{"version":3,"file":"index-e42a7aa9.js","sources":["../../node_modules/vue-router-prefetch/dist/index.esm.js","../../node_modules/hookable/dist/index.mjs","../../node_modules/@unhead/vue/dist/index.mjs","../../node_modules/@unhead/dom/dist/index.mjs","../../node_modules/@vueuse/head/dist/index.mjs","../../node_modules/@apollo/client/link/batch/batching.js","../../node_modules/@apollo/client/link/batch/batchLink.js","../../node_modules/@apollo/client/link/batch-http/batchHttpLink.js","../../src/apollo/apollo.ts","../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js","../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js","../../src/composables/useTooltip.ts","../../src/directives/Tooltip.ts","../../src/assets/img/waytoodank.webp","../../src/apollo/query/user-self.query.ts","../../src/composables/useContextMenu.ts","../../src/common/Rand.ts","../../src/Logger.ts","../../src/worker/index.ts","../../src/worker/worker.events.ts","../../src/worker/worker.ts","../../src/composables/useWorker.ts","../../src/components/base/UserSearchIcon.vue","../../src/components/utility/ThemeSwitcher.vue","../../src/components/base/Logo.vue","../../src/components/Nav.vue","../../src/components/modal/ModalViewport.vue","../../src/components/overlay/ContextMenu.vue","../../src/apollo/query/emote-set.query.ts","../../src/composables/useObjectSub.ts","../../src/ActorLogic.ts","../../src/App.vue","../../src/icons.ts","../../node_modules/@formkit/utils/dist/index.mjs","../../node_modules/@formkit/core/dist/index.mjs","../../node_modules/@formkit/inputs/dist/index.mjs","../../node_modules/@formkit/rules/dist/index.mjs","../../node_modules/@formkit/observer/dist/index.mjs","../../node_modules/@formkit/validation/dist/index.mjs","../../node_modules/@formkit/i18n/dist/index.mjs","../../node_modules/@formkit/themes/dist/index.mjs","../../node_modules/@formkit/dev/dist/index.mjs","../../node_modules/@formkit/vue/dist/index.mjs","../../node_modules/no-darkreader/nodarkreader.min.js","../../node_modules/v-wave/dist/es/index.js","../../src/main.ts"],"sourcesContent":["var inBrowser = typeof window !== 'undefined';\nvar conn = inBrowser && navigator.connection;\nvar canPrefetch = inBrowser && (!conn || (conn.effectiveType || '').indexOf('2g') === -1 && !conn.saveData);\nvar supportIntersectionObserver = inBrowser && window.IntersectionObserver;\n\n/**\n * Portions copyright 2018 Google Inc.\n * Inspired by Gatsby's prefetching logic, with those portions\n * remaining MIT. Additions include support for Fetch API,\n * XHR switching, SaveData and Effective Connection Type checking.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\nvar preFetched = {};\n/**\n * Checks if a feature on `link` is natively supported.\n * Examples of features include `prefetch` and `preload`.\n * @param {string} feature - name of the feature to test\n * @return {Boolean} whether the feature is supported\n */\n\nfunction support(feature) {\n if (!inBrowser) {\n return;\n }\n\n var link = document.createElement('link');\n return link.relList && link.relList.supports && link.relList.supports(feature);\n}\n/**\n * Fetches a given URL using ``\n * @param {string} url - the URL to fetch\n * @return {Object} a Promise\n */\n\n\nfunction linkPrefetchStrategy(url) {\n return new Promise(function (resolve, reject) {\n var link = document.createElement(\"link\");\n link.rel = \"prefetch\";\n link.href = url;\n link.addEventListener('load', resolve);\n link.addEventListener('error', reject);\n document.head.appendChild(link);\n });\n}\n/**\n * Fetches a given URL using XMLHttpRequest\n * @param {string} url - the URL to fetch\n * @return {Object} a Promise\n */\n\n\nfunction xhrPrefetchStrategy(url) {\n return new Promise(function (resolve, reject) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url, req.withCredentials = true);\n req.addEventListener('load', function () {\n req.status === 200 ? resolve() : reject();\n });\n req.send();\n });\n}\n/**\n * Fetches a given URL using the Fetch API. Falls back\n * to XMLHttpRequest if the API is not supported.\n * @param {string} url - the URL to fetch\n * @return {Object} a Promise\n */\n\n\nfunction highPriFetchStrategy(url) {\n // TODO: Investigate using preload for high-priority\n // fetches. May have to sniff file-extension to provide\n // valid 'as' values. In the future, we may be able to\n // use Priority Hints here.\n //\n // As of 2018, fetch() is high-priority in Chrome\n // and medium-priority in Safari.\n return self.fetch ? fetch(url, {\n credentials: \"include\"\n }) : xhrPrefetchStrategy(url);\n}\n\nvar supportedPrefetchStrategy = support('prefetch') ? linkPrefetchStrategy : xhrPrefetchStrategy;\n/**\n * Prefetch a given URL with an optional preferred fetch priority\n * @param {String} url - the URL to fetch\n * @param {Boolean} isPriority - if is \"high\" priority\n * @param {Object} conn - navigator.connection (internal)\n * @return {Object} a Promise\n */\n\nfunction prefetcher(url, isPriority) {\n if (!canPrefetch || preFetched[url]) {\n return;\n } // Wanna do something on catch()?\n\n\n return (isPriority ? highPriFetchStrategy : supportedPrefetchStrategy)(url).then(function () {\n preFetched[url] = true;\n });\n}\n\nfunction installRouterPrefetch(\n/** @type {import('vue').App} */\napp, ref) {\n if ( ref === void 0 ) ref = {};\n var componentName = ref.componentName; if ( componentName === void 0 ) componentName = 'RouterLink';\n var enablePrefetch = ref.prefetch; if ( enablePrefetch === void 0 ) enablePrefetch = true;\n\n var observer = supportIntersectionObserver && new window.IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n if (entry.isIntersecting) {\n entry.target._linkPrefetch();\n }\n });\n });\n\n var requestIdleCallback = inBrowser && window.requestIdleCallback || function (cb, ref) {\n var timeout = ref.timeout; if ( timeout === void 0 ) timeout = 1;\n\n var start = Date.now();\n return setTimeout(function () {\n cb({\n didTimeout: false,\n\n timeRemaining: function timeRemaining() {\n return Math.max(0, 50 - (Date.now() - start));\n }\n\n });\n }, timeout);\n };\n\n var RouterLink = app.component('RouterLink') || app.component('router-link');\n\n if (process.env.NODE_ENV === 'development' && !RouterLink) {\n console.error(\"[vue-router-prefetch] You need to call app.use(VueRouter) before this plugin!\");\n }\n\n var Link = {\n name: componentName,\n props: Object.assign({}, RouterLink.props, {\n prefetch: {\n type: Boolean,\n default: enablePrefetch\n },\n prefetchFiles: {\n type: Array\n },\n timeout: {\n type: Number,\n default: 2000\n }\n }),\n\n setup: function setup(props, context) {\n return RouterLink.setup(props, context);\n },\n\n mounted: function mounted() {\n if (this.prefetch && observer && canPrefetch) {\n requestIdleCallback(this.observe, {\n timeout: this.timeout\n });\n }\n },\n\n beforeUnmount: function beforeUnmount() {\n this.unobserve();\n },\n\n methods: {\n observe: function observe() {\n observer.observe(this.$el);\n this.$el._linkPrefetch = this.linkPrefetch;\n this._linkObserved = true;\n },\n\n unobserve: function unobserve() {\n if (this._linkObserved) {\n observer.unobserve(this.$el);\n }\n },\n\n getRouteComponents: function getRouteComponents(route) {\n return route.matched.map(function (record) {\n return Object.values(record.components);\n }).flat().filter(function (Component) {\n return typeof Component === 'function' && Component.cid === undefined;\n });\n },\n\n linkPrefetch: function linkPrefetch() {\n var route = this.$router.resolve(this.to);\n if (route.meta.__prefetched) { return; }\n route.meta.__prefetched = true;\n\n if (route.meta.prefetch !== false) {\n // Prefetch route component\n var components = this.getRouteComponents(route);\n\n for (var i = 0, list = components; i < list.length; i += 1) {\n var Component = list[i];\n\n this.$emit('prefetch', this.to);\n Component(); // eslint-disable-line new-cap\n }\n }\n\n if (typeof route.meta.prefetch === 'function') {\n route.meta.prefetch(route);\n } // Prefetch addtional files\n\n\n var prefetchFiles = (this.prefetchFiles || []).concat( (route.meta.prefetchFiles || []));\n\n if (prefetchFiles.length > 0) {\n for (var i$1 = 0, list$1 = prefetchFiles; i$1 < list$1.length; i$1 += 1) {\n var file = list$1[i$1];\n\n prefetcher(file);\n }\n }\n\n this.unobserve();\n }\n\n } // `app.component(Link.name, Link)` will emit a warning\n\n };\n app._context.components[Link.name] = Link;\n}\n\nexport default installRouterPrefetch;\nexport { prefetcher as prefetch, installRouterPrefetch as install };\n","function flatHooks(configHooks, hooks = {}, parentName) {\n for (const key in configHooks) {\n const subHook = configHooks[key];\n const name = parentName ? `${parentName}:${key}` : key;\n if (typeof subHook === \"object\" && subHook !== null) {\n flatHooks(subHook, hooks, name);\n } else if (typeof subHook === \"function\") {\n hooks[name] = subHook;\n }\n }\n return hooks;\n}\nfunction mergeHooks(...hooks) {\n const finalHooks = {};\n for (const hook of hooks) {\n const flatenHook = flatHooks(hook);\n for (const key in flatenHook) {\n if (finalHooks[key]) {\n finalHooks[key].push(flatenHook[key]);\n } else {\n finalHooks[key] = [flatenHook[key]];\n }\n }\n }\n for (const key in finalHooks) {\n if (finalHooks[key].length > 1) {\n const array = finalHooks[key];\n finalHooks[key] = (...arguments_) => serial(array, (function_) => function_(...arguments_));\n } else {\n finalHooks[key] = finalHooks[key][0];\n }\n }\n return finalHooks;\n}\nfunction serial(tasks, function_) {\n return tasks.reduce((promise, task) => promise.then(() => function_(task)), Promise.resolve());\n}\nfunction serialCaller(hooks, arguments_) {\n return hooks.reduce((promise, hookFunction) => promise.then(() => hookFunction.apply(void 0, arguments_)), Promise.resolve());\n}\nfunction parallelCaller(hooks, arguments_) {\n return Promise.all(hooks.map((hook) => hook.apply(void 0, arguments_)));\n}\nfunction callEachWith(callbacks, argument0) {\n for (const callback of callbacks) {\n callback(argument0);\n }\n}\n\nclass Hookable {\n constructor() {\n this._hooks = {};\n this._before = void 0;\n this._after = void 0;\n this._deprecatedMessages = void 0;\n this._deprecatedHooks = {};\n this.hook = this.hook.bind(this);\n this.callHook = this.callHook.bind(this);\n this.callHookWith = this.callHookWith.bind(this);\n }\n hook(name, function_, options = {}) {\n if (!name || typeof function_ !== \"function\") {\n return () => {\n };\n }\n const originalName = name;\n let dep;\n while (this._deprecatedHooks[name]) {\n dep = this._deprecatedHooks[name];\n name = dep.to;\n }\n if (dep && !options.allowDeprecated) {\n let message = dep.message;\n if (!message) {\n message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : \"\");\n }\n if (!this._deprecatedMessages) {\n this._deprecatedMessages = /* @__PURE__ */ new Set();\n }\n if (!this._deprecatedMessages.has(message)) {\n console.warn(message);\n this._deprecatedMessages.add(message);\n }\n }\n this._hooks[name] = this._hooks[name] || [];\n this._hooks[name].push(function_);\n return () => {\n if (function_) {\n this.removeHook(name, function_);\n function_ = void 0;\n }\n };\n }\n hookOnce(name, function_) {\n let _unreg;\n let _function = (...arguments_) => {\n if (typeof _unreg === \"function\") {\n _unreg();\n }\n _unreg = void 0;\n _function = void 0;\n return function_(...arguments_);\n };\n _unreg = this.hook(name, _function);\n return _unreg;\n }\n removeHook(name, function_) {\n if (this._hooks[name]) {\n const index = this._hooks[name].indexOf(function_);\n if (index !== -1) {\n this._hooks[name].splice(index, 1);\n }\n if (this._hooks[name].length === 0) {\n delete this._hooks[name];\n }\n }\n }\n deprecateHook(name, deprecated) {\n this._deprecatedHooks[name] = typeof deprecated === \"string\" ? { to: deprecated } : deprecated;\n const _hooks = this._hooks[name] || [];\n this._hooks[name] = void 0;\n for (const hook of _hooks) {\n this.hook(name, hook);\n }\n }\n deprecateHooks(deprecatedHooks) {\n Object.assign(this._deprecatedHooks, deprecatedHooks);\n for (const name in deprecatedHooks) {\n this.deprecateHook(name, deprecatedHooks[name]);\n }\n }\n addHooks(configHooks) {\n const hooks = flatHooks(configHooks);\n const removeFns = Object.keys(hooks).map((key) => this.hook(key, hooks[key]));\n return () => {\n for (const unreg of removeFns.splice(0, removeFns.length)) {\n unreg();\n }\n };\n }\n removeHooks(configHooks) {\n const hooks = flatHooks(configHooks);\n for (const key in hooks) {\n this.removeHook(key, hooks[key]);\n }\n }\n callHook(name, ...arguments_) {\n return this.callHookWith(serialCaller, name, ...arguments_);\n }\n callHookParallel(name, ...arguments_) {\n return this.callHookWith(parallelCaller, name, ...arguments_);\n }\n callHookWith(caller, name, ...arguments_) {\n const event = this._before || this._after ? { name, args: arguments_, context: {} } : void 0;\n if (this._before) {\n callEachWith(this._before, event);\n }\n const result = caller(this._hooks[name] || [], arguments_);\n if (result instanceof Promise) {\n return result.finally(() => {\n if (this._after && event) {\n callEachWith(this._after, event);\n }\n });\n }\n if (this._after && event) {\n callEachWith(this._after, event);\n }\n return result;\n }\n beforeEach(function_) {\n this._before = this._before || [];\n this._before.push(function_);\n return () => {\n const index = this._before.indexOf(function_);\n if (index !== -1) {\n this._before.splice(index, 1);\n }\n };\n }\n afterEach(function_) {\n this._after = this._after || [];\n this._after.push(function_);\n return () => {\n const index = this._after.indexOf(function_);\n if (index !== -1) {\n this._after.splice(index, 1);\n }\n };\n }\n}\nfunction createHooks() {\n return new Hookable();\n}\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction createDebugger(hooks, _options = {}) {\n const options = {\n inspect: isBrowser,\n group: isBrowser,\n filter: () => true,\n ..._options\n };\n const _filter = options.filter;\n const filter = typeof _filter === \"string\" ? (name) => name.startsWith(_filter) : _filter;\n const _tag = options.tag ? `[${options.tag}] ` : \"\";\n const logPrefix = (event) => _tag + event.name + \"\".padEnd(event._id, \"\\0\");\n const _idCtr = {};\n const unsubscribeBefore = hooks.beforeEach((event) => {\n if (!filter(event.name)) {\n return;\n }\n _idCtr[event.name] = _idCtr[event.name] || 0;\n event._id = _idCtr[event.name]++;\n console.time(logPrefix(event));\n });\n const unsubscribeAfter = hooks.afterEach((event) => {\n if (!filter(event.name)) {\n return;\n }\n if (options.group) {\n console.groupCollapsed(event.name);\n }\n if (options.inspect) {\n console.timeLog(logPrefix(event), event.args);\n } else {\n console.timeEnd(logPrefix(event));\n }\n if (options.group) {\n console.groupEnd();\n }\n _idCtr[event.name]--;\n });\n return {\n close: () => {\n unsubscribeBefore();\n unsubscribeAfter();\n }\n };\n}\n\nexport { Hookable, createDebugger, createHooks, flatHooks, mergeHooks, parallelCaller, serial, serialCaller };\n","import { createHooks } from 'hookable';\nimport { unref, isRef, version, getCurrentInstance, inject, nextTick, ref, watchEffect, watch, onBeforeUnmount } from 'vue';\n\nconst TagsWithInnerContent = [\"script\", \"style\", \"noscript\"];\nconst HasElementTags$1 = [\n \"base\",\n \"meta\",\n \"link\",\n \"style\",\n \"script\",\n \"noscript\"\n];\n\nconst UniqueTags$1 = [\"base\", \"title\", \"titleTemplate\", \"bodyAttrs\", \"htmlAttrs\"];\nfunction tagDedupeKey$1(tag, fn) {\n const { props, tag: tagName } = tag;\n if (UniqueTags$1.includes(tagName))\n return tagName;\n if (tagName === \"link\" && props.rel === \"canonical\")\n return \"canonical\";\n if (props.charset)\n return \"charset\";\n const name = [\"id\"];\n if (tagName === \"meta\")\n name.push(...[\"name\", \"property\", \"http-equiv\"]);\n for (const n of name) {\n if (typeof props[n] !== \"undefined\") {\n const val = String(props[n]);\n if (fn && !fn(val))\n return false;\n return `${tagName}:${n}:${val}`;\n }\n }\n return false;\n}\n\nconst setAttrs = (ctx, markSideEffect) => {\n const { tag, $el } = ctx;\n if (!$el)\n return;\n Object.entries(tag.props).forEach(([k, value]) => {\n value = String(value);\n const attrSdeKey = `attr:${k}`;\n if (k === \"class\") {\n if (!value)\n return;\n for (const c of value.split(\" \")) {\n const classSdeKey = `${attrSdeKey}:${c}`;\n if (markSideEffect)\n markSideEffect(ctx, classSdeKey, () => $el.classList.remove(c));\n if (!$el.classList.contains(c))\n $el.classList.add(c);\n }\n return;\n }\n if (markSideEffect && !k.startsWith(\"data-h-\"))\n markSideEffect(ctx, attrSdeKey, () => $el.removeAttribute(k));\n if ($el.getAttribute(k) !== value)\n $el.setAttribute(k, value);\n });\n if (TagsWithInnerContent.includes(tag.tag) && $el.innerHTML !== (tag.children || \"\"))\n $el.innerHTML = tag.children || \"\";\n};\n\nfunction hashCode(s) {\n let h = 9;\n for (let i = 0; i < s.length; )\n h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9);\n return ((h ^ h >>> 9) + 65536).toString(16).substring(1, 8).toLowerCase();\n}\n\nasync function renderDOMHead(head, options = {}) {\n const ctx = { shouldRender: true };\n await head.hooks.callHook(\"dom:beforeRender\", ctx);\n if (!ctx.shouldRender)\n return;\n const dom = options.document || window.document;\n const staleSideEffects = head._popSideEffectQueue();\n head.headEntries().map((entry) => entry._sde).forEach((sde) => {\n Object.entries(sde).forEach(([key, fn]) => {\n staleSideEffects[key] = fn;\n });\n });\n const preRenderTag = async (tag) => {\n const entry = head.headEntries().find((e) => e._i === tag._e);\n const renderCtx = {\n renderId: tag._d || hashCode(JSON.stringify({ ...tag, _e: void 0, _p: void 0 })),\n $el: null,\n shouldRender: true,\n tag,\n entry,\n staleSideEffects\n };\n await head.hooks.callHook(\"dom:beforeRenderTag\", renderCtx);\n return renderCtx;\n };\n const renders = [];\n const pendingRenders = {\n body: [],\n head: []\n };\n const markSideEffect = (ctx2, key, fn) => {\n key = `${ctx2.renderId}:${key}`;\n if (ctx2.entry)\n ctx2.entry._sde[key] = fn;\n delete staleSideEffects[key];\n };\n const markEl = (ctx2) => {\n head._elMap[ctx2.renderId] = ctx2.$el;\n renders.push(ctx2);\n markSideEffect(ctx2, \"el\", () => {\n ctx2.$el?.remove();\n delete head._elMap[ctx2.renderId];\n });\n };\n for (const t of await head.resolveTags()) {\n const ctx2 = await preRenderTag(t);\n if (!ctx2.shouldRender)\n continue;\n const { tag } = ctx2;\n if (tag.tag === \"title\") {\n dom.title = tag.children || \"\";\n renders.push(ctx2);\n continue;\n }\n if (tag.tag === \"htmlAttrs\" || tag.tag === \"bodyAttrs\") {\n ctx2.$el = dom[tag.tag === \"htmlAttrs\" ? \"documentElement\" : \"body\"];\n setAttrs(ctx2, markSideEffect);\n renders.push(ctx2);\n continue;\n }\n ctx2.$el = head._elMap[ctx2.renderId];\n if (!ctx2.$el && tag._hash) {\n ctx2.$el = dom.querySelector(`${tag.tagPosition?.startsWith(\"body\") ? \"body\" : \"head\"} > ${tag.tag}[data-h-${tag._hash}]`);\n }\n if (ctx2.$el) {\n if (ctx2.tag._d)\n setAttrs(ctx2);\n markEl(ctx2);\n continue;\n }\n ctx2.$el = dom.createElement(tag.tag);\n setAttrs(ctx2);\n pendingRenders[tag.tagPosition?.startsWith(\"body\") ? \"body\" : \"head\"].push(ctx2);\n }\n Object.entries(pendingRenders).forEach(([pos, queue]) => {\n if (!queue.length)\n return;\n for (const $el of [...dom[pos].children].reverse()) {\n const elTag = $el.tagName.toLowerCase();\n if (!HasElementTags$1.includes(elTag))\n continue;\n const dedupeKey = tagDedupeKey$1({\n tag: elTag,\n props: $el.getAttributeNames().reduce((props, name) => ({ ...props, [name]: $el.getAttribute(name) }), {})\n });\n const matchIdx = queue.findIndex((ctx2) => ctx2 && (ctx2.tag._d === dedupeKey || $el.isEqualNode(ctx2.$el)));\n if (matchIdx !== -1) {\n const ctx2 = queue[matchIdx];\n ctx2.$el = $el;\n setAttrs(ctx2);\n markEl(ctx2);\n delete queue[matchIdx];\n }\n }\n queue.forEach((ctx2) => {\n if (!ctx2.$el)\n return;\n switch (ctx2.tag.tagPosition) {\n case \"bodyClose\":\n dom.body.appendChild(ctx2.$el);\n break;\n case \"bodyOpen\":\n dom.body.insertBefore(ctx2.$el, dom.body.firstChild);\n break;\n case \"head\":\n default:\n dom.head.appendChild(ctx2.$el);\n break;\n }\n markEl(ctx2);\n });\n });\n for (const ctx2 of renders)\n await head.hooks.callHook(\"dom:renderTag\", ctx2);\n Object.values(staleSideEffects).forEach((fn) => fn());\n}\nlet domUpdatePromise = null;\nasync function debouncedRenderDOMHead(head, options = {}) {\n function doDomUpdate() {\n domUpdatePromise = null;\n return renderDOMHead(head, options);\n }\n const delayFn = options.delayFn || ((fn) => setTimeout(fn, 10));\n return domUpdatePromise = domUpdatePromise || new Promise((resolve) => delayFn(() => resolve(doDomUpdate())));\n}\n\nconst index = {\n __proto__: null,\n debouncedRenderDOMHead: debouncedRenderDOMHead,\n get domUpdatePromise () { return domUpdatePromise; },\n hashCode: hashCode,\n renderDOMHead: renderDOMHead\n};\n\nconst ValidHeadTags = [\n \"title\",\n \"titleTemplate\",\n \"base\",\n \"htmlAttrs\",\n \"bodyAttrs\",\n \"meta\",\n \"link\",\n \"style\",\n \"script\",\n \"noscript\"\n];\nconst TagConfigKeys = [\"tagPosition\", \"tagPriority\", \"tagDuplicateStrategy\"];\n\nasync function normaliseTag(tagName, input) {\n const tag = { tag: tagName, props: {} };\n if (tagName === \"title\" || tagName === \"titleTemplate\") {\n tag.children = input instanceof Promise ? await input : input;\n return tag;\n }\n tag.props = await normaliseProps({ ...input });\n [\"children\", \"innerHtml\", \"innerHTML\"].forEach((key) => {\n if (typeof tag.props[key] !== \"undefined\") {\n tag.children = tag.props[key];\n if (typeof tag.children === \"object\")\n tag.children = JSON.stringify(tag.children);\n delete tag.props[key];\n }\n });\n Object.keys(tag.props).filter((k) => TagConfigKeys.includes(k)).forEach((k) => {\n tag[k] = tag.props[k];\n delete tag.props[k];\n });\n if (typeof tag.props.class === \"object\" && !Array.isArray(tag.props.class)) {\n tag.props.class = Object.keys(tag.props.class).filter((k) => tag.props.class[k]);\n }\n if (Array.isArray(tag.props.class))\n tag.props.class = tag.props.class.join(\" \");\n if (tag.props.content && Array.isArray(tag.props.content)) {\n return tag.props.content.map((v, i) => {\n const newTag = { ...tag, props: { ...tag.props } };\n newTag.props.content = v;\n newTag.key = `${tag.props.name || tag.props.property}:${i}`;\n return newTag;\n });\n }\n return tag;\n}\nasync function normaliseProps(props) {\n for (const k of Object.keys(props)) {\n if (props[k] instanceof Promise) {\n props[k] = await props[k];\n }\n if (String(props[k]) === \"true\") {\n props[k] = \"\";\n } else if (String(props[k]) === \"false\") {\n delete props[k];\n }\n }\n return props;\n}\n\nconst tagWeight = (tag) => {\n if (typeof tag.tagPriority === \"number\")\n return tag.tagPriority;\n switch (tag.tagPriority) {\n case \"critical\":\n return 2;\n case \"high\":\n return 9;\n case \"low\":\n return 12;\n }\n switch (tag.tag) {\n case \"base\":\n return -1;\n case \"title\":\n return 1;\n case \"meta\":\n if (tag.props.charset)\n return -2;\n if (tag.props[\"http-equiv\"] === \"content-security-policy\")\n return 0;\n return 10;\n default:\n return 10;\n }\n};\nconst sortTags = (aTag, bTag) => {\n return tagWeight(aTag) - tagWeight(bTag);\n};\n\nconst UniqueTags = [\"base\", \"title\", \"titleTemplate\", \"bodyAttrs\", \"htmlAttrs\"];\nfunction tagDedupeKey(tag, fn) {\n const { props, tag: tagName } = tag;\n if (UniqueTags.includes(tagName))\n return tagName;\n if (tagName === \"link\" && props.rel === \"canonical\")\n return \"canonical\";\n if (props.charset)\n return \"charset\";\n const name = [\"id\"];\n if (tagName === \"meta\")\n name.push(...[\"name\", \"property\", \"http-equiv\"]);\n for (const n of name) {\n if (typeof props[n] !== \"undefined\") {\n const val = String(props[n]);\n if (fn && !fn(val))\n return false;\n return `${tagName}:${n}:${val}`;\n }\n }\n return false;\n}\n\nconst renderTitleTemplate = (template, title) => {\n if (template == null)\n return title || null;\n if (typeof template === \"function\")\n return template(title);\n return template.replace(\"%s\", title ?? \"\");\n};\nfunction resolveTitleTemplateFromTags(tags) {\n let titleTemplateIdx = tags.findIndex((i) => i.tag === \"titleTemplate\");\n const titleIdx = tags.findIndex((i) => i.tag === \"title\");\n if (titleIdx !== -1 && titleTemplateIdx !== -1) {\n const newTitle = renderTitleTemplate(\n tags[titleTemplateIdx].children,\n tags[titleIdx].children\n );\n if (newTitle !== null) {\n tags[titleIdx].children = newTitle || tags[titleIdx].children;\n } else {\n delete tags[titleIdx];\n }\n } else if (titleTemplateIdx !== -1) {\n const newTitle = renderTitleTemplate(\n tags[titleTemplateIdx].children\n );\n if (newTitle !== null) {\n tags[titleTemplateIdx].children = newTitle;\n tags[titleTemplateIdx].tag = \"title\";\n titleTemplateIdx = -1;\n }\n }\n if (titleTemplateIdx !== -1) {\n delete tags[titleTemplateIdx];\n }\n return tags.filter(Boolean);\n}\n\nconst DedupesTagsPlugin = (options) => {\n options = options || {};\n const dedupeKeys = options.dedupeKeys || [\"hid\", \"vmid\", \"key\"];\n return defineHeadPlugin({\n hooks: {\n \"tag:normalise\": function({ tag }) {\n dedupeKeys.forEach((key) => {\n if (tag.props[key]) {\n tag.key = tag.props[key];\n delete tag.props[key];\n }\n });\n const dedupe = tag.key ? `${tag.tag}:${tag.key}` : tagDedupeKey(tag);\n if (dedupe)\n tag._d = dedupe;\n },\n \"tags:resolve\": function(ctx) {\n const deduping = {};\n ctx.tags.forEach((tag) => {\n let dedupeKey = tag._d || tag._p;\n const dupedTag = deduping[dedupeKey];\n if (dupedTag) {\n let strategy = tag?.tagDuplicateStrategy;\n if (!strategy && (tag.tag === \"htmlAttrs\" || tag.tag === \"bodyAttrs\"))\n strategy = \"merge\";\n if (strategy === \"merge\") {\n const oldProps = dupedTag.props;\n [\"class\", \"style\"].forEach((key) => {\n if (tag.props[key] && oldProps[key]) {\n if (key === \"style\" && !oldProps[key].endsWith(\";\"))\n oldProps[key] += \";\";\n tag.props[key] = `${oldProps[key]} ${tag.props[key]}`;\n }\n });\n deduping[dedupeKey].props = {\n ...oldProps,\n ...tag.props\n };\n return;\n } else if (tag._e === dupedTag._e) {\n dedupeKey = tag._d = `${dedupeKey}:${tag._p}`;\n }\n const propCount = Object.keys(tag.props).length;\n if ((propCount === 0 || propCount === 1 && typeof tag.props[\"data-h-key\"] !== \"undefined\") && !tag.children) {\n delete deduping[dedupeKey];\n return;\n }\n }\n deduping[dedupeKey] = tag;\n });\n ctx.tags = Object.values(deduping);\n }\n }\n });\n};\n\nconst SortTagsPlugin = () => {\n return defineHeadPlugin({\n hooks: {\n \"tags:resolve\": (ctx) => {\n const tagIndexForKey = (key) => ctx.tags.find((tag) => tag._d === key)?._p;\n for (const tag of ctx.tags) {\n if (!tag.tagPriority || typeof tag.tagPriority === \"number\")\n continue;\n const modifiers = [{ prefix: \"before:\", offset: -1 }, { prefix: \"after:\", offset: 1 }];\n for (const { prefix, offset } of modifiers) {\n if (tag.tagPriority.startsWith(prefix)) {\n const key = tag.tagPriority.replace(prefix, \"\");\n const index = tagIndexForKey(key);\n if (typeof index !== \"undefined\")\n tag._p = index + offset;\n }\n }\n }\n ctx.tags.sort((a, b) => a._p - b._p).sort(sortTags);\n }\n }\n });\n};\n\nconst TitleTemplatePlugin = () => {\n return defineHeadPlugin({\n hooks: {\n \"tags:resolve\": (ctx) => {\n ctx.tags = resolveTitleTemplateFromTags(ctx.tags);\n }\n }\n });\n};\n\nconst DeprecatedTagAttrPlugin = () => {\n return defineHeadPlugin({\n hooks: {\n \"tag:normalise\": function({ tag }) {\n if (typeof tag.props.body !== \"undefined\") {\n tag.tagPosition = \"bodyClose\";\n delete tag.props.body;\n }\n }\n }\n });\n};\n\nconst IsBrowser$1 = typeof window !== \"undefined\";\n\nconst ProvideTagHashPlugin = () => {\n return defineHeadPlugin({\n hooks: {\n \"tag:normalise\": (ctx) => {\n const { tag, entry } = ctx;\n const isDynamic = typeof tag.props._dynamic !== \"undefined\";\n if (!HasElementTags.includes(tag.tag) || !tag.key)\n return;\n tag._hash = hashCode(JSON.stringify({ tag: tag.tag, key: tag.key }));\n if (IsBrowser$1 || getActiveHead()?.resolvedOptions?.document)\n return;\n if (entry._m === \"server\" || isDynamic) {\n tag.props[`data-h-${tag._hash}`] = \"\";\n }\n },\n \"tags:resolve\": (ctx) => {\n ctx.tags = ctx.tags.map((t) => {\n delete t.props._dynamic;\n return t;\n });\n }\n }\n });\n};\n\nconst PatchDomOnEntryUpdatesPlugin = (options) => {\n return defineHeadPlugin({\n hooks: {\n \"entries:updated\": function(head) {\n if (typeof options?.document === \"undefined\" && typeof window === \"undefined\")\n return;\n let delayFn = options?.delayFn;\n if (!delayFn && typeof requestAnimationFrame !== \"undefined\")\n delayFn = requestAnimationFrame;\n Promise.resolve().then(function () { return index; }).then(({ debouncedRenderDOMHead }) => {\n debouncedRenderDOMHead(head, { document: options?.document || window.document, delayFn });\n });\n }\n }\n });\n};\n\nconst EventHandlersPlugin = () => {\n const stripEventHandlers = (mode, tag) => {\n const props = {};\n const eventHandlers = {};\n Object.entries(tag.props).forEach(([key, value]) => {\n if (key.startsWith(\"on\") && typeof value === \"function\")\n eventHandlers[key] = value;\n else\n props[key] = value;\n });\n let delayedSrc;\n if (mode === \"dom\" && tag.tag === \"script\" && typeof props.src === \"string\" && typeof eventHandlers.onload !== \"undefined\") {\n delayedSrc = props.src;\n delete props.src;\n }\n return { props, eventHandlers, delayedSrc };\n };\n return defineHeadPlugin({\n hooks: {\n \"ssr:render\": function(ctx) {\n ctx.tags = ctx.tags.map((tag) => {\n tag.props = stripEventHandlers(\"ssr\", tag).props;\n return tag;\n });\n },\n \"dom:beforeRenderTag\": function(ctx) {\n const { props, eventHandlers, delayedSrc } = stripEventHandlers(\"dom\", ctx.tag);\n if (!Object.keys(eventHandlers).length)\n return;\n ctx.tag.props = props;\n ctx.tag._eventHandlers = eventHandlers;\n ctx.tag._delayedSrc = delayedSrc;\n },\n \"dom:renderTag\": function(ctx) {\n const $el = ctx.$el;\n if (!ctx.tag._eventHandlers || !$el)\n return;\n const $eventListenerTarget = ctx.tag.tag === \"bodyAttrs\" && typeof window !== \"undefined\" ? window : $el;\n Object.entries(ctx.tag._eventHandlers).forEach(([k, value]) => {\n const sdeKey = `${ctx.tag._d || ctx.tag._p}:${k}`;\n const eventName = k.slice(2).toLowerCase();\n const eventDedupeKey = `data-h-${eventName}`;\n delete ctx.staleSideEffects[sdeKey];\n if ($el.hasAttribute(eventDedupeKey))\n return;\n const handler = value;\n $el.setAttribute(eventDedupeKey, \"\");\n $eventListenerTarget.addEventListener(eventName, handler);\n if (ctx.entry) {\n ctx.entry._sde[sdeKey] = () => {\n $eventListenerTarget.removeEventListener(eventName, handler);\n $el.removeAttribute(eventDedupeKey);\n };\n }\n });\n if (ctx.tag._delayedSrc) {\n $el.setAttribute(\"src\", ctx.tag._delayedSrc);\n }\n }\n }\n });\n};\n\nfunction asArray$1(value) {\n return Array.isArray(value) ? value : [value];\n}\nconst HasElementTags = [\n \"base\",\n \"meta\",\n \"link\",\n \"style\",\n \"script\",\n \"noscript\"\n];\n\nlet activeHead;\nconst setActiveHead = (head) => activeHead = head;\nconst getActiveHead = () => activeHead;\n\nconst TagEntityBits = 10;\n\nasync function normaliseEntryTags(e) {\n const tagPromises = [];\n Object.entries(e.resolvedInput || e.input).filter(([k, v]) => typeof v !== \"undefined\" && ValidHeadTags.includes(k)).forEach(([k, value]) => {\n const v = asArray$1(value);\n tagPromises.push(...v.map((props) => normaliseTag(k, props)).flat());\n });\n return (await Promise.all(tagPromises)).flat().map((t, i) => {\n t._e = e._i;\n t._p = (e._i << TagEntityBits) + i;\n return t;\n });\n}\n\nconst CorePlugins = () => [\n DedupesTagsPlugin(),\n SortTagsPlugin(),\n TitleTemplatePlugin(),\n ProvideTagHashPlugin(),\n EventHandlersPlugin(),\n DeprecatedTagAttrPlugin()\n];\nconst DOMPlugins = (options = {}) => [\n PatchDomOnEntryUpdatesPlugin({ document: options?.document, delayFn: options?.domDelayFn })\n];\nfunction createHead$1(options = {}) {\n const head = createHeadCore({\n ...options,\n plugins: [...DOMPlugins(options), ...options?.plugins || []]\n });\n setActiveHead(head);\n return head;\n}\nfunction createHeadCore(options = {}) {\n let entries = [];\n let _sde = {};\n let _eid = 0;\n const hooks = createHooks();\n if (options?.hooks)\n hooks.addHooks(options.hooks);\n options.plugins = [\n ...CorePlugins(),\n ...options?.plugins || []\n ];\n options.plugins.forEach((p) => p.hooks && hooks.addHooks(p.hooks));\n const updated = () => hooks.callHook(\"entries:updated\", head);\n const head = {\n resolvedOptions: options,\n headEntries() {\n return entries;\n },\n get hooks() {\n return hooks;\n },\n use(plugin) {\n if (plugin.hooks)\n hooks.addHooks(plugin.hooks);\n },\n push(input, options2) {\n const activeEntry = {\n _i: _eid++,\n input,\n _sde: {}\n };\n if (options2?.mode)\n activeEntry._m = options2?.mode;\n entries.push(activeEntry);\n updated();\n return {\n dispose() {\n entries = entries.filter((e) => {\n if (e._i !== activeEntry._i)\n return true;\n _sde = { ..._sde, ...e._sde || {} };\n e._sde = {};\n updated();\n return false;\n });\n },\n patch(input2) {\n entries = entries.map((e) => {\n if (e._i === activeEntry._i) {\n activeEntry.input = e.input = input2;\n updated();\n }\n return e;\n });\n }\n };\n },\n async resolveTags() {\n const resolveCtx = { tags: [], entries: [...entries] };\n await hooks.callHook(\"entries:resolve\", resolveCtx);\n for (const entry of resolveCtx.entries) {\n for (const tag of await normaliseEntryTags(entry)) {\n const tagCtx = { tag, entry };\n await hooks.callHook(\"tag:normalise\", tagCtx);\n resolveCtx.tags.push(tagCtx.tag);\n }\n }\n await hooks.callHook(\"tags:resolve\", resolveCtx);\n return resolveCtx.tags;\n },\n _elMap: {},\n _popSideEffectQueue() {\n const sde = { ..._sde };\n _sde = {};\n return sde;\n }\n };\n head.hooks.callHook(\"init\", head);\n return head;\n}\n\nfunction defineHeadPlugin(plugin) {\n return plugin;\n}\nconst composableNames = [\n \"useHead\",\n \"useTagTitle\",\n \"useTagBase\",\n \"useTagMeta\",\n \"useTagMetaFlat\",\n \"useSeoMeta\",\n \"useTagLink\",\n \"useTagScript\",\n \"useTagStyle\",\n \"useTagNoscript\",\n \"useHtmlAttrs\",\n \"useBodyAttrs\",\n \"useTitleTemplate\",\n \"useServerHead\",\n \"useServerTagTitle\",\n \"useServerTagBase\",\n \"useServerTagMeta\",\n \"useServerTagMetaFlat\",\n \"useServerTagLink\",\n \"useServerTagScript\",\n \"useServerTagStyle\",\n \"useServerTagNoscript\",\n \"useServerHtmlAttrs\",\n \"useServerBodyAttrs\",\n \"useServerTitleTemplate\"\n];\n\nfunction resolveUnref(r) {\n return typeof r === \"function\" ? r() : unref(r);\n}\nfunction resolveUnrefHeadInput(ref, lastKey = \"\") {\n if (ref instanceof Promise)\n return ref;\n const root = resolveUnref(ref);\n if (!ref || !root)\n return root;\n if (Array.isArray(root))\n return root.map((r) => resolveUnrefHeadInput(r, lastKey));\n if (typeof root === \"object\") {\n let dynamic = false;\n const unrefdObj = Object.fromEntries(\n Object.entries(root).map(([k, v]) => {\n if (k === \"titleTemplate\" || k.startsWith(\"on\"))\n return [k, unref(v)];\n if (typeof v === \"function\" || isRef(v))\n dynamic = true;\n return [k, resolveUnrefHeadInput(v, k)];\n })\n );\n if (dynamic && HasElementTags.includes(String(lastKey)))\n unrefdObj._dynamic = true;\n return unrefdObj;\n }\n return root;\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\n\nconst Vue3 = version.startsWith(\"3\");\nconst IsBrowser = typeof window !== \"undefined\";\n\nconst headSymbol = \"usehead\";\nfunction injectHead() {\n return getCurrentInstance() && inject(headSymbol) || getActiveHead();\n}\nfunction createHead(options = {}) {\n const head = createHead$1({\n ...options,\n domDelayFn: (fn) => setTimeout(() => nextTick(() => fn()), 10),\n plugins: [\n VueReactiveUseHeadPlugin(),\n ...options?.plugins || []\n ]\n });\n const vuePlugin = {\n install(app) {\n if (Vue3) {\n app.config.globalProperties.$unhead = head;\n app.provide(headSymbol, head);\n }\n }\n };\n head.install = vuePlugin.install;\n return head;\n}\n\nconst VueHeadMixin = {\n created() {\n const instance = getCurrentInstance();\n if (!instance)\n return;\n const options = instance.type;\n if (!options || !(\"head\" in options))\n return;\n const source = typeof options.head === \"function\" ? () => options.head.call(instance.proxy) : options.head;\n useHead(source);\n }\n};\n\nconst VueReactiveUseHeadPlugin = () => {\n return defineHeadPlugin({\n hooks: {\n \"entries:resolve\": function(ctx) {\n for (const entry of ctx.entries)\n entry.resolvedInput = resolveUnrefHeadInput(entry.input);\n }\n }\n });\n};\n\nconst Vue2ProvideUnheadPlugin = function(_Vue, head) {\n _Vue.mixin({\n beforeCreate() {\n const options = this.$options;\n const origProvide = options.provide;\n options.provide = function() {\n let origProvideResult;\n if (typeof origProvide === \"function\")\n origProvideResult = origProvide.call(this);\n else\n origProvideResult = origProvide || {};\n return {\n ...origProvideResult,\n [headSymbol]: head\n };\n };\n }\n });\n};\n\nfunction unpackToArray(input, options) {\n const unpacked = [];\n const kFn = options.resolveKeyData || ((ctx) => ctx.key);\n const vFn = options.resolveValueData || ((ctx) => ctx.value);\n for (const [k, v] of Object.entries(input)) {\n unpacked.push(...(Array.isArray(v) ? v : [v]).map((i) => {\n const ctx = { key: k, value: i };\n const val = vFn(ctx);\n if (typeof val === \"object\")\n return unpackToArray(val, options);\n if (Array.isArray(val))\n return val;\n return {\n [typeof options.key === \"function\" ? options.key(ctx) : options.key]: kFn(ctx),\n [typeof options.value === \"function\" ? options.value(ctx) : options.value]: val\n };\n }).flat());\n }\n return unpacked;\n}\n\nfunction unpackToString(value, options) {\n return Object.entries(value).map(([key, value2]) => {\n if (typeof value2 === \"object\")\n value2 = unpackToString(value2, options);\n if (options.resolve) {\n const resolved = options.resolve({ key, value: value2 });\n if (resolved)\n return resolved;\n }\n if (typeof value2 === \"number\")\n value2 = value2.toString();\n if (typeof value2 === \"string\" && options.wrapValue) {\n value2 = value2.replace(new RegExp(options.wrapValue, \"g\"), `\\\\${options.wrapValue}`);\n value2 = `${options.wrapValue}${value2}${options.wrapValue}`;\n }\n return `${key}${options.keyValueSeparator || \"\"}${value2}`;\n }).join(options.entrySeparator || \"\");\n}\n\nconst MetaPackingSchema = {\n robots: {\n unpack: {\n keyValueSeparator: \":\"\n }\n },\n contentSecurityPolicy: {\n unpack: {\n keyValueSeparator: \" \",\n entrySeparator: \"; \"\n },\n metaKey: \"http-equiv\"\n },\n fbAppId: {\n keyValue: \"fb:app_id\",\n metaKey: \"property\"\n },\n msapplicationTileImage: {\n keyValue: \"msapplication-TileImage\"\n },\n msapplicationTileColor: {\n keyValue: \"msapplication-TileColor\"\n },\n msapplicationConfig: {\n keyValue: \"msapplication-Config\"\n },\n charset: {\n metaKey: \"charset\"\n },\n contentType: {\n metaKey: \"http-equiv\"\n },\n defaultStyle: {\n metaKey: \"http-equiv\"\n },\n xUaCompatible: {\n metaKey: \"http-equiv\"\n },\n refresh: {\n metaKey: \"http-equiv\"\n }\n};\nfunction resolveMetaKeyType(key) {\n return PropertyPrefixKeys.test(key) ? \"property\" : MetaPackingSchema[key]?.metaKey || \"name\";\n}\n\nfunction unpackMeta(input) {\n return unpackToArray(input, {\n key({ key }) {\n return resolveMetaKeyType(key);\n },\n value({ key }) {\n return key === \"charset\" ? \"charset\" : \"content\";\n },\n resolveKeyData({ key }) {\n return MetaPackingSchema[key]?.keyValue || fixKeyCase(key);\n },\n resolveValueData({ value, key }) {\n if (typeof value === \"object\") {\n const definition = MetaPackingSchema[key];\n if (key === \"refresh\")\n return `${value.seconds};url=${value.url}`;\n return unpackToString(\n changeKeyCasingDeep(value),\n {\n entrySeparator: \", \",\n keyValueSeparator: \"=\",\n resolve({ value: value2, key: key2 }) {\n if (typeof value2 === \"boolean\")\n return `${key2}`;\n },\n ...definition?.unpack\n }\n );\n }\n return typeof value === \"number\" ? value.toString() : value;\n }\n });\n}\n\nconst PropertyPrefixKeys = /^(og|twitter|fb)/;\nfunction fixKeyCase(key) {\n key = key.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n if (PropertyPrefixKeys.test(key)) {\n key = key.replace(\"secure-url\", \"secure_url\").replace(/-/g, \":\");\n }\n return key;\n}\nfunction changeKeyCasingDeep(input) {\n if (Array.isArray(input)) {\n return input.map((entry) => changeKeyCasingDeep(entry));\n }\n if (typeof input !== \"object\" || Array.isArray(input))\n return input;\n const output = {};\n for (const [key, value] of Object.entries(input))\n output[fixKeyCase(key)] = changeKeyCasingDeep(value);\n return output;\n}\n\nfunction clientUseHead(input, options = {}) {\n const head = injectHead();\n const resolvedInput = ref({});\n watchEffect(() => {\n resolvedInput.value = resolveUnrefHeadInput(input);\n });\n const entry = head.push(resolvedInput.value, options);\n watch(resolvedInput, (e) => entry.patch(e));\n const vm = getCurrentInstance();\n if (vm) {\n onBeforeUnmount(() => {\n entry.dispose();\n });\n }\n return entry;\n}\n\nfunction serverUseHead(input, options = {}) {\n const head = injectHead();\n return head.push(input, options);\n}\n\nfunction useServerHead(input, options = {}) {\n return useHead(input, { ...options, mode: \"server\" });\n}\nconst useServerTagTitle = (title) => useServerHead({ title });\nconst useServerTitleTemplate = (titleTemplate) => useServerHead({ titleTemplate });\nconst useServerTagMeta = (meta) => useServerHead({ meta: asArray(meta) });\nconst useServerTagMetaFlat = (meta) => {\n const input = ref({});\n watchEffect(() => {\n input.value = unpackMeta(resolveUnrefHeadInput(meta));\n });\n return useServerHead({ meta: input });\n};\nconst useServerTagLink = (link) => useServerHead({ link: asArray(link) });\nconst useServerTagScript = (script) => useServerHead({ script: asArray(script) });\nconst useServerTagStyle = (style) => useServerHead({ style: asArray(style) });\nconst useServerTagNoscript = (noscript) => useServerHead({ noscript: asArray(noscript) });\nconst useServerTagBase = (base) => useServerHead({ base });\nconst useServerHtmlAttrs = (attrs) => useServerHead({ htmlAttrs: attrs });\nconst useServerBodyAttrs = (attrs) => useHead({ bodyAttrs: attrs });\n\nfunction useHead(input, options = {}) {\n const head = injectHead();\n if (head) {\n const isBrowser = IsBrowser || !!head.resolvedOptions?.document;\n if (options.mode === \"server\" && isBrowser || options.mode === \"client\" && !isBrowser)\n return;\n return isBrowser ? clientUseHead(input, options) : serverUseHead(input, options);\n }\n}\nconst useTagTitle = (title) => useHead({ title });\nconst useTitleTemplate = (titleTemplate) => useHead({ titleTemplate });\nconst useTagMeta = (meta) => useHead({ meta: asArray(meta) });\nconst useTagMetaFlat = (meta) => {\n const input = ref({});\n watchEffect(() => {\n input.value = unpackMeta(resolveUnrefHeadInput(meta));\n });\n return useHead({ meta: input });\n};\nconst useSeoMeta = useTagMetaFlat;\nconst useTagLink = (link) => useHead({ link: asArray(link) });\nconst useTagScript = (script) => useHead({ script: asArray(script) });\nconst useTagStyle = (style) => useHead({ style: asArray(style) });\nconst useTagNoscript = (noscript) => useHead({ noscript: asArray(noscript) });\nconst useTagBase = (base) => useHead({ base });\nconst useHtmlAttrs = (attrs) => useHead({ htmlAttrs: attrs });\nconst useBodyAttrs = (attrs) => useHead({ bodyAttrs: attrs });\n\nconst coreComposableNames = [\n \"injectHead\"\n];\nconst unheadVueComposablesImports = [\n {\n from: \"@unhead/vue\",\n imports: [...coreComposableNames, ...composableNames]\n }\n];\n\nexport { Vue2ProvideUnheadPlugin, VueHeadMixin, VueReactiveUseHeadPlugin, asArray, createHead, createHeadCore, headSymbol, injectHead, resolveUnrefHeadInput, unheadVueComposablesImports, useBodyAttrs, useHead, useHtmlAttrs, useSeoMeta, useServerBodyAttrs, useServerHead, useServerHtmlAttrs, useServerTagBase, useServerTagLink, useServerTagMeta, useServerTagMetaFlat, useServerTagNoscript, useServerTagScript, useServerTagStyle, useServerTagTitle, useServerTitleTemplate, useTagBase, useTagLink, useTagMeta, useTagMetaFlat, useTagNoscript, useTagScript, useTagStyle, useTagTitle, useTitleTemplate };\n","const TagsWithInnerContent = [\"script\", \"style\", \"noscript\"];\nconst HasElementTags = [\n \"base\",\n \"meta\",\n \"link\",\n \"style\",\n \"script\",\n \"noscript\"\n];\n\nconst UniqueTags = [\"base\", \"title\", \"titleTemplate\", \"bodyAttrs\", \"htmlAttrs\"];\nfunction tagDedupeKey(tag, fn) {\n const { props, tag: tagName } = tag;\n if (UniqueTags.includes(tagName))\n return tagName;\n if (tagName === \"link\" && props.rel === \"canonical\")\n return \"canonical\";\n if (props.charset)\n return \"charset\";\n const name = [\"id\"];\n if (tagName === \"meta\")\n name.push(...[\"name\", \"property\", \"http-equiv\"]);\n for (const n of name) {\n if (typeof props[n] !== \"undefined\") {\n const val = String(props[n]);\n if (fn && !fn(val))\n return false;\n return `${tagName}:${n}:${val}`;\n }\n }\n return false;\n}\n\nconst setAttrs = (ctx, markSideEffect) => {\n const { tag, $el } = ctx;\n if (!$el)\n return;\n Object.entries(tag.props).forEach(([k, value]) => {\n value = String(value);\n const attrSdeKey = `attr:${k}`;\n if (k === \"class\") {\n if (!value)\n return;\n for (const c of value.split(\" \")) {\n const classSdeKey = `${attrSdeKey}:${c}`;\n if (markSideEffect)\n markSideEffect(ctx, classSdeKey, () => $el.classList.remove(c));\n if (!$el.classList.contains(c))\n $el.classList.add(c);\n }\n return;\n }\n if (markSideEffect && !k.startsWith(\"data-h-\"))\n markSideEffect(ctx, attrSdeKey, () => $el.removeAttribute(k));\n if ($el.getAttribute(k) !== value)\n $el.setAttribute(k, value);\n });\n if (TagsWithInnerContent.includes(tag.tag) && $el.innerHTML !== (tag.children || \"\"))\n $el.innerHTML = tag.children || \"\";\n};\n\nfunction hashCode(s) {\n let h = 9;\n for (let i = 0; i < s.length; )\n h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9);\n return ((h ^ h >>> 9) + 65536).toString(16).substring(1, 8).toLowerCase();\n}\n\nasync function renderDOMHead(head, options = {}) {\n const ctx = { shouldRender: true };\n await head.hooks.callHook(\"dom:beforeRender\", ctx);\n if (!ctx.shouldRender)\n return;\n const dom = options.document || window.document;\n const staleSideEffects = head._popSideEffectQueue();\n head.headEntries().map((entry) => entry._sde).forEach((sde) => {\n Object.entries(sde).forEach(([key, fn]) => {\n staleSideEffects[key] = fn;\n });\n });\n const preRenderTag = async (tag) => {\n const entry = head.headEntries().find((e) => e._i === tag._e);\n const renderCtx = {\n renderId: tag._d || hashCode(JSON.stringify({ ...tag, _e: void 0, _p: void 0 })),\n $el: null,\n shouldRender: true,\n tag,\n entry,\n staleSideEffects\n };\n await head.hooks.callHook(\"dom:beforeRenderTag\", renderCtx);\n return renderCtx;\n };\n const renders = [];\n const pendingRenders = {\n body: [],\n head: []\n };\n const markSideEffect = (ctx2, key, fn) => {\n key = `${ctx2.renderId}:${key}`;\n if (ctx2.entry)\n ctx2.entry._sde[key] = fn;\n delete staleSideEffects[key];\n };\n const markEl = (ctx2) => {\n head._elMap[ctx2.renderId] = ctx2.$el;\n renders.push(ctx2);\n markSideEffect(ctx2, \"el\", () => {\n ctx2.$el?.remove();\n delete head._elMap[ctx2.renderId];\n });\n };\n for (const t of await head.resolveTags()) {\n const ctx2 = await preRenderTag(t);\n if (!ctx2.shouldRender)\n continue;\n const { tag } = ctx2;\n if (tag.tag === \"title\") {\n dom.title = tag.children || \"\";\n renders.push(ctx2);\n continue;\n }\n if (tag.tag === \"htmlAttrs\" || tag.tag === \"bodyAttrs\") {\n ctx2.$el = dom[tag.tag === \"htmlAttrs\" ? \"documentElement\" : \"body\"];\n setAttrs(ctx2, markSideEffect);\n renders.push(ctx2);\n continue;\n }\n ctx2.$el = head._elMap[ctx2.renderId];\n if (!ctx2.$el && tag._hash) {\n ctx2.$el = dom.querySelector(`${tag.tagPosition?.startsWith(\"body\") ? \"body\" : \"head\"} > ${tag.tag}[data-h-${tag._hash}]`);\n }\n if (ctx2.$el) {\n if (ctx2.tag._d)\n setAttrs(ctx2);\n markEl(ctx2);\n continue;\n }\n ctx2.$el = dom.createElement(tag.tag);\n setAttrs(ctx2);\n pendingRenders[tag.tagPosition?.startsWith(\"body\") ? \"body\" : \"head\"].push(ctx2);\n }\n Object.entries(pendingRenders).forEach(([pos, queue]) => {\n if (!queue.length)\n return;\n for (const $el of [...dom[pos].children].reverse()) {\n const elTag = $el.tagName.toLowerCase();\n if (!HasElementTags.includes(elTag))\n continue;\n const dedupeKey = tagDedupeKey({\n tag: elTag,\n props: $el.getAttributeNames().reduce((props, name) => ({ ...props, [name]: $el.getAttribute(name) }), {})\n });\n const matchIdx = queue.findIndex((ctx2) => ctx2 && (ctx2.tag._d === dedupeKey || $el.isEqualNode(ctx2.$el)));\n if (matchIdx !== -1) {\n const ctx2 = queue[matchIdx];\n ctx2.$el = $el;\n setAttrs(ctx2);\n markEl(ctx2);\n delete queue[matchIdx];\n }\n }\n queue.forEach((ctx2) => {\n if (!ctx2.$el)\n return;\n switch (ctx2.tag.tagPosition) {\n case \"bodyClose\":\n dom.body.appendChild(ctx2.$el);\n break;\n case \"bodyOpen\":\n dom.body.insertBefore(ctx2.$el, dom.body.firstChild);\n break;\n case \"head\":\n default:\n dom.head.appendChild(ctx2.$el);\n break;\n }\n markEl(ctx2);\n });\n });\n for (const ctx2 of renders)\n await head.hooks.callHook(\"dom:renderTag\", ctx2);\n Object.values(staleSideEffects).forEach((fn) => fn());\n}\nlet domUpdatePromise = null;\nasync function debouncedRenderDOMHead(head, options = {}) {\n function doDomUpdate() {\n domUpdatePromise = null;\n return renderDOMHead(head, options);\n }\n const delayFn = options.delayFn || ((fn) => setTimeout(fn, 10));\n return domUpdatePromise = domUpdatePromise || new Promise((resolve) => delayFn(() => resolve(doDomUpdate())));\n}\n\nexport { debouncedRenderDOMHead, domUpdatePromise, hashCode, renderDOMHead };\n","import { createHead as createHead$1, useHead, Vue2ProvideUnheadPlugin, injectHead } from '@unhead/vue';\nexport { Vue2ProvideUnheadPlugin, VueHeadMixin, createHeadCore, injectHead, unheadVueComposablesImports, useBodyAttrs, useHead, useHtmlAttrs, useSeoMeta, useServerBodyAttrs, useServerHead, useServerHtmlAttrs, useServerTagBase, useServerTagLink, useServerTagMeta, useServerTagMetaFlat, useServerTagNoscript, useServerTagScript, useServerTagStyle, useServerTagTitle, useServerTitleTemplate, useTagBase, useTagLink, useTagMeta, useTagMetaFlat, useTagNoscript, useTagScript, useTagStyle, useTagTitle, useTitleTemplate } from '@unhead/vue';\nimport { renderDOMHead, debouncedRenderDOMHead } from '@unhead/dom';\nimport { version, defineComponent, ref, onBeforeUnmount, watchEffect } from 'vue';\nimport { renderSSRHead } from '@unhead/ssr';\n\nfunction createHead(initHeadObject) {\n const unhead = createHead$1();\n const legacyHead = {\n unhead,\n install(app) {\n if (version.startsWith(\"3\")) {\n app.config.globalProperties.$head = unhead;\n app.provide(\"usehead\", unhead);\n }\n },\n use(plugin) {\n unhead.use(plugin);\n },\n resolveTags() {\n return unhead.resolveTags();\n },\n headEntries() {\n return unhead.headEntries();\n },\n headTags() {\n return unhead.resolveTags();\n },\n push(input, options) {\n return unhead.push(input, options);\n },\n addEntry(input, options) {\n return unhead.push(input, options);\n },\n addHeadObjs(input, options) {\n return unhead.push(input, options);\n },\n addReactiveEntry(input, options) {\n const api = useHead(input, options);\n if (typeof api !== \"undefined\")\n return api.dispose;\n return () => {\n };\n },\n removeHeadObjs() {\n },\n updateDOM(document, force) {\n if (force)\n renderDOMHead(unhead, { document });\n else\n debouncedRenderDOMHead(unhead, { delayFn: (fn) => setTimeout(() => fn(), 50), document });\n },\n internalHooks: unhead.hooks,\n hooks: {\n \"before:dom\": [],\n \"resolved:tags\": [],\n \"resolved:entries\": []\n }\n };\n unhead.addHeadObjs = legacyHead.addHeadObjs;\n unhead.updateDOM = legacyHead.updateDOM;\n unhead.hooks.hook(\"dom:beforeRender\", (ctx) => {\n for (const hook of legacyHead.hooks[\"before:dom\"]) {\n if (hook() === false)\n ctx.shouldRender = false;\n }\n });\n if (initHeadObject)\n legacyHead.addHeadObjs(initHeadObject);\n return legacyHead;\n}\n\nconst HeadVuePlugin = Vue2ProvideUnheadPlugin;\nconst renderHeadToString = (head) => renderSSRHead(head.unhead);\n\nconst Vue2 = version.startsWith(\"2.\");\nconst IsBrowser = typeof window !== \"undefined\";\n\nconst addVNodeToHeadObj = (node, obj) => {\n const nodeType = Vue2 ? node.tag : node.type;\n const type = nodeType === \"html\" ? \"htmlAttrs\" : nodeType === \"body\" ? \"bodyAttrs\" : nodeType;\n if (typeof type !== \"string\" || !(type in obj))\n return;\n const nodeData = Vue2 ? node.data : node;\n const props = (Vue2 ? nodeData.attrs : node.props) || {};\n if (Vue2) {\n if (nodeData.staticClass)\n props.class = nodeData.staticClass;\n if (nodeData.staticStyle)\n props.style = Object.entries(nodeData.staticStyle).map(([key, value]) => `${key}:${value}`).join(\";\");\n }\n if (node.children) {\n const childrenAttr = Vue2 ? \"text\" : \"children\";\n props.children = Array.isArray(node.children) ? node.children[0][childrenAttr] : node[childrenAttr];\n }\n if (Array.isArray(obj[type]))\n obj[type].push(props);\n else if (type === \"title\")\n obj.title = props.children;\n else\n obj[type] = props;\n};\nconst vnodesToHeadObj = (nodes) => {\n const obj = {\n title: void 0,\n htmlAttrs: void 0,\n bodyAttrs: void 0,\n base: void 0,\n meta: [],\n link: [],\n style: [],\n script: [],\n noscript: []\n };\n for (const node of nodes) {\n if (typeof node.type === \"symbol\" && Array.isArray(node.children)) {\n for (const childNode of node.children)\n addVNodeToHeadObj(childNode, obj);\n } else {\n addVNodeToHeadObj(node, obj);\n }\n }\n return obj;\n};\nconst Head = /* @__PURE__ */ defineComponent({\n name: \"Head\",\n setup(_, { slots }) {\n const head = injectHead();\n const obj = ref({});\n const entry = head.push(obj);\n if (IsBrowser) {\n onBeforeUnmount(() => {\n entry.dispose();\n });\n }\n return () => {\n watchEffect(() => {\n if (!slots.default)\n return;\n entry.patch(vnodesToHeadObj(slots.default()));\n });\n return null;\n };\n }\n});\n\nexport { Head, HeadVuePlugin, createHead, renderHeadToString };\n","import { __assign } from \"tslib\";\nimport { Observable } from \"../../utilities/index.js\";\nvar OperationBatcher = (function () {\n function OperationBatcher(_a) {\n var batchDebounce = _a.batchDebounce, batchInterval = _a.batchInterval, batchMax = _a.batchMax, batchHandler = _a.batchHandler, batchKey = _a.batchKey;\n this.batchesByKey = new Map();\n this.batchDebounce = batchDebounce;\n this.batchInterval = batchInterval;\n this.batchMax = batchMax || 0;\n this.batchHandler = batchHandler;\n this.batchKey = batchKey || (function () { return ''; });\n }\n OperationBatcher.prototype.enqueueRequest = function (request) {\n var _this = this;\n var requestCopy = __assign(__assign({}, request), { next: [], error: [], complete: [], subscribers: new Set() });\n var key = this.batchKey(request.operation);\n if (!requestCopy.observable) {\n requestCopy.observable = new Observable(function (observer) {\n var batch = _this.batchesByKey.get(key);\n if (!batch)\n _this.batchesByKey.set(key, batch = new Set());\n var isFirstEnqueuedRequest = batch.size === 0;\n var isFirstSubscriber = requestCopy.subscribers.size === 0;\n requestCopy.subscribers.add(observer);\n if (isFirstSubscriber) {\n batch.add(requestCopy);\n }\n if (observer.next) {\n requestCopy.next.push(observer.next.bind(observer));\n }\n if (observer.error) {\n requestCopy.error.push(observer.error.bind(observer));\n }\n if (observer.complete) {\n requestCopy.complete.push(observer.complete.bind(observer));\n }\n if (isFirstEnqueuedRequest || _this.batchDebounce) {\n _this.scheduleQueueConsumption(key);\n }\n if (batch.size === _this.batchMax) {\n _this.consumeQueue(key);\n }\n return function () {\n var _a;\n if (requestCopy.subscribers.delete(observer) &&\n requestCopy.subscribers.size < 1) {\n if (batch.delete(requestCopy) && batch.size < 1) {\n _this.consumeQueue(key);\n (_a = batch.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n }\n }\n };\n });\n }\n return requestCopy.observable;\n };\n OperationBatcher.prototype.consumeQueue = function (key) {\n if (key === void 0) { key = ''; }\n var batch = this.batchesByKey.get(key);\n this.batchesByKey.delete(key);\n if (!batch || !batch.size) {\n return;\n }\n var operations = [];\n var forwards = [];\n var observables = [];\n var nexts = [];\n var errors = [];\n var completes = [];\n batch.forEach(function (request) {\n operations.push(request.operation);\n forwards.push(request.forward);\n observables.push(request.observable);\n nexts.push(request.next);\n errors.push(request.error);\n completes.push(request.complete);\n });\n var batchedObservable = this.batchHandler(operations, forwards) || Observable.of();\n var onError = function (error) {\n errors.forEach(function (rejecters) {\n if (rejecters) {\n rejecters.forEach(function (e) { return e(error); });\n }\n });\n };\n batch.subscription = batchedObservable.subscribe({\n next: function (results) {\n if (!Array.isArray(results)) {\n results = [results];\n }\n if (nexts.length !== results.length) {\n var error = new Error(\"server returned results with length \".concat(results.length, \", expected length of \").concat(nexts.length));\n error.result = results;\n return onError(error);\n }\n results.forEach(function (result, index) {\n if (nexts[index]) {\n nexts[index].forEach(function (next) { return next(result); });\n }\n });\n },\n error: onError,\n complete: function () {\n completes.forEach(function (complete) {\n if (complete) {\n complete.forEach(function (c) { return c(); });\n }\n });\n },\n });\n return observables;\n };\n OperationBatcher.prototype.scheduleQueueConsumption = function (key) {\n var _this = this;\n clearTimeout(this.scheduledBatchTimer);\n this.scheduledBatchTimer = setTimeout(function () {\n _this.consumeQueue(key);\n }, this.batchInterval);\n };\n return OperationBatcher;\n}());\nexport { OperationBatcher };\n//# sourceMappingURL=batching.js.map","import { __extends } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { OperationBatcher } from \"./batching.js\";\nexport { OperationBatcher } from \"./batching.js\";\nvar BatchLink = (function (_super) {\n __extends(BatchLink, _super);\n function BatchLink(fetchParams) {\n var _this = _super.call(this) || this;\n var _a = fetchParams || {}, batchDebounce = _a.batchDebounce, _b = _a.batchInterval, batchInterval = _b === void 0 ? 10 : _b, _c = _a.batchMax, batchMax = _c === void 0 ? 0 : _c, _d = _a.batchHandler, batchHandler = _d === void 0 ? function () { return null; } : _d, _e = _a.batchKey, batchKey = _e === void 0 ? function () { return ''; } : _e;\n _this.batcher = new OperationBatcher({\n batchDebounce: batchDebounce,\n batchInterval: batchInterval,\n batchMax: batchMax,\n batchHandler: batchHandler,\n batchKey: batchKey,\n });\n if (fetchParams.batchHandler.length <= 1) {\n _this.request = function (operation) { return _this.batcher.enqueueRequest({ operation: operation }); };\n }\n return _this;\n }\n BatchLink.prototype.request = function (operation, forward) {\n return this.batcher.enqueueRequest({\n operation: operation,\n forward: forward,\n });\n };\n return BatchLink;\n}(ApolloLink));\nexport { BatchLink };\n//# sourceMappingURL=batchLink.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport { fromError } from \"../utils/index.js\";\nimport { serializeFetchParameter, selectURI, parseAndCheckHttpResponse, checkFetcher, selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig, createSignalIfSupported, } from \"../http/index.js\";\nimport { BatchLink } from \"../batch/index.js\";\nvar BatchHttpLink = (function (_super) {\n __extends(BatchHttpLink, _super);\n function BatchHttpLink(fetchParams) {\n var _this = _super.call(this) || this;\n var _a = fetchParams || {}, _b = _a.uri, uri = _b === void 0 ? '/graphql' : _b, fetcher = _a.fetch, _c = _a.print, print = _c === void 0 ? defaultPrinter : _c, includeExtensions = _a.includeExtensions, preserveHeaderCase = _a.preserveHeaderCase, batchInterval = _a.batchInterval, batchDebounce = _a.batchDebounce, batchMax = _a.batchMax, batchKey = _a.batchKey, requestOptions = __rest(_a, [\"uri\", \"fetch\", \"print\", \"includeExtensions\", \"preserveHeaderCase\", \"batchInterval\", \"batchDebounce\", \"batchMax\", \"batchKey\"]);\n checkFetcher(fetcher);\n if (!fetcher) {\n fetcher = fetch;\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions, preserveHeaderCase: preserveHeaderCase },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n _this.batchDebounce = batchDebounce;\n _this.batchInterval = batchInterval || 10;\n _this.batchMax = batchMax || 10;\n var batchHandler = function (operations) {\n var chosenURI = selectURI(operations[0], uri);\n var context = operations[0].getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: __assign(__assign({}, clientAwarenessHeaders), context.headers),\n };\n var optsAndBody = operations.map(function (operation) {\n return selectHttpOptionsAndBodyInternal(operation, print, fallbackHttpConfig, linkConfig, contextConfig);\n });\n var loadedBody = optsAndBody.map(function (_a) {\n var body = _a.body;\n return body;\n });\n var options = optsAndBody[0].options;\n if (options.method === 'GET') {\n return fromError(new Error('apollo-link-batch-http does not support GET requests'));\n }\n try {\n options.body = serializeFetchParameter(loadedBody, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n var controller;\n if (!options.signal) {\n var _b = createSignalIfSupported(), _controller = _b.controller, signal = _b.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n return new Observable(function (observer) {\n fetcher(chosenURI, options)\n .then(function (response) {\n operations.forEach(function (operation) { return operation.setContext({ response: response }); });\n return response;\n })\n .then(parseAndCheckHttpResponse(operations))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n };\n batchKey =\n batchKey ||\n (function (operation) {\n var context = operation.getContext();\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n return selectURI(operation, uri) + JSON.stringify(contextConfig);\n });\n _this.batcher = new BatchLink({\n batchDebounce: _this.batchDebounce,\n batchInterval: _this.batchInterval,\n batchMax: _this.batchMax,\n batchKey: batchKey,\n batchHandler: batchHandler,\n });\n return _this;\n }\n BatchHttpLink.prototype.request = function (operation) {\n return this.batcher.request(operation);\n };\n return BatchHttpLink;\n}(ApolloLink));\nexport { BatchHttpLink };\n//# sourceMappingURL=batchHttpLink.js.map","import { useStore } from \"@/store/main\";\nimport { ApolloClient, ApolloLink, InMemoryCache } from \"@apollo/client/core\";\nimport { BatchHttpLink } from \"@apollo/client/link/batch-http\";\n\n// HTTP connection to the API\nconst httpLink = new BatchHttpLink({\n\t// You should use an absolute URL here\n\turi: `${import.meta.env.VITE_APP_API_GQL}`,\n\tcredentials: \"include\",\n\tbatchMax: 20,\n\tbatchInterval: 20,\n});\n\nlet cycleDetected = false;\n\nconst authLink = new ApolloLink((operation, forward) => {\n\tconst store = useStore();\n\n\t// Use the setContext method to set the HTTP headers.\n\toperation.setContext({\n\t\theaders: store.authToken\n\t\t\t? {\n\t\t\t\t\tauthorization: `Bearer ${store.authToken}`,\n\t\t\t\t\t// Allows to ignore auth failures and still get a response\n\t\t\t\t\t\"x-ignore-auth-failure\": \"true\",\n\t\t\t }\n\t\t\t: {},\n\t});\n\n\t// Call the next link in the middleware chain.\n\treturn forward(operation).map((response) => {\n\t\tconst { response: resp } = operation.getContext();\n\n\t\tif (resp?.headers) {\n\t\t\tconst authFailure = resp.headers.get(\"x-auth-failure\") === \"true\";\n\t\t\tif (authFailure) {\n\t\t\t\tif (!cycleDetected) {\n\t\t\t\t\tstore.setAuthToken(null);\n\t\t\t\t\tcycleDetected = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcycleDetected = false;\n\t\t\t}\n\t\t}\n\n\t\treturn response;\n\t});\n});\n\nconst link = ApolloLink.from([authLink, httpLink]);\n\n// Cache implementation\nconst cache = new InMemoryCache({\n\ttypePolicies: {\n\t\tUser: {\n\t\t\tfields: {\n\t\t\t\troles: {\n\t\t\t\t\tmerge(_, b) {\n\t\t\t\t\t\treturn b;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tEmoteSet: {\n\t\t\tfields: {\n\t\t\t\temotes: {\n\t\t\t\t\tmerge(_, b) {\n\t\t\t\t\t\treturn b;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tChangeMap: {\n\t\t\tfields: {\n\t\t\t\tpulled: {\n\t\t\t\t\tmerge(_, b) {\n\t\t\t\t\t\treturn b;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tpushed: {\n\t\t\t\t\tmerge(_, b) {\n\t\t\t\t\t\treturn b;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n});\n\n// Create the apollo client\nexport const apolloClient = new ApolloClient({\n\tlink: link,\n\tcache,\n\tdefaultOptions: {\n\t\twatchQuery: {\n\t\t\tfetchPolicy: \"no-cache\",\n\t\t},\n\t\tquery: {\n\t\t\tfetchPolicy: \"no-cache\",\n\t\t},\n\t},\n});\n","function getAlignment(placement) {\n return placement.split('-')[1];\n}\n\nfunction getLengthFromAxis(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\n\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\n\nfunction getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';\n}\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const mainAxis = getMainAxisFromPlacement(placement);\n const length = getLengthFromAxis(mainAxis);\n const commonAlign = reference[length] / 2 - floating[length] / 2;\n const side = getSide(placement);\n const isVertical = mainAxis === 'x';\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a reference element when it is given a certain positioning strategy.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n if (process.env.NODE_ENV !== \"production\") {\n if (platform == null) {\n console.error(['Floating UI: `platform` property was not passed to config. If you', 'want to use Floating UI on the web, install @floating-ui/dom', 'instead of the /core package. Otherwise, you can create your own', '`platform`: https://floating-ui.com/docs/platform'].join(' '));\n }\n if (validMiddleware.filter(_ref => {\n let {\n name\n } = _ref;\n return name === 'autoPlacement' || name === 'flip';\n }).length > 1) {\n throw new Error(['Floating UI: duplicate `flip` and/or `autoPlacement` middleware', 'detected. This will lead to an infinite loop. Ensure only one of', 'either has been passed to the `middleware` array.'].join(' '));\n }\n if (!reference || !floating) {\n console.error(['Floating UI: The reference and/or floating element was not defined', 'when `computePosition()` was called. Ensure that both elements have', 'been created and can be measured.'].join(' '));\n }\n }\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (process.env.NODE_ENV !== \"production\") {\n if (resetCount > 50) {\n console.warn(['Floating UI: The middleware lifecycle appears to be running in an', 'infinite loop. This is usually caused by a `reset` continually', 'being returned without a break condition.'].join(' '));\n }\n }\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n continue;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\n\nfunction getSideObjectFromPadding(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\n\nfunction rectToClientRect(rect) {\n return {\n ...rect,\n top: rect.y,\n left: rect.x,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(middlewareArguments, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = middlewareArguments;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = options;\n const paddingObject = getSideObjectFromPadding(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n 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))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n ...rects.floating,\n x,\n y\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n rect,\n offsetParent,\n strategy\n }) : rect);\n if (process.env.NODE_ENV !== \"production\") ;\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\nconst min = Math.min;\nconst max = Math.max;\n\nfunction within(min$1, value, max$1) {\n return max(min$1, min(value, max$1));\n}\n\n/**\n * Positions an inner element of the floating element such that it is centered\n * to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(middlewareArguments) {\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = options || {};\n const {\n x,\n y,\n placement,\n rects,\n platform\n } = middlewareArguments;\n if (element == null) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn('Floating UI: No `element` was passed to the `arrow` middleware.');\n }\n return {};\n }\n const paddingObject = getSideObjectFromPadding(padding);\n const coords = {\n x,\n y\n };\n const axis = getMainAxisFromPlacement(placement);\n const length = getLengthFromAxis(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const minProp = axis === 'y' ? 'top' : 'left';\n const maxProp = axis === 'y' ? 'bottom' : 'right';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n if (clientSize === 0) {\n clientSize = rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min = paddingObject[minProp];\n const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = within(min, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. This stops `shift()` from taking action, but can\n // be worked around by calling it again after the `arrow()` if desired.\n const shouldAddOffset = getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min ? paddingObject[minProp] : paddingObject[maxProp]) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;\n return {\n [axis]: coords[axis] - alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset\n }\n };\n }\n});\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-start\", side + \"-end\"), []);\n\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\n\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const mainAxis = getMainAxisFromPlacement(placement);\n const length = getLengthFromAxis(mainAxis);\n let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return {\n main: mainAlignmentSide,\n cross: getOppositePlacement(mainAlignmentSide)\n };\n}\n\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Automatically chooses the `placement` which has the most space available.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(middlewareArguments) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsSortedByLe;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = middlewareArguments;\n const {\n alignment,\n allowedPlacements = allPlacements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = options;\n const placements = alignment !== undefined || allowedPlacements === allPlacements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const {\n main,\n cross\n } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByLeastOverflow = allOverflows.slice().sort((a, b) => a.overflows[0] - b.overflows[0]);\n const placementThatFitsOnAllSides = (_placementsSortedByLe = placementsSortedByLeastOverflow.find(_ref => {\n let {\n overflows\n } = _ref;\n return overflows.every(overflow => overflow <= 0);\n })) == null ? void 0 : _placementsSortedByLe.placement;\n const resetPlacement = placementThatFitsOnAllSides || placementsSortedByLeastOverflow[0].placement;\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\n\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\n\n/**\n * Changes the placement of the floating element to one that will fit if the\n * initially specified `placement` does not.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(middlewareArguments) {\n var _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = middlewareArguments;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = options;\n const side = getSide(placement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const {\n main,\n cross\n } = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[main], overflow[cross]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n let resetPlacement = 'bottom';\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$map$so;\n const placement = (_overflowsData$map$so = overflowsData.map(d => [d, 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].placement;\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(middlewareArguments) {\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = options;\n const {\n rects\n } = middlewareArguments;\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(middlewareArguments, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(middlewareArguments, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(middlewareArguments) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = middlewareArguments;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = options;\n const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n rect: rects.reference,\n offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),\n strategy\n }) : rects.reference);\n const clientRects = (await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || [];\n const paddingObject = getSideObjectFromPadding(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n 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;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getMainAxisFromPlacement(placement) === 'x') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n 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) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nasync function convertValueToCoords(middlewareArguments, value) {\n const {\n placement,\n platform,\n elements\n } = middlewareArguments;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getMainAxisFromPlacement(placement) === 'x';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = typeof value === 'function' ? value(middlewareArguments) : value;\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Displaces the floating element from its reference element.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (value) {\n if (value === void 0) {\n value = 0;\n }\n return {\n name: 'offset',\n options: value,\n async fn(middlewareArguments) {\n const {\n x,\n y\n } = middlewareArguments;\n const diffCoords = await convertValueToCoords(middlewareArguments, value);\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: diffCoords\n };\n }\n };\n};\n\nfunction getCrossAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\n\n/**\n * Shifts the floating element in order to keep it in view when it will overflow\n * a clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(middlewareArguments) {\n const {\n x,\n y,\n placement\n } = middlewareArguments;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = options;\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);\n const mainAxis = getMainAxisFromPlacement(getSide(placement));\n const crossAxis = getCrossAxis(mainAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = within(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = within(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...middlewareArguments,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(middlewareArguments) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = middlewareArguments;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = options;\n const coords = {\n x,\n y\n };\n const mainAxis = getMainAxisFromPlacement(placement);\n const crossAxis = getCrossAxis(mainAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = typeof offset === 'function' ? offset(middlewareArguments) : offset;\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n 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);\n 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);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data to change the size of the floating element. For instance,\n * prevent it from overflowing its clipping boundary or match the width of the\n * reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(middlewareArguments) {\n const {\n placement,\n rects,\n platform,\n elements\n } = middlewareArguments;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = options;\n const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n const dimensions = {\n availableHeight: rects.floating.height - (['left', 'right'].includes(placement) ? 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)) : overflow[heightSide]),\n availableWidth: rects.floating.width - (['top', 'bottom'].includes(placement) ? 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)) : overflow[widthSide])\n };\n await apply({\n ...middlewareArguments,\n ...dimensions\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (rects.floating.width !== nextDimensions.width || rects.floating.height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, rectToClientRect, shift, size };\n","import { rectToClientRect, computePosition as computePosition$1 } from '@floating-ui/core';\nexport { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, offset, shift, size } from '@floating-ui/core';\n\nfunction getWindow(node) {\n var _node$ownerDocument;\n return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\n\nfunction getComputedStyle$1(element) {\n return getWindow(element).getComputedStyle(element);\n}\n\nfunction getNodeName(node) {\n return isNode(node) ? (node.nodeName || '').toLowerCase() : '';\n}\n\nlet uaString;\nfunction getUAString() {\n if (uaString) {\n return uaString;\n }\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n uaString = uaData.brands.map(item => item.brand + \"/\" + item.version).join(' ');\n return uaString;\n }\n return navigator.userAgent;\n}\n\nfunction isHTMLElement(value) {\n return value instanceof getWindow(value).HTMLElement;\n}\nfunction isElement(value) {\n return value instanceof getWindow(value).Element;\n}\nfunction isNode(value) {\n return value instanceof getWindow(value).Node;\n}\nfunction isShadowRoot(node) {\n // Browsers without `ShadowRoot` support\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle$1(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isContainingBlock(element) {\n // TODO: Try and use feature detection here instead\n const isFirefox = /firefox/i.test(getUAString());\n const css = getComputedStyle$1(element);\n const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;\n\n // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n return css.transform !== 'none' || css.perspective !== 'none' || (backdropFilter ? backdropFilter !== 'none' : false) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective'].some(value => css.willChange.includes(value)) || ['paint', 'layout', 'strict', 'content'].some(\n // TS 4.1 compat\n value => {\n const contain = css.contain;\n return contain != null ? contain.includes(value) : false;\n });\n}\nfunction isLayoutViewport() {\n // Not Safari\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n // Feature detection for this fails in various ways\n // • Always-visible scrollbar or not\n // • Width of , etc.\n // const vV = win.visualViewport;\n // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;\n}\n\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\n\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n let width = parseFloat(css.width);\n let height = parseFloat(css.height);\n const offsetWidth = element.offsetWidth;\n const offsetHeight = element.offsetHeight;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n fallback: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nconst FALLBACK_SCALE = {\n x: 1,\n y: 1\n};\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return FALLBACK_SCALE;\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n fallback\n } = getCssDimensions(domElement);\n let x = (fallback ? round(rect.width) : rect.width) / width;\n let y = (fallback ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n var _win$visualViewport, _win$visualViewport2;\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = FALLBACK_SCALE;\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const win = domElement ? getWindow(domElement) : window;\n const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n let x = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale.x;\n let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentIFrame = win.frameElement;\n while (currentIFrame && offsetParent && offsetWin !== win) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += iframeRect.x;\n y += iframeRect.y;\n currentIFrame = getWindow(currentIFrame).frameElement;\n }\n }\n return {\n width,\n height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x,\n y\n };\n}\n\nfunction getDocumentElement(node) {\n return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;\n}\n\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.pageXOffset,\n scrollTop: element.pageYOffset\n };\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const rect = getBoundingClientRect(element, true, strategy === 'fixed', offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = {\n x: 0,\n y: 0\n };\n if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent, true);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node\n node.assignedSlot ||\n // DOM Element detected\n node.parentNode || (\n // ShadowRoot detected\n isShadowRoot(node) ? node.host : null) ||\n // Fallback\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n return element.offsetParent;\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else {\n currentNode = getParentNode(currentNode);\n }\n }\n return null;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element) {\n const window = getWindow(element);\n let offsetParent = getTrueOffsetParent(element);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n return window;\n }\n return offsetParent || getContainingBlock(element) || window;\n}\n\nfunction getDimensions(element) {\n return getCssDimensions(element);\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n if (offsetParent === documentElement) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = {\n x: 1,\n y: 1\n };\n const offsets = {\n x: 0,\n y: 0\n };\n if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n // This doesn't appear to need to be negated.\n // else if (documentElement) {\n // offsets.x = getWindowScrollBarX(documentElement);\n // }\n }\n\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const layoutViewport = isLayoutViewport();\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `
` rect bounds if horizontally scrollable\nfunction getDocumentRect(element) {\n var _element$ownerDocumen;\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n // @ts-ignore assume body is always available\n return node.ownerDocument.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\n\nfunction getOverflowAncestors(node, list) {\n var _node$ownerDocument;\n if (list === void 0) {\n list = [];\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));\n}\n\n// Returns the inner client rect, subtracting scrollbars if present\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : {\n x: 1,\n y: 1\n };\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y,\n width,\n height\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n if (clippingAncestor === 'viewport') {\n return rectToClientRect(getViewportRect(element, strategy));\n }\n if (isElement(clippingAncestor)) {\n return getInnerBoundingClientRect(clippingAncestor, strategy);\n }\n return rectToClientRect(getDocumentRect(getDocumentElement(element)));\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const containingBlock = isContainingBlock(currentNode);\n const shouldDropCurrentNode = elementIsFixed ? !containingBlock && !currentContainingBlockComputedStyle : !containingBlock && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nconst platform = {\n getClippingRect,\n convertOffsetParentRelativeRectToViewportRelativeRect,\n isElement,\n getDimensions,\n getOffsetParent,\n getDocumentElement,\n getScale,\n async getElementRects(_ref) {\n let {\n reference,\n floating,\n strategy\n } = _ref;\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n return {\n reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),\n floating: {\n x: 0,\n y: 0,\n ...(await getDimensionsFn(floating))\n }\n };\n },\n getClientRects: element => Array.from(element.getClientRects()),\n isRTL: element => getComputedStyle$1(element).direction === 'rtl'\n};\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll: _ancestorScroll = true,\n ancestorResize = true,\n elementResize = true,\n animationFrame = false\n } = options;\n const ancestorScroll = _ancestorScroll && !animationFrame;\n const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : reference.contextElement ? getOverflowAncestors(reference.contextElement) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n let observer = null;\n if (elementResize) {\n let initialUpdate = true;\n observer = new ResizeObserver(() => {\n if (!initialUpdate) {\n update();\n }\n initialUpdate = false;\n });\n isElement(reference) && !animationFrame && observer.observe(reference);\n if (!isElement(reference) && reference.contextElement && !animationFrame) {\n observer.observe(reference.contextElement);\n }\n observer.observe(floating);\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _observer;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n (_observer = observer) == null ? void 0 : _observer.disconnect();\n observer = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a reference element when it is given a certain CSS positioning\n * strategy.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { autoUpdate, computePosition, getOverflowAncestors, platform };\n","import { Component, markRaw, nextTick, reactive } from \"vue\";\nimport { Placement, computePosition, shift } from \"@floating-ui/dom\";\n\nexport const tooltip = reactive({\n\tx: 0,\n\ty: 0,\n\tcontent: null as Component | string | null,\n\tcontentProps: {} as Record