@stonecrop/desktop 0.4.4 โ 0.4.6
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 +1123 -1158
- package/dist/desktop.js.map +1 -1
- package/dist/desktop.umd.cjs +11 -11
- 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(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)}}/*!
|
|
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"],qn=["href"],Qn={class:"dropdown-item"},Xn=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(()=>{i()});const i=()=>{for(const d of e.value)d.type==="dropdown"&&(d.show=!1)},l=()=>{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;i(),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:l,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:h=>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,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,Yn)):h.link!=null?(r.openBlock(),r.createElementBlock("a",{key:1,href:h.link},[r.createElementVNode("button",Qn,r.toDisplayString(h.label),1)],8,qn)):r.createCommentVNode("",!0)]))),128))])],512),[[r.vShow,p.show]])])):r.createCommentVNode("",!0)]))),128))],34))}}),Dt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},ge=Dt(Xn,[["__scopeId","data-v-38e7af34"]]),Kn={};function Zn(t,e){return r.openBlock(),r.createElementBlock("dialog")}const ye=Dt(Kn,[["render",Zn]]),to=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n};function we(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function at(t){return typeof t=="function"?t():r.unref(t)}const be=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=()=>{},Ee=oo();function oo(){var t,e;return be&&((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=be?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=[],i=()=>{a.forEach(d=>d()),a.length=0},l=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[ao(e),at(s)],([d,f])=>{if(i(),!d)return;const p=no(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>l(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),i()};return we(c),c}function Tt(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function ve(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:ve(n)}}function lo(t){const e=t||window.event,n=e.target;return ve(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const At=new WeakMap;function co(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(ro(t),l=>{const u=Tt(at(l));if(u){const c=u;if(At.get(c)||At.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 l=Tt(at(t));!l||n.value||(Ee&&(o=io(l,"touchmove",u=>{lo(u)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},i=()=>{const l=Tt(at(t));!l||!n.value||(Ee&&(o==null||o()),l.style.overflow=s,At.delete(l),n.value=!1)};return we(i),r.computed({get(){return n.value},set(l){l?a():i()}})}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=i=>{let l={};for(const[u,c]of Object.entries(i))["component","fieldtype"].includes(u)||(l[u]=c),u==="rows"&&c&&c.length===0&&(l.rows=o.value[i.fieldname]);return l},a=r.computed({get:()=>t.modelValue.map((i,l)=>r.computed({get(){return i.value},set:u=>{t.modelValue[l].value=u,n("update:modelValue",t.modelValue)}})),set:()=>{}});return(i,l)=>(r.openBlock(),r.createElementBlock("form",fo,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.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:i.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 Bt(t){this.message=t||""}Bt.prototype=Object.create(Error.prototype,{constructor:{value:Bt},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});const ke=class It{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"),It._root)return It._root;It._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 Bt(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:i}=this.workflow;this.workflow.transition(i,{type:n}),a&&a.length>0&&a.forEach(l=>{new Function(l)(o)})}}};T(ke,"_root");let yo=ke;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 Rt(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}function wo(){return Se().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Se(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const bo=typeof Proxy=="function",_o="devtools-plugin:setup",Eo="plugin:settings:set";let it,jt;function vo(){var t;return it!==void 0||(typeof window<"u"&&window.performance?(it=!0,jt=window.performance):typeof globalThis<"u"&&!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance?(it=!0,jt=globalThis.perf_hooks.performance):it=!1),it}function ko(){return vo()?jt.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 i in e.settings){const l=e.settings[i];o[i]=l.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let a=Object.assign({},o);try{const i=localStorage.getItem(s),l=JSON.parse(i);Object.assign(a,l)}catch{}this.fallbacks={getSettings(){return a},setSettings(i){try{localStorage.setItem(s,JSON.stringify(i))}catch{}a=i},now(){return ko()}},n&&n.on(Eo,(i,l)=>{i===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(i,l)=>this.target?this.target.on[l]:(...u)=>{this.onQueue.push({method:l,args:u})}}),this.proxiedTarget=new Proxy({},{get:(i,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...u)=>(this.targetQueue.push({method:l,args:u,resolve:()=>{}}),this.fallbacks[l](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:l,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 Ne(t,e){const n=t,o=Se(),s=wo(),a=bo&&n.enableEarlyProxy;if(s&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))s.emit(_o,t,e);else{const i=a?new $o(n,s):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:i}),i&&e(i.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,
|
|
6
|
-
${
|
|
7
|
-
Only state can be modified.`);
|
|
5
|
+
*/let lt;const ct=t=>lt=t,xe=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 U;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(U||(U={}));const G=typeof window<"u",Oe=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(){Ie(o.response,e,n)},o.onerror=function(){console.error("could not download file")},o.send()}function Ce(t){const e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function _t(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 Et=typeof navigator=="object"?navigator:{userAgent:""},Pe=/Macintosh/.test(Et.userAgent)&&/AppleWebKit/.test(Et.userAgent)&&!/Safari/.test(Et.userAgent),Ie=G?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Pe?No:"msSaveOrOpenBlob"in Et?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?Ce(o.href)?Lt(t,e,n):(o.target="_blank",_t(o)):_t(o)):(o.href=URL.createObjectURL(t),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){_t(o)},0))}function xo(t,e="download",n){if(typeof t=="string")if(Ce(t))Lt(t,e,n);else{const o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){_t(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(Oe.HTMLElement))||"safari"in Oe,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||s&&a||Pe)&&typeof FileReader<"u"){const l=new FileReader;l.onloadend=function(){let u=l.result;if(typeof u!="string")throw o=null,new Error("Wrong reader.result type");u=i?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=u:location.assign(u),o=null},l.readAsDataURL(t)}else{const l=URL.createObjectURL(t);o?o.location.assign(l):location.href=l,o=null,setTimeout(function(){URL.revokeObjectURL(l)},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 Mt(t){return"_a"in t&&"install"in t}function Ve(){if(!("clipboard"in navigator))return x("Your browser doesn't support the Clipboard API","error"),!0}function De(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(!Ve())try{await navigator.clipboard.writeText(JSON.stringify(t.state.value)),x("Global state copied to clipboard.")}catch(e){if(De(e))return;x("Failed to serialize the state. Check the console for more details.","error"),console.error(e)}}async function Po(t){if(!Ve())try{Te(t,JSON.parse(await navigator.clipboard.readText())),x("Global state pasted from clipboard.")}catch(e){if(De(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{Ie(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;Te(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 Te(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 M(t){return{_custom:{display:t}}}const Ae="๐ Pinia (root)",vt="_root";function To(t){return Mt(t)?{id:vt,label:Ae}:{id:t.$id,label:t.$id}}function Ao(t){if(Mt(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((i,l)=>(i[l]=a[l],i),{})}})}}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:M(t.type),key:M(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 Lo(t,e){Ne({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 i=o.componentInstance.proxy._pStores;Object.values(i).forEach(l=>{o.instanceData.state.push({type:$t(l.$id),key:"state",editable:!0,value:l._isOptionsAPI?{_custom:{value:r.toRaw(l.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>l.$reset()}]}}:Object.keys(l.$state).reduce((u,c)=>(u[c]=l.$state[c],u),{})}),l._getters&&l._getters.length&&o.instanceData.state.push({type:$t(l.$id),key:"getters",editable:!1,value:l._getters.reduce((u,c)=>{try{u[c]=l[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()):Ae.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:i}=o;Mt(a)?i.unshift("state"):(i.length!==1||!a._customProperties.has(i[0])||i[0]in a.$state)&&i.unshift("$state"),Z=!1,o.set(a,i,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:i}=o;if(i[0]!=="state")return x(`Invalid path for store "${s}":
|
|
6
|
+
${i}
|
|
7
|
+
Only state can be modified.`);i[0]="$state",Z=!1,o.set(a,i,o.state.value),Z=!0}})})}function Mo(t,e){kt.includes($t(e.$id))||kt.push($t(e.$id)),Ne({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:i,onError:l,name:u,args:c})=>{const d=Be++;n.addTimelineEvent({layerId:Q,event:{time:o(),title:"๐ซ "+u,subtitle:"start",data:{store:M(e.$id),action:M(u),args:c},groupId:d}}),i(f=>{Y=void 0,n.addTimelineEvent({layerId:Q,event:{time:o(),title:"๐ฌ "+u,subtitle:"end",data:{store:M(e.$id),action:M(u),args:c,result:f},groupId:d}})}),l(f=>{Y=void 0,n.addTimelineEvent({layerId:Q,event:{time:o(),logType:"error",title:"๐ฅ "+u,subtitle:"end",data:{store:M(e.$id),action:M(u),args:c,error:f},groupId:d}})})},!0),e._customProperties.forEach(i=>{r.watch(()=>r.unref(e[i]),(l,u)=>{n.notifyComponentUpdate(),n.sendInspectorState(P),Z&&n.addTimelineEvent({layerId:Q,event:{time:o(),title:"Change",subtitle:i,data:{newValue:l,oldValue:u},groupId:Y}})},{deep:!0})}),e.$subscribe(({events:i,type:l},u)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(P),!Z)return;const c={time:o(),title:Ro(l),data:jo({store:M(e.$id)},Bo(i)),groupId:Y};l===U.patchFunction?c.subtitle="โคต๏ธ":l===U.patchObject?c.subtitle="๐งฉ":i&&!Array.isArray(i)&&(c.subtitle=i.type),i&&(c.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:Q,event:c})},{detached:!0,flush:"sync"});const s=e._hotUpdate;e._hotUpdate=r.markRaw(i=>{s(i),n.addTimelineEvent({layerId:Q,event:{time:o(),title:"๐ฅ "+e.$id,subtitle:"HMR update",data:{store:M(e.$id),info:M("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 Be=0,Y;function Re(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=Be,i=n?new Proxy(t,{get(...u){return Y=a,Reflect.get(...u)},set(...u){return Y=a,Reflect.set(...u)}}):t;Y=a;const l=o[s].apply(i,arguments);return Y=void 0,l}}function Uo({app:t,store:e,options:n}){if(!e.$id.startsWith("__hot:")){if(e._isOptionsAPI=!!n.state,!e._p._testing){Re(e,Object.keys(n.actions),e._isOptionsAPI);const o=e._hotUpdate;r.toRaw(e)._hotUpdate=function(s){o.apply(this,arguments),Re(e,Object.keys(s._hmrPayload.actions),!!e._isOptionsAPI)}}Mo(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(xe,s),a.config.globalProperties.$pinia=s,process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&G&&Lo(a,s),o.forEach(i=>n.push(i)),o=[]},use(a){return!this._a&&!$e?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 je(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]=je(s,o):t[n]=o}return t}const Le=()=>{};function Me(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(),Ue=Symbol(),Ut=Symbol();function Wt(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]=Wt(s,o):t[n]=o}return t}const Fo=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function zo(t){return!q(t)||!t.hasOwnProperty(Fo)}const{assign:A}=Object;function We(t){return!!(r.isRef(t)&&t.effect)}function He(t,e,n,o){const{state:s,actions:a,getters:i}=e,l=n.state.value[t];let u;function c(){!l&&(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(i||{}).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 i[p].call(w,w)})),f),{}))}return u=Ht(t,c,e,n,o,!0),u}function Ht(t,e,n={},o,s,a){let i;const l=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"&&!$e&&(u.onTrigger=b=>{c?w=b:c==!1&&!g._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 h=o.state.value[t];!a&&!h&&(process.env.NODE_ENV==="production"||!s)&&(o.state.value[t]={});const _=r.ref({});let E;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}):(Wt(o.state.value[t],b),m={type:U.patchObject,payload:b,storeId:t,events:w});const y=E=Symbol();r.nextTick().then(()=>{E===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(){i.stop(),f=[],p=[],o._s.delete(t)}const j=(b,m="")=>{if(Ue in b)return b[Ut]=m,b;const y=function(){ct(o);const k=Array.from(arguments),O=[],J=[];function wt(C){O.push(C)}function he(C){J.push(C)}tt(p,{args:k,name:y[Ut],store:g,after:wt,onError:he});let K;try{K=b.apply(this&&this.$id===t?this:g,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[Ue]=!0,y[Ut]=m,y},V=r.markRaw({actions:{},getters:{},state:[],hotState:_}),N={_p:o,$id:t,$onAction:Me.bind(null,p),$patch:S,$reset:$,$subscribe(b,m={}){const y=Me(f,b,m.detached,()=>k()),k=i.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},g=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,g);const v=(o._a&&o._a.runWithContext||Ho)(()=>o._e.run(()=>(i=r.effectScope()).run(()=>e({action:j}))));for(const b in v){const m=v[b];if(r.isRef(m)&&!We(m)||r.isReactive(m))process.env.NODE_ENV!=="production"&&s?bt(_.value,b,r.toRef(v,b)):a||(h&&zo(m)&&(r.isRef(m)?m.value=h[b]:Wt(m,h[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),l.actions[b]=m}else process.env.NODE_ENV!=="production"&&We(m)&&(V.getters[b]=a?n.getters[b]:m,G&&(v._getters||(v._getters=r.markRaw([]))).push(b))}if(A(g,v),A(r.toRaw(g),v),Object.defineProperty(g,"$state",{get:()=>process.env.NODE_ENV!=="production"&&s?_.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"&&(g._hotUpdate=r.markRaw(b=>{g._hotUpdating=!0,b._hmrPayload.state.forEach(m=>{if(m in g.$state){const y=b.$state[m],k=g.$state[m];typeof y=="object"&&q(y)&&q(k)?je(y,k):b.$state[m]=k}bt(g,m,r.toRef(b.$state,m))}),Object.keys(g.$state).forEach(m=>{m in b.$state||Rt(g,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(g,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(g,g))):y;bt(g,m,k)}Object.keys(g._hmrPayload.getters).forEach(m=>{m in b._hmrPayload.getters||Rt(g,m)}),Object.keys(g._hmrPayload.actions).forEach(m=>{m in b._hmrPayload.actions||Rt(g,m)}),g._hmrPayload=b._hmrPayload,g._getters=b._getters,g._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(g,m,A({value:g[m]},b))})}return o._p.forEach(b=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&G){const m=i.run(()=>b({store:g,app:o._a,pinia:o,options:l}));Object.keys(m||{}).forEach(y=>g._customProperties.add(y)),A(g,m)}else A(g,i.run(()=>b({store:g,app:o._a,pinia:o,options:l})))}),process.env.NODE_ENV!=="production"&&g.$state&&typeof g.$state=="object"&&typeof g.$state.constructor=="function"&&!g.$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 "${g.$id}".`),h&&a&&n.hydrate&&n.hydrate(g.$state,h),c=!0,d=!0,g}/*! #__NO_SIDE_EFFECTS__ */function Jo(t,e,n){let o,s;const a=typeof e=="function";o=t,s=a?n:e;function i(l,u){const c=r.hasInjectionContext();if(l=(process.env.NODE_ENV==="test"&<&<._testing?null:l)||(c?r.inject(xe,null):null),l&&ct(l),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,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],
|
|
11
|
+
This will fail in production.`);l=lt,l._s.has(o)||(a?Ht(o,e,s,l):He(o,s,l),process.env.NODE_ENV!=="production"&&(i._pinia=l));const d=l._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?Ht(f,e,s,l,!0):He(f,A({},s),l,!0);u._hotUpdate(p),delete l.state.value[f],l._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 i.$id=o,i}const Go=Jo("data",()=>{const t=r.ref([]),e=r.ref({});return{records:t,record:e}});function Fe(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 i=t.router.currentRoute.value,l=(n=i.params.records)==null?void 0:n.toString().toLowerCase(),u=(o=i.params.record)==null?void 0:o.toString().toLowerCase();if(!l&&!u)return;const c=await((s=t.getMeta)==null?void 0:s.call(t,l));c&&(t.addDoctype(c),e.value.setup(c),l&&(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 Vt{constructor(e,n){if(T(this,"name"),T(this,"registry"),T(this,"router"),T(this,"getMeta"),Vt._root)return Vt._root;Vt._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 ze(t,e){return t||(t=0),new Promise(function(n){return setTimeout(function(){return n(e)},t)})}function qo(t,e){return Math.floor(Math.random()*(e-t+1)+t)}function Ft(){return Math.random().toString(36).substring(2)}var Je=0,zt=0;function St(){var t=new Date().getTime();return t===Je?(zt++,t*1e3+zt):(Je=t,zt=0,t*1e3)}var Qo=St,Xo="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:Xo,averageResponseTime:or,microSeconds:Qo},Ge=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,Ye()),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=Ye()-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 Ye(){return new Date().getTime()}function Jt(){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 Gt(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(i){return a(i)},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(i,l){a.oncomplete=function(){return i()},a.onerror=function(c){return l(c)};var u=a.objectStore(H);u.add(s),Gt(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 i=o.getAll(a);return new Promise(function(u,c){i.onerror=function(d){return c(d)},i.onsuccess=function(d){u(d.target.result)}})}function l(){try{return a=IDBKeyRange.bound(e+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,c){var d=l();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()):(Gt(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(i){a.onsuccess=function(){return i()}})}))}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(i){s.openCursor().onsuccess=function(l){var u=l.target.result;if(u){var c=u.value;c.time<n?(a.push(c),u.continue()):(Gt(o),i(a))}else i(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=Jt(e),cr(t).then(function(n){var o={closed:!1,lastCursorId:0,channelName:t,options:e,uuid:Ft(),eMIs:new Ge(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||Xe(t).then(function(){return ze(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 Xe(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(){qo(0,10)===0&&mr(t)}),t.writeBlockPromise}function br(t,e,n){t.messagesCallbackTime=n,t.messagesCallback=e,Xe(t)}function _r(){return!!qe()}function Er(t){return t.idb.fallbackInterval*2}var vr={create:hr,close:yr,onMessage:br,postMessage:wr,canBeUsed:_r,type:lr,averageResponseTime:Er,microSeconds:ar},kr=St,$r="pubkey.broadcastChannel-",Sr="localstorage";function Ke(){var t;if(typeof window>"u")return null;try{t=window.localStorage,t=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return t}function Ze(t){return $r+t}function Nr(t,e){return new Promise(function(n){ze().then(function(){var o=Ze(t.channelName),s={token:Ft(),time:new Date().getTime(),data:e,uuid:t.uuid},a=JSON.stringify(s);Ke().setItem(o,a);var i=document.createEvent("Event");i.initEvent("storage",!0,!0),i.key=o,i.newValue=a,window.dispatchEvent(i),n()})})}function xr(t,e){var n=Ze(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=Jt(e),!tn())throw new Error("BroadcastChannel: localstorage cannot be used");var n=Ft(),o=new Ge(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 tn(){var t=Ke();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:tn,type:Sr,averageResponseTime:Vr,microSeconds:kr},Tr=St,Ar="simulate",Yt=new Set;function Br(t){var e={name:t,messagesCallback:null};return Yt.add(e),e}function Rr(t){Yt.delete(t)}function jr(t,e){return new Promise(function(n){return setTimeout(function(){var o=Array.from(Yt);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 Lr(t,e){t.messagesCallback=e}function Mr(){return!0}function Ur(){return 5}var Wr={create:Br,close:Rr,onMessage:Lr,postMessage:jr,canBeUsed:Mr,type:Ar,averageResponseTime:Ur,microSeconds:Tr},en=[rr,vr,Dr];function Hr(t){var e=[].concat(t.methods,en).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(en.map(function(s){return s.type})))}var nn=new Set,Fr=0,qt=function(t,e){this.id=Fr++,nn.add(this),this.name=t,this.options=Jt(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 on(this,"message",t)},postInternal:function(t){return on(this,"internal",t)},set onmessage(t){var e=this.method.microSeconds(),n={time:e,fn:t};an(this,"message",this._onML),t&&typeof t=="function"?(this._onML=n,sn(this,"message",n)):this._onML=null},addEventListener:function(t,e){var n=this.method.microSeconds(),o={time:n,fn:e};sn(this,t,o)},removeEventListener:function(t,e){var n=this._addEL[t].find(function(o){return o.fn===e});an(this,t,n)},close:function(){var t=this;if(!this.closed){nn.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 on(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 i=t.method.postMessage(t._state,s);return t._uMP.add(i),i.catch().then(function(){return t._uMP.delete(i)}),i})}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 rn(t){return t._addEL.message.length>0||t._addEL.internal.length>0}function sn(t,e,n){t._addEL[e].push(n),Jr(t)}function an(t,e,n){t._addEL[e]=t._addEL[e].filter(function(o){return o!==n}),Gr(t)}function Jr(t){if(!t._iL&&rn(t)){var e=function(o){t._addEL[o.type].forEach(function(s){var a=1e5,i=s.time-a;o.time>=i&&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&&!rn(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 ln(t){return Object(t)!==t}const Yr=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function qr(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 Xr(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],i=Xr(a);i&&(e+=t.slice(n,s)+i,n=s+1)}return`"${n===0?t:e+t.slice(n)}"`}const Xt=-1,cn=-2,un=-3,dn=-4,fn=-5,Kt=-6;function pn(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,i=!1){if(a===Xt)return;if(a===un)return NaN;if(a===dn)return 1/0;if(a===fn)return-1/0;if(a===Kt)return-0;if(i)throw new Error("Invalid input");if(a in o)return o[a];const l=n[a];if(!l||typeof l!="object")o[a]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const u=l[0];switch(u){case"Date":o[a]=new Date(l[1]);break;case"Set":const c=new Set;o[a]=c;for(let p=1;p<l.length;p+=1)c.add(s(l[p]));break;case"Map":const d=new Map;o[a]=d;for(let p=1;p<l.length;p+=2)d.set(s(l[p]),s(l[p+1]));break;case"RegExp":o[a]=new RegExp(l[1],l[2]);break;case"Object":o[a]=Object(l[1]);break;case"BigInt":o[a]=BigInt(l[1]);break;case"null":const f=Object.create(null);o[a]=f;for(let p=1;p<l.length;p+=2)f[l[p]]=s(l[p+1]);break;default:throw new Error(`Unknown type ${u}`)}}else{const u=new Array(l.length);o[a]=u;for(let c=0;c<l.length;c+=1){const d=l[c];d!==cn&&(u[c]=s(d))}}else{const u={};o[a]=u;for(const c in l){const d=l[c];u[c]=s(d)}}return o[a]}return s(0)}function mn(t,e){const n=[],o=new Map,s=[];for(const c in e)s.push({key:c,fn:e[c]});const a=[];let i=0;function l(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 Xt;if(Number.isNaN(c))return un;if(c===1/0)return dn;if(c===-1/0)return fn;if(c===0&&1/c<0)return Kt;const d=i++;o.set(c,d);for(const{key:p,fn:w}of s){const h=w(c);if(h)return n[d]=`["${p}",${l(h)}]`,d}let f="";if(ln(c))f=Zt(c);else switch(Qr(c)){case"Number":case"String":case"Boolean":f=`["Object",${Zt(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 h=0;h<c.length;h+=1)h>0&&(f+=","),h in c?(a.push(`[${h}]`),f+=l(c[h]),a.pop()):f+=cn;f+="]";break;case"Set":f='["Set"';for(const h of c)f+=`,${l(h)}`;f+="]";break;case"Map":f='["Map"';for(const[h,_]of c)a.push(`.get(${ln(h)?Zt(h):"..."})`),f+=`,${l(h)},${l(_)}`,a.pop();f+="]";break;default:if(!qr(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 h in c)a.push(`.${h}`),f+=`,${nt(h)},${l(c[h])}`,a.pop();f+="]"}else{f="{";let h=!1;for(const _ in c)h&&(f+=","),h=!0,a.push(`.${_}`),f+=`${nt(_)}:${l(c[_])}`,a.pop();f+="}"}}return n[d]=f,d}const u=l(t);return u<0?`${u}`:`[${n.join(",")}]`}function Zt(t){const e=typeof t;return e==="string"?nt(t):t instanceof String?nt(t.toString()):t===void 0?Xt.toString():t===0&&1/t<0?Kt.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}),i=!1,l=0;r.watch(()=>e[t],d=>{i||(l=Date.now(),a.postMessage({timestamp:l,state:pn(mn(d))})),i=!1},{deep:!0}),a.onmessage=d=>{if(d===void 0){a.postMessage({timestamp:l,state:pn(mn(e[t]))});return}d.timestamp<=l||(i=!0,l=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,i;let l=((a=s==null?void 0:s.share)==null?void 0:a.enable)??e,u=((i=s==null?void 0:s.share)==null?void 0:i.omit)??[];!l||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 hn=r.defineComponent({__name:"Doctype",setup(t){const{stonecrop:e,isReady:n}=Fe(),o=r.ref([]);return r.watch(n,()=>{if(n.value){let s=e.value.schema.schema.toArray();s.forEach((a,i)=>{const u=e.value.store.record[a.fieldname];s[i].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]=i=>o.value=i)},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 te(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,os=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function
|
|
16
|
+
*/let ut;const Ot=t=>ut=t,os=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 dt;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(dt||(dt={}));const ft=typeof window<"u";function gn(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]=gn(s,o):t[n]=o}return t}const yn=()=>{};function wn(t,e,n,o=yn){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(),bn=Symbol(),ee=Symbol();function ne(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]=ne(s,o):t[n]=o}return t}const ss=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function as(t){return!X(t)||!t.hasOwnProperty(ss)}const{assign:B}=Object;function _n(t){return!!(r.isRef(t)&&t.effect)}function En(t,e,n,o){const{state:s,actions:a,getters:i}=e,l=n.state.value[t];let u;function c(){!l&&(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(i||{}).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 i[p].call(w,w)})),f),{}))}return u=oe(t,c,e,n,o,!0),u}function oe(t,e,n={},o,s,a){let i;const l=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&&!g._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 h=o.state.value[t];!a&&!h&&(process.env.NODE_ENV==="production"||!s)&&(o.state.value[t]={});const _=r.ref({});let E;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}):(ne(o.state.value[t],m),y={type:dt.patchObject,payload:m,storeId:t,events:w});const k=E=Symbol();r.nextTick().then(()=>{E===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().`)}:yn;function I(){i.stop(),f=[],p=[],o._s.delete(t)}const j=(m,y="")=>{if(bn in m)return m[ee]=y,m;const k=function(){Ot(o);const O=Array.from(arguments),J=[],wt=[];function he(L){J.push(L)}function K(L){wt.push(L)}ot(p,{args:O,name:k[ee],store:g,after:he,onError:K});let C;try{C=m.apply(this&&this.$id===t?this:g,O)}catch(L){throw ot(wt,L),L}return C instanceof Promise?C.then(L=>(ot(J,L),L)).catch(L=>(ot(wt,L),Promise.reject(L))):(ot(J,C),C)};return k[bn]=!0,k[ee]=y,k},V=r.markRaw({actions:{},getters:{},state:[],hotState:_}),N={_p:o,$id:t,$onAction:wn.bind(null,p),$patch:S,$reset:$,$subscribe(m,y={}){const k=wn(f,m,y.detached,()=>O()),O=i.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},g=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,g);const b=(o._a&&o._a.runWithContext||rs)(()=>o._e.run(()=>(i=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(_.value,m,r.toRef(b,m)):a||(h&&as(y)&&(r.isRef(y)?y.value=h[m]:ne(y,h[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),l.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(g,b),B(r.toRaw(g),b),Object.defineProperty(g,"$state",{get:()=>process.env.NODE_ENV!=="production"&&s?_.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"&&(g._hotUpdate=r.markRaw(m=>{g._hotUpdating=!0,m._hmrPayload.state.forEach(y=>{if(y in g.$state){const k=m.$state[y],O=g.$state[y];typeof k=="object"&&X(k)&&X(O)?gn(k,O):m.$state[y]=O}xt(g,y,r.toRef(m.$state,y))}),Object.keys(g.$state).forEach(y=>{y in m.$state||te(g,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(g,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(g,g))):k;xt(g,y,O)}Object.keys(g._hmrPayload.getters).forEach(y=>{y in m._hmrPayload.getters||te(g,y)}),Object.keys(g._hmrPayload.actions).forEach(y=>{y in m._hmrPayload.actions||te(g,y)}),g._hmrPayload=m._hmrPayload,g._getters=m._getters,g._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(g,y,B({value:g[y]},m))})}return o._p.forEach(m=>{if(process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&ft){const y=i.run(()=>m({store:g,app:o._a,pinia:o,options:l}));Object.keys(y||{}).forEach(k=>g._customProperties.add(k)),B(g,y)}else B(g,i.run(()=>m({store:g,app:o._a,pinia:o,options:l})))}),process.env.NODE_ENV!=="production"&&g.$state&&typeof g.$state=="object"&&typeof g.$state.constructor=="function"&&!g.$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 "${g.$id}".`),h&&a&&n.hydrate&&n.hydrate(g.$state,h),c=!0,d=!0,g}/*! #__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 i(l,u){const c=r.hasInjectionContext();if(l=(process.env.NODE_ENV==="test"&&ut&&ut._testing?null:l)||(c?r.inject(os,null):null),l&&Ot(l),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,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
|
|
20
|
+
This will fail in production.`);l=ut,l._s.has(o)||(a?oe(o,e,s,l):En(o,s,l),process.env.NODE_ENV!=="production"&&(i._pinia=l));const d=l._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?oe(f,e,s,l,!0):En(f,B({},s),l,!0);u._hotUpdate(p),delete l.state.value[f],l._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 i.$id=o,i}function vn(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function re(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=re(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=[],i=()=>{a.forEach(d=>d()),a.length=0},l=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[mt(e),re(s)],([d,f])=>{if(i(),!d)return;const p=ds(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>l(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),i()};return vn(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 i=ms(()=>o&&"MutationObserver"in o),l=()=>{a&&(a.disconnect(),a=void 0)},u=r.computed(()=>{const p=re(t),w=(Array.isArray(p)?p:[p]).map(mt).filter(cs);return new Set(w)}),c=r.watch(()=>u.value,p=>{l(),i.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(),l()};return vn(f),{isSupported:i,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,i=()=>{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},l=r.ref(),u=()=>{l.value=i()};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===l.value&&u()})},{childList:!0,subtree:!0}),u(),l}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),i=gs(e);return!n||!i.value?{focused:a}:(ht(o,ys,()=>s.value=!0),ht(o,ws,()=>s.value=!1),{focused:a})}function _s(t,{window:e=pt,scrollTarget:n}={}){const o=r.ref(!1),s=()=>{if(!e)return;const a=e.document,i=mt(t);if(!i)o.value=!1;else{const l=i.getBoundingClientRect();o.value=l.top<=(e.innerHeight||a.documentElement.clientHeight)&&l.left<=(e.innerWidth||a.documentElement.clientWidth)&&l.bottom>=0&&l.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=_s(t).value;return e=e&&t.offsetHeight>0,e},z=t=>t.tabIndex>=0,kn=t=>{const e=t.target;return se(e)},se=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))?se(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,i=a==null?void 0:a.children[n.cellIndex];i&&(o=i)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.firstElementChild;a&&(o=a)}}return o&&(!z(o)||!F(o))?ae(o):o},$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.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))?ae(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,i=a==null?void 0:a.children[n.cellIndex];i&&(o=i)}}else if(n instanceof HTMLTableRowElement){const s=n.parentElement;if(s){const a=s.lastElementChild;a&&(o=a)}}return o&&(!z(o)||!F(o))?se(o):o},Sn=t=>{const e=t.target;return ie(e)},ie=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))?ie(n):n},Nn=t=>{const e=t.target;return le(e)},le=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))?le(n):n},xn=t=>{const e=t.target.parentElement,n=e==null?void 0:e.firstElementChild;return n&&(!z(n)||!F(n))?le(n):n},On=t=>{const e=t.target.parentElement,n=e==null?void 0:e.lastElementChild;return n&&(!z(n)||!F(n))?ie(n):n},Ct=["alt","control","shift","meta"],ks={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},ce={"keydown.up":t=>{const e=kn(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=Sn(t);t.preventDefault(),t.stopPropagation(),e&&e.focus()},"keydown.right":t=>{const e=Nn(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=vs(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.left":t=>{const e=xn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.control.right":t=>{const e=On(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.end":t=>{const e=On(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=kn(t);e&&e.focus()}},"keydown.home":t=>{const e=xn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.tab":t=>{const e=Nn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())},"keydown.shift.tab":t=>{const e=Sn(t);e&&(t.preventDefault(),t.stopPropagation(),e.focus())}};function Cn(t){const e=i=>{let l=null;return i.parent&&(typeof i.parent=="string"?l=document.querySelector(i.parent):i.parent instanceof HTMLElement?l=i.parent:l=i.parent.value),l},n=i=>{var l;const u=e(i);let c=[];if(typeof i.selectors=="string")c=u?Array.from(u.querySelectorAll(i.selectors)):Array.from(document.querySelectorAll(i.selectors));else if(Array.isArray(i.selectors))for(const d of i.selectors)d instanceof HTMLElement?c.push(d):c.push(d.$el);else if(i.selectors instanceof HTMLElement)c.push(i.selectors);else if((l=i.selectors)!=null&&l.value)if(Array.isArray(i.selectors.value))for(const d of i.selectors.value)d instanceof HTMLElement?c.push(d):c.push(d.$el);else c.push(i.selectors.value);return c},o=i=>{const l=e(i);let u=[];return i.selectors?u=n(i):l&&(u=Array.from(l.children).filter(c=>z(c)&&F(c))),u},s=i=>l=>{const u=ks[l.key]||l.key.toLowerCase();if(Ct.includes(u))return;const c=i.handlers||ce;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(E=>Ct.includes(E)),_=Ct.some(E=>{const S=E.charAt(0).toUpperCase()+E.slice(1);return l.getModifierState(S)});if(h.length>0){if(_){for(const E of Ct)if(p.includes(E)){const S=E.charAt(0).toUpperCase()+E.slice(1);l.getModifierState(S)&&w(l)}}}else _||w(l)}}},a=[];r.onMounted(()=>{for(const i of t){const l=e(i),u=o(i),c=s(i),d=l?[l]:u;for(const f of d){const{focused:p}=bs(r.ref(f)),w=r.watch(p,h=>{h?f.addEventListener("keydown",c):f.removeEventListener("keydown",c)});a.push(w)}}}),r.onBeforeUnmount(()=>{for(const i of a)i()})}function gt(t){return r.getCurrentScope()?(r.onScopeDispose(t),!0):!1}function R(t){return typeof t=="function"?t():r.unref(t)}const ue=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $s=t=>t!=null,Ss=Object.prototype.toString,Pn=t=>Ss.call(t)==="[object Object]",rt=()=>{},de=Ns();function Ns(){var t,e;return ue&&((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 fe=ue?window:void 0;function st(t){var e;const n=R(t);return(e=n==null?void 0:n.$el)!=null?e:n}function In(...t){let e,n,o,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,s]=t,e=fe):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],i=()=>{a.forEach(d=>d()),a.length=0},l=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[st(e),R(s)],([d,f])=>{if(i(),!d)return;const p=Pn(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>l(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),i()};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=fe,...s}=n;let a;const i=Vn(()=>o&&"MutationObserver"in o),l=()=>{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=>{l(),i.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(),l()};return gt(f),{isSupported:i,stop:f,takeRecords:d}}function Is(t,e,n={}){const{window:o=fe,...s}=n;let a;const i=Vn(()=>o&&"ResizeObserver"in o),l=()=>{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(l(),i.value&&o){a=new ResizeObserver(e);for(const p of f)p&&a.observe(p,s)}},{immediate:!0,flush:"post"}),d=()=>{l(),c()};return gt(d),{isSupported:i,stop:d}}function Tn(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:s=!0,immediate:a=!0,updateTiming:i="sync"}=e,l=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 _(){const S=st(t);if(!S){n&&(l.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();l.value=$.height,u.value=$.bottom,c.value=$.left,d.value=$.right,f.value=$.top,p.value=$.width,w.value=$.x,h.value=$.y}function E(){i==="sync"?_():i==="next-frame"&&requestAnimationFrame(()=>_())}return Is(t,E),r.watch(()=>st(t),S=>!S&&E()),Dn(t,E,{attributeFilter:["style","class"]}),s&&In("scroll",E,{capture:!0,passive:!0}),o&&In("resize",E,{passive:!0}),Cs(()=>{a&&E()}),{height:l,bottom:u,left:c,right:d,top:f,width:p,x:w,y:h,update:E}}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,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(""),i=r.ref(!1),l=t.store.columns[t.colIndex],u=t.store.rows[t.rowIndex],c=l.align||"center",d=l.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 $;return{textAlign:c,width:d,fontWeight:i.value?"bold":"inherit",paddingLeft:t.store.getIndent(t.colIndex,($=t.store.display[t.rowIndex])==null?void 0:$.indent)}}),h=r.computed(()=>({"sticky-column":t.pinned,"cell-modified":i.value})),_=()=>{const{left:$,bottom:I,width:j,height:V}=Tn(o);l.mask,l.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,N.modal.cell=o.value,typeof l.modalComponent=="function"?N.modal.component=l.modalComponent({table:N.table,row:u,column:l}):N.modal.component=l.modalComponent,N.modal.componentProps=l.modalComponentExtraProps})};if(t.addNavigation){let $={...ce,"keydown.f2":_,"keydown.alt.up":_,"keydown.alt.down":_,"keydown.alt.left":_,"keydown.alt.right":_};typeof t.addNavigation=="object"&&($={...$,...t.addNavigation}),Cn([{selectors:o,handlers:$}])}const E=()=>{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,l.format?(i.value=I.textContent!==t.store.getFormattedValue(t.colIndex,t.rowIndex,s),t.store.setCellText(t.colIndex,t.rowIndex,I.textContent)):(i.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(l).edit,contenteditable:r.unref(l).edit,tabindex:$.tabIndex,spellcheck:!1,style:r.normalizeStyle(w.value),onFocus:E,onPaste:S,onInput:S,onClick:_,class:r.normalizeClass(["atable-cell",h.value])},[r.unref(l).cellComponent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(l).cellComponent),r.mergeProps({key:0,value:f.value},r.unref(l).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))}}),An=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},js=["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=ce;typeof t.addNavigation=="object"&&(s={...s,...t.addNavigation}),Cn([{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]=i=>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,js)),[[r.vShow,n.value]])}}),Ms=An(Ls,[["__scopeId","data-v-9c529d3d"]]),Bn=ue?window:void 0;function yt(t){var e;const n=R(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=Bn):[e,n,o,s]=t,!e)return rt;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],i=()=>{a.forEach(d=>d()),a.length=0},l=(d,f,p,w)=>(d.addEventListener(f,p,w),()=>d.removeEventListener(f,p,w)),u=r.watch(()=>[yt(e),R(s)],([d,f])=>{if(i(),!d)return;const p=Pn(f)?{...f}:f;a.push(...n.flatMap(w=>o.map(h=>l(d,w,h,p))))},{immediate:!0,flush:"post"}),c=()=>{u(),i()};return gt(c),c}let Rn=!1;function jn(t,e,n={}){const{window:o=Bn,ignore:s=[],capture:a=!0,detectIframe:i=!1}=n;if(!o)return rt;de&&!Rn&&(Rn=!0,Array.from(o.document.body.children).forEach(h=>h.addEventListener("click",rt)),o.document.documentElement.addEventListener("click",rt));let l=!0;const u=h=>R(s).some(_=>{if(typeof _=="string")return Array.from(o.document.querySelectorAll(_)).some(E=>E===h.target||h.composedPath().includes(E));{const E=yt(_);return E&&(h.target===E||h.composedPath().includes(E))}});function c(h){const _=R(h);return _&&_.$.subTree.shapeFlag===16}function d(h,_){const E=R(h),S=E.$.subTree&&E.$.subTree.children;return S==null||!Array.isArray(S)?!1:S.some($=>$.el===_.target||_.composedPath().includes($.el))}const f=h=>{const _=yt(t);if(h.target!=null&&!(!(_ instanceof Element)&&c(t)&&d(t,h))&&!(!_||_===h.target||h.composedPath().includes(_))){if(h.detail===0&&(l=!u(h)),!l){l=!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 _=yt(t);l=!u(h)&&!!(_&&!h.composedPath().includes(_))},{passive:!0}),i&&Pt(o,"blur",h=>{setTimeout(()=>{var _;const E=yt(t);((_=o.document.activeElement)==null?void 0:_.tagName)==="IFRAME"&&!(E!=null&&E.contains(o.document.activeElement))&&e(h)},0)})].filter(Boolean);return()=>w.forEach(h=>h())}const Us={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 pe(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function Ln(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:Ln(n)}}function Ws(t){const e=t||window.event,n=e.target;return Ln(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const me=new WeakMap;function Hs(t,e=!1){const n=r.ref(e);let o=null,s="";r.watch(Os(t),l=>{const u=pe(R(l));if(u){const c=u;if(me.get(c)||me.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 l=pe(R(t));!l||n.value||(de&&(o=Pt(l,"touchmove",u=>{Ws(u)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},i=()=>{const l=pe(R(t));!l||!n.value||(de&&(o==null||o()),l.style.overflow=s,me.delete(l),n.value=!1)};return gt(i),r.computed({get(){return n.value},set(l){l?a():i()}})}function Fs(){let t=!1;const e=r.ref(!1);return(n,o)=>{if(e.value=o.value,t)return;t=!0;const s=Hs(n,o.value);r.watch(e,a=>s.value=a)}}Fs();const zs={key:0,id:"resizable"},Js={class:"atable-header-row",tabindex:"-1"},Gs=r.defineComponent({__name:"ATableHeader",props:{columns:{},store:{}},setup(t){return(e,n)=>e.columns.length?(r.openBlock(),r.createElementBlock("thead",zs,[r.createElementVNode("tr",Js,[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)}}),Ys=r.defineComponent({__name:"ATableModal",props:{store:{}},setup(t){const e=r.useTemplateRef("amodal"),{width:n,height:o}=Tn(e),s=r.computed(()=>{var a,i,l,u;if(!(t.store.modal.height&&t.store.modal.width&&t.store.modal.left&&t.store.modal.bottom))return;const c=(a=t.store.modal.cell)==null?void 0:a.closest("table"),d=c.offsetHeight||0,f=c.offsetWidth||0;let p=((i=t.store.modal.cell)==null?void 0:i.offsetTop)||0;const w=((l=c.querySelector("thead"))==null?void 0:l.offsetHeight)||0;p+=w,p=p+o.value<d?p:p-(o.value+t.store.modal.height);let h=((u=t.store.modal.cell)==null?void 0:u.offsetLeft)||0;return h=h+n.value<=f?h:h-(n.value-t.store.modal.width),{left:`${h}px`,top:`${p}px`}});return(a,i)=>(r.openBlock(),r.createElementBlock("div",{class:"amodal",ref:"amodal",tabindex:"-1",onClick:i[0]||(i[0]=r.withModifiers(()=>{},["stop"])),onInput:i[1]||(i[1]=r.withModifiers(()=>{},["stop"])),style:r.normalizeStyle(s.value)},[r.renderSlot(a.$slots,"default")],36))}}),qs=t=>{const e=t.id||Ds();return is(`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),i=r.ref(t.config||{}),l=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(()=>i.value.view?["list","tree","list-expansion"].includes(i.value.view):!1),h=(g,v)=>l.value[`${g}:${v}`],_=(g,v,b)=>{const m=`${g}:${v}`,y=s.value[g];l.value[m]!==b&&(u.value[v].rowModified=!0),l.value[m]=b,a.value[v][y.name]=b},E=(g,v,b)=>{const m=`${g}:${v}`;l.value[m]!==b&&(u.value[v].rowModified=!0,d.value[m]=b)},S=g=>({minWidth:g.width||"40ch",textAlign:g.align||"center",width:i.value.fullWidth?"auto":void 0}),$=g=>i.value.view!=="tree"||u.value[g].isRoot||u.value[g].open,I=g=>i.value.view!=="tree"?"":u.value[g].isRoot||u.value[g].isParent?u.value[g].childrenOpen?"-":"+":"",j=g=>{if(i.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&&j(v))}else i.value.view==="list-expansion"&&(u.value[g].expanded=!u.value[g].expanded)},V=(g,v)=>{const b=h(g,v);return N(g,v,b)},N=(g,v,b)=>{const m=s.value[g],y=a.value[v],k=m.format;return k?typeof k=="function"?k(b,{table:l.value,row:y,column:m}):typeof k=="string"?Function(`"use strict";return (${k})`)()(b,{table:l.value,row:y,column:m}):b:b};return{columns:s,config:i,display:u,modal:c,rows:a,table:l,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:V,getFormattedValue:N,getHeaderCellStyle:S,getIndent:(g,v)=>v&&g===0&&v>0?`${v}ch`:"inherit",getRowExpandSymbol:I,isRowVisible:$,setCellData:_,setCellText:E,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,i=qs({columns:t.columns,rows:a,id:t.id,config:t.config});i.$onAction(({name:c,store:d,args:f,after:p})=>{if(c==="setCellData"){const[w,h,_]=f,E=d.getCellData(w,h);p(()=>{o("cellUpdate",w,h,_,E)})}}),r.watch(()=>i.rows,c=>{o("update:modelValue",c)},{deep:!0}),r.onMounted(()=>{t.columns.some(c=>c.pinned)&&(u(),i.config.view==="tree"&&Dn(s,u,{childList:!0,subtree:!0}))});const l=(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 _=f==null?void 0:f.cells[w];_&&(h.style.width=`${_.offsetWidth}px`)}for(const w of(c==null?void 0:c.rows)||[]){let h=0;const _=[];for(const E of w.cells)(E.classList.contains("sticky-column")||E.classList.contains("sticky-index"))&&(E.style.left=`${h}px`,h+=E.offsetWidth,_.push(E));_.length>0&&_[_.length-1].classList.add("sticky-column-edge")}};return window.addEventListener("keydown",c=>{if(c.key==="Escape"&&i.modal.visible){i.modal.visible=!1;const d=i.modal.parent;d&&r.nextTick().then(()=>{d.focus()})}}),e({store:i}),(c,d)=>r.withDirectives((r.openBlock(),r.createElementBlock("table",{ref:"table",class:"atable",style:r.normalizeStyle({width:r.unref(i).config.fullWidth?"100%":"auto"})},[r.renderSlot(c.$slots,"header",{data:r.unref(i)},()=>[r.createVNode(Gs,{columns:r.unref(i).columns,store:r.unref(i)},null,8,["columns","store"])],!0),r.createElementVNode("tbody",null,[r.renderSlot(c.$slots,"body",{data:r.unref(i)},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(i).rows,(f,p)=>(r.openBlock(),r.createBlock(Ms,{key:f.id,row:f,rowIndex:p,store:r.unref(i)},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(i).columns,(w,h)=>(r.openBlock(),r.createBlock(Rs,{key:w.name,store:r.unref(i),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(i).config.fullWidth?"auto":null}),onCellInput:l},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(i)},void 0,!0),r.renderSlot(c.$slots,"modal",{data:r.unref(i)},()=>[r.withDirectives(r.createVNode(Ys,{store:r.unref(i)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(r.unref(i).modal.component),r.mergeProps({key:`${r.unref(i).modal.rowIndex}:${r.unref(i).modal.colIndex}`,colIndex:r.unref(i).modal.colIndex,rowIndex:r.unref(i).modal.rowIndex,store:r.unref(i)},r.unref(i).modal.componentProps),null,16,["colIndex","rowIndex","store"]))]),_:1},8,["store"]),[[r.vShow,r.unref(i).modal.visible]])],!0)],4)),[[r.unref(Us),r.unref(i).closeModal]])}}),Xs=An(Qs,[["__scopeId","data-v-37bee2a6"]]),Mn=r.defineComponent({__name:"Records",setup(t){const{stonecrop:e,isReady:n}=Fe(),o={view:"list"};return(s,a)=>r.unref(n)?(r.openBlock(),r.createBlock(r.unref(Xs),{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"}},Un=Dt(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"),i=()=>{e.value=!e.value},l=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 l()},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:i,onKeydown:r.withKeys(i,["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
|
|
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:
|
|
28
|
+
C81.03,234.149,81.03,385.666,81.03,385.666z`})],-1)])))]),_:1})],36),r.createElementVNode("li",{class:"searchtab",onClick:l,onKeydown:r.withKeys(l,["enter"]),style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createElementVNode("a",ea,[r.createElementVNode("span",{style:r.normalizeStyle({display:n.value?"none":"block"})},[(r.openBlock(),r.createElementBlock("svg",na,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]=h=>o.value=h),ref:"searchinput",style:r.normalizeStyle({display:n.value?"block":"none"}),onClick:p[1]||(p[1]=h=>u(h)),onInput:p[2]||(p[2]=h=>u(h)),onBlur:p[3]||(p[3]=h=>c(h)),onKeydown:p[4]||(p[4]=r.withKeys(h=>c(h),["enter"])),type:"text"},null,36),[[r.vModelText,o.value]])])],36),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.breadcrumbs,h=>(r.openBlock(),r.createElementBlock("li",{key:h.title,style:r.normalizeStyle({display:e.value?"block":"none"})},[r.createVNode(w,{tabindex:"0",to:h.to},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.title),1)]),_:2},1032,["to"])],4))),128))])])}}}),[["__scopeId","data-v-a650f215"]]),oa={install:t=>{t.component("ActionSet",ge),t.component("CommandPalette",ye),t.component("Doctype",hn),t.component("Records",Mn),t.component("SheetNav",Un)}};D.ActionSet=ge,D.CommandPalette=ye,D.Doctype=hn,D.Records=Mn,D.SheetNav=Un,D.StonecropDesktop=oa,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
|
|
29
29
|
//# sourceMappingURL=desktop.umd.cjs.map
|