/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 66: /***/ ((module) => { "use strict"; var isMergeableObject = function isMergeableObject(value) { return isNonNullObject(value) && !isSpecial(value) }; function isNonNullObject(value) { return !!value && typeof value === 'object' } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value) } // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 var canUseSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE } function emptyTarget(val) { return Array.isArray(val) ? [] : {} } function cloneUnlessOtherwiseSpecified(value, options) { return (options.clone !== false && options.isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, options) : value } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options) }) } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge } var customMerge = options.customMerge(key); return typeof customMerge === 'function' ? customMerge : deepmerge } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol) }) : [] } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)) } function propertyIsOnObject(object, property) { try { return property in object } catch(_) { return false } } // Protects from prototype poisoning and unexpected merging up the prototype chain. function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination } function deepmerge(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() // implementations can use it. The caller may not replace it. options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options) } else if (sourceIsArray) { return options.arrayMerge(target, source, options) } else { return mergeObject(target, source, options) } } deepmerge.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error('first argument should be an array') } return array.reduce(function(prev, next) { return deepmerge(prev, next, options) }, {}) }; var deepmerge_1 = deepmerge; module.exports = deepmerge_1; /***/ }), /***/ 7734: /***/ ((module) => { "use strict"; // do not edit .js files directly - edit src/index.jst var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if ((a instanceof Map) && (b instanceof Map)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false; return true; } if ((a instanceof Set) && (b instanceof Set)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; return true; } if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /***/ }), /***/ 8924: /***/ ((__unused_webpack_module, exports) => { // Copyright (c) 2014 Rafael Caricio. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. var GradientParser = {}; GradientParser.parse = (function() { var tokens = { linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i, repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i, radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i, repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i, sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i, extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/, positionKeywords: /^(left|center|right|top|bottom)/i, pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/, percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/, emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/, angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/, startCall: /^\(/, endCall: /^\)/, comma: /^,/, hexColor: /^\#([0-9a-fA-F]+)/, literalColor: /^([a-zA-Z]+)/, rgbColor: /^rgb/i, rgbaColor: /^rgba/i, number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/ }; var input = ''; function error(msg) { var err = new Error(input + ': ' + msg); err.source = input; throw err; } function getAST() { var ast = matchListDefinitions(); if (input.length > 0) { error('Invalid input not EOF'); } return ast; } function matchListDefinitions() { return matchListing(matchDefinition); } function matchDefinition() { return matchGradient( 'linear-gradient', tokens.linearGradient, matchLinearOrientation) || matchGradient( 'repeating-linear-gradient', tokens.repeatingLinearGradient, matchLinearOrientation) || matchGradient( 'radial-gradient', tokens.radialGradient, matchListRadialOrientations) || matchGradient( 'repeating-radial-gradient', tokens.repeatingRadialGradient, matchListRadialOrientations); } function matchGradient(gradientType, pattern, orientationMatcher) { return matchCall(pattern, function(captures) { var orientation = orientationMatcher(); if (orientation) { if (!scan(tokens.comma)) { error('Missing comma before color stops'); } } return { type: gradientType, orientation: orientation, colorStops: matchListing(matchColorStop) }; }); } function matchCall(pattern, callback) { var captures = scan(pattern); if (captures) { if (!scan(tokens.startCall)) { error('Missing ('); } result = callback(captures); if (!scan(tokens.endCall)) { error('Missing )'); } return result; } } function matchLinearOrientation() { return matchSideOrCorner() || matchAngle(); } function matchSideOrCorner() { return match('directional', tokens.sideOrCorner, 1); } function matchAngle() { return match('angular', tokens.angleValue, 1); } function matchListRadialOrientations() { var radialOrientations, radialOrientation = matchRadialOrientation(), lookaheadCache; if (radialOrientation) { radialOrientations = []; radialOrientations.push(radialOrientation); lookaheadCache = input; if (scan(tokens.comma)) { radialOrientation = matchRadialOrientation(); if (radialOrientation) { radialOrientations.push(radialOrientation); } else { input = lookaheadCache; } } } return radialOrientations; } function matchRadialOrientation() { var radialType = matchCircle() || matchEllipse(); if (radialType) { radialType.at = matchAtPosition(); } else { var defaultPosition = matchPositioning(); if (defaultPosition) { radialType = { type: 'default-radial', at: defaultPosition }; } } return radialType; } function matchCircle() { var circle = match('shape', /^(circle)/i, 0); if (circle) { circle.style = matchLength() || matchExtentKeyword(); } return circle; } function matchEllipse() { var ellipse = match('shape', /^(ellipse)/i, 0); if (ellipse) { ellipse.style = matchDistance() || matchExtentKeyword(); } return ellipse; } function matchExtentKeyword() { return match('extent-keyword', tokens.extentKeywords, 1); } function matchAtPosition() { if (match('position', /^at/, 0)) { var positioning = matchPositioning(); if (!positioning) { error('Missing positioning value'); } return positioning; } } function matchPositioning() { var location = matchCoordinates(); if (location.x || location.y) { return { type: 'position', value: location }; } } function matchCoordinates() { return { x: matchDistance(), y: matchDistance() }; } function matchListing(matcher) { var captures = matcher(), result = []; if (captures) { result.push(captures); while (scan(tokens.comma)) { captures = matcher(); if (captures) { result.push(captures); } else { error('One extra comma'); } } } return result; } function matchColorStop() { var color = matchColor(); if (!color) { error('Expected color definition'); } color.length = matchDistance(); return color; } function matchColor() { return matchHexColor() || matchRGBAColor() || matchRGBColor() || matchLiteralColor(); } function matchLiteralColor() { return match('literal', tokens.literalColor, 0); } function matchHexColor() { return match('hex', tokens.hexColor, 1); } function matchRGBColor() { return matchCall(tokens.rgbColor, function() { return { type: 'rgb', value: matchListing(matchNumber) }; }); } function matchRGBAColor() { return matchCall(tokens.rgbaColor, function() { return { type: 'rgba', value: matchListing(matchNumber) }; }); } function matchNumber() { return scan(tokens.number)[1]; } function matchDistance() { return match('%', tokens.percentageValue, 1) || matchPositionKeyword() || matchLength(); } function matchPositionKeyword() { return match('position-keyword', tokens.positionKeywords, 1); } function matchLength() { return match('px', tokens.pixelValue, 1) || match('em', tokens.emValue, 1); } function match(type, pattern, captureIndex) { var captures = scan(pattern); if (captures) { return { type: type, value: captures[captureIndex] }; } } function scan(regexp) { var captures, blankCaptures; blankCaptures = /^[\n\r\t\s]+/.exec(input); if (blankCaptures) { consume(blankCaptures[0].length); } captures = regexp.exec(input); if (captures) { consume(captures[0].length); } return captures; } function consume(size) { input = input.substr(size); } return function(code) { input = code.toString(); return getAST(); }; })(); exports.parse = (GradientParser || {}).parse; /***/ }), /***/ 9664: /***/ ((module) => { module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __nested_webpack_require_187__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __nested_webpack_require_187__.m = modules; /******/ /******/ // expose the module cache /******/ __nested_webpack_require_187__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __nested_webpack_require_187__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __nested_webpack_require_187__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __nested_webpack_require_1468__) { module.exports = __nested_webpack_require_1468__(1); /***/ }), /* 1 */ /***/ (function(module, exports, __nested_webpack_require_1587__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _utils = __nested_webpack_require_1587__(2); Object.defineProperty(exports, 'combineChunks', { enumerable: true, get: function get() { return _utils.combineChunks; } }); Object.defineProperty(exports, 'fillInChunks', { enumerable: true, get: function get() { return _utils.fillInChunks; } }); Object.defineProperty(exports, 'findAll', { enumerable: true, get: function get() { return _utils.findAll; } }); Object.defineProperty(exports, 'findChunks', { enumerable: true, get: function get() { return _utils.findChunks; } }); /***/ }), /* 2 */ /***/ (function(module, exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); /** * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) */ var findAll = exports.findAll = function findAll(_ref) { var autoEscape = _ref.autoEscape, _ref$caseSensitive = _ref.caseSensitive, caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive, _ref$findChunks = _ref.findChunks, findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks, sanitize = _ref.sanitize, searchWords = _ref.searchWords, textToHighlight = _ref.textToHighlight; return fillInChunks({ chunksToHighlight: combineChunks({ chunks: findChunks({ autoEscape: autoEscape, caseSensitive: caseSensitive, sanitize: sanitize, searchWords: searchWords, textToHighlight: textToHighlight }) }), totalLength: textToHighlight ? textToHighlight.length : 0 }); }; /** * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. * @return {start:number, end:number}[] */ var combineChunks = exports.combineChunks = function combineChunks(_ref2) { var chunks = _ref2.chunks; chunks = chunks.sort(function (first, second) { return first.start - second.start; }).reduce(function (processedChunks, nextChunk) { // First chunk just goes straight in the array... if (processedChunks.length === 0) { return [nextChunk]; } else { // ... subsequent chunks get checked to see if they overlap... var prevChunk = processedChunks.pop(); if (nextChunk.start <= prevChunk.end) { // It may be the case that prevChunk completely surrounds nextChunk, so take the // largest of the end indeces. var endIndex = Math.max(prevChunk.end, nextChunk.end); processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex }); } else { processedChunks.push(prevChunk, nextChunk); } return processedChunks; } }, []); return chunks; }; /** * Examine text for any matches. * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). * @return {start:number, end:number}[] */ var defaultFindChunks = function defaultFindChunks(_ref3) { var autoEscape = _ref3.autoEscape, caseSensitive = _ref3.caseSensitive, _ref3$sanitize = _ref3.sanitize, sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize, searchWords = _ref3.searchWords, textToHighlight = _ref3.textToHighlight; textToHighlight = sanitize(textToHighlight); return searchWords.filter(function (searchWord) { return searchWord; }) // Remove empty words .reduce(function (chunks, searchWord) { searchWord = sanitize(searchWord); if (autoEscape) { searchWord = escapeRegExpFn(searchWord); } var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi'); var match = void 0; while (match = regex.exec(textToHighlight)) { var _start = match.index; var _end = regex.lastIndex; // We do not return zero-length matches if (_end > _start) { chunks.push({ highlight: false, start: _start, end: _end }); } // Prevent browsers like Firefox from getting stuck in an infinite loop // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/ if (match.index === regex.lastIndex) { regex.lastIndex++; } } return chunks; }, []); }; // Allow the findChunks to be overridden in findAll, // but for backwards compatibility we export as the old name exports.findChunks = defaultFindChunks; /** * Given a set of chunks to highlight, create an additional set of chunks * to represent the bits of text between the highlighted text. * @param chunksToHighlight {start:number, end:number}[] * @param totalLength number * @return {start:number, end:number, highlight:boolean}[] */ var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) { var chunksToHighlight = _ref4.chunksToHighlight, totalLength = _ref4.totalLength; var allChunks = []; var append = function append(start, end, highlight) { if (end - start > 0) { allChunks.push({ start: start, end: end, highlight: highlight }); } }; if (chunksToHighlight.length === 0) { append(0, totalLength, false); } else { var lastIndex = 0; chunksToHighlight.forEach(function (chunk) { append(lastIndex, chunk.start, false); append(chunk.start, chunk.end, true); lastIndex = chunk.end; }); append(lastIndex, totalLength, false); } return allChunks; }; function defaultSanitize(string) { return string; } function escapeRegExpFn(string) { return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); } /***/ }) /******/ ]); /***/ }), /***/ 1880: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var reactIs = __webpack_require__(1178); /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var FORWARD_REF_STATICS = { '$$typeof': true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { '$$typeof': true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; function getStatics(component) { // React v16.11 and below if (reactIs.isMemo(component)) { return MEMO_STATICS; } // React v16.12 and above return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } } return targetComponent; } module.exports = hoistNonReactStatics; /***/ }), /***/ 2950: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; /***/ }), /***/ 1178: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(2950); } else {} /***/ }), /***/ 9681: /***/ ((module) => { var characterMap = { "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "Ấ": "A", "Ắ": "A", "Ẳ": "A", "Ẵ": "A", "Ặ": "A", "Æ": "AE", "Ầ": "A", "Ằ": "A", "Ȃ": "A", "Ả": "A", "Ạ": "A", "Ẩ": "A", "Ẫ": "A", "Ậ": "A", "Ç": "C", "Ḉ": "C", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "Ế": "E", "Ḗ": "E", "Ề": "E", "Ḕ": "E", "Ḝ": "E", "Ȇ": "E", "Ẻ": "E", "Ẽ": "E", "Ẹ": "E", "Ể": "E", "Ễ": "E", "Ệ": "E", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "Ḯ": "I", "Ȋ": "I", "Ỉ": "I", "Ị": "I", "Ð": "D", "Ñ": "N", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "Ố": "O", "Ṍ": "O", "Ṓ": "O", "Ȏ": "O", "Ỏ": "O", "Ọ": "O", "Ổ": "O", "Ỗ": "O", "Ộ": "O", "Ờ": "O", "Ở": "O", "Ỡ": "O", "Ớ": "O", "Ợ": "O", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "Ủ": "U", "Ụ": "U", "Ử": "U", "Ữ": "U", "Ự": "U", "Ý": "Y", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "ấ": "a", "ắ": "a", "ẳ": "a", "ẵ": "a", "ặ": "a", "æ": "ae", "ầ": "a", "ằ": "a", "ȃ": "a", "ả": "a", "ạ": "a", "ẩ": "a", "ẫ": "a", "ậ": "a", "ç": "c", "ḉ": "c", "è": "e", "é": "e", "ê": "e", "ë": "e", "ế": "e", "ḗ": "e", "ề": "e", "ḕ": "e", "ḝ": "e", "ȇ": "e", "ẻ": "e", "ẽ": "e", "ẹ": "e", "ể": "e", "ễ": "e", "ệ": "e", "ì": "i", "í": "i", "î": "i", "ï": "i", "ḯ": "i", "ȋ": "i", "ỉ": "i", "ị": "i", "ð": "d", "ñ": "n", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "ố": "o", "ṍ": "o", "ṓ": "o", "ȏ": "o", "ỏ": "o", "ọ": "o", "ổ": "o", "ỗ": "o", "ộ": "o", "ờ": "o", "ở": "o", "ỡ": "o", "ớ": "o", "ợ": "o", "ù": "u", "ú": "u", "û": "u", "ü": "u", "ủ": "u", "ụ": "u", "ử": "u", "ữ": "u", "ự": "u", "ý": "y", "ÿ": "y", "Ā": "A", "ā": "a", "Ă": "A", "ă": "a", "Ą": "A", "ą": "a", "Ć": "C", "ć": "c", "Ĉ": "C", "ĉ": "c", "Ċ": "C", "ċ": "c", "Č": "C", "č": "c", "C̆": "C", "c̆": "c", "Ď": "D", "ď": "d", "Đ": "D", "đ": "d", "Ē": "E", "ē": "e", "Ĕ": "E", "ĕ": "e", "Ė": "E", "ė": "e", "Ę": "E", "ę": "e", "Ě": "E", "ě": "e", "Ĝ": "G", "Ǵ": "G", "ĝ": "g", "ǵ": "g", "Ğ": "G", "ğ": "g", "Ġ": "G", "ġ": "g", "Ģ": "G", "ģ": "g", "Ĥ": "H", "ĥ": "h", "Ħ": "H", "ħ": "h", "Ḫ": "H", "ḫ": "h", "Ĩ": "I", "ĩ": "i", "Ī": "I", "ī": "i", "Ĭ": "I", "ĭ": "i", "Į": "I", "į": "i", "İ": "I", "ı": "i", "IJ": "IJ", "ij": "ij", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "Ḱ": "K", "ḱ": "k", "K̆": "K", "k̆": "k", "Ĺ": "L", "ĺ": "l", "Ļ": "L", "ļ": "l", "Ľ": "L", "ľ": "l", "Ŀ": "L", "ŀ": "l", "Ł": "l", "ł": "l", "Ḿ": "M", "ḿ": "m", "M̆": "M", "m̆": "m", "Ń": "N", "ń": "n", "Ņ": "N", "ņ": "n", "Ň": "N", "ň": "n", "ʼn": "n", "N̆": "N", "n̆": "n", "Ō": "O", "ō": "o", "Ŏ": "O", "ŏ": "o", "Ő": "O", "ő": "o", "Œ": "OE", "œ": "oe", "P̆": "P", "p̆": "p", "Ŕ": "R", "ŕ": "r", "Ŗ": "R", "ŗ": "r", "Ř": "R", "ř": "r", "R̆": "R", "r̆": "r", "Ȓ": "R", "ȓ": "r", "Ś": "S", "ś": "s", "Ŝ": "S", "ŝ": "s", "Ş": "S", "Ș": "S", "ș": "s", "ş": "s", "Š": "S", "š": "s", "Ţ": "T", "ţ": "t", "ț": "t", "Ț": "T", "Ť": "T", "ť": "t", "Ŧ": "T", "ŧ": "t", "T̆": "T", "t̆": "t", "Ũ": "U", "ũ": "u", "Ū": "U", "ū": "u", "Ŭ": "U", "ŭ": "u", "Ů": "U", "ů": "u", "Ű": "U", "ű": "u", "Ų": "U", "ų": "u", "Ȗ": "U", "ȗ": "u", "V̆": "V", "v̆": "v", "Ŵ": "W", "ŵ": "w", "Ẃ": "W", "ẃ": "w", "X̆": "X", "x̆": "x", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Y̆": "Y", "y̆": "y", "Ź": "Z", "ź": "z", "Ż": "Z", "ż": "z", "Ž": "Z", "ž": "z", "ſ": "s", "ƒ": "f", "Ơ": "O", "ơ": "o", "Ư": "U", "ư": "u", "Ǎ": "A", "ǎ": "a", "Ǐ": "I", "ǐ": "i", "Ǒ": "O", "ǒ": "o", "Ǔ": "U", "ǔ": "u", "Ǖ": "U", "ǖ": "u", "Ǘ": "U", "ǘ": "u", "Ǚ": "U", "ǚ": "u", "Ǜ": "U", "ǜ": "u", "Ứ": "U", "ứ": "u", "Ṹ": "U", "ṹ": "u", "Ǻ": "A", "ǻ": "a", "Ǽ": "AE", "ǽ": "ae", "Ǿ": "O", "ǿ": "o", "Þ": "TH", "þ": "th", "Ṕ": "P", "ṕ": "p", "Ṥ": "S", "ṥ": "s", "X́": "X", "x́": "x", "Ѓ": "Г", "ѓ": "г", "Ќ": "К", "ќ": "к", "A̋": "A", "a̋": "a", "E̋": "E", "e̋": "e", "I̋": "I", "i̋": "i", "Ǹ": "N", "ǹ": "n", "Ồ": "O", "ồ": "o", "Ṑ": "O", "ṑ": "o", "Ừ": "U", "ừ": "u", "Ẁ": "W", "ẁ": "w", "Ỳ": "Y", "ỳ": "y", "Ȁ": "A", "ȁ": "a", "Ȅ": "E", "ȅ": "e", "Ȉ": "I", "ȉ": "i", "Ȍ": "O", "ȍ": "o", "Ȑ": "R", "ȑ": "r", "Ȕ": "U", "ȕ": "u", "B̌": "B", "b̌": "b", "Č̣": "C", "č̣": "c", "Ê̌": "E", "ê̌": "e", "F̌": "F", "f̌": "f", "Ǧ": "G", "ǧ": "g", "Ȟ": "H", "ȟ": "h", "J̌": "J", "ǰ": "j", "Ǩ": "K", "ǩ": "k", "M̌": "M", "m̌": "m", "P̌": "P", "p̌": "p", "Q̌": "Q", "q̌": "q", "Ř̩": "R", "ř̩": "r", "Ṧ": "S", "ṧ": "s", "V̌": "V", "v̌": "v", "W̌": "W", "w̌": "w", "X̌": "X", "x̌": "x", "Y̌": "Y", "y̌": "y", "A̧": "A", "a̧": "a", "B̧": "B", "b̧": "b", "Ḑ": "D", "ḑ": "d", "Ȩ": "E", "ȩ": "e", "Ɛ̧": "E", "ɛ̧": "e", "Ḩ": "H", "ḩ": "h", "I̧": "I", "i̧": "i", "Ɨ̧": "I", "ɨ̧": "i", "M̧": "M", "m̧": "m", "O̧": "O", "o̧": "o", "Q̧": "Q", "q̧": "q", "U̧": "U", "u̧": "u", "X̧": "X", "x̧": "x", "Z̧": "Z", "z̧": "z", "й":"и", "Й":"И", "ё":"е", "Ё":"Е", }; var chars = Object.keys(characterMap).join('|'); var allAccents = new RegExp(chars, 'g'); var firstAccent = new RegExp(chars, ''); function matcher(match) { return characterMap[match]; } var removeAccents = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents; module.exports.has = hasAccents; module.exports.remove = removeAccents; /***/ }), /***/ 8477: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var e=__webpack_require__(1609);function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u; /***/ }), /***/ 422: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(8477); } else {} /***/ }), /***/ 1609: /***/ ((module) => { "use strict"; module.exports = window["React"]; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 16: return value when it's Promise-like /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = this(value); /******/ if(mode & 8) return value; /******/ if(typeof value === 'object' && value) { /******/ if((mode & 4) && value.__esModule) return value; /******/ if((mode & 16) && typeof value.then === 'function') return value; /******/ } /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } /******/ def['default'] = () => (value); /******/ __webpack_require__.d(ns, def); /******/ return ns; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/nonce */ /******/ (() => { /******/ __webpack_require__.nc = undefined; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { AlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control), AnglePickerControl: () => (/* reexport */ angle_picker_control), Animate: () => (/* reexport */ animate), Autocomplete: () => (/* reexport */ Autocomplete), BaseControl: () => (/* reexport */ base_control), BlockQuotation: () => (/* reexport */ external_wp_primitives_namespaceObject.BlockQuotation), Button: () => (/* reexport */ build_module_button), ButtonGroup: () => (/* reexport */ button_group), Card: () => (/* reexport */ card_component), CardBody: () => (/* reexport */ card_body_component), CardDivider: () => (/* reexport */ card_divider_component), CardFooter: () => (/* reexport */ card_footer_component), CardHeader: () => (/* reexport */ card_header_component), CardMedia: () => (/* reexport */ card_media_component), CheckboxControl: () => (/* reexport */ checkbox_control), Circle: () => (/* reexport */ external_wp_primitives_namespaceObject.Circle), ClipboardButton: () => (/* reexport */ ClipboardButton), ColorIndicator: () => (/* reexport */ color_indicator), ColorPalette: () => (/* reexport */ color_palette), ColorPicker: () => (/* reexport */ LegacyAdapter), ComboboxControl: () => (/* reexport */ combobox_control), Composite: () => (/* reexport */ Composite), CustomGradientPicker: () => (/* reexport */ custom_gradient_picker), CustomSelectControl: () => (/* reexport */ custom_select_control), Dashicon: () => (/* reexport */ dashicon), DatePicker: () => (/* reexport */ date), DateTimePicker: () => (/* reexport */ build_module_date_time), Disabled: () => (/* reexport */ disabled), Draggable: () => (/* reexport */ draggable), DropZone: () => (/* reexport */ drop_zone), DropZoneProvider: () => (/* reexport */ DropZoneProvider), Dropdown: () => (/* reexport */ dropdown), DropdownMenu: () => (/* reexport */ dropdown_menu), DuotonePicker: () => (/* reexport */ duotone_picker), DuotoneSwatch: () => (/* reexport */ duotone_swatch), ExternalLink: () => (/* reexport */ external_link), Fill: () => (/* reexport */ slot_fill_Fill), Flex: () => (/* reexport */ flex_component), FlexBlock: () => (/* reexport */ flex_block_component), FlexItem: () => (/* reexport */ flex_item_component), FocalPointPicker: () => (/* reexport */ focal_point_picker), FocusReturnProvider: () => (/* reexport */ with_focus_return_Provider), FocusableIframe: () => (/* reexport */ FocusableIframe), FontSizePicker: () => (/* reexport */ font_size_picker), FormFileUpload: () => (/* reexport */ form_file_upload), FormToggle: () => (/* reexport */ form_toggle), FormTokenField: () => (/* reexport */ form_token_field), G: () => (/* reexport */ external_wp_primitives_namespaceObject.G), GradientPicker: () => (/* reexport */ gradient_picker), Guide: () => (/* reexport */ guide), GuidePage: () => (/* reexport */ GuidePage), HorizontalRule: () => (/* reexport */ external_wp_primitives_namespaceObject.HorizontalRule), Icon: () => (/* reexport */ build_module_icon), IconButton: () => (/* reexport */ deprecated), IsolatedEventContainer: () => (/* reexport */ isolated_event_container), KeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts), Line: () => (/* reexport */ external_wp_primitives_namespaceObject.Line), MenuGroup: () => (/* reexport */ menu_group), MenuItem: () => (/* reexport */ menu_item), MenuItemsChoice: () => (/* reexport */ menu_items_choice), Modal: () => (/* reexport */ modal), NavigableMenu: () => (/* reexport */ navigable_container_menu), Notice: () => (/* reexport */ build_module_notice), NoticeList: () => (/* reexport */ list), Panel: () => (/* reexport */ panel), PanelBody: () => (/* reexport */ body), PanelHeader: () => (/* reexport */ panel_header), PanelRow: () => (/* reexport */ row), Path: () => (/* reexport */ external_wp_primitives_namespaceObject.Path), Placeholder: () => (/* reexport */ placeholder), Polygon: () => (/* reexport */ external_wp_primitives_namespaceObject.Polygon), Popover: () => (/* reexport */ popover), ProgressBar: () => (/* reexport */ progress_bar), QueryControls: () => (/* reexport */ query_controls), RadioControl: () => (/* reexport */ radio_control), RangeControl: () => (/* reexport */ range_control), Rect: () => (/* reexport */ external_wp_primitives_namespaceObject.Rect), ResizableBox: () => (/* reexport */ resizable_box), ResponsiveWrapper: () => (/* reexport */ responsive_wrapper), SVG: () => (/* reexport */ external_wp_primitives_namespaceObject.SVG), SandBox: () => (/* reexport */ sandbox), ScrollLock: () => (/* reexport */ scroll_lock), SearchControl: () => (/* reexport */ search_control), SelectControl: () => (/* reexport */ select_control), Slot: () => (/* reexport */ slot_fill_Slot), SlotFillProvider: () => (/* reexport */ Provider), Snackbar: () => (/* reexport */ snackbar), SnackbarList: () => (/* reexport */ snackbar_list), Spinner: () => (/* reexport */ spinner), TabPanel: () => (/* reexport */ tab_panel), TabbableContainer: () => (/* reexport */ tabbable), TextControl: () => (/* reexport */ text_control), TextHighlight: () => (/* reexport */ text_highlight), TextareaControl: () => (/* reexport */ textarea_control), TimePicker: () => (/* reexport */ date_time_time), Tip: () => (/* reexport */ build_module_tip), ToggleControl: () => (/* reexport */ toggle_control), Toolbar: () => (/* reexport */ toolbar), ToolbarButton: () => (/* reexport */ toolbar_button), ToolbarDropdownMenu: () => (/* reexport */ toolbar_dropdown_menu), ToolbarGroup: () => (/* reexport */ toolbar_group), ToolbarItem: () => (/* reexport */ toolbar_item), Tooltip: () => (/* reexport */ tooltip), TreeSelect: () => (/* reexport */ tree_select), VisuallyHidden: () => (/* reexport */ visually_hidden_component), __experimentalAlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control), __experimentalApplyValueToSides: () => (/* reexport */ applyValueToSides), __experimentalBorderBoxControl: () => (/* reexport */ border_box_control_component), __experimentalBorderControl: () => (/* reexport */ border_control_component), __experimentalBoxControl: () => (/* reexport */ box_control), __experimentalConfirmDialog: () => (/* reexport */ confirm_dialog_component), __experimentalDimensionControl: () => (/* reexport */ dimension_control), __experimentalDivider: () => (/* reexport */ divider_component), __experimentalDropdownContentWrapper: () => (/* reexport */ dropdown_content_wrapper), __experimentalElevation: () => (/* reexport */ elevation_component), __experimentalGrid: () => (/* reexport */ grid_component), __experimentalHStack: () => (/* reexport */ h_stack_component), __experimentalHasSplitBorders: () => (/* reexport */ hasSplitBorders), __experimentalHeading: () => (/* reexport */ heading_component), __experimentalInputControl: () => (/* reexport */ input_control), __experimentalInputControlPrefixWrapper: () => (/* reexport */ input_prefix_wrapper), __experimentalInputControlSuffixWrapper: () => (/* reexport */ input_suffix_wrapper), __experimentalIsDefinedBorder: () => (/* reexport */ isDefinedBorder), __experimentalIsEmptyBorder: () => (/* reexport */ isEmptyBorder), __experimentalItem: () => (/* reexport */ item_component), __experimentalItemGroup: () => (/* reexport */ item_group_component), __experimentalNavigation: () => (/* reexport */ navigation), __experimentalNavigationBackButton: () => (/* reexport */ back_button), __experimentalNavigationGroup: () => (/* reexport */ group), __experimentalNavigationItem: () => (/* reexport */ navigation_item), __experimentalNavigationMenu: () => (/* reexport */ navigation_menu), __experimentalNavigatorBackButton: () => (/* reexport */ NavigatorBackButton), __experimentalNavigatorButton: () => (/* reexport */ NavigatorButton), __experimentalNavigatorProvider: () => (/* reexport */ NavigatorProvider), __experimentalNavigatorScreen: () => (/* reexport */ NavigatorScreen), __experimentalNavigatorToParentButton: () => (/* reexport */ NavigatorToParentButton), __experimentalNumberControl: () => (/* reexport */ number_control), __experimentalPaletteEdit: () => (/* reexport */ palette_edit), __experimentalParseQuantityAndUnitFromRawValue: () => (/* reexport */ parseQuantityAndUnitFromRawValue), __experimentalRadio: () => (/* reexport */ radio_group_radio), __experimentalRadioGroup: () => (/* reexport */ radio_group), __experimentalScrollable: () => (/* reexport */ scrollable_component), __experimentalSpacer: () => (/* reexport */ spacer_component), __experimentalStyleProvider: () => (/* reexport */ style_provider), __experimentalSurface: () => (/* reexport */ surface_component), __experimentalText: () => (/* reexport */ text_component), __experimentalToggleGroupControl: () => (/* reexport */ toggle_group_control_component), __experimentalToggleGroupControlOption: () => (/* reexport */ toggle_group_control_option_component), __experimentalToggleGroupControlOptionIcon: () => (/* reexport */ toggle_group_control_option_icon_component), __experimentalToolbarContext: () => (/* reexport */ toolbar_context), __experimentalToolsPanel: () => (/* reexport */ tools_panel_component), __experimentalToolsPanelContext: () => (/* reexport */ ToolsPanelContext), __experimentalToolsPanelItem: () => (/* reexport */ tools_panel_item_component), __experimentalTreeGrid: () => (/* reexport */ tree_grid), __experimentalTreeGridCell: () => (/* reexport */ cell), __experimentalTreeGridItem: () => (/* reexport */ tree_grid_item), __experimentalTreeGridRow: () => (/* reexport */ tree_grid_row), __experimentalTruncate: () => (/* reexport */ truncate_component), __experimentalUnitControl: () => (/* reexport */ unit_control), __experimentalUseCustomUnits: () => (/* reexport */ useCustomUnits), __experimentalUseNavigator: () => (/* reexport */ useNavigator), __experimentalUseSlot: () => (/* reexport */ useSlot), __experimentalUseSlotFills: () => (/* reexport */ useSlotFills), __experimentalVStack: () => (/* reexport */ v_stack_component), __experimentalView: () => (/* reexport */ component), __experimentalZStack: () => (/* reexport */ z_stack_component), __unstableAnimatePresence: () => (/* reexport */ AnimatePresence), __unstableComposite: () => (/* reexport */ legacy_Composite), __unstableCompositeGroup: () => (/* reexport */ legacy_CompositeGroup), __unstableCompositeItem: () => (/* reexport */ legacy_CompositeItem), __unstableDisclosureContent: () => (/* reexport */ disclosure_DisclosureContent), __unstableGetAnimateClassName: () => (/* reexport */ getAnimateClassName), __unstableMotion: () => (/* reexport */ motion), __unstableMotionContext: () => (/* reexport */ MotionContext), __unstableUseAutocompleteProps: () => (/* reexport */ useAutocompleteProps), __unstableUseCompositeState: () => (/* reexport */ useCompositeState), __unstableUseNavigateRegions: () => (/* reexport */ useNavigateRegions), createSlotFill: () => (/* reexport */ createSlotFill), navigateRegions: () => (/* reexport */ navigate_regions), privateApis: () => (/* reexport */ privateApis), useBaseControlProps: () => (/* reexport */ useBaseControlProps), withConstrainedTabbing: () => (/* reexport */ with_constrained_tabbing), withFallbackStyles: () => (/* reexport */ with_fallback_styles), withFilters: () => (/* reexport */ withFilters), withFocusOutside: () => (/* reexport */ with_focus_outside), withFocusReturn: () => (/* reexport */ with_focus_return), withNotices: () => (/* reexport */ with_notices), withSpokenMessages: () => (/* reexport */ with_spoken_messages) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js var text_styles_namespaceObject = {}; __webpack_require__.r(text_styles_namespaceObject); __webpack_require__.d(text_styles_namespaceObject, { Text: () => (Text), block: () => (styles_block), destructive: () => (destructive), highlighterText: () => (highlighterText), muted: () => (muted), positive: () => (positive), upperCase: () => (upperCase) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js var toggle_group_control_option_base_styles_namespaceObject = {}; __webpack_require__.r(toggle_group_control_option_base_styles_namespaceObject); __webpack_require__.d(toggle_group_control_option_base_styles_namespaceObject, { ButtonContentView: () => (ButtonContentView), LabelView: () => (LabelView), ou: () => (backdropView), uG: () => (buttonView), eh: () => (labelBlock) }); ;// CONCATENATED MODULE: external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var _3YLGPPWQ_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var _3YLGPPWQ_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/3YLGPPWQ.js "use client"; var _3YLGPPWQ_defProp = Object.defineProperty; var _3YLGPPWQ_defProps = Object.defineProperties; var _3YLGPPWQ_getOwnPropDescs = Object.getOwnPropertyDescriptors; var _3YLGPPWQ_getOwnPropSymbols = Object.getOwnPropertySymbols; var _3YLGPPWQ_hasOwnProp = Object.prototype.hasOwnProperty; var _3YLGPPWQ_propIsEnum = Object.prototype.propertyIsEnumerable; var _3YLGPPWQ_defNormalProp = (obj, key, value) => key in obj ? _3YLGPPWQ_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var _chunks_3YLGPPWQ_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (_3YLGPPWQ_hasOwnProp.call(b, prop)) _3YLGPPWQ_defNormalProp(a, prop, b[prop]); if (_3YLGPPWQ_getOwnPropSymbols) for (var prop of _3YLGPPWQ_getOwnPropSymbols(b)) { if (_3YLGPPWQ_propIsEnum.call(b, prop)) _3YLGPPWQ_defNormalProp(a, prop, b[prop]); } return a; }; var _chunks_3YLGPPWQ_spreadProps = (a, b) => _3YLGPPWQ_defProps(a, _3YLGPPWQ_getOwnPropDescs(b)); var _3YLGPPWQ_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (_3YLGPPWQ_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && _3YLGPPWQ_getOwnPropSymbols) for (var prop of _3YLGPPWQ_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && _3YLGPPWQ_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/PBFD2E7P.js "use client"; // src/utils/misc.ts function noop(..._) { } function shallowEqual(a, b) { if (a === b) return true; if (!a) return false; if (!b) return false; if (typeof a !== "object") return false; if (typeof b !== "object") return false; const aKeys = Object.keys(a); const bKeys = Object.keys(b); const { length } = aKeys; if (bKeys.length !== length) return false; for (const key of aKeys) { if (a[key] !== b[key]) { return false; } } return true; } function applyState(argument, currentValue) { if (isUpdater(argument)) { const value = isLazyValue(currentValue) ? currentValue() : currentValue; return argument(value); } return argument; } function isUpdater(argument) { return typeof argument === "function"; } function isLazyValue(value) { return typeof value === "function"; } function isObject(arg) { return typeof arg === "object" && arg != null; } function isEmpty(arg) { if (Array.isArray(arg)) return !arg.length; if (isObject(arg)) return !Object.keys(arg).length; if (arg == null) return true; if (arg === "") return true; return false; } function isInteger(arg) { if (typeof arg === "number") { return Math.floor(arg) === arg; } return String(Math.floor(Number(arg))) === arg; } function PBFD2E7P_hasOwnProperty(object, prop) { if (typeof Object.hasOwn === "function") { return Object.hasOwn(object, prop); } return Object.prototype.hasOwnProperty.call(object, prop); } function chain(...fns) { return (...args) => { for (const fn of fns) { if (typeof fn === "function") { fn(...args); } } }; } function cx(...args) { return args.filter(Boolean).join(" ") || void 0; } function normalizeString(str) { return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); } function omit(object, keys) { const result = _chunks_3YLGPPWQ_spreadValues({}, object); for (const key of keys) { if (PBFD2E7P_hasOwnProperty(result, key)) { delete result[key]; } } return result; } function pick(object, paths) { const result = {}; for (const key of paths) { if (PBFD2E7P_hasOwnProperty(object, key)) { result[key] = object[key]; } } return result; } function identity(value) { return value; } function beforePaint(cb = noop) { const raf = requestAnimationFrame(cb); return () => cancelAnimationFrame(raf); } function afterPaint(cb = noop) { let raf = requestAnimationFrame(() => { raf = requestAnimationFrame(cb); }); return () => cancelAnimationFrame(raf); } function invariant(condition, message) { if (condition) return; if (typeof message !== "string") throw new Error("Invariant failed"); throw new Error(message); } function getKeys(obj) { return Object.keys(obj); } function isFalsyBooleanCallback(booleanOrCallback, ...args) { const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback; if (result == null) return false; return !result; } function disabledFromProps(props) { return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; } function removeUndefinedValues(obj) { const result = {}; for (const key in obj) { if (obj[key] !== void 0) { result[key] = obj[key]; } } return result; } function defaultValue(...values) { for (const value of values) { if (value !== void 0) return value; } return void 0; } // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(1609); var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SK3NAZA3.js "use client"; // src/utils/misc.ts function setRef(ref, value) { if (typeof ref === "function") { ref(value); } else if (ref) { ref.current = value; } } function isValidElementWithRef(element) { if (!element) return false; if (!(0,external_React_.isValidElement)(element)) return false; if ("ref" in element.props) return true; if ("ref" in element) return true; return false; } function getRefProperty(element) { if (!isValidElementWithRef(element)) return null; const props = _3YLGPPWQ_spreadValues({}, element.props); return props.ref || element.ref; } function mergeProps(base, overrides) { const props = _3YLGPPWQ_spreadValues({}, base); for (const key in overrides) { if (!PBFD2E7P_hasOwnProperty(overrides, key)) continue; if (key === "className") { const prop = "className"; props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop]; continue; } if (key === "style") { const prop = "style"; props[prop] = base[prop] ? _3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop]; continue; } const overrideValue = overrides[key]; if (typeof overrideValue === "function" && key.startsWith("on")) { const baseValue = base[key]; if (typeof baseValue === "function") { props[key] = (...args) => { overrideValue(...args); baseValue(...args); }; continue; } } props[key] = overrideValue; } return props; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/HWOIWM4O.js "use client"; // src/utils/dom.ts var canUseDOM = checkIsBrowser(); function checkIsBrowser() { var _a; return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); } function getDocument(node) { return node ? node.ownerDocument || node : document; } function getWindow(node) { return getDocument(node).defaultView || window; } function getActiveElement(node, activeDescendant = false) { const { activeElement } = getDocument(node); if (!(activeElement == null ? void 0 : activeElement.nodeName)) { return null; } if (isFrame(activeElement) && activeElement.contentDocument) { return getActiveElement( activeElement.contentDocument.body, activeDescendant ); } if (activeDescendant) { const id = activeElement.getAttribute("aria-activedescendant"); if (id) { const element = getDocument(activeElement).getElementById(id); if (element) { return element; } } } return activeElement; } function contains(parent, child) { return parent === child || parent.contains(child); } function isFrame(element) { return element.tagName === "IFRAME"; } function isButton(element) { const tagName = element.tagName.toLowerCase(); if (tagName === "button") return true; if (tagName === "input" && element.type) { return buttonInputTypes.indexOf(element.type) !== -1; } return false; } var buttonInputTypes = [ "button", "color", "file", "image", "reset", "submit" ]; function isVisible(element) { if (typeof element.checkVisibility === "function") { return element.checkVisibility(); } const htmlElement = element; return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; } function isTextField(element) { try { const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; const isTextArea = element.tagName === "TEXTAREA"; return isTextInput || isTextArea || false; } catch (error) { return false; } } function isTextbox(element) { return element.isContentEditable || isTextField(element); } function getTextboxValue(element) { if (isTextField(element)) { return element.value; } if (element.isContentEditable) { const range = getDocument(element).createRange(); range.selectNodeContents(element); return range.toString(); } return ""; } function getTextboxSelection(element) { let start = 0; let end = 0; if (isTextField(element)) { start = element.selectionStart || 0; end = element.selectionEnd || 0; } else if (element.isContentEditable) { const selection = getDocument(element).getSelection(); if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) { const range = selection.getRangeAt(0); const nextRange = range.cloneRange(); nextRange.selectNodeContents(element); nextRange.setEnd(range.startContainer, range.startOffset); start = nextRange.toString().length; nextRange.setEnd(range.endContainer, range.endOffset); end = nextRange.toString().length; } } return { start, end }; } function getPopupRole(element, fallback) { const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"]; const role = element == null ? void 0 : element.getAttribute("role"); if (role && allowedPopupRoles.indexOf(role) !== -1) { return role; } return fallback; } function getPopupItemRole(element, fallback) { var _a; const itemRoleByPopupRole = { menu: "menuitem", listbox: "option", tree: "treeitem" }; const popupRole = getPopupRole(element); if (!popupRole) return fallback; const key = popupRole; return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback; } function scrollIntoViewIfNeeded(element, arg) { if (isPartiallyHidden(element) && "scrollIntoView" in element) { element.scrollIntoView(arg); } } function getScrollingElement(element) { if (!element) return null; if (element.clientHeight && element.scrollHeight > element.clientHeight) { const { overflowY } = getComputedStyle(element); const isScrollable = overflowY !== "visible" && overflowY !== "hidden"; if (isScrollable) return element; } else if (element.clientWidth && element.scrollWidth > element.clientWidth) { const { overflowX } = getComputedStyle(element); const isScrollable = overflowX !== "visible" && overflowX !== "hidden"; if (isScrollable) return element; } return getScrollingElement(element.parentElement) || document.scrollingElement || document.body; } function isPartiallyHidden(element) { const elementRect = element.getBoundingClientRect(); const scroller = getScrollingElement(element); if (!scroller) return false; const scrollerRect = scroller.getBoundingClientRect(); const isHTML = scroller.tagName === "HTML"; const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top; const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom; const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left; const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right; const top = elementRect.top < scrollerTop; const left = elementRect.left < scrollerLeft; const bottom = elementRect.bottom > scrollerBottom; const right = elementRect.right > scrollerRight; return top || left || bottom || right; } function setSelectionRange(element, ...args) { if (/text|search|password|tel|url/i.test(element.type)) { element.setSelectionRange(...args); } } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/US4USQPI.js "use client"; // src/utils/platform.ts function isTouchDevice() { return canUseDOM && !!navigator.maxTouchPoints; } function isApple() { if (!canUseDOM) return false; return /mac|iphone|ipad|ipod/i.test(navigator.platform); } function isSafari() { return canUseDOM && isApple() && /apple/i.test(navigator.vendor); } function isFirefox() { return canUseDOM && /firefox\//i.test(navigator.userAgent); } function isMac() { return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/events.js "use client"; // src/utils/events.ts function isPortalEvent(event) { return Boolean( event.currentTarget && !contains(event.currentTarget, event.target) ); } function isSelfTarget(event) { return event.target === event.currentTarget; } function isOpeningInNewTab(event) { const element = event.currentTarget; if (!element) return false; const isAppleDevice = isApple(); if (isAppleDevice && !event.metaKey) return false; if (!isAppleDevice && !event.ctrlKey) return false; const tagName = element.tagName.toLowerCase(); if (tagName === "a") return true; if (tagName === "button" && element.type === "submit") return true; if (tagName === "input" && element.type === "submit") return true; return false; } function isDownloading(event) { const element = event.currentTarget; if (!element) return false; const tagName = element.tagName.toLowerCase(); if (!event.altKey) return false; if (tagName === "a") return true; if (tagName === "button" && element.type === "submit") return true; if (tagName === "input" && element.type === "submit") return true; return false; } function fireEvent(element, type, eventInit) { const event = new Event(type, eventInit); return element.dispatchEvent(event); } function fireBlurEvent(element, eventInit) { const event = new FocusEvent("blur", eventInit); const defaultAllowed = element.dispatchEvent(event); const bubbleInit = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, eventInit), { bubbles: true }); element.dispatchEvent(new FocusEvent("focusout", bubbleInit)); return defaultAllowed; } function fireFocusEvent(element, eventInit) { const event = new FocusEvent("focus", eventInit); const defaultAllowed = element.dispatchEvent(event); const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true }); element.dispatchEvent(new FocusEvent("focusin", bubbleInit)); return defaultAllowed; } function fireKeyboardEvent(element, type, eventInit) { const event = new KeyboardEvent(type, eventInit); return element.dispatchEvent(event); } function fireClickEvent(element, eventInit) { const event = new MouseEvent("click", eventInit); return element.dispatchEvent(event); } function isFocusEventOutside(event, container) { const containerElement = container || event.currentTarget; const relatedTarget = event.relatedTarget; return !relatedTarget || !contains(containerElement, relatedTarget); } function getInputType(event) { const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event; if (!nativeEvent) return; if (!("inputType" in nativeEvent)) return; if (typeof nativeEvent.inputType !== "string") return; return nativeEvent.inputType; } function queueBeforeEvent(element, type, callback, timeout) { const createTimer = (callback2) => { if (timeout) { const timerId2 = setTimeout(callback2, timeout); return () => clearTimeout(timerId2); } const timerId = requestAnimationFrame(callback2); return () => cancelAnimationFrame(timerId); }; const cancelTimer = createTimer(() => { element.removeEventListener(type, callSync, true); callback(); }); const callSync = () => { cancelTimer(); callback(); }; element.addEventListener(type, callSync, { once: true, capture: true }); return cancelTimer; } function addGlobalEventListener(type, listener, options, scope = window) { const children = []; try { scope.document.addEventListener(type, listener, options); for (const frame of Array.from(scope.frames)) { children.push(addGlobalEventListener(type, listener, options, frame)); } } catch (e) { } const removeEventListener = () => { try { scope.document.removeEventListener(type, listener, options); } catch (e) { } for (const remove of children) { remove(); } }; return removeEventListener; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/Z32BISHQ.js "use client"; // src/utils/hooks.ts var _React = _3YLGPPWQ_spreadValues({}, external_React_namespaceObject); var useReactId = _React.useId; var useReactDeferredValue = _React.useDeferredValue; var useReactInsertionEffect = _React.useInsertionEffect; var useSafeLayoutEffect = canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; function useInitialValue(value) { const [initialValue] = (0,external_React_.useState)(value); return initialValue; } function useLazyValue(init) { const ref = useRef(); if (ref.current === void 0) { ref.current = init(); } return ref.current; } function useLiveRef(value) { const ref = (0,external_React_.useRef)(value); useSafeLayoutEffect(() => { ref.current = value; }); return ref; } function usePreviousValue(value) { const [previousValue, setPreviousValue] = useState(value); if (value !== previousValue) { setPreviousValue(value); } return previousValue; } function useEvent(callback) { const ref = (0,external_React_.useRef)(() => { throw new Error("Cannot call an event handler while rendering."); }); if (useReactInsertionEffect) { useReactInsertionEffect(() => { ref.current = callback; }); } else { ref.current = callback; } return (0,external_React_.useCallback)((...args) => { var _a; return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args); }, []); } function useTransactionState(callback) { const [state, setState] = (0,external_React_.useState)(null); useSafeLayoutEffect(() => { if (state == null) return; if (!callback) return; let prevState = null; callback((prev) => { prevState = prev; return state; }); return () => { callback(prevState); }; }, [state, callback]); return [state, setState]; } function useMergeRefs(...refs) { return (0,external_React_.useMemo)(() => { if (!refs.some(Boolean)) return; return (value) => { for (const ref of refs) { setRef(ref, value); } }; }, refs); } function useId(defaultId) { if (useReactId) { const reactId = useReactId(); if (defaultId) return defaultId; return reactId; } const [id, setId] = (0,external_React_.useState)(defaultId); useSafeLayoutEffect(() => { if (defaultId || id) return; const random = Math.random().toString(36).substr(2, 6); setId(`id-${random}`); }, [defaultId, id]); return defaultId || id; } function useDeferredValue(value) { if (useReactDeferredValue) { return useReactDeferredValue(value); } const [deferredValue, setDeferredValue] = useState(value); useEffect(() => { const raf = requestAnimationFrame(() => setDeferredValue(value)); return () => cancelAnimationFrame(raf); }, [value]); return deferredValue; } function useTagName(refOrElement, type) { const stringOrUndefined = (type2) => { if (typeof type2 !== "string") return; return type2; }; const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type)); useSafeLayoutEffect(() => { const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type)); }, [refOrElement, type]); return tagName; } function useAttribute(refOrElement, attributeName, defaultValue) { const [attribute, setAttribute] = (0,external_React_.useState)(defaultValue); useSafeLayoutEffect(() => { const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; if (!element) return; const callback = () => { const value = element.getAttribute(attributeName); if (value == null) return; setAttribute(value); }; const observer = new MutationObserver(callback); observer.observe(element, { attributeFilter: [attributeName] }); callback(); return () => observer.disconnect(); }, [refOrElement, attributeName]); return attribute; } function useUpdateEffect(effect, deps) { const mounted = (0,external_React_.useRef)(false); (0,external_React_.useEffect)(() => { if (mounted.current) { return effect(); } mounted.current = true; }, deps); (0,external_React_.useEffect)( () => () => { mounted.current = false; }, [] ); } function useUpdateLayoutEffect(effect, deps) { const mounted = useRef(false); useSafeLayoutEffect(() => { if (mounted.current) { return effect(); } mounted.current = true; }, deps); useSafeLayoutEffect( () => () => { mounted.current = false; }, [] ); } function useForceUpdate() { return (0,external_React_.useReducer)(() => [], []); } function useBooleanEvent(booleanOrCallback) { return useEvent( typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback ); } function useWrapElement(props, callback, deps = []) { const wrapElement = (0,external_React_.useCallback)( (element) => { if (props.wrapElement) { element = props.wrapElement(element); } return callback(element); }, [...deps, props.wrapElement] ); return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { wrapElement }); } function usePortalRef(portalProp = false, portalRefProp) { const [portalNode, setPortalNode] = (0,external_React_.useState)(null); const portalRef = useMergeRefs(setPortalNode, portalRefProp); const domReady = !portalProp || portalNode; return { portalRef, portalNode, domReady }; } function useMetadataProps(props, key, value) { const parent = props.onLoadedMetadataCapture; const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => { return Object.assign(() => { }, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, parent), { [key]: value })); }, [parent, key, value]); return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }]; } function useIsMouseMoving() { (0,external_React_.useEffect)(() => { addGlobalEventListener("mousemove", setMouseMoving, true); addGlobalEventListener("mousedown", resetMouseMoving, true); addGlobalEventListener("mouseup", resetMouseMoving, true); addGlobalEventListener("keydown", resetMouseMoving, true); addGlobalEventListener("scroll", resetMouseMoving, true); }, []); const isMouseMoving = useEvent(() => mouseMoving); return isMouseMoving; } var mouseMoving = false; var previousScreenX = 0; var previousScreenY = 0; function hasMouseMovement(event) { const movementX = event.movementX || event.screenX - previousScreenX; const movementY = event.movementY || event.screenY - previousScreenY; previousScreenX = event.screenX; previousScreenY = event.screenY; return movementX || movementY || "production" === "test"; } function setMouseMoving(event) { if (!hasMouseMovement(event)) return; mouseMoving = true; } function resetMouseMoving() { mouseMoving = false; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/EQQLU3CG.js "use client"; // src/utils/store.ts function getInternal(store, key) { const internals = store.__unstableInternals; invariant(internals, "Invalid store"); return internals[key]; } function createStore(initialState, ...stores) { let state = initialState; let prevStateBatch = state; let lastUpdate = Symbol(); let destroy = noop; const instances = /* @__PURE__ */ new Set(); const updatedKeys = /* @__PURE__ */ new Set(); const setups = /* @__PURE__ */ new Set(); const listeners = /* @__PURE__ */ new Set(); const batchListeners = /* @__PURE__ */ new Set(); const disposables = /* @__PURE__ */ new WeakMap(); const listenerKeys = /* @__PURE__ */ new WeakMap(); const storeSetup = (callback) => { setups.add(callback); return () => setups.delete(callback); }; const storeInit = () => { const initialized = instances.size; const instance = Symbol(); instances.add(instance); const maybeDestroy = () => { instances.delete(instance); if (instances.size) return; destroy(); }; if (initialized) return maybeDestroy; const desyncs = getKeys(state).map( (key) => chain( ...stores.map((store) => { var _a; const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store); if (!storeState) return; if (!PBFD2E7P_hasOwnProperty(storeState, key)) return; return sync(store, [key], (state2) => { setState( key, state2[key], // @ts-expect-error - Not public API. This is just to prevent // infinite loops. true ); }); }) ) ); const teardowns = []; for (const setup2 of setups) { teardowns.push(setup2()); } const cleanups = stores.map(init); destroy = chain(...desyncs, ...teardowns, ...cleanups); return maybeDestroy; }; const sub = (keys, listener, set = listeners) => { set.add(listener); listenerKeys.set(listener, keys); return () => { var _a; (_a = disposables.get(listener)) == null ? void 0 : _a(); disposables.delete(listener); listenerKeys.delete(listener); set.delete(listener); }; }; const storeSubscribe = (keys, listener) => sub(keys, listener); const storeSync = (keys, listener) => { disposables.set(listener, listener(state, state)); return sub(keys, listener); }; const storeBatch = (keys, listener) => { disposables.set(listener, listener(state, prevStateBatch)); return sub(keys, listener, batchListeners); }; const storePick = (keys) => createStore(pick(state, keys), finalStore); const storeOmit = (keys) => createStore(omit(state, keys), finalStore); const getState = () => state; const setState = (key, value, fromStores = false) => { var _a; if (!PBFD2E7P_hasOwnProperty(state, key)) return; const nextValue = applyState(value, state[key]); if (nextValue === state[key]) return; if (!fromStores) { for (const store of stores) { (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue); } } const prevState = state; state = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, state), { [key]: nextValue }); const thisUpdate = Symbol(); lastUpdate = thisUpdate; updatedKeys.add(key); const run = (listener, prev, uKeys) => { var _a2; const keys = listenerKeys.get(listener); const updated = (k) => uKeys ? uKeys.has(k) : k === key; if (!keys || keys.some(updated)) { (_a2 = disposables.get(listener)) == null ? void 0 : _a2(); disposables.set(listener, listener(state, prev)); } }; for (const listener of listeners) { run(listener, prevState); } queueMicrotask(() => { if (lastUpdate !== thisUpdate) return; const snapshot = state; for (const listener of batchListeners) { run(listener, prevStateBatch, updatedKeys); } prevStateBatch = snapshot; updatedKeys.clear(); }); }; const finalStore = { getState, setState, __unstableInternals: { setup: storeSetup, init: storeInit, subscribe: storeSubscribe, sync: storeSync, batch: storeBatch, pick: storePick, omit: storeOmit } }; return finalStore; } function setup(store, ...args) { if (!store) return; return getInternal(store, "setup")(...args); } function init(store, ...args) { if (!store) return; return getInternal(store, "init")(...args); } function subscribe(store, ...args) { if (!store) return; return getInternal(store, "subscribe")(...args); } function sync(store, ...args) { if (!store) return; return getInternal(store, "sync")(...args); } function batch(store, ...args) { if (!store) return; return getInternal(store, "batch")(...args); } function omit2(store, ...args) { if (!store) return; return getInternal(store, "omit")(...args); } function pick2(store, ...args) { if (!store) return; return getInternal(store, "pick")(...args); } function mergeStore(...stores) { const initialState = stores.reduce((state, store2) => { var _a; const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); if (!nextState) return state; return Object.assign(state, nextState); }, {}); const store = createStore(initialState, ...stores); return store; } function throwOnConflictingProps(props, store) { if (true) return; if (!store) return; const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => { var _a; const stateKey = key.replace("default", ""); return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`; }); if (!defaultKeys.length) return; const storeState = store.getState(); const conflictingProps = defaultKeys.filter( (key) => PBFD2E7P_hasOwnProperty(storeState, key) ); if (!conflictingProps.length) return; throw new Error( `Passing a store prop in conjunction with a default state is not supported. const store = useSelectStore(); ^ ^ Instead, pass the default state to the topmost store: const store = useSelectStore({ defaultValue: "Apple" }); See https://github.com/ariakit/ariakit/pull/2745 for more details. If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit ` ); } // EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js var shim = __webpack_require__(422); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/2GXGCHW6.js "use client"; // src/utils/store.tsx var { useSyncExternalStore } = shim; var noopSubscribe = () => () => { }; function useStoreState(store, keyOrSelector = identity) { const storeSubscribe = external_React_.useCallback( (callback) => { if (!store) return noopSubscribe(); return subscribe(store, null, callback); }, [store] ); const getSnapshot = () => { const key = typeof keyOrSelector === "string" ? keyOrSelector : null; const selector = typeof keyOrSelector === "function" ? keyOrSelector : null; const state = store == null ? void 0 : store.getState(); if (selector) return selector(state); if (!state) return; if (!key) return; if (!PBFD2E7P_hasOwnProperty(state, key)) return; return state[key]; }; return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); } function useStoreProps(store, props, key, setKey) { const value = PBFD2E7P_hasOwnProperty(props, key) ? props[key] : void 0; const setValue = setKey ? props[setKey] : void 0; const propsRef = useLiveRef({ value, setValue }); useSafeLayoutEffect(() => { return sync(store, [key], (state, prev) => { const { value: value2, setValue: setValue2 } = propsRef.current; if (!setValue2) return; if (state[key] === prev[key]) return; if (state[key] === value2) return; setValue2(state[key]); }); }, [store, key]); useSafeLayoutEffect(() => { if (value === void 0) return; store.setState(key, value); return batch(store, [key], () => { if (value === void 0) return; store.setState(key, value); }); }); } function _2GXGCHW6_useStore(createStore, props) { const [store, setStore] = external_React_.useState(() => createStore(props)); useSafeLayoutEffect(() => init(store), [store]); const useState2 = external_React_.useCallback( (keyOrSelector) => useStoreState(store, keyOrSelector), [store] ); const memoizedStore = external_React_.useMemo( () => _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, store), { useState: useState2 }), [store, useState2] ); const updateStore = useEvent(() => { setStore((store2) => createStore(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({}, props), store2.getState()))); }); return [memoizedStore, updateStore]; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TCAGH6BH.js "use client"; // src/collection/collection-store.ts function useCollectionStoreProps(store, update, props) { useUpdateEffect(update, [props.store]); useStoreProps(store, props, "items", "setItems"); return store; } function useCollectionStore(props = {}) { const [store, update] = useStore(Core.createCollectionStore, props); return useCollectionStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/6DHTHWXD.js "use client"; // src/collection/collection-store.ts function isElementPreceding(a, b) { return Boolean( b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING ); } function sortBasedOnDOMPosition(items) { const pairs = items.map((item, index) => [index, item]); let isOrderDifferent = false; pairs.sort(([indexA, a], [indexB, b]) => { const elementA = a.element; const elementB = b.element; if (elementA === elementB) return 0; if (!elementA || !elementB) return 0; if (isElementPreceding(elementA, elementB)) { if (indexA > indexB) { isOrderDifferent = true; } return -1; } if (indexA < indexB) { isOrderDifferent = true; } return 1; }); if (isOrderDifferent) { return pairs.map(([_, item]) => item); } return items; } function getCommonParent(items) { var _a; const firstItem = items.find((item) => !!item.element); const lastItem = [...items].reverse().find((item) => !!item.element); let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement; while (parentElement && (lastItem == null ? void 0 : lastItem.element)) { const parent = parentElement; if (lastItem && parent.contains(lastItem.element)) { return parentElement; } parentElement = parentElement.parentElement; } return getDocument(parentElement).body; } function getPrivateStore(store) { return store == null ? void 0 : store.__unstablePrivateStore; } function createCollectionStore(props = {}) { var _a; throwOnConflictingProps(props, props.store); const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const items = defaultValue( props.items, syncState == null ? void 0 : syncState.items, props.defaultItems, [] ); const itemsMap = new Map(items.map((item) => [item.id, item])); const initialState = { items, renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, []) }; const syncPrivateStore = getPrivateStore(props.store); const privateStore = createStore( { items, renderedItems: initialState.renderedItems }, syncPrivateStore ); const collection = createStore(initialState, props.store); const sortItems = (renderedItems) => { const sortedItems = sortBasedOnDOMPosition(renderedItems); privateStore.setState("renderedItems", sortedItems); collection.setState("renderedItems", sortedItems); }; setup(collection, () => init(privateStore)); setup(privateStore, () => { return batch(privateStore, ["items"], (state) => { collection.setState("items", state.items); }); }); setup(privateStore, () => { return batch(privateStore, ["renderedItems"], (state) => { let firstRun = true; let raf = requestAnimationFrame(() => { const { renderedItems } = collection.getState(); if (state.renderedItems === renderedItems) return; sortItems(state.renderedItems); }); if (typeof IntersectionObserver !== "function") { return () => cancelAnimationFrame(raf); } const ioCallback = () => { if (firstRun) { firstRun = false; return; } cancelAnimationFrame(raf); raf = requestAnimationFrame(() => sortItems(state.renderedItems)); }; const root = getCommonParent(state.renderedItems); const observer = new IntersectionObserver(ioCallback, { root }); for (const item of state.renderedItems) { if (!item.element) continue; observer.observe(item.element); } return () => { cancelAnimationFrame(raf); observer.disconnect(); }; }); }); const mergeItem = (item, setItems, canDeleteFromMap = false) => { let prevItem; setItems((items2) => { const index = items2.findIndex(({ id }) => id === item.id); const nextItems = items2.slice(); if (index !== -1) { prevItem = items2[index]; const nextItem = _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, prevItem), item); nextItems[index] = nextItem; itemsMap.set(item.id, nextItem); } else { nextItems.push(item); itemsMap.set(item.id, item); } return nextItems; }); const unmergeItem = () => { setItems((items2) => { if (!prevItem) { if (canDeleteFromMap) { itemsMap.delete(item.id); } return items2.filter(({ id }) => id !== item.id); } const index = items2.findIndex(({ id }) => id === item.id); if (index === -1) return items2; const nextItems = items2.slice(); nextItems[index] = prevItem; itemsMap.set(item.id, prevItem); return nextItems; }); }; return unmergeItem; }; const registerItem = (item) => mergeItem( item, (getItems) => privateStore.setState("items", getItems), true ); return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection), { registerItem, renderItem: (item) => chain( registerItem(item), mergeItem( item, (getItems) => privateStore.setState("renderedItems", getItems) ) ), item: (id) => { if (!id) return null; let item = itemsMap.get(id); if (!item) { const { items: items2 } = collection.getState(); item = items2.find((item2) => item2.id === id); if (item) { itemsMap.set(id, item); } } return item || null; }, // @ts-expect-error Internal __unstablePrivateStore: privateStore }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js "use client"; // src/utils/array.ts function toArray(arg) { if (Array.isArray(arg)) { return arg; } return typeof arg !== "undefined" ? [arg] : []; } function addItemToArray(array, item, index = -1) { if (!(index in array)) { return [...array, item]; } return [...array.slice(0, index), item, ...array.slice(index)]; } function flatten2DArray(array) { const flattened = []; for (const row of array) { flattened.push(...row); } return flattened; } function reverseArray(array) { return array.slice().reverse(); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/D7EIQZAU.js "use client"; // src/composite/composite-store.ts var NULL_ITEM = { id: null }; function findFirstEnabledItem(items, excludeId) { return items.find((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; } return !item.disabled; }); } function getEnabledItems(items, excludeId) { return items.filter((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; } return !item.disabled; }); } function getOppositeOrientation(orientation) { if (orientation === "vertical") return "horizontal"; if (orientation === "horizontal") return "vertical"; return; } function getItemsInRow(items, rowId) { return items.filter((item) => item.rowId === rowId); } function flipItems(items, activeId, shouldInsertNullItem = false) { const index = items.findIndex((item) => item.id === activeId); return [ ...items.slice(index + 1), ...shouldInsertNullItem ? [NULL_ITEM] : [], ...items.slice(0, index) ]; } function groupItemsByRows(items) { const rows = []; for (const item of items) { const row = rows.find((currentRow) => { var _a; return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; }); if (row) { row.push(item); } else { rows.push([item]); } } return rows; } function getMaxRowLength(array) { let maxLength = 0; for (const { length } of array) { if (length > maxLength) { maxLength = length; } } return maxLength; } function createEmptyItem(rowId) { return { id: "__EMPTY_ITEM__", disabled: true, rowId }; } function normalizeRows(rows, activeId, focusShift) { const maxLength = getMaxRowLength(rows); for (const row of rows) { for (let i = 0; i < maxLength; i += 1) { const item = row[i]; if (!item || focusShift && item.disabled) { const isFirst = i === 0; const previousItem = isFirst && focusShift ? findFirstEnabledItem(row) : row[i - 1]; row[i] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId); } } } return rows; } function verticalizeItems(items) { const rows = groupItemsByRows(items); const maxLength = getMaxRowLength(rows); const verticalized = []; for (let i = 0; i < maxLength; i += 1) { for (const row of rows) { const item = row[i]; if (item) { verticalized.push(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, item), { // If there's no rowId, it means that it's not a grid composite, but // a single row instead. So, instead of verticalizing it, that is, // assigning a different rowId based on the column index, we keep it // undefined so they will be part of the same row. This is useful // when using up/down on one-dimensional composites. rowId: item.rowId ? `${i}` : void 0 })); } } } return verticalized; } function createCompositeStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const collection = createCollectionStore(props); const activeId = defaultValue( props.activeId, syncState == null ? void 0 : syncState.activeId, props.defaultActiveId ); const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, collection.getState()), { activeId, baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null), includesBaseElement: defaultValue( props.includesBaseElement, syncState == null ? void 0 : syncState.includesBaseElement, activeId === null ), moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0), orientation: defaultValue( props.orientation, syncState == null ? void 0 : syncState.orientation, "both" ), rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false), virtualFocus: defaultValue( props.virtualFocus, syncState == null ? void 0 : syncState.virtualFocus, false ), focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false), focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false), focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false) }); const composite = createStore(initialState, collection, props.store); setup( composite, () => sync(composite, ["renderedItems", "activeId"], (state) => { composite.setState("activeId", (activeId2) => { var _a2; if (activeId2 !== void 0) return activeId2; return (_a2 = findFirstEnabledItem(state.renderedItems)) == null ? void 0 : _a2.id; }); }) ); const getNextId = (items, orientation, hasNullItem, skip) => { var _a2, _b; const { activeId: activeId2, rtl, focusLoop, focusWrap, includesBaseElement } = composite.getState(); const isHorizontal = orientation !== "vertical"; const isRTL = rtl && isHorizontal; const allItems = isRTL ? reverseArray(items) : items; if (activeId2 == null) { return (_a2 = findFirstEnabledItem(allItems)) == null ? void 0 : _a2.id; } const activeItem = allItems.find((item) => item.id === activeId2); if (!activeItem) { return (_b = findFirstEnabledItem(allItems)) == null ? void 0 : _b.id; } const isGrid = !!activeItem.rowId; const activeIndex = allItems.indexOf(activeItem); const nextItems = allItems.slice(activeIndex + 1); const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId); if (skip !== void 0) { const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2); const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one. nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1]; return nextItem2 == null ? void 0 : nextItem2.id; } const oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous call, // which is inherently horizontal. up/down will call next with orientation // set to vertical by default (see below on up/down methods). isGrid ? orientation || "horizontal" : orientation ); const canLoop = focusLoop && focusLoop !== oppositeOrientation; const canWrap = isGrid && focusWrap && focusWrap !== oppositeOrientation; hasNullItem = hasNullItem || !isGrid && canLoop && includesBaseElement; if (canLoop) { const loopItems = canWrap && !hasNullItem ? allItems : getItemsInRow(allItems, activeItem.rowId); const sortedItems = flipItems(loopItems, activeId2, hasNullItem); const nextItem2 = findFirstEnabledItem(sortedItems, activeId2); return nextItem2 == null ? void 0 : nextItem2.id; } if (canWrap) { const nextItem2 = findFirstEnabledItem( // We can use nextItems, which contains all the next items, including // items from other rows, to wrap between rows. However, if there is a // null item (the composite container), we'll only use the next items in // the row. So moving next from the last item will focus on the // composite container. On grid composites, horizontal navigation never // focuses on the composite container, only vertical. hasNullItem ? nextItemsInRow : nextItems, activeId2 ); const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id; return nextId; } const nextItem = findFirstEnabledItem(nextItemsInRow, activeId2); if (!nextItem && hasNullItem) { return null; } return nextItem == null ? void 0 : nextItem.id; }; return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, collection), composite), { setBaseElement: (element) => composite.setState("baseElement", element), setActiveId: (id) => composite.setState("activeId", id), move: (id) => { if (id === void 0) return; composite.setState("activeId", id); composite.setState("moves", (moves) => moves + 1); }, first: () => { var _a2; return (_a2 = findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id; }, last: () => { var _a2; return (_a2 = findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id; }, next: (skip) => { const { renderedItems, orientation } = composite.getState(); return getNextId(renderedItems, orientation, false, skip); }, previous: (skip) => { var _a2; const { renderedItems, orientation, includesBaseElement } = composite.getState(); const isGrid = !!((_a2 = findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId); const hasNullItem = !isGrid && includesBaseElement; return getNextId( reverseArray(renderedItems), orientation, hasNullItem, skip ); }, down: (skip) => { const { activeId: activeId2, renderedItems, focusShift, focusLoop, includesBaseElement } = composite.getState(); const shouldShift = focusShift && !skip; const verticalItems = verticalizeItems( flatten2DArray( normalizeRows(groupItemsByRows(renderedItems), activeId2, shouldShift) ) ); const canLoop = focusLoop && focusLoop !== "horizontal"; const hasNullItem = canLoop && includesBaseElement; return getNextId(verticalItems, "vertical", hasNullItem, skip); }, up: (skip) => { const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState(); const shouldShift = focusShift && !skip; const verticalItems = verticalizeItems( reverseArray( flatten2DArray( normalizeRows( groupItemsByRows(renderedItems), activeId2, shouldShift ) ) ) ); const hasNullItem = includesBaseElement; return getNextId(verticalItems, "vertical", hasNullItem, skip); } }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UVQLZ7T5.js "use client"; // src/composite/composite-store.ts function useCompositeStoreProps(store, update, props) { store = useCollectionStoreProps(store, update, props); useStoreProps(store, props, "activeId", "setActiveId"); useStoreProps(store, props, "includesBaseElement"); useStoreProps(store, props, "virtualFocus"); useStoreProps(store, props, "orientation"); useStoreProps(store, props, "rtl"); useStoreProps(store, props, "focusLoop"); useStoreProps(store, props, "focusWrap"); useStoreProps(store, props, "focusShift"); return store; } function useCompositeStore(props = {}) { const [store, update] = _2GXGCHW6_useStore(createCompositeStore, props); return useCompositeStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js "use client"; // src/composite/utils.ts var _5VQZOHHZ_NULL_ITEM = { id: null }; function _5VQZOHHZ_flipItems(items, activeId, shouldInsertNullItem = false) { const index = items.findIndex((item) => item.id === activeId); return [ ...items.slice(index + 1), ...shouldInsertNullItem ? [_5VQZOHHZ_NULL_ITEM] : [], ...items.slice(0, index) ]; } function _5VQZOHHZ_findFirstEnabledItem(items, excludeId) { return items.find((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; } return !item.disabled; }); } function getEnabledItem(store, id) { if (!id) return null; return store.item(id) || null; } function _5VQZOHHZ_groupItemsByRows(items) { const rows = []; for (const item of items) { const row = rows.find((currentRow) => { var _a; return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; }); if (row) { row.push(item); } else { rows.push([item]); } } return rows; } function selectTextField(element, collapseToEnd = false) { if (isTextField(element)) { element.setSelectionRange( collapseToEnd ? element.value.length : 0, element.value.length ); } else if (element.isContentEditable) { const selection = getDocument(element).getSelection(); selection == null ? void 0 : selection.selectAllChildren(element); if (collapseToEnd) { selection == null ? void 0 : selection.collapseToEnd(); } } } var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY"); function focusSilently(element) { element[FOCUS_SILENTLY] = true; element.focus({ preventScroll: true }); } function silentlyFocused(element) { const isSilentlyFocused = element[FOCUS_SILENTLY]; delete element[FOCUS_SILENTLY]; return isSilentlyFocused; } function isItem(store, element, exclude) { if (!element) return false; if (element === exclude) return false; const item = store.item(element.id); if (!item) return false; if (exclude && item.element === exclude) return false; return true; } ;// CONCATENATED MODULE: external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HKOOKEDE.js "use client"; // src/utils/system.tsx function forwardRef2(render) { const Role = external_React_.forwardRef((props, ref) => render(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref }))); Role.displayName = render.displayName || render.name; return Role; } function memo2(Component, propsAreEqual) { return external_React_.memo(Component, propsAreEqual); } function HKOOKEDE_createElement(Type, props) { const _a = props, { wrapElement, render } = _a, rest = __objRest(_a, ["wrapElement", "render"]); const mergedRef = useMergeRefs(props.ref, getRefProperty(render)); let element; if (external_React_.isValidElement(render)) { const renderProps = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, render.props), { ref: mergedRef }); element = external_React_.cloneElement(render, mergeProps(rest, renderProps)); } else if (render) { element = render(rest); } else { element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Type, _3YLGPPWQ_spreadValues({}, rest)); } if (wrapElement) { return wrapElement(element); } return element; } function createHook(useProps) { const useRole = (props = {}) => { return useProps(props); }; useRole.displayName = useProps.name; return useRole; } function createStoreContext(providers = [], scopedProviders = []) { const context = external_React_.createContext(void 0); const scopedContext = external_React_.createContext(void 0); const useContext2 = () => external_React_.useContext(context); const useScopedContext = (onlyScoped = false) => { const scoped = external_React_.useContext(scopedContext); const store = useContext2(); if (onlyScoped) return scoped; return scoped || store; }; const useProviderContext = () => { const scoped = external_React_.useContext(scopedContext); const store = useContext2(); if (scoped && scoped === store) return; return store; }; const ContextProvider = (props) => { return providers.reduceRight( (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(context.Provider, _3YLGPPWQ_spreadValues({}, props)) ); }; const ScopedContextProvider = (props) => { return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextProvider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children: scopedProviders.reduceRight( (children, Provider) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { children })), /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(scopedContext.Provider, _3YLGPPWQ_spreadValues({}, props)) ) })); }; return { context, scopedContext, useContext: useContext2, useScopedContext, useProviderContext, ContextProvider, ScopedContextProvider }; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FMYQNSCK.js "use client"; // src/collection/collection-context.tsx var ctx = createStoreContext(); var useCollectionContext = ctx.useContext; var useCollectionScopedContext = ctx.useScopedContext; var useCollectionProviderContext = ctx.useProviderContext; var CollectionContextProvider = ctx.ContextProvider; var CollectionScopedContextProvider = ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/WENSINUV.js "use client"; // src/composite/composite-context.tsx var WENSINUV_ctx = createStoreContext( [CollectionContextProvider], [CollectionScopedContextProvider] ); var useCompositeContext = WENSINUV_ctx.useContext; var useCompositeScopedContext = WENSINUV_ctx.useScopedContext; var useCompositeProviderContext = WENSINUV_ctx.useProviderContext; var CompositeContextProvider = WENSINUV_ctx.ContextProvider; var CompositeScopedContextProvider = WENSINUV_ctx.ScopedContextProvider; var CompositeItemContext = (0,external_React_.createContext)( void 0 ); var CompositeRowContext = (0,external_React_.createContext)( void 0 ); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js "use client"; // src/focusable/focusable-context.tsx var FocusableContext = (0,external_React_.createContext)(true); ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/focus.js "use client"; // src/utils/focus.ts var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; function hasNegativeTabIndex(element) { const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10); return tabIndex < 0; } function isFocusable(element) { if (!element.matches(selector)) return false; if (!isVisible(element)) return false; if (element.closest("[inert]")) return false; return true; } function isTabbable(element) { if (!isFocusable(element)) return false; if (hasNegativeTabIndex(element)) return false; if (!("form" in element)) return true; if (!element.form) return true; if (element.checked) return true; if (element.type !== "radio") return true; const radioGroup = element.form.elements.namedItem(element.name); if (!radioGroup) return true; if (!("length" in radioGroup)) return true; const activeElement = getActiveElement(element); if (!activeElement) return true; if (activeElement === element) return true; if (!("form" in activeElement)) return true; if (activeElement.form !== element.form) return true; if (activeElement.name !== element.name) return true; return false; } function getAllFocusableIn(container, includeContainer) { const elements = Array.from( container.querySelectorAll(selector) ); if (includeContainer) { elements.unshift(container); } const focusableElements = elements.filter(isFocusable); focusableElements.forEach((element, i) => { if (isFrame(element) && element.contentDocument) { const frameBody = element.contentDocument.body; focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody)); } }); return focusableElements; } function getAllFocusable(includeBody) { return getAllFocusableIn(document.body, includeBody); } function getFirstFocusableIn(container, includeContainer) { const [first] = getAllFocusableIn(container, includeContainer); return first || null; } function getFirstFocusable(includeBody) { return getFirstFocusableIn(document.body, includeBody); } function getAllTabbableIn(container, includeContainer, fallbackToFocusable) { const elements = Array.from( container.querySelectorAll(selector) ); const tabbableElements = elements.filter(isTabbable); if (includeContainer && isTabbable(container)) { tabbableElements.unshift(container); } tabbableElements.forEach((element, i) => { if (isFrame(element) && element.contentDocument) { const frameBody = element.contentDocument.body; const allFrameTabbable = getAllTabbableIn( frameBody, false, fallbackToFocusable ); tabbableElements.splice(i, 1, ...allFrameTabbable); } }); if (!tabbableElements.length && fallbackToFocusable) { return elements; } return tabbableElements; } function getAllTabbable(fallbackToFocusable) { return getAllTabbableIn(document.body, false, fallbackToFocusable); } function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) { const [first] = getAllTabbableIn( container, includeContainer, fallbackToFocusable ); return first || null; } function getFirstTabbable(fallbackToFocusable) { return getFirstTabbableIn(document.body, false, fallbackToFocusable); } function getLastTabbableIn(container, includeContainer, fallbackToFocusable) { const allTabbable = getAllTabbableIn( container, includeContainer, fallbackToFocusable ); return allTabbable[allTabbable.length - 1] || null; } function getLastTabbable(fallbackToFocusable) { return getLastTabbableIn(document.body, false, fallbackToFocusable); } function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) { const activeElement = getActiveElement(container); const allFocusable = getAllFocusableIn(container, includeContainer); const activeIndex = allFocusable.indexOf(activeElement); const nextFocusableElements = allFocusable.slice(activeIndex + 1); return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null; } function getNextTabbable(fallbackToFirst, fallbackToFocusable) { return getNextTabbableIn( document.body, false, fallbackToFirst, fallbackToFocusable ); } function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) { const activeElement = getActiveElement(container); const allFocusable = getAllFocusableIn(container, includeContainer).reverse(); const activeIndex = allFocusable.indexOf(activeElement); const previousFocusableElements = allFocusable.slice(activeIndex + 1); return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null; } function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) { return getPreviousTabbableIn( document.body, false, fallbackToFirst, fallbackToFocusable ); } function getClosestFocusable(element) { while (element && !isFocusable(element)) { element = element.closest(selector); } return element || null; } function hasFocus(element) { const activeElement = getActiveElement(element); if (!activeElement) return false; if (activeElement === element) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) return false; return activeDescendant === element.id; } function hasFocusWithin(element) { const activeElement = getActiveElement(element); if (!activeElement) return false; if (contains(element, activeElement)) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) return false; if (!("id" in element)) return false; if (activeDescendant === element.id) return true; return !!element.querySelector(`#${CSS.escape(activeDescendant)}`); } function focusIfNeeded(element) { if (!hasFocusWithin(element) && isFocusable(element)) { element.focus(); } } function disableFocus(element) { var _a; const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : ""; element.setAttribute("data-tabindex", currentTabindex); element.setAttribute("tabindex", "-1"); } function disableFocusIn(container, includeContainer) { const tabbableElements = getAllTabbableIn(container, includeContainer); for (const element of tabbableElements) { disableFocus(element); } } function restoreFocusIn(container) { const elements = container.querySelectorAll("[data-tabindex]"); const restoreTabIndex = (element) => { const tabindex = element.getAttribute("data-tabindex"); element.removeAttribute("data-tabindex"); if (tabindex) { element.setAttribute("tabindex", tabindex); } else { element.removeAttribute("tabindex"); } }; if (container.hasAttribute("data-tabindex")) { restoreTabIndex(container); } for (const element of elements) { restoreTabIndex(element); } } function focusIntoView(element, options) { if (!("scrollIntoView" in element)) { element.focus(); } else { element.focus({ preventScroll: true }); element.scrollIntoView(_chunks_3YLGPPWQ_spreadValues({ block: "nearest", inline: "nearest" }, options)); } } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OD7ALSX5.js "use client"; // src/focusable/focusable.tsx var TagName = "div"; var isSafariBrowser = isSafari(); var alwaysFocusVisibleInputTypes = [ "text", "search", "url", "tel", "email", "password", "number", "date", "month", "week", "time", "datetime", "datetime-local" ]; var safariFocusAncestorSymbol = Symbol("safariFocusAncestor"); function isSafariFocusAncestor(element) { if (!element) return false; return !!element[safariFocusAncestorSymbol]; } function markSafariFocusAncestor(element, value) { if (!element) return; element[safariFocusAncestorSymbol] = value; } function isAlwaysFocusVisible(element) { const { tagName, readOnly, type } = element; if (tagName === "TEXTAREA" && !readOnly) return true; if (tagName === "SELECT" && !readOnly) return true; if (tagName === "INPUT" && !readOnly) { return alwaysFocusVisibleInputTypes.includes(type); } if (element.isContentEditable) return true; const role = element.getAttribute("role"); if (role === "combobox" && element.dataset.name) { return true; } return false; } function getLabels(element) { if ("labels" in element) { return element.labels; } return null; } function isNativeCheckboxOrRadio(element) { const tagName = element.tagName.toLowerCase(); if (tagName === "input" && element.type) { return element.type === "radio" || element.type === "checkbox"; } return false; } function isNativeTabbable(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a"; } function supportsDisabledAttribute(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea"; } function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) { if (!focusable) { return tabIndexProp; } if (trulyDisabled) { if (nativeTabbable && !supportsDisabled) { return -1; } return; } if (nativeTabbable) { return tabIndexProp; } return tabIndexProp || 0; } function useDisableEvent(onEvent, disabled) { return useEvent((event) => { onEvent == null ? void 0 : onEvent(event); if (event.defaultPrevented) return; if (disabled) { event.stopPropagation(); event.preventDefault(); } }); } var isKeyboardModality = true; function onGlobalMouseDown(event) { const target = event.target; if (target && "hasAttribute" in target) { if (!target.hasAttribute("data-focus-visible")) { isKeyboardModality = false; } } } function onGlobalKeyDown(event) { if (event.metaKey) return; if (event.ctrlKey) return; if (event.altKey) return; isKeyboardModality = true; } var useFocusable = createHook( function useFocusable2(_a) { var _b = _a, { focusable = true, accessibleWhenDisabled, autoFocus, onFocusVisible } = _b, props = __objRest(_b, [ "focusable", "accessibleWhenDisabled", "autoFocus", "onFocusVisible" ]); const ref = (0,external_React_.useRef)(null); (0,external_React_.useEffect)(() => { if (!focusable) return; addGlobalEventListener("mousedown", onGlobalMouseDown, true); addGlobalEventListener("keydown", onGlobalKeyDown, true); }, [focusable]); if (isSafariBrowser) { (0,external_React_.useEffect)(() => { if (!focusable) return; const element = ref.current; if (!element) return; if (!isNativeCheckboxOrRadio(element)) return; const labels = getLabels(element); if (!labels) return; const onMouseUp = () => queueMicrotask(() => element.focus()); for (const label of labels) { label.addEventListener("mouseup", onMouseUp); } return () => { for (const label of labels) { label.removeEventListener("mouseup", onMouseUp); } }; }, [focusable]); } const disabled = focusable && disabledFromProps(props); const trulyDisabled = !!disabled && !accessibleWhenDisabled; const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!focusable) return; if (trulyDisabled && focusVisible) { setFocusVisible(false); } }, [focusable, trulyDisabled, focusVisible]); (0,external_React_.useEffect)(() => { if (!focusable) return; if (!focusVisible) return; const element = ref.current; if (!element) return; if (typeof IntersectionObserver === "undefined") return; const observer = new IntersectionObserver(() => { if (!isFocusable(element)) { setFocusVisible(false); } }); observer.observe(element); return () => observer.disconnect(); }, [focusable, focusVisible]); const onKeyPressCapture = useDisableEvent( props.onKeyPressCapture, disabled ); const onMouseDownCapture = useDisableEvent( props.onMouseDownCapture, disabled ); const onClickCapture = useDisableEvent(props.onClickCapture, disabled); const onMouseDownProp = props.onMouseDown; const onMouseDown = useEvent((event) => { onMouseDownProp == null ? void 0 : onMouseDownProp(event); if (event.defaultPrevented) return; if (!focusable) return; const element = event.currentTarget; if (!isSafariBrowser) return; if (isPortalEvent(event)) return; if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return; let receivedFocus = false; const onFocus = () => { receivedFocus = true; }; const options = { capture: true, once: true }; element.addEventListener("focusin", onFocus, options); const focusableContainer = getClosestFocusable(element.parentElement); markSafariFocusAncestor(focusableContainer, true); queueBeforeEvent(element, "mouseup", () => { element.removeEventListener("focusin", onFocus, true); markSafariFocusAncestor(focusableContainer, false); if (receivedFocus) return; focusIfNeeded(element); }); }); const handleFocusVisible = (event, currentTarget) => { if (currentTarget) { event.currentTarget = currentTarget; } if (!focusable) return; const element = event.currentTarget; if (!element) return; if (!hasFocus(element)) return; onFocusVisible == null ? void 0 : onFocusVisible(event); if (event.defaultPrevented) return; element.dataset.focusVisible = "true"; setFocusVisible(true); }; const onKeyDownCaptureProp = props.onKeyDownCapture; const onKeyDownCapture = useEvent((event) => { onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); if (event.defaultPrevented) return; if (!focusable) return; if (focusVisible) return; if (event.metaKey) return; if (event.altKey) return; if (event.ctrlKey) return; if (!isSelfTarget(event)) return; const element = event.currentTarget; const applyFocusVisible = () => handleFocusVisible(event, element); queueBeforeEvent(element, "focusout", applyFocusVisible); }); const onFocusCaptureProp = props.onFocusCapture; const onFocusCapture = useEvent((event) => { onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); if (event.defaultPrevented) return; if (!focusable) return; if (!isSelfTarget(event)) { setFocusVisible(false); return; } const element = event.currentTarget; const applyFocusVisible = () => handleFocusVisible(event, element); if (isKeyboardModality || isAlwaysFocusVisible(event.target)) { queueBeforeEvent(event.target, "focusout", applyFocusVisible); } else { setFocusVisible(false); } }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { onBlurProp == null ? void 0 : onBlurProp(event); if (!focusable) return; if (!isFocusEventOutside(event)) return; setFocusVisible(false); }); const autoFocusOnShow = (0,external_React_.useContext)(FocusableContext); const autoFocusRef = useEvent((element) => { if (!focusable) return; if (!autoFocus) return; if (!element) return; if (!autoFocusOnShow) return; queueMicrotask(() => { if (hasFocus(element)) return; if (!isFocusable(element)) return; element.focus(); }); }); const tagName = useTagName(ref); const nativeTabbable = focusable && isNativeTabbable(tagName); const supportsDisabled = focusable && supportsDisabledAttribute(tagName); const styleProp = props.style; const style = (0,external_React_.useMemo)(() => { if (trulyDisabled) { return _3YLGPPWQ_spreadValues({ pointerEvents: "none" }, styleProp); } return styleProp; }, [trulyDisabled, styleProp]); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ "data-focus-visible": focusable && focusVisible || void 0, "data-autofocus": autoFocus || void 0, "aria-disabled": disabled || void 0 }, props), { ref: useMergeRefs(ref, autoFocusRef, props.ref), style, tabIndex: getTabIndex( focusable, trulyDisabled, nativeTabbable, supportsDisabled, props.tabIndex ), disabled: supportsDisabled && trulyDisabled ? true : void 0, // TODO: Test Focusable contentEditable. contentEditable: disabled ? void 0 : props.contentEditable, onKeyPressCapture, onClickCapture, onMouseDownCapture, onMouseDown, onKeyDownCapture, onFocusCapture, onBlur }); return removeUndefinedValues(props); } ); var Focusable = forwardRef2(function Focusable2(props) { const htmlProps = useFocusable(props); return HKOOKEDE_createElement(TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/2BDG6X5K.js "use client"; // src/composite/composite.tsx var _2BDG6X5K_TagName = "div"; function isGrid(items) { return items.some((item) => !!item.rowId); } function isPrintableKey(event) { const target = event.target; if (target && !isTextField(target)) return false; return event.key.length === 1 && !event.ctrlKey && !event.metaKey; } function isModifierKey(event) { return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta"; } function useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) { return useEvent((event) => { var _a; onKeyboardEvent == null ? void 0 : onKeyboardEvent(event); if (event.defaultPrevented) return; if (event.isPropagationStopped()) return; if (!isSelfTarget(event)) return; if (isModifierKey(event)) return; if (isPrintableKey(event)) return; const state = store.getState(); const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element; if (!activeElement) return; const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]); const previousElement = previousElementRef == null ? void 0 : previousElementRef.current; if (activeElement !== previousElement) { activeElement.focus(); } if (!fireKeyboardEvent(activeElement, event.type, eventInit)) { event.preventDefault(); } if (event.currentTarget.contains(activeElement)) { event.stopPropagation(); } }); } function findFirstEnabledItemInTheLastRow(items) { return _5VQZOHHZ_findFirstEnabledItem( flatten2DArray(reverseArray(_5VQZOHHZ_groupItemsByRows(items))) ); } function useScheduleFocus(store) { const [scheduled, setScheduled] = (0,external_React_.useState)(false); const schedule = (0,external_React_.useCallback)(() => setScheduled(true), []); const activeItem = store.useState( (state) => getEnabledItem(store, state.activeId) ); (0,external_React_.useEffect)(() => { const activeElement = activeItem == null ? void 0 : activeItem.element; if (!scheduled) return; if (!activeElement) return; setScheduled(false); activeElement.focus({ preventScroll: true }); }, [activeItem, scheduled]); return schedule; } var useComposite = createHook( function useComposite2(_a) { var _b = _a, { store, composite = true, focusOnMove = composite, moveOnKeyPress = true } = _b, props = __objRest(_b, [ "store", "composite", "focusOnMove", "moveOnKeyPress" ]); const context = useCompositeProviderContext(); store = store || context; invariant( store, false && 0 ); const ref = (0,external_React_.useRef)(null); const previousElementRef = (0,external_React_.useRef)(null); const scheduleFocus = useScheduleFocus(store); const moves = store.useState("moves"); const [, setBaseElement] = useTransactionState( composite ? store.setBaseElement : null ); (0,external_React_.useEffect)(() => { var _a2; if (!store) return; if (!moves) return; if (!composite) return; if (!focusOnMove) return; const { activeId: activeId2 } = store.getState(); const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; if (!itemElement) return; focusIntoView(itemElement); }, [store, moves, composite, focusOnMove]); useSafeLayoutEffect(() => { if (!store) return; if (!moves) return; if (!composite) return; const { baseElement, activeId: activeId2 } = store.getState(); const isSelfAcive = activeId2 === null; if (!isSelfAcive) return; if (!baseElement) return; const previousElement = previousElementRef.current; previousElementRef.current = null; if (previousElement) { fireBlurEvent(previousElement, { relatedTarget: baseElement }); } if (!hasFocus(baseElement)) { baseElement.focus(); } }, [store, moves, composite]); const activeId = store.useState("activeId"); const virtualFocus = store.useState("virtualFocus"); useSafeLayoutEffect(() => { var _a2; if (!store) return; if (!composite) return; if (!virtualFocus) return; const previousElement = previousElementRef.current; previousElementRef.current = null; if (!previousElement) return; const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element; const relatedTarget = activeElement || getActiveElement(previousElement); if (relatedTarget === previousElement) return; fireBlurEvent(previousElement, { relatedTarget }); }, [store, activeId, virtualFocus, composite]); const onKeyDownCapture = useKeyboardEventProxy( store, props.onKeyDownCapture, previousElementRef ); const onKeyUpCapture = useKeyboardEventProxy( store, props.onKeyUpCapture, previousElementRef ); const onFocusCaptureProp = props.onFocusCapture; const onFocusCapture = useEvent((event) => { onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); if (event.defaultPrevented) return; if (!store) return; const { virtualFocus: virtualFocus2 } = store.getState(); if (!virtualFocus2) return; const previousActiveElement = event.relatedTarget; const isSilentlyFocused = silentlyFocused(event.currentTarget); if (isSelfTarget(event) && isSilentlyFocused) { event.stopPropagation(); previousElementRef.current = previousActiveElement; } }); const onFocusProp = props.onFocus; const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); if (event.defaultPrevented) return; if (!composite) return; if (!store) return; const { relatedTarget } = event; const { virtualFocus: virtualFocus2 } = store.getState(); if (virtualFocus2) { if (isSelfTarget(event) && !isItem(store, relatedTarget)) { queueMicrotask(scheduleFocus); } } else if (isSelfTarget(event)) { store.setActiveId(null); } }); const onBlurCaptureProp = props.onBlurCapture; const onBlurCapture = useEvent((event) => { var _a2; onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); if (event.defaultPrevented) return; if (!store) return; const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState(); if (!virtualFocus2) return; const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element; const nextActiveElement = event.relatedTarget; const nextActiveElementIsItem = isItem(store, nextActiveElement); const previousElement = previousElementRef.current; previousElementRef.current = null; if (isSelfTarget(event) && nextActiveElementIsItem) { if (nextActiveElement === activeElement) { if (previousElement && previousElement !== nextActiveElement) { fireBlurEvent(previousElement, event); } } else if (activeElement) { fireBlurEvent(activeElement, event); } else if (previousElement) { fireBlurEvent(previousElement, event); } event.stopPropagation(); } else { const targetIsItem = isItem(store, event.target); if (!targetIsItem && activeElement) { fireBlurEvent(activeElement, event); } } }); const onKeyDownProp = props.onKeyDown; const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); const onKeyDown = useEvent((event) => { var _a2; onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (event.defaultPrevented) return; if (!store) return; if (!isSelfTarget(event)) return; const { orientation, items, renderedItems, activeId: activeId2 } = store.getState(); const activeItem = getEnabledItem(store, activeId2); if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected) return; const isVertical = orientation !== "horizontal"; const isHorizontal = orientation !== "vertical"; const grid = isGrid(renderedItems); const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End"; if (isHorizontalKey && isTextField(event.currentTarget)) return; const up = () => { if (grid) { const item = items && findFirstEnabledItemInTheLastRow(items); return item == null ? void 0 : item.id; } return store == null ? void 0 : store.last(); }; const keyMap = { ArrowUp: (grid || isVertical) && up, ArrowRight: (grid || isHorizontal) && store.first, ArrowDown: (grid || isVertical) && store.first, ArrowLeft: (grid || isHorizontal) && store.last, Home: store.first, End: store.last, PageUp: store.first, PageDown: store.last }; const action = keyMap[event.key]; if (action) { const id = action(); if (id !== void 0) { if (!moveOnKeyPressProp(event)) return; event.preventDefault(); store.move(id); } } }); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContextProvider, { value: store, children: element }), [store] ); const activeDescendant = store.useState((state) => { var _a2; if (!store) return; if (!composite) return; if (!state.virtualFocus) return; return (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id; }); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ "aria-activedescendant": activeDescendant }, props), { ref: useMergeRefs(ref, setBaseElement, props.ref), onKeyDownCapture, onKeyUpCapture, onFocusCapture, onFocus, onBlurCapture, onKeyDown }); const focusable = store.useState( (state) => composite && (state.virtualFocus || state.activeId === null) ); props = useFocusable(_3YLGPPWQ_spreadValues({ focusable }, props)); return props; } ); var _2BDG6X5K_Composite = forwardRef2(function Composite2(props) { const htmlProps = useComposite(props); return HKOOKEDE_createElement(_2BDG6X5K_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/context.js /** * WordPress dependencies */ /** * Internal dependencies */ const CompositeContext = (0,external_wp_element_namespaceObject.createContext)({}); const context_useCompositeContext = () => (0,external_wp_element_namespaceObject.useContext)(CompositeContext); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7HVFURXT.js "use client"; // src/group/group-label-context.tsx var GroupLabelContext = (0,external_React_.createContext)(void 0); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZPO4YZYE.js "use client"; // src/group/group.tsx var ZPO4YZYE_TagName = "div"; var useGroup = createHook( function useGroup2(props) { const [labelId, setLabelId] = (0,external_React_.useState)(); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupLabelContext.Provider, { value: setLabelId, children: element }), [] ); props = _3YLGPPWQ_spreadValues({ role: "group", "aria-labelledby": labelId }, props); return removeUndefinedValues(props); } ); var Group = forwardRef2(function Group2(props) { const htmlProps = useGroup(props); return HKOOKEDE_createElement(ZPO4YZYE_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IEKMDIUY.js "use client"; // src/composite/composite-group.tsx var IEKMDIUY_TagName = "div"; var useCompositeGroup = createHook( function useCompositeGroup2(_a) { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); props = useGroup(props); return props; } ); var IEKMDIUY_CompositeGroup = forwardRef2(function CompositeGroup2(props) { const htmlProps = useCompositeGroup(props); return HKOOKEDE_createElement(IEKMDIUY_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/group.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const CompositeGroup = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeGroup(props, ref) { const context = context_useCompositeContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(IEKMDIUY_CompositeGroup, { store: context.store, ...props, ref: ref }); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IGFP5YPG.js "use client"; // src/group/group-label.tsx var IGFP5YPG_TagName = "div"; var useGroupLabel = createHook( function useGroupLabel2(props) { const setLabelId = (0,external_React_.useContext)(GroupLabelContext); const id = useId(props.id); useSafeLayoutEffect(() => { setLabelId == null ? void 0 : setLabelId(id); return () => setLabelId == null ? void 0 : setLabelId(void 0); }, [setLabelId, id]); props = _3YLGPPWQ_spreadValues({ id, "aria-hidden": true }, props); return removeUndefinedValues(props); } ); var GroupLabel = forwardRef2(function GroupLabel2(props) { const htmlProps = useGroupLabel(props); return HKOOKEDE_createElement(IGFP5YPG_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/Y2MAXF6C.js "use client"; // src/composite/composite-group-label.tsx var Y2MAXF6C_TagName = "div"; var useCompositeGroupLabel = createHook(function useCompositeGroupLabel2(_a) { var _b = _a, { store } = _b, props = __objRest(_b, ["store"]); props = useGroupLabel(props); return props; }); var Y2MAXF6C_CompositeGroupLabel = forwardRef2(function CompositeGroupLabel2(props) { const htmlProps = useCompositeGroupLabel(props); return HKOOKEDE_createElement(Y2MAXF6C_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/group-label.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const CompositeGroupLabel = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeGroupLabel(props, ref) { const context = context_useCompositeContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Y2MAXF6C_CompositeGroupLabel, { store: context.store, ...props, ref: ref }); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OBZMLI6J.js "use client"; // src/composite/composite-hover.tsx var OBZMLI6J_TagName = "div"; function getMouseDestination(event) { const relatedTarget = event.relatedTarget; if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) { return relatedTarget; } return null; } function hoveringInside(event) { const nextElement = getMouseDestination(event); if (!nextElement) return false; return contains(event.currentTarget, nextElement); } var symbol = Symbol("composite-hover"); function movingToAnotherItem(event) { let dest = getMouseDestination(event); if (!dest) return false; do { if (PBFD2E7P_hasOwnProperty(dest, symbol) && dest[symbol]) return true; dest = dest.parentElement; } while (dest); return false; } var useCompositeHover = createHook( function useCompositeHover2(_a) { var _b = _a, { store, focusOnHover = true, blurOnHoverEnd = !!focusOnHover } = _b, props = __objRest(_b, [ "store", "focusOnHover", "blurOnHoverEnd" ]); const context = useCompositeContext(); store = store || context; invariant( store, false && 0 ); const isMouseMoving = useIsMouseMoving(); const onMouseMoveProp = props.onMouseMove; const focusOnHoverProp = useBooleanEvent(focusOnHover); const onMouseMove = useEvent((event) => { onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); if (event.defaultPrevented) return; if (!isMouseMoving()) return; if (!focusOnHoverProp(event)) return; if (!hasFocusWithin(event.currentTarget)) { const baseElement = store == null ? void 0 : store.getState().baseElement; if (baseElement && !hasFocus(baseElement)) { baseElement.focus(); } } store == null ? void 0 : store.setActiveId(event.currentTarget.id); }); const onMouseLeaveProp = props.onMouseLeave; const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd); const onMouseLeave = useEvent((event) => { var _a2; onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event); if (event.defaultPrevented) return; if (!isMouseMoving()) return; if (hoveringInside(event)) return; if (movingToAnotherItem(event)) return; if (!focusOnHoverProp(event)) return; if (!blurOnHoverEndProp(event)) return; store == null ? void 0 : store.setActiveId(null); (_a2 = store == null ? void 0 : store.getState().baseElement) == null ? void 0 : _a2.focus(); }); const ref = (0,external_React_.useCallback)((element) => { if (!element) return; element[symbol] = true; }, []); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref: useMergeRefs(ref, props.ref), onMouseMove, onMouseLeave }); return removeUndefinedValues(props); } ); var OBZMLI6J_CompositeHover = memo2( forwardRef2(function CompositeHover2(props) { const htmlProps = useCompositeHover(props); return HKOOKEDE_createElement(OBZMLI6J_TagName, htmlProps); }) ); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/hover.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const CompositeHover = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeHover(props, ref) { const context = context_useCompositeContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OBZMLI6J_CompositeHover, { store: context.store, ...props, ref: ref }); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/PLQDTVXM.js "use client"; // src/collection/collection-item.tsx var PLQDTVXM_TagName = "div"; var useCollectionItem = createHook( function useCollectionItem2(_a) { var _b = _a, { store, shouldRegisterItem = true, getItem = identity, element: element } = _b, props = __objRest(_b, [ "store", "shouldRegisterItem", "getItem", // @ts-expect-error This prop may come from a collection renderer. "element" ]); const context = useCollectionContext(); store = store || context; const id = useId(props.id); const ref = (0,external_React_.useRef)(element); (0,external_React_.useEffect)(() => { const element2 = ref.current; if (!id) return; if (!element2) return; if (!shouldRegisterItem) return; const item = getItem({ id, element: element2 }); return store == null ? void 0 : store.renderItem(item); }, [id, shouldRegisterItem, getItem, store]); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref: useMergeRefs(ref, props.ref) }); return removeUndefinedValues(props); } ); var CollectionItem = forwardRef2(function CollectionItem2(props) { const htmlProps = useCollectionItem(props); return HKOOKEDE_createElement(PLQDTVXM_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HGP5L2ST.js "use client"; // src/command/command.tsx var HGP5L2ST_TagName = "button"; function isNativeClick(event) { if (!event.isTrusted) return false; const element = event.currentTarget; if (event.key === "Enter") { return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A"; } if (event.key === " ") { return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT"; } return false; } var HGP5L2ST_symbol = Symbol("command"); var useCommand = createHook( function useCommand2(_a) { var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]); const ref = (0,external_React_.useRef)(null); const tagName = useTagName(ref); const type = props.type; const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( () => !!tagName && isButton({ tagName, type }) ); (0,external_React_.useEffect)(() => { if (!ref.current) return; setIsNativeButton(isButton(ref.current)); }, []); const [active, setActive] = (0,external_React_.useState)(false); const activeRef = (0,external_React_.useRef)(false); const disabled = disabledFromProps(props); const [isDuplicate, metadataProps] = useMetadataProps(props, HGP5L2ST_symbol, true); const onKeyDownProp = props.onKeyDown; const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); const element = event.currentTarget; if (event.defaultPrevented) return; if (isDuplicate) return; if (disabled) return; if (!isSelfTarget(event)) return; if (isTextField(element)) return; if (element.isContentEditable) return; const isEnter = clickOnEnter && event.key === "Enter"; const isSpace = clickOnSpace && event.key === " "; const shouldPreventEnter = event.key === "Enter" && !clickOnEnter; const shouldPreventSpace = event.key === " " && !clickOnSpace; if (shouldPreventEnter || shouldPreventSpace) { event.preventDefault(); return; } if (isEnter || isSpace) { const nativeClick = isNativeClick(event); if (isEnter) { if (!nativeClick) { event.preventDefault(); const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); const click = () => fireClickEvent(element, eventInit); if (isFirefox()) { queueBeforeEvent(element, "keyup", click); } else { queueMicrotask(click); } } } else if (isSpace) { activeRef.current = true; if (!nativeClick) { event.preventDefault(); setActive(true); } } } }); const onKeyUpProp = props.onKeyUp; const onKeyUp = useEvent((event) => { onKeyUpProp == null ? void 0 : onKeyUpProp(event); if (event.defaultPrevented) return; if (isDuplicate) return; if (disabled) return; if (event.metaKey) return; const isSpace = clickOnSpace && event.key === " "; if (activeRef.current && isSpace) { activeRef.current = false; if (!isNativeClick(event)) { event.preventDefault(); setActive(false); const element = event.currentTarget; const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); queueMicrotask(() => fireClickEvent(element, eventInit)); } } }); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues(_3YLGPPWQ_spreadValues({ "data-active": active || void 0, type: isNativeButton ? "button" : void 0 }, metadataProps), props), { ref: useMergeRefs(ref, props.ref), onKeyDown, onKeyUp }); props = useFocusable(props); return props; } ); var Command = forwardRef2(function Command2(props) { const htmlProps = useCommand(props); return HKOOKEDE_createElement(HGP5L2ST_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7QKWW6TW.js "use client"; // src/composite/composite-item.tsx var _7QKWW6TW_TagName = "button"; function isEditableElement(element) { if (isTextbox(element)) return true; return element.tagName === "INPUT" && !isButton(element); } function getNextPageOffset(scrollingElement, pageUp = false) { const height = scrollingElement.clientHeight; const { top } = scrollingElement.getBoundingClientRect(); const pageSize = Math.max(height * 0.875, height - 40) * 1.5; const pageOffset = pageUp ? height - pageSize + top : pageSize + top; if (scrollingElement.tagName === "HTML") { return pageOffset + scrollingElement.scrollTop; } return pageOffset; } function getItemOffset(itemElement, pageUp = false) { const { top } = itemElement.getBoundingClientRect(); if (pageUp) { return top + itemElement.clientHeight; } return top; } function findNextPageItemId(element, store, next, pageUp = false) { var _a; if (!store) return; if (!next) return; const { renderedItems } = store.getState(); const scrollingElement = getScrollingElement(element); if (!scrollingElement) return; const nextPageOffset = getNextPageOffset(scrollingElement, pageUp); let id; let prevDifference; for (let i = 0; i < renderedItems.length; i += 1) { const previousId = id; id = next(i); if (!id) break; if (id === previousId) continue; const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element; if (!itemElement) continue; const itemOffset = getItemOffset(itemElement, pageUp); const difference = itemOffset - nextPageOffset; const absDifference = Math.abs(difference); if (pageUp && difference <= 0 || !pageUp && difference >= 0) { if (prevDifference !== void 0 && prevDifference < absDifference) { id = previousId; } break; } prevDifference = absDifference; } return id; } function targetIsAnotherItem(event, store) { if (isSelfTarget(event)) return false; return isItem(store, event.target); } var useCompositeItem = createHook( function useCompositeItem2(_a) { var _b = _a, { store, rowId: rowIdProp, preventScrollOnKeyDown = false, moveOnKeyPress = true, tabbable = false, getItem: getItemProp, "aria-setsize": ariaSetSizeProp, "aria-posinset": ariaPosInSetProp } = _b, props = __objRest(_b, [ "store", "rowId", "preventScrollOnKeyDown", "moveOnKeyPress", "tabbable", "getItem", "aria-setsize", "aria-posinset" ]); const context = useCompositeContext(); store = store || context; const id = useId(props.id); const ref = (0,external_React_.useRef)(null); const row = (0,external_React_.useContext)(CompositeRowContext); const rowId = useStoreState(store, (state) => { if (rowIdProp) return rowIdProp; if (!state) return; if (!(row == null ? void 0 : row.baseElement)) return; if (row.baseElement !== state.baseElement) return; return row.id; }); const disabled = disabledFromProps(props); const trulyDisabled = disabled && !props.accessibleWhenDisabled; const getItem = (0,external_React_.useCallback)( (item) => { const nextItem = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, item), { id: id || item.id, rowId, disabled: !!trulyDisabled }); if (getItemProp) { return getItemProp(nextItem); } return nextItem; }, [id, rowId, trulyDisabled, getItemProp] ); const onFocusProp = props.onFocus; const hasFocusedComposite = (0,external_React_.useRef)(false); const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); if (event.defaultPrevented) return; if (isPortalEvent(event)) return; if (!id) return; if (!store) return; if (targetIsAnotherItem(event, store)) return; const { virtualFocus, baseElement: baseElement2 } = store.getState(); store.setActiveId(id); if (isTextbox(event.currentTarget)) { selectTextField(event.currentTarget); } if (!virtualFocus) return; if (!isSelfTarget(event)) return; if (isEditableElement(event.currentTarget)) return; if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return; if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) { event.currentTarget.scrollIntoView({ block: "nearest", inline: "nearest" }); } hasFocusedComposite.current = true; const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget); if (fromComposite) { focusSilently(baseElement2); } else { baseElement2.focus(); } }); const onBlurCaptureProp = props.onBlurCapture; const onBlurCapture = useEvent((event) => { onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); if (event.defaultPrevented) return; const state = store == null ? void 0 : store.getState(); if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) { hasFocusedComposite.current = false; event.preventDefault(); event.stopPropagation(); } }); const onKeyDownProp = props.onKeyDown; const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown); const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (event.defaultPrevented) return; if (!isSelfTarget(event)) return; if (!store) return; const { currentTarget } = event; const state = store.getState(); const item = store.item(id); const isGrid = !!(item == null ? void 0 : item.rowId); const isVertical = state.orientation !== "horizontal"; const isHorizontal = state.orientation !== "vertical"; const canHomeEnd = () => { if (isGrid) return true; if (isHorizontal) return true; if (!state.baseElement) return true; if (!isTextField(state.baseElement)) return true; return false; }; const keyMap = { ArrowUp: (isGrid || isVertical) && store.up, ArrowRight: (isGrid || isHorizontal) && store.next, ArrowDown: (isGrid || isVertical) && store.down, ArrowLeft: (isGrid || isHorizontal) && store.previous, Home: () => { if (!canHomeEnd()) return; if (!isGrid || event.ctrlKey) { return store == null ? void 0 : store.first(); } return store == null ? void 0 : store.previous(-1); }, End: () => { if (!canHomeEnd()) return; if (!isGrid || event.ctrlKey) { return store == null ? void 0 : store.last(); } return store == null ? void 0 : store.next(-1); }, PageUp: () => { return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true); }, PageDown: () => { return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down); } }; const action = keyMap[event.key]; if (action) { if (isTextbox(currentTarget)) { const selection = getTextboxSelection(currentTarget); const isLeft = isHorizontal && event.key === "ArrowLeft"; const isRight = isHorizontal && event.key === "ArrowRight"; const isUp = isVertical && event.key === "ArrowUp"; const isDown = isVertical && event.key === "ArrowDown"; if (isRight || isDown) { const { length: valueLength } = getTextboxValue(currentTarget); if (selection.end !== valueLength) return; } else if ((isLeft || isUp) && selection.start !== 0) return; } const nextId = action(); if (preventScrollOnKeyDownProp(event) || nextId !== void 0) { if (!moveOnKeyPressProp(event)) return; event.preventDefault(); store.move(nextId); } } }); const baseElement = useStoreState( store, (state) => (state == null ? void 0 : state.baseElement) || void 0 ); const providerValue = (0,external_React_.useMemo)( () => ({ id, baseElement }), [id, baseElement] ); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), [providerValue] ); const isActiveItem = useStoreState( store, (state) => !!state && state.activeId === id ); const ariaSetSize = useStoreState(store, (state) => { if (ariaSetSizeProp != null) return ariaSetSizeProp; if (!state) return; if (!(row == null ? void 0 : row.ariaSetSize)) return; if (row.baseElement !== state.baseElement) return; return row.ariaSetSize; }); const ariaPosInSet = useStoreState(store, (state) => { if (ariaPosInSetProp != null) return ariaPosInSetProp; if (!state) return; if (!(row == null ? void 0 : row.ariaPosInSet)) return; if (row.baseElement !== state.baseElement) return; const itemsInRow = state.renderedItems.filter( (item) => item.rowId === rowId ); return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); }); const isTabbable = useStoreState(store, (state) => { if (!(state == null ? void 0 : state.renderedItems.length)) return true; if (state.virtualFocus) return false; if (tabbable) return true; return state.activeId === id; }); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, "data-active-item": isActiveItem || void 0 }, props), { ref: useMergeRefs(ref, props.ref), tabIndex: isTabbable ? props.tabIndex : -1, onFocus, onBlurCapture, onKeyDown }); props = useCommand(props); props = useCollectionItem(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ store }, props), { getItem, shouldRegisterItem: id ? props.shouldRegisterItem : false })); return removeUndefinedValues(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { "aria-setsize": ariaSetSize, "aria-posinset": ariaPosInSet })); } ); var _7QKWW6TW_CompositeItem = memo2( forwardRef2(function CompositeItem2(props) { const htmlProps = useCompositeItem(props); return HKOOKEDE_createElement(_7QKWW6TW_TagName, htmlProps); }) ); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/item.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const CompositeItem = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeItem(props, ref) { const context = context_useCompositeContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(_7QKWW6TW_CompositeItem, { store: context.store, ...props, ref: ref }); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6BE7QOX5.js "use client"; // src/composite/composite-row.tsx var _6BE7QOX5_TagName = "div"; var useCompositeRow = createHook( function useCompositeRow2(_a) { var _b = _a, { store, "aria-setsize": ariaSetSize, "aria-posinset": ariaPosInSet } = _b, props = __objRest(_b, [ "store", "aria-setsize", "aria-posinset" ]); const context = useCompositeContext(); store = store || context; invariant( store, false && 0 ); const id = useId(props.id); const baseElement = store.useState( (state) => state.baseElement || void 0 ); const providerValue = (0,external_React_.useMemo)( () => ({ id, baseElement, ariaSetSize, ariaPosInSet }), [id, baseElement, ariaSetSize, ariaPosInSet] ); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeRowContext.Provider, { value: providerValue, children: element }), [providerValue] ); props = _3YLGPPWQ_spreadValues({ id }, props); return removeUndefinedValues(props); } ); var _6BE7QOX5_CompositeRow = forwardRef2(function CompositeRow2(props) { const htmlProps = useCompositeRow(props); return HKOOKEDE_createElement(_6BE7QOX5_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/row.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const CompositeRow = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeRow(props, ref) { const context = context_useCompositeContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(_6BE7QOX5_CompositeRow, { store: context.store, ...props, ref: ref }); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/DS36B3MQ.js "use client"; // src/composite/composite-typeahead.tsx var DS36B3MQ_TagName = "div"; var chars = ""; function clearChars() { chars = ""; } function isValidTypeaheadEvent(event) { const target = event.target; if (target && isTextField(target)) return false; if (event.key === " " && chars.length) return true; return event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey && /^[\p{Letter}\p{Number}]$/u.test(event.key); } function isSelfTargetOrItem(event, items) { if (isSelfTarget(event)) return true; const target = event.target; if (!target) return false; const isItem = items.some((item) => item.element === target); return isItem; } function DS36B3MQ_getEnabledItems(items) { return items.filter((item) => !item.disabled); } function itemTextStartsWith(item, text) { var _a; const itemText = ((_a = item.element) == null ? void 0 : _a.textContent) || item.children || // The composite item object itself doesn't include a value property, but // other components like Select do. Since CompositeTypeahead is a generic // component that can be used with those as well, we also consider the value // property as a fallback for the typeahead text content. "value" in item && item.value; if (!itemText) return false; return normalizeString(itemText).trim().toLowerCase().startsWith(text.toLowerCase()); } function getSameInitialItems(items, char, activeId) { if (!activeId) return items; const activeItem = items.find((item) => item.id === activeId); if (!activeItem) return items; if (!itemTextStartsWith(activeItem, char)) return items; if (chars !== char && itemTextStartsWith(activeItem, chars)) return items; chars = char; return _5VQZOHHZ_flipItems( items.filter((item) => itemTextStartsWith(item, chars)), activeId ).filter((item) => item.id !== activeId); } var useCompositeTypeahead = createHook(function useCompositeTypeahead2(_a) { var _b = _a, { store, typeahead = true } = _b, props = __objRest(_b, ["store", "typeahead"]); const context = useCompositeContext(); store = store || context; invariant( store, false && 0 ); const onKeyDownCaptureProp = props.onKeyDownCapture; const cleanupTimeoutRef = (0,external_React_.useRef)(0); const onKeyDownCapture = useEvent((event) => { onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); if (event.defaultPrevented) return; if (!typeahead) return; if (!store) return; const { renderedItems, items, activeId } = store.getState(); if (!isValidTypeaheadEvent(event)) return clearChars(); let enabledItems = DS36B3MQ_getEnabledItems( renderedItems.length ? renderedItems : items ); if (!isSelfTargetOrItem(event, enabledItems)) return clearChars(); event.preventDefault(); window.clearTimeout(cleanupTimeoutRef.current); cleanupTimeoutRef.current = window.setTimeout(() => { chars = ""; }, 500); const char = event.key.toLowerCase(); chars += char; enabledItems = getSameInitialItems(enabledItems, char, activeId); const item = enabledItems.find((item2) => itemTextStartsWith(item2, chars)); if (item) { store.move(item.id); } else { clearChars(); } }); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { onKeyDownCapture }); return removeUndefinedValues(props); }); var DS36B3MQ_CompositeTypeahead = forwardRef2(function CompositeTypeahead2(props) { const htmlProps = useCompositeTypeahead(props); return HKOOKEDE_createElement(DS36B3MQ_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/typeahead.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const CompositeTypeahead = (0,external_wp_element_namespaceObject.forwardRef)(function CompositeTypeahead(props, ref) { const context = context_useCompositeContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DS36B3MQ_CompositeTypeahead, { store: context.store, ...props, ref: ref }); }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/composite/index.js /** * Composite is a component that may contain navigable items represented by * Composite.Item. It's inspired by the WAI-ARIA Composite Role and implements * all the keyboard navigation mechanisms to ensure that there's only one * tab stop for the whole Composite element. This means that it can behave as * a roving tabindex or aria-activedescendant container. * * @see https://ariakit.org/components/composite */ /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Renders a widget based on the WAI-ARIA [`composite`](https://w3c.github.io/aria/#composite) * role, which provides a single tab stop on the page and arrow key navigation * through the focusable descendants. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * * * Item 1 * Item 2 * * ``` */ const Composite = Object.assign((0,external_wp_element_namespaceObject.forwardRef)(function Composite({ // Composite store props activeId, defaultActiveId, setActiveId, focusLoop = false, focusWrap = false, focusShift = false, virtualFocus = false, orientation = 'both', rtl = (0,external_wp_i18n_namespaceObject.isRTL)(), // Composite component props children, disabled = false, // Rest props ...props }, ref) { const store = useCompositeStore({ activeId, defaultActiveId, setActiveId, focusLoop, focusWrap, focusShift, virtualFocus, orientation, rtl }); const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ store }), [store]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(_2BDG6X5K_Composite, { disabled: disabled, store: store, ...props, ref: ref, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContext.Provider, { value: contextValue, children: children }) }); }), { /** * Renders a group element for composite items. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * * * * Label * Item 1 * Item 2 * * * ``` */ Group: Object.assign(CompositeGroup, { displayName: 'Composite.Group' }), /** * Renders a label in a composite group. This component must be wrapped with * `Composite.Group` so the `aria-labelledby` prop is properly set on the * composite group element. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * * * * Label * Item 1 * Item 2 * * * ``` */ GroupLabel: Object.assign(CompositeGroupLabel, { displayName: 'Composite.GroupLabel' }), /** * Renders a composite item. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * * * Item 1 * Item 2 * Item 3 * * ``` */ Item: Object.assign(CompositeItem, { displayName: 'Composite.Item' }), /** * Renders a composite row. Wrapping `Composite.Item` elements within * `Composite.Row` will create a two-dimensional composite widget, such as a * grid. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * * * * Item 1.1 * Item 1.2 * Item 1.3 * * * Item 2.1 * Item 2.2 * Item 2.3 * * * ``` */ Row: Object.assign(CompositeRow, { displayName: 'Composite.Row' }), /** * Renders an element in a composite widget that receives focus on mouse move * and loses focus to the composite base element on mouse leave. This should * be combined with the `Composite.Item` component. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * * * }> * Item 1 * * }> * Item 2 * * * ``` */ Hover: Object.assign(CompositeHover, { displayName: 'Composite.Hover' }), /** * Renders a component that adds typeahead functionality to composite * components. Hitting printable character keys will move focus to the next * composite item that begins with the input characters. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * * }> * Item 1 * Item 2 * * ``` */ Typeahead: Object.assign(CompositeTypeahead, { displayName: 'Composite.Typeahead' }), /** * The React context used by the composite components. It can be used by * to access the composite store, and to forward the context when composite * sub-components are rendered across portals (ie. `SlotFill` components) * that would not otherwise forward the context to the `Fill` children. * * @example * ```jsx * import { Composite } from '@wordpress/components'; * import { useContext } from '@wordpress/element'; * * const compositeContext = useContext( Composite.Context ); * ``` */ Context: Object.assign(CompositeContext, { displayName: 'Composite.Context' }) }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/6E4KKOSB.js "use client"; // src/disclosure/disclosure-store.ts function createDisclosureStore(props = {}) { const store = mergeStore( props.store, omit2(props.disclosure, ["contentElement", "disclosureElement"]) ); throwOnConflictingProps(props, store); const syncState = store == null ? void 0 : store.getState(); const open = defaultValue( props.open, syncState == null ? void 0 : syncState.open, props.defaultOpen, false ); const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); const initialState = { open, animated, animating: !!animated && open, mounted: open, contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) }; const disclosure = createStore(initialState, store); setup( disclosure, () => sync(disclosure, ["animated", "animating"], (state) => { if (state.animated) return; disclosure.setState("animating", false); }) ); setup( disclosure, () => subscribe(disclosure, ["open"], () => { if (!disclosure.getState().animated) return; disclosure.setState("animating", true); }) ); setup( disclosure, () => sync(disclosure, ["open", "animating"], (state) => { disclosure.setState("mounted", state.open || state.animating); }) ); return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, disclosure), { disclosure: props.disclosure, setOpen: (value) => disclosure.setState("open", value), show: () => disclosure.setState("open", true), hide: () => disclosure.setState("open", false), toggle: () => disclosure.setState("open", (open2) => !open2), stopAnimation: () => disclosure.setState("animating", false), setContentElement: (value) => disclosure.setState("contentElement", value), setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KGK2TTFO.js "use client"; // src/disclosure/disclosure-store.ts function useDisclosureStoreProps(store, update, props) { useUpdateEffect(update, [props.store, props.disclosure]); useStoreProps(store, props, "open", "setOpen"); useStoreProps(store, props, "mounted", "setMounted"); useStoreProps(store, props, "animated"); return Object.assign(store, { disclosure: props.disclosure }); } function useDisclosureStore(props = {}) { const [store, update] = _2GXGCHW6_useStore(createDisclosureStore, props); return useDisclosureStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/YOHCVXJB.js "use client"; // src/dialog/dialog-store.ts function createDialogStore(props = {}) { return createDisclosureStore(props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/QYS5FHDY.js "use client"; // src/dialog/dialog-store.ts function useDialogStoreProps(store, update, props) { return useDisclosureStoreProps(store, update, props); } function useDialogStore(props = {}) { const [store, update] = _2GXGCHW6_useStore(createDialogStore, props); return useDialogStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CBC47ZYL.js "use client"; // src/popover/popover-store.ts function usePopoverStoreProps(store, update, props) { useUpdateEffect(update, [props.popover]); useStoreProps(store, props, "placement"); return useDialogStoreProps(store, update, props); } function usePopoverStore(props = {}) { const [store, update] = useStore(Core.createPopoverStore, props); return usePopoverStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XMDAT5SM.js "use client"; // src/hovercard/hovercard-store.ts function useHovercardStoreProps(store, update, props) { useStoreProps(store, props, "timeout"); useStoreProps(store, props, "showTimeout"); useStoreProps(store, props, "hideTimeout"); return usePopoverStoreProps(store, update, props); } function useHovercardStore(props = {}) { const [store, update] = useStore(Core.createHovercardStore, props); return useHovercardStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/3UYWTADI.js "use client"; // src/popover/popover-store.ts function createPopoverStore(_a = {}) { var _b = _a, { popover: otherPopover } = _b, props = _3YLGPPWQ_objRest(_b, [ "popover" ]); const store = mergeStore( props.store, omit2(otherPopover, [ "arrowElement", "anchorElement", "contentElement", "popoverElement", "disclosureElement" ]) ); throwOnConflictingProps(props, store); const syncState = store == null ? void 0 : store.getState(); const dialog = createDialogStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { store })); const placement = defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "bottom" ); const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, dialog.getState()), { placement, currentPlacement: placement, anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), rendered: Symbol("rendered") }); const popover = createStore(initialState, dialog, store); return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, dialog), popover), { setAnchorElement: (element) => popover.setState("anchorElement", element), setPopoverElement: (element) => popover.setState("popoverElement", element), setArrowElement: (element) => popover.setState("arrowElement", element), render: () => popover.setState("rendered", Symbol("rendered")) }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/EACLTACN.js "use client"; // src/hovercard/hovercard-store.ts function createHovercardStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const popover = createPopoverStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { placement: defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "bottom" ) })); const timeout = defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500); const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, popover.getState()), { timeout, showTimeout: defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout), hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout), autoFocusOnShow: defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false) }); const hovercard = createStore(initialState, popover, props.store); return _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, popover), hovercard), { setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value) }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/tooltip/tooltip-store.js "use client"; // src/tooltip/tooltip-store.ts function createTooltipStore(props = {}) { var _a; if (false) {} const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const hovercard = createHovercardStore(_chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, props), { placement: defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "top" ), hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0) })); const initialState = _chunks_3YLGPPWQ_spreadProps(_chunks_3YLGPPWQ_spreadValues({}, hovercard.getState()), { type: defaultValue(props.type, syncState == null ? void 0 : syncState.type, "description"), skipTimeout: defaultValue(props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300) }); const tooltip = createStore(initialState, hovercard, props.store); return _chunks_3YLGPPWQ_spreadValues(_chunks_3YLGPPWQ_spreadValues({}, hovercard), tooltip); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/2D53SX6Q.js "use client"; // src/tooltip/tooltip-store.ts function useTooltipStoreProps(store, update, props) { useStoreProps(store, props, "type"); useStoreProps(store, props, "skipTimeout"); return useHovercardStoreProps(store, update, props); } function useTooltipStore(props = {}) { const [store, update] = _2GXGCHW6_useStore(createTooltipStore, props); return useTooltipStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/AXRBYZQP.js "use client"; // src/role/role.tsx var AXRBYZQP_TagName = "div"; var AXRBYZQP_elements = [ "a", "button", "details", "dialog", "div", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "img", "input", "label", "li", "nav", "ol", "p", "section", "select", "span", "summary", "textarea", "ul", "svg" ]; var useRole = createHook( function useRole2(props) { return props; } ); var Role = forwardRef2( // @ts-expect-error function Role2(props) { return HKOOKEDE_createElement(AXRBYZQP_TagName, props); } ); Object.assign( Role, AXRBYZQP_elements.reduce((acc, element) => { acc[element] = forwardRef2(function Role3(props) { return HKOOKEDE_createElement(element, props); }); return acc; }, {}) ); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/RGUP62TM.js "use client"; // src/disclosure/disclosure-context.tsx var RGUP62TM_ctx = createStoreContext(); var useDisclosureContext = RGUP62TM_ctx.useContext; var useDisclosureScopedContext = RGUP62TM_ctx.useScopedContext; var useDisclosureProviderContext = RGUP62TM_ctx.useProviderContext; var DisclosureContextProvider = RGUP62TM_ctx.ContextProvider; var DisclosureScopedContextProvider = RGUP62TM_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/DU4D3UCJ.js "use client"; // src/dialog/dialog-context.tsx var DU4D3UCJ_ctx = createStoreContext( [DisclosureContextProvider], [DisclosureScopedContextProvider] ); var useDialogContext = DU4D3UCJ_ctx.useContext; var useDialogScopedContext = DU4D3UCJ_ctx.useScopedContext; var useDialogProviderContext = DU4D3UCJ_ctx.useProviderContext; var DialogContextProvider = DU4D3UCJ_ctx.ContextProvider; var DialogScopedContextProvider = DU4D3UCJ_ctx.ScopedContextProvider; var DialogHeadingContext = (0,external_React_.createContext)(void 0); var DialogDescriptionContext = (0,external_React_.createContext)(void 0); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/54MGSIOI.js "use client"; // src/popover/popover-context.tsx var _54MGSIOI_ctx = createStoreContext( [DialogContextProvider], [DialogScopedContextProvider] ); var usePopoverContext = _54MGSIOI_ctx.useContext; var usePopoverScopedContext = _54MGSIOI_ctx.useScopedContext; var usePopoverProviderContext = _54MGSIOI_ctx.useProviderContext; var PopoverContextProvider = _54MGSIOI_ctx.ContextProvider; var PopoverScopedContextProvider = _54MGSIOI_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CTQR3VDU.js "use client"; // src/hovercard/hovercard-context.tsx var CTQR3VDU_ctx = createStoreContext( [PopoverContextProvider], [PopoverScopedContextProvider] ); var useHovercardContext = CTQR3VDU_ctx.useContext; var useHovercardScopedContext = CTQR3VDU_ctx.useScopedContext; var useHovercardProviderContext = CTQR3VDU_ctx.useProviderContext; var HovercardContextProvider = CTQR3VDU_ctx.ContextProvider; var HovercardScopedContextProvider = CTQR3VDU_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CF4NC545.js "use client"; // src/hovercard/hovercard-anchor.tsx var CF4NC545_TagName = "a"; var useHovercardAnchor = createHook( function useHovercardAnchor2(_a) { var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); const context = useHovercardProviderContext(); store = store || context; invariant( store, false && 0 ); const disabled = disabledFromProps(props); const showTimeoutRef = (0,external_React_.useRef)(0); (0,external_React_.useEffect)(() => () => window.clearTimeout(showTimeoutRef.current), []); (0,external_React_.useEffect)(() => { const onMouseLeave = (event) => { if (!store) return; const { anchorElement } = store.getState(); if (!anchorElement) return; if (event.target !== anchorElement) return; window.clearTimeout(showTimeoutRef.current); showTimeoutRef.current = 0; }; return addGlobalEventListener("mouseleave", onMouseLeave, true); }, [store]); const onMouseMoveProp = props.onMouseMove; const showOnHoverProp = useBooleanEvent(showOnHover); const isMouseMoving = useIsMouseMoving(); const onMouseMove = useEvent((event) => { onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); if (disabled) return; if (!store) return; if (event.defaultPrevented) return; if (showTimeoutRef.current) return; if (!isMouseMoving()) return; if (!showOnHoverProp(event)) return; const element = event.currentTarget; store.setAnchorElement(element); store.setDisclosureElement(element); const { showTimeout, timeout } = store.getState(); const showHovercard = () => { showTimeoutRef.current = 0; if (!isMouseMoving()) return; store == null ? void 0 : store.setAnchorElement(element); store == null ? void 0 : store.show(); queueMicrotask(() => { store == null ? void 0 : store.setDisclosureElement(element); }); }; const timeoutMs = showTimeout != null ? showTimeout : timeout; if (timeoutMs === 0) { showHovercard(); } else { showTimeoutRef.current = window.setTimeout(showHovercard, timeoutMs); } }); const onClickProp = props.onClick; const onClick = useEvent((event) => { onClickProp == null ? void 0 : onClickProp(event); if (!store) return; window.clearTimeout(showTimeoutRef.current); showTimeoutRef.current = 0; }); const ref = (0,external_React_.useCallback)( (element) => { if (!store) return; const { anchorElement } = store.getState(); if (anchorElement == null ? void 0 : anchorElement.isConnected) return; store.setAnchorElement(element); }, [store] ); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref: useMergeRefs(ref, props.ref), onMouseMove, onClick }); props = useFocusable(props); return props; } ); var HovercardAnchor = forwardRef2(function HovercardAnchor2(props) { const htmlProps = useHovercardAnchor(props); return HKOOKEDE_createElement(CF4NC545_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TWCRTUOB.js "use client"; // src/tooltip/tooltip-context.tsx var TWCRTUOB_ctx = createStoreContext( [HovercardContextProvider], [HovercardScopedContextProvider] ); var useTooltipContext = TWCRTUOB_ctx.useContext; var useTooltipScopedContext = TWCRTUOB_ctx.useScopedContext; var useTooltipProviderContext = TWCRTUOB_ctx.useProviderContext; var TooltipContextProvider = TWCRTUOB_ctx.ContextProvider; var TooltipScopedContextProvider = TWCRTUOB_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip-anchor.js "use client"; // src/tooltip/tooltip-anchor.tsx var tooltip_anchor_TagName = "div"; var globalStore = createStore({ activeStore: null }); function createRemoveStoreCallback(store) { return () => { const { activeStore } = globalStore.getState(); if (activeStore !== store) return; globalStore.setState("activeStore", null); }; } var useTooltipAnchor = createHook( function useTooltipAnchor2(_a) { var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); const context = useTooltipProviderContext(); store = store || context; invariant( store, false && 0 ); const canShowOnHoverRef = (0,external_React_.useRef)(false); (0,external_React_.useEffect)(() => { return sync(store, ["mounted"], (state) => { if (state.mounted) return; canShowOnHoverRef.current = false; }); }, [store]); (0,external_React_.useEffect)(() => { if (!store) return; return chain( // Immediately remove the current store from the global store when // the component unmounts. This is useful, for example, to avoid // showing tooltips immediately on serial tests. createRemoveStoreCallback(store), sync(store, ["mounted", "skipTimeout"], (state) => { if (!store) return; if (state.mounted) { const { activeStore } = globalStore.getState(); if (activeStore !== store) { activeStore == null ? void 0 : activeStore.hide(); } return globalStore.setState("activeStore", store); } const id = setTimeout( createRemoveStoreCallback(store), state.skipTimeout ); return () => clearTimeout(id); }) ); }, [store]); const onMouseEnterProp = props.onMouseEnter; const onMouseEnter = useEvent((event) => { onMouseEnterProp == null ? void 0 : onMouseEnterProp(event); canShowOnHoverRef.current = true; }); const onFocusVisibleProp = props.onFocusVisible; const onFocusVisible = useEvent((event) => { onFocusVisibleProp == null ? void 0 : onFocusVisibleProp(event); if (event.defaultPrevented) return; store == null ? void 0 : store.setAnchorElement(event.currentTarget); store == null ? void 0 : store.show(); }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { onBlurProp == null ? void 0 : onBlurProp(event); if (event.defaultPrevented) return; const { activeStore } = globalStore.getState(); canShowOnHoverRef.current = false; if (activeStore === store) { globalStore.setState("activeStore", null); } }); const type = store.useState("type"); const contentId = store.useState((state) => { var _a2; return (_a2 = state.contentElement) == null ? void 0 : _a2.id; }); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ "aria-labelledby": type === "label" ? contentId : void 0 }, props), { onMouseEnter, onFocusVisible, onBlur }); props = useHovercardAnchor(_3YLGPPWQ_spreadValues({ store, showOnHover(event) { if (!canShowOnHoverRef.current) return false; if (isFalsyBooleanCallback(showOnHover, event)) return false; const { activeStore } = globalStore.getState(); if (!activeStore) return true; store == null ? void 0 : store.show(); return false; } }, props)); return props; } ); var TooltipAnchor = forwardRef2(function TooltipAnchor2(props) { const htmlProps = useTooltipAnchor(props); return HKOOKEDE_createElement(tooltip_anchor_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/X7QOZUD3.js "use client"; // src/hovercard/utils/polygon.ts function getEventPoint(event) { return [event.clientX, event.clientY]; } function isPointInPolygon(point, polygon) { const [x, y] = point; let inside = false; const length = polygon.length; for (let l = length, i = 0, j = l - 1; i < l; j = i++) { const [xi, yi] = polygon[i]; const [xj, yj] = polygon[j]; const [, vy] = polygon[j === 0 ? l - 1 : j - 1] || [0, 0]; const where = (yi - yj) * (x - xi) - (xi - xj) * (y - yi); if (yj < yi) { if (y >= yj && y < yi) { if (where === 0) return true; if (where > 0) { if (y === yj) { if (y > vy) { inside = !inside; } } else { inside = !inside; } } } } else if (yi < yj) { if (y > yi && y <= yj) { if (where === 0) return true; if (where < 0) { if (y === yj) { if (y < vy) { inside = !inside; } } else { inside = !inside; } } } } else if (y === yi && (x >= xj && x <= xi || x >= xi && x <= xj)) { return true; } } return inside; } function getEnterPointPlacement(enterPoint, rect) { const { top, right, bottom, left } = rect; const [x, y] = enterPoint; const placementX = x < left ? "left" : x > right ? "right" : null; const placementY = y < top ? "top" : y > bottom ? "bottom" : null; return [placementX, placementY]; } function getElementPolygon(element, enterPoint) { const rect = element.getBoundingClientRect(); const { top, right, bottom, left } = rect; const [x, y] = getEnterPointPlacement(enterPoint, rect); const polygon = [enterPoint]; if (x) { if (y !== "top") { polygon.push([x === "left" ? left : right, top]); } polygon.push([x === "left" ? right : left, top]); polygon.push([x === "left" ? right : left, bottom]); if (y !== "bottom") { polygon.push([x === "left" ? left : right, bottom]); } } else if (y === "top") { polygon.push([left, top]); polygon.push([left, bottom]); polygon.push([right, bottom]); polygon.push([right, top]); } else { polygon.push([left, bottom]); polygon.push([left, top]); polygon.push([right, top]); polygon.push([right, bottom]); } return polygon; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/63XF7ACK.js "use client"; // src/dialog/utils/is-backdrop.ts function _63XF7ACK_isBackdrop(element, ...ids) { if (!element) return false; const backdrop = element.getAttribute("data-backdrop"); if (backdrop == null) return false; if (backdrop === "") return true; if (backdrop === "true") return true; if (!ids.length) return true; return ids.some((id) => backdrop === id); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/K2ZF5NU7.js "use client"; // src/dialog/utils/orchestrate.ts var cleanups = /* @__PURE__ */ new WeakMap(); function orchestrate(element, key, setup) { if (!cleanups.has(element)) { cleanups.set(element, /* @__PURE__ */ new Map()); } const elementCleanups = cleanups.get(element); const prevCleanup = elementCleanups.get(key); if (!prevCleanup) { elementCleanups.set(key, setup()); return () => { var _a; (_a = elementCleanups.get(key)) == null ? void 0 : _a(); elementCleanups.delete(key); }; } const cleanup = setup(); const nextCleanup = () => { cleanup(); prevCleanup(); elementCleanups.delete(key); }; elementCleanups.set(key, nextCleanup); return () => { const isCurrent = elementCleanups.get(key) === nextCleanup; if (!isCurrent) return; cleanup(); elementCleanups.set(key, prevCleanup); }; } function setAttribute(element, attr, value) { const setup = () => { const previousValue = element.getAttribute(attr); element.setAttribute(attr, value); return () => { if (previousValue == null) { element.removeAttribute(attr); } else { element.setAttribute(attr, previousValue); } }; }; return orchestrate(element, attr, setup); } function setProperty(element, property, value) { const setup = () => { const exists = property in element; const previousValue = element[property]; element[property] = value; return () => { if (!exists) { delete element[property]; } else { element[property] = previousValue; } }; }; return orchestrate(element, property, setup); } function assignStyle(element, style) { if (!element) return () => { }; const setup = () => { const prevStyle = element.style.cssText; Object.assign(element.style, style); return () => { element.style.cssText = prevStyle; }; }; return orchestrate(element, "style", setup); } function setCSSProperty(element, property, value) { if (!element) return () => { }; const setup = () => { const previousValue = element.style.getPropertyValue(property); element.style.setProperty(property, value); return () => { if (previousValue) { element.style.setProperty(property, previousValue); } else { element.style.removeProperty(property); } }; }; return orchestrate(element, property, setup); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/AOUGVQZ3.js "use client"; // src/dialog/utils/walk-tree-outside.ts var ignoreTags = ["SCRIPT", "STYLE"]; function getSnapshotPropertyName(id) { return `__ariakit-dialog-snapshot-${id}`; } function inSnapshot(id, element) { const doc = getDocument(element); const propertyName = getSnapshotPropertyName(id); if (!doc.body[propertyName]) return true; do { if (element === doc.body) return false; if (element[propertyName]) return true; if (!element.parentElement) return false; element = element.parentElement; } while (true); } function isValidElement(id, element, ignoredElements) { if (ignoreTags.includes(element.tagName)) return false; if (!inSnapshot(id, element)) return false; return !ignoredElements.some( (enabledElement) => enabledElement && contains(element, enabledElement) ); } function AOUGVQZ3_walkTreeOutside(id, elements, callback, ancestorCallback) { for (let element of elements) { if (!(element == null ? void 0 : element.isConnected)) continue; const hasAncestorAlready = elements.some((maybeAncestor) => { if (!maybeAncestor) return false; if (maybeAncestor === element) return false; return maybeAncestor.contains(element); }); const doc = getDocument(element); const originalElement = element; while (element.parentElement && element !== doc.body) { ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement); if (!hasAncestorAlready) { for (const child of element.parentElement.children) { if (isValidElement(id, child, elements)) { callback(child, originalElement); } } } element = element.parentElement; } } } function createWalkTreeSnapshot(id, elements) { const { body } = getDocument(elements[0]); const cleanups = []; const markElement = (element) => { cleanups.push(setProperty(element, getSnapshotPropertyName(id), true)); }; AOUGVQZ3_walkTreeOutside(id, elements, markElement); return chain(setProperty(body, getSnapshotPropertyName(id), true), () => { for (const cleanup of cleanups) { cleanup(); } }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/2PGBN2Y4.js "use client"; // src/dialog/utils/mark-tree-outside.ts function getPropertyName(id = "", ancestor = false) { return `__ariakit-dialog-${ancestor ? "ancestor" : "outside"}${id ? `-${id}` : ""}`; } function markElement(element, id = "") { return chain( setProperty(element, getPropertyName(), true), setProperty(element, getPropertyName(id), true) ); } function markAncestor(element, id = "") { return chain( setProperty(element, getPropertyName("", true), true), setProperty(element, getPropertyName(id, true), true) ); } function isElementMarked(element, id) { const ancestorProperty = getPropertyName(id, true); if (element[ancestorProperty]) return true; const elementProperty = getPropertyName(id); do { if (element[elementProperty]) return true; if (!element.parentElement) return false; element = element.parentElement; } while (true); } function markTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); AOUGVQZ3_walkTreeOutside( id, elements, (element) => { if (_63XF7ACK_isBackdrop(element, ...ids)) return; cleanups.unshift(markElement(element, id)); }, (ancestor, element) => { const isAnotherDialogAncestor = element.hasAttribute("data-dialog") && element.id !== id; if (isAnotherDialogAncestor) return; cleanups.unshift(markAncestor(ancestor, id)); } ); const restoreAccessibilityTree = () => { for (const cleanup of cleanups) { cleanup(); } }; return restoreAccessibilityTree; } ;// CONCATENATED MODULE: external "ReactDOM" const external_ReactDOM_namespaceObject = window["ReactDOM"]; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BSEL4YAF.js "use client"; // src/disclosure/disclosure-content.tsx var BSEL4YAF_TagName = "div"; function afterTimeout(timeoutMs, cb) { const timeoutId = setTimeout(cb, timeoutMs); return () => clearTimeout(timeoutId); } function BSEL4YAF_afterPaint(cb) { let raf = requestAnimationFrame(() => { raf = requestAnimationFrame(cb); }); return () => cancelAnimationFrame(raf); } function parseCSSTime(...times) { return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => { const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3; const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier; if (currentTime > longestTime) return currentTime; return longestTime; }, 0); } function isHidden(mounted, hidden, alwaysVisible) { return !alwaysVisible && hidden !== false && (!mounted || !!hidden); } var useDisclosureContent = createHook(function useDisclosureContent2(_a) { var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); const context = useDisclosureProviderContext(); store = store || context; invariant( store, false && 0 ); const ref = (0,external_React_.useRef)(null); const id = useId(props.id); const [transition, setTransition] = (0,external_React_.useState)(null); const open = store.useState("open"); const mounted = store.useState("mounted"); const animated = store.useState("animated"); const contentElement = store.useState("contentElement"); const otherElement = useStoreState(store.disclosure, "contentElement"); useSafeLayoutEffect(() => { if (!ref.current) return; store == null ? void 0 : store.setContentElement(ref.current); }, [store]); useSafeLayoutEffect(() => { let previousAnimated; store == null ? void 0 : store.setState("animated", (animated2) => { previousAnimated = animated2; return true; }); return () => { if (previousAnimated === void 0) return; store == null ? void 0 : store.setState("animated", previousAnimated); }; }, [store]); useSafeLayoutEffect(() => { if (!animated) return; if (!(contentElement == null ? void 0 : contentElement.isConnected)) { setTransition(null); return; } return BSEL4YAF_afterPaint(() => { setTransition(open ? "enter" : mounted ? "leave" : null); }); }, [animated, contentElement, open, mounted]); useSafeLayoutEffect(() => { if (!store) return; if (!animated) return; const stopAnimation = () => store == null ? void 0 : store.setState("animating", false); const stopAnimationSync = () => (0,external_ReactDOM_namespaceObject.flushSync)(stopAnimation); if (!transition || !contentElement) { stopAnimation(); return; } if (transition === "leave" && open) return; if (transition === "enter" && !open) return; if (typeof animated === "number") { const timeout2 = animated; return afterTimeout(timeout2, stopAnimationSync); } const { transitionDuration, animationDuration, transitionDelay, animationDelay } = getComputedStyle(contentElement); const { transitionDuration: transitionDuration2 = "0", animationDuration: animationDuration2 = "0", transitionDelay: transitionDelay2 = "0", animationDelay: animationDelay2 = "0" } = otherElement ? getComputedStyle(otherElement) : {}; const delay = parseCSSTime( transitionDelay, animationDelay, transitionDelay2, animationDelay2 ); const duration = parseCSSTime( transitionDuration, animationDuration, transitionDuration2, animationDuration2 ); const timeout = delay + duration; if (!timeout) { if (transition === "enter") { store.setState("animated", false); } stopAnimation(); return; } const frameRate = 1e3 / 60; const maxTimeout = Math.max(timeout - frameRate, 0); return afterTimeout(maxTimeout, stopAnimationSync); }, [store, animated, contentElement, otherElement, open, transition]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: element }), [store] ); const hidden = isHidden(mounted, props.hidden, alwaysVisible); const styleProp = props.style; const style = (0,external_React_.useMemo)(() => { if (hidden) return _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, styleProp), { display: "none" }); return styleProp; }, [hidden, styleProp]); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, "data-open": open || void 0, "data-enter": transition === "enter" || void 0, "data-leave": transition === "leave" || void 0, hidden }, props), { ref: useMergeRefs(id ? store.setContentElement : null, ref, props.ref), style }); return removeUndefinedValues(props); }); var DisclosureContentImpl = forwardRef2(function DisclosureContentImpl2(props) { const htmlProps = useDisclosureContent(props); return HKOOKEDE_createElement(BSEL4YAF_TagName, htmlProps); }); var DisclosureContent = forwardRef2(function DisclosureContent2(_a) { var _b = _a, { unmountOnHide } = _b, props = __objRest(_b, [ "unmountOnHide" ]); const context = useDisclosureProviderContext(); const store = props.store || context; const mounted = useStoreState( store, (state) => !unmountOnHide || (state == null ? void 0 : state.mounted) ); if (mounted === false) return null; return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DisclosureContentImpl, _3YLGPPWQ_spreadValues({}, props)); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UQBPM777.js "use client"; // src/dialog/dialog-backdrop.tsx function DialogBackdrop({ store, backdrop, alwaysVisible, hidden }) { const ref = (0,external_React_.useRef)(null); const disclosure = useDisclosureStore({ disclosure: store }); const contentElement = store.useState("contentElement"); useSafeLayoutEffect(() => { const backdrop2 = ref.current; const dialog = contentElement; if (!backdrop2) return; if (!dialog) return; backdrop2.style.zIndex = getComputedStyle(dialog).zIndex; }, [contentElement]); useSafeLayoutEffect(() => { const id = contentElement == null ? void 0 : contentElement.id; if (!id) return; const backdrop2 = ref.current; if (!backdrop2) return; return markAncestor(backdrop2, id); }, [contentElement]); const props = useDisclosureContent({ ref, store: disclosure, role: "presentation", "data-backdrop": (contentElement == null ? void 0 : contentElement.id) || "", alwaysVisible, hidden: hidden != null ? hidden : void 0, style: { position: "fixed", top: 0, right: 0, bottom: 0, left: 0 } }); if (!backdrop) return null; if ((0,external_React_.isValidElement)(backdrop)) { return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { render: backdrop })); } const Component = typeof backdrop !== "boolean" ? backdrop : "div"; return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Role, _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { render: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {}) })); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ESSM74HH.js "use client"; // src/dialog/utils/disable-accessibility-tree-outside.ts function hideElementFromAccessibilityTree(element) { return setAttribute(element, "aria-hidden", "true"); } function disableAccessibilityTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); walkTreeOutside(id, elements, (element) => { if (isBackdrop(element, ...ids)) return; cleanups.unshift(hideElementFromAccessibilityTree(element)); }); const restoreAccessibilityTree = () => { for (const cleanup of cleanups) { cleanup(); } }; return restoreAccessibilityTree; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/677M2CI3.js "use client"; // src/dialog/utils/supports-inert.ts function supportsInert() { return "inert" in HTMLElement.prototype; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NSFBIL2Z.js "use client"; // src/dialog/utils/disable-tree.ts function disableTree(element, ignoredElements) { if (!("style" in element)) return noop; if (supportsInert()) { return setProperty(element, "inert", true); } const tabbableElements = getAllTabbableIn(element, true); const enableElements = tabbableElements.map((element2) => { if (ignoredElements == null ? void 0 : ignoredElements.some((el) => el && contains(el, element2))) return noop; const restoreFocusMethod = orchestrate(element2, "focus", () => { element2.focus = noop; return () => { delete element2.focus; }; }); return chain(setAttribute(element2, "tabindex", "-1"), restoreFocusMethod); }); return chain( ...enableElements, hideElementFromAccessibilityTree(element), assignStyle(element, { pointerEvents: "none", userSelect: "none", cursor: "default" }) ); } function disableTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); AOUGVQZ3_walkTreeOutside( id, elements, (element) => { if (_63XF7ACK_isBackdrop(element, ...ids)) return; cleanups.unshift(disableTree(element, elements)); }, (element) => { if (!element.hasAttribute("role")) return; if (elements.some((el) => el && contains(el, element))) return; cleanups.unshift(setAttribute(element, "role", "none")); } ); const restoreTreeOutside = () => { for (const cleanup of cleanups) { cleanup(); } }; return restoreTreeOutside; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/YJS26JVG.js "use client"; // src/dialog/utils/use-root-dialog.ts function useRootDialog({ attribute, contentId, contentElement, enabled }) { const [updated, retry] = useForceUpdate(); const isRootDialog = (0,external_React_.useCallback)(() => { if (!enabled) return false; if (!contentElement) return false; const { body } = getDocument(contentElement); const id = body.getAttribute(attribute); return !id || id === contentId; }, [updated, enabled, contentElement, attribute, contentId]); (0,external_React_.useEffect)(() => { if (!enabled) return; if (!contentId) return; if (!contentElement) return; const { body } = getDocument(contentElement); if (isRootDialog()) { body.setAttribute(attribute, contentId); return () => body.removeAttribute(attribute); } const observer = new MutationObserver(() => (0,external_ReactDOM_namespaceObject.flushSync)(retry)); observer.observe(body, { attributeFilter: [attribute] }); return () => observer.disconnect(); }, [updated, enabled, contentId, contentElement, isRootDialog, attribute]); return isRootDialog; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KB6RR6FL.js "use client"; // src/dialog/utils/use-prevent-body-scroll.ts function getPaddingProperty(documentElement) { const documentLeft = documentElement.getBoundingClientRect().left; const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft; return scrollbarX ? "paddingLeft" : "paddingRight"; } function usePreventBodyScroll(contentElement, contentId, enabled) { const isRootDialog = useRootDialog({ attribute: "data-dialog-prevent-body-scroll", contentElement, contentId, enabled }); (0,external_React_.useEffect)(() => { if (!isRootDialog()) return; if (!contentElement) return; const doc = getDocument(contentElement); const win = getWindow(contentElement); const { documentElement, body } = doc; const cssScrollbarWidth = documentElement.style.getPropertyValue("--scrollbar-width"); const scrollbarWidth = cssScrollbarWidth ? Number.parseInt(cssScrollbarWidth) : win.innerWidth - documentElement.clientWidth; const setScrollbarWidthProperty = () => setCSSProperty( documentElement, "--scrollbar-width", `${scrollbarWidth}px` ); const paddingProperty = getPaddingProperty(documentElement); const setStyle = () => assignStyle(body, { overflow: "hidden", [paddingProperty]: `${scrollbarWidth}px` }); const setIOSStyle = () => { var _a, _b; const { scrollX, scrollY, visualViewport } = win; const offsetLeft = (_a = visualViewport == null ? void 0 : visualViewport.offsetLeft) != null ? _a : 0; const offsetTop = (_b = visualViewport == null ? void 0 : visualViewport.offsetTop) != null ? _b : 0; const restoreStyle = assignStyle(body, { position: "fixed", overflow: "hidden", top: `${-(scrollY - Math.floor(offsetTop))}px`, left: `${-(scrollX - Math.floor(offsetLeft))}px`, right: "0", [paddingProperty]: `${scrollbarWidth}px` }); return () => { restoreStyle(); if (true) { win.scrollTo({ left: scrollX, top: scrollY, behavior: "instant" }); } }; }; const isIOS = isApple() && !isMac(); return chain( setScrollbarWidthProperty(), isIOS ? setIOSStyle() : setStyle() ); }, [isRootDialog, contentElement]); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/T3RMEPVH.js "use client"; // src/dialog/utils/use-nested-dialogs.tsx var NestedDialogsContext = (0,external_React_.createContext)({}); function useNestedDialogs(store) { const context = (0,external_React_.useContext)(NestedDialogsContext); const [dialogs, setDialogs] = (0,external_React_.useState)([]); const add = (0,external_React_.useCallback)( (dialog) => { var _a; setDialogs((dialogs2) => [...dialogs2, dialog]); return chain((_a = context.add) == null ? void 0 : _a.call(context, dialog), () => { setDialogs((dialogs2) => dialogs2.filter((d) => d !== dialog)); }); }, [context] ); useSafeLayoutEffect(() => { return sync(store, ["open", "contentElement"], (state) => { var _a; if (!state.open) return; if (!state.contentElement) return; return (_a = context.add) == null ? void 0 : _a.call(context, store); }); }, [store, context]); const providerValue = (0,external_React_.useMemo)(() => ({ store, add }), [store, add]); const wrapElement = (0,external_React_.useCallback)( (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NestedDialogsContext.Provider, { value: providerValue, children: element }), [providerValue] ); return { wrapElement, nestedDialogs: dialogs }; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HLTQOHKZ.js "use client"; // src/dialog/utils/use-previous-mouse-down-ref.ts function usePreviousMouseDownRef(enabled) { const previousMouseDownRef = (0,external_React_.useRef)(); (0,external_React_.useEffect)(() => { if (!enabled) { previousMouseDownRef.current = null; return; } const onMouseDown = (event) => { previousMouseDownRef.current = event.target; }; return addGlobalEventListener("mousedown", onMouseDown, true); }, [enabled]); return previousMouseDownRef; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BOZIQ7QT.js "use client"; // src/dialog/utils/use-hide-on-interact-outside.ts function isInDocument(target) { if (target.tagName === "HTML") return true; return contains(getDocument(target).body, target); } function isDisclosure(disclosure, target) { if (!disclosure) return false; if (contains(disclosure, target)) return true; const activeId = target.getAttribute("aria-activedescendant"); if (activeId) { const activeElement = getDocument(disclosure).getElementById(activeId); if (activeElement) { return contains(disclosure, activeElement); } } return false; } function isMouseEventOnDialog(event, dialog) { if (!("clientY" in event)) return false; const rect = dialog.getBoundingClientRect(); if (rect.width === 0 || rect.height === 0) return false; return rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width; } function useEventOutside({ store, type, listener, capture, domReady }) { const callListener = useEvent(listener); const open = useStoreState(store, "open"); const focusedRef = (0,external_React_.useRef)(false); useSafeLayoutEffect(() => { if (!open) return; if (!domReady) return; const { contentElement } = store.getState(); if (!contentElement) return; const onFocus = () => { focusedRef.current = true; }; contentElement.addEventListener("focusin", onFocus, true); return () => contentElement.removeEventListener("focusin", onFocus, true); }, [store, open, domReady]); (0,external_React_.useEffect)(() => { if (!open) return; const onEvent = (event) => { const { contentElement, disclosureElement } = store.getState(); const target = event.target; if (!contentElement) return; if (!target) return; if (!isInDocument(target)) return; if (contains(contentElement, target)) return; if (isDisclosure(disclosureElement, target)) return; if (target.hasAttribute("data-focus-trap")) return; if (isMouseEventOnDialog(event, contentElement)) return; const focused = focusedRef.current; if (focused && !isElementMarked(target, contentElement.id)) return; if (isSafariFocusAncestor(target)) return; callListener(event); }; return addGlobalEventListener(type, onEvent, capture); }, [open, capture]); } function shouldHideOnInteractOutside(hideOnInteractOutside, event) { if (typeof hideOnInteractOutside === "function") { return hideOnInteractOutside(event); } return !!hideOnInteractOutside; } function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) { const open = useStoreState(store, "open"); const previousMouseDownRef = usePreviousMouseDownRef(open); const props = { store, domReady, capture: true }; useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { type: "click", listener: (event) => { const { contentElement } = store.getState(); const previousMouseDown = previousMouseDownRef.current; if (!previousMouseDown) return; if (!isVisible(previousMouseDown)) return; if (!isElementMarked(previousMouseDown, contentElement == null ? void 0 : contentElement.id)) return; if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return; store.hide(); } })); useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { type: "focusin", listener: (event) => { const { contentElement } = store.getState(); if (!contentElement) return; if (event.target === getDocument(contentElement)) return; if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return; store.hide(); } })); useEventOutside(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { type: "contextmenu", listener: (event) => { if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return; store.hide(); } })); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6GXEOXGT.js "use client"; // src/dialog/utils/prepend-hidden-dismiss.ts function prependHiddenDismiss(container, onClick) { const document = getDocument(container); const button = document.createElement("button"); button.type = "button"; button.tabIndex = -1; button.textContent = "Dismiss popup"; Object.assign(button.style, { border: "0px", clip: "rect(0 0 0 0)", height: "1px", margin: "-1px", overflow: "hidden", padding: "0px", position: "absolute", whiteSpace: "nowrap", width: "1px" }); button.addEventListener("click", onClick); container.prepend(button); const removeHiddenDismiss = () => { button.removeEventListener("click", onClick); button.remove(); }; return removeHiddenDismiss; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HT3UEUDM.js "use client"; // src/focusable/focusable-container.tsx var HT3UEUDM_TagName = "div"; var useFocusableContainer = createHook(function useFocusableContainer2(_a) { var _b = _a, { autoFocusOnShow = true } = _b, props = __objRest(_b, ["autoFocusOnShow"]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocusableContext.Provider, { value: autoFocusOnShow, children: element }), [autoFocusOnShow] ); return props; }); var FocusableContainer = forwardRef2(function FocusableContainer2(props) { const htmlProps = useFocusableContainer(props); return HKOOKEDE_createElement(HT3UEUDM_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CZ4GFWYL.js "use client"; // src/heading/heading-context.tsx var HeadingContext = (0,external_React_.createContext)(0); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/5M6RIVE2.js "use client"; // src/heading/heading-level.tsx function HeadingLevel({ level, children }) { const contextLevel = (0,external_React_.useContext)(HeadingContext); const nextLevel = Math.max( Math.min(level || contextLevel + 1, 6), 1 ); return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingContext.Provider, { value: nextLevel, children }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ILNAUGA4.js "use client"; // src/visually-hidden/visually-hidden.tsx var ILNAUGA4_TagName = "span"; var useVisuallyHidden = createHook( function useVisuallyHidden2(props) { props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { style: _3YLGPPWQ_spreadValues({ border: 0, clip: "rect(0 0 0 0)", height: "1px", margin: "-1px", overflow: "hidden", padding: 0, position: "absolute", whiteSpace: "nowrap", width: "1px" }, props.style) }); return props; } ); var VisuallyHidden = forwardRef2(function VisuallyHidden2(props) { const htmlProps = useVisuallyHidden(props); return HKOOKEDE_createElement(ILNAUGA4_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LWDIJ7XK.js "use client"; // src/focus-trap/focus-trap.tsx var LWDIJ7XK_TagName = "span"; var useFocusTrap = createHook( function useFocusTrap2(props) { props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ "data-focus-trap": "", tabIndex: 0, "aria-hidden": true }, props), { style: _3YLGPPWQ_spreadValues({ // Prevents unintended scroll jumps. position: "fixed", top: 0, left: 0 }, props.style) }); props = useVisuallyHidden(props); return props; } ); var FocusTrap = forwardRef2(function FocusTrap2(props) { const htmlProps = useFocusTrap(props); return HKOOKEDE_createElement(LWDIJ7XK_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/AOQQTIBO.js "use client"; // src/portal/portal-context.tsx var PortalContext = (0,external_React_.createContext)(null); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UNZQGRPO.js "use client"; // src/portal/portal.tsx var UNZQGRPO_TagName = "div"; function getRootElement(element) { return getDocument(element).body; } function getPortalElement(element, portalElement) { if (!portalElement) { return getDocument(element).createElement("div"); } if (typeof portalElement === "function") { return portalElement(element); } return portalElement; } function getRandomId(prefix = "id") { return `${prefix ? `${prefix}-` : ""}${Math.random().toString(36).substr(2, 6)}`; } function queueFocus(element) { queueMicrotask(() => { element == null ? void 0 : element.focus(); }); } var usePortal = createHook(function usePortal2(_a) { var _b = _a, { preserveTabOrder, preserveTabOrderAnchor, portalElement, portalRef, portal = true } = _b, props = __objRest(_b, [ "preserveTabOrder", "preserveTabOrderAnchor", "portalElement", "portalRef", "portal" ]); const ref = (0,external_React_.useRef)(null); const refProp = useMergeRefs(ref, props.ref); const context = (0,external_React_.useContext)(PortalContext); const [portalNode, setPortalNode] = (0,external_React_.useState)(null); const [anchorPortalNode, setAnchorPortalNode] = (0,external_React_.useState)( null ); const outerBeforeRef = (0,external_React_.useRef)(null); const innerBeforeRef = (0,external_React_.useRef)(null); const innerAfterRef = (0,external_React_.useRef)(null); const outerAfterRef = (0,external_React_.useRef)(null); useSafeLayoutEffect(() => { const element = ref.current; if (!element || !portal) { setPortalNode(null); return; } const portalEl = getPortalElement(element, portalElement); if (!portalEl) { setPortalNode(null); return; } const isPortalInDocument = portalEl.isConnected; if (!isPortalInDocument) { const rootElement = context || getRootElement(element); rootElement.appendChild(portalEl); } if (!portalEl.id) { portalEl.id = element.id ? `portal/${element.id}` : getRandomId(); } setPortalNode(portalEl); setRef(portalRef, portalEl); if (isPortalInDocument) return; return () => { portalEl.remove(); setRef(portalRef, null); }; }, [portal, portalElement, context, portalRef]); useSafeLayoutEffect(() => { if (!portal) return; if (!preserveTabOrder) return; if (!preserveTabOrderAnchor) return; const doc = getDocument(preserveTabOrderAnchor); const element = doc.createElement("span"); element.style.position = "fixed"; preserveTabOrderAnchor.insertAdjacentElement("afterend", element); setAnchorPortalNode(element); return () => { element.remove(); setAnchorPortalNode(null); }; }, [portal, preserveTabOrder, preserveTabOrderAnchor]); (0,external_React_.useEffect)(() => { if (!portalNode) return; if (!preserveTabOrder) return; let raf = 0; const onFocus = (event) => { if (!isFocusEventOutside(event)) return; const focusing = event.type === "focusin"; cancelAnimationFrame(raf); if (focusing) { return restoreFocusIn(portalNode); } raf = requestAnimationFrame(() => { disableFocusIn(portalNode, true); }); }; portalNode.addEventListener("focusin", onFocus, true); portalNode.addEventListener("focusout", onFocus, true); return () => { cancelAnimationFrame(raf); portalNode.removeEventListener("focusin", onFocus, true); portalNode.removeEventListener("focusout", onFocus, true); }; }, [portalNode, preserveTabOrder]); props = useWrapElement( props, (element) => { element = // While the portal node is not in the DOM, we need to pass the // current context to the portal context, otherwise it's going to // reset to the body element on nested portals. /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PortalContext.Provider, { value: portalNode || context, children: element }); if (!portal) return element; if (!portalNode) { return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( "span", { ref: refProp, id: props.id, style: { position: "fixed" }, hidden: true } ); } element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( FocusTrap, { ref: innerBeforeRef, className: "__focus-trap-inner-before", onFocus: (event) => { if (isFocusEventOutside(event, portalNode)) { queueFocus(getNextTabbable()); } else { queueFocus(outerBeforeRef.current); } } } ), element, preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( FocusTrap, { ref: innerAfterRef, className: "__focus-trap-inner-after", onFocus: (event) => { if (isFocusEventOutside(event, portalNode)) { queueFocus(getPreviousTabbable()); } else { queueFocus(outerAfterRef.current); } } } ) ] }); if (portalNode) { element = (0,external_ReactDOM_namespaceObject.createPortal)(element, portalNode); } let preserveTabOrderElement = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( FocusTrap, { ref: outerBeforeRef, className: "__focus-trap-outer-before", onFocus: (event) => { const fromOuter = event.relatedTarget === outerAfterRef.current; if (!fromOuter && isFocusEventOutside(event, portalNode)) { queueFocus(innerBeforeRef.current); } else { queueFocus(getPreviousTabbable()); } } } ), preserveTabOrder && // We're using position: fixed here so that the browser doesn't // add margin to the element when setting gap on a parent element. /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-owns": portalNode == null ? void 0 : portalNode.id, style: { position: "fixed" } }), preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( FocusTrap, { ref: outerAfterRef, className: "__focus-trap-outer-after", onFocus: (event) => { if (isFocusEventOutside(event, portalNode)) { queueFocus(innerAfterRef.current); } else { const nextTabbable = getNextTabbable(); if (nextTabbable === innerBeforeRef.current) { requestAnimationFrame(() => { var _a2; return (_a2 = getNextTabbable()) == null ? void 0 : _a2.focus(); }); return; } queueFocus(nextTabbable); } } } ) ] }); if (anchorPortalNode && preserveTabOrder) { preserveTabOrderElement = (0,external_ReactDOM_namespaceObject.createPortal)( preserveTabOrderElement, anchorPortalNode ); } return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ preserveTabOrderElement, element ] }); }, [portalNode, context, portal, props.id, preserveTabOrder, anchorPortalNode] ); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { ref: refProp }); return props; }); var Portal = forwardRef2(function Portal2(props) { const htmlProps = usePortal(props); return HKOOKEDE_createElement(UNZQGRPO_TagName, htmlProps); }); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TMQXBAX4.js "use client"; // src/dialog/dialog.tsx var TMQXBAX4_TagName = "div"; var TMQXBAX4_isSafariBrowser = isSafari(); function isAlreadyFocusingAnotherElement(dialog) { const activeElement = getActiveElement(); if (!activeElement) return false; if (dialog && contains(dialog, activeElement)) return false; if (isFocusable(activeElement)) return true; return false; } function getElementFromProp(prop, focusable = false) { if (!prop) return null; const element = "current" in prop ? prop.current : prop; if (!element) return null; if (focusable) return isFocusable(element) ? element : null; return element; } var useDialog = createHook(function useDialog2(_a) { var _b = _a, { store: storeProp, open: openProp, onClose, focusable = true, modal = true, portal = !!modal, backdrop = !!modal, hideOnEscape = true, hideOnInteractOutside = true, getPersistentElements, preventBodyScroll = !!modal, autoFocusOnShow = true, autoFocusOnHide = true, initialFocus, finalFocus, unmountOnHide, unstable_treeSnapshotKey } = _b, props = __objRest(_b, [ "store", "open", "onClose", "focusable", "modal", "portal", "backdrop", "hideOnEscape", "hideOnInteractOutside", "getPersistentElements", "preventBodyScroll", "autoFocusOnShow", "autoFocusOnHide", "initialFocus", "finalFocus", "unmountOnHide", "unstable_treeSnapshotKey" ]); const context = useDialogProviderContext(); const ref = (0,external_React_.useRef)(null); const store = useDialogStore({ store: storeProp || context, open: openProp, setOpen(open2) { if (open2) return; const dialog = ref.current; if (!dialog) return; const event = new Event("close", { bubbles: false, cancelable: true }); if (onClose) { dialog.addEventListener("close", onClose, { once: true }); } dialog.dispatchEvent(event); if (!event.defaultPrevented) return; store.setOpen(true); } }); const { portalRef, domReady } = usePortalRef(portal, props.portalRef); const preserveTabOrderProp = props.preserveTabOrder; const preserveTabOrder = store.useState( (state) => preserveTabOrderProp && !modal && state.mounted ); const id = useId(props.id); const open = store.useState("open"); const mounted = store.useState("mounted"); const contentElement = store.useState("contentElement"); const hidden = isHidden(mounted, props.hidden, props.alwaysVisible); usePreventBodyScroll(contentElement, id, preventBodyScroll && !hidden); useHideOnInteractOutside(store, hideOnInteractOutside, domReady); const { wrapElement, nestedDialogs } = useNestedDialogs(store); props = useWrapElement(props, wrapElement, [wrapElement]); useSafeLayoutEffect(() => { if (!open) return; const dialog = ref.current; const activeElement = getActiveElement(dialog, true); if (!activeElement) return; if (activeElement.tagName === "BODY") return; if (dialog && contains(dialog, activeElement)) return; store.setDisclosureElement(activeElement); }, [store, open]); if (TMQXBAX4_isSafariBrowser) { (0,external_React_.useEffect)(() => { if (!mounted) return; const { disclosureElement } = store.getState(); if (!disclosureElement) return; if (!isButton(disclosureElement)) return; const onMouseDown = () => { let receivedFocus = false; const onFocus = () => { receivedFocus = true; }; const options = { capture: true, once: true }; disclosureElement.addEventListener("focusin", onFocus, options); queueBeforeEvent(disclosureElement, "mouseup", () => { disclosureElement.removeEventListener("focusin", onFocus, true); if (receivedFocus) return; focusIfNeeded(disclosureElement); }); }; disclosureElement.addEventListener("mousedown", onMouseDown); return () => { disclosureElement.removeEventListener("mousedown", onMouseDown); }; }, [store, mounted]); } (0,external_React_.useEffect)(() => { if (!modal) return; if (!mounted) return; if (!domReady) return; const dialog = ref.current; if (!dialog) return; const existingDismiss = dialog.querySelector("[data-dialog-dismiss]"); if (existingDismiss) return; return prependHiddenDismiss(dialog, store.hide); }, [store, modal, mounted, domReady]); useSafeLayoutEffect(() => { if (!supportsInert()) return; if (open) return; if (!mounted) return; if (!domReady) return; const dialog = ref.current; if (!dialog) return; return disableTree(dialog); }, [open, mounted, domReady]); const canTakeTreeSnapshot = open && domReady; useSafeLayoutEffect(() => { if (!id) return; if (!canTakeTreeSnapshot) return; const dialog = ref.current; return createWalkTreeSnapshot(id, [dialog]); }, [id, canTakeTreeSnapshot, unstable_treeSnapshotKey]); const getPersistentElementsProp = useEvent(getPersistentElements); useSafeLayoutEffect(() => { if (!id) return; if (!canTakeTreeSnapshot) return; const { disclosureElement } = store.getState(); const dialog = ref.current; const persistentElements = getPersistentElementsProp() || []; const allElements = [ dialog, ...persistentElements, ...nestedDialogs.map((dialog2) => dialog2.getState().contentElement) ]; if (modal) { return chain( markTreeOutside(id, allElements), disableTreeOutside(id, allElements) ); } return markTreeOutside(id, [disclosureElement, ...allElements]); }, [ id, store, canTakeTreeSnapshot, getPersistentElementsProp, nestedDialogs, modal, unstable_treeSnapshotKey ]); const mayAutoFocusOnShow = !!autoFocusOnShow; const autoFocusOnShowProp = useBooleanEvent(autoFocusOnShow); const [autoFocusEnabled, setAutoFocusEnabled] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!open) return; if (!mayAutoFocusOnShow) return; if (!domReady) return; if (!(contentElement == null ? void 0 : contentElement.isConnected)) return; const element = getElementFromProp(initialFocus, true) || // If no initial focus is specified, we try to focus the first element // with the autofocus attribute. If it's an Ariakit component, the // Focusable component will consume the autoFocus prop and add the // data-autofocus attribute to the element instead. contentElement.querySelector( "[data-autofocus=true],[autofocus]" ) || // We have to fallback to the first focusable element otherwise portaled // dialogs with preserveTabOrder set to true will not receive focus // properly because the elements aren't tabbable until the dialog receives // focus. getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) || // Finally, we fallback to the dialog element itself. contentElement; const isElementFocusable = isFocusable(element); if (!autoFocusOnShowProp(isElementFocusable ? element : null)) return; setAutoFocusEnabled(true); queueMicrotask(() => { element.focus(); if (!TMQXBAX4_isSafariBrowser) return; element.scrollIntoView({ block: "nearest", inline: "nearest" }); }); }, [ open, mayAutoFocusOnShow, domReady, contentElement, initialFocus, portal, preserveTabOrder, autoFocusOnShowProp ]); const mayAutoFocusOnHide = !!autoFocusOnHide; const autoFocusOnHideProp = useBooleanEvent(autoFocusOnHide); const [hasOpened, setHasOpened] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!open) return; setHasOpened(true); return () => setHasOpened(false); }, [open]); const focusOnHide = (0,external_React_.useCallback)( (dialog, retry = true) => { const { disclosureElement } = store.getState(); if (isAlreadyFocusingAnotherElement(dialog)) return; let element = getElementFromProp(finalFocus) || disclosureElement; if (element == null ? void 0 : element.id) { const doc = getDocument(element); const selector = `[aria-activedescendant="${element.id}"]`; const composite = doc.querySelector(selector); if (composite) { element = composite; } } if (element && !isFocusable(element)) { const maybeParentDialog = element.closest("[data-dialog]"); if (maybeParentDialog == null ? void 0 : maybeParentDialog.id) { const doc = getDocument(maybeParentDialog); const selector = `[aria-controls~="${maybeParentDialog.id}"]`; const control = doc.querySelector(selector); if (control) { element = control; } } } const isElementFocusable = element && isFocusable(element); if (!isElementFocusable && retry) { requestAnimationFrame(() => focusOnHide(dialog, false)); return; } if (!autoFocusOnHideProp(isElementFocusable ? element : null)) return; if (!isElementFocusable) return; element == null ? void 0 : element.focus(); }, [store, finalFocus, autoFocusOnHideProp] ); const focusedOnHideRef = (0,external_React_.useRef)(false); useSafeLayoutEffect(() => { if (open) return; if (!hasOpened) return; if (!mayAutoFocusOnHide) return; const dialog = ref.current; focusedOnHideRef.current = true; focusOnHide(dialog); }, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]); (0,external_React_.useEffect)(() => { if (!hasOpened) return; if (!mayAutoFocusOnHide) return; const dialog = ref.current; return () => { if (focusedOnHideRef.current) { focusedOnHideRef.current = false; return; } focusOnHide(dialog); }; }, [hasOpened, mayAutoFocusOnHide, focusOnHide]); const hideOnEscapeProp = useBooleanEvent(hideOnEscape); (0,external_React_.useEffect)(() => { if (!domReady) return; if (!mounted) return; const onKeyDown = (event) => { if (event.key !== "Escape") return; if (event.defaultPrevented) return; const dialog = ref.current; if (!dialog) return; if (isElementMarked(dialog)) return; const target = event.target; if (!target) return; const { disclosureElement } = store.getState(); const isValidTarget = () => { if (target.tagName === "BODY") return true; if (contains(dialog, target)) return true; if (!disclosureElement) return true; if (contains(disclosureElement, target)) return true; return false; }; if (!isValidTarget()) return; if (!hideOnEscapeProp(event)) return; store.hide(); }; return addGlobalEventListener("keydown", onKeyDown, true); }, [store, domReady, mounted, hideOnEscapeProp]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevel, { level: modal ? 1 : void 0, children: element }), [modal] ); const hiddenProp = props.hidden; const alwaysVisible = props.alwaysVisible; props = useWrapElement( props, (element) => { if (!backdrop) return element; return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [ /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)( DialogBackdrop, { store, backdrop, hidden: hiddenProp, alwaysVisible } ), element ] }); }, [store, backdrop, hiddenProp, alwaysVisible] ); const [headingId, setHeadingId] = (0,external_React_.useState)(); const [descriptionId, setDescriptionId] = (0,external_React_.useState)(); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogHeadingContext.Provider, { value: setHeadingId, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(DialogDescriptionContext.Provider, { value: setDescriptionId, children: element }) }) }), [store] ); props = _3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ id, "data-dialog": "", role: "dialog", tabIndex: focusable ? -1 : void 0, "aria-labelledby": headingId, "aria-describedby": descriptionId }, props), { ref: useMergeRefs(ref, props.ref) }); props = useFocusableContainer(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { autoFocusOnShow: autoFocusEnabled })); props = useDisclosureContent(_3YLGPPWQ_spreadValues({ store }, props)); props = useFocusable(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({}, props), { focusable })); props = usePortal(_3YLGPPWQ_spreadProps(_3YLGPPWQ_spreadValues({ portal }, props), { portalRef, preserveTabOrder })); return props; }); function createDialogComponent(Component, useProviderContext = useDialogProviderContext) { return forwardRef2(function DialogComponent(props) { const context = useProviderContext(); const store = props.store || context; const mounted = useStoreState( store, (state) => !props.unmountOnHide || (state == null ? void 0 : state.mounted) || !!props.open ); if (!mounted) return null; return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, _3YLGPPWQ_spreadValues({}, props)); }); } var Dialog = createDialogComponent( forwardRef2(function Dialog2(props) { const htmlProps = useDialog(props); return HKOOKEDE_createElement(TMQXBAX4_TagName, htmlProps); }), useDialogProviderContext ); ;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); const floating_ui_utils_min = Math.min; const floating_ui_utils_max = Math.max; const round = Math.round; const floor = Math.floor; const createCoords = v => ({ x: v, y: v }); const oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; const oppositeAlignmentMap = { start: 'end', end: 'start' }; function clamp(start, value, end) { return floating_ui_utils_max(start, floating_ui_utils_min(value, end)); } function floating_ui_utils_evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function floating_ui_utils_getSide(placement) { return placement.split('-')[0]; } function floating_ui_utils_getAlignment(placement) { return placement.split('-')[1]; } function getOppositeAxis(axis) { return axis === 'x' ? 'y' : 'x'; } function getAxisLength(axis) { return axis === 'y' ? 'height' : 'width'; } function floating_ui_utils_getSideAxis(placement) { return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x'; } function getAlignmentAxis(placement) { return getOppositeAxis(floating_ui_utils_getSideAxis(placement)); } function floating_ui_utils_getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = floating_ui_utils_getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; } function floating_ui_utils_getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); } function getSideList(side, isStart, rtl) { const lr = ['left', 'right']; const rl = ['right', 'left']; const tb = ['top', 'bottom']; const bt = ['bottom', 'top']; switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case 'left': case 'right': return isStart ? tb : bt; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = floating_ui_utils_getAlignment(placement); let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function floating_ui_utils_getPaddingObject(padding) { return typeof padding !== 'number' ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function floating_ui_utils_rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const sideAxis = floating_ui_utils_getSideAxis(placement); const alignmentAxis = getAlignmentAxis(placement); const alignLength = getAxisLength(alignmentAxis); const side = floating_ui_utils_getSide(placement); const isVertical = sideAxis === 'y'; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; let coords; switch (side) { case 'top': coords = { x: commonX, y: reference.y - floating.height }; break; case 'bottom': coords = { x: commonX, y: reference.y + reference.height }; break; case 'right': coords = { x: reference.x + reference.width, y: commonY }; break; case 'left': coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } switch (floating_ui_utils_getAlignment(placement)) { case 'start': coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case 'end': coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } /** * Computes the `x` and `y` coordinates that will place the floating element * next to a reference element when it is given a certain positioning strategy. * * This export does not have any `platform` interface logic. You will need to * write one for the platform you are using Floating UI with. */ const computePosition = async (reference, floating, config) => { const { placement = 'bottom', strategy = 'absolute', middleware = [], platform } = config; const validMiddleware = middleware.filter(Boolean); const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); let rects = await platform.getElementRects({ reference, floating, strategy }); let { x, y } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let middlewareData = {}; let resetCount = 0; for (let i = 0; i < validMiddleware.length; i++) { const { name, fn } = validMiddleware[i]; const { x: nextX, y: nextY, data, reset } = await fn({ x, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; middlewareData = { ...middlewareData, [name]: { ...middlewareData[name], ...data } }; if (reset && resetCount <= 50) { resetCount++; if (typeof reset === 'object') { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; continue; } } return { x, y, placement: statefulPlacement, strategy, middlewareData }; }; /** * Resolves with an object of overflow side offsets that determine how much the * element is overflowing a given clipping boundary on each side. * - positive = overflowing the boundary by that number of pixels * - negative = how many pixels left before it will overflow * - 0 = lies flush with the boundary * @see https://floating-ui.com/docs/detectOverflow */ async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, platform, rects, elements, strategy } = state; const { boundary = 'clippingAncestors', rootBoundary = 'viewport', elementContext = 'floating', altBoundary = false, padding = 0 } = floating_ui_utils_evaluate(options, state); const paddingObject = floating_ui_utils_getPaddingObject(padding); const altContext = elementContext === 'floating' ? 'reference' : 'floating'; const element = elements[altBoundary ? altContext : elementContext]; const clippingClientRect = floating_ui_utils_rectToClientRect(await platform.getClippingRect({ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), boundary, rootBoundary, strategy })); const rect = elementContext === 'floating' ? { ...rects.floating, x, y } : rects.reference; const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { x: 1, y: 1 } : { x: 1, y: 1 }; const elementClientRect = floating_ui_utils_rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } /** * Provides data to position an inner element of the floating element so that it * appears centered to the reference element. * @see https://floating-ui.com/docs/arrow */ const arrow = options => ({ name: 'arrow', options, async fn(state) { const { x, y, placement, rects, platform, elements, middlewareData } = state; // Since `element` is required, we don't Partial<> the type. const { element, padding = 0 } = floating_ui_utils_evaluate(options, state) || {}; if (element == null) { return {}; } const paddingObject = floating_ui_utils_getPaddingObject(padding); const coords = { x, y }; const axis = getAlignmentAxis(placement); const length = getAxisLength(axis); const arrowDimensions = await platform.getDimensions(element); const isYAxis = axis === 'y'; const minProp = isYAxis ? 'top' : 'left'; const maxProp = isYAxis ? 'bottom' : 'right'; const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; const startDiff = coords[axis] - rects.reference[axis]; const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; // DOM platform can return `window` as the `offsetParent`. if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { clientSize = elements.floating[clientProp] || rects.floating[length]; } const centerToReference = endDiff / 2 - startDiff / 2; // If the padding is large enough that it causes the arrow to no longer be // centered, modify the padding so that it is centered. const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding); const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding); // Make sure the arrow doesn't overflow the floating element if the center // point is outside the floating element's bounds. const min$1 = minPadding; const max = clientSize - arrowDimensions[length] - maxPadding; const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; const offset = clamp(min$1, center, max); // If the reference is small enough that the arrow's padding causes it to // to point to nothing for an aligned placement, adjust the offset of the // floating element itself. To ensure `shift()` continues to take action, // a single reset is performed when this is true. const shouldAddOffset = !middlewareData.arrow && floating_ui_utils_getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; return { [axis]: coords[axis] + alignmentOffset, data: { [axis]: offset, centerOffset: center - offset - alignmentOffset, ...(shouldAddOffset && { alignmentOffset }) }, reset: shouldAddOffset }; } }); function getPlacementList(alignment, autoAlignment, allowedPlacements) { const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); return allowedPlacementsSortedByAlignment.filter(placement => { if (alignment) { return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); } return true; }); } /** * Optimizes the visibility of the floating element by choosing the placement * that has the most space available automatically, without needing to specify a * preferred placement. Alternative to `flip`. * @see https://floating-ui.com/docs/autoPlacement */ const autoPlacement = function (options) { if (options === void 0) { options = {}; } return { name: 'autoPlacement', options, async fn(state) { var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; const { rects, middlewareData, placement, platform, elements } = state; const { crossAxis = false, alignment, allowedPlacements = placements, autoAlignment = true, ...detectOverflowOptions } = evaluate(options, state); const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; const overflow = await detectOverflow(state, detectOverflowOptions); const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; const currentPlacement = placements$1[currentIndex]; if (currentPlacement == null) { return {}; } const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); // Make `computeCoords` start from the right place. if (placement !== currentPlacement) { return { reset: { placement: placements$1[0] } }; } const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { placement: currentPlacement, overflows: currentOverflows }]; const nextPlacement = placements$1[currentIndex + 1]; // There are more placements to check. if (nextPlacement) { return { data: { index: currentIndex + 1, overflows: allOverflows }, reset: { placement: nextPlacement } }; } const placementsSortedByMostSpace = allOverflows.map(d => { const alignment = getAlignment(d.placement); return [d.placement, alignment && crossAxis ? // Check along the mainAxis and main crossAxis side. d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : // Check only the mainAxis. d.overflows[0], d.overflows]; }).sort((a, b) => a[1] - b[1]); const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, // Aligned placements should not check their opposite crossAxis // side. getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; if (resetPlacement !== placement) { return { data: { index: currentIndex + 1, overflows: allOverflows }, reset: { placement: resetPlacement } }; } return {}; } }; }; /** * Optimizes the visibility of the floating element by flipping the `placement` * in order to keep it in view when the preferred placement(s) will overflow the * clipping boundary. Alternative to `autoPlacement`. * @see https://floating-ui.com/docs/flip */ const flip = function (options) { if (options === void 0) { options = {}; } return { name: 'flip', options, async fn(state) { var _middlewareData$arrow, _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform, elements } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = 'bestFit', fallbackAxisSideDirection = 'none', flipAlignment = true, ...detectOverflowOptions } = floating_ui_utils_evaluate(options, state); // If a reset by the arrow was caused due to an alignment offset being // added, we should skip any logic now since `flip()` has already done its // work. // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } const side = floating_ui_utils_getSide(placement); const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements = [initialPlacement, ...fallbackPlacements]; const overflow = await detectOverflow(state, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const sides = floating_ui_utils_getAlignmentSides(placement, rects, rtl); overflows.push(overflow[sides[0]], overflow[sides[1]]); } overflowsData = [...overflowsData, { placement, overflows }]; // One or more sides is overflowing. if (!overflows.every(side => side <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements[nextIndex]; if (nextPlacement) { // Try next placement and re-run the lifecycle. return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } // First, find the candidates that fit on the mainAxis side of overflow, // then find the placement that fits the best on the main crossAxis side. let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; // Otherwise fallback. if (!resetPlacement) { switch (fallbackStrategy) { case 'bestFit': { var _overflowsData$map$so; const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0]; if (placement) { resetPlacement = placement; } break; } case 'initialPlacement': resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; function getSideOffsets(overflow, rect) { return { top: overflow.top - rect.height, right: overflow.right - rect.width, bottom: overflow.bottom - rect.height, left: overflow.left - rect.width }; } function isAnySideFullyClipped(overflow) { return sides.some(side => overflow[side] >= 0); } /** * Provides data to hide the floating element in applicable situations, such as * when it is not in the same clipping context as the reference element. * @see https://floating-ui.com/docs/hide */ const hide = function (options) { if (options === void 0) { options = {}; } return { name: 'hide', options, async fn(state) { const { rects } = state; const { strategy = 'referenceHidden', ...detectOverflowOptions } = evaluate(options, state); switch (strategy) { case 'referenceHidden': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, elementContext: 'reference' }); const offsets = getSideOffsets(overflow, rects.reference); return { data: { referenceHiddenOffsets: offsets, referenceHidden: isAnySideFullyClipped(offsets) } }; } case 'escaped': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, altBoundary: true }); const offsets = getSideOffsets(overflow, rects.floating); return { data: { escapedOffsets: offsets, escaped: isAnySideFullyClipped(offsets) } }; } default: { return {}; } } } }; }; function getBoundingRect(rects) { const minX = min(...rects.map(rect => rect.left)); const minY = min(...rects.map(rect => rect.top)); const maxX = max(...rects.map(rect => rect.right)); const maxY = max(...rects.map(rect => rect.bottom)); return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }; } function getRectsByLine(rects) { const sortedRects = rects.slice().sort((a, b) => a.y - b.y); const groups = []; let prevRect = null; for (let i = 0; i < sortedRects.length; i++) { const rect = sortedRects[i]; if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { groups.push([rect]); } else { groups[groups.length - 1].push(rect); } prevRect = rect; } return groups.map(rect => rectToClientRect(getBoundingRect(rect))); } /** * Provides improved positioning for inline reference elements that can span * over multiple lines, such as hyperlinks or range selections. * @see https://floating-ui.com/docs/inline */ const inline = function (options) { if (options === void 0) { options = {}; } return { name: 'inline', options, async fn(state) { const { placement, elements, rects, platform, strategy } = state; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a // ClientRect's bounds, despite the event listener being triggered. A // padding of 2 seems to handle this issue. const { padding = 2, x, y } = evaluate(options, state); const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); const clientRects = getRectsByLine(nativeClientRects); const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); const paddingObject = getPaddingObject(padding); function getBoundingClientRect() { // There are two rects and they are disjoined. if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { // Find the first rect in which the point is fully inside. return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; } // There are 2 or more connected rects. if (clientRects.length >= 2) { if (getSideAxis(placement) === 'y') { const firstRect = clientRects[0]; const lastRect = clientRects[clientRects.length - 1]; const isTop = getSide(placement) === 'top'; const top = firstRect.top; const bottom = lastRect.bottom; const left = isTop ? firstRect.left : lastRect.left; const right = isTop ? firstRect.right : lastRect.right; const width = right - left; const height = bottom - top; return { top, bottom, left, right, width, height, x: left, y: top }; } const isLeftSide = getSide(placement) === 'left'; const maxRight = max(...clientRects.map(rect => rect.right)); const minLeft = min(...clientRects.map(rect => rect.left)); const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); const top = measureRects[0].top; const bottom = measureRects[measureRects.length - 1].bottom; const left = minLeft; const right = maxRight; const width = right - left; const height = bottom - top; return { top, bottom, left, right, width, height, x: left, y: top }; } return fallback; } const resetRects = await platform.getElementRects({ reference: { getBoundingClientRect }, floating: elements.floating, strategy }); if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { return { reset: { rects: resetRects } }; } return {}; } }; }; // For type backwards-compatibility, the `OffsetOptions` type was also // Derivable. async function convertValueToCoords(state, options) { const { placement, platform, elements } = state; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const side = floating_ui_utils_getSide(placement); const alignment = floating_ui_utils_getAlignment(placement); const isVertical = floating_ui_utils_getSideAxis(placement) === 'y'; const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = floating_ui_utils_evaluate(options, state); // eslint-disable-next-line prefer-const let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === 'number' ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...rawValue }; if (alignment && typeof alignmentAxis === 'number') { crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } /** * Modifies the placement by translating the floating element along the * specified axes. * A number (shorthand for `mainAxis` or distance), or an axes configuration * object may be passed. * @see https://floating-ui.com/docs/offset */ const offset = function (options) { if (options === void 0) { options = 0; } return { name: 'offset', options, async fn(state) { const { x, y } = state; const diffCoords = await convertValueToCoords(state, options); return { x: x + diffCoords.x, y: y + diffCoords.y, data: diffCoords }; } }; }; /** * Optimizes the visibility of the floating element by shifting it in order to * keep it in view when it will overflow the clipping boundary. * @see https://floating-ui.com/docs/shift */ const shift = function (options) { if (options === void 0) { options = {}; } return { name: 'shift', options, async fn(state) { const { x, y, placement } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: _ref => { let { x, y } = _ref; return { x, y }; } }, ...detectOverflowOptions } = floating_ui_utils_evaluate(options, state); const coords = { x, y }; const overflow = await detectOverflow(state, detectOverflowOptions); const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement)); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === 'y' ? 'top' : 'left'; const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; const min = mainAxisCoord + overflow[minSide]; const max = mainAxisCoord - overflow[maxSide]; mainAxisCoord = clamp(min, mainAxisCoord, max); } if (checkCrossAxis) { const minSide = crossAxis === 'y' ? 'top' : 'left'; const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; const min = crossAxisCoord + overflow[minSide]; const max = crossAxisCoord - overflow[maxSide]; crossAxisCoord = clamp(min, crossAxisCoord, max); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y } }; } }; }; /** * Built-in `limiter` that will stop `shift()` at a certain point. */ const limitShift = function (options) { if (options === void 0) { options = {}; } return { options, fn(state) { const { x, y, placement, rects, middlewareData } = state; const { offset = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = floating_ui_utils_evaluate(options, state); const coords = { x, y }; const crossAxis = floating_ui_utils_getSideAxis(placement); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; const rawOffset = floating_ui_utils_evaluate(offset, state); const computedOffset = typeof rawOffset === 'number' ? { mainAxis: rawOffset, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...rawOffset }; if (checkMainAxis) { const len = mainAxis === 'y' ? 'height' : 'width'; const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; if (mainAxisCoord < limitMin) { mainAxisCoord = limitMin; } else if (mainAxisCoord > limitMax) { mainAxisCoord = limitMax; } } if (checkCrossAxis) { var _middlewareData$offse, _middlewareData$offse2; const len = mainAxis === 'y' ? 'width' : 'height'; const isOriginSide = ['top', 'left'].includes(floating_ui_utils_getSide(placement)); const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); if (crossAxisCoord < limitMin) { crossAxisCoord = limitMin; } else if (crossAxisCoord > limitMax) { crossAxisCoord = limitMax; } } return { [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }; } }; }; /** * Provides data that allows you to change the size of the floating element — * for instance, prevent it from overflowing the clipping boundary or match the * width of the reference element. * @see https://floating-ui.com/docs/size */ const size = function (options) { if (options === void 0) { options = {}; } return { name: 'size', options, async fn(state) { const { placement, rects, platform, elements } = state; const { apply = () => {}, ...detectOverflowOptions } = floating_ui_utils_evaluate(options, state); const overflow = await detectOverflow(state, detectOverflowOptions); const side = floating_ui_utils_getSide(placement); const alignment = floating_ui_utils_getAlignment(placement); const isYAxis = floating_ui_utils_getSideAxis(placement) === 'y'; const { width, height } = rects.floating; let heightSide; let widthSide; if (side === 'top' || side === 'bottom') { heightSide = side; widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; } else { widthSide = side; heightSide = alignment === 'end' ? 'top' : 'bottom'; } const overflowAvailableHeight = height - overflow[heightSide]; const overflowAvailableWidth = width - overflow[widthSide]; const noShift = !state.middlewareData.shift; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if (isYAxis) { const maximumClippingWidth = width - overflow.left - overflow.right; availableWidth = alignment || noShift ? floating_ui_utils_min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth; } else { const maximumClippingHeight = height - overflow.top - overflow.bottom; availableHeight = alignment || noShift ? floating_ui_utils_min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight; } if (noShift && !alignment) { const xMin = floating_ui_utils_max(overflow.left, 0); const xMax = floating_ui_utils_max(overflow.right, 0); const yMin = floating_ui_utils_max(overflow.top, 0); const yMax = floating_ui_utils_max(overflow.bottom, 0); if (isYAxis) { availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : floating_ui_utils_max(overflow.left, overflow.right)); } else { availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : floating_ui_utils_max(overflow.top, overflow.bottom)); } } await apply({ ...state, availableWidth, availableHeight }); const nextDimensions = await platform.getDimensions(elements.floating); if (width !== nextDimensions.width || height !== nextDimensions.height) { return { reset: { rects: true } }; } return {}; } }; }; ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs /** * Custom positioning reference element. * @see https://floating-ui.com/docs/virtual-elements */ const dist_floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); const floating_ui_utils_alignments = (/* unused pure expression or super */ null && (['start', 'end'])); const dist_floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (dist_floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + floating_ui_utils_alignments[0], side + "-" + floating_ui_utils_alignments[1]), []))); const dist_floating_ui_utils_min = Math.min; const dist_floating_ui_utils_max = Math.max; const floating_ui_utils_round = Math.round; const floating_ui_utils_floor = Math.floor; const floating_ui_utils_createCoords = v => ({ x: v, y: v }); const floating_ui_utils_oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; const floating_ui_utils_oppositeAlignmentMap = { start: 'end', end: 'start' }; function floating_ui_utils_clamp(start, value, end) { return dist_floating_ui_utils_max(start, dist_floating_ui_utils_min(value, end)); } function dist_floating_ui_utils_evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function dist_floating_ui_utils_getSide(placement) { return placement.split('-')[0]; } function dist_floating_ui_utils_getAlignment(placement) { return placement.split('-')[1]; } function floating_ui_utils_getOppositeAxis(axis) { return axis === 'x' ? 'y' : 'x'; } function floating_ui_utils_getAxisLength(axis) { return axis === 'y' ? 'height' : 'width'; } function dist_floating_ui_utils_getSideAxis(placement) { return ['top', 'bottom'].includes(dist_floating_ui_utils_getSide(placement)) ? 'y' : 'x'; } function floating_ui_utils_getAlignmentAxis(placement) { return floating_ui_utils_getOppositeAxis(dist_floating_ui_utils_getSideAxis(placement)); } function dist_floating_ui_utils_getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = dist_floating_ui_utils_getAlignment(placement); const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement); const length = floating_ui_utils_getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)]; } function floating_ui_utils_getExpandedPlacements(placement) { const oppositePlacement = floating_ui_utils_getOppositePlacement(placement); return [dist_floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, dist_floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; } function dist_floating_ui_utils_getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => floating_ui_utils_oppositeAlignmentMap[alignment]); } function floating_ui_utils_getSideList(side, isStart, rtl) { const lr = ['left', 'right']; const rl = ['right', 'left']; const tb = ['top', 'bottom']; const bt = ['bottom', 'top']; switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case 'left': case 'right': return isStart ? tb : bt; default: return []; } } function floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = dist_floating_ui_utils_getAlignment(placement); let list = floating_ui_utils_getSideList(dist_floating_ui_utils_getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(dist_floating_ui_utils_getOppositeAlignmentPlacement)); } } return list; } function floating_ui_utils_getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => floating_ui_utils_oppositeSideMap[side]); } function floating_ui_utils_expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function dist_floating_ui_utils_getPaddingObject(padding) { return typeof padding !== 'number' ? floating_ui_utils_expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function dist_floating_ui_utils_rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function getNodeName(node) { if (isNode(node)) { return (node.nodeName || '').toLowerCase(); } // Mocked nodes in testing environments may not be instances of Node. By // returning `#document` an infinite loop won't occur. // https://github.com/floating-ui/floating-ui/issues/2317 return '#document'; } function floating_ui_utils_dom_getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node; } function isElement(value) { return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element; } function isHTMLElement(value) { return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement; } function isShadowRoot(value) { // Browsers without `ShadowRoot` support. if (typeof ShadowRoot === 'undefined') { return false; } return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = floating_ui_utils_dom_getComputedStyle(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); } function isTableElement(element) { return ['table', 'td', 'th'].includes(getNodeName(element)); } function isContainingBlock(element) { const webkit = isWebKit(); const css = floating_ui_utils_dom_getComputedStyle(element); // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else { currentNode = getParentNode(currentNode); } } return null; } function isWebKit() { if (typeof CSS === 'undefined' || !CSS.supports) return false; return CSS.supports('-webkit-backdrop-filter', 'none'); } function isLastTraversableNode(node) { return ['html', 'body', '#document'].includes(getNodeName(node)); } function floating_ui_utils_dom_getComputedStyle(element) { return floating_ui_utils_dom_getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.pageXOffset, scrollTop: element.pageYOffset }; } function getParentNode(node) { if (getNodeName(node) === 'html') { return node; } const result = // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = floating_ui_utils_dom_getWindow(scrollableAncestor); if (isBody) { return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function getCssDimensions(element) { const css = floating_ui_utils_dom_getComputedStyle(element); // In testing environments, the `width` and `height` properties are empty // strings for SVG elements, returning NaN. Fallback to `0` in this case. let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element) { return !isElement(element) ? element.contextElement : element; } function getScale(element) { const domElement = unwrapElement(element); if (!isHTMLElement(domElement)) { return floating_ui_utils_createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width; let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1. if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } const noOffsets = /*#__PURE__*/floating_ui_utils_createCoords(0); function getVisualOffsets(element) { const win = floating_ui_utils_dom_getWindow(element); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== floating_ui_utils_dom_getWindow(element)) { return false; } return isFixed; } function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); let scale = floating_ui_utils_createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : floating_ui_utils_createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = floating_ui_utils_dom_getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? floating_ui_utils_dom_getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = currentWin.frameElement; while (currentIFrame && offsetParent && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = floating_ui_utils_dom_getComputedStyle(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentWin = floating_ui_utils_dom_getWindow(currentIFrame); currentIFrame = currentWin.frameElement; } } return floating_ui_utils_rectToClientRect({ width, height, x, y }); } const topLayerSelectors = [':popover-open', ':modal']; function isTopLayer(floating) { return topLayerSelectors.some(selector => { try { return floating.matches(selector); } catch (e) { return false; } }); } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { elements, rect, offsetParent, strategy } = _ref; const isFixed = strategy === 'fixed'; const documentElement = getDocumentElement(offsetParent); const topLayer = elements ? isTopLayer(elements.floating) : false; if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = floating_ui_utils_createCoords(1); const offsets = floating_ui_utils_createCoords(0); const isOffsetParentAnElement = isHTMLElement(offsetParent); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y }; } function getClientRects(element) { return Array.from(element.getClientRects()); } function getWindowScrollBarX(element) { // If has a CSS width greater than the viewport, then this will be // incorrect for RTL. return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft; } // Gets the entire size of the scrollable document area, even extending outside // of the `` and `` rect bounds if horizontally scrollable. function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.ownerDocument.body; const width = dist_floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = dist_floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element); const y = -scroll.scrollTop; if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') { x += dist_floating_ui_utils_max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } function getViewportRect(element, strategy) { const win = floating_ui_utils_dom_getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } // Returns the inner client rect, subtracting scrollbars if present. function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = isHTMLElement(element) ? getScale(element) : floating_ui_utils_createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === 'viewport') { rect = getViewportRect(element, strategy); } else if (clippingAncestor === 'document') { rect = getDocumentRect(getDocumentElement(element)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { ...clippingAncestor, x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y }; } return floating_ui_utils_rectToClientRect(rect); } function hasFixedPositionAncestor(element, stopNode) { const parentNode = getParentNode(element); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); } // A "clipping ancestor" is an `overflow` element with the characteristic of // clipping (or hiding) child elements. This returns all clipping ancestors // of the given element up the tree. function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); let currentContainingBlockComputedStyle = null; const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed'; let currentNode = elementIsFixed ? getParentNode(element) : element; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === 'fixed') { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { // Drop non-containing blocks. result = result.filter(ancestor => ancestor !== currentNode); } else { // Record last containing block for next iteration. currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element, result); return result; } // Gets the maximum area that the element is visible in due to any number of // clipping ancestors. function getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); accRect.top = dist_floating_ui_utils_max(rect.top, accRect.top); accRect.right = dist_floating_ui_utils_min(rect.right, accRect.right); accRect.bottom = dist_floating_ui_utils_min(rect.bottom, accRect.bottom); accRect.left = dist_floating_ui_utils_max(rect.left, accRect.left); return accRect; }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element) { const { width, height } = getCssDimensions(element); return { width, height }; } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === 'fixed'; const rect = getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = floating_ui_utils_createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { offsets.x = getWindowScrollBarX(documentElement); } } const x = rect.left + scroll.scrollLeft - offsets.x; const y = rect.top + scroll.scrollTop - offsets.y; return { x, y, width: rect.width, height: rect.height }; } function getTrueOffsetParent(element, polyfill) { if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') { return null; } if (polyfill) { return polyfill(element); } return element.offsetParent; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. function getOffsetParent(element, polyfill) { const window = floating_ui_utils_dom_getWindow(element); if (!isHTMLElement(element) || isTopLayer(element)) { return window; } let offsetParent = getTrueOffsetParent(element, polyfill); while (offsetParent && isTableElement(offsetParent) && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static') { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) { return window; } return offsetParent || getContainingBlock(element) || window; } const getElementRects = async function (data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; return { reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, ...(await getDimensionsFn(data.floating)) } }; }; function isRTL(element) { return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl'; } const platform = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement: getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement: isElement, isRTL }; // https://samthor.au/2021/observing-dom/ function observeMove(element, onMove) { let io = null; let timeoutId; const root = getDocumentElement(element); function cleanup() { var _io; clearTimeout(timeoutId); (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const { left, top, width, height } = element.getBoundingClientRect(); if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floating_ui_utils_floor(top); const insetRight = floating_ui_utils_floor(root.clientWidth - (left + width)); const insetBottom = floating_ui_utils_floor(root.clientHeight - (top + height)); const insetLeft = floating_ui_utils_floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: dist_floating_ui_utils_max(0, dist_floating_ui_utils_min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 100); } else { refresh(false, ratio); } } isFirstUpdate = false; } // Older browsers don't support a `document` as the root and will throw an // error. try { io = new IntersectionObserver(handleObserve, { ...options, // Handle