@stonecrop/desktop 0.2.11 โ 0.2.13
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/package.json +5 -5
- package/dist/desktop.js +0 -4965
- package/dist/desktop.js.map +0 -1
- package/dist/desktop.umd.cjs +0 -45
- package/dist/desktop.umd.cjs.map +0 -1
- package/dist/style.css +0 -1
package/dist/desktop.umd.cjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
(function(W,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(W=typeof globalThis<"u"?globalThis:W||self,s(W["@stonecrop/desktop"]={},W.Vue))})(this,function(W,s){"use strict";const ze=e=>(s.pushScopeId("data-v-b7fdfbec"),e=e(),s.popScopeId(),e),Do={class:"action-menu-icon"},Vo=[ze(()=>s.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"},[s.createElementVNode("polygon",{points:"54.2,33.4 29.2,58.8 25,54.6 50,29.2 "})],-1)),ze(()=>s.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"},[s.createElementVNode("polygon",{points:"70.8,58.8 45.8,33.4 50,29.2 75,54.6 "})],-1))],Bo=ze(()=>s.createElementVNode("div",{style:{"margin-right":"30px"}},null,-1)),Mo=["onclick"],Lo={key:1},jo=["onClick"],Uo={class:"dropdown-container"},Ho={class:"dropdown"},Fo=["onclick"],Wo=["href"],zo={class:"dropdown-item"},Go=s.defineComponent({__name:"ActionSet",props:{elements:{}},setup(e){const t=e,n=s.ref([]),o=s.ref(!1),r=s.ref(null),a=s.ref(!1),c=s.ref(!1);s.onMounted(()=>{n.value=t.elements,i()});const i=()=>{for(let f of n.value)f.elementType==="dropdown"&&(f.show=!1)},u=()=>{a.value=!0,r.value=setTimeout(()=>{a.value&&(o.value=!0)},500)},d=()=>{a.value=!1,c.value=!1,clearTimeout(r.value),o.value=!1},l=f=>{const p=!n.value[f].show;i(),n.value[f].show=p};return(f,p)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([{"open-set":o.value,"hovered-and-closed":c.value},"action-set collapse"]),onMouseover:u,onMouseleave:d},[s.createElementVNode("div",Do,[s.createElementVNode("div",{id:"chevron",onClick:p[0]||(p[0]=h=>c.value=!c.value)},Vo)]),Bo,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value,(h,y)=>(s.openBlock(),s.createElementBlock("div",{class:"action-element",key:y},[h.elementType=="button"?(s.openBlock(),s.createElementBlock("button",{key:0,onclick:h.action,class:"button-default"},s.toDisplayString(h.label),9,Mo)):s.createCommentVNode("",!0),h.elementType=="dropdown"?(s.openBlock(),s.createElementBlock("div",Lo,[s.createElementVNode("button",{class:"button-default",onClick:g=>l(y)},s.toDisplayString(h.label),9,jo),s.withDirectives(s.createElementVNode("div",Uo,[s.createElementVNode("div",Ho,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.actions,g=>(s.openBlock(),s.createElementBlock("div",{key:g.label},[g.action!=null?(s.openBlock(),s.createElementBlock("button",{key:0,onclick:g.action,class:"dropdown-item"},s.toDisplayString(g.label),9,Fo)):g.link!=null?(s.openBlock(),s.createElementBlock("a",{key:1,href:g.link},[s.createElementVNode("button",zo,s.toDisplayString(g.label),1)],8,Wo)):s.createCommentVNode("",!0)]))),128))])],512),[[s.vShow,h.show]])])):s.createCommentVNode("",!0)]))),128))],34))}}),Ge=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},$t=Ge(Go,[["__scopeId","data-v-b7fdfbec"]]),Qo={};function qo(e,t){return s.openBlock(),s.createElementBlock("dialog")}const Rt=Ge(Qo,[["render",qo]]),Ko=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n};var Tt;typeof window<"u"&&(Tt=window==null?void 0:window.navigator)!=null&&Tt.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Jo(e){return e}const At=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Dt="__vueuse_ssr_handlers__";At[Dt]=At[Dt]||{};var Vt;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Vt||(Vt={}));var Yo=Object.defineProperty,Bt=Object.getOwnPropertySymbols,Xo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,Mt=(e,t,n)=>t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,er=(e,t)=>{for(var n in t||(t={}))Xo.call(t,n)&&Mt(e,n,t[n]);if(Bt)for(var n of Bt(t))Zo.call(t,n)&&Mt(e,n,t[n]);return e};er({linear:Jo},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]}),s.defineComponent({name:"ADropdown",props:{modelValue:{type:String,required:!1,default:""},label:{type:String,required:!0},value:String,items:{type:Array,required:!1,default:()=>[]},isAsync:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue","filterChanged"],data(){return{results:[],search:this.modelValue,isLoading:!1,arrowCounter:0,isOpen:!1}},watch:{items:function(e,t){this.isLoading=!1,this.results=e}},mounted(){document.addEventListener("click",this.handleClickOutside),this.filterResults()},destroyed(){document.removeEventListener("click",this.handleClickOutside)},methods:{setResult(e){this.search=e,this.closeResults()},filterResults(){this.results=this.items.filter(e=>e.toLowerCase().indexOf(this.search.toLowerCase())>-1)},onChange(){this.isOpen=!0,this.isAsync?(this.isLoading=!0,this.$emit("filterChanged",this.search)):this.filterResults()},handleClickOutside(e){this.$el.contains(e.target)||(this.closeResults(),this.arrowCounter=0)},closeResults(){this.isOpen=!1,this.items.includes(this.search)||(this.search=""),this.$emit("update:modelValue",this.search)},onArrowDown(){this.arrowCounter<this.results.length&&(this.arrowCounter=this.arrowCounter+1)},onArrowUp(){this.arrowCounter>0&&(this.arrowCounter=this.arrowCounter-1)},onEnter(){this.search=this.results[this.arrowCounter],this.closeResults(),this.arrowCounter=0},openWithSearch(){this.search="",this.onChange(),this.$refs.mopInput.focus()}}});const tr=s.defineComponent({__name:"AForm",props:{modelValue:{},data:{},readonly:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t,r=s.ref(n.data||{}),a=i=>{let u={};for(const[d,l]of Object.entries(i))["component","fieldtype"].includes(d)||(u[d]=l),d==="rows"&&l&&l.length===0&&(u.rows=r.value[i.fieldname]);return u},c=s.computed({get:()=>n.modelValue.map((i,u)=>s.computed({get(){return i.value},set:d=>{n.modelValue[u].value=d,o("update:modelValue",n.modelValue)}})),set:()=>{}});return(i,u)=>(s.openBlock(),s.createElementBlock("form",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.modelValue,(d,l)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(d.component),s.mergeProps({key:l,schema:d,modelValue:c.value[l].value,"onUpdate:modelValue":f=>c.value[l].value=f,data:r.value[d.fieldname],readonly:i.readonly},a(d)),null,16,["schema","modelValue","onUpdate:modelValue","data","readonly"]))),128))]))}}),nr=Ko(tr,[["__scopeId","data-v-74d66cf2"]]),Lt={date:"##/##/####",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"};function or(e){try{return Function(`"use strict";return (${e})`)()}catch{}}function rr(e){var t;let n=e.value;if(n){const o=or(n);if(o){const r=e.instance.locale;n=o(r)}}else{const o=(t=e.instance.schema.fieldtype)==null?void 0:t.toLowerCase();o&&Lt[o]&&(n=Lt[o])}return n}function sr(e,t){t||(t="#");let n=e;const o=[t,"/","-","(",")"," "];for(const r of o)n=n.replaceAll(r,"");return n}function ar(e,t,n){n||(n="#");let o=t;for(const r of e){const a=o.indexOf(n);if(a!==-1){const c=o.substring(0,a),i=o.substring(a+1);o=c+r+i}}return o.slice(0,t.length)}function ir(e,t){const n=rr(t);if(!n)return;const o="#",r=e.value,a=sr(r,o);if(a){const c=ar(a,n,o);t.instance.maskFilled&&(t.instance.maskFilled=!c.includes(o)),e.value=c}else e.value=n}s.defineComponent({name:"ATextInput",props:{schema:{type:Object,required:!0},label:{type:String,required:!0},modelValue:{type:null},mask:{type:String},required:{type:Boolean},readonly:{type:Boolean},uuid:{type:String},validation:{type:Object,default:()=>({errorMessage:" "})}},setup(e,t){const n=s.ref(!1),o=s.inject("locale","");return{inputText:s.computed({get(){return e.modelValue},set(r){t.emit("update:modelValue",r)}}),locale:o,maskFilled:n}},directives:{mask:ir}});function Qe(e){this.message=e||""}Qe.prototype=Object.create(Error.prototype,{constructor:{value:Qe},name:{value:"NotImplemented"},stack:{get:function(){return new Error().stack}}});class ve{constructor(t,n,o,r,a){if(this.name="Stonecrop",ve._root)return ve._root;ve._root=this,this.registry=t,this.store=n,this.schema=o,this.workflow=r,this.actions=a}setup(t){this.getMeta(t),this.getWorkflow(t),this.getActions(t)}getMeta(t){return this.registry.getMeta?this.registry.getMeta(t.doctype):new Qe(t.doctype)}getWorkflow(t){const n=this.registry.registry[t.slug];this.workflow=n.workflow}getActions(t){const n=this.registry.registry[t.slug];this.actions=n.actions}async getRecords(t,n){this.store.$patch({records:[]});const r=await(await fetch(`/${t.slug}`,n)).json();this.store.$patch({records:r})}async getRecord(t,n){this.store.$patch({record:{}});const r=await(await fetch(`/${t.slug}/${n}`)).json();this.store.$patch({record:r})}runAction(t,n,o){const a=this.registry.registry[t.slug].actions.get(n),{initialState:c}=this.workflow;this.workflow.transition(c,{type:n}),a.length>0&&a.forEach(i=>{new Function(i)(o)})}}var jt=!1;function $e(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function qe(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function cr(){return Ut().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ut(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const lr=typeof Proxy=="function",ur="devtools-plugin:setup",dr="plugin:settings:set";let pe,Ke;function fr(){var e;return pe!==void 0||(typeof window<"u"&&window.performance?(pe=!0,Ke=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(pe=!0,Ke=global.perf_hooks.performance):pe=!1),pe}function pr(){return fr()?Ke.now():Date.now()}class hr{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const o={};if(t.settings)for(const c in t.settings){const i=t.settings[c];o[c]=i.defaultValue}const r=`__vue-devtools-plugin-settings__${t.id}`;let a=Object.assign({},o);try{const c=localStorage.getItem(r),i=JSON.parse(c);Object.assign(a,i)}catch{}this.fallbacks={getSettings(){return a},setSettings(c){try{localStorage.setItem(r,JSON.stringify(c))}catch{}a=c},now(){return pr()}},n&&n.on(dr,(c,i)=>{c===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(c,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(c,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(d=>{this.targetQueue.push({method:i,args:u,resolve:d})})})}async setRealTarget(t){this.target=t;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 Je(e,t){const n=e,o=Ut(),r=cr(),a=lr&&n.enableEarlyProxy;if(r&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))r.emit(ur,e,t);else{const c=a?new hr(n,r):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:c}),c&&t(c.proxiedTarget)}}/*!
|
|
2
|
-
* pinia v2.1.7
|
|
3
|
-
* (c) 2023 Eduardo San Martin Morote
|
|
4
|
-
* @license MIT
|
|
5
|
-
*/let _e;const be=e=>_e=e,Ht=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function ce(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var J;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(J||(J={}));const Re=typeof window<"u",Ee=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&Re,Ft=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 mr(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function Ye(e,t,n){const o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){Gt(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function Wt(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Te(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}const Ae=typeof navigator=="object"?navigator:{userAgent:""},zt=/Macintosh/.test(Ae.userAgent)&&/AppleWebKit/.test(Ae.userAgent)&&!/Safari/.test(Ae.userAgent),Gt=Re?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!zt?gr:"msSaveOrOpenBlob"in Ae?yr:wr:()=>{};function gr(e,t="download",n){const o=document.createElement("a");o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin!==location.origin?Wt(o.href)?Ye(e,t,n):(o.target="_blank",Te(o)):Te(o)):(o.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){Te(o)},0))}function yr(e,t="download",n){if(typeof e=="string")if(Wt(e))Ye(e,t,n);else{const o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){Te(o)})}else navigator.msSaveOrOpenBlob(mr(e,n),t)}function wr(e,t,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return Ye(e,t,n);const r=e.type==="application/octet-stream",a=/constructor/i.test(String(Ft.HTMLElement))||"safari"in Ft,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||r&&a||zt)&&typeof FileReader<"u"){const i=new FileReader;i.onloadend=function(){let u=i.result;if(typeof u!="string")throw o=null,new Error("Wrong reader.result type");u=c?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=u:location.assign(u),o=null},i.readAsDataURL(e)}else{const i=URL.createObjectURL(e);o?o.location.assign(i):location.href=i,o=null,setTimeout(function(){URL.revokeObjectURL(i)},4e4)}}function B(e,t){const n="๐ "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,t):t==="error"?console.error(n):t==="warn"?console.warn(n):console.log(n)}function Xe(e){return"_a"in e&&"install"in e}function Qt(){if(!("clipboard"in navigator))return B("Your browser doesn't support the Clipboard API","error"),!0}function qt(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(B('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function vr(e){if(!Qt())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),B("Global state copied to clipboard.")}catch(t){if(qt(t))return;B("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function _r(e){if(!Qt())try{Kt(e,JSON.parse(await navigator.clipboard.readText())),B("Global state pasted from clipboard.")}catch(t){if(qt(t))return;B("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function br(e){try{Gt(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){B("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let X;function Er(){X||(X=document.createElement("input"),X.type="file",X.accept=".json");function e(){return new Promise((t,n)=>{X.onchange=async()=>{const o=X.files;if(!o)return t(null);const r=o.item(0);return t(r?{text:await r.text(),file:r}:null)},X.oncancel=()=>t(null),X.onerror=n,X.click()})}return e}async function kr(e){try{const n=await Er()();if(!n)return;const{text:o,file:r}=n;Kt(e,JSON.parse(o)),B(`Global state imported from "${r.name}".`)}catch(t){B("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function Kt(e,t){for(const n in t){const o=e.state.value[n];o?Object.assign(o,t[n]):e.state.value[n]=t[n]}}function q(e){return{_custom:{display:e}}}const Jt="๐ Pinia (root)",Ze="_root";function Sr(e){return Xe(e)?{id:Ze,label:Jt}:{id:e.$id,label:e.$id}}function Or(e){if(Xe(e)){const n=Array.from(e._s.keys()),o=e._s;return{state:n.map(a=>({editable:!0,key:a,value:e.state.value[a]})),getters:n.filter(a=>o.get(a)._getters).map(a=>{const c=o.get(a);return{editable:!1,key:a,value:c._getters.reduce((i,u)=>(i[u]=c[u],i),{})}})}}const t={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),t}function Ir(e){return e?Array.isArray(e)?e.reduce((t,n)=>(t.keys.push(n.key),t.operations.push(n.type),t.oldValue[n.key]=n.oldValue,t.newValue[n.key]=n.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:q(e.type),key:q(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Cr(e){switch(e){case J.direct:return"mutation";case J.patchFunction:return"$patch";case J.patchObject:return"$patch";default:return"unknown"}}let he=!0;const De=[],le="pinia:mutations",j="pinia",{assign:Nr}=Object,Ve=e=>"๐ "+e;function Pr(e,t){Je({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:De,app:e},n=>{typeof n.now!="function"&&B("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:le,label:"Pinia ๐",color:15064968}),n.addInspector({id:j,label:"Pinia ๐",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{vr(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await _r(t),n.sendInspectorTree(j),n.sendInspectorState(j)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{br(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await kr(t),n.sendInspectorTree(j),n.sendInspectorState(j)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:o=>{const r=t._s.get(o);r?typeof r.$reset!="function"?B(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`,"warn"):(r.$reset(),B(`Store "${o}" reset.`)):B(`Cannot reset "${o}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((o,r)=>{const a=o.componentInstance&&o.componentInstance.proxy;if(a&&a._pStores){const c=o.componentInstance.proxy._pStores;Object.values(c).forEach(i=>{o.instanceData.state.push({type:Ve(i.$id),key:"state",editable:!0,value:i._isOptionsAPI?{_custom:{value:s.toRaw(i.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>i.$reset()}]}}:Object.keys(i.$state).reduce((u,d)=>(u[d]=i.$state[d],u),{})}),i._getters&&i._getters.length&&o.instanceData.state.push({type:Ve(i.$id),key:"getters",editable:!1,value:i._getters.reduce((u,d)=>{try{u[d]=i[d]}catch(l){u[d]=l}return u},{})})})}}),n.on.getInspectorTree(o=>{if(o.app===e&&o.inspectorId===j){let r=[t];r=r.concat(Array.from(t._s.values())),o.rootNodes=(o.filter?r.filter(a=>"$id"in a?a.$id.toLowerCase().includes(o.filter.toLowerCase()):Jt.toLowerCase().includes(o.filter.toLowerCase())):r).map(Sr)}}),n.on.getInspectorState(o=>{if(o.app===e&&o.inspectorId===j){const r=o.nodeId===Ze?t:t._s.get(o.nodeId);if(!r)return;r&&(o.state=Or(r))}}),n.on.editInspectorState((o,r)=>{if(o.app===e&&o.inspectorId===j){const a=o.nodeId===Ze?t:t._s.get(o.nodeId);if(!a)return B(`store "${o.nodeId}" not found`,"error");const{path:c}=o;Xe(a)?c.unshift("state"):(c.length!==1||!a._customProperties.has(c[0])||c[0]in a.$state)&&c.unshift("$state"),he=!1,o.set(a,c,o.state.value),he=!0}}),n.on.editComponentState(o=>{if(o.type.startsWith("๐")){const r=o.type.replace(/^๐\s*/,""),a=t._s.get(r);if(!a)return B(`store "${r}" not found`,"error");const{path:c}=o;if(c[0]!=="state")return B(`Invalid path for store "${r}":
|
|
6
|
-
${c}
|
|
7
|
-
Only state can be modified.`);c[0]="$state",he=!1,o.set(a,c,o.state.value),he=!0}})})}function xr(e,t){De.includes(Ve(t.$id))||De.push(Ve(t.$id)),Je({id:"dev.esm.pinia",label:"Pinia ๐",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:De,app:e,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;t.$onAction(({after:c,onError:i,name:u,args:d})=>{const l=Yt++;n.addTimelineEvent({layerId:le,event:{time:o(),title:"๐ซ "+u,subtitle:"start",data:{store:q(t.$id),action:q(u),args:d},groupId:l}}),c(f=>{re=void 0,n.addTimelineEvent({layerId:le,event:{time:o(),title:"๐ฌ "+u,subtitle:"end",data:{store:q(t.$id),action:q(u),args:d,result:f},groupId:l}})}),i(f=>{re=void 0,n.addTimelineEvent({layerId:le,event:{time:o(),logType:"error",title:"๐ฅ "+u,subtitle:"end",data:{store:q(t.$id),action:q(u),args:d,error:f},groupId:l}})})},!0),t._customProperties.forEach(c=>{s.watch(()=>s.unref(t[c]),(i,u)=>{n.notifyComponentUpdate(),n.sendInspectorState(j),he&&n.addTimelineEvent({layerId:le,event:{time:o(),title:"Change",subtitle:c,data:{newValue:i,oldValue:u},groupId:re}})},{deep:!0})}),t.$subscribe(({events:c,type:i},u)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(j),!he)return;const d={time:o(),title:Cr(i),data:Nr({store:q(t.$id)},Ir(c)),groupId:re};i===J.patchFunction?d.subtitle="โคต๏ธ":i===J.patchObject?d.subtitle="๐งฉ":c&&!Array.isArray(c)&&(d.subtitle=c.type),c&&(d.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:c}}),n.addTimelineEvent({layerId:le,event:d})},{detached:!0,flush:"sync"});const r=t._hotUpdate;t._hotUpdate=s.markRaw(c=>{r(c),n.addTimelineEvent({layerId:le,event:{time:o(),title:"๐ฅ "+t.$id,subtitle:"HMR update",data:{store:q(t.$id),info:q("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(j),n.sendInspectorState(j)});const{$dispose:a}=t;t.$dispose=()=>{a(),n.notifyComponentUpdate(),n.sendInspectorTree(j),n.sendInspectorState(j),n.getSettings().logStoreChanges&&B(`Disposed "${t.$id}" store ๐`)},n.notifyComponentUpdate(),n.sendInspectorTree(j),n.sendInspectorState(j),n.getSettings().logStoreChanges&&B(`"${t.$id}" store installed ๐`)})}let Yt=0,re;function Xt(e,t,n){const o=t.reduce((r,a)=>(r[a]=s.toRaw(e)[a],r),{});for(const r in o)e[r]=function(){const a=Yt,c=n?new Proxy(e,{get(...u){return re=a,Reflect.get(...u)},set(...u){return re=a,Reflect.set(...u)}}):e;re=a;const i=o[r].apply(c,arguments);return re=void 0,i}}function $r({app:e,store:t,options:n}){if(t.$id.startsWith("__hot:"))return;t._isOptionsAPI=!!n.state,Xt(t,Object.keys(n.actions),t._isOptionsAPI);const o=t._hotUpdate;s.toRaw(t)._hotUpdate=function(r){o.apply(this,arguments),Xt(t,Object.keys(r._hmrPayload.actions),!!t._isOptionsAPI)},xr(e,t)}function Rr(){const e=s.effectScope(!0),t=e.run(()=>s.ref({}));let n=[],o=[];const r=s.markRaw({install(a){be(r),r._a=a,a.provide(Ht,r),a.config.globalProperties.$pinia=r,Ee&&Pr(a,r),o.forEach(c=>n.push(c)),o=[]},use(a){return!this._a&&!jt?o.push(a):n.push(a),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return Ee&&typeof Proxy<"u"&&r.use($r),r}function Zt(e,t){for(const n in t){const o=t[n];if(!(n in e))continue;const r=e[n];ce(r)&&ce(o)&&!s.isRef(o)&&!s.isReactive(o)?e[n]=Zt(r,o):e[n]=o}return e}const en=()=>{};function tn(e,t,n,o=en){e.push(t);const r=()=>{const a=e.indexOf(t);a>-1&&(e.splice(a,1),o())};return!n&&s.getCurrentScope()&&s.onScopeDispose(r),r}function me(e,...t){e.slice().forEach(n=>{n(...t)})}const Tr=e=>e();function et(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,o)=>e.set(o,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],r=e[n];ce(r)&&ce(o)&&e.hasOwnProperty(n)&&!s.isRef(o)&&!s.isReactive(o)?e[n]=et(r,o):e[n]=o}return e}const Ar=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Dr(e){return!ce(e)||!e.hasOwnProperty(Ar)}const{assign:z}=Object;function nn(e){return!!(s.isRef(e)&&e.effect)}function on(e,t,n,o){const{state:r,actions:a,getters:c}=t,i=n.state.value[e];let u;function d(){!i&&(process.env.NODE_ENV==="production"||!o)&&(n.state.value[e]=r?r():{});const l=process.env.NODE_ENV!=="production"&&o?s.toRefs(s.ref(r?r():{}).value):s.toRefs(n.state.value[e]);return z(l,a,Object.keys(c||{}).reduce((f,p)=>(process.env.NODE_ENV!=="production"&&p in l&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${e}".`),f[p]=s.markRaw(s.computed(()=>{be(n);const h=n._s.get(e);return c[p].call(h,h)})),f),{}))}return u=tt(e,d,t,n,o,!0),u}function tt(e,t,n={},o,r,a){let c;const i=z({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"&&!jt&&(u.onTrigger=k=>{d?h=k:d==!1&&!S._hotUpdating&&(Array.isArray(h)?h.push(k):console.error("๐ debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let d,l,f=[],p=[],h;const y=o.state.value[e];!a&&!y&&(process.env.NODE_ENV==="production"||!r)&&(o.state.value[e]={});const g=s.ref({});let _;function O(k){let b;d=l=!1,process.env.NODE_ENV!=="production"&&(h=[]),typeof k=="function"?(k(o.state.value[e]),b={type:J.patchFunction,storeId:e,events:h}):(et(o.state.value[e],k),b={type:J.patchObject,payload:k,storeId:e,events:h});const R=_=Symbol();s.nextTick().then(()=>{_===R&&(d=!0)}),l=!0,me(f,b,o.state.value[e])}const I=a?function(){const{state:b}=n,R=b?b():{};this.$patch(V=>{z(V,R)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`๐: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:en;function T(){c.stop(),f=[],p=[],o._s.delete(e)}function L(k,b){return function(){be(o);const R=Array.from(arguments),V=[],de=[];function xe(U){V.push(U)}function Fe(U){de.push(U)}me(p,{args:R,name:k,store:S,after:xe,onError:Fe});let Y;try{Y=b.apply(this&&this.$id===e?this:S,R)}catch(U){throw me(de,U),U}return Y instanceof Promise?Y.then(U=>(me(V,U),U)).catch(U=>(me(de,U),Promise.reject(U))):(me(V,Y),Y)}}const G=s.markRaw({actions:{},getters:{},state:[],hotState:g}),Q={_p:o,$id:e,$onAction:tn.bind(null,p),$patch:O,$reset:I,$subscribe(k,b={}){const R=tn(f,k,b.detached,()=>V()),V=c.run(()=>s.watch(()=>o.state.value[e],de=>{(b.flush==="sync"?l:d)&&k({storeId:e,type:J.direct,events:h},de)},z({},u,b)));return R},$dispose:T},S=s.reactive(process.env.NODE_ENV!=="production"||Ee?z({_hmrPayload:G,_customProperties:s.markRaw(new Set)},Q):Q);o._s.set(e,S);const K=(o._a&&o._a.runWithContext||Tr)(()=>o._e.run(()=>(c=s.effectScope()).run(t)));for(const k in K){const b=K[k];if(s.isRef(b)&&!nn(b)||s.isReactive(b))process.env.NODE_ENV!=="production"&&r?$e(g.value,k,s.toRef(K,k)):a||(y&&Dr(b)&&(s.isRef(b)?b.value=y[k]:et(b,y[k])),o.state.value[e][k]=b),process.env.NODE_ENV!=="production"&&G.state.push(k);else if(typeof b=="function"){const R=process.env.NODE_ENV!=="production"&&r?b:L(k,b);K[k]=R,process.env.NODE_ENV!=="production"&&(G.actions[k]=b),i.actions[k]=b}else process.env.NODE_ENV!=="production"&&nn(b)&&(G.getters[k]=a?n.getters[k]:b,Re&&(K._getters||(K._getters=s.markRaw([]))).push(k))}if(z(S,K),z(s.toRaw(S),K),Object.defineProperty(S,"$state",{get:()=>process.env.NODE_ENV!=="production"&&r?g.value:o.state.value[e],set:k=>{if(process.env.NODE_ENV!=="production"&&r)throw new Error("cannot set hotState");O(b=>{z(b,k)})}}),process.env.NODE_ENV!=="production"&&(S._hotUpdate=s.markRaw(k=>{S._hotUpdating=!0,k._hmrPayload.state.forEach(b=>{if(b in S.$state){const R=k.$state[b],V=S.$state[b];typeof R=="object"&&ce(R)&&ce(V)?Zt(R,V):k.$state[b]=V}$e(S,b,s.toRef(k.$state,b))}),Object.keys(S.$state).forEach(b=>{b in k.$state||qe(S,b)}),d=!1,l=!1,o.state.value[e]=s.toRef(k._hmrPayload,"hotState"),l=!0,s.nextTick().then(()=>{d=!0});for(const b in k._hmrPayload.actions){const R=k[b];$e(S,b,L(b,R))}for(const b in k._hmrPayload.getters){const R=k._hmrPayload.getters[b],V=a?s.computed(()=>(be(o),R.call(S,S))):R;$e(S,b,V)}Object.keys(S._hmrPayload.getters).forEach(b=>{b in k._hmrPayload.getters||qe(S,b)}),Object.keys(S._hmrPayload.actions).forEach(b=>{b in k._hmrPayload.actions||qe(S,b)}),S._hmrPayload=k._hmrPayload,S._getters=k._getters,S._hotUpdating=!1})),Ee){const k={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(b=>{Object.defineProperty(S,b,z({value:S[b]},k))})}return o._p.forEach(k=>{if(Ee){const b=c.run(()=>k({store:S,app:o._a,pinia:o,options:i}));Object.keys(b||{}).forEach(R=>S._customProperties.add(R)),z(S,b)}else z(S,c.run(()=>k({store:S,app:o._a,pinia:o,options:i})))}),process.env.NODE_ENV!=="production"&&S.$state&&typeof S.$state=="object"&&typeof S.$state.constructor=="function"&&!S.$state.constructor.toString().includes("[native code]")&&console.warn(`[๐]: The "state" must be a plain object. It cannot be
|
|
8
|
-
state: () => new MyClass()
|
|
9
|
-
Found in store "${S.$id}".`),y&&a&&n.hydrate&&n.hydrate(S.$state,y),d=!0,l=!0,S}function Vr(e,t,n){let o,r;const a=typeof t=="function";if(typeof e=="string")o=e,r=a?n:t;else if(r=e,o=e.id,process.env.NODE_ENV!=="production"&&typeof o!="string")throw new Error('[๐]: "defineStore()" must be passed a store id as its first argument.');function c(i,u){const d=s.hasInjectionContext();if(i=(process.env.NODE_ENV==="test"&&_e&&_e._testing?null:i)||(d?s.inject(Ht,null):null),i&&be(i),process.env.NODE_ENV!=="production"&&!_e)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
|
-
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
11
|
-
This will fail in production.`);i=_e,i._s.has(o)||(a?tt(o,t,r,i):on(o,r,i),process.env.NODE_ENV!=="production"&&(c._pinia=i));const l=i._s.get(o);if(process.env.NODE_ENV!=="production"&&u){const f="__hot:"+o,p=a?tt(f,t,r,i,!0):on(f,z({},r),i,!0);u._hotUpdate(p),delete i.state.value[f],i._s.delete(f)}if(process.env.NODE_ENV!=="production"&&Re){const f=s.getCurrentInstance();if(f&&f.proxy&&!u){const p=f.proxy,h="_pStores"in p?p._pStores:p._pStores={};h[o]=l}}return l}return c.$id=o,c}const Br=Vr("data",()=>{const e=s.ref([]),t=s.ref({});return{records:e,record:t}});function rn(e){e||(e=s.inject("$registry"));const t=Br(),n=s.ref(new ve(e,t)),o=s.ref(!1);return s.onBeforeMount(async()=>{var r,a;const c=e.router.currentRoute.value,i=(r=c.params.records)==null?void 0:r.toString().toLowerCase(),u=(a=c.params.record)==null?void 0:a.toString().toLowerCase();if(!i&&!u)return;const d=await e.getMeta(i);e.addDoctype(d),n.value.setup(d),i&&(u?await n.value.getRecord(d,u):await n.value.getRecords(d)),n.value.runAction(d,"LOAD",u?[u]:void 0),o.value=!0}),{stonecrop:n,isReady:o}}/*!
|
|
12
|
-
* vue-router v4.2.5
|
|
13
|
-
* (c) 2023 Eduardo San Martin Morote
|
|
14
|
-
* @license MIT
|
|
15
|
-
*/const Z=typeof window<"u";function Mr(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const x=Object.assign;function nt(e,t){const n={};for(const o in t){const r=t[o];n[o]=F(r)?r.map(e):e(r)}return n}const ke=()=>{},F=Array.isArray;function P(e){const t=Array.from(arguments).slice(1);console.warn.apply(console,["[Vue Router warn]: "+e].concat(t))}const Lr=/\/$/,jr=e=>e.replace(Lr,"");function ot(e,t,n="/"){let o,r={},a="",c="";const i=t.indexOf("#");let u=t.indexOf("?");return i<u&&i>=0&&(u=-1),u>-1&&(o=t.slice(0,u),a=t.slice(u+1,i>-1?i:t.length),r=e(a)),i>-1&&(o=o||t.slice(0,i),c=t.slice(i,t.length)),o=Fr(o??t,n),{fullPath:o+(a&&"?")+a+c,path:o,query:r,hash:c}}function Ur(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function sn(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function an(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&se(t.matched[o],n.matched[r])&&cn(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function se(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function cn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Hr(e[n],t[n]))return!1;return!0}function Hr(e,t){return F(e)?ln(e,t):F(t)?ln(t,e):e===t}function ln(e,t){return F(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Fr(e,t){if(e.startsWith("/"))return e;if(process.env.NODE_ENV!=="production"&&!t.startsWith("/"))return P(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`),e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let a=n.length-1,c,i;for(c=0;c<o.length;c++)if(i=o[c],i!==".")if(i==="..")a>1&&a--;else break;return n.slice(0,a).join("/")+"/"+o.slice(c-(c===o.length?1:0)).join("/")}var Se;(function(e){e.pop="pop",e.push="push"})(Se||(Se={}));var Oe;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Oe||(Oe={}));function Wr(e){if(!e)if(Z){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),jr(e)}const zr=/^[^#]+#/;function Gr(e,t){return e.replace(zr,"#")+t}function Qr(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const Be=()=>({left:window.pageXOffset,top:window.pageYOffset});function qr(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#");if(process.env.NODE_ENV!=="production"&&typeof e.el=="string"&&(!o||!document.getElementById(e.el.slice(1))))try{const a=document.querySelector(e.el);if(o&&a){P(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);return}}catch{P(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);return}const r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r){process.env.NODE_ENV!=="production"&&P(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);return}t=Qr(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function un(e,t){return(history.state?history.state.position-t:-1)+e}const rt=new Map;function Kr(e,t){rt.set(e,t)}function Jr(e){const t=rt.get(e);return rt.delete(e),t}let Yr=()=>location.protocol+"//"+location.host;function dn(e,t){const{pathname:n,search:o,hash:r}=t,a=e.indexOf("#");if(a>-1){let i=r.includes(e.slice(a))?e.slice(a).length:1,u=r.slice(i);return u[0]!=="/"&&(u="/"+u),sn(u,"")}return sn(n,e)+o+r}function Xr(e,t,n,o){let r=[],a=[],c=null;const i=({state:p})=>{const h=dn(e,location),y=n.value,g=t.value;let _=0;if(p){if(n.value=h,t.value=p,c&&c===y){c=null;return}_=g?p.position-g.position:0}else o(h);r.forEach(O=>{O(n.value,y,{delta:_,type:Se.pop,direction:_?_>0?Oe.forward:Oe.back:Oe.unknown})})};function u(){c=n.value}function d(p){r.push(p);const h=()=>{const y=r.indexOf(p);y>-1&&r.splice(y,1)};return a.push(h),h}function l(){const{history:p}=window;p.state&&p.replaceState(x({},p.state,{scroll:Be()}),"")}function f(){for(const p of a)p();a=[],window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",l)}return window.addEventListener("popstate",i),window.addEventListener("beforeunload",l,{passive:!0}),{pauseListeners:u,listen:d,destroy:f}}function fn(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?Be():null}}function Zr(e){const{history:t,location:n}=window,o={value:dn(e,n)},r={value:t.state};r.value||a(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(u,d,l){const f=e.indexOf("#"),p=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+u:Yr()+e+u;try{t[l?"replaceState":"pushState"](d,"",p),r.value=d}catch(h){process.env.NODE_ENV!=="production"?P("Error with push/replace State",h):console.error(h),n[l?"replace":"assign"](p)}}function c(u,d){const l=x({},t.state,fn(r.value.back,u,r.value.forward,!0),d,{position:r.value.position});a(u,l,!0),o.value=u}function i(u,d){const l=x({},r.value,t.state,{forward:u,scroll:Be()});process.env.NODE_ENV!=="production"&&!t.state&&P(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
|
|
16
|
-
|
|
17
|
-
history.replaceState(history.state, '', url)
|
|
18
|
-
|
|
19
|
-
You can find more information at https://next.router.vuejs.org/guide/migration/#usage-of-history-state.`),a(l.current,l,!0);const f=x({},fn(o.value,u,null),{position:l.position+1},d);a(u,f,!1),o.value=u}return{location:o,state:r,push:i,replace:c}}function es(e){e=Wr(e);const t=Zr(e),n=Xr(e,t.state,t.location,t.replace);function o(a,c=!0){c||n.pauseListeners(),history.go(a)}const r=x({location:"",base:e,go:o,createHref:Gr.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function ts(e){return typeof e=="string"||e&&typeof e=="object"}function pn(e){return typeof e=="string"||typeof e=="symbol"}const ae={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},st=Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var hn;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(hn||(hn={}));const ns={1({location:e,currentLocation:t}){return`No match for
|
|
20
|
-
${JSON.stringify(e)}${t?`
|
|
21
|
-
while being at
|
|
22
|
-
`+JSON.stringify(t):""}`},2({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${rs(t)}" via a navigation guard.`},4({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},8({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},16({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ge(e,t){return process.env.NODE_ENV!=="production"?x(new Error(ns[e](t)),{type:e,[st]:!0},t):x(new Error,{type:e,[st]:!0},t)}function ee(e,t){return e instanceof Error&&st in e&&(t==null||!!(e.type&t))}const os=["params","query","hash"];function rs(e){if(typeof e=="string")return e;if("path"in e)return e.path;const t={};for(const n of os)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const mn="[^/]+?",ss={sensitive:!1,strict:!1,start:!0,end:!0},as=/[.+*?^${}()[\]/\\]/g;function is(e,t){const n=x({},ss,t),o=[];let r=n.start?"^":"";const a=[];for(const d of e){const l=d.length?[]:[90];n.strict&&!d.length&&(r+="/");for(let f=0;f<d.length;f++){const p=d[f];let h=40+(n.sensitive?.25:0);if(p.type===0)f||(r+="/"),r+=p.value.replace(as,"\\$&"),h+=40;else if(p.type===1){const{value:y,repeatable:g,optional:_,regexp:O}=p;a.push({name:y,repeatable:g,optional:_});const I=O||mn;if(I!==mn){h+=10;try{new RegExp(`(${I})`)}catch(L){throw new Error(`Invalid custom RegExp for param "${y}" (${I}): `+L.message)}}let T=g?`((?:${I})(?:/(?:${I}))*)`:`(${I})`;f||(T=_&&d.length<2?`(?:/${T})`:"/"+T),_&&(T+="?"),r+=T,h+=20,_&&(h+=-8),g&&(h+=-20),I===".*"&&(h+=-50)}l.push(h)}o.push(l)}if(n.strict&&n.end){const d=o.length-1;o[d][o[d].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&(r+="(?:/|$)");const c=new RegExp(r,n.sensitive?"":"i");function i(d){const l=d.match(c),f={};if(!l)return null;for(let p=1;p<l.length;p++){const h=l[p]||"",y=a[p-1];f[y.name]=h&&y.repeatable?h.split("/"):h}return f}function u(d){let l="",f=!1;for(const p of e){(!f||!l.endsWith("/"))&&(l+="/"),f=!1;for(const h of p)if(h.type===0)l+=h.value;else if(h.type===1){const{value:y,repeatable:g,optional:_}=h,O=y in d?d[y]:"";if(F(O)&&!g)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const I=F(O)?O.join("/"):O;if(!I)if(_)p.length<2&&(l.endsWith("/")?l=l.slice(0,-1):f=!0);else throw new Error(`Missing required param "${y}"`);l+=I}}return l||"/"}return{re:c,score:o,keys:a,parse:i,stringify:u}}function cs(e,t){let n=0;for(;n<e.length&&n<t.length;){const o=t[n]-e[n];if(o)return o;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function ls(e,t){let n=0;const o=e.score,r=t.score;for(;n<o.length&&n<r.length;){const a=cs(o[n],r[n]);if(a)return a;n++}if(Math.abs(r.length-o.length)===1){if(gn(o))return 1;if(gn(r))return-1}return r.length-o.length}function gn(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const us={type:0,value:""},ds=/[a-zA-Z0-9_]/;function fs(e){if(!e)return[[]];if(e==="/")return[[us]];if(!e.startsWith("/"))throw new Error(process.env.NODE_ENV!=="production"?`Route paths should start with a "/": "${e}" should be "/${e}".`:`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${d}": ${h}`)}let n=0,o=n;const r=[];let a;function c(){a&&r.push(a),a=[]}let i=0,u,d="",l="";function f(){d&&(n===0?a.push({type:0,value:d}):n===1||n===2||n===3?(a.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:d,regexp:l,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),d="")}function p(){d+=u}for(;i<e.length;){if(u=e[i++],u==="\\"&&n!==2){o=n,n=4;continue}switch(n){case 0:u==="/"?(d&&f(),c()):u===":"?(f(),n=1):p();break;case 4:p(),n=o;break;case 1:u==="("?n=2:ds.test(u)?p():(f(),n=0,u!=="*"&&u!=="?"&&u!=="+"&&i--);break;case 2:u===")"?l[l.length-1]=="\\"?l=l.slice(0,-1)+u:n=3:l+=u;break;case 3:f(),n=0,u!=="*"&&u!=="?"&&u!=="+"&&i--,l="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${d}"`),f(),c(),r}function ps(e,t,n){const o=is(fs(e.path),n);if(process.env.NODE_ENV!=="production"){const a=new Set;for(const c of o.keys)a.has(c.name)&&P(`Found duplicated params with name "${c.name}" for path "${e.path}". Only the last one will be available on "$route.params".`),a.add(c.name)}const r=x(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function hs(e,t){const n=[],o=new Map;t=vn({strict:!1,end:!0,sensitive:!1},t);function r(l){return o.get(l)}function a(l,f,p){const h=!p,y=ms(l);process.env.NODE_ENV!=="production"&&vs(y,f),y.aliasOf=p&&p.record;const g=vn(t,l),_=[y];if("alias"in l){const T=typeof l.alias=="string"?[l.alias]:l.alias;for(const L of T)_.push(x({},y,{components:p?p.record.components:y.components,path:L,aliasOf:p?p.record:y}))}let O,I;for(const T of _){const{path:L}=T;if(f&&L[0]!=="/"){const G=f.record.path,Q=G[G.length-1]==="/"?"":"/";T.path=f.record.path+(L&&Q+L)}if(process.env.NODE_ENV!=="production"&&T.path==="*")throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
|
|
23
|
-
See more at https://next.router.vuejs.org/guide/migration/#removed-star-or-catch-all-routes.`);if(O=ps(T,f,g),process.env.NODE_ENV!=="production"&&f&&L[0]==="/"&&_s(O,f),p?(p.alias.push(O),process.env.NODE_ENV!=="production"&&ws(p,O)):(I=I||O,I!==O&&I.alias.push(O),h&&l.name&&!wn(O)&&c(l.name)),y.children){const G=y.children;for(let Q=0;Q<G.length;Q++)a(G[Q],O,p&&p.children[Q])}p=p||O,(O.record.components&&Object.keys(O.record.components).length||O.record.name||O.record.redirect)&&u(O)}return I?()=>{c(I)}:ke}function c(l){if(pn(l)){const f=o.get(l);f&&(o.delete(l),n.splice(n.indexOf(f),1),f.children.forEach(c),f.alias.forEach(c))}else{const f=n.indexOf(l);f>-1&&(n.splice(f,1),l.record.name&&o.delete(l.record.name),l.children.forEach(c),l.alias.forEach(c))}}function i(){return n}function u(l){let f=0;for(;f<n.length&&ls(l,n[f])>=0&&(l.record.path!==n[f].record.path||!_n(l,n[f]));)f++;n.splice(f,0,l),l.record.name&&!wn(l)&&o.set(l.record.name,l)}function d(l,f){let p,h={},y,g;if("name"in l&&l.name){if(p=o.get(l.name),!p)throw ge(1,{location:l});if(process.env.NODE_ENV!=="production"){const I=Object.keys(l.params||{}).filter(T=>!p.keys.find(L=>L.name===T));I.length&&P(`Discarded invalid param(s) "${I.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}g=p.record.name,h=x(yn(f.params,p.keys.filter(I=>!I.optional).map(I=>I.name)),l.params&&yn(l.params,p.keys.map(I=>I.name))),y=p.stringify(h)}else if("path"in l)y=l.path,process.env.NODE_ENV!=="production"&&!y.startsWith("/")&&P(`The Matcher cannot resolve relative paths but received "${y}". Unless you directly called \`matcher.resolve("${y}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`),p=n.find(I=>I.re.test(y)),p&&(h=p.parse(y),g=p.record.name);else{if(p=f.name?o.get(f.name):n.find(I=>I.re.test(f.path)),!p)throw ge(1,{location:l,currentLocation:f});g=p.record.name,h=x({},f.params,l.params),y=p.stringify(h)}const _=[];let O=p;for(;O;)_.unshift(O.record),O=O.parent;return{name:g,path:y,params:h,matched:_,meta:ys(_)}}return e.forEach(l=>a(l)),{addRoute:a,resolve:d,removeRoute:c,getRoutes:i,getRecordMatcher:r}}function yn(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function ms(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:gs(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function gs(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function wn(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ys(e){return e.reduce((t,n)=>x(t,n.meta),{})}function vn(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function at(e,t){return e.name===t.name&&e.optional===t.optional&&e.repeatable===t.repeatable}function ws(e,t){for(const n of e.keys)if(!n.optional&&!t.keys.find(at.bind(null,n)))return P(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);for(const n of t.keys)if(!n.optional&&!e.keys.find(at.bind(null,n)))return P(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`)}function vs(e,t){t&&t.record.name&&!e.name&&!e.path&&P(`The route named "${String(t.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`)}function _s(e,t){for(const n of t.keys)if(!e.keys.find(at.bind(null,n)))return P(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`)}function _n(e,t){return t.children.some(n=>n===e||_n(e,n))}const bn=/#/g,bs=/&/g,Es=/\//g,ks=/=/g,Ss=/\?/g,En=/\+/g,Os=/%5B/g,Is=/%5D/g,kn=/%5E/g,Cs=/%60/g,Sn=/%7B/g,Ns=/%7C/g,On=/%7D/g,Ps=/%20/g;function it(e){return encodeURI(""+e).replace(Ns,"|").replace(Os,"[").replace(Is,"]")}function xs(e){return it(e).replace(Sn,"{").replace(On,"}").replace(kn,"^")}function ct(e){return it(e).replace(En,"%2B").replace(Ps,"+").replace(bn,"%23").replace(bs,"%26").replace(Cs,"`").replace(Sn,"{").replace(On,"}").replace(kn,"^")}function $s(e){return ct(e).replace(ks,"%3D")}function Rs(e){return it(e).replace(bn,"%23").replace(Ss,"%3F")}function Ts(e){return e==null?"":Rs(e).replace(Es,"%2F")}function Ie(e){try{return decodeURIComponent(""+e)}catch{process.env.NODE_ENV!=="production"&&P(`Error decoding "${e}". Using original value`)}return""+e}function As(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){const a=o[r].replace(En," "),c=a.indexOf("="),i=Ie(c<0?a:a.slice(0,c)),u=c<0?null:Ie(a.slice(c+1));if(i in t){let d=t[i];F(d)||(d=t[i]=[d]),d.push(u)}else t[i]=u}return t}function In(e){let t="";for(let n in e){const o=e[n];if(n=$s(n),o==null){o!==void 0&&(t+=(t.length?"&":"")+n);continue}(F(o)?o.map(a=>a&&ct(a)):[o&&ct(o)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+n,a!=null&&(t+="="+a))})}return t}function Ds(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=F(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const Vs=Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Cn=Symbol(process.env.NODE_ENV!=="production"?"router view depth":""),lt=Symbol(process.env.NODE_ENV!=="production"?"router":""),Nn=Symbol(process.env.NODE_ENV!=="production"?"route location":""),ut=Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Ce(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ie(e,t,n,o,r){const a=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((c,i)=>{const u=f=>{f===!1?i(ge(4,{from:n,to:t})):f instanceof Error?i(f):ts(f)?i(ge(2,{from:t,to:f})):(a&&o.enterCallbacks[r]===a&&typeof f=="function"&&a.push(f),c())},d=e.call(o&&o.instances[r],t,n,process.env.NODE_ENV!=="production"?Bs(u,t,n):u);let l=Promise.resolve(d);if(e.length<3&&(l=l.then(u)),process.env.NODE_ENV!=="production"&&e.length>2){const f=`The "next" callback was never called inside of ${e.name?'"'+e.name+'"':""}:
|
|
24
|
-
${e.toString()}
|
|
25
|
-
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof d=="object"&&"then"in d)l=l.then(p=>u._called?p:(P(f),Promise.reject(new Error("Invalid navigation guard"))));else if(d!==void 0&&!u._called){P(f),i(new Error("Invalid navigation guard"));return}}l.catch(f=>i(f))})}function Bs(e,t,n){let o=0;return function(){o++===1&&P(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),e._called=!0,o===1&&e.apply(null,arguments)}}function dt(e,t,n,o){const r=[];for(const a of e){process.env.NODE_ENV!=="production"&&!a.components&&!a.children.length&&P(`Record with path "${a.path}" is either missing a "component(s)" or "children" property.`);for(const c in a.components){let i=a.components[c];if(process.env.NODE_ENV!=="production"){if(!i||typeof i!="object"&&typeof i!="function")throw P(`Component "${c}" in record with path "${a.path}" is not a valid component. Received "${String(i)}".`),new Error("Invalid route component");if("then"in i){P(`Component "${c}" in record with path "${a.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);const u=i;i=()=>u}else i.__asyncLoader&&!i.__warnedDefineAsync&&(i.__warnedDefineAsync=!0,P(`Component "${c}" in record with path "${a.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(t!=="beforeRouteEnter"&&!a.instances[c]))if(Ms(i)){const d=(i.__vccOpts||i)[t];d&&r.push(ie(d,n,o,a,c))}else{let u=i();process.env.NODE_ENV!=="production"&&!("catch"in u)&&(P(`Component "${c}" in record with path "${a.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),u=Promise.resolve(u)),r.push(()=>u.then(d=>{if(!d)return Promise.reject(new Error(`Couldn't resolve component "${c}" at "${a.path}"`));const l=Mr(d)?d.default:d;a.components[c]=l;const p=(l.__vccOpts||l)[t];return p&&ie(p,n,o,a,c)()}))}}}return r}function Ms(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Pn(e){const t=s.inject(lt),n=s.inject(Nn),o=s.computed(()=>t.resolve(s.unref(e.to))),r=s.computed(()=>{const{matched:u}=o.value,{length:d}=u,l=u[d-1],f=n.matched;if(!l||!f.length)return-1;const p=f.findIndex(se.bind(null,l));if(p>-1)return p;const h=xn(u[d-2]);return d>1&&xn(l)===h&&f[f.length-1].path!==h?f.findIndex(se.bind(null,u[d-2])):p}),a=s.computed(()=>r.value>-1&&Us(n.params,o.value.params)),c=s.computed(()=>r.value>-1&&r.value===n.matched.length-1&&cn(n.params,o.value.params));function i(u={}){return js(u)?t[s.unref(e.replace)?"replace":"push"](s.unref(e.to)).catch(ke):Promise.resolve()}if(process.env.NODE_ENV!=="production"&&Z){const u=s.getCurrentInstance();if(u){const d={route:o.value,isActive:a.value,isExactActive:c.value};u.__vrl_devtools=u.__vrl_devtools||[],u.__vrl_devtools.push(d),s.watchEffect(()=>{d.route=o.value,d.isActive=a.value,d.isExactActive=c.value},{flush:"post"})}}return{route:o,href:s.computed(()=>o.value.href),isActive:a,isExactActive:c,navigate:i}}const Ls=s.defineComponent({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Pn,setup(e,{slots:t}){const n=s.reactive(Pn(e)),{options:o}=s.inject(lt),r=s.computed(()=>({[$n(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[$n(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const a=t.default&&t.default(n);return e.custom?a:s.h("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},a)}}});function js(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Us(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!F(r)||r.length!==o.length||o.some((a,c)=>a!==r[c]))return!1}return!0}function xn(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const $n=(e,t,n)=>e??t??n,Hs=s.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){process.env.NODE_ENV!=="production"&&Ws();const o=s.inject(ut),r=s.computed(()=>e.route||o.value),a=s.inject(Cn,0),c=s.computed(()=>{let d=s.unref(a);const{matched:l}=r.value;let f;for(;(f=l[d])&&!f.components;)d++;return d}),i=s.computed(()=>r.value.matched[c.value]);s.provide(Cn,s.computed(()=>c.value+1)),s.provide(Vs,i),s.provide(ut,r);const u=s.ref();return s.watch(()=>[u.value,i.value,e.name],([d,l,f],[p,h,y])=>{l&&(l.instances[f]=d,h&&h!==l&&d&&d===p&&(l.leaveGuards.size||(l.leaveGuards=h.leaveGuards),l.updateGuards.size||(l.updateGuards=h.updateGuards))),d&&l&&(!h||!se(l,h)||!p)&&(l.enterCallbacks[f]||[]).forEach(g=>g(d))},{flush:"post"}),()=>{const d=r.value,l=e.name,f=i.value,p=f&&f.components[l];if(!p)return Rn(n.default,{Component:p,route:d});const h=f.props[l],y=h?h===!0?d.params:typeof h=="function"?h(d):h:null,g=O=>{O.component.isUnmounted&&(f.instances[l]=null)},_=s.h(p,x({},y,t,{onVnodeUnmounted:g,ref:u}));if(process.env.NODE_ENV!=="production"&&Z&&_.ref){const O={depth:c.value,name:f.name,path:f.path,meta:f.meta};(F(_.ref)?_.ref.map(T=>T.i):[_.ref.i]).forEach(T=>{T.__vrv_devtools=O})}return Rn(n.default,{Component:_,route:d})||_}}});function Rn(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Fs=Hs;function Ws(){const e=s.getCurrentInstance(),t=e.parent&&e.parent.type.name,n=e.parent&&e.parent.subTree&&e.parent.subTree.type;if(t&&(t==="KeepAlive"||t.includes("Transition"))&&typeof n=="object"&&n.name==="RouterView"){const o=t==="KeepAlive"?"keep-alive":"transition";P(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
|
|
26
|
-
Use slot props instead:
|
|
27
|
-
|
|
28
|
-
<router-view v-slot="{ Component }">
|
|
29
|
-
<${o}>
|
|
30
|
-
<component :is="Component" />
|
|
31
|
-
</${o}>
|
|
32
|
-
</router-view>`)}}function Ne(e,t){const n=x({},e,{matched:e.matched.map(o=>Zs(o,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function Me(e){return{_custom:{display:e}}}let zs=0;function Gs(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const o=zs++;Je({id:"org.vuejs.router"+(o?"."+o:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:e},r=>{typeof r.now!="function"&&console.warn("[Vue Router]: 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."),r.on.inspectComponent((l,f)=>{l.instanceData&&l.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:Ne(t.currentRoute.value,"Current Route")})}),r.on.visitComponentTree(({treeNode:l,componentInstance:f})=>{if(f.__vrv_devtools){const p=f.__vrv_devtools;l.tags.push({label:(p.name?`${p.name.toString()}: `:"")+p.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:Tn})}F(f.__vrl_devtools)&&(f.__devtoolsApi=r,f.__vrl_devtools.forEach(p=>{let h=Vn,y="";p.isExactActive?(h=Dn,y="This is exactly active"):p.isActive&&(h=An,y="This link is active"),l.tags.push({label:p.route.path,textColor:0,tooltip:y,backgroundColor:h})}))}),s.watch(t.currentRoute,()=>{u(),r.notifyComponentUpdate(),r.sendInspectorTree(i),r.sendInspectorState(i)});const a="router:navigations:"+o;r.addTimelineLayer({id:a,label:`Router${o?" "+o:""} Navigations`,color:4237508}),t.onError((l,f)=>{r.addTimelineEvent({layerId:a,event:{title:"Error during Navigation",subtitle:f.fullPath,logType:"error",time:r.now(),data:{error:l},groupId:f.meta.__navigationId}})});let c=0;t.beforeEach((l,f)=>{const p={guard:Me("beforeEach"),from:Ne(f,"Current Location during this navigation"),to:Ne(l,"Target location")};Object.defineProperty(l.meta,"__navigationId",{value:c++}),r.addTimelineEvent({layerId:a,event:{time:r.now(),title:"Start of navigation",subtitle:l.fullPath,data:p,groupId:l.meta.__navigationId}})}),t.afterEach((l,f,p)=>{const h={guard:Me("afterEach")};p?(h.failure={_custom:{type:Error,readOnly:!0,display:p?p.message:"",tooltip:"Navigation Failure",value:p}},h.status=Me("โ")):h.status=Me("โ
"),h.from=Ne(f,"Current Location during this navigation"),h.to=Ne(l,"Target location"),r.addTimelineEvent({layerId:a,event:{title:"End of navigation",subtitle:l.fullPath,time:r.now(),data:h,logType:p?"warning":"default",groupId:l.meta.__navigationId}})});const i="router-inspector:"+o;r.addInspector({id:i,label:"Routes"+(o?" "+o:""),icon:"book",treeFilterPlaceholder:"Search routes"});function u(){if(!d)return;const l=d;let f=n.getRoutes().filter(p=>!p.parent||!p.parent.record.components);f.forEach(Ln),l.filter&&(f=f.filter(p=>ft(p,l.filter.toLowerCase()))),f.forEach(p=>Mn(p,t.currentRoute.value)),l.rootNodes=f.map(Bn)}let d;r.on.getInspectorTree(l=>{d=l,l.app===e&&l.inspectorId===i&&u()}),r.on.getInspectorState(l=>{if(l.app===e&&l.inspectorId===i){const p=n.getRoutes().find(h=>h.record.__vd_id===l.nodeId);p&&(l.state={options:qs(p)})}}),r.sendInspectorTree(i),r.sendInspectorState(i)})}function Qs(e){return e.optional?e.repeatable?"*":"?":e.repeatable?"+":""}function qs(e){const{record:t}=e,n=[{editable:!1,key:"path",value:t.path}];return t.name!=null&&n.push({editable:!1,key:"name",value:t.name}),n.push({editable:!1,key:"regexp",value:e.re}),e.keys.length&&n.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:e.keys.map(o=>`${o.name}${Qs(o)}`).join(" "),tooltip:"Param keys",value:e.keys}}}),t.redirect!=null&&n.push({editable:!1,key:"redirect",value:t.redirect}),e.alias.length&&n.push({editable:!1,key:"aliases",value:e.alias.map(o=>o.record.path)}),Object.keys(e.record.meta).length&&n.push({editable:!1,key:"meta",value:e.record.meta}),n.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:e.score.map(o=>o.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:e.score}}}),n}const Tn=15485081,An=2450411,Dn=8702998,Ks=2282478,Vn=16486972,Js=6710886;function Bn(e){const t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:Ks}),n.aliasOf&&t.push({label:"alias",textColor:0,backgroundColor:Vn}),e.__vd_match&&t.push({label:"matches",textColor:0,backgroundColor:Tn}),e.__vd_exactActive&&t.push({label:"exact",textColor:0,backgroundColor:Dn}),e.__vd_active&&t.push({label:"active",textColor:0,backgroundColor:An}),n.redirect&&t.push({label:typeof n.redirect=="string"?`redirect: ${n.redirect}`:"redirects",textColor:16777215,backgroundColor:Js});let o=n.__vd_id;return o==null&&(o=String(Ys++),n.__vd_id=o),{id:o,label:n.path,tags:t,children:e.children.map(Bn)}}let Ys=0;const Xs=/^\/(.*)\/([a-z]*)$/;function Mn(e,t){const n=t.matched.length&&se(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(o=>se(o,e.record))),e.children.forEach(o=>Mn(o,t))}function Ln(e){e.__vd_match=!1,e.children.forEach(Ln)}function ft(e,t){const n=String(e.re).match(Xs);if(e.__vd_match=!1,!n||n.length<3)return!1;if(new RegExp(n[1].replace(/\$$/,""),n[2]).test(t))return e.children.forEach(c=>ft(c,t)),e.record.path!=="/"||t==="/"?(e.__vd_match=e.re.test(t),!0):!1;const r=e.record.path.toLowerCase(),a=Ie(r);return!t.startsWith("/")&&(a.includes(t)||r.includes(t))||a.startsWith(t)||r.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(c=>ft(c,t))}function Zs(e,t){const n={};for(const o in e)t.includes(o)||(n[o]=e[o]);return n}function ea(e){const t=hs(e.routes,e),n=e.parseQuery||As,o=e.stringifyQuery||In,r=e.history;if(process.env.NODE_ENV!=="production"&&!r)throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');const a=Ce(),c=Ce(),i=Ce(),u=s.shallowRef(ae);let d=ae;Z&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const l=nt.bind(null,m=>""+m),f=nt.bind(null,Ts),p=nt.bind(null,Ie);function h(m,v){let w,E;return pn(m)?(w=t.getRecordMatcher(m),E=v):E=m,t.addRoute(E,w)}function y(m){const v=t.getRecordMatcher(m);v?t.removeRoute(v):process.env.NODE_ENV!=="production"&&P(`Cannot remove non-existent route "${String(m)}"`)}function g(){return t.getRoutes().map(m=>m.record)}function _(m){return!!t.getRecordMatcher(m)}function O(m,v){if(v=x({},v||u.value),typeof m=="string"){const C=ot(n,m,v.path),A=t.resolve({path:C.path},v),fe=r.createHref(C.fullPath);return process.env.NODE_ENV!=="production"&&(fe.startsWith("//")?P(`Location "${m}" resolved to "${fe}". A resolved location cannot start with multiple slashes.`):A.matched.length||P(`No match found for location with path "${m}"`)),x(C,A,{params:p(A.params),hash:Ie(C.hash),redirectedFrom:void 0,href:fe})}let w;if("path"in m)process.env.NODE_ENV!=="production"&&"params"in m&&!("name"in m)&&Object.keys(m.params).length&&P(`Path "${m.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),w=x({},m,{path:ot(n,m.path,v.path).path});else{const C=x({},m.params);for(const A in C)C[A]==null&&delete C[A];w=x({},m,{params:f(C)}),v.params=f(v.params)}const E=t.resolve(w,v),$=m.hash||"";process.env.NODE_ENV!=="production"&&$&&!$.startsWith("#")&&P(`A \`hash\` should always start with the character "#". Replace "${$}" with "#${$}".`),E.params=l(p(E.params));const D=Ur(o,x({},m,{hash:xs($),path:E.path})),N=r.createHref(D);return process.env.NODE_ENV!=="production"&&(N.startsWith("//")?P(`Location "${m}" resolved to "${N}". A resolved location cannot start with multiple slashes.`):E.matched.length||P(`No match found for location with path "${"path"in m?m.path:m}"`)),x({fullPath:D,hash:$,query:o===In?Ds(m.query):m.query||{}},E,{redirectedFrom:void 0,href:N})}function I(m){return typeof m=="string"?ot(n,m,u.value.path):x({},m)}function T(m,v){if(d!==m)return ge(8,{from:v,to:m})}function L(m){return S(m)}function G(m){return L(x(I(m),{replace:!0}))}function Q(m){const v=m.matched[m.matched.length-1];if(v&&v.redirect){const{redirect:w}=v;let E=typeof w=="function"?w(m):w;if(typeof E=="string"&&(E=E.includes("?")||E.includes("#")?E=I(E):{path:E},E.params={}),process.env.NODE_ENV!=="production"&&!("path"in E)&&!("name"in E))throw P(`Invalid redirect found:
|
|
33
|
-
${JSON.stringify(E,null,2)}
|
|
34
|
-
when navigating to "${m.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return x({query:m.query,hash:m.hash,params:"path"in E?{}:m.params},E)}}function S(m,v){const w=d=O(m),E=u.value,$=m.state,D=m.force,N=m.replace===!0,C=Q(w);if(C)return S(x(I(C),{state:typeof C=="object"?x({},$,C.state):$,force:D,replace:N}),v||w);const A=w;A.redirectedFrom=v;let fe;return!D&&an(o,E,w)&&(fe=ge(16,{to:A,from:E}),Ao(E,E,!0,!1)),(fe?Promise.resolve(fe):k(A,E)).catch(H=>ee(H)?ee(H,2)?H:Nt(H):U(H,A,E)).then(H=>{if(H){if(ee(H,2))return process.env.NODE_ENV!=="production"&&an(o,O(H.to),A)&&v&&(v._count=v._count?v._count+1:1)>30?(P(`Detected a possibly infinite redirection in a navigation guard when going from "${E.fullPath}" to "${A.fullPath}". Aborting to avoid a Stack Overflow.
|
|
35
|
-
Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):S(x({replace:N},I(H.to),{state:typeof H.to=="object"?x({},$,H.to.state):$,force:D}),v||A)}else H=R(A,E,!0,N,$);return b(A,E,H),H})}function To(m,v){const w=T(m,v);return w?Promise.reject(w):Promise.resolve()}function K(m){const v=We.values().next().value;return v&&typeof v.runWithContext=="function"?v.runWithContext(m):m()}function k(m,v){let w;const[E,$,D]=ta(m,v);w=dt(E.reverse(),"beforeRouteLeave",m,v);for(const C of E)C.leaveGuards.forEach(A=>{w.push(ie(A,m,v))});const N=To.bind(null,m,v);return w.push(N),we(w).then(()=>{w=[];for(const C of a.list())w.push(ie(C,m,v));return w.push(N),we(w)}).then(()=>{w=dt($,"beforeRouteUpdate",m,v);for(const C of $)C.updateGuards.forEach(A=>{w.push(ie(A,m,v))});return w.push(N),we(w)}).then(()=>{w=[];for(const C of D)if(C.beforeEnter)if(F(C.beforeEnter))for(const A of C.beforeEnter)w.push(ie(A,m,v));else w.push(ie(C.beforeEnter,m,v));return w.push(N),we(w)}).then(()=>(m.matched.forEach(C=>C.enterCallbacks={}),w=dt(D,"beforeRouteEnter",m,v),w.push(N),we(w))).then(()=>{w=[];for(const C of c.list())w.push(ie(C,m,v));return w.push(N),we(w)}).catch(C=>ee(C,8)?C:Promise.reject(C))}function b(m,v,w){i.list().forEach(E=>K(()=>E(m,v,w)))}function R(m,v,w,E,$){const D=T(m,v);if(D)return D;const N=v===ae,C=Z?history.state:{};w&&(E||N?r.replace(m.fullPath,x({scroll:N&&C&&C.scroll},$)):r.push(m.fullPath,$)),u.value=m,Ao(m,v,w,N),Nt()}let V;function de(){V||(V=r.listen((m,v,w)=>{const E=O(m),$=Q(E);if($){S(x($,{replace:!0}),E).catch(ke);return}d=E;const D=u.value;Z&&Kr(un(D.fullPath,w.delta),Be()),k(E,D).catch(N=>ee(N,12)?N:ee(N,2)?(S(N.to,E).then(C=>{ee(C,20)&&!w.delta&&w.type===Se.pop&&r.go(-1,!1)}).catch(ke),Promise.reject()):(w.delta&&r.go(-w.delta,!1),U(N,E,D))).then(N=>{N=N||R(E,D,!1),N&&(w.delta&&!ee(N,8)?r.go(-w.delta,!1):w.type===Se.pop&&ee(N,20)&&r.go(-1,!1)),b(E,D,N)}).catch(ke)}))}let xe=Ce(),Fe=Ce(),Y;function U(m,v,w){Nt(m);const E=Fe.list();return E.length?E.forEach($=>$(m,v,w)):(process.env.NODE_ENV!=="production"&&P("uncaught error during route navigation:"),console.error(m)),Promise.reject(m)}function Zi(){return Y&&u.value!==ae?Promise.resolve():new Promise((m,v)=>{xe.add([m,v])})}function Nt(m){return Y||(Y=!m,de(),xe.list().forEach(([v,w])=>m?w(m):v()),xe.reset()),m}function Ao(m,v,w,E){const{scrollBehavior:$}=e;if(!Z||!$)return Promise.resolve();const D=!w&&Jr(un(m.fullPath,0))||(E||!w)&&history.state&&history.state.scroll||null;return s.nextTick().then(()=>$(m,v,D)).then(N=>N&&qr(N)).catch(N=>U(N,m,v))}const Pt=m=>r.go(m);let xt;const We=new Set,ec={currentRoute:u,listening:!0,addRoute:h,removeRoute:y,hasRoute:_,getRoutes:g,resolve:O,options:e,push:L,replace:G,go:Pt,back:()=>Pt(-1),forward:()=>Pt(1),beforeEach:a.add,beforeResolve:c.add,afterEach:i.add,onError:Fe.add,isReady:Zi,install(m){const v=this;m.component("RouterLink",Ls),m.component("RouterView",Fs),m.config.globalProperties.$router=v,Object.defineProperty(m.config.globalProperties,"$route",{enumerable:!0,get:()=>s.unref(u)}),Z&&!xt&&u.value===ae&&(xt=!0,L(r.location).catch($=>{process.env.NODE_ENV!=="production"&&P("Unexpected error when starting the router:",$)}));const w={};for(const $ in ae)Object.defineProperty(w,$,{get:()=>u.value[$],enumerable:!0});m.provide(lt,v),m.provide(Nn,s.shallowReactive(w)),m.provide(ut,u);const E=m.unmount;We.add(m),m.unmount=function(){We.delete(m),We.size<1&&(d=ae,V&&V(),V=null,u.value=ae,xt=!1,Y=!1),E()},process.env.NODE_ENV!=="production"&&Z&&Gs(m,v,t)}};function we(m){return m.reduce((v,w)=>v.then(()=>K(w)),Promise.resolve())}return ec}function ta(e,t){const n=[],o=[],r=[],a=Math.max(t.matched.length,e.matched.length);for(let c=0;c<a;c++){const i=t.matched[c];i&&(e.matched.find(d=>se(d,i))?o.push(i):n.push(i));const u=e.matched[c];u&&(t.matched.find(d=>se(d,u))||r.push(u))}return[n,o,r]}ea({history:es(),routes:[]});function na(e){return e&&typeof e.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var ue=Promise.resolve();function jn(e,t){return e||(e=0),new Promise(function(n){return setTimeout(function(){return n(t)},e)})}function oa(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function pt(){return Math.random().toString(36).substring(2)}var Un=0,ht=0;function Le(){var e=new Date().getTime();return e===Un?(ht++,e*1e3+ht):(Un=e,ht=0,e*1e3)}var ra=Le,sa="native";function aa(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(n){t.messagesCallback&&t.messagesCallback(n.data)},t}function ia(e){e.bc.close(),e.subFns=[]}function ca(e,t){try{return e.bc.postMessage(t,!1),ue}catch(n){return Promise.reject(n)}}function la(e,t){e.messagesCallback=t}function ua(){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 da(){return 150}var fa={create:aa,close:ia,onMessage:la,postMessage:ca,canBeUsed:ua,type:sa,averageResponseTime:da,microSeconds:ra},Hn=function(){function e(t){this.ttl=t,this.map=new Map,this._to=!1}return e.prototype.has=function(t){return this.map.has(t)},e.prototype.add=function(t){var n=this;this.map.set(t,Fn()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,pa(n)},0))},e.prototype.clear=function(){this.map.clear()},e}();function pa(e){for(var t=Fn()-e.ttl,n=e.map[Symbol.iterator]();;){var o=n.next().value;if(!o)return;var r=o[0],a=o[1];if(a<t)e.map.delete(r);else return}}function Fn(){return new Date().getTime()}function mt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=JSON.parse(JSON.stringify(e));return typeof t.webWorkerSupport>"u"&&(t.webWorkerSupport=!0),t.idb||(t.idb={}),t.idb.ttl||(t.idb.ttl=1e3*45),t.idb.fallbackInterval||(t.idb.fallbackInterval=150),e.idb&&typeof e.idb.onclose=="function"&&(t.idb.onclose=e.idb.onclose),t.localstorage||(t.localstorage={}),t.localstorage.removeTimeout||(t.localstorage.removeTimeout=1e3*60),e.methods&&(t.methods=e.methods),t.node||(t.node={}),t.node.ttl||(t.node.ttl=1e3*60*2),t.node.maxParallelWrites||(t.node.maxParallelWrites=2048),typeof t.node.useFastPath>"u"&&(t.node.useFastPath=!0),t}var ha=Le,ma="pubkey.broadcast-channel-0-",te="messages",je={durability:"relaxed"},ga="idb";function Wn(){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(e){e.commit&&e.commit()}function ya(e){var t=Wn(),n=ma+e,o=t.open(n);return o.onupgradeneeded=function(r){var a=r.target.result;a.createObjectStore(te,{keyPath:"id",autoIncrement:!0})},new Promise(function(r,a){o.onerror=function(c){return a(c)},o.onsuccess=function(){r(o.result)}})}function wa(e,t,n){var o=new Date().getTime(),r={uuid:t,time:o,data:n},a=e.transaction([te],"readwrite",je);return new Promise(function(c,i){a.oncomplete=function(){return c()},a.onerror=function(d){return i(d)};var u=a.objectStore(te);u.add(r),gt(a)})}function va(e,t){var n=e.transaction(te,"readonly",je),o=n.objectStore(te),r=[],a=IDBKeyRange.bound(t+1,1/0);if(o.getAll){var c=o.getAll(a);return new Promise(function(u,d){c.onerror=function(l){return d(l)},c.onsuccess=function(l){u(l.target.result)}})}function i(){try{return a=IDBKeyRange.bound(t+1,1/0),o.openCursor(a)}catch{return o.openCursor()}}return new Promise(function(u,d){var l=i();l.onerror=function(f){return d(f)},l.onsuccess=function(f){var p=f.target.result;p?p.value.id<t+1?p.continue(t+1):(r.push(p.value),p.continue()):(gt(n),u(r))}})}function _a(e,t){if(e.closed)return Promise.resolve([]);var n=e.db.transaction(te,"readwrite",je),o=n.objectStore(te);return Promise.all(t.map(function(r){var a=o.delete(r);return new Promise(function(c){a.onsuccess=function(){return c()}})}))}function ba(e,t){var n=new Date().getTime()-t,o=e.transaction(te,"readonly",je),r=o.objectStore(te),a=[];return new Promise(function(c){r.openCursor().onsuccess=function(i){var u=i.target.result;if(u){var d=u.value;d.time<n?(a.push(d),u.continue()):(gt(o),c(a))}else c(a)}})}function Ea(e){return ba(e.db,e.options.idb.ttl).then(function(t){return _a(e,t.map(function(n){return n.id}))})}function ka(e,t){return t=mt(t),ya(e).then(function(n){var o={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:pt(),eMIs:new Hn(t.idb.ttl*2),writeBlockPromise:ue,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){o.closed=!0,t.idb.onclose&&t.idb.onclose()},zn(o),o})}function zn(e){e.closed||Gn(e).then(function(){return jn(e.options.idb.fallbackInterval)}).then(function(){return zn(e)})}function Sa(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}function Gn(e){return e.closed||!e.messagesCallback?ue:va(e.db,e.lastCursorId).then(function(t){var n=t.filter(function(o){return!!o}).map(function(o){return o.id>e.lastCursorId&&(e.lastCursorId=o.id),o}).filter(function(o){return Sa(o,e)}).sort(function(o,r){return o.time-r.time});return n.forEach(function(o){e.messagesCallback&&(e.eMIs.add(o.id),e.messagesCallback(o.data))}),ue})}function Oa(e){e.closed=!0,e.db.close()}function Ia(e,t){return e.writeBlockPromise=e.writeBlockPromise.then(function(){return wa(e.db,e.uuid,t)}).then(function(){oa(0,10)===0&&Ea(e)}),e.writeBlockPromise}function Ca(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t,Gn(e)}function Na(){return!!Wn()}function Pa(e){return e.idb.fallbackInterval*2}var xa={create:ka,close:Oa,onMessage:Ca,postMessage:Ia,canBeUsed:Na,type:ga,averageResponseTime:Pa,microSeconds:ha},$a=Le,Ra="pubkey.broadcastChannel-",Ta="localstorage";function Qn(){var e;if(typeof window>"u")return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return e}function qn(e){return Ra+e}function Aa(e,t){return new Promise(function(n){jn().then(function(){var o=qn(e.channelName),r={token:pt(),time:new Date().getTime(),data:t,uuid:e.uuid},a=JSON.stringify(r);Qn().setItem(o,a);var c=document.createEvent("Event");c.initEvent("storage",!0,!0),c.key=o,c.newValue=a,window.dispatchEvent(c),n()})})}function Da(e,t){var n=qn(e),o=function(a){a.key===n&&t(JSON.parse(a.newValue))};return window.addEventListener("storage",o),o}function Va(e){window.removeEventListener("storage",e)}function Ba(e,t){if(t=mt(t),!Kn())throw new Error("BroadcastChannel: localstorage cannot be used");var n=pt(),o=new Hn(t.localstorage.removeTimeout),r={channelName:e,uuid:n,eMIs:o};return r.listener=Da(e,function(a){r.messagesCallback&&a.uuid!==n&&(!a.token||o.has(a.token)||a.data.time&&a.data.time<r.messagesCallbackTime||(o.add(a.token),r.messagesCallback(a.data)))}),r}function Ma(e){Va(e.listener)}function La(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t}function Kn(){var e=Qn();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch{return!1}return!0}function ja(){var e=120,t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")?e*2:e}var Ua={create:Ba,close:Ma,onMessage:La,postMessage:Aa,canBeUsed:Kn,type:Ta,averageResponseTime:ja,microSeconds:$a},Ha=Le,Fa="simulate",yt=new Set;function Wa(e){var t={name:e,messagesCallback:null};return yt.add(t),t}function za(e){yt.delete(e)}function Ga(e,t){return new Promise(function(n){return setTimeout(function(){var o=Array.from(yt);o.filter(function(r){return r.name===e.name}).filter(function(r){return r!==e}).filter(function(r){return!!r.messagesCallback}).forEach(function(r){return r.messagesCallback(t)}),n()},5)})}function Qa(e,t){e.messagesCallback=t}function qa(){return!0}function Ka(){return 5}var Ja={create:Wa,close:za,onMessage:Qa,postMessage:Ga,canBeUsed:qa,type:Fa,averageResponseTime:Ka,microSeconds:Ha},Jn=[fa,xa,Ua];function Ya(e){var t=[].concat(e.methods,Jn).filter(Boolean);if(e.type){if(e.type==="simulate")return Ja;var n=t.find(function(r){return r.type===e.type});if(n)return n;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||(t=t.filter(function(r){return r.type!=="idb"}));var o=t.find(function(r){return r.canBeUsed()});if(o)return o;throw new Error("No usable method found in "+JSON.stringify(Jn.map(function(r){return r.type})))}var Yn=new Set,Xa=0,wt=function(t,n){this.id=Xa++,Yn.add(this),this.name=t,this.options=mt(n),this.method=Ya(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Za(this)};wt._pubkey=!0,wt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return Xn(this,"message",t)},postInternal:function(t){return Xn(this,"internal",t)},set onmessage(e){var t=this.method.microSeconds(),n={time:t,fn:e};to(this,"message",this._onML),e&&typeof e=="function"?(this._onML=n,eo(this,"message",n)):this._onML=null},addEventListener:function(t,n){var o=this.method.microSeconds(),r={time:o,fn:n};eo(this,t,r)},removeEventListener:function(t,n){var o=this._addEL[t].find(function(r){return r.fn===n});to(this,t,o)},close:function(){var t=this;if(!this.closed){Yn.delete(this),this.closed=!0;var n=this._prepP?this._prepP:ue;return this._onML=null,this._addEL.message=[],n.then(function(){return Promise.all(Array.from(t._uMP))}).then(function(){return Promise.all(t._befC.map(function(o){return o()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function Xn(e,t,n){var o=e.method.microSeconds(),r={time:o,type:t,data:n},a=e._prepP?e._prepP:ue;return a.then(function(){var c=e.method.postMessage(e._state,r);return e._uMP.add(c),c.catch().then(function(){return e._uMP.delete(c)}),c})}function Za(e){var t=e.method.create(e.name,e.options);na(t)?(e._prepP=t,t.then(function(n){e._state=n})):e._state=t}function Zn(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function eo(e,t,n){e._addEL[t].push(n),ei(e)}function to(e,t,n){e._addEL[t]=e._addEL[t].filter(function(o){return o!==n}),ti(e)}function ei(e){if(!e._iL&&Zn(e)){var t=function(r){e._addEL[r.type].forEach(function(a){var c=1e5,i=a.time-c;r.time>=i&&a.fn(r.data)})},n=e.method.microSeconds();e._prepP?e._prepP.then(function(){e._iL=!0,e.method.onMessage(e._state,t,n)}):(e._iL=!0,e.method.onMessage(e._state,t,n))}}function ti(e){if(e._iL&&!Zn(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}class vt extends Error{constructor(t,n){super(t),this.name="DevalueError",this.path=n.join("")}}function no(e){return Object(e)!==e}const ni=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oi(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===ni}function ri(e){return Object.prototype.toString.call(e).slice(8,-1)}function si(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
36
|
-
`: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 e<" "?`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function ye(e){let t="",n=0;const o=e.length;for(let r=0;r<o;r+=1){const a=e[r],c=si(a);c&&(t+=e.slice(n,r)+c,n=r+1)}return`"${n===0?e:t+e.slice(n)}"`}const _t=-1,oo=-2,ro=-3,so=-4,ao=-5,bt=-6;function io(e,t){return ai(JSON.parse(e),t)}function ai(e,t){if(typeof e=="number")return r(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,o=Array(n.length);function r(a,c=!1){if(a===_t)return;if(a===ro)return NaN;if(a===so)return 1/0;if(a===ao)return-1/0;if(a===bt)return-0;if(c)throw new Error("Invalid input");if(a in o)return o[a];const i=n[a];if(!i||typeof i!="object")o[a]=i;else if(Array.isArray(i))if(typeof i[0]=="string"){const u=i[0],d=t==null?void 0:t[u];if(d)return o[a]=d(r(i[1]));switch(u){case"Date":o[a]=new Date(i[1]);break;case"Set":const l=new Set;o[a]=l;for(let h=1;h<i.length;h+=1)l.add(r(i[h]));break;case"Map":const f=new Map;o[a]=f;for(let h=1;h<i.length;h+=2)f.set(r(i[h]),r(i[h+1]));break;case"RegExp":o[a]=new RegExp(i[1],i[2]);break;case"Object":o[a]=Object(i[1]);break;case"BigInt":o[a]=BigInt(i[1]);break;case"null":const p=Object.create(null);o[a]=p;for(let h=1;h<i.length;h+=2)p[i[h]]=r(i[h+1]);break;default:throw new Error(`Unknown type ${u}`)}}else{const u=new Array(i.length);o[a]=u;for(let d=0;d<i.length;d+=1){const l=i[d];l!==oo&&(u[d]=r(l))}}else{const u={};o[a]=u;for(const d in i){const l=i[d];u[d]=r(l)}}return o[a]}return r(0)}function co(e,t){const n=[],o=new Map,r=[];for(const d in t)r.push({key:d,fn:t[d]});const a=[];let c=0;function i(d){if(typeof d=="function")throw new vt("Cannot stringify a function",a);if(o.has(d))return o.get(d);if(d===void 0)return _t;if(Number.isNaN(d))return ro;if(d===1/0)return so;if(d===-1/0)return ao;if(d===0&&1/d<0)return bt;const l=c++;o.set(d,l);for(const{key:p,fn:h}of r){const y=h(d);if(y)return n[l]=`["${p}",${i(y)}]`,l}let f="";if(no(d))f=Et(d);else switch(ri(d)){case"Number":case"String":case"Boolean":f=`["Object",${Et(d)}]`;break;case"BigInt":f=`["BigInt",${d}]`;break;case"Date":f=`["Date","${d.toISOString()}"]`;break;case"RegExp":const{source:h,flags:y}=d;f=y?`["RegExp",${ye(h)},"${y}"]`:`["RegExp",${ye(h)}]`;break;case"Array":f="[";for(let g=0;g<d.length;g+=1)g>0&&(f+=","),g in d?(a.push(`[${g}]`),f+=i(d[g]),a.pop()):f+=oo;f+="]";break;case"Set":f='["Set"';for(const g of d)f+=`,${i(g)}`;f+="]";break;case"Map":f='["Map"';for(const[g,_]of d)a.push(`.get(${no(g)?Et(g):"..."})`),f+=`,${i(g)},${i(_)}`;f+="]";break;default:if(!oi(d))throw new vt("Cannot stringify arbitrary non-POJOs",a);if(Object.getOwnPropertySymbols(d).length>0)throw new vt("Cannot stringify POJOs with symbolic keys",a);if(Object.getPrototypeOf(d)===null){f='["null"';for(const g in d)a.push(`.${g}`),f+=`,${ye(g)},${i(d[g])}`,a.pop();f+="]"}else{f="{";let g=!1;for(const _ in d)g&&(f+=","),g=!0,a.push(`.${_}`),f+=`${ye(_)}:${i(d[_])}`,a.pop();f+="}"}}return n[l]=f,l}const u=i(e);return u<0?`${u}`:`[${n.join(",")}]`}function Et(e){const t=typeof e;return t==="string"?ye(e):e instanceof String?ye(e.toString()):e===void 0?_t.toString():e===0&&1/e<0?bt.toString():t==="bigint"?`["BigInt","${e}"]`:String(e)}function ii(e,t,{initialize:n,type:o}){let r=`${t.$id}-${e.toString()}`,a=new wt(r,{type:o}),c=!1,i=0;s.watch(()=>t[e],l=>{c||(i=Date.now(),a.postMessage({timestamp:i,state:io(co(l))})),c=!1},{deep:!0}),a.onmessage=l=>{if(l===void 0){a.postMessage({timestamp:i,state:io(co(t[e]))});return}l.timestamp<=i||(c=!0,i=l.timestamp,t[e]=l.state)};let u=()=>a.postMessage(void 0),d=()=>a.close();return n&&u(),{sync:u,unshare:d}}var ci=(e,t)=>Object.keys(t).includes(e),li=({initialize:e=!0,enable:t=!0,type:n})=>({store:o,options:r})=>{var a,c;let i=((a=r==null?void 0:r.share)==null?void 0:a.enable)??t,u=((c=r==null?void 0:r.share)==null?void 0:c.omit)??[];!i||Object.keys(o.$state).forEach(d=>{var l;u.includes(d)||!ci(d,o.$state)||ii(d,o,{initialize:((l=r==null?void 0:r.share)==null?void 0:l.initialize)??e,type:n})})};Rr().use(li({enable:!0,initialize:!0}));const lo=s.defineComponent({__name:"Doctype",setup(e){const{stonecrop:t,isReady:n}=rn(),o=s.ref([]);return s.watch(n,()=>{if(n.value){let r=t.value.schema.schema.toArray();r.forEach((a,c)=>{const u=t.value.store.record[a.fieldname];r[c].value=u}),o.value=r}}),(r,a)=>s.unref(n)?(s.openBlock(),s.createBlock(s.unref(nr),{key:0,class:"aform-main",modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=c=>o.value=c)},null,8,["modelValue"])):s.createCommentVNode("",!0)}});var uo;const fo=typeof window<"u",ui=e=>typeof e=="string",di=()=>{};fo&&(uo=window==null?void 0:window.navigator)!=null&&uo.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function po(e){return typeof e=="function"?e():s.unref(e)}function fi(e){return e}function pi(e){return s.getCurrentScope()?(s.onScopeDispose(e),!0):!1}function kt(e){var t;const n=po(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ho=fo?window:void 0;function hi(...e){let t,n,o,r;if(ui(e[0])||Array.isArray(e[0])?([n,o,r]=e,t=ho):[t,n,o,r]=e,!t)return di;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const a=[],c=()=>{a.forEach(l=>l()),a.length=0},i=(l,f,p,h)=>(l.addEventListener(f,p,h),()=>l.removeEventListener(f,p,h)),u=s.watch(()=>[kt(t),po(r)],([l,f])=>{c(),l&&a.push(...n.flatMap(p=>o.map(h=>i(l,p,h,f))))},{immediate:!0,flush:"post"}),d=()=>{u(),c()};return pi(d),d}const mo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},go="__vueuse_ssr_handlers__";mo[go]=mo[go]||{};function mi(e,{window:t=ho,scrollTarget:n}={}){const o=s.ref(!1),r=()=>{if(!t)return;const a=t.document,c=kt(e);if(!c)o.value=!1;else{const i=c.getBoundingClientRect();o.value=i.top<=(t.innerHeight||a.documentElement.clientHeight)&&i.left<=(t.innerWidth||a.documentElement.clientWidth)&&i.bottom>=0&&i.right>=0}};return s.watch(()=>kt(e),()=>r(),{immediate:!0,flush:"post"}),t&&hi(n||t,"scroll",r,{capture:!1,passive:!0}),o}var yo;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(yo||(yo={}));var gi=Object.defineProperty,wo=Object.getOwnPropertySymbols,yi=Object.prototype.hasOwnProperty,wi=Object.prototype.propertyIsEnumerable,vo=(e,t,n)=>t in e?gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t)=>{for(var n in t||(t={}))yi.call(t,n)&&vo(e,n,t[n]);if(wo)for(var n of wo(t))wi.call(t,n)&&vo(e,n,t[n]);return e};vi({linear:fi},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const ne=e=>{let t=mi(e).value;return t=t&&e.offsetHeight>0,t},oe=e=>e.tabIndex>=0,_o=e=>{const t=e.target;return St(t)},St=e=>{var t;let n;if(e instanceof HTMLTableCellElement){const o=(t=e.parentElement)==null?void 0:t.previousElementSibling;if(o){const r=Array.from(o.children)[e.cellIndex];r&&(n=r)}}else if(e instanceof HTMLTableRowElement){const o=e.previousElementSibling;o&&(n=o)}return n&&(!oe(n)||!ne(n))?St(n):n},_i=e=>{var t;const n=e.target;let o;if(n instanceof HTMLTableCellElement){const r=(t=n.parentElement)==null?void 0:t.parentElement;if(r){const a=r.firstElementChild.children[n.cellIndex];a&&(o=a)}}else if(n instanceof HTMLTableRowElement){const r=n.parentElement;if(r){const a=r.firstElementChild;a&&(o=a)}}return o&&(!oe(o)||!ne(o))?Ot(o):o},bo=e=>{const t=e.target;return Ot(t)},Ot=e=>{var t;let n;if(e instanceof HTMLTableCellElement){const o=(t=e.parentElement)==null?void 0:t.nextElementSibling;if(o){const r=Array.from(o.children)[e.cellIndex];r&&(n=r)}}else if(e instanceof HTMLTableRowElement){const o=e.nextElementSibling;o&&(n=o)}return n&&(!oe(n)||!ne(n))?Ot(n):n},bi=e=>{var t;const n=e.target;let o;if(n instanceof HTMLTableCellElement){const r=(t=n.parentElement)==null?void 0:t.parentElement;if(r){const a=r.lastElementChild.children[n.cellIndex];a&&(o=a)}}else if(n instanceof HTMLTableRowElement){const r=n.parentElement;if(r){const a=r.lastElementChild;a&&(o=a)}}return o&&(!oe(o)||!ne(o))?St(o):o},Eo=e=>{const t=e.target;return It(t)},It=e=>{var t;let n;if(e.previousElementSibling)n=e.previousElementSibling;else{const o=(t=e.parentElement)==null?void 0:t.previousElementSibling;n=o==null?void 0:o.lastElementChild}return n&&(!oe(n)||!ne(n))?It(n):n},ko=e=>{const t=e.target;return Ct(t)},Ct=e=>{var t;let n;if(e.nextElementSibling)n=e.nextElementSibling;else{const o=(t=e.parentElement)==null?void 0:t.nextElementSibling;n=o==null?void 0:o.firstElementChild}return n&&(!oe(n)||!ne(n))?Ct(n):n},So=e=>{const t=e.target.parentElement.firstElementChild;return t&&(!oe(t)||!ne(t))?Ct(t):t},Oo=e=>{const t=e.target.parentElement.lastElementChild;return t&&(!oe(t)||!ne(t))?It(t):t},Ue=["alt","control","shift","meta"],Ei={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},Io={"keydown.up":e=>{const t=_o(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.down":e=>{const t=bo(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.left":e=>{const t=Eo(e);e.preventDefault(),e.stopPropagation(),t&&t.focus()},"keydown.right":e=>{const t=ko(e);e.preventDefault(),e.stopPropagation(),t&&t.focus()},"keydown.control.up":e=>{const t=_i(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.control.down":e=>{const t=bi(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.control.left":e=>{const t=So(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.control.right":e=>{const t=Oo(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.end":e=>{const t=Oo(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const t=bo(e);t&&t.focus()}},"keydown.shift.enter":e=>{if(e.target instanceof HTMLTableCellElement){e.preventDefault(),e.stopPropagation();const t=_o(e);t&&t.focus()}},"keydown.home":e=>{const t=So(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.tab":e=>{const t=ko(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.shift.tab":e=>{const t=Eo(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())}};function Co(e){const t=o=>{let r=null;o.parent&&(typeof o.parent=="string"?r=document.querySelector(o.parent):o.parent instanceof Element?r=o.parent:r=o.parent.value);let a=[];if(o.selectors)if(typeof o.selectors=="string")a=r?Array.from(r.querySelectorAll(o.selectors)):Array.from(document.querySelectorAll(o.selectors));else if(o.selectors instanceof Element)a.push(o.selectors);else if(Array.isArray(o.selectors.value))for(const c of o.selectors.value)c instanceof Element?a.push(c):a.push(c.$el);else a.push(o.selectors.value);else a=Array.from(r.children).filter(c=>oe(c)&&ne(c));return a},n=o=>r=>{const a=Ei[r.key]||r.key.toLowerCase();if(Ue.includes(a))return;const c=o.handlers||Io;for(const i of Object.keys(c)){const[u,...d]=i.split(".");if(u==="keydown"&&d.includes(a)){const l=c[i],f=d.filter(h=>Ue.includes(h)),p=Ue.some(h=>{const y=h.charAt(0).toUpperCase()+h.slice(1);return r.getModifierState(y)});if(f.length>0){if(p){for(const h of Ue)if(d.includes(h)){const y=h.charAt(0).toUpperCase()+h.slice(1);r.getModifierState(y)&&l(r)}}}else p||l(r)}}};s.onMounted(()=>{for(const o of e){const r=t(o);for(const a of r)a.addEventListener("keydown",n(o))}}),s.onBeforeUnmount(()=>{for(const o of e){const r=t(o);for(const a of r)a.removeEventListener("keydown",n(o))}})}const ki=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],Si={key:1},Oi=s.defineComponent({__name:"ACell",props:{colIndex:{},rowIndex:{},tableid:{},addNavigation:{type:[Boolean,Object],default:!0},tabIndex:{default:0},clickHandler:{}},setup(e){var t;const n=e,o=s.inject(n.tableid),r=s.ref(null);let a=s.ref(!1);const c=s.computed(()=>{const g=o.cellData(n.colIndex,n.rowIndex);if(o.columns[n.colIndex].format){const _=o.columns[n.colIndex].format;return typeof _=="function"?_(g):typeof _=="string"?Function(`"use strict";return (${_})`)()(g):g}else return g}),i=g=>{if(n.clickHandler){n.clickHandler(g);return}if(o.columns[n.colIndex].mask,o.columns[n.colIndex].modalComponent){const _=r.value.getBoundingClientRect();o.modal.visible=!0,o.modal.colIndex=n.colIndex,o.modal.rowIndex=n.rowIndex,o.modal.parent=r.value,o.modal.top=_.top+_.height,o.modal.left=_.left,o.modal.width=d.value,o.modal.component=o.columns[n.colIndex].modalComponent,o.modal.componentProps=o.columns[n.colIndex].modalComponentProps}};if(n.addNavigation){let g={...Io,"keydown.f2":i,"keydown.alt.up":i,"keydown.alt.down":i,"keydown.alt.left":i,"keydown.alt.right":i};typeof n.addNavigation=="object"&&(g={...g,...n.addNavigation}),Co([{selectors:r,handlers:g}])}const u=s.computed(()=>o.columns[n.colIndex].align||"center"),d=s.computed(()=>o.columns[n.colIndex].width||"40ch");let l="";const f=()=>{r.value&&(l=r.value.innerText)},p=()=>{r.value&&r.value.innerHTML!==l&&(l=r.value.innerText,r.value.dispatchEvent(new Event("change")),a.value=!0,o.columns[n.colIndex].format||o.setCellData(n.rowIndex,n.colIndex,l))},h=(g,_)=>_&&g===0&&_>0?`${_}ch`:"inherit",y={textAlign:u.value,width:d.value,backgroundColor:a.value?"var(--cell-modified-color)":"inherit",fontWeight:a.value?"bold":"inherit",paddingLeft:h(n.colIndex,(t=o.display[n.rowIndex])==null?void 0:t.indent)};return(g,_)=>(s.openBlock(),s.createElementBlock("td",{ref_key:"cell",ref:r,"data-colindex":g.colIndex,"data-rowindex":g.rowIndex,"data-editable":s.unref(o).columns[g.colIndex].edit,contenteditable:s.unref(o).columns[g.colIndex].edit,tabindex:g.tabIndex,spellcheck:!1,style:y,onFocus:f,onPaste:p,onBlur:p,onInput:p,onClick:i,onMousedown:i},[s.unref(o).columns[g.colIndex].cellComponent?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(o).columns[g.colIndex].cellComponent),s.mergeProps({key:0,value:c.value},s.unref(o).columns[g.colIndex].cellComponentProps),null,16,["value"])):(s.openBlock(),s.createElementBlock("span",Si,s.toDisplayString(c.value),1))],40,ki))}}),Pe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Ii=Pe(Oi,[["__scopeId","data-v-07dfe445"]]),Ci=["tabindex"],Ni={key:0,tabIndex:-1,class:"list-index"},Pi=s.defineComponent({__name:"ARow",props:{row:{},rowIndex:{},tableid:{},tabIndex:{default:-1},addNavigation:{}},setup(e){s.useCssVars(u=>({"5b18ee03":s.unref(r)}));const t=e,n=s.inject(t.tableid),o=s.ref(null),r=n.numberedRowWidth.value,a=()=>n.config.view!=="tree"?"":n.display[t.rowIndex].isRoot||n.display[t.rowIndex].isParent?n.display[t.rowIndex].childrenOpen?"-":"+":"",c=()=>n.config.view!=="tree"||n.display[t.rowIndex].isRoot||n.display[t.rowIndex].open,i=u=>{n.toggleRowExpand(u)};return t.addNavigation&&Co([{selectors:o,handlers:t.addNavigation}]),(u,d)=>s.withDirectives((s.openBlock(),s.createElementBlock("tr",{ref_key:"rowEl",ref:o,tabindex:u.tabIndex,class:"table-row"},[s.unref(n).config.view==="list"?(s.openBlock(),s.createElementBlock("td",Ni,s.toDisplayString(u.rowIndex+1),1)):s.unref(n).config.view==="tree"?(s.openBlock(),s.createElementBlock("td",{key:1,tabIndex:-1,class:"tree-index",onClick:d[0]||(d[0]=l=>i(u.rowIndex))},s.toDisplayString(a()),1)):s.renderSlot(u.$slots,"indexCell",{key:2},void 0,!0),s.renderSlot(u.$slots,"default",{},void 0,!0)],8,Ci)),[[s.vShow,c()]])}}),xi=Pe(Pi,[["__scopeId","data-v-4c71a067"]]);let He;const $i=new Uint8Array(16);function Ri(){if(!He&&(He=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!He))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return He($i)}const M=[];for(let e=0;e<256;++e)M.push((e+256).toString(16).slice(1));function Ti(e,t=0){return M[e[t+0]]+M[e[t+1]]+M[e[t+2]]+M[e[t+3]]+"-"+M[e[t+4]]+M[e[t+5]]+"-"+M[e[t+6]]+M[e[t+7]]+"-"+M[e[t+8]]+M[e[t+9]]+"-"+M[e[t+10]]+M[e[t+11]]+M[e[t+12]]+M[e[t+13]]+M[e[t+14]]+M[e[t+15]]}const Ai=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),No={randomUUID:Ai};function Po(e,t,n){if(No.randomUUID&&!t&&!e)return No.randomUUID();e=e||{};const o=e.random||(e.rng||Ri)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,t){n=n||0;for(let r=0;r<16;++r)t[n+r]=o[r];return t}return Ti(o)}class Di{constructor(t,n,o,r,a,c){this.id=t||Po(),this.rows=o,this.columns=s.reactive(n),this.config=s.reactive(r),this.table=a||s.reactive(this.createTableObject()),this.display=this.createDisplayObject(c),this.modal=s.reactive({visible:!1})}createTableObject(){const t={};for(const[n,o]of this.columns.entries())for(const[r,a]of this.rows.entries())t[`${n}:${r}`]=a[o.name];return t}createDisplayObject(t){const n=[Object.assign({},{modified:!1})];if(t&&"0:0"in t)return t;const o=new Set;for(let r=this.rows.length-1;r>=0;r--){const a=this.rows[r];a.parent&&o.add(a.parent),n[r]={childrenOpen:!1,expanded:!1,indent:a.indent||null,isParent:o.has(r),isRoot:a.parent===null||a.parent===void 0,modified:!1,open:a.parent===null||a.parent===void 0,parent:a.parent}}return s.reactive(n)}get zeroColumn(){return["list","tree","list-expansion"].includes(this.config.view)}get numberedRowWidth(){return s.computed(()=>String(Math.ceil(this.rows.length/100)+1)+"ch")}cellData(t,n){return this.table[`${t}:${n}`]}setCellData(t,n,o){this.table[`${n}:${t}`]!==o&&(this.display[t].modified=!0),this.table[`${n}:${t}`]=o;const r=this.columns[n];return this.rows[t][r.name]=o,this.table[`${n}:${t}`]}toggleRowExpand(t){if(this.config.view==="tree"){this.display[t].childrenOpen=!this.display[t].childrenOpen;for(let n=this.rows.length-1;n>=0;n--)this.display[n].parent===t&&(this.display[n].open=!this.display[n].open,this.display[n].childrenOpen&&this.toggleRowExpand(n))}else this.config.view==="list-expansion"&&(this.display[t].expanded=!this.display[t].expanded)}}const Vi={key:0},Bi={class:"atable-header-row",tabindex:"-1"},Mi={key:0,id:"header-index"},Li=s.defineComponent({__name:"ATableHeader",props:{columns:{},config:{},tableid:{}},setup(e){s.useCssVars(r=>({"12d06943":s.unref(n)}));const t=s.inject(e.tableid),n=t.numberedRowWidth.value,o=r=>({minWidth:r.width||"40ch",textAlign:r.align||"center",width:t.config.fullWidth?"auto":null});return(r,a)=>r.columns.length?(s.openBlock(),s.createElementBlock("thead",Vi,[s.createElementVNode("tr",Bi,[s.unref(t).zeroColumn?(s.openBlock(),s.createElementBlock("th",Mi)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.columns,(c,i)=>(s.openBlock(),s.createElementBlock("th",{key:i,tabindex:"-1",style:s.normalizeStyle(o(c))},[s.renderSlot(r.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(c.label||String.fromCharCode(i+97).toUpperCase()),1)],!0)],4))),128))])])):s.createCommentVNode("",!0)}}),ji=Pe(Li,[["__scopeId","data-v-16e66636"]]),Ui=s.defineComponent({__name:"ATableModal",props:{colIndex:{},rowIndex:{},tableid:{}},setup(e){s.inject(e.tableid);const t=n=>{n.stopPropagation()};return(n,o)=>(s.openBlock(),s.createElementBlock("div",{ref:"amodal",class:"amodal",tabindex:"-1",onClick:t,onInput:t},[s.renderSlot(n.$slots,"default",{},void 0,!0)],544))}}),Hi=Pe(Ui,[["__scopeId","data-v-10a48b2a"]]),Fi=s.defineComponent({__name:"ATable",props:{id:{},modelValue:{},columns:{},rows:{default:()=>[]},config:{default:()=>new Object},tableid:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t;let r=n.modelValue?n.modelValue:n.rows,a=new Di(n.id,n.columns,r,n.config);s.provide(a.id,a),s.watch(()=>a.rows,i=>{o("update:modelValue",i)},{deep:!0});const c=i=>{var u;(u=a.modal.parent)!=null&&u.contains(i.target)||a.modal.visible&&(a.modal.visible=!1)};return window.addEventListener("click",c),window.addEventListener("keydown",i=>{if(i.key==="Escape"&&a.modal.visible){a.modal.visible=!1;const u=a.modal.parent;u&&s.nextTick().then(()=>{const d=u.dataset.rowindex,l=u.dataset.colindex,f=document.querySelectorAll(`[data-rowindex='${d}'][data-colindex='${l}']`);f&&f[0].focus()})}}),(i,u)=>(s.openBlock(),s.createElementBlock("table",{class:"atable",style:s.normalizeStyle({width:s.unref(a).config.fullWidth?"100%":"auto"})},[s.renderSlot(i.$slots,"header",{data:s.unref(a)},()=>[s.createVNode(ji,{columns:s.unref(a).columns,config:s.unref(a).config,tableid:s.unref(a).id},null,8,["columns","config","tableid"])],!0),s.createElementVNode("tbody",null,[s.renderSlot(i.$slots,"body",{data:s.unref(a)},()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(a).rows,(d,l)=>(s.openBlock(),s.createBlock(xi,{key:d.id||s.unref(Po)(),row:d,rowIndex:l,tableid:s.unref(a).id},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(a).columns,(f,p)=>(s.openBlock(),s.createBlock(Ii,{key:`${p}:${l}`,tableid:s.unref(a).id,col:f,spellcheck:"false",rowIndex:l,colIndex:p+(s.unref(a).zeroColumn?0:-1),component:f.cellComponent,style:s.normalizeStyle({textAlign:(f==null?void 0:f.align)||"center",minWidth:(f==null?void 0:f.width)||"40ch",width:s.unref(a).config.fullWidth?"auto":null})},null,8,["tableid","col","rowIndex","colIndex","component","style"]))),128))]),_:2},1032,["row","rowIndex","tableid"]))),128))],!0)]),s.renderSlot(i.$slots,"footer",{data:s.unref(a)},void 0,!0),s.renderSlot(i.$slots,"modal",{data:s.unref(a)},()=>[s.withDirectives(s.createVNode(Hi,{colIndex:s.unref(a).modal.colIndex,rowIndex:s.unref(a).modal.rowIndex,tableid:s.unref(a).id,style:s.normalizeStyle({left:s.unref(a).modal.left+"px",top:s.unref(a).modal.top+"px",maxWidth:s.unref(a).modal.width+"px"})},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(a).modal.component),s.mergeProps({key:`${s.unref(a).modal.rowIndex}:${s.unref(a).modal.colIndex}`,colIndex:s.unref(a).modal.colIndex,rowIndex:s.unref(a).modal.rowIndex,tableid:s.unref(a).id},s.unref(a).modal.componentProps),null,16,["colIndex","rowIndex","tableid"]))]),_:1},8,["colIndex","rowIndex","tableid","style"]),[[s.vShow,s.unref(a).modal.visible]])],!0)],4))}}),Wi=Pe(Fi,[["__scopeId","data-v-55d8ba05"]]),xo=s.defineComponent({__name:"Records",setup(e){const{stonecrop:t,isReady:n}=rn(),o={view:"list"};return(r,a)=>s.unref(n)?(s.openBlock(),s.createBlock(s.unref(Wi),{key:0,columns:s.unref(t).schema.schema.toArray(),rows:s.unref(t).store.records,config:o},null,8,["columns","rows"])):s.createCommentVNode("",!0)}}),$o=e=>(s.pushScopeId("data-v-18bfde6e"),e=e(),s.popScopeId(),e),zi={class:"tabs"},Gi={tabindex:"0"},Qi={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"},qi=[$o(()=>s.createElementVNode("g",null,[s.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
|
|
37
|
-
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
|
|
38
|
-
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
|
|
39
|
-
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
|
|
40
|
-
l-56.64-0.114v150.98C359.32,398.29,355.686,401.923,351.191,401.923z M81.03,385.666h262.033V234.67
|
|
41
|
-
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
|
|
42
|
-
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
|
|
43
|
-
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
|
|
44
|
-
C81.03,234.149,81.03,385.666,81.03,385.666z`})],-1))],Ki={tabindex:"0"},Ji={style:{width:"11pt"}},Yi=[$o(()=>s.createElementVNode("g",{transform:"matrix(-0.08088215,0,0,0.08088215,9.8016177,3.1263021e-6)"},[s.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))],Ro=Ge(s.defineComponent({__name:"SheetNav",props:{breadcrumbs:{}},setup(e){const t=e,n=s.ref([]),o=s.ref(!0),r=s.ref(!1),a=s.ref(""),c=s.ref(null),i=s.computed(()=>o.value?"unrotated":"rotated");s.onMounted(()=>{n.value=t.breadcrumbs||[]});const u=()=>{o.value=!o.value},d=async()=>{r.value=!r.value,await s.nextTick(()=>{c.value.focus()})},l=h=>{h.preventDefault(),h.stopPropagation()},f=async h=>{h.preventDefault(),h.stopPropagation(),await d()},p=()=>{};return(h,y)=>{const g=s.resolveComponent("router-link");return s.openBlock(),s.createElementBlock("footer",null,[s.createElementVNode("ul",zi,[s.createElementVNode("li",{class:"hidebreadcrumbs",onClick:u,onKeydown:s.withKeys(u,["enter"])},[s.createElementVNode("a",Gi,[s.createElementVNode("div",{class:s.normalizeClass(i.value)},"ร",2)])],32),s.createElementVNode("li",{class:"hometab",onClick:p,onKeydown:s.withKeys(p,["enter"]),style:s.normalizeStyle({display:o.value?"block":"none"})},[s.createVNode(g,{to:"/home",tabindex:"0"},{default:s.withCtx(()=>[(s.openBlock(),s.createElementBlock("svg",Qi,qi))]),_:1})],36),s.createElementVNode("li",{class:"searchtab",onClick:d,onKeydown:s.withKeys(d,["enter"]),style:s.normalizeStyle({display:o.value?"block":"none"})},[s.createElementVNode("a",Ki,[s.createElementVNode("span",{style:s.normalizeStyle({display:r.value?"none":"block"})},[(s.openBlock(),s.createElementBlock("svg",Ji,Yi))],4),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=_=>a.value=_),ref_key:"searchinput",ref:c,style:s.normalizeStyle({display:r.value?"block":"none"}),onClick:y[1]||(y[1]=_=>l(_)),onInput:y[2]||(y[2]=_=>l(_)),onBlur:y[3]||(y[3]=_=>f(_)),onKeydown:y[4]||(y[4]=s.withKeys(_=>f(_),["enter"])),type:"text"},null,36),[[s.vModelText,a.value]])])],36),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value,(_,O)=>(s.openBlock(),s.createElementBlock("li",{key:O,style:s.normalizeStyle({display:o.value?"block":"none"})},[s.createVNode(g,{tabindex:"0",to:_.to},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(_.title),1)]),_:2},1032,["to"])],4))),128))])])}}}),[["__scopeId","data-v-18bfde6e"]]),Xi={install:e=>{e.component("ActionSet",$t),e.component("CommandPalette",Rt),e.component("Doctype",lo),e.component("Records",xo),e.component("SheetNav",Ro)}};W.ActionSet=$t,W.CommandPalette=Rt,W.Doctype=lo,W.Records=xo,W.SheetNav=Ro,W.StonecropDesktop=Xi,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
-
//# sourceMappingURL=desktop.umd.cjs.map
|