@stonecrop/desktop 0.8.13 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"desktop.js","sources":["../src/components/ActionSet.vue","../src/components/CommandPalette.vue","../../stonecrop/dist/stonecrop.js","../../aform/dist/aform.js","../src/components/SheetNav.vue","../src/components/Desktop.vue","../src/plugins/index.ts"],"sourcesContent":["<template>\n\t<div\n\t\t:class=\"{ 'open-set': isOpen, 'hovered-and-closed': closeClicked }\"\n\t\tclass=\"action-set collapse\"\n\t\t@mouseover=\"onHover\"\n\t\t@mouseleave=\"onHoverLeave\">\n\t\t<div class=\"action-menu-icon\">\n\t\t\t<div id=\"chevron\" @click=\"closeClicked = !closeClicked\">\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"leftBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"54.2,33.4 29.2,58.8 25,54.6 50,29.2 \" />\n\t\t\t\t</svg>\n\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"rightBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"70.8,58.8 45.8,33.4 50,29.2 75,54.6 \" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"margin-right: 30px\"></div>\n\t\t<div v-for=\"(el, index) in elements\" :key=\"el.label\" class=\"action-element\">\n\t\t\t<button\n\t\t\t\tv-if=\"el.type == 'button'\"\n\t\t\t\t:disabled=\"el.disabled\"\n\t\t\t\tclass=\"button-default\"\n\t\t\t\t@click=\"handleClick(el.action, el.label)\">\n\t\t\t\t{{ el.label }}\n\t\t\t</button>\n\t\t\t<div v-if=\"el.type == 'dropdown'\">\n\t\t\t\t<button class=\"button-default\" @click=\"toggleDropdown(index)\">{{ el.label }}</button>\n\t\t\t\t<div v-show=\"dropdownStates[index]\" class=\"dropdown-container\">\n\t\t\t\t\t<div class=\"dropdown\">\n\t\t\t\t\t\t<div v-for=\"(item, itemIndex) in el.actions\" :key=\"item.label\">\n\t\t\t\t\t\t\t<button v-if=\"item.action != null\" class=\"dropdown-item\" @click=\"handleClick(item.action, item.label)\">\n\t\t\t\t\t\t\t\t{{ item.label }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a v-else-if=\"item.link != null\" :href=\"item.link\"\n\t\t\t\t\t\t\t\t><button class=\"dropdown-item\">{{ item.label }}</button></a\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue'\n\nimport type { ActionElements } from '../types'\n\nconst { elements = [] } = defineProps<{ elements?: ActionElements[] }>()\nconst emit = defineEmits<{\n\tactionClick: [label: string, action: (() => void | Promise<void>) | undefined]\n}>()\n\n// Track dropdown open state separately (index -> boolean)\nconst dropdownStates = ref<Record<number, boolean>>({})\n\nconst isOpen = ref(false)\nconst timeoutId = ref<number>(-1)\nconst hover = ref(false)\nconst closeClicked = ref(false)\n\nonMounted(() => {\n\tcloseDropdowns()\n})\n\nconst closeDropdowns = () => {\n\tdropdownStates.value = {}\n}\n\nconst onHover = () => {\n\thover.value = true\n\ttimeoutId.value = setTimeout(() => {\n\t\tif (hover.value) {\n\t\t\tisOpen.value = true\n\t\t}\n\t}, 500)\n}\n\nconst onHoverLeave = () => {\n\thover.value = false\n\tcloseClicked.value = false\n\tclearTimeout(timeoutId.value)\n\tisOpen.value = false\n}\n\nconst toggleDropdown = (index: number) => {\n\tconst showDropdown = !dropdownStates.value[index]\n\tcloseDropdowns()\n\tif (showDropdown) {\n\t\tdropdownStates.value[index] = true\n\t}\n}\n\nconst handleClick = (action: (() => void | Promise<void>) | undefined, label: string) => {\n\t// Emit event to parent - parent will handle execution\n\temit('actionClick', label, action)\n}\n</script>\n\n<style scoped>\n#chevron {\n\tposition: relative;\n\ttransform: rotate(90deg);\n}\n\n.leftBar,\n.rightBar {\n\ttransition-duration: 0.225s;\n\ttransition-property: transform;\n}\n\n.leftBar,\n.action-set.collapse.hovered-and-closed:hover .leftBar {\n\ttransform-origin: 33.4% 50%;\n\ttransform: rotate(90deg);\n}\n\n.rightBar,\n.action-set.collapse.hovered-and-closed:hover .rightBar {\n\ttransform-origin: 67% 50%;\n\ttransform: rotate(-90deg);\n}\n\n.rightBar {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n}\n\n.action-set.collapse:hover .leftBar {\n\ttransform: rotate(0);\n}\n\n.action-set.collapse:hover .rightBar {\n\ttransform: rotate(0);\n}\n\n.action-set {\n\tposition: fixed;\n\ttop: 10px;\n\tright: 10px;\n\tpadding: 20px;\n\tbox-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);\n\tborder-radius: 10px;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tbackground-color: white;\n\toverflow: hidden;\n\tz-index: 1001; /* Above SheetNav (100) and operation log button (999) */\n}\n\n.action-menu-icon {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 4px;\n}\n\n.action-menu-icon svg {\n\tfill: #333333;\n}\n\n.action-set.collapse,\n.action-set.collapse.hovered-and-closed:hover {\n\tmax-width: 25px;\n\toverflow: hidden;\n\n\t-webkit-transition: max-width 0.5s ease-in-out;\n\t-moz-transition: max-width 0.5s ease-in-out;\n\t-o-transition: max-width 0.5s ease-in-out;\n\ttransition: max-width 0.5s ease-in-out;\n}\n\n.action-set.collapse .action-element,\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0;\n\t-webkit-transition: opacity 0.25s ease-in-out;\n\t-moz-transition: opacity 0.25s ease-in-out;\n\t-o-transition: opacity 0.25s ease-in-out;\n\ttransition: opacity 0.25s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.action-set.collapse:hover {\n\tmax-width: 500px;\n}\n\n.action-set.collapse.open-set:hover {\n\toverflow: visible !important;\n}\n\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-set.collapse:hover .action-element {\n\topacity: 100 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-element {\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n\tposition: relative; /* Make this the positioning context for absolute children */\n}\nbutton.button-default {\n\tbackground-color: #ffffff;\n\tpadding: 5px 12px;\n\tborder-radius: 3px;\n\tbox-shadow: rgba(0, 0, 0, 0.05) 0px 0.5px 0px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,\n\t\trgba(0, 0, 0, 0.05) 0px 2px 4px 0px;\n\tborder: none;\n\tcursor: pointer;\n\twhite-space: nowrap;\n}\n\nbutton.button-default:hover {\n\tbackground-color: #f2f2f2;\n}\n\nbutton.button-default:disabled {\n\topacity: 0.5;\n\tcursor: not-allowed;\n\tbackground-color: #f5f5f5;\n\tcolor: #999;\n}\n\nbutton.button-default:disabled:hover {\n\tbackground-color: #f5f5f5;\n}\n\n.dropdown-container {\n\tposition: relative;\n}\n\n.dropdown {\n\tposition: absolute;\n\tright: 0;\n\tmin-width: 200px;\n\tbox-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);\n\tborder-radius: 10px;\n\tbackground-color: #ffffff;\n\tpadding: 10px;\n\tz-index: 1000;\n}\n\nbutton.dropdown-item {\n\twidth: 100%;\n\tpadding: 8px 5px;\n\ttext-align: left;\n\tborder: none;\n\tbackground-color: #ffffff;\n\tcursor: pointer;\n\tborder-radius: 5px;\n}\n\nbutton.dropdown-item:hover {\n\tbackground-color: #f2f2f2;\n}\n</style>\n","<template>\n\t<Teleport to=\"body\">\n\t\t<Transition name=\"fade\">\n\t\t\t<div v-if=\"isOpen\" class=\"command-palette-overlay\" @click=\"closeModal\">\n\t\t\t\t<div class=\"command-palette\" @click.stop>\n\t\t\t\t\t<div class=\"command-palette-header\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"command-palette-input\"\n\t\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\t@keydown=\"handleKeydown\" />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"results.length\" class=\"command-palette-results\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"(result, index) in results\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"command-palette-result\"\n\t\t\t\t\t\t\t:class=\"{ selected: index === selectedIndex }\"\n\t\t\t\t\t\t\t@click=\"selectResult(result)\"\n\t\t\t\t\t\t\t@mouseover=\"selectedIndex = index\">\n\t\t\t\t\t\t\t<div class=\"result-title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"result-content\">\n\t\t\t\t\t\t\t\t<slot name=\"content\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-else-if=\"query && !results.length\" class=\"command-palette-no-results\">\n\t\t\t\t\t\t<slot name=\"empty\"> No results found for \"{{ query }}\" </slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Transition>\n\t</Teleport>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { ref, computed, watch, nextTick, useTemplateRef } from 'vue'\n\ndefineSlots<{\n\ttitle?: { result: T }\n\tcontent?: { result: T }\n\tempty?: null\n}>()\n\nconst {\n\tsearch,\n\tisOpen = false,\n\tplaceholder = 'Type a command or search...',\n\tmaxResults = 10,\n} = defineProps<{\n\tsearch: (query: string) => T[]\n\tisOpen?: boolean\n\tplaceholder?: string\n\tmaxResults?: number\n}>()\n\nconst emit = defineEmits<{\n\tselect: [T]\n\tclose: []\n}>()\n\nconst query = ref('')\nconst selectedIndex = ref(0)\nconst inputRef = useTemplateRef('input')\n\nconst results = computed(() => {\n\tif (!query.value) return []\n\tconst results = search(query.value)\n\treturn results.slice(0, maxResults)\n})\n\n// reset search query when modal opens\nwatch(\n\t() => isOpen,\n\tasync isOpen => {\n\t\tif (isOpen) {\n\t\t\tquery.value = ''\n\t\t\tselectedIndex.value = 0\n\t\t\tawait nextTick()\n\t\t\t;(inputRef.value as HTMLInputElement)?.focus()\n\t\t}\n\t}\n)\n\n// reset selected index when results change\nwatch(results, () => {\n\tselectedIndex.value = 0\n})\n\nconst closeModal = () => {\n\temit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n\tswitch (e.key) {\n\t\tcase 'Escape':\n\t\t\tcloseModal()\n\t\t\tbreak\n\t\tcase 'ArrowDown':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value + 1) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'ArrowUp':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value - 1 + results.value.length) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'Enter':\n\t\t\tif (results.value.length && selectedIndex.value >= 0) {\n\t\t\t\tselectResult(results.value[selectedIndex.value])\n\t\t\t}\n\t\t\tbreak\n\t}\n}\n\nconst selectResult = (result: T) => {\n\temit('select', result)\n\tcloseModal()\n}\n</script>\n\n<style>\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 0.2s ease;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.command-palette-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.5);\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tz-index: 9999;\n\tpadding-top: 100px;\n}\n\n.command-palette {\n\twidth: 600px;\n\tmax-width: 90%;\n\tbackground-color: white;\n\tborder-radius: 8px;\n\tbox-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\toverflow: hidden;\n\tmax-height: 80vh;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.command-palette-header {\n\tdisplay: flex;\n\tborder-bottom: 1px solid #eaeaea;\n\tpadding: 12px;\n}\n\n.command-palette-input {\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tfont-size: 16px;\n\tpadding: 8px 12px;\n\tbackground-color: transparent;\n}\n\n.command-palette-close {\n\tbackground: transparent;\n\tborder: none;\n\tfont-size: 24px;\n\tcursor: pointer;\n\tcolor: #666;\n\tpadding: 0 8px;\n}\n\n.command-palette-close:hover {\n\tcolor: #333;\n}\n\n.command-palette-results {\n\toverflow-y: auto;\n\tmax-height: 60vh;\n}\n\n.command-palette-result {\n\tpadding: 12px 16px;\n\tcursor: pointer;\n\tborder-bottom: 1px solid #f0f0f0;\n}\n\n.command-palette-result:hover,\n.command-palette-result.selected {\n\tbackground-color: #f5f5f5;\n}\n\n.command-palette-result.selected {\n\tbackground-color: rgba(132, 60, 3, 0.1);\n}\n\n.result-title {\n\tfont-weight: 500;\n\tmargin-bottom: 4px;\n\tcolor: #333;\n}\n\n.result-content {\n\tfont-size: 14px;\n\tcolor: #666;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.command-palette-no-results {\n\tpadding: 20px 16px;\n\ttext-align: center;\n\tcolor: #666;\n}\n</style>\n","import { hasInjectionContext as Ae, inject as oe, toRaw as Me, computed as W, isRef as se, isReactive as be, toRef as ce, getCurrentInstance as Fe, ref as B, reactive as ye, markRaw as ae, effectScope as Ye, nextTick as de, getCurrentScope as Xe, onScopeDispose as et, watch as U, toRefs as $e, onMounted as Be, readonly as je, customRef as tt, toValue as q, shallowRef as We, unref as rt, provide as De } from \"vue\";\nconst te = typeof window < \"u\";\nlet G;\nconst me = (n) => G = n;\nprocess.env.NODE_ENV;\nconst Pe = process.env.NODE_ENV !== \"production\" ? /* @__PURE__ */ Symbol(\"pinia\") : (\n /* istanbul ignore next */\n /* @__PURE__ */ Symbol()\n);\nfunction Y(n) {\n return n && typeof n == \"object\" && Object.prototype.toString.call(n) === \"[object Object]\" && typeof n.toJSON != \"function\";\n}\nvar le;\n(function(n) {\n n.direct = \"direct\", n.patchObject = \"patch object\", n.patchFunction = \"patch function\";\n})(le || (le = {}));\nfunction He(n, e) {\n for (const t in e) {\n const r = e[t];\n if (!(t in n))\n continue;\n const o = n[t];\n Y(o) && Y(r) && !se(r) && !be(r) ? n[t] = He(o, r) : n[t] = r;\n }\n return n;\n}\nconst ze = () => {\n};\nfunction Te(n, e, t, r = ze) {\n n.add(e);\n const o = () => {\n n.delete(e) && r();\n };\n return !t && Xe() && et(o), o;\n}\nfunction ee(n, ...e) {\n n.forEach((t) => {\n t(...e);\n });\n}\nconst nt = (n) => n(), Ie = /* @__PURE__ */ Symbol(), Ee = /* @__PURE__ */ Symbol();\nfunction Ne(n, e) {\n n instanceof Map && e instanceof Map ? e.forEach((t, r) => n.set(r, t)) : n instanceof Set && e instanceof Set && e.forEach(n.add, n);\n for (const t in e) {\n if (!e.hasOwnProperty(t))\n continue;\n const r = e[t], o = n[t];\n Y(o) && Y(r) && n.hasOwnProperty(t) && !se(r) && !be(r) ? n[t] = Ne(o, r) : n[t] = r;\n }\n return n;\n}\nconst ot = process.env.NODE_ENV !== \"production\" ? /* @__PURE__ */ Symbol(\"pinia:skipHydration\") : (\n /* istanbul ignore next */\n /* @__PURE__ */ Symbol()\n);\nfunction st(n) {\n return !Y(n) || !Object.prototype.hasOwnProperty.call(n, ot);\n}\nconst { assign: z } = Object;\nfunction Ce(n) {\n return !!(se(n) && n.effect);\n}\nfunction ke(n, e, t, r) {\n const { state: o, actions: s, getters: i } = e, a = t.state.value[n];\n let c;\n function f() {\n !a && (process.env.NODE_ENV === \"production\" || !r) && (t.state.value[n] = o ? o() : {});\n const g = process.env.NODE_ENV !== \"production\" && r ? (\n // use ref() to unwrap refs inside state TODO: check if this is still necessary\n $e(B(o ? o() : {}).value)\n ) : $e(t.state.value[n]);\n return z(g, s, Object.keys(i || {}).reduce((b, A) => (process.env.NODE_ENV !== \"production\" && A in g && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${A}\" in store \"${n}\".`), b[A] = ae(W(() => {\n me(t);\n const $ = t._s.get(n);\n return i[A].call($, $);\n })), b), {}));\n }\n return c = _e(n, f, e, t, r, !0), c;\n}\nfunction _e(n, e, t = {}, r, o, s) {\n let i;\n const a = z({ actions: {} }, t);\n if (process.env.NODE_ENV !== \"production\" && !r._e.active)\n throw new Error(\"Pinia destroyed\");\n const c = { deep: !0 };\n process.env.NODE_ENV !== \"production\" && (c.onTrigger = (d) => {\n f ? $ = d : f == !1 && !v._hotUpdating && (Array.isArray($) ? $.push(d) : console.error(\"🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.\"));\n });\n let f, g, b = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set(), $;\n const k = r.state.value[n];\n !s && !k && (process.env.NODE_ENV === \"production\" || !o) && (r.state.value[n] = {});\n const x = B({});\n let N;\n function D(d) {\n let p;\n f = g = !1, process.env.NODE_ENV !== \"production\" && ($ = []), typeof d == \"function\" ? (d(r.state.value[n]), p = {\n type: le.patchFunction,\n storeId: n,\n events: $\n }) : (Ne(r.state.value[n], d), p = {\n type: le.patchObject,\n payload: d,\n storeId: n,\n events: $\n });\n const R = N = /* @__PURE__ */ Symbol();\n de().then(() => {\n N === R && (f = !0);\n }), g = !0, ee(b, p, r.state.value[n]);\n }\n const P = s ? function() {\n const { state: p } = t, R = p ? p() : {};\n this.$patch((F) => {\n z(F, R);\n });\n } : (\n /* istanbul ignore next */\n process.env.NODE_ENV !== \"production\" ? () => {\n throw new Error(`🍍: Store \"${n}\" is built using the setup syntax and does not implement $reset().`);\n } : ze\n );\n function S() {\n i.stop(), b.clear(), A.clear(), r._s.delete(n);\n }\n const C = (d, p = \"\") => {\n if (Ie in d)\n return d[Ee] = p, d;\n const R = function() {\n me(r);\n const F = Array.from(arguments), w = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set();\n function L(m) {\n w.add(m);\n }\n function y(m) {\n T.add(m);\n }\n ee(A, {\n args: F,\n name: R[Ee],\n store: v,\n after: L,\n onError: y\n });\n let E;\n try {\n E = d.apply(this && this.$id === n ? this : v, F);\n } catch (m) {\n throw ee(T, m), m;\n }\n return E instanceof Promise ? E.then((m) => (ee(w, m), m)).catch((m) => (ee(T, m), Promise.reject(m))) : (ee(w, E), E);\n };\n return R[Ie] = !0, R[Ee] = p, R;\n }, O = /* @__PURE__ */ ae({\n actions: {},\n getters: {},\n state: [],\n hotState: x\n }), _ = {\n _p: r,\n // _s: scope,\n $id: n,\n $onAction: Te.bind(null, A),\n $patch: D,\n $reset: P,\n $subscribe(d, p = {}) {\n const R = Te(b, d, p.detached, () => F()), F = i.run(() => U(() => r.state.value[n], (w) => {\n (p.flush === \"sync\" ? g : f) && d({\n storeId: n,\n type: le.direct,\n events: $\n }, w);\n }, z({}, c, p)));\n return R;\n },\n $dispose: S\n }, v = ye(process.env.NODE_ENV !== \"production\" || process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && te ? z(\n {\n _hmrPayload: O,\n _customProperties: ae(/* @__PURE__ */ new Set())\n // devtools custom properties\n },\n _\n // must be added later\n // setupStore\n ) : _);\n r._s.set(n, v);\n const M = (r._a && r._a.runWithContext || nt)(() => r._e.run(() => (i = Ye()).run(() => e({ action: C }))));\n for (const d in M) {\n const p = M[d];\n if (se(p) && !Ce(p) || be(p))\n process.env.NODE_ENV !== \"production\" && o ? x.value[d] = ce(M, d) : s || (k && st(p) && (se(p) ? p.value = k[d] : Ne(p, k[d])), r.state.value[n][d] = p), process.env.NODE_ENV !== \"production\" && O.state.push(d);\n else if (typeof p == \"function\") {\n const R = process.env.NODE_ENV !== \"production\" && o ? p : C(p, d);\n M[d] = R, process.env.NODE_ENV !== \"production\" && (O.actions[d] = p), a.actions[d] = p;\n } else process.env.NODE_ENV !== \"production\" && Ce(p) && (O.getters[d] = s ? (\n // @ts-expect-error\n t.getters[d]\n ) : p, te && (M._getters || // @ts-expect-error: same\n (M._getters = ae([]))).push(d));\n }\n if (z(v, M), z(Me(v), M), Object.defineProperty(v, \"$state\", {\n get: () => process.env.NODE_ENV !== \"production\" && o ? x.value : r.state.value[n],\n set: (d) => {\n if (process.env.NODE_ENV !== \"production\" && o)\n throw new Error(\"cannot set hotState\");\n D((p) => {\n z(p, d);\n });\n }\n }), process.env.NODE_ENV !== \"production\" && (v._hotUpdate = ae((d) => {\n v._hotUpdating = !0, d._hmrPayload.state.forEach((p) => {\n if (p in v.$state) {\n const R = d.$state[p], F = v.$state[p];\n typeof R == \"object\" && Y(R) && Y(F) ? He(R, F) : d.$state[p] = F;\n }\n v[p] = ce(d.$state, p);\n }), Object.keys(v.$state).forEach((p) => {\n p in d.$state || delete v[p];\n }), f = !1, g = !1, r.state.value[n] = ce(d._hmrPayload, \"hotState\"), g = !0, de().then(() => {\n f = !0;\n });\n for (const p in d._hmrPayload.actions) {\n const R = d[p];\n v[p] = //\n C(R, p);\n }\n for (const p in d._hmrPayload.getters) {\n const R = d._hmrPayload.getters[p], F = s ? (\n // special handling of options api\n W(() => (me(r), R.call(v, v)))\n ) : R;\n v[p] = //\n F;\n }\n Object.keys(v._hmrPayload.getters).forEach((p) => {\n p in d._hmrPayload.getters || delete v[p];\n }), Object.keys(v._hmrPayload.actions).forEach((p) => {\n p in d._hmrPayload.actions || delete v[p];\n }), v._hmrPayload = d._hmrPayload, v._getters = d._getters, v._hotUpdating = !1;\n })), process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && te) {\n const d = {\n writable: !0,\n configurable: !0,\n // avoid warning on devtools trying to display this property\n enumerable: !1\n };\n [\"_p\", \"_hmrPayload\", \"_getters\", \"_customProperties\"].forEach((p) => {\n Object.defineProperty(v, p, z({ value: v[p] }, d));\n });\n }\n return r._p.forEach((d) => {\n if (process.env.NODE_ENV !== \"production\" && process.env.NODE_ENV !== \"test\" && te) {\n const p = i.run(() => d({\n store: v,\n app: r._a,\n pinia: r,\n options: a\n }));\n Object.keys(p || {}).forEach((R) => v._customProperties.add(R)), z(v, p);\n } else\n z(v, i.run(() => d({\n store: v,\n app: r._a,\n pinia: r,\n options: a\n })));\n }), process.env.NODE_ENV !== \"production\" && v.$state && typeof v.$state == \"object\" && typeof v.$state.constructor == \"function\" && !v.$state.constructor.toString().includes(\"[native code]\") && console.warn(`[🍍]: The \"state\" must be a plain object. It cannot be\n\tstate: () => new MyClass()\nFound in store \"${v.$id}\".`), k && s && t.hydrate && t.hydrate(v.$state, k), f = !0, g = !0, v;\n}\n// @__NO_SIDE_EFFECTS__\nfunction it(n, e, t) {\n let r;\n const o = typeof e == \"function\";\n r = o ? t : e;\n function s(i, a) {\n const c = Ae();\n if (i = // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n (process.env.NODE_ENV === \"test\" && G && G._testing ? null : i) || (c ? oe(Pe, null) : null), i && me(i), process.env.NODE_ENV !== \"production\" && !G)\n throw new Error(`[🍍]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\nSee https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\nThis will fail in production.`);\n i = G, i._s.has(n) || (o ? _e(n, e, r, i) : ke(n, r, i), process.env.NODE_ENV !== \"production\" && (s._pinia = i));\n const f = i._s.get(n);\n if (process.env.NODE_ENV !== \"production\" && a) {\n const g = \"__hot:\" + n, b = o ? _e(g, e, r, i, !0) : ke(g, z({}, r), i, !0);\n a._hotUpdate(b), delete i.state.value[g], i._s.delete(g);\n }\n if (process.env.NODE_ENV !== \"production\" && te) {\n const g = Fe();\n if (g && g.proxy && // avoid adding stores that are just built for hot module replacement\n !a) {\n const b = g.proxy, A = \"_pStores\" in b ? b._pStores : b._pStores = {};\n A[n] = f;\n }\n }\n return f;\n }\n return s.$id = n, s;\n}\nfunction Ue(n) {\n const e = Me(n), t = {};\n for (const r in e) {\n const o = e[r];\n o.effect ? t[r] = // ...\n W({\n get: () => n[r],\n set(s) {\n n[r] = s;\n }\n }) : (se(o) || be(o)) && (t[r] = // ---\n ce(n, r));\n }\n return t;\n}\nconst at = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst ct = Object.prototype.toString, lt = (n) => ct.call(n) === \"[object Object]\", Je = () => {\n};\nfunction ut(...n) {\n if (n.length !== 1) return ce(...n);\n const e = n[0];\n return typeof e == \"function\" ? je(tt(() => ({\n get: e,\n set: Je\n }))) : B(e);\n}\nfunction ft(n, e) {\n function t(...r) {\n return new Promise((o, s) => {\n Promise.resolve(n(() => e.apply(this, r), {\n fn: e,\n thisArg: this,\n args: r\n })).then(o).catch(s);\n });\n }\n return t;\n}\nconst qe = (n) => n();\nfunction dt(n = qe, e = {}) {\n const { initialState: t = \"active\" } = e, r = ut(t === \"active\");\n function o() {\n r.value = !1;\n }\n function s() {\n r.value = !0;\n }\n const i = (...a) => {\n r.value && n(...a);\n };\n return {\n isActive: je(r),\n pause: o,\n resume: s,\n eventFilter: i\n };\n}\nfunction Oe(n) {\n return Array.isArray(n) ? n : [n];\n}\nfunction pt(n) {\n return Fe();\n}\nfunction ht(n, e, t = {}) {\n const { eventFilter: r = qe, ...o } = t;\n return U(n, ft(r, e), o);\n}\nfunction gt(n, e, t = {}) {\n const { eventFilter: r, initialState: o = \"active\", ...s } = t, { eventFilter: i, pause: a, resume: c, isActive: f } = dt(r, { initialState: o });\n return {\n stop: ht(n, e, {\n ...s,\n eventFilter: i\n }),\n pause: a,\n resume: c,\n isActive: f\n };\n}\nfunction vt(n, e = !0, t) {\n pt() ? Be(n, t) : e ? n() : de(n);\n}\nfunction yt(n, e, t) {\n return U(n, e, {\n ...t,\n immediate: !0\n });\n}\nfunction ie(n, e, t) {\n return U(n, (o, s, i) => {\n o && e(o, s, i);\n }, {\n ...t,\n once: !1\n });\n}\nconst Q = at ? window : void 0;\nfunction mt(n) {\n var e;\n const t = q(n);\n return (e = t?.$el) !== null && e !== void 0 ? e : t;\n}\nfunction re(...n) {\n const e = (r, o, s, i) => (r.addEventListener(o, s, i), () => r.removeEventListener(o, s, i)), t = W(() => {\n const r = Oe(q(n[0])).filter((o) => o != null);\n return r.every((o) => typeof o != \"string\") ? r : void 0;\n });\n return yt(() => {\n var r, o;\n return [\n (r = (o = t.value) === null || o === void 0 ? void 0 : o.map((s) => mt(s))) !== null && r !== void 0 ? r : [Q].filter((s) => s != null),\n Oe(q(t.value ? n[1] : n[0])),\n Oe(rt(t.value ? n[2] : n[1])),\n q(t.value ? n[3] : n[2])\n ];\n }, ([r, o, s, i], a, c) => {\n if (!r?.length || !o?.length || !s?.length) return;\n const f = lt(i) ? { ...i } : i, g = r.flatMap((b) => o.flatMap((A) => s.map(($) => e(b, A, $, f))));\n c(() => {\n g.forEach((b) => b());\n });\n }, { flush: \"post\" });\n}\nconst he = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {}, ge = \"__vueuse_ssr_handlers__\", St = /* @__PURE__ */ bt();\nfunction bt() {\n return ge in he || (he[ge] = he[ge] || {}), he[ge];\n}\nfunction wt(n, e) {\n return St[n] || e;\n}\nfunction Et(n) {\n return n == null ? \"any\" : n instanceof Set ? \"set\" : n instanceof Map ? \"map\" : n instanceof Date ? \"date\" : typeof n == \"boolean\" ? \"boolean\" : typeof n == \"string\" ? \"string\" : typeof n == \"object\" ? \"object\" : Number.isNaN(n) ? \"any\" : \"number\";\n}\nconst Ot = {\n boolean: {\n read: (n) => n === \"true\",\n write: (n) => String(n)\n },\n object: {\n read: (n) => JSON.parse(n),\n write: (n) => JSON.stringify(n)\n },\n number: {\n read: (n) => Number.parseFloat(n),\n write: (n) => String(n)\n },\n any: {\n read: (n) => n,\n write: (n) => String(n)\n },\n string: {\n read: (n) => n,\n write: (n) => String(n)\n },\n map: {\n read: (n) => new Map(JSON.parse(n)),\n write: (n) => JSON.stringify(Array.from(n.entries()))\n },\n set: {\n read: (n) => new Set(JSON.parse(n)),\n write: (n) => JSON.stringify(Array.from(n))\n },\n date: {\n read: (n) => new Date(n),\n write: (n) => n.toISOString()\n }\n}, Le = \"vueuse-storage\";\nfunction Rt(n, e, t, r = {}) {\n var o;\n const { flush: s = \"pre\", deep: i = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: f = !1, shallow: g, window: b = Q, eventFilter: A, onError: $ = (w) => {\n console.error(w);\n }, initOnMounted: k } = r, x = (g ? We : B)(e), N = W(() => q(n));\n if (!t) try {\n t = wt(\"getDefaultStorage\", () => Q?.localStorage)();\n } catch (w) {\n $(w);\n }\n if (!t) return x;\n const D = q(e), P = Et(D), S = (o = r.serializer) !== null && o !== void 0 ? o : Ot[P], { pause: C, resume: O } = gt(x, (w) => d(w), {\n flush: s,\n deep: i,\n eventFilter: A\n });\n U(N, () => R(), { flush: s });\n let _ = !1;\n const v = (w) => {\n k && !_ || R(w);\n }, j = (w) => {\n k && !_ || F(w);\n };\n b && a && (t instanceof Storage ? re(b, \"storage\", v, { passive: !0 }) : re(b, Le, j)), k ? vt(() => {\n _ = !0, R();\n }) : R();\n function M(w, T) {\n if (b) {\n const L = {\n key: N.value,\n oldValue: w,\n newValue: T,\n storageArea: t\n };\n b.dispatchEvent(t instanceof Storage ? new StorageEvent(\"storage\", L) : new CustomEvent(Le, { detail: L }));\n }\n }\n function d(w) {\n try {\n const T = t.getItem(N.value);\n if (w == null)\n M(T, null), t.removeItem(N.value);\n else {\n const L = S.write(w);\n T !== L && (t.setItem(N.value, L), M(T, L));\n }\n } catch (T) {\n $(T);\n }\n }\n function p(w) {\n const T = w ? w.newValue : t.getItem(N.value);\n if (T == null)\n return c && D != null && t.setItem(N.value, S.write(D)), D;\n if (!w && f) {\n const L = S.read(T);\n return typeof f == \"function\" ? f(L, D) : P === \"object\" && !Array.isArray(L) ? {\n ...D,\n ...L\n } : L;\n } else return typeof T != \"string\" ? T : S.read(T);\n }\n function R(w) {\n if (!(w && w.storageArea !== t)) {\n if (w && w.key == null) {\n x.value = D;\n return;\n }\n if (!(w && w.key !== N.value)) {\n C();\n try {\n const T = S.write(x.value);\n (w === void 0 || w?.newValue !== T) && (x.value = p(w));\n } catch (T) {\n $(T);\n } finally {\n w ? de(O) : O();\n }\n }\n }\n }\n function F(w) {\n R(w.detail);\n }\n return x;\n}\nfunction At(n, e, t = {}) {\n const { window: r = Q } = t;\n return Rt(n, e, r?.localStorage, t);\n}\nconst Pt = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\nfunction Nt(n = {}) {\n const { reactive: e = !1, target: t = Q, aliasMap: r = Pt, passive: o = !0, onEventFired: s = Je } = n, i = ye(/* @__PURE__ */ new Set()), a = {\n toJSON() {\n return {};\n },\n current: i\n }, c = e ? ye(a) : a, f = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map([\n [\"Meta\", f],\n [\"Shift\", /* @__PURE__ */ new Set()],\n [\"Alt\", /* @__PURE__ */ new Set()]\n ]), b = /* @__PURE__ */ new Set();\n function A(P, S) {\n P in c && (e ? c[P] = S : c[P].value = S);\n }\n function $() {\n i.clear();\n for (const P of b) A(P, !1);\n }\n function k(P, S, C) {\n if (!(!P || typeof S.getModifierState != \"function\")) {\n for (const [O, _] of g) if (S.getModifierState(O)) {\n C.forEach((v) => _.add(v));\n break;\n }\n }\n }\n function x(P, S) {\n if (P) return;\n const C = `${S[0].toUpperCase()}${S.slice(1)}`, O = g.get(C);\n if (![\"shift\", \"alt\"].includes(S) || !O) return;\n const _ = Array.from(O), v = _.indexOf(S);\n _.forEach((j, M) => {\n M >= v && (i.delete(j), A(j, !1));\n }), O.clear();\n }\n function N(P, S) {\n var C, O;\n const _ = (C = P.key) === null || C === void 0 ? void 0 : C.toLowerCase(), v = [(O = P.code) === null || O === void 0 ? void 0 : O.toLowerCase(), _].filter(Boolean);\n if (_) {\n _ && (S ? i.add(_) : i.delete(_));\n for (const j of v)\n b.add(j), A(j, S);\n k(S, P, [...i, ...v]), x(S, _), _ === \"meta\" && !S && (f.forEach((j) => {\n i.delete(j), A(j, !1);\n }), f.clear());\n }\n }\n re(t, \"keydown\", (P) => (N(P, !0), s(P)), { passive: o }), re(t, \"keyup\", (P) => (N(P, !1), s(P)), { passive: o }), re(\"blur\", $, { passive: o }), re(\"focus\", $, { passive: o });\n const D = new Proxy(c, { get(P, S, C) {\n if (typeof S != \"string\") return Reflect.get(P, S, C);\n if (S = S.toLowerCase(), S in r && (S = r[S]), !(S in c)) if (/[+_-]/.test(S)) {\n const _ = S.split(/[+_-]/g).map((v) => v.trim());\n c[S] = W(() => _.map((v) => q(D[v])).every(Boolean));\n } else c[S] = We(!1);\n const O = Reflect.get(P, S, C);\n return e ? q(O) : O;\n } });\n return D;\n}\nfunction Re() {\n return typeof crypto < \"u\" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\nfunction ve(n) {\n const e = {\n type: n.type,\n clientId: n.clientId,\n timestamp: n.timestamp.toISOString()\n };\n return n.operation && (e.operation = {\n ...n.operation,\n timestamp: n.operation.timestamp.toISOString()\n }), n.operations && (e.operations = n.operations.map((t) => ({\n ...t,\n timestamp: t.timestamp.toISOString()\n }))), e;\n}\nfunction _t(n) {\n const e = {\n type: n.type,\n clientId: n.clientId,\n timestamp: new Date(n.timestamp)\n };\n return n.operation && (e.operation = {\n ...n.operation,\n timestamp: new Date(n.operation.timestamp)\n }), n.operations && (e.operations = n.operations.map((t) => ({\n ...t,\n timestamp: new Date(t.timestamp)\n }))), e;\n}\nconst pe = /* @__PURE__ */ it(\"hst-operation-log\", () => {\n const n = B({\n maxOperations: 100,\n enableCrossTabSync: !0,\n autoSyncInterval: 3e4,\n enablePersistence: !1,\n persistenceKeyPrefix: \"stonecrop-ops\"\n }), e = B([]), t = B(-1), r = B(Re()), o = B(!1), s = B([]), i = B(null), a = W(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = W(() => t.value < e.value.length - 1), f = W(() => {\n let u = 0;\n for (let l = t.value; l >= 0 && e.value[l]?.reversible; l--)\n u++;\n return u;\n }), g = W(() => e.value.length - 1 - t.value), b = W(() => ({\n canUndo: a.value,\n canRedo: c.value,\n undoCount: f.value,\n redoCount: g.value,\n currentIndex: t.value\n }));\n function A(u) {\n n.value = { ...n.value, ...u }, n.value.enablePersistence && (y(), m()), n.value.enableCrossTabSync && p();\n }\n function $(u, l = \"user\") {\n const h = {\n ...u,\n id: Re(),\n timestamp: /* @__PURE__ */ new Date(),\n source: l,\n userId: n.value.userId\n };\n if (n.value.operationFilter && !n.value.operationFilter(h))\n return h.id;\n if (o.value)\n return s.value.push(h), h.id;\n if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(h), t.value++, n.value.maxOperations && e.value.length > n.value.maxOperations) {\n const I = e.value.length - n.value.maxOperations;\n e.value = e.value.slice(I), t.value -= I;\n }\n return n.value.enableCrossTabSync && R(h), h.id;\n }\n function k() {\n o.value = !0, s.value = [], i.value = Re();\n }\n function x(u) {\n if (!o.value || s.value.length === 0)\n return o.value = !1, s.value = [], i.value = null, null;\n const l = i.value, h = s.value.every((V) => V.reversible), I = {\n id: l,\n type: \"batch\",\n path: \"\",\n // Batch doesn't have a single path\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: s.value[0]?.doctype || \"\",\n timestamp: /* @__PURE__ */ new Date(),\n source: \"user\",\n reversible: h,\n irreversibleReason: h ? void 0 : \"Contains irreversible operations\",\n childOperationIds: s.value.map((V) => V.id),\n metadata: { description: u }\n };\n s.value.forEach((V) => {\n V.parentOperationId = l;\n }), e.value.push(...s.value, I), t.value = e.value.length - 1, n.value.enableCrossTabSync && F(s.value, I);\n const H = l;\n return o.value = !1, s.value = [], i.value = null, H;\n }\n function N() {\n o.value = !1, s.value = [], i.value = null;\n }\n function D(u) {\n if (!a.value) return !1;\n const l = e.value[t.value];\n if (!l.reversible)\n return typeof console < \"u\" && l.irreversibleReason && console.warn(\"Cannot undo irreversible operation:\", l.irreversibleReason), !1;\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (let h = l.childOperationIds.length - 1; h >= 0; h--) {\n const I = l.childOperationIds[h], H = e.value.find((V) => V.id === I);\n H && S(H, u);\n }\n else\n S(l, u);\n return t.value--, n.value.enableCrossTabSync && w(l), !0;\n } catch (h) {\n return typeof console < \"u\" && console.error(\"Undo failed:\", h), !1;\n }\n }\n function P(u) {\n if (!c.value) return !1;\n const l = e.value[t.value + 1];\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (const h of l.childOperationIds) {\n const I = e.value.find((H) => H.id === h);\n I && C(I, u);\n }\n else\n C(l, u);\n return t.value++, n.value.enableCrossTabSync && T(l), !0;\n } catch (h) {\n return typeof console < \"u\" && console.error(\"Redo failed:\", h), !1;\n }\n }\n function S(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.beforeValue, \"undo\");\n }\n function C(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.afterValue, \"redo\");\n }\n function O() {\n const u = e.value.filter((h) => h.reversible).length, l = e.value.map((h) => h.timestamp);\n return {\n operations: [...e.value],\n currentIndex: t.value,\n totalOperations: e.value.length,\n reversibleOperations: u,\n irreversibleOperations: e.value.length - u,\n oldestOperation: l.length > 0 ? new Date(Math.min(...l.map((h) => h.getTime()))) : void 0,\n newestOperation: l.length > 0 ? new Date(Math.max(...l.map((h) => h.getTime()))) : void 0\n };\n }\n function _() {\n e.value = [], t.value = -1;\n }\n function v(u, l) {\n return e.value.filter((h) => h.doctype === u && (l === void 0 || h.recordId === l));\n }\n function j(u, l) {\n const h = e.value.find((I) => I.id === u);\n h && (h.reversible = !1, h.irreversibleReason = l);\n }\n function M(u, l, h, I = \"success\", H) {\n const V = {\n type: \"action\",\n path: h && h.length > 0 ? `${u}.${h[0]}` : u,\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: u,\n recordId: h && h.length > 0 ? h[0] : void 0,\n reversible: !1,\n // Actions are typically not reversible\n actionName: l,\n actionRecordIds: h,\n actionResult: I,\n actionError: H\n };\n return $(V);\n }\n let d = null;\n function p() {\n typeof window > \"u\" || !window.BroadcastChannel || (d = new BroadcastChannel(\"stonecrop-operation-log\"), d.addEventListener(\"message\", (u) => {\n const l = u.data;\n if (!l || typeof l != \"object\") return;\n const h = _t(l);\n h.clientId !== r.value && (h.type === \"operation\" && h.operation ? (e.value.push({ ...h.operation, source: \"sync\" }), t.value = e.value.length - 1) : h.type === \"operation\" && h.operations && (e.value.push(...h.operations.map((I) => ({ ...I, source: \"sync\" }))), t.value = e.value.length - 1));\n }));\n }\n function R(u) {\n if (!d) return;\n const l = {\n type: \"operation\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n d.postMessage(ve(l));\n }\n function F(u, l) {\n if (!d) return;\n const h = {\n type: \"operation\",\n operations: [...u, l],\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n d.postMessage(ve(h));\n }\n function w(u) {\n if (!d) return;\n const l = {\n type: \"undo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n d.postMessage(ve(l));\n }\n function T(u) {\n if (!d) return;\n const l = {\n type: \"redo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n d.postMessage(ve(l));\n }\n const L = At(\"stonecrop-ops-operations\", null, {\n serializer: {\n read: (u) => {\n try {\n return JSON.parse(u);\n } catch {\n return null;\n }\n },\n write: (u) => u ? JSON.stringify(u) : \"\"\n }\n });\n function y() {\n if (!(typeof window > \"u\"))\n try {\n const u = L.value;\n u && Array.isArray(u.operations) && (e.value = u.operations.map((l) => ({\n ...l,\n timestamp: new Date(l.timestamp)\n })), t.value = u.currentIndex ?? -1);\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to load operations from persistence:\", u);\n }\n }\n function E() {\n if (!(typeof window > \"u\"))\n try {\n L.value = {\n operations: e.value.map((u) => ({\n ...u,\n timestamp: u.timestamp.toISOString()\n })),\n currentIndex: t.value\n };\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to save operations to persistence:\", u);\n }\n }\n function m() {\n U(\n [e, t],\n () => {\n n.value.enablePersistence && E();\n },\n { deep: !0 }\n );\n }\n return {\n // State\n operations: e,\n currentIndex: t,\n config: n,\n clientId: r,\n undoRedoState: b,\n // Computed\n canUndo: a,\n canRedo: c,\n undoCount: f,\n redoCount: g,\n // Methods\n configure: A,\n addOperation: $,\n startBatch: k,\n commitBatch: x,\n cancelBatch: N,\n undo: D,\n redo: P,\n clear: _,\n getOperationsFor: v,\n getSnapshot: O,\n markIrreversible: j,\n logAction: M\n };\n});\nclass ue {\n /**\n * The root FieldTriggerEngine instance\n */\n static _root;\n options;\n doctypeActions = /* @__PURE__ */ new Map();\n // doctype -> action/field -> functions\n doctypeTransitions = /* @__PURE__ */ new Map();\n // doctype -> transition -> functions\n fieldRollbackConfig = /* @__PURE__ */ new Map();\n // doctype -> field -> rollback enabled\n globalActions = /* @__PURE__ */ new Map();\n // action name -> function\n globalTransitionActions = /* @__PURE__ */ new Map();\n // transition action name -> function\n /**\n * Creates a new FieldTriggerEngine instance (singleton pattern)\n * @param options - Configuration options for the field trigger engine\n */\n constructor(e = {}) {\n if (ue._root)\n return ue._root;\n ue._root = this, this.options = {\n defaultTimeout: e.defaultTimeout ?? 5e3,\n debug: e.debug ?? !1,\n enableRollback: e.enableRollback ?? !0,\n errorHandler: e.errorHandler\n };\n }\n /**\n * Register a global action function\n * @param name - The name of the action\n * @param fn - The action function\n */\n registerAction(e, t) {\n this.globalActions.set(e, t);\n }\n /**\n * Register a global XState transition action function\n * @param name - The name of the transition action\n * @param fn - The transition action function\n */\n registerTransitionAction(e, t) {\n this.globalTransitionActions.set(e, t);\n }\n /**\n * Configure rollback behavior for a specific field trigger\n * @param doctype - The doctype name\n * @param fieldname - The field name\n * @param enableRollback - Whether to enable rollback\n */\n setFieldRollback(e, t, r) {\n this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(t, r);\n }\n /**\n * Get rollback configuration for a specific field trigger\n */\n getFieldRollback(e, t) {\n return this.fieldRollbackConfig.get(e)?.get(t);\n }\n /**\n * Register actions from a doctype - both regular actions and field triggers\n * Separates XState transitions (uppercase) from field triggers (lowercase)\n * @param doctype - The doctype name\n * @param actions - The actions to register (supports Immutable Map, Map, or plain object)\n */\n registerDoctypeActions(e, t) {\n if (!t) return;\n const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();\n if (typeof t.entrySeq == \"function\")\n t.entrySeq().forEach(([s, i]) => {\n this.categorizeAction(s, i, r, o);\n });\n else if (t instanceof Map)\n for (const [s, i] of t)\n this.categorizeAction(s, i, r, o);\n else t && typeof t == \"object\" && Object.entries(t).forEach(([s, i]) => {\n this.categorizeAction(s, i, r, o);\n });\n this.doctypeActions.set(e, r), this.doctypeTransitions.set(e, o);\n }\n /**\n * Categorize an action as either a field trigger or XState transition\n * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger\n */\n categorizeAction(e, t, r, o) {\n this.isTransitionKey(e) ? o.set(e, t) : r.set(e, t);\n }\n /**\n * Determine if a key represents an XState transition\n * Transitions are identified by being all uppercase\n */\n isTransitionKey(e) {\n return /^[A-Z0-9_]+$/.test(e) && e.length > 0;\n }\n /**\n * Execute field triggers for a changed field\n * @param context - The field change context\n * @param options - Execution options (timeout and enableRollback)\n */\n async executeFieldTriggers(e, t = {}) {\n const { doctype: r, fieldname: o } = e, s = this.findFieldTriggers(r, o);\n if (s.length === 0)\n return {\n path: e.path,\n actionResults: [],\n totalExecutionTime: 0,\n allSucceeded: !0,\n stoppedOnError: !1,\n rolledBack: !1\n };\n const i = performance.now(), a = [];\n let c = !1, f = !1, g;\n const b = this.getFieldRollback(r, o), A = t.enableRollback ?? b ?? this.options.enableRollback;\n A && e.store && (g = this.captureSnapshot(e));\n for (const N of s)\n try {\n const D = await this.executeAction(N, e, t.timeout);\n if (a.push(D), !D.success) {\n c = !0;\n break;\n }\n } catch (D) {\n const S = {\n success: !1,\n error: D instanceof Error ? D : new Error(String(D)),\n executionTime: 0,\n action: N\n };\n a.push(S), c = !0;\n break;\n }\n if (A && c && g && e.store)\n try {\n this.restoreSnapshot(e, g), f = !0;\n } catch (N) {\n console.error(\"[FieldTriggers] Rollback failed:\", N);\n }\n const $ = performance.now() - i, k = a.filter((N) => !N.success);\n if (k.length > 0 && this.options.errorHandler)\n for (const N of k)\n try {\n this.options.errorHandler(N.error, e, N.action);\n } catch (D) {\n console.error(\"[FieldTriggers] Error in global error handler:\", D);\n }\n return {\n path: e.path,\n actionResults: a,\n totalExecutionTime: $,\n allSucceeded: a.every((N) => N.success),\n stoppedOnError: c,\n rolledBack: f,\n snapshot: this.options.debug && A ? g : void 0\n // Only include snapshot in debug mode if rollback is enabled\n };\n }\n /**\n * Execute XState transition actions\n * Similar to field triggers but specifically for FSM state transitions\n * @param context - The transition change context\n * @param options - Execution options (timeout)\n */\n async executeTransitionActions(e, t = {}) {\n const { doctype: r, transition: o } = e, s = this.findTransitionActions(r, o);\n if (s.length === 0)\n return [];\n const i = [];\n for (const c of s)\n try {\n const f = await this.executeTransitionAction(c, e, t.timeout);\n if (i.push(f), !f.success)\n break;\n } catch (f) {\n const b = {\n success: !1,\n error: f instanceof Error ? f : new Error(String(f)),\n executionTime: 0,\n action: c,\n transition: o\n };\n i.push(b);\n break;\n }\n const a = i.filter((c) => !c.success);\n if (a.length > 0 && this.options.errorHandler)\n for (const c of a)\n try {\n this.options.errorHandler(c.error, e, c.action);\n } catch (f) {\n console.error(\"[FieldTriggers] Error in global error handler:\", f);\n }\n return i;\n }\n /**\n * Find transition actions for a specific doctype and transition\n */\n findTransitionActions(e, t) {\n const r = this.doctypeTransitions.get(e);\n return r ? r.get(t) || [] : [];\n }\n /**\n * Execute a single transition action by name\n */\n async executeTransitionAction(e, t, r) {\n const o = performance.now(), s = r ?? this.options.defaultTimeout;\n try {\n let i = this.globalTransitionActions.get(e);\n if (!i) {\n const c = this.globalActions.get(e);\n c && (i = c);\n }\n if (!i)\n throw new Error(`Transition action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(i, t, s), {\n success: !0,\n executionTime: performance.now() - o,\n action: e,\n transition: t.transition\n };\n } catch (i) {\n const a = performance.now() - o;\n return {\n success: !1,\n error: i instanceof Error ? i : new Error(String(i)),\n executionTime: a,\n action: e,\n transition: t.transition\n };\n }\n }\n /**\n * Find field triggers for a specific doctype and field\n * Field triggers are identified by keys that look like field paths (contain dots or match field names)\n */\n findFieldTriggers(e, t) {\n const r = this.doctypeActions.get(e);\n if (!r) return [];\n const o = [];\n for (const [s, i] of r)\n this.isFieldTriggerKey(s, t) && o.push(...i);\n return o;\n }\n /**\n * Determine if an action key represents a field trigger\n * Field triggers can be:\n * - Exact field name match: \"emailAddress\"\n * - Wildcard patterns: \"emailAddress.*\", \"*.is_primary\"\n * - Nested field paths: \"address.street\", \"contact.email\"\n */\n isFieldTriggerKey(e, t) {\n return e === t ? !0 : e.includes(\".\") ? this.matchFieldPattern(e, t) : e.includes(\"*\") ? this.matchFieldPattern(e, t) : !1;\n }\n /**\n * Match a field pattern against a field name\n * Supports wildcards (*) for dynamic segments\n */\n matchFieldPattern(e, t) {\n const r = e.split(\".\"), o = t.split(\".\");\n if (r.length !== o.length)\n return !1;\n for (let s = 0; s < r.length; s++) {\n const i = r[s], a = o[s];\n if (i !== \"*\" && i !== a)\n return !1;\n }\n return !0;\n }\n /**\n * Execute a single action by name\n */\n async executeAction(e, t, r) {\n const o = performance.now(), s = r ?? this.options.defaultTimeout;\n try {\n const i = this.globalActions.get(e);\n if (!i)\n throw new Error(`Action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(i, t, s), {\n success: !0,\n executionTime: performance.now() - o,\n action: e\n };\n } catch (i) {\n const a = performance.now() - o;\n return {\n success: !1,\n error: i instanceof Error ? i : new Error(String(i)),\n executionTime: a,\n action: e\n };\n }\n }\n /**\n * Execute a function with timeout\n */\n async executeWithTimeout(e, t, r) {\n return new Promise((o, s) => {\n const i = setTimeout(() => {\n s(new Error(`Action timeout after ${r}ms`));\n }, r);\n Promise.resolve(e(t)).then((a) => {\n clearTimeout(i), o(a);\n }).catch((a) => {\n clearTimeout(i), s(a);\n });\n });\n }\n /**\n * Capture a snapshot of the record state before executing actions\n * This creates a deep copy of the record data for potential rollback\n */\n captureSnapshot(e) {\n if (!(!e.store || !e.doctype || !e.recordId))\n try {\n const t = `${e.doctype}.${e.recordId}`, r = e.store.get(t);\n return !r || typeof r != \"object\" ? void 0 : JSON.parse(JSON.stringify(r));\n } catch (t) {\n this.options.debug && console.warn(\"[FieldTriggers] Failed to capture snapshot:\", t);\n return;\n }\n }\n /**\n * Restore a previously captured snapshot\n * This reverts the record to its state before actions were executed\n */\n restoreSnapshot(e, t) {\n if (!(!e.store || !e.doctype || !e.recordId || !t))\n try {\n const r = `${e.doctype}.${e.recordId}`;\n e.store.set(r, t), this.options.debug && console.log(`[FieldTriggers] Rolled back ${r} to previous state`);\n } catch (r) {\n throw console.error(\"[FieldTriggers] Failed to restore snapshot:\", r), r;\n }\n }\n}\nfunction K(n) {\n return new ue(n);\n}\nfunction Vt(n, e) {\n K().registerAction(n, e);\n}\nfunction xt(n, e) {\n K().registerTransitionAction(n, e);\n}\nfunction Mt(n, e, t) {\n K().setFieldRollback(n, e, t);\n}\nasync function Ft(n, e, t) {\n const r = K(), o = {\n path: t?.path || (t?.recordId ? `${n}.${t.recordId}` : n),\n fieldname: \"\",\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: n,\n recordId: t?.recordId,\n timestamp: /* @__PURE__ */ new Date(),\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n };\n return await r.executeTransitionActions(o);\n}\nfunction Bt(n, e) {\n if (n)\n try {\n pe().markIrreversible(n, e);\n } catch {\n }\n}\nfunction Ve() {\n try {\n return pe();\n } catch {\n return null;\n }\n}\nclass ne {\n static instance;\n /**\n * Gets the singleton instance of HST\n * @returns The HST singleton instance\n */\n static getInstance() {\n return ne.instance || (ne.instance = new ne()), ne.instance;\n }\n /**\n * Gets the global registry instance\n * @returns The global registry object or undefined if not found\n */\n getRegistry() {\n if (typeof globalThis < \"u\") {\n const e = globalThis.Registry?._root;\n if (e)\n return e;\n }\n if (typeof window < \"u\") {\n const e = window.Registry?._root;\n if (e)\n return e;\n }\n if (typeof global < \"u\" && global) {\n const e = global.Registry?._root;\n if (e)\n return e;\n }\n }\n /**\n * Helper method to get doctype metadata from the registry\n * @param doctype - The name of the doctype to retrieve metadata for\n * @returns The doctype metadata object or undefined if not found\n */\n getDoctypeMeta(e) {\n const t = this.getRegistry();\n if (t && typeof t == \"object\" && \"registry\" in t)\n return t.registry[e];\n }\n}\nclass Se {\n target;\n parentPath;\n rootNode;\n doctype;\n parentDoctype;\n hst;\n constructor(e, t, r = \"\", o = null, s) {\n return this.target = e, this.parentPath = r, this.rootNode = o || this, this.doctype = t, this.parentDoctype = s, this.hst = ne.getInstance(), new Proxy(this, {\n get(i, a) {\n if (a in i) return i[a];\n const c = String(a);\n return i.getNode(c);\n },\n set(i, a, c) {\n const f = String(a);\n return i.set(f, c), !0;\n }\n });\n }\n get(e) {\n return this.resolveValue(e);\n }\n // Method to get a tree-wrapped node for navigation\n getNode(e) {\n const t = this.resolvePath(e), r = this.resolveValue(e), o = t.split(\".\");\n let s = this.doctype;\n return this.doctype === \"StonecropStore\" && o.length >= 1 && (s = o[0]), typeof r == \"object\" && r !== null && !this.isPrimitive(r) ? new Se(r, s, t, this.rootNode, this.parentDoctype) : new Se(r, s, t, this.rootNode, this.parentDoctype);\n }\n set(e, t, r = \"user\") {\n const o = this.resolvePath(e), s = this.has(e) ? this.get(e) : void 0;\n if (r !== \"undo\" && r !== \"redo\") {\n const i = Ve();\n if (i && typeof i.addOperation == \"function\") {\n const a = o.split(\".\"), c = this.doctype === \"StonecropStore\" && a.length >= 1 ? a[0] : this.doctype, f = a.length >= 2 ? a[1] : void 0, g = a.slice(2).join(\".\") || a[a.length - 1], A = t === void 0 && s !== void 0 ? \"delete\" : \"set\";\n i.addOperation(\n {\n type: A,\n path: o,\n fieldname: g,\n beforeValue: s,\n afterValue: t,\n doctype: c,\n recordId: f,\n reversible: !0\n // Default to reversible, can be changed by field triggers\n },\n r\n );\n }\n }\n this.updateValue(e, t), this.triggerFieldActions(o, s, t);\n }\n has(e) {\n try {\n if (e === \"\")\n return !0;\n const t = this.parsePath(e);\n let r = this.target;\n for (let o = 0; o < t.length; o++) {\n const s = t[o];\n if (r == null)\n return !1;\n if (o === t.length - 1)\n return this.isImmutable(r) ? r.has(s) : this.isPiniaStore(r) && r.$state && s in r.$state || s in r;\n r = this.getProperty(r, s);\n }\n return !1;\n } catch {\n return !1;\n }\n }\n // Tree navigation methods\n getParent() {\n if (!this.parentPath) return null;\n const t = this.parentPath.split(\".\").slice(0, -1).join(\".\");\n return t === \"\" ? this.rootNode : this.rootNode.getNode(t);\n }\n getRoot() {\n return this.rootNode;\n }\n getPath() {\n return this.parentPath;\n }\n getDepth() {\n return this.parentPath ? this.parentPath.split(\".\").length : 0;\n }\n getBreadcrumbs() {\n return this.parentPath ? this.parentPath.split(\".\") : [];\n }\n /**\n * Trigger an XState transition with optional context data\n */\n async triggerTransition(e, t) {\n const r = K(), o = this.parentPath.split(\".\");\n let s = this.doctype, i;\n this.doctype === \"StonecropStore\" && o.length >= 1 && (s = o[0]), o.length >= 2 && (i = o[1]);\n const a = {\n path: this.parentPath,\n fieldname: \"\",\n // No specific field for transitions\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: s,\n recordId: i,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0,\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }, c = Ve();\n return c && typeof c.addOperation == \"function\" && c.addOperation(\n {\n type: \"transition\",\n path: this.parentPath,\n fieldname: e,\n beforeValue: t?.currentState,\n afterValue: t?.targetState,\n doctype: s,\n recordId: i,\n reversible: !1,\n // FSM transitions are generally not reversible\n metadata: {\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }\n },\n \"user\"\n ), await r.executeTransitionActions(a);\n }\n // Private helper methods\n resolvePath(e) {\n return e === \"\" ? this.parentPath : this.parentPath ? `${this.parentPath}.${e}` : e;\n }\n resolveValue(e) {\n if (e === \"\")\n return this.target;\n const t = this.parsePath(e);\n let r = this.target;\n for (const o of t) {\n if (r == null)\n return;\n r = this.getProperty(r, o);\n }\n return r;\n }\n updateValue(e, t) {\n if (e === \"\")\n throw new Error(\"Cannot set value on empty path\");\n const r = this.parsePath(e), o = r.pop();\n let s = this.target;\n for (const i of r)\n if (s = this.getProperty(s, i), s == null)\n throw new Error(`Cannot set property on null/undefined path: ${e}`);\n this.setProperty(s, o, t);\n }\n getProperty(e, t) {\n return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];\n }\n setProperty(e, t, r) {\n if (this.isImmutable(e))\n throw new Error(\"Cannot directly mutate immutable objects. Use immutable update methods instead.\");\n if (this.isPiniaStore(e)) {\n e.$patch ? e.$patch({ [t]: r }) : e[t] = r;\n return;\n }\n e[t] = r;\n }\n async triggerFieldActions(e, t, r) {\n try {\n if (!e || typeof e != \"string\")\n return;\n const o = e.split(\".\");\n if (o.length < 3)\n return;\n const s = K(), i = o.slice(2).join(\".\") || o[o.length - 1];\n let a = this.doctype;\n this.doctype === \"StonecropStore\" && o.length >= 1 && (a = o[0]);\n let c;\n o.length >= 2 && (c = o[1]);\n const f = {\n path: e,\n fieldname: i,\n beforeValue: t,\n afterValue: r,\n operation: \"set\",\n doctype: a,\n recordId: c,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0\n // Pass the root store for snapshot/rollback capabilities\n };\n await s.executeFieldTriggers(f);\n } catch (o) {\n o instanceof Error && console.warn(\"Field trigger error:\", o.message);\n }\n }\n isVueReactive(e) {\n return e && typeof e == \"object\" && \"__v_isReactive\" in e && e.__v_isReactive === !0;\n }\n isPiniaStore(e) {\n return e && typeof e == \"object\" && (\"$state\" in e || \"$patch\" in e || \"$id\" in e);\n }\n isImmutable(e) {\n if (!e || typeof e != \"object\")\n return !1;\n const t = \"get\" in e && typeof e.get == \"function\", r = \"set\" in e && typeof e.set == \"function\", o = \"has\" in e && typeof e.has == \"function\", s = \"__ownerID\" in e || \"_map\" in e || \"_list\" in e || \"_origin\" in e || \"_capacity\" in e || \"_defaultValues\" in e || \"_tail\" in e || \"_root\" in e || \"size\" in e && t && r;\n let i;\n try {\n const c = e;\n if (\"constructor\" in c && c.constructor && typeof c.constructor == \"object\" && \"name\" in c.constructor) {\n const f = c.constructor.name;\n i = typeof f == \"string\" ? f : void 0;\n }\n } catch {\n i = void 0;\n }\n const a = i && (i.includes(\"Map\") || i.includes(\"List\") || i.includes(\"Set\") || i.includes(\"Stack\") || i.includes(\"Seq\")) && (t || r);\n return !!(t && r && o && s || t && r && a);\n }\n isPrimitive(e) {\n return e == null || typeof e == \"string\" || typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"function\" || typeof e == \"symbol\" || typeof e == \"bigint\";\n }\n /**\n * Parse a path string into segments, handling both dot notation and array bracket notation\n * @param path - The path string to parse (e.g., \"order.456.line_items[0].product\")\n * @returns Array of path segments (e.g., ['order', '456', 'line_items', '0', 'product'])\n */\n parsePath(e) {\n return e ? e.replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter((r) => r.length > 0) : [];\n }\n}\nfunction $t(n, e, t) {\n return new Se(n, e, \"\", null, t);\n}\nclass Ke {\n hstStore;\n _operationLogStore;\n _operationLogConfig;\n /** The registry instance containing all doctype definitions */\n registry;\n /**\n * Creates a new Stonecrop instance with HST integration\n * @param registry - The Registry instance containing doctype definitions\n * @param operationLogConfig - Optional configuration for the operation log\n */\n constructor(e, t) {\n this.registry = e, this._operationLogConfig = t, this.initializeHSTStore(), this.setupRegistrySync();\n }\n /**\n * Get the operation log store (lazy initialization)\n * @internal\n */\n getOperationLogStore() {\n return this._operationLogStore || (this._operationLogStore = pe(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;\n }\n /**\n * Initialize the HST store structure\n */\n initializeHSTStore() {\n const e = {};\n Object.keys(this.registry.registry).forEach((t) => {\n e[t] = {};\n }), this.hstStore = $t(ye(e), \"StonecropStore\");\n }\n /**\n * Setup automatic sync with Registry when doctypes are added\n */\n setupRegistrySync() {\n const e = this.registry.addDoctype.bind(this.registry);\n this.registry.addDoctype = (t) => {\n e(t), this.hstStore.has(t.slug) || this.hstStore.set(t.slug, {});\n };\n }\n /**\n * Get records hash for a doctype\n * @param doctype - The doctype to get records for\n * @returns HST node containing records hash\n */\n records(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n return this.ensureDoctypeExists(t), this.hstStore.getNode(t);\n }\n /**\n * Add a record to the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @param recordData - The record data\n */\n addRecord(e, t, r) {\n const o = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(o), this.hstStore.set(`${o}.${t}`, r);\n }\n /**\n * Get a specific record\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @returns HST node for the record or undefined\n */\n getRecordById(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n if (this.ensureDoctypeExists(r), !(!this.hstStore.has(`${r}.${t}`) || this.hstStore.get(`${r}.${t}`) === void 0))\n return this.hstStore.getNode(`${r}.${t}`);\n }\n /**\n * Remove a record from the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n removeRecord(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(r), this.hstStore.has(`${r}.${t}`) && this.hstStore.set(`${r}.${t}`, void 0);\n }\n /**\n * Get all record IDs for a doctype\n * @param doctype - The doctype\n * @returns Array of record IDs\n */\n getRecordIds(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t);\n const r = this.hstStore.get(t);\n return !r || typeof r != \"object\" ? [] : Object.keys(r).filter((o) => r[o] !== void 0);\n }\n /**\n * Clear all records for a doctype\n * @param doctype - The doctype\n */\n clearRecords(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((o) => {\n this.hstStore.set(`${t}.${o}`, void 0);\n });\n }\n /**\n * Setup method for doctype initialization\n * @param doctype - The doctype to setup\n */\n setup(e) {\n this.ensureDoctypeExists(e.slug);\n }\n /**\n * Run action on doctype\n * Executes the action and logs it to the operation log for audit tracking\n * @param doctype - The doctype\n * @param action - The action to run\n * @param args - Action arguments (typically record IDs)\n */\n runAction(e, t, r) {\n const s = this.registry.registry[e.slug]?.actions?.get(t), i = Array.isArray(r) ? r.filter((g) => typeof g == \"string\") : void 0, a = this.getOperationLogStore();\n let c = \"success\", f;\n try {\n s && s.length > 0 && s.forEach((g) => {\n try {\n new Function(\"args\", g)(r);\n } catch (b) {\n throw c = \"failure\", f = b instanceof Error ? b.message : \"Unknown error\", b;\n }\n });\n } catch {\n } finally {\n a.logAction(e.doctype, t, i, c, f);\n }\n }\n /**\n * Get records from server (maintains compatibility)\n * @param doctype - The doctype\n */\n async getRecords(e) {\n (await (await fetch(`/${e.slug}`)).json()).forEach((o) => {\n o.id && this.addRecord(e, o.id, o);\n });\n }\n /**\n * Get single record from server (maintains compatibility)\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n async getRecord(e, t) {\n const o = await (await fetch(`/${e.slug}/${t}`)).json();\n this.addRecord(e, t, o);\n }\n /**\n * Ensure doctype section exists in HST store\n * @param slug - The doctype slug\n */\n ensureDoctypeExists(e) {\n this.hstStore.has(e) || this.hstStore.set(e, {});\n }\n /**\n * Get doctype metadata from the registry\n * @param context - The route context\n * @returns The doctype metadata\n */\n async getMeta(e) {\n if (!this.registry.getMeta)\n throw new Error(\"No getMeta function provided to Registry\");\n return await this.registry.getMeta(e);\n }\n /**\n * Get the root HST store node for advanced usage\n * @returns Root HST node\n */\n getStore() {\n return this.hstStore;\n }\n}\nfunction jt(n) {\n n || (n = {});\n const e = n.registry || oe(\"$registry\"), t = oe(\"$stonecrop\"), r = B(), o = B(), s = B({}), i = B(), a = B(), c = B([]);\n if (n.doctype && e) {\n const y = n.doctype.schema ? Array.isArray(n.doctype.schema) ? n.doctype.schema : Array.from(n.doctype.schema) : [];\n c.value = e.resolveSchema(y);\n }\n const f = B([]), g = B(-1), b = W(() => r.value?.getOperationLogStore().canUndo ?? !1), A = W(() => r.value?.getOperationLogStore().canRedo ?? !1), $ = W(() => r.value?.getOperationLogStore().undoCount ?? 0), k = W(() => r.value?.getOperationLogStore().redoCount ?? 0), x = W(\n () => r.value?.getOperationLogStore().undoRedoState ?? {\n canUndo: !1,\n canRedo: !1,\n undoCount: 0,\n redoCount: 0,\n currentIndex: -1\n }\n ), N = (y) => r.value?.getOperationLogStore().undo(y) ?? !1, D = (y) => r.value?.getOperationLogStore().redo(y) ?? !1, P = () => {\n r.value?.getOperationLogStore().startBatch();\n }, S = (y) => r.value?.getOperationLogStore().commitBatch(y) ?? null, C = () => {\n r.value?.getOperationLogStore().cancelBatch();\n }, O = () => {\n r.value?.getOperationLogStore().clear();\n }, _ = (y, E) => r.value?.getOperationLogStore().getOperationsFor(y, E) ?? [], v = () => r.value?.getOperationLogStore().getSnapshot() ?? {\n operations: [],\n currentIndex: -1,\n totalOperations: 0,\n reversibleOperations: 0,\n irreversibleOperations: 0\n }, j = (y, E) => {\n r.value?.getOperationLogStore().markIrreversible(y, E);\n }, M = (y, E, m, u = \"success\", l) => r.value?.getOperationLogStore().logAction(y, E, m, u, l) ?? \"\", d = (y) => {\n r.value?.getOperationLogStore().configure(y);\n };\n Be(async () => {\n if (e) {\n r.value = t || new Ke(e);\n try {\n const y = r.value.getOperationLogStore(), E = Ue(y);\n f.value = E.operations.value, g.value = E.currentIndex.value, U(\n () => E.operations.value,\n (m) => {\n f.value = m;\n }\n ), U(\n () => E.currentIndex.value,\n (m) => {\n g.value = m;\n }\n );\n } catch {\n }\n if (!n.doctype && e.router) {\n const y = e.router.currentRoute.value;\n if (!y.path) return;\n const E = y.path.split(\"/\").filter((u) => u.length > 0), m = E[1]?.toLowerCase();\n if (E.length > 0) {\n const u = {\n path: y.path,\n segments: E\n }, l = await e.getMeta?.(u);\n if (l) {\n if (e.addDoctype(l), r.value.setup(l), i.value = l, a.value = m, o.value = r.value.getStore(), e) {\n const h = l.schema ? Array.isArray(l.schema) ? l.schema : Array.from(l.schema) : [];\n c.value = e.resolveSchema(h);\n }\n if (m && m !== \"new\") {\n const h = r.value.getRecordById(l, m);\n if (h)\n s.value = h.get(\"\") || {};\n else\n try {\n await r.value.getRecord(l, m);\n const I = r.value.getRecordById(l, m);\n I && (s.value = I.get(\"\") || {});\n } catch {\n s.value = J(l);\n }\n } else\n s.value = J(l);\n o.value && xe(l, m || \"new\", s, o.value), r.value.runAction(l, \"load\", m ? [m] : void 0);\n }\n }\n }\n if (n.doctype) {\n o.value = r.value.getStore();\n const y = n.doctype, E = n.recordId;\n if (E && E !== \"new\") {\n const m = r.value.getRecordById(y, E);\n if (m)\n s.value = m.get(\"\") || {};\n else\n try {\n await r.value.getRecord(y, E);\n const u = r.value.getRecordById(y, E);\n u && (s.value = u.get(\"\") || {});\n } catch {\n s.value = J(y);\n }\n } else\n s.value = J(y);\n o.value && xe(y, E || \"new\", s, o.value);\n }\n }\n });\n const p = (y, E) => {\n const m = n.doctype || i.value;\n if (!m) return \"\";\n const u = E || n.recordId || a.value || \"new\";\n return `${m.slug}.${u}.${y}`;\n }, R = (y) => {\n const E = n.doctype || i.value;\n if (!(!o.value || !r.value || !E))\n try {\n const m = y.path.split(\".\");\n if (m.length >= 2) {\n const h = m[0], I = m[1];\n if (o.value.has(`${h}.${I}`) || r.value.addRecord(E, I, { ...s.value }), m.length > 3) {\n const H = `${h}.${I}`, V = m.slice(2);\n let Z = H;\n for (let X = 0; X < V.length - 1; X++)\n if (Z += `.${V[X]}`, !o.value.has(Z)) {\n const we = V[X + 1], Qe = !isNaN(Number(we));\n o.value.set(Z, Qe ? [] : {});\n }\n }\n }\n o.value.set(y.path, y.value);\n const u = y.fieldname.split(\".\"), l = { ...s.value };\n u.length === 1 ? l[u[0]] = y.value : Dt(l, u, y.value), s.value = l;\n } catch {\n }\n };\n (n.doctype || e?.router) && (De(\"hstPathProvider\", p), De(\"hstChangeHandler\", R));\n const F = (y, E, m) => {\n if (!r.value)\n return J(E);\n if (m)\n try {\n const u = o.value?.get(y);\n return u && typeof u == \"object\" ? u : J(E);\n } catch {\n return J(E);\n }\n return J(E);\n }, w = async (y, E) => {\n if (!o.value || !r.value)\n throw new Error(\"HST store not initialized\");\n const m = `${y.slug}.${E}`, l = { ...o.value.get(m) || {} }, h = y.schema ? Array.isArray(y.schema) ? y.schema : Array.from(y.schema) : [], H = (e ? e.resolveSchema(h) : h).filter(\n (V) => \"fieldtype\" in V && V.fieldtype === \"Doctype\" && \"schema\" in V && Array.isArray(V.schema)\n );\n for (const V of H) {\n const Z = V, X = `${m}.${Z.fieldname}`, we = Ze(Z.schema, X, o.value);\n l[Z.fieldname] = we;\n }\n return l;\n }, T = (y, E) => ({\n provideHSTPath: (l) => `${y}.${l}`,\n handleHSTChange: (l) => {\n const h = l.path.startsWith(y) ? l.path : `${y}.${l.fieldname}`;\n R({\n ...l,\n path: h\n });\n }\n }), L = {\n operations: f,\n currentIndex: g,\n undoRedoState: x,\n canUndo: b,\n canRedo: A,\n undoCount: $,\n redoCount: k,\n undo: N,\n redo: D,\n startBatch: P,\n commitBatch: S,\n cancelBatch: C,\n clear: O,\n getOperationsFor: _,\n getSnapshot: v,\n markIrreversible: j,\n logAction: M,\n configure: d\n };\n return n.doctype ? {\n stonecrop: r,\n operationLog: L,\n provideHSTPath: p,\n handleHSTChange: R,\n hstStore: o,\n formData: s,\n resolvedSchema: c,\n loadNestedData: F,\n saveRecursive: w,\n createNestedContext: T\n } : !n.doctype && e?.router ? {\n stonecrop: r,\n operationLog: L,\n provideHSTPath: p,\n handleHSTChange: R,\n hstStore: o,\n formData: s,\n resolvedSchema: c,\n loadNestedData: F,\n saveRecursive: w,\n createNestedContext: T\n } : {\n stonecrop: r,\n operationLog: L\n };\n}\nfunction J(n) {\n const e = {};\n return n.schema && n.schema.forEach((t) => {\n switch (\"fieldtype\" in t ? t.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n e[t.fieldname] = \"\";\n break;\n case \"Check\":\n e[t.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n e[t.fieldname] = 0;\n break;\n case \"Table\":\n e[t.fieldname] = [];\n break;\n case \"JSON\":\n e[t.fieldname] = {};\n break;\n default:\n e[t.fieldname] = null;\n }\n }), e;\n}\nfunction xe(n, e, t, r) {\n U(\n t,\n (o) => {\n const s = `${n.slug}.${e}`;\n Object.keys(o).forEach((i) => {\n const a = `${s}.${i}`;\n try {\n r.set(a, o[i]);\n } catch {\n }\n });\n },\n { deep: !0 }\n );\n}\nfunction Dt(n, e, t) {\n let r = n;\n for (let s = 0; s < e.length - 1; s++) {\n const i = e[s];\n (!(i in r) || typeof r[i] != \"object\") && (r[i] = isNaN(Number(e[s + 1])) ? {} : []), r = r[i];\n }\n const o = e[e.length - 1];\n r[o] = t;\n}\nfunction Ze(n, e, t) {\n const o = { ...t.get(e) || {} }, s = n.filter(\n (i) => \"fieldtype\" in i && i.fieldtype === \"Doctype\" && \"schema\" in i && Array.isArray(i.schema)\n );\n for (const i of s) {\n const a = i, c = `${e}.${a.fieldname}`, f = Ze(a.schema, c, t);\n o[a.fieldname] = f;\n }\n return o;\n}\nfunction Ge(n) {\n const t = oe(\"$operationLogStore\", void 0) || pe();\n n && t.configure(n);\n const { operations: r, currentIndex: o, undoRedoState: s, canUndo: i, canRedo: a, undoCount: c, redoCount: f } = Ue(t);\n function g(O) {\n return t.undo(O);\n }\n function b(O) {\n return t.redo(O);\n }\n function A() {\n t.startBatch();\n }\n function $(O) {\n return t.commitBatch(O);\n }\n function k() {\n t.cancelBatch();\n }\n function x() {\n t.clear();\n }\n function N(O, _) {\n return t.getOperationsFor(O, _);\n }\n function D() {\n return t.getSnapshot();\n }\n function P(O, _) {\n t.markIrreversible(O, _);\n }\n function S(O, _, v, j = \"success\", M) {\n return t.logAction(O, _, v, j, M);\n }\n function C(O) {\n t.configure(O);\n }\n return {\n // State\n operations: r,\n currentIndex: o,\n undoRedoState: s,\n canUndo: i,\n canRedo: a,\n undoCount: c,\n redoCount: f,\n // Methods\n undo: g,\n redo: b,\n startBatch: A,\n commitBatch: $,\n cancelBatch: k,\n clear: x,\n getOperationsFor: N,\n getSnapshot: D,\n markIrreversible: P,\n logAction: S,\n configure: C\n };\n}\nfunction Wt(n, e = !0) {\n if (!e) return;\n const { undo: t, redo: r, canUndo: o, canRedo: s } = Ge(), i = Nt();\n ie(i[\"Ctrl+Z\"], () => {\n o.value && t(n);\n }), ie(i[\"Meta+Z\"], () => {\n o.value && t(n);\n }), ie(i[\"Ctrl+Shift+Z\"], () => {\n s.value && r(n);\n }), ie(i[\"Meta+Shift+Z\"], () => {\n s.value && r(n);\n }), ie(i[\"Ctrl+Y\"], () => {\n s.value && r(n);\n });\n}\nasync function Ht(n, e) {\n const { startBatch: t, commitBatch: r, cancelBatch: o } = Ge();\n t();\n try {\n return await n(), r(e);\n } catch (s) {\n throw o(), s;\n }\n}\nclass zt {\n /**\n * The doctype name\n * @public\n * @readonly\n */\n doctype;\n /**\n * The doctype schema\n * @public\n * @readonly\n */\n schema;\n /**\n * The doctype workflow\n * @public\n * @readonly\n */\n workflow;\n /**\n * The doctype actions and field triggers\n * @public\n * @readonly\n */\n actions;\n /**\n * The doctype component\n * @public\n * @readonly\n */\n component;\n /**\n * Creates a new DoctypeMeta instance\n * @param doctype - The doctype name\n * @param schema - The doctype schema definition\n * @param workflow - The doctype workflow configuration (XState machine)\n * @param actions - The doctype actions and field triggers\n * @param component - Optional Vue component for rendering the doctype\n */\n constructor(e, t, r, o, s) {\n this.doctype = e, this.schema = t, this.workflow = r, this.actions = o, this.component = s;\n }\n /**\n * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n * - It replaces camelCase and PascalCase with kebab-case strings\n * - It replaces spaces and underscores with hyphens\n * - It converts the string to lowercase\n *\n * @returns The slugified doctype string\n *\n * @example\n * ```ts\n * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n * console.log(doctype.slug) // 'task-item'\n * ```\n *\n * @public\n */\n get slug() {\n return this.doctype.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[\\s_]+/g, \"-\").toLowerCase();\n }\n}\nclass fe {\n /**\n * The root Registry instance\n */\n static _root;\n /**\n * The name of the Registry instance\n *\n * @defaultValue 'Registry'\n */\n name;\n /**\n * The registry property contains a collection of doctypes\n * @see {@link DoctypeMeta}\n */\n registry;\n /**\n * The Vue router instance\n * @see {@link https://router.vuejs.org/}\n */\n router;\n /**\n * Creates a new Registry instance (singleton pattern)\n * @param router - Optional Vue router instance for route management\n * @param getMeta - Optional function to fetch doctype metadata from an API\n */\n constructor(e, t) {\n if (fe._root)\n return fe._root;\n fe._root = this, this.name = \"Registry\", this.registry = {}, this.router = e, this.getMeta = t;\n }\n /**\n * The getMeta function fetches doctype metadata from an API based on route context\n * @see {@link DoctypeMeta}\n */\n getMeta;\n /**\n * Get doctype metadata\n * @param doctype - The doctype to fetch metadata for\n * @returns The doctype metadata\n * @see {@link DoctypeMeta}\n */\n addDoctype(e) {\n e.doctype in Object.keys(this.registry) || (this.registry[e.slug] = e);\n const t = K();\n t.registerDoctypeActions(e.doctype, e.actions), e.slug !== e.doctype && t.registerDoctypeActions(e.slug, e.actions), e.component && this.router && !this.router.hasRoute(e.doctype) && this.router.addRoute({\n path: `/${e.slug}`,\n name: e.slug,\n component: e.component\n });\n }\n /**\n * Resolve nested Doctype and Table fields in a schema by embedding child schemas inline.\n *\n * @remarks\n * Walks the schema array and for each field with `fieldtype: 'Doctype'` and a string\n * `options` value, looks up the referenced doctype in the registry and embeds its schema\n * as the field's `schema` property. Recurses for deeply nested doctypes.\n *\n * For fields with `fieldtype: 'Table'`, looks up the referenced child doctype and\n * auto-derives `columns` from its schema fields (unless columns are already provided).\n * Also sets sensible defaults for `component` (`'ATable'`) and `config` (`{ view: 'list' }`).\n * Row data is expected to come from the parent form's data model at `data[fieldname]`.\n *\n * Returns a new array — does not mutate the original schema.\n *\n * @param schema - The schema array to resolve\n * @returns A new schema array with nested Doctype fields resolved\n *\n * @example\n * ```ts\n * registry.addDoctype(addressDoctype)\n * registry.addDoctype(customerDoctype)\n *\n * // Before: customer schema has { fieldname: 'address', fieldtype: 'Doctype', options: 'address' }\n * const resolved = registry.resolveSchema(customerSchema)\n * // After: address field now has schema: [...address fields...]\n * ```\n *\n * @public\n */\n resolveSchema(e, t) {\n const r = t || /* @__PURE__ */ new Set();\n return e.map((o) => {\n if (\"fieldtype\" in o && o.fieldtype === \"Doctype\" && \"options\" in o && typeof o.options == \"string\") {\n const s = o.options;\n if (r.has(s))\n return { ...o };\n const i = this.registry[s];\n if (i && i.schema) {\n const a = Array.isArray(i.schema) ? i.schema : Array.from(i.schema);\n r.add(s);\n const c = this.resolveSchema(a, r);\n return r.delete(s), { ...o, schema: c };\n }\n }\n if (\"fieldtype\" in o && o.fieldtype === \"Table\" && \"options\" in o && typeof o.options == \"string\") {\n const s = o.options;\n if (r.has(s))\n return { ...o };\n const i = this.registry[s];\n if (i && i.schema) {\n const a = Array.isArray(i.schema) ? i.schema : Array.from(i.schema), c = { ...o };\n return (!(\"columns\" in o) || !o.columns) && (c.columns = a.map((f) => ({\n name: f.fieldname,\n fieldname: f.fieldname,\n label: \"label\" in f && f.label || f.fieldname,\n fieldtype: \"fieldtype\" in f ? f.fieldtype : \"Data\",\n align: \"align\" in f && f.align || \"left\",\n edit: \"edit\" in f ? f.edit : !0,\n width: \"width\" in f && f.width || \"20ch\"\n }))), c.component || (c.component = \"ATable\"), (!(\"config\" in o) || !o.config) && (c.config = { view: \"list\" }), (!(\"rows\" in o) || !o.rows) && (c.rows = []), c;\n }\n }\n return { ...o };\n });\n }\n /**\n * Initialize a new record with default values based on a schema.\n *\n * @remarks\n * Creates a plain object with keys from the schema's fieldnames and default values\n * derived from each field's `fieldtype`:\n * - Data, Text → `''`\n * - Check → `false`\n * - Int, Float, Decimal, Currency, Quantity → `0`\n * - Table → `[]`\n * - JSON, Doctype → `{}`\n * - All others → `null`\n *\n * For Doctype fields with a resolved `schema` array, recursively initializes the nested record.\n *\n * @param schema - The schema array to derive defaults from\n * @returns A plain object with default values for each field\n *\n * @example\n * ```ts\n * const defaults = registry.initializeRecord(addressSchema)\n * // { street: '', city: '', state: '', zip_code: '' }\n * ```\n *\n * @public\n */\n initializeRecord(e) {\n const t = {};\n return e.forEach((r) => {\n switch (\"fieldtype\" in r ? r.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n case \"Code\":\n t[r.fieldname] = \"\";\n break;\n case \"Check\":\n t[r.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n case \"Decimal\":\n case \"Currency\":\n case \"Quantity\":\n t[r.fieldname] = 0;\n break;\n case \"Table\":\n t[r.fieldname] = [];\n break;\n case \"JSON\":\n t[r.fieldname] = {};\n break;\n case \"Doctype\":\n \"schema\" in r && Array.isArray(r.schema) ? t[r.fieldname] = this.initializeRecord(r.schema) : t[r.fieldname] = {};\n break;\n default:\n t[r.fieldname] = null;\n }\n }), t;\n }\n // TODO: should we allow clearing the registry at all?\n // clear() {\n // \tthis.registry = {}\n // \tif (this.router) {\n // \t\tconst routes = this.router.getRoutes()\n // \t\tfor (const route of routes) {\n // \t\t\tif (route.name) {\n // \t\t\t\tthis.router.removeRoute(route.name)\n // \t\t\t}\n // \t\t}\n // \t}\n // }\n}\nasync function Tt(n, e, t) {\n await de();\n try {\n await t(n, e);\n } catch {\n }\n}\nconst Ut = {\n install: (n, e) => {\n const t = n.config.globalProperties.$router, r = e?.router, o = t || r;\n !t && r && n.use(r);\n const s = new fe(o, e?.getMeta);\n n.provide(\"$registry\", s), n.config.globalProperties.$registry = s;\n const i = new Ke(s);\n n.provide(\"$stonecrop\", i), n.config.globalProperties.$stonecrop = i;\n try {\n const a = n.config.globalProperties.$pinia;\n if (a) {\n const c = pe(a);\n n.provide(\"$operationLogStore\", c), n.config.globalProperties.$operationLogStore = c;\n }\n } catch (a) {\n console.warn(\"Pinia not available - operation log features will be disabled:\", a);\n }\n if (e?.components)\n for (const [a, c] of Object.entries(e.components))\n n.component(a, c);\n e?.autoInitializeRouter && e.onRouterInitialized && Tt(s, i, e.onRouterInitialized);\n }\n};\nvar It = /* @__PURE__ */ ((n) => (n.ERROR = \"error\", n.WARNING = \"warning\", n.INFO = \"info\", n))(It || {});\nclass Ct {\n options;\n /**\n * Creates a new SchemaValidator instance\n * @param options - Validator configuration options\n */\n constructor(e = {}) {\n this.options = {\n registry: e.registry || null,\n validateLinkTargets: e.validateLinkTargets ?? !0,\n validateActions: e.validateActions ?? !0,\n validateWorkflows: e.validateWorkflows ?? !0,\n validateRequiredProperties: e.validateRequiredProperties ?? !0\n };\n }\n /**\n * Validates a complete doctype schema\n * @param doctype - Doctype name\n * @param schema - Schema fields (List or Array)\n * @param workflow - Optional workflow configuration\n * @param actions - Optional actions map\n * @returns Validation result\n */\n validate(e, t, r, o) {\n const s = [], i = t ? Array.isArray(t) ? t : t.toArray() : [];\n if (this.options.validateRequiredProperties && s.push(...this.validateRequiredProperties(e, i)), this.options.validateLinkTargets && this.options.registry && s.push(...this.validateLinkFields(e, i, this.options.registry)), this.options.validateWorkflows && r && s.push(...this.validateWorkflow(e, r)), this.options.validateActions && o) {\n const g = o instanceof Map ? o : o.toObject();\n s.push(...this.validateActionRegistration(e, g));\n }\n const a = s.filter(\n (g) => g.severity === \"error\"\n /* ERROR */\n ).length, c = s.filter(\n (g) => g.severity === \"warning\"\n /* WARNING */\n ).length, f = s.filter(\n (g) => g.severity === \"info\"\n /* INFO */\n ).length;\n return {\n valid: a === 0,\n issues: s,\n errorCount: a,\n warningCount: c,\n infoCount: f\n };\n }\n /**\n * Validates that required schema properties are present\n * @internal\n */\n validateRequiredProperties(e, t) {\n const r = [];\n for (const o of t) {\n if (!o.fieldname) {\n r.push({\n severity: \"error\",\n rule: \"required-fieldname\",\n message: \"Field is missing required property: fieldname\",\n doctype: e,\n context: { field: o }\n });\n continue;\n }\n if (!o.component && !(\"fieldtype\" in o) && r.push({\n severity: \"error\",\n rule: \"required-component-or-fieldtype\",\n message: `Field \"${o.fieldname}\" must have either component or fieldtype property`,\n doctype: e,\n fieldname: o.fieldname\n }), \"schema\" in o) {\n const s = o.schema, i = Array.isArray(s) ? s : s.toArray?.() || [];\n r.push(...this.validateRequiredProperties(e, i));\n }\n }\n return r;\n }\n /**\n * Validates Link field targets exist in registry\n * @internal\n */\n validateLinkFields(e, t, r) {\n const o = [];\n for (const s of t) {\n if ((\"fieldtype\" in s ? s.fieldtype : void 0) === \"Link\") {\n const a = \"options\" in s ? s.options : void 0;\n if (!a) {\n o.push({\n severity: \"error\",\n rule: \"link-missing-options\",\n message: `Link field \"${s.fieldname}\" is missing options property (target doctype)`,\n doctype: e,\n fieldname: s.fieldname\n });\n continue;\n }\n const c = typeof a == \"string\" ? a : \"\";\n if (!c) {\n o.push({\n severity: \"error\",\n rule: \"link-invalid-options\",\n message: `Link field \"${s.fieldname}\" has invalid options format (expected string doctype name)`,\n doctype: e,\n fieldname: s.fieldname\n });\n continue;\n }\n r.registry[c] || r.registry[c.toLowerCase()] || o.push({\n severity: \"error\",\n rule: \"link-invalid-target\",\n message: `Link field \"${s.fieldname}\" references non-existent doctype: \"${c}\"`,\n doctype: e,\n fieldname: s.fieldname,\n context: { targetDoctype: c }\n });\n }\n if (\"schema\" in s) {\n const a = s.schema, c = Array.isArray(a) ? a : a.toArray?.() || [];\n o.push(...this.validateLinkFields(e, c, r));\n }\n }\n return o;\n }\n /**\n * Validates workflow state machine configuration\n * @internal\n */\n validateWorkflow(e, t) {\n const r = [];\n if (!t.initial && !t.type && r.push({\n severity: \"warning\",\n rule: \"workflow-missing-initial\",\n message: \"Workflow is missing initial state property\",\n doctype: e\n }), !t.states || Object.keys(t.states).length === 0)\n return r.push({\n severity: \"warning\",\n rule: \"workflow-no-states\",\n message: \"Workflow has no states defined\",\n doctype: e\n }), r;\n t.initial && typeof t.initial == \"string\" && !t.states[t.initial] && r.push({\n severity: \"error\",\n rule: \"workflow-invalid-initial\",\n message: `Workflow initial state \"${t.initial}\" does not exist in states`,\n doctype: e,\n context: { initialState: t.initial }\n });\n const o = Object.keys(t.states), s = /* @__PURE__ */ new Set();\n t.initial && typeof t.initial == \"string\" && s.add(t.initial);\n for (const [i, a] of Object.entries(t.states)) {\n const c = a;\n if (c.on) {\n for (const [f, g] of Object.entries(c.on))\n if (typeof g == \"string\")\n s.add(g);\n else if (g && typeof g == \"object\") {\n const b = \"target\" in g ? g.target : void 0;\n typeof b == \"string\" ? s.add(b) : Array.isArray(b) && b.forEach((A) => {\n typeof A == \"string\" && s.add(A);\n });\n }\n }\n }\n for (const i of o)\n s.has(i) || r.push({\n severity: \"warning\",\n rule: \"workflow-unreachable-state\",\n message: `Workflow state \"${i}\" may not be reachable`,\n doctype: e,\n context: { stateName: i }\n });\n return r;\n }\n /**\n * Validates that actions are registered in the FieldTriggerEngine\n * @internal\n */\n validateActionRegistration(e, t) {\n const r = [], o = K();\n for (const [s, i] of Object.entries(t)) {\n if (!Array.isArray(i)) {\n r.push({\n severity: \"error\",\n rule: \"action-invalid-format\",\n message: `Action configuration for \"${s}\" must be an array`,\n doctype: e,\n context: { triggerName: s, actionNames: i }\n });\n continue;\n }\n for (const a of i) {\n const c = o;\n c.globalActions?.has(a) || c.globalTransitionActions?.has(a) || r.push({\n severity: \"warning\",\n rule: \"action-not-registered\",\n message: `Action \"${a}\" referenced in \"${s}\" is not registered in FieldTriggerEngine`,\n doctype: e,\n context: { triggerName: s, actionName: a }\n });\n }\n }\n return r;\n }\n}\nfunction kt(n, e) {\n return new Ct({\n registry: n,\n ...e\n });\n}\nfunction Jt(n, e, t, r, o) {\n return kt(t).validate(n, e, r, o);\n}\nexport {\n zt as DoctypeMeta,\n ne as HST,\n fe as Registry,\n Ct as SchemaValidator,\n Ke as Stonecrop,\n It as ValidationSeverity,\n $t as createHST,\n kt as createValidator,\n Ut as default,\n K as getGlobalTriggerEngine,\n Bt as markOperationIrreversible,\n Vt as registerGlobalAction,\n xt as registerTransitionAction,\n Mt as setFieldRollback,\n Ft as triggerTransition,\n Ge as useOperationLog,\n pe as useOperationLogStore,\n jt as useStonecrop,\n Wt as useUndoRedoShortcuts,\n Jt as validateSchema,\n Ht as withBatch\n};\n//# sourceMappingURL=stonecrop.js.map\n","import { defineComponent as te, useTemplateRef as fe, ref as L, computed as $, openBlock as w, createElementBlock as k, unref as V, normalizeClass as ae, normalizeStyle as xe, createBlock as pe, resolveDynamicComponent as We, mergeProps as vt, toDisplayString as K, createElementVNode as y, withModifiers as Ie, withDirectives as J, Fragment as ue, renderList as me, vShow as Ce, createCommentVNode as q, renderSlot as he, createTextVNode as Dt, onMounted as Ee, watch as oe, onBeforeUnmount as sn, nextTick as pt, toValue as E, shallowRef as ie, getCurrentScope as mt, onScopeDispose as ht, reactive as rn, vModelText as we, vModelCheckbox as un, vModelSelect as Cn, getCurrentInstance as gt, watchEffect as Oe, useCssVars as En, onUnmounted as An, useModel as ke, createVNode as dt, withCtx as Tt, mergeModels as Me, isRef as Tn, toRefs as $n, customRef as St, toRef as cn, readonly as Rt, resolveComponent as dn, withKeys as Ne } from \"vue\";\nimport { defineStore as Dn } from \"pinia\";\nimport './assets/index.css';function fn(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\nconst Sn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Rn = (e) => e != null, Ln = Object.prototype.toString, Hn = (e) => Ln.call(e) === \"[object Object]\", Vn = () => {\n};\nfunction rt(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction Pn(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst qe = Sn ? window : void 0;\nfunction Ge(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction Ke(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = rt(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return Pn(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => Ge(r))) !== null && o !== void 0 ? o : [qe].filter((r) => r != null),\n rt(E(n.value ? e[1] : e[0])),\n rt(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = Hn(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction On() {\n const e = ie(!1), t = gt();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction _n(e) {\n const t = /* @__PURE__ */ On();\n return $(() => (t.value, !!e()));\n}\nfunction Bn(e, t, n = {}) {\n const { window: o = qe, ...a } = n;\n let r;\n const s = /* @__PURE__ */ _n(() => o && \"MutationObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const p = rt(E(e)).map(Ge).filter(Rn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((h) => r.observe(h, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => r?.takeRecords(), c = () => {\n i(), l();\n };\n return fn(c), {\n isSupported: s,\n stop: c,\n takeRecords: u\n };\n}\nfunction Fn(e, t, n = {}) {\n const { window: o = qe, document: a = o?.document, flush: r = \"sync\" } = n;\n if (!o || !a) return Vn;\n let s;\n const l = (c) => {\n s?.(), s = c;\n }, i = Oe(() => {\n const c = Ge(e);\n if (c) {\n const { stop: p } = Bn(a, (h) => {\n h.map((b) => [...b.removedNodes]).flat().some((b) => b === c || b.contains(c)) && t(h);\n }, {\n window: o,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), u = () => {\n i(), l();\n };\n return fn(u), u;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Zn(e = {}) {\n var t;\n const { window: n = qe, deep: o = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {\n let u = r?.activeElement;\n if (o)\n for (var c; u?.shadowRoot; ) u = u == null || (c = u.shadowRoot) === null || c === void 0 ? void 0 : c.activeElement;\n return u;\n }, l = ie(), i = () => {\n l.value = s();\n };\n if (n) {\n const u = {\n capture: !0,\n passive: !0\n };\n Ke(n, \"blur\", (c) => {\n c.relatedTarget === null && i();\n }, u), Ke(n, \"focus\", i, u);\n }\n return a && Fn(l, i, { document: r }), i(), l;\n}\nconst Nn = \"focusin\", Un = \"focusout\", Wn = \":focus-within\";\nfunction Gn(e, t = {}) {\n const { window: n = qe } = t, o = $(() => Ge(e)), a = ie(!1), r = $(() => a.value);\n if (!n || !(/* @__PURE__ */ Zn(t)).value) return { focused: r };\n const s = { passive: !0 };\n return Ke(o, Nn, () => a.value = !0, s), Ke(o, Un, () => {\n var l, i, u;\n return a.value = (l = (i = o.value) === null || i === void 0 || (u = i.matches) === null || u === void 0 ? void 0 : u.call(i, Wn)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction zn(e, { window: t = qe, scrollTarget: n } = {}) {\n const o = L(!1), a = () => {\n if (!t) return;\n const r = t.document, s = Ge(e);\n if (!s)\n o.value = !1;\n else {\n const l = s.getBoundingClientRect();\n o.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return oe(\n () => Ge(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && Ke(n || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), o;\n}\nconst Ae = (e) => {\n let t = zn(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, Te = (e) => e.tabIndex >= 0, Wt = (e) => {\n const t = e.target;\n return Lt(t);\n}, Lt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.previousElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.previousElementSibling;\n n && (t = n);\n }\n return t && (!Te(t) || !Ae(t)) ? Lt(t) : t;\n}, qn = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.firstElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.firstElementChild;\n a && (n = a);\n }\n }\n return n && (!Te(n) || !Ae(n)) ? Ht(n) : n;\n}, Gt = (e) => {\n const t = e.target;\n return Ht(t);\n}, Ht = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.nextElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.nextElementSibling;\n n && (t = n);\n }\n return t && (!Te(t) || !Ae(t)) ? Ht(t) : t;\n}, Yn = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.lastElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.lastElementChild;\n a && (n = a);\n }\n }\n return n && (!Te(n) || !Ae(n)) ? Lt(n) : n;\n}, zt = (e) => {\n const t = e.target;\n return Vt(t);\n}, Vt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!Te(t) || !Ae(t)) ? Vt(t) : t;\n}, qt = (e) => {\n const t = e.target;\n return Pt(t);\n}, Pt = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!Te(t) || !Ae(t)) ? Pt(t) : t;\n}, Yt = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!Te(t) || !Ae(t)) ? Pt(t) : t;\n}, Xt = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!Te(t) || !Ae(t)) ? Vt(t) : t;\n}, ot = [\"alt\", \"control\", \"shift\", \"meta\"], Xn = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, wt = {\n \"keydown.up\": (e) => {\n const t = Wt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Gt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = zt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = qt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = qn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Yn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Gt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Wt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = zt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Ot(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, n = (s) => {\n const l = t(s);\n let i = [];\n if (typeof s.selectors == \"string\")\n i = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const u of s.selectors)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else if (s.selectors instanceof HTMLElement)\n i.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const u of s.selectors.value)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else\n i.push(s.selectors.value);\n return i;\n }, o = (s) => {\n const l = t(s);\n let i = [];\n return s.selectors ? i = n(s) : l && (i = Array.from(l.children).filter((u) => Te(u) && Ae(u))), i;\n }, a = (s) => (l) => {\n const i = Xn[l.key] || l.key.toLowerCase();\n if (ot.includes(i)) return;\n const u = s.handlers || wt;\n for (const c of Object.keys(u)) {\n const [p, ...h] = c.split(\".\");\n if (p === \"keydown\" && h.includes(i)) {\n const b = u[c], I = h.filter((f) => ot.includes(f)), x = ot.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (I.length > 0) {\n if (x) {\n for (const f of ot)\n if (h.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && b(l);\n }\n }\n } else\n x || b(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), i = o(s), u = a(s), c = l ? [l] : i;\n for (const p of c) {\n const { focused: h } = Gn(L(p)), b = oe(h, (I) => {\n I ? p.addEventListener(\"keydown\", u) : p.removeEventListener(\"keydown\", u);\n });\n r.push(b);\n }\n }\n }), sn(() => {\n for (const s of r)\n s();\n });\n}\nfunction _t(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\nconst vn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst jn = (e) => e != null, Jn = Object.prototype.toString, Qn = (e) => Jn.call(e) === \"[object Object]\", _e = () => {\n};\nfunction Kn(...e) {\n if (e.length !== 1) return cn(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: _e\n }))) : L(t);\n}\nfunction eo(e, t) {\n function n(...o) {\n return new Promise((a, r) => {\n Promise.resolve(e(() => t.apply(this, o), {\n fn: t,\n thisArg: this,\n args: o\n })).then(a).catch(r);\n });\n }\n return n;\n}\nfunction to(e, t = {}) {\n let n, o, a = _e;\n const r = (l) => {\n clearTimeout(l), a(), a = _e;\n };\n let s;\n return (l) => {\n const i = E(e), u = E(t.maxWait);\n return n && r(n), i <= 0 || u !== void 0 && u <= 0 ? (o && (r(o), o = void 0), Promise.resolve(l())) : new Promise((c, p) => {\n a = t.rejectOnCancel ? p : c, s = l, u && !o && (o = setTimeout(() => {\n n && r(n), o = void 0, c(s());\n }, u)), n = setTimeout(() => {\n o && r(o), o = void 0, c(l());\n }, i);\n });\n };\n}\nfunction it(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction no(e) {\n return gt();\n}\n// @__NO_SIDE_EFFECTS__\nfunction oo(e, t = 200, n = {}) {\n return eo(to(t, n), e);\n}\nfunction lo(e, t = {}) {\n if (!Tn(e)) return $n(e);\n const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};\n for (const o in e.value) n[o] = St(() => ({\n get() {\n return e.value[o];\n },\n set(a) {\n var r;\n if (!((r = E(t.replaceRef)) !== null && r !== void 0) || r) if (Array.isArray(e.value)) {\n const s = [...e.value];\n s[o] = a, e.value = s;\n } else {\n const s = {\n ...e.value,\n [o]: a\n };\n Object.setPrototypeOf(s, Object.getPrototypeOf(e.value)), e.value = s;\n }\n else e.value[o] = a;\n }\n }));\n return n;\n}\nfunction ao(e, t = !0, n) {\n no() ? Ee(e, n) : t ? e() : pt(e);\n}\nfunction so(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst tt = vn ? window : void 0;\nfunction ye(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction He(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = it(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return so(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => ye(r))) !== null && o !== void 0 ? o : [tt].filter((r) => r != null),\n it(E(n.value ? e[1] : e[0])),\n it(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = Qn(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction $t(e, t, n = {}) {\n const { window: o = tt, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = n;\n if (!o) return l ? {\n stop: _e,\n cancel: _e,\n trigger: _e\n } : _e;\n let i = !0;\n const u = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(o.document.querySelectorAll(m)).some((g) => g === f.target || f.composedPath().includes(g));\n {\n const g = ye(m);\n return g && (f.target === g || f.composedPath().includes(g));\n }\n });\n function c(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const g = E(f), C = g.$.subTree && g.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some((T) => T.el === m.target || m.composedPath().includes(T.el));\n }\n const h = (f) => {\n const m = ye(e);\n if (f.target != null && !(!(m instanceof Element) && c(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (i = !u(f)), !i) {\n i = !0;\n return;\n }\n t(f);\n }\n };\n let b = !1;\n const I = [\n He(o, \"click\", (f) => {\n b || (b = !0, setTimeout(() => {\n b = !1;\n }, 0), h(f));\n }, {\n passive: !0,\n capture: r\n }),\n He(o, \"pointerdown\", (f) => {\n const m = ye(e);\n i = !u(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && He(o, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const g = ye(e);\n ((m = o.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !g?.contains(o.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), x = () => I.forEach((f) => f());\n return l ? {\n stop: x,\n cancel: () => {\n i = !1;\n },\n trigger: (f) => {\n i = !0, h(f), i = !1;\n }\n } : x;\n}\n// @__NO_SIDE_EFFECTS__\nfunction ro() {\n const e = ie(!1), t = gt();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction pn(e) {\n const t = /* @__PURE__ */ ro();\n return $(() => (t.value, !!e()));\n}\nfunction mn(e, t, n = {}) {\n const { window: o = tt, ...a } = n;\n let r;\n const s = /* @__PURE__ */ pn(() => o && \"MutationObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const p = it(E(e)).map(ye).filter(jn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((h) => r.observe(h, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => r?.takeRecords(), c = () => {\n i(), l();\n };\n return _t(c), {\n isSupported: s,\n stop: c,\n takeRecords: u\n };\n}\nconst lt = {\n speed: 2,\n margin: 30,\n direction: \"both\"\n};\nfunction io(e) {\n e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));\n}\nfunction yt(e, t = {}) {\n var n, o, a, r;\n const { pointerTypes: s, preventDefault: l, stopPropagation: i, exact: u, onMove: c, onEnd: p, onStart: h, initialValue: b, axis: I = \"both\", draggingElement: x = tt, containerElement: f, handle: m = e, buttons: g = [0], restrictInView: C, autoScroll: T = !1 } = t, R = L((n = E(b)) !== null && n !== void 0 ? n : {\n x: 0,\n y: 0\n }), S = L(), _ = (D) => s ? s.includes(D.pointerType) : !0, U = (D) => {\n E(l) && D.preventDefault(), E(i) && D.stopPropagation();\n }, ve = E(T), Y = typeof ve == \"object\" ? {\n speed: (o = E(ve.speed)) !== null && o !== void 0 ? o : lt.speed,\n margin: (a = E(ve.margin)) !== null && a !== void 0 ? a : lt.margin,\n direction: (r = ve.direction) !== null && r !== void 0 ? r : lt.direction\n } : lt, X = (D) => typeof D == \"number\" ? [D, D] : [D.x, D.y], ge = (D, F, W) => {\n const { clientWidth: j, clientHeight: z, scrollLeft: se, scrollTop: be, scrollWidth: Le, scrollHeight: O } = D, [B, G] = X(Y.margin), [Q, ne] = X(Y.speed);\n let ee = 0, re = 0;\n (Y.direction === \"x\" || Y.direction === \"both\") && (W.x < B && se > 0 ? ee = -Q : W.x + F.width > j - B && se < Le - j && (ee = Q)), (Y.direction === \"y\" || Y.direction === \"both\") && (W.y < G && be > 0 ? re = -ne : W.y + F.height > z - G && be < O - z && (re = ne)), (ee || re) && D.scrollBy({\n left: ee,\n top: re,\n behavior: \"auto\"\n });\n };\n let de = null;\n const Be = () => {\n const D = E(f);\n D && !de && (de = setInterval(() => {\n const F = E(e).getBoundingClientRect(), { x: W, y: j } = R.value, z = {\n x: W - D.scrollLeft,\n y: j - D.scrollTop\n };\n z.x >= 0 && z.y >= 0 && (ge(D, F, z), z.x += D.scrollLeft, z.y += D.scrollTop, R.value = z);\n }, 1e3 / 60));\n }, Re = () => {\n de && (clearInterval(de), de = null);\n }, Xe = (D, F, W, j) => {\n const [z, se] = typeof W == \"number\" ? [W, W] : [W.x, W.y], { clientWidth: be, clientHeight: Le } = F;\n return D.x < z || D.x + j.width > be - z || D.y < se || D.y + j.height > Le - se;\n }, je = () => {\n if (E(t.disabled) || !S.value) return;\n const D = E(f);\n if (!D) return;\n const F = E(e).getBoundingClientRect(), { x: W, y: j } = R.value;\n Xe({\n x: W - D.scrollLeft,\n y: j - D.scrollTop\n }, D, Y.margin, F) ? Be() : Re();\n };\n E(T) && oe(R, je);\n const Fe = (D) => {\n var F;\n if (!E(g).includes(D.button) || E(t.disabled) || !_(D) || E(u) && D.target !== E(e)) return;\n const W = E(f), j = W == null || (F = W.getBoundingClientRect) === null || F === void 0 ? void 0 : F.call(W), z = E(e).getBoundingClientRect(), se = {\n x: D.clientX - (W ? z.left - j.left + (T ? 0 : W.scrollLeft) : z.left),\n y: D.clientY - (W ? z.top - j.top + (T ? 0 : W.scrollTop) : z.top)\n };\n h?.(se, D) !== !1 && (S.value = se, U(D));\n }, Je = (D) => {\n if (E(t.disabled) || !_(D) || !S.value) return;\n const F = E(f);\n F instanceof HTMLElement && io(F);\n const W = E(e).getBoundingClientRect();\n let { x: j, y: z } = R.value;\n if ((I === \"x\" || I === \"both\") && (j = D.clientX - S.value.x, F && (j = Math.min(Math.max(0, j), F.scrollWidth - W.width))), (I === \"y\" || I === \"both\") && (z = D.clientY - S.value.y, F && (z = Math.min(Math.max(0, z), F.scrollHeight - W.height))), E(T) && F && (de === null && ge(F, W, {\n x: j,\n y: z\n }), j += F.scrollLeft, z += F.scrollTop), F && (C || T)) {\n if (I !== \"y\") {\n const se = j - F.scrollLeft;\n se < 0 ? j = F.scrollLeft : se > F.clientWidth - W.width && (j = F.clientWidth - W.width + F.scrollLeft);\n }\n if (I !== \"x\") {\n const se = z - F.scrollTop;\n se < 0 ? z = F.scrollTop : se > F.clientHeight - W.height && (z = F.clientHeight - W.height + F.scrollTop);\n }\n }\n R.value = {\n x: j,\n y: z\n }, c?.(R.value, D), U(D);\n }, Ze = (D) => {\n E(t.disabled) || !_(D) || S.value && (S.value = void 0, T && Re(), p?.(R.value, D), U(D));\n };\n if (vn) {\n const D = () => {\n var F;\n return {\n capture: (F = t.capture) !== null && F !== void 0 ? F : !0,\n passive: !E(l)\n };\n };\n He(m, \"pointerdown\", Fe, D), He(x, \"pointermove\", Je, D), He(x, \"pointerup\", Ze, D);\n }\n return {\n ...lo(R),\n position: R,\n isDragging: $(() => !!S.value),\n style: $(() => `\n left: ${R.value.x}px;\n top: ${R.value.y}px;\n ${T ? \"text-wrap: nowrap;\" : \"\"}\n `)\n };\n}\nfunction ft(e, t, n = {}) {\n const { window: o = tt, ...a } = n;\n let r;\n const s = /* @__PURE__ */ pn(() => o && \"ResizeObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const c = E(e);\n return Array.isArray(c) ? c.map((p) => ye(p)) : [ye(c)];\n }), (c) => {\n if (l(), s.value && o) {\n r = new ResizeObserver(t);\n for (const p of c) p && r.observe(p, a);\n }\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => {\n l(), i();\n };\n return _t(u), {\n isSupported: s,\n stop: u\n };\n}\nfunction Pe(e, t = {}) {\n const { reset: n = !0, windowResize: o = !0, windowScroll: a = !0, immediate: r = !0, updateTiming: s = \"sync\" } = t, l = ie(0), i = ie(0), u = ie(0), c = ie(0), p = ie(0), h = ie(0), b = ie(0), I = ie(0);\n function x() {\n const m = ye(e);\n if (!m) {\n n && (l.value = 0, i.value = 0, u.value = 0, c.value = 0, p.value = 0, h.value = 0, b.value = 0, I.value = 0);\n return;\n }\n const g = m.getBoundingClientRect();\n l.value = g.height, i.value = g.bottom, u.value = g.left, c.value = g.right, p.value = g.top, h.value = g.width, b.value = g.x, I.value = g.y;\n }\n function f() {\n s === \"sync\" ? x() : s === \"next-frame\" && requestAnimationFrame(() => x());\n }\n return ft(e, f), oe(() => ye(e), (m) => !m && f()), mn(e, f, { attributeFilter: [\"style\", \"class\"] }), a && He(\"scroll\", f, {\n capture: !0,\n passive: !0\n }), o && He(\"resize\", f, { passive: !0 }), ao(() => {\n r && f();\n }), {\n height: l,\n bottom: i,\n left: u,\n right: c,\n top: p,\n width: h,\n x: b,\n y: I,\n update: f\n };\n}\nfunction xt(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst bt = /* @__PURE__ */ new WeakMap();\nfunction uo(e, t = !1) {\n const n = ie(t);\n let o = \"\";\n oe(Kn(e), (s) => {\n const l = xt(E(s));\n if (l) {\n const i = l;\n if (bt.get(i) || bt.set(i, i.style.overflow), i.style.overflow !== \"hidden\" && (o = i.style.overflow), i.style.overflow === \"hidden\") return n.value = !0;\n if (n.value) return i.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = xt(E(e));\n !s || n.value || (s.style.overflow = \"hidden\", n.value = !0);\n }, r = () => {\n const s = xt(E(e));\n !s || !n.value || (s.style.overflow = o, bt.delete(s), n.value = !1);\n };\n return _t(r), $({\n get() {\n return n.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst co = (e) => {\n const t = new DOMParser().parseFromString(e, \"text/html\");\n return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);\n}, fo = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(\"\"), vo = [\"data-colindex\", \"data-rowindex\", \"data-editable\", \"contenteditable\", \"tabindex\"], po = [\"innerHTML\"], mo = { key: 2 }, ho = /* @__PURE__ */ te({\n __name: \"ACell\",\n props: {\n colIndex: {},\n rowIndex: {},\n store: {},\n addNavigation: { type: [Boolean, Object], default: !0 },\n tabIndex: { default: 0 },\n pinned: { type: Boolean, default: !1 },\n debounce: { default: 300 }\n },\n setup(e, { expose: t }) {\n const n = fe(\"cell\"), o = e.store.getCellData(e.colIndex, e.rowIndex), a = L(\"\"), r = L(!1), s = e.store.columns[e.colIndex], l = e.store.rows[e.rowIndex], i = s.align || \"center\", u = s.width || \"40ch\", c = $(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), p = $(() => typeof c.value == \"string\" ? co(c.value) : !1), h = $(() => ({\n textAlign: i,\n width: u,\n fontWeight: r.value ? \"bold\" : \"inherit\",\n paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)\n })), b = $(() => ({\n \"sticky-column\": e.pinned,\n \"cell-modified\": r.value\n })), I = () => {\n f(), x();\n }, x = () => {\n const { left: S, bottom: _, width: U, height: ve } = Pe(n);\n s.mask, s.modalComponent && e.store.$patch((Y) => {\n Y.modal.visible = !0, Y.modal.colIndex = e.colIndex, Y.modal.rowIndex = e.rowIndex, Y.modal.left = S, Y.modal.bottom = _, Y.modal.width = U, Y.modal.height = ve, Y.modal.cell = n.value, typeof s.modalComponent == \"function\" ? Y.modal.component = s.modalComponent({ table: Y.table, row: l, column: s }) : Y.modal.component = s.modalComponent, Y.modal.componentProps = s.modalComponentExtraProps;\n });\n };\n if (e.addNavigation) {\n let S = {\n ...wt,\n \"keydown.f2\": x,\n \"keydown.alt.up\": x,\n \"keydown.alt.down\": x,\n \"keydown.alt.left\": x,\n \"keydown.alt.right\": x\n };\n typeof e.addNavigation == \"object\" && (S = {\n ...S,\n ...e.addNavigation\n }), Ot([\n {\n selectors: n,\n handlers: S\n }\n ]);\n }\n const f = () => {\n if (n.value && s.edit) {\n const S = window.getSelection();\n if (S)\n try {\n const _ = document.createRange();\n _.selectNodeContents && (_.selectNodeContents(n.value), S.removeAllRanges(), S.addRange(_));\n } catch {\n }\n }\n }, m = () => {\n n.value && (a.value = n.value.textContent, f());\n }, g = () => {\n try {\n const S = window.getSelection();\n if (S && S.rangeCount > 0 && n.value) {\n const _ = S.getRangeAt(0), U = _.cloneRange();\n if (U.selectNodeContents && U.setEnd)\n return U.selectNodeContents(n.value), U.setEnd(_.endContainer, _.endOffset), U.toString().length;\n }\n } catch {\n }\n return 0;\n }, C = (S) => {\n if (n.value)\n try {\n const _ = window.getSelection();\n if (!_) return;\n let U = 0;\n const ve = document.createTreeWalker ? document.createTreeWalker(n.value, NodeFilter.SHOW_TEXT, null) : null;\n if (!ve) return;\n let Y, X = null;\n for (; Y = ve.nextNode(); ) {\n const ge = Y, de = U + ge.textContent.length;\n if (S <= de && (X = document.createRange(), X.setStart && X.setEnd)) {\n X.setStart(ge, S - U), X.setEnd(ge, S - U);\n break;\n }\n U = de;\n }\n X && _.removeAllRanges && _.addRange && (_.removeAllRanges(), _.addRange(X));\n } catch {\n }\n }, T = (S) => {\n if (!s.edit) return;\n const _ = S.target;\n if (_.textContent === a.value)\n return;\n const U = g();\n a.value = _.textContent, s.format ? (r.value = _.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, o), e.store.setCellText(e.colIndex, e.rowIndex, _.textContent)) : (r.value = _.textContent !== o, e.store.setCellData(e.colIndex, e.rowIndex, _.textContent)), pt().then(() => {\n C(U);\n });\n }, R = /* @__PURE__ */ oo(T, e.debounce);\n return t({\n currentData: a\n }), (S, _) => (w(), k(\"td\", {\n ref: \"cell\",\n \"data-colindex\": e.colIndex,\n \"data-rowindex\": e.rowIndex,\n \"data-editable\": V(s).edit,\n contenteditable: V(s).edit,\n tabindex: e.tabIndex,\n spellcheck: !1,\n style: xe(h.value),\n class: ae([\"atable-cell\", b.value]),\n onFocus: m,\n onPaste: T,\n onInput: _[0] || (_[0] = //@ts-ignore\n (...U) => V(R) && V(R)(...U)),\n onClick: I\n }, [\n V(s).cellComponent ? (w(), pe(We(V(s).cellComponent), vt({\n key: 0,\n value: c.value\n }, V(s).cellComponentProps), null, 16, [\"value\"])) : p.value ? (w(), k(\"span\", {\n key: 1,\n innerHTML: c.value\n }, null, 8, po)) : (w(), k(\"span\", mo, K(c.value), 1))\n ], 46, vo));\n }\n}), go = [\"tabindex\"], wo = [\"tabindex\"], yo = [\"colspan\"], xo = /* @__PURE__ */ te({\n __name: \"AExpansionRow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: () => wt }\n },\n setup(e) {\n const t = fe(\"rowEl\"), n = $(() => e.store.display[e.rowIndex].expanded ? \"▼\" : \"►\");\n if (e.addNavigation) {\n const o = {\n \"keydown.control.g\": (a) => {\n a.stopPropagation(), a.preventDefault(), e.store.toggleRowExpand(e.rowIndex);\n }\n };\n typeof e.addNavigation == \"object\" && Object.assign(o, e.addNavigation), Ot([\n {\n selectors: t,\n handlers: o\n }\n ]);\n }\n return (o, a) => (w(), k(ue, null, [\n y(\"tr\", vt(o.$attrs, {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"expandable-row\"\n }), [\n y(\"td\", {\n tabIndex: -1,\n class: \"row-index\",\n onClick: a[0] || (a[0] = (r) => e.store.toggleRowExpand(e.rowIndex))\n }, K(n.value), 1),\n he(o.$slots, \"row\", {}, void 0, !0)\n ], 16, go),\n e.store.display[e.rowIndex].expanded ? (w(), k(\"tr\", {\n key: 0,\n ref: \"rowExpanded\",\n tabindex: e.tabIndex,\n class: \"expanded-row\"\n }, [\n y(\"td\", {\n tabIndex: -1,\n colspan: e.store.columns.length + 1,\n class: \"expanded-row-content\"\n }, [\n he(o.$slots, \"content\", {}, void 0, !0)\n ], 8, yo)\n ], 8, wo)) : q(\"\", !0)\n ], 64));\n }\n}), Ve = (e, t) => {\n const n = e.__vccOpts || e;\n for (const [o, a] of t)\n n[o] = a;\n return n;\n}, bo = /* @__PURE__ */ Ve(xo, [[\"__scopeId\", \"data-v-a42297c7\"]]), Io = [\"colspan\"], ko = {\n ref: \"container\",\n class: \"gantt-container\"\n}, Mo = [\"data-rowindex\", \"data-colindex\"], Co = {\n key: 2,\n class: \"gantt-label\"\n}, Eo = [\"x1\", \"y1\", \"x2\", \"y2\"], Ao = /* @__PURE__ */ te({\n __name: \"AGanttCell\",\n props: {\n store: {},\n columnsCount: {},\n rowIndex: {},\n colIndex: {},\n start: { default: 0 },\n end: { default: 0 },\n colspan: { default: 1 },\n label: { default: \"\" },\n color: { default: \"#cccccc\" }\n },\n emits: [\"connection:create\"],\n setup(e, { expose: t, emit: n }) {\n En((O) => ({\n v6d722296: a.value,\n v260b36f8: O.colspan\n }));\n const o = n, a = L(e.color.length >= 6 ? e.color : \"#cccccc\"), r = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, s = fe(\"container\"), l = fe(\"bar\"), i = fe(\"leftResizeHandle\"), u = fe(\"rightResizeHandle\"), c = fe(\"leftConnectionHandle\"), p = fe(\"rightConnectionHandle\"), { width: h } = Pe(s), { left: b, right: I } = Pe(l), x = L(e.start), f = L(e.end || x.value + e.colspan), m = L(!1), g = L(!1), C = L(!1), T = L(!1), R = L(!1), S = L({ startX: 0, startY: 0, endX: 0, endY: 0 }), _ = $(() => Be.value || ge.value || de.value), U = $(() => e.colspan > 0 ? h.value / e.colspan : 0), ve = $(() => {\n const O = x.value / e.colspan * 100, B = f.value / e.colspan * 100;\n return {\n left: `${O}%`,\n width: `${B - O}%`,\n backgroundColor: a.value\n };\n }), Y = $(\n () => ({\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100vw\",\n height: \"100vh\",\n pointerEvents: \"none\",\n zIndex: 1e3\n })\n ), X = L({ startX: 0, startPos: 0 }), { isDragging: ge } = yt(i, {\n axis: \"x\",\n onStart: () => Re(b.value, x.value),\n onMove: ({ x: O }) => Xe(O),\n onEnd: ({ x: O }) => je(O)\n }), { isDragging: de } = yt(u, {\n axis: \"x\",\n onStart: () => Re(I.value, f.value),\n onMove: ({ x: O }) => Fe(O),\n onEnd: ({ x: O }) => Je(O)\n }), { isDragging: Be } = yt(l, {\n exact: !0,\n axis: \"x\",\n onStart: () => Re(b.value, x.value),\n onMove: ({ x: O }) => Ze(O),\n onEnd: ({ x: O }) => D(O)\n });\n Ee(() => {\n F();\n }), An(() => {\n W();\n });\n function Re(O, B) {\n l.value && (l.value.style.transition = \"none\"), X.value = { startX: O, startPos: B };\n }\n function Xe(O) {\n if (!ge.value || !l.value) return;\n const B = (O - X.value.startX) / U.value, G = Math.max(0, Math.min(f.value - 1, X.value.startPos + B));\n l.value.style.left = `${G / e.colspan * 100}%`, l.value.style.width = `${(f.value - G) / e.colspan * 100}%`;\n }\n function je(O) {\n if (!l.value) return;\n const B = O - X.value.startX, G = Math.round(B / U.value), Q = x.value, ne = Math.max(0, Math.min(f.value - 1, X.value.startPos + G));\n x.value = ne, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"start\",\n oldStart: Q,\n newStart: ne,\n end: f.value,\n delta: G,\n oldColspan: f.value - Q,\n newColspan: f.value - ne\n });\n }\n function Fe(O) {\n if (!de.value || !l.value) return;\n const B = (O - X.value.startX) / U.value, G = Math.max(x.value + 1, Math.min(e.columnsCount, X.value.startPos + B));\n l.value.style.width = `${(G - x.value) / e.colspan * 100}%`;\n }\n function Je(O) {\n if (!l.value) return;\n const B = O - X.value.startX, G = Math.round(B / U.value), Q = f.value, ne = Math.max(x.value + 1, Math.min(e.columnsCount, X.value.startPos + G));\n f.value = ne, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"end\",\n oldEnd: Q,\n newEnd: ne,\n start: x.value,\n delta: G,\n oldColspan: Q - x.value,\n newColspan: ne - x.value\n });\n }\n function Ze(O) {\n if (!Be.value || !l.value) return;\n const B = (O - X.value.startX) / U.value, G = f.value - x.value, Q = Math.max(0, Math.min(X.value.startPos + B, e.columnsCount - G));\n l.value.style.left = `${Q / e.colspan * 100}%`;\n }\n function D(O) {\n if (!l.value) return;\n const B = O - X.value.startX, G = Math.round(B / U.value), Q = f.value - x.value, ne = x.value, ee = f.value;\n let re = X.value.startPos + G, ce = re + Q;\n re < 0 ? (re = 0, ce = Q) : ce > e.columnsCount && (ce = e.columnsCount, re = ce - Q), x.value = re, f.value = ce, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"bar\",\n oldStart: ne,\n oldEnd: ee,\n newStart: re,\n newEnd: ce,\n delta: G,\n colspan: ce - re\n });\n }\n function F() {\n const { x: O, y: B } = Pe(l), { x: G, y: Q } = Pe(c), { x: ne, y: ee } = Pe(p);\n e.store.registerGanttBar({\n id: r,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n startIndex: x,\n endIndex: f,\n color: a,\n label: e.label,\n position: { x: O, y: B }\n }), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({\n id: `${r}-connection-left`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"left\",\n position: { x: G, y: Q },\n visible: m,\n barId: r\n }), e.store.registerConnectionHandle({\n id: `${r}-connection-right`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"right\",\n position: { x: ne, y: ee },\n visible: g,\n barId: r\n }));\n }\n function W() {\n e.store.unregisterGanttBar(r), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${r}-connection-left`), e.store.unregisterConnectionHandle(`${r}-connection-right`));\n }\n function j() {\n e.store.isDependencyGraphEnabled && (m.value = !0, g.value = !0);\n }\n function z() {\n !C.value && !T.value && (m.value = !1, g.value = !1);\n }\n function se(O, B) {\n B.preventDefault(), B.stopPropagation(), R.value = !0, O === \"left\" ? C.value = !0 : T.value = !0;\n const G = O === \"left\" ? c.value : p.value;\n if (G) {\n const ee = G.getBoundingClientRect(), re = ee.left + ee.width / 2, ce = ee.top + ee.height / 2;\n S.value = { startX: re, startY: ce, endX: re, endY: ce };\n }\n const Q = (ee) => {\n S.value.endX = ee.clientX, S.value.endY = ee.clientY;\n }, ne = (ee) => {\n be(ee, O), Le(Q, ne);\n };\n document.addEventListener(\"mousemove\", Q), document.addEventListener(\"mouseup\", ne);\n }\n function be(O, B) {\n const G = document.elementFromPoint(O.clientX, O.clientY)?.closest(\".connection-handle\");\n if (G && G !== (B === \"left\" ? c.value : p.value)) {\n const Q = G.closest(\".gantt-bar\");\n if (Q) {\n const ne = parseInt(Q.getAttribute(\"data-rowindex\") || \"0\"), ee = parseInt(Q.getAttribute(\"data-colindex\") || \"0\"), re = G.classList.contains(\"left-connection-handle\") ? \"left\" : \"right\", ce = `gantt-bar-row-${ne}-col-${ee}`, d = e.store.createConnection(\n `${r}-connection-${B}`,\n `${ce}-connection-${re}`\n );\n d && o(\"connection:create\", d);\n }\n }\n }\n function Le(O, B) {\n R.value = !1, C.value = !1, T.value = !1, document.removeEventListener(\"mousemove\", O), document.removeEventListener(\"mouseup\", B), l.value?.matches(\":hover\") || z();\n }\n return t({\n barStyle: ve,\n cleanupConnectionDrag: Le,\n currentEnd: f,\n handleConnectionDrop: be,\n isLeftConnectionDragging: C,\n isLeftConnectionVisible: m,\n isRightConnectionDragging: T,\n isRightConnectionVisible: g,\n showDragPreview: R\n }), (O, B) => (w(), k(\"td\", {\n class: \"aganttcell\",\n colspan: e.colspan\n }, [\n y(\"div\", ko, [\n y(\"div\", {\n ref: \"bar\",\n \"data-rowindex\": e.rowIndex,\n \"data-colindex\": e.colIndex,\n class: ae([\"gantt-bar\", { \"is-dragging\": _.value }]),\n style: xe(ve.value),\n onMouseenter: j,\n onMouseleave: z\n }, [\n e.store.isDependencyGraphEnabled ? (w(), k(\"div\", {\n key: 0,\n ref: \"leftConnectionHandle\",\n class: ae([\"connection-handle left-connection-handle\", { visible: m.value, \"is-dragging\": C.value }]),\n onMousedown: B[0] || (B[0] = Ie((G) => se(\"left\", G), [\"stop\"]))\n }, [...B[2] || (B[2] = [\n y(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : q(\"\", !0),\n e.store.isDependencyGraphEnabled ? (w(), k(\"div\", {\n key: 1,\n ref: \"rightConnectionHandle\",\n class: ae([\"connection-handle right-connection-handle\", { visible: g.value, \"is-dragging\": T.value }]),\n onMousedown: B[1] || (B[1] = Ie((G) => se(\"right\", G), [\"stop\"]))\n }, [...B[3] || (B[3] = [\n y(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : q(\"\", !0),\n y(\"div\", {\n ref: \"leftResizeHandle\",\n class: ae([\"resize-handle left-resize-handle\", { \"is-dragging\": V(ge) }])\n }, [...B[4] || (B[4] = [\n y(\"div\", { class: \"handle-grip\" }, null, -1),\n y(\"div\", { class: \"vertical-indicator left-indicator\" }, null, -1)\n ])], 2),\n e.label ? (w(), k(\"label\", Co, K(e.label), 1)) : q(\"\", !0),\n y(\"div\", {\n ref: \"rightResizeHandle\",\n class: ae([\"resize-handle right-resize-handle\", { \"is-dragging\": V(de) }])\n }, [...B[5] || (B[5] = [\n y(\"div\", { class: \"handle-grip\" }, null, -1),\n y(\"div\", { class: \"vertical-indicator right-indicator\" }, null, -1)\n ])], 2)\n ], 46, Mo)\n ], 512),\n e.store.isDependencyGraphEnabled && R.value ? (w(), k(\"svg\", {\n key: 0,\n style: xe(Y.value)\n }, [\n y(\"line\", {\n x1: S.value.startX,\n y1: S.value.startY,\n x2: S.value.endX,\n y2: S.value.endY,\n stroke: \"#2196f3\",\n \"stroke-width\": \"2\",\n \"stroke-dasharray\": \"5,5\"\n }, null, 8, Eo)\n ], 4)) : q(\"\", !0)\n ], 8, Io));\n }\n}), To = /* @__PURE__ */ Ve(Ao, [[\"__scopeId\", \"data-v-8917a8a3\"]]), $o = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"34 18 30 18 30 30 18 30 18 34 30 34 30 46 34 46 34 34 46 34 46 30 34 30 34 18\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>\n`, Do = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"46.84 19.99 44.01 17.16 32 29.17 19.99 17.16 17.16 19.99 29.17 32 17.16 44.01 19.99 46.84 32 34.83 44.01 46.84 46.84 44.01 34.83 32 46.84 19.99\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, So = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.67\">\n <path d=\"M68.67,16.67h-14.67V2c0-1.1-.9-2-2-2H2C.9,0,0,.9,0,2v50c0,1.1.9,2,2,2h14.67v14.67c0,1.1.9,2,2,2h50c1.1,0,2-.9,2-2V18.67c0-1.1-.9-2-2-2ZM4,4h46v46H4V4ZM66.67,66.67H20.67v-12.67h31.33c1.1,0,2-.9,2-2v-31.33h12.67v46Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"41 25 29 25 29 13 25 13 25 25 13 25 13 29 25 29 25 41 29 41 29 29 41 29 41 25\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Ro = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <path d=\"M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z\"/>\n <g>\n <polygon points=\"70.6 2.5 68.6 2.5 68.6 2 68.1 2 68.1 0 70.6 0 70.6 2.5\"/>\n <path d=\"M65.3,2h-2.9V0h2.9v2ZM59.6,2h-2.9V0h2.9v2ZM53.9,2h-2.9V0h2.9v2ZM48.2,2h-2.9V0h2.9v2ZM42.4,2h-2.9V0h2.9v2ZM36.7,2h-2.9V0h2.9v2ZM31,2h-2.9V0h2.9v2ZM25.3,2h-2.9V0h2.9v2ZM19.6,2h-2.9V0h2.9v2ZM13.9,2h-2.9V0h2.9v2ZM8.2,2h-2.9V0h2.9v2Z\"/>\n <polygon points=\"2 2.5 0 2.5 0 0 2.5 0 2.5 2 2 2 2 2.5\"/>\n <path d=\"M2,13.4H0v-2.7h2v2.7ZM2,8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 18.7 0 18.7 0 16.2 2 16.2 2 16.7 2.5 16.7 2.5 18.7\"/>\n <path d=\"M65.3,18.7h-2.9v-2h2.9v2ZM59.6,18.7h-2.9v-2h2.9v2ZM53.9,18.7h-2.9v-2h2.9v2ZM48.2,18.7h-2.9v-2h2.9v2ZM42.4,18.7h-2.9v-2h2.9v2ZM36.7,18.7h-2.9v-2h2.9v2ZM31,18.7h-2.9v-2h2.9v2ZM25.3,18.7h-2.9v-2h2.9v2ZM19.6,18.7h-2.9v-2h2.9v2ZM13.9,18.7h-2.9v-2h2.9v2ZM8.2,18.7h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 18.7 68.1 18.7 68.1 16.7 68.6 16.7 68.6 16.2 70.6 16.2 70.6 18.7\"/>\n <path d=\"M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z\"/>\n </g>\n</svg>`, Lo = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <g>\n <polygon points=\"70.6 45.3 68.6 45.3 68.6 44.8 68.1 44.8 68.1 42.8 70.6 42.8 70.6 45.3\"/>\n <path d=\"M65.3,44.8h-2.9v-2h2.9v2ZM59.6,44.8h-2.9v-2h2.9v2ZM53.9,44.8h-2.9v-2h2.9v2ZM48.2,44.8h-2.9v-2h2.9v2ZM42.4,44.8h-2.9v-2h2.9v2ZM36.7,44.8h-2.9v-2h2.9v2ZM31,44.8h-2.9v-2h2.9v2ZM25.3,44.8h-2.9v-2h2.9v2ZM19.6,44.8h-2.9v-2h2.9v2ZM13.9,44.8h-2.9v-2h2.9v2ZM8.2,44.8h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"2 45.3 0 45.3 0 42.8 2.5 42.8 2.5 44.8 2 44.8 2 45.3\"/>\n <path d=\"M2,56.3H0v-2.7h2v2.7ZM2,50.8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 61.5 0 61.5 0 59 2 59 2 59.5 2.5 59.5 2.5 61.5\"/>\n <path d=\"M65.3,61.5h-2.9v-2h2.9v2ZM59.6,61.5h-2.9v-2h2.9v2ZM53.9,61.5h-2.9v-2h2.9v2ZM48.2,61.5h-2.9v-2h2.9v2ZM42.4,61.5h-2.9v-2h2.9v2ZM36.7,61.5h-2.9v-2h2.9v2ZM31,61.5h-2.9v-2h2.9v2ZM25.3,61.5h-2.9v-2h2.9v2ZM19.6,61.5h-2.9v-2h2.9v2ZM13.9,61.5h-2.9v-2h2.9v2ZM8.2,61.5h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 61.5 68.1 61.5 68.1 59.5 68.6 59.5 68.6 59 70.6 59 70.6 61.5\"/>\n <path d=\"M70.6,56.3h-2v-2.7h2v2.7ZM70.6,50.8h-2v-2.7h2v2.7Z\"/>\n </g>\n <path d=\"M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z\"/>\n</svg>`, Ho = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.64\">\n <path d=\"M70.08,33.9l-9.75-9.75-2.83,2.83,6.33,6.33h-26.51V6.81l6.33,6.33,2.83-2.83L36.75.56c-.75-.75-2.08-.75-2.83,0l-9.75,9.75,2.83,2.83,6.33-6.33v26.5H6.83l6.33-6.33-2.83-2.83L.59,33.9c-.38.38-.59.88-.59,1.41s.21,1.04.59,1.41l9.75,9.75,2.83-2.83-6.33-6.33h26.5v26.51l-6.33-6.33-2.83,2.83,9.75,9.75c.38.38.88.59,1.41.59s1.04-.21,1.41-.59l9.75-9.75-2.83-2.83-6.33,6.33v-26.51h26.51l-6.33,6.33,2.83,2.83,9.75-9.75c.38-.38.59-.88.59-1.41s-.21-1.04-.59-1.41Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Vo = {\n add: $o,\n delete: Do,\n duplicate: So,\n insertAbove: Ro,\n insertBelow: Lo,\n move: Ho\n}, Po = {\n key: 0,\n class: \"row-actions-dropdown\"\n}, Oo = [\"aria-expanded\"], _o = [\"onClick\"], Bo = [\"innerHTML\"], Fo = { class: \"action-label\" }, Zo = {\n key: 1,\n class: \"row-actions-icons\"\n}, No = [\"title\", \"aria-label\", \"onClick\"], Uo = [\"innerHTML\"], ut = /* @__PURE__ */ te({\n __name: \"ARowActions\",\n props: {\n rowIndex: {},\n store: {},\n config: {},\n position: {}\n },\n emits: [\"action\"],\n setup(e, { emit: t }) {\n const n = e, o = t, a = fe(\"actionsCell\"), r = fe(\"toggleButton\"), s = L(0), l = L(!1), i = L(!1), u = L({ top: 0, left: 0 }), c = {\n add: \"Add Row\",\n delete: \"Delete Row\",\n duplicate: \"Duplicate Row\",\n insertAbove: \"Insert Above\",\n insertBelow: \"Insert Below\",\n move: \"Move Row\"\n }, p = $(() => {\n const m = [], g = n.config.actions || {}, C = [\"add\", \"delete\", \"duplicate\", \"insertAbove\", \"insertBelow\", \"move\"];\n for (const T of C) {\n const R = g[T];\n if (R === !1 || R === void 0) continue;\n let S = !0, _ = c[T], U = Vo[T];\n typeof R == \"object\" && (S = R.enabled !== !1, _ = R.label || _, U = R.icon || U), S && m.push({ type: T, label: _, icon: U });\n }\n return m;\n }), h = $(() => {\n if (n.config.forceDropdown) return !0;\n const m = n.config.dropdownThreshold ?? 150;\n return m === 0 ? !1 : s.value > 0 && s.value < m;\n }), b = $(() => l.value ? i.value ? {\n position: \"fixed\",\n bottom: `${window.innerHeight - u.value.top}px`,\n left: `${u.value.left}px`,\n top: \"auto\"\n } : {\n position: \"fixed\",\n top: `${u.value.top}px`,\n left: `${u.value.left}px`\n } : {});\n ft(a, (m) => {\n const g = m[0];\n g && (s.value = g.contentRect.width);\n });\n const I = () => {\n l.value || x(), l.value = !l.value;\n }, x = () => {\n if (!r.value) return;\n const m = r.value.getBoundingClientRect(), g = window.innerHeight, C = p.value.length * 40 + 16, T = g - m.bottom, R = m.top;\n i.value = T < C && R > C, i.value ? u.value = {\n top: m.top,\n left: m.left\n } : u.value = {\n top: m.bottom,\n left: m.left\n };\n };\n $t(a, () => {\n l.value = !1;\n });\n const f = (m) => {\n l.value = !1;\n const g = n.config.actions?.[m];\n typeof g == \"object\" && g.handler && g.handler(n.rowIndex, n.store) === !1 || o(\"action\", m, n.rowIndex);\n };\n return (m, g) => (w(), k(\"td\", {\n ref: \"actionsCell\",\n class: ae([\"atable-row-actions\", { \"sticky-column\": e.position === \"before-index\", \"dropdown-active\": l.value }])\n }, [\n h.value ? (w(), k(\"div\", Po, [\n y(\"button\", {\n ref: \"toggleButton\",\n type: \"button\",\n class: \"row-actions-toggle\",\n \"aria-expanded\": l.value,\n \"aria-haspopup\": \"true\",\n onClick: Ie(I, [\"stop\"])\n }, [...g[0] || (g[0] = [\n y(\"span\", { class: \"dropdown-icon\" }, \"⋮\", -1)\n ])], 8, Oo),\n J(y(\"div\", {\n class: ae([\"row-actions-menu\", { \"menu-flipped\": i.value }]),\n style: xe(b.value),\n role: \"menu\"\n }, [\n (w(!0), k(ue, null, me(p.value, (C) => (w(), k(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-menu-item\",\n role: \"menuitem\",\n onClick: Ie((T) => f(C.type), [\"stop\"])\n }, [\n y(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, Bo),\n y(\"span\", Fo, K(C.label), 1)\n ], 8, _o))), 128))\n ], 6), [\n [Ce, l.value]\n ])\n ])) : (w(), k(\"div\", Zo, [\n (w(!0), k(ue, null, me(p.value, (C) => (w(), k(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-btn\",\n title: C.label,\n \"aria-label\": C.label,\n onClick: Ie((T) => f(C.type), [\"stop\"])\n }, [\n y(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, Uo)\n ], 8, No))), 128))\n ]))\n ], 2));\n }\n}), Wo = [\"tabindex\"], Go = /* @__PURE__ */ te({\n __name: \"ARow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: !1 }\n },\n emits: [\"row:action\"],\n setup(e, { emit: t }) {\n const n = t, o = fe(\"rowEl\"), a = $(() => e.store.isRowVisible(e.rowIndex)), r = $(() => e.store.getRowExpandSymbol(e.rowIndex)), s = $(() => e.store.config.rowActions || { enabled: !1 }), l = $(() => s.value.enabled), i = $(() => s.value.position || \"before-index\"), u = (c, p) => {\n n(\"row:action\", c, p);\n };\n if (e.addNavigation) {\n let c = wt;\n typeof e.addNavigation == \"object\" && (c = {\n ...c,\n ...e.addNavigation\n }), Ot([\n {\n selectors: o,\n handlers: c\n }\n ]);\n }\n return (c, p) => J((w(), k(\"tr\", {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"atable-row\"\n }, [\n l.value && i.value === \"before-index\" ? (w(), pe(ut, {\n key: 0,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: i.value,\n onAction: u\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : q(\"\", !0),\n e.store.config.view !== \"uncounted\" ? he(c.$slots, \"index\", { key: 1 }, () => [\n e.store.config.view === \"list\" ? (w(), k(\"td\", {\n key: 0,\n tabIndex: -1,\n class: ae([\"list-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"])\n }, K(e.rowIndex + 1), 3)) : e.store.isTreeView ? (w(), k(\"td\", {\n key: 1,\n tabIndex: -1,\n class: ae([\"tree-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"]),\n onClick: p[0] || (p[0] = (h) => e.store.toggleRowExpand(e.rowIndex))\n }, K(r.value), 3)) : q(\"\", !0)\n ], !0) : q(\"\", !0),\n l.value && i.value === \"after-index\" ? (w(), pe(ut, {\n key: 2,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: i.value,\n onAction: u\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : q(\"\", !0),\n he(c.$slots, \"default\", {}, void 0, !0),\n l.value && i.value === \"end\" ? (w(), pe(ut, {\n key: 3,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: i.value,\n onAction: u\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : q(\"\", !0)\n ], 8, Wo)), [\n [Ce, a.value]\n ]);\n }\n}), hn = /* @__PURE__ */ Ve(Go, [[\"__scopeId\", \"data-v-2e038a9c\"]]), It = /* @__PURE__ */ new WeakMap(), zo = {\n mounted(e, t) {\n const n = !t.modifiers.bubble;\n let o;\n if (typeof t.value == \"function\") o = $t(e, t.value, { capture: n });\n else {\n const [a, r] = t.value;\n o = $t(e, a, Object.assign({ capture: n }, r));\n }\n It.set(e, o);\n },\n unmounted(e) {\n const t = It.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), It.delete(e);\n }\n}, qo = { mounted(e, t) {\n typeof t.value == \"function\" ? ft(e, t.value) : ft(e, ...t.value);\n} };\nfunction Yo() {\n let e = !1;\n const t = ie(!1);\n return (n, o) => {\n if (t.value = o.value, e) return;\n e = !0;\n const a = uo(n, o.value);\n oe(t, (r) => a.value = r);\n };\n}\nYo();\nconst Xo = { class: \"gantt-connection-overlay\" }, jo = {\n class: \"connection-svg\",\n style: {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n pointerEvents: \"none\",\n zIndex: 1\n }\n}, Jo = [\"d\", \"stroke-width\", \"onDblclick\"], Qo = [\"id\", \"d\", \"stroke\", \"stroke-width\", \"onDblclick\"], Ko = 0.25, at = 16, el = /* @__PURE__ */ te({\n __name: \"AGanttConnection\",\n props: {\n store: {}\n },\n emits: [\"connection:delete\"],\n setup(e, { emit: t }) {\n const n = t, o = $(() => e.store.connectionPaths.filter((s) => {\n const l = e.store.ganttBars.find((u) => u.id === s.from.barId), i = e.store.ganttBars.find((u) => u.id === s.to.barId);\n return l && i;\n })), a = (s) => {\n const l = e.store.connectionHandles.find(\n (_) => _.barId === s.from.barId && _.side === s.from.side\n ), i = e.store.connectionHandles.find(\n (_) => _.barId === s.to.barId && _.side === s.to.side\n );\n if (!l || !i) return \"\";\n const u = l.position.x + at / 2, c = l.position.y + at / 2, p = i.position.x + at / 2, h = i.position.y + at / 2, b = Math.abs(p - u), I = Math.max(b * Ko, 50), x = u + (s.from.side === \"left\" ? -I : I), f = p + (s.to.side === \"left\" ? -I : I), m = { x: 0.5 * u + 0.5 * x, y: 0.5 * c + 0.5 * c }, g = { x: 0.5 * x + 0.5 * f, y: 0.5 * c + 0.5 * h }, C = { x: 0.5 * f + 0.5 * p, y: 0.5 * h + 0.5 * h }, T = { x: 0.5 * m.x + 0.5 * g.x, y: 0.5 * m.y + 0.5 * g.y }, R = { x: 0.5 * g.x + 0.5 * C.x, y: 0.5 * g.y + 0.5 * C.y }, S = { x: 0.5 * T.x + 0.5 * R.x, y: 0.5 * T.y + 0.5 * R.y };\n return `M ${u} ${c} Q ${x} ${c}, ${S.x} ${S.y} Q ${f} ${h}, ${p} ${h}`;\n }, r = (s) => {\n e.store.deleteConnection(s.id) && n(\"connection:delete\", s);\n };\n return (s, l) => (w(), k(\"div\", Xo, [\n (w(), k(\"svg\", jo, [\n l[0] || (l[0] = y(\"defs\", null, [\n y(\"path\", {\n id: \"arrowhead\",\n d: \"M 0 -7 L 20 0 L 0 7Z\",\n stroke: \"black\",\n \"stroke-width\": \"1\",\n fill: \"currentColor\"\n }),\n y(\"marker\", {\n id: \"arrowhead-marker\",\n markerWidth: \"10\",\n markerHeight: \"7\",\n refX: \"5\",\n refY: \"3.5\",\n orient: \"auto\",\n markerUnits: \"strokeWidth\"\n }, [\n y(\"polygon\", {\n points: \"0 0, 10 3.5, 0 7\",\n fill: \"currentColor\"\n })\n ])\n ], -1)),\n (w(!0), k(ue, null, me(o.value, (i) => (w(), k(\"path\", {\n key: `${i.id}-hitbox`,\n d: a(i),\n stroke: \"transparent\",\n \"stroke-width\": (i.style?.width || 2) + 10,\n fill: \"none\",\n class: \"connection-hitbox\",\n onDblclick: (u) => r(i)\n }, null, 40, Jo))), 128)),\n (w(!0), k(ue, null, me(o.value, (i) => (w(), k(\"path\", {\n id: i.id,\n key: i.id,\n d: a(i),\n stroke: i.style?.color || \"#666\",\n \"stroke-width\": i.style?.width || 2,\n fill: \"none\",\n \"marker-mid\": \"url(#arrowhead-marker)\",\n class: \"connection-path animated-path\",\n onDblclick: (u) => r(i)\n }, null, 40, Qo))), 128))\n ]))\n ]));\n }\n}), tl = /* @__PURE__ */ Ve(el, [[\"__scopeId\", \"data-v-71911260\"]]), nl = { class: \"column-filter\" }, ol = {\n key: 2,\n class: \"checkbox-filter\"\n}, ll = [\"value\"], al = {\n key: 5,\n class: \"date-range-filter\"\n}, sl = /* @__PURE__ */ te({\n __name: \"ATableColumnFilter\",\n props: {\n column: {},\n colIndex: {},\n store: {}\n },\n setup(e) {\n const t = L(\"\"), n = rn({\n startValue: \"\",\n endValue: \"\"\n }), o = (i) => {\n if (i.filterOptions) return i.filterOptions;\n const u = /* @__PURE__ */ new Set();\n return e.store.rows.forEach((c) => {\n const p = c[i.name];\n p != null && p !== \"\" && u.add(p);\n }), Array.from(u).map((c) => ({\n value: c,\n label: String(c)\n }));\n }, a = $(() => !!(t.value || n.startValue || n.endValue)), r = (i) => {\n !i && e.column.filterType !== \"checkbox\" ? (e.store.clearFilter(e.colIndex), t.value = \"\") : (t.value = i, e.store.setFilter(e.colIndex, { value: i }));\n }, s = (i, u) => {\n i === \"start\" ? n.startValue = u : n.endValue = u, !n.startValue && !n.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {\n value: null,\n startValue: n.startValue,\n endValue: n.endValue\n });\n }, l = () => {\n t.value = \"\", n.startValue = \"\", n.endValue = \"\", e.store.clearFilter(e.colIndex);\n };\n return (i, u) => (w(), k(\"div\", nl, [\n (e.column.filterType || \"text\") === \"text\" ? J((w(), k(\"input\", {\n key: 0,\n \"onUpdate:modelValue\": u[0] || (u[0] = (c) => t.value = c),\n type: \"text\",\n class: \"filter-input\",\n onInput: u[1] || (u[1] = (c) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"number\" ? J((w(), k(\"input\", {\n key: 1,\n \"onUpdate:modelValue\": u[2] || (u[2] = (c) => t.value = c),\n type: \"number\",\n class: \"filter-input\",\n onInput: u[3] || (u[3] = (c) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"checkbox\" ? (w(), k(\"label\", ol, [\n J(y(\"input\", {\n \"onUpdate:modelValue\": u[4] || (u[4] = (c) => t.value = c),\n type: \"checkbox\",\n class: \"filter-checkbox\",\n onChange: u[5] || (u[5] = (c) => r(t.value))\n }, null, 544), [\n [un, t.value]\n ]),\n y(\"span\", null, K(e.column.label), 1)\n ])) : e.column.filterType === \"select\" ? J((w(), k(\"select\", {\n key: 3,\n \"onUpdate:modelValue\": u[6] || (u[6] = (c) => t.value = c),\n class: \"filter-select\",\n onChange: u[7] || (u[7] = (c) => r(t.value))\n }, [\n u[15] || (u[15] = y(\"option\", { value: \"\" }, \"All\", -1)),\n (w(!0), k(ue, null, me(o(e.column), (c) => (w(), k(\"option\", {\n key: c.value || c,\n value: c.value || c\n }, K(c.label || c), 9, ll))), 128))\n ], 544)), [\n [Cn, t.value]\n ]) : e.column.filterType === \"date\" ? J((w(), k(\"input\", {\n key: 4,\n \"onUpdate:modelValue\": u[8] || (u[8] = (c) => t.value = c),\n type: \"date\",\n class: \"filter-input\",\n onChange: u[9] || (u[9] = (c) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"dateRange\" ? (w(), k(\"div\", al, [\n J(y(\"input\", {\n \"onUpdate:modelValue\": u[10] || (u[10] = (c) => n.startValue = c),\n type: \"date\",\n class: \"filter-input\",\n onChange: u[11] || (u[11] = (c) => s(\"start\", n.startValue))\n }, null, 544), [\n [we, n.startValue]\n ]),\n u[16] || (u[16] = y(\"span\", { class: \"date-separator\" }, \"-\", -1)),\n J(y(\"input\", {\n \"onUpdate:modelValue\": u[12] || (u[12] = (c) => n.endValue = c),\n type: \"date\",\n class: \"filter-input\",\n onChange: u[13] || (u[13] = (c) => s(\"end\", n.endValue))\n }, null, 544), [\n [we, n.endValue]\n ])\n ])) : e.column.filterType === \"component\" && e.column.filterComponent ? (w(), pe(We(e.column.filterComponent), {\n key: 6,\n value: t.value,\n column: e.column,\n colIndex: e.colIndex,\n store: e.store,\n \"onUpdate:value\": u[14] || (u[14] = (c) => r(c))\n }, null, 40, [\"value\", \"column\", \"colIndex\", \"store\"])) : q(\"\", !0),\n a.value ? (w(), k(\"button\", {\n key: 7,\n onClick: l,\n class: \"clear-btn\",\n title: \"Clear\"\n }, \"×\")) : q(\"\", !0)\n ]));\n }\n}), rl = /* @__PURE__ */ Ve(sl, [[\"__scopeId\", \"data-v-8487462d\"]]), il = { key: 0 }, ul = {\n class: \"atable-header-row\",\n tabindex: \"-1\"\n}, cl = {\n key: 2,\n class: \"row-actions-header\"\n}, dl = [\"data-colindex\", \"onClick\"], fl = {\n key: 3,\n class: \"row-actions-header\"\n}, vl = {\n key: 0,\n class: \"atable-filters-row\"\n}, pl = {\n key: 2,\n class: \"row-actions-header\"\n}, ml = {\n key: 3,\n class: \"row-actions-header\"\n}, gn = /* @__PURE__ */ te({\n __name: \"ATableHeader\",\n props: {\n columns: {},\n store: {}\n },\n setup(e) {\n const t = e, n = $(() => t.columns.filter((l) => l.filterable)), o = $(() => t.store.config.value?.rowActions?.enabled ?? !1), a = $(() => t.store.config.value?.rowActions?.position ?? \"before-index\"), r = (l) => t.store.sortByColumn(l), s = (l) => {\n for (const i of l) {\n if (i.borderBoxSize.length === 0) continue;\n const u = i.borderBoxSize[0].inlineSize, c = Number(i.target.dataset.colindex), p = t.store.columns[c]?.width;\n typeof p == \"number\" && p !== u && t.store.resizeColumn(c, u);\n }\n };\n return (l, i) => t.columns.length ? (w(), k(\"thead\", il, [\n y(\"tr\", ul, [\n o.value && a.value === \"before-index\" ? (w(), k(\"th\", {\n key: 0,\n class: ae([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : q(\"\", !0),\n t.store.zeroColumn ? (w(), k(\"th\", {\n key: 1,\n id: \"header-index\",\n class: ae([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : q(\"\", !0),\n o.value && a.value === \"after-index\" ? (w(), k(\"th\", cl)) : q(\"\", !0),\n (w(!0), k(ue, null, me(t.columns, (u, c) => J((w(), k(\"th\", {\n key: u.name,\n \"data-colindex\": c,\n tabindex: \"-1\",\n style: xe(t.store.getHeaderCellStyle(u)),\n class: ae(`${u.pinned ? \"sticky-column\" : \"\"} ${u.sortable === !1 ? \"\" : \"cursor-pointer\"}`),\n onClick: (p) => u.sortable !== !1 ? r(c) : void 0\n }, [\n he(l.$slots, \"default\", {}, () => [\n Dt(K(u.label || String.fromCharCode(c + 97).toUpperCase()), 1)\n ])\n ], 14, dl)), [\n [V(qo), s]\n ])), 128)),\n o.value && a.value === \"end\" ? (w(), k(\"th\", fl)) : q(\"\", !0)\n ]),\n n.value.length > 0 ? (w(), k(\"tr\", vl, [\n o.value && a.value === \"before-index\" ? (w(), k(\"th\", {\n key: 0,\n class: ae([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : q(\"\", !0),\n t.store.zeroColumn ? (w(), k(\"th\", {\n key: 1,\n class: ae([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : q(\"\", !0),\n o.value && a.value === \"after-index\" ? (w(), k(\"th\", pl)) : q(\"\", !0),\n (w(!0), k(ue, null, me(t.columns, (u, c) => (w(), k(\"th\", {\n key: `filter-${u.name}`,\n class: ae(`${u.pinned ? \"sticky-column\" : \"\"}`),\n style: xe(t.store.getHeaderCellStyle(u))\n }, [\n u.filterable ? (w(), pe(rl, {\n key: 0,\n column: u,\n \"col-index\": c,\n store: t.store\n }, null, 8, [\"column\", \"col-index\", \"store\"])) : q(\"\", !0)\n ], 6))), 128)),\n o.value && a.value === \"end\" ? (w(), k(\"th\", ml)) : q(\"\", !0)\n ])) : q(\"\", !0)\n ])) : q(\"\", !0);\n }\n}), wn = /* @__PURE__ */ te({\n __name: \"ATableModal\",\n props: {\n store: {}\n },\n setup(e) {\n const t = fe(\"amodal\"), { width: n, height: o } = Pe(t), a = $(() => {\n if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;\n const r = e.store.modal.cell?.closest(\"table\");\n if (!r) return {};\n const s = r.offsetHeight || 0, l = r.offsetWidth || 0;\n let i = e.store.modal.cell?.offsetTop || 0;\n const u = r.querySelector(\"thead\")?.offsetHeight || 0;\n i += u, i = i + o.value < s ? i : i - (o.value + e.store.modal.height);\n let c = e.store.modal.cell?.offsetLeft || 0;\n return c = c + n.value <= l ? c : c - (n.value - e.store.modal.width), {\n left: `${c}px`,\n top: `${i}px`\n };\n });\n return (r, s) => (w(), k(\"div\", {\n ref: \"amodal\",\n class: \"amodal\",\n tabindex: \"-1\",\n style: xe(a.value),\n onClick: s[0] || (s[0] = Ie(() => {\n }, [\"stop\"])),\n onInput: s[1] || (s[1] = Ie(() => {\n }, [\"stop\"]))\n }, [\n he(r.$slots, \"default\")\n ], 36));\n }\n}), hl = (e) => {\n const t = e.id || fo();\n return Dn(`table-${t}`, () => {\n const n = () => {\n const d = [Object.assign({}, { rowModified: !1 })], v = /* @__PURE__ */ new Set();\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A];\n H.parent !== null && H.parent !== void 0 && v.add(H.parent);\n }\n const M = (A) => a.value[A]?.gantt !== void 0, P = (A) => {\n for (let H = 0; H < a.value.length; H++)\n if (a.value[H].parent === A && (M(H) || P(H)))\n return !0;\n return !1;\n }, Z = (A) => {\n const H = r.value, N = H.view === \"tree\" || H.view === \"tree-gantt\" ? H.defaultTreeExpansion : void 0;\n if (!N) return !0;\n switch (N) {\n case \"root\":\n return !1;\n // Only root nodes are visible, all children start collapsed\n case \"branch\":\n return P(A);\n case \"leaf\":\n return !0;\n // All nodes should be expanded\n default:\n return !0;\n }\n };\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A], N = H.parent === null || H.parent === void 0, le = v.has(A);\n d[A] = {\n childrenOpen: Z(A),\n expanded: !1,\n indent: H.indent || 0,\n isParent: le,\n isRoot: N,\n rowModified: !1,\n open: N,\n // This will be recalculated later for non-root nodes\n parent: H.parent\n };\n }\n return d;\n }, o = L(e.columns), a = L(e.rows), r = L(e.config || {}), s = L({}), l = L({}), i = $(() => {\n const d = {};\n for (const [v, M] of o.value.entries())\n for (const [P, Z] of a.value.entries())\n d[`${v}:${P}`] = Z[M.name];\n return d;\n }), u = $({\n get: () => {\n const d = n();\n for (let v = 0; v < d.length; v++)\n s.value[v] && (d[v].rowModified = s.value[v]), l.value[v] && (l.value[v].childrenOpen !== void 0 && (d[v].childrenOpen = l.value[v].childrenOpen), l.value[v].expanded !== void 0 && (d[v].expanded = l.value[v].expanded));\n if (C.value) {\n const v = (M, P) => {\n const Z = P[M];\n if (Z.isRoot || Z.parent === null || Z.parent === void 0)\n return !0;\n const A = Z.parent;\n return A < 0 || A >= P.length ? !1 : (P[A].childrenOpen || !1) && v(A, P);\n };\n for (let M = 0; M < d.length; M++)\n d[M].isRoot || (d[M].open = v(M, d));\n }\n return d;\n },\n set: (d) => {\n JSON.stringify(d) !== JSON.stringify(u.value) && (u.value = d);\n }\n }), c = L(e.modal || { visible: !1 }), p = L({}), h = L([]), b = L([]), I = L([]), x = L({\n column: null,\n direction: null\n }), f = L({}), m = $(() => o.value.some((d) => d.pinned)), g = $(() => r.value.view === \"gantt\" || r.value.view === \"tree-gantt\"), C = $(() => r.value.view === \"tree\" || r.value.view === \"tree-gantt\"), T = $(() => {\n const d = r.value;\n return d.view === \"gantt\" || d.view === \"tree-gantt\" ? d.dependencyGraph !== !1 : !0;\n }), R = $(() => `${Math.ceil(a.value.length / 100 + 1)}ch`), S = $(\n () => r.value.view ? [\"list\", \"tree\", \"tree-gantt\", \"list-expansion\"].includes(r.value.view) : !1\n ), _ = $(() => {\n let d = a.value.map((v, M) => ({\n ...v,\n originalIndex: M\n }));\n if (Object.entries(f.value).forEach(([v, M]) => {\n const P = parseInt(v), Z = o.value[P];\n !Z || !(M.value || M.startValue || M.endValue || Z.filterType === \"checkbox\" && M.value !== void 0) || (d = d.filter((A) => {\n const H = A[Z.name];\n return ne(H, M, Z);\n }));\n }), x.value.column !== null && x.value.direction) {\n const v = o.value[x.value.column], M = x.value.direction;\n d.sort((P, Z) => {\n let A = P[v.name], H = Z[v.name];\n A == null && (A = \"\"), H == null && (H = \"\");\n const N = Number(A), le = Number(H);\n if (!isNaN(N) && !isNaN(le) && A !== \"\" && H !== \"\")\n return M === \"asc\" ? N - le : le - N;\n {\n const nt = String(A).toLowerCase(), Ut = String(H).toLowerCase();\n return M === \"asc\" ? nt.localeCompare(Ut) : Ut.localeCompare(nt);\n }\n });\n }\n return d;\n }), U = (d, v) => i.value[`${d}:${v}`], ve = (d, v, M) => {\n const P = `${d}:${v}`, Z = o.value[d];\n i.value[P] !== M && (s.value[v] = !0), i.value[P] = M, a.value[v] = {\n ...a.value[v],\n [Z.name]: M\n };\n }, Y = (d) => {\n a.value = d;\n }, X = (d, v, M) => {\n const P = `${d}:${v}`;\n i.value[P] !== M && (s.value[v] = !0, p.value[P] = M);\n }, ge = (d) => {\n const v = o.value.indexOf(d) === o.value.length - 1, M = r.value.fullWidth ? d.resizable && !v : d.resizable;\n return {\n width: d.width || \"40ch\",\n textAlign: d.align || \"center\",\n ...M && {\n resize: \"horizontal\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\"\n }\n };\n }, de = (d, v) => {\n if (d < 0 || d >= o.value.length) return;\n const M = Math.max(v, 40);\n o.value[d] = {\n ...o.value[d],\n width: `${M}px`\n };\n }, Be = (d) => {\n const v = a.value[d];\n return g.value && v.gantt !== void 0;\n }, Re = (d) => !C.value || u.value[d].isRoot || u.value[d].open, Xe = (d) => !C.value && r.value.view !== \"list-expansion\" ? \"\" : C.value && (u.value[d].isRoot || u.value[d].isParent) ? u.value[d].childrenOpen ? \"▼\" : \"►\" : r.value.view === \"list-expansion\" ? u.value[d].expanded ? \"▼\" : \"►\" : \"\", je = (d) => {\n if (C.value) {\n const v = l.value[d] || {}, M = !(v.childrenOpen ?? u.value[d].childrenOpen);\n l.value[d] = {\n ...v,\n childrenOpen: M\n }, M || Fe(d);\n } else if (r.value.view === \"list-expansion\") {\n const v = l.value[d] || {}, M = v.expanded ?? u.value[d].expanded;\n l.value[d] = {\n ...v,\n expanded: !M\n };\n }\n }, Fe = (d) => {\n for (let v = 0; v < a.value.length; v++)\n if (u.value[v].parent === d) {\n const M = l.value[v] || {};\n l.value[v] = {\n ...M,\n childrenOpen: !1\n }, Fe(v);\n }\n }, Je = (d, v) => {\n const M = U(d, v);\n return Ze(d, v, M);\n }, Ze = (d, v, M) => {\n const P = o.value[d], Z = a.value[v], A = P.format;\n return A ? typeof A == \"function\" ? A(M, { table: i.value, row: Z, column: P }) : typeof A == \"string\" ? Function(`\"use strict\";return (${A})`)()(M, { table: i.value, row: Z, column: P }) : M : M;\n }, D = (d) => {\n d.target instanceof Node && c.value.parent?.contains(d.target) || c.value.visible && (c.value.visible = !1);\n }, F = (d, v) => v && d === 0 && v > 0 ? `${v}ch` : \"inherit\", W = (d) => {\n const v = a.value[d.rowIndex]?.gantt;\n v && (d.type === \"resize\" ? d.edge === \"start\" ? (v.startIndex = d.newStart, v.endIndex = d.end, v.colspan = v.endIndex - v.startIndex) : d.edge === \"end\" && (v.startIndex = d.start, v.endIndex = d.newEnd, v.colspan = v.endIndex - v.startIndex) : d.type === \"bar\" && (v.startIndex = d.newStart, v.endIndex = d.newEnd, v.colspan = v.endIndex - v.startIndex));\n }, j = (d) => {\n const v = h.value.findIndex((M) => M.id === d.id);\n v >= 0 ? h.value[v] = d : h.value.push(d);\n }, z = (d) => {\n const v = h.value.findIndex((M) => M.id === d);\n v >= 0 && h.value.splice(v, 1);\n }, se = (d) => {\n const v = b.value.findIndex((M) => M.id === d.id);\n v >= 0 ? b.value[v] = d : b.value.push(d);\n }, be = (d) => {\n const v = b.value.findIndex((M) => M.id === d);\n v >= 0 && b.value.splice(v, 1);\n }, Le = (d, v, M) => {\n const P = b.value.find((H) => H.id === d), Z = b.value.find((H) => H.id === v);\n if (!P || !Z)\n return console.warn(\"Cannot create connection: handle not found\"), null;\n const A = {\n id: `connection-${d}-${v}`,\n from: {\n barId: P.barId,\n side: P.side\n },\n to: {\n barId: Z.barId,\n side: Z.side\n },\n style: M?.style,\n label: M?.label\n };\n return I.value.push(A), A;\n }, O = (d) => {\n const v = I.value.findIndex((M) => M.id === d);\n return v >= 0 ? (I.value.splice(v, 1), !0) : !1;\n }, B = (d) => I.value.filter((v) => v.from.barId === d || v.to.barId === d), G = (d) => b.value.filter((v) => v.barId === d), Q = (d) => {\n if (o.value[d].sortable === !1) return;\n let v;\n x.value.column === d && x.value.direction === \"asc\" ? v = \"desc\" : v = \"asc\", x.value.column = d, x.value.direction = v;\n }, ne = (d, v, M) => {\n const P = M.filterType || \"text\", Z = v.value;\n if (!Z && P !== \"dateRange\" && P !== \"checkbox\") return !0;\n switch (P) {\n case \"text\": {\n let A = \"\";\n return typeof d == \"object\" && d !== null ? A = Object.values(d).join(\" \") : A = String(d || \"\"), A.toLowerCase().includes(String(Z).toLowerCase());\n }\n case \"number\": {\n const A = Number(d), H = Number(Z);\n return !isNaN(A) && !isNaN(H) && A === H;\n }\n case \"select\":\n return d === Z;\n case \"checkbox\":\n return Z === !0 ? !!d : !0;\n case \"date\": {\n let A;\n if (typeof d == \"number\") {\n const N = new Date(d), le = (/* @__PURE__ */ new Date()).getFullYear();\n A = new Date(le, N.getMonth(), N.getDate());\n } else\n A = new Date(String(d));\n const H = new Date(String(Z));\n return A.toDateString() === H.toDateString();\n }\n case \"dateRange\": {\n const A = v.startValue, H = v.endValue;\n if (!A && !H) return !0;\n let N;\n if (typeof d == \"number\") {\n const le = new Date(d), nt = (/* @__PURE__ */ new Date()).getFullYear();\n N = new Date(nt, le.getMonth(), le.getDate());\n } else\n N = new Date(String(d));\n return !(A && N < new Date(String(A)) || H && N > new Date(String(H)));\n }\n default:\n return !0;\n }\n }, ee = (d, v) => {\n !v.value && !v.startValue && !v.endValue ? delete f.value[d] : f.value[d] = v;\n }, re = (d) => {\n delete f.value[d];\n }, ce = (d, v = \"end\") => {\n const M = {};\n for (const Z of o.value)\n M[Z.name] = \"\";\n d && Object.assign(M, d);\n let P;\n return v === \"start\" ? (P = 0, a.value.unshift(M)) : v === \"end\" ? (P = a.value.length, a.value.push(M)) : (P = Math.max(0, Math.min(v, a.value.length)), a.value.splice(P, 0, M)), P;\n };\n return {\n // state\n columns: o,\n config: r,\n connectionHandles: b,\n connectionPaths: I,\n display: u,\n filterState: f,\n ganttBars: h,\n modal: c,\n rows: a,\n sortState: x,\n table: i,\n updates: p,\n // getters\n filteredRows: _,\n hasPinnedColumns: m,\n isGanttView: g,\n isTreeView: C,\n isDependencyGraphEnabled: T,\n numberedRowWidth: R,\n zeroColumn: S,\n // actions\n addRow: ce,\n clearFilter: re,\n closeModal: D,\n createConnection: Le,\n deleteConnection: O,\n deleteRow: (d) => {\n if (d < 0 || d >= a.value.length)\n return null;\n const [v] = a.value.splice(d, 1);\n delete s.value[d], delete l.value[d];\n const M = {}, P = {};\n for (const [Z, A] of Object.entries(s.value)) {\n const H = parseInt(Z);\n H > d ? M[H - 1] = A : M[H] = A;\n }\n for (const [Z, A] of Object.entries(l.value)) {\n const H = parseInt(Z);\n H > d ? P[H - 1] = A : P[H] = A;\n }\n return s.value = M, l.value = P, v;\n },\n duplicateRow: (d) => {\n if (d < 0 || d >= a.value.length)\n return -1;\n const v = a.value[d], M = JSON.parse(JSON.stringify(v)), P = d + 1;\n return a.value.splice(P, 0, M), P;\n },\n getCellData: U,\n getCellDisplayValue: Je,\n getConnectionsForBar: B,\n getFormattedValue: Ze,\n getHandlesForBar: G,\n getHeaderCellStyle: ge,\n getIndent: F,\n getRowExpandSymbol: Xe,\n insertRowAbove: (d, v) => {\n const M = Math.max(0, d);\n return ce(v, M);\n },\n insertRowBelow: (d, v) => {\n const M = Math.min(d + 1, a.value.length);\n return ce(v, M);\n },\n isRowGantt: Be,\n isRowVisible: Re,\n moveRow: (d, v) => {\n if (d < 0 || d >= a.value.length || v < 0 || v >= a.value.length || d === v)\n return !1;\n const [M] = a.value.splice(d, 1);\n a.value.splice(v, 0, M);\n const P = {}, Z = {};\n for (const [A, H] of Object.entries(s.value)) {\n const N = parseInt(A);\n let le = N;\n N === d ? le = v : d < v ? N > d && N <= v && (le = N - 1) : N >= v && N < d && (le = N + 1), P[le] = H;\n }\n for (const [A, H] of Object.entries(l.value)) {\n const N = parseInt(A);\n let le = N;\n N === d ? le = v : d < v ? N > d && N <= v && (le = N - 1) : N >= v && N < d && (le = N + 1), Z[le] = H;\n }\n return s.value = P, l.value = Z, !0;\n },\n registerConnectionHandle: se,\n registerGanttBar: j,\n resizeColumn: de,\n setCellData: ve,\n setCellText: X,\n setFilter: ee,\n sortByColumn: Q,\n toggleRowExpand: je,\n unregisterConnectionHandle: be,\n unregisterGanttBar: z,\n updateGanttBar: W,\n updateRows: Y\n };\n })();\n}, gl = {\n class: \"atable-container\",\n style: { position: \"relative\" }\n}, wl = /* @__PURE__ */ te({\n __name: \"ATable\",\n props: /* @__PURE__ */ Me({\n id: { default: \"\" },\n config: { default: () => new Object() }\n }, {\n rows: { required: !0 },\n rowsModifiers: {},\n columns: { required: !0 },\n columnsModifiers: {}\n }),\n emits: /* @__PURE__ */ Me([\"cellUpdate\", \"gantt:drag\", \"connection:event\", \"columns:update\", \"row:add\", \"row:delete\", \"row:duplicate\", \"row:insert-above\", \"row:insert-below\", \"row:move\"], [\"update:rows\", \"update:columns\"]),\n setup(e, { expose: t, emit: n }) {\n const o = ke(e, \"rows\"), a = ke(e, \"columns\"), r = n, s = fe(\"table\"), l = hl({ columns: a.value, rows: o.value, id: e.id, config: e.config });\n l.$onAction(({ name: I, store: x, args: f, after: m }) => {\n if (I === \"setCellData\" || I === \"setCellText\") {\n const [g, C, T] = f, R = x.getCellData(g, C);\n m(() => {\n o.value = [...x.rows], r(\"cellUpdate\", { colIndex: g, rowIndex: C, newValue: T, oldValue: R });\n });\n } else if (I === \"updateGanttBar\") {\n const [g] = f;\n let C = !1;\n g.type === \"resize\" ? C = g.oldColspan !== g.newColspan : g.type === \"bar\" && (C = g.oldStart !== g.newStart || g.oldEnd !== g.newEnd), C && m(() => {\n r(\"gantt:drag\", g);\n });\n } else I === \"resizeColumn\" && m(() => {\n a.value = [...x.columns], r(\"columns:update\", [...x.columns]);\n });\n }), oe(\n () => o.value,\n (I) => {\n JSON.stringify(I) !== JSON.stringify(l.rows) && (l.rows = [...I]);\n },\n { deep: !0 }\n ), oe(\n a,\n (I) => {\n JSON.stringify(I) !== JSON.stringify(l.columns) && (l.columns = [...I], r(\"columns:update\", [...I]));\n },\n { deep: !0 }\n ), Ee(() => {\n a.value.some((I) => I.pinned) && (u(), l.isTreeView && mn(s, u, { childList: !0, subtree: !0 }));\n });\n const i = $(() => l.columns.filter((I) => I.pinned).length), u = () => {\n const I = s.value, x = I?.rows[0], f = I?.rows[1], m = x ? Array.from(x.cells) : [];\n for (const [g, C] of m.entries()) {\n const T = f?.cells[g];\n T && (C.style.width = `${T.offsetWidth}px`);\n }\n for (const g of I?.rows || []) {\n let C = 0;\n const T = [];\n for (const R of g.cells)\n (R.classList.contains(\"sticky-column\") || R.classList.contains(\"sticky-index\")) && (R.style.left = `${C}px`, C += R.offsetWidth, T.push(R));\n T.length > 0 && T[T.length - 1].classList.add(\"sticky-column-edge\");\n }\n };\n window.addEventListener(\"keydown\", (I) => {\n if (I.key === \"Escape\" && l.modal.visible) {\n l.modal.visible = !1;\n const x = l.modal.parent;\n x && pt().then(() => {\n x.focus();\n });\n }\n });\n const c = (I) => {\n if (!I.gantt || i.value === 0)\n return l.columns;\n const x = [];\n for (let f = 0; f < i.value; f++) {\n const m = { ...l.columns[f] };\n m.originalIndex = f, x.push(m);\n }\n return x.push({\n ...l.columns[i.value],\n isGantt: !0,\n colspan: I.gantt?.colspan || l.columns.length - i.value,\n originalIndex: i.value,\n width: \"auto\"\n // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable\n }), x;\n }, p = (I) => {\n r(\"connection:event\", { type: \"create\", connection: I });\n }, h = (I) => {\n r(\"connection:event\", { type: \"delete\", connection: I });\n }, b = (I, x) => {\n switch (I) {\n case \"add\": {\n const f = l.addRow({}, x + 1), m = l.rows[f];\n o.value = [...l.rows], r(\"row:add\", { rowIndex: f, row: m });\n break;\n }\n case \"delete\": {\n const f = l.deleteRow(x);\n f && (o.value = [...l.rows], r(\"row:delete\", { rowIndex: x, row: f }));\n break;\n }\n case \"duplicate\": {\n const f = l.duplicateRow(x);\n if (f >= 0) {\n const m = l.rows[f];\n o.value = [...l.rows], r(\"row:duplicate\", { sourceIndex: x, newIndex: f, row: m });\n }\n break;\n }\n case \"insertAbove\": {\n const f = l.insertRowAbove(x), m = l.rows[f];\n o.value = [...l.rows], r(\"row:insert-above\", { targetIndex: x, newIndex: f, row: m });\n break;\n }\n case \"insertBelow\": {\n const f = l.insertRowBelow(x), m = l.rows[f];\n o.value = [...l.rows], r(\"row:insert-below\", { targetIndex: x, newIndex: f, row: m });\n break;\n }\n case \"move\": {\n r(\"row:move\", { fromIndex: x, toIndex: -1 });\n break;\n }\n }\n };\n return t({\n store: l,\n createConnection: l.createConnection,\n deleteConnection: l.deleteConnection,\n getConnectionsForBar: l.getConnectionsForBar,\n getHandlesForBar: l.getHandlesForBar,\n // Row action methods\n addRow: l.addRow,\n deleteRow: l.deleteRow,\n duplicateRow: l.duplicateRow,\n insertRowAbove: l.insertRowAbove,\n insertRowBelow: l.insertRowBelow,\n moveRow: l.moveRow\n }), (I, x) => (w(), k(\"div\", gl, [\n J((w(), k(\"table\", {\n ref: \"table\",\n class: \"atable\",\n style: xe({\n width: V(l).config.fullWidth ? \"100%\" : \"auto\"\n })\n }, [\n he(I.$slots, \"header\", { data: V(l) }, () => [\n dt(gn, {\n columns: V(l).columns,\n store: V(l)\n }, null, 8, [\"columns\", \"store\"])\n ], !0),\n y(\"tbody\", null, [\n he(I.$slots, \"body\", { data: V(l) }, () => [\n (w(!0), k(ue, null, me(V(l).filteredRows, (f, m) => (w(), pe(hn, {\n key: `${f.originalIndex}-${m}`,\n row: f,\n rowIndex: f.originalIndex,\n store: V(l),\n \"onRow:action\": b\n }, {\n default: Tt(() => [\n (w(!0), k(ue, null, me(c(f), (g, C) => (w(), k(ue, {\n key: g.name\n }, [\n g.isGantt ? (w(), pe(We(g.ganttComponent || \"AGanttCell\"), {\n key: 0,\n store: V(l),\n \"columns-count\": V(l).columns.length - i.value,\n color: f.gantt?.color,\n start: f.gantt?.startIndex,\n end: f.gantt?.endIndex,\n colspan: g.colspan,\n pinned: g.pinned,\n rowIndex: f.originalIndex,\n colIndex: g.originalIndex ?? C,\n style: xe({\n textAlign: g?.align || \"center\",\n minWidth: g?.width || \"40ch\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n \"onConnection:create\": p\n }, null, 40, [\"store\", \"columns-count\", \"color\", \"start\", \"end\", \"colspan\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"])) : (w(), pe(We(g.cellComponent || \"ACell\"), {\n key: 1,\n store: V(l),\n pinned: g.pinned,\n rowIndex: f.originalIndex,\n colIndex: C,\n style: xe({\n textAlign: g?.align || \"center\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n spellcheck: \"false\"\n }, null, 8, [\"store\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"]))\n ], 64))), 128))\n ]),\n _: 2\n }, 1032, [\"row\", \"rowIndex\", \"store\"]))), 128))\n ], !0)\n ]),\n he(I.$slots, \"footer\", { data: V(l) }, void 0, !0),\n he(I.$slots, \"modal\", { data: V(l) }, () => [\n J(dt(wn, { store: V(l) }, {\n default: Tt(() => [\n (w(), pe(We(V(l).modal.component), vt({\n key: `${V(l).modal.rowIndex}:${V(l).modal.colIndex}`,\n \"col-index\": V(l).modal.colIndex,\n \"row-index\": V(l).modal.rowIndex,\n store: V(l)\n }, V(l).modal.componentProps), null, 16, [\"col-index\", \"row-index\", \"store\"]))\n ]),\n _: 1\n }, 8, [\"store\"]), [\n [Ce, V(l).modal.visible]\n ])\n ], !0)\n ], 4)), [\n [V(zo), V(l).closeModal]\n ]),\n V(l).isGanttView && V(l).isDependencyGraphEnabled ? (w(), pe(tl, {\n key: 0,\n store: V(l),\n \"onConnection:delete\": h\n }, null, 8, [\"store\"])) : q(\"\", !0)\n ]));\n }\n}), yl = /* @__PURE__ */ Ve(wl, [[\"__scopeId\", \"data-v-3d00d51b\"]]), xl = {}, bl = { class: \"aloading\" }, Il = { class: \"aloading-header\" };\nfunction kl(e, t) {\n return w(), k(\"div\", bl, [\n y(\"h2\", Il, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = y(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst Ml = /* @__PURE__ */ Ve(xl, [[\"render\", kl], [\"__scopeId\", \"data-v-a930a25b\"]]), Cl = {}, El = { class: \"aloading\" }, Al = { class: \"aloading-header\" };\nfunction Tl(e, t) {\n return w(), k(\"div\", El, [\n y(\"h2\", Al, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = y(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst $l = /* @__PURE__ */ Ve(Cl, [[\"render\", Tl], [\"__scopeId\", \"data-v-e1165876\"]]);\nfunction Dl(e) {\n e.component(\"ACell\", ho), e.component(\"AExpansionRow\", bo), e.component(\"AGanttCell\", To), e.component(\"ARow\", hn), e.component(\"ARowActions\", ut), e.component(\"ATable\", yl), e.component(\"ATableHeader\", gn), e.component(\"ATableLoading\", Ml), e.component(\"ATableLoadingBar\", $l), e.component(\"ATableModal\", wn);\n}\nconst Sl = { class: \"aform_form-element\" }, Rl = [\"for\"], Ll = { class: \"aform_checkbox-container aform_input-field\" }, Hl = [\"id\", \"readonly\", \"required\"], Vl = [\"innerHTML\"], Pl = /* @__PURE__ */ te({\n __name: \"ACheckbox\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: { type: [Boolean, String, Array, Set] },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\");\n return (n, o) => (w(), k(\"div\", Sl, [\n y(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, K(e.label), 9, Rl),\n y(\"span\", Ll, [\n J(y(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (a) => t.value = a),\n type: \"checkbox\",\n class: \"aform_checkbox\",\n readonly: e.readOnly,\n required: e.required\n }, null, 8, Hl), [\n [un, t.value]\n ])\n ]),\n J(y(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, Vl), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), $e = (e, t) => {\n const n = e.__vccOpts || e;\n for (const [o, a] of t)\n n[o] = a;\n return n;\n}, Ol = /* @__PURE__ */ $e(Pl, [[\"__scopeId\", \"data-v-f13fd4d6\"]]), _l = /* @__PURE__ */ te({\n __name: \"AComboBox\",\n props: [\"event\", \"cellData\", \"tableID\"],\n setup(e) {\n return (t, n) => {\n const o = dn(\"ATableModal\");\n return w(), pe(o, {\n event: e.event,\n \"cell-data\": e.cellData,\n class: \"amodal\"\n }, {\n default: Tt(() => [...n[0] || (n[0] = [\n y(\"div\", null, [\n y(\"input\", { type: \"text\" }),\n y(\"input\", { type: \"text\" }),\n y(\"input\", { type: \"text\" })\n ], -1)\n ])]),\n _: 1\n }, 8, [\"event\", \"cell-data\"]);\n };\n }\n}), Bl = [\"id\", \"disabled\", \"required\"], Fl = [\"for\"], Zl = [\"innerHTML\"], Nl = /* @__PURE__ */ te({\n __name: \"ADate\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: { default: \"Date\" },\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {\n // format the date to be compatible with the native input datepicker\n },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\", {\n // format the date to be compatible with the native input datepicker\n set: (a) => new Date(a).toISOString().split(\"T\")[0]\n }), n = fe(\"date\"), o = () => {\n n.value && \"showPicker\" in HTMLInputElement.prototype && n.value.showPicker();\n };\n return (a, r) => (w(), k(\"div\", null, [\n J(y(\"input\", {\n id: e.uuid,\n ref: \"date\",\n \"onUpdate:modelValue\": r[0] || (r[0] = (s) => t.value = s),\n type: \"date\",\n disabled: e.readOnly,\n required: e.required,\n onClick: o\n }, null, 8, Bl), [\n [we, t.value]\n ]),\n y(\"label\", { for: e.uuid }, K(e.label), 9, Fl),\n J(y(\"p\", {\n innerHTML: e.validation.errorMessage\n }, null, 8, Zl), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), Ul = /* @__PURE__ */ $e(Nl, [[\"__scopeId\", \"data-v-a15ed922\"]]);\nfunction yn(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\n// @__NO_SIDE_EFFECTS__\nfunction jt() {\n const e = /* @__PURE__ */ new Set(), t = (r) => {\n e.delete(r);\n };\n return {\n on: (r) => {\n e.add(r);\n const s = () => t(r);\n return yn(s), { off: s };\n },\n off: t,\n trigger: (...r) => Promise.all(Array.from(e).map((s) => s(...r))),\n clear: () => {\n e.clear();\n }\n };\n}\nconst xn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Wl = Object.prototype.toString, Gl = (e) => Wl.call(e) === \"[object Object]\", Qe = () => {\n}, zl = (e, t) => Object.prototype.hasOwnProperty.call(e, t);\nfunction ql(...e) {\n if (e.length !== 1) return cn(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: Qe\n }))) : L(t);\n}\nfunction kt(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction Yl(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst bn = xn ? window : void 0, Xl = xn ? window.document : void 0;\nfunction Ue(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction Mt(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = kt(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return Yl(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => Ue(r))) !== null && o !== void 0 ? o : [bn].filter((r) => r != null),\n kt(E(n.value ? e[1] : e[0])),\n kt(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = Gl(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction Jt(e, t, n = {}) {\n const { window: o = bn, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = n;\n if (!o) return l ? {\n stop: Qe,\n cancel: Qe,\n trigger: Qe\n } : Qe;\n let i = !0;\n const u = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(o.document.querySelectorAll(m)).some((g) => g === f.target || f.composedPath().includes(g));\n {\n const g = Ue(m);\n return g && (f.target === g || f.composedPath().includes(g));\n }\n });\n function c(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const g = E(f), C = g.$.subTree && g.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some((T) => T.el === m.target || m.composedPath().includes(T.el));\n }\n const h = (f) => {\n const m = Ue(e);\n if (f.target != null && !(!(m instanceof Element) && c(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (i = !u(f)), !i) {\n i = !0;\n return;\n }\n t(f);\n }\n };\n let b = !1;\n const I = [\n Mt(o, \"click\", (f) => {\n b || (b = !0, setTimeout(() => {\n b = !1;\n }, 0), h(f));\n }, {\n passive: !0,\n capture: r\n }),\n Mt(o, \"pointerdown\", (f) => {\n const m = Ue(e);\n i = !u(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && Mt(o, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const g = Ue(e);\n ((m = o.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !g?.contains(o.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), x = () => I.forEach((f) => f());\n return l ? {\n stop: x,\n cancel: () => {\n i = !1;\n },\n trigger: (f) => {\n i = !0, h(f), i = !1;\n }\n } : x;\n}\nconst jl = {\n multiple: !0,\n accept: \"*\",\n reset: !1,\n directory: !1\n};\nfunction Jl(e) {\n if (!e) return null;\n if (e instanceof FileList) return e;\n const t = new DataTransfer();\n for (const n of e) t.items.add(n);\n return t.files;\n}\nfunction Ql(e = {}) {\n const { document: t = Xl } = e, n = L(Jl(e.initialFiles)), { on: o, trigger: a } = /* @__PURE__ */ jt(), { on: r, trigger: s } = /* @__PURE__ */ jt(), l = $(() => {\n var p;\n const h = (p = Ue(e.input)) !== null && p !== void 0 ? p : t ? t.createElement(\"input\") : void 0;\n return h && (h.type = \"file\", h.onchange = (b) => {\n n.value = b.target.files, a(n.value);\n }, h.oncancel = () => {\n s();\n }), h;\n }), i = () => {\n n.value = null, l.value && l.value.value && (l.value.value = \"\", a(null));\n }, u = (p) => {\n const h = l.value;\n h && (h.multiple = E(p.multiple), h.accept = E(p.accept), h.webkitdirectory = E(p.directory), zl(p, \"capture\") && (h.capture = E(p.capture)));\n }, c = (p) => {\n const h = l.value;\n if (!h) return;\n const b = {\n ...jl,\n ...e,\n ...p\n };\n u(b), E(b.reset) && i(), h.click();\n };\n return Oe(() => {\n u(e);\n }), {\n files: Rt(n),\n open: c,\n reset: i,\n onCancel: r,\n onChange: o\n };\n}\nfunction Ct(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst Et = /* @__PURE__ */ new WeakMap();\nfunction Kl(e, t = !1) {\n const n = ie(t);\n let o = \"\";\n oe(ql(e), (s) => {\n const l = Ct(E(s));\n if (l) {\n const i = l;\n if (Et.get(i) || Et.set(i, i.style.overflow), i.style.overflow !== \"hidden\" && (o = i.style.overflow), i.style.overflow === \"hidden\") return n.value = !0;\n if (n.value) return i.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = Ct(E(e));\n !s || n.value || (s.style.overflow = \"hidden\", n.value = !0);\n }, r = () => {\n const s = Ct(E(e));\n !s || !n.value || (s.style.overflow = o, Et.delete(s), n.value = !1);\n };\n return yn(r), $({\n get() {\n return n.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst At = /* @__PURE__ */ new WeakMap(), ea = {\n mounted(e, t) {\n const n = !t.modifiers.bubble;\n let o;\n if (typeof t.value == \"function\") o = Jt(e, t.value, { capture: n });\n else {\n const [a, r] = t.value;\n o = Jt(e, a, Object.assign({ capture: n }, r));\n }\n At.set(e, o);\n },\n unmounted(e) {\n const t = At.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), At.delete(e);\n }\n};\nfunction ta() {\n let e = !1;\n const t = ie(!1);\n return (n, o) => {\n if (t.value = o.value, e) return;\n e = !0;\n const a = Kl(n, o.value);\n oe(t, (r) => a.value = r);\n };\n}\nta();\nconst na = { class: \"input-wrapper\" }, oa = {\n id: \"autocomplete-results\",\n class: \"autocomplete-results\"\n}, la = {\n key: 0,\n class: \"loading autocomplete-result\"\n}, aa = [\"onClick\"], sa = /* @__PURE__ */ te({\n __name: \"ADropdown\",\n props: /* @__PURE__ */ Me({\n label: {},\n items: { default: () => [] },\n isAsync: { type: Boolean, default: !1 },\n filterFunction: { type: Function, default: void 0 }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\"), n = rn({\n activeItemIndex: null,\n open: !1,\n loading: !1,\n results: e.items\n }), o = () => l(), a = async () => {\n if (n.open = !0, n.activeItemIndex = null, e.filterFunction) {\n e.isAsync && (n.loading = !0);\n try {\n const h = await e.filterFunction(t.value || \"\");\n n.results = h || [];\n } catch {\n n.results = [];\n } finally {\n e.isAsync && (n.loading = !1);\n }\n } else\n i();\n }, r = (h) => {\n t.value = h, l(h);\n }, s = () => {\n n.activeItemIndex = e.isAsync ? null : t.value && e.items?.indexOf(t.value) || null, n.open = !0, n.results = e.isAsync ? [] : e.items;\n }, l = (h) => {\n n.activeItemIndex = null, n.open = !1, e.items?.includes(h || t.value || \"\") || (t.value = \"\");\n }, i = () => {\n t.value ? n.results = e.items?.filter((h) => h.toLowerCase().includes((t.value ?? \"\").toLowerCase())) : n.results = e.items;\n }, u = () => {\n const h = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const b = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n n.activeItemIndex = (b + 1) % h;\n } else\n n.activeItemIndex = 0;\n }, c = () => {\n const h = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const b = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n b === 0 ? n.activeItemIndex = null : n.activeItemIndex = b - 1;\n } else\n n.activeItemIndex = h - 1;\n }, p = () => {\n if (n.results) {\n const h = n.activeItemIndex || 0, b = n.results[h];\n r(b);\n }\n n.activeItemIndex = 0;\n };\n return (h, b) => J((w(), k(\"div\", {\n class: ae([\"autocomplete\", { isOpen: n.open }])\n }, [\n y(\"div\", na, [\n J(y(\"input\", {\n \"onUpdate:modelValue\": b[0] || (b[0] = (I) => t.value = I),\n type: \"text\",\n onInput: a,\n onFocus: s,\n onKeydown: [\n Ne(u, [\"down\"]),\n Ne(c, [\"up\"]),\n Ne(p, [\"enter\"]),\n Ne(o, [\"esc\"]),\n Ne(o, [\"tab\"])\n ]\n }, null, 544), [\n [we, t.value]\n ]),\n J(y(\"ul\", oa, [\n n.loading ? (w(), k(\"li\", la, \"Loading results...\")) : (w(!0), k(ue, { key: 1 }, me(n.results, (I, x) => (w(), k(\"li\", {\n key: I,\n class: ae([\"autocomplete-result\", { \"is-active\": x === n.activeItemIndex }]),\n onClick: Ie((f) => r(I), [\"stop\"])\n }, K(I), 11, aa))), 128))\n ], 512), [\n [Ce, n.open]\n ]),\n y(\"label\", null, K(e.label), 1)\n ])\n ], 2)), [\n [V(ea), o]\n ]);\n }\n}), ra = /* @__PURE__ */ $e(sa, [[\"__scopeId\", \"data-v-31a6db8c\"]]);\nfunction In(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\nconst ia = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst ua = (e) => e != null, ca = Object.prototype.toString, da = (e) => ca.call(e) === \"[object Object]\", fa = () => {\n};\nfunction ct(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction va(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst Ye = ia ? window : void 0;\nfunction ze(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction et(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = ct(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return va(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => ze(r))) !== null && o !== void 0 ? o : [Ye].filter((r) => r != null),\n ct(E(n.value ? e[1] : e[0])),\n ct(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = da(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction pa() {\n const e = ie(!1), t = gt();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction ma(e) {\n const t = /* @__PURE__ */ pa();\n return $(() => (t.value, !!e()));\n}\nfunction ha(e, t, n = {}) {\n const { window: o = Ye, ...a } = n;\n let r;\n const s = /* @__PURE__ */ ma(() => o && \"MutationObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const p = ct(E(e)).map(ze).filter(ua);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((h) => r.observe(h, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => r?.takeRecords(), c = () => {\n i(), l();\n };\n return In(c), {\n isSupported: s,\n stop: c,\n takeRecords: u\n };\n}\nfunction ga(e, t, n = {}) {\n const { window: o = Ye, document: a = o?.document, flush: r = \"sync\" } = n;\n if (!o || !a) return fa;\n let s;\n const l = (c) => {\n s?.(), s = c;\n }, i = Oe(() => {\n const c = ze(e);\n if (c) {\n const { stop: p } = ha(a, (h) => {\n h.map((b) => [...b.removedNodes]).flat().some((b) => b === c || b.contains(c)) && t(h);\n }, {\n window: o,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), u = () => {\n i(), l();\n };\n return In(u), u;\n}\n// @__NO_SIDE_EFFECTS__\nfunction wa(e = {}) {\n var t;\n const { window: n = Ye, deep: o = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {\n let u = r?.activeElement;\n if (o)\n for (var c; u?.shadowRoot; ) u = u == null || (c = u.shadowRoot) === null || c === void 0 ? void 0 : c.activeElement;\n return u;\n }, l = ie(), i = () => {\n l.value = s();\n };\n if (n) {\n const u = {\n capture: !0,\n passive: !0\n };\n et(n, \"blur\", (c) => {\n c.relatedTarget === null && i();\n }, u), et(n, \"focus\", i, u);\n }\n return a && ga(l, i, { document: r }), i(), l;\n}\nconst ya = \"focusin\", xa = \"focusout\", ba = \":focus-within\";\nfunction Ia(e, t = {}) {\n const { window: n = Ye } = t, o = $(() => ze(e)), a = ie(!1), r = $(() => a.value);\n if (!n || !(/* @__PURE__ */ wa(t)).value) return { focused: r };\n const s = { passive: !0 };\n return et(o, ya, () => a.value = !0, s), et(o, xa, () => {\n var l, i, u;\n return a.value = (l = (i = o.value) === null || i === void 0 || (u = i.matches) === null || u === void 0 ? void 0 : u.call(i, ba)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction ka(e, { window: t = Ye, scrollTarget: n } = {}) {\n const o = L(!1), a = () => {\n if (!t) return;\n const r = t.document, s = ze(e);\n if (!s)\n o.value = !1;\n else {\n const l = s.getBoundingClientRect();\n o.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return oe(\n () => ze(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && et(n || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), o;\n}\nconst De = (e) => {\n let t = ka(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, Se = (e) => e.tabIndex >= 0, Qt = (e) => {\n const t = e.target;\n return Bt(t);\n}, Bt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.previousElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.previousElementSibling;\n n && (t = n);\n }\n return t && (!Se(t) || !De(t)) ? Bt(t) : t;\n}, Ma = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.firstElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.firstElementChild;\n a && (n = a);\n }\n }\n return n && (!Se(n) || !De(n)) ? Ft(n) : n;\n}, Kt = (e) => {\n const t = e.target;\n return Ft(t);\n}, Ft = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.nextElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.nextElementSibling;\n n && (t = n);\n }\n return t && (!Se(t) || !De(t)) ? Ft(t) : t;\n}, Ca = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.lastElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.lastElementChild;\n a && (n = a);\n }\n }\n return n && (!Se(n) || !De(n)) ? Bt(n) : n;\n}, en = (e) => {\n const t = e.target;\n return Zt(t);\n}, Zt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, tn = (e) => {\n const t = e.target;\n return Nt(t);\n}, Nt = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, nn = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, on = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, st = [\"alt\", \"control\", \"shift\", \"meta\"], Ea = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, kn = {\n \"keydown.up\": (e) => {\n const t = Qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Kt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = en(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = tn(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = Ma(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Ca(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Kt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Qt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = tn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = en(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Aa(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, n = (s) => {\n const l = t(s);\n let i = [];\n if (typeof s.selectors == \"string\")\n i = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const u of s.selectors)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else if (s.selectors instanceof HTMLElement)\n i.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const u of s.selectors.value)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else\n i.push(s.selectors.value);\n return i;\n }, o = (s) => {\n const l = t(s);\n let i = [];\n return s.selectors ? i = n(s) : l && (i = Array.from(l.children).filter((u) => Se(u) && De(u))), i;\n }, a = (s) => (l) => {\n const i = Ea[l.key] || l.key.toLowerCase();\n if (st.includes(i)) return;\n const u = s.handlers || kn;\n for (const c of Object.keys(u)) {\n const [p, ...h] = c.split(\".\");\n if (p === \"keydown\" && h.includes(i)) {\n const b = u[c], I = h.filter((f) => st.includes(f)), x = st.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (I.length > 0) {\n if (x) {\n for (const f of st)\n if (h.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && b(l);\n }\n }\n } else\n x || b(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), i = o(s), u = a(s), c = l ? [l] : i;\n for (const p of c) {\n const { focused: h } = Ia(L(p)), b = oe(h, (I) => {\n I ? p.addEventListener(\"keydown\", u) : p.removeEventListener(\"keydown\", u);\n });\n r.push(b);\n }\n }\n }), sn(() => {\n for (const s of r)\n s();\n });\n}\nconst Ta = {\n ref: \"datepicker\",\n class: \"adatepicker\",\n tabindex: \"0\"\n}, $a = {\n colspan: \"5\",\n tabindex: -1\n}, Da = [\"onClick\", \"onKeydown\"], Sa = 6, ln = 7, Ra = /* @__PURE__ */ te({\n __name: \"ADatePicker\",\n props: {\n modelValue: { default: /* @__PURE__ */ new Date() },\n modelModifiers: {}\n },\n emits: [\"update:modelValue\"],\n setup(e, { expose: t }) {\n const n = ke(e, \"modelValue\"), o = L(new Date(n.value)), a = L(o.value.getMonth()), r = L(o.value.getFullYear()), s = L([]), l = fe(\"datepicker\");\n Ee(async () => {\n i(), await pt();\n const C = document.getElementsByClassName(\"selectedDate\");\n if (C.length > 0)\n C[0].focus();\n else {\n const T = document.getElementsByClassName(\"todaysDate\");\n T.length > 0 && T[0].focus();\n }\n });\n const i = () => {\n s.value = [];\n const C = new Date(r.value, a.value, 1), T = C.getDay(), R = C.setDate(C.getDate() - T);\n for (const S of Array(43).keys())\n s.value.push(R + S * 864e5);\n };\n oe([a, r], i);\n const u = () => r.value -= 1, c = () => r.value += 1, p = () => {\n a.value == 0 ? (a.value = 11, u()) : a.value -= 1;\n }, h = () => {\n a.value == 11 ? (a.value = 0, c()) : a.value += 1;\n }, b = (C) => {\n const T = /* @__PURE__ */ new Date();\n if (a.value === T.getMonth())\n return T.toDateString() === new Date(C).toDateString();\n }, I = (C) => new Date(C).toDateString() === new Date(o.value).toDateString(), x = (C, T) => (C - 1) * ln + T, f = (C, T) => s.value[x(C, T)], m = (C) => {\n n.value = o.value = new Date(s.value[C]);\n }, g = $(() => new Date(r.value, a.value, 1).toLocaleDateString(void 0, {\n year: \"numeric\",\n month: \"long\"\n }));\n return Aa([\n {\n parent: l,\n selectors: \"td\",\n handlers: {\n ...kn,\n \"keydown.pageup\": p,\n \"keydown.shift.pageup\": u,\n \"keydown.pagedown\": h,\n \"keydown.shift.pagedown\": c,\n // TODO: this is a hack to override the stonecrop enter handler;\n // store context inside the component so that handlers can be setup consistently\n \"keydown.enter\": () => {\n }\n }\n }\n ]), t({ currentMonth: a, currentYear: r, selectedDate: o }), (C, T) => (w(), k(\"div\", Ta, [\n y(\"table\", null, [\n y(\"tbody\", null, [\n y(\"tr\", null, [\n y(\"td\", {\n id: \"previous-month-btn\",\n tabindex: -1,\n onClick: p\n }, \"<\"),\n y(\"th\", $a, K(g.value), 1),\n y(\"td\", {\n id: \"next-month-btn\",\n tabindex: -1,\n onClick: h\n }, \">\")\n ]),\n T[0] || (T[0] = y(\"tr\", { class: \"days-header\" }, [\n y(\"td\", null, \"M\"),\n y(\"td\", null, \"T\"),\n y(\"td\", null, \"W\"),\n y(\"td\", null, \"T\"),\n y(\"td\", null, \"F\"),\n y(\"td\", null, \"S\"),\n y(\"td\", null, \"S\")\n ], -1)),\n (w(), k(ue, null, me(Sa, (R) => y(\"tr\", { key: R }, [\n (w(), k(ue, null, me(ln, (S) => y(\"td\", {\n ref_for: !0,\n ref: \"celldate\",\n key: x(R, S),\n contenteditable: !1,\n spellcheck: !1,\n tabindex: 0,\n class: ae({\n todaysDate: b(f(R, S)),\n selectedDate: I(f(R, S))\n }),\n onClick: Ie((_) => m(x(R, S)), [\"prevent\", \"stop\"]),\n onKeydown: Ne((_) => m(x(R, S)), [\"enter\"])\n }, K(new Date(f(R, S)).getDate()), 43, Da)), 64))\n ])), 64))\n ])\n ])\n ], 512));\n }\n}), La = /* @__PURE__ */ $e(Ra, [[\"__scopeId\", \"data-v-056d2b5e\"]]), Ha = /* @__PURE__ */ te({\n __name: \"CollapseButton\",\n props: {\n collapsed: { type: Boolean }\n },\n setup(e) {\n return (t, n) => (w(), k(\"button\", {\n class: ae([\"collapse-button\", e.collapsed ? \"rotated\" : \"unrotated\"])\n }, \"×\", 2));\n }\n}), Va = /* @__PURE__ */ $e(Ha, [[\"__scopeId\", \"data-v-6f1c1b45\"]]), Pa = { class: \"aform\" }, Oa = {\n key: 0,\n class: \"aform-nested-section\"\n}, _a = {\n key: 0,\n class: \"aform-nested-label\"\n}, Ba = /* @__PURE__ */ te({\n __name: \"AForm\",\n props: /* @__PURE__ */ Me({\n schema: {},\n readOnly: { type: Boolean }\n }, {\n data: { required: !0 },\n dataModifiers: {}\n }),\n emits: /* @__PURE__ */ Me([\"update:schema\", \"update:data\"], [\"update:data\"]),\n setup(e, { emit: t }) {\n const n = t, o = ke(e, \"data\"), a = L({});\n Oe(() => {\n !e.schema || !o.value || e.schema.forEach((i) => {\n \"schema\" in i && Array.isArray(i.schema) && i.schema.length > 0 && (!a.value[i.fieldname] && o.value[i.fieldname] ? a.value[i.fieldname] = o.value[i.fieldname] : a.value[i.fieldname] || (a.value[i.fieldname] = {}));\n });\n }), Oe(() => {\n Object.keys(a.value).forEach((i) => {\n o.value && a.value[i] !== o.value[i] && (o.value[i] = a.value[i], n(\"update:data\", o.value));\n });\n }), Oe(() => {\n o.value && e.schema && e.schema.forEach((i) => {\n i.fieldname && o.value[i.fieldname] !== void 0 && (i.value = o.value[i.fieldname]);\n });\n });\n const r = (i) => {\n const u = {};\n for (const [c, p] of Object.entries(i))\n [\"component\", \"fieldtype\"].includes(c) || (u[c] = p), c === \"rows\" && (!p || Array.isArray(p) && p.length === 0) && (u.rows = o.value[i.fieldname] || []);\n return u;\n }, s = L([]);\n Oe(() => {\n e.schema && s.value.length !== e.schema.length && (s.value = e.schema.map((i, u) => $({\n get() {\n return i.value;\n },\n set: (c) => {\n const p = e.schema[u].fieldname;\n e.schema[u].value = c, p && o.value && (o.value[p] = c, n(\"update:data\", o.value)), n(\"update:schema\", e.schema);\n }\n })));\n });\n const l = $(() => s.value);\n return (i, u) => {\n const c = dn(\"AForm\", !0);\n return w(), k(\"form\", Pa, [\n (w(!0), k(ue, null, me(e.schema, (p, h) => (w(), k(ue, { key: h }, [\n \"schema\" in p && Array.isArray(p.schema) && p.schema.length > 0 ? (w(), k(\"div\", Oa, [\n p.label ? (w(), k(\"h4\", _a, K(p.label), 1)) : q(\"\", !0),\n dt(c, {\n data: a.value[p.fieldname],\n \"onUpdate:data\": (b) => a.value[p.fieldname] = b,\n schema: p.schema,\n \"read-only\": e.readOnly || p.readOnly\n }, null, 8, [\"data\", \"onUpdate:data\", \"schema\", \"read-only\"])\n ])) : (w(), pe(We(p.component), vt({\n key: 1,\n modelValue: l.value[h].value,\n \"onUpdate:modelValue\": (b) => l.value[h].value = b,\n schema: p,\n data: o.value[p.fieldname],\n \"read-only\": e.readOnly\n }, { ref_for: !0 }, r(p)), null, 16, [\"modelValue\", \"onUpdate:modelValue\", \"schema\", \"data\", \"read-only\"]))\n ], 64))), 128))\n ]);\n };\n }\n}), Mn = /* @__PURE__ */ $e(Ba, [[\"__scopeId\", \"data-v-06e17c5b\"]]), Fa = /* @__PURE__ */ te({\n __name: \"AFieldset\",\n props: {\n schema: {},\n label: {},\n collapsible: { type: Boolean },\n data: { default: () => ({}) }\n },\n setup(e, { expose: t }) {\n const n = L(!1), o = L(e.data || []), a = L(e.schema), r = (s) => {\n s.preventDefault(), e.collapsible && (n.value = !n.value);\n };\n return t({ collapsed: n }), (s, l) => (w(), k(\"fieldset\", null, [\n y(\"legend\", {\n onClick: r,\n onSubmit: r\n }, [\n Dt(K(e.label) + \" \", 1),\n e.collapsible ? (w(), pe(Va, {\n key: 0,\n collapsed: n.value\n }, null, 8, [\"collapsed\"])) : q(\"\", !0)\n ], 32),\n he(s.$slots, \"default\", { collapsed: n.value }, () => [\n J(dt(Mn, {\n schema: a.value,\n data: o.value,\n \"onUpdate:data\": l[0] || (l[0] = (i) => o.value = i)\n }, null, 8, [\"schema\", \"data\"]), [\n [Ce, !n.value]\n ])\n ], !0)\n ]));\n }\n}), Za = /* @__PURE__ */ $e(Fa, [[\"__scopeId\", \"data-v-18fd6c61\"]]), Na = { class: \"aform_form-element aform_file-attach aform__grid--full\" }, Ua = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, Wa = [\"disabled\"], Ga = /* @__PURE__ */ te({\n __name: \"AFileAttach\",\n props: {\n label: {}\n },\n setup(e) {\n const { files: t, open: n, reset: o, onChange: a } = Ql(), r = $(() => `${t.value.length} ${t.value.length === 1 ? \"file\" : \"files\"}`);\n return a((s) => s), (s, l) => (w(), k(\"div\", Na, [\n V(t) ? (w(), k(\"div\", Ua, [\n y(\"p\", null, [\n l[2] || (l[2] = Dt(\" You have selected: \", -1)),\n y(\"b\", null, K(r.value), 1)\n ]),\n (w(!0), k(ue, null, me(V(t), (i) => (w(), k(\"li\", {\n key: i.name\n }, K(i.name), 1))), 128))\n ])) : q(\"\", !0),\n y(\"button\", {\n type: \"button\",\n class: \"aform_form-btn\",\n onClick: l[0] || (l[0] = (i) => V(n)())\n }, K(e.label), 1),\n y(\"button\", {\n type: \"button\",\n disabled: !V(t),\n class: \"aform_form-btn\",\n onClick: l[1] || (l[1] = (i) => V(o)())\n }, \"Reset\", 8, Wa)\n ]));\n }\n}), za = /* @__PURE__ */ $e(Ga, [[\"__scopeId\", \"data-v-b700734f\"]]), qa = { class: \"aform_form-element\" }, Ya = [\"id\", \"disabled\", \"required\"], Xa = [\"for\"], ja = [\"innerHTML\"], Ja = /* @__PURE__ */ te({\n __name: \"ANumericInput\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\");\n return (n, o) => (w(), k(\"div\", qa, [\n J(y(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (a) => t.value = a),\n class: \"aform_input-field\",\n type: \"number\",\n disabled: e.readOnly,\n required: e.required\n }, null, 8, Ya), [\n [we, t.value]\n ]),\n y(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, K(e.label), 9, Xa),\n J(y(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, ja), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), an = {\n date: \"##/##/####\",\n datetime: \"####/##/## ##:##\",\n time: \"##:##\",\n fulltime: \"##:##:##\",\n phone: \"(###) ### - ####\",\n card: \"#### #### #### ####\"\n};\nfunction Qa(e) {\n try {\n return Function(`\"use strict\";return (${e})`)();\n } catch {\n }\n}\nfunction Ka(e) {\n let t = e.value;\n if (t) {\n const n = Qa(t);\n if (n) {\n const o = e.instance?.locale;\n t = n(o);\n }\n } else {\n const o = e.instance?.schema?.fieldtype?.toLowerCase();\n o && an[o] && (t = an[o]);\n }\n return t;\n}\nfunction es(e, t) {\n let n = e;\n const o = [t, \"/\", \"-\", \"(\", \")\", \" \"];\n for (const a of o)\n n = n.replaceAll(a, \"\");\n return n;\n}\nfunction ts(e, t, n) {\n let o = t;\n for (const a of e) {\n const r = o.indexOf(n);\n if (r !== -1) {\n const s = o.substring(0, r), l = o.substring(r + 1);\n o = s + a + l;\n }\n }\n return o.slice(0, t.length);\n}\nfunction ns(e, t) {\n const n = Ka(t);\n if (!n) return;\n const o = \"#\", a = e.value, r = es(a, o);\n if (r) {\n const s = ts(r, n, o);\n t.instance?.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;\n } else\n e.value = n;\n}\nconst os = { class: \"aform_form-element\" }, ls = [\"id\", \"disabled\", \"maxlength\", \"required\"], as = [\"for\"], ss = [\"innerHTML\"], rs = /* @__PURE__ */ te({\n __name: \"ATextInput\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = L(!0), n = ke(e, \"modelValue\");\n return (o, a) => (w(), k(\"div\", os, [\n J(y(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": a[0] || (a[0] = (r) => n.value = r),\n class: \"aform_input-field\",\n disabled: e.readOnly,\n maxlength: e.mask && t.value ? e.mask.length : void 0,\n required: e.required\n }, null, 8, ls), [\n [we, n.value],\n [V(ns), e.mask]\n ]),\n y(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, K(e.label), 9, as),\n J(y(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, ss), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), is = { class: \"login-container\" }, us = { class: \"account-container\" }, cs = { class: \"account-header\" }, ds = { id: \"account-title\" }, fs = { id: \"account-subtitle\" }, vs = { class: \"login-form-container\" }, ps = { class: \"login-form-email aform_form-element\" }, ms = [\"disabled\"], hs = { class: \"login-form-password aform_form-element\" }, gs = [\"disabled\"], ws = [\"disabled\"], ys = {\n key: 0,\n class: \"material-symbols-outlined loading-icon\"\n}, xs = /* @__PURE__ */ te({\n __name: \"Login\",\n props: {\n headerTitle: { default: \"Login\" },\n headerSubtitle: { default: \"Enter your email and password to login\" }\n },\n emits: [\"loginFailed\", \"loginSuccess\"],\n setup(e, { emit: t }) {\n const n = t, o = L(\"\"), a = L(\"\"), r = L(!1), s = L(!1);\n function l(i) {\n if (i.preventDefault(), r.value = !0, s.value) {\n r.value = !1, n(\"loginFailed\");\n return;\n }\n r.value = !1, n(\"loginSuccess\");\n }\n return (i, u) => (w(), k(\"div\", is, [\n y(\"div\", null, [\n y(\"div\", us, [\n y(\"div\", cs, [\n y(\"h1\", ds, K(e.headerTitle), 1),\n y(\"p\", fs, K(e.headerSubtitle), 1)\n ]),\n y(\"form\", { onSubmit: l }, [\n y(\"div\", vs, [\n y(\"div\", ps, [\n u[2] || (u[2] = y(\"label\", {\n id: \"login-email\",\n for: \"email\",\n class: \"aform_field-label\"\n }, \"Email\", -1)),\n J(y(\"input\", {\n id: \"email\",\n \"onUpdate:modelValue\": u[0] || (u[0] = (c) => o.value = c),\n class: \"aform_input-field\",\n name: \"email\",\n placeholder: \"name@example.com\",\n type: \"email\",\n \"auto-capitalize\": \"none\",\n \"auto-complete\": \"email\",\n \"auto-correct\": \"off\",\n disabled: r.value\n }, null, 8, ms), [\n [we, o.value]\n ])\n ]),\n y(\"div\", hs, [\n u[3] || (u[3] = y(\"label\", {\n id: \"login-password\",\n for: \"password\",\n class: \"aform_field-label\"\n }, \"Password\", -1)),\n J(y(\"input\", {\n id: \"password\",\n \"onUpdate:modelValue\": u[1] || (u[1] = (c) => a.value = c),\n class: \"aform_input-field\",\n name: \"password\",\n type: \"password\",\n disabled: r.value\n }, null, 8, gs), [\n [we, a.value]\n ])\n ]),\n y(\"button\", {\n class: \"btn\",\n disabled: r.value || !o.value || !a.value,\n onClick: l\n }, [\n r.value ? (w(), k(\"span\", ys, \"progress_activity\")) : q(\"\", !0),\n u[4] || (u[4] = y(\"span\", { id: \"login-form-button\" }, \"Login\", -1))\n ], 8, ws)\n ])\n ], 32),\n u[5] || (u[5] = y(\"button\", { class: \"btn\" }, [\n y(\"span\", { id: \"forgot-password-button\" }, \"Forgot password?\")\n ], -1))\n ])\n ])\n ]));\n }\n}), ks = /* @__PURE__ */ $e(xs, [[\"__scopeId\", \"data-v-d9ffd0a7\"]]);\nfunction Ms(e) {\n e.use(Dl), e.component(\"ACheckbox\", Ol), e.component(\"ACombobox\", _l), e.component(\"ADate\", Ul), e.component(\"ADropdown\", ra), e.component(\"ADatePicker\", La), e.component(\"AFieldset\", Za), e.component(\"AFileAttach\", za), e.component(\"AForm\", Mn), e.component(\"ANumericInput\", Ja), e.component(\"ATextInput\", rs);\n}\nexport {\n Ol as ACheckbox,\n _l as AComboBox,\n Ul as ADate,\n La as ADatePicker,\n ra as ADropdown,\n Za as AFieldset,\n za as AFileAttach,\n Mn as AForm,\n Ja as ANumericInput,\n rs as ATextInput,\n ks as Login,\n Ms as install\n};\n//# sourceMappingURL=aform.js.map\n","<template>\n\t<footer>\n\t\t<ul class=\"tabs\">\n\t\t\t<li class=\"hidebreadcrumbs\" @click=\"toggleBreadcrumbs\" @keydown.enter=\"toggleBreadcrumbs\">\n\t\t\t\t<a tabindex=\"0\"><div :class=\"rotateHideTabIcon\">×</div></a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tclass=\"hometab\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\"\n\t\t\t\t@click=\"navigateHome\"\n\t\t\t\t@keydown.enter=\"navigateHome\">\n\t\t\t\t<router-link to=\"/\" tabindex=\"0\">\n\t\t\t\t\t<svg class=\"icon\" aria-label=\"Home\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n\t\t\t\t\t\t<path d=\"M3 12l9-9 9 9\" />\n\t\t\t\t\t\t<path d=\"M9 21V12h6v9\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</router-link>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\t:class=\"['searchtab', { 'search-active': searchVisible }]\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<a tabindex=\"0\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tv-show=\"!searchVisible\"\n\t\t\t\t\t\tclass=\"icon search-icon\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Search\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t@click=\"toggleSearch\"\n\t\t\t\t\t\t@keydown.enter=\"toggleSearch\">\n\t\t\t\t\t\t<circle cx=\"11\" cy=\"11\" r=\"7\" />\n\t\t\t\t\t\t<path d=\"M21 21l-4.35-4.35\" />\n\t\t\t\t\t</svg>\n\t\t\t\t\t<input\n\t\t\t\t\t\tv-show=\"searchVisible\"\n\t\t\t\t\t\tref=\"searchinput\"\n\t\t\t\t\t\tv-model=\"searchText\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t\t\t@click.stop\n\t\t\t\t\t\t@input=\"handleSearchInput($event)\"\n\t\t\t\t\t\t@blur=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.escape=\"toggleSearch\" />\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tv-for=\"breadcrumb in breadcrumbs\"\n\t\t\t\t:key=\"breadcrumb.title\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<router-link tabindex=\"0\" :to=\"breadcrumb.to\"> {{ breadcrumb.title }} </router-link>\n\t\t\t</li>\n\t\t</ul>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nconst { breadcrumbs = [] } = defineProps<{ breadcrumbs?: { title: string; to: string }[] }>()\n\nconst breadcrumbsVisibile = ref(true)\nconst searchVisible = ref(false)\nconst searchText = ref('')\nconst inputRef = useTemplateRef<HTMLInputElement>('searchinput')\n\nconst rotateHideTabIcon = computed(() => {\n\treturn breadcrumbsVisibile.value ? 'unrotated' : 'rotated'\n})\n\nconst toggleBreadcrumbs = () => {\n\tbreadcrumbsVisibile.value = !breadcrumbsVisibile.value\n}\n\nconst toggleSearch = async () => {\n\tsearchVisible.value = !searchVisible.value\n\tawait nextTick(() => {\n\t\tinputRef.value?.focus()\n\t})\n}\n\nconst handleSearchInput = (event: Event | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n}\n\nconst handleSearch = async (event: FocusEvent | KeyboardEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tawait toggleSearch()\n}\n\nconst navigateHome = (/* event: MouseEvent | KeyboardEvent */) => {\n\t// navigate home\n}\n</script>\n\n<style scoped>\nfooter {\n\tposition: fixed;\n\tbottom: 0px;\n\twidth: 100%;\n\tbackground-color: transparent;\n\theight: auto;\n\tmin-height: 2.4rem;\n\tz-index: 100;\n\ttext-align: left;\n\tfont-size: 100%;\n\tdisplay: flex;\n\tjustify-content: right;\n\tpadding: 0 0.75rem 0 0;\n\tbox-sizing: border-box;\n}\nul {\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.tabs li {\n\tfloat: left;\n\tlist-style-type: none;\n\tposition: relative;\n\tmargin-left: -1px;\n}\n\n/* Base tab styling */\n.tabs a {\n\tfloat: left;\n\tpadding: 0.5rem 1rem;\n\theight: 2.4rem;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttext-decoration: none;\n\tcolor: var(--sc-gray-60, #666);\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tfont-size: 0.85rem;\n\tfont-family: var(--sc-font-family, system-ui, sans-serif);\n\ttransition: all 0.15s ease;\n\n\t/* Minimal ornamentation - subtle top radius only */\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n}\n\n.tabs a:hover {\n\tbackground: var(--sc-btn-hover, #f2f2f2);\n}\n\n.tabs .router-link-active {\n\tz-index: 3;\n\tbackground: var(--sc-primary-color, #827553) !important;\n\tborder-color: var(--sc-primary-color, #827553) !important;\n\tcolor: var(--sc-primary-text-color, #fff) !important;\n}\n\n/* Pseudo-elements removed - minimal ornamentation style */\n\n/* Hide breadcrumbs tab */\n.hidebreadcrumbs a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n.hidebreadcrumbs a div {\n\tfont-size: 1.2rem;\n}\n\n.rotated {\n\ttransform: rotate(45deg);\n\t-webkit-transform: rotate(45deg);\n\t-moz-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\t-o-transform: rotate(45deg);\n\ttransition: transform 250ms ease;\n}\n.unrotated {\n\ttransform: rotate(0deg);\n\t-webkit-transform: rotate(0deg);\n\t-moz-transform: rotate(0deg);\n\t-ms-transform: rotate(0deg);\n\t-o-transform: rotate(0deg);\n\ttransition: transform 250ms ease;\n}\n\nli:active,\nli:hover,\nli:focus,\nli > a:active,\nli > a:hover,\nli > a:focus {\n\tz-index: 3;\n}\n\na:active,\na:hover,\na:focus {\n\toutline: 2px solid var(--sc-input-active-border-color, black);\n\tz-index: 3;\n}\n\n/* Home tab */\n.hometab a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n/* SVG icon styling */\n.icon {\n\twidth: 1rem;\n\theight: 1rem;\n\tstroke: currentColor;\n\tflex-shrink: 0;\n}\n\n/* Search tab with animation */\n.searchtab {\n\toverflow: hidden;\n}\n\n.searchtab a {\n\tmin-width: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n\toverflow: hidden;\n\t/* Animation for smooth expand/collapse */\n\tmax-width: 2.4rem;\n\ttransition: max-width 0.35s ease-in-out, padding 0.35s ease-in-out, background 0.2s ease;\n}\n\n.searchtab .search-icon {\n\tcursor: pointer;\n}\n\n.searchtab input {\n\toutline: none;\n\tborder: 1px solid var(--sc-input-border-color, #ccc);\n\tborder-radius: 0.25rem;\n\tbackground-color: var(--sc-form-background, #ffffff);\n\tcolor: var(--sc-gray-80, #333);\n\ttext-align: left;\n\tfont-size: 0.875rem;\n\tpadding: 0.25rem 0.5rem;\n\twidth: 180px;\n\theight: 1.5rem;\n\tflex-shrink: 0;\n\topacity: 0;\n\ttransition: opacity 0.2s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.searchtab input:focus {\n\tborder-color: var(--sc-input-active-border-color, #4f46e5);\n\toutline: none;\n}\n\n.searchtab input::placeholder {\n\tcolor: var(--sc-input-label-color, #999);\n}\n\n/* Search active state - expanded with animation */\n.searchtab.search-active a {\n\tmax-width: 200px;\n\tmin-width: auto;\n\twidth: auto;\n\tpadding: 0.5rem 0.75rem;\n}\n\n.searchtab.search-active input {\n\topacity: 1;\n\ttransition-delay: 0.15s;\n}\n</style>\n","<template>\n\t<div class=\"desktop\" @click=\"handleClick\">\n\t\t<!-- Action Set -->\n\t\t<ActionSet :elements=\"actionElements\" @action-click=\"handleActionClick\" />\n\n\t\t<!-- Main content using AForm -->\n\t\t<AForm v-if=\"writableSchema.length > 0\" v-model=\"writableSchema\" :data=\"currentViewData\" />\n\t\t<div v-else-if=\"!stonecrop\" class=\"loading\"><p>Initializing Stonecrop...</p></div>\n\t\t<div v-else class=\"loading\">\n\t\t\t<p>Loading {{ currentView }} data...</p>\n\t\t</div>\n\n\t\t<!-- Sheet Navigation -->\n\t\t<SheetNav :breadcrumbs=\"navigationBreadcrumbs\" />\n\n\t\t<!-- Command Palette -->\n\t\t<CommandPalette\n\t\t\t:is-open=\"commandPaletteOpen\"\n\t\t\t:search=\"searchCommands\"\n\t\t\tplaceholder=\"Type a command or search...\"\n\t\t\t@select=\"executeCommand\"\n\t\t\t@close=\"commandPaletteOpen = false\">\n\t\t\t<template #title=\"{ result }\">\n\t\t\t\t{{ result.title }}\n\t\t\t</template>\n\t\t\t<template #content=\"{ result }\">\n\t\t\t\t{{ result.description }}\n\t\t\t</template>\n\t\t</CommandPalette>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { useStonecrop } from '@stonecrop/stonecrop'\nimport { AForm, type SchemaTypes, type TableColumn, type TableConfig } from '@stonecrop/aform'\nimport { computed, nextTick, onMounted, provide, ref, unref, watch } from 'vue'\n\nimport ActionSet from './ActionSet.vue'\nimport SheetNav from './SheetNav.vue'\nimport CommandPalette from './CommandPalette.vue'\nimport type { ActionElements } from '../types'\n\nconst { availableDoctypes = [] } = defineProps<{ availableDoctypes?: string[] }>()\n\nconst { stonecrop } = useStonecrop()\n\n// State\nconst loading = ref(false)\nconst saving = ref(false)\nconst commandPaletteOpen = ref(false)\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed property that reads from HST store for reactive form data\nconst currentViewData = computed<Record<string, any>>({\n\tget() {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn {}\n\t\t}\n\n\t\ttry {\n\t\t\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\treturn record?.get('') || {}\n\t\t} catch {\n\t\t\treturn {}\n\t\t}\n\t},\n\tset(newData: Record<string, any>) {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\t// Update each field in HST, which will automatically trigger field actions\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\t\t\tfor (const [fieldname, value] of Object.entries(newData)) {\n\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${fieldname}`\n\t\t\t\thstStore.set(fieldPath, value)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST update failed:', error)\n\t\t}\n\t},\n})\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed properties for current route context\nconst route = computed(() => unref(stonecrop.value?.registry.router?.currentRoute))\nconst router = computed(() => stonecrop.value?.registry.router)\nconst currentDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// First check if we have actualDoctype in meta (from registered routes)\n\tif (route.value.meta?.actualDoctype) {\n\t\treturn route.value.meta.actualDoctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\n// The route doctype for display and navigation (e.g., 'todo')\nconst routeDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// Check route meta first\n\tif (route.value.meta?.doctype) {\n\t\treturn route.value.meta.doctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\nconst currentRecordId = computed(() => {\n\tif (!route.value) return ''\n\n\t// For named routes, use params.recordId\n\tif (route.value.params.recordId) {\n\t\treturn route.value.params.recordId as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 1) {\n\t\treturn pathMatch[1]\n\t}\n\n\treturn ''\n})\nconst isNewRecord = computed(() => currentRecordId.value?.startsWith('new-'))\n\n// Determine current view based on route\nconst currentView = computed(() => {\n\tif (!route.value) {\n\t\treturn 'doctypes'\n\t}\n\n\t// Home route\n\tif (route.value.name === 'home' || route.value.path === '/') {\n\t\treturn 'doctypes'\n\t}\n\n\t// Named routes from registered doctypes\n\tif (route.value.name && route.value.name !== 'catch-all') {\n\t\tconst routeName = route.value.name as string\n\t\tif (routeName.includes('form') || route.value.params.recordId) {\n\t\t\treturn 'record'\n\t\t} else if (routeName.includes('list') || route.value.params.doctype) {\n\t\t\treturn 'records'\n\t\t}\n\t}\n\n\t// Catch-all route - determine from path structure\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\tconst view = pathMatch.length === 1 ? 'records' : 'record'\n\t\treturn view\n\t}\n\n\treturn 'doctypes'\n})\n\n// Computed properties (now that all helper functions are defined)\n// Helper function to get available transitions for current record\nconst getAvailableTransitions = () => {\n\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\treturn []\n\t}\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (!meta?.workflow?.states) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get current FSM state (for now, use workflow initial state or 'editing')\n\t\t// In a full implementation, this would track actual FSM state\n\t\tconst currentState = isNewRecord.value ? 'creating' : 'editing'\n\t\tconst stateConfig = meta.workflow.states[currentState]\n\n\t\tif (!stateConfig?.on) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get available transitions from current state\n\t\tconst transitions = Object.keys(stateConfig.on)\n\n\t\t// Create action elements for each transition\n\t\tconst actionElements = transitions.map(transition => {\n\t\t\tconst targetState = stateConfig.on?.[transition]\n\t\t\tconst targetStateName = typeof targetState === 'string' ? targetState : 'unknown'\n\n\t\t\tconst actionFn = async () => {\n\t\t\t\tconst node = stonecrop.value?.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\t\tif (node) {\n\t\t\t\t\tconst recordData = currentViewData.value || {}\n\t\t\t\t\tawait node.triggerTransition(transition, {\n\t\t\t\t\t\tcurrentState,\n\t\t\t\t\t\ttargetState: targetStateName,\n\t\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst element = {\n\t\t\t\tlabel: `${transition} (→ ${targetStateName})`,\n\t\t\t\taction: actionFn,\n\t\t\t}\n\n\t\t\treturn element\n\t\t})\n\n\t\treturn actionElements\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error getting available transitions:', error)\n\t\treturn []\n\t}\n}\n\n// New component reactive properties// New component reactive properties\nconst actionElements = computed<ActionElements[]>(() => {\n\tconst elements: ActionElements[] = []\n\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\telements.push({\n\t\t\t\ttype: 'button',\n\t\t\t\tlabel: 'Refresh',\n\t\t\t\taction: () => {\n\t\t\t\t\t// Refresh doctypes\n\t\t\t\t\twindow.location.reload()\n\t\t\t\t},\n\t\t\t})\n\t\t\tbreak\n\t\tcase 'records':\n\t\t\telements.push(\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'New Record',\n\t\t\t\t\taction: () => void createNewRecord(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'Refresh',\n\t\t\t\t\taction: () => {\n\t\t\t\t\t\t// Refresh records\n\t\t\t\t\t\twindow.location.reload()\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t)\n\t\t\tbreak\n\t\tcase 'record': {\n\t\t\t// Add XState Transitions dropdown for record view\n\t\t\tconst transitionActions = getAvailableTransitions()\n\t\t\tif (transitionActions.length > 0) {\n\t\t\t\telements.push({\n\t\t\t\t\ttype: 'dropdown',\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tactions: transitionActions,\n\t\t\t\t})\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn elements\n})\n\nconst navigationBreadcrumbs = computed(() => {\n\tconst breadcrumbs: { title: string; to: string }[] = []\n\n\tif (currentView.value === 'records' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` }\n\t\t)\n\t} else if (currentView.value === 'record' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` },\n\t\t\t{ title: isNewRecord.value ? 'New Record' : 'Edit Record', to: route.value?.fullPath || '' }\n\t\t)\n\t}\n\n\treturn breadcrumbs\n})\n\n// Command palette functionality\ntype Command = {\n\ttitle: string\n\tdescription: string\n\taction: () => void\n}\n\nconst searchCommands = (query: string): Command[] => {\n\tconst commands: Command[] = [\n\t\t{\n\t\t\ttitle: 'Go Home',\n\t\t\tdescription: 'Navigate to the home page',\n\t\t\taction: () => void router.value?.push('/'),\n\t\t},\n\t\t{\n\t\t\ttitle: 'Toggle Command Palette',\n\t\t\tdescription: 'Open/close the command palette',\n\t\t\taction: () => (commandPaletteOpen.value = !commandPaletteOpen.value),\n\t\t},\n\t]\n\n\t// Add doctype-specific commands\n\tif (routeDoctype.value) {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(routeDoctype.value)} Records`,\n\t\t\tdescription: `Navigate to ${routeDoctype.value} list`,\n\t\t\taction: () => void router.value?.push(`/${routeDoctype.value}`),\n\t\t})\n\n\t\tcommands.push({\n\t\t\ttitle: `Create New ${formatDoctypeName(routeDoctype.value)}`,\n\t\t\tdescription: `Create a new ${routeDoctype.value} record`,\n\t\t\taction: () => void createNewRecord(),\n\t\t})\n\t}\n\n\t// Add available doctypes as commands\n\tavailableDoctypes.forEach(doctype => {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(doctype)}`,\n\t\t\tdescription: `Navigate to ${doctype} list`,\n\t\t\taction: () => void router.value?.push(`/${doctype}`),\n\t\t})\n\t})\n\n\t// Filter commands based on query\n\tif (!query) return commands\n\n\treturn commands.filter(\n\t\tcmd =>\n\t\t\tcmd.title.toLowerCase().includes(query.toLowerCase()) ||\n\t\t\tcmd.description.toLowerCase().includes(query.toLowerCase())\n\t)\n}\n\nconst executeCommand = (command: Command) => {\n\tcommand.action()\n\tcommandPaletteOpen.value = false\n}\n\n// Helper functions - moved here to avoid \"before initialization\" errors\nconst formatDoctypeName = (doctype: string): string => {\n\treturn doctype\n\t\t.split('-')\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(' ')\n}\n\nconst getRecordCount = (doctype: string): number => {\n\tif (!stonecrop.value) return 0\n\tconst recordIds = stonecrop.value.getRecordIds(doctype)\n\treturn recordIds.length\n}\n\nconst navigateToDoctype = async (doctype: string) => {\n\tawait router.value?.push(`/${doctype}`)\n}\n\nconst openRecord = async (recordId: string) => {\n\tawait router.value?.push(`/${routeDoctype.value}/${recordId}`)\n}\n\nconst createNewRecord = async () => {\n\tconst newId = `new-${Date.now()}`\n\tawait router.value?.push(`/${routeDoctype.value}/${newId}`)\n}\n\n// Doctype metadata loader - simplified since router handles most of this\nconst loadDoctypeMetadata = (doctype: string) => {\n\tif (!stonecrop.value) return\n\n\t// Ensure the doctype structure exists in HST\n\t// The router should have already loaded the metadata, but this ensures the HST structure exists\n\ttry {\n\t\tstonecrop.value.records(doctype)\n\t} catch (error) {\n\t\t// Silent error handling - structure will be created if needed\n\t}\n}\n\n// Schema generator functions - moved here to be available to computed properties\nconst getDoctypesSchema = (): SchemaTypes[] => {\n\tif (!availableDoctypes.length) return []\n\n\tconst rows = availableDoctypes.map(doctype => ({\n\t\tid: doctype,\n\t\tdoctype,\n\t\tdisplay_name: formatDoctypeName(doctype),\n\t\trecord_count: getRecordCount(doctype),\n\t\tactions: 'View Records',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<h1>Available Doctypes</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'doctypes_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Doctype',\n\t\t\t\t\tname: 'doctype',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Name',\n\t\t\t\t\tname: 'display_name',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '30ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Records',\n\t\t\t\t\tname: 'record_count',\n\t\t\t\t\tfieldtype: 'Int',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '15ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordsSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\tconst records = getRecords()\n\tconst columns = getColumns()\n\n\t// If no columns are available, show a loading or empty state\n\tif (columns.length === 0) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'loading',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} schema...</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst rows = records.map((record: any) => ({\n\t\t...record,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tid: record.id || '',\n\t\tactions: 'Edit | Delete',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t</nav>\n\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'actions',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\tNew ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t...(records.length === 0\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'empty_state',\n\t\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\t\tvalue: `\n\t\t\t\t\t\t\t<div class=\"empty-state\">\n\t\t\t\t\t\t\t\t<p>No ${routeDoctype.value || currentDoctype.value} records found.</p>\n\t\t\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\t\t\t\tCreate First Record\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`,\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'records_table',\n\t\t\t\t\t\tcomponent: 'ATable',\n\t\t\t\t\t\tcolumns: [\n\t\t\t\t\t\t\t...columns.map(col => ({\n\t\t\t\t\t\t\t\tlabel: col.label,\n\t\t\t\t\t\t\t\tname: col.fieldname,\n\t\t\t\t\t\t\t\tfieldtype: col.fieldtype,\n\t\t\t\t\t\t\t\talign: 'left',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\t\t\t\tname: 'actions',\n\t\t\t\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] as TableColumn[],\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tview: 'list',\n\t\t\t\t\t\t\tfullWidth: true,\n\t\t\t\t\t\t} as TableConfig,\n\t\t\t\t\t\trows,\n\t\t\t\t\t},\n\t\t\t ]),\n\t]\n}\n\nconst getRecordFormSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value?.registry\n\t\tconst meta = registry?.registry[currentDoctype.value]\n\n\t\tif (!meta?.schema) {\n\t\t\t// Return loading state if schema isn't available yet\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'header',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t\t)}</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t\t<h1>${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}</h1>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'loading',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} form...</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\tconst currentRecord = getCurrentRecord()\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t)}</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>\n\t\t\t\t\t\t\t${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'actions',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"save\" ${saving.value ? 'disabled' : ''}>\n\t\t\t\t\t\t\t${saving.value ? 'Saving...' : 'Save'}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button class=\"btn-secondary\" data-action=\"cancel\">Cancel</button>\n\t\t\t\t\t\t${!isNewRecord.value ? '<button class=\"btn-danger\" data-action=\"delete\">Delete</button>' : ''}\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t...schemaArray.map(field => ({\n\t\t\t\t...field,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\tvalue: currentRecord[field.fieldname] || '',\n\t\t\t})),\n\t\t]\n\t} catch (error) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'error',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"error-state\">\n\t\t\t\t\t\t<p>Unable to load form schema for ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n}\n\n// Additional data helper functions\nconst getRecords = () => {\n\tif (!stonecrop.value || !currentDoctype.value) {\n\t\treturn []\n\t}\n\n\tconst recordsNode = stonecrop.value.records(currentDoctype.value)\n\tconst recordsData = recordsNode?.get('')\n\n\tif (recordsData && typeof recordsData === 'object' && !Array.isArray(recordsData)) {\n\t\treturn Object.values(recordsData as Record<string, any>)\n\t}\n\n\treturn []\n}\n\nconst getColumns = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (meta?.schema) {\n\t\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\t\treturn schemaArray.map(field => ({\n\t\t\t\tfieldname: field.fieldname,\n\t\t\t\tlabel: ('label' in field && field.label) || field.fieldname,\n\t\t\t\tfieldtype: ('fieldtype' in field && field.fieldtype) || 'Data',\n\t\t\t}))\n\t\t}\n\t} catch (error) {\n\t\t// Error getting schema - return empty array\n\t}\n\n\treturn []\n}\n\nconst getCurrentRecord = () => {\n\tif (!stonecrop.value || !currentDoctype.value || isNewRecord.value) return {}\n\n\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\treturn record?.get('') || {}\n}\n\n// Schema for different views - defined here after all helper functions are available\nconst currentViewSchema = computed<SchemaTypes[]>(() => {\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\treturn getDoctypesSchema()\n\t\tcase 'records':\n\t\t\treturn getRecordsSchema()\n\t\tcase 'record':\n\t\t\treturn getRecordFormSchema()\n\t\tdefault:\n\t\t\treturn []\n\t}\n})\n\n// Writable schema for AForm v-model binding\nconst writableSchema = ref<SchemaTypes[]>([])\n\n// Sync computed schema to writable schema when it changes\nwatch(\n\tcurrentViewSchema,\n\tnewSchema => {\n\t\twritableSchema.value = [...newSchema]\n\t},\n\t{ immediate: true, deep: true }\n)\n\n// Watch for field changes in writable schema and sync to HST\nwatch(\n\twritableSchema,\n\tnewSchema => {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value || isNewRecord.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\n\t\t\t// Process form field updates from schema\n\t\t\tnewSchema.forEach(field => {\n\t\t\t\t// Only process fields that have a fieldname and value (form fields)\n\t\t\t\tif (\n\t\t\t\t\tfield.fieldname &&\n\t\t\t\t\t'value' in field &&\n\t\t\t\t\t!['header', 'actions', 'loading', 'error'].includes(field.fieldname)\n\t\t\t\t) {\n\t\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${field.fieldname}`\n\t\t\t\t\tconst currentValue = hstStore.has(fieldPath) ? hstStore.get(fieldPath) : undefined\n\n\t\t\t\t\t// Only update if value actually changed to avoid infinite loops\n\t\t\t\t\tif (currentValue !== field.value) {\n\t\t\t\t\t\thstStore.set(fieldPath, field.value)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST schema sync failed:', error)\n\t\t}\n\t},\n\t{ deep: true }\n)\n\n// Action handlers (will be triggered by button clicks in the UI)\nconst handleSave = async () => {\n\t// eslint-disable-next-line no-console\n\tif (!stonecrop.value) return\n\n\tsaving.value = true\n\n\ttry {\n\t\tconst formData = currentViewData.value || {}\n\n\t\tif (isNewRecord.value) {\n\t\t\tconst newId = `record-${Date.now()}`\n\t\t\tconst recordData = { id: newId, ...formData }\n\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, newId, recordData)\n\n\t\t\t// Trigger SAVE transition for new record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, newId)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'creating',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tawait router.value?.replace(`/${routeDoctype.value}/${newId}`)\n\t\t} else {\n\t\t\tconst recordData = { id: currentRecordId.value, ...formData }\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, currentRecordId.value, recordData)\n\n\t\t\t// Trigger SAVE transition for existing record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\t// Silently handle error\n\t} finally {\n\t\tsaving.value = false\n\t}\n}\n\nconst handleCancel = async () => {\n\tif (isNewRecord.value) {\n\t\t// For new records, we don't have a specific record node yet\n\t\t// Just navigate back without triggering transition\n\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t} else {\n\t\t// Trigger CANCEL transition for existing record\n\t\tif (stonecrop.value) {\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('CANCEL', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'cancelled',\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t// Reload current record data\n\t\tloadRecordData()\n\t}\n}\n\nconst handleActionClick = (label: string, action: (() => void | Promise<void>) | undefined) => {\n\t// eslint-disable-next-line no-console\n\tif (action) {\n\t\tvoid action()\n\t}\n}\n\nconst handleDelete = async (recordId?: string) => {\n\tif (!stonecrop.value) return\n\n\tconst targetRecordId = recordId || currentRecordId.value\n\tif (!targetRecordId) return\n\n\tif (confirm('Are you sure you want to delete this record?')) {\n\t\t// Trigger DELETE transition before removing\n\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, targetRecordId)\n\t\tif (node) {\n\t\t\tawait node.triggerTransition('DELETE', {\n\t\t\t\tcurrentState: 'editing',\n\t\t\t\ttargetState: 'deleted',\n\t\t\t})\n\t\t}\n\n\t\tstonecrop.value.removeRecord(currentDoctype.value, targetRecordId)\n\n\t\tif (currentView.value === 'record') {\n\t\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t\t}\n\t}\n}\n\n// Event handlers\nconst handleClick = async (event: Event) => {\n\tconst target = event.target as HTMLElement\n\tconst action = target.getAttribute('data-action')\n\n\tif (action) {\n\t\tswitch (action) {\n\t\t\tcase 'create':\n\t\t\t\tawait createNewRecord()\n\t\t\t\tbreak\n\t\t\tcase 'save':\n\t\t\t\tawait handleSave()\n\t\t\t\tbreak\n\t\t\tcase 'cancel':\n\t\t\t\tawait handleCancel()\n\t\t\t\tbreak\n\t\t\tcase 'delete':\n\t\t\t\tawait handleDelete()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Handle table cell clicks for actions\n\tconst cell = target.closest('td, th')\n\tif (cell) {\n\t\tconst cellText = cell.textContent?.trim()\n\t\tconst row = cell.closest('tr')\n\n\t\tif (cellText === 'View Records' && row) {\n\t\t\t// Get the doctype from the row data\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst doctypeCell = cells[1] // Assuming doctype is in second column (first column is index)\n\t\t\t\tconst doctype = doctypeCell.textContent?.trim()\n\t\t\t\tif (doctype) {\n\t\t\t\t\tawait navigateToDoctype(doctype)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Edit') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait openRecord(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Delete') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait handleDelete(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Watch for route changes to load appropriate data\nwatch(\n\t[currentView, currentDoctype, currentRecordId],\n\t() => {\n\t\tif (currentView.value === 'record') {\n\t\t\tloadRecordData()\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for Stonecrop instance to become available\nwatch(\n\tstonecrop,\n\tnewStonecrop => {\n\t\tif (newStonecrop) {\n\t\t\t// Force a re-evaluation of the current view schema when Stonecrop becomes available\n\t\t\t// This is handled automatically by the reactive computed properties\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for when we need to load data for records view\nwatch(\n\t[currentView, currentDoctype, stonecrop],\n\t([view, doctype, stonecropInstance]) => {\n\t\tif (view === 'records' && doctype && stonecropInstance) {\n\t\t\t// Ensure doctype metadata is loaded\n\t\t\tloadDoctypeMetadata(doctype)\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\nconst loadRecordData = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return\n\n\tloading.value = true\n\n\ttry {\n\t\tif (!isNewRecord.value) {\n\t\t\t// For existing records, ensure the record exists in HST\n\t\t\t// The computed currentViewData will automatically read from HST\n\t\t\tstonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t}\n\t\t// For new records, currentViewData computed property will return {} automatically\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error loading record data:', error)\n\t} finally {\n\t\tloading.value = false\n\t}\n}\n\n// Provide methods for action components\nconst desktopMethods = {\n\tnavigateToDoctype,\n\topenRecord,\n\tcreateNewRecord,\n\thandleSave,\n\thandleCancel,\n\thandleDelete,\n}\n\nprovide('desktopMethods', desktopMethods)\n\n// Register action components in Vue app\nonMounted(() => {\n\t// Wait a tick for stonecrop to be ready, then load initial data\n\tvoid nextTick(() => {\n\t\tif (currentView.value === 'records' && currentDoctype.value && stonecrop.value) {\n\t\t\tloadDoctypeMetadata(currentDoctype.value)\n\t\t}\n\t})\n\n\t// Components will be automatically registered via the global component system\n\n\t// Add keyboard shortcuts\n\tconst handleKeydown = (event: KeyboardEvent) => {\n\t\t// Ctrl+K or Cmd+K to open command palette\n\t\tif ((event.ctrlKey || event.metaKey) && event.key === 'k') {\n\t\t\tevent.preventDefault()\n\t\t\tcommandPaletteOpen.value = true\n\t\t}\n\t\t// Escape to close command palette\n\t\tif (event.key === 'Escape' && commandPaletteOpen.value) {\n\t\t\tcommandPaletteOpen.value = false\n\t\t}\n\t}\n\n\tdocument.addEventListener('keydown', handleKeydown)\n\n\t// Cleanup event listener on unmount\n\treturn () => {\n\t\tdocument.removeEventListener('keydown', handleKeydown)\n\t}\n})\n</script>\n","import { App, type Plugin } from 'vue'\n\nimport ActionSet from '../components/ActionSet.vue'\nimport CommandPalette from '../components/CommandPalette.vue'\nimport Desktop from '../components/Desktop.vue'\nimport SheetNav from '../components/SheetNav.vue'\n\n/**\n * This is the main plugin that will be used to register all the desktop components.\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App) => {\n\t\tapp.component('ActionSet', ActionSet)\n\t\tapp.component('CommandPalette', CommandPalette)\n\t\tapp.component('Desktop', Desktop)\n\t\tapp.component('SheetNav', SheetNav)\n\t},\n}\n\nexport default plugin\n"],"names":["emit","__emit","dropdownStates","ref","isOpen","timeoutId","hover","closeClicked","onMounted","closeDropdowns","onHover","onHoverLeave","toggleDropdown","index","showDropdown","handleClick","action","label","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_1","_cache","$event","_openBlock","_Fragment","_renderList","__props","el","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_withDirectives","_hoisted_5","_hoisted_6","item","itemIndex","_hoisted_7","_hoisted_9","_vShow","query","selectedIndex","inputRef","useTemplateRef","results","computed","watch","nextTick","closeModal","handleKeydown","e","selectResult","result","_createBlock","_Teleport","_createVNode","_Transition","_renderSlot","_ctx","te","G","me","n","Pe","Y","le","He","t","r","o","se","be","ze","Te","Xe","et","ee","nt","Ie","Ee","Ne","ot","st","z","Ce","ke","s","i","a","c","f","g","$e","B","b","A","ae","W","$","_e","d","v","x","N","D","p","R","de","P","F","S","C","w","T","L","m","y","E","O","_","U","ye","M","Ye","ce","Me","it","Ae","oe","Fe","Ue","at","ct","lt","Je","ut","je","tt","ft","qe","dt","Oe","pt","ht","gt","vt","Be","yt","Q","mt","q","re","rt","he","ge","St","bt","wt","Et","Ot","Le","Rt","We","j","At","Re","ve","_t","pe","u","l","h","I","V","H","ue","K","Ve","ne","Se","$t","Ke","jt","J","xe","Z","X","we","Qe","Dt","De","Ze","Kn","cn","xt","uo","ie","Yo","yn","ql","Ct","Kl","ta","Pa","Oa","_a","Ba","dn","k","Mn","breadcrumbsVisibile","searchVisible","searchText","rotateHideTabIcon","toggleBreadcrumbs","toggleSearch","handleSearchInput","event","handleSearch","navigateHome","_component_router_link","_withKeys","breadcrumb","_createTextVNode","stonecrop","useStonecrop","loading","saving","commandPaletteOpen","currentViewData","currentDoctype","currentRecordId","newData","hstStore","fieldname","value","fieldPath","error","route","unref","router","pathMatch","routeDoctype","isNewRecord","currentView","routeName","getAvailableTransitions","meta","currentState","stateConfig","transition","targetState","targetStateName","actionFn","node","recordData","actionElements","elements","createNewRecord","transitionActions","navigationBreadcrumbs","breadcrumbs","formatDoctypeName","searchCommands","commands","doctype","cmd","executeCommand","command","word","getRecordCount","navigateToDoctype","openRecord","recordId","newId","loadDoctypeMetadata","getDoctypesSchema","rows","getRecordsSchema","records","getRecords","columns","getColumns","record","col","getRecordFormSchema","schemaArray","currentRecord","getCurrentRecord","field","recordsData","currentViewSchema","writableSchema","newSchema","handleSave","formData","handleCancel","loadRecordData","handleActionClick","handleDelete","targetRecordId","target","cell","cellText","row","cells","newStonecrop","view","stonecropInstance","provide","ActionSet","_unref","AForm","SheetNav","CommandPalette","_withCtx","plugin","app","Desktop"],"mappings":";;;;;;;;AAyEA,UAAMA,IAAOC,GAKPC,IAAiBC,EAA6B,EAAE,GAEhDC,IAASD,EAAI,EAAK,GAClBE,IAAYF,EAAY,EAAE,GAC1BG,IAAQH,EAAI,EAAK,GACjBI,IAAeJ,EAAI,EAAK;AAE9B,IAAAK,GAAU,MAAM;AACf,MAA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jB,CAAwB,EADH,QAAAvQ,QAAM;AAAA,UACxB2K,GAAAnM,GAAAwB,EAAO,WAAW,GAAA,CAAA;AAAA,QAAA;;;;;ICfnBwQ,KAAiB;AAAA,EACtB,SAAS,CAACC,MAAa;AACtB,IAAAA,EAAI,UAAU,aAAaP,EAAS,GACpCO,EAAI,UAAU,kBAAkBH,EAAc,GAC9CG,EAAI,UAAU,WAAWC,EAAO,GAChCD,EAAI,UAAU,YAAYJ,EAAQ;AAAA,EACnC;AACD;"}
1
+ {"version":3,"file":"desktop.js","sources":["../src/components/ActionSet.vue","../src/components/CommandPalette.vue","../../common/temp/node_modules/.pnpm/pinia@3.0.4_typescript@5.9.3_vue@3.5.28_typescript@5.9.3_/node_modules/pinia/dist/pinia.mjs","../../stonecrop/dist/stonecrop.js","../../aform/dist/aform.js","../src/components/SheetNav.vue","../src/components/Desktop.vue","../src/plugins/index.ts"],"sourcesContent":["<template>\n\t<div\n\t\t:class=\"{ 'open-set': isOpen, 'hovered-and-closed': closeClicked }\"\n\t\tclass=\"action-set collapse\"\n\t\t@mouseover=\"onHover\"\n\t\t@mouseleave=\"onHoverLeave\">\n\t\t<div class=\"action-menu-icon\">\n\t\t\t<div id=\"chevron\" @click=\"closeClicked = !closeClicked\">\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"leftBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"54.2,33.4 29.2,58.8 25,54.6 50,29.2 \" />\n\t\t\t\t</svg>\n\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"rightBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"70.8,58.8 45.8,33.4 50,29.2 75,54.6 \" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"margin-right: 30px\"></div>\n\t\t<div v-for=\"(el, index) in elements\" :key=\"el.label\" class=\"action-element\">\n\t\t\t<button\n\t\t\t\tv-if=\"el.type == 'button'\"\n\t\t\t\t:disabled=\"el.disabled\"\n\t\t\t\tclass=\"button-default\"\n\t\t\t\t@click=\"handleClick(el.action, el.label)\">\n\t\t\t\t{{ el.label }}\n\t\t\t</button>\n\t\t\t<div v-if=\"el.type == 'dropdown'\">\n\t\t\t\t<button class=\"button-default\" @click=\"toggleDropdown(index)\">{{ el.label }}</button>\n\t\t\t\t<div v-show=\"dropdownStates[index]\" class=\"dropdown-container\">\n\t\t\t\t\t<div class=\"dropdown\">\n\t\t\t\t\t\t<div v-for=\"(item, itemIndex) in el.actions\" :key=\"item.label\">\n\t\t\t\t\t\t\t<button v-if=\"item.action != null\" class=\"dropdown-item\" @click=\"handleClick(item.action, item.label)\">\n\t\t\t\t\t\t\t\t{{ item.label }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a v-else-if=\"item.link != null\" :href=\"item.link\"\n\t\t\t\t\t\t\t\t><button class=\"dropdown-item\">{{ item.label }}</button></a\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue'\n\nimport type { ActionElements } from '../types'\n\nconst { elements = [] } = defineProps<{ elements?: ActionElements[] }>()\nconst emit = defineEmits<{\n\tactionClick: [label: string, action: (() => void | Promise<void>) | undefined]\n}>()\n\n// Track dropdown open state separately (index -> boolean)\nconst dropdownStates = ref<Record<number, boolean>>({})\n\nconst isOpen = ref(false)\nconst timeoutId = ref<number>(-1)\nconst hover = ref(false)\nconst closeClicked = ref(false)\n\nonMounted(() => {\n\tcloseDropdowns()\n})\n\nconst closeDropdowns = () => {\n\tdropdownStates.value = {}\n}\n\nconst onHover = () => {\n\thover.value = true\n\ttimeoutId.value = setTimeout(() => {\n\t\tif (hover.value) {\n\t\t\tisOpen.value = true\n\t\t}\n\t}, 500)\n}\n\nconst onHoverLeave = () => {\n\thover.value = false\n\tcloseClicked.value = false\n\tclearTimeout(timeoutId.value)\n\tisOpen.value = false\n}\n\nconst toggleDropdown = (index: number) => {\n\tconst showDropdown = !dropdownStates.value[index]\n\tcloseDropdowns()\n\tif (showDropdown) {\n\t\tdropdownStates.value[index] = true\n\t}\n}\n\nconst handleClick = (action: (() => void | Promise<void>) | undefined, label: string) => {\n\t// Emit event to parent - parent will handle execution\n\temit('actionClick', label, action)\n}\n</script>\n\n<style scoped>\n#chevron {\n\tposition: relative;\n\ttransform: rotate(90deg);\n}\n\n.leftBar,\n.rightBar {\n\ttransition-duration: 0.225s;\n\ttransition-property: transform;\n}\n\n.leftBar,\n.action-set.collapse.hovered-and-closed:hover .leftBar {\n\ttransform-origin: 33.4% 50%;\n\ttransform: rotate(90deg);\n}\n\n.rightBar,\n.action-set.collapse.hovered-and-closed:hover .rightBar {\n\ttransform-origin: 67% 50%;\n\ttransform: rotate(-90deg);\n}\n\n.rightBar {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n}\n\n.action-set.collapse:hover .leftBar {\n\ttransform: rotate(0);\n}\n\n.action-set.collapse:hover .rightBar {\n\ttransform: rotate(0);\n}\n\n.action-set {\n\tposition: fixed;\n\ttop: 10px;\n\tright: 10px;\n\tpadding: 20px;\n\tbox-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);\n\tborder-radius: 10px;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tbackground-color: white;\n\toverflow: hidden;\n\tz-index: 1001; /* Above SheetNav (100) and operation log button (999) */\n}\n\n.action-menu-icon {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 4px;\n}\n\n.action-menu-icon svg {\n\tfill: #333333;\n}\n\n.action-set.collapse,\n.action-set.collapse.hovered-and-closed:hover {\n\tmax-width: 25px;\n\toverflow: hidden;\n\n\t-webkit-transition: max-width 0.5s ease-in-out;\n\t-moz-transition: max-width 0.5s ease-in-out;\n\t-o-transition: max-width 0.5s ease-in-out;\n\ttransition: max-width 0.5s ease-in-out;\n}\n\n.action-set.collapse .action-element,\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0;\n\t-webkit-transition: opacity 0.25s ease-in-out;\n\t-moz-transition: opacity 0.25s ease-in-out;\n\t-o-transition: opacity 0.25s ease-in-out;\n\ttransition: opacity 0.25s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.action-set.collapse:hover {\n\tmax-width: 500px;\n}\n\n.action-set.collapse.open-set:hover {\n\toverflow: visible !important;\n}\n\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-set.collapse:hover .action-element {\n\topacity: 100 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-element {\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n\tposition: relative; /* Make this the positioning context for absolute children */\n}\nbutton.button-default {\n\tbackground-color: #ffffff;\n\tpadding: 5px 12px;\n\tborder-radius: 3px;\n\tbox-shadow: rgba(0, 0, 0, 0.05) 0px 0.5px 0px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,\n\t\trgba(0, 0, 0, 0.05) 0px 2px 4px 0px;\n\tborder: none;\n\tcursor: pointer;\n\twhite-space: nowrap;\n}\n\nbutton.button-default:hover {\n\tbackground-color: #f2f2f2;\n}\n\nbutton.button-default:disabled {\n\topacity: 0.5;\n\tcursor: not-allowed;\n\tbackground-color: #f5f5f5;\n\tcolor: #999;\n}\n\nbutton.button-default:disabled:hover {\n\tbackground-color: #f5f5f5;\n}\n\n.dropdown-container {\n\tposition: relative;\n}\n\n.dropdown {\n\tposition: absolute;\n\tright: 0;\n\tmin-width: 200px;\n\tbox-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);\n\tborder-radius: 10px;\n\tbackground-color: #ffffff;\n\tpadding: 10px;\n\tz-index: 1000;\n}\n\nbutton.dropdown-item {\n\twidth: 100%;\n\tpadding: 8px 5px;\n\ttext-align: left;\n\tborder: none;\n\tbackground-color: #ffffff;\n\tcursor: pointer;\n\tborder-radius: 5px;\n}\n\nbutton.dropdown-item:hover {\n\tbackground-color: #f2f2f2;\n}\n</style>\n","<template>\n\t<Teleport to=\"body\">\n\t\t<Transition name=\"fade\">\n\t\t\t<div v-if=\"isOpen\" class=\"command-palette-overlay\" @click=\"closeModal\">\n\t\t\t\t<div class=\"command-palette\" @click.stop>\n\t\t\t\t\t<div class=\"command-palette-header\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"command-palette-input\"\n\t\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\t@keydown=\"handleKeydown\" />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"results.length\" class=\"command-palette-results\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"(result, index) in results\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"command-palette-result\"\n\t\t\t\t\t\t\t:class=\"{ selected: index === selectedIndex }\"\n\t\t\t\t\t\t\t@click=\"selectResult(result)\"\n\t\t\t\t\t\t\t@mouseover=\"selectedIndex = index\">\n\t\t\t\t\t\t\t<div class=\"result-title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"result-content\">\n\t\t\t\t\t\t\t\t<slot name=\"content\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-else-if=\"query && !results.length\" class=\"command-palette-no-results\">\n\t\t\t\t\t\t<slot name=\"empty\"> No results found for \"{{ query }}\" </slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Transition>\n\t</Teleport>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { ref, computed, watch, nextTick, useTemplateRef } from 'vue'\n\ndefineSlots<{\n\ttitle?: { result: T }\n\tcontent?: { result: T }\n\tempty?: null\n}>()\n\nconst {\n\tsearch,\n\tisOpen = false,\n\tplaceholder = 'Type a command or search...',\n\tmaxResults = 10,\n} = defineProps<{\n\tsearch: (query: string) => T[]\n\tisOpen?: boolean\n\tplaceholder?: string\n\tmaxResults?: number\n}>()\n\nconst emit = defineEmits<{\n\tselect: [T]\n\tclose: []\n}>()\n\nconst query = ref('')\nconst selectedIndex = ref(0)\nconst inputRef = useTemplateRef('input')\n\nconst results = computed(() => {\n\tif (!query.value) return []\n\tconst results = search(query.value)\n\treturn results.slice(0, maxResults)\n})\n\n// reset search query when modal opens\nwatch(\n\t() => isOpen,\n\tasync isOpen => {\n\t\tif (isOpen) {\n\t\t\tquery.value = ''\n\t\t\tselectedIndex.value = 0\n\t\t\tawait nextTick()\n\t\t\t;(inputRef.value as HTMLInputElement)?.focus()\n\t\t}\n\t}\n)\n\n// reset selected index when results change\nwatch(results, () => {\n\tselectedIndex.value = 0\n})\n\nconst closeModal = () => {\n\temit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n\tswitch (e.key) {\n\t\tcase 'Escape':\n\t\t\tcloseModal()\n\t\t\tbreak\n\t\tcase 'ArrowDown':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value + 1) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'ArrowUp':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value - 1 + results.value.length) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'Enter':\n\t\t\tif (results.value.length && selectedIndex.value >= 0) {\n\t\t\t\tselectResult(results.value[selectedIndex.value])\n\t\t\t}\n\t\t\tbreak\n\t}\n}\n\nconst selectResult = (result: T) => {\n\temit('select', result)\n\tcloseModal()\n}\n</script>\n\n<style>\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 0.2s ease;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.command-palette-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.5);\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tz-index: 9999;\n\tpadding-top: 100px;\n}\n\n.command-palette {\n\twidth: 600px;\n\tmax-width: 90%;\n\tbackground-color: white;\n\tborder-radius: 8px;\n\tbox-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\toverflow: hidden;\n\tmax-height: 80vh;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.command-palette-header {\n\tdisplay: flex;\n\tborder-bottom: 1px solid #eaeaea;\n\tpadding: 12px;\n}\n\n.command-palette-input {\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tfont-size: 16px;\n\tpadding: 8px 12px;\n\tbackground-color: transparent;\n}\n\n.command-palette-close {\n\tbackground: transparent;\n\tborder: none;\n\tfont-size: 24px;\n\tcursor: pointer;\n\tcolor: #666;\n\tpadding: 0 8px;\n}\n\n.command-palette-close:hover {\n\tcolor: #333;\n}\n\n.command-palette-results {\n\toverflow-y: auto;\n\tmax-height: 60vh;\n}\n\n.command-palette-result {\n\tpadding: 12px 16px;\n\tcursor: pointer;\n\tborder-bottom: 1px solid #f0f0f0;\n}\n\n.command-palette-result:hover,\n.command-palette-result.selected {\n\tbackground-color: #f5f5f5;\n}\n\n.command-palette-result.selected {\n\tbackground-color: rgba(132, 60, 3, 0.1);\n}\n\n.result-title {\n\tfont-weight: 500;\n\tmargin-bottom: 4px;\n\tcolor: #333;\n}\n\n.result-content {\n\tfont-size: 14px;\n\tcolor: #666;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.command-palette-no-results {\n\tpadding: 20px 16px;\n\ttext-align: center;\n\tcolor: #666;\n}\n</style>\n","/*!\n * pinia v3.0.4\n * (c) 2025 Eduardo San Martin Morote\n * @license MIT\n */\nimport { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isRef, isReactive, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, nextTick, computed, toRefs } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\nconst IS_CLIENT = typeof window !== 'undefined';\n\n/**\n * setActivePinia must be called to handle SSR at the top of functions like\n * `fetch`, `setup`, `serverPrefetch` and others\n */\nlet activePinia;\n/**\n * Sets or unsets the active pinia. Used in SSR and internally when calling\n * actions and getters\n *\n * @param pinia - Pinia instance\n */\n// @ts-expect-error: cannot constrain the type of the return\nconst setActivePinia = (pinia) => (activePinia = pinia);\n/**\n * Get the currently active pinia if there is any.\n */\nconst getActivePinia = (process.env.NODE_ENV !== 'production')\n ? () => {\n const pinia = hasInjectionContext() && inject(piniaSymbol);\n if (!pinia && !IS_CLIENT) {\n console.error(`[🍍]: Pinia instance not found in context. This falls back to the global activePinia which exposes you to cross-request pollution on the server. Most of the time, it means you are calling \"useStore()\" in the wrong place.\\n` +\n `Read https://vuejs.org/guide/reusability/composables.html to learn more`);\n }\n return pinia || activePinia;\n }\n : () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia;\nconst piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol());\n\nfunction isPlainObject(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\no) {\n return (o &&\n typeof o === 'object' &&\n Object.prototype.toString.call(o) === '[object Object]' &&\n typeof o.toJSON !== 'function');\n}\n// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }\n// TODO: can we change these to numbers?\n/**\n * Possible types for SubscriptionCallback\n */\nvar MutationType;\n(function (MutationType) {\n /**\n * Direct mutation of the state:\n *\n * - `store.name = 'new name'`\n * - `store.$state.name = 'new name'`\n * - `store.list.push('new item')`\n */\n MutationType[\"direct\"] = \"direct\";\n /**\n * Mutated the state with `$patch` and an object\n *\n * - `store.$patch({ name: 'newName' })`\n */\n MutationType[\"patchObject\"] = \"patch object\";\n /**\n * Mutated the state with `$patch` and a function\n *\n * - `store.$patch(state => state.name = 'newName')`\n */\n MutationType[\"patchFunction\"] = \"patch function\";\n // maybe reset? for $state = {} and $reset\n})(MutationType || (MutationType = {}));\n\n/*\n * FileSaver.js A saveAs() FileSaver implementation.\n *\n * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin\n * Morote.\n *\n * License : MIT\n */\n// The one and only way of getting global scope in all environments\n// https://stackoverflow.com/q/3277182/1008999\nconst _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window\n ? window\n : typeof self === 'object' && self.self === self\n ? self\n : typeof global === 'object' && global.global === global\n ? global\n : typeof globalThis === 'object'\n ? globalThis\n : { HTMLElement: null })();\nfunction bom(blob, { autoBom = false } = {}) {\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (autoBom &&\n /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n }\n return blob;\n}\nfunction download(url, name, opts) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.responseType = 'blob';\n xhr.onload = function () {\n saveAs(xhr.response, name, opts);\n };\n xhr.onerror = function () {\n console.error('could not download file');\n };\n xhr.send();\n}\nfunction corsEnabled(url) {\n const xhr = new XMLHttpRequest();\n // use sync to avoid popup blocker\n xhr.open('HEAD', url, false);\n try {\n xhr.send();\n }\n catch (e) { }\n return xhr.status >= 200 && xhr.status <= 299;\n}\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n try {\n node.dispatchEvent(new MouseEvent('click'));\n }\n catch (e) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n detail: 0,\n screenX: 80,\n screenY: 20,\n clientX: 80,\n clientY: 20,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: null,\n });\n node.dispatchEvent(evt);\n }\n}\nconst _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' };\n// Detect WebView inside a native macOS app by ruling out all browsers\n// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too\n// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos\nconst isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) &&\n /AppleWebKit/.test(_navigator.userAgent) &&\n !/Safari/.test(_navigator.userAgent))();\nconst saveAs = !IS_CLIENT\n ? () => { } // noop\n : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program\n typeof HTMLAnchorElement !== 'undefined' &&\n 'download' in HTMLAnchorElement.prototype &&\n !isMacOSWebView\n ? downloadSaveAs\n : // Use msSaveOrOpenBlob as a second approach\n 'msSaveOrOpenBlob' in _navigator\n ? msSaveAs\n : // Fallback to using FileReader and a popup\n fileSaverSaveAs;\nfunction downloadSaveAs(blob, name = 'download', opts) {\n const a = document.createElement('a');\n a.download = name;\n a.rel = 'noopener'; // tabnabbing\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n if (typeof blob === 'string') {\n // Support regular links\n a.href = blob;\n if (a.origin !== location.origin) {\n if (corsEnabled(a.href)) {\n download(blob, name, opts);\n }\n else {\n a.target = '_blank';\n click(a);\n }\n }\n else {\n click(a);\n }\n }\n else {\n // Support blobs\n a.href = URL.createObjectURL(blob);\n setTimeout(function () {\n URL.revokeObjectURL(a.href);\n }, 4e4); // 40s\n setTimeout(function () {\n click(a);\n }, 0);\n }\n}\nfunction msSaveAs(blob, name = 'download', opts) {\n if (typeof blob === 'string') {\n if (corsEnabled(blob)) {\n download(blob, name, opts);\n }\n else {\n const a = document.createElement('a');\n a.href = blob;\n a.target = '_blank';\n setTimeout(function () {\n click(a);\n });\n }\n }\n else {\n // @ts-ignore: works on windows\n navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n }\n}\nfunction fileSaverSaveAs(blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open('', '_blank');\n if (popup) {\n popup.document.title = popup.document.body.innerText = 'downloading...';\n }\n if (typeof blob === 'string')\n return download(blob, name, opts);\n const force = blob.type === 'application/octet-stream';\n const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global;\n const isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n if ((isChromeIOS || (force && isSafari) || isMacOSWebView) &&\n typeof FileReader !== 'undefined') {\n // Safari doesn't allow downloading of blob URLs\n const reader = new FileReader();\n reader.onloadend = function () {\n let url = reader.result;\n if (typeof url !== 'string') {\n popup = null;\n throw new Error('Wrong reader.result type');\n }\n url = isChromeIOS\n ? url\n : url.replace(/^data:[^;]*;/, 'data:attachment/file;');\n if (popup) {\n popup.location.href = url;\n }\n else {\n location.assign(url);\n }\n popup = null; // reverse-tabnabbing #460\n };\n reader.readAsDataURL(blob);\n }\n else {\n const url = URL.createObjectURL(blob);\n if (popup)\n popup.location.assign(url);\n else\n location.href = url;\n popup = null; // reverse-tabnabbing #460\n setTimeout(function () {\n URL.revokeObjectURL(url);\n }, 4e4); // 40s\n }\n}\n\n/**\n * Shows a toast or console.log\n *\n * @param message - message to log\n * @param type - different color of the tooltip\n */\nfunction toastMessage(message, type) {\n const piniaMessage = '🍍 ' + message;\n if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') {\n // No longer available :(\n __VUE_DEVTOOLS_TOAST__(piniaMessage, type);\n }\n else if (type === 'error') {\n console.error(piniaMessage);\n }\n else if (type === 'warn') {\n console.warn(piniaMessage);\n }\n else {\n console.log(piniaMessage);\n }\n}\nfunction isPinia(o) {\n return '_a' in o && 'install' in o;\n}\n\n/**\n * This file contain devtools actions, they are not Pinia actions.\n */\n// ---\nfunction checkClipboardAccess() {\n if (!('clipboard' in navigator)) {\n toastMessage(`Your browser doesn't support the Clipboard API`, 'error');\n return true;\n }\n}\nfunction checkNotFocusedError(error) {\n if (error instanceof Error &&\n error.message.toLowerCase().includes('document is not focused')) {\n toastMessage('You need to activate the \"Emulate a focused page\" setting in the \"Rendering\" panel of devtools.', 'warn');\n return true;\n }\n return false;\n}\nasync function actionGlobalCopyState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));\n toastMessage('Global state copied to clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalPasteState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText()));\n toastMessage('Global state pasted from clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalSaveState(pinia) {\n try {\n saveAs(new Blob([JSON.stringify(pinia.state.value)], {\n type: 'text/plain;charset=utf-8',\n }), 'pinia-state.json');\n }\n catch (error) {\n toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nlet fileInput;\nfunction getFileOpener() {\n if (!fileInput) {\n fileInput = document.createElement('input');\n fileInput.type = 'file';\n fileInput.accept = '.json';\n }\n function openFile() {\n return new Promise((resolve, reject) => {\n fileInput.onchange = async () => {\n const files = fileInput.files;\n if (!files)\n return resolve(null);\n const file = files.item(0);\n if (!file)\n return resolve(null);\n return resolve({ text: await file.text(), file });\n };\n // @ts-ignore: TODO: changed from 4.3 to 4.4\n fileInput.oncancel = () => resolve(null);\n fileInput.onerror = reject;\n fileInput.click();\n });\n }\n return openFile;\n}\nasync function actionGlobalOpenStateFile(pinia) {\n try {\n const open = getFileOpener();\n const result = await open();\n if (!result)\n return;\n const { text, file } = result;\n loadStoresState(pinia, JSON.parse(text));\n toastMessage(`Global state imported from \"${file.name}\".`);\n }\n catch (error) {\n toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nfunction loadStoresState(pinia, state) {\n for (const key in state) {\n const storeState = pinia.state.value[key];\n // store is already instantiated, patch it\n if (storeState) {\n Object.assign(storeState, state[key]);\n }\n else {\n // store is not instantiated, set the initial state\n pinia.state.value[key] = state[key];\n }\n }\n}\n\nfunction formatDisplay(display) {\n return {\n _custom: {\n display,\n },\n };\n}\nconst PINIA_ROOT_LABEL = '🍍 Pinia (root)';\nconst PINIA_ROOT_ID = '_root';\nfunction formatStoreForInspectorTree(store) {\n return isPinia(store)\n ? {\n id: PINIA_ROOT_ID,\n label: PINIA_ROOT_LABEL,\n }\n : {\n id: store.$id,\n label: store.$id,\n };\n}\nfunction formatStoreForInspectorState(store) {\n if (isPinia(store)) {\n const storeNames = Array.from(store._s.keys());\n const storeMap = store._s;\n const state = {\n state: storeNames.map((storeId) => ({\n editable: true,\n key: storeId,\n value: store.state.value[storeId],\n })),\n getters: storeNames\n .filter((id) => storeMap.get(id)._getters)\n .map((id) => {\n const store = storeMap.get(id);\n return {\n editable: false,\n key: id,\n value: store._getters.reduce((getters, key) => {\n getters[key] = store[key];\n return getters;\n }, {}),\n };\n }),\n };\n return state;\n }\n const state = {\n state: Object.keys(store.$state).map((key) => ({\n editable: true,\n key,\n value: store.$state[key],\n })),\n };\n // avoid adding empty getters\n if (store._getters && store._getters.length) {\n state.getters = store._getters.map((getterName) => ({\n editable: false,\n key: getterName,\n value: store[getterName],\n }));\n }\n if (store._customProperties.size) {\n state.customProperties = Array.from(store._customProperties).map((key) => ({\n editable: true,\n key,\n value: store[key],\n }));\n }\n return state;\n}\nfunction formatEventData(events) {\n if (!events)\n return {};\n if (Array.isArray(events)) {\n // TODO: handle add and delete for arrays and objects\n return events.reduce((data, event) => {\n data.keys.push(event.key);\n data.operations.push(event.type);\n data.oldValue[event.key] = event.oldValue;\n data.newValue[event.key] = event.newValue;\n return data;\n }, {\n oldValue: {},\n keys: [],\n operations: [],\n newValue: {},\n });\n }\n else {\n return {\n operation: formatDisplay(events.type),\n key: formatDisplay(events.key),\n oldValue: events.oldValue,\n newValue: events.newValue,\n };\n }\n}\nfunction formatMutationType(type) {\n switch (type) {\n case MutationType.direct:\n return 'mutation';\n case MutationType.patchFunction:\n return '$patch';\n case MutationType.patchObject:\n return '$patch';\n default:\n return 'unknown';\n }\n}\n\n// timeline can be paused when directly changing the state\nlet isTimelineActive = true;\nconst componentStateTypes = [];\nconst MUTATIONS_LAYER_ID = 'pinia:mutations';\nconst INSPECTOR_ID = 'pinia';\nconst { assign: assign$1 } = Object;\n/**\n * Gets the displayed name of a store in devtools\n *\n * @param id - id of the store\n * @returns a formatted string\n */\nconst getStoreType = (id) => '🍍 ' + id;\n/**\n * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab\n * as soon as it is added to the application.\n *\n * @param app - Vue application\n * @param pinia - pinia instance\n */\nfunction registerPiniaDevtools(app, pinia) {\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia 🍍',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n }, (api) => {\n if (typeof api.now !== 'function') {\n toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.');\n }\n api.addTimelineLayer({\n id: MUTATIONS_LAYER_ID,\n label: `Pinia 🍍`,\n color: 0xe5df88,\n });\n api.addInspector({\n id: INSPECTOR_ID,\n label: 'Pinia 🍍',\n icon: 'storage',\n treeFilterPlaceholder: 'Search stores',\n actions: [\n {\n icon: 'content_copy',\n action: () => {\n actionGlobalCopyState(pinia);\n },\n tooltip: 'Serialize and copy the state',\n },\n {\n icon: 'content_paste',\n action: async () => {\n await actionGlobalPasteState(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Replace the state with the content of your clipboard',\n },\n {\n icon: 'save',\n action: () => {\n actionGlobalSaveState(pinia);\n },\n tooltip: 'Save the state as a JSON file',\n },\n {\n icon: 'folder_open',\n action: async () => {\n await actionGlobalOpenStateFile(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Import the state from a JSON file',\n },\n ],\n nodeActions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state (with \"$reset\")',\n action: (nodeId) => {\n const store = pinia._s.get(nodeId);\n if (!store) {\n toastMessage(`Cannot reset \"${nodeId}\" store because it wasn't found.`, 'warn');\n }\n else if (typeof store.$reset !== 'function') {\n toastMessage(`Cannot reset \"${nodeId}\" store because it doesn't have a \"$reset\" method implemented.`, 'warn');\n }\n else {\n store.$reset();\n toastMessage(`Store \"${nodeId}\" reset.`);\n }\n },\n },\n ],\n });\n api.on.inspectComponent((payload) => {\n const proxy = (payload.componentInstance &&\n payload.componentInstance.proxy);\n if (proxy && proxy._pStores) {\n const piniaStores = payload.componentInstance.proxy._pStores;\n Object.values(piniaStores).forEach((store) => {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'state',\n editable: true,\n value: store._isOptionsAPI\n ? {\n _custom: {\n value: toRaw(store.$state),\n actions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state of this store',\n action: () => store.$reset(),\n },\n ],\n },\n }\n : // NOTE: workaround to unwrap transferred refs\n Object.keys(store.$state).reduce((state, key) => {\n state[key] = store.$state[key];\n return state;\n }, {}),\n });\n if (store._getters && store._getters.length) {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'getters',\n editable: false,\n value: store._getters.reduce((getters, key) => {\n try {\n getters[key] = store[key];\n }\n catch (error) {\n // @ts-expect-error: we just want to show it in devtools\n getters[key] = error;\n }\n return getters;\n }, {}),\n });\n }\n });\n }\n });\n api.on.getInspectorTree((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n let stores = [pinia];\n stores = stores.concat(Array.from(pinia._s.values()));\n payload.rootNodes = (payload.filter\n ? stores.filter((store) => '$id' in store\n ? store.$id\n .toLowerCase()\n .includes(payload.filter.toLowerCase())\n : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase()))\n : stores).map(formatStoreForInspectorTree);\n }\n });\n // Expose pinia instance as $pinia to window\n globalThis.$pinia = pinia;\n api.on.getInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n // this could be the selected store restored for a different project\n // so it's better not to say anything here\n return;\n }\n if (inspectedStore) {\n // Expose selected store as $store to window\n if (payload.nodeId !== PINIA_ROOT_ID)\n globalThis.$store = toRaw(inspectedStore);\n payload.state = formatStoreForInspectorState(inspectedStore);\n }\n }\n });\n api.on.editInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n return toastMessage(`store \"${payload.nodeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (!isPinia(inspectedStore)) {\n // access only the state\n if (path.length !== 1 ||\n !inspectedStore._customProperties.has(path[0]) ||\n path[0] in inspectedStore.$state) {\n path.unshift('$state');\n }\n }\n else {\n // Root access, we can omit the `.value` because the devtools API does it for us\n path.unshift('state');\n }\n isTimelineActive = false;\n payload.set(inspectedStore, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n api.on.editComponentState((payload) => {\n if (payload.type.startsWith('🍍')) {\n const storeId = payload.type.replace(/^🍍\\s*/, '');\n const store = pinia._s.get(storeId);\n if (!store) {\n return toastMessage(`store \"${storeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (path[0] !== 'state') {\n return toastMessage(`Invalid path for store \"${storeId}\":\\n${path}\\nOnly state can be modified.`);\n }\n // rewrite the first entry to be able to directly set the state as\n // well as any other path\n path[0] = '$state';\n isTimelineActive = false;\n payload.set(store, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n });\n}\nfunction addStoreToDevtools(app, store) {\n if (!componentStateTypes.includes(getStoreType(store.$id))) {\n componentStateTypes.push(getStoreType(store.$id));\n }\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia 🍍',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n settings: {\n logStoreChanges: {\n label: 'Notify about new/deleted stores',\n type: 'boolean',\n defaultValue: true,\n },\n // useEmojis: {\n // label: 'Use emojis in messages ⚡️',\n // type: 'boolean',\n // defaultValue: true,\n // },\n },\n }, (api) => {\n // gracefully handle errors\n const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now;\n store.$onAction(({ after, onError, name, args }) => {\n const groupId = runningActionId++;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🛫 ' + name,\n subtitle: 'start',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n },\n groupId,\n },\n });\n after((result) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🛬 ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n result,\n },\n groupId,\n },\n });\n });\n onError((error) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n logType: 'error',\n title: '💥 ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n error,\n },\n groupId,\n },\n });\n });\n }, true);\n store._customProperties.forEach((name) => {\n watch(() => unref(store[name]), (newValue, oldValue) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (isTimelineActive) {\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: 'Change',\n subtitle: name,\n data: {\n newValue,\n oldValue,\n },\n groupId: activeAction,\n },\n });\n }\n }, { deep: true });\n });\n store.$subscribe(({ events, type }, state) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (!isTimelineActive)\n return;\n // rootStore.state[store.id] = state\n const eventData = {\n time: now(),\n title: formatMutationType(type),\n data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)),\n groupId: activeAction,\n };\n if (type === MutationType.patchFunction) {\n eventData.subtitle = '⤵️';\n }\n else if (type === MutationType.patchObject) {\n eventData.subtitle = '🧩';\n }\n else if (events && !Array.isArray(events)) {\n eventData.subtitle = events.type;\n }\n if (events) {\n eventData.data['rawEvent(s)'] = {\n _custom: {\n display: 'DebuggerEvent',\n type: 'object',\n tooltip: 'raw DebuggerEvent[]',\n value: events,\n },\n };\n }\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: eventData,\n });\n }, { detached: true, flush: 'sync' });\n const hotUpdate = store._hotUpdate;\n store._hotUpdate = markRaw((newStore) => {\n hotUpdate(newStore);\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🔥 ' + store.$id,\n subtitle: 'HMR update',\n data: {\n store: formatDisplay(store.$id),\n info: formatDisplay(`HMR update`),\n },\n },\n });\n // update the devtools too\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n });\n const { $dispose } = store;\n store.$dispose = () => {\n $dispose();\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`Disposed \"${store.$id}\" store 🗑`);\n };\n // trigger an update so it can display new registered stores\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`\"${store.$id}\" store installed 🆕`);\n });\n}\nlet runningActionId = 0;\nlet activeAction;\n/**\n * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the\n * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state\n * mutation to the action.\n *\n * @param store - store to patch\n * @param actionNames - list of actionst to patch\n */\nfunction patchActionForGrouping(store, actionNames, wrapWithProxy) {\n // original actions of the store as they are given by pinia. We are going to override them\n const actions = actionNames.reduce((storeActions, actionName) => {\n // use toRaw to avoid tracking #541\n storeActions[actionName] = toRaw(store)[actionName];\n return storeActions;\n }, {});\n for (const actionName in actions) {\n store[actionName] = function () {\n // the running action id is incremented in a before action hook\n const _actionId = runningActionId;\n const trackedStore = wrapWithProxy\n ? new Proxy(store, {\n get(...args) {\n activeAction = _actionId;\n return Reflect.get(...args);\n },\n set(...args) {\n activeAction = _actionId;\n return Reflect.set(...args);\n },\n })\n : store;\n // For Setup Stores we need https://github.com/tc39/proposal-async-context\n activeAction = _actionId;\n const retValue = actions[actionName].apply(trackedStore, arguments);\n // this is safer as async actions in Setup Stores would associate mutations done outside of the action\n activeAction = undefined;\n return retValue;\n };\n }\n}\n/**\n * pinia.use(devtoolsPlugin)\n */\nfunction devtoolsPlugin({ app, store, options }) {\n // HMR module\n if (store.$id.startsWith('__hot:')) {\n return;\n }\n // detect option api vs setup api\n store._isOptionsAPI = !!options.state;\n // Do not overwrite actions mocked by @pinia/testing (#2298)\n if (!store._p._testing) {\n patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);\n // Upgrade the HMR to also update the new actions\n const originalHotUpdate = store._hotUpdate;\n toRaw(store)._hotUpdate = function (newStore) {\n originalHotUpdate.apply(this, arguments);\n patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);\n };\n }\n addStoreToDevtools(app, \n // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?\n store);\n}\n\n/**\n * Creates a Pinia instance to be used by the application\n */\nfunction createPinia() {\n const scope = effectScope(true);\n // NOTE: here we could check the window object for a state and directly set it\n // if there is anything like it with Vue 3 SSR\n const state = scope.run(() => ref({}));\n let _p = [];\n // plugins added before calling app.use(pinia)\n let toBeInstalled = [];\n const pinia = markRaw({\n install(app) {\n // this allows calling useStore() outside of a component setup after\n // installing pinia's plugin\n setActivePinia(pinia);\n pinia._a = app;\n app.provide(piniaSymbol, pinia);\n app.config.globalProperties.$pinia = pinia;\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n registerPiniaDevtools(app, pinia);\n }\n toBeInstalled.forEach((plugin) => _p.push(plugin));\n toBeInstalled = [];\n },\n use(plugin) {\n if (!this._a) {\n toBeInstalled.push(plugin);\n }\n else {\n _p.push(plugin);\n }\n return this;\n },\n _p,\n // it's actually undefined here\n // @ts-expect-error\n _a: null,\n _e: scope,\n _s: new Map(),\n state,\n });\n // pinia devtools rely on dev only features so they cannot be forced unless\n // the dev build of Vue is used. Avoid old browsers like IE11.\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT && typeof Proxy !== 'undefined') {\n pinia.use(devtoolsPlugin);\n }\n return pinia;\n}\n/**\n * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly\n * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.\n * Once disposed, the pinia instance cannot be used anymore.\n *\n * @param pinia - pinia instance\n */\nfunction disposePinia(pinia) {\n pinia._e.stop();\n pinia._s.clear();\n pinia._p.splice(0);\n pinia.state.value = {};\n // @ts-expect-error: non valid\n pinia._a = null;\n}\n\n/**\n * Checks if a function is a `StoreDefinition`.\n *\n * @param fn - object to test\n * @returns true if `fn` is a StoreDefinition\n */\nconst isUseStore = (fn) => {\n return typeof fn === 'function' && typeof fn.$id === 'string';\n};\n/**\n * Mutates in place `newState` with `oldState` to _hot update_ it. It will\n * remove any key not existing in `newState` and recursively merge plain\n * objects.\n *\n * @param newState - new state object to be patched\n * @param oldState - old state that should be used to patch newState\n * @returns - newState\n */\nfunction patchObject(newState, oldState) {\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in oldState) {\n const subPatch = oldState[key];\n // skip the whole sub tree\n if (!(key in newState)) {\n continue;\n }\n const targetValue = newState[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n newState[key] = patchObject(targetValue, subPatch);\n }\n else {\n // objects are either a bit more complex (e.g. refs) or primitives, so we\n // just set the whole thing\n newState[key] = subPatch;\n }\n }\n return newState;\n}\n/**\n * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.\n *\n * @example\n * ```js\n * const useUser = defineStore(...)\n * if (import.meta.hot) {\n * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))\n * }\n * ```\n *\n * @param initialUseStore - return of the defineStore to hot update\n * @param hot - `import.meta.hot`\n */\nfunction acceptHMRUpdate(initialUseStore, hot) {\n // strip as much as possible from iife.prod\n if (!(process.env.NODE_ENV !== 'production')) {\n return () => { };\n }\n return (newModule) => {\n const pinia = hot.data.pinia || initialUseStore._pinia;\n if (!pinia) {\n // this store is still not used\n return;\n }\n // preserve the pinia instance across loads\n hot.data.pinia = pinia;\n // console.log('got data', newStore)\n for (const exportName in newModule) {\n const useStore = newModule[exportName];\n // console.log('checking for', exportName)\n if (isUseStore(useStore) && pinia._s.has(useStore.$id)) {\n // console.log('Accepting update for', useStore.$id)\n const id = useStore.$id;\n if (id !== initialUseStore.$id) {\n console.warn(`The id of the store changed from \"${initialUseStore.$id}\" to \"${id}\". Reloading.`);\n // return import.meta.hot.invalidate()\n return hot.invalidate();\n }\n const existingStore = pinia._s.get(id);\n if (!existingStore) {\n console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);\n return;\n }\n useStore(pinia, existingStore);\n }\n }\n };\n}\n\nconst noop = () => { };\nfunction addSubscription(subscriptions, callback, detached, onCleanup = noop) {\n subscriptions.add(callback);\n const removeSubscription = () => {\n const isDel = subscriptions.delete(callback);\n isDel && onCleanup();\n };\n if (!detached && getCurrentScope()) {\n onScopeDispose(removeSubscription);\n }\n return removeSubscription;\n}\nfunction triggerSubscriptions(subscriptions, ...args) {\n subscriptions.forEach((callback) => {\n callback(...args);\n });\n}\n\nconst fallbackRunWithContext = (fn) => fn();\n/**\n * Marks a function as an action for `$onAction`\n * @internal\n */\nconst ACTION_MARKER = Symbol();\n/**\n * Action name symbol. Allows to add a name to an action after defining it\n * @internal\n */\nconst ACTION_NAME = Symbol();\nfunction mergeReactiveObjects(target, patchToApply) {\n // Handle Map instances\n if (target instanceof Map && patchToApply instanceof Map) {\n patchToApply.forEach((value, key) => target.set(key, value));\n }\n else if (target instanceof Set && patchToApply instanceof Set) {\n // Handle Set instances\n patchToApply.forEach(target.add, target);\n }\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in patchToApply) {\n if (!patchToApply.hasOwnProperty(key))\n continue;\n const subPatch = patchToApply[key];\n const targetValue = target[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n target.hasOwnProperty(key) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might\n // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that\n // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.\n target[key] = mergeReactiveObjects(targetValue, subPatch);\n }\n else {\n // @ts-expect-error: subPatch is a valid value\n target[key] = subPatch;\n }\n }\n return target;\n}\nconst skipHydrateSymbol = (process.env.NODE_ENV !== 'production')\n ? Symbol('pinia:skipHydration')\n : /* istanbul ignore next */ Symbol();\n/**\n * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a\n * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.\n *\n * @param obj - target object\n * @returns obj\n */\nfunction skipHydrate(obj) {\n return Object.defineProperty(obj, skipHydrateSymbol, {});\n}\n/**\n * Returns whether a value should be hydrated\n *\n * @param obj - target variable\n * @returns true if `obj` should be hydrated\n */\nfunction shouldHydrate(obj) {\n return (!isPlainObject(obj) ||\n !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol));\n}\nconst { assign } = Object;\nfunction isComputed(o) {\n return !!(isRef(o) && o.effect);\n}\nfunction createOptionsStore(id, options, pinia, hot) {\n const { state, actions, getters } = options;\n const initialState = pinia.state.value[id];\n let store;\n function setup() {\n if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[id] = state ? state() : {};\n }\n // avoid creating a state in pinia.state.value\n const localState = (process.env.NODE_ENV !== 'production') && hot\n ? // use ref() to unwrap refs inside state TODO: check if this is still necessary\n toRefs(ref(state ? state() : {}).value)\n : toRefs(pinia.state.value[id]);\n return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {\n if ((process.env.NODE_ENV !== 'production') && name in localState) {\n console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${name}\" in store \"${id}\".`);\n }\n computedGetters[name] = markRaw(computed(() => {\n setActivePinia(pinia);\n // it was created just before\n const store = pinia._s.get(id);\n // allow cross using stores\n // @ts-expect-error\n // return getters![name].call(context, context)\n // TODO: avoid reading the getter while assigning with a global variable\n return getters[name].call(store, store);\n }));\n return computedGetters;\n }, {}));\n }\n store = createSetupStore(id, setup, options, pinia, hot, true);\n return store;\n}\nfunction createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {\n let scope;\n const optionsForPlugin = assign({ actions: {} }, options);\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) {\n throw new Error('Pinia destroyed');\n }\n // watcher options for $subscribe\n const $subscribeOptions = { deep: true };\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n $subscribeOptions.onTrigger = (event) => {\n /* istanbul ignore else */\n if (isListening) {\n debuggerEvents = event;\n // avoid triggering this while the store is being built and the state is being set in pinia\n }\n else if (isListening == false && !store._hotUpdating) {\n // let patch send all the events together later\n /* istanbul ignore else */\n if (Array.isArray(debuggerEvents)) {\n debuggerEvents.push(event);\n }\n else {\n console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.');\n }\n }\n };\n }\n // internal state\n let isListening; // set to true at the end\n let isSyncListening; // set to true at the end\n let subscriptions = new Set();\n let actionSubscriptions = new Set();\n let debuggerEvents;\n const initialState = pinia.state.value[$id];\n // avoid setting the state for option stores if it is set\n // by the setup\n if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[$id] = {};\n }\n const hotState = ref({});\n // avoid triggering too many listeners\n // https://github.com/vuejs/pinia/issues/1129\n let activeListener;\n function $patch(partialStateOrMutator) {\n let subscriptionMutation;\n isListening = isSyncListening = false;\n // reset the debugger events since patches are sync\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n debuggerEvents = [];\n }\n if (typeof partialStateOrMutator === 'function') {\n partialStateOrMutator(pinia.state.value[$id]);\n subscriptionMutation = {\n type: MutationType.patchFunction,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n else {\n mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);\n subscriptionMutation = {\n type: MutationType.patchObject,\n payload: partialStateOrMutator,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n const myListenerId = (activeListener = Symbol());\n nextTick().then(() => {\n if (activeListener === myListenerId) {\n isListening = true;\n }\n });\n isSyncListening = true;\n // because we paused the watcher, we need to manually call the subscriptions\n triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);\n }\n const $reset = isOptionsStore\n ? function $reset() {\n const { state } = options;\n const newState = state ? state() : {};\n // we use a patch to group all changes into one single subscription\n this.$patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, newState);\n });\n }\n : /* istanbul ignore next */\n (process.env.NODE_ENV !== 'production')\n ? () => {\n throw new Error(`🍍: Store \"${$id}\" is built using the setup syntax and does not implement $reset().`);\n }\n : noop;\n function $dispose() {\n scope.stop();\n subscriptions.clear();\n actionSubscriptions.clear();\n pinia._s.delete($id);\n }\n /**\n * Helper that wraps function so it can be tracked with $onAction\n * @param fn - action to wrap\n * @param name - name of the action\n */\n const action = (fn, name = '') => {\n if (ACTION_MARKER in fn) {\n fn[ACTION_NAME] = name;\n return fn;\n }\n const wrappedAction = function () {\n setActivePinia(pinia);\n const args = Array.from(arguments);\n const afterCallbackSet = new Set();\n const onErrorCallbackSet = new Set();\n function after(callback) {\n afterCallbackSet.add(callback);\n }\n function onError(callback) {\n onErrorCallbackSet.add(callback);\n }\n // @ts-expect-error\n triggerSubscriptions(actionSubscriptions, {\n args,\n name: wrappedAction[ACTION_NAME],\n store,\n after,\n onError,\n });\n let ret;\n try {\n ret = fn.apply(this && this.$id === $id ? this : store, args);\n // handle sync errors\n }\n catch (error) {\n triggerSubscriptions(onErrorCallbackSet, error);\n throw error;\n }\n if (ret instanceof Promise) {\n return ret\n .then((value) => {\n triggerSubscriptions(afterCallbackSet, value);\n return value;\n })\n .catch((error) => {\n triggerSubscriptions(onErrorCallbackSet, error);\n return Promise.reject(error);\n });\n }\n // trigger after callbacks\n triggerSubscriptions(afterCallbackSet, ret);\n return ret;\n };\n wrappedAction[ACTION_MARKER] = true;\n wrappedAction[ACTION_NAME] = name; // will be set later\n // @ts-expect-error: we are intentionally limiting the returned type to just Fn\n // because all the added properties are internals that are exposed through `$onAction()` only\n return wrappedAction;\n };\n const _hmrPayload = /*#__PURE__*/ markRaw({\n actions: {},\n getters: {},\n state: [],\n hotState,\n });\n const partialStore = {\n _p: pinia,\n // _s: scope,\n $id,\n $onAction: addSubscription.bind(null, actionSubscriptions),\n $patch,\n $reset,\n $subscribe(callback, options = {}) {\n const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());\n const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {\n if (options.flush === 'sync' ? isSyncListening : isListening) {\n callback({\n storeId: $id,\n type: MutationType.direct,\n events: debuggerEvents,\n }, state);\n }\n }, assign({}, $subscribeOptions, options)));\n return removeSubscription;\n },\n $dispose,\n };\n const store = reactive((process.env.NODE_ENV !== 'production') || ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT)\n ? assign({\n _hmrPayload,\n _customProperties: markRaw(new Set()), // devtools custom properties\n }, partialStore\n // must be added later\n // setupStore\n )\n : partialStore);\n // store the partial store now so the setup of stores can instantiate each other before they are finished without\n // creating infinite loops.\n pinia._s.set($id, store);\n const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext;\n // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped\n const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));\n // overwrite existing actions to support $onAction\n for (const key in setupStore) {\n const prop = setupStore[key];\n if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) {\n // mark it as a piece of state to be serialized\n if ((process.env.NODE_ENV !== 'production') && hot) {\n hotState.value[key] = toRef(setupStore, key);\n // createOptionStore directly sets the state in pinia.state.value so we\n // can just skip that\n }\n else if (!isOptionsStore) {\n // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created\n if (initialState && shouldHydrate(prop)) {\n if (isRef(prop)) {\n prop.value = initialState[key];\n }\n else {\n // probably a reactive object, lets recursively assign\n // @ts-expect-error: prop is unknown\n mergeReactiveObjects(prop, initialState[key]);\n }\n }\n // transfer the ref to the pinia state to keep everything in sync\n pinia.state.value[$id][key] = prop;\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.state.push(key);\n }\n // action\n }\n else if (typeof prop === 'function') {\n const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : action(prop, key);\n // this a hot module replacement store because the hotUpdate method needs\n // to do it with the right context\n // @ts-expect-error\n setupStore[key] = actionValue;\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.actions[key] = prop;\n }\n // list actions so they can be used in plugins\n // @ts-expect-error\n optionsForPlugin.actions[key] = prop;\n }\n else if ((process.env.NODE_ENV !== 'production')) {\n // add getters for devtools\n if (isComputed(prop)) {\n _hmrPayload.getters[key] = isOptionsStore\n ? // @ts-expect-error\n options.getters[key]\n : prop;\n if (IS_CLIENT) {\n const getters = setupStore._getters ||\n // @ts-expect-error: same\n (setupStore._getters = markRaw([]));\n getters.push(key);\n }\n }\n }\n }\n // add the state, getters, and action properties\n /* istanbul ignore if */\n assign(store, setupStore);\n // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.\n // Make `storeToRefs()` work with `reactive()` #799\n assign(toRaw(store), setupStore);\n // use this instead of a computed with setter to be able to create it anywhere\n // without linking the computed lifespan to wherever the store is first\n // created.\n Object.defineProperty(store, '$state', {\n get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]),\n set: (state) => {\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && hot) {\n throw new Error('cannot set hotState');\n }\n $patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, state);\n });\n },\n });\n // add the hotUpdate before plugins to allow them to override it\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n store._hotUpdate = markRaw((newStore) => {\n store._hotUpdating = true;\n newStore._hmrPayload.state.forEach((stateKey) => {\n if (stateKey in store.$state) {\n const newStateTarget = newStore.$state[stateKey];\n const oldStateSource = store.$state[stateKey];\n if (typeof newStateTarget === 'object' &&\n isPlainObject(newStateTarget) &&\n isPlainObject(oldStateSource)) {\n patchObject(newStateTarget, oldStateSource);\n }\n else {\n // transfer the ref\n newStore.$state[stateKey] = oldStateSource;\n }\n }\n // patch direct access properties to allow store.stateProperty to work as\n // store.$state.stateProperty\n // @ts-expect-error: any type\n store[stateKey] = toRef(newStore.$state, stateKey);\n });\n // remove deleted state properties\n Object.keys(store.$state).forEach((stateKey) => {\n if (!(stateKey in newStore.$state)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[stateKey];\n }\n });\n // avoid devtools logging this as a mutation\n isListening = false;\n isSyncListening = false;\n pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState');\n isSyncListening = true;\n nextTick().then(() => {\n isListening = true;\n });\n for (const actionName in newStore._hmrPayload.actions) {\n const actionFn = newStore[actionName];\n // @ts-expect-error: actionName is a string\n store[actionName] =\n //\n action(actionFn, actionName);\n }\n // TODO: does this work in both setup and option store?\n for (const getterName in newStore._hmrPayload.getters) {\n const getter = newStore._hmrPayload.getters[getterName];\n const getterValue = isOptionsStore\n ? // special handling of options api\n computed(() => {\n setActivePinia(pinia);\n return getter.call(store, store);\n })\n : getter;\n // @ts-expect-error: getterName is a string\n store[getterName] =\n //\n getterValue;\n }\n // remove deleted getters\n Object.keys(store._hmrPayload.getters).forEach((key) => {\n if (!(key in newStore._hmrPayload.getters)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // remove old actions\n Object.keys(store._hmrPayload.actions).forEach((key) => {\n if (!(key in newStore._hmrPayload.actions)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // update the values used in devtools and to allow deleting new properties later on\n store._hmrPayload = newStore._hmrPayload;\n store._getters = newStore._getters;\n store._hotUpdating = false;\n });\n }\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const nonEnumerable = {\n writable: true,\n configurable: true,\n // avoid warning on devtools trying to display this property\n enumerable: false,\n };\n ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => {\n Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable));\n });\n }\n // apply all plugins\n pinia._p.forEach((extender) => {\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const extensions = scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n }));\n Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));\n assign(store, extensions);\n }\n else {\n assign(store, scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n })));\n }\n });\n if ((process.env.NODE_ENV !== 'production') &&\n store.$state &&\n typeof store.$state === 'object' &&\n typeof store.$state.constructor === 'function' &&\n !store.$state.constructor.toString().includes('[native code]')) {\n console.warn(`[🍍]: The \"state\" must be a plain object. It cannot be\\n` +\n `\\tstate: () => new MyClass()\\n` +\n `Found in store \"${store.$id}\".`);\n }\n // only apply hydrate to option stores with an initial state in pinia\n if (initialState &&\n isOptionsStore &&\n options.hydrate) {\n options.hydrate(store.$state, initialState);\n }\n isListening = true;\n isSyncListening = true;\n return store;\n}\n// allows unused stores to be tree shaken\n/*! #__NO_SIDE_EFFECTS__ */\nfunction defineStore(\n// TODO: add proper types from above\nid, setup, setupOptions) {\n let options;\n const isSetupStore = typeof setup === 'function';\n // the option store setup will contain the actual options in this case\n options = isSetupStore ? setupOptions : setup;\n function useStore(pinia, hot) {\n const hasContext = hasInjectionContext();\n pinia =\n // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) ||\n (hasContext ? inject(piniaSymbol, null) : null);\n if (pinia)\n setActivePinia(pinia);\n if ((process.env.NODE_ENV !== 'production') && !activePinia) {\n throw new Error(`[🍍]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\\n` +\n `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\\n` +\n `This will fail in production.`);\n }\n pinia = activePinia;\n if (!pinia._s.has(id)) {\n // creating the store registers it in `pinia._s`\n if (isSetupStore) {\n createSetupStore(id, setup, options, pinia);\n }\n else {\n createOptionsStore(id, options, pinia);\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n // @ts-expect-error: not the right inferred type\n useStore._pinia = pinia;\n }\n }\n const store = pinia._s.get(id);\n if ((process.env.NODE_ENV !== 'production') && hot) {\n const hotId = '__hot:' + id;\n const newStore = isSetupStore\n ? createSetupStore(hotId, setup, options, pinia, true)\n : createOptionsStore(hotId, assign({}, options), pinia, true);\n hot._hotUpdate(newStore);\n // cleanup the state properties and the store from the cache\n delete pinia.state.value[hotId];\n pinia._s.delete(hotId);\n }\n if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) {\n const currentInstance = getCurrentInstance();\n // save stores in instances to access them devtools\n if (currentInstance &&\n currentInstance.proxy &&\n // avoid adding stores that are just built for hot module replacement\n !hot) {\n const vm = currentInstance.proxy;\n const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {});\n cache[id] = store;\n }\n }\n // StoreGeneric cannot be casted towards Store\n return store;\n }\n useStore.$id = id;\n return useStore;\n}\n\nlet mapStoreSuffix = 'Store';\n/**\n * Changes the suffix added by `mapStores()`. Can be set to an empty string.\n * Defaults to `\"Store\"`. Make sure to extend the MapStoresCustomization\n * interface if you are using TypeScript.\n *\n * @param suffix - new suffix\n */\nfunction setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS\n) {\n mapStoreSuffix = suffix;\n}\n/**\n * Allows using stores without the composition API (`setup()`) by generating an\n * object to be spread in the `computed` field of a component. It accepts a list\n * of store definitions.\n *\n * @example\n * ```js\n * export default {\n * computed: {\n * // other computed properties\n * ...mapStores(useUserStore, useCartStore)\n * },\n *\n * created() {\n * this.userStore // store with id \"user\"\n * this.cartStore // store with id \"cart\"\n * }\n * }\n * ```\n *\n * @param stores - list of stores to map to an object\n */\nfunction mapStores(...stores) {\n if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) {\n console.warn(`[🍍]: Directly pass all stores to \"mapStores()\" without putting them in an array:\\n` +\n `Replace\\n` +\n `\\tmapStores([useAuthStore, useCartStore])\\n` +\n `with\\n` +\n `\\tmapStores(useAuthStore, useCartStore)\\n` +\n `This will fail in production if not fixed.`);\n stores = stores[0];\n }\n return stores.reduce((reduced, useStore) => {\n // @ts-expect-error: $id is added by defineStore\n reduced[useStore.$id + mapStoreSuffix] = function () {\n return useStore(this.$pinia);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = function () {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key];\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function () {\n const store = useStore(this.$pinia);\n const storeKey = keysOrMapper[key];\n // for some reason TS is unable to infer the type of storeKey to be a\n // function\n return typeof storeKey === 'function'\n ? storeKey.call(this, store)\n : // @ts-expect-error: FIXME: should work?\n store[storeKey];\n };\n return reduced;\n }, {});\n}\n/**\n * Alias for `mapState()`. You should use `mapState()` instead.\n * @deprecated use `mapState()` instead.\n */\nconst mapGetters = mapState;\n/**\n * Allows directly using actions from your store without using the composition\n * API (`setup()`) by generating an object to be spread in the `methods` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapActions(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key](...args);\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[keysOrMapper[key]](...args);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapWritableState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[key];\n },\n set(value) {\n return (useStore(this.$pinia)[key] = value);\n },\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[keysOrMapper[key]];\n },\n set(value) {\n return (useStore(this.$pinia)[keysOrMapper[key]] = value);\n },\n };\n return reduced;\n }, {});\n}\n\n/**\n * Creates an object of references with all the state, getters, and plugin-added\n * state properties of the store. Similar to `toRefs()` but specifically\n * designed for Pinia stores so methods and non reactive properties are\n * completely ignored.\n *\n * @param store - store to extract the refs from\n */\nfunction storeToRefs(store) {\n const rawStore = toRaw(store);\n const refs = {};\n for (const key in rawStore) {\n const value = rawStore[key];\n // There is no native method to check for a computed\n // https://github.com/vuejs/core/pull/4165\n if (value.effect) {\n // @ts-expect-error: too hard to type correctly\n refs[key] =\n // ...\n computed({\n get: () => store[key],\n set(value) {\n store[key] = value;\n },\n });\n }\n else if (isRef(value) || isReactive(value)) {\n // @ts-expect-error: the key is state or getter\n refs[key] =\n // ---\n toRef(store, key);\n }\n }\n return refs;\n}\n\nexport { MutationType, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs };\n","import { watch as U, onMounted as me, nextTick as de, readonly as ye, getCurrentInstance as Pe, toRef as Ie, customRef as Ee, ref as L, reactive as ue, computed as B, toValue as H, shallowRef as Se, unref as Ce, inject as fe, provide as pe } from \"vue\";\nimport { defineStore as De, storeToRefs as be } from \"pinia\";\nconst ke = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Le = Object.prototype.toString, Me = (o) => Le.call(o) === \"[object Object]\", we = () => {\n};\nfunction Fe(...o) {\n if (o.length !== 1) return Ie(...o);\n const e = o[0];\n return typeof e == \"function\" ? ye(Ee(() => ({\n get: e,\n set: we\n }))) : L(e);\n}\nfunction xe(o, e) {\n function t(...r) {\n return new Promise((n, i) => {\n Promise.resolve(o(() => e.apply(this, r), {\n fn: e,\n thisArg: this,\n args: r\n })).then(n).catch(i);\n });\n }\n return t;\n}\nconst Re = (o) => o();\nfunction Ne(o = Re, e = {}) {\n const { initialState: t = \"active\" } = e, r = Fe(t === \"active\");\n function n() {\n r.value = !1;\n }\n function i() {\n r.value = !0;\n }\n const s = (...a) => {\n r.value && o(...a);\n };\n return {\n isActive: ye(r),\n pause: n,\n resume: i,\n eventFilter: s\n };\n}\nfunction ce(o) {\n return Array.isArray(o) ? o : [o];\n}\nfunction Be(o) {\n return Pe();\n}\nfunction _e(o, e, t = {}) {\n const { eventFilter: r = Re, ...n } = t;\n return U(o, xe(r, e), n);\n}\nfunction Ve(o, e, t = {}) {\n const { eventFilter: r, initialState: n = \"active\", ...i } = t, { eventFilter: s, pause: a, resume: c, isActive: d } = Ne(r, { initialState: n });\n return {\n stop: _e(o, e, {\n ...i,\n eventFilter: s\n }),\n pause: a,\n resume: c,\n isActive: d\n };\n}\nfunction We(o, e = !0, t) {\n Be() ? me(o, t) : e ? o() : de(o);\n}\nfunction ze(o, e, t) {\n return U(o, e, {\n ...t,\n immediate: !0\n });\n}\nfunction X(o, e, t) {\n return U(o, (n, i, s) => {\n n && e(n, i, s);\n }, {\n ...t,\n once: !1\n });\n}\nconst j = ke ? window : void 0;\nfunction He(o) {\n var e;\n const t = H(o);\n return (e = t?.$el) !== null && e !== void 0 ? e : t;\n}\nfunction Q(...o) {\n const e = (r, n, i, s) => (r.addEventListener(n, i, s), () => r.removeEventListener(n, i, s)), t = B(() => {\n const r = ce(H(o[0])).filter((n) => n != null);\n return r.every((n) => typeof n != \"string\") ? r : void 0;\n });\n return ze(() => {\n var r, n;\n return [\n (r = (n = t.value) === null || n === void 0 ? void 0 : n.map((i) => He(i))) !== null && r !== void 0 ? r : [j].filter((i) => i != null),\n ce(H(t.value ? o[1] : o[0])),\n ce(Ce(t.value ? o[2] : o[1])),\n H(t.value ? o[3] : o[2])\n ];\n }, ([r, n, i, s], a, c) => {\n if (!r?.length || !n?.length || !i?.length) return;\n const d = Me(s) ? { ...s } : s, g = r.flatMap((S) => n.flatMap(($) => i.map((k) => e(S, $, k, d))));\n c(() => {\n g.forEach((S) => S());\n });\n }, { flush: \"post\" });\n}\nconst ne = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {}, oe = \"__vueuse_ssr_handlers__\", Ue = /* @__PURE__ */ Je();\nfunction Je() {\n return oe in ne || (ne[oe] = ne[oe] || {}), ne[oe];\n}\nfunction qe(o, e) {\n return Ue[o] || e;\n}\nfunction Ke(o) {\n return o == null ? \"any\" : o instanceof Set ? \"set\" : o instanceof Map ? \"map\" : o instanceof Date ? \"date\" : typeof o == \"boolean\" ? \"boolean\" : typeof o == \"string\" ? \"string\" : typeof o == \"object\" ? \"object\" : Number.isNaN(o) ? \"any\" : \"number\";\n}\nconst je = {\n boolean: {\n read: (o) => o === \"true\",\n write: (o) => String(o)\n },\n object: {\n read: (o) => JSON.parse(o),\n write: (o) => JSON.stringify(o)\n },\n number: {\n read: (o) => Number.parseFloat(o),\n write: (o) => String(o)\n },\n any: {\n read: (o) => o,\n write: (o) => String(o)\n },\n string: {\n read: (o) => o,\n write: (o) => String(o)\n },\n map: {\n read: (o) => new Map(JSON.parse(o)),\n write: (o) => JSON.stringify(Array.from(o.entries()))\n },\n set: {\n read: (o) => new Set(JSON.parse(o)),\n write: (o) => JSON.stringify(Array.from(o))\n },\n date: {\n read: (o) => new Date(o),\n write: (o) => o.toISOString()\n }\n}, he = \"vueuse-storage\";\nfunction Ge(o, e, t, r = {}) {\n var n;\n const { flush: i = \"pre\", deep: s = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: d = !1, shallow: g, window: S = j, eventFilter: $, onError: k = (v) => {\n console.error(v);\n }, initOnMounted: x } = r, F = (g ? Se : L)(e), R = B(() => H(o));\n if (!t) try {\n t = qe(\"getDefaultStorage\", () => j?.localStorage)();\n } catch (v) {\n k(v);\n }\n if (!t) return F;\n const O = H(e), w = Ke(O), h = (n = r.serializer) !== null && n !== void 0 ? n : je[w], { pause: E, resume: b } = Ve(F, (v) => N(v), {\n flush: i,\n deep: s,\n eventFilter: $\n });\n U(R, () => _(), { flush: i });\n let A = !1;\n const C = (v) => {\n x && !A || _(v);\n }, M = (v) => {\n x && !A || G(v);\n };\n S && a && (t instanceof Storage ? Q(S, \"storage\", C, { passive: !0 }) : Q(S, he, M)), x ? We(() => {\n A = !0, _();\n }) : _();\n function W(v, P) {\n if (S) {\n const D = {\n key: R.value,\n oldValue: v,\n newValue: P,\n storageArea: t\n };\n S.dispatchEvent(t instanceof Storage ? new StorageEvent(\"storage\", D) : new CustomEvent(he, { detail: D }));\n }\n }\n function N(v) {\n try {\n const P = t.getItem(R.value);\n if (v == null)\n W(P, null), t.removeItem(R.value);\n else {\n const D = h.write(v);\n P !== D && (t.setItem(R.value, D), W(P, D));\n }\n } catch (P) {\n k(P);\n }\n }\n function q(v) {\n const P = v ? v.newValue : t.getItem(R.value);\n if (P == null)\n return c && O != null && t.setItem(R.value, h.write(O)), O;\n if (!v && d) {\n const D = h.read(P);\n return typeof d == \"function\" ? d(D, O) : w === \"object\" && !Array.isArray(D) ? {\n ...O,\n ...D\n } : D;\n } else return typeof P != \"string\" ? P : h.read(P);\n }\n function _(v) {\n if (!(v && v.storageArea !== t)) {\n if (v && v.key == null) {\n F.value = O;\n return;\n }\n if (!(v && v.key !== R.value)) {\n E();\n try {\n const P = h.write(F.value);\n (v === void 0 || v?.newValue !== P) && (F.value = q(v));\n } catch (P) {\n k(P);\n } finally {\n v ? de(b) : b();\n }\n }\n }\n }\n function G(v) {\n _(v.detail);\n }\n return F;\n}\nfunction Ze(o, e, t = {}) {\n const { window: r = j } = t;\n return Ge(o, e, r?.localStorage, t);\n}\nconst Qe = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\nfunction Ye(o = {}) {\n const { reactive: e = !1, target: t = j, aliasMap: r = Qe, passive: n = !0, onEventFired: i = we } = o, s = ue(/* @__PURE__ */ new Set()), a = {\n toJSON() {\n return {};\n },\n current: s\n }, c = e ? ue(a) : a, d = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map([\n [\"Meta\", d],\n [\"Shift\", /* @__PURE__ */ new Set()],\n [\"Alt\", /* @__PURE__ */ new Set()]\n ]), S = /* @__PURE__ */ new Set();\n function $(w, h) {\n w in c && (e ? c[w] = h : c[w].value = h);\n }\n function k() {\n s.clear();\n for (const w of S) $(w, !1);\n }\n function x(w, h, E) {\n if (!(!w || typeof h.getModifierState != \"function\")) {\n for (const [b, A] of g) if (h.getModifierState(b)) {\n E.forEach((C) => A.add(C));\n break;\n }\n }\n }\n function F(w, h) {\n if (w) return;\n const E = `${h[0].toUpperCase()}${h.slice(1)}`, b = g.get(E);\n if (![\"shift\", \"alt\"].includes(h) || !b) return;\n const A = Array.from(b), C = A.indexOf(h);\n A.forEach((M, W) => {\n W >= C && (s.delete(M), $(M, !1));\n }), b.clear();\n }\n function R(w, h) {\n var E, b;\n const A = (E = w.key) === null || E === void 0 ? void 0 : E.toLowerCase(), C = [(b = w.code) === null || b === void 0 ? void 0 : b.toLowerCase(), A].filter(Boolean);\n if (A) {\n A && (h ? s.add(A) : s.delete(A));\n for (const M of C)\n S.add(M), $(M, h);\n x(h, w, [...s, ...C]), F(h, A), A === \"meta\" && !h && (d.forEach((M) => {\n s.delete(M), $(M, !1);\n }), d.clear());\n }\n }\n Q(t, \"keydown\", (w) => (R(w, !0), i(w)), { passive: n }), Q(t, \"keyup\", (w) => (R(w, !1), i(w)), { passive: n }), Q(\"blur\", k, { passive: n }), Q(\"focus\", k, { passive: n });\n const O = new Proxy(c, { get(w, h, E) {\n if (typeof h != \"string\") return Reflect.get(w, h, E);\n if (h = h.toLowerCase(), h in r && (h = r[h]), !(h in c)) if (/[+_-]/.test(h)) {\n const A = h.split(/[+_-]/g).map((C) => C.trim());\n c[h] = B(() => A.map((C) => H(O[C])).every(Boolean));\n } else c[h] = Se(!1);\n const b = Reflect.get(w, h, E);\n return e ? H(b) : b;\n } });\n return O;\n}\nfunction le() {\n return typeof crypto < \"u\" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\nfunction ie(o) {\n const e = {\n type: o.type,\n clientId: o.clientId,\n timestamp: o.timestamp.toISOString()\n };\n return o.operation && (e.operation = {\n ...o.operation,\n timestamp: o.operation.timestamp.toISOString()\n }), o.operations && (e.operations = o.operations.map((t) => ({\n ...t,\n timestamp: t.timestamp.toISOString()\n }))), e;\n}\nfunction Xe(o) {\n const e = {\n type: o.type,\n clientId: o.clientId,\n timestamp: new Date(o.timestamp)\n };\n return o.operation && (e.operation = {\n ...o.operation,\n timestamp: new Date(o.operation.timestamp)\n }), o.operations && (e.operations = o.operations.map((t) => ({\n ...t,\n timestamp: new Date(t.timestamp)\n }))), e;\n}\nconst re = De(\"hst-operation-log\", () => {\n const o = L({\n maxOperations: 100,\n enableCrossTabSync: !0,\n autoSyncInterval: 3e4,\n enablePersistence: !1,\n persistenceKeyPrefix: \"stonecrop-ops\"\n }), e = L([]), t = L(-1), r = L(le()), n = L(!1), i = L([]), s = L(null), a = B(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = B(() => t.value < e.value.length - 1), d = B(() => {\n let u = 0;\n for (let l = t.value; l >= 0 && e.value[l]?.reversible; l--)\n u++;\n return u;\n }), g = B(() => e.value.length - 1 - t.value), S = B(() => ({\n canUndo: a.value,\n canRedo: c.value,\n undoCount: d.value,\n redoCount: g.value,\n currentIndex: t.value\n }));\n function $(u) {\n o.value = { ...o.value, ...u }, o.value.enablePersistence && (p(), y()), o.value.enableCrossTabSync && q();\n }\n function k(u, l = \"user\") {\n const f = {\n ...u,\n id: le(),\n timestamp: /* @__PURE__ */ new Date(),\n source: l,\n userId: o.value.userId\n };\n if (o.value.operationFilter && !o.value.operationFilter(f))\n return f.id;\n if (n.value)\n return i.value.push(f), f.id;\n if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(f), t.value++, o.value.maxOperations && e.value.length > o.value.maxOperations) {\n const T = e.value.length - o.value.maxOperations;\n e.value = e.value.slice(T), t.value -= T;\n }\n return o.value.enableCrossTabSync && _(f), f.id;\n }\n function x() {\n n.value = !0, i.value = [], s.value = le();\n }\n function F(u) {\n if (!n.value || i.value.length === 0)\n return n.value = !1, i.value = [], s.value = null, null;\n const l = s.value, f = i.value.every((I) => I.reversible), T = {\n id: l,\n type: \"batch\",\n path: \"\",\n // Batch doesn't have a single path\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: i.value[0]?.doctype || \"\",\n timestamp: /* @__PURE__ */ new Date(),\n source: \"user\",\n reversible: f,\n irreversibleReason: f ? void 0 : \"Contains irreversible operations\",\n childOperationIds: i.value.map((I) => I.id),\n metadata: { description: u }\n };\n i.value.forEach((I) => {\n I.parentOperationId = l;\n }), e.value.push(...i.value, T), t.value = e.value.length - 1, o.value.enableCrossTabSync && G(i.value, T);\n const V = l;\n return n.value = !1, i.value = [], s.value = null, V;\n }\n function R() {\n n.value = !1, i.value = [], s.value = null;\n }\n function O(u) {\n if (!a.value) return !1;\n const l = e.value[t.value];\n if (!l.reversible)\n return typeof console < \"u\" && l.irreversibleReason && console.warn(\"Cannot undo irreversible operation:\", l.irreversibleReason), !1;\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (let f = l.childOperationIds.length - 1; f >= 0; f--) {\n const T = l.childOperationIds[f], V = e.value.find((I) => I.id === T);\n V && h(V, u);\n }\n else\n h(l, u);\n return t.value--, o.value.enableCrossTabSync && v(l), !0;\n } catch (f) {\n return typeof console < \"u\" && console.error(\"Undo failed:\", f), !1;\n }\n }\n function w(u) {\n if (!c.value) return !1;\n const l = e.value[t.value + 1];\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (const f of l.childOperationIds) {\n const T = e.value.find((V) => V.id === f);\n T && E(T, u);\n }\n else\n E(l, u);\n return t.value++, o.value.enableCrossTabSync && P(l), !0;\n } catch (f) {\n return typeof console < \"u\" && console.error(\"Redo failed:\", f), !1;\n }\n }\n function h(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.beforeValue, \"undo\");\n }\n function E(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.afterValue, \"redo\");\n }\n function b() {\n const u = e.value.filter((f) => f.reversible).length, l = e.value.map((f) => f.timestamp);\n return {\n operations: [...e.value],\n currentIndex: t.value,\n totalOperations: e.value.length,\n reversibleOperations: u,\n irreversibleOperations: e.value.length - u,\n oldestOperation: l.length > 0 ? new Date(Math.min(...l.map((f) => f.getTime()))) : void 0,\n newestOperation: l.length > 0 ? new Date(Math.max(...l.map((f) => f.getTime()))) : void 0\n };\n }\n function A() {\n e.value = [], t.value = -1;\n }\n function C(u, l) {\n return e.value.filter((f) => f.doctype === u && (l === void 0 || f.recordId === l));\n }\n function M(u, l) {\n const f = e.value.find((T) => T.id === u);\n f && (f.reversible = !1, f.irreversibleReason = l);\n }\n function W(u, l, f, T = \"success\", V) {\n const I = {\n type: \"action\",\n path: f && f.length > 0 ? `${u}.${f[0]}` : u,\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: u,\n recordId: f && f.length > 0 ? f[0] : void 0,\n reversible: !1,\n // Actions are typically not reversible\n actionName: l,\n actionRecordIds: f,\n actionResult: T,\n actionError: V\n };\n return k(I);\n }\n let N = null;\n function q() {\n typeof window > \"u\" || !window.BroadcastChannel || (N = new BroadcastChannel(\"stonecrop-operation-log\"), N.addEventListener(\"message\", (u) => {\n const l = u.data;\n if (!l || typeof l != \"object\") return;\n const f = Xe(l);\n f.clientId !== r.value && (f.type === \"operation\" && f.operation ? (e.value.push({ ...f.operation, source: \"sync\" }), t.value = e.value.length - 1) : f.type === \"operation\" && f.operations && (e.value.push(...f.operations.map((T) => ({ ...T, source: \"sync\" }))), t.value = e.value.length - 1));\n }));\n }\n function _(u) {\n if (!N) return;\n const l = {\n type: \"operation\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(l));\n }\n function G(u, l) {\n if (!N) return;\n const f = {\n type: \"operation\",\n operations: [...u, l],\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(f));\n }\n function v(u) {\n if (!N) return;\n const l = {\n type: \"undo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(l));\n }\n function P(u) {\n if (!N) return;\n const l = {\n type: \"redo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(l));\n }\n const D = Ze(\"stonecrop-ops-operations\", null, {\n serializer: {\n read: (u) => {\n try {\n return JSON.parse(u);\n } catch {\n return null;\n }\n },\n write: (u) => u ? JSON.stringify(u) : \"\"\n }\n });\n function p() {\n if (!(typeof window > \"u\"))\n try {\n const u = D.value;\n u && Array.isArray(u.operations) && (e.value = u.operations.map((l) => ({\n ...l,\n timestamp: new Date(l.timestamp)\n })), t.value = u.currentIndex ?? -1);\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to load operations from persistence:\", u);\n }\n }\n function m() {\n if (!(typeof window > \"u\"))\n try {\n D.value = {\n operations: e.value.map((u) => ({\n ...u,\n timestamp: u.timestamp.toISOString()\n })),\n currentIndex: t.value\n };\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to save operations to persistence:\", u);\n }\n }\n function y() {\n U(\n [e, t],\n () => {\n o.value.enablePersistence && m();\n },\n { deep: !0 }\n );\n }\n return {\n // State\n operations: e,\n currentIndex: t,\n config: o,\n clientId: r,\n undoRedoState: S,\n // Computed\n canUndo: a,\n canRedo: c,\n undoCount: d,\n redoCount: g,\n // Methods\n configure: $,\n addOperation: k,\n startBatch: x,\n commitBatch: F,\n cancelBatch: R,\n undo: O,\n redo: w,\n clear: A,\n getOperationsFor: C,\n getSnapshot: b,\n markIrreversible: M,\n logAction: W\n };\n});\nclass ee {\n /**\n * The root FieldTriggerEngine instance\n */\n static _root;\n options;\n doctypeActions = /* @__PURE__ */ new Map();\n // doctype -> action/field -> functions\n doctypeTransitions = /* @__PURE__ */ new Map();\n // doctype -> transition -> functions\n fieldRollbackConfig = /* @__PURE__ */ new Map();\n // doctype -> field -> rollback enabled\n globalActions = /* @__PURE__ */ new Map();\n // action name -> function\n globalTransitionActions = /* @__PURE__ */ new Map();\n // transition action name -> function\n /**\n * Creates a new FieldTriggerEngine instance (singleton pattern)\n * @param options - Configuration options for the field trigger engine\n */\n constructor(e = {}) {\n if (ee._root)\n return ee._root;\n ee._root = this, this.options = {\n defaultTimeout: e.defaultTimeout ?? 5e3,\n debug: e.debug ?? !1,\n enableRollback: e.enableRollback ?? !0,\n errorHandler: e.errorHandler\n };\n }\n /**\n * Register a global action function\n * @param name - The name of the action\n * @param fn - The action function\n */\n registerAction(e, t) {\n this.globalActions.set(e, t);\n }\n /**\n * Register a global XState transition action function\n * @param name - The name of the transition action\n * @param fn - The transition action function\n */\n registerTransitionAction(e, t) {\n this.globalTransitionActions.set(e, t);\n }\n /**\n * Configure rollback behavior for a specific field trigger\n * @param doctype - The doctype name\n * @param fieldname - The field name\n * @param enableRollback - Whether to enable rollback\n */\n setFieldRollback(e, t, r) {\n this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(t, r);\n }\n /**\n * Get rollback configuration for a specific field trigger\n */\n getFieldRollback(e, t) {\n return this.fieldRollbackConfig.get(e)?.get(t);\n }\n /**\n * Register actions from a doctype - both regular actions and field triggers\n * Separates XState transitions (uppercase) from field triggers (lowercase)\n * @param doctype - The doctype name\n * @param actions - The actions to register (supports Immutable Map, Map, or plain object)\n */\n registerDoctypeActions(e, t) {\n if (!t) return;\n const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();\n if (typeof t.entrySeq == \"function\")\n t.entrySeq().forEach(([i, s]) => {\n this.categorizeAction(i, s, r, n);\n });\n else if (t instanceof Map)\n for (const [i, s] of t)\n this.categorizeAction(i, s, r, n);\n else t && typeof t == \"object\" && Object.entries(t).forEach(([i, s]) => {\n this.categorizeAction(i, s, r, n);\n });\n this.doctypeActions.set(e, r), this.doctypeTransitions.set(e, n);\n }\n /**\n * Categorize an action as either a field trigger or XState transition\n * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger\n */\n categorizeAction(e, t, r, n) {\n this.isTransitionKey(e) ? n.set(e, t) : r.set(e, t);\n }\n /**\n * Determine if a key represents an XState transition\n * Transitions are identified by being all uppercase\n */\n isTransitionKey(e) {\n return /^[A-Z0-9_]+$/.test(e) && e.length > 0;\n }\n /**\n * Execute field triggers for a changed field\n * @param context - The field change context\n * @param options - Execution options (timeout and enableRollback)\n */\n async executeFieldTriggers(e, t = {}) {\n const { doctype: r, fieldname: n } = e, i = this.findFieldTriggers(r, n);\n if (i.length === 0)\n return {\n path: e.path,\n actionResults: [],\n totalExecutionTime: 0,\n allSucceeded: !0,\n stoppedOnError: !1,\n rolledBack: !1\n };\n const s = performance.now(), a = [];\n let c = !1, d = !1, g;\n const S = this.getFieldRollback(r, n), $ = t.enableRollback ?? S ?? this.options.enableRollback;\n $ && e.store && (g = this.captureSnapshot(e));\n for (const R of i)\n try {\n const O = await this.executeAction(R, e, t.timeout);\n if (a.push(O), !O.success) {\n c = !0;\n break;\n }\n } catch (O) {\n const h = {\n success: !1,\n error: O instanceof Error ? O : new Error(String(O)),\n executionTime: 0,\n action: R\n };\n a.push(h), c = !0;\n break;\n }\n if ($ && c && g && e.store)\n try {\n this.restoreSnapshot(e, g), d = !0;\n } catch (R) {\n console.error(\"[FieldTriggers] Rollback failed:\", R);\n }\n const k = performance.now() - s, x = a.filter((R) => !R.success);\n if (x.length > 0 && this.options.errorHandler)\n for (const R of x)\n try {\n this.options.errorHandler(R.error, e, R.action);\n } catch (O) {\n console.error(\"[FieldTriggers] Error in global error handler:\", O);\n }\n return {\n path: e.path,\n actionResults: a,\n totalExecutionTime: k,\n allSucceeded: a.every((R) => R.success),\n stoppedOnError: c,\n rolledBack: d,\n snapshot: this.options.debug && $ ? g : void 0\n // Only include snapshot in debug mode if rollback is enabled\n };\n }\n /**\n * Execute XState transition actions\n * Similar to field triggers but specifically for FSM state transitions\n * @param context - The transition change context\n * @param options - Execution options (timeout)\n */\n async executeTransitionActions(e, t = {}) {\n const { doctype: r, transition: n } = e, i = this.findTransitionActions(r, n);\n if (i.length === 0)\n return [];\n const s = [];\n for (const c of i)\n try {\n const d = await this.executeTransitionAction(c, e, t.timeout);\n if (s.push(d), !d.success)\n break;\n } catch (d) {\n const S = {\n success: !1,\n error: d instanceof Error ? d : new Error(String(d)),\n executionTime: 0,\n action: c,\n transition: n\n };\n s.push(S);\n break;\n }\n const a = s.filter((c) => !c.success);\n if (a.length > 0 && this.options.errorHandler)\n for (const c of a)\n try {\n this.options.errorHandler(c.error, e, c.action);\n } catch (d) {\n console.error(\"[FieldTriggers] Error in global error handler:\", d);\n }\n return s;\n }\n /**\n * Find transition actions for a specific doctype and transition\n */\n findTransitionActions(e, t) {\n const r = this.doctypeTransitions.get(e);\n return r ? r.get(t) || [] : [];\n }\n /**\n * Execute a single transition action by name\n */\n async executeTransitionAction(e, t, r) {\n const n = performance.now(), i = r ?? this.options.defaultTimeout;\n try {\n let s = this.globalTransitionActions.get(e);\n if (!s) {\n const c = this.globalActions.get(e);\n c && (s = c);\n }\n if (!s)\n throw new Error(`Transition action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(s, t, i), {\n success: !0,\n executionTime: performance.now() - n,\n action: e,\n transition: t.transition\n };\n } catch (s) {\n const a = performance.now() - n;\n return {\n success: !1,\n error: s instanceof Error ? s : new Error(String(s)),\n executionTime: a,\n action: e,\n transition: t.transition\n };\n }\n }\n /**\n * Find field triggers for a specific doctype and field\n * Field triggers are identified by keys that look like field paths (contain dots or match field names)\n */\n findFieldTriggers(e, t) {\n const r = this.doctypeActions.get(e);\n if (!r) return [];\n const n = [];\n for (const [i, s] of r)\n this.isFieldTriggerKey(i, t) && n.push(...s);\n return n;\n }\n /**\n * Determine if an action key represents a field trigger\n * Field triggers can be:\n * - Exact field name match: \"emailAddress\"\n * - Wildcard patterns: \"emailAddress.*\", \"*.is_primary\"\n * - Nested field paths: \"address.street\", \"contact.email\"\n */\n isFieldTriggerKey(e, t) {\n return e === t ? !0 : e.includes(\".\") ? this.matchFieldPattern(e, t) : e.includes(\"*\") ? this.matchFieldPattern(e, t) : !1;\n }\n /**\n * Match a field pattern against a field name\n * Supports wildcards (*) for dynamic segments\n */\n matchFieldPattern(e, t) {\n const r = e.split(\".\"), n = t.split(\".\");\n if (r.length !== n.length)\n return !1;\n for (let i = 0; i < r.length; i++) {\n const s = r[i], a = n[i];\n if (s !== \"*\" && s !== a)\n return !1;\n }\n return !0;\n }\n /**\n * Execute a single action by name\n */\n async executeAction(e, t, r) {\n const n = performance.now(), i = r ?? this.options.defaultTimeout;\n try {\n const s = this.globalActions.get(e);\n if (!s)\n throw new Error(`Action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(s, t, i), {\n success: !0,\n executionTime: performance.now() - n,\n action: e\n };\n } catch (s) {\n const a = performance.now() - n;\n return {\n success: !1,\n error: s instanceof Error ? s : new Error(String(s)),\n executionTime: a,\n action: e\n };\n }\n }\n /**\n * Execute a function with timeout\n */\n async executeWithTimeout(e, t, r) {\n return new Promise((n, i) => {\n const s = setTimeout(() => {\n i(new Error(`Action timeout after ${r}ms`));\n }, r);\n Promise.resolve(e(t)).then((a) => {\n clearTimeout(s), n(a);\n }).catch((a) => {\n clearTimeout(s), i(a);\n });\n });\n }\n /**\n * Capture a snapshot of the record state before executing actions\n * This creates a deep copy of the record data for potential rollback\n */\n captureSnapshot(e) {\n if (!(!e.store || !e.doctype || !e.recordId))\n try {\n const t = `${e.doctype}.${e.recordId}`, r = e.store.get(t);\n return !r || typeof r != \"object\" ? void 0 : JSON.parse(JSON.stringify(r));\n } catch (t) {\n this.options.debug && console.warn(\"[FieldTriggers] Failed to capture snapshot:\", t);\n return;\n }\n }\n /**\n * Restore a previously captured snapshot\n * This reverts the record to its state before actions were executed\n */\n restoreSnapshot(e, t) {\n if (!(!e.store || !e.doctype || !e.recordId || !t))\n try {\n const r = `${e.doctype}.${e.recordId}`;\n e.store.set(r, t), this.options.debug && console.log(`[FieldTriggers] Rolled back ${r} to previous state`);\n } catch (r) {\n throw console.error(\"[FieldTriggers] Failed to restore snapshot:\", r), r;\n }\n }\n}\nfunction J(o) {\n return new ee(o);\n}\nfunction ct(o, e) {\n J().registerAction(o, e);\n}\nfunction lt(o, e) {\n J().registerTransitionAction(o, e);\n}\nfunction ut(o, e, t) {\n J().setFieldRollback(o, e, t);\n}\nasync function ft(o, e, t) {\n const r = J(), n = {\n path: t?.path || (t?.recordId ? `${o}.${t.recordId}` : o),\n fieldname: \"\",\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: o,\n recordId: t?.recordId,\n timestamp: /* @__PURE__ */ new Date(),\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n };\n return await r.executeTransitionActions(n);\n}\nfunction dt(o, e) {\n if (o)\n try {\n re().markIrreversible(o, e);\n } catch {\n }\n}\nfunction ge() {\n try {\n return re();\n } catch {\n return null;\n }\n}\nclass Y {\n static instance;\n /**\n * Gets the singleton instance of HST\n * @returns The HST singleton instance\n */\n static getInstance() {\n return Y.instance || (Y.instance = new Y()), Y.instance;\n }\n /**\n * Gets the global registry instance\n * @returns The global registry object or undefined if not found\n */\n getRegistry() {\n if (typeof globalThis < \"u\") {\n const e = globalThis.Registry?._root;\n if (e)\n return e;\n }\n if (typeof window < \"u\") {\n const e = window.Registry?._root;\n if (e)\n return e;\n }\n if (typeof global < \"u\" && global) {\n const e = global.Registry?._root;\n if (e)\n return e;\n }\n }\n /**\n * Helper method to get doctype metadata from the registry\n * @param doctype - The name of the doctype to retrieve metadata for\n * @returns The doctype metadata object or undefined if not found\n */\n getDoctypeMeta(e) {\n const t = this.getRegistry();\n if (t && typeof t == \"object\" && \"registry\" in t)\n return t.registry[e];\n }\n}\nclass se {\n target;\n parentPath;\n rootNode;\n doctype;\n parentDoctype;\n hst;\n constructor(e, t, r = \"\", n = null, i) {\n return this.target = e, this.parentPath = r, this.rootNode = n || this, this.doctype = t, this.parentDoctype = i, this.hst = Y.getInstance(), new Proxy(this, {\n get(s, a) {\n if (a in s) return s[a];\n const c = String(a);\n return s.getNode(c);\n },\n set(s, a, c) {\n const d = String(a);\n return s.set(d, c), !0;\n }\n });\n }\n get(e) {\n return this.resolveValue(e);\n }\n // Method to get a tree-wrapped node for navigation\n getNode(e) {\n const t = this.resolvePath(e), r = this.resolveValue(e), n = t.split(\".\");\n let i = this.doctype;\n return this.doctype === \"StonecropStore\" && n.length >= 1 && (i = n[0]), typeof r == \"object\" && r !== null && !this.isPrimitive(r) ? new se(r, i, t, this.rootNode, this.parentDoctype) : new se(r, i, t, this.rootNode, this.parentDoctype);\n }\n set(e, t, r = \"user\") {\n const n = this.resolvePath(e), i = this.has(e) ? this.get(e) : void 0;\n if (r !== \"undo\" && r !== \"redo\") {\n const s = ge();\n if (s && typeof s.addOperation == \"function\") {\n const a = n.split(\".\"), c = this.doctype === \"StonecropStore\" && a.length >= 1 ? a[0] : this.doctype, d = a.length >= 2 ? a[1] : void 0, g = a.slice(2).join(\".\") || a[a.length - 1], $ = t === void 0 && i !== void 0 ? \"delete\" : \"set\";\n s.addOperation(\n {\n type: $,\n path: n,\n fieldname: g,\n beforeValue: i,\n afterValue: t,\n doctype: c,\n recordId: d,\n reversible: !0\n // Default to reversible, can be changed by field triggers\n },\n r\n );\n }\n }\n this.updateValue(e, t), this.triggerFieldActions(n, i, t);\n }\n has(e) {\n try {\n if (e === \"\")\n return !0;\n const t = this.parsePath(e);\n let r = this.target;\n for (let n = 0; n < t.length; n++) {\n const i = t[n];\n if (r == null)\n return !1;\n if (n === t.length - 1)\n return this.isImmutable(r) ? r.has(i) : this.isPiniaStore(r) && r.$state && i in r.$state || i in r;\n r = this.getProperty(r, i);\n }\n return !1;\n } catch {\n return !1;\n }\n }\n // Tree navigation methods\n getParent() {\n if (!this.parentPath) return null;\n const t = this.parentPath.split(\".\").slice(0, -1).join(\".\");\n return t === \"\" ? this.rootNode : this.rootNode.getNode(t);\n }\n getRoot() {\n return this.rootNode;\n }\n getPath() {\n return this.parentPath;\n }\n getDepth() {\n return this.parentPath ? this.parentPath.split(\".\").length : 0;\n }\n getBreadcrumbs() {\n return this.parentPath ? this.parentPath.split(\".\") : [];\n }\n /**\n * Trigger an XState transition with optional context data\n */\n async triggerTransition(e, t) {\n const r = J(), n = this.parentPath.split(\".\");\n let i = this.doctype, s;\n this.doctype === \"StonecropStore\" && n.length >= 1 && (i = n[0]), n.length >= 2 && (s = n[1]);\n const a = {\n path: this.parentPath,\n fieldname: \"\",\n // No specific field for transitions\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: i,\n recordId: s,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0,\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }, c = ge();\n return c && typeof c.addOperation == \"function\" && c.addOperation(\n {\n type: \"transition\",\n path: this.parentPath,\n fieldname: e,\n beforeValue: t?.currentState,\n afterValue: t?.targetState,\n doctype: i,\n recordId: s,\n reversible: !1,\n // FSM transitions are generally not reversible\n metadata: {\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }\n },\n \"user\"\n ), await r.executeTransitionActions(a);\n }\n // Private helper methods\n resolvePath(e) {\n return e === \"\" ? this.parentPath : this.parentPath ? `${this.parentPath}.${e}` : e;\n }\n resolveValue(e) {\n if (e === \"\")\n return this.target;\n const t = this.parsePath(e);\n let r = this.target;\n for (const n of t) {\n if (r == null)\n return;\n r = this.getProperty(r, n);\n }\n return r;\n }\n updateValue(e, t) {\n if (e === \"\")\n throw new Error(\"Cannot set value on empty path\");\n const r = this.parsePath(e), n = r.pop();\n let i = this.target;\n for (const s of r)\n if (i = this.getProperty(i, s), i == null)\n throw new Error(`Cannot set property on null/undefined path: ${e}`);\n this.setProperty(i, n, t);\n }\n getProperty(e, t) {\n return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];\n }\n setProperty(e, t, r) {\n if (this.isImmutable(e))\n throw new Error(\"Cannot directly mutate immutable objects. Use immutable update methods instead.\");\n if (this.isPiniaStore(e)) {\n e.$patch ? e.$patch({ [t]: r }) : e[t] = r;\n return;\n }\n e[t] = r;\n }\n async triggerFieldActions(e, t, r) {\n try {\n if (!e || typeof e != \"string\")\n return;\n const n = e.split(\".\");\n if (n.length < 3)\n return;\n const i = J(), s = n.slice(2).join(\".\") || n[n.length - 1];\n let a = this.doctype;\n this.doctype === \"StonecropStore\" && n.length >= 1 && (a = n[0]);\n let c;\n n.length >= 2 && (c = n[1]);\n const d = {\n path: e,\n fieldname: s,\n beforeValue: t,\n afterValue: r,\n operation: \"set\",\n doctype: a,\n recordId: c,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0\n // Pass the root store for snapshot/rollback capabilities\n };\n await i.executeFieldTriggers(d);\n } catch (n) {\n n instanceof Error && console.warn(\"Field trigger error:\", n.message);\n }\n }\n isVueReactive(e) {\n return e && typeof e == \"object\" && \"__v_isReactive\" in e && e.__v_isReactive === !0;\n }\n isPiniaStore(e) {\n return e && typeof e == \"object\" && (\"$state\" in e || \"$patch\" in e || \"$id\" in e);\n }\n isImmutable(e) {\n if (!e || typeof e != \"object\")\n return !1;\n const t = \"get\" in e && typeof e.get == \"function\", r = \"set\" in e && typeof e.set == \"function\", n = \"has\" in e && typeof e.has == \"function\", i = \"__ownerID\" in e || \"_map\" in e || \"_list\" in e || \"_origin\" in e || \"_capacity\" in e || \"_defaultValues\" in e || \"_tail\" in e || \"_root\" in e || \"size\" in e && t && r;\n let s;\n try {\n const c = e;\n if (\"constructor\" in c && c.constructor && typeof c.constructor == \"object\" && \"name\" in c.constructor) {\n const d = c.constructor.name;\n s = typeof d == \"string\" ? d : void 0;\n }\n } catch {\n s = void 0;\n }\n const a = s && (s.includes(\"Map\") || s.includes(\"List\") || s.includes(\"Set\") || s.includes(\"Stack\") || s.includes(\"Seq\")) && (t || r);\n return !!(t && r && n && i || t && r && a);\n }\n isPrimitive(e) {\n return e == null || typeof e == \"string\" || typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"function\" || typeof e == \"symbol\" || typeof e == \"bigint\";\n }\n /**\n * Parse a path string into segments, handling both dot notation and array bracket notation\n * @param path - The path string to parse (e.g., \"order.456.line_items[0].product\")\n * @returns Array of path segments (e.g., ['order', '456', 'line_items', '0', 'product'])\n */\n parsePath(e) {\n return e ? e.replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter((r) => r.length > 0) : [];\n }\n}\nfunction et(o, e, t) {\n return new se(o, e, \"\", null, t);\n}\nclass Ae {\n hstStore;\n _operationLogStore;\n _operationLogConfig;\n /** The registry instance containing all doctype definitions */\n registry;\n /**\n * Creates a new Stonecrop instance with HST integration\n * @param registry - The Registry instance containing doctype definitions\n * @param operationLogConfig - Optional configuration for the operation log\n */\n constructor(e, t) {\n this.registry = e, this._operationLogConfig = t, this.initializeHSTStore(), this.setupRegistrySync();\n }\n /**\n * Get the operation log store (lazy initialization)\n * @internal\n */\n getOperationLogStore() {\n return this._operationLogStore || (this._operationLogStore = re(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;\n }\n /**\n * Initialize the HST store structure\n */\n initializeHSTStore() {\n const e = {};\n Object.keys(this.registry.registry).forEach((t) => {\n e[t] = {};\n }), this.hstStore = et(ue(e), \"StonecropStore\");\n }\n /**\n * Setup automatic sync with Registry when doctypes are added\n */\n setupRegistrySync() {\n const e = this.registry.addDoctype.bind(this.registry);\n this.registry.addDoctype = (t) => {\n e(t), this.hstStore.has(t.slug) || this.hstStore.set(t.slug, {});\n };\n }\n /**\n * Get records hash for a doctype\n * @param doctype - The doctype to get records for\n * @returns HST node containing records hash\n */\n records(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n return this.ensureDoctypeExists(t), this.hstStore.getNode(t);\n }\n /**\n * Add a record to the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @param recordData - The record data\n */\n addRecord(e, t, r) {\n const n = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(n), this.hstStore.set(`${n}.${t}`, r);\n }\n /**\n * Get a specific record\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @returns HST node for the record or undefined\n */\n getRecordById(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n if (this.ensureDoctypeExists(r), !(!this.hstStore.has(`${r}.${t}`) || this.hstStore.get(`${r}.${t}`) === void 0))\n return this.hstStore.getNode(`${r}.${t}`);\n }\n /**\n * Remove a record from the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n removeRecord(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(r), this.hstStore.has(`${r}.${t}`) && this.hstStore.set(`${r}.${t}`, void 0);\n }\n /**\n * Get all record IDs for a doctype\n * @param doctype - The doctype\n * @returns Array of record IDs\n */\n getRecordIds(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t);\n const r = this.hstStore.get(t);\n return !r || typeof r != \"object\" ? [] : Object.keys(r).filter((n) => r[n] !== void 0);\n }\n /**\n * Clear all records for a doctype\n * @param doctype - The doctype\n */\n clearRecords(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((n) => {\n this.hstStore.set(`${t}.${n}`, void 0);\n });\n }\n /**\n * Setup method for doctype initialization\n * @param doctype - The doctype to setup\n */\n setup(e) {\n this.ensureDoctypeExists(e.slug);\n }\n /**\n * Run action on doctype\n * Executes the action and logs it to the operation log for audit tracking\n * @param doctype - The doctype\n * @param action - The action to run\n * @param args - Action arguments (typically record IDs)\n */\n runAction(e, t, r) {\n const i = this.registry.registry[e.slug]?.actions?.get(t), s = Array.isArray(r) ? r.filter((g) => typeof g == \"string\") : void 0, a = this.getOperationLogStore();\n let c = \"success\", d;\n try {\n i && i.length > 0 && i.forEach((g) => {\n try {\n new Function(\"args\", g)(r);\n } catch (S) {\n throw c = \"failure\", d = S instanceof Error ? S.message : \"Unknown error\", S;\n }\n });\n } catch {\n } finally {\n a.logAction(e.doctype, t, s, c, d);\n }\n }\n /**\n * Get records from server (maintains compatibility)\n * @param doctype - The doctype\n */\n async getRecords(e) {\n (await (await fetch(`/${e.slug}`)).json()).forEach((n) => {\n n.id && this.addRecord(e, n.id, n);\n });\n }\n /**\n * Get single record from server (maintains compatibility)\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n async getRecord(e, t) {\n const n = await (await fetch(`/${e.slug}/${t}`)).json();\n this.addRecord(e, t, n);\n }\n /**\n * Ensure doctype section exists in HST store\n * @param slug - The doctype slug\n */\n ensureDoctypeExists(e) {\n this.hstStore.has(e) || this.hstStore.set(e, {});\n }\n /**\n * Get doctype metadata from the registry\n * @param context - The route context\n * @returns The doctype metadata\n */\n async getMeta(e) {\n if (!this.registry.getMeta)\n throw new Error(\"No getMeta function provided to Registry\");\n return await this.registry.getMeta(e);\n }\n /**\n * Get the root HST store node for advanced usage\n * @returns Root HST node\n */\n getStore() {\n return this.hstStore;\n }\n}\nfunction pt(o) {\n o || (o = {});\n const e = o.registry || fe(\"$registry\"), t = fe(\"$stonecrop\"), r = L(), n = L(), i = L({}), s = L(), a = L(), c = L([]);\n if (o.doctype && e) {\n const p = o.doctype.schema ? Array.isArray(o.doctype.schema) ? o.doctype.schema : Array.from(o.doctype.schema) : [];\n c.value = e.resolveSchema(p);\n }\n const d = L([]), g = L(-1), S = B(() => r.value?.getOperationLogStore().canUndo ?? !1), $ = B(() => r.value?.getOperationLogStore().canRedo ?? !1), k = B(() => r.value?.getOperationLogStore().undoCount ?? 0), x = B(() => r.value?.getOperationLogStore().redoCount ?? 0), F = B(\n () => r.value?.getOperationLogStore().undoRedoState ?? {\n canUndo: !1,\n canRedo: !1,\n undoCount: 0,\n redoCount: 0,\n currentIndex: -1\n }\n ), R = (p) => r.value?.getOperationLogStore().undo(p) ?? !1, O = (p) => r.value?.getOperationLogStore().redo(p) ?? !1, w = () => {\n r.value?.getOperationLogStore().startBatch();\n }, h = (p) => r.value?.getOperationLogStore().commitBatch(p) ?? null, E = () => {\n r.value?.getOperationLogStore().cancelBatch();\n }, b = () => {\n r.value?.getOperationLogStore().clear();\n }, A = (p, m) => r.value?.getOperationLogStore().getOperationsFor(p, m) ?? [], C = () => r.value?.getOperationLogStore().getSnapshot() ?? {\n operations: [],\n currentIndex: -1,\n totalOperations: 0,\n reversibleOperations: 0,\n irreversibleOperations: 0\n }, M = (p, m) => {\n r.value?.getOperationLogStore().markIrreversible(p, m);\n }, W = (p, m, y, u = \"success\", l) => r.value?.getOperationLogStore().logAction(p, m, y, u, l) ?? \"\", N = (p) => {\n r.value?.getOperationLogStore().configure(p);\n };\n me(async () => {\n if (e) {\n r.value = t || new Ae(e);\n try {\n const p = r.value.getOperationLogStore(), m = be(p);\n d.value = m.operations.value, g.value = m.currentIndex.value, U(\n () => m.operations.value,\n (y) => {\n d.value = y;\n }\n ), U(\n () => m.currentIndex.value,\n (y) => {\n g.value = y;\n }\n );\n } catch {\n }\n if (!o.doctype && e.router) {\n const p = e.router.currentRoute.value;\n if (!p.path) return;\n const m = p.path.split(\"/\").filter((u) => u.length > 0), y = m[1]?.toLowerCase();\n if (m.length > 0) {\n const u = {\n path: p.path,\n segments: m\n }, l = await e.getMeta?.(u);\n if (l) {\n if (e.addDoctype(l), r.value.setup(l), s.value = l, a.value = y, n.value = r.value.getStore(), e) {\n const f = l.schema ? Array.isArray(l.schema) ? l.schema : Array.from(l.schema) : [];\n c.value = e.resolveSchema(f);\n }\n if (y && y !== \"new\") {\n const f = r.value.getRecordById(l, y);\n if (f)\n i.value = f.get(\"\") || {};\n else\n try {\n await r.value.getRecord(l, y);\n const T = r.value.getRecordById(l, y);\n T && (i.value = T.get(\"\") || {});\n } catch {\n i.value = z(l);\n }\n } else\n i.value = z(l);\n n.value && ve(l, y || \"new\", i, n.value), r.value.runAction(l, \"load\", y ? [y] : void 0);\n }\n }\n }\n if (o.doctype) {\n n.value = r.value.getStore();\n const p = o.doctype, m = o.recordId;\n if (m && m !== \"new\") {\n const y = r.value.getRecordById(p, m);\n if (y)\n i.value = y.get(\"\") || {};\n else\n try {\n await r.value.getRecord(p, m);\n const u = r.value.getRecordById(p, m);\n u && (i.value = u.get(\"\") || {});\n } catch {\n i.value = z(p);\n }\n } else\n i.value = z(p);\n n.value && ve(p, m || \"new\", i, n.value);\n }\n }\n });\n const q = (p, m) => {\n const y = o.doctype || s.value;\n if (!y) return \"\";\n const u = m || o.recordId || a.value || \"new\";\n return `${y.slug}.${u}.${p}`;\n }, _ = (p) => {\n const m = o.doctype || s.value;\n if (!(!n.value || !r.value || !m))\n try {\n const y = p.path.split(\".\");\n if (y.length >= 2) {\n const f = y[0], T = y[1];\n if (n.value.has(`${f}.${T}`) || r.value.addRecord(m, T, { ...i.value }), y.length > 3) {\n const V = `${f}.${T}`, I = y.slice(2);\n let K = V;\n for (let Z = 0; Z < I.length - 1; Z++)\n if (K += `.${I[Z]}`, !n.value.has(K)) {\n const ae = I[Z + 1], $e = !isNaN(Number(ae));\n n.value.set(K, $e ? [] : {});\n }\n }\n }\n n.value.set(p.path, p.value);\n const u = p.fieldname.split(\".\"), l = { ...i.value };\n u.length === 1 ? l[u[0]] = p.value : tt(l, u, p.value), i.value = l;\n } catch {\n }\n };\n (o.doctype || e?.router) && (pe(\"hstPathProvider\", q), pe(\"hstChangeHandler\", _));\n const G = (p, m, y) => {\n if (!r.value)\n return z(m);\n if (y)\n try {\n const u = n.value?.get(p);\n return u && typeof u == \"object\" ? u : z(m);\n } catch {\n return z(m);\n }\n return z(m);\n }, v = async (p, m) => {\n if (!n.value || !r.value)\n throw new Error(\"HST store not initialized\");\n const y = `${p.slug}.${m}`, l = { ...n.value.get(y) || {} }, f = p.schema ? Array.isArray(p.schema) ? p.schema : Array.from(p.schema) : [], V = (e ? e.resolveSchema(f) : f).filter(\n (I) => \"fieldtype\" in I && I.fieldtype === \"Doctype\" && \"schema\" in I && Array.isArray(I.schema)\n );\n for (const I of V) {\n const K = I, Z = `${y}.${K.fieldname}`, ae = Oe(K.schema, Z, n.value);\n l[K.fieldname] = ae;\n }\n return l;\n }, P = (p, m) => ({\n provideHSTPath: (l) => `${p}.${l}`,\n handleHSTChange: (l) => {\n const f = l.path.startsWith(p) ? l.path : `${p}.${l.fieldname}`;\n _({\n ...l,\n path: f\n });\n }\n }), D = {\n operations: d,\n currentIndex: g,\n undoRedoState: F,\n canUndo: S,\n canRedo: $,\n undoCount: k,\n redoCount: x,\n undo: R,\n redo: O,\n startBatch: w,\n commitBatch: h,\n cancelBatch: E,\n clear: b,\n getOperationsFor: A,\n getSnapshot: C,\n markIrreversible: M,\n logAction: W,\n configure: N\n };\n return o.doctype ? {\n stonecrop: r,\n operationLog: D,\n provideHSTPath: q,\n handleHSTChange: _,\n hstStore: n,\n formData: i,\n resolvedSchema: c,\n loadNestedData: G,\n saveRecursive: v,\n createNestedContext: P\n } : !o.doctype && e?.router ? {\n stonecrop: r,\n operationLog: D,\n provideHSTPath: q,\n handleHSTChange: _,\n hstStore: n,\n formData: i,\n resolvedSchema: c,\n loadNestedData: G,\n saveRecursive: v,\n createNestedContext: P\n } : {\n stonecrop: r,\n operationLog: D\n };\n}\nfunction z(o) {\n const e = {};\n return o.schema && o.schema.forEach((t) => {\n switch (\"fieldtype\" in t ? t.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n e[t.fieldname] = \"\";\n break;\n case \"Check\":\n e[t.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n e[t.fieldname] = 0;\n break;\n case \"Table\":\n e[t.fieldname] = [];\n break;\n case \"JSON\":\n e[t.fieldname] = {};\n break;\n default:\n e[t.fieldname] = null;\n }\n }), e;\n}\nfunction ve(o, e, t, r) {\n U(\n t,\n (n) => {\n const i = `${o.slug}.${e}`;\n Object.keys(n).forEach((s) => {\n const a = `${i}.${s}`;\n try {\n r.set(a, n[s]);\n } catch {\n }\n });\n },\n { deep: !0 }\n );\n}\nfunction tt(o, e, t) {\n let r = o;\n for (let i = 0; i < e.length - 1; i++) {\n const s = e[i];\n (!(s in r) || typeof r[s] != \"object\") && (r[s] = isNaN(Number(e[i + 1])) ? {} : []), r = r[s];\n }\n const n = e[e.length - 1];\n r[n] = t;\n}\nfunction Oe(o, e, t) {\n const n = { ...t.get(e) || {} }, i = o.filter(\n (s) => \"fieldtype\" in s && s.fieldtype === \"Doctype\" && \"schema\" in s && Array.isArray(s.schema)\n );\n for (const s of i) {\n const a = s, c = `${e}.${a.fieldname}`, d = Oe(a.schema, c, t);\n n[a.fieldname] = d;\n }\n return n;\n}\nfunction Te(o) {\n const t = fe(\"$operationLogStore\", void 0) || re();\n o && t.configure(o);\n const { operations: r, currentIndex: n, undoRedoState: i, canUndo: s, canRedo: a, undoCount: c, redoCount: d } = be(t);\n function g(b) {\n return t.undo(b);\n }\n function S(b) {\n return t.redo(b);\n }\n function $() {\n t.startBatch();\n }\n function k(b) {\n return t.commitBatch(b);\n }\n function x() {\n t.cancelBatch();\n }\n function F() {\n t.clear();\n }\n function R(b, A) {\n return t.getOperationsFor(b, A);\n }\n function O() {\n return t.getSnapshot();\n }\n function w(b, A) {\n t.markIrreversible(b, A);\n }\n function h(b, A, C, M = \"success\", W) {\n return t.logAction(b, A, C, M, W);\n }\n function E(b) {\n t.configure(b);\n }\n return {\n // State\n operations: r,\n currentIndex: n,\n undoRedoState: i,\n canUndo: s,\n canRedo: a,\n undoCount: c,\n redoCount: d,\n // Methods\n undo: g,\n redo: S,\n startBatch: $,\n commitBatch: k,\n cancelBatch: x,\n clear: F,\n getOperationsFor: R,\n getSnapshot: O,\n markIrreversible: w,\n logAction: h,\n configure: E\n };\n}\nfunction ht(o, e = !0) {\n if (!e) return;\n const { undo: t, redo: r, canUndo: n, canRedo: i } = Te(), s = Ye();\n X(s[\"Ctrl+Z\"], () => {\n n.value && t(o);\n }), X(s[\"Meta+Z\"], () => {\n n.value && t(o);\n }), X(s[\"Ctrl+Shift+Z\"], () => {\n i.value && r(o);\n }), X(s[\"Meta+Shift+Z\"], () => {\n i.value && r(o);\n }), X(s[\"Ctrl+Y\"], () => {\n i.value && r(o);\n });\n}\nasync function gt(o, e) {\n const { startBatch: t, commitBatch: r, cancelBatch: n } = Te();\n t();\n try {\n return await o(), r(e);\n } catch (i) {\n throw n(), i;\n }\n}\nclass vt {\n /**\n * The doctype name\n * @public\n * @readonly\n */\n doctype;\n /**\n * The doctype schema\n * @public\n * @readonly\n */\n schema;\n /**\n * The doctype workflow\n * @public\n * @readonly\n */\n workflow;\n /**\n * The doctype actions and field triggers\n * @public\n * @readonly\n */\n actions;\n /**\n * The doctype component\n * @public\n * @readonly\n */\n component;\n /**\n * Creates a new DoctypeMeta instance\n * @param doctype - The doctype name\n * @param schema - The doctype schema definition\n * @param workflow - The doctype workflow configuration (XState machine)\n * @param actions - The doctype actions and field triggers\n * @param component - Optional Vue component for rendering the doctype\n */\n constructor(e, t, r, n, i) {\n this.doctype = e, this.schema = t, this.workflow = r, this.actions = n, this.component = i;\n }\n /**\n * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n * - It replaces camelCase and PascalCase with kebab-case strings\n * - It replaces spaces and underscores with hyphens\n * - It converts the string to lowercase\n *\n * @returns The slugified doctype string\n *\n * @example\n * ```ts\n * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n * console.log(doctype.slug) // 'task-item'\n * ```\n *\n * @public\n */\n get slug() {\n return this.doctype.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[\\s_]+/g, \"-\").toLowerCase();\n }\n}\nclass te {\n /**\n * The root Registry instance\n */\n static _root;\n /**\n * The name of the Registry instance\n *\n * @defaultValue 'Registry'\n */\n name;\n /**\n * The registry property contains a collection of doctypes\n * @see {@link DoctypeMeta}\n */\n registry;\n /**\n * The Vue router instance\n * @see {@link https://router.vuejs.org/}\n */\n router;\n /**\n * Creates a new Registry instance (singleton pattern)\n * @param router - Optional Vue router instance for route management\n * @param getMeta - Optional function to fetch doctype metadata from an API\n */\n constructor(e, t) {\n if (te._root)\n return te._root;\n te._root = this, this.name = \"Registry\", this.registry = {}, this.router = e, this.getMeta = t;\n }\n /**\n * The getMeta function fetches doctype metadata from an API based on route context\n * @see {@link DoctypeMeta}\n */\n getMeta;\n /**\n * Get doctype metadata\n * @param doctype - The doctype to fetch metadata for\n * @returns The doctype metadata\n * @see {@link DoctypeMeta}\n */\n addDoctype(e) {\n e.doctype in Object.keys(this.registry) || (this.registry[e.slug] = e);\n const t = J();\n t.registerDoctypeActions(e.doctype, e.actions), e.slug !== e.doctype && t.registerDoctypeActions(e.slug, e.actions), e.component && this.router && !this.router.hasRoute(e.doctype) && this.router.addRoute({\n path: `/${e.slug}`,\n name: e.slug,\n component: e.component\n });\n }\n /**\n * Resolve nested Doctype and Table fields in a schema by embedding child schemas inline.\n *\n * @remarks\n * Walks the schema array and for each field with `fieldtype: 'Doctype'` and a string\n * `options` value, looks up the referenced doctype in the registry and embeds its schema\n * as the field's `schema` property. Recurses for deeply nested doctypes.\n *\n * For fields with `fieldtype: 'Table'`, looks up the referenced child doctype and\n * auto-derives `columns` from its schema fields (unless columns are already provided).\n * Also sets sensible defaults for `component` (`'ATable'`) and `config` (`{ view: 'list' }`).\n * Row data is expected to come from the parent form's data model at `data[fieldname]`.\n *\n * Returns a new array — does not mutate the original schema.\n *\n * @param schema - The schema array to resolve\n * @returns A new schema array with nested Doctype fields resolved\n *\n * @example\n * ```ts\n * registry.addDoctype(addressDoctype)\n * registry.addDoctype(customerDoctype)\n *\n * // Before: customer schema has { fieldname: 'address', fieldtype: 'Doctype', options: 'address' }\n * const resolved = registry.resolveSchema(customerSchema)\n * // After: address field now has schema: [...address fields...]\n * ```\n *\n * @public\n */\n resolveSchema(e, t) {\n const r = t || /* @__PURE__ */ new Set();\n return e.map((n) => {\n if (\"fieldtype\" in n && n.fieldtype === \"Doctype\" && \"options\" in n && typeof n.options == \"string\") {\n const i = n.options;\n if (r.has(i))\n return { ...n };\n const s = this.registry[i];\n if (s && s.schema) {\n const a = Array.isArray(s.schema) ? s.schema : Array.from(s.schema);\n r.add(i);\n const c = this.resolveSchema(a, r);\n return r.delete(i), { ...n, schema: c };\n }\n }\n if (\"fieldtype\" in n && n.fieldtype === \"Table\" && \"options\" in n && typeof n.options == \"string\") {\n const i = n.options;\n if (r.has(i))\n return { ...n };\n const s = this.registry[i];\n if (s && s.schema) {\n const a = Array.isArray(s.schema) ? s.schema : Array.from(s.schema), c = { ...n };\n return (!(\"columns\" in n) || !n.columns) && (c.columns = a.map((d) => ({\n name: d.fieldname,\n fieldname: d.fieldname,\n label: \"label\" in d && d.label || d.fieldname,\n fieldtype: \"fieldtype\" in d ? d.fieldtype : \"Data\",\n align: \"align\" in d && d.align || \"left\",\n edit: \"edit\" in d ? d.edit : !0,\n width: \"width\" in d && d.width || \"20ch\"\n }))), c.component || (c.component = \"ATable\"), (!(\"config\" in n) || !n.config) && (c.config = { view: \"list\" }), (!(\"rows\" in n) || !n.rows) && (c.rows = []), c;\n }\n }\n return { ...n };\n });\n }\n /**\n * Initialize a new record with default values based on a schema.\n *\n * @remarks\n * Creates a plain object with keys from the schema's fieldnames and default values\n * derived from each field's `fieldtype`:\n * - Data, Text → `''`\n * - Check → `false`\n * - Int, Float, Decimal, Currency, Quantity → `0`\n * - Table → `[]`\n * - JSON, Doctype → `{}`\n * - All others → `null`\n *\n * For Doctype fields with a resolved `schema` array, recursively initializes the nested record.\n *\n * @param schema - The schema array to derive defaults from\n * @returns A plain object with default values for each field\n *\n * @example\n * ```ts\n * const defaults = registry.initializeRecord(addressSchema)\n * // { street: '', city: '', state: '', zip_code: '' }\n * ```\n *\n * @public\n */\n initializeRecord(e) {\n const t = {};\n return e.forEach((r) => {\n switch (\"fieldtype\" in r ? r.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n case \"Code\":\n t[r.fieldname] = \"\";\n break;\n case \"Check\":\n t[r.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n case \"Decimal\":\n case \"Currency\":\n case \"Quantity\":\n t[r.fieldname] = 0;\n break;\n case \"Table\":\n t[r.fieldname] = [];\n break;\n case \"JSON\":\n t[r.fieldname] = {};\n break;\n case \"Doctype\":\n \"schema\" in r && Array.isArray(r.schema) ? t[r.fieldname] = this.initializeRecord(r.schema) : t[r.fieldname] = {};\n break;\n default:\n t[r.fieldname] = null;\n }\n }), t;\n }\n // TODO: should we allow clearing the registry at all?\n // clear() {\n // \tthis.registry = {}\n // \tif (this.router) {\n // \t\tconst routes = this.router.getRoutes()\n // \t\tfor (const route of routes) {\n // \t\t\tif (route.name) {\n // \t\t\t\tthis.router.removeRoute(route.name)\n // \t\t\t}\n // \t\t}\n // \t}\n // }\n}\nasync function rt(o, e, t) {\n await de();\n try {\n await t(o, e);\n } catch {\n }\n}\nconst mt = {\n install: (o, e) => {\n const t = o.config.globalProperties.$router, r = e?.router, n = t || r;\n !t && r && o.use(r);\n const i = new te(n, e?.getMeta);\n o.provide(\"$registry\", i), o.config.globalProperties.$registry = i;\n const s = new Ae(i);\n o.provide(\"$stonecrop\", s), o.config.globalProperties.$stonecrop = s;\n try {\n const a = o.config.globalProperties.$pinia;\n if (a) {\n const c = re(a);\n o.provide(\"$operationLogStore\", c), o.config.globalProperties.$operationLogStore = c;\n }\n } catch (a) {\n console.warn(\"Pinia not available - operation log features will be disabled:\", a);\n }\n if (e?.components)\n for (const [a, c] of Object.entries(e.components))\n o.component(a, c);\n e?.autoInitializeRouter && e.onRouterInitialized && rt(i, s, e.onRouterInitialized);\n }\n};\nvar nt = /* @__PURE__ */ ((o) => (o.ERROR = \"error\", o.WARNING = \"warning\", o.INFO = \"info\", o))(nt || {});\nclass ot {\n options;\n /**\n * Creates a new SchemaValidator instance\n * @param options - Validator configuration options\n */\n constructor(e = {}) {\n this.options = {\n registry: e.registry || null,\n validateLinkTargets: e.validateLinkTargets ?? !0,\n validateActions: e.validateActions ?? !0,\n validateWorkflows: e.validateWorkflows ?? !0,\n validateRequiredProperties: e.validateRequiredProperties ?? !0\n };\n }\n /**\n * Validates a complete doctype schema\n * @param doctype - Doctype name\n * @param schema - Schema fields (List or Array)\n * @param workflow - Optional workflow configuration\n * @param actions - Optional actions map\n * @returns Validation result\n */\n validate(e, t, r, n) {\n const i = [], s = t ? Array.isArray(t) ? t : t.toArray() : [];\n if (this.options.validateRequiredProperties && i.push(...this.validateRequiredProperties(e, s)), this.options.validateLinkTargets && this.options.registry && i.push(...this.validateLinkFields(e, s, this.options.registry)), this.options.validateWorkflows && r && i.push(...this.validateWorkflow(e, r)), this.options.validateActions && n) {\n const g = n instanceof Map ? n : n.toObject();\n i.push(...this.validateActionRegistration(e, g));\n }\n const a = i.filter(\n (g) => g.severity === \"error\"\n /* ERROR */\n ).length, c = i.filter(\n (g) => g.severity === \"warning\"\n /* WARNING */\n ).length, d = i.filter(\n (g) => g.severity === \"info\"\n /* INFO */\n ).length;\n return {\n valid: a === 0,\n issues: i,\n errorCount: a,\n warningCount: c,\n infoCount: d\n };\n }\n /**\n * Validates that required schema properties are present\n * @internal\n */\n validateRequiredProperties(e, t) {\n const r = [];\n for (const n of t) {\n if (!n.fieldname) {\n r.push({\n severity: \"error\",\n rule: \"required-fieldname\",\n message: \"Field is missing required property: fieldname\",\n doctype: e,\n context: { field: n }\n });\n continue;\n }\n if (!n.component && !(\"fieldtype\" in n) && r.push({\n severity: \"error\",\n rule: \"required-component-or-fieldtype\",\n message: `Field \"${n.fieldname}\" must have either component or fieldtype property`,\n doctype: e,\n fieldname: n.fieldname\n }), \"schema\" in n) {\n const i = n.schema, s = Array.isArray(i) ? i : i.toArray?.() || [];\n r.push(...this.validateRequiredProperties(e, s));\n }\n }\n return r;\n }\n /**\n * Validates Link field targets exist in registry\n * @internal\n */\n validateLinkFields(e, t, r) {\n const n = [];\n for (const i of t) {\n if ((\"fieldtype\" in i ? i.fieldtype : void 0) === \"Link\") {\n const a = \"options\" in i ? i.options : void 0;\n if (!a) {\n n.push({\n severity: \"error\",\n rule: \"link-missing-options\",\n message: `Link field \"${i.fieldname}\" is missing options property (target doctype)`,\n doctype: e,\n fieldname: i.fieldname\n });\n continue;\n }\n const c = typeof a == \"string\" ? a : \"\";\n if (!c) {\n n.push({\n severity: \"error\",\n rule: \"link-invalid-options\",\n message: `Link field \"${i.fieldname}\" has invalid options format (expected string doctype name)`,\n doctype: e,\n fieldname: i.fieldname\n });\n continue;\n }\n r.registry[c] || r.registry[c.toLowerCase()] || n.push({\n severity: \"error\",\n rule: \"link-invalid-target\",\n message: `Link field \"${i.fieldname}\" references non-existent doctype: \"${c}\"`,\n doctype: e,\n fieldname: i.fieldname,\n context: { targetDoctype: c }\n });\n }\n if (\"schema\" in i) {\n const a = i.schema, c = Array.isArray(a) ? a : a.toArray?.() || [];\n n.push(...this.validateLinkFields(e, c, r));\n }\n }\n return n;\n }\n /**\n * Validates workflow state machine configuration\n * @internal\n */\n validateWorkflow(e, t) {\n const r = [];\n if (!t.initial && !t.type && r.push({\n severity: \"warning\",\n rule: \"workflow-missing-initial\",\n message: \"Workflow is missing initial state property\",\n doctype: e\n }), !t.states || Object.keys(t.states).length === 0)\n return r.push({\n severity: \"warning\",\n rule: \"workflow-no-states\",\n message: \"Workflow has no states defined\",\n doctype: e\n }), r;\n t.initial && typeof t.initial == \"string\" && !t.states[t.initial] && r.push({\n severity: \"error\",\n rule: \"workflow-invalid-initial\",\n message: `Workflow initial state \"${t.initial}\" does not exist in states`,\n doctype: e,\n context: { initialState: t.initial }\n });\n const n = Object.keys(t.states), i = /* @__PURE__ */ new Set();\n t.initial && typeof t.initial == \"string\" && i.add(t.initial);\n for (const [s, a] of Object.entries(t.states)) {\n const c = a;\n if (c.on) {\n for (const [d, g] of Object.entries(c.on))\n if (typeof g == \"string\")\n i.add(g);\n else if (g && typeof g == \"object\") {\n const S = \"target\" in g ? g.target : void 0;\n typeof S == \"string\" ? i.add(S) : Array.isArray(S) && S.forEach(($) => {\n typeof $ == \"string\" && i.add($);\n });\n }\n }\n }\n for (const s of n)\n i.has(s) || r.push({\n severity: \"warning\",\n rule: \"workflow-unreachable-state\",\n message: `Workflow state \"${s}\" may not be reachable`,\n doctype: e,\n context: { stateName: s }\n });\n return r;\n }\n /**\n * Validates that actions are registered in the FieldTriggerEngine\n * @internal\n */\n validateActionRegistration(e, t) {\n const r = [], n = J();\n for (const [i, s] of Object.entries(t)) {\n if (!Array.isArray(s)) {\n r.push({\n severity: \"error\",\n rule: \"action-invalid-format\",\n message: `Action configuration for \"${i}\" must be an array`,\n doctype: e,\n context: { triggerName: i, actionNames: s }\n });\n continue;\n }\n for (const a of s) {\n const c = n;\n c.globalActions?.has(a) || c.globalTransitionActions?.has(a) || r.push({\n severity: \"warning\",\n rule: \"action-not-registered\",\n message: `Action \"${a}\" referenced in \"${i}\" is not registered in FieldTriggerEngine`,\n doctype: e,\n context: { triggerName: i, actionName: a }\n });\n }\n }\n return r;\n }\n}\nfunction it(o, e) {\n return new ot({\n registry: o,\n ...e\n });\n}\nfunction yt(o, e, t, r, n) {\n return it(t).validate(o, e, r, n);\n}\nexport {\n vt as DoctypeMeta,\n Y as HST,\n te as Registry,\n ot as SchemaValidator,\n Ae as Stonecrop,\n nt as ValidationSeverity,\n et as createHST,\n it as createValidator,\n mt as default,\n J as getGlobalTriggerEngine,\n dt as markOperationIrreversible,\n ct as registerGlobalAction,\n lt as registerTransitionAction,\n ut as setFieldRollback,\n ft as triggerTransition,\n Te as useOperationLog,\n re as useOperationLogStore,\n pt as useStonecrop,\n ht as useUndoRedoShortcuts,\n yt as validateSchema,\n gt as withBatch\n};\n//# sourceMappingURL=stonecrop.js.map\n","import { defineComponent as te, useTemplateRef as fe, ref as L, computed as $, openBlock as w, createElementBlock as k, unref as V, normalizeClass as ae, normalizeStyle as xe, createBlock as pe, resolveDynamicComponent as We, mergeProps as vt, toDisplayString as K, createElementVNode as y, withModifiers as Ie, withDirectives as J, Fragment as ue, renderList as me, vShow as Ce, createCommentVNode as q, renderSlot as he, createTextVNode as Dt, onMounted as Ee, watch as oe, onBeforeUnmount as sn, nextTick as pt, toValue as E, shallowRef as ie, getCurrentScope as mt, onScopeDispose as ht, reactive as rn, vModelText as we, vModelCheckbox as un, vModelSelect as Cn, getCurrentInstance as gt, watchEffect as Oe, useCssVars as En, onUnmounted as An, useModel as ke, createVNode as dt, withCtx as Tt, mergeModels as Me, isRef as Tn, toRefs as $n, customRef as St, toRef as cn, readonly as Rt, resolveComponent as dn, withKeys as Ne } from \"vue\";\nimport { defineStore as Dn } from \"pinia\";\nimport './assets/index.css';function fn(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\nconst Sn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Rn = (e) => e != null, Ln = Object.prototype.toString, Hn = (e) => Ln.call(e) === \"[object Object]\", Vn = () => {\n};\nfunction rt(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction Pn(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst qe = Sn ? window : void 0;\nfunction Ge(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction Ke(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = rt(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return Pn(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => Ge(r))) !== null && o !== void 0 ? o : [qe].filter((r) => r != null),\n rt(E(n.value ? e[1] : e[0])),\n rt(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = Hn(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction On() {\n const e = ie(!1), t = gt();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction _n(e) {\n const t = /* @__PURE__ */ On();\n return $(() => (t.value, !!e()));\n}\nfunction Bn(e, t, n = {}) {\n const { window: o = qe, ...a } = n;\n let r;\n const s = /* @__PURE__ */ _n(() => o && \"MutationObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const p = rt(E(e)).map(Ge).filter(Rn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((h) => r.observe(h, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => r?.takeRecords(), c = () => {\n i(), l();\n };\n return fn(c), {\n isSupported: s,\n stop: c,\n takeRecords: u\n };\n}\nfunction Fn(e, t, n = {}) {\n const { window: o = qe, document: a = o?.document, flush: r = \"sync\" } = n;\n if (!o || !a) return Vn;\n let s;\n const l = (c) => {\n s?.(), s = c;\n }, i = Oe(() => {\n const c = Ge(e);\n if (c) {\n const { stop: p } = Bn(a, (h) => {\n h.map((b) => [...b.removedNodes]).flat().some((b) => b === c || b.contains(c)) && t(h);\n }, {\n window: o,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), u = () => {\n i(), l();\n };\n return fn(u), u;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Zn(e = {}) {\n var t;\n const { window: n = qe, deep: o = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {\n let u = r?.activeElement;\n if (o)\n for (var c; u?.shadowRoot; ) u = u == null || (c = u.shadowRoot) === null || c === void 0 ? void 0 : c.activeElement;\n return u;\n }, l = ie(), i = () => {\n l.value = s();\n };\n if (n) {\n const u = {\n capture: !0,\n passive: !0\n };\n Ke(n, \"blur\", (c) => {\n c.relatedTarget === null && i();\n }, u), Ke(n, \"focus\", i, u);\n }\n return a && Fn(l, i, { document: r }), i(), l;\n}\nconst Nn = \"focusin\", Un = \"focusout\", Wn = \":focus-within\";\nfunction Gn(e, t = {}) {\n const { window: n = qe } = t, o = $(() => Ge(e)), a = ie(!1), r = $(() => a.value);\n if (!n || !(/* @__PURE__ */ Zn(t)).value) return { focused: r };\n const s = { passive: !0 };\n return Ke(o, Nn, () => a.value = !0, s), Ke(o, Un, () => {\n var l, i, u;\n return a.value = (l = (i = o.value) === null || i === void 0 || (u = i.matches) === null || u === void 0 ? void 0 : u.call(i, Wn)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction zn(e, { window: t = qe, scrollTarget: n } = {}) {\n const o = L(!1), a = () => {\n if (!t) return;\n const r = t.document, s = Ge(e);\n if (!s)\n o.value = !1;\n else {\n const l = s.getBoundingClientRect();\n o.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return oe(\n () => Ge(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && Ke(n || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), o;\n}\nconst Ae = (e) => {\n let t = zn(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, Te = (e) => e.tabIndex >= 0, Wt = (e) => {\n const t = e.target;\n return Lt(t);\n}, Lt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.previousElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.previousElementSibling;\n n && (t = n);\n }\n return t && (!Te(t) || !Ae(t)) ? Lt(t) : t;\n}, qn = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.firstElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.firstElementChild;\n a && (n = a);\n }\n }\n return n && (!Te(n) || !Ae(n)) ? Ht(n) : n;\n}, Gt = (e) => {\n const t = e.target;\n return Ht(t);\n}, Ht = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.nextElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.nextElementSibling;\n n && (t = n);\n }\n return t && (!Te(t) || !Ae(t)) ? Ht(t) : t;\n}, Yn = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.lastElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.lastElementChild;\n a && (n = a);\n }\n }\n return n && (!Te(n) || !Ae(n)) ? Lt(n) : n;\n}, zt = (e) => {\n const t = e.target;\n return Vt(t);\n}, Vt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!Te(t) || !Ae(t)) ? Vt(t) : t;\n}, qt = (e) => {\n const t = e.target;\n return Pt(t);\n}, Pt = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!Te(t) || !Ae(t)) ? Pt(t) : t;\n}, Yt = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!Te(t) || !Ae(t)) ? Pt(t) : t;\n}, Xt = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!Te(t) || !Ae(t)) ? Vt(t) : t;\n}, ot = [\"alt\", \"control\", \"shift\", \"meta\"], Xn = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, wt = {\n \"keydown.up\": (e) => {\n const t = Wt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Gt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = zt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = qt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = qn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Yn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Gt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Wt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = zt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Ot(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, n = (s) => {\n const l = t(s);\n let i = [];\n if (typeof s.selectors == \"string\")\n i = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const u of s.selectors)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else if (s.selectors instanceof HTMLElement)\n i.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const u of s.selectors.value)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else\n i.push(s.selectors.value);\n return i;\n }, o = (s) => {\n const l = t(s);\n let i = [];\n return s.selectors ? i = n(s) : l && (i = Array.from(l.children).filter((u) => Te(u) && Ae(u))), i;\n }, a = (s) => (l) => {\n const i = Xn[l.key] || l.key.toLowerCase();\n if (ot.includes(i)) return;\n const u = s.handlers || wt;\n for (const c of Object.keys(u)) {\n const [p, ...h] = c.split(\".\");\n if (p === \"keydown\" && h.includes(i)) {\n const b = u[c], I = h.filter((f) => ot.includes(f)), x = ot.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (I.length > 0) {\n if (x) {\n for (const f of ot)\n if (h.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && b(l);\n }\n }\n } else\n x || b(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), i = o(s), u = a(s), c = l ? [l] : i;\n for (const p of c) {\n const { focused: h } = Gn(L(p)), b = oe(h, (I) => {\n I ? p.addEventListener(\"keydown\", u) : p.removeEventListener(\"keydown\", u);\n });\n r.push(b);\n }\n }\n }), sn(() => {\n for (const s of r)\n s();\n });\n}\nfunction _t(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\nconst vn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst jn = (e) => e != null, Jn = Object.prototype.toString, Qn = (e) => Jn.call(e) === \"[object Object]\", _e = () => {\n};\nfunction Kn(...e) {\n if (e.length !== 1) return cn(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: _e\n }))) : L(t);\n}\nfunction eo(e, t) {\n function n(...o) {\n return new Promise((a, r) => {\n Promise.resolve(e(() => t.apply(this, o), {\n fn: t,\n thisArg: this,\n args: o\n })).then(a).catch(r);\n });\n }\n return n;\n}\nfunction to(e, t = {}) {\n let n, o, a = _e;\n const r = (l) => {\n clearTimeout(l), a(), a = _e;\n };\n let s;\n return (l) => {\n const i = E(e), u = E(t.maxWait);\n return n && r(n), i <= 0 || u !== void 0 && u <= 0 ? (o && (r(o), o = void 0), Promise.resolve(l())) : new Promise((c, p) => {\n a = t.rejectOnCancel ? p : c, s = l, u && !o && (o = setTimeout(() => {\n n && r(n), o = void 0, c(s());\n }, u)), n = setTimeout(() => {\n o && r(o), o = void 0, c(l());\n }, i);\n });\n };\n}\nfunction it(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction no(e) {\n return gt();\n}\n// @__NO_SIDE_EFFECTS__\nfunction oo(e, t = 200, n = {}) {\n return eo(to(t, n), e);\n}\nfunction lo(e, t = {}) {\n if (!Tn(e)) return $n(e);\n const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};\n for (const o in e.value) n[o] = St(() => ({\n get() {\n return e.value[o];\n },\n set(a) {\n var r;\n if (!((r = E(t.replaceRef)) !== null && r !== void 0) || r) if (Array.isArray(e.value)) {\n const s = [...e.value];\n s[o] = a, e.value = s;\n } else {\n const s = {\n ...e.value,\n [o]: a\n };\n Object.setPrototypeOf(s, Object.getPrototypeOf(e.value)), e.value = s;\n }\n else e.value[o] = a;\n }\n }));\n return n;\n}\nfunction ao(e, t = !0, n) {\n no() ? Ee(e, n) : t ? e() : pt(e);\n}\nfunction so(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst tt = vn ? window : void 0;\nfunction ye(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction He(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = it(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return so(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => ye(r))) !== null && o !== void 0 ? o : [tt].filter((r) => r != null),\n it(E(n.value ? e[1] : e[0])),\n it(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = Qn(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction $t(e, t, n = {}) {\n const { window: o = tt, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = n;\n if (!o) return l ? {\n stop: _e,\n cancel: _e,\n trigger: _e\n } : _e;\n let i = !0;\n const u = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(o.document.querySelectorAll(m)).some((g) => g === f.target || f.composedPath().includes(g));\n {\n const g = ye(m);\n return g && (f.target === g || f.composedPath().includes(g));\n }\n });\n function c(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const g = E(f), C = g.$.subTree && g.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some((T) => T.el === m.target || m.composedPath().includes(T.el));\n }\n const h = (f) => {\n const m = ye(e);\n if (f.target != null && !(!(m instanceof Element) && c(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (i = !u(f)), !i) {\n i = !0;\n return;\n }\n t(f);\n }\n };\n let b = !1;\n const I = [\n He(o, \"click\", (f) => {\n b || (b = !0, setTimeout(() => {\n b = !1;\n }, 0), h(f));\n }, {\n passive: !0,\n capture: r\n }),\n He(o, \"pointerdown\", (f) => {\n const m = ye(e);\n i = !u(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && He(o, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const g = ye(e);\n ((m = o.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !g?.contains(o.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), x = () => I.forEach((f) => f());\n return l ? {\n stop: x,\n cancel: () => {\n i = !1;\n },\n trigger: (f) => {\n i = !0, h(f), i = !1;\n }\n } : x;\n}\n// @__NO_SIDE_EFFECTS__\nfunction ro() {\n const e = ie(!1), t = gt();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction pn(e) {\n const t = /* @__PURE__ */ ro();\n return $(() => (t.value, !!e()));\n}\nfunction mn(e, t, n = {}) {\n const { window: o = tt, ...a } = n;\n let r;\n const s = /* @__PURE__ */ pn(() => o && \"MutationObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const p = it(E(e)).map(ye).filter(jn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((h) => r.observe(h, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => r?.takeRecords(), c = () => {\n i(), l();\n };\n return _t(c), {\n isSupported: s,\n stop: c,\n takeRecords: u\n };\n}\nconst lt = {\n speed: 2,\n margin: 30,\n direction: \"both\"\n};\nfunction io(e) {\n e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));\n}\nfunction yt(e, t = {}) {\n var n, o, a, r;\n const { pointerTypes: s, preventDefault: l, stopPropagation: i, exact: u, onMove: c, onEnd: p, onStart: h, initialValue: b, axis: I = \"both\", draggingElement: x = tt, containerElement: f, handle: m = e, buttons: g = [0], restrictInView: C, autoScroll: T = !1 } = t, R = L((n = E(b)) !== null && n !== void 0 ? n : {\n x: 0,\n y: 0\n }), S = L(), _ = (D) => s ? s.includes(D.pointerType) : !0, U = (D) => {\n E(l) && D.preventDefault(), E(i) && D.stopPropagation();\n }, ve = E(T), Y = typeof ve == \"object\" ? {\n speed: (o = E(ve.speed)) !== null && o !== void 0 ? o : lt.speed,\n margin: (a = E(ve.margin)) !== null && a !== void 0 ? a : lt.margin,\n direction: (r = ve.direction) !== null && r !== void 0 ? r : lt.direction\n } : lt, X = (D) => typeof D == \"number\" ? [D, D] : [D.x, D.y], ge = (D, F, W) => {\n const { clientWidth: j, clientHeight: z, scrollLeft: se, scrollTop: be, scrollWidth: Le, scrollHeight: O } = D, [B, G] = X(Y.margin), [Q, ne] = X(Y.speed);\n let ee = 0, re = 0;\n (Y.direction === \"x\" || Y.direction === \"both\") && (W.x < B && se > 0 ? ee = -Q : W.x + F.width > j - B && se < Le - j && (ee = Q)), (Y.direction === \"y\" || Y.direction === \"both\") && (W.y < G && be > 0 ? re = -ne : W.y + F.height > z - G && be < O - z && (re = ne)), (ee || re) && D.scrollBy({\n left: ee,\n top: re,\n behavior: \"auto\"\n });\n };\n let de = null;\n const Be = () => {\n const D = E(f);\n D && !de && (de = setInterval(() => {\n const F = E(e).getBoundingClientRect(), { x: W, y: j } = R.value, z = {\n x: W - D.scrollLeft,\n y: j - D.scrollTop\n };\n z.x >= 0 && z.y >= 0 && (ge(D, F, z), z.x += D.scrollLeft, z.y += D.scrollTop, R.value = z);\n }, 1e3 / 60));\n }, Re = () => {\n de && (clearInterval(de), de = null);\n }, Xe = (D, F, W, j) => {\n const [z, se] = typeof W == \"number\" ? [W, W] : [W.x, W.y], { clientWidth: be, clientHeight: Le } = F;\n return D.x < z || D.x + j.width > be - z || D.y < se || D.y + j.height > Le - se;\n }, je = () => {\n if (E(t.disabled) || !S.value) return;\n const D = E(f);\n if (!D) return;\n const F = E(e).getBoundingClientRect(), { x: W, y: j } = R.value;\n Xe({\n x: W - D.scrollLeft,\n y: j - D.scrollTop\n }, D, Y.margin, F) ? Be() : Re();\n };\n E(T) && oe(R, je);\n const Fe = (D) => {\n var F;\n if (!E(g).includes(D.button) || E(t.disabled) || !_(D) || E(u) && D.target !== E(e)) return;\n const W = E(f), j = W == null || (F = W.getBoundingClientRect) === null || F === void 0 ? void 0 : F.call(W), z = E(e).getBoundingClientRect(), se = {\n x: D.clientX - (W ? z.left - j.left + (T ? 0 : W.scrollLeft) : z.left),\n y: D.clientY - (W ? z.top - j.top + (T ? 0 : W.scrollTop) : z.top)\n };\n h?.(se, D) !== !1 && (S.value = se, U(D));\n }, Je = (D) => {\n if (E(t.disabled) || !_(D) || !S.value) return;\n const F = E(f);\n F instanceof HTMLElement && io(F);\n const W = E(e).getBoundingClientRect();\n let { x: j, y: z } = R.value;\n if ((I === \"x\" || I === \"both\") && (j = D.clientX - S.value.x, F && (j = Math.min(Math.max(0, j), F.scrollWidth - W.width))), (I === \"y\" || I === \"both\") && (z = D.clientY - S.value.y, F && (z = Math.min(Math.max(0, z), F.scrollHeight - W.height))), E(T) && F && (de === null && ge(F, W, {\n x: j,\n y: z\n }), j += F.scrollLeft, z += F.scrollTop), F && (C || T)) {\n if (I !== \"y\") {\n const se = j - F.scrollLeft;\n se < 0 ? j = F.scrollLeft : se > F.clientWidth - W.width && (j = F.clientWidth - W.width + F.scrollLeft);\n }\n if (I !== \"x\") {\n const se = z - F.scrollTop;\n se < 0 ? z = F.scrollTop : se > F.clientHeight - W.height && (z = F.clientHeight - W.height + F.scrollTop);\n }\n }\n R.value = {\n x: j,\n y: z\n }, c?.(R.value, D), U(D);\n }, Ze = (D) => {\n E(t.disabled) || !_(D) || S.value && (S.value = void 0, T && Re(), p?.(R.value, D), U(D));\n };\n if (vn) {\n const D = () => {\n var F;\n return {\n capture: (F = t.capture) !== null && F !== void 0 ? F : !0,\n passive: !E(l)\n };\n };\n He(m, \"pointerdown\", Fe, D), He(x, \"pointermove\", Je, D), He(x, \"pointerup\", Ze, D);\n }\n return {\n ...lo(R),\n position: R,\n isDragging: $(() => !!S.value),\n style: $(() => `\n left: ${R.value.x}px;\n top: ${R.value.y}px;\n ${T ? \"text-wrap: nowrap;\" : \"\"}\n `)\n };\n}\nfunction ft(e, t, n = {}) {\n const { window: o = tt, ...a } = n;\n let r;\n const s = /* @__PURE__ */ pn(() => o && \"ResizeObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const c = E(e);\n return Array.isArray(c) ? c.map((p) => ye(p)) : [ye(c)];\n }), (c) => {\n if (l(), s.value && o) {\n r = new ResizeObserver(t);\n for (const p of c) p && r.observe(p, a);\n }\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => {\n l(), i();\n };\n return _t(u), {\n isSupported: s,\n stop: u\n };\n}\nfunction Pe(e, t = {}) {\n const { reset: n = !0, windowResize: o = !0, windowScroll: a = !0, immediate: r = !0, updateTiming: s = \"sync\" } = t, l = ie(0), i = ie(0), u = ie(0), c = ie(0), p = ie(0), h = ie(0), b = ie(0), I = ie(0);\n function x() {\n const m = ye(e);\n if (!m) {\n n && (l.value = 0, i.value = 0, u.value = 0, c.value = 0, p.value = 0, h.value = 0, b.value = 0, I.value = 0);\n return;\n }\n const g = m.getBoundingClientRect();\n l.value = g.height, i.value = g.bottom, u.value = g.left, c.value = g.right, p.value = g.top, h.value = g.width, b.value = g.x, I.value = g.y;\n }\n function f() {\n s === \"sync\" ? x() : s === \"next-frame\" && requestAnimationFrame(() => x());\n }\n return ft(e, f), oe(() => ye(e), (m) => !m && f()), mn(e, f, { attributeFilter: [\"style\", \"class\"] }), a && He(\"scroll\", f, {\n capture: !0,\n passive: !0\n }), o && He(\"resize\", f, { passive: !0 }), ao(() => {\n r && f();\n }), {\n height: l,\n bottom: i,\n left: u,\n right: c,\n top: p,\n width: h,\n x: b,\n y: I,\n update: f\n };\n}\nfunction xt(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst bt = /* @__PURE__ */ new WeakMap();\nfunction uo(e, t = !1) {\n const n = ie(t);\n let o = \"\";\n oe(Kn(e), (s) => {\n const l = xt(E(s));\n if (l) {\n const i = l;\n if (bt.get(i) || bt.set(i, i.style.overflow), i.style.overflow !== \"hidden\" && (o = i.style.overflow), i.style.overflow === \"hidden\") return n.value = !0;\n if (n.value) return i.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = xt(E(e));\n !s || n.value || (s.style.overflow = \"hidden\", n.value = !0);\n }, r = () => {\n const s = xt(E(e));\n !s || !n.value || (s.style.overflow = o, bt.delete(s), n.value = !1);\n };\n return _t(r), $({\n get() {\n return n.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst co = (e) => {\n const t = new DOMParser().parseFromString(e, \"text/html\");\n return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);\n}, fo = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(\"\"), vo = [\"data-colindex\", \"data-rowindex\", \"data-editable\", \"contenteditable\", \"tabindex\"], po = [\"innerHTML\"], mo = { key: 2 }, ho = /* @__PURE__ */ te({\n __name: \"ACell\",\n props: {\n colIndex: {},\n rowIndex: {},\n store: {},\n addNavigation: { type: [Boolean, Object], default: !0 },\n tabIndex: { default: 0 },\n pinned: { type: Boolean, default: !1 },\n debounce: { default: 300 }\n },\n setup(e, { expose: t }) {\n const n = fe(\"cell\"), o = e.store.getCellData(e.colIndex, e.rowIndex), a = L(\"\"), r = L(!1), s = e.store.columns[e.colIndex], l = e.store.rows[e.rowIndex], i = s.align || \"center\", u = s.width || \"40ch\", c = $(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), p = $(() => typeof c.value == \"string\" ? co(c.value) : !1), h = $(() => ({\n textAlign: i,\n width: u,\n fontWeight: r.value ? \"bold\" : \"inherit\",\n paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)\n })), b = $(() => ({\n \"sticky-column\": e.pinned,\n \"cell-modified\": r.value\n })), I = () => {\n f(), x();\n }, x = () => {\n const { left: S, bottom: _, width: U, height: ve } = Pe(n);\n s.mask, s.modalComponent && e.store.$patch((Y) => {\n Y.modal.visible = !0, Y.modal.colIndex = e.colIndex, Y.modal.rowIndex = e.rowIndex, Y.modal.left = S, Y.modal.bottom = _, Y.modal.width = U, Y.modal.height = ve, Y.modal.cell = n.value, typeof s.modalComponent == \"function\" ? Y.modal.component = s.modalComponent({ table: Y.table, row: l, column: s }) : Y.modal.component = s.modalComponent, Y.modal.componentProps = s.modalComponentExtraProps;\n });\n };\n if (e.addNavigation) {\n let S = {\n ...wt,\n \"keydown.f2\": x,\n \"keydown.alt.up\": x,\n \"keydown.alt.down\": x,\n \"keydown.alt.left\": x,\n \"keydown.alt.right\": x\n };\n typeof e.addNavigation == \"object\" && (S = {\n ...S,\n ...e.addNavigation\n }), Ot([\n {\n selectors: n,\n handlers: S\n }\n ]);\n }\n const f = () => {\n if (n.value && s.edit) {\n const S = window.getSelection();\n if (S)\n try {\n const _ = document.createRange();\n _.selectNodeContents && (_.selectNodeContents(n.value), S.removeAllRanges(), S.addRange(_));\n } catch {\n }\n }\n }, m = () => {\n n.value && (a.value = n.value.textContent, f());\n }, g = () => {\n try {\n const S = window.getSelection();\n if (S && S.rangeCount > 0 && n.value) {\n const _ = S.getRangeAt(0), U = _.cloneRange();\n if (U.selectNodeContents && U.setEnd)\n return U.selectNodeContents(n.value), U.setEnd(_.endContainer, _.endOffset), U.toString().length;\n }\n } catch {\n }\n return 0;\n }, C = (S) => {\n if (n.value)\n try {\n const _ = window.getSelection();\n if (!_) return;\n let U = 0;\n const ve = document.createTreeWalker ? document.createTreeWalker(n.value, NodeFilter.SHOW_TEXT, null) : null;\n if (!ve) return;\n let Y, X = null;\n for (; Y = ve.nextNode(); ) {\n const ge = Y, de = U + ge.textContent.length;\n if (S <= de && (X = document.createRange(), X.setStart && X.setEnd)) {\n X.setStart(ge, S - U), X.setEnd(ge, S - U);\n break;\n }\n U = de;\n }\n X && _.removeAllRanges && _.addRange && (_.removeAllRanges(), _.addRange(X));\n } catch {\n }\n }, T = (S) => {\n if (!s.edit) return;\n const _ = S.target;\n if (_.textContent === a.value)\n return;\n const U = g();\n a.value = _.textContent, s.format ? (r.value = _.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, o), e.store.setCellText(e.colIndex, e.rowIndex, _.textContent)) : (r.value = _.textContent !== o, e.store.setCellData(e.colIndex, e.rowIndex, _.textContent)), pt().then(() => {\n C(U);\n });\n }, R = /* @__PURE__ */ oo(T, e.debounce);\n return t({\n currentData: a\n }), (S, _) => (w(), k(\"td\", {\n ref: \"cell\",\n \"data-colindex\": e.colIndex,\n \"data-rowindex\": e.rowIndex,\n \"data-editable\": V(s).edit,\n contenteditable: V(s).edit,\n tabindex: e.tabIndex,\n spellcheck: !1,\n style: xe(h.value),\n class: ae([\"atable-cell\", b.value]),\n onFocus: m,\n onPaste: T,\n onInput: _[0] || (_[0] = //@ts-ignore\n (...U) => V(R) && V(R)(...U)),\n onClick: I\n }, [\n V(s).cellComponent ? (w(), pe(We(V(s).cellComponent), vt({\n key: 0,\n value: c.value\n }, V(s).cellComponentProps), null, 16, [\"value\"])) : p.value ? (w(), k(\"span\", {\n key: 1,\n innerHTML: c.value\n }, null, 8, po)) : (w(), k(\"span\", mo, K(c.value), 1))\n ], 46, vo));\n }\n}), go = [\"tabindex\"], wo = [\"tabindex\"], yo = [\"colspan\"], xo = /* @__PURE__ */ te({\n __name: \"AExpansionRow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: () => wt }\n },\n setup(e) {\n const t = fe(\"rowEl\"), n = $(() => e.store.display[e.rowIndex].expanded ? \"▼\" : \"►\");\n if (e.addNavigation) {\n const o = {\n \"keydown.control.g\": (a) => {\n a.stopPropagation(), a.preventDefault(), e.store.toggleRowExpand(e.rowIndex);\n }\n };\n typeof e.addNavigation == \"object\" && Object.assign(o, e.addNavigation), Ot([\n {\n selectors: t,\n handlers: o\n }\n ]);\n }\n return (o, a) => (w(), k(ue, null, [\n y(\"tr\", vt(o.$attrs, {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"expandable-row\"\n }), [\n y(\"td\", {\n tabIndex: -1,\n class: \"row-index\",\n onClick: a[0] || (a[0] = (r) => e.store.toggleRowExpand(e.rowIndex))\n }, K(n.value), 1),\n he(o.$slots, \"row\", {}, void 0, !0)\n ], 16, go),\n e.store.display[e.rowIndex].expanded ? (w(), k(\"tr\", {\n key: 0,\n ref: \"rowExpanded\",\n tabindex: e.tabIndex,\n class: \"expanded-row\"\n }, [\n y(\"td\", {\n tabIndex: -1,\n colspan: e.store.columns.length + 1,\n class: \"expanded-row-content\"\n }, [\n he(o.$slots, \"content\", {}, void 0, !0)\n ], 8, yo)\n ], 8, wo)) : q(\"\", !0)\n ], 64));\n }\n}), Ve = (e, t) => {\n const n = e.__vccOpts || e;\n for (const [o, a] of t)\n n[o] = a;\n return n;\n}, bo = /* @__PURE__ */ Ve(xo, [[\"__scopeId\", \"data-v-a42297c7\"]]), Io = [\"colspan\"], ko = {\n ref: \"container\",\n class: \"gantt-container\"\n}, Mo = [\"data-rowindex\", \"data-colindex\"], Co = {\n key: 2,\n class: \"gantt-label\"\n}, Eo = [\"x1\", \"y1\", \"x2\", \"y2\"], Ao = /* @__PURE__ */ te({\n __name: \"AGanttCell\",\n props: {\n store: {},\n columnsCount: {},\n rowIndex: {},\n colIndex: {},\n start: { default: 0 },\n end: { default: 0 },\n colspan: { default: 1 },\n label: { default: \"\" },\n color: { default: \"#cccccc\" }\n },\n emits: [\"connection:create\"],\n setup(e, { expose: t, emit: n }) {\n En((O) => ({\n v6d722296: a.value,\n v260b36f8: O.colspan\n }));\n const o = n, a = L(e.color.length >= 6 ? e.color : \"#cccccc\"), r = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, s = fe(\"container\"), l = fe(\"bar\"), i = fe(\"leftResizeHandle\"), u = fe(\"rightResizeHandle\"), c = fe(\"leftConnectionHandle\"), p = fe(\"rightConnectionHandle\"), { width: h } = Pe(s), { left: b, right: I } = Pe(l), x = L(e.start), f = L(e.end || x.value + e.colspan), m = L(!1), g = L(!1), C = L(!1), T = L(!1), R = L(!1), S = L({ startX: 0, startY: 0, endX: 0, endY: 0 }), _ = $(() => Be.value || ge.value || de.value), U = $(() => e.colspan > 0 ? h.value / e.colspan : 0), ve = $(() => {\n const O = x.value / e.colspan * 100, B = f.value / e.colspan * 100;\n return {\n left: `${O}%`,\n width: `${B - O}%`,\n backgroundColor: a.value\n };\n }), Y = $(\n () => ({\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100vw\",\n height: \"100vh\",\n pointerEvents: \"none\",\n zIndex: 1e3\n })\n ), X = L({ startX: 0, startPos: 0 }), { isDragging: ge } = yt(i, {\n axis: \"x\",\n onStart: () => Re(b.value, x.value),\n onMove: ({ x: O }) => Xe(O),\n onEnd: ({ x: O }) => je(O)\n }), { isDragging: de } = yt(u, {\n axis: \"x\",\n onStart: () => Re(I.value, f.value),\n onMove: ({ x: O }) => Fe(O),\n onEnd: ({ x: O }) => Je(O)\n }), { isDragging: Be } = yt(l, {\n exact: !0,\n axis: \"x\",\n onStart: () => Re(b.value, x.value),\n onMove: ({ x: O }) => Ze(O),\n onEnd: ({ x: O }) => D(O)\n });\n Ee(() => {\n F();\n }), An(() => {\n W();\n });\n function Re(O, B) {\n l.value && (l.value.style.transition = \"none\"), X.value = { startX: O, startPos: B };\n }\n function Xe(O) {\n if (!ge.value || !l.value) return;\n const B = (O - X.value.startX) / U.value, G = Math.max(0, Math.min(f.value - 1, X.value.startPos + B));\n l.value.style.left = `${G / e.colspan * 100}%`, l.value.style.width = `${(f.value - G) / e.colspan * 100}%`;\n }\n function je(O) {\n if (!l.value) return;\n const B = O - X.value.startX, G = Math.round(B / U.value), Q = x.value, ne = Math.max(0, Math.min(f.value - 1, X.value.startPos + G));\n x.value = ne, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"start\",\n oldStart: Q,\n newStart: ne,\n end: f.value,\n delta: G,\n oldColspan: f.value - Q,\n newColspan: f.value - ne\n });\n }\n function Fe(O) {\n if (!de.value || !l.value) return;\n const B = (O - X.value.startX) / U.value, G = Math.max(x.value + 1, Math.min(e.columnsCount, X.value.startPos + B));\n l.value.style.width = `${(G - x.value) / e.colspan * 100}%`;\n }\n function Je(O) {\n if (!l.value) return;\n const B = O - X.value.startX, G = Math.round(B / U.value), Q = f.value, ne = Math.max(x.value + 1, Math.min(e.columnsCount, X.value.startPos + G));\n f.value = ne, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"end\",\n oldEnd: Q,\n newEnd: ne,\n start: x.value,\n delta: G,\n oldColspan: Q - x.value,\n newColspan: ne - x.value\n });\n }\n function Ze(O) {\n if (!Be.value || !l.value) return;\n const B = (O - X.value.startX) / U.value, G = f.value - x.value, Q = Math.max(0, Math.min(X.value.startPos + B, e.columnsCount - G));\n l.value.style.left = `${Q / e.colspan * 100}%`;\n }\n function D(O) {\n if (!l.value) return;\n const B = O - X.value.startX, G = Math.round(B / U.value), Q = f.value - x.value, ne = x.value, ee = f.value;\n let re = X.value.startPos + G, ce = re + Q;\n re < 0 ? (re = 0, ce = Q) : ce > e.columnsCount && (ce = e.columnsCount, re = ce - Q), x.value = re, f.value = ce, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"bar\",\n oldStart: ne,\n oldEnd: ee,\n newStart: re,\n newEnd: ce,\n delta: G,\n colspan: ce - re\n });\n }\n function F() {\n const { x: O, y: B } = Pe(l), { x: G, y: Q } = Pe(c), { x: ne, y: ee } = Pe(p);\n e.store.registerGanttBar({\n id: r,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n startIndex: x,\n endIndex: f,\n color: a,\n label: e.label,\n position: { x: O, y: B }\n }), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({\n id: `${r}-connection-left`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"left\",\n position: { x: G, y: Q },\n visible: m,\n barId: r\n }), e.store.registerConnectionHandle({\n id: `${r}-connection-right`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"right\",\n position: { x: ne, y: ee },\n visible: g,\n barId: r\n }));\n }\n function W() {\n e.store.unregisterGanttBar(r), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${r}-connection-left`), e.store.unregisterConnectionHandle(`${r}-connection-right`));\n }\n function j() {\n e.store.isDependencyGraphEnabled && (m.value = !0, g.value = !0);\n }\n function z() {\n !C.value && !T.value && (m.value = !1, g.value = !1);\n }\n function se(O, B) {\n B.preventDefault(), B.stopPropagation(), R.value = !0, O === \"left\" ? C.value = !0 : T.value = !0;\n const G = O === \"left\" ? c.value : p.value;\n if (G) {\n const ee = G.getBoundingClientRect(), re = ee.left + ee.width / 2, ce = ee.top + ee.height / 2;\n S.value = { startX: re, startY: ce, endX: re, endY: ce };\n }\n const Q = (ee) => {\n S.value.endX = ee.clientX, S.value.endY = ee.clientY;\n }, ne = (ee) => {\n be(ee, O), Le(Q, ne);\n };\n document.addEventListener(\"mousemove\", Q), document.addEventListener(\"mouseup\", ne);\n }\n function be(O, B) {\n const G = document.elementFromPoint(O.clientX, O.clientY)?.closest(\".connection-handle\");\n if (G && G !== (B === \"left\" ? c.value : p.value)) {\n const Q = G.closest(\".gantt-bar\");\n if (Q) {\n const ne = parseInt(Q.getAttribute(\"data-rowindex\") || \"0\"), ee = parseInt(Q.getAttribute(\"data-colindex\") || \"0\"), re = G.classList.contains(\"left-connection-handle\") ? \"left\" : \"right\", ce = `gantt-bar-row-${ne}-col-${ee}`, d = e.store.createConnection(\n `${r}-connection-${B}`,\n `${ce}-connection-${re}`\n );\n d && o(\"connection:create\", d);\n }\n }\n }\n function Le(O, B) {\n R.value = !1, C.value = !1, T.value = !1, document.removeEventListener(\"mousemove\", O), document.removeEventListener(\"mouseup\", B), l.value?.matches(\":hover\") || z();\n }\n return t({\n barStyle: ve,\n cleanupConnectionDrag: Le,\n currentEnd: f,\n handleConnectionDrop: be,\n isLeftConnectionDragging: C,\n isLeftConnectionVisible: m,\n isRightConnectionDragging: T,\n isRightConnectionVisible: g,\n showDragPreview: R\n }), (O, B) => (w(), k(\"td\", {\n class: \"aganttcell\",\n colspan: e.colspan\n }, [\n y(\"div\", ko, [\n y(\"div\", {\n ref: \"bar\",\n \"data-rowindex\": e.rowIndex,\n \"data-colindex\": e.colIndex,\n class: ae([\"gantt-bar\", { \"is-dragging\": _.value }]),\n style: xe(ve.value),\n onMouseenter: j,\n onMouseleave: z\n }, [\n e.store.isDependencyGraphEnabled ? (w(), k(\"div\", {\n key: 0,\n ref: \"leftConnectionHandle\",\n class: ae([\"connection-handle left-connection-handle\", { visible: m.value, \"is-dragging\": C.value }]),\n onMousedown: B[0] || (B[0] = Ie((G) => se(\"left\", G), [\"stop\"]))\n }, [...B[2] || (B[2] = [\n y(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : q(\"\", !0),\n e.store.isDependencyGraphEnabled ? (w(), k(\"div\", {\n key: 1,\n ref: \"rightConnectionHandle\",\n class: ae([\"connection-handle right-connection-handle\", { visible: g.value, \"is-dragging\": T.value }]),\n onMousedown: B[1] || (B[1] = Ie((G) => se(\"right\", G), [\"stop\"]))\n }, [...B[3] || (B[3] = [\n y(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : q(\"\", !0),\n y(\"div\", {\n ref: \"leftResizeHandle\",\n class: ae([\"resize-handle left-resize-handle\", { \"is-dragging\": V(ge) }])\n }, [...B[4] || (B[4] = [\n y(\"div\", { class: \"handle-grip\" }, null, -1),\n y(\"div\", { class: \"vertical-indicator left-indicator\" }, null, -1)\n ])], 2),\n e.label ? (w(), k(\"label\", Co, K(e.label), 1)) : q(\"\", !0),\n y(\"div\", {\n ref: \"rightResizeHandle\",\n class: ae([\"resize-handle right-resize-handle\", { \"is-dragging\": V(de) }])\n }, [...B[5] || (B[5] = [\n y(\"div\", { class: \"handle-grip\" }, null, -1),\n y(\"div\", { class: \"vertical-indicator right-indicator\" }, null, -1)\n ])], 2)\n ], 46, Mo)\n ], 512),\n e.store.isDependencyGraphEnabled && R.value ? (w(), k(\"svg\", {\n key: 0,\n style: xe(Y.value)\n }, [\n y(\"line\", {\n x1: S.value.startX,\n y1: S.value.startY,\n x2: S.value.endX,\n y2: S.value.endY,\n stroke: \"#2196f3\",\n \"stroke-width\": \"2\",\n \"stroke-dasharray\": \"5,5\"\n }, null, 8, Eo)\n ], 4)) : q(\"\", !0)\n ], 8, Io));\n }\n}), To = /* @__PURE__ */ Ve(Ao, [[\"__scopeId\", \"data-v-8917a8a3\"]]), $o = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"34 18 30 18 30 30 18 30 18 34 30 34 30 46 34 46 34 34 46 34 46 30 34 30 34 18\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>\n`, Do = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"46.84 19.99 44.01 17.16 32 29.17 19.99 17.16 17.16 19.99 29.17 32 17.16 44.01 19.99 46.84 32 34.83 44.01 46.84 46.84 44.01 34.83 32 46.84 19.99\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, So = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.67\">\n <path d=\"M68.67,16.67h-14.67V2c0-1.1-.9-2-2-2H2C.9,0,0,.9,0,2v50c0,1.1.9,2,2,2h14.67v14.67c0,1.1.9,2,2,2h50c1.1,0,2-.9,2-2V18.67c0-1.1-.9-2-2-2ZM4,4h46v46H4V4ZM66.67,66.67H20.67v-12.67h31.33c1.1,0,2-.9,2-2v-31.33h12.67v46Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"41 25 29 25 29 13 25 13 25 25 13 25 13 29 25 29 25 41 29 41 29 29 41 29 41 25\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Ro = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <path d=\"M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z\"/>\n <g>\n <polygon points=\"70.6 2.5 68.6 2.5 68.6 2 68.1 2 68.1 0 70.6 0 70.6 2.5\"/>\n <path d=\"M65.3,2h-2.9V0h2.9v2ZM59.6,2h-2.9V0h2.9v2ZM53.9,2h-2.9V0h2.9v2ZM48.2,2h-2.9V0h2.9v2ZM42.4,2h-2.9V0h2.9v2ZM36.7,2h-2.9V0h2.9v2ZM31,2h-2.9V0h2.9v2ZM25.3,2h-2.9V0h2.9v2ZM19.6,2h-2.9V0h2.9v2ZM13.9,2h-2.9V0h2.9v2ZM8.2,2h-2.9V0h2.9v2Z\"/>\n <polygon points=\"2 2.5 0 2.5 0 0 2.5 0 2.5 2 2 2 2 2.5\"/>\n <path d=\"M2,13.4H0v-2.7h2v2.7ZM2,8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 18.7 0 18.7 0 16.2 2 16.2 2 16.7 2.5 16.7 2.5 18.7\"/>\n <path d=\"M65.3,18.7h-2.9v-2h2.9v2ZM59.6,18.7h-2.9v-2h2.9v2ZM53.9,18.7h-2.9v-2h2.9v2ZM48.2,18.7h-2.9v-2h2.9v2ZM42.4,18.7h-2.9v-2h2.9v2ZM36.7,18.7h-2.9v-2h2.9v2ZM31,18.7h-2.9v-2h2.9v2ZM25.3,18.7h-2.9v-2h2.9v2ZM19.6,18.7h-2.9v-2h2.9v2ZM13.9,18.7h-2.9v-2h2.9v2ZM8.2,18.7h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 18.7 68.1 18.7 68.1 16.7 68.6 16.7 68.6 16.2 70.6 16.2 70.6 18.7\"/>\n <path d=\"M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z\"/>\n </g>\n</svg>`, Lo = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <g>\n <polygon points=\"70.6 45.3 68.6 45.3 68.6 44.8 68.1 44.8 68.1 42.8 70.6 42.8 70.6 45.3\"/>\n <path d=\"M65.3,44.8h-2.9v-2h2.9v2ZM59.6,44.8h-2.9v-2h2.9v2ZM53.9,44.8h-2.9v-2h2.9v2ZM48.2,44.8h-2.9v-2h2.9v2ZM42.4,44.8h-2.9v-2h2.9v2ZM36.7,44.8h-2.9v-2h2.9v2ZM31,44.8h-2.9v-2h2.9v2ZM25.3,44.8h-2.9v-2h2.9v2ZM19.6,44.8h-2.9v-2h2.9v2ZM13.9,44.8h-2.9v-2h2.9v2ZM8.2,44.8h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"2 45.3 0 45.3 0 42.8 2.5 42.8 2.5 44.8 2 44.8 2 45.3\"/>\n <path d=\"M2,56.3H0v-2.7h2v2.7ZM2,50.8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 61.5 0 61.5 0 59 2 59 2 59.5 2.5 59.5 2.5 61.5\"/>\n <path d=\"M65.3,61.5h-2.9v-2h2.9v2ZM59.6,61.5h-2.9v-2h2.9v2ZM53.9,61.5h-2.9v-2h2.9v2ZM48.2,61.5h-2.9v-2h2.9v2ZM42.4,61.5h-2.9v-2h2.9v2ZM36.7,61.5h-2.9v-2h2.9v2ZM31,61.5h-2.9v-2h2.9v2ZM25.3,61.5h-2.9v-2h2.9v2ZM19.6,61.5h-2.9v-2h2.9v2ZM13.9,61.5h-2.9v-2h2.9v2ZM8.2,61.5h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 61.5 68.1 61.5 68.1 59.5 68.6 59.5 68.6 59 70.6 59 70.6 61.5\"/>\n <path d=\"M70.6,56.3h-2v-2.7h2v2.7ZM70.6,50.8h-2v-2.7h2v2.7Z\"/>\n </g>\n <path d=\"M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z\"/>\n</svg>`, Ho = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.64\">\n <path d=\"M70.08,33.9l-9.75-9.75-2.83,2.83,6.33,6.33h-26.51V6.81l6.33,6.33,2.83-2.83L36.75.56c-.75-.75-2.08-.75-2.83,0l-9.75,9.75,2.83,2.83,6.33-6.33v26.5H6.83l6.33-6.33-2.83-2.83L.59,33.9c-.38.38-.59.88-.59,1.41s.21,1.04.59,1.41l9.75,9.75,2.83-2.83-6.33-6.33h26.5v26.51l-6.33-6.33-2.83,2.83,9.75,9.75c.38.38.88.59,1.41.59s1.04-.21,1.41-.59l9.75-9.75-2.83-2.83-6.33,6.33v-26.51h26.51l-6.33,6.33,2.83,2.83,9.75-9.75c.38-.38.59-.88.59-1.41s-.21-1.04-.59-1.41Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Vo = {\n add: $o,\n delete: Do,\n duplicate: So,\n insertAbove: Ro,\n insertBelow: Lo,\n move: Ho\n}, Po = {\n key: 0,\n class: \"row-actions-dropdown\"\n}, Oo = [\"aria-expanded\"], _o = [\"onClick\"], Bo = [\"innerHTML\"], Fo = { class: \"action-label\" }, Zo = {\n key: 1,\n class: \"row-actions-icons\"\n}, No = [\"title\", \"aria-label\", \"onClick\"], Uo = [\"innerHTML\"], ut = /* @__PURE__ */ te({\n __name: \"ARowActions\",\n props: {\n rowIndex: {},\n store: {},\n config: {},\n position: {}\n },\n emits: [\"action\"],\n setup(e, { emit: t }) {\n const n = e, o = t, a = fe(\"actionsCell\"), r = fe(\"toggleButton\"), s = L(0), l = L(!1), i = L(!1), u = L({ top: 0, left: 0 }), c = {\n add: \"Add Row\",\n delete: \"Delete Row\",\n duplicate: \"Duplicate Row\",\n insertAbove: \"Insert Above\",\n insertBelow: \"Insert Below\",\n move: \"Move Row\"\n }, p = $(() => {\n const m = [], g = n.config.actions || {}, C = [\"add\", \"delete\", \"duplicate\", \"insertAbove\", \"insertBelow\", \"move\"];\n for (const T of C) {\n const R = g[T];\n if (R === !1 || R === void 0) continue;\n let S = !0, _ = c[T], U = Vo[T];\n typeof R == \"object\" && (S = R.enabled !== !1, _ = R.label || _, U = R.icon || U), S && m.push({ type: T, label: _, icon: U });\n }\n return m;\n }), h = $(() => {\n if (n.config.forceDropdown) return !0;\n const m = n.config.dropdownThreshold ?? 150;\n return m === 0 ? !1 : s.value > 0 && s.value < m;\n }), b = $(() => l.value ? i.value ? {\n position: \"fixed\",\n bottom: `${window.innerHeight - u.value.top}px`,\n left: `${u.value.left}px`,\n top: \"auto\"\n } : {\n position: \"fixed\",\n top: `${u.value.top}px`,\n left: `${u.value.left}px`\n } : {});\n ft(a, (m) => {\n const g = m[0];\n g && (s.value = g.contentRect.width);\n });\n const I = () => {\n l.value || x(), l.value = !l.value;\n }, x = () => {\n if (!r.value) return;\n const m = r.value.getBoundingClientRect(), g = window.innerHeight, C = p.value.length * 40 + 16, T = g - m.bottom, R = m.top;\n i.value = T < C && R > C, i.value ? u.value = {\n top: m.top,\n left: m.left\n } : u.value = {\n top: m.bottom,\n left: m.left\n };\n };\n $t(a, () => {\n l.value = !1;\n });\n const f = (m) => {\n l.value = !1;\n const g = n.config.actions?.[m];\n typeof g == \"object\" && g.handler && g.handler(n.rowIndex, n.store) === !1 || o(\"action\", m, n.rowIndex);\n };\n return (m, g) => (w(), k(\"td\", {\n ref: \"actionsCell\",\n class: ae([\"atable-row-actions\", { \"sticky-column\": e.position === \"before-index\", \"dropdown-active\": l.value }])\n }, [\n h.value ? (w(), k(\"div\", Po, [\n y(\"button\", {\n ref: \"toggleButton\",\n type: \"button\",\n class: \"row-actions-toggle\",\n \"aria-expanded\": l.value,\n \"aria-haspopup\": \"true\",\n onClick: Ie(I, [\"stop\"])\n }, [...g[0] || (g[0] = [\n y(\"span\", { class: \"dropdown-icon\" }, \"⋮\", -1)\n ])], 8, Oo),\n J(y(\"div\", {\n class: ae([\"row-actions-menu\", { \"menu-flipped\": i.value }]),\n style: xe(b.value),\n role: \"menu\"\n }, [\n (w(!0), k(ue, null, me(p.value, (C) => (w(), k(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-menu-item\",\n role: \"menuitem\",\n onClick: Ie((T) => f(C.type), [\"stop\"])\n }, [\n y(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, Bo),\n y(\"span\", Fo, K(C.label), 1)\n ], 8, _o))), 128))\n ], 6), [\n [Ce, l.value]\n ])\n ])) : (w(), k(\"div\", Zo, [\n (w(!0), k(ue, null, me(p.value, (C) => (w(), k(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-btn\",\n title: C.label,\n \"aria-label\": C.label,\n onClick: Ie((T) => f(C.type), [\"stop\"])\n }, [\n y(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, Uo)\n ], 8, No))), 128))\n ]))\n ], 2));\n }\n}), Wo = [\"tabindex\"], Go = /* @__PURE__ */ te({\n __name: \"ARow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: !1 }\n },\n emits: [\"row:action\"],\n setup(e, { emit: t }) {\n const n = t, o = fe(\"rowEl\"), a = $(() => e.store.isRowVisible(e.rowIndex)), r = $(() => e.store.getRowExpandSymbol(e.rowIndex)), s = $(() => e.store.config.rowActions || { enabled: !1 }), l = $(() => s.value.enabled), i = $(() => s.value.position || \"before-index\"), u = (c, p) => {\n n(\"row:action\", c, p);\n };\n if (e.addNavigation) {\n let c = wt;\n typeof e.addNavigation == \"object\" && (c = {\n ...c,\n ...e.addNavigation\n }), Ot([\n {\n selectors: o,\n handlers: c\n }\n ]);\n }\n return (c, p) => J((w(), k(\"tr\", {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"atable-row\"\n }, [\n l.value && i.value === \"before-index\" ? (w(), pe(ut, {\n key: 0,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: i.value,\n onAction: u\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : q(\"\", !0),\n e.store.config.view !== \"uncounted\" ? he(c.$slots, \"index\", { key: 1 }, () => [\n e.store.config.view === \"list\" ? (w(), k(\"td\", {\n key: 0,\n tabIndex: -1,\n class: ae([\"list-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"])\n }, K(e.rowIndex + 1), 3)) : e.store.isTreeView ? (w(), k(\"td\", {\n key: 1,\n tabIndex: -1,\n class: ae([\"tree-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"]),\n onClick: p[0] || (p[0] = (h) => e.store.toggleRowExpand(e.rowIndex))\n }, K(r.value), 3)) : q(\"\", !0)\n ], !0) : q(\"\", !0),\n l.value && i.value === \"after-index\" ? (w(), pe(ut, {\n key: 2,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: i.value,\n onAction: u\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : q(\"\", !0),\n he(c.$slots, \"default\", {}, void 0, !0),\n l.value && i.value === \"end\" ? (w(), pe(ut, {\n key: 3,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: i.value,\n onAction: u\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : q(\"\", !0)\n ], 8, Wo)), [\n [Ce, a.value]\n ]);\n }\n}), hn = /* @__PURE__ */ Ve(Go, [[\"__scopeId\", \"data-v-2e038a9c\"]]), It = /* @__PURE__ */ new WeakMap(), zo = {\n mounted(e, t) {\n const n = !t.modifiers.bubble;\n let o;\n if (typeof t.value == \"function\") o = $t(e, t.value, { capture: n });\n else {\n const [a, r] = t.value;\n o = $t(e, a, Object.assign({ capture: n }, r));\n }\n It.set(e, o);\n },\n unmounted(e) {\n const t = It.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), It.delete(e);\n }\n}, qo = { mounted(e, t) {\n typeof t.value == \"function\" ? ft(e, t.value) : ft(e, ...t.value);\n} };\nfunction Yo() {\n let e = !1;\n const t = ie(!1);\n return (n, o) => {\n if (t.value = o.value, e) return;\n e = !0;\n const a = uo(n, o.value);\n oe(t, (r) => a.value = r);\n };\n}\nYo();\nconst Xo = { class: \"gantt-connection-overlay\" }, jo = {\n class: \"connection-svg\",\n style: {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n pointerEvents: \"none\",\n zIndex: 1\n }\n}, Jo = [\"d\", \"stroke-width\", \"onDblclick\"], Qo = [\"id\", \"d\", \"stroke\", \"stroke-width\", \"onDblclick\"], Ko = 0.25, at = 16, el = /* @__PURE__ */ te({\n __name: \"AGanttConnection\",\n props: {\n store: {}\n },\n emits: [\"connection:delete\"],\n setup(e, { emit: t }) {\n const n = t, o = $(() => e.store.connectionPaths.filter((s) => {\n const l = e.store.ganttBars.find((u) => u.id === s.from.barId), i = e.store.ganttBars.find((u) => u.id === s.to.barId);\n return l && i;\n })), a = (s) => {\n const l = e.store.connectionHandles.find(\n (_) => _.barId === s.from.barId && _.side === s.from.side\n ), i = e.store.connectionHandles.find(\n (_) => _.barId === s.to.barId && _.side === s.to.side\n );\n if (!l || !i) return \"\";\n const u = l.position.x + at / 2, c = l.position.y + at / 2, p = i.position.x + at / 2, h = i.position.y + at / 2, b = Math.abs(p - u), I = Math.max(b * Ko, 50), x = u + (s.from.side === \"left\" ? -I : I), f = p + (s.to.side === \"left\" ? -I : I), m = { x: 0.5 * u + 0.5 * x, y: 0.5 * c + 0.5 * c }, g = { x: 0.5 * x + 0.5 * f, y: 0.5 * c + 0.5 * h }, C = { x: 0.5 * f + 0.5 * p, y: 0.5 * h + 0.5 * h }, T = { x: 0.5 * m.x + 0.5 * g.x, y: 0.5 * m.y + 0.5 * g.y }, R = { x: 0.5 * g.x + 0.5 * C.x, y: 0.5 * g.y + 0.5 * C.y }, S = { x: 0.5 * T.x + 0.5 * R.x, y: 0.5 * T.y + 0.5 * R.y };\n return `M ${u} ${c} Q ${x} ${c}, ${S.x} ${S.y} Q ${f} ${h}, ${p} ${h}`;\n }, r = (s) => {\n e.store.deleteConnection(s.id) && n(\"connection:delete\", s);\n };\n return (s, l) => (w(), k(\"div\", Xo, [\n (w(), k(\"svg\", jo, [\n l[0] || (l[0] = y(\"defs\", null, [\n y(\"path\", {\n id: \"arrowhead\",\n d: \"M 0 -7 L 20 0 L 0 7Z\",\n stroke: \"black\",\n \"stroke-width\": \"1\",\n fill: \"currentColor\"\n }),\n y(\"marker\", {\n id: \"arrowhead-marker\",\n markerWidth: \"10\",\n markerHeight: \"7\",\n refX: \"5\",\n refY: \"3.5\",\n orient: \"auto\",\n markerUnits: \"strokeWidth\"\n }, [\n y(\"polygon\", {\n points: \"0 0, 10 3.5, 0 7\",\n fill: \"currentColor\"\n })\n ])\n ], -1)),\n (w(!0), k(ue, null, me(o.value, (i) => (w(), k(\"path\", {\n key: `${i.id}-hitbox`,\n d: a(i),\n stroke: \"transparent\",\n \"stroke-width\": (i.style?.width || 2) + 10,\n fill: \"none\",\n class: \"connection-hitbox\",\n onDblclick: (u) => r(i)\n }, null, 40, Jo))), 128)),\n (w(!0), k(ue, null, me(o.value, (i) => (w(), k(\"path\", {\n id: i.id,\n key: i.id,\n d: a(i),\n stroke: i.style?.color || \"#666\",\n \"stroke-width\": i.style?.width || 2,\n fill: \"none\",\n \"marker-mid\": \"url(#arrowhead-marker)\",\n class: \"connection-path animated-path\",\n onDblclick: (u) => r(i)\n }, null, 40, Qo))), 128))\n ]))\n ]));\n }\n}), tl = /* @__PURE__ */ Ve(el, [[\"__scopeId\", \"data-v-71911260\"]]), nl = { class: \"column-filter\" }, ol = {\n key: 2,\n class: \"checkbox-filter\"\n}, ll = [\"value\"], al = {\n key: 5,\n class: \"date-range-filter\"\n}, sl = /* @__PURE__ */ te({\n __name: \"ATableColumnFilter\",\n props: {\n column: {},\n colIndex: {},\n store: {}\n },\n setup(e) {\n const t = L(\"\"), n = rn({\n startValue: \"\",\n endValue: \"\"\n }), o = (i) => {\n if (i.filterOptions) return i.filterOptions;\n const u = /* @__PURE__ */ new Set();\n return e.store.rows.forEach((c) => {\n const p = c[i.name];\n p != null && p !== \"\" && u.add(p);\n }), Array.from(u).map((c) => ({\n value: c,\n label: String(c)\n }));\n }, a = $(() => !!(t.value || n.startValue || n.endValue)), r = (i) => {\n !i && e.column.filterType !== \"checkbox\" ? (e.store.clearFilter(e.colIndex), t.value = \"\") : (t.value = i, e.store.setFilter(e.colIndex, { value: i }));\n }, s = (i, u) => {\n i === \"start\" ? n.startValue = u : n.endValue = u, !n.startValue && !n.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {\n value: null,\n startValue: n.startValue,\n endValue: n.endValue\n });\n }, l = () => {\n t.value = \"\", n.startValue = \"\", n.endValue = \"\", e.store.clearFilter(e.colIndex);\n };\n return (i, u) => (w(), k(\"div\", nl, [\n (e.column.filterType || \"text\") === \"text\" ? J((w(), k(\"input\", {\n key: 0,\n \"onUpdate:modelValue\": u[0] || (u[0] = (c) => t.value = c),\n type: \"text\",\n class: \"filter-input\",\n onInput: u[1] || (u[1] = (c) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"number\" ? J((w(), k(\"input\", {\n key: 1,\n \"onUpdate:modelValue\": u[2] || (u[2] = (c) => t.value = c),\n type: \"number\",\n class: \"filter-input\",\n onInput: u[3] || (u[3] = (c) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"checkbox\" ? (w(), k(\"label\", ol, [\n J(y(\"input\", {\n \"onUpdate:modelValue\": u[4] || (u[4] = (c) => t.value = c),\n type: \"checkbox\",\n class: \"filter-checkbox\",\n onChange: u[5] || (u[5] = (c) => r(t.value))\n }, null, 544), [\n [un, t.value]\n ]),\n y(\"span\", null, K(e.column.label), 1)\n ])) : e.column.filterType === \"select\" ? J((w(), k(\"select\", {\n key: 3,\n \"onUpdate:modelValue\": u[6] || (u[6] = (c) => t.value = c),\n class: \"filter-select\",\n onChange: u[7] || (u[7] = (c) => r(t.value))\n }, [\n u[15] || (u[15] = y(\"option\", { value: \"\" }, \"All\", -1)),\n (w(!0), k(ue, null, me(o(e.column), (c) => (w(), k(\"option\", {\n key: c.value || c,\n value: c.value || c\n }, K(c.label || c), 9, ll))), 128))\n ], 544)), [\n [Cn, t.value]\n ]) : e.column.filterType === \"date\" ? J((w(), k(\"input\", {\n key: 4,\n \"onUpdate:modelValue\": u[8] || (u[8] = (c) => t.value = c),\n type: \"date\",\n class: \"filter-input\",\n onChange: u[9] || (u[9] = (c) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"dateRange\" ? (w(), k(\"div\", al, [\n J(y(\"input\", {\n \"onUpdate:modelValue\": u[10] || (u[10] = (c) => n.startValue = c),\n type: \"date\",\n class: \"filter-input\",\n onChange: u[11] || (u[11] = (c) => s(\"start\", n.startValue))\n }, null, 544), [\n [we, n.startValue]\n ]),\n u[16] || (u[16] = y(\"span\", { class: \"date-separator\" }, \"-\", -1)),\n J(y(\"input\", {\n \"onUpdate:modelValue\": u[12] || (u[12] = (c) => n.endValue = c),\n type: \"date\",\n class: \"filter-input\",\n onChange: u[13] || (u[13] = (c) => s(\"end\", n.endValue))\n }, null, 544), [\n [we, n.endValue]\n ])\n ])) : e.column.filterType === \"component\" && e.column.filterComponent ? (w(), pe(We(e.column.filterComponent), {\n key: 6,\n value: t.value,\n column: e.column,\n colIndex: e.colIndex,\n store: e.store,\n \"onUpdate:value\": u[14] || (u[14] = (c) => r(c))\n }, null, 40, [\"value\", \"column\", \"colIndex\", \"store\"])) : q(\"\", !0),\n a.value ? (w(), k(\"button\", {\n key: 7,\n onClick: l,\n class: \"clear-btn\",\n title: \"Clear\"\n }, \"×\")) : q(\"\", !0)\n ]));\n }\n}), rl = /* @__PURE__ */ Ve(sl, [[\"__scopeId\", \"data-v-8487462d\"]]), il = { key: 0 }, ul = {\n class: \"atable-header-row\",\n tabindex: \"-1\"\n}, cl = {\n key: 2,\n class: \"row-actions-header\"\n}, dl = [\"data-colindex\", \"onClick\"], fl = {\n key: 3,\n class: \"row-actions-header\"\n}, vl = {\n key: 0,\n class: \"atable-filters-row\"\n}, pl = {\n key: 2,\n class: \"row-actions-header\"\n}, ml = {\n key: 3,\n class: \"row-actions-header\"\n}, gn = /* @__PURE__ */ te({\n __name: \"ATableHeader\",\n props: {\n columns: {},\n store: {}\n },\n setup(e) {\n const t = e, n = $(() => t.columns.filter((l) => l.filterable)), o = $(() => t.store.config.value?.rowActions?.enabled ?? !1), a = $(() => t.store.config.value?.rowActions?.position ?? \"before-index\"), r = (l) => t.store.sortByColumn(l), s = (l) => {\n for (const i of l) {\n if (i.borderBoxSize.length === 0) continue;\n const u = i.borderBoxSize[0].inlineSize, c = Number(i.target.dataset.colindex), p = t.store.columns[c]?.width;\n typeof p == \"number\" && p !== u && t.store.resizeColumn(c, u);\n }\n };\n return (l, i) => t.columns.length ? (w(), k(\"thead\", il, [\n y(\"tr\", ul, [\n o.value && a.value === \"before-index\" ? (w(), k(\"th\", {\n key: 0,\n class: ae([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : q(\"\", !0),\n t.store.zeroColumn ? (w(), k(\"th\", {\n key: 1,\n id: \"header-index\",\n class: ae([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : q(\"\", !0),\n o.value && a.value === \"after-index\" ? (w(), k(\"th\", cl)) : q(\"\", !0),\n (w(!0), k(ue, null, me(t.columns, (u, c) => J((w(), k(\"th\", {\n key: u.name,\n \"data-colindex\": c,\n tabindex: \"-1\",\n style: xe(t.store.getHeaderCellStyle(u)),\n class: ae(`${u.pinned ? \"sticky-column\" : \"\"} ${u.sortable === !1 ? \"\" : \"cursor-pointer\"}`),\n onClick: (p) => u.sortable !== !1 ? r(c) : void 0\n }, [\n he(l.$slots, \"default\", {}, () => [\n Dt(K(u.label || String.fromCharCode(c + 97).toUpperCase()), 1)\n ])\n ], 14, dl)), [\n [V(qo), s]\n ])), 128)),\n o.value && a.value === \"end\" ? (w(), k(\"th\", fl)) : q(\"\", !0)\n ]),\n n.value.length > 0 ? (w(), k(\"tr\", vl, [\n o.value && a.value === \"before-index\" ? (w(), k(\"th\", {\n key: 0,\n class: ae([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : q(\"\", !0),\n t.store.zeroColumn ? (w(), k(\"th\", {\n key: 1,\n class: ae([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : q(\"\", !0),\n o.value && a.value === \"after-index\" ? (w(), k(\"th\", pl)) : q(\"\", !0),\n (w(!0), k(ue, null, me(t.columns, (u, c) => (w(), k(\"th\", {\n key: `filter-${u.name}`,\n class: ae(`${u.pinned ? \"sticky-column\" : \"\"}`),\n style: xe(t.store.getHeaderCellStyle(u))\n }, [\n u.filterable ? (w(), pe(rl, {\n key: 0,\n column: u,\n \"col-index\": c,\n store: t.store\n }, null, 8, [\"column\", \"col-index\", \"store\"])) : q(\"\", !0)\n ], 6))), 128)),\n o.value && a.value === \"end\" ? (w(), k(\"th\", ml)) : q(\"\", !0)\n ])) : q(\"\", !0)\n ])) : q(\"\", !0);\n }\n}), wn = /* @__PURE__ */ te({\n __name: \"ATableModal\",\n props: {\n store: {}\n },\n setup(e) {\n const t = fe(\"amodal\"), { width: n, height: o } = Pe(t), a = $(() => {\n if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;\n const r = e.store.modal.cell?.closest(\"table\");\n if (!r) return {};\n const s = r.offsetHeight || 0, l = r.offsetWidth || 0;\n let i = e.store.modal.cell?.offsetTop || 0;\n const u = r.querySelector(\"thead\")?.offsetHeight || 0;\n i += u, i = i + o.value < s ? i : i - (o.value + e.store.modal.height);\n let c = e.store.modal.cell?.offsetLeft || 0;\n return c = c + n.value <= l ? c : c - (n.value - e.store.modal.width), {\n left: `${c}px`,\n top: `${i}px`\n };\n });\n return (r, s) => (w(), k(\"div\", {\n ref: \"amodal\",\n class: \"amodal\",\n tabindex: \"-1\",\n style: xe(a.value),\n onClick: s[0] || (s[0] = Ie(() => {\n }, [\"stop\"])),\n onInput: s[1] || (s[1] = Ie(() => {\n }, [\"stop\"]))\n }, [\n he(r.$slots, \"default\")\n ], 36));\n }\n}), hl = (e) => {\n const t = e.id || fo();\n return Dn(`table-${t}`, () => {\n const n = () => {\n const d = [Object.assign({}, { rowModified: !1 })], v = /* @__PURE__ */ new Set();\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A];\n H.parent !== null && H.parent !== void 0 && v.add(H.parent);\n }\n const M = (A) => a.value[A]?.gantt !== void 0, P = (A) => {\n for (let H = 0; H < a.value.length; H++)\n if (a.value[H].parent === A && (M(H) || P(H)))\n return !0;\n return !1;\n }, Z = (A) => {\n const H = r.value, N = H.view === \"tree\" || H.view === \"tree-gantt\" ? H.defaultTreeExpansion : void 0;\n if (!N) return !0;\n switch (N) {\n case \"root\":\n return !1;\n // Only root nodes are visible, all children start collapsed\n case \"branch\":\n return P(A);\n case \"leaf\":\n return !0;\n // All nodes should be expanded\n default:\n return !0;\n }\n };\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A], N = H.parent === null || H.parent === void 0, le = v.has(A);\n d[A] = {\n childrenOpen: Z(A),\n expanded: !1,\n indent: H.indent || 0,\n isParent: le,\n isRoot: N,\n rowModified: !1,\n open: N,\n // This will be recalculated later for non-root nodes\n parent: H.parent\n };\n }\n return d;\n }, o = L(e.columns), a = L(e.rows), r = L(e.config || {}), s = L({}), l = L({}), i = $(() => {\n const d = {};\n for (const [v, M] of o.value.entries())\n for (const [P, Z] of a.value.entries())\n d[`${v}:${P}`] = Z[M.name];\n return d;\n }), u = $({\n get: () => {\n const d = n();\n for (let v = 0; v < d.length; v++)\n s.value[v] && (d[v].rowModified = s.value[v]), l.value[v] && (l.value[v].childrenOpen !== void 0 && (d[v].childrenOpen = l.value[v].childrenOpen), l.value[v].expanded !== void 0 && (d[v].expanded = l.value[v].expanded));\n if (C.value) {\n const v = (M, P) => {\n const Z = P[M];\n if (Z.isRoot || Z.parent === null || Z.parent === void 0)\n return !0;\n const A = Z.parent;\n return A < 0 || A >= P.length ? !1 : (P[A].childrenOpen || !1) && v(A, P);\n };\n for (let M = 0; M < d.length; M++)\n d[M].isRoot || (d[M].open = v(M, d));\n }\n return d;\n },\n set: (d) => {\n JSON.stringify(d) !== JSON.stringify(u.value) && (u.value = d);\n }\n }), c = L(e.modal || { visible: !1 }), p = L({}), h = L([]), b = L([]), I = L([]), x = L({\n column: null,\n direction: null\n }), f = L({}), m = $(() => o.value.some((d) => d.pinned)), g = $(() => r.value.view === \"gantt\" || r.value.view === \"tree-gantt\"), C = $(() => r.value.view === \"tree\" || r.value.view === \"tree-gantt\"), T = $(() => {\n const d = r.value;\n return d.view === \"gantt\" || d.view === \"tree-gantt\" ? d.dependencyGraph !== !1 : !0;\n }), R = $(() => `${Math.ceil(a.value.length / 100 + 1)}ch`), S = $(\n () => r.value.view ? [\"list\", \"tree\", \"tree-gantt\", \"list-expansion\"].includes(r.value.view) : !1\n ), _ = $(() => {\n let d = a.value.map((v, M) => ({\n ...v,\n originalIndex: M\n }));\n if (Object.entries(f.value).forEach(([v, M]) => {\n const P = parseInt(v), Z = o.value[P];\n !Z || !(M.value || M.startValue || M.endValue || Z.filterType === \"checkbox\" && M.value !== void 0) || (d = d.filter((A) => {\n const H = A[Z.name];\n return ne(H, M, Z);\n }));\n }), x.value.column !== null && x.value.direction) {\n const v = o.value[x.value.column], M = x.value.direction;\n d.sort((P, Z) => {\n let A = P[v.name], H = Z[v.name];\n A == null && (A = \"\"), H == null && (H = \"\");\n const N = Number(A), le = Number(H);\n if (!isNaN(N) && !isNaN(le) && A !== \"\" && H !== \"\")\n return M === \"asc\" ? N - le : le - N;\n {\n const nt = String(A).toLowerCase(), Ut = String(H).toLowerCase();\n return M === \"asc\" ? nt.localeCompare(Ut) : Ut.localeCompare(nt);\n }\n });\n }\n return d;\n }), U = (d, v) => i.value[`${d}:${v}`], ve = (d, v, M) => {\n const P = `${d}:${v}`, Z = o.value[d];\n i.value[P] !== M && (s.value[v] = !0), i.value[P] = M, a.value[v] = {\n ...a.value[v],\n [Z.name]: M\n };\n }, Y = (d) => {\n a.value = d;\n }, X = (d, v, M) => {\n const P = `${d}:${v}`;\n i.value[P] !== M && (s.value[v] = !0, p.value[P] = M);\n }, ge = (d) => {\n const v = o.value.indexOf(d) === o.value.length - 1, M = r.value.fullWidth ? d.resizable && !v : d.resizable;\n return {\n width: d.width || \"40ch\",\n textAlign: d.align || \"center\",\n ...M && {\n resize: \"horizontal\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\"\n }\n };\n }, de = (d, v) => {\n if (d < 0 || d >= o.value.length) return;\n const M = Math.max(v, 40);\n o.value[d] = {\n ...o.value[d],\n width: `${M}px`\n };\n }, Be = (d) => {\n const v = a.value[d];\n return g.value && v.gantt !== void 0;\n }, Re = (d) => !C.value || u.value[d].isRoot || u.value[d].open, Xe = (d) => !C.value && r.value.view !== \"list-expansion\" ? \"\" : C.value && (u.value[d].isRoot || u.value[d].isParent) ? u.value[d].childrenOpen ? \"▼\" : \"►\" : r.value.view === \"list-expansion\" ? u.value[d].expanded ? \"▼\" : \"►\" : \"\", je = (d) => {\n if (C.value) {\n const v = l.value[d] || {}, M = !(v.childrenOpen ?? u.value[d].childrenOpen);\n l.value[d] = {\n ...v,\n childrenOpen: M\n }, M || Fe(d);\n } else if (r.value.view === \"list-expansion\") {\n const v = l.value[d] || {}, M = v.expanded ?? u.value[d].expanded;\n l.value[d] = {\n ...v,\n expanded: !M\n };\n }\n }, Fe = (d) => {\n for (let v = 0; v < a.value.length; v++)\n if (u.value[v].parent === d) {\n const M = l.value[v] || {};\n l.value[v] = {\n ...M,\n childrenOpen: !1\n }, Fe(v);\n }\n }, Je = (d, v) => {\n const M = U(d, v);\n return Ze(d, v, M);\n }, Ze = (d, v, M) => {\n const P = o.value[d], Z = a.value[v], A = P.format;\n return A ? typeof A == \"function\" ? A(M, { table: i.value, row: Z, column: P }) : typeof A == \"string\" ? Function(`\"use strict\";return (${A})`)()(M, { table: i.value, row: Z, column: P }) : M : M;\n }, D = (d) => {\n d.target instanceof Node && c.value.parent?.contains(d.target) || c.value.visible && (c.value.visible = !1);\n }, F = (d, v) => v && d === 0 && v > 0 ? `${v}ch` : \"inherit\", W = (d) => {\n const v = a.value[d.rowIndex]?.gantt;\n v && (d.type === \"resize\" ? d.edge === \"start\" ? (v.startIndex = d.newStart, v.endIndex = d.end, v.colspan = v.endIndex - v.startIndex) : d.edge === \"end\" && (v.startIndex = d.start, v.endIndex = d.newEnd, v.colspan = v.endIndex - v.startIndex) : d.type === \"bar\" && (v.startIndex = d.newStart, v.endIndex = d.newEnd, v.colspan = v.endIndex - v.startIndex));\n }, j = (d) => {\n const v = h.value.findIndex((M) => M.id === d.id);\n v >= 0 ? h.value[v] = d : h.value.push(d);\n }, z = (d) => {\n const v = h.value.findIndex((M) => M.id === d);\n v >= 0 && h.value.splice(v, 1);\n }, se = (d) => {\n const v = b.value.findIndex((M) => M.id === d.id);\n v >= 0 ? b.value[v] = d : b.value.push(d);\n }, be = (d) => {\n const v = b.value.findIndex((M) => M.id === d);\n v >= 0 && b.value.splice(v, 1);\n }, Le = (d, v, M) => {\n const P = b.value.find((H) => H.id === d), Z = b.value.find((H) => H.id === v);\n if (!P || !Z)\n return console.warn(\"Cannot create connection: handle not found\"), null;\n const A = {\n id: `connection-${d}-${v}`,\n from: {\n barId: P.barId,\n side: P.side\n },\n to: {\n barId: Z.barId,\n side: Z.side\n },\n style: M?.style,\n label: M?.label\n };\n return I.value.push(A), A;\n }, O = (d) => {\n const v = I.value.findIndex((M) => M.id === d);\n return v >= 0 ? (I.value.splice(v, 1), !0) : !1;\n }, B = (d) => I.value.filter((v) => v.from.barId === d || v.to.barId === d), G = (d) => b.value.filter((v) => v.barId === d), Q = (d) => {\n if (o.value[d].sortable === !1) return;\n let v;\n x.value.column === d && x.value.direction === \"asc\" ? v = \"desc\" : v = \"asc\", x.value.column = d, x.value.direction = v;\n }, ne = (d, v, M) => {\n const P = M.filterType || \"text\", Z = v.value;\n if (!Z && P !== \"dateRange\" && P !== \"checkbox\") return !0;\n switch (P) {\n case \"text\": {\n let A = \"\";\n return typeof d == \"object\" && d !== null ? A = Object.values(d).join(\" \") : A = String(d || \"\"), A.toLowerCase().includes(String(Z).toLowerCase());\n }\n case \"number\": {\n const A = Number(d), H = Number(Z);\n return !isNaN(A) && !isNaN(H) && A === H;\n }\n case \"select\":\n return d === Z;\n case \"checkbox\":\n return Z === !0 ? !!d : !0;\n case \"date\": {\n let A;\n if (typeof d == \"number\") {\n const N = new Date(d), le = (/* @__PURE__ */ new Date()).getFullYear();\n A = new Date(le, N.getMonth(), N.getDate());\n } else\n A = new Date(String(d));\n const H = new Date(String(Z));\n return A.toDateString() === H.toDateString();\n }\n case \"dateRange\": {\n const A = v.startValue, H = v.endValue;\n if (!A && !H) return !0;\n let N;\n if (typeof d == \"number\") {\n const le = new Date(d), nt = (/* @__PURE__ */ new Date()).getFullYear();\n N = new Date(nt, le.getMonth(), le.getDate());\n } else\n N = new Date(String(d));\n return !(A && N < new Date(String(A)) || H && N > new Date(String(H)));\n }\n default:\n return !0;\n }\n }, ee = (d, v) => {\n !v.value && !v.startValue && !v.endValue ? delete f.value[d] : f.value[d] = v;\n }, re = (d) => {\n delete f.value[d];\n }, ce = (d, v = \"end\") => {\n const M = {};\n for (const Z of o.value)\n M[Z.name] = \"\";\n d && Object.assign(M, d);\n let P;\n return v === \"start\" ? (P = 0, a.value.unshift(M)) : v === \"end\" ? (P = a.value.length, a.value.push(M)) : (P = Math.max(0, Math.min(v, a.value.length)), a.value.splice(P, 0, M)), P;\n };\n return {\n // state\n columns: o,\n config: r,\n connectionHandles: b,\n connectionPaths: I,\n display: u,\n filterState: f,\n ganttBars: h,\n modal: c,\n rows: a,\n sortState: x,\n table: i,\n updates: p,\n // getters\n filteredRows: _,\n hasPinnedColumns: m,\n isGanttView: g,\n isTreeView: C,\n isDependencyGraphEnabled: T,\n numberedRowWidth: R,\n zeroColumn: S,\n // actions\n addRow: ce,\n clearFilter: re,\n closeModal: D,\n createConnection: Le,\n deleteConnection: O,\n deleteRow: (d) => {\n if (d < 0 || d >= a.value.length)\n return null;\n const [v] = a.value.splice(d, 1);\n delete s.value[d], delete l.value[d];\n const M = {}, P = {};\n for (const [Z, A] of Object.entries(s.value)) {\n const H = parseInt(Z);\n H > d ? M[H - 1] = A : M[H] = A;\n }\n for (const [Z, A] of Object.entries(l.value)) {\n const H = parseInt(Z);\n H > d ? P[H - 1] = A : P[H] = A;\n }\n return s.value = M, l.value = P, v;\n },\n duplicateRow: (d) => {\n if (d < 0 || d >= a.value.length)\n return -1;\n const v = a.value[d], M = JSON.parse(JSON.stringify(v)), P = d + 1;\n return a.value.splice(P, 0, M), P;\n },\n getCellData: U,\n getCellDisplayValue: Je,\n getConnectionsForBar: B,\n getFormattedValue: Ze,\n getHandlesForBar: G,\n getHeaderCellStyle: ge,\n getIndent: F,\n getRowExpandSymbol: Xe,\n insertRowAbove: (d, v) => {\n const M = Math.max(0, d);\n return ce(v, M);\n },\n insertRowBelow: (d, v) => {\n const M = Math.min(d + 1, a.value.length);\n return ce(v, M);\n },\n isRowGantt: Be,\n isRowVisible: Re,\n moveRow: (d, v) => {\n if (d < 0 || d >= a.value.length || v < 0 || v >= a.value.length || d === v)\n return !1;\n const [M] = a.value.splice(d, 1);\n a.value.splice(v, 0, M);\n const P = {}, Z = {};\n for (const [A, H] of Object.entries(s.value)) {\n const N = parseInt(A);\n let le = N;\n N === d ? le = v : d < v ? N > d && N <= v && (le = N - 1) : N >= v && N < d && (le = N + 1), P[le] = H;\n }\n for (const [A, H] of Object.entries(l.value)) {\n const N = parseInt(A);\n let le = N;\n N === d ? le = v : d < v ? N > d && N <= v && (le = N - 1) : N >= v && N < d && (le = N + 1), Z[le] = H;\n }\n return s.value = P, l.value = Z, !0;\n },\n registerConnectionHandle: se,\n registerGanttBar: j,\n resizeColumn: de,\n setCellData: ve,\n setCellText: X,\n setFilter: ee,\n sortByColumn: Q,\n toggleRowExpand: je,\n unregisterConnectionHandle: be,\n unregisterGanttBar: z,\n updateGanttBar: W,\n updateRows: Y\n };\n })();\n}, gl = {\n class: \"atable-container\",\n style: { position: \"relative\" }\n}, wl = /* @__PURE__ */ te({\n __name: \"ATable\",\n props: /* @__PURE__ */ Me({\n id: { default: \"\" },\n config: { default: () => new Object() }\n }, {\n rows: { required: !0 },\n rowsModifiers: {},\n columns: { required: !0 },\n columnsModifiers: {}\n }),\n emits: /* @__PURE__ */ Me([\"cellUpdate\", \"gantt:drag\", \"connection:event\", \"columns:update\", \"row:add\", \"row:delete\", \"row:duplicate\", \"row:insert-above\", \"row:insert-below\", \"row:move\"], [\"update:rows\", \"update:columns\"]),\n setup(e, { expose: t, emit: n }) {\n const o = ke(e, \"rows\"), a = ke(e, \"columns\"), r = n, s = fe(\"table\"), l = hl({ columns: a.value, rows: o.value, id: e.id, config: e.config });\n l.$onAction(({ name: I, store: x, args: f, after: m }) => {\n if (I === \"setCellData\" || I === \"setCellText\") {\n const [g, C, T] = f, R = x.getCellData(g, C);\n m(() => {\n o.value = [...x.rows], r(\"cellUpdate\", { colIndex: g, rowIndex: C, newValue: T, oldValue: R });\n });\n } else if (I === \"updateGanttBar\") {\n const [g] = f;\n let C = !1;\n g.type === \"resize\" ? C = g.oldColspan !== g.newColspan : g.type === \"bar\" && (C = g.oldStart !== g.newStart || g.oldEnd !== g.newEnd), C && m(() => {\n r(\"gantt:drag\", g);\n });\n } else I === \"resizeColumn\" && m(() => {\n a.value = [...x.columns], r(\"columns:update\", [...x.columns]);\n });\n }), oe(\n () => o.value,\n (I) => {\n JSON.stringify(I) !== JSON.stringify(l.rows) && (l.rows = [...I]);\n },\n { deep: !0 }\n ), oe(\n a,\n (I) => {\n JSON.stringify(I) !== JSON.stringify(l.columns) && (l.columns = [...I], r(\"columns:update\", [...I]));\n },\n { deep: !0 }\n ), Ee(() => {\n a.value.some((I) => I.pinned) && (u(), l.isTreeView && mn(s, u, { childList: !0, subtree: !0 }));\n });\n const i = $(() => l.columns.filter((I) => I.pinned).length), u = () => {\n const I = s.value, x = I?.rows[0], f = I?.rows[1], m = x ? Array.from(x.cells) : [];\n for (const [g, C] of m.entries()) {\n const T = f?.cells[g];\n T && (C.style.width = `${T.offsetWidth}px`);\n }\n for (const g of I?.rows || []) {\n let C = 0;\n const T = [];\n for (const R of g.cells)\n (R.classList.contains(\"sticky-column\") || R.classList.contains(\"sticky-index\")) && (R.style.left = `${C}px`, C += R.offsetWidth, T.push(R));\n T.length > 0 && T[T.length - 1].classList.add(\"sticky-column-edge\");\n }\n };\n window.addEventListener(\"keydown\", (I) => {\n if (I.key === \"Escape\" && l.modal.visible) {\n l.modal.visible = !1;\n const x = l.modal.parent;\n x && pt().then(() => {\n x.focus();\n });\n }\n });\n const c = (I) => {\n if (!I.gantt || i.value === 0)\n return l.columns;\n const x = [];\n for (let f = 0; f < i.value; f++) {\n const m = { ...l.columns[f] };\n m.originalIndex = f, x.push(m);\n }\n return x.push({\n ...l.columns[i.value],\n isGantt: !0,\n colspan: I.gantt?.colspan || l.columns.length - i.value,\n originalIndex: i.value,\n width: \"auto\"\n // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable\n }), x;\n }, p = (I) => {\n r(\"connection:event\", { type: \"create\", connection: I });\n }, h = (I) => {\n r(\"connection:event\", { type: \"delete\", connection: I });\n }, b = (I, x) => {\n switch (I) {\n case \"add\": {\n const f = l.addRow({}, x + 1), m = l.rows[f];\n o.value = [...l.rows], r(\"row:add\", { rowIndex: f, row: m });\n break;\n }\n case \"delete\": {\n const f = l.deleteRow(x);\n f && (o.value = [...l.rows], r(\"row:delete\", { rowIndex: x, row: f }));\n break;\n }\n case \"duplicate\": {\n const f = l.duplicateRow(x);\n if (f >= 0) {\n const m = l.rows[f];\n o.value = [...l.rows], r(\"row:duplicate\", { sourceIndex: x, newIndex: f, row: m });\n }\n break;\n }\n case \"insertAbove\": {\n const f = l.insertRowAbove(x), m = l.rows[f];\n o.value = [...l.rows], r(\"row:insert-above\", { targetIndex: x, newIndex: f, row: m });\n break;\n }\n case \"insertBelow\": {\n const f = l.insertRowBelow(x), m = l.rows[f];\n o.value = [...l.rows], r(\"row:insert-below\", { targetIndex: x, newIndex: f, row: m });\n break;\n }\n case \"move\": {\n r(\"row:move\", { fromIndex: x, toIndex: -1 });\n break;\n }\n }\n };\n return t({\n store: l,\n createConnection: l.createConnection,\n deleteConnection: l.deleteConnection,\n getConnectionsForBar: l.getConnectionsForBar,\n getHandlesForBar: l.getHandlesForBar,\n // Row action methods\n addRow: l.addRow,\n deleteRow: l.deleteRow,\n duplicateRow: l.duplicateRow,\n insertRowAbove: l.insertRowAbove,\n insertRowBelow: l.insertRowBelow,\n moveRow: l.moveRow\n }), (I, x) => (w(), k(\"div\", gl, [\n J((w(), k(\"table\", {\n ref: \"table\",\n class: \"atable\",\n style: xe({\n width: V(l).config.fullWidth ? \"100%\" : \"auto\"\n })\n }, [\n he(I.$slots, \"header\", { data: V(l) }, () => [\n dt(gn, {\n columns: V(l).columns,\n store: V(l)\n }, null, 8, [\"columns\", \"store\"])\n ], !0),\n y(\"tbody\", null, [\n he(I.$slots, \"body\", { data: V(l) }, () => [\n (w(!0), k(ue, null, me(V(l).filteredRows, (f, m) => (w(), pe(hn, {\n key: `${f.originalIndex}-${m}`,\n row: f,\n rowIndex: f.originalIndex,\n store: V(l),\n \"onRow:action\": b\n }, {\n default: Tt(() => [\n (w(!0), k(ue, null, me(c(f), (g, C) => (w(), k(ue, {\n key: g.name\n }, [\n g.isGantt ? (w(), pe(We(g.ganttComponent || \"AGanttCell\"), {\n key: 0,\n store: V(l),\n \"columns-count\": V(l).columns.length - i.value,\n color: f.gantt?.color,\n start: f.gantt?.startIndex,\n end: f.gantt?.endIndex,\n colspan: g.colspan,\n pinned: g.pinned,\n rowIndex: f.originalIndex,\n colIndex: g.originalIndex ?? C,\n style: xe({\n textAlign: g?.align || \"center\",\n minWidth: g?.width || \"40ch\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n \"onConnection:create\": p\n }, null, 40, [\"store\", \"columns-count\", \"color\", \"start\", \"end\", \"colspan\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"])) : (w(), pe(We(g.cellComponent || \"ACell\"), {\n key: 1,\n store: V(l),\n pinned: g.pinned,\n rowIndex: f.originalIndex,\n colIndex: C,\n style: xe({\n textAlign: g?.align || \"center\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n spellcheck: \"false\"\n }, null, 8, [\"store\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"]))\n ], 64))), 128))\n ]),\n _: 2\n }, 1032, [\"row\", \"rowIndex\", \"store\"]))), 128))\n ], !0)\n ]),\n he(I.$slots, \"footer\", { data: V(l) }, void 0, !0),\n he(I.$slots, \"modal\", { data: V(l) }, () => [\n J(dt(wn, { store: V(l) }, {\n default: Tt(() => [\n (w(), pe(We(V(l).modal.component), vt({\n key: `${V(l).modal.rowIndex}:${V(l).modal.colIndex}`,\n \"col-index\": V(l).modal.colIndex,\n \"row-index\": V(l).modal.rowIndex,\n store: V(l)\n }, V(l).modal.componentProps), null, 16, [\"col-index\", \"row-index\", \"store\"]))\n ]),\n _: 1\n }, 8, [\"store\"]), [\n [Ce, V(l).modal.visible]\n ])\n ], !0)\n ], 4)), [\n [V(zo), V(l).closeModal]\n ]),\n V(l).isGanttView && V(l).isDependencyGraphEnabled ? (w(), pe(tl, {\n key: 0,\n store: V(l),\n \"onConnection:delete\": h\n }, null, 8, [\"store\"])) : q(\"\", !0)\n ]));\n }\n}), yl = /* @__PURE__ */ Ve(wl, [[\"__scopeId\", \"data-v-3d00d51b\"]]), xl = {}, bl = { class: \"aloading\" }, Il = { class: \"aloading-header\" };\nfunction kl(e, t) {\n return w(), k(\"div\", bl, [\n y(\"h2\", Il, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = y(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst Ml = /* @__PURE__ */ Ve(xl, [[\"render\", kl], [\"__scopeId\", \"data-v-a930a25b\"]]), Cl = {}, El = { class: \"aloading\" }, Al = { class: \"aloading-header\" };\nfunction Tl(e, t) {\n return w(), k(\"div\", El, [\n y(\"h2\", Al, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = y(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst $l = /* @__PURE__ */ Ve(Cl, [[\"render\", Tl], [\"__scopeId\", \"data-v-e1165876\"]]);\nfunction Dl(e) {\n e.component(\"ACell\", ho), e.component(\"AExpansionRow\", bo), e.component(\"AGanttCell\", To), e.component(\"ARow\", hn), e.component(\"ARowActions\", ut), e.component(\"ATable\", yl), e.component(\"ATableHeader\", gn), e.component(\"ATableLoading\", Ml), e.component(\"ATableLoadingBar\", $l), e.component(\"ATableModal\", wn);\n}\nconst Sl = { class: \"aform_form-element\" }, Rl = [\"for\"], Ll = { class: \"aform_checkbox-container aform_input-field\" }, Hl = [\"id\", \"readonly\", \"required\"], Vl = [\"innerHTML\"], Pl = /* @__PURE__ */ te({\n __name: \"ACheckbox\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: { type: [Boolean, String, Array, Set] },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\");\n return (n, o) => (w(), k(\"div\", Sl, [\n y(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, K(e.label), 9, Rl),\n y(\"span\", Ll, [\n J(y(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (a) => t.value = a),\n type: \"checkbox\",\n class: \"aform_checkbox\",\n readonly: e.readOnly,\n required: e.required\n }, null, 8, Hl), [\n [un, t.value]\n ])\n ]),\n J(y(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, Vl), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), $e = (e, t) => {\n const n = e.__vccOpts || e;\n for (const [o, a] of t)\n n[o] = a;\n return n;\n}, Ol = /* @__PURE__ */ $e(Pl, [[\"__scopeId\", \"data-v-f13fd4d6\"]]), _l = /* @__PURE__ */ te({\n __name: \"AComboBox\",\n props: [\"event\", \"cellData\", \"tableID\"],\n setup(e) {\n return (t, n) => {\n const o = dn(\"ATableModal\");\n return w(), pe(o, {\n event: e.event,\n \"cell-data\": e.cellData,\n class: \"amodal\"\n }, {\n default: Tt(() => [...n[0] || (n[0] = [\n y(\"div\", null, [\n y(\"input\", { type: \"text\" }),\n y(\"input\", { type: \"text\" }),\n y(\"input\", { type: \"text\" })\n ], -1)\n ])]),\n _: 1\n }, 8, [\"event\", \"cell-data\"]);\n };\n }\n}), Bl = [\"id\", \"disabled\", \"required\"], Fl = [\"for\"], Zl = [\"innerHTML\"], Nl = /* @__PURE__ */ te({\n __name: \"ADate\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: { default: \"Date\" },\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {\n // format the date to be compatible with the native input datepicker\n },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\", {\n // format the date to be compatible with the native input datepicker\n set: (a) => new Date(a).toISOString().split(\"T\")[0]\n }), n = fe(\"date\"), o = () => {\n n.value && \"showPicker\" in HTMLInputElement.prototype && n.value.showPicker();\n };\n return (a, r) => (w(), k(\"div\", null, [\n J(y(\"input\", {\n id: e.uuid,\n ref: \"date\",\n \"onUpdate:modelValue\": r[0] || (r[0] = (s) => t.value = s),\n type: \"date\",\n disabled: e.readOnly,\n required: e.required,\n onClick: o\n }, null, 8, Bl), [\n [we, t.value]\n ]),\n y(\"label\", { for: e.uuid }, K(e.label), 9, Fl),\n J(y(\"p\", {\n innerHTML: e.validation.errorMessage\n }, null, 8, Zl), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), Ul = /* @__PURE__ */ $e(Nl, [[\"__scopeId\", \"data-v-a15ed922\"]]);\nfunction yn(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\n// @__NO_SIDE_EFFECTS__\nfunction jt() {\n const e = /* @__PURE__ */ new Set(), t = (r) => {\n e.delete(r);\n };\n return {\n on: (r) => {\n e.add(r);\n const s = () => t(r);\n return yn(s), { off: s };\n },\n off: t,\n trigger: (...r) => Promise.all(Array.from(e).map((s) => s(...r))),\n clear: () => {\n e.clear();\n }\n };\n}\nconst xn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Wl = Object.prototype.toString, Gl = (e) => Wl.call(e) === \"[object Object]\", Qe = () => {\n}, zl = (e, t) => Object.prototype.hasOwnProperty.call(e, t);\nfunction ql(...e) {\n if (e.length !== 1) return cn(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: Qe\n }))) : L(t);\n}\nfunction kt(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction Yl(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst bn = xn ? window : void 0, Xl = xn ? window.document : void 0;\nfunction Ue(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction Mt(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = kt(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return Yl(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => Ue(r))) !== null && o !== void 0 ? o : [bn].filter((r) => r != null),\n kt(E(n.value ? e[1] : e[0])),\n kt(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = Gl(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction Jt(e, t, n = {}) {\n const { window: o = bn, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = n;\n if (!o) return l ? {\n stop: Qe,\n cancel: Qe,\n trigger: Qe\n } : Qe;\n let i = !0;\n const u = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(o.document.querySelectorAll(m)).some((g) => g === f.target || f.composedPath().includes(g));\n {\n const g = Ue(m);\n return g && (f.target === g || f.composedPath().includes(g));\n }\n });\n function c(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const g = E(f), C = g.$.subTree && g.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some((T) => T.el === m.target || m.composedPath().includes(T.el));\n }\n const h = (f) => {\n const m = Ue(e);\n if (f.target != null && !(!(m instanceof Element) && c(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (i = !u(f)), !i) {\n i = !0;\n return;\n }\n t(f);\n }\n };\n let b = !1;\n const I = [\n Mt(o, \"click\", (f) => {\n b || (b = !0, setTimeout(() => {\n b = !1;\n }, 0), h(f));\n }, {\n passive: !0,\n capture: r\n }),\n Mt(o, \"pointerdown\", (f) => {\n const m = Ue(e);\n i = !u(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && Mt(o, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const g = Ue(e);\n ((m = o.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !g?.contains(o.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), x = () => I.forEach((f) => f());\n return l ? {\n stop: x,\n cancel: () => {\n i = !1;\n },\n trigger: (f) => {\n i = !0, h(f), i = !1;\n }\n } : x;\n}\nconst jl = {\n multiple: !0,\n accept: \"*\",\n reset: !1,\n directory: !1\n};\nfunction Jl(e) {\n if (!e) return null;\n if (e instanceof FileList) return e;\n const t = new DataTransfer();\n for (const n of e) t.items.add(n);\n return t.files;\n}\nfunction Ql(e = {}) {\n const { document: t = Xl } = e, n = L(Jl(e.initialFiles)), { on: o, trigger: a } = /* @__PURE__ */ jt(), { on: r, trigger: s } = /* @__PURE__ */ jt(), l = $(() => {\n var p;\n const h = (p = Ue(e.input)) !== null && p !== void 0 ? p : t ? t.createElement(\"input\") : void 0;\n return h && (h.type = \"file\", h.onchange = (b) => {\n n.value = b.target.files, a(n.value);\n }, h.oncancel = () => {\n s();\n }), h;\n }), i = () => {\n n.value = null, l.value && l.value.value && (l.value.value = \"\", a(null));\n }, u = (p) => {\n const h = l.value;\n h && (h.multiple = E(p.multiple), h.accept = E(p.accept), h.webkitdirectory = E(p.directory), zl(p, \"capture\") && (h.capture = E(p.capture)));\n }, c = (p) => {\n const h = l.value;\n if (!h) return;\n const b = {\n ...jl,\n ...e,\n ...p\n };\n u(b), E(b.reset) && i(), h.click();\n };\n return Oe(() => {\n u(e);\n }), {\n files: Rt(n),\n open: c,\n reset: i,\n onCancel: r,\n onChange: o\n };\n}\nfunction Ct(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst Et = /* @__PURE__ */ new WeakMap();\nfunction Kl(e, t = !1) {\n const n = ie(t);\n let o = \"\";\n oe(ql(e), (s) => {\n const l = Ct(E(s));\n if (l) {\n const i = l;\n if (Et.get(i) || Et.set(i, i.style.overflow), i.style.overflow !== \"hidden\" && (o = i.style.overflow), i.style.overflow === \"hidden\") return n.value = !0;\n if (n.value) return i.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = Ct(E(e));\n !s || n.value || (s.style.overflow = \"hidden\", n.value = !0);\n }, r = () => {\n const s = Ct(E(e));\n !s || !n.value || (s.style.overflow = o, Et.delete(s), n.value = !1);\n };\n return yn(r), $({\n get() {\n return n.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst At = /* @__PURE__ */ new WeakMap(), ea = {\n mounted(e, t) {\n const n = !t.modifiers.bubble;\n let o;\n if (typeof t.value == \"function\") o = Jt(e, t.value, { capture: n });\n else {\n const [a, r] = t.value;\n o = Jt(e, a, Object.assign({ capture: n }, r));\n }\n At.set(e, o);\n },\n unmounted(e) {\n const t = At.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), At.delete(e);\n }\n};\nfunction ta() {\n let e = !1;\n const t = ie(!1);\n return (n, o) => {\n if (t.value = o.value, e) return;\n e = !0;\n const a = Kl(n, o.value);\n oe(t, (r) => a.value = r);\n };\n}\nta();\nconst na = { class: \"input-wrapper\" }, oa = {\n id: \"autocomplete-results\",\n class: \"autocomplete-results\"\n}, la = {\n key: 0,\n class: \"loading autocomplete-result\"\n}, aa = [\"onClick\"], sa = /* @__PURE__ */ te({\n __name: \"ADropdown\",\n props: /* @__PURE__ */ Me({\n label: {},\n items: { default: () => [] },\n isAsync: { type: Boolean, default: !1 },\n filterFunction: { type: Function, default: void 0 }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\"), n = rn({\n activeItemIndex: null,\n open: !1,\n loading: !1,\n results: e.items\n }), o = () => l(), a = async () => {\n if (n.open = !0, n.activeItemIndex = null, e.filterFunction) {\n e.isAsync && (n.loading = !0);\n try {\n const h = await e.filterFunction(t.value || \"\");\n n.results = h || [];\n } catch {\n n.results = [];\n } finally {\n e.isAsync && (n.loading = !1);\n }\n } else\n i();\n }, r = (h) => {\n t.value = h, l(h);\n }, s = () => {\n n.activeItemIndex = e.isAsync ? null : t.value && e.items?.indexOf(t.value) || null, n.open = !0, n.results = e.isAsync ? [] : e.items;\n }, l = (h) => {\n n.activeItemIndex = null, n.open = !1, e.items?.includes(h || t.value || \"\") || (t.value = \"\");\n }, i = () => {\n t.value ? n.results = e.items?.filter((h) => h.toLowerCase().includes((t.value ?? \"\").toLowerCase())) : n.results = e.items;\n }, u = () => {\n const h = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const b = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n n.activeItemIndex = (b + 1) % h;\n } else\n n.activeItemIndex = 0;\n }, c = () => {\n const h = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const b = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n b === 0 ? n.activeItemIndex = null : n.activeItemIndex = b - 1;\n } else\n n.activeItemIndex = h - 1;\n }, p = () => {\n if (n.results) {\n const h = n.activeItemIndex || 0, b = n.results[h];\n r(b);\n }\n n.activeItemIndex = 0;\n };\n return (h, b) => J((w(), k(\"div\", {\n class: ae([\"autocomplete\", { isOpen: n.open }])\n }, [\n y(\"div\", na, [\n J(y(\"input\", {\n \"onUpdate:modelValue\": b[0] || (b[0] = (I) => t.value = I),\n type: \"text\",\n onInput: a,\n onFocus: s,\n onKeydown: [\n Ne(u, [\"down\"]),\n Ne(c, [\"up\"]),\n Ne(p, [\"enter\"]),\n Ne(o, [\"esc\"]),\n Ne(o, [\"tab\"])\n ]\n }, null, 544), [\n [we, t.value]\n ]),\n J(y(\"ul\", oa, [\n n.loading ? (w(), k(\"li\", la, \"Loading results...\")) : (w(!0), k(ue, { key: 1 }, me(n.results, (I, x) => (w(), k(\"li\", {\n key: I,\n class: ae([\"autocomplete-result\", { \"is-active\": x === n.activeItemIndex }]),\n onClick: Ie((f) => r(I), [\"stop\"])\n }, K(I), 11, aa))), 128))\n ], 512), [\n [Ce, n.open]\n ]),\n y(\"label\", null, K(e.label), 1)\n ])\n ], 2)), [\n [V(ea), o]\n ]);\n }\n}), ra = /* @__PURE__ */ $e(sa, [[\"__scopeId\", \"data-v-31a6db8c\"]]);\nfunction In(e, t) {\n return mt() ? (ht(e, t), !0) : !1;\n}\nconst ia = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst ua = (e) => e != null, ca = Object.prototype.toString, da = (e) => ca.call(e) === \"[object Object]\", fa = () => {\n};\nfunction ct(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction va(e, t, n) {\n return oe(e, t, {\n ...n,\n immediate: !0\n });\n}\nconst Ye = ia ? window : void 0;\nfunction ze(e) {\n var t;\n const n = E(e);\n return (t = n?.$el) !== null && t !== void 0 ? t : n;\n}\nfunction et(...e) {\n const t = (o, a, r, s) => (o.addEventListener(a, r, s), () => o.removeEventListener(a, r, s)), n = $(() => {\n const o = ct(E(e[0])).filter((a) => a != null);\n return o.every((a) => typeof a != \"string\") ? o : void 0;\n });\n return va(() => {\n var o, a;\n return [\n (o = (a = n.value) === null || a === void 0 ? void 0 : a.map((r) => ze(r))) !== null && o !== void 0 ? o : [Ye].filter((r) => r != null),\n ct(E(n.value ? e[1] : e[0])),\n ct(V(n.value ? e[2] : e[1])),\n E(n.value ? e[3] : e[2])\n ];\n }, ([o, a, r, s], l, i) => {\n if (!o?.length || !a?.length || !r?.length) return;\n const u = da(s) ? { ...s } : s, c = o.flatMap((p) => a.flatMap((h) => r.map((b) => t(p, h, b, u))));\n i(() => {\n c.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction pa() {\n const e = ie(!1), t = gt();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction ma(e) {\n const t = /* @__PURE__ */ pa();\n return $(() => (t.value, !!e()));\n}\nfunction ha(e, t, n = {}) {\n const { window: o = Ye, ...a } = n;\n let r;\n const s = /* @__PURE__ */ ma(() => o && \"MutationObserver\" in o), l = () => {\n r && (r.disconnect(), r = void 0);\n }, i = oe($(() => {\n const p = ct(E(e)).map(ze).filter(ua);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((h) => r.observe(h, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), u = () => r?.takeRecords(), c = () => {\n i(), l();\n };\n return In(c), {\n isSupported: s,\n stop: c,\n takeRecords: u\n };\n}\nfunction ga(e, t, n = {}) {\n const { window: o = Ye, document: a = o?.document, flush: r = \"sync\" } = n;\n if (!o || !a) return fa;\n let s;\n const l = (c) => {\n s?.(), s = c;\n }, i = Oe(() => {\n const c = ze(e);\n if (c) {\n const { stop: p } = ha(a, (h) => {\n h.map((b) => [...b.removedNodes]).flat().some((b) => b === c || b.contains(c)) && t(h);\n }, {\n window: o,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), u = () => {\n i(), l();\n };\n return In(u), u;\n}\n// @__NO_SIDE_EFFECTS__\nfunction wa(e = {}) {\n var t;\n const { window: n = Ye, deep: o = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : n?.document, s = () => {\n let u = r?.activeElement;\n if (o)\n for (var c; u?.shadowRoot; ) u = u == null || (c = u.shadowRoot) === null || c === void 0 ? void 0 : c.activeElement;\n return u;\n }, l = ie(), i = () => {\n l.value = s();\n };\n if (n) {\n const u = {\n capture: !0,\n passive: !0\n };\n et(n, \"blur\", (c) => {\n c.relatedTarget === null && i();\n }, u), et(n, \"focus\", i, u);\n }\n return a && ga(l, i, { document: r }), i(), l;\n}\nconst ya = \"focusin\", xa = \"focusout\", ba = \":focus-within\";\nfunction Ia(e, t = {}) {\n const { window: n = Ye } = t, o = $(() => ze(e)), a = ie(!1), r = $(() => a.value);\n if (!n || !(/* @__PURE__ */ wa(t)).value) return { focused: r };\n const s = { passive: !0 };\n return et(o, ya, () => a.value = !0, s), et(o, xa, () => {\n var l, i, u;\n return a.value = (l = (i = o.value) === null || i === void 0 || (u = i.matches) === null || u === void 0 ? void 0 : u.call(i, ba)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction ka(e, { window: t = Ye, scrollTarget: n } = {}) {\n const o = L(!1), a = () => {\n if (!t) return;\n const r = t.document, s = ze(e);\n if (!s)\n o.value = !1;\n else {\n const l = s.getBoundingClientRect();\n o.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return oe(\n () => ze(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && et(n || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), o;\n}\nconst De = (e) => {\n let t = ka(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, Se = (e) => e.tabIndex >= 0, Qt = (e) => {\n const t = e.target;\n return Bt(t);\n}, Bt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.previousElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.previousElementSibling;\n n && (t = n);\n }\n return t && (!Se(t) || !De(t)) ? Bt(t) : t;\n}, Ma = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.firstElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.firstElementChild;\n a && (n = a);\n }\n }\n return n && (!Se(n) || !De(n)) ? Ft(n) : n;\n}, Kt = (e) => {\n const t = e.target;\n return Ft(t);\n}, Ft = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const n = e.parentElement?.nextElementSibling;\n if (n) {\n const o = Array.from(n.children)[e.cellIndex];\n o && (t = o);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const n = e.nextElementSibling;\n n && (t = n);\n }\n return t && (!Se(t) || !De(t)) ? Ft(t) : t;\n}, Ca = (e) => {\n const t = e.target;\n let n;\n if (t instanceof HTMLTableCellElement) {\n const o = t.parentElement?.parentElement;\n if (o) {\n const a = o.lastElementChild?.children[t.cellIndex];\n a && (n = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const o = t.parentElement;\n if (o) {\n const a = o.lastElementChild;\n a && (n = a);\n }\n }\n return n && (!Se(n) || !De(n)) ? Bt(n) : n;\n}, en = (e) => {\n const t = e.target;\n return Zt(t);\n}, Zt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, tn = (e) => {\n const t = e.target;\n return Nt(t);\n}, Nt = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, nn = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, on = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, st = [\"alt\", \"control\", \"shift\", \"meta\"], Ea = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, kn = {\n \"keydown.up\": (e) => {\n const t = Qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Kt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = en(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = tn(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = Ma(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Ca(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Kt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Qt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = tn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = en(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Aa(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, n = (s) => {\n const l = t(s);\n let i = [];\n if (typeof s.selectors == \"string\")\n i = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const u of s.selectors)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else if (s.selectors instanceof HTMLElement)\n i.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const u of s.selectors.value)\n u instanceof HTMLElement ? i.push(u) : i.push(u.$el);\n else\n i.push(s.selectors.value);\n return i;\n }, o = (s) => {\n const l = t(s);\n let i = [];\n return s.selectors ? i = n(s) : l && (i = Array.from(l.children).filter((u) => Se(u) && De(u))), i;\n }, a = (s) => (l) => {\n const i = Ea[l.key] || l.key.toLowerCase();\n if (st.includes(i)) return;\n const u = s.handlers || kn;\n for (const c of Object.keys(u)) {\n const [p, ...h] = c.split(\".\");\n if (p === \"keydown\" && h.includes(i)) {\n const b = u[c], I = h.filter((f) => st.includes(f)), x = st.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (I.length > 0) {\n if (x) {\n for (const f of st)\n if (h.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && b(l);\n }\n }\n } else\n x || b(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), i = o(s), u = a(s), c = l ? [l] : i;\n for (const p of c) {\n const { focused: h } = Ia(L(p)), b = oe(h, (I) => {\n I ? p.addEventListener(\"keydown\", u) : p.removeEventListener(\"keydown\", u);\n });\n r.push(b);\n }\n }\n }), sn(() => {\n for (const s of r)\n s();\n });\n}\nconst Ta = {\n ref: \"datepicker\",\n class: \"adatepicker\",\n tabindex: \"0\"\n}, $a = {\n colspan: \"5\",\n tabindex: -1\n}, Da = [\"onClick\", \"onKeydown\"], Sa = 6, ln = 7, Ra = /* @__PURE__ */ te({\n __name: \"ADatePicker\",\n props: {\n modelValue: { default: /* @__PURE__ */ new Date() },\n modelModifiers: {}\n },\n emits: [\"update:modelValue\"],\n setup(e, { expose: t }) {\n const n = ke(e, \"modelValue\"), o = L(new Date(n.value)), a = L(o.value.getMonth()), r = L(o.value.getFullYear()), s = L([]), l = fe(\"datepicker\");\n Ee(async () => {\n i(), await pt();\n const C = document.getElementsByClassName(\"selectedDate\");\n if (C.length > 0)\n C[0].focus();\n else {\n const T = document.getElementsByClassName(\"todaysDate\");\n T.length > 0 && T[0].focus();\n }\n });\n const i = () => {\n s.value = [];\n const C = new Date(r.value, a.value, 1), T = C.getDay(), R = C.setDate(C.getDate() - T);\n for (const S of Array(43).keys())\n s.value.push(R + S * 864e5);\n };\n oe([a, r], i);\n const u = () => r.value -= 1, c = () => r.value += 1, p = () => {\n a.value == 0 ? (a.value = 11, u()) : a.value -= 1;\n }, h = () => {\n a.value == 11 ? (a.value = 0, c()) : a.value += 1;\n }, b = (C) => {\n const T = /* @__PURE__ */ new Date();\n if (a.value === T.getMonth())\n return T.toDateString() === new Date(C).toDateString();\n }, I = (C) => new Date(C).toDateString() === new Date(o.value).toDateString(), x = (C, T) => (C - 1) * ln + T, f = (C, T) => s.value[x(C, T)], m = (C) => {\n n.value = o.value = new Date(s.value[C]);\n }, g = $(() => new Date(r.value, a.value, 1).toLocaleDateString(void 0, {\n year: \"numeric\",\n month: \"long\"\n }));\n return Aa([\n {\n parent: l,\n selectors: \"td\",\n handlers: {\n ...kn,\n \"keydown.pageup\": p,\n \"keydown.shift.pageup\": u,\n \"keydown.pagedown\": h,\n \"keydown.shift.pagedown\": c,\n // TODO: this is a hack to override the stonecrop enter handler;\n // store context inside the component so that handlers can be setup consistently\n \"keydown.enter\": () => {\n }\n }\n }\n ]), t({ currentMonth: a, currentYear: r, selectedDate: o }), (C, T) => (w(), k(\"div\", Ta, [\n y(\"table\", null, [\n y(\"tbody\", null, [\n y(\"tr\", null, [\n y(\"td\", {\n id: \"previous-month-btn\",\n tabindex: -1,\n onClick: p\n }, \"<\"),\n y(\"th\", $a, K(g.value), 1),\n y(\"td\", {\n id: \"next-month-btn\",\n tabindex: -1,\n onClick: h\n }, \">\")\n ]),\n T[0] || (T[0] = y(\"tr\", { class: \"days-header\" }, [\n y(\"td\", null, \"M\"),\n y(\"td\", null, \"T\"),\n y(\"td\", null, \"W\"),\n y(\"td\", null, \"T\"),\n y(\"td\", null, \"F\"),\n y(\"td\", null, \"S\"),\n y(\"td\", null, \"S\")\n ], -1)),\n (w(), k(ue, null, me(Sa, (R) => y(\"tr\", { key: R }, [\n (w(), k(ue, null, me(ln, (S) => y(\"td\", {\n ref_for: !0,\n ref: \"celldate\",\n key: x(R, S),\n contenteditable: !1,\n spellcheck: !1,\n tabindex: 0,\n class: ae({\n todaysDate: b(f(R, S)),\n selectedDate: I(f(R, S))\n }),\n onClick: Ie((_) => m(x(R, S)), [\"prevent\", \"stop\"]),\n onKeydown: Ne((_) => m(x(R, S)), [\"enter\"])\n }, K(new Date(f(R, S)).getDate()), 43, Da)), 64))\n ])), 64))\n ])\n ])\n ], 512));\n }\n}), La = /* @__PURE__ */ $e(Ra, [[\"__scopeId\", \"data-v-056d2b5e\"]]), Ha = /* @__PURE__ */ te({\n __name: \"CollapseButton\",\n props: {\n collapsed: { type: Boolean }\n },\n setup(e) {\n return (t, n) => (w(), k(\"button\", {\n class: ae([\"collapse-button\", e.collapsed ? \"rotated\" : \"unrotated\"])\n }, \"×\", 2));\n }\n}), Va = /* @__PURE__ */ $e(Ha, [[\"__scopeId\", \"data-v-6f1c1b45\"]]), Pa = { class: \"aform\" }, Oa = {\n key: 0,\n class: \"aform-nested-section\"\n}, _a = {\n key: 0,\n class: \"aform-nested-label\"\n}, Ba = /* @__PURE__ */ te({\n __name: \"AForm\",\n props: /* @__PURE__ */ Me({\n schema: {},\n readOnly: { type: Boolean }\n }, {\n data: { required: !0 },\n dataModifiers: {}\n }),\n emits: /* @__PURE__ */ Me([\"update:schema\", \"update:data\"], [\"update:data\"]),\n setup(e, { emit: t }) {\n const n = t, o = ke(e, \"data\"), a = L({});\n Oe(() => {\n !e.schema || !o.value || e.schema.forEach((i) => {\n \"schema\" in i && Array.isArray(i.schema) && i.schema.length > 0 && (!a.value[i.fieldname] && o.value[i.fieldname] ? a.value[i.fieldname] = o.value[i.fieldname] : a.value[i.fieldname] || (a.value[i.fieldname] = {}));\n });\n }), Oe(() => {\n Object.keys(a.value).forEach((i) => {\n o.value && a.value[i] !== o.value[i] && (o.value[i] = a.value[i], n(\"update:data\", o.value));\n });\n }), Oe(() => {\n o.value && e.schema && e.schema.forEach((i) => {\n i.fieldname && o.value[i.fieldname] !== void 0 && (i.value = o.value[i.fieldname]);\n });\n });\n const r = (i) => {\n const u = {};\n for (const [c, p] of Object.entries(i))\n [\"component\", \"fieldtype\"].includes(c) || (u[c] = p), c === \"rows\" && (!p || Array.isArray(p) && p.length === 0) && (u.rows = o.value[i.fieldname] || []);\n return u;\n }, s = L([]);\n Oe(() => {\n e.schema && s.value.length !== e.schema.length && (s.value = e.schema.map((i, u) => $({\n get() {\n return i.value;\n },\n set: (c) => {\n const p = e.schema[u].fieldname;\n e.schema[u].value = c, p && o.value && (o.value[p] = c, n(\"update:data\", o.value)), n(\"update:schema\", e.schema);\n }\n })));\n });\n const l = $(() => s.value);\n return (i, u) => {\n const c = dn(\"AForm\", !0);\n return w(), k(\"form\", Pa, [\n (w(!0), k(ue, null, me(e.schema, (p, h) => (w(), k(ue, { key: h }, [\n \"schema\" in p && Array.isArray(p.schema) && p.schema.length > 0 ? (w(), k(\"div\", Oa, [\n p.label ? (w(), k(\"h4\", _a, K(p.label), 1)) : q(\"\", !0),\n dt(c, {\n data: a.value[p.fieldname],\n \"onUpdate:data\": (b) => a.value[p.fieldname] = b,\n schema: p.schema,\n \"read-only\": e.readOnly || p.readOnly\n }, null, 8, [\"data\", \"onUpdate:data\", \"schema\", \"read-only\"])\n ])) : (w(), pe(We(p.component), vt({\n key: 1,\n modelValue: l.value[h].value,\n \"onUpdate:modelValue\": (b) => l.value[h].value = b,\n schema: p,\n data: o.value[p.fieldname],\n \"read-only\": e.readOnly\n }, { ref_for: !0 }, r(p)), null, 16, [\"modelValue\", \"onUpdate:modelValue\", \"schema\", \"data\", \"read-only\"]))\n ], 64))), 128))\n ]);\n };\n }\n}), Mn = /* @__PURE__ */ $e(Ba, [[\"__scopeId\", \"data-v-06e17c5b\"]]), Fa = /* @__PURE__ */ te({\n __name: \"AFieldset\",\n props: {\n schema: {},\n label: {},\n collapsible: { type: Boolean },\n data: { default: () => ({}) }\n },\n setup(e, { expose: t }) {\n const n = L(!1), o = L(e.data || []), a = L(e.schema), r = (s) => {\n s.preventDefault(), e.collapsible && (n.value = !n.value);\n };\n return t({ collapsed: n }), (s, l) => (w(), k(\"fieldset\", null, [\n y(\"legend\", {\n onClick: r,\n onSubmit: r\n }, [\n Dt(K(e.label) + \" \", 1),\n e.collapsible ? (w(), pe(Va, {\n key: 0,\n collapsed: n.value\n }, null, 8, [\"collapsed\"])) : q(\"\", !0)\n ], 32),\n he(s.$slots, \"default\", { collapsed: n.value }, () => [\n J(dt(Mn, {\n schema: a.value,\n data: o.value,\n \"onUpdate:data\": l[0] || (l[0] = (i) => o.value = i)\n }, null, 8, [\"schema\", \"data\"]), [\n [Ce, !n.value]\n ])\n ], !0)\n ]));\n }\n}), Za = /* @__PURE__ */ $e(Fa, [[\"__scopeId\", \"data-v-18fd6c61\"]]), Na = { class: \"aform_form-element aform_file-attach aform__grid--full\" }, Ua = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, Wa = [\"disabled\"], Ga = /* @__PURE__ */ te({\n __name: \"AFileAttach\",\n props: {\n label: {}\n },\n setup(e) {\n const { files: t, open: n, reset: o, onChange: a } = Ql(), r = $(() => `${t.value.length} ${t.value.length === 1 ? \"file\" : \"files\"}`);\n return a((s) => s), (s, l) => (w(), k(\"div\", Na, [\n V(t) ? (w(), k(\"div\", Ua, [\n y(\"p\", null, [\n l[2] || (l[2] = Dt(\" You have selected: \", -1)),\n y(\"b\", null, K(r.value), 1)\n ]),\n (w(!0), k(ue, null, me(V(t), (i) => (w(), k(\"li\", {\n key: i.name\n }, K(i.name), 1))), 128))\n ])) : q(\"\", !0),\n y(\"button\", {\n type: \"button\",\n class: \"aform_form-btn\",\n onClick: l[0] || (l[0] = (i) => V(n)())\n }, K(e.label), 1),\n y(\"button\", {\n type: \"button\",\n disabled: !V(t),\n class: \"aform_form-btn\",\n onClick: l[1] || (l[1] = (i) => V(o)())\n }, \"Reset\", 8, Wa)\n ]));\n }\n}), za = /* @__PURE__ */ $e(Ga, [[\"__scopeId\", \"data-v-b700734f\"]]), qa = { class: \"aform_form-element\" }, Ya = [\"id\", \"disabled\", \"required\"], Xa = [\"for\"], ja = [\"innerHTML\"], Ja = /* @__PURE__ */ te({\n __name: \"ANumericInput\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = ke(e, \"modelValue\");\n return (n, o) => (w(), k(\"div\", qa, [\n J(y(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": o[0] || (o[0] = (a) => t.value = a),\n class: \"aform_input-field\",\n type: \"number\",\n disabled: e.readOnly,\n required: e.required\n }, null, 8, Ya), [\n [we, t.value]\n ]),\n y(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, K(e.label), 9, Xa),\n J(y(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, ja), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), an = {\n date: \"##/##/####\",\n datetime: \"####/##/## ##:##\",\n time: \"##:##\",\n fulltime: \"##:##:##\",\n phone: \"(###) ### - ####\",\n card: \"#### #### #### ####\"\n};\nfunction Qa(e) {\n try {\n return Function(`\"use strict\";return (${e})`)();\n } catch {\n }\n}\nfunction Ka(e) {\n let t = e.value;\n if (t) {\n const n = Qa(t);\n if (n) {\n const o = e.instance?.locale;\n t = n(o);\n }\n } else {\n const o = e.instance?.schema?.fieldtype?.toLowerCase();\n o && an[o] && (t = an[o]);\n }\n return t;\n}\nfunction es(e, t) {\n let n = e;\n const o = [t, \"/\", \"-\", \"(\", \")\", \" \"];\n for (const a of o)\n n = n.replaceAll(a, \"\");\n return n;\n}\nfunction ts(e, t, n) {\n let o = t;\n for (const a of e) {\n const r = o.indexOf(n);\n if (r !== -1) {\n const s = o.substring(0, r), l = o.substring(r + 1);\n o = s + a + l;\n }\n }\n return o.slice(0, t.length);\n}\nfunction ns(e, t) {\n const n = Ka(t);\n if (!n) return;\n const o = \"#\", a = e.value, r = es(a, o);\n if (r) {\n const s = ts(r, n, o);\n t.instance?.maskFilled && (t.instance.maskFilled = !s.includes(o)), e.value = s;\n } else\n e.value = n;\n}\nconst os = { class: \"aform_form-element\" }, ls = [\"id\", \"disabled\", \"maxlength\", \"required\"], as = [\"for\"], ss = [\"innerHTML\"], rs = /* @__PURE__ */ te({\n __name: \"ATextInput\",\n props: /* @__PURE__ */ Me({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n readOnly: { type: Boolean },\n uuid: {},\n validation: { default: () => ({ errorMessage: \"&nbsp;\" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = L(!0), n = ke(e, \"modelValue\");\n return (o, a) => (w(), k(\"div\", os, [\n J(y(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": a[0] || (a[0] = (r) => n.value = r),\n class: \"aform_input-field\",\n disabled: e.readOnly,\n maxlength: e.mask && t.value ? e.mask.length : void 0,\n required: e.required\n }, null, 8, ls), [\n [we, n.value],\n [V(ns), e.mask]\n ]),\n y(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, K(e.label), 9, as),\n J(y(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, ss), [\n [Ce, e.validation.errorMessage]\n ])\n ]));\n }\n}), is = { class: \"login-container\" }, us = { class: \"account-container\" }, cs = { class: \"account-header\" }, ds = { id: \"account-title\" }, fs = { id: \"account-subtitle\" }, vs = { class: \"login-form-container\" }, ps = { class: \"login-form-email aform_form-element\" }, ms = [\"disabled\"], hs = { class: \"login-form-password aform_form-element\" }, gs = [\"disabled\"], ws = [\"disabled\"], ys = {\n key: 0,\n class: \"material-symbols-outlined loading-icon\"\n}, xs = /* @__PURE__ */ te({\n __name: \"Login\",\n props: {\n headerTitle: { default: \"Login\" },\n headerSubtitle: { default: \"Enter your email and password to login\" }\n },\n emits: [\"loginFailed\", \"loginSuccess\"],\n setup(e, { emit: t }) {\n const n = t, o = L(\"\"), a = L(\"\"), r = L(!1), s = L(!1);\n function l(i) {\n if (i.preventDefault(), r.value = !0, s.value) {\n r.value = !1, n(\"loginFailed\");\n return;\n }\n r.value = !1, n(\"loginSuccess\");\n }\n return (i, u) => (w(), k(\"div\", is, [\n y(\"div\", null, [\n y(\"div\", us, [\n y(\"div\", cs, [\n y(\"h1\", ds, K(e.headerTitle), 1),\n y(\"p\", fs, K(e.headerSubtitle), 1)\n ]),\n y(\"form\", { onSubmit: l }, [\n y(\"div\", vs, [\n y(\"div\", ps, [\n u[2] || (u[2] = y(\"label\", {\n id: \"login-email\",\n for: \"email\",\n class: \"aform_field-label\"\n }, \"Email\", -1)),\n J(y(\"input\", {\n id: \"email\",\n \"onUpdate:modelValue\": u[0] || (u[0] = (c) => o.value = c),\n class: \"aform_input-field\",\n name: \"email\",\n placeholder: \"name@example.com\",\n type: \"email\",\n \"auto-capitalize\": \"none\",\n \"auto-complete\": \"email\",\n \"auto-correct\": \"off\",\n disabled: r.value\n }, null, 8, ms), [\n [we, o.value]\n ])\n ]),\n y(\"div\", hs, [\n u[3] || (u[3] = y(\"label\", {\n id: \"login-password\",\n for: \"password\",\n class: \"aform_field-label\"\n }, \"Password\", -1)),\n J(y(\"input\", {\n id: \"password\",\n \"onUpdate:modelValue\": u[1] || (u[1] = (c) => a.value = c),\n class: \"aform_input-field\",\n name: \"password\",\n type: \"password\",\n disabled: r.value\n }, null, 8, gs), [\n [we, a.value]\n ])\n ]),\n y(\"button\", {\n class: \"btn\",\n disabled: r.value || !o.value || !a.value,\n onClick: l\n }, [\n r.value ? (w(), k(\"span\", ys, \"progress_activity\")) : q(\"\", !0),\n u[4] || (u[4] = y(\"span\", { id: \"login-form-button\" }, \"Login\", -1))\n ], 8, ws)\n ])\n ], 32),\n u[5] || (u[5] = y(\"button\", { class: \"btn\" }, [\n y(\"span\", { id: \"forgot-password-button\" }, \"Forgot password?\")\n ], -1))\n ])\n ])\n ]));\n }\n}), ks = /* @__PURE__ */ $e(xs, [[\"__scopeId\", \"data-v-d9ffd0a7\"]]);\nfunction Ms(e) {\n e.use(Dl), e.component(\"ACheckbox\", Ol), e.component(\"ACombobox\", _l), e.component(\"ADate\", Ul), e.component(\"ADropdown\", ra), e.component(\"ADatePicker\", La), e.component(\"AFieldset\", Za), e.component(\"AFileAttach\", za), e.component(\"AForm\", Mn), e.component(\"ANumericInput\", Ja), e.component(\"ATextInput\", rs);\n}\nexport {\n Ol as ACheckbox,\n _l as AComboBox,\n Ul as ADate,\n La as ADatePicker,\n ra as ADropdown,\n Za as AFieldset,\n za as AFileAttach,\n Mn as AForm,\n Ja as ANumericInput,\n rs as ATextInput,\n ks as Login,\n Ms as install\n};\n//# sourceMappingURL=aform.js.map\n","<template>\n\t<footer>\n\t\t<ul class=\"tabs\">\n\t\t\t<li class=\"hidebreadcrumbs\" @click=\"toggleBreadcrumbs\" @keydown.enter=\"toggleBreadcrumbs\">\n\t\t\t\t<a tabindex=\"0\"><div :class=\"rotateHideTabIcon\">×</div></a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tclass=\"hometab\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\"\n\t\t\t\t@click=\"navigateHome\"\n\t\t\t\t@keydown.enter=\"navigateHome\">\n\t\t\t\t<router-link to=\"/\" tabindex=\"0\">\n\t\t\t\t\t<svg class=\"icon\" aria-label=\"Home\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n\t\t\t\t\t\t<path d=\"M3 12l9-9 9 9\" />\n\t\t\t\t\t\t<path d=\"M9 21V12h6v9\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</router-link>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\t:class=\"['searchtab', { 'search-active': searchVisible }]\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<a tabindex=\"0\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tv-show=\"!searchVisible\"\n\t\t\t\t\t\tclass=\"icon search-icon\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Search\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t@click=\"toggleSearch\"\n\t\t\t\t\t\t@keydown.enter=\"toggleSearch\">\n\t\t\t\t\t\t<circle cx=\"11\" cy=\"11\" r=\"7\" />\n\t\t\t\t\t\t<path d=\"M21 21l-4.35-4.35\" />\n\t\t\t\t\t</svg>\n\t\t\t\t\t<input\n\t\t\t\t\t\tv-show=\"searchVisible\"\n\t\t\t\t\t\tref=\"searchinput\"\n\t\t\t\t\t\tv-model=\"searchText\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t\t\t@click.stop\n\t\t\t\t\t\t@input=\"handleSearchInput($event)\"\n\t\t\t\t\t\t@blur=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.escape=\"toggleSearch\" />\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tv-for=\"breadcrumb in breadcrumbs\"\n\t\t\t\t:key=\"breadcrumb.title\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<router-link tabindex=\"0\" :to=\"breadcrumb.to\"> {{ breadcrumb.title }} </router-link>\n\t\t\t</li>\n\t\t</ul>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nconst { breadcrumbs = [] } = defineProps<{ breadcrumbs?: { title: string; to: string }[] }>()\n\nconst breadcrumbsVisibile = ref(true)\nconst searchVisible = ref(false)\nconst searchText = ref('')\nconst inputRef = useTemplateRef<HTMLInputElement>('searchinput')\n\nconst rotateHideTabIcon = computed(() => {\n\treturn breadcrumbsVisibile.value ? 'unrotated' : 'rotated'\n})\n\nconst toggleBreadcrumbs = () => {\n\tbreadcrumbsVisibile.value = !breadcrumbsVisibile.value\n}\n\nconst toggleSearch = async () => {\n\tsearchVisible.value = !searchVisible.value\n\tawait nextTick(() => {\n\t\tinputRef.value?.focus()\n\t})\n}\n\nconst handleSearchInput = (event: Event | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n}\n\nconst handleSearch = async (event: FocusEvent | KeyboardEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tawait toggleSearch()\n}\n\nconst navigateHome = (/* event: MouseEvent | KeyboardEvent */) => {\n\t// navigate home\n}\n</script>\n\n<style scoped>\nfooter {\n\tposition: fixed;\n\tbottom: 0px;\n\twidth: 100%;\n\tbackground-color: transparent;\n\theight: auto;\n\tmin-height: 2.4rem;\n\tz-index: 100;\n\ttext-align: left;\n\tfont-size: 100%;\n\tdisplay: flex;\n\tjustify-content: right;\n\tpadding: 0 0.75rem 0 0;\n\tbox-sizing: border-box;\n}\nul {\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.tabs li {\n\tfloat: left;\n\tlist-style-type: none;\n\tposition: relative;\n\tmargin-left: -1px;\n}\n\n/* Base tab styling */\n.tabs a {\n\tfloat: left;\n\tpadding: 0.5rem 1rem;\n\theight: 2.4rem;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttext-decoration: none;\n\tcolor: var(--sc-gray-60, #666);\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tfont-size: 0.85rem;\n\tfont-family: var(--sc-font-family, system-ui, sans-serif);\n\ttransition: all 0.15s ease;\n\n\t/* Minimal ornamentation - subtle top radius only */\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n}\n\n.tabs a:hover {\n\tbackground: var(--sc-btn-hover, #f2f2f2);\n}\n\n.tabs .router-link-active {\n\tz-index: 3;\n\tbackground: var(--sc-primary-color, #827553) !important;\n\tborder-color: var(--sc-primary-color, #827553) !important;\n\tcolor: var(--sc-primary-text-color, #fff) !important;\n}\n\n/* Pseudo-elements removed - minimal ornamentation style */\n\n/* Hide breadcrumbs tab */\n.hidebreadcrumbs a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n.hidebreadcrumbs a div {\n\tfont-size: 1.2rem;\n}\n\n.rotated {\n\ttransform: rotate(45deg);\n\t-webkit-transform: rotate(45deg);\n\t-moz-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\t-o-transform: rotate(45deg);\n\ttransition: transform 250ms ease;\n}\n.unrotated {\n\ttransform: rotate(0deg);\n\t-webkit-transform: rotate(0deg);\n\t-moz-transform: rotate(0deg);\n\t-ms-transform: rotate(0deg);\n\t-o-transform: rotate(0deg);\n\ttransition: transform 250ms ease;\n}\n\nli:active,\nli:hover,\nli:focus,\nli > a:active,\nli > a:hover,\nli > a:focus {\n\tz-index: 3;\n}\n\na:active,\na:hover,\na:focus {\n\toutline: 2px solid var(--sc-input-active-border-color, black);\n\tz-index: 3;\n}\n\n/* Home tab */\n.hometab a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n/* SVG icon styling */\n.icon {\n\twidth: 1rem;\n\theight: 1rem;\n\tstroke: currentColor;\n\tflex-shrink: 0;\n}\n\n/* Search tab with animation */\n.searchtab {\n\toverflow: hidden;\n}\n\n.searchtab a {\n\tmin-width: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n\toverflow: hidden;\n\t/* Animation for smooth expand/collapse */\n\tmax-width: 2.4rem;\n\ttransition: max-width 0.35s ease-in-out, padding 0.35s ease-in-out, background 0.2s ease;\n}\n\n.searchtab .search-icon {\n\tcursor: pointer;\n}\n\n.searchtab input {\n\toutline: none;\n\tborder: 1px solid var(--sc-input-border-color, #ccc);\n\tborder-radius: 0.25rem;\n\tbackground-color: var(--sc-form-background, #ffffff);\n\tcolor: var(--sc-gray-80, #333);\n\ttext-align: left;\n\tfont-size: 0.875rem;\n\tpadding: 0.25rem 0.5rem;\n\twidth: 180px;\n\theight: 1.5rem;\n\tflex-shrink: 0;\n\topacity: 0;\n\ttransition: opacity 0.2s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.searchtab input:focus {\n\tborder-color: var(--sc-input-active-border-color, #4f46e5);\n\toutline: none;\n}\n\n.searchtab input::placeholder {\n\tcolor: var(--sc-input-label-color, #999);\n}\n\n/* Search active state - expanded with animation */\n.searchtab.search-active a {\n\tmax-width: 200px;\n\tmin-width: auto;\n\twidth: auto;\n\tpadding: 0.5rem 0.75rem;\n}\n\n.searchtab.search-active input {\n\topacity: 1;\n\ttransition-delay: 0.15s;\n}\n</style>\n","<template>\n\t<div class=\"desktop\" @click=\"handleClick\">\n\t\t<!-- Action Set -->\n\t\t<ActionSet :elements=\"actionElements\" @action-click=\"handleActionClick\" />\n\n\t\t<!-- Main content using AForm -->\n\t\t<AForm v-if=\"writableSchema.length > 0\" v-model=\"writableSchema\" :data=\"currentViewData\" />\n\t\t<div v-else-if=\"!stonecrop\" class=\"loading\"><p>Initializing Stonecrop...</p></div>\n\t\t<div v-else class=\"loading\">\n\t\t\t<p>Loading {{ currentView }} data...</p>\n\t\t</div>\n\n\t\t<!-- Sheet Navigation -->\n\t\t<SheetNav :breadcrumbs=\"navigationBreadcrumbs\" />\n\n\t\t<!-- Command Palette -->\n\t\t<CommandPalette\n\t\t\t:is-open=\"commandPaletteOpen\"\n\t\t\t:search=\"searchCommands\"\n\t\t\tplaceholder=\"Type a command or search...\"\n\t\t\t@select=\"executeCommand\"\n\t\t\t@close=\"commandPaletteOpen = false\">\n\t\t\t<template #title=\"{ result }\">\n\t\t\t\t{{ result.title }}\n\t\t\t</template>\n\t\t\t<template #content=\"{ result }\">\n\t\t\t\t{{ result.description }}\n\t\t\t</template>\n\t\t</CommandPalette>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { useStonecrop } from '@stonecrop/stonecrop'\nimport { AForm, type SchemaTypes, type TableColumn, type TableConfig } from '@stonecrop/aform'\nimport { computed, nextTick, onMounted, provide, ref, unref, watch } from 'vue'\n\nimport ActionSet from './ActionSet.vue'\nimport SheetNav from './SheetNav.vue'\nimport CommandPalette from './CommandPalette.vue'\nimport type { ActionElements } from '../types'\n\nconst { availableDoctypes = [] } = defineProps<{ availableDoctypes?: string[] }>()\n\nconst { stonecrop } = useStonecrop()\n\n// State\nconst loading = ref(false)\nconst saving = ref(false)\nconst commandPaletteOpen = ref(false)\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed property that reads from HST store for reactive form data\nconst currentViewData = computed<Record<string, any>>({\n\tget() {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn {}\n\t\t}\n\n\t\ttry {\n\t\t\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\treturn record?.get('') || {}\n\t\t} catch {\n\t\t\treturn {}\n\t\t}\n\t},\n\tset(newData: Record<string, any>) {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\t// Update each field in HST, which will automatically trigger field actions\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\t\t\tfor (const [fieldname, value] of Object.entries(newData)) {\n\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${fieldname}`\n\t\t\t\thstStore.set(fieldPath, value)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST update failed:', error)\n\t\t}\n\t},\n})\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed properties for current route context\nconst route = computed(() => unref(stonecrop.value?.registry.router?.currentRoute))\nconst router = computed(() => stonecrop.value?.registry.router)\nconst currentDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// First check if we have actualDoctype in meta (from registered routes)\n\tif (route.value.meta?.actualDoctype) {\n\t\treturn route.value.meta.actualDoctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\n// The route doctype for display and navigation (e.g., 'todo')\nconst routeDoctype = computed(() => {\n\tif (!route.value) return ''\n\n\t// Check route meta first\n\tif (route.value.meta?.doctype) {\n\t\treturn route.value.meta.doctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\nconst currentRecordId = computed(() => {\n\tif (!route.value) return ''\n\n\t// For named routes, use params.recordId\n\tif (route.value.params.recordId) {\n\t\treturn route.value.params.recordId as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 1) {\n\t\treturn pathMatch[1]\n\t}\n\n\treturn ''\n})\nconst isNewRecord = computed(() => currentRecordId.value?.startsWith('new-'))\n\n// Determine current view based on route\nconst currentView = computed(() => {\n\tif (!route.value) {\n\t\treturn 'doctypes'\n\t}\n\n\t// Home route\n\tif (route.value.name === 'home' || route.value.path === '/') {\n\t\treturn 'doctypes'\n\t}\n\n\t// Named routes from registered doctypes\n\tif (route.value.name && route.value.name !== 'catch-all') {\n\t\tconst routeName = route.value.name as string\n\t\tif (routeName.includes('form') || route.value.params.recordId) {\n\t\t\treturn 'record'\n\t\t} else if (routeName.includes('list') || route.value.params.doctype) {\n\t\t\treturn 'records'\n\t\t}\n\t}\n\n\t// Catch-all route - determine from path structure\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\tconst view = pathMatch.length === 1 ? 'records' : 'record'\n\t\treturn view\n\t}\n\n\treturn 'doctypes'\n})\n\n// Computed properties (now that all helper functions are defined)\n// Helper function to get available transitions for current record\nconst getAvailableTransitions = () => {\n\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\treturn []\n\t}\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (!meta?.workflow?.states) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get current FSM state (for now, use workflow initial state or 'editing')\n\t\t// In a full implementation, this would track actual FSM state\n\t\tconst currentState = isNewRecord.value ? 'creating' : 'editing'\n\t\tconst stateConfig = meta.workflow.states[currentState]\n\n\t\tif (!stateConfig?.on) {\n\t\t\treturn []\n\t\t}\n\n\t\t// Get available transitions from current state\n\t\tconst transitions = Object.keys(stateConfig.on)\n\n\t\t// Create action elements for each transition\n\t\tconst actionElements = transitions.map(transition => {\n\t\t\tconst targetState = stateConfig.on?.[transition]\n\t\t\tconst targetStateName = typeof targetState === 'string' ? targetState : 'unknown'\n\n\t\t\tconst actionFn = async () => {\n\t\t\t\tconst node = stonecrop.value?.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\t\tif (node) {\n\t\t\t\t\tconst recordData = currentViewData.value || {}\n\t\t\t\t\tawait node.triggerTransition(transition, {\n\t\t\t\t\t\tcurrentState,\n\t\t\t\t\t\ttargetState: targetStateName,\n\t\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst element = {\n\t\t\t\tlabel: `${transition} (→ ${targetStateName})`,\n\t\t\t\taction: actionFn,\n\t\t\t}\n\n\t\t\treturn element\n\t\t})\n\n\t\treturn actionElements\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error getting available transitions:', error)\n\t\treturn []\n\t}\n}\n\n// New component reactive properties// New component reactive properties\nconst actionElements = computed<ActionElements[]>(() => {\n\tconst elements: ActionElements[] = []\n\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\telements.push({\n\t\t\t\ttype: 'button',\n\t\t\t\tlabel: 'Refresh',\n\t\t\t\taction: () => {\n\t\t\t\t\t// Refresh doctypes\n\t\t\t\t\twindow.location.reload()\n\t\t\t\t},\n\t\t\t})\n\t\t\tbreak\n\t\tcase 'records':\n\t\t\telements.push(\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'New Record',\n\t\t\t\t\taction: () => void createNewRecord(),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tlabel: 'Refresh',\n\t\t\t\t\taction: () => {\n\t\t\t\t\t\t// Refresh records\n\t\t\t\t\t\twindow.location.reload()\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t)\n\t\t\tbreak\n\t\tcase 'record': {\n\t\t\t// Add XState Transitions dropdown for record view\n\t\t\tconst transitionActions = getAvailableTransitions()\n\t\t\tif (transitionActions.length > 0) {\n\t\t\t\telements.push({\n\t\t\t\t\ttype: 'dropdown',\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tactions: transitionActions,\n\t\t\t\t})\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn elements\n})\n\nconst navigationBreadcrumbs = computed(() => {\n\tconst breadcrumbs: { title: string; to: string }[] = []\n\n\tif (currentView.value === 'records' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` }\n\t\t)\n\t} else if (currentView.value === 'record' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` },\n\t\t\t{ title: isNewRecord.value ? 'New Record' : 'Edit Record', to: route.value?.fullPath || '' }\n\t\t)\n\t}\n\n\treturn breadcrumbs\n})\n\n// Command palette functionality\ntype Command = {\n\ttitle: string\n\tdescription: string\n\taction: () => void\n}\n\nconst searchCommands = (query: string): Command[] => {\n\tconst commands: Command[] = [\n\t\t{\n\t\t\ttitle: 'Go Home',\n\t\t\tdescription: 'Navigate to the home page',\n\t\t\taction: () => void router.value?.push('/'),\n\t\t},\n\t\t{\n\t\t\ttitle: 'Toggle Command Palette',\n\t\t\tdescription: 'Open/close the command palette',\n\t\t\taction: () => (commandPaletteOpen.value = !commandPaletteOpen.value),\n\t\t},\n\t]\n\n\t// Add doctype-specific commands\n\tif (routeDoctype.value) {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(routeDoctype.value)} Records`,\n\t\t\tdescription: `Navigate to ${routeDoctype.value} list`,\n\t\t\taction: () => void router.value?.push(`/${routeDoctype.value}`),\n\t\t})\n\n\t\tcommands.push({\n\t\t\ttitle: `Create New ${formatDoctypeName(routeDoctype.value)}`,\n\t\t\tdescription: `Create a new ${routeDoctype.value} record`,\n\t\t\taction: () => void createNewRecord(),\n\t\t})\n\t}\n\n\t// Add available doctypes as commands\n\tavailableDoctypes.forEach(doctype => {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(doctype)}`,\n\t\t\tdescription: `Navigate to ${doctype} list`,\n\t\t\taction: () => void router.value?.push(`/${doctype}`),\n\t\t})\n\t})\n\n\t// Filter commands based on query\n\tif (!query) return commands\n\n\treturn commands.filter(\n\t\tcmd =>\n\t\t\tcmd.title.toLowerCase().includes(query.toLowerCase()) ||\n\t\t\tcmd.description.toLowerCase().includes(query.toLowerCase())\n\t)\n}\n\nconst executeCommand = (command: Command) => {\n\tcommand.action()\n\tcommandPaletteOpen.value = false\n}\n\n// Helper functions - moved here to avoid \"before initialization\" errors\nconst formatDoctypeName = (doctype: string): string => {\n\treturn doctype\n\t\t.split('-')\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(' ')\n}\n\nconst getRecordCount = (doctype: string): number => {\n\tif (!stonecrop.value) return 0\n\tconst recordIds = stonecrop.value.getRecordIds(doctype)\n\treturn recordIds.length\n}\n\nconst navigateToDoctype = async (doctype: string) => {\n\tawait router.value?.push(`/${doctype}`)\n}\n\nconst openRecord = async (recordId: string) => {\n\tawait router.value?.push(`/${routeDoctype.value}/${recordId}`)\n}\n\nconst createNewRecord = async () => {\n\tconst newId = `new-${Date.now()}`\n\tawait router.value?.push(`/${routeDoctype.value}/${newId}`)\n}\n\n// Doctype metadata loader - simplified since router handles most of this\nconst loadDoctypeMetadata = (doctype: string) => {\n\tif (!stonecrop.value) return\n\n\t// Ensure the doctype structure exists in HST\n\t// The router should have already loaded the metadata, but this ensures the HST structure exists\n\ttry {\n\t\tstonecrop.value.records(doctype)\n\t} catch (error) {\n\t\t// Silent error handling - structure will be created if needed\n\t}\n}\n\n// Schema generator functions - moved here to be available to computed properties\nconst getDoctypesSchema = (): SchemaTypes[] => {\n\tif (!availableDoctypes.length) return []\n\n\tconst rows = availableDoctypes.map(doctype => ({\n\t\tid: doctype,\n\t\tdoctype,\n\t\tdisplay_name: formatDoctypeName(doctype),\n\t\trecord_count: getRecordCount(doctype),\n\t\tactions: 'View Records',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<h1>Available Doctypes</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'doctypes_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Doctype',\n\t\t\t\t\tname: 'doctype',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Name',\n\t\t\t\t\tname: 'display_name',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '30ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Records',\n\t\t\t\t\tname: 'record_count',\n\t\t\t\t\tfieldtype: 'Int',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '15ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordsSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\tconst records = getRecords()\n\tconst columns = getColumns()\n\n\t// If no columns are available, show a loading or empty state\n\tif (columns.length === 0) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'loading',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} schema...</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst rows = records.map((record: any) => ({\n\t\t...record,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tid: record.id || '',\n\t\tactions: 'Edit | Delete',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'header',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t<span class=\"current\">${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</span>\n\t\t\t\t\t</nav>\n\t\t\t\t\t<h1>${formatDoctypeName(routeDoctype.value || currentDoctype.value)} Records</h1>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t{\n\t\t\tfieldname: 'actions',\n\t\t\tcomponent: 'div',\n\t\t\tvalue: `\n\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\tNew ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t`,\n\t\t},\n\t\t...(records.length === 0\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'empty_state',\n\t\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\t\tvalue: `\n\t\t\t\t\t\t\t<div class=\"empty-state\">\n\t\t\t\t\t\t\t\t<p>No ${routeDoctype.value || currentDoctype.value} records found.</p>\n\t\t\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"create\">\n\t\t\t\t\t\t\t\t\tCreate First Record\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`,\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfieldname: 'records_table',\n\t\t\t\t\t\tcomponent: 'ATable',\n\t\t\t\t\t\tcolumns: [\n\t\t\t\t\t\t\t...columns.map(col => ({\n\t\t\t\t\t\t\t\tlabel: col.label,\n\t\t\t\t\t\t\t\tname: col.fieldname,\n\t\t\t\t\t\t\t\tfieldtype: col.fieldtype,\n\t\t\t\t\t\t\t\talign: 'left',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\t\t\t\tname: 'actions',\n\t\t\t\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\t\t\t\talign: 'center',\n\t\t\t\t\t\t\t\tedit: false,\n\t\t\t\t\t\t\t\twidth: '20ch',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] as TableColumn[],\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\tview: 'list',\n\t\t\t\t\t\t\tfullWidth: true,\n\t\t\t\t\t\t} as TableConfig,\n\t\t\t\t\t\trows,\n\t\t\t\t\t},\n\t\t\t ]),\n\t]\n}\n\nconst getRecordFormSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value?.registry\n\t\tconst meta = registry?.registry[currentDoctype.value]\n\n\t\tif (!meta?.schema) {\n\t\t\t// Return loading state if schema isn't available yet\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'header',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t\t)}</a>\n\t\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t\t<h1>${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}</h1>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfieldname: 'loading',\n\t\t\t\t\tcomponent: 'div',\n\t\t\t\t\tvalue: `\n\t\t\t\t\t\t<div class=\"loading-state\">\n\t\t\t\t\t\t\t<p>Loading ${formatDoctypeName(routeDoctype.value || currentDoctype.value)} form...</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\tconst currentRecord = getCurrentRecord()\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'header',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-header\">\n\t\t\t\t\t\t<nav class=\"breadcrumbs\">\n\t\t\t\t\t\t\t<a href=\"/\">Home</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<a href=\"/${routeDoctype.value || currentDoctype.value}\">${formatDoctypeName(\n\t\t\t\t\trouteDoctype.value || currentDoctype.value\n\t\t\t\t)}</a>\n\t\t\t\t\t\t\t<span class=\"separator\">/</span>\n\t\t\t\t\t\t\t<span class=\"current\">${isNewRecord.value ? 'New Record' : currentRecordId.value}</span>\n\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t<h1>\n\t\t\t\t\t\t\t${\n\t\t\t\t\t\t\t\tisNewRecord.value\n\t\t\t\t\t\t\t\t\t? `New ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t\t\t: `Edit ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfieldname: 'actions',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"view-actions\">\n\t\t\t\t\t\t<button class=\"btn-primary\" data-action=\"save\" ${saving.value ? 'disabled' : ''}>\n\t\t\t\t\t\t\t${saving.value ? 'Saving...' : 'Save'}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<button class=\"btn-secondary\" data-action=\"cancel\">Cancel</button>\n\t\t\t\t\t\t${!isNewRecord.value ? '<button class=\"btn-danger\" data-action=\"delete\">Delete</button>' : ''}\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t\t...schemaArray.map(field => ({\n\t\t\t\t...field,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t\t\tvalue: currentRecord[field.fieldname] || '',\n\t\t\t})),\n\t\t]\n\t} catch (error) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tfieldname: 'error',\n\t\t\t\tcomponent: 'div',\n\t\t\t\tvalue: `\n\t\t\t\t\t<div class=\"error-state\">\n\t\t\t\t\t\t<p>Unable to load form schema for ${formatDoctypeName(routeDoctype.value || currentDoctype.value)}</p>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t},\n\t\t]\n\t}\n}\n\n// Additional data helper functions\nconst getRecords = () => {\n\tif (!stonecrop.value || !currentDoctype.value) {\n\t\treturn []\n\t}\n\n\tconst recordsNode = stonecrop.value.records(currentDoctype.value)\n\tconst recordsData = recordsNode?.get('')\n\n\tif (recordsData && typeof recordsData === 'object' && !Array.isArray(recordsData)) {\n\t\treturn Object.values(recordsData as Record<string, any>)\n\t}\n\n\treturn []\n}\n\nconst getColumns = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (meta?.schema) {\n\t\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\t\treturn schemaArray.map(field => ({\n\t\t\t\tfieldname: field.fieldname,\n\t\t\t\tlabel: ('label' in field && field.label) || field.fieldname,\n\t\t\t\tfieldtype: ('fieldtype' in field && field.fieldtype) || 'Data',\n\t\t\t}))\n\t\t}\n\t} catch (error) {\n\t\t// Error getting schema - return empty array\n\t}\n\n\treturn []\n}\n\nconst getCurrentRecord = () => {\n\tif (!stonecrop.value || !currentDoctype.value || isNewRecord.value) return {}\n\n\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\treturn record?.get('') || {}\n}\n\n// Schema for different views - defined here after all helper functions are available\nconst currentViewSchema = computed<SchemaTypes[]>(() => {\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\treturn getDoctypesSchema()\n\t\tcase 'records':\n\t\t\treturn getRecordsSchema()\n\t\tcase 'record':\n\t\t\treturn getRecordFormSchema()\n\t\tdefault:\n\t\t\treturn []\n\t}\n})\n\n// Writable schema for AForm v-model binding\nconst writableSchema = ref<SchemaTypes[]>([])\n\n// Sync computed schema to writable schema when it changes\nwatch(\n\tcurrentViewSchema,\n\tnewSchema => {\n\t\twritableSchema.value = [...newSchema]\n\t},\n\t{ immediate: true, deep: true }\n)\n\n// Watch for field changes in writable schema and sync to HST\nwatch(\n\twritableSchema,\n\tnewSchema => {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value || isNewRecord.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\n\t\t\t// Process form field updates from schema\n\t\t\tnewSchema.forEach(field => {\n\t\t\t\t// Only process fields that have a fieldname and value (form fields)\n\t\t\t\tif (\n\t\t\t\t\tfield.fieldname &&\n\t\t\t\t\t'value' in field &&\n\t\t\t\t\t!['header', 'actions', 'loading', 'error'].includes(field.fieldname)\n\t\t\t\t) {\n\t\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${field.fieldname}`\n\t\t\t\t\tconst currentValue = hstStore.has(fieldPath) ? hstStore.get(fieldPath) : undefined\n\n\t\t\t\t\t// Only update if value actually changed to avoid infinite loops\n\t\t\t\t\tif (currentValue !== field.value) {\n\t\t\t\t\t\thstStore.set(fieldPath, field.value)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST schema sync failed:', error)\n\t\t}\n\t},\n\t{ deep: true }\n)\n\n// Action handlers (will be triggered by button clicks in the UI)\nconst handleSave = async () => {\n\t// eslint-disable-next-line no-console\n\tif (!stonecrop.value) return\n\n\tsaving.value = true\n\n\ttry {\n\t\tconst formData = currentViewData.value || {}\n\n\t\tif (isNewRecord.value) {\n\t\t\tconst newId = `record-${Date.now()}`\n\t\t\tconst recordData = { id: newId, ...formData }\n\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, newId, recordData)\n\n\t\t\t// Trigger SAVE transition for new record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, newId)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'creating',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tawait router.value?.replace(`/${routeDoctype.value}/${newId}`)\n\t\t} else {\n\t\t\tconst recordData = { id: currentRecordId.value, ...formData }\n\t\t\tstonecrop.value.addRecord(currentDoctype.value, currentRecordId.value, recordData)\n\n\t\t\t// Trigger SAVE transition for existing record\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('SAVE', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'saved',\n\t\t\t\t\tfsmContext: recordData,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\t// Silently handle error\n\t} finally {\n\t\tsaving.value = false\n\t}\n}\n\nconst handleCancel = async () => {\n\tif (isNewRecord.value) {\n\t\t// For new records, we don't have a specific record node yet\n\t\t// Just navigate back without triggering transition\n\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t} else {\n\t\t// Trigger CANCEL transition for existing record\n\t\tif (stonecrop.value) {\n\t\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\tif (node) {\n\t\t\t\tawait node.triggerTransition('CANCEL', {\n\t\t\t\t\tcurrentState: 'editing',\n\t\t\t\t\ttargetState: 'cancelled',\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t// Reload current record data\n\t\tloadRecordData()\n\t}\n}\n\nconst handleActionClick = (label: string, action: (() => void | Promise<void>) | undefined) => {\n\t// eslint-disable-next-line no-console\n\tif (action) {\n\t\tvoid action()\n\t}\n}\n\nconst handleDelete = async (recordId?: string) => {\n\tif (!stonecrop.value) return\n\n\tconst targetRecordId = recordId || currentRecordId.value\n\tif (!targetRecordId) return\n\n\tif (confirm('Are you sure you want to delete this record?')) {\n\t\t// Trigger DELETE transition before removing\n\t\tconst node = stonecrop.value.getRecordById(currentDoctype.value, targetRecordId)\n\t\tif (node) {\n\t\t\tawait node.triggerTransition('DELETE', {\n\t\t\t\tcurrentState: 'editing',\n\t\t\t\ttargetState: 'deleted',\n\t\t\t})\n\t\t}\n\n\t\tstonecrop.value.removeRecord(currentDoctype.value, targetRecordId)\n\n\t\tif (currentView.value === 'record') {\n\t\t\tawait router.value?.push(`/${routeDoctype.value}`)\n\t\t}\n\t}\n}\n\n// Event handlers\nconst handleClick = async (event: Event) => {\n\tconst target = event.target as HTMLElement\n\tconst action = target.getAttribute('data-action')\n\n\tif (action) {\n\t\tswitch (action) {\n\t\t\tcase 'create':\n\t\t\t\tawait createNewRecord()\n\t\t\t\tbreak\n\t\t\tcase 'save':\n\t\t\t\tawait handleSave()\n\t\t\t\tbreak\n\t\t\tcase 'cancel':\n\t\t\t\tawait handleCancel()\n\t\t\t\tbreak\n\t\t\tcase 'delete':\n\t\t\t\tawait handleDelete()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// Handle table cell clicks for actions\n\tconst cell = target.closest('td, th')\n\tif (cell) {\n\t\tconst cellText = cell.textContent?.trim()\n\t\tconst row = cell.closest('tr')\n\n\t\tif (cellText === 'View Records' && row) {\n\t\t\t// Get the doctype from the row data\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst doctypeCell = cells[1] // Assuming doctype is in second column (first column is index)\n\t\t\t\tconst doctype = doctypeCell.textContent?.trim()\n\t\t\t\tif (doctype) {\n\t\t\t\t\tawait navigateToDoctype(doctype)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Edit') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait openRecord(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Delete') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait handleDelete(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Watch for route changes to load appropriate data\nwatch(\n\t[currentView, currentDoctype, currentRecordId],\n\t() => {\n\t\tif (currentView.value === 'record') {\n\t\t\tloadRecordData()\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for Stonecrop instance to become available\nwatch(\n\tstonecrop,\n\tnewStonecrop => {\n\t\tif (newStonecrop) {\n\t\t\t// Force a re-evaluation of the current view schema when Stonecrop becomes available\n\t\t\t// This is handled automatically by the reactive computed properties\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Watch for when we need to load data for records view\nwatch(\n\t[currentView, currentDoctype, stonecrop],\n\t([view, doctype, stonecropInstance]) => {\n\t\tif (view === 'records' && doctype && stonecropInstance) {\n\t\t\t// Ensure doctype metadata is loaded\n\t\t\tloadDoctypeMetadata(doctype)\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\nconst loadRecordData = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return\n\n\tloading.value = true\n\n\ttry {\n\t\tif (!isNewRecord.value) {\n\t\t\t// For existing records, ensure the record exists in HST\n\t\t\t// The computed currentViewData will automatically read from HST\n\t\t\tstonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t}\n\t\t// For new records, currentViewData computed property will return {} automatically\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error loading record data:', error)\n\t} finally {\n\t\tloading.value = false\n\t}\n}\n\n// Provide methods for action components\nconst desktopMethods = {\n\tnavigateToDoctype,\n\topenRecord,\n\tcreateNewRecord,\n\thandleSave,\n\thandleCancel,\n\thandleDelete,\n}\n\nprovide('desktopMethods', desktopMethods)\n\n// Register action components in Vue app\nonMounted(() => {\n\t// Wait a tick for stonecrop to be ready, then load initial data\n\tvoid nextTick(() => {\n\t\tif (currentView.value === 'records' && currentDoctype.value && stonecrop.value) {\n\t\t\tloadDoctypeMetadata(currentDoctype.value)\n\t\t}\n\t})\n\n\t// Components will be automatically registered via the global component system\n\n\t// Add keyboard shortcuts\n\tconst handleKeydown = (event: KeyboardEvent) => {\n\t\t// Ctrl+K or Cmd+K to open command palette\n\t\tif ((event.ctrlKey || event.metaKey) && event.key === 'k') {\n\t\t\tevent.preventDefault()\n\t\t\tcommandPaletteOpen.value = true\n\t\t}\n\t\t// Escape to close command palette\n\t\tif (event.key === 'Escape' && commandPaletteOpen.value) {\n\t\t\tcommandPaletteOpen.value = false\n\t\t}\n\t}\n\n\tdocument.addEventListener('keydown', handleKeydown)\n\n\t// Cleanup event listener on unmount\n\treturn () => {\n\t\tdocument.removeEventListener('keydown', handleKeydown)\n\t}\n})\n</script>\n","import { App, type Plugin } from 'vue'\n\nimport ActionSet from '../components/ActionSet.vue'\nimport CommandPalette from '../components/CommandPalette.vue'\nimport Desktop from '../components/Desktop.vue'\nimport SheetNav from '../components/SheetNav.vue'\n\n/**\n * This is the main plugin that will be used to register all the desktop components.\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App) => {\n\t\tapp.component('ActionSet', ActionSet)\n\t\tapp.component('CommandPalette', CommandPalette)\n\t\tapp.component('Desktop', Desktop)\n\t\tapp.component('SheetNav', SheetNav)\n\t},\n}\n\nexport default plugin\n"],"names":["emit","__emit","dropdownStates","ref","isOpen","timeoutId","hover","closeClicked","onMounted","closeDropdowns","onHover","onHoverLeave","toggleDropdown","index","showDropdown","handleClick","action","label","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_1","_cache","$event","_openBlock","_Fragment","_renderList","__props","el","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_withDirectives","_hoisted_5","_hoisted_6","item","itemIndex","_hoisted_7","_hoisted_9","_vShow","query","selectedIndex","inputRef","useTemplateRef","results","computed","watch","nextTick","closeModal","handleKeydown","e","selectResult","result","_createBlock","_Teleport","_createVNode","_Transition","_renderSlot","_ctx","IS_CLIENT","activePinia","setActivePinia","pinia","piniaSymbol","isPlainObject","o","MutationType","patchObject","newState","oldState","key","subPatch","targetValue","isRef","isReactive","noop","addSubscription","subscriptions","callback","detached","onCleanup","removeSubscription","getCurrentScope","onScopeDispose","triggerSubscriptions","args","fallbackRunWithContext","fn","ACTION_MARKER","ACTION_NAME","mergeReactiveObjects","target","patchToApply","value","skipHydrateSymbol","shouldHydrate","obj","assign","isComputed","createOptionsStore","id","options","hot","state","actions","getters","initialState","store","setup","localState","toRefs","computedGetters","name","markRaw","createSetupStore","$id","isOptionsStore","scope","optionsForPlugin","$subscribeOptions","event","isListening","debuggerEvents","isSyncListening","actionSubscriptions","hotState","activeListener","$patch","partialStateOrMutator","subscriptionMutation","myListenerId","$reset","$state","$dispose","wrappedAction","afterCallbackSet","onErrorCallbackSet","after","onError","ret","error","_hmrPayload","partialStore","stopWatcher","reactive","setupStore","effectScope","prop","toRef","actionValue","toRaw","newStore","stateKey","newStateTarget","oldStateSource","actionName","actionFn","getterName","getter","getterValue","nonEnumerable","p","extender","extensions","defineStore","setupOptions","isSetupStore","useStore","hasContext","hasInjectionContext","inject","hotId","currentInstance","getCurrentInstance","vm","cache","storeToRefs","rawStore","refs","ke","Le","Me","we","Fe","Ie","ye","Ee","L","xe","t","r","n","Re","Ne","s","a","ce","Be","Pe","_e","U","Ve","c","d","We","me","de","ze","j","He","H","Q","B","Ce","g","S","$","k","ne","oe","Ue","Je","qe","Ke","je","he","Ge","v","x","F","Se","R","O","w","h","E","b","N","_","A","C","M","G","P","D","q","Ze","le","ie","Xe","re","De","u","l","y","f","T","I","V","m","ee","J","ge","Y","se","et","Ae","ue","i","pt","fe","be","z","ve","K","Z","ae","$e","tt","pe","Oe","_t","mt","ht","Kn","cn","Rt","St","xt","bt","uo","Yo","yn","Qe","ql","Ct","Et","Kl","ta","Pa","Oa","_a","Ba","te","dn","dt","vt","Mn","breadcrumbsVisibile","searchVisible","searchText","rotateHideTabIcon","toggleBreadcrumbs","toggleSearch","handleSearchInput","handleSearch","navigateHome","_component_router_link","_withKeys","breadcrumb","_createTextVNode","stonecrop","useStonecrop","loading","saving","commandPaletteOpen","currentViewData","currentDoctype","currentRecordId","newData","hstStore","fieldname","fieldPath","route","unref","router","pathMatch","routeDoctype","isNewRecord","currentView","routeName","getAvailableTransitions","meta","currentState","stateConfig","transition","targetState","targetStateName","node","recordData","actionElements","elements","createNewRecord","transitionActions","navigationBreadcrumbs","breadcrumbs","formatDoctypeName","searchCommands","commands","doctype","cmd","executeCommand","command","word","getRecordCount","navigateToDoctype","openRecord","recordId","newId","loadDoctypeMetadata","getDoctypesSchema","rows","getRecordsSchema","records","getRecords","columns","getColumns","record","col","getRecordFormSchema","schemaArray","currentRecord","getCurrentRecord","field","recordsData","currentViewSchema","writableSchema","newSchema","handleSave","formData","handleCancel","loadRecordData","handleActionClick","handleDelete","targetRecordId","cell","cellText","row","cells","newStonecrop","view","stonecropInstance","provide","ActionSet","_unref","AForm","SheetNav","CommandPalette","_withCtx","plugin","app","Desktop"],"mappings":";;;;;;;;AAyEA,UAAMA,IAAOC,GAKPC,IAAiBC,EAA6B,EAAE,GAEhDC,IAASD,EAAI,EAAK,GAClBE,IAAYF,EAAY,EAAE,GAC1BG,IAAQH,EAAI,EAAK,GACjBI,IAAeJ,EAAI,EAAK;AAE9B,IAAAK,GAAU,MAAM;AACf,MAAAC,EAAA;AAAA,IACD,CAAC;AAED,UAAMA,IAAiB,MAAM;AAC5B,MAAAP,EAAe,QAAQ,CAAA;AAAA,IACxB,GAEMQ,IAAU,MAAM;AACrB,MAAAJ,EAAM,QAAQ,IACdD,EAAU,QAAQ,WAAW,MAAM;AAClC,QAAIC,EAAM,UACTF,EAAO,QAAQ;AAAA,MAEjB,GAAG,GAAG;AAAA,IACP,GAEMO,IAAe,MAAM;AAC1B,MAAAL,EAAM,QAAQ,IACdC,EAAa,QAAQ,IACrB,aAAaF,EAAU,KAAK,GAC5BD,EAAO,QAAQ;AAAA,IAChB,GAEMQ,IAAiB,CAACC,MAAkB;AACzC,YAAMC,IAAe,CAACZ,EAAe,MAAMW,CAAK;AAChD,MAAAJ,EAAA,GACIK,MACHZ,EA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