@stonecrop/desktop 0.2.5
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/README.md +11 -0
- package/dist/desktop.js +4967 -0
- package/dist/desktop.js.map +1 -0
- package/dist/desktop.umd.cjs +45 -0
- package/dist/desktop.umd.cjs.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +54 -0
- package/src/components/ActionSet.vue +271 -0
- package/src/components/CommandPalette.vue +5 -0
- package/src/components/Desktop.vue +8 -0
- package/src/components/Doctype.vue +37 -0
- package/src/components/Records.vue +20 -0
- package/src/components/SheetNav.vue +330 -0
|
@@ -0,0 +1,45 @@
|
|
|
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))}}),Zi="",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=Ko(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))]))}}),[["__scopeId","data-v-74d66cf2"]]),Lt={date:"##/##/####",datetime:"####/##/## ##:##",time:"##:##",fulltime:"##:##:##",phone:"(###) ### - ####",card:"#### #### #### ####"};function nr(e){try{return Function(`"use strict";return (${e})`)()}catch{}}function or(e){var t;let n=e.value;if(n){const o=nr(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 rr(e,t){t||(t="#");let n=e;const o=[t,"/","-","(",")"," "];for(const r of o)n=n.replaceAll(r,"");return n}function sr(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 ar(e,t){const n=or(t);if(!n)return;const o="#",r=e.value,a=rr(r,o);if(a){const c=sr(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:ar}});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 _e{constructor(t,n,o,r,a){if(this.name="Stonecrop",_e._root)return _e._root;_e._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 ir(){return Ut().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ut(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const cr=typeof Proxy=="function",lr="devtools-plugin:setup",ur="plugin:settings:set";let pe,Ke;function dr(){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 fr(){return dr()?Ke.now():Date.now()}class pr{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 fr()}},n&&n.on(ur,(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=ir(),a=cr&&n.enableEarlyProxy;if(r&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))r.emit(lr,e,t);else{const c=a?new pr(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 ve;const be=e=>ve=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 hr(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([String.fromCharCode(65279),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?mr:"msSaveOrOpenBlob"in Ae?gr:yr:()=>{};function mr(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 gr(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(hr(e,n),t)}function yr(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 wr(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 vr(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 br(){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 Er(e){try{const n=await br()();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 kr(e){return Xe(e)?{id:Ze,label:Jt}:{id:e.$id,label:e.$id}}function Sr(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 Or(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:Cr}=Object,Ve=e=>"๐ "+e;function Nr(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:()=>{wr(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:()=>{vr(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Er(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(kr)}}),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=Sr(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 Pr(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:Or(i),data:Cr({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 xr({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)},Pr(e,t)}function $r(){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&&Nr(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(xr),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 Rr=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 Tr=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Ar(e){return!ce(e)||!e.hasOwnProperty(Tr)}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 v;function I(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=v=Symbol();s.nextTick().then(()=>{v===R&&(d=!0)}),l=!0,me(f,b,o.state.value[e])}const O=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:I,$reset:O,$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||Rr)(()=>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&&Ar(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");I(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 Dr(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"&&ve&&ve._testing?null:i)||(d?s.inject(Ht,null):null),i&&be(i),process.env.NODE_ENV!=="production"&&!ve)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=ve,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 Vr=Dr("data",()=>{const e=s.ref([]),t=s.ref({});return{records:e,record:t}});function rn(e){e||(e=s.inject("$registry"));const t=Vr(),n=s.ref(new _e(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 Br(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 Mr=/\/$/,Lr=e=>e.replace(Mr,"");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=Hr(o??t,n),{fullPath:o+(a&&"?")+a+c,path:o,query:r,hash:c}}function jr(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(!Ur(e[n],t[n]))return!1;return!0}function Ur(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 Hr(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 Ie;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Ie||(Ie={}));function Fr(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),Lr(e)}const Wr=/^[^#]+#/;function zr(e,t){return e.replace(Wr,"#")+t}function Gr(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=Gr(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 qr(e,t){rt.set(e,t)}function Kr(e){const t=rt.get(e);return rt.delete(e),t}let Jr=()=>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 Yr(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 v=0;if(p){if(n.value=h,t.value=p,c&&c===y){c=null;return}v=g?p.position-g.position:0}else o(h);r.forEach(I=>{I(n.value,y,{delta:v,type:Se.pop,direction:v?v>0?Ie.forward:Ie.back:Ie.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 Xr(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:Jr()+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 Zr(e){e=Fr(e);const t=Xr(e),n=Yr(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:zr.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 es(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 ts={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 "${os(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(ts[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 ns=["params","query","hash"];function os(e){if(typeof e=="string")return e;if("path"in e)return e.path;const t={};for(const n of ns)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const mn="[^/]+?",rs={sensitive:!1,strict:!1,start:!0,end:!0},ss=/[.+*?^${}()[\]/\\]/g;function as(e,t){const n=x({},rs,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(ss,"\\$&"),h+=40;else if(p.type===1){const{value:y,repeatable:g,optional:v,regexp:I}=p;a.push({name:y,repeatable:g,optional:v});const O=I||mn;if(O!==mn){h+=10;try{new RegExp(`(${O})`)}catch(L){throw new Error(`Invalid custom RegExp for param "${y}" (${O}): `+L.message)}}let T=g?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(T=v&&d.length<2?`(?:/${T})`:"/"+T),v&&(T+="?"),r+=T,h+=20,v&&(h+=-8),g&&(h+=-20),O===".*"&&(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:v}=h,I=y in d?d[y]:"";if(F(I)&&!g)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const O=F(I)?I.join("/"):I;if(!O)if(v)p.length<2&&(l.endsWith("/")?l=l.slice(0,-1):f=!0);else throw new Error(`Missing required param "${y}"`);l+=O}}return l||"/"}return{re:c,score:o,keys:a,parse:i,stringify:u}}function is(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]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function cs(e,t){let n=0;const o=e.score,r=t.score;for(;n<o.length&&n<r.length;){const a=is(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 ls={type:0,value:""},us=/[a-zA-Z0-9_]/;function ds(e){if(!e)return[[]];if(e==="/")return[[ls]];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:us.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 fs(e,t,n){const o=as(ds(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 ps(e,t){const n=[],o=new Map;t=_n({strict:!1,end:!0,sensitive:!1},t);function r(l){return o.get(l)}function a(l,f,p){const h=!p,y=hs(l);process.env.NODE_ENV!=="production"&&ws(y,f),y.aliasOf=p&&p.record;const g=_n(t,l),v=[y];if("alias"in l){const T=typeof l.alias=="string"?[l.alias]:l.alias;for(const L of T)v.push(x({},y,{components:p?p.record.components:y.components,path:L,aliasOf:p?p.record:y}))}let I,O;for(const T of v){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(I=fs(T,f,g),process.env.NODE_ENV!=="production"&&f&&L[0]==="/"&&_s(I,f),p?(p.alias.push(I),process.env.NODE_ENV!=="production"&&ys(p,I)):(O=O||I,O!==I&&O.alias.push(I),h&&l.name&&!wn(I)&&c(l.name)),y.children){const G=y.children;for(let Q=0;Q<G.length;Q++)a(G[Q],I,p&&p.children[Q])}p=p||I,(I.record.components&&Object.keys(I.record.components).length||I.record.name||I.record.redirect)&&u(I)}return O?()=>{c(O)}: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&&cs(l,n[f])>=0&&(l.record.path!==n[f].record.path||!vn(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 O=Object.keys(l.params||{}).filter(T=>!p.keys.find(L=>L.name===T));O.length&&P(`Discarded invalid param(s) "${O.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(O=>!O.optional).map(O=>O.name)),l.params&&yn(l.params,p.keys.map(O=>O.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(O=>O.re.test(y)),p&&(h=p.parse(y),g=p.record.name);else{if(p=f.name?o.get(f.name):n.find(O=>O.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 v=[];let I=p;for(;I;)v.unshift(I.record),I=I.parent;return{name:g,path:y,params:h,matched:v,meta:gs(v)}}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 hs(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:ms(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 ms(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 gs(e){return e.reduce((t,n)=>x(t,n.meta),{})}function _n(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 ys(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 ws(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 vn(e,t){return t.children.some(n=>n===e||vn(e,n))}const bn=/#/g,vs=/&/g,bs=/\//g,Es=/=/g,ks=/\?/g,En=/\+/g,Ss=/%5B/g,Is=/%5D/g,kn=/%5E/g,Os=/%60/g,Sn=/%7B/g,Cs=/%7C/g,In=/%7D/g,Ns=/%20/g;function it(e){return encodeURI(""+e).replace(Cs,"|").replace(Ss,"[").replace(Is,"]")}function Ps(e){return it(e).replace(Sn,"{").replace(In,"}").replace(kn,"^")}function ct(e){return it(e).replace(En,"%2B").replace(Ns,"+").replace(bn,"%23").replace(vs,"%26").replace(Os,"`").replace(Sn,"{").replace(In,"}").replace(kn,"^")}function xs(e){return ct(e).replace(Es,"%3D")}function $s(e){return it(e).replace(bn,"%23").replace(ks,"%3F")}function Rs(e){return e==null?"":$s(e).replace(bs,"%2F")}function Oe(e){try{return decodeURIComponent(""+e)}catch{process.env.NODE_ENV!=="production"&&P(`Error decoding "${e}". Using original value`)}return""+e}function Ts(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=Oe(c<0?a:a.slice(0,c)),u=c<0?null:Oe(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 On(e){let t="";for(let n in e){const o=e[n];if(n=xs(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 As(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 Ds=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):es(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"?Vs(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 Vs(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(Bs(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=Br(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 Bs(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&&js(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 Ls(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 Ms=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 Ls(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 js(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,Us=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"&&Fs();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(Ds,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=I=>{I.component.isUnmounted&&(f.instances[l]=null)},v=s.h(p,x({},y,t,{onVnodeUnmounted:g,ref:u}));if(process.env.NODE_ENV!=="production"&&Z&&v.ref){const I={depth:c.value,name:f.name,path:f.path,meta:f.meta};(F(v.ref)?v.ref.map(T=>T.i):[v.ref.i]).forEach(T=>{T.__vrv_devtools=I})}return Rn(n.default,{Component:v,route:d})||v}}});function Rn(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Hs=Us;function Fs(){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=>Xs(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 Ws=0;function zs(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const o=Ws++;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 Gs(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}${Gs(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,qs=2282478,Vn=16486972,Ks=6710886;function Bn(e){const t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:qs}),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:Ks});let o=n.__vd_id;return o==null&&(o=String(Js++),n.__vd_id=o),{id:o,label:n.path,tags:t,children:e.children.map(Bn)}}let Js=0;const Ys=/^\/(.*)\/([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(Ys);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=Oe(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 Xs(e,t){const n={};for(const o in e)t.includes(o)||(n[o]=e[o]);return n}function Zs(e){const t=ps(e.routes,e),n=e.parseQuery||Ts,o=e.stringifyQuery||On,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,Rs),p=nt.bind(null,Oe);function h(m,_){let w,E;return pn(m)?(w=t.getRecordMatcher(m),E=_):E=m,t.addRoute(E,w)}function y(m){const _=t.getRecordMatcher(m);_?t.removeRoute(_):process.env.NODE_ENV!=="production"&&P(`Cannot remove non-existent route "${String(m)}"`)}function g(){return t.getRoutes().map(m=>m.record)}function v(m){return!!t.getRecordMatcher(m)}function I(m,_){if(_=x({},_||u.value),typeof m=="string"){const C=ot(n,m,_.path),A=t.resolve({path:C.path},_),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:Oe(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,_.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)}),_.params=f(_.params)}const E=t.resolve(w,_),$=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=jr(o,x({},m,{hash:Ps($),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===On?As(m.query):m.query||{}},E,{redirectedFrom:void 0,href:N})}function O(m){return typeof m=="string"?ot(n,m,u.value.path):x({},m)}function T(m,_){if(d!==m)return ge(8,{from:_,to:m})}function L(m){return S(m)}function G(m){return L(x(O(m),{replace:!0}))}function Q(m){const _=m.matched[m.matched.length-1];if(_&&_.redirect){const{redirect:w}=_;let E=typeof w=="function"?w(m):w;if(typeof E=="string"&&(E=E.includes("?")||E.includes("#")?E=O(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,_){const w=d=I(m),E=u.value,$=m.state,D=m.force,N=m.replace===!0,C=Q(w);if(C)return S(x(O(C),{state:typeof C=="object"?x({},$,C.state):$,force:D,replace:N}),_||w);const A=w;A.redirectedFrom=_;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,I(H.to),A)&&_&&(_._count=_._count?_._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},O(H.to),{state:typeof H.to=="object"?x({},$,H.to.state):$,force:D}),_||A)}else H=R(A,E,!0,N,$);return b(A,E,H),H})}function To(m,_){const w=T(m,_);return w?Promise.reject(w):Promise.resolve()}function K(m){const _=We.values().next().value;return _&&typeof _.runWithContext=="function"?_.runWithContext(m):m()}function k(m,_){let w;const[E,$,D]=ea(m,_);w=dt(E.reverse(),"beforeRouteLeave",m,_);for(const C of E)C.leaveGuards.forEach(A=>{w.push(ie(A,m,_))});const N=To.bind(null,m,_);return w.push(N),we(w).then(()=>{w=[];for(const C of a.list())w.push(ie(C,m,_));return w.push(N),we(w)}).then(()=>{w=dt($,"beforeRouteUpdate",m,_);for(const C of $)C.updateGuards.forEach(A=>{w.push(ie(A,m,_))});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,_));else w.push(ie(C.beforeEnter,m,_));return w.push(N),we(w)}).then(()=>(m.matched.forEach(C=>C.enterCallbacks={}),w=dt(D,"beforeRouteEnter",m,_),w.push(N),we(w))).then(()=>{w=[];for(const C of c.list())w.push(ie(C,m,_));return w.push(N),we(w)}).catch(C=>ee(C,8)?C:Promise.reject(C))}function b(m,_,w){i.list().forEach(E=>K(()=>E(m,_,w)))}function R(m,_,w,E,$){const D=T(m,_);if(D)return D;const N=_===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,_,w,N),Nt()}let V;function de(){V||(V=r.listen((m,_,w)=>{const E=I(m),$=Q(E);if($){S(x($,{replace:!0}),E).catch(ke);return}d=E;const D=u.value;Z&&qr(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,_,w){Nt(m);const E=Fe.list();return E.length?E.forEach($=>$(m,_,w)):(process.env.NODE_ENV!=="production"&&P("uncaught error during route navigation:"),console.error(m)),Promise.reject(m)}function Ki(){return Y&&u.value!==ae?Promise.resolve():new Promise((m,_)=>{xe.add([m,_])})}function Nt(m){return Y||(Y=!m,de(),xe.list().forEach(([_,w])=>m?w(m):_()),xe.reset()),m}function Ao(m,_,w,E){const{scrollBehavior:$}=e;if(!Z||!$)return Promise.resolve();const D=!w&&Kr(un(m.fullPath,0))||(E||!w)&&history.state&&history.state.scroll||null;return s.nextTick().then(()=>$(m,_,D)).then(N=>N&&Qr(N)).catch(N=>U(N,m,_))}const Pt=m=>r.go(m);let xt;const We=new Set,Ji={currentRoute:u,listening:!0,addRoute:h,removeRoute:y,hasRoute:v,getRoutes:g,resolve:I,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:Ki,install(m){const _=this;m.component("RouterLink",Ms),m.component("RouterView",Hs),m.config.globalProperties.$router=_,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,_),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&&zs(m,_,t)}};function we(m){return m.reduce((_,w)=>_.then(()=>K(w)),Promise.resolve())}return Ji}function ea(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]}Zs({history:Zr(),routes:[]});function ta(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 na(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 oa=Le,ra="native";function sa(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(n){t.messagesCallback&&t.messagesCallback(n.data)},t}function aa(e){e.bc.close(),e.subFns=[]}function ia(e,t){try{return e.bc.postMessage(t,!1),ue}catch(n){return Promise.reject(n)}}function ca(e,t){e.messagesCallback=t}function la(){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 ua(){return 150}var da={create:sa,close:aa,onMessage:ca,postMessage:ia,canBeUsed:la,type:ra,averageResponseTime:ua,microSeconds:oa},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,fa(n)},0))},e.prototype.clear=function(){this.map.clear()},e}();function fa(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 pa=Le,ha="pubkey.broadcast-channel-0-",te="messages",je={durability:"relaxed"},ma="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 ga(e){var t=Wn(),n=ha+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 ya(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 wa(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 va(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 ba(e){return va(e.db,e.options.idb.ttl).then(function(t){return _a(e,t.map(function(n){return n.id}))})}function Ea(e,t){return t=mt(t),ga(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 ka(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:wa(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 ka(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 Sa(e){e.closed=!0,e.db.close()}function Ia(e,t){return e.writeBlockPromise=e.writeBlockPromise.then(function(){return ya(e.db,e.uuid,t)}).then(function(){na(0,10)===0&&ba(e)}),e.writeBlockPromise}function Oa(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t,Gn(e)}function Ca(){return!!Wn()}function Na(e){return e.idb.fallbackInterval*2}var Pa={create:Ea,close:Sa,onMessage:Oa,postMessage:Ia,canBeUsed:Ca,type:ma,averageResponseTime:Na,microSeconds:pa},xa=Le,$a="pubkey.broadcastChannel-",Ra="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 $a+e}function Ta(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 Aa(e,t){var n=qn(e),o=function(a){a.key===n&&t(JSON.parse(a.newValue))};return window.addEventListener("storage",o),o}function Da(e){window.removeEventListener("storage",e)}function Va(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=Aa(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 Ba(e){Da(e.listener)}function Ma(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 La(){var e=120,t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")?e*2:e}var ja={create:Va,close:Ba,onMessage:Ma,postMessage:Ta,canBeUsed:Kn,type:Ra,averageResponseTime:La,microSeconds:xa},Ua=Le,Ha="simulate",yt=new Set;function Fa(e){var t={name:e,messagesCallback:null};return yt.add(t),t}function Wa(e){yt.delete(e)}function za(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 Ga(e,t){e.messagesCallback=t}function Qa(){return!0}function qa(){return 5}var Ka={create:Fa,close:Wa,onMessage:Ga,postMessage:za,canBeUsed:Qa,type:Ha,averageResponseTime:qa,microSeconds:Ua},Jn=[da,Pa,ja];function Ja(e){var t=[].concat(e.methods,Jn).filter(Boolean);if(e.type){if(e.type==="simulate")return Ka;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,Ya=0,wt=function(t,n){this.id=Ya++,Yn.add(this),this.name=t,this.options=mt(n),this.method=Ja(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Xa(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 Xa(e){var t=e.method.create(e.name,e.options);ta(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),Za(e)}function to(e,t,n){e._addEL[t]=e._addEL[t].filter(function(o){return o!==n}),ei(e)}function Za(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 ei(e){if(e._iL&&!Zn(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}class _t extends Error{constructor(t,n){super(t),this.name="DevalueError",this.path=n.join("")}}function no(e){return Object(e)!==e}const ti=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ni(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===ti}function oi(e){return Object.prototype.toString.call(e).slice(8,-1)}function ri(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=ri(a);c&&(t+=e.slice(n,r)+c,n=r+1)}return`"${n===0?e:t+e.slice(n)}"`}const vt=-1,oo=-2,ro=-3,so=-4,ao=-5,bt=-6;function io(e,t){return si(JSON.parse(e),t)}function si(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===vt)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 _t("Cannot stringify a function",a);if(o.has(d))return o.get(d);if(d===void 0)return vt;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(oi(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,v]of d)a.push(`.get(${no(g)?Et(g):"..."})`),f+=`,${i(g)},${i(v)}`;f+="]";break;default:if(!ni(d))throw new _t("Cannot stringify arbitrary non-POJOs",a);if(Object.getOwnPropertySymbols(d).length>0)throw new _t("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 v in d)g&&(f+=","),g=!0,a.push(`.${v}`),f+=`${ye(v)}:${i(d[v])}`,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?vt.toString():e===0&&1/e<0?bt.toString():t==="bigint"?`["BigInt","${e}"]`:String(e)}function ai(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 ii=(e,t)=>Object.keys(t).includes(e),ci=({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)||!ii(d,o.$state)||ai(d,o,{initialize:((l=r==null?void 0:r.share)==null?void 0:l.initialize)??e,type:n})})};$r().use(ci({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(tr),{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",li=e=>typeof e=="string",ui=()=>{};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 di(e){return e}function fi(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 pi(...e){let t,n,o,r;if(li(e[0])||Array.isArray(e[0])?([n,o,r]=e,t=ho):[t,n,o,r]=e,!t)return ui;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 fi(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 hi(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&&pi(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 mi=Object.defineProperty,wo=Object.getOwnPropertySymbols,gi=Object.prototype.hasOwnProperty,yi=Object.prototype.propertyIsEnumerable,_o=(e,t,n)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wi=(e,t)=>{for(var n in t||(t={}))gi.call(t,n)&&_o(e,n,t[n]);if(wo)for(var n of wo(t))yi.call(t,n)&&_o(e,n,t[n]);return e};wi({linear:di},{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=hi(e).value;return t=t&&e.offsetHeight>0,t},oe=e=>e.tabIndex>=0,vo=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))?It(o):o},bo=e=>{const t=e.target;return It(t)},It=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))?It(n):n},vi=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 Ot(t)},Ot=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))?Ot(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},Io=e=>{const t=e.target.parentElement.lastElementChild;return t&&(!oe(t)||!ne(t))?Ot(t):t},Ue=["alt","control","shift","meta"],bi={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},Oo={"keydown.up":e=>{const t=vo(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=vi(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=Io(e);t&&(e.preventDefault(),e.stopPropagation(),t.focus())},"keydown.end":e=>{const t=Io(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=vo(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=bi[r.key]||r.key.toLowerCase();if(Ue.includes(a))return;const c=o.handlers||Oo;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 Ei=["data-colindex","data-rowindex","data-editable","contenteditable","tabindex"],ki={key:1},Si=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 v=o.columns[n.colIndex].format;return typeof v=="function"?v(g):typeof v=="string"?Function(`"use strict";return (${v})`)()(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 v=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=v.top+v.height,o.modal.left=v.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={...Oo,"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,v)=>v&&g===0&&v>0?`${v}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,v)=>(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",ki,s.toDisplayString(c.value),1))],40,Ei))}}),Pe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Ii=Pe(Si,[["__scopeId","data-v-07dfe445"]]),Oi=["tabindex"],Ci={key:0,tabIndex:-1,class:"list-index"},Ni=Pe(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",Ci,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,Oi)),[[s.vShow,c()]])}}),[["__scopeId","data-v-4c71a067"]]);let He;const Pi=new Uint8Array(16);function xi(){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(Pi)}const M=[];for(let e=0;e<256;++e)M.push((e+256).toString(16).slice(1));function $i(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 Ri=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),No={randomUUID:Ri};function Po(e,t,n){if(No.randomUUID&&!t&&!e)return No.randomUUID();e=e||{};const o=e.random||(e.rng||xi)();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 $i(o)}class Ti{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 Ai={key:0},Di={class:"atable-header-row",tabindex:"-1"},Vi={key:0,id:"header-index"},Bi=Pe(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",Ai,[s.createElementVNode("tr",Di,[s.unref(t).zeroColumn?(s.openBlock(),s.createElementBlock("th",Vi)):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)}}),[["__scopeId","data-v-16e66636"]]),Mi=Pe(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))}}),[["__scopeId","data-v-10a48b2a"]]),Li=Pe(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 Ti(n.id,n.columns,r,n.config);s.provide(a.id,a),s.watch(()=>a.rows,(i,u)=>{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(Bi,{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(Ni,{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(Mi,{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))}}),[["__scopeId","data-v-819abcc5"]]),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(Li),{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),ji={class:"tabs"},Ui={tabindex:"0"},Hi={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"},Fi=[$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))],Wi={tabindex:"0"},zi={style:{width:"11pt"}},Gi=[$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))],Qi=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",ji,[s.createElementVNode("li",{class:"hidebreadcrumbs",onClick:u,onKeydown:s.withKeys(u,["enter"])},[s.createElementVNode("a",Ui,[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",Hi,Fi))]),_: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",Wi,[s.createElementVNode("span",{style:s.normalizeStyle({display:r.value?"none":"block"})},[(s.openBlock(),s.createElementBlock("svg",zi,Gi))],4),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":y[0]||(y[0]=v=>a.value=v),ref_key:"searchinput",ref:c,style:s.normalizeStyle({display:r.value?"block":"none"}),onClick:y[1]||(y[1]=v=>l(v)),onInput:y[2]||(y[2]=v=>l(v)),onBlur:y[3]||(y[3]=v=>f(v)),onKeydown:y[4]||(y[4]=s.withKeys(v=>f(v),["enter"])),type:"text"},null,36),[[s.vModelText,a.value]])])],36),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value,(v,I)=>(s.openBlock(),s.createElementBlock("li",{key:I,style:s.normalizeStyle({display:o.value?"block":"none"})},[s.createVNode(g,{tabindex:"0",to:v.to},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(v.title),1)]),_:2},1032,["to"])],4))),128))])])}}}),fc="",Ro=Ge(Qi,[["__scopeId","data-v-18bfde6e"]]),qi={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=qi,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
+
//# sourceMappingURL=desktop.umd.cjs.map
|