@stonecrop/desktop 0.4.2 โ 0.4.4
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.
- package/dist/desktop.js +761 -759
- package/dist/desktop.js.map +1 -1
- package/dist/desktop.umd.cjs +10 -10
- package/dist/desktop.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/desktop.umd.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
(function(P,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(P=typeof globalThis<"u"?globalThis:P||self,r(P["@stonecrop/desktop"]={},P.Vue))})(this,function(P,r){"use strict";const Un={class:"action-menu-icon"},Wn=["onclick"],Hn={key:1},Fn=["onClick"],zn={class:"dropdown-container"},Jn={class:"dropdown"},Gn=["onclick"],Yn=["href"],Xn={class:"dropdown-item"},Qn=r.defineComponent({__name:"ActionSet",props:{elements:{}},setup(t){const e=r.ref(t.elements),n=r.ref(!1),o=r.ref(null),s=r.ref(!1),a=r.ref(!1);r.onMounted(()=>{l()});const l=()=>{for(const d of e.value)d.type==="dropdown"&&(d.show=!1)},i=()=>{s.value=!0,o.value=setTimeout(()=>{s.value&&(n.value=!0)},500)},u=()=>{s.value=!1,a.value=!1,clearTimeout(o.value),n.value=!1},c=d=>{const f=!e.value[d].show;l(),e.value[d].show=f};return(d,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"open-set":n.value,"hovered-and-closed":a.value},"action-set collapse"]),onMouseover:i,onMouseleave:u},[r.createElementVNode("div",Un,[r.createElementVNode("div",{id:"chevron",onClick:f[0]||(f[0]=p=>a.value=!a.value)},f[1]||(f[1]=[r.createElementVNode("svg",{class:"leftBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"54.2,33.4 29.2,58.8 25,54.6 50,29.2 "})],-1),r.createElementVNode("svg",{class:"rightBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"70.8,58.8 45.8,33.4 50,29.2 75,54.6 "})],-1)]))]),f[2]||(f[2]=r.createElementVNode("div",{style:{"margin-right":"30px"}},null,-1)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.value,(p,w)=>(r.openBlock(),r.createElementBlock("div",{class:"action-element",key:p.label},[p.type=="button"?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:p.action,class:"button-default"},r.toDisplayString(p.label),9,Wn)):r.createCommentVNode("",!0),p.type=="dropdown"?(r.openBlock(),r.createElementBlock("div",Hn,[r.createElementVNode("button",{class:"button-default",onClick:h=>c(w)},r.toDisplayString(p.label),9,Fn),r.withDirectives(r.createElementVNode("div",zn,[r.createElementVNode("div",Jn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actions,h=>(r.openBlock(),r.createElementBlock("div",{key:h.label},[h.action!=null?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:h.action,class:"dropdown-item"},r.toDisplayString(h.label),9,Gn)):h.link!=null?(r.openBlock(),r.createElementBlock("a",{key:1,href:h.link},[r.createElementVNode("button",Xn,r.toDisplayString(h.label),1)],8,Yn)):r.createCommentVNode("",!0)]))),128))])],512),[[r.vShow,p.show]])])):r.createCommentVNode("",!0)]))),128))],34))}}),Tt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},ye=Tt(Qn,[["__scopeId","data-v-38e7af34"]]),qn={};function Kn(t,e){return r.openBlock(),r.createElementBlock("dialog")}const we=Tt(qn,[["render",Kn]]),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n};function be(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function at(t){return typeof t=="function"?t():r.unref(t)}const Ee=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const to=Object.prototype.toString,eo=t=>to.call(t)==="[object Object]",_e=()=>{},ve=no();function no(){var t,e;return Ee&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function oo(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:_e}))):r.ref(e)}const ro=Ee?window:void 0;function so(t){var e;const n=at(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ao(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=ro):[e,n,o,s]=t,!e)return _e;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[so(e),at(s)],([d,f])=>{if(l(),!d)return;const p=eo(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return be(c),c}function At(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function ke(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:ke(n)}}function io(t){const e=t||window.event,n=e.target;return ke(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Bt=new WeakMap;function lo(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(oo(t),i=>{const u=At(at(i));if(u){const c=u;if(Bt.get(c)||Bt.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=At(at(t));!i||n.value||(ve&&(o=ao(i,"touchmove",u=>{io(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=At(at(t));!i||!n.value||(ve&&(o==null||o()),i.style.overflow=s,Bt.delete(i),n.value=!1)};return be(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function co(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=lo(n,o.value);r.watch(e,a=>s.value=a)}}co(),typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uo={class:"aform"},fo=r.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=r.ref(t.data||{}),s=l=>{let i={};for(const[u,c]of Object.entries(l))["component","fieldtype"].includes(u)||(i[u]=c),u==="rows"&&c&&c.length===0&&(i.rows=o.value[l.fieldname]);return i},a=r.computed({get:()=>t.modelValue.map((l,i)=>r.computed({get(){return l.value},set:u=>{t.modelValue[i].value=u,n("update:modelValue",t.modelValue)}})),set:()=>{}});return(l,i)=>(r.openBlock(),r.createElementBlock("form",uo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.modelValue,(u,c)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.component),r.mergeProps({key:c,schema:u,modelValue:a.value[c].value,"onUpdate:modelValue":d=>a.value[c].value=d,data:o.value[u.fieldname],readonly:l.readonly,ref_for:!0},s(u)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),po=Zn(fo,[["__scopeId","data-v-68845234"]]);var mo=Object.defineProperty,ho=(t,e,n)=>e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);function Rt(t){this.message=t||""}Rt.prototype=Object.create(Error.prototype,{constructor:{value:Rt},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});const Se=class Vt{constructor(e,n,o,s,a){if(V(this,"name","Stonecrop"),V(this,"registry"),V(this,"store"),V(this,"schema"),V(this,"workflow"),V(this,"actions"),Vt._root)return Vt._root;Vt._root=this,this.registry=e,this.store=n,this.schema=o,this.workflow=s,this.actions=a}setup(e){this.getMeta(e),this.getWorkflow(e),this.getActions(e)}getMeta(e){return this.registry.getMeta?this.registry.getMeta(e.doctype):new Rt(e.doctype)}getWorkflow(e){const n=this.registry.registry[e.slug];this.workflow=n.workflow}getActions(e){const n=this.registry.registry[e.slug];this.actions=n.actions}async getRecords(e,n){this.store.$patch({records:[]});const o=await(await fetch(`/${e.slug}`,n)).json();this.store.$patch({records:o})}async getRecord(e,n){this.store.$patch({record:{}});const o=await(await fetch(`/${e.slug}/${n}`)).json();this.store.$patch({record:o})}runAction(e,n,o){var s;const a=(s=this.registry.registry[e.slug].actions)==null?void 0:s.get(n);if(this.workflow){const{initialState:l}=this.workflow;this.workflow.transition(l,{type:n}),a&&a.length>0&&a.forEach(i=>{new Function(i)(o)})}}};V(Se,"_root");let go=Se;var $e=!1;function bt(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function jt(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}function yo(){return Ne().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ne(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const wo=typeof Proxy=="function",bo="devtools-plugin:setup",Eo="plugin:settings:set";let it,Mt;function _o(){var t;return it!==void 0||(typeof window<"u"&&window.performance?(it=!0,Mt=window.performance):typeof globalThis<"u"&&!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance?(it=!0,Mt=globalThis.perf_hooks.performance):it=!1),it}function vo(){return _o()?Mt.now():Date.now()}class ko{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const o={};if(e.settings)for(const l in e.settings){const i=e.settings[l];o[l]=i.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let a=Object.assign({},o);try{const l=localStorage.getItem(s),i=JSON.parse(l);Object.assign(a,i)}catch{}this.fallbacks={getSettings(){return a},setSettings(l){try{localStorage.setItem(s,JSON.stringify(l))}catch{}a=l},now(){return vo()}},n&&n.on(Eo,(l,i)=>{l===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(l,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(l,i)=>this.target?this.target[i]:i==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(i)?(...u)=>(this.targetQueue.push({method:i,args:u,resolve:()=>{}}),this.fallbacks[i](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:i,args:u,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function xe(t,e){const n=t,o=Ne(),s=yo(),a=wo&&n.enableEarlyProxy;if(s&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))s.emit(bo,t,e);else{const l=a?new ko(n,s):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:l}),l&&e(l.proxiedTarget)}}/*!
|
|
1
|
+
(function(D,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(D=typeof globalThis<"u"?globalThis:D||self,r(D["@stonecrop/desktop"]={},D.Vue))})(this,function(D,r){"use strict";const Wn={class:"action-menu-icon"},Hn=["onclick"],Fn={key:1},zn=["onClick"],Jn={class:"dropdown-container"},Gn={class:"dropdown"},Yn=["onclick"],Xn=["href"],Qn={class:"dropdown-item"},qn=r.defineComponent({__name:"ActionSet",props:{elements:{}},setup(t){const e=r.ref(t.elements),n=r.ref(!1),o=r.ref(null),s=r.ref(!1),a=r.ref(!1);r.onMounted(()=>{l()});const l=()=>{for(const d of e.value)d.type==="dropdown"&&(d.show=!1)},i=()=>{s.value=!0,o.value=setTimeout(()=>{s.value&&(n.value=!0)},500)},u=()=>{s.value=!1,a.value=!1,clearTimeout(o.value),n.value=!1},c=d=>{const f=!e.value[d].show;l(),e.value[d].show=f};return(d,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([{"open-set":n.value,"hovered-and-closed":a.value},"action-set collapse"]),onMouseover:i,onMouseleave:u},[r.createElementVNode("div",Wn,[r.createElementVNode("div",{id:"chevron",onClick:f[0]||(f[0]=p=>a.value=!a.value)},f[1]||(f[1]=[r.createElementVNode("svg",{class:"leftBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"54.2,33.4 29.2,58.8 25,54.6 50,29.2 "})],-1),r.createElementVNode("svg",{class:"rightBar",version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","xml:space":"preserve",width:"50",height:"50"},[r.createElementVNode("polygon",{points:"70.8,58.8 45.8,33.4 50,29.2 75,54.6 "})],-1)]))]),f[2]||(f[2]=r.createElementVNode("div",{style:{"margin-right":"30px"}},null,-1)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.value,(p,w)=>(r.openBlock(),r.createElementBlock("div",{class:"action-element",key:p.label},[p.type=="button"?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:p.action,class:"button-default"},r.toDisplayString(p.label),9,Hn)):r.createCommentVNode("",!0),p.type=="dropdown"?(r.openBlock(),r.createElementBlock("div",Fn,[r.createElementVNode("button",{class:"button-default",onClick:g=>c(w)},r.toDisplayString(p.label),9,zn),r.withDirectives(r.createElementVNode("div",Jn,[r.createElementVNode("div",Gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actions,g=>(r.openBlock(),r.createElementBlock("div",{key:g.label},[g.action!=null?(r.openBlock(),r.createElementBlock("button",{key:0,onclick:g.action,class:"dropdown-item"},r.toDisplayString(g.label),9,Yn)):g.link!=null?(r.openBlock(),r.createElementBlock("a",{key:1,href:g.link},[r.createElementVNode("button",Qn,r.toDisplayString(g.label),1)],8,Xn)):r.createCommentVNode("",!0)]))),128))])],512),[[r.vShow,p.show]])])):r.createCommentVNode("",!0)]))),128))],34))}}),Tt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},ye=Tt(qn,[["__scopeId","data-v-38e7af34"]]),Kn={};function Zn(t,e){return r.openBlock(),r.createElementBlock("dialog")}const we=Tt(Kn,[["render",Zn]]),to=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n};function be(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function at(t){return typeof t=="function"?t():r.unref(t)}const Ee=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const eo=Object.prototype.toString,no=t=>eo.call(t)==="[object Object]",_e=()=>{},ve=oo();function oo(){var t,e;return Ee&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ro(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:_e}))):r.ref(e)}const so=Ee?window:void 0;function ao(t){var e;const n=at(t);return(e=n==null?void 0:n.$el)!=null?e:n}function io(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=so):[e,n,o,s]=t,!e)return _e;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[ao(e),at(s)],([d,f])=>{if(l(),!d)return;const p=no(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(g=>i(d,w,g,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return be(c),c}function At(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function ke(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:ke(n)}}function lo(t){const e=t||window.event,n=e.target;return ke(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Bt=new WeakMap;function co(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(ro(t),i=>{const u=At(at(i));if(u){const c=u;if(Bt.get(c)||Bt.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=At(at(t));!i||n.value||(ve&&(o=io(i,"touchmove",u=>{lo(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=At(at(t));!i||!n.value||(ve&&(o==null||o()),i.style.overflow=s,Bt.delete(i),n.value=!1)};return be(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function uo(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=co(n,o.value);r.watch(e,a=>s.value=a)}}uo(),typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fo={class:"aform"},po=r.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=r.ref(t.data||{}),s=l=>{let i={};for(const[u,c]of Object.entries(l))["component","fieldtype"].includes(u)||(i[u]=c),u==="rows"&&c&&c.length===0&&(i.rows=o.value[l.fieldname]);return i},a=r.computed({get:()=>t.modelValue.map((l,i)=>r.computed({get(){return l.value},set:u=>{t.modelValue[i].value=u,n("update:modelValue",t.modelValue)}})),set:()=>{}});return(l,i)=>(r.openBlock(),r.createElementBlock("form",fo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.modelValue,(u,c)=>(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.component),r.mergeProps({key:c,schema:u,modelValue:a.value[c].value,"onUpdate:modelValue":d=>a.value[c].value=d,data:o.value[u.fieldname],readonly:l.readonly,ref_for:!0},s(u)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),mo=to(po,[["__scopeId","data-v-68845234"]]);var ho=Object.defineProperty,go=(t,e,n)=>e in t?ho(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,T=(t,e,n)=>go(t,typeof e!="symbol"?e+"":e,n);function Rt(t){this.message=t||""}Rt.prototype=Object.create(Error.prototype,{constructor:{value:Rt},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});const $e=class Vt{constructor(e,n,o,s,a){if(T(this,"name","Stonecrop"),T(this,"registry"),T(this,"store"),T(this,"schema"),T(this,"workflow"),T(this,"actions"),Vt._root)return Vt._root;Vt._root=this,this.registry=e,this.store=n,this.schema=o,this.workflow=s,this.actions=a}setup(e){this.getMeta(e),this.getWorkflow(e),this.getActions(e)}getMeta(e){return this.registry.getMeta?this.registry.getMeta(e.doctype):new Rt(e.doctype)}getWorkflow(e){const n=this.registry.registry[e.slug];this.workflow=n.workflow}getActions(e){const n=this.registry.registry[e.slug];this.actions=n.actions}async getRecords(e,n){this.store.$patch({records:[]});const o=await(await fetch(`/${e.slug}`,n)).json();this.store.$patch({records:o})}async getRecord(e,n){this.store.$patch({record:{}});const o=await(await fetch(`/${e.slug}/${n}`)).json();this.store.$patch({record:o})}runAction(e,n,o){var s;const a=(s=this.registry.registry[e.slug].actions)==null?void 0:s.get(n);if(this.workflow){const{initialState:l}=this.workflow;this.workflow.transition(l,{type:n}),a&&a.length>0&&a.forEach(i=>{new Function(i)(o)})}}};T($e,"_root");let yo=$e;var Se=!1;function bt(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function jt(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}function wo(){return Ne().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ne(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const bo=typeof Proxy=="function",Eo="devtools-plugin:setup",_o="plugin:settings:set";let it,Mt;function vo(){var t;return it!==void 0||(typeof window<"u"&&window.performance?(it=!0,Mt=window.performance):typeof globalThis<"u"&&!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance?(it=!0,Mt=globalThis.perf_hooks.performance):it=!1),it}function ko(){return vo()?Mt.now():Date.now()}class $o{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const o={};if(e.settings)for(const l in e.settings){const i=e.settings[l];o[l]=i.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let a=Object.assign({},o);try{const l=localStorage.getItem(s),i=JSON.parse(l);Object.assign(a,i)}catch{}this.fallbacks={getSettings(){return a},setSettings(l){try{localStorage.setItem(s,JSON.stringify(l))}catch{}a=l},now(){return ko()}},n&&n.on(_o,(l,i)=>{l===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(l,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(l,i)=>this.target?this.target[i]:i==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(i)?(...u)=>(this.targetQueue.push({method:i,args:u,resolve:()=>{}}),this.fallbacks[i](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:i,args:u,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function xe(t,e){const n=t,o=Ne(),s=wo(),a=bo&&n.enableEarlyProxy;if(s&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))s.emit(Eo,t,e);else{const l=a?new $o(n,s):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:l}),l&&e(l.proxiedTarget)}}/*!
|
|
2
2
|
* pinia v2.3.0
|
|
3
3
|
* (c) 2024 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/let lt;const ct=t=>lt=t,Oe=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function
|
|
5
|
+
*/let lt;const ct=t=>lt=t,Oe=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function X(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var U;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(U||(U={}));const G=typeof window<"u",Ce=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function So(t,{autoBom:e=!1}={}){return e&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function Lt(t,e,n){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="blob",o.onload=function(){Ve(o.response,e,n)},o.onerror=function(){console.error("could not download file")},o.send()}function Pe(t){const e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function Et(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{const e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}const _t=typeof navigator=="object"?navigator:{userAgent:""},Ie=/Macintosh/.test(_t.userAgent)&&/AppleWebKit/.test(_t.userAgent)&&!/Safari/.test(_t.userAgent),Ve=G?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Ie?No:"msSaveOrOpenBlob"in _t?xo:Oo:()=>{};function No(t,e="download",n){const o=document.createElement("a");o.download=e,o.rel="noopener",typeof t=="string"?(o.href=t,o.origin!==location.origin?Pe(o.href)?Lt(t,e,n):(o.target="_blank",Et(o)):Et(o)):(o.href=URL.createObjectURL(t),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){Et(o)},0))}function xo(t,e="download",n){if(typeof t=="string")if(Pe(t))Lt(t,e,n);else{const o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){Et(o)})}else navigator.msSaveOrOpenBlob(So(t,n),e)}function Oo(t,e,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof t=="string")return Lt(t,e,n);const s=t.type==="application/octet-stream",a=/constructor/i.test(String(Ce.HTMLElement))||"safari"in Ce,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&a||Ie)&&typeof FileReader<"u"){const i=new FileReader;i.onloadend=function(){let u=i.result;if(typeof u!="string")throw o=null,new Error("Wrong reader.result type");u=l?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=u:location.assign(u),o=null},i.readAsDataURL(t)}else{const i=URL.createObjectURL(t);o?o.location.assign(i):location.href=i,o=null,setTimeout(function(){URL.revokeObjectURL(i)},4e4)}}function x(t,e){const n="๐ "+t;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,e):e==="error"?console.error(n):e==="warn"?console.warn(n):console.log(n)}function Ut(t){return"_a"in t&&"install"in t}function De(){if(!("clipboard"in navigator))return x("Your browser doesn't support the Clipboard API","error"),!0}function Te(t){return t instanceof Error&&t.message.toLowerCase().includes("document is not focused")?(x('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Co(t){if(!De())try{await navigator.clipboard.writeText(JSON.stringify(t.state.value)),x("Global state copied to clipboard.")}catch(e){if(Te(e))return;x("Failed to serialize the state. Check the console for more details.","error"),console.error(e)}}async function Po(t){if(!De())try{Ae(t,JSON.parse(await navigator.clipboard.readText())),x("Global state pasted from clipboard.")}catch(e){if(Te(e))return;x("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(e)}}async function Io(t){try{Ve(new Blob([JSON.stringify(t.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(e){x("Failed to export the state as JSON. Check the console for more details.","error"),console.error(e)}}let W;function Vo(){W||(W=document.createElement("input"),W.type="file",W.accept=".json");function t(){return new Promise((e,n)=>{W.onchange=async()=>{const o=W.files;if(!o)return e(null);const s=o.item(0);return e(s?{text:await s.text(),file:s}:null)},W.oncancel=()=>e(null),W.onerror=n,W.click()})}return t}async function Do(t){try{const e=await Vo()();if(!e)return;const{text:n,file:o}=e;Ae(t,JSON.parse(n)),x(`Global state imported from "${o.name}".`)}catch(e){x("Failed to import the state from JSON. Check the console for more details.","error"),console.error(e)}}function Ae(t,e){for(const n in e){const o=t.state.value[n];o?Object.assign(o,e[n]):t.state.value[n]=e[n]}}function L(t){return{_custom:{display:t}}}const Be="๐ Pinia (root)",vt="_root";function To(t){return Ut(t)?{id:vt,label:Be}:{id:t.$id,label:t.$id}}function Ao(t){if(Ut(t)){const n=Array.from(t._s.keys()),o=t._s;return{state:n.map(s=>({editable:!0,key:s,value:t.state.value[s]})),getters:n.filter(s=>o.get(s)._getters).map(s=>{const a=o.get(s);return{editable:!1,key:s,value:a._getters.reduce((l,i)=>(l[i]=a[i],l),{})}})}}const e={state:Object.keys(t.$state).map(n=>({editable:!0,key:n,value:t.$state[n]}))};return t._getters&&t._getters.length&&(e.getters=t._getters.map(n=>({editable:!1,key:n,value:t[n]}))),t._customProperties.size&&(e.customProperties=Array.from(t._customProperties).map(n=>({editable:!0,key:n,value:t[n]}))),e}function Bo(t){return t?Array.isArray(t)?t.reduce((e,n)=>(e.keys.push(n.key),e.operations.push(n.type),e.oldValue[n.key]=n.oldValue,e.newValue[n.key]=n.newValue,e),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:L(t.type),key:L(t.key),oldValue:t.oldValue,newValue:t.newValue}:{}}function Ro(t){switch(t){case U.direct:return"mutation";case U.patchFunction:return"$patch";case U.patchObject:return"$patch";default:return"unknown"}}let Z=!0;const kt=[],Q="pinia:mutations",P="pinia",{assign:jo}=Object,$t=t=>"๐ "+t;function Mo(t,e){xe({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:kt,app:t},n=>{typeof n.now!="function"&&x("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.addTimelineLayer({id:Q,label:"Pinia ๐",color:15064968}),n.addInspector({id:P,label:"Pinia ๐",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Co(e)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await Po(e),n.sendInspectorTree(P),n.sendInspectorState(P)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Io(e)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Do(e),n.sendInspectorTree(P),n.sendInspectorState(P)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:o=>{const s=e._s.get(o);s?typeof s.$reset!="function"?x(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`,"warn"):(s.$reset(),x(`Store "${o}" reset.`)):x(`Cannot reset "${o}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((o,s)=>{const a=o.componentInstance&&o.componentInstance.proxy;if(a&&a._pStores){const l=o.componentInstance.proxy._pStores;Object.values(l).forEach(i=>{o.instanceData.state.push({type:$t(i.$id),key:"state",editable:!0,value:i._isOptionsAPI?{_custom:{value:r.toRaw(i.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>i.$reset()}]}}:Object.keys(i.$state).reduce((u,c)=>(u[c]=i.$state[c],u),{})}),i._getters&&i._getters.length&&o.instanceData.state.push({type:$t(i.$id),key:"getters",editable:!1,value:i._getters.reduce((u,c)=>{try{u[c]=i[c]}catch(d){u[c]=d}return u},{})})})}}),n.on.getInspectorTree(o=>{if(o.app===t&&o.inspectorId===P){let s=[e];s=s.concat(Array.from(e._s.values())),o.rootNodes=(o.filter?s.filter(a=>"$id"in a?a.$id.toLowerCase().includes(o.filter.toLowerCase()):Be.toLowerCase().includes(o.filter.toLowerCase())):s).map(To)}}),globalThis.$pinia=e,n.on.getInspectorState(o=>{if(o.app===t&&o.inspectorId===P){const s=o.nodeId===vt?e:e._s.get(o.nodeId);if(!s)return;s&&(o.nodeId!==vt&&(globalThis.$store=r.toRaw(s)),o.state=Ao(s))}}),n.on.editInspectorState((o,s)=>{if(o.app===t&&o.inspectorId===P){const a=o.nodeId===vt?e:e._s.get(o.nodeId);if(!a)return x(`store "${o.nodeId}" not found`,"error");const{path:l}=o;Ut(a)?l.unshift("state"):(l.length!==1||!a._customProperties.has(l[0])||l[0]in a.$state)&&l.unshift("$state"),Z=!1,o.set(a,l,o.state.value),Z=!0}}),n.on.editComponentState(o=>{if(o.type.startsWith("๐")){const s=o.type.replace(/^๐\s*/,""),a=e._s.get(s);if(!a)return x(`store "${s}" not found`,"error");const{path:l}=o;if(l[0]!=="state")return x(`Invalid path for store "${s}":
|
|
6
6
|
${l}
|
|
7
|
-
Only state can be modified.`);l[0]="$state",Z=!1,o.set(a,l,o.state.value),Z=!0}})})}function
|
|
7
|
+
Only state can be modified.`);l[0]="$state",Z=!1,o.set(a,l,o.state.value),Z=!0}})})}function Lo(t,e){kt.includes($t(e.$id))||kt.push($t(e.$id)),xe({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:kt,app:t,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const o=typeof n.now=="function"?n.now.bind(n):Date.now;e.$onAction(({after:l,onError:i,name:u,args:c})=>{const d=Re++;n.addTimelineEvent({layerId:Q,event:{time:o(),title:"๐ซ "+u,subtitle:"start",data:{store:L(e.$id),action:L(u),args:c},groupId:d}}),l(f=>{Y=void 0,n.addTimelineEvent({layerId:Q,event:{time:o(),title:"๐ฌ "+u,subtitle:"end",data:{store:L(e.$id),action:L(u),args:c,result:f},groupId:d}})}),i(f=>{Y=void 0,n.addTimelineEvent({layerId:Q,event:{time:o(),logType:"error",title:"๐ฅ "+u,subtitle:"end",data:{store:L(e.$id),action:L(u),args:c,error:f},groupId:d}})})},!0),e._customProperties.forEach(l=>{r.watch(()=>r.unref(e[l]),(i,u)=>{n.notifyComponentUpdate(),n.sendInspectorState(P),Z&&n.addTimelineEvent({layerId:Q,event:{time:o(),title:"Change",subtitle:l,data:{newValue:i,oldValue:u},groupId:Y}})},{deep:!0})}),e.$subscribe(({events:l,type:i},u)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(P),!Z)return;const c={time:o(),title:Ro(i),data:jo({store:L(e.$id)},Bo(l)),groupId:Y};i===U.patchFunction?c.subtitle="โคต๏ธ":i===U.patchObject?c.subtitle="๐งฉ":l&&!Array.isArray(l)&&(c.subtitle=l.type),l&&(c.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:l}}),n.addTimelineEvent({layerId:Q,event:c})},{detached:!0,flush:"sync"});const s=e._hotUpdate;e._hotUpdate=r.markRaw(l=>{s(l),n.addTimelineEvent({layerId:Q,event:{time:o(),title:"๐ฅ "+e.$id,subtitle:"HMR update",data:{store:L(e.$id),info:L("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P)});const{$dispose:a}=e;e.$dispose=()=>{a(),n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P),n.getSettings().logStoreChanges&&x(`Disposed "${e.$id}" store ๐`)},n.notifyComponentUpdate(),n.sendInspectorTree(P),n.sendInspectorState(P),n.getSettings().logStoreChanges&&x(`"${e.$id}" store installed ๐`)})}let Re=0,Y;function je(t,e,n){const o=e.reduce((s,a)=>(s[a]=r.toRaw(t)[a],s),{});for(const s in o)t[s]=function(){const a=Re,l=n?new Proxy(t,{get(...u){return Y=a,Reflect.get(...u)},set(...u){return Y=a,Reflect.set(...u)}}):t;Y=a;const i=o[s].apply(l,arguments);return Y=void 0,i}}function Uo({app:t,store:e,options:n}){if(!e.$id.startsWith("__hot:")){if(e._isOptionsAPI=!!n.state,!e._p._testing){je(e,Object.keys(n.actions),e._isOptionsAPI);const o=e._hotUpdate;r.toRaw(e)._hotUpdate=function(s){o.apply(this,arguments),je(e,Object.keys(s._hmrPayload.actions),!!e._isOptionsAPI)}}Lo(t,e)}}function Wo(){const t=r.effectScope(!0),e=t.run(()=>r.ref({}));let n=[],o=[];const s=r.markRaw({install(a){ct(s),s._a=a,a.provide(Oe,s),a.config.globalProperties.$pinia=s,process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&G&&Mo(a,s),o.forEach(l=>n.push(l)),o=[]},use(a){return!this._a&&!Se?o.push(a):n.push(a),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&G&&typeof Proxy<"u"&&s.use(Uo),s}function Me(t,e){for(const n in e){const o=e[n];if(!(n in t))continue;const s=t[n];X(s)&&X(o)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=Me(s,o):t[n]=o}return t}const Le=()=>{};function Ue(t,e,n,o=Le){t.push(e);const s=()=>{const a=t.indexOf(e);a>-1&&(t.splice(a,1),o())};return!n&&r.getCurrentScope()&&r.onScopeDispose(s),s}function tt(t,...e){t.slice().forEach(n=>{n(...e)})}const Ho=t=>t(),We=Symbol(),Wt=Symbol();function Ht(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,o)=>t.set(o,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const o=e[n],s=t[n];X(s)&&X(o)&&t.hasOwnProperty(n)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=Ht(s,o):t[n]=o}return t}const Fo=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function zo(t){return!X(t)||!t.hasOwnProperty(Fo)}const{assign:A}=Object;function He(t){return!!(r.isRef(t)&&t.effect)}function Fe(t,e,n,o){const{state:s,actions:a,getters:l}=e,i=n.state.value[t];let u;function c(){!i&&(process.env.NODE_ENV==="production"||!o)&&(n.state.value[t]=s?s():{});const d=process.env.NODE_ENV!=="production"&&o?r.toRefs(r.ref(s?s():{}).value):r.toRefs(n.state.value[t]);return A(d,a,Object.keys(l||{}).reduce((f,p)=>(process.env.NODE_ENV!=="production"&&p in d&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${t}".`),f[p]=r.markRaw(r.computed(()=>{ct(n);const w=n._s.get(t);return l[p].call(w,w)})),f),{}))}return u=Ft(t,c,e,n,o,!0),u}function Ft(t,e,n={},o,s,a){let l;const i=A({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const u={deep:!0};process.env.NODE_ENV!=="production"&&!Se&&(u.onTrigger=b=>{c?w=b:c==!1&&!h._hotUpdating&&(Array.isArray(w)?w.push(b):console.error("๐ debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,d,f=[],p=[],w;const g=o.state.value[t];!a&&!g&&(process.env.NODE_ENV==="production"||!s)&&(o.state.value[t]={});const E=r.ref({});let _;function S(b){let m;c=d=!1,process.env.NODE_ENV!=="production"&&(w=[]),typeof b=="function"?(b(o.state.value[t]),m={type:U.patchFunction,storeId:t,events:w}):(Ht(o.state.value[t],b),m={type:U.patchObject,payload:b,storeId:t,events:w});const y=_=Symbol();r.nextTick().then(()=>{_===y&&(c=!0)}),d=!0,tt(f,m,o.state.value[t])}const $=a?function(){const{state:b}=n,m=b?b():{};this.$patch(y=>{A(y,m)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`๐: Store "${t}" is built using the setup syntax and does not implement $reset().`)}:Le;function I(){l.stop(),f=[],p=[],o._s.delete(t)}const j=(b,m="")=>{if(We in b)return b[Wt]=m,b;const y=function(){ct(o);const k=Array.from(arguments),O=[],J=[];function wt(C){O.push(C)}function ge(C){J.push(C)}tt(p,{args:k,name:y[Wt],store:h,after:wt,onError:ge});let K;try{K=b.apply(this&&this.$id===t?this:h,k)}catch(C){throw tt(J,C),C}return K instanceof Promise?K.then(C=>(tt(O,C),C)).catch(C=>(tt(J,C),Promise.reject(C))):(tt(O,K),K)};return y[We]=!0,y[Wt]=m,y},V=r.markRaw({actions:{},getters:{},state:[],hotState:E}),N={_p:o,$id:t,$onAction:Ue.bind(null,p),$patch:S,$reset:$,$subscribe(b,m={}){const y=Ue(f,b,m.detached,()=>k()),k=l.run(()=>r.watch(()=>o.state.value[t],O=>{(m.flush==="sync"?d:c)&&b({storeId:t,type:U.direct,events:w},O)},A({},u,m)));return y},$dispose:I},h=r.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&G?A({_hmrPayload:V,_customProperties:r.markRaw(new Set)},N):N);o._s.set(t,h);const v=(o._a&&o._a.runWithContext||Ho)(()=>o._e.run(()=>(l=r.effectScope()).run(()=>e({action:j}))));for(const b in v){const m=v[b];if(r.isRef(m)&&!He(m)||r.isReactive(m))process.env.NODE_ENV!=="production"&&s?bt(E.value,b,r.toRef(v,b)):a||(g&&zo(m)&&(r.isRef(m)?m.value=g[b]:Ht(m,g[b])),o.state.value[t][b]=m),process.env.NODE_ENV!=="production"&&V.state.push(b);else if(typeof m=="function"){const y=process.env.NODE_ENV!=="production"&&s?m:j(m,b);v[b]=y,process.env.NODE_ENV!=="production"&&(V.actions[b]=m),i.actions[b]=m}else process.env.NODE_ENV!=="production"&&He(m)&&(V.getters[b]=a?n.getters[b]:m,G&&(v._getters||(v._getters=r.markRaw([]))).push(b))}if(A(h,v),A(r.toRaw(h),v),Object.defineProperty(h,"$state",{get:()=>process.env.NODE_ENV!=="production"&&s?E.value:o.state.value[t],set:b=>{if(process.env.NODE_ENV!=="production"&&s)throw new Error("cannot set hotState");S(m=>{A(m,b)})}}),process.env.NODE_ENV!=="production"&&(h._hotUpdate=r.markRaw(b=>{h._hotUpdating=!0,b._hmrPayload.state.forEach(m=>{if(m in h.$state){const y=b.$state[m],k=h.$state[m];typeof y=="object"&&X(y)&&X(k)?Me(y,k):b.$state[m]=k}bt(h,m,r.toRef(b.$state,m))}),Object.keys(h.$state).forEach(m=>{m in b.$state||jt(h,m)}),c=!1,d=!1,o.state.value[t]=r.toRef(b._hmrPayload,"hotState"),d=!0,r.nextTick().then(()=>{c=!0});for(const m in b._hmrPayload.actions){const y=b[m];bt(h,m,j(y,m))}for(const m in b._hmrPayload.getters){const y=b._hmrPayload.getters[m],k=a?r.computed(()=>(ct(o),y.call(h,h))):y;bt(h,m,k)}Object.keys(h._hmrPayload.getters).forEach(m=>{m in b._hmrPayload.getters||jt(h,m)}),Object.keys(h._hmrPayload.actions).forEach(m=>{m in b._hmrPayload.actions||jt(h,m)}),h._hmrPayload=b._hmrPayload,h._getters=b._getters,h._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&G){const b={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(m=>{Object.defineProperty(h,m,A({value:h[m]},b))})}return o._p.forEach(b=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&G){const m=l.run(()=>b({store:h,app:o._a,pinia:o,options:i}));Object.keys(m||{}).forEach(y=>h._customProperties.add(y)),A(h,m)}else A(h,l.run(()=>b({store:h,app:o._a,pinia:o,options:i})))}),process.env.NODE_ENV!=="production"&&h.$state&&typeof h.$state=="object"&&typeof h.$state.constructor=="function"&&!h.$state.constructor.toString().includes("[native code]")&&console.warn(`[๐]: The "state" must be a plain object. It cannot be
|
|
8
8
|
state: () => new MyClass()
|
|
9
|
-
Found in store "${
|
|
9
|
+
Found in store "${h.$id}".`),g&&a&&n.hydrate&&n.hydrate(h.$state,g),c=!0,d=!0,h}/*! #__NO_SIDE_EFFECTS__ */function Jo(t,e,n){let o,s;const a=typeof e=="function";o=t,s=a?n:e;function l(i,u){const c=r.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&<&<._testing?null:i)||(c?r.inject(Oe,null):null),i&&ct(i),process.env.NODE_ENV!=="production"&&!lt)throw new Error(`[๐]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
10
10
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
11
|
-
This will fail in production.`);i=lt,i._s.has(o)||(a?Ft(o,e,s,i):Fe(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?Ft(f,e,s,i,!0):Fe(f,D({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&z){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}const Jo=zo("data",()=>{const t=r.ref([]),e=r.ref({});return{records:t,record:e}});function ze(t){const e=r.ref();return r.onMounted(async()=>{var n,o,s;t||(t=r.inject("$registry"));let a;try{a=Jo()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}if(e.value=new go(t,a),!t||!t.router)return;const l=t.router.currentRoute.value,i=(n=l.params.records)==null?void 0:n.toString().toLowerCase(),u=(o=l.params.record)==null?void 0:o.toString().toLowerCase();if(!i&&!u)return;const c=await((s=t.getMeta)==null?void 0:s.call(t,i));c&&(t.addDoctype(c),e.value.setup(c),i&&(u?await e.value.getRecord(c,u):await e.value.getRecords(c)),e.value.runAction(c,"LOAD",u?[u]:void 0))}),{stonecrop:e}}V(class Dt{constructor(e,n){if(V(this,"name"),V(this,"registry"),V(this,"router"),V(this,"getMeta"),Dt._root)return Dt._root;Dt._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=n}addDoctype(e){e.doctype in Object.keys(this.registry)||(this.registry[e.slug]=e),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}},"_root");function Go(t){return t&&typeof t.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var et=Promise.resolve();function Je(t,e){return t||(t=0),new Promise(function(n){return setTimeout(function(){return n(e)},t)})}function Yo(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function zt(){return Math.random().toString(36).substring(2)}var Ge=0,Jt=0;function $t(){var t=new Date().getTime();return t===Ge?(Jt++,t*1e3+Jt):(Ge=t,Jt=0,t*1e3)}var Xo=$t,Qo="native";function qo(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(n){e.messagesCallback&&e.messagesCallback(n.data)},e}function Ko(t){t.bc.close(),t.subFns=[]}function Zo(t,e){try{return t.bc.postMessage(e,!1),et}catch(n){return Promise.reject(n)}}function tr(t,e){t.messagesCallback=e}function er(){if(typeof window>"u")return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function nr(){return 150}var or={create:qo,close:Ko,onMessage:tr,postMessage:Zo,canBeUsed:er,type:Qo,averageResponseTime:nr,microSeconds:Xo},Ye=function(){function t(e){this.ttl=e,this.map=new Map,this._to=!1}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.add=function(e){var n=this;this.map.set(e,Xe()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,rr(n)},0))},t.prototype.clear=function(){this.map.clear()},t}();function rr(t){for(var e=Xe()-t.ttl,n=t.map[Symbol.iterator]();;){var o=n.next().value;if(!o)return;var s=o[0],a=o[1];if(a<e)t.map.delete(s);else return}}function Xe(){return new Date().getTime()}function Gt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return typeof e.webWorkerSupport>"u"&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=1e3*45),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),t.idb&&typeof t.idb.onclose=="function"&&(e.idb.onclose=t.idb.onclose),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=1e3*60),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=1e3*60*2),e.node.maxParallelWrites||(e.node.maxParallelWrites=2048),typeof e.node.useFastPath>"u"&&(e.node.useFastPath=!0),e}var sr=$t,ar="pubkey.broadcast-channel-0-",U="messages",Nt={durability:"relaxed"},ir="idb";function Qe(){if(typeof indexedDB<"u")return indexedDB;if(typeof window<"u"){if(typeof window.mozIndexedDB<"u")return window.mozIndexedDB;if(typeof window.webkitIndexedDB<"u")return window.webkitIndexedDB;if(typeof window.msIndexedDB<"u")return window.msIndexedDB}return!1}function Yt(t){t.commit&&t.commit()}function lr(t){var e=Qe(),n=ar+t,o=e.open(n);return o.onupgradeneeded=function(s){var a=s.target.result;a.createObjectStore(U,{keyPath:"id",autoIncrement:!0})},new Promise(function(s,a){o.onerror=function(l){return a(l)},o.onsuccess=function(){s(o.result)}})}function cr(t,e,n){var o=new Date().getTime(),s={uuid:e,time:o,data:n},a=t.transaction([U],"readwrite",Nt);return new Promise(function(l,i){a.oncomplete=function(){return l()},a.onerror=function(c){return i(c)};var u=a.objectStore(U);u.add(s),Yt(a)})}function ur(t,e){var n=t.transaction(U,"readonly",Nt),o=n.objectStore(U),s=[],a=IDBKeyRange.bound(e+1,1/0);if(o.getAll){var l=o.getAll(a);return new Promise(function(u,c){l.onerror=function(d){return c(d)},l.onsuccess=function(d){u(d.target.result)}})}function i(){try{return a=IDBKeyRange.bound(e+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,c){var d=i();d.onerror=function(f){return c(f)},d.onsuccess=function(f){var p=f.target.result;p?p.value.id<e+1?p.continue(e+1):(s.push(p.value),p.continue()):(Yt(n),u(s))}})}function dr(t,e){if(t.closed)return Promise.resolve([]);var n=t.db.transaction(U,"readwrite",Nt),o=n.objectStore(U);return Promise.all(e.map(function(s){var a=o.delete(s);return new Promise(function(l){a.onsuccess=function(){return l()}})}))}function fr(t,e){var n=new Date().getTime()-e,o=t.transaction(U,"readonly",Nt),s=o.objectStore(U),a=[];return new Promise(function(l){s.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<n?(a.push(c),u.continue()):(Yt(o),l(a))}else l(a)}})}function pr(t){return fr(t.db,t.options.idb.ttl).then(function(e){return dr(t,e.map(function(n){return n.id}))})}function mr(t,e){return e=Gt(e),lr(t).then(function(n){var o={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:zt(),eMIs:new Ye(e.idb.ttl*2),writeBlockPromise:et,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){o.closed=!0,e.idb.onclose&&e.idb.onclose()},qe(o),o})}function qe(t){t.closed||Ke(t).then(function(){return Je(t.options.idb.fallbackInterval)}).then(function(){return qe(t)})}function hr(t,e){return!(t.uuid===e.uuid||e.eMIs.has(t.id)||t.data.time<e.messagesCallbackTime)}function Ke(t){return t.closed||!t.messagesCallback?et:ur(t.db,t.lastCursorId).then(function(e){var n=e.filter(function(o){return!!o}).map(function(o){return o.id>t.lastCursorId&&(t.lastCursorId=o.id),o}).filter(function(o){return hr(o,t)}).sort(function(o,s){return o.time-s.time});return n.forEach(function(o){t.messagesCallback&&(t.eMIs.add(o.id),t.messagesCallback(o.data))}),et})}function gr(t){t.closed=!0,t.db.close()}function yr(t,e){return t.writeBlockPromise=t.writeBlockPromise.then(function(){return cr(t.db,t.uuid,e)}).then(function(){Yo(0,10)===0&&pr(t)}),t.writeBlockPromise}function wr(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,Ke(t)}function br(){return!!Qe()}function Er(t){return t.idb.fallbackInterval*2}var _r={create:mr,close:gr,onMessage:wr,postMessage:yr,canBeUsed:br,type:ir,averageResponseTime:Er,microSeconds:sr},vr=$t,kr="pubkey.broadcastChannel-",Sr="localstorage";function Ze(){var t;if(typeof window>"u")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function tn(t){return kr+t}function $r(t,e){return new Promise(function(n){Je().then(function(){var o=tn(t.channelName),s={token:zt(),time:new Date().getTime(),data:e,uuid:t.uuid},a=JSON.stringify(s);Ze().setItem(o,a);var l=document.createEvent("Event");l.initEvent("storage",!0,!0),l.key=o,l.newValue=a,window.dispatchEvent(l),n()})})}function Nr(t,e){var n=tn(t),o=function(s){s.key===n&&e(JSON.parse(s.newValue))};return window.addEventListener("storage",o),o}function xr(t){window.removeEventListener("storage",t)}function Or(t,e){if(e=Gt(e),!en())throw new Error("BroadcastChannel: localstorage cannot be used");var n=zt(),o=new Ye(e.localstorage.removeTimeout),s={channelName:t,uuid:n,eMIs:o};return s.listener=Nr(t,function(a){s.messagesCallback&&a.uuid!==n&&(!a.token||o.has(a.token)||a.data.time&&a.data.time<s.messagesCallbackTime||(o.add(a.token),s.messagesCallback(a.data)))}),s}function Cr(t){xr(t.listener)}function Ir(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e}function en(){var t=Ze();if(!t)return!1;try{var e="__broadcastchannel_check";t.setItem(e,"works"),t.removeItem(e)}catch{return!1}return!0}function Pr(){var t=120,e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?t*2:t}var Vr={create:Or,close:Cr,onMessage:Ir,postMessage:$r,canBeUsed:en,type:Sr,averageResponseTime:Pr,microSeconds:vr},Dr=$t,Tr="simulate",Xt=new Set;function Ar(t){var e={name:t,messagesCallback:null};return Xt.add(e),e}function Br(t){Xt.delete(t)}function Rr(t,e){return new Promise(function(n){return setTimeout(function(){var o=Array.from(Xt);o.filter(function(s){return s.name===t.name}).filter(function(s){return s!==t}).filter(function(s){return!!s.messagesCallback}).forEach(function(s){return s.messagesCallback(e)}),n()},5)})}function jr(t,e){t.messagesCallback=e}function Mr(){return!0}function Lr(){return 5}var Ur={create:Ar,close:Br,onMessage:jr,postMessage:Rr,canBeUsed:Mr,type:Tr,averageResponseTime:Lr,microSeconds:Dr},nn=[or,_r,Vr];function Wr(t){var e=[].concat(t.methods,nn).filter(Boolean);if(t.type){if(t.type==="simulate")return Ur;var n=e.find(function(s){return s.type===t.type});if(n)return n;throw new Error("method-type "+t.type+" not found")}t.webWorkerSupport||(e=e.filter(function(s){return s.type!=="idb"}));var o=e.find(function(s){return s.canBeUsed()});if(o)return o;throw new Error("No usable method found in "+JSON.stringify(nn.map(function(s){return s.type})))}var on=new Set,Hr=0,Qt=function(t,e){this.id=Hr++,on.add(this),this.name=t,this.options=Gt(e),this.method=Wr(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Fr(this)};Qt._pubkey=!0,Qt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return rn(this,"message",t)},postInternal:function(t){return rn(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};ln(this,"message",this._onML),t&&typeof t=="function"?(this._onML=n,an(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),o={time:n,fn:e};an(this,t,o)},removeEventListener:function(t,e){var n=this._addEL[t].find(function(o){return o.fn===e});ln(this,t,n)},close:function(){var t=this;if(!this.closed){on.delete(this),this.closed=!0;var e=this._prepP?this._prepP:et;return this._onML=null,this._addEL.message=[],e.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(n){return n()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function rn(t,e,n){var o=t.method.microSeconds(),s={time:o,type:e,data:n},a=t._prepP?t._prepP:et;return a.then(function(){var l=t.method.postMessage(t._state,s);return t._uMP.add(l),l.catch().then(function(){return t._uMP.delete(l)}),l})}function Fr(t){var e=t.method.create(t.name,t.options);Go(e)?(t._prepP=e,e.then(function(n){t._state=n})):t._state=e}function sn(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function an(t,e,n){t._addEL[e].push(n),zr(t)}function ln(t,e,n){t._addEL[e]=t._addEL[e].filter(function(o){return o!==n}),Jr(t)}function zr(t){if(!t._iL&&sn(t)){var e=function(o){t._addEL[o.type].forEach(function(s){var a=1e5,l=s.time-a;o.time>=l&&s.fn(o.data)})},n=t.method.microSeconds();t._prepP?t._prepP.then(function(){t._iL=!0,t.method.onMessage(t._state,e,n)}):(t._iL=!0,t.method.onMessage(t._state,e,n))}}function Jr(t){if(t._iL&&!sn(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}let qt=class extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}};function cn(t){return Object(t)!==t}const Gr=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yr(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Gr}function Xr(t){return Object.prototype.toString.call(t).slice(8,-1)}function Qr(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
12
|
-
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return t<" "?`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function nt(t){let e="",n=0;const o=t.length;for(let s=0;s<o;s+=1){const a=t[s],l=
|
|
11
|
+
This will fail in production.`);i=lt,i._s.has(o)||(a?Ft(o,e,s,i):Fe(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?Ft(f,e,s,i,!0):Fe(f,A({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&G){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}const Go=Jo("data",()=>{const t=r.ref([]),e=r.ref({});return{records:t,record:e}});function ze(t){const e=r.ref();return r.onMounted(async()=>{var n,o,s;t||(t=r.inject("$registry"));let a;try{a=Go()}catch{throw new Error("Please enable the Stonecrop plugin before using the Stonecrop composable")}if(e.value=new yo(t,a),!t||!t.router)return;const l=t.router.currentRoute.value,i=(n=l.params.records)==null?void 0:n.toString().toLowerCase(),u=(o=l.params.record)==null?void 0:o.toString().toLowerCase();if(!i&&!u)return;const c=await((s=t.getMeta)==null?void 0:s.call(t,i));c&&(t.addDoctype(c),e.value.setup(c),i&&(u?await e.value.getRecord(c,u):await e.value.getRecords(c)),e.value.runAction(c,"LOAD",u?[u]:void 0))}),{stonecrop:e}}T(class Dt{constructor(e,n){if(T(this,"name"),T(this,"registry"),T(this,"router"),T(this,"getMeta"),Dt._root)return Dt._root;Dt._root=this,this.name="Registry",this.registry={},this.router=e,this.getMeta=n}addDoctype(e){e.doctype in Object.keys(this.registry)||(this.registry[e.slug]=e),e.component&&this.router&&!this.router.hasRoute(e.doctype)&&this.router.addRoute({path:`/${e.slug}`,name:e.slug,component:e.component})}},"_root");function Yo(t){return t&&typeof t.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var et=Promise.resolve();function Je(t,e){return t||(t=0),new Promise(function(n){return setTimeout(function(){return n(e)},t)})}function Xo(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function zt(){return Math.random().toString(36).substring(2)}var Ge=0,Jt=0;function St(){var t=new Date().getTime();return t===Ge?(Jt++,t*1e3+Jt):(Ge=t,Jt=0,t*1e3)}var Qo=St,qo="native";function Ko(t){var e={messagesCallback:null,bc:new BroadcastChannel(t),subFns:[]};return e.bc.onmessage=function(n){e.messagesCallback&&e.messagesCallback(n.data)},e}function Zo(t){t.bc.close(),t.subFns=[]}function tr(t,e){try{return t.bc.postMessage(e,!1),et}catch(n){return Promise.reject(n)}}function er(t,e){t.messagesCallback=e}function nr(){if(typeof window>"u")return!1;if(typeof BroadcastChannel=="function"){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}else return!1}function or(){return 150}var rr={create:Ko,close:Zo,onMessage:er,postMessage:tr,canBeUsed:nr,type:qo,averageResponseTime:or,microSeconds:Qo},Ye=function(){function t(e){this.ttl=e,this.map=new Map,this._to=!1}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.add=function(e){var n=this;this.map.set(e,Xe()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,sr(n)},0))},t.prototype.clear=function(){this.map.clear()},t}();function sr(t){for(var e=Xe()-t.ttl,n=t.map[Symbol.iterator]();;){var o=n.next().value;if(!o)return;var s=o[0],a=o[1];if(a<e)t.map.delete(s);else return}}function Xe(){return new Date().getTime()}function Gt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=JSON.parse(JSON.stringify(t));return typeof e.webWorkerSupport>"u"&&(e.webWorkerSupport=!0),e.idb||(e.idb={}),e.idb.ttl||(e.idb.ttl=1e3*45),e.idb.fallbackInterval||(e.idb.fallbackInterval=150),t.idb&&typeof t.idb.onclose=="function"&&(e.idb.onclose=t.idb.onclose),e.localstorage||(e.localstorage={}),e.localstorage.removeTimeout||(e.localstorage.removeTimeout=1e3*60),t.methods&&(e.methods=t.methods),e.node||(e.node={}),e.node.ttl||(e.node.ttl=1e3*60*2),e.node.maxParallelWrites||(e.node.maxParallelWrites=2048),typeof e.node.useFastPath>"u"&&(e.node.useFastPath=!0),e}var ar=St,ir="pubkey.broadcast-channel-0-",H="messages",Nt={durability:"relaxed"},lr="idb";function Qe(){if(typeof indexedDB<"u")return indexedDB;if(typeof window<"u"){if(typeof window.mozIndexedDB<"u")return window.mozIndexedDB;if(typeof window.webkitIndexedDB<"u")return window.webkitIndexedDB;if(typeof window.msIndexedDB<"u")return window.msIndexedDB}return!1}function Yt(t){t.commit&&t.commit()}function cr(t){var e=Qe(),n=ir+t,o=e.open(n);return o.onupgradeneeded=function(s){var a=s.target.result;a.createObjectStore(H,{keyPath:"id",autoIncrement:!0})},new Promise(function(s,a){o.onerror=function(l){return a(l)},o.onsuccess=function(){s(o.result)}})}function ur(t,e,n){var o=new Date().getTime(),s={uuid:e,time:o,data:n},a=t.transaction([H],"readwrite",Nt);return new Promise(function(l,i){a.oncomplete=function(){return l()},a.onerror=function(c){return i(c)};var u=a.objectStore(H);u.add(s),Yt(a)})}function dr(t,e){var n=t.transaction(H,"readonly",Nt),o=n.objectStore(H),s=[],a=IDBKeyRange.bound(e+1,1/0);if(o.getAll){var l=o.getAll(a);return new Promise(function(u,c){l.onerror=function(d){return c(d)},l.onsuccess=function(d){u(d.target.result)}})}function i(){try{return a=IDBKeyRange.bound(e+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,c){var d=i();d.onerror=function(f){return c(f)},d.onsuccess=function(f){var p=f.target.result;p?p.value.id<e+1?p.continue(e+1):(s.push(p.value),p.continue()):(Yt(n),u(s))}})}function fr(t,e){if(t.closed)return Promise.resolve([]);var n=t.db.transaction(H,"readwrite",Nt),o=n.objectStore(H);return Promise.all(e.map(function(s){var a=o.delete(s);return new Promise(function(l){a.onsuccess=function(){return l()}})}))}function pr(t,e){var n=new Date().getTime()-e,o=t.transaction(H,"readonly",Nt),s=o.objectStore(H),a=[];return new Promise(function(l){s.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var c=u.value;c.time<n?(a.push(c),u.continue()):(Yt(o),l(a))}else l(a)}})}function mr(t){return pr(t.db,t.options.idb.ttl).then(function(e){return fr(t,e.map(function(n){return n.id}))})}function hr(t,e){return e=Gt(e),cr(t).then(function(n){var o={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:zt(),eMIs:new Ye(e.idb.ttl*2),writeBlockPromise:et,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){o.closed=!0,e.idb.onclose&&e.idb.onclose()},qe(o),o})}function qe(t){t.closed||Ke(t).then(function(){return Je(t.options.idb.fallbackInterval)}).then(function(){return qe(t)})}function gr(t,e){return!(t.uuid===e.uuid||e.eMIs.has(t.id)||t.data.time<e.messagesCallbackTime)}function Ke(t){return t.closed||!t.messagesCallback?et:dr(t.db,t.lastCursorId).then(function(e){var n=e.filter(function(o){return!!o}).map(function(o){return o.id>t.lastCursorId&&(t.lastCursorId=o.id),o}).filter(function(o){return gr(o,t)}).sort(function(o,s){return o.time-s.time});return n.forEach(function(o){t.messagesCallback&&(t.eMIs.add(o.id),t.messagesCallback(o.data))}),et})}function yr(t){t.closed=!0,t.db.close()}function wr(t,e){return t.writeBlockPromise=t.writeBlockPromise.then(function(){return ur(t.db,t.uuid,e)}).then(function(){Xo(0,10)===0&&mr(t)}),t.writeBlockPromise}function br(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,Ke(t)}function Er(){return!!Qe()}function _r(t){return t.idb.fallbackInterval*2}var vr={create:hr,close:yr,onMessage:br,postMessage:wr,canBeUsed:Er,type:lr,averageResponseTime:_r,microSeconds:ar},kr=St,$r="pubkey.broadcastChannel-",Sr="localstorage";function Ze(){var t;if(typeof window>"u")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function tn(t){return $r+t}function Nr(t,e){return new Promise(function(n){Je().then(function(){var o=tn(t.channelName),s={token:zt(),time:new Date().getTime(),data:e,uuid:t.uuid},a=JSON.stringify(s);Ze().setItem(o,a);var l=document.createEvent("Event");l.initEvent("storage",!0,!0),l.key=o,l.newValue=a,window.dispatchEvent(l),n()})})}function xr(t,e){var n=tn(t),o=function(s){s.key===n&&e(JSON.parse(s.newValue))};return window.addEventListener("storage",o),o}function Or(t){window.removeEventListener("storage",t)}function Cr(t,e){if(e=Gt(e),!en())throw new Error("BroadcastChannel: localstorage cannot be used");var n=zt(),o=new Ye(e.localstorage.removeTimeout),s={channelName:t,uuid:n,eMIs:o};return s.listener=xr(t,function(a){s.messagesCallback&&a.uuid!==n&&(!a.token||o.has(a.token)||a.data.time&&a.data.time<s.messagesCallbackTime||(o.add(a.token),s.messagesCallback(a.data)))}),s}function Pr(t){Or(t.listener)}function Ir(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e}function en(){var t=Ze();if(!t)return!1;try{var e="__broadcastchannel_check";t.setItem(e,"works"),t.removeItem(e)}catch{return!1}return!0}function Vr(){var t=120,e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?t*2:t}var Dr={create:Cr,close:Pr,onMessage:Ir,postMessage:Nr,canBeUsed:en,type:Sr,averageResponseTime:Vr,microSeconds:kr},Tr=St,Ar="simulate",Xt=new Set;function Br(t){var e={name:t,messagesCallback:null};return Xt.add(e),e}function Rr(t){Xt.delete(t)}function jr(t,e){return new Promise(function(n){return setTimeout(function(){var o=Array.from(Xt);o.filter(function(s){return s.name===t.name}).filter(function(s){return s!==t}).filter(function(s){return!!s.messagesCallback}).forEach(function(s){return s.messagesCallback(e)}),n()},5)})}function Mr(t,e){t.messagesCallback=e}function Lr(){return!0}function Ur(){return 5}var Wr={create:Br,close:Rr,onMessage:Mr,postMessage:jr,canBeUsed:Lr,type:Ar,averageResponseTime:Ur,microSeconds:Tr},nn=[rr,vr,Dr];function Hr(t){var e=[].concat(t.methods,nn).filter(Boolean);if(t.type){if(t.type==="simulate")return Wr;var n=e.find(function(s){return s.type===t.type});if(n)return n;throw new Error("method-type "+t.type+" not found")}t.webWorkerSupport||(e=e.filter(function(s){return s.type!=="idb"}));var o=e.find(function(s){return s.canBeUsed()});if(o)return o;throw new Error("No usable method found in "+JSON.stringify(nn.map(function(s){return s.type})))}var on=new Set,Fr=0,Qt=function(t,e){this.id=Fr++,on.add(this),this.name=t,this.options=Gt(e),this.method=Hr(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,zr(this)};Qt._pubkey=!0,Qt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return rn(this,"message",t)},postInternal:function(t){return rn(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};ln(this,"message",this._onML),t&&typeof t=="function"?(this._onML=n,an(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),o={time:n,fn:e};an(this,t,o)},removeEventListener:function(t,e){var n=this._addEL[t].find(function(o){return o.fn===e});ln(this,t,n)},close:function(){var t=this;if(!this.closed){on.delete(this),this.closed=!0;var e=this._prepP?this._prepP:et;return this._onML=null,this._addEL.message=[],e.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(n){return n()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function rn(t,e,n){var o=t.method.microSeconds(),s={time:o,type:e,data:n},a=t._prepP?t._prepP:et;return a.then(function(){var l=t.method.postMessage(t._state,s);return t._uMP.add(l),l.catch().then(function(){return t._uMP.delete(l)}),l})}function zr(t){var e=t.method.create(t.name,t.options);Yo(e)?(t._prepP=e,e.then(function(n){t._state=n})):t._state=e}function sn(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function an(t,e,n){t._addEL[e].push(n),Jr(t)}function ln(t,e,n){t._addEL[e]=t._addEL[e].filter(function(o){return o!==n}),Gr(t)}function Jr(t){if(!t._iL&&sn(t)){var e=function(o){t._addEL[o.type].forEach(function(s){var a=1e5,l=s.time-a;o.time>=l&&s.fn(o.data)})},n=t.method.microSeconds();t._prepP?t._prepP.then(function(){t._iL=!0,t.method.onMessage(t._state,e,n)}):(t._iL=!0,t.method.onMessage(t._state,e,n))}}function Gr(t){if(t._iL&&!sn(t)){t._iL=!1;var e=t.method.microSeconds();t.method.onMessage(t._state,null,e)}}let qt=class extends Error{constructor(e,n){super(e),this.name="DevalueError",this.path=n.join("")}};function cn(t){return Object(t)!==t}const Yr=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xr(t){const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===Yr}function Qr(t){return Object.prototype.toString.call(t).slice(8,-1)}function qr(t){switch(t){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
12
|
+
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return t<" "?`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function nt(t){let e="",n=0;const o=t.length;for(let s=0;s<o;s+=1){const a=t[s],l=qr(a);l&&(e+=t.slice(n,s)+l,n=s+1)}return`"${n===0?t:e+t.slice(n)}"`}const Kt=-1,un=-2,dn=-3,fn=-4,pn=-5,Zt=-6;function mn(t,e){return Kr(JSON.parse(t))}function Kr(t,e){if(typeof t=="number")return s(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,o=Array(n.length);function s(a,l=!1){if(a===Kt)return;if(a===dn)return NaN;if(a===fn)return 1/0;if(a===pn)return-1/0;if(a===Zt)return-0;if(l)throw new Error("Invalid input");if(a in o)return o[a];const i=n[a];if(!i||typeof i!="object")o[a]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const u=i[0];switch(u){case"Date":o[a]=new Date(i[1]);break;case"Set":const c=new Set;o[a]=c;for(let p=1;p<i.length;p+=1)c.add(s(i[p]));break;case"Map":const d=new Map;o[a]=d;for(let p=1;p<i.length;p+=2)d.set(s(i[p]),s(i[p+1]));break;case"RegExp":o[a]=new RegExp(i[1],i[2]);break;case"Object":o[a]=Object(i[1]);break;case"BigInt":o[a]=BigInt(i[1]);break;case"null":const f=Object.create(null);o[a]=f;for(let p=1;p<i.length;p+=2)f[i[p]]=s(i[p+1]);break;default:throw new Error(`Unknown type ${u}`)}}else{const u=new Array(i.length);o[a]=u;for(let c=0;c<i.length;c+=1){const d=i[c];d!==un&&(u[c]=s(d))}}else{const u={};o[a]=u;for(const c in i){const d=i[c];u[c]=s(d)}}return o[a]}return s(0)}function hn(t,e){const n=[],o=new Map,s=[];for(const c in e)s.push({key:c,fn:e[c]});const a=[];let l=0;function i(c){if(typeof c=="function")throw new qt("Cannot stringify a function",a);if(o.has(c))return o.get(c);if(c===void 0)return Kt;if(Number.isNaN(c))return dn;if(c===1/0)return fn;if(c===-1/0)return pn;if(c===0&&1/c<0)return Zt;const d=l++;o.set(c,d);for(const{key:p,fn:w}of s){const g=w(c);if(g)return n[d]=`["${p}",${i(g)}]`,d}let f="";if(cn(c))f=te(c);else switch(Qr(c)){case"Number":case"String":case"Boolean":f=`["Object",${te(c)}]`;break;case"BigInt":f=`["BigInt",${c}]`;break;case"Date":f=`["Date","${isNaN(c.getDate())?"":c.toISOString()}"]`;break;case"RegExp":const{source:p,flags:w}=c;f=w?`["RegExp",${nt(p)},"${w}"]`:`["RegExp",${nt(p)}]`;break;case"Array":f="[";for(let g=0;g<c.length;g+=1)g>0&&(f+=","),g in c?(a.push(`[${g}]`),f+=i(c[g]),a.pop()):f+=un;f+="]";break;case"Set":f='["Set"';for(const g of c)f+=`,${i(g)}`;f+="]";break;case"Map":f='["Map"';for(const[g,E]of c)a.push(`.get(${cn(g)?te(g):"..."})`),f+=`,${i(g)},${i(E)}`,a.pop();f+="]";break;default:if(!Xr(c))throw new qt("Cannot stringify arbitrary non-POJOs",a);if(Object.getOwnPropertySymbols(c).length>0)throw new qt("Cannot stringify POJOs with symbolic keys",a);if(Object.getPrototypeOf(c)===null){f='["null"';for(const g in c)a.push(`.${g}`),f+=`,${nt(g)},${i(c[g])}`,a.pop();f+="]"}else{f="{";let g=!1;for(const E in c)g&&(f+=","),g=!0,a.push(`.${E}`),f+=`${nt(E)}:${i(c[E])}`,a.pop();f+="}"}}return n[d]=f,d}const u=i(t);return u<0?`${u}`:`[${n.join(",")}]`}function te(t){const e=typeof t;return e==="string"?nt(t):t instanceof String?nt(t.toString()):t===void 0?Kt.toString():t===0&&1/t<0?Zt.toString():e==="bigint"?`["BigInt","${t}"]`:String(t)}function Zr(t,e,{initialize:n,type:o}){let s=`${e.$id}-${t.toString()}`,a=new Qt(s,{type:o}),l=!1,i=0;r.watch(()=>e[t],d=>{l||(i=Date.now(),a.postMessage({timestamp:i,state:mn(hn(d))})),l=!1},{deep:!0}),a.onmessage=d=>{if(d===void 0){a.postMessage({timestamp:i,state:mn(hn(e[t]))});return}d.timestamp<=i||(l=!0,i=d.timestamp,e[t]=d.state)};let u=()=>a.postMessage(void 0),c=()=>a.close();return n&&u(),{sync:u,unshare:c}}var ts=(t,e)=>Object.keys(e).includes(t),es=({initialize:t=!0,enable:e=!0,type:n})=>({store:o,options:s})=>{var a,l;let i=((a=s==null?void 0:s.share)==null?void 0:a.enable)??e,u=((l=s==null?void 0:s.share)==null?void 0:l.omit)??[];!i||Object.keys(o.$state).forEach(c=>{var d;u.includes(c)||!ts(c,o.$state)||Zr(c,o,{initialize:((d=s==null?void 0:s.share)==null?void 0:d.initialize)??t,type:n})})};Wo().use(es({enable:!0,initialize:!0}));const gn=r.defineComponent({__name:"Doctype",setup(t){const{stonecrop:e,isReady:n}=ze(),o=r.ref([]);return r.watch(n,()=>{if(n.value){let s=e.value.schema.schema.toArray();s.forEach((a,l)=>{const u=e.value.store.record[a.fieldname];s[l].value=u}),o.value=s}}),(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(mo),{key:0,class:"aform-main",modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=l=>o.value=l)},null,8,["modelValue"])):r.createCommentVNode("",!0)}});var ns=!1;function xt(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function ee(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}/*!
|
|
13
13
|
* pinia v2.3.0
|
|
14
14
|
* (c) 2024 Eduardo San Martin Morote
|
|
15
15
|
* @license MIT
|
|
16
|
-
*/let ut;const Ot=t=>ut=t,
|
|
16
|
+
*/let ut;const Ot=t=>ut=t,os=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function q(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var dt;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(dt||(dt={}));const ft=typeof window<"u";function yn(t,e){for(const n in e){const o=e[n];if(!(n in t))continue;const s=t[n];q(s)&&q(o)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=yn(s,o):t[n]=o}return t}const wn=()=>{};function bn(t,e,n,o=wn){t.push(e);const s=()=>{const a=t.indexOf(e);a>-1&&(t.splice(a,1),o())};return!n&&r.getCurrentScope()&&r.onScopeDispose(s),s}function ot(t,...e){t.slice().forEach(n=>{n(...e)})}const rs=t=>t(),En=Symbol(),ne=Symbol();function oe(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,o)=>t.set(o,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const o=e[n],s=t[n];q(s)&&q(o)&&t.hasOwnProperty(n)&&!r.isRef(o)&&!r.isReactive(o)?t[n]=oe(s,o):t[n]=o}return t}const ss=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function as(t){return!q(t)||!t.hasOwnProperty(ss)}const{assign:B}=Object;function _n(t){return!!(r.isRef(t)&&t.effect)}function vn(t,e,n,o){const{state:s,actions:a,getters:l}=e,i=n.state.value[t];let u;function c(){!i&&(process.env.NODE_ENV==="production"||!o)&&(n.state.value[t]=s?s():{});const d=process.env.NODE_ENV!=="production"&&o?r.toRefs(r.ref(s?s():{}).value):r.toRefs(n.state.value[t]);return B(d,a,Object.keys(l||{}).reduce((f,p)=>(process.env.NODE_ENV!=="production"&&p in d&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${t}".`),f[p]=r.markRaw(r.computed(()=>{Ot(n);const w=n._s.get(t);return l[p].call(w,w)})),f),{}))}return u=re(t,c,e,n,o,!0),u}function re(t,e,n={},o,s,a){let l;const i=B({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!o._e.active)throw new Error("Pinia destroyed");const u={deep:!0};process.env.NODE_ENV!=="production"&&!ns&&(u.onTrigger=m=>{c?w=m:c==!1&&!h._hotUpdating&&(Array.isArray(w)?w.push(m):console.error("๐ debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,d,f=[],p=[],w;const g=o.state.value[t];!a&&!g&&(process.env.NODE_ENV==="production"||!s)&&(o.state.value[t]={});const E=r.ref({});let _;function S(m){let y;c=d=!1,process.env.NODE_ENV!=="production"&&(w=[]),typeof m=="function"?(m(o.state.value[t]),y={type:dt.patchFunction,storeId:t,events:w}):(oe(o.state.value[t],m),y={type:dt.patchObject,payload:m,storeId:t,events:w});const k=_=Symbol();r.nextTick().then(()=>{_===k&&(c=!0)}),d=!0,ot(f,y,o.state.value[t])}const $=a?function(){const{state:y}=n,k=y?y():{};this.$patch(O=>{B(O,k)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`๐: Store "${t}" is built using the setup syntax and does not implement $reset().`)}:wn;function I(){l.stop(),f=[],p=[],o._s.delete(t)}const j=(m,y="")=>{if(En in m)return m[ne]=y,m;const k=function(){Ot(o);const O=Array.from(arguments),J=[],wt=[];function ge(M){J.push(M)}function K(M){wt.push(M)}ot(p,{args:O,name:k[ne],store:h,after:ge,onError:K});let C;try{C=m.apply(this&&this.$id===t?this:h,O)}catch(M){throw ot(wt,M),M}return C instanceof Promise?C.then(M=>(ot(J,M),M)).catch(M=>(ot(wt,M),Promise.reject(M))):(ot(J,C),C)};return k[En]=!0,k[ne]=y,k},V=r.markRaw({actions:{},getters:{},state:[],hotState:E}),N={_p:o,$id:t,$onAction:bn.bind(null,p),$patch:S,$reset:$,$subscribe(m,y={}){const k=bn(f,m,y.detached,()=>O()),O=l.run(()=>r.watch(()=>o.state.value[t],J=>{(y.flush==="sync"?d:c)&&m({storeId:t,type:dt.direct,events:w},J)},B({},u,y)));return k},$dispose:I},h=r.reactive(process.env.NODE_ENV!=="production"||process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ft?B({_hmrPayload:V,_customProperties:r.markRaw(new Set)},N):N);o._s.set(t,h);const b=(o._a&&o._a.runWithContext||rs)(()=>o._e.run(()=>(l=r.effectScope()).run(()=>e({action:j}))));for(const m in b){const y=b[m];if(r.isRef(y)&&!_n(y)||r.isReactive(y))process.env.NODE_ENV!=="production"&&s?xt(E.value,m,r.toRef(b,m)):a||(g&&as(y)&&(r.isRef(y)?y.value=g[m]:oe(y,g[m])),o.state.value[t][m]=y),process.env.NODE_ENV!=="production"&&V.state.push(m);else if(typeof y=="function"){const k=process.env.NODE_ENV!=="production"&&s?y:j(y,m);b[m]=k,process.env.NODE_ENV!=="production"&&(V.actions[m]=y),i.actions[m]=y}else process.env.NODE_ENV!=="production"&&_n(y)&&(V.getters[m]=a?n.getters[m]:y,ft&&(b._getters||(b._getters=r.markRaw([]))).push(m))}if(B(h,b),B(r.toRaw(h),b),Object.defineProperty(h,"$state",{get:()=>process.env.NODE_ENV!=="production"&&s?E.value:o.state.value[t],set:m=>{if(process.env.NODE_ENV!=="production"&&s)throw new Error("cannot set hotState");S(y=>{B(y,m)})}}),process.env.NODE_ENV!=="production"&&(h._hotUpdate=r.markRaw(m=>{h._hotUpdating=!0,m._hmrPayload.state.forEach(y=>{if(y in h.$state){const k=m.$state[y],O=h.$state[y];typeof k=="object"&&q(k)&&q(O)?yn(k,O):m.$state[y]=O}xt(h,y,r.toRef(m.$state,y))}),Object.keys(h.$state).forEach(y=>{y in m.$state||ee(h,y)}),c=!1,d=!1,o.state.value[t]=r.toRef(m._hmrPayload,"hotState"),d=!0,r.nextTick().then(()=>{c=!0});for(const y in m._hmrPayload.actions){const k=m[y];xt(h,y,j(k,y))}for(const y in m._hmrPayload.getters){const k=m._hmrPayload.getters[y],O=a?r.computed(()=>(Ot(o),k.call(h,h))):k;xt(h,y,O)}Object.keys(h._hmrPayload.getters).forEach(y=>{y in m._hmrPayload.getters||ee(h,y)}),Object.keys(h._hmrPayload.actions).forEach(y=>{y in m._hmrPayload.actions||ee(h,y)}),h._hmrPayload=m._hmrPayload,h._getters=m._getters,h._hotUpdating=!1})),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ft){const m={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(y=>{Object.defineProperty(h,y,B({value:h[y]},m))})}return o._p.forEach(m=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ft){const y=l.run(()=>m({store:h,app:o._a,pinia:o,options:i}));Object.keys(y||{}).forEach(k=>h._customProperties.add(k)),B(h,y)}else B(h,l.run(()=>m({store:h,app:o._a,pinia:o,options:i})))}),process.env.NODE_ENV!=="production"&&h.$state&&typeof h.$state=="object"&&typeof h.$state.constructor=="function"&&!h.$state.constructor.toString().includes("[native code]")&&console.warn(`[๐]: The "state" must be a plain object. It cannot be
|
|
17
17
|
state: () => new MyClass()
|
|
18
|
-
Found in store "${
|
|
18
|
+
Found in store "${h.$id}".`),g&&a&&n.hydrate&&n.hydrate(h.$state,g),c=!0,d=!0,h}/*! #__NO_SIDE_EFFECTS__ */function is(t,e,n){let o,s;const a=typeof e=="function";if(typeof t=="string")o=t,s=a?n:e;else if(s=t,o=t.id,process.env.NODE_ENV!=="production"&&typeof o!="string")throw new Error('[๐]: "defineStore()" must be passed a store id as its first argument.');function l(i,u){const c=r.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&&ut&&ut._testing?null:i)||(c?r.inject(os,null):null),i&&Ot(i),process.env.NODE_ENV!=="production"&&!ut)throw new Error(`[๐]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
19
19
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
20
|
-
This will fail in production.`);i=ut,i._s.has(o)||(a?re(o,e,s,i):vn(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?re(f,e,s,i,!0):vn(f,T({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&ft){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}function kn(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function se(t){return typeof t=="function"?t():r.unref(t)}const is=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ls=t=>t!=null,cs=Object.prototype.toString,us=t=>cs.call(t)==="[object Object]",ds=()=>{},pt=is?window:void 0;function mt(t){var e;const n=se(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ht(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=pt):[e,n,o,s]=t,!e)return ds;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[mt(e),se(s)],([d,f])=>{if(l(),!d)return;const p=us(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return kn(c),c}function fs(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function ps(t){const e=fs();return r.computed(()=>(e.value,!!t()))}function ms(t,e,n={}){const{window:o=pt,...s}=n;let a;const l=ps(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=se(t),w=(Array.isArray(p)?p:[p]).map(mt).filter(ls);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return kn(f),{isSupported:l,stop:f,takeRecords:d}}function hs(t={}){var e;const{window:n=pt,deep:o=!0,triggerOnRemoval:s=!1}=t,a=(e=t.document)!=null?e:n==null?void 0:n.document,l=()=>{var c;let d=a==null?void 0:a.activeElement;if(o)for(;d!=null&&d.shadowRoot;)d=(c=d==null?void 0:d.shadowRoot)==null?void 0:c.activeElement;return d},i=r.ref(),u=()=>{i.value=l()};return n&&(ht(n,"blur",c=>{c.relatedTarget===null&&u()},!0),ht(n,"focus",u,!0)),s&&ms(a,c=>{c.filter(d=>d.removedNodes.length).map(d=>Array.from(d.removedNodes)).flat().forEach(d=>{d===i.value&&u()})},{childList:!0,subtree:!0}),u(),i}const gs="focusin",ys="focusout";function ws(t,e={}){const{window:n=pt}=e,o=r.computed(()=>mt(t)),s=r.ref(!1),a=r.computed(()=>s.value),l=hs(e);return!n||!l.value?{focused:a}:(ht(o,gs,()=>s.value=!0),ht(o,ys,()=>s.value=!1),{focused:a})}function bs(t,{window:e=pt,scrollTarget:n}={}){const o=r.ref(!1),s=()=>{if(!e)return;const a=e.document,l=mt(t);if(!l)o.value=!1;else{const i=l.getBoundingClientRect();o.value=i.top<=(e.innerHeight||a.documentElement.clientHeight)&&i.left<=(e.innerWidth||a.documentElement.clientWidth)&&i.bottom>=0&&i.right>=0}};return r.watch(()=>mt(t),()=>s(),{immediate:!0,flush:"post"}),e&&ht(n||e,"scroll",s,{capture:!1,passive:!0}),o}const W=t=>{let e=bs(t).value;return e=e&&t.offsetHeight>0,e},H=t=>t.tabIndex>=0,Sn=t=>{const e=t.target;return ae(e)},ae=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.previousElementSibling;o&&(n=o)}return n&&(!H(n)||!W(n))?ae(n):n},Es=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.firstElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.firstElementChild;a&&(o=a)}}return o&&(!H(o)||!W(o))?ie(o):o},$n=t=>{const e=t.target;return ie(e)},ie=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.nextElementSibling;o&&(n=o)}return n&&(!H(n)||!W(n))?ie(n):n},_s=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.lastElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.lastElementChild;a&&(o=a)}}return o&&(!H(o)||!W(o))?ae(o):o},Nn=t=>{const e=t.target;return le(e)},le=t=>{var e;let n;if(t.previousElementSibling)n=t.previousElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;n=o==null?void 0:o.lastElementChild}return n&&(!H(n)||!W(n))?le(n):n},xn=t=>{const e=t.target;return ce(e)},ce=t=>{var e;let n;if(t.nextElementSibling)n=t.nextElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;n=o==null?void 0:o.firstElementChild}return n&&(!H(n)||!W(n))?ce(n):n},On=t=>{const e=t.target.parentElement,n=e==null?void 0:e.firstElementChild;return n&&(!H(n)||!W(n))?ce(n):n},Cn=t=>{const e=t.target.parentElement,n=e==null?void 0:e.lastElementChild;return n&&(!H(n)||!W(n))?le(n):n},Ct=["alt","control","shift","meta"],vs={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ue={"keydown.up":t=>{const e=Sn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.down":t=>{const e=$n(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.left":t=>{const e=Nn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.right":t=>{const e=xn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.control.up":t=>{const e=Es(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.down":t=>{const e=_s(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.left":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.right":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.end":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=$n(t);e&&e.focus()}},"keydown.shift.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=Sn(t);e&&e.focus()}},"keydown.home":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.tab":t=>{const e=xn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.shift.tab":t=>{const e=Nn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())}};function In(t){const e=l=>{let i=null;return l.parent&&(typeof l.parent=="string"?i=document.querySelector(l.parent):l.parent instanceof HTMLElement?i=l.parent:i=l.parent.value),i},n=l=>{var i;const u=e(l);let c=[];if(typeof l.selectors=="string")c=u?Array.from(u.querySelectorAll(l.selectors)):Array.from(document.querySelectorAll(l.selectors));else if(Array.isArray(l.selectors))for(const d of l.selectors)d instanceof HTMLElement?c.push(d):c.push(d.$el);else if(l.selectors instanceof HTMLElement)c.push(l.selectors);else if((i=l.selectors)!=null&&i.value)if(Array.isArray(l.selectors.value))for(const d of l.selectors.value)d instanceof HTMLElement?c.push(d):c.push(d.$el);else c.push(l.selectors.value);return c},o=l=>{const i=e(l);let u=[];return l.selectors?u=n(l):i&&(u=Array.from(i.children).filter(c=>H(c)&&W(c))),u},s=l=>i=>{const u=vs[i.key]||i.key.toLowerCase();if(Ct.includes(u))return;const c=l.handlers||ue;for(const d of Object.keys(c)){const[f,...p]=d.split(".");if(f==="keydown"&&p.includes(u)){const w=c[d],h=p.filter(_=>Ct.includes(_)),E=Ct.some(_=>{const S=_.charAt(0).toUpperCase()+_.slice(1);return i.getModifierState(S)});if(h.length>0){if(E){for(const _ of Ct)if(p.includes(_)){const S=_.charAt(0).toUpperCase()+_.slice(1);i.getModifierState(S)&&w(i)}}}else E||w(i)}}},a=[];r.onMounted(()=>{for(const l of t){const i=e(l),u=o(l),c=s(l),d=i?[i]:u;for(const f of d){const{focused:p}=ws(r.ref(f)),w=r.watch(p,h=>{h?f.addEventListener("keydown",c):f.removeEventListener("keydown",c)});a.push(w)}}}),r.onBeforeUnmount(()=>{for(const l of a)l()})}function gt(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function A(t){return typeof t=="function"?t():r.unref(t)}const de=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ks=t=>t!=null,Ss=Object.prototype.toString,Pn=t=>Ss.call(t)==="[object Object]",rt=()=>{},fe=$s();function $s(){var t,e;return de&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Ns(t){return r.getCurrentInstance()}function xs(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:rt}))):r.ref(e)}function Os(t,e=!0,n){Ns()?r.onMounted(t,n):e?t():r.nextTick(t)}const It=de?window:void 0;function st(t){var e;const n=A(t);return(e=n==null?void 0:n.$el)!=null?e:n}function pe(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=It):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[st(e),A(s)],([d,f])=>{if(l(),!d)return;const p=Pn(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}function Cs(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function Vn(t){const e=Cs();return r.computed(()=>(e.value,!!t()))}function Dn(t,e,n={}){const{window:o=It,...s}=n;let a;const l=Vn(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=A(t),w=(Array.isArray(p)?p:[p]).map(st).filter(ks);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return gt(f),{isSupported:l,stop:f,takeRecords:d}}function Is(t,e,n={}){const{window:o=It,...s}=n;let a;const l=Vn(()=>o&&"ResizeObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const f=A(t);return Array.isArray(f)?f.map(p=>st(p)):[st(f)]}),c=r.watch(u,f=>{if(i(),l.value&&o){a=new ResizeObserver(e);for(const p of f)p&&a.observe(p,s)}},{immediate:!0,flush:"post"}),d=()=>{i(),c()};return gt(d),{isSupported:l,stop:d}}function Tn(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:s=!0,immediate:a=!0,updateTiming:l="sync"}=e,i=r.ref(0),u=r.ref(0),c=r.ref(0),d=r.ref(0),f=r.ref(0),p=r.ref(0),w=r.ref(0),h=r.ref(0);function E(){const S=st(t);if(!S){n&&(i.value=0,u.value=0,c.value=0,d.value=0,f.value=0,p.value=0,w.value=0,h.value=0);return}const $=S.getBoundingClientRect();i.value=$.height,u.value=$.bottom,c.value=$.left,d.value=$.right,f.value=$.top,p.value=$.width,w.value=$.x,h.value=$.y}function _(){l==="sync"?E():l==="next-frame"&&requestAnimationFrame(()=>E())}return Is(t,_),r.watch(()=>st(t),S=>!S&&_()),Dn(t,_,{attributeFilter:["style","class"]}),s&&pe("scroll",_,{capture:!0,passive:!0}),o&&pe("resize",_,{passive:!0}),Os(()=>{a&&_()}),{height:i,bottom:u,left:c,right:d,top:f,width:p,x:w,y:h,update:_}}function Ps(t={}){const{window:e=It,behavior:n="auto"}=t;if(!e)return{x:r.ref(0),y:r.ref(0)};const o=r.ref(e.scrollX),s=r.ref(e.scrollY),a=r.computed({get(){return o.value},set(i){scrollTo({left:i,behavior:n})}}),l=r.computed({get(){return s.value},set(i){scrollTo({top:i,behavior:n})}});return pe(e,"scroll",()=>{o.value=e.scrollX,s.value=e.scrollY},{capture:!1,passive:!0}),{x:a,y:l}}const Vs=t=>{const e=new DOMParser().parseFromString(t,"text/html");return Array.from(e.body.childNodes).some(n=>n.nodeType===1)},Ds=(t=8)=>Array.from({length:t},()=>Math.floor(Math.random()*16).toString(16)).join(""),Ts=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],As=["innerHTML"],Bs={key:2},Rs=r.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean}},emits:["cellInput"],setup(t,{emit:e}){const n=e,o=r.useTemplateRef("cell"),s=t.store.getCellData(t.colIndex,t.rowIndex),a=r.ref(""),l=r.ref(!1),i=t.store.columns[t.colIndex],u=t.store.rows[t.rowIndex],c=i.align||"center",d=i.width||"40ch",f=r.computed(()=>t.store.getCellDisplayValue(t.colIndex,t.rowIndex)),p=r.computed(()=>typeof f.value=="string"?Vs(f.value):!1),w=r.computed(()=>{var S;return{textAlign:c,width:d,backgroundColor:l.value?"var(--sc-cell-changed-color)":"inherit",fontWeight:l.value?"bold":"inherit",paddingLeft:t.store.getIndent(t.colIndex,(S=t.store.display[t.rowIndex])==null?void 0:S.indent)}}),h=()=>{const{left:S,bottom:$,width:q,height:B}=Tn(o);i.mask,i.modalComponent&&t.store.$patch(N=>{N.modal.visible=!0,N.modal.colIndex=t.colIndex,N.modal.rowIndex=t.rowIndex,N.modal.left=S,N.modal.bottom=$,N.modal.width=q,N.modal.height=B,typeof i.modalComponent=="function"?N.modal.component=i.modalComponent({table:N.table,row:u,column:i}):N.modal.component=i.modalComponent,N.modal.componentProps=i.modalComponentExtraProps})};if(t.addNavigation){let S={...ue,"keydown.f2":h,"keydown.alt.up":h,"keydown.alt.down":h,"keydown.alt.left":h,"keydown.alt.right":h};typeof t.addNavigation=="object"&&(S={...S,...t.addNavigation}),In([{selectors:o,handlers:S}])}const E=()=>{o.value&&(a.value=o.value.textContent)},_=S=>{const $=S.target;$.textContent!==a.value&&(n("cellInput",t.colIndex,t.rowIndex,$.textContent,a.value),a.value=$.textContent,i.format?(l.value=$.textContent!==t.store.getFormattedValue(t.colIndex,t.rowIndex,s),t.store.setCellText(t.colIndex,t.rowIndex,$.textContent)):(l.value=$.textContent!==s,t.store.setCellData(t.colIndex,t.rowIndex,$.textContent)))};return(S,$)=>(r.openBlock(),r.createElementBlock("td",{ref:"cell","data-colindex":S.colIndex,"data-rowindex":S.rowIndex,"data-editable":r.unref(i).edit,contenteditable:r.unref(i).edit,tabindex:S.tabIndex,spellcheck:!1,style:r.normalizeStyle(w.value),onFocus:E,onPaste:_,onInput:_,onClick:h,class:r.normalizeClass(["atable-cell",S.pinned?"sticky-column":""])},[r.unref(i).cellComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(i).cellComponent),r.mergeProps({key:0,value:f.value},r.unref(i).cellComponentProps),null,16,["value"])):p.value?(r.openBlock(),r.createElementBlock("span",{key:1,innerHTML:f.value},null,8,As)):(r.openBlock(),r.createElementBlock("span",Bs,r.toDisplayString(f.value),1))],46,Ts))}}),js=["tabindex"],Ms=r.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(t){const e=r.useTemplateRef("rowEl"),n=r.computed(()=>t.store.isRowVisible(t.rowIndex)),o=r.computed(()=>t.store.getRowExpandSymbol(t.rowIndex));if(t.addNavigation){let s=ue;typeof t.addNavigation=="object"&&(s={...s,...t.addNavigation}),In([{selectors:e,handlers:s}])}return(s,a)=>r.withDirectives((r.openBlock(),r.createElementBlock("tr",{ref:"rowEl",tabindex:s.tabIndex,class:"table-row"},[s.store.config.view!=="uncounted"?r.renderSlot(s.$slots,"index",{key:0},()=>[s.store.config.view==="list"?(r.openBlock(),r.createElementBlock("td",{key:0,tabIndex:-1,class:r.normalizeClass(["list-index",s.store.hasPinnedColumns?"sticky-index":""])},r.toDisplayString(s.rowIndex+1),3)):s.store.config.view==="tree"?(r.openBlock(),r.createElementBlock("td",{key:1,tabIndex:-1,class:r.normalizeClass(["tree-index",s.store.hasPinnedColumns?"sticky-index":""]),onClick:a[0]||(a[0]=l=>s.store.toggleRowExpand(s.rowIndex))},r.toDisplayString(o.value),3)):r.createCommentVNode("",!0)]):r.createCommentVNode("",!0),r.renderSlot(s.$slots,"default")],8,js)),[[r.vShow,n.value]])}}),An=de?window:void 0;function yt(t){var e;const n=A(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Pt(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=An):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[yt(e),A(s)],([d,f])=>{if(l(),!d)return;const p=Pn(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>i(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}let Bn=!1;function Rn(t,e,n={}){const{window:o=An,ignore:s=[],capture:a=!0,detectIframe:l=!1}=n;if(!o)return rt;fe&&!Bn&&(Bn=!0,Array.from(o.document.body.children).forEach(h=>h.addEventListener("click",rt)),o.document.documentElement.addEventListener("click",rt));let i=!0;const u=h=>A(s).some(E=>{if(typeof E=="string")return Array.from(o.document.querySelectorAll(E)).some(_=>_===h.target||h.composedPath().includes(_));{const _=yt(E);return _&&(h.target===_||h.composedPath().includes(_))}});function c(h){const E=A(h);return E&&E.$.subTree.shapeFlag===16}function d(h,E){const _=A(h),S=_.$.subTree&&_.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some($=>$.el===E.target||E.composedPath().includes($.el))}const f=h=>{const E=yt(t);if(h.target!=null&&!(!(E instanceof Element)&&c(t)&&d(t,h))&&!(!E||E===h.target||h.composedPath().includes(E))){if(h.detail===0&&(i=!u(h)),!i){i=!0;return}e(h)}};let p=!1;const w=[Pt(o,"click",h=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(h))},{passive:!0,capture:a}),Pt(o,"pointerdown",h=>{const E=yt(t);i=!u(h)&&!!(E&&!h.composedPath().includes(E))},{passive:!0}),l&&Pt(o,"blur",h=>{setTimeout(()=>{var E;const _=yt(t);((E=o.document.activeElement)==null?void 0:E.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&e(h)},0)})].filter(Boolean);return()=>w.forEach(h=>h())}const Ls={mounted(t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=Rn(t,e.value,{capture:n});else{const[o,s]=e.value;t.__onClickOutside_stop=Rn(t,o,Object.assign({capture:n},s))}},unmounted(t){t.__onClickOutside_stop()}};function me(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function jn(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:jn(n)}}function Us(t){const e=t||window.event,n=e.target;return jn(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const he=new WeakMap;function Ws(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(xs(t),i=>{const u=me(A(i));if(u){const c=u;if(he.get(c)||he.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=me(A(t));!i||n.value||(fe&&(o=Pt(i,"touchmove",u=>{Us(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=me(A(t));!i||!n.value||(fe&&(o==null||o()),i.style.overflow=s,he.delete(i),n.value=!1)};return gt(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function Hs(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=Ws(n,o.value);r.watch(e,a=>s.value=a)}}Hs();const Fs={key:0,id:"resizable"},zs={class:"atable-header-row",tabindex:"-1"},Js=r.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(t){return(e,n)=>e.columns.length?(r.openBlock(),r.createElementBlock("thead",Fs,[r.createElementVNode("tr",zs,[e.store.zeroColumn?(r.openBlock(),r.createElementBlock("th",{key:0,id:"header-index",class:r.normalizeClass([[e.store.hasPinnedColumns?"sticky-index":"",e.store.config.view==="tree"?"tree-index":"",e.store.config.view==="list-expansion"?"list-expansion-index":""],"list-index"])},null,2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.columns,(o,s)=>(r.openBlock(),r.createElementBlock("th",{key:o.name,tabindex:"-1",style:r.normalizeStyle(e.store.getHeaderCellStyle(o)),class:r.normalizeClass(o.pinned?"sticky-column":"")},[r.renderSlot(e.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(o.label||String.fromCharCode(s+97).toUpperCase()),1)])],6))),128))])])):r.createCommentVNode("",!0)}}),Gs=r.defineComponent({__name:"ATableModal",props:{store:{}},setup(t){const e=r.useTemplateRef("amodal"),{width:n,height:o}=Tn(e),{y:s}=Ps(),a=r.computed(()=>{if(!(t.store.modal.height&&t.store.modal.width&&t.store.modal.left&&t.store.modal.bottom))return;const i=document.body,u=document.documentElement,c=Math.max(i.scrollHeight,i.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),d=Math.max(i.scrollWidth,i.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),f=t.store.modal.bottom+o.value+s.value<=c?t.store.modal.bottom:t.store.modal.bottom-o.value-t.store.modal.height;return{left:`${t.store.modal.left+n.value<=d?t.store.modal.left:t.store.modal.left-(n.value-t.store.modal.width)}px`,top:`${f}px`}}),l=i=>{i.stopPropagation()};return(i,u)=>(r.openBlock(),r.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:l,onInput:l,style:r.normalizeStyle(a.value)},[r.renderSlot(i.$slots,"default")],36))}}),Ys=t=>{const e=t.id||Ds();return as(`table-${e}`,()=>{const n=()=>{const g={};for(const[v,b]of s.value.entries())for(const[m,y]of a.value.entries())g[`${v}:${m}`]=y[b.name];return g},o=g=>{const v=[Object.assign({},{rowModified:!1})];if(g&&"0:0"in g)return g;const b=new Set;for(let m=a.value.length-1;m>=0;m--){const y=a.value[m];y.parent&&b.add(y.parent),v[m]={childrenOpen:!1,expanded:!1,indent:y.indent||0,isParent:b.has(m),isRoot:y.parent===null||y.parent===void 0,rowModified:!1,open:y.parent===null||y.parent===void 0,parent:y.parent}}return v},s=r.ref(t.columns),a=r.ref(t.rows),l=r.ref(t.config||{}),i=r.ref(t.table||n()),u=r.ref(o(t.display)),c=r.ref(t.modal||{visible:!1}),d=r.ref({}),f=r.computed(()=>s.value.some(g=>g.pinned)),p=r.computed(()=>`${Math.ceil(a.value.length/100+1)}ch`),w=r.computed(()=>l.value.view?["list","tree","list-expansion"].includes(l.value.view):!1),h=(g,v)=>i.value[`${g}:${v}`],E=(g,v,b)=>{const m=`${g}:${v}`,y=s.value[g];i.value[m]!==b&&(u.value[v].rowModified=!0),i.value[m]=b,a.value[v][y.name]=b},_=(g,v,b)=>{const m=`${g}:${v}`;i.value[m]!==b&&(u.value[v].rowModified=!0,d.value[m]=b)},S=g=>({minWidth:g.width||"40ch",textAlign:g.align||"center",width:l.value.fullWidth?"auto":void 0}),$=g=>l.value.view!=="tree"||u.value[g].isRoot||u.value[g].open,q=g=>l.value.view!=="tree"?"":u.value[g].isRoot||u.value[g].isParent?u.value[g].childrenOpen?"-":"+":"",B=g=>{if(l.value.view==="tree"){u.value[g].childrenOpen=!u.value[g].childrenOpen;for(let v=a.value.length-1;v>=0;v--)u.value[v].parent===g&&(u.value[v].open=!u.value[v].open,u.value[v].childrenOpen&&B(v))}else l.value.view==="list-expansion"&&(u.value[g].expanded=!u.value[g].expanded)},N=(g,v)=>{const b=h(g,v);return G(g,v,b)},G=(g,v,b)=>{const m=s.value[g],y=a.value[v],k=m.format;return k?typeof k=="function"?k(b,{table:i.value,row:y,column:m}):typeof k=="string"?Function(`"use strict";return (${k})`)()(b,{table:i.value,row:y,column:m}):b:b};return{columns:s,config:l,display:u,modal:c,rows:a,table:i,updates:d,hasPinnedColumns:f,numberedRowWidth:p,zeroColumn:w,closeModal:g=>{var v;g.target instanceof Node&&(v=c.value.parent)!=null&&v.contains(g.target)||c.value.visible&&(c.value.visible=!1)},getCellData:h,getCellDisplayValue:N,getFormattedValue:G,getHeaderCellStyle:S,getIndent:(g,v)=>v&&g===0&&v>0?`${v}ch`:"inherit",getRowExpandSymbol:q,isRowVisible:$,setCellData:E,setCellText:_,toggleRowExpand:B}})()},Xs=r.defineComponent({__name:"ATable",props:{id:{},modelValue:{},columns:{},rows:{default:()=>[]},config:{default:()=>new Object}},emits:["update:modelValue","cellUpdate"],setup(t,{expose:e,emit:n}){const o=n,s=r.useTemplateRef("table"),a=t.modelValue?t.modelValue:t.rows,l=Ys({columns:t.columns,rows:a,id:t.id,config:t.config});l.$onAction(({name:c,store:d,args:f,after:p})=>{if(c==="setCellData"){const[w,h,E]=f,_=d.getCellData(w,h);p(()=>{o("cellUpdate",w,h,E,_)})}}),r.watch(()=>l.rows,c=>{o("update:modelValue",c)},{deep:!0}),r.onMounted(()=>{t.columns.some(c=>c.pinned)&&(u(),l.config.view==="tree"&&Dn(s,u,{childList:!0,subtree:!0}))});const i=(c,d,f,p)=>{o("cellUpdate",c,d,f,p)},u=()=>{const c=s.value,d=c==null?void 0:c.rows[0],f=c==null?void 0:c.rows[1],p=d?Array.from(d.cells):[];for(const[w,h]of p.entries()){const E=f==null?void 0:f.cells[w];E&&(h.style.width=`${E.offsetWidth}px`)}for(const w of(c==null?void 0:c.rows)||[]){let h=0;const E=[];for(const _ of w.cells)(_.classList.contains("sticky-column")||_.classList.contains("sticky-index"))&&(_.style.left=`${h}px`,h+=_.offsetWidth,E.push(_));E.length>0&&E[E.length-1].classList.add("sticky-column-edge")}};return window.addEventListener("keydown",c=>{if(c.key==="Escape"&&l.modal.visible){l.modal.visible=!1;const d=l.modal.parent;d&&r.nextTick().then(()=>{d.focus()})}}),e({store:l}),(c,d)=>r.withDirectives((r.openBlock(),r.createElementBlock("table",{ref:"table",class:"atable",style:r.normalizeStyle({width:r.unref(l).config.fullWidth?"100%":"auto"})},[r.renderSlot(c.$slots,"header",{data:r.unref(l)},()=>[r.createVNode(Js,{columns:r.unref(l).columns,store:r.unref(l)},null,8,["columns","store"])],!0),r.createElementVNode("tbody",null,[r.renderSlot(c.$slots,"body",{data:r.unref(l)},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).rows,(f,p)=>(r.openBlock(),r.createBlock(Ms,{key:f.id,row:f,rowIndex:p,store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).columns,(w,h)=>(r.openBlock(),r.createBlock(Rs,{key:w.name,store:r.unref(l),col:w,spellcheck:"false",pinned:w.pinned,rowIndex:p,colIndex:h,component:w.cellComponent,style:r.normalizeStyle({textAlign:(w==null?void 0:w.align)||"center",minWidth:(w==null?void 0:w.width)||"40ch",width:r.unref(l).config.fullWidth?"auto":null}),onCellInput:i},null,8,["store","col","pinned","rowIndex","colIndex","component","style"]))),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),r.renderSlot(c.$slots,"footer",{data:r.unref(l)},void 0,!0),r.renderSlot(c.$slots,"modal",{data:r.unref(l)},()=>[r.withDirectives(r.createVNode(Gs,{store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(l).modal.component),r.mergeProps({key:`${r.unref(l).modal.rowIndex}:${r.unref(l).modal.colIndex}`,colIndex:r.unref(l).modal.colIndex,rowIndex:r.unref(l).modal.rowIndex,store:r.unref(l)},r.unref(l).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[r.vShow,r.unref(l).modal.visible]])],!0)],4)),[[r.unref(Ls),r.unref(l).closeModal]])}}),Qs=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},qs=Qs(Xs,[["__scopeId","data-v-bd5101d3"]]),Mn=r.defineComponent({__name:"Records",setup(t){const{stonecrop:e,isReady:n}=ze(),o={view:"list"};return(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(qs),{key:0,columns:r.unref(e).schema.schema.toArray(),rows:r.unref(e).store.records,config:o},null,8,["columns","rows"])):r.createCommentVNode("",!0)}}),Ks={class:"tabs"},Zs={tabindex:"0"},ta={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 424.098 424.098",style:{"enable-background":"new 0 0 424.098 424.098"},"xml:space":"preserve"},ea={tabindex:"0"},na={style:{width:"11pt"}},Ln=Tt(r.defineComponent({__name:"SheetNav",props:{breadcrumbs:{default:()=>[]}},setup(t){const e=r.ref(!0),n=r.ref(!1),o=r.ref(""),s=r.useTemplateRef("searchinput"),a=r.computed(()=>e.value?"unrotated":"rotated"),l=()=>{e.value=!e.value},i=async()=>{n.value=!n.value,await r.nextTick(()=>{s.value.focus()})},u=f=>{f.preventDefault(),f.stopPropagation()},c=async f=>{f.preventDefault(),f.stopPropagation(),await i()},d=()=>{};return(f,p)=>{const w=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("footer",null,[r.createElementVNode("ul",Ks,[r.createElementVNode("li",{class:"hidebreadcrumbs",onClick:l,onKeydown:r.withKeys(l,["enter"])},[r.createElementVNode("a",Zs,[r.createElementVNode("div",{class:r.normalizeClass(a.value)},"ร",2)])],32),r.createElementVNode("li",{class:"hometab",onClick:d,onKeydown:r.withKeys(d,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{to:"/home",tabindex:"0"},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",ta,p[5]||(p[5]=[r.createElementVNode("g",null,[r.createElementVNode("path",{style:{fill:"#010002"},d:`M351.191,401.923H72.901c-4.487,0-8.129-3.633-8.129-8.129V242.262l-56.664-0.114
|
|
20
|
+
This will fail in production.`);i=ut,i._s.has(o)||(a?re(o,e,s,i):vn(o,s,i),process.env.NODE_ENV!=="production"&&(l._pinia=i));const d=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?re(f,e,s,i,!0):vn(f,B({},s),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&ft){const f=r.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,w="_pStores"in p?p._pStores:p._pStores={};w[o]=d}}return d}return l.$id=o,l}function kn(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function se(t){return typeof t=="function"?t():r.unref(t)}const ls=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const cs=t=>t!=null,us=Object.prototype.toString,ds=t=>us.call(t)==="[object Object]",fs=()=>{},pt=ls?window:void 0;function mt(t){var e;const n=se(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ht(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=pt):[e,n,o,s]=t,!e)return fs;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[mt(e),se(s)],([d,f])=>{if(l(),!d)return;const p=ds(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(g=>i(d,w,g,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return kn(c),c}function ps(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function ms(t){const e=ps();return r.computed(()=>(e.value,!!t()))}function hs(t,e,n={}){const{window:o=pt,...s}=n;let a;const l=ms(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=se(t),w=(Array.isArray(p)?p:[p]).map(mt).filter(cs);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return kn(f),{isSupported:l,stop:f,takeRecords:d}}function gs(t={}){var e;const{window:n=pt,deep:o=!0,triggerOnRemoval:s=!1}=t,a=(e=t.document)!=null?e:n==null?void 0:n.document,l=()=>{var c;let d=a==null?void 0:a.activeElement;if(o)for(;d!=null&&d.shadowRoot;)d=(c=d==null?void 0:d.shadowRoot)==null?void 0:c.activeElement;return d},i=r.ref(),u=()=>{i.value=l()};return n&&(ht(n,"blur",c=>{c.relatedTarget===null&&u()},!0),ht(n,"focus",u,!0)),s&&hs(a,c=>{c.filter(d=>d.removedNodes.length).map(d=>Array.from(d.removedNodes)).flat().forEach(d=>{d===i.value&&u()})},{childList:!0,subtree:!0}),u(),i}const ys="focusin",ws="focusout";function bs(t,e={}){const{window:n=pt}=e,o=r.computed(()=>mt(t)),s=r.ref(!1),a=r.computed(()=>s.value),l=gs(e);return!n||!l.value?{focused:a}:(ht(o,ys,()=>s.value=!0),ht(o,ws,()=>s.value=!1),{focused:a})}function Es(t,{window:e=pt,scrollTarget:n}={}){const o=r.ref(!1),s=()=>{if(!e)return;const a=e.document,l=mt(t);if(!l)o.value=!1;else{const i=l.getBoundingClientRect();o.value=i.top<=(e.innerHeight||a.documentElement.clientHeight)&&i.left<=(e.innerWidth||a.documentElement.clientWidth)&&i.bottom>=0&&i.right>=0}};return r.watch(()=>mt(t),()=>s(),{immediate:!0,flush:"post"}),e&&ht(n||e,"scroll",s,{capture:!1,passive:!0}),o}const F=t=>{let e=Es(t).value;return e=e&&t.offsetHeight>0,e},z=t=>t.tabIndex>=0,$n=t=>{const e=t.target;return ae(e)},ae=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.previousElementSibling;o&&(n=o)}return n&&(!z(n)||!F(n))?ae(n):n},_s=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.firstElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.firstElementChild;a&&(o=a)}}return o&&(!z(o)||!F(o))?ie(o):o},Sn=t=>{const e=t.target;return ie(e)},ie=t=>{var e;let n;if(t instanceof HTMLTableCellElement){const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;if(o){const s=Array.from(o.children)[t.cellIndex];s&&(n=s)}}else if(t instanceof HTMLTableRowElement){const o=t.nextElementSibling;o&&(n=o)}return n&&(!z(n)||!F(n))?ie(n):n},vs=t=>{var e;const n=t.target;let o;if(n instanceof HTMLTableCellElement){const s=(e=n.parentElement)==null?void 0:e.parentElement;if(s){const a=s.lastElementChild,l=a==null?void 0:a.children[n.cellIndex];l&&(o=l)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.lastElementChild;a&&(o=a)}}return o&&(!z(o)||!F(o))?ae(o):o},Nn=t=>{const e=t.target;return le(e)},le=t=>{var e;let n;if(t.previousElementSibling)n=t.previousElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.previousElementSibling;n=o==null?void 0:o.lastElementChild}return n&&(!z(n)||!F(n))?le(n):n},xn=t=>{const e=t.target;return ce(e)},ce=t=>{var e;let n;if(t.nextElementSibling)n=t.nextElementSibling;else{const o=(e=t.parentElement)==null?void 0:e.nextElementSibling;n=o==null?void 0:o.firstElementChild}return n&&(!z(n)||!F(n))?ce(n):n},On=t=>{const e=t.target.parentElement,n=e==null?void 0:e.firstElementChild;return n&&(!z(n)||!F(n))?ce(n):n},Cn=t=>{const e=t.target.parentElement,n=e==null?void 0:e.lastElementChild;return n&&(!z(n)||!F(n))?le(n):n},Ct=["alt","control","shift","meta"],ks={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ue={"keydown.up":t=>{const e=$n(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.down":t=>{const e=Sn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.left":t=>{const e=Nn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.right":t=>{const e=xn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.control.up":t=>{const e=_s(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.down":t=>{const e=vs(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.left":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.right":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.end":t=>{const e=Cn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=Sn(t);e&&e.focus()}},"keydown.shift.enter":t=>{if(t.target instanceof HTMLTableCellElement){t.preventDefault(),t.stopPropagation();const e=$n(t);e&&e.focus()}},"keydown.home":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.tab":t=>{const e=xn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.shift.tab":t=>{const e=Nn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())}};function Pn(t){const e=l=>{let i=null;return l.parent&&(typeof l.parent=="string"?i=document.querySelector(l.parent):l.parent instanceof HTMLElement?i=l.parent:i=l.parent.value),i},n=l=>{var i;const u=e(l);let c=[];if(typeof l.selectors=="string")c=u?Array.from(u.querySelectorAll(l.selectors)):Array.from(document.querySelectorAll(l.selectors));else if(Array.isArray(l.selectors))for(const d of l.selectors)d instanceof HTMLElement?c.push(d):c.push(d.$el);else if(l.selectors instanceof HTMLElement)c.push(l.selectors);else if((i=l.selectors)!=null&&i.value)if(Array.isArray(l.selectors.value))for(const d of l.selectors.value)d instanceof HTMLElement?c.push(d):c.push(d.$el);else c.push(l.selectors.value);return c},o=l=>{const i=e(l);let u=[];return l.selectors?u=n(l):i&&(u=Array.from(i.children).filter(c=>z(c)&&F(c))),u},s=l=>i=>{const u=ks[i.key]||i.key.toLowerCase();if(Ct.includes(u))return;const c=l.handlers||ue;for(const d of Object.keys(c)){const[f,...p]=d.split(".");if(f==="keydown"&&p.includes(u)){const w=c[d],g=p.filter(_=>Ct.includes(_)),E=Ct.some(_=>{const S=_.charAt(0).toUpperCase()+_.slice(1);return i.getModifierState(S)});if(g.length>0){if(E){for(const _ of Ct)if(p.includes(_)){const S=_.charAt(0).toUpperCase()+_.slice(1);i.getModifierState(S)&&w(i)}}}else E||w(i)}}},a=[];r.onMounted(()=>{for(const l of t){const i=e(l),u=o(l),c=s(l),d=i?[i]:u;for(const f of d){const{focused:p}=bs(r.ref(f)),w=r.watch(p,g=>{g?f.addEventListener("keydown",c):f.removeEventListener("keydown",c)});a.push(w)}}}),r.onBeforeUnmount(()=>{for(const l of a)l()})}function gt(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function R(t){return typeof t=="function"?t():r.unref(t)}const de=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $s=t=>t!=null,Ss=Object.prototype.toString,In=t=>Ss.call(t)==="[object Object]",rt=()=>{},fe=Ns();function Ns(){var t,e;return de&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function xs(t){return r.getCurrentInstance()}function Os(...t){if(t.length!==1)return r.toRef(...t);const e=t[0];return typeof e=="function"?r.readonly(r.customRef(()=>({get:e,set:rt}))):r.ref(e)}function Cs(t,e=!0,n){xs()?r.onMounted(t,n):e?t():r.nextTick(t)}const Pt=de?window:void 0;function st(t){var e;const n=R(t);return(e=n==null?void 0:n.$el)!=null?e:n}function pe(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=Pt):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[st(e),R(s)],([d,f])=>{if(l(),!d)return;const p=In(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(g=>i(d,w,g,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}function Ps(){const t=r.ref(!1),e=r.getCurrentInstance();return e&&r.onMounted(()=>{t.value=!0},e),t}function Vn(t){const e=Ps();return r.computed(()=>(e.value,!!t()))}function Dn(t,e,n={}){const{window:o=Pt,...s}=n;let a;const l=Vn(()=>o&&"MutationObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=R(t),w=(Array.isArray(p)?p:[p]).map(st).filter($s);return new Set(w)}),c=r.watch(()=>u.value,p=>{i(),l.value&&p.size&&(a=new MutationObserver(e),p.forEach(w=>a.observe(w,s)))},{immediate:!0,flush:"post"}),d=()=>a==null?void 0:a.takeRecords(),f=()=>{c(),i()};return gt(f),{isSupported:l,stop:f,takeRecords:d}}function Is(t,e,n={}){const{window:o=Pt,...s}=n;let a;const l=Vn(()=>o&&"ResizeObserver"in o),i=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const f=R(t);return Array.isArray(f)?f.map(p=>st(p)):[st(f)]}),c=r.watch(u,f=>{if(i(),l.value&&o){a=new ResizeObserver(e);for(const p of f)p&&a.observe(p,s)}},{immediate:!0,flush:"post"}),d=()=>{i(),c()};return gt(d),{isSupported:l,stop:d}}function Tn(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:s=!0,immediate:a=!0,updateTiming:l="sync"}=e,i=r.ref(0),u=r.ref(0),c=r.ref(0),d=r.ref(0),f=r.ref(0),p=r.ref(0),w=r.ref(0),g=r.ref(0);function E(){const S=st(t);if(!S){n&&(i.value=0,u.value=0,c.value=0,d.value=0,f.value=0,p.value=0,w.value=0,g.value=0);return}const $=S.getBoundingClientRect();i.value=$.height,u.value=$.bottom,c.value=$.left,d.value=$.right,f.value=$.top,p.value=$.width,w.value=$.x,g.value=$.y}function _(){l==="sync"?E():l==="next-frame"&&requestAnimationFrame(()=>E())}return Is(t,_),r.watch(()=>st(t),S=>!S&&_()),Dn(t,_,{attributeFilter:["style","class"]}),s&&pe("scroll",_,{capture:!0,passive:!0}),o&&pe("resize",_,{passive:!0}),Cs(()=>{a&&_()}),{height:i,bottom:u,left:c,right:d,top:f,width:p,x:w,y:g,update:_}}function Vs(t={}){const{window:e=Pt,behavior:n="auto"}=t;if(!e)return{x:r.ref(0),y:r.ref(0)};const o=r.ref(e.scrollX),s=r.ref(e.scrollY),a=r.computed({get(){return o.value},set(i){scrollTo({left:i,behavior:n})}}),l=r.computed({get(){return s.value},set(i){scrollTo({top:i,behavior:n})}});return pe(e,"scroll",()=>{o.value=e.scrollX,s.value=e.scrollY},{capture:!1,passive:!0}),{x:a,y:l}}const Ds=t=>{const e=new DOMParser().parseFromString(t,"text/html");return Array.from(e.body.childNodes).some(n=>n.nodeType===1)},Ts=(t=8)=>Array.from({length:t},()=>Math.floor(Math.random()*16).toString(16)).join(""),As=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],Bs=["innerHTML"],Rs={key:2},js=r.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},store:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},pinned:{type:Boolean,default:!1}},emits:["cellInput"],setup(t,{emit:e}){const n=e,o=r.useTemplateRef("cell"),s=t.store.getCellData(t.colIndex,t.rowIndex),a=r.ref(""),l=r.ref(!1),i=t.store.columns[t.colIndex],u=t.store.rows[t.rowIndex],c=i.align||"center",d=i.width||"40ch",f=r.computed(()=>t.store.getCellDisplayValue(t.colIndex,t.rowIndex)),p=r.computed(()=>typeof f.value=="string"?Ds(f.value):!1),w=r.computed(()=>{var $;return{textAlign:c,width:d,fontWeight:l.value?"bold":"inherit",paddingLeft:t.store.getIndent(t.colIndex,($=t.store.display[t.rowIndex])==null?void 0:$.indent)}}),g=r.computed(()=>({"sticky-column":t.pinned,"cell-modified":l.value})),E=()=>{const{left:$,bottom:I,width:j,height:V}=Tn(o);i.mask,i.modalComponent&&t.store.$patch(N=>{N.modal.visible=!0,N.modal.colIndex=t.colIndex,N.modal.rowIndex=t.rowIndex,N.modal.left=$,N.modal.bottom=I,N.modal.width=j,N.modal.height=V,typeof i.modalComponent=="function"?N.modal.component=i.modalComponent({table:N.table,row:u,column:i}):N.modal.component=i.modalComponent,N.modal.componentProps=i.modalComponentExtraProps})};if(t.addNavigation){let $={...ue,"keydown.f2":E,"keydown.alt.up":E,"keydown.alt.down":E,"keydown.alt.left":E,"keydown.alt.right":E};typeof t.addNavigation=="object"&&($={...$,...t.addNavigation}),Pn([{selectors:o,handlers:$}])}const _=()=>{o.value&&(a.value=o.value.textContent)},S=$=>{const I=$.target;I.textContent!==a.value&&(n("cellInput",t.colIndex,t.rowIndex,I.textContent,a.value),a.value=I.textContent,i.format?(l.value=I.textContent!==t.store.getFormattedValue(t.colIndex,t.rowIndex,s),t.store.setCellText(t.colIndex,t.rowIndex,I.textContent)):(l.value=I.textContent!==s,t.store.setCellData(t.colIndex,t.rowIndex,I.textContent)))};return($,I)=>(r.openBlock(),r.createElementBlock("td",{ref:"cell","data-colindex":$.colIndex,"data-rowindex":$.rowIndex,"data-editable":r.unref(i).edit,contenteditable:r.unref(i).edit,tabindex:$.tabIndex,spellcheck:!1,style:r.normalizeStyle(w.value),onFocus:_,onPaste:S,onInput:S,onClick:E,class:r.normalizeClass(["atable-cell",g.value])},[r.unref(i).cellComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(i).cellComponent),r.mergeProps({key:0,value:f.value},r.unref(i).cellComponentProps),null,16,["value"])):p.value?(r.openBlock(),r.createElementBlock("span",{key:1,innerHTML:f.value},null,8,Bs)):(r.openBlock(),r.createElementBlock("span",Rs,r.toDisplayString(f.value),1))],46,As))}}),An=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},Ms=["tabindex"],Ls=r.defineComponent({__name:"ARow",props:{rowIndex:{},store:{},tabIndex:{default:()=>-1},addNavigation:{type:[Boolean,Object],default:!1}},setup(t){const e=r.useTemplateRef("rowEl"),n=r.computed(()=>t.store.isRowVisible(t.rowIndex)),o=r.computed(()=>t.store.getRowExpandSymbol(t.rowIndex));if(t.addNavigation){let s=ue;typeof t.addNavigation=="object"&&(s={...s,...t.addNavigation}),Pn([{selectors:e,handlers:s}])}return(s,a)=>r.withDirectives((r.openBlock(),r.createElementBlock("tr",{ref:"rowEl",tabindex:s.tabIndex,class:"atable-row"},[s.store.config.view!=="uncounted"?r.renderSlot(s.$slots,"index",{key:0},()=>[s.store.config.view==="list"?(r.openBlock(),r.createElementBlock("td",{key:0,tabIndex:-1,class:r.normalizeClass(["list-index",s.store.hasPinnedColumns?"sticky-index":""])},r.toDisplayString(s.rowIndex+1),3)):s.store.config.view==="tree"?(r.openBlock(),r.createElementBlock("td",{key:1,tabIndex:-1,class:r.normalizeClass(["tree-index",s.store.hasPinnedColumns?"sticky-index":""]),onClick:a[0]||(a[0]=l=>s.store.toggleRowExpand(s.rowIndex))},r.toDisplayString(o.value),3)):r.createCommentVNode("",!0)],!0):r.createCommentVNode("",!0),r.renderSlot(s.$slots,"default",{},void 0,!0)],8,Ms)),[[r.vShow,n.value]])}}),Us=An(Ls,[["__scopeId","data-v-e02365ea"]]),Bn=de?window:void 0;function yt(t){var e;const n=R(t);return(e=n==null?void 0:n.$el)!=null?e:n}function It(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=Bn):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],l=()=>{a.forEach(d=>d()),a.length=0},i=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[yt(e),R(s)],([d,f])=>{if(l(),!d)return;const p=In(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(g=>i(d,w,g,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),l()};return gt(c),c}let Rn=!1;function jn(t,e,n={}){const{window:o=Bn,ignore:s=[],capture:a=!0,detectIframe:l=!1}=n;if(!o)return rt;fe&&!Rn&&(Rn=!0,Array.from(o.document.body.children).forEach(g=>g.addEventListener("click",rt)),o.document.documentElement.addEventListener("click",rt));let i=!0;const u=g=>R(s).some(E=>{if(typeof E=="string")return Array.from(o.document.querySelectorAll(E)).some(_=>_===g.target||g.composedPath().includes(_));{const _=yt(E);return _&&(g.target===_||g.composedPath().includes(_))}});function c(g){const E=R(g);return E&&E.$.subTree.shapeFlag===16}function d(g,E){const _=R(g),S=_.$.subTree&&_.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some($=>$.el===E.target||E.composedPath().includes($.el))}const f=g=>{const E=yt(t);if(g.target!=null&&!(!(E instanceof Element)&&c(t)&&d(t,g))&&!(!E||E===g.target||g.composedPath().includes(E))){if(g.detail===0&&(i=!u(g)),!i){i=!0;return}e(g)}};let p=!1;const w=[It(o,"click",g=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(g))},{passive:!0,capture:a}),It(o,"pointerdown",g=>{const E=yt(t);i=!u(g)&&!!(E&&!g.composedPath().includes(E))},{passive:!0}),l&&It(o,"blur",g=>{setTimeout(()=>{var E;const _=yt(t);((E=o.document.activeElement)==null?void 0:E.tagName)==="IFRAME"&&!(_!=null&&_.contains(o.document.activeElement))&&e(g)},0)})].filter(Boolean);return()=>w.forEach(g=>g())}const Ws={mounted(t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=jn(t,e.value,{capture:n});else{const[o,s]=e.value;t.__onClickOutside_stop=jn(t,o,Object.assign({capture:n},s))}},unmounted(t){t.__onClickOutside_stop()}};function me(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function Mn(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:Mn(n)}}function Hs(t){const e=t||window.event,n=e.target;return Mn(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const he=new WeakMap;function Fs(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(Os(t),i=>{const u=me(R(i));if(u){const c=u;if(he.get(c)||he.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(s=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const a=()=>{const i=me(R(t));!i||n.value||(fe&&(o=It(i,"touchmove",u=>{Hs(u)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},l=()=>{const i=me(R(t));!i||!n.value||(fe&&(o==null||o()),i.style.overflow=s,he.delete(i),n.value=!1)};return gt(l),r.computed({get(){return n.value},set(i){i?a():l()}})}function zs(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=Fs(n,o.value);r.watch(e,a=>s.value=a)}}zs();const Js={key:0,id:"resizable"},Gs={class:"atable-header-row",tabindex:"-1"},Ys=r.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(t){return(e,n)=>e.columns.length?(r.openBlock(),r.createElementBlock("thead",Js,[r.createElementVNode("tr",Gs,[e.store.zeroColumn?(r.openBlock(),r.createElementBlock("th",{key:0,id:"header-index",class:r.normalizeClass([[e.store.hasPinnedColumns?"sticky-index":"",e.store.config.view==="tree"?"tree-index":"",e.store.config.view==="list-expansion"?"list-expansion-index":""],"list-index"])},null,2)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.columns,(o,s)=>(r.openBlock(),r.createElementBlock("th",{key:o.name,tabindex:"-1",style:r.normalizeStyle(e.store.getHeaderCellStyle(o)),class:r.normalizeClass(o.pinned?"sticky-column":"")},[r.renderSlot(e.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(o.label||String.fromCharCode(s+97).toUpperCase()),1)])],6))),128))])])):r.createCommentVNode("",!0)}}),Xs=r.defineComponent({__name:"ATableModal",props:{store:{}},setup(t){const e=r.useTemplateRef("amodal"),{width:n,height:o}=Tn(e),{y:s}=Vs(),a=r.computed(()=>{if(!(t.store.modal.height&&t.store.modal.width&&t.store.modal.left&&t.store.modal.bottom))return;const i=document.body,u=document.documentElement,c=Math.max(i.scrollHeight,i.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),d=Math.max(i.scrollWidth,i.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),f=t.store.modal.bottom+o.value+s.value<=c?t.store.modal.bottom:t.store.modal.bottom-o.value-t.store.modal.height;return{left:`${t.store.modal.left+n.value<=d?t.store.modal.left:t.store.modal.left-(n.value-t.store.modal.width)}px`,top:`${f}px`}}),l=i=>{i.stopPropagation()};return(i,u)=>(r.openBlock(),r.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:l,onInput:l,style:r.normalizeStyle(a.value)},[r.renderSlot(i.$slots,"default")],36))}}),Qs=t=>{const e=t.id||Ts();return is(`table-${e}`,()=>{const n=()=>{const h={};for(const[v,b]of s.value.entries())for(const[m,y]of a.value.entries())h[`${v}:${m}`]=y[b.name];return h},o=h=>{const v=[Object.assign({},{rowModified:!1})];if(h&&"0:0"in h)return h;const b=new Set;for(let m=a.value.length-1;m>=0;m--){const y=a.value[m];y.parent&&b.add(y.parent),v[m]={childrenOpen:!1,expanded:!1,indent:y.indent||0,isParent:b.has(m),isRoot:y.parent===null||y.parent===void 0,rowModified:!1,open:y.parent===null||y.parent===void 0,parent:y.parent}}return v},s=r.ref(t.columns),a=r.ref(t.rows),l=r.ref(t.config||{}),i=r.ref(t.table||n()),u=r.ref(o(t.display)),c=r.ref(t.modal||{visible:!1}),d=r.ref({}),f=r.computed(()=>s.value.some(h=>h.pinned)),p=r.computed(()=>`${Math.ceil(a.value.length/100+1)}ch`),w=r.computed(()=>l.value.view?["list","tree","list-expansion"].includes(l.value.view):!1),g=(h,v)=>i.value[`${h}:${v}`],E=(h,v,b)=>{const m=`${h}:${v}`,y=s.value[h];i.value[m]!==b&&(u.value[v].rowModified=!0),i.value[m]=b,a.value[v][y.name]=b},_=(h,v,b)=>{const m=`${h}:${v}`;i.value[m]!==b&&(u.value[v].rowModified=!0,d.value[m]=b)},S=h=>({minWidth:h.width||"40ch",textAlign:h.align||"center",width:l.value.fullWidth?"auto":void 0}),$=h=>l.value.view!=="tree"||u.value[h].isRoot||u.value[h].open,I=h=>l.value.view!=="tree"?"":u.value[h].isRoot||u.value[h].isParent?u.value[h].childrenOpen?"-":"+":"",j=h=>{if(l.value.view==="tree"){u.value[h].childrenOpen=!u.value[h].childrenOpen;for(let v=a.value.length-1;v>=0;v--)u.value[v].parent===h&&(u.value[v].open=!u.value[v].open,u.value[v].childrenOpen&&j(v))}else l.value.view==="list-expansion"&&(u.value[h].expanded=!u.value[h].expanded)},V=(h,v)=>{const b=g(h,v);return N(h,v,b)},N=(h,v,b)=>{const m=s.value[h],y=a.value[v],k=m.format;return k?typeof k=="function"?k(b,{table:i.value,row:y,column:m}):typeof k=="string"?Function(`"use strict";return (${k})`)()(b,{table:i.value,row:y,column:m}):b:b};return{columns:s,config:l,display:u,modal:c,rows:a,table:i,updates:d,hasPinnedColumns:f,numberedRowWidth:p,zeroColumn:w,closeModal:h=>{var v;h.target instanceof Node&&(v=c.value.parent)!=null&&v.contains(h.target)||c.value.visible&&(c.value.visible=!1)},getCellData:g,getCellDisplayValue:V,getFormattedValue:N,getHeaderCellStyle:S,getIndent:(h,v)=>v&&h===0&&v>0?`${v}ch`:"inherit",getRowExpandSymbol:I,isRowVisible:$,setCellData:E,setCellText:_,toggleRowExpand:j}})()},qs=r.defineComponent({__name:"ATable",props:{id:{},modelValue:{},columns:{},rows:{default:()=>[]},config:{default:()=>new Object}},emits:["update:modelValue","cellUpdate"],setup(t,{expose:e,emit:n}){const o=n,s=r.useTemplateRef("table"),a=t.modelValue?t.modelValue:t.rows,l=Qs({columns:t.columns,rows:a,id:t.id,config:t.config});l.$onAction(({name:c,store:d,args:f,after:p})=>{if(c==="setCellData"){const[w,g,E]=f,_=d.getCellData(w,g);p(()=>{o("cellUpdate",w,g,E,_)})}}),r.watch(()=>l.rows,c=>{o("update:modelValue",c)},{deep:!0}),r.onMounted(()=>{t.columns.some(c=>c.pinned)&&(u(),l.config.view==="tree"&&Dn(s,u,{childList:!0,subtree:!0}))});const i=(c,d,f,p)=>{o("cellUpdate",c,d,f,p)},u=()=>{const c=s.value,d=c==null?void 0:c.rows[0],f=c==null?void 0:c.rows[1],p=d?Array.from(d.cells):[];for(const[w,g]of p.entries()){const E=f==null?void 0:f.cells[w];E&&(g.style.width=`${E.offsetWidth}px`)}for(const w of(c==null?void 0:c.rows)||[]){let g=0;const E=[];for(const _ of w.cells)(_.classList.contains("sticky-column")||_.classList.contains("sticky-index"))&&(_.style.left=`${g}px`,g+=_.offsetWidth,E.push(_));E.length>0&&E[E.length-1].classList.add("sticky-column-edge")}};return window.addEventListener("keydown",c=>{if(c.key==="Escape"&&l.modal.visible){l.modal.visible=!1;const d=l.modal.parent;d&&r.nextTick().then(()=>{d.focus()})}}),e({store:l}),(c,d)=>r.withDirectives((r.openBlock(),r.createElementBlock("table",{ref:"table",class:"atable",style:r.normalizeStyle({width:r.unref(l).config.fullWidth?"100%":"auto"})},[r.renderSlot(c.$slots,"header",{data:r.unref(l)},()=>[r.createVNode(Ys,{columns:r.unref(l).columns,store:r.unref(l)},null,8,["columns","store"])],!0),r.createElementVNode("tbody",null,[r.renderSlot(c.$slots,"body",{data:r.unref(l)},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).rows,(f,p)=>(r.openBlock(),r.createBlock(Us,{key:f.id,row:f,rowIndex:p,store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l).columns,(w,g)=>(r.openBlock(),r.createBlock(js,{key:w.name,store:r.unref(l),col:w,spellcheck:"false",pinned:w.pinned,rowIndex:p,colIndex:g,component:w.cellComponent,style:r.normalizeStyle({textAlign:(w==null?void 0:w.align)||"center",minWidth:(w==null?void 0:w.width)||"40ch",width:r.unref(l).config.fullWidth?"auto":null}),onCellInput:i},null,8,["store","col","pinned","rowIndex","colIndex","component","style"]))),128))]),_:2},1032,["row","rowIndex","store"]))),128))],!0)]),r.renderSlot(c.$slots,"footer",{data:r.unref(l)},void 0,!0),r.renderSlot(c.$slots,"modal",{data:r.unref(l)},()=>[r.withDirectives(r.createVNode(Xs,{store:r.unref(l)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(l).modal.component),r.mergeProps({key:`${r.unref(l).modal.rowIndex}:${r.unref(l).modal.colIndex}`,colIndex:r.unref(l).modal.colIndex,rowIndex:r.unref(l).modal.rowIndex,store:r.unref(l)},r.unref(l).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[r.vShow,r.unref(l).modal.visible]])],!0)],4)),[[r.unref(Ws),r.unref(l).closeModal]])}}),Ks=An(qs,[["__scopeId","data-v-bd5101d3"]]),Ln=r.defineComponent({__name:"Records",setup(t){const{stonecrop:e,isReady:n}=ze(),o={view:"list"};return(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(Ks),{key:0,columns:r.unref(e).schema.schema.toArray(),rows:r.unref(e).store.records,config:o},null,8,["columns","rows"])):r.createCommentVNode("",!0)}}),Zs={class:"tabs"},ta={tabindex:"0"},ea={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 424.098 424.098",style:{"enable-background":"new 0 0 424.098 424.098"},"xml:space":"preserve"},na={tabindex:"0"},oa={style:{width:"11pt"}},Un=Tt(r.defineComponent({__name:"SheetNav",props:{breadcrumbs:{default:()=>[]}},setup(t){const e=r.ref(!0),n=r.ref(!1),o=r.ref(""),s=r.useTemplateRef("searchinput"),a=r.computed(()=>e.value?"unrotated":"rotated"),l=()=>{e.value=!e.value},i=async()=>{n.value=!n.value,await r.nextTick(()=>{s.value.focus()})},u=f=>{f.preventDefault(),f.stopPropagation()},c=async f=>{f.preventDefault(),f.stopPropagation(),await i()},d=()=>{};return(f,p)=>{const w=r.resolveComponent("router-link");return r.openBlock(),r.createElementBlock("footer",null,[r.createElementVNode("ul",Zs,[r.createElementVNode("li",{class:"hidebreadcrumbs",onClick:l,onKeydown:r.withKeys(l,["enter"])},[r.createElementVNode("a",ta,[r.createElementVNode("div",{class:r.normalizeClass(a.value)},"ร",2)])],32),r.createElementVNode("li",{class:"hometab",onClick:d,onKeydown:r.withKeys(d,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{to:"/home",tabindex:"0"},{default:r.withCtx(()=>[(r.openBlock(),r.createElementBlock("svg",ea,p[5]||(p[5]=[r.createElementVNode("g",null,[r.createElementVNode("path",{style:{fill:"#010002"},d:`M351.191,401.923H72.901c-4.487,0-8.129-3.633-8.129-8.129V242.262l-56.664-0.114
|
|
21
21
|
c-3.284-0.008-6.243-1.992-7.495-5.023c-1.252-3.04-0.553-6.527,1.764-8.852L206.104,24.546c1.853-1.845,4.503-2.666,7.047-2.276
|
|
22
22
|
c2.414,0.39,4.511,1.845,5.731,3.942l47.43,47.43V58.499c0-4.487,3.633-8.129,8.129-8.129h47.755c4.495,0,8.129,3.642,8.129,8.129
|
|
23
23
|
v79.156l91.39,91.398c2.325,2.325,3.024,5.828,1.764,8.868c-1.26,3.032-4.227,5.007-7.511,5.007c-0.008,0-0.008,0-0.016,0
|
|
@@ -25,5 +25,5 @@ This will fail in production.`);i=ut,i._s.has(o)||(a?re(o,e,s,i):vn(o,s,i),proce
|
|
|
25
25
|
c0-2.162,0.854-4.235,2.39-5.755c1.528-1.52,3.585-2.374,5.739-2.374c0.008,0,0.008,0,0.016,0l45.105,0.089l-79.855-79.863
|
|
26
26
|
c-1.528-1.528-2.382-3.593-2.382-5.747V66.628h-31.498v26.645c0,3.284-1.975,6.251-5.015,7.511
|
|
27
27
|
c-3.032,1.268-6.527,0.569-8.86-1.764l-57.038-57.038l-183.95,183.95l45.203,0.089c4.487,0.008,8.112,3.642,8.112,8.129
|
|
28
|
-
C81.03,234.149,81.03,385.666,81.03,385.666z`})],-1)])))]),_:1})],36),r.createElementVNode("li",{class:"searchtab",onClick:i,onKeydown:r.withKeys(i,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createElementVNode("a",
|
|
28
|
+
C81.03,234.149,81.03,385.666,81.03,385.666z`})],-1)])))]),_:1})],36),r.createElementVNode("li",{class:"searchtab",onClick:i,onKeydown:r.withKeys(i,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createElementVNode("a",na,[r.createElementVNode("span",{style:r.normalizeStyle({display:n.value?"none":"block"})},[(r.openBlock(),r.createElementBlock("svg",oa,p[6]||(p[6]=[r.createElementVNode("g",{transform:"matrix(-0.08088215,0,0,0.08088215,9.8016177,3.1263021e-6)"},[r.createElementVNode("path",{d:"M 93.148438,80.832031 C 109.5,57.742188 104.03125,25.769531 80.941406,9.421875 57.851562,-6.925781 25.878906,-1.460938 9.53125,21.632812 -6.816406,44.722656 -1.351562,76.691406 21.742188,93.039062 38.222656,104.70703 60.011719,105.60547 77.394531,95.339844 l 37.769529,37.542966 c 4.07813,4.29297 10.86328,4.46485 15.15625,0.38672 4.29297,-4.07422 4.46485,-10.85937 0.39063,-15.15234 -0.12891,-0.13672 -0.25391,-0.26172 -0.39063,-0.39063 z m -41.839844,3.5 C 33.0625,84.335938 18.269531,69.554688 18.257812,51.308594 18.253906,33.0625 33.035156,18.269531 51.285156,18.261719 c 18.222656,-0.0078 33.007813,14.75 33.042969,32.972656 0.03125,18.25 -14.742187,33.066406 -32.996094,33.097656 -0.0078,0 -0.01172,0 -0.02344,0 z m 0,0",style:{fill:"#000000","fill-opacity":"1","fill-rule":"nonzero",stroke:"none"},id:"path2"})],-1)])))],4),r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=g=>o.value=g),ref:"searchinput",style:r.normalizeStyle({display:n.value?"block":"none"}),onClick:p[1]||(p[1]=g=>u(g)),onInput:p[2]||(p[2]=g=>u(g)),onBlur:p[3]||(p[3]=g=>c(g)),onKeydown:p[4]||(p[4]=r.withKeys(g=>c(g),["enter"])),type:"text"},null,36),[[r.vModelText,o.value]])])],36),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.breadcrumbs,g=>(r.openBlock(),r.createElementBlock("li",{key:g.title,style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{tabindex:"0",to:g.to},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(g.title),1)]),_:2},1032,["to"])],4))),128))])])}}}),[["__scopeId","data-v-a650f215"]]),ra={install:t=>{t.component("ActionSet",ye),t.component("CommandPalette",we),t.component("Doctype",gn),t.component("Records",Ln),t.component("SheetNav",Un)}};D.ActionSet=ye,D.CommandPalette=we,D.Doctype=gn,D.Records=Ln,D.SheetNav=Un,D.StonecropDesktop=ra,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
|
|
29
29
|
//# sourceMappingURL=desktop.umd.cjs.map
|