@stonecrop/stonecrop 0.2.32 โ 0.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/stonecrop.umd.cjs
CHANGED
|
@@ -2,42 +2,42 @@
|
|
|
2
2
|
* pinia v2.1.7
|
|
3
3
|
* (c) 2023 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/let we;const be=e=>we=e,kt=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function ae(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Q;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Q||(Q={}));const Ce=typeof window<"u",Se=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&Ce,
|
|
5
|
+
*/let we;const be=e=>we=e,kt=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function ae(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Q;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Q||(Q={}));const Ce=typeof window<"u",Se=(process.env.NODE_ENV!=="production"||!1)&&process.env.NODE_ENV!=="test"&&Ce,Pt=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 or(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function Je(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){$t(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function Nt(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Ae(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 Te=typeof navigator=="object"?navigator:{userAgent:""},Rt=/Macintosh/.test(Te.userAgent)&&/AppleWebKit/.test(Te.userAgent)&&!/Safari/.test(Te.userAgent),$t=Ce?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Rt?sr:"msSaveOrOpenBlob"in Te?ir:ar:()=>{};function sr(e,t="download",n){const r=document.createElement("a");r.download=t,r.rel="noopener",typeof e=="string"?(r.href=e,r.origin!==location.origin?Nt(r.href)?Je(e,t,n):(r.target="_blank",Ae(r)):Ae(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Ae(r)},0))}function ir(e,t="download",n){if(typeof e=="string")if(Nt(e))Je(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Ae(r)})}else navigator.msSaveOrOpenBlob(or(e,n),t)}function ar(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return Je(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(Pt.HTMLElement))||"safari"in Pt,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||Rt)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let c=a.result;if(typeof c!="string")throw r=null,new Error("Wrong reader.result type");c=i?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=c:location.assign(c),r=null},a.readAsDataURL(e)}else{const a=URL.createObjectURL(e);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function V(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 Ke(e){return"_a"in e&&"install"in e}function It(){if(!("clipboard"in navigator))return V("Your browser doesn't support the Clipboard API","error"),!0}function Ct(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(V('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function cr(e){if(!It())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),V("Global state copied to clipboard.")}catch(t){if(Ct(t))return;V("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function ur(e){if(!It())try{At(e,JSON.parse(await navigator.clipboard.readText())),V("Global state pasted from clipboard.")}catch(t){if(Ct(t))return;V("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function lr(e){try{$t(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){V("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let X;function fr(){X||(X=document.createElement("input"),X.type="file",X.accept=".json");function e(){return new Promise((t,n)=>{X.onchange=async()=>{const r=X.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},X.oncancel=()=>t(null),X.onerror=n,X.click()})}return e}async function dr(e){try{const n=await fr()();if(!n)return;const{text:r,file:o}=n;At(e,JSON.parse(r)),V(`Global state imported from "${o.name}".`)}catch(t){V("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function At(e,t){for(const n in t){const r=e.state.value[n];r?Object.assign(r,t[n]):e.state.value[n]=t[n]}}function J(e){return{_custom:{display:e}}}const Tt="๐ Pinia (root)",Qe="_root";function pr(e){return Ke(e)?{id:Qe,label:Tt}:{id:e.$id,label:e.$id}}function hr(e){if(Ke(e)){const n=Array.from(e._s.keys()),r=e._s;return{state:n.map(s=>({editable:!0,key:s,value:e.state.value[s]})),getters:n.filter(s=>r.get(s)._getters).map(s=>{const i=r.get(s);return{editable:!1,key:s,value:i._getters.reduce((a,c)=>(a[c]=i[c],a),{})}})}}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 mr(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:J(e.type),key:J(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function gr(e){switch(e){case Q.direct:return"mutation";case Q.patchFunction:return"$patch";case Q.patchObject:return"$patch";default:return"unknown"}}let pe=!0;const De=[],ce="pinia:mutations",U="pinia",{assign:vr}=Object,Me=e=>"๐ "+e;function yr(e,t){qe({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"&&V("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:ce,label:"Pinia ๐",color:15064968}),n.addInspector({id:U,label:"Pinia ๐",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{cr(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await ur(t),n.sendInspectorTree(U),n.sendInspectorState(U)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{lr(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await dr(t),n.sendInspectorTree(U),n.sendInspectorState(U)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const o=t._s.get(r);o?typeof o.$reset!="function"?V(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),V(`Store "${r}" reset.`)):V(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((r,o)=>{const s=r.componentInstance&&r.componentInstance.proxy;if(s&&s._pStores){const i=r.componentInstance.proxy._pStores;Object.values(i).forEach(a=>{r.instanceData.state.push({type:Me(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:m.toRaw(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((c,u)=>(c[u]=a.$state[u],c),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:Me(a.$id),key:"getters",editable:!1,value:a._getters.reduce((c,u)=>{try{c[u]=a[u]}catch(f){c[u]=f}return c},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===U){let o=[t];o=o.concat(Array.from(t._s.values())),r.rootNodes=(r.filter?o.filter(s=>"$id"in s?s.$id.toLowerCase().includes(r.filter.toLowerCase()):Tt.toLowerCase().includes(r.filter.toLowerCase())):o).map(pr)}}),n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===U){const o=r.nodeId===Qe?t:t._s.get(r.nodeId);if(!o)return;o&&(r.state=hr(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===U){const s=r.nodeId===Qe?t:t._s.get(r.nodeId);if(!s)return V(`store "${r.nodeId}" not found`,"error");const{path:i}=r;Ke(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),pe=!1,r.set(s,i,r.state.value),pe=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("๐")){const o=r.type.replace(/^๐\s*/,""),s=t._s.get(o);if(!s)return V(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return V(`Invalid path for store "${o}":
|
|
6
6
|
${i}
|
|
7
|
-
Only state can be modified.`);i[0]="$state",pe=!1,r.set(s,i,r.state.value),pe=!0}})})}function _r(e,t){De.includes(Me(t.$id))||De.push(Me(t.$id)),qe({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 r=typeof n.now=="function"?n.now.bind(n):Date.now;t.$onAction(({after:i,onError:a,name:c,args:u})=>{const f=Dt++;n.addTimelineEvent({layerId:ce,event:{time:r(),title:"๐ซ "+c,subtitle:"start",data:{store:J(t.$id),action:J(c),args:u},groupId:f}}),i(l=>{re=void 0,n.addTimelineEvent({layerId:ce,event:{time:r(),title:"๐ฌ "+c,subtitle:"end",data:{store:J(t.$id),action:J(c),args:u,result:l},groupId:f}})}),a(l=>{re=void 0,n.addTimelineEvent({layerId:ce,event:{time:r(),logType:"error",title:"๐ฅ "+c,subtitle:"end",data:{store:J(t.$id),action:J(c),args:u,error:l},groupId:f}})})},!0),t._customProperties.forEach(i=>{m.watch(()=>m.unref(t[i]),(a,c)=>{n.notifyComponentUpdate(),n.sendInspectorState(U),pe&&n.addTimelineEvent({layerId:ce,event:{time:r(),title:"Change",subtitle:i,data:{newValue:a,oldValue:c},groupId:re}})},{deep:!0})}),t.$subscribe(({events:i,type:a},c)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(U),!pe)return;const u={time:r(),title:gr(a),data:vr({store:J(t.$id)},mr(i)),groupId:re};a===Q.patchFunction?u.subtitle="โคต๏ธ":a===Q.patchObject?u.subtitle="๐งฉ":i&&!Array.isArray(i)&&(u.subtitle=i.type),i&&(u.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:ce,event:u})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=m.markRaw(i=>{o(i),n.addTimelineEvent({layerId:ce,event:{time:r(),title:"๐ฅ "+t.$id,subtitle:"HMR update",data:{store:J(t.$id),info:J("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(U),n.sendInspectorState(U)});const{$dispose:s}=t;t.$dispose=()=>{s(),n.notifyComponentUpdate(),n.sendInspectorTree(U),n.sendInspectorState(U),n.getSettings().logStoreChanges&&V(`Disposed "${t.$id}" store ๐`)},n.notifyComponentUpdate(),n.sendInspectorTree(U),n.sendInspectorState(U),n.getSettings().logStoreChanges&&V(`"${t.$id}" store installed ๐`)})}let Dt=0,re;function Mt(e,t,n){const r=t.reduce((o,s)=>(o[s]=m.toRaw(e)[s],o),{});for(const o in r)e[o]=function(){const s=Dt,i=n?new Proxy(e,{get(...c){return re=s,Reflect.get(...c)},set(...c){return re=s,Reflect.set(...c)}}):e;re=s;const a=r[o].apply(i,arguments);return re=void 0,a}}function Er({app:e,store:t,options:n}){if(t.$id.startsWith("__hot:"))return;t._isOptionsAPI=!!n.state,Mt(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;m.toRaw(t)._hotUpdate=function(o){r.apply(this,arguments),Mt(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)},_r(e,t)}function wr(){const e=m.effectScope(!0),t=e.run(()=>m.ref({}));let n=[],r=[];const o=m.markRaw({install(s){be(o),o._a=s,s.provide(kt,o),s.config.globalProperties.$pinia=o,Se&&yr(s,o),r.forEach(i=>n.push(i)),r=[]},use(s){return!this._a&&!St?r.push(s):n.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return Se&&typeof Proxy<"u"&&o.use(Er),o}function jt(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const o=e[n];ae(o)&&ae(r)&&!m.isRef(r)&&!m.isReactive(r)?e[n]=jt(o,r):e[n]=r}return e}const Vt=()=>{};function xt(e,t,n,r=Vt){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),r())};return!n&&m.getCurrentScope()&&m.onScopeDispose(o),o}function he(e,...t){e.slice().forEach(n=>{n(...t)})}const br=e=>e();function Ye(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,r)=>e.set(r,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];ae(o)&&ae(r)&&e.hasOwnProperty(n)&&!m.isRef(r)&&!m.isReactive(r)?e[n]=Ye(o,r):e[n]=r}return e}const Sr=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Or(e){return!ae(e)||!e.hasOwnProperty(Sr)}const{assign:z}=Object;function Lt(e){return!!(m.isRef(e)&&e.effect)}function Bt(e,t,n,r){const{state:o,actions:s,getters:i}=t,a=n.state.value[e];let c;function u(){!a&&(process.env.NODE_ENV==="production"||!r)&&(n.state.value[e]=o?o():{});const f=process.env.NODE_ENV!=="production"&&r?m.toRefs(m.ref(o?o():{}).value):m.toRefs(n.state.value[e]);return z(f,s,Object.keys(i||{}).reduce((l,d)=>(process.env.NODE_ENV!=="production"&&d in f&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${d}" in store "${e}".`),l[d]=m.markRaw(m.computed(()=>{be(n);const
|
|
7
|
+
Only state can be modified.`);i[0]="$state",pe=!1,r.set(s,i,r.state.value),pe=!0}})})}function _r(e,t){De.includes(Me(t.$id))||De.push(Me(t.$id)),qe({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 r=typeof n.now=="function"?n.now.bind(n):Date.now;t.$onAction(({after:i,onError:a,name:c,args:u})=>{const f=Dt++;n.addTimelineEvent({layerId:ce,event:{time:r(),title:"๐ซ "+c,subtitle:"start",data:{store:J(t.$id),action:J(c),args:u},groupId:f}}),i(l=>{re=void 0,n.addTimelineEvent({layerId:ce,event:{time:r(),title:"๐ฌ "+c,subtitle:"end",data:{store:J(t.$id),action:J(c),args:u,result:l},groupId:f}})}),a(l=>{re=void 0,n.addTimelineEvent({layerId:ce,event:{time:r(),logType:"error",title:"๐ฅ "+c,subtitle:"end",data:{store:J(t.$id),action:J(c),args:u,error:l},groupId:f}})})},!0),t._customProperties.forEach(i=>{m.watch(()=>m.unref(t[i]),(a,c)=>{n.notifyComponentUpdate(),n.sendInspectorState(U),pe&&n.addTimelineEvent({layerId:ce,event:{time:r(),title:"Change",subtitle:i,data:{newValue:a,oldValue:c},groupId:re}})},{deep:!0})}),t.$subscribe(({events:i,type:a},c)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(U),!pe)return;const u={time:r(),title:gr(a),data:vr({store:J(t.$id)},mr(i)),groupId:re};a===Q.patchFunction?u.subtitle="โคต๏ธ":a===Q.patchObject?u.subtitle="๐งฉ":i&&!Array.isArray(i)&&(u.subtitle=i.type),i&&(u.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:ce,event:u})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=m.markRaw(i=>{o(i),n.addTimelineEvent({layerId:ce,event:{time:r(),title:"๐ฅ "+t.$id,subtitle:"HMR update",data:{store:J(t.$id),info:J("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(U),n.sendInspectorState(U)});const{$dispose:s}=t;t.$dispose=()=>{s(),n.notifyComponentUpdate(),n.sendInspectorTree(U),n.sendInspectorState(U),n.getSettings().logStoreChanges&&V(`Disposed "${t.$id}" store ๐`)},n.notifyComponentUpdate(),n.sendInspectorTree(U),n.sendInspectorState(U),n.getSettings().logStoreChanges&&V(`"${t.$id}" store installed ๐`)})}let Dt=0,re;function Mt(e,t,n){const r=t.reduce((o,s)=>(o[s]=m.toRaw(e)[s],o),{});for(const o in r)e[o]=function(){const s=Dt,i=n?new Proxy(e,{get(...c){return re=s,Reflect.get(...c)},set(...c){return re=s,Reflect.set(...c)}}):e;re=s;const a=r[o].apply(i,arguments);return re=void 0,a}}function Er({app:e,store:t,options:n}){if(t.$id.startsWith("__hot:"))return;t._isOptionsAPI=!!n.state,Mt(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;m.toRaw(t)._hotUpdate=function(o){r.apply(this,arguments),Mt(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)},_r(e,t)}function wr(){const e=m.effectScope(!0),t=e.run(()=>m.ref({}));let n=[],r=[];const o=m.markRaw({install(s){be(o),o._a=s,s.provide(kt,o),s.config.globalProperties.$pinia=o,Se&&yr(s,o),r.forEach(i=>n.push(i)),r=[]},use(s){return!this._a&&!St?r.push(s):n.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return Se&&typeof Proxy<"u"&&o.use(Er),o}function jt(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const o=e[n];ae(o)&&ae(r)&&!m.isRef(r)&&!m.isReactive(r)?e[n]=jt(o,r):e[n]=r}return e}const Vt=()=>{};function xt(e,t,n,r=Vt){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),r())};return!n&&m.getCurrentScope()&&m.onScopeDispose(o),o}function he(e,...t){e.slice().forEach(n=>{n(...t)})}const br=e=>e();function Ye(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,r)=>e.set(r,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];ae(o)&&ae(r)&&e.hasOwnProperty(n)&&!m.isRef(r)&&!m.isReactive(r)?e[n]=Ye(o,r):e[n]=r}return e}const Sr=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Or(e){return!ae(e)||!e.hasOwnProperty(Sr)}const{assign:z}=Object;function Lt(e){return!!(m.isRef(e)&&e.effect)}function Bt(e,t,n,r){const{state:o,actions:s,getters:i}=t,a=n.state.value[e];let c;function u(){!a&&(process.env.NODE_ENV==="production"||!r)&&(n.state.value[e]=o?o():{});const f=process.env.NODE_ENV!=="production"&&r?m.toRefs(m.ref(o?o():{}).value):m.toRefs(n.state.value[e]);return z(f,s,Object.keys(i||{}).reduce((l,d)=>(process.env.NODE_ENV!=="production"&&d in f&&console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with "${d}" in store "${e}".`),l[d]=m.markRaw(m.computed(()=>{be(n);const h=n._s.get(e);return i[d].call(h,h)})),l),{}))}return c=Xe(e,u,t,n,r,!0),c}function Xe(e,t,n={},r,o,s){let i;const a=z({actions:{}},n);if(process.env.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const c={deep:!0};process.env.NODE_ENV!=="production"&&!St&&(c.onTrigger=w=>{u?h=w:u==!1&&!S._hotUpdating&&(Array.isArray(h)?h.push(w):console.error("๐ debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let u,f,l=[],d=[],h;const b=r.state.value[e];!s&&!b&&(process.env.NODE_ENV==="production"||!o)&&(r.state.value[e]={});const y=m.ref({});let k;function A(w){let _;u=f=!1,process.env.NODE_ENV!=="production"&&(h=[]),typeof w=="function"?(w(r.state.value[e]),_={type:Q.patchFunction,storeId:e,events:h}):(Ye(r.state.value[e],w),_={type:Q.patchObject,payload:w,storeId:e,events:h});const T=k=Symbol();m.nextTick().then(()=>{k===T&&(u=!0)}),f=!0,he(l,_,r.state.value[e])}const N=s?function(){const{state:_}=n,T=_?_():{};this.$patch(j=>{z(j,T)})}:process.env.NODE_ENV!=="production"?()=>{throw new Error(`๐: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:Vt;function R(){i.stop(),l=[],d=[],r._s.delete(e)}function L(w,_){return function(){be(r);const T=Array.from(arguments),j=[],le=[];function $e(H){j.push(H)}function He(H){le.push(H)}he(d,{args:T,name:w,store:S,after:$e,onError:He});let Y;try{Y=_.apply(this&&this.$id===e?this:S,T)}catch(H){throw he(le,H),H}return Y instanceof Promise?Y.then(H=>(he(j,H),H)).catch(H=>(he(le,H),Promise.reject(H))):(he(j,Y),Y)}}const F=m.markRaw({actions:{},getters:{},state:[],hotState:y}),K={_p:r,$id:e,$onAction:xt.bind(null,d),$patch:A,$reset:N,$subscribe(w,_={}){const T=xt(l,w,_.detached,()=>j()),j=i.run(()=>m.watch(()=>r.state.value[e],le=>{(_.flush==="sync"?f:u)&&w({storeId:e,type:Q.direct,events:h},le)},z({},c,_)));return T},$dispose:R},S=m.reactive(process.env.NODE_ENV!=="production"||Se?z({_hmrPayload:F,_customProperties:m.markRaw(new Set)},K):K);r._s.set(e,S);const q=(r._a&&r._a.runWithContext||br)(()=>r._e.run(()=>(i=m.effectScope()).run(t)));for(const w in q){const _=q[w];if(m.isRef(_)&&!Lt(_)||m.isReactive(_))process.env.NODE_ENV!=="production"&&o?Ie(y.value,w,m.toRef(q,w)):s||(b&&Or(_)&&(m.isRef(_)?_.value=b[w]:Ye(_,b[w])),r.state.value[e][w]=_),process.env.NODE_ENV!=="production"&&F.state.push(w);else if(typeof _=="function"){const T=process.env.NODE_ENV!=="production"&&o?_:L(w,_);q[w]=T,process.env.NODE_ENV!=="production"&&(F.actions[w]=_),a.actions[w]=_}else process.env.NODE_ENV!=="production"&&Lt(_)&&(F.getters[w]=s?n.getters[w]:_,Ce&&(q._getters||(q._getters=m.markRaw([]))).push(w))}if(z(S,q),z(m.toRaw(S),q),Object.defineProperty(S,"$state",{get:()=>process.env.NODE_ENV!=="production"&&o?y.value:r.state.value[e],set:w=>{if(process.env.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");A(_=>{z(_,w)})}}),process.env.NODE_ENV!=="production"&&(S._hotUpdate=m.markRaw(w=>{S._hotUpdating=!0,w._hmrPayload.state.forEach(_=>{if(_ in S.$state){const T=w.$state[_],j=S.$state[_];typeof T=="object"&&ae(T)&&ae(j)?jt(T,j):w.$state[_]=j}Ie(S,_,m.toRef(w.$state,_))}),Object.keys(S.$state).forEach(_=>{_ in w.$state||We(S,_)}),u=!1,f=!1,r.state.value[e]=m.toRef(w._hmrPayload,"hotState"),f=!0,m.nextTick().then(()=>{u=!0});for(const _ in w._hmrPayload.actions){const T=w[_];Ie(S,_,L(_,T))}for(const _ in w._hmrPayload.getters){const T=w._hmrPayload.getters[_],j=s?m.computed(()=>(be(r),T.call(S,S))):T;Ie(S,_,j)}Object.keys(S._hmrPayload.getters).forEach(_=>{_ in w._hmrPayload.getters||We(S,_)}),Object.keys(S._hmrPayload.actions).forEach(_=>{_ in w._hmrPayload.actions||We(S,_)}),S._hmrPayload=w._hmrPayload,S._getters=w._getters,S._hotUpdating=!1})),Se){const w={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(_=>{Object.defineProperty(S,_,z({value:S[_]},w))})}return r._p.forEach(w=>{if(Se){const _=i.run(()=>w({store:S,app:r._a,pinia:r,options:a}));Object.keys(_||{}).forEach(T=>S._customProperties.add(T)),z(S,_)}else z(S,i.run(()=>w({store:S,app:r._a,pinia:r,options:a})))}),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
8
|
state: () => new MyClass()
|
|
9
|
-
Found in store "${S.$id}".`),b&&s&&n.hydrate&&n.hydrate(S.$state,b),u=!0,f=!0,S}function kr(e,t,n){let r,o;const s=typeof t=="function";
|
|
9
|
+
Found in store "${S.$id}".`),b&&s&&n.hydrate&&n.hydrate(S.$state,b),u=!0,f=!0,S}function kr(e,t,n){let r,o;const s=typeof t=="function";r=e,o=s?n:t;function i(a,c){const u=m.hasInjectionContext();if(a=(process.env.NODE_ENV==="test"&&we&&we._testing?null:a)||(u?m.inject(kt,null):null),a&&be(a),process.env.NODE_ENV!=="production"&&!we)throw new Error(`[๐]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
10
10
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
11
|
-
This will fail in production.`);a=we,a._s.has(r)||(s?Xe(r,t,o,a):Bt(r,o,a),process.env.NODE_ENV!=="production"&&(i._pinia=a));const f=a._s.get(r);if(process.env.NODE_ENV!=="production"&&c){const l="__hot:"+r,d=s?Xe(l,t,o,a,!0):Bt(l,z({},o),a,!0);c._hotUpdate(d),delete a.state.value[l],a._s.delete(l)}if(process.env.NODE_ENV!=="production"&&Ce){const l=m.getCurrentInstance();if(l&&l.proxy&&!c){const d=l.proxy,
|
|
11
|
+
This will fail in production.`);a=we,a._s.has(r)||(s?Xe(r,t,o,a):Bt(r,o,a),process.env.NODE_ENV!=="production"&&(i._pinia=a));const f=a._s.get(r);if(process.env.NODE_ENV!=="production"&&c){const l="__hot:"+r,d=s?Xe(l,t,o,a,!0):Bt(l,z({},o),a,!0);c._hotUpdate(d),delete a.state.value[l],a._s.delete(l)}if(process.env.NODE_ENV!=="production"&&Ce){const l=m.getCurrentInstance();if(l&&l.proxy&&!c){const d=l.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[r]=f}}return f}return i.$id=r,i}const Pr=kr("data",()=>{const e=m.ref([]),t=m.ref({});return{records:e,record:t}});function Nr(e){e||(e=m.inject("$registry"));const t=Pr(),n=m.ref(new Ge(e,t)),r=m.ref(!1);return m.onBeforeMount(async()=>{var c,u;const o=e.router.currentRoute.value,s=(c=o.params.records)==null?void 0:c.toString().toLowerCase(),i=(u=o.params.record)==null?void 0:u.toString().toLowerCase();if(!s&&!i)return;const a=await e.getMeta(s);e.addDoctype(a),n.value.setup(a),s&&(i?await n.value.getRecord(a,i):await n.value.getRecords(a)),n.value.runAction(a,"LOAD",i?[i]:void 0),r.value=!0}),{stonecrop:n,isReady:r}}class Rr{constructor(t,n,r,o,s){x(this,"doctype");x(this,"schema");x(this,"workflow");x(this,"actions");x(this,"component");this.doctype=t,this.schema=n,this.workflow=r,this.actions=o,this.component=s}get slug(){return this.doctype.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}get __typename(){return this.doctype}}const _e=class _e{constructor(t,n){x(this,"name");x(this,"router");x(this,"registry");x(this,"getMeta");if(_e._root)return _e._root;_e._root=this,this.name="Registry",this.router=t,this.registry={},this.getMeta=n}addDoctype(t){t.doctype in Object.keys(this.registry)||(this.registry[t.slug]=t),this.router.hasRoute(t.doctype)||this.router.addRoute({path:`/${t.slug}`,name:t.slug,component:t.component})}};x(_e,"_root");let je=_e;/*!
|
|
12
12
|
* vue-router v4.4.0
|
|
13
13
|
* (c) 2024 Eduardo San Martin Morote
|
|
14
14
|
* @license MIT
|
|
15
|
-
*/const Z=typeof document<"u";function $r(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const I=Object.assign;function Ze(e,t){const n={};for(const r in t){const o=t[r];n[r]=W(o)?o.map(e):e(o)}return n}const Oe=()=>{},W=Array.isArray;function O(e){const t=Array.from(arguments).slice(1);console.warn.apply(console,["[Vue Router warn]: "+e].concat(t))}const Ut=/#/g,Ir=/&/g,Cr=/\//g,Ar=/=/g,Tr=/\?/g,Ht=/\+/g,Dr=/%5B/g,Mr=/%5D/g,Ft=/%5E/g,jr=/%60/g,Gt=/%7B/g,Vr=/%7C/g,Wt=/%7D/g,xr=/%20/g;function et(e){return encodeURI(""+e).replace(Vr,"|").replace(Dr,"[").replace(Mr,"]")}function Lr(e){return et(e).replace(Gt,"{").replace(Wt,"}").replace(Ft,"^")}function tt(e){return et(e).replace(Ht,"%2B").replace(xr,"+").replace(Ut,"%23").replace(Ir,"%26").replace(jr,"`").replace(Gt,"{").replace(Wt,"}").replace(Ft,"^")}function Br(e){return tt(e).replace(Ar,"%3D")}function Ur(e){return et(e).replace(Ut,"%23").replace(Tr,"%3F")}function Hr(e){return e==null?"":Ur(e).replace(Cr,"%2F")}function me(e){try{return decodeURIComponent(""+e)}catch{process.env.NODE_ENV!=="production"&&O(`Error decoding "${e}". Using original value`)}return""+e}const Fr=/\/$/,Gr=e=>e.replace(Fr,"");function nt(e,t,n="/"){let r,o={},s="",i="";const a=t.indexOf("#");let c=t.indexOf("?");return a<c&&a>=0&&(c=-1),c>-1&&(r=t.slice(0,c),s=t.slice(c+1,a>-1?a:t.length),o=e(s)),a>-1&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=qr(r??t,n),{fullPath:r+(s&&"?")+s+i,path:r,query:o,hash:me(i)}}function Wr(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function zt(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function qt(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&oe(t.matched[r],n.matched[o])&&Jt(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function oe(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Jt(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!zr(e[n],t[n]))return!1;return!0}function zr(e,t){return W(e)?Kt(e,t):W(t)?Kt(t,e):e===t}function Kt(e,t){return W(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function qr(e,t){if(e.startsWith("/"))return e;if(process.env.NODE_ENV!=="production"&&!t.startsWith("/"))return O(`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("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(i).join("/")}const se={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var ke;(function(e){e.pop="pop",e.push="push"})(ke||(ke={}));var
|
|
15
|
+
*/const Z=typeof document<"u";function $r(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const I=Object.assign;function Ze(e,t){const n={};for(const r in t){const o=t[r];n[r]=W(o)?o.map(e):e(o)}return n}const Oe=()=>{},W=Array.isArray;function O(e){const t=Array.from(arguments).slice(1);console.warn.apply(console,["[Vue Router warn]: "+e].concat(t))}const Ut=/#/g,Ir=/&/g,Cr=/\//g,Ar=/=/g,Tr=/\?/g,Ht=/\+/g,Dr=/%5B/g,Mr=/%5D/g,Ft=/%5E/g,jr=/%60/g,Gt=/%7B/g,Vr=/%7C/g,Wt=/%7D/g,xr=/%20/g;function et(e){return encodeURI(""+e).replace(Vr,"|").replace(Dr,"[").replace(Mr,"]")}function Lr(e){return et(e).replace(Gt,"{").replace(Wt,"}").replace(Ft,"^")}function tt(e){return et(e).replace(Ht,"%2B").replace(xr,"+").replace(Ut,"%23").replace(Ir,"%26").replace(jr,"`").replace(Gt,"{").replace(Wt,"}").replace(Ft,"^")}function Br(e){return tt(e).replace(Ar,"%3D")}function Ur(e){return et(e).replace(Ut,"%23").replace(Tr,"%3F")}function Hr(e){return e==null?"":Ur(e).replace(Cr,"%2F")}function me(e){try{return decodeURIComponent(""+e)}catch{process.env.NODE_ENV!=="production"&&O(`Error decoding "${e}". Using original value`)}return""+e}const Fr=/\/$/,Gr=e=>e.replace(Fr,"");function nt(e,t,n="/"){let r,o={},s="",i="";const a=t.indexOf("#");let c=t.indexOf("?");return a<c&&a>=0&&(c=-1),c>-1&&(r=t.slice(0,c),s=t.slice(c+1,a>-1?a:t.length),o=e(s)),a>-1&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=qr(r??t,n),{fullPath:r+(s&&"?")+s+i,path:r,query:o,hash:me(i)}}function Wr(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function zt(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function qt(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&oe(t.matched[r],n.matched[o])&&Jt(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function oe(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Jt(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!zr(e[n],t[n]))return!1;return!0}function zr(e,t){return W(e)?Kt(e,t):W(t)?Kt(t,e):e===t}function Kt(e,t){return W(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function qr(e,t){if(e.startsWith("/"))return e;if(process.env.NODE_ENV!=="production"&&!t.startsWith("/"))return O(`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("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(i).join("/")}const se={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var ke;(function(e){e.pop="pop",e.push="push"})(ke||(ke={}));var Pe;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Pe||(Pe={}));function Jr(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),Gr(e)}const Kr=/^[^#]+#/;function Qr(e,t){return e.replace(Kr,"#")+t}function Yr(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Ve=()=>({left:window.scrollX,top:window.scrollY});function Xr(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#");if(process.env.NODE_ENV!=="production"&&typeof e.el=="string"&&(!r||!document.getElementById(e.el.slice(1))))try{const s=document.querySelector(e.el);if(r&&s){O(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);return}}catch{O(`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 o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o){process.env.NODE_ENV!=="production"&&O(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);return}t=Yr(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Qt(e,t){return(history.state?history.state.position-t:-1)+e}const rt=new Map;function Zr(e,t){rt.set(e,t)}function eo(e){const t=rt.get(e);return rt.delete(e),t}let to=()=>location.protocol+"//"+location.host;function Yt(e,t){const{pathname:n,search:r,hash:o}=t,s=e.indexOf("#");if(s>-1){let a=o.includes(e.slice(s))?e.slice(s).length:1,c=o.slice(a);return c[0]!=="/"&&(c="/"+c),zt(c,"")}return zt(n,e)+r+o}function no(e,t,n,r){let o=[],s=[],i=null;const a=({state:d})=>{const h=Yt(e,location),b=n.value,y=t.value;let k=0;if(d){if(n.value=h,t.value=d,i&&i===b){i=null;return}k=y?d.position-y.position:0}else r(h);o.forEach(A=>{A(n.value,b,{delta:k,type:ke.pop,direction:k?k>0?Pe.forward:Pe.back:Pe.unknown})})};function c(){i=n.value}function u(d){o.push(d);const h=()=>{const b=o.indexOf(d);b>-1&&o.splice(b,1)};return s.push(h),h}function f(){const{history:d}=window;d.state&&d.replaceState(I({},d.state,{scroll:Ve()}),"")}function l(){for(const d of s)d();s=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",f)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",f,{passive:!0}),{pauseListeners:c,listen:u,destroy:l}}function Xt(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?Ve():null}}function ro(e){const{history:t,location:n}=window,r={value:Yt(e,n)},o={value:t.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(c,u,f){const l=e.indexOf("#"),d=l>-1?(n.host&&document.querySelector("base")?e:e.slice(l))+c:to()+e+c;try{t[f?"replaceState":"pushState"](u,"",d),o.value=u}catch(h){process.env.NODE_ENV!=="production"?O("Error with push/replace State",h):console.error(h),n[f?"replace":"assign"](d)}}function i(c,u){const f=I({},t.state,Xt(o.value.back,c,o.value.forward,!0),u,{position:o.value.position});s(c,f,!0),r.value=c}function a(c,u){const f=I({},o.value,t.state,{forward:c,scroll:Ve()});process.env.NODE_ENV!=="production"&&!t.state&&O(`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
16
|
|
|
17
17
|
history.replaceState(history.state, '', url)
|
|
18
18
|
|
|
19
19
|
You can find more information at https://next.router.vuejs.org/guide/migration/#usage-of-history-state.`),s(f.current,f,!0);const l=I({},Xt(r.value,c,null),{position:f.position+1},u);s(c,l,!1),r.value=c}return{location:r,state:o,push:a,replace:i}}function oo(e){e=Jr(e);const t=ro(e),n=no(e,t.state,t.location,t.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=I({location:"",base:e,go:r,createHref:Qr.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function xe(e){return typeof e=="string"||e&&typeof e=="object"}function Zt(e){return typeof e=="string"||typeof e=="symbol"}const ot=Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var en;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(en||(en={}));const so={1({location:e,currentLocation:t}){return`No match for
|
|
20
20
|
${JSON.stringify(e)}${t?`
|
|
21
21
|
while being at
|
|
22
|
-
`+JSON.stringify(t):""}`},2({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${ao(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"?I(new Error(so[e](t)),{type:e,[ot]:!0},t):I(new Error,{type:e,[ot]:!0},t)}function ee(e,t){return e instanceof Error&&ot in e&&(t==null||!!(e.type&t))}const io=["params","query","hash"];function ao(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of io)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const tn="[^/]+?",co={sensitive:!1,strict:!1,start:!0,end:!0},uo=/[.+*?^${}()[\]/\\]/g;function lo(e,t){const n=I({},co,t),r=[];let o=n.start?"^":"";const s=[];for(const u of e){const f=u.length?[]:[90];n.strict&&!u.length&&(o+="/");for(let l=0;l<u.length;l++){const d=u[l];let
|
|
23
|
-
See more at https://next.router.vuejs.org/guide/migration/#removed-star-or-catch-all-routes.`);if(
|
|
22
|
+
`+JSON.stringify(t):""}`},2({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${ao(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"?I(new Error(so[e](t)),{type:e,[ot]:!0},t):I(new Error,{type:e,[ot]:!0},t)}function ee(e,t){return e instanceof Error&&ot in e&&(t==null||!!(e.type&t))}const io=["params","query","hash"];function ao(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of io)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const tn="[^/]+?",co={sensitive:!1,strict:!1,start:!0,end:!0},uo=/[.+*?^${}()[\]/\\]/g;function lo(e,t){const n=I({},co,t),r=[];let o=n.start?"^":"";const s=[];for(const u of e){const f=u.length?[]:[90];n.strict&&!u.length&&(o+="/");for(let l=0;l<u.length;l++){const d=u[l];let h=40+(n.sensitive?.25:0);if(d.type===0)l||(o+="/"),o+=d.value.replace(uo,"\\$&"),h+=40;else if(d.type===1){const{value:b,repeatable:y,optional:k,regexp:A}=d;s.push({name:b,repeatable:y,optional:k});const N=A||tn;if(N!==tn){h+=10;try{new RegExp(`(${N})`)}catch(L){throw new Error(`Invalid custom RegExp for param "${b}" (${N}): `+L.message)}}let R=y?`((?:${N})(?:/(?:${N}))*)`:`(${N})`;l||(R=k&&u.length<2?`(?:/${R})`:"/"+R),k&&(R+="?"),o+=R,h+=20,k&&(h+=-8),y&&(h+=-20),N===".*"&&(h+=-50)}f.push(h)}r.push(f)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(u){const f=u.match(i),l={};if(!f)return null;for(let d=1;d<f.length;d++){const h=f[d]||"",b=s[d-1];l[b.name]=h&&b.repeatable?h.split("/"):h}return l}function c(u){let f="",l=!1;for(const d of e){(!l||!f.endsWith("/"))&&(f+="/"),l=!1;for(const h of d)if(h.type===0)f+=h.value;else if(h.type===1){const{value:b,repeatable:y,optional:k}=h,A=b in u?u[b]:"";if(W(A)&&!y)throw new Error(`Provided param "${b}" is an array but it is not repeatable (* or + modifiers)`);const N=W(A)?A.join("/"):A;if(!N)if(k)d.length<2&&(f.endsWith("/")?f=f.slice(0,-1):l=!0);else throw new Error(`Missing required param "${b}"`);f+=N}}return f||"/"}return{re:i,score:r,keys:s,parse:a,stringify:c}}function fo(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function nn(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const s=fo(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(rn(r))return 1;if(rn(o))return-1}return o.length-r.length}function rn(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const po={type:0,value:""},ho=/[a-zA-Z0-9_]/;function mo(e){if(!e)return[[]];if(e==="/")return[[po]];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})/"${u}": ${h}`)}let n=0,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let a=0,c,u="",f="";function l(){u&&(n===0?s.push({type:0,value:u}):n===1||n===2||n===3?(s.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:u,regexp:f,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),u="")}function d(){u+=c}for(;a<e.length;){if(c=e[a++],c==="\\"&&n!==2){r=n,n=4;continue}switch(n){case 0:c==="/"?(u&&l(),i()):c===":"?(l(),n=1):d();break;case 4:d(),n=r;break;case 1:c==="("?n=2:ho.test(c)?d():(l(),n=0,c!=="*"&&c!=="?"&&c!=="+"&&a--);break;case 2:c===")"?f[f.length-1]=="\\"?f=f.slice(0,-1)+c:n=3:f+=c;break;case 3:l(),n=0,c!=="*"&&c!=="?"&&c!=="+"&&a--,f="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${u}"`),l(),i(),o}function go(e,t,n){const r=lo(mo(e.path),n);if(process.env.NODE_ENV!=="production"){const s=new Set;for(const i of r.keys)s.has(i.name)&&O(`Found duplicated params with name "${i.name}" for path "${e.path}". Only the last one will be available on "$route.params".`),s.add(i.name)}const o=I(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function vo(e,t){const n=[],r=new Map;t=an({strict:!1,end:!0,sensitive:!1},t);function o(l){return r.get(l)}function s(l,d,h){const b=!h,y=yo(l);process.env.NODE_ENV!=="production"&&bo(y,d),y.aliasOf=h&&h.record;const k=an(t,l),A=[y];if("alias"in l){const L=typeof l.alias=="string"?[l.alias]:l.alias;for(const F of L)A.push(I({},y,{components:h?h.record.components:y.components,path:F,aliasOf:h?h.record:y}))}let N,R;for(const L of A){const{path:F}=L;if(d&&F[0]!=="/"){const K=d.record.path,S=K[K.length-1]==="/"?"":"/";L.path=d.record.path+(F&&S+F)}if(process.env.NODE_ENV!=="production"&&L.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(N=go(L,d,k),process.env.NODE_ENV!=="production"&&d&&F[0]==="/"&&So(N,d),h?(h.alias.push(N),process.env.NODE_ENV!=="production"&&wo(h,N)):(R=R||N,R!==N&&R.alias.push(N),b&&l.name&&!sn(N)&&i(l.name)),cn(N)&&c(N),y.children){const K=y.children;for(let S=0;S<K.length;S++)s(K[S],N,h&&h.children[S])}h=h||N}return R?()=>{i(R)}:Oe}function i(l){if(Zt(l)){const d=r.get(l);d&&(r.delete(l),n.splice(n.indexOf(d),1),d.children.forEach(i),d.alias.forEach(i))}else{const d=n.indexOf(l);d>-1&&(n.splice(d,1),l.record.name&&r.delete(l.record.name),l.children.forEach(i),l.alias.forEach(i))}}function a(){return n}function c(l){const d=Oo(l,n);n.splice(d,0,l),l.record.name&&!sn(l)&&r.set(l.record.name,l)}function u(l,d){let h,b={},y,k;if("name"in l&&l.name){if(h=r.get(l.name),!h)throw ge(1,{location:l});if(process.env.NODE_ENV!=="production"){const R=Object.keys(l.params||{}).filter(L=>!h.keys.find(F=>F.name===L));R.length&&O(`Discarded invalid param(s) "${R.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}k=h.record.name,b=I(on(d.params,h.keys.filter(R=>!R.optional).concat(h.parent?h.parent.keys.filter(R=>R.optional):[]).map(R=>R.name)),l.params&&on(l.params,h.keys.map(R=>R.name))),y=h.stringify(b)}else if(l.path!=null)y=l.path,process.env.NODE_ENV!=="production"&&!y.startsWith("/")&&O(`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.`),h=n.find(R=>R.re.test(y)),h&&(b=h.parse(y),k=h.record.name);else{if(h=d.name?r.get(d.name):n.find(R=>R.re.test(d.path)),!h)throw ge(1,{location:l,currentLocation:d});k=h.record.name,b=I({},d.params,l.params),y=h.stringify(b)}const A=[];let N=h;for(;N;)A.unshift(N.record),N=N.parent;return{name:k,path:y,params:b,matched:A,meta:Eo(A)}}e.forEach(l=>s(l));function f(){n.length=0,r.clear()}return{addRoute:s,resolve:u,removeRoute:i,clearRoutes:f,getRoutes:a,getRecordMatcher:o}}function on(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function yo(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:_o(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 _o(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function sn(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Eo(e){return e.reduce((t,n)=>I(t,n.meta),{})}function an(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function st(e,t){return e.name===t.name&&e.optional===t.optional&&e.repeatable===t.repeatable}function wo(e,t){for(const n of e.keys)if(!n.optional&&!t.keys.find(st.bind(null,n)))return O(`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(st.bind(null,n)))return O(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`)}function bo(e,t){t&&t.record.name&&!e.name&&!e.path&&O(`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 So(e,t){for(const n of t.keys)if(!e.keys.find(st.bind(null,n)))return O(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`)}function Oo(e,t){let n=0,r=t.length;for(;n!==r;){const s=n+r>>1;nn(e,t[s])<0?r=s:n=s+1}const o=ko(e);return o&&(r=t.lastIndexOf(o,r-1),process.env.NODE_ENV!=="production"&&r<0&&O(`Finding ancestor route "${o.record.path}" failed for "${e.record.path}"`)),r}function ko(e){let t=e;for(;t=t.parent;)if(cn(t)&&nn(e,t)===0)return t}function cn({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Po(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;o<r.length;++o){const s=r[o].replace(Ht," "),i=s.indexOf("="),a=me(i<0?s:s.slice(0,i)),c=i<0?null:me(s.slice(i+1));if(a in t){let u=t[a];W(u)||(u=t[a]=[u]),u.push(c)}else t[a]=c}return t}function un(e){let t="";for(let n in e){const r=e[n];if(n=Br(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(W(r)?r.map(s=>s&&tt(s)):[r&&tt(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function No(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=W(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const Ro=Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),ln=Symbol(process.env.NODE_ENV!=="production"?"router view depth":""),it=Symbol(process.env.NODE_ENV!=="production"?"router":""),fn=Symbol(process.env.NODE_ENV!=="production"?"route location":""),at=Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Ne(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function ie(e,t,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,c)=>{const u=d=>{d===!1?c(ge(4,{from:n,to:t})):d instanceof Error?c(d):xe(d)?c(ge(2,{from:t,to:d})):(i&&r.enterCallbacks[o]===i&&typeof d=="function"&&i.push(d),a())},f=s(()=>e.call(r&&r.instances[o],t,n,process.env.NODE_ENV!=="production"?$o(u,t,n):u));let l=Promise.resolve(f);if(e.length<3&&(l=l.then(u)),process.env.NODE_ENV!=="production"&&e.length>2){const d=`The "next" callback was never called inside of ${e.name?'"'+e.name+'"':""}:
|
|
24
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 f=="object"&&"then"in f)l=l.then(
|
|
25
|
+
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof f=="object"&&"then"in f)l=l.then(h=>u._called?h:(O(d),Promise.reject(new Error("Invalid navigation guard"))));else if(f!==void 0&&!u._called){O(d),c(new Error("Invalid navigation guard"));return}}l.catch(d=>c(d))})}function $o(e,t,n){let r=0;return function(){r++===1&&O(`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,r===1&&e.apply(null,arguments)}}function ct(e,t,n,r,o=s=>s()){const s=[];for(const i of e){process.env.NODE_ENV!=="production"&&!i.components&&!i.children.length&&O(`Record with path "${i.path}" is either missing a "component(s)" or "children" property.`);for(const a in i.components){let c=i.components[a];if(process.env.NODE_ENV!=="production"){if(!c||typeof c!="object"&&typeof c!="function")throw O(`Component "${a}" in record with path "${i.path}" is not a valid component. Received "${String(c)}".`),new Error("Invalid route component");if("then"in c){O(`Component "${a}" in record with path "${i.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=c;c=()=>u}else c.__asyncLoader&&!c.__warnedDefineAsync&&(c.__warnedDefineAsync=!0,O(`Component "${a}" in record with path "${i.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(Io(c)){const f=(c.__vccOpts||c)[t];f&&s.push(ie(f,n,r,i,a,o))}else{let u=c();process.env.NODE_ENV!=="production"&&!("catch"in u)&&(O(`Component "${a}" in record with path "${i.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)),s.push(()=>u.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${i.path}"`));const l=$r(f)?f.default:f;i.components[a]=l;const h=(l.__vccOpts||l)[t];return h&&ie(h,n,r,i,a,o)()}))}}}return s}function Io(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function dn(e){const t=m.inject(it),n=m.inject(fn);let r=!1,o=null;const s=m.computed(()=>{const f=m.unref(e.to);return process.env.NODE_ENV!=="production"&&(!r||f!==o)&&(xe(f)||(r?O(`Invalid value for prop "to" in useLink()
|
|
26
26
|
- to:`,f,`
|
|
27
27
|
- previous to:`,o,`
|
|
28
28
|
- props:`,e):O(`Invalid value for prop "to" in useLink()
|
|
29
29
|
- to:`,f,`
|
|
30
|
-
- props:`,e)),o=f,r=!0),t.resolve(f)}),i=m.computed(()=>{const{matched:f}=s.value,{length:l}=f,d=f[l-1],
|
|
30
|
+
- props:`,e)),o=f,r=!0),t.resolve(f)}),i=m.computed(()=>{const{matched:f}=s.value,{length:l}=f,d=f[l-1],h=n.matched;if(!d||!h.length)return-1;const b=h.findIndex(oe.bind(null,d));if(b>-1)return b;const y=pn(f[l-2]);return l>1&&pn(d)===y&&h[h.length-1].path!==y?h.findIndex(oe.bind(null,f[l-2])):b}),a=m.computed(()=>i.value>-1&&To(n.params,s.value.params)),c=m.computed(()=>i.value>-1&&i.value===n.matched.length-1&&Jt(n.params,s.value.params));function u(f={}){return Ao(f)?t[m.unref(e.replace)?"replace":"push"](m.unref(e.to)).catch(Oe):Promise.resolve()}if(process.env.NODE_ENV!=="production"&&Z){const f=m.getCurrentInstance();if(f){const l={route:s.value,isActive:a.value,isExactActive:c.value,error:null};f.__vrl_devtools=f.__vrl_devtools||[],f.__vrl_devtools.push(l),m.watchEffect(()=>{l.route=s.value,l.isActive=a.value,l.isExactActive=c.value,l.error=xe(m.unref(e.to))?null:'Invalid "to" value'},{flush:"post"})}}return{route:s,href:m.computed(()=>s.value.href),isActive:a,isExactActive:c,navigate:u}}const Co=m.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:dn,setup(e,{slots:t}){const n=m.reactive(dn(e)),{options:r}=m.inject(it),o=m.computed(()=>({[hn(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[hn(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&t.default(n);return e.custom?s:m.h("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}});function Ao(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 To(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!W(o)||o.length!==r.length||r.some((s,i)=>s!==o[i]))return!1}return!0}function pn(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const hn=(e,t,n)=>e??t??n,Do=m.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"&&jo();const r=m.inject(at),o=m.computed(()=>e.route||r.value),s=m.inject(ln,0),i=m.computed(()=>{let u=m.unref(s);const{matched:f}=o.value;let l;for(;(l=f[u])&&!l.components;)u++;return u}),a=m.computed(()=>o.value.matched[i.value]);m.provide(ln,m.computed(()=>i.value+1)),m.provide(Ro,a),m.provide(at,o);const c=m.ref();return m.watch(()=>[c.value,a.value,e.name],([u,f,l],[d,h,b])=>{f&&(f.instances[l]=u,h&&h!==f&&u&&u===d&&(f.leaveGuards.size||(f.leaveGuards=h.leaveGuards),f.updateGuards.size||(f.updateGuards=h.updateGuards))),u&&f&&(!h||!oe(f,h)||!d)&&(f.enterCallbacks[l]||[]).forEach(y=>y(u))},{flush:"post"}),()=>{const u=o.value,f=e.name,l=a.value,d=l&&l.components[f];if(!d)return mn(n.default,{Component:d,route:u});const h=l.props[f],b=h?h===!0?u.params:typeof h=="function"?h(u):h:null,y=A=>{A.component.isUnmounted&&(l.instances[f]=null)},k=m.h(d,I({},b,t,{onVnodeUnmounted:y,ref:c}));if(process.env.NODE_ENV!=="production"&&Z&&k.ref){const A={depth:i.value,name:l.name,path:l.path,meta:l.meta};(W(k.ref)?k.ref.map(R=>R.i):[k.ref.i]).forEach(R=>{R.__vrv_devtools=A})}return mn(n.default,{Component:k,route:u})||k}}});function mn(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Mo=Do;function jo(){const e=m.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 r=t==="KeepAlive"?"keep-alive":"transition";O(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
|
|
31
31
|
Use slot props instead:
|
|
32
32
|
|
|
33
33
|
<router-view v-slot="{ Component }">
|
|
34
34
|
<${r}>
|
|
35
35
|
<component :is="Component" />
|
|
36
36
|
</${r}>
|
|
37
|
-
</router-view>`)}}function Re(e,t){const n=I({},e,{matched:e.matched.map(r=>qo(r,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function Le(e){return{_custom:{display:e}}}let Vo=0;function xo(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const r=Vo++;qe({id:"org.vuejs.router"+(r?"."+r:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:e},o=>{typeof o.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."),o.on.inspectComponent((f,l)=>{f.instanceData&&f.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:Re(t.currentRoute.value,"Current Route")})}),o.on.visitComponentTree(({treeNode:f,componentInstance:l})=>{if(l.__vrv_devtools){const d=l.__vrv_devtools;f.tags.push({label:(d.name?`${d.name.toString()}: `:"")+d.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:gn})}W(l.__vrl_devtools)&&(l.__devtoolsApi=o,l.__vrl_devtools.forEach(d=>{let
|
|
38
|
-
- Location:`,
|
|
37
|
+
</router-view>`)}}function Re(e,t){const n=I({},e,{matched:e.matched.map(r=>qo(r,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function Le(e){return{_custom:{display:e}}}let Vo=0;function xo(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const r=Vo++;qe({id:"org.vuejs.router"+(r?"."+r:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:e},o=>{typeof o.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."),o.on.inspectComponent((f,l)=>{f.instanceData&&f.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:Re(t.currentRoute.value,"Current Route")})}),o.on.visitComponentTree(({treeNode:f,componentInstance:l})=>{if(l.__vrv_devtools){const d=l.__vrv_devtools;f.tags.push({label:(d.name?`${d.name.toString()}: `:"")+d.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:gn})}W(l.__vrl_devtools)&&(l.__devtoolsApi=o,l.__vrl_devtools.forEach(d=>{let h=d.route.path,b=_n,y="",k=0;d.error?(h=d.error,b=Fo,k=Go):d.isExactActive?(b=yn,y="This is exactly active"):d.isActive&&(b=vn,y="This link is active"),f.tags.push({label:h,textColor:k,tooltip:y,backgroundColor:b})}))}),m.watch(t.currentRoute,()=>{c(),o.notifyComponentUpdate(),o.sendInspectorTree(a),o.sendInspectorState(a)});const s="router:navigations:"+r;o.addTimelineLayer({id:s,label:`Router${r?" "+r:""} Navigations`,color:4237508}),t.onError((f,l)=>{o.addTimelineEvent({layerId:s,event:{title:"Error during Navigation",subtitle:l.fullPath,logType:"error",time:o.now(),data:{error:f},groupId:l.meta.__navigationId}})});let i=0;t.beforeEach((f,l)=>{const d={guard:Le("beforeEach"),from:Re(l,"Current Location during this navigation"),to:Re(f,"Target location")};Object.defineProperty(f.meta,"__navigationId",{value:i++}),o.addTimelineEvent({layerId:s,event:{time:o.now(),title:"Start of navigation",subtitle:f.fullPath,data:d,groupId:f.meta.__navigationId}})}),t.afterEach((f,l,d)=>{const h={guard:Le("afterEach")};d?(h.failure={_custom:{type:Error,readOnly:!0,display:d?d.message:"",tooltip:"Navigation Failure",value:d}},h.status=Le("โ")):h.status=Le("โ
"),h.from=Re(l,"Current Location during this navigation"),h.to=Re(f,"Target location"),o.addTimelineEvent({layerId:s,event:{title:"End of navigation",subtitle:f.fullPath,time:o.now(),data:h,logType:d?"warning":"default",groupId:f.meta.__navigationId}})});const a="router-inspector:"+r;o.addInspector({id:a,label:"Routes"+(r?" "+r:""),icon:"book",treeFilterPlaceholder:"Search routes"});function c(){if(!u)return;const f=u;let l=n.getRoutes().filter(d=>!d.parent||!d.parent.record.components);l.forEach(bn),f.filter&&(l=l.filter(d=>ut(d,f.filter.toLowerCase()))),l.forEach(d=>wn(d,t.currentRoute.value)),f.rootNodes=l.map(En)}let u;o.on.getInspectorTree(f=>{u=f,f.app===e&&f.inspectorId===a&&c()}),o.on.getInspectorState(f=>{if(f.app===e&&f.inspectorId===a){const d=n.getRoutes().find(h=>h.record.__vd_id===f.nodeId);d&&(f.state={options:Bo(d)})}}),o.sendInspectorTree(a),o.sendInspectorState(a)})}function Lo(e){return e.optional?e.repeatable?"*":"?":e.repeatable?"+":""}function Bo(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(r=>`${r.name}${Lo(r)}`).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(r=>r.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(r=>r.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:e.score}}}),n}const gn=15485081,vn=2450411,yn=8702998,Uo=2282478,_n=16486972,Ho=6710886,Fo=16704226,Go=12131356;function En(e){const t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:Uo}),n.aliasOf&&t.push({label:"alias",textColor:0,backgroundColor:_n}),e.__vd_match&&t.push({label:"matches",textColor:0,backgroundColor:gn}),e.__vd_exactActive&&t.push({label:"exact",textColor:0,backgroundColor:yn}),e.__vd_active&&t.push({label:"active",textColor:0,backgroundColor:vn}),n.redirect&&t.push({label:typeof n.redirect=="string"?`redirect: ${n.redirect}`:"redirects",textColor:16777215,backgroundColor:Ho});let r=n.__vd_id;return r==null&&(r=String(Wo++),n.__vd_id=r),{id:r,label:n.path,tags:t,children:e.children.map(En)}}let Wo=0;const zo=/^\/(.*)\/([a-z]*)$/;function wn(e,t){const n=t.matched.length&&oe(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(r=>oe(r,e.record))),e.children.forEach(r=>wn(r,t))}function bn(e){e.__vd_match=!1,e.children.forEach(bn)}function ut(e,t){const n=String(e.re).match(zo);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(i=>ut(i,t)),e.record.path!=="/"||t==="/"?(e.__vd_match=e.re.test(t),!0):!1;const o=e.record.path.toLowerCase(),s=me(o);return!t.startsWith("/")&&(s.includes(t)||o.includes(t))||s.startsWith(t)||o.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(i=>ut(i,t))}function qo(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}function Jo(e){const t=vo(e.routes,e),n=e.parseQuery||Po,r=e.stringifyQuery||un,o=e.history;if(process.env.NODE_ENV!=="production"&&!o)throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');const s=Ne(),i=Ne(),a=Ne(),c=m.shallowRef(se);let u=se;Z&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const f=Ze.bind(null,p=>""+p),l=Ze.bind(null,Hr),d=Ze.bind(null,me);function h(p,v){let g,E;return Zt(p)?(g=t.getRecordMatcher(p),process.env.NODE_ENV!=="production"&&!g&&O(`Parent route "${String(p)}" not found when adding child route`,v),E=v):E=p,t.addRoute(E,g)}function b(p){const v=t.getRecordMatcher(p);v?t.removeRoute(v):process.env.NODE_ENV!=="production"&&O(`Cannot remove non-existent route "${String(p)}"`)}function y(){return t.getRoutes().map(p=>p.record)}function k(p){return!!t.getRecordMatcher(p)}function A(p,v){if(v=I({},v||c.value),typeof p=="string"){const P=nt(n,p,v.path),D=t.resolve({path:P.path},v),fe=o.createHref(P.fullPath);return process.env.NODE_ENV!=="production"&&(fe.startsWith("//")?O(`Location "${p}" resolved to "${fe}". A resolved location cannot start with multiple slashes.`):D.matched.length||O(`No match found for location with path "${p}"`)),I(P,D,{params:d(D.params),hash:me(P.hash),redirectedFrom:void 0,href:fe})}if(process.env.NODE_ENV!=="production"&&!xe(p))return O(`router.resolve() was passed an invalid location. This will fail in production.
|
|
38
|
+
- Location:`,p),A({});let g;if(p.path!=null)process.env.NODE_ENV!=="production"&&"params"in p&&!("name"in p)&&Object.keys(p.params).length&&O(`Path "${p.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),g=I({},p,{path:nt(n,p.path,v.path).path});else{const P=I({},p.params);for(const D in P)P[D]==null&&delete P[D];g=I({},p,{params:l(P)}),v.params=l(v.params)}const E=t.resolve(g,v),C=p.hash||"";process.env.NODE_ENV!=="production"&&C&&!C.startsWith("#")&&O(`A \`hash\` should always start with the character "#". Replace "${C}" with "#${C}".`),E.params=f(d(E.params));const M=Wr(r,I({},p,{hash:Lr(C),path:E.path})),$=o.createHref(M);return process.env.NODE_ENV!=="production"&&($.startsWith("//")?O(`Location "${p}" resolved to "${$}". A resolved location cannot start with multiple slashes.`):E.matched.length||O(`No match found for location with path "${p.path!=null?p.path:p}"`)),I({fullPath:M,hash:C,query:r===un?No(p.query):p.query||{}},E,{redirectedFrom:void 0,href:$})}function N(p){return typeof p=="string"?nt(n,p,c.value.path):I({},p)}function R(p,v){if(u!==p)return ge(8,{from:v,to:p})}function L(p){return S(p)}function F(p){return L(I(N(p),{replace:!0}))}function K(p){const v=p.matched[p.matched.length-1];if(v&&v.redirect){const{redirect:g}=v;let E=typeof g=="function"?g(p):g;if(typeof E=="string"&&(E=E.includes("?")||E.includes("#")?E=N(E):{path:E},E.params={}),process.env.NODE_ENV!=="production"&&E.path==null&&!("name"in E))throw O(`Invalid redirect found:
|
|
39
39
|
${JSON.stringify(E,null,2)}
|
|
40
|
-
when navigating to "${
|
|
41
|
-
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(I({replace:$},P(G.to),{state:typeof G.to=="object"?I({},C,G.to.state):C,force:M}),v||D)}else G=T(D,E,!0,$,C);return _(D,E,G),G})}function Jn(h,v){const g=R(h,v);return g?Promise.reject(g):Promise.resolve()}function q(h){const v=Fe.values().next().value;return v&&typeof v.runWithContext=="function"?v.runWithContext(h):h()}function w(h,v){let g;const[E,C,M]=Ko(h,v);g=ct(E.reverse(),"beforeRouteLeave",h,v);for(const N of E)N.leaveGuards.forEach(D=>{g.push(ie(D,h,v))});const $=Jn.bind(null,h,v);return g.push($),Ee(g).then(()=>{g=[];for(const N of s.list())g.push(ie(N,h,v));return g.push($),Ee(g)}).then(()=>{g=ct(C,"beforeRouteUpdate",h,v);for(const N of C)N.updateGuards.forEach(D=>{g.push(ie(D,h,v))});return g.push($),Ee(g)}).then(()=>{g=[];for(const N of M)if(N.beforeEnter)if(W(N.beforeEnter))for(const D of N.beforeEnter)g.push(ie(D,h,v));else g.push(ie(N.beforeEnter,h,v));return g.push($),Ee(g)}).then(()=>(h.matched.forEach(N=>N.enterCallbacks={}),g=ct(M,"beforeRouteEnter",h,v,q),g.push($),Ee(g))).then(()=>{g=[];for(const N of i.list())g.push(ie(N,h,v));return g.push($),Ee(g)}).catch(N=>ee(N,8)?N:Promise.reject(N))}function _(h,v,g){a.list().forEach(E=>q(()=>E(h,v,g)))}function T(h,v,g,E,C){const M=R(h,v);if(M)return M;const $=v===se,N=Z?history.state:{};g&&(E||$?o.replace(h.fullPath,I({scroll:$&&N&&N.scroll},C)):o.push(h.fullPath,C)),c.value=h,Kn(h,v,g,$),Et()}let j;function le(){j||(j=o.listen((h,v,g)=>{if(!Qn.listening)return;const E=A(h),C=K(E);if(C){S(I(C,{replace:!0}),E).catch(Oe);return}u=E;const M=c.value;Z&&Zr(Qt(M.fullPath,g.delta),Ve()),w(E,M).catch($=>ee($,12)?$:ee($,2)?(S($.to,E).then(N=>{ee(N,20)&&!g.delta&&g.type===ke.pop&&o.go(-1,!1)}).catch(Oe),Promise.reject()):(g.delta&&o.go(-g.delta,!1),H($,E,M))).then($=>{$=$||T(E,M,!1),$&&(g.delta&&!ee($,8)?o.go(-g.delta,!1):g.type===ke.pop&&ee($,20)&&o.go(-1,!1)),_(E,M,$)}).catch(Oe)}))}let $e=Pe(),He=Pe(),Y;function H(h,v,g){Et(h);const E=He.list();return E.length?E.forEach(C=>C(h,v,g)):(process.env.NODE_ENV!=="production"&&O("uncaught error during route navigation:"),console.error(h)),Promise.reject(h)}function ii(){return Y&&c.value!==se?Promise.resolve():new Promise((h,v)=>{$e.add([h,v])})}function Et(h){return Y||(Y=!h,le(),$e.list().forEach(([v,g])=>h?g(h):v()),$e.reset()),h}function Kn(h,v,g,E){const{scrollBehavior:C}=e;if(!Z||!C)return Promise.resolve();const M=!g&&eo(Qt(h.fullPath,0))||(E||!g)&&history.state&&history.state.scroll||null;return m.nextTick().then(()=>C(h,v,M)).then($=>$&&Xr($)).catch($=>H($,h,v))}const wt=h=>o.go(h);let bt;const Fe=new Set,Qn={currentRoute:c,listening:!0,addRoute:p,removeRoute:b,clearRoutes:t.clearRoutes,hasRoute:k,getRoutes:y,resolve:A,options:e,push:L,replace:F,go:wt,back:()=>wt(-1),forward:()=>wt(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:He.add,isReady:ii,install(h){const v=this;h.component("RouterLink",Co),h.component("RouterView",Mo),h.config.globalProperties.$router=v,Object.defineProperty(h.config.globalProperties,"$route",{enumerable:!0,get:()=>m.unref(c)}),Z&&!bt&&c.value===se&&(bt=!0,L(o.location).catch(C=>{process.env.NODE_ENV!=="production"&&O("Unexpected error when starting the router:",C)}));const g={};for(const C in se)Object.defineProperty(g,C,{get:()=>c.value[C],enumerable:!0});h.provide(it,v),h.provide(fn,m.shallowReactive(g)),h.provide(at,c);const E=h.unmount;Fe.add(h),h.unmount=function(){Fe.delete(h),Fe.size<1&&(u=se,j&&j(),j=null,c.value=se,bt=!1,Y=!1),E()},process.env.NODE_ENV!=="production"&&Z&&xo(h,v,t)}};function Ee(h){return h.reduce((v,g)=>v.then(()=>q(g)),Promise.resolve())}return Qn}function Ko(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;i<s;i++){const a=t.matched[i];a&&(e.matched.find(u=>oe(u,a))?r.push(a):n.push(a));const c=e.matched[i];c&&(t.matched.find(u=>oe(u,c))||o.push(c))}return[n,r,o]}const Qo=Jo({history:oo(),routes:[]});function Yo(e){return e&&typeof e.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var ue=Promise.resolve();function Sn(e,t){return e||(e=0),new Promise(function(n){return setTimeout(function(){return n(t)},e)})}function Xo(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function lt(){return Math.random().toString(36).substring(2)}var On=0,ft=0;function Be(){var e=new Date().getTime();return e===On?(ft++,e*1e3+ft):(On=e,ft=0,e*1e3)}var Zo=Be,es="native";function ts(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(n){t.messagesCallback&&t.messagesCallback(n.data)},t}function ns(e){e.bc.close(),e.subFns=[]}function rs(e,t){try{return e.bc.postMessage(t,!1),ue}catch(n){return Promise.reject(n)}}function os(e,t){e.messagesCallback=t}function ss(){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 is(){return 150}var as={create:ts,close:ns,onMessage:os,postMessage:rs,canBeUsed:ss,type:es,averageResponseTime:is,microSeconds:Zo},kn=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,Nn()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,cs(n)},0))},e.prototype.clear=function(){this.map.clear()},e}();function cs(e){for(var t=Nn()-e.ttl,n=e.map[Symbol.iterator]();;){var r=n.next().value;if(!r)return;var o=r[0],s=r[1];if(s<t)e.map.delete(o);else return}}function Nn(){return new Date().getTime()}function dt(){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 us=Be,ls="pubkey.broadcast-channel-0-",te="messages",Ue={durability:"relaxed"},fs="idb";function Pn(){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 pt(e){e.commit&&e.commit()}function ds(e){var t=Pn(),n=ls+e,r=t.open(n);return r.onupgradeneeded=function(o){var s=o.target.result;s.createObjectStore(te,{keyPath:"id",autoIncrement:!0})},new Promise(function(o,s){r.onerror=function(i){return s(i)},r.onsuccess=function(){o(r.result)}})}function ps(e,t,n){var r=new Date().getTime(),o={uuid:t,time:r,data:n},s=e.transaction([te],"readwrite",Ue);return new Promise(function(i,a){s.oncomplete=function(){return i()},s.onerror=function(u){return a(u)};var c=s.objectStore(te);c.add(o),pt(s)})}function hs(e,t){var n=e.transaction(te,"readonly",Ue),r=n.objectStore(te),o=[],s=IDBKeyRange.bound(t+1,1/0);if(r.getAll){var i=r.getAll(s);return new Promise(function(c,u){i.onerror=function(f){return u(f)},i.onsuccess=function(f){c(f.target.result)}})}function a(){try{return s=IDBKeyRange.bound(t+1,1/0),r.openCursor(s)}catch{return r.openCursor()}}return new Promise(function(c,u){var f=a();f.onerror=function(l){return u(l)},f.onsuccess=function(l){var d=l.target.result;d?d.value.id<t+1?d.continue(t+1):(o.push(d.value),d.continue()):(pt(n),c(o))}})}function ms(e,t){if(e.closed)return Promise.resolve([]);var n=e.db.transaction(te,"readwrite",Ue),r=n.objectStore(te);return Promise.all(t.map(function(o){var s=r.delete(o);return new Promise(function(i){s.onsuccess=function(){return i()}})}))}function gs(e,t){var n=new Date().getTime()-t,r=e.transaction(te,"readonly",Ue),o=r.objectStore(te),s=[];return new Promise(function(i){o.openCursor().onsuccess=function(a){var c=a.target.result;if(c){var u=c.value;u.time<n?(s.push(u),c.continue()):(pt(r),i(s))}else i(s)}})}function vs(e){return gs(e.db,e.options.idb.ttl).then(function(t){return ms(e,t.map(function(n){return n.id}))})}function ys(e,t){return t=dt(t),ds(e).then(function(n){var r={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:lt(),eMIs:new kn(t.idb.ttl*2),writeBlockPromise:ue,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){r.closed=!0,t.idb.onclose&&t.idb.onclose()},Rn(r),r})}function Rn(e){e.closed||$n(e).then(function(){return Sn(e.options.idb.fallbackInterval)}).then(function(){return Rn(e)})}function _s(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}function $n(e){return e.closed||!e.messagesCallback?ue:hs(e.db,e.lastCursorId).then(function(t){var n=t.filter(function(r){return!!r}).map(function(r){return r.id>e.lastCursorId&&(e.lastCursorId=r.id),r}).filter(function(r){return _s(r,e)}).sort(function(r,o){return r.time-o.time});return n.forEach(function(r){e.messagesCallback&&(e.eMIs.add(r.id),e.messagesCallback(r.data))}),ue})}function Es(e){e.closed=!0,e.db.close()}function ws(e,t){return e.writeBlockPromise=e.writeBlockPromise.then(function(){return ps(e.db,e.uuid,t)}).then(function(){Xo(0,10)===0&&vs(e)}),e.writeBlockPromise}function bs(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t,$n(e)}function Ss(){return!!Pn()}function Os(e){return e.idb.fallbackInterval*2}var ks={create:ys,close:Es,onMessage:bs,postMessage:ws,canBeUsed:Ss,type:fs,averageResponseTime:Os,microSeconds:us},Ns=Be,Ps="pubkey.broadcastChannel-",Rs="localstorage";function In(){var e;if(typeof window>"u")return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return e}function Cn(e){return Ps+e}function $s(e,t){return new Promise(function(n){Sn().then(function(){var r=Cn(e.channelName),o={token:lt(),time:new Date().getTime(),data:t,uuid:e.uuid},s=JSON.stringify(o);In().setItem(r,s);var i=document.createEvent("Event");i.initEvent("storage",!0,!0),i.key=r,i.newValue=s,window.dispatchEvent(i),n()})})}function Is(e,t){var n=Cn(e),r=function(s){s.key===n&&t(JSON.parse(s.newValue))};return window.addEventListener("storage",r),r}function Cs(e){window.removeEventListener("storage",e)}function As(e,t){if(t=dt(t),!An())throw new Error("BroadcastChannel: localstorage cannot be used");var n=lt(),r=new kn(t.localstorage.removeTimeout),o={channelName:e,uuid:n,eMIs:r};return o.listener=Is(e,function(s){o.messagesCallback&&s.uuid!==n&&(!s.token||r.has(s.token)||s.data.time&&s.data.time<o.messagesCallbackTime||(r.add(s.token),o.messagesCallback(s.data)))}),o}function Ts(e){Cs(e.listener)}function Ds(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t}function An(){var e=In();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch{return!1}return!0}function Ms(){var e=120,t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")?e*2:e}var js={create:As,close:Ts,onMessage:Ds,postMessage:$s,canBeUsed:An,type:Rs,averageResponseTime:Ms,microSeconds:Ns},Vs=Be,xs="simulate",ht=new Set;function Ls(e){var t={name:e,messagesCallback:null};return ht.add(t),t}function Bs(e){ht.delete(e)}function Us(e,t){return new Promise(function(n){return setTimeout(function(){var r=Array.from(ht);r.filter(function(o){return o.name===e.name}).filter(function(o){return o!==e}).filter(function(o){return!!o.messagesCallback}).forEach(function(o){return o.messagesCallback(t)}),n()},5)})}function Hs(e,t){e.messagesCallback=t}function Fs(){return!0}function Gs(){return 5}var Ws={create:Ls,close:Bs,onMessage:Hs,postMessage:Us,canBeUsed:Fs,type:xs,averageResponseTime:Gs,microSeconds:Vs},Tn=[as,ks,js];function zs(e){var t=[].concat(e.methods,Tn).filter(Boolean);if(e.type){if(e.type==="simulate")return Ws;var n=t.find(function(o){return o.type===e.type});if(n)return n;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||(t=t.filter(function(o){return o.type!=="idb"}));var r=t.find(function(o){return o.canBeUsed()});if(r)return r;throw new Error("No usable method found in "+JSON.stringify(Tn.map(function(o){return o.type})))}var Dn=new Set,qs=0,mt=function(t,n){this.id=qs++,Dn.add(this),this.name=t,Mn&&(n=Mn),this.options=dt(n),this.method=zs(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Js(this)};mt._pubkey=!0;var Mn;mt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return jn(this,"message",t)},postInternal:function(t){return jn(this,"internal",t)},set onmessage(e){var t=this.method.microSeconds(),n={time:t,fn:e};Ln(this,"message",this._onML),e&&typeof e=="function"?(this._onML=n,xn(this,"message",n)):this._onML=null},addEventListener:function(t,n){var r=this.method.microSeconds(),o={time:r,fn:n};xn(this,t,o)},removeEventListener:function(t,n){var r=this._addEL[t].find(function(o){return o.fn===n});Ln(this,t,r)},close:function(){var t=this;if(!this.closed){Dn.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(r){return r()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function jn(e,t,n){var r=e.method.microSeconds(),o={time:r,type:t,data:n},s=e._prepP?e._prepP:ue;return s.then(function(){var i=e.method.postMessage(e._state,o);return e._uMP.add(i),i.catch().then(function(){return e._uMP.delete(i)}),i})}function Js(e){var t=e.method.create(e.name,e.options);Yo(t)?(e._prepP=t,t.then(function(n){e._state=n})):e._state=t}function Vn(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function xn(e,t,n){e._addEL[t].push(n),Ks(e)}function Ln(e,t,n){e._addEL[t]=e._addEL[t].filter(function(r){return r!==n}),Qs(e)}function Ks(e){if(!e._iL&&Vn(e)){var t=function(o){e._addEL[o.type].forEach(function(s){var i=1e5,a=s.time-i;o.time>=a&&s.fn(o.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 Qs(e){if(e._iL&&!Vn(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}class gt extends Error{constructor(t,n){super(t),this.name="DevalueError",this.path=n.join("")}}function Bn(e){return Object(e)!==e}const Ys=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xs(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Ys}function Zs(e){return Object.prototype.toString.call(e).slice(8,-1)}function ei(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
42
|
-
`: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 ve(e){let t="",n=0;const r=e.length;for(let o=0;o<r;o+=1){const s=e[o],i=ei(s);i&&(t+=e.slice(n,o)+i,n=o+1)}return`"${n===0?e:t+e.slice(n)}"`}const vt=-1,Un=-2,Hn=-3,Fn=-4,Gn=-5,yt=-6;function Wn(e,t){return ti(JSON.parse(e)
|
|
40
|
+
when navigating to "${p.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return I({query:p.query,hash:p.hash,params:E.path!=null?{}:p.params},E)}}function S(p,v){const g=u=A(p),E=c.value,C=p.state,M=p.force,$=p.replace===!0,P=K(g);if(P)return S(I(N(P),{state:typeof P=="object"?I({},C,P.state):C,force:M,replace:$}),v||g);const D=g;D.redirectedFrom=v;let fe;return!M&&qt(r,E,g)&&(fe=ge(16,{to:D,from:E}),Kn(E,E,!0,!1)),(fe?Promise.resolve(fe):w(D,E)).catch(G=>ee(G)?ee(G,2)?G:Et(G):H(G,D,E)).then(G=>{if(G){if(ee(G,2))return process.env.NODE_ENV!=="production"&&qt(r,A(G.to),D)&&v&&(v._count=v._count?v._count+1:1)>30?(O(`Detected a possibly infinite redirection in a navigation guard when going from "${E.fullPath}" to "${D.fullPath}". Aborting to avoid a Stack Overflow.
|
|
41
|
+
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(I({replace:$},N(G.to),{state:typeof G.to=="object"?I({},C,G.to.state):C,force:M}),v||D)}else G=T(D,E,!0,$,C);return _(D,E,G),G})}function Jn(p,v){const g=R(p,v);return g?Promise.reject(g):Promise.resolve()}function q(p){const v=Fe.values().next().value;return v&&typeof v.runWithContext=="function"?v.runWithContext(p):p()}function w(p,v){let g;const[E,C,M]=Ko(p,v);g=ct(E.reverse(),"beforeRouteLeave",p,v);for(const P of E)P.leaveGuards.forEach(D=>{g.push(ie(D,p,v))});const $=Jn.bind(null,p,v);return g.push($),Ee(g).then(()=>{g=[];for(const P of s.list())g.push(ie(P,p,v));return g.push($),Ee(g)}).then(()=>{g=ct(C,"beforeRouteUpdate",p,v);for(const P of C)P.updateGuards.forEach(D=>{g.push(ie(D,p,v))});return g.push($),Ee(g)}).then(()=>{g=[];for(const P of M)if(P.beforeEnter)if(W(P.beforeEnter))for(const D of P.beforeEnter)g.push(ie(D,p,v));else g.push(ie(P.beforeEnter,p,v));return g.push($),Ee(g)}).then(()=>(p.matched.forEach(P=>P.enterCallbacks={}),g=ct(M,"beforeRouteEnter",p,v,q),g.push($),Ee(g))).then(()=>{g=[];for(const P of i.list())g.push(ie(P,p,v));return g.push($),Ee(g)}).catch(P=>ee(P,8)?P:Promise.reject(P))}function _(p,v,g){a.list().forEach(E=>q(()=>E(p,v,g)))}function T(p,v,g,E,C){const M=R(p,v);if(M)return M;const $=v===se,P=Z?history.state:{};g&&(E||$?o.replace(p.fullPath,I({scroll:$&&P&&P.scroll},C)):o.push(p.fullPath,C)),c.value=p,Kn(p,v,g,$),Et()}let j;function le(){j||(j=o.listen((p,v,g)=>{if(!Qn.listening)return;const E=A(p),C=K(E);if(C){S(I(C,{replace:!0}),E).catch(Oe);return}u=E;const M=c.value;Z&&Zr(Qt(M.fullPath,g.delta),Ve()),w(E,M).catch($=>ee($,12)?$:ee($,2)?(S($.to,E).then(P=>{ee(P,20)&&!g.delta&&g.type===ke.pop&&o.go(-1,!1)}).catch(Oe),Promise.reject()):(g.delta&&o.go(-g.delta,!1),H($,E,M))).then($=>{$=$||T(E,M,!1),$&&(g.delta&&!ee($,8)?o.go(-g.delta,!1):g.type===ke.pop&&ee($,20)&&o.go(-1,!1)),_(E,M,$)}).catch(Oe)}))}let $e=Ne(),He=Ne(),Y;function H(p,v,g){Et(p);const E=He.list();return E.length?E.forEach(C=>C(p,v,g)):(process.env.NODE_ENV!=="production"&&O("uncaught error during route navigation:"),console.error(p)),Promise.reject(p)}function ii(){return Y&&c.value!==se?Promise.resolve():new Promise((p,v)=>{$e.add([p,v])})}function Et(p){return Y||(Y=!p,le(),$e.list().forEach(([v,g])=>p?g(p):v()),$e.reset()),p}function Kn(p,v,g,E){const{scrollBehavior:C}=e;if(!Z||!C)return Promise.resolve();const M=!g&&eo(Qt(p.fullPath,0))||(E||!g)&&history.state&&history.state.scroll||null;return m.nextTick().then(()=>C(p,v,M)).then($=>$&&Xr($)).catch($=>H($,p,v))}const wt=p=>o.go(p);let bt;const Fe=new Set,Qn={currentRoute:c,listening:!0,addRoute:h,removeRoute:b,clearRoutes:t.clearRoutes,hasRoute:k,getRoutes:y,resolve:A,options:e,push:L,replace:F,go:wt,back:()=>wt(-1),forward:()=>wt(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:He.add,isReady:ii,install(p){const v=this;p.component("RouterLink",Co),p.component("RouterView",Mo),p.config.globalProperties.$router=v,Object.defineProperty(p.config.globalProperties,"$route",{enumerable:!0,get:()=>m.unref(c)}),Z&&!bt&&c.value===se&&(bt=!0,L(o.location).catch(C=>{process.env.NODE_ENV!=="production"&&O("Unexpected error when starting the router:",C)}));const g={};for(const C in se)Object.defineProperty(g,C,{get:()=>c.value[C],enumerable:!0});p.provide(it,v),p.provide(fn,m.shallowReactive(g)),p.provide(at,c);const E=p.unmount;Fe.add(p),p.unmount=function(){Fe.delete(p),Fe.size<1&&(u=se,j&&j(),j=null,c.value=se,bt=!1,Y=!1),E()},process.env.NODE_ENV!=="production"&&Z&&xo(p,v,t)}};function Ee(p){return p.reduce((v,g)=>v.then(()=>q(g)),Promise.resolve())}return Qn}function Ko(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;i<s;i++){const a=t.matched[i];a&&(e.matched.find(u=>oe(u,a))?r.push(a):n.push(a));const c=e.matched[i];c&&(t.matched.find(u=>oe(u,c))||o.push(c))}return[n,r,o]}const Qo=Jo({history:oo(),routes:[]});function Yo(e){return e&&typeof e.then=="function"}Promise.resolve(!1),Promise.resolve(!0);var ue=Promise.resolve();function Sn(e,t){return e||(e=0),new Promise(function(n){return setTimeout(function(){return n(t)},e)})}function Xo(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function lt(){return Math.random().toString(36).substring(2)}var On=0,ft=0;function Be(){var e=new Date().getTime();return e===On?(ft++,e*1e3+ft):(On=e,ft=0,e*1e3)}var Zo=Be,es="native";function ts(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(n){t.messagesCallback&&t.messagesCallback(n.data)},t}function ns(e){e.bc.close(),e.subFns=[]}function rs(e,t){try{return e.bc.postMessage(t,!1),ue}catch(n){return Promise.reject(n)}}function os(e,t){e.messagesCallback=t}function ss(){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 is(){return 150}var as={create:ts,close:ns,onMessage:os,postMessage:rs,canBeUsed:ss,type:es,averageResponseTime:is,microSeconds:Zo},kn=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,Pn()),this._to||(this._to=!0,setTimeout(function(){n._to=!1,cs(n)},0))},e.prototype.clear=function(){this.map.clear()},e}();function cs(e){for(var t=Pn()-e.ttl,n=e.map[Symbol.iterator]();;){var r=n.next().value;if(!r)return;var o=r[0],s=r[1];if(s<t)e.map.delete(o);else return}}function Pn(){return new Date().getTime()}function dt(){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 us=Be,ls="pubkey.broadcast-channel-0-",te="messages",Ue={durability:"relaxed"},fs="idb";function Nn(){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 pt(e){e.commit&&e.commit()}function ds(e){var t=Nn(),n=ls+e,r=t.open(n);return r.onupgradeneeded=function(o){var s=o.target.result;s.createObjectStore(te,{keyPath:"id",autoIncrement:!0})},new Promise(function(o,s){r.onerror=function(i){return s(i)},r.onsuccess=function(){o(r.result)}})}function ps(e,t,n){var r=new Date().getTime(),o={uuid:t,time:r,data:n},s=e.transaction([te],"readwrite",Ue);return new Promise(function(i,a){s.oncomplete=function(){return i()},s.onerror=function(u){return a(u)};var c=s.objectStore(te);c.add(o),pt(s)})}function hs(e,t){var n=e.transaction(te,"readonly",Ue),r=n.objectStore(te),o=[],s=IDBKeyRange.bound(t+1,1/0);if(r.getAll){var i=r.getAll(s);return new Promise(function(c,u){i.onerror=function(f){return u(f)},i.onsuccess=function(f){c(f.target.result)}})}function a(){try{return s=IDBKeyRange.bound(t+1,1/0),r.openCursor(s)}catch{return r.openCursor()}}return new Promise(function(c,u){var f=a();f.onerror=function(l){return u(l)},f.onsuccess=function(l){var d=l.target.result;d?d.value.id<t+1?d.continue(t+1):(o.push(d.value),d.continue()):(pt(n),c(o))}})}function ms(e,t){if(e.closed)return Promise.resolve([]);var n=e.db.transaction(te,"readwrite",Ue),r=n.objectStore(te);return Promise.all(t.map(function(o){var s=r.delete(o);return new Promise(function(i){s.onsuccess=function(){return i()}})}))}function gs(e,t){var n=new Date().getTime()-t,r=e.transaction(te,"readonly",Ue),o=r.objectStore(te),s=[];return new Promise(function(i){o.openCursor().onsuccess=function(a){var c=a.target.result;if(c){var u=c.value;u.time<n?(s.push(u),c.continue()):(pt(r),i(s))}else i(s)}})}function vs(e){return gs(e.db,e.options.idb.ttl).then(function(t){return ms(e,t.map(function(n){return n.id}))})}function ys(e,t){return t=dt(t),ds(e).then(function(n){var r={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:lt(),eMIs:new kn(t.idb.ttl*2),writeBlockPromise:ue,messagesCallback:null,readQueuePromises:[],db:n};return n.onclose=function(){r.closed=!0,t.idb.onclose&&t.idb.onclose()},Rn(r),r})}function Rn(e){e.closed||$n(e).then(function(){return Sn(e.options.idb.fallbackInterval)}).then(function(){return Rn(e)})}function _s(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}function $n(e){return e.closed||!e.messagesCallback?ue:hs(e.db,e.lastCursorId).then(function(t){var n=t.filter(function(r){return!!r}).map(function(r){return r.id>e.lastCursorId&&(e.lastCursorId=r.id),r}).filter(function(r){return _s(r,e)}).sort(function(r,o){return r.time-o.time});return n.forEach(function(r){e.messagesCallback&&(e.eMIs.add(r.id),e.messagesCallback(r.data))}),ue})}function Es(e){e.closed=!0,e.db.close()}function ws(e,t){return e.writeBlockPromise=e.writeBlockPromise.then(function(){return ps(e.db,e.uuid,t)}).then(function(){Xo(0,10)===0&&vs(e)}),e.writeBlockPromise}function bs(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t,$n(e)}function Ss(){return!!Nn()}function Os(e){return e.idb.fallbackInterval*2}var ks={create:ys,close:Es,onMessage:bs,postMessage:ws,canBeUsed:Ss,type:fs,averageResponseTime:Os,microSeconds:us},Ps=Be,Ns="pubkey.broadcastChannel-",Rs="localstorage";function In(){var e;if(typeof window>"u")return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch{}return e}function Cn(e){return Ns+e}function $s(e,t){return new Promise(function(n){Sn().then(function(){var r=Cn(e.channelName),o={token:lt(),time:new Date().getTime(),data:t,uuid:e.uuid},s=JSON.stringify(o);In().setItem(r,s);var i=document.createEvent("Event");i.initEvent("storage",!0,!0),i.key=r,i.newValue=s,window.dispatchEvent(i),n()})})}function Is(e,t){var n=Cn(e),r=function(s){s.key===n&&t(JSON.parse(s.newValue))};return window.addEventListener("storage",r),r}function Cs(e){window.removeEventListener("storage",e)}function As(e,t){if(t=dt(t),!An())throw new Error("BroadcastChannel: localstorage cannot be used");var n=lt(),r=new kn(t.localstorage.removeTimeout),o={channelName:e,uuid:n,eMIs:r};return o.listener=Is(e,function(s){o.messagesCallback&&s.uuid!==n&&(!s.token||r.has(s.token)||s.data.time&&s.data.time<o.messagesCallbackTime||(r.add(s.token),o.messagesCallback(s.data)))}),o}function Ts(e){Cs(e.listener)}function Ds(e,t,n){e.messagesCallbackTime=n,e.messagesCallback=t}function An(){var e=In();if(!e)return!1;try{var t="__broadcastchannel_check";e.setItem(t,"works"),e.removeItem(t)}catch{return!1}return!0}function Ms(){var e=120,t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")?e*2:e}var js={create:As,close:Ts,onMessage:Ds,postMessage:$s,canBeUsed:An,type:Rs,averageResponseTime:Ms,microSeconds:Ps},Vs=Be,xs="simulate",ht=new Set;function Ls(e){var t={name:e,messagesCallback:null};return ht.add(t),t}function Bs(e){ht.delete(e)}function Us(e,t){return new Promise(function(n){return setTimeout(function(){var r=Array.from(ht);r.filter(function(o){return o.name===e.name}).filter(function(o){return o!==e}).filter(function(o){return!!o.messagesCallback}).forEach(function(o){return o.messagesCallback(t)}),n()},5)})}function Hs(e,t){e.messagesCallback=t}function Fs(){return!0}function Gs(){return 5}var Ws={create:Ls,close:Bs,onMessage:Hs,postMessage:Us,canBeUsed:Fs,type:xs,averageResponseTime:Gs,microSeconds:Vs},Tn=[as,ks,js];function zs(e){var t=[].concat(e.methods,Tn).filter(Boolean);if(e.type){if(e.type==="simulate")return Ws;var n=t.find(function(o){return o.type===e.type});if(n)return n;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||(t=t.filter(function(o){return o.type!=="idb"}));var r=t.find(function(o){return o.canBeUsed()});if(r)return r;throw new Error("No usable method found in "+JSON.stringify(Tn.map(function(o){return o.type})))}var Dn=new Set,qs=0,mt=function(t,n){this.id=qs++,Dn.add(this),this.name=t,Mn&&(n=Mn),this.options=dt(n),this.method=zs(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,Js(this)};mt._pubkey=!0;var Mn;mt.prototype={postMessage:function(t){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(t));return jn(this,"message",t)},postInternal:function(t){return jn(this,"internal",t)},set onmessage(e){var t=this.method.microSeconds(),n={time:t,fn:e};Ln(this,"message",this._onML),e&&typeof e=="function"?(this._onML=n,xn(this,"message",n)):this._onML=null},addEventListener:function(t,n){var r=this.method.microSeconds(),o={time:r,fn:n};xn(this,t,o)},removeEventListener:function(t,n){var r=this._addEL[t].find(function(o){return o.fn===n});Ln(this,t,r)},close:function(){var t=this;if(!this.closed){Dn.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(r){return r()}))}).then(function(){return t.method.close(t._state)})}},get type(){return this.method.type},get isClosed(){return this.closed}};function jn(e,t,n){var r=e.method.microSeconds(),o={time:r,type:t,data:n},s=e._prepP?e._prepP:ue;return s.then(function(){var i=e.method.postMessage(e._state,o);return e._uMP.add(i),i.catch().then(function(){return e._uMP.delete(i)}),i})}function Js(e){var t=e.method.create(e.name,e.options);Yo(t)?(e._prepP=t,t.then(function(n){e._state=n})):e._state=t}function Vn(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function xn(e,t,n){e._addEL[t].push(n),Ks(e)}function Ln(e,t,n){e._addEL[t]=e._addEL[t].filter(function(r){return r!==n}),Qs(e)}function Ks(e){if(!e._iL&&Vn(e)){var t=function(o){e._addEL[o.type].forEach(function(s){var i=1e5,a=s.time-i;o.time>=a&&s.fn(o.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 Qs(e){if(e._iL&&!Vn(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}class gt extends Error{constructor(t,n){super(t),this.name="DevalueError",this.path=n.join("")}}function Bn(e){return Object(e)!==e}const Ys=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xs(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Ys}function Zs(e){return Object.prototype.toString.call(e).slice(8,-1)}function ei(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
|
|
42
|
+
`: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 ve(e){let t="",n=0;const r=e.length;for(let o=0;o<r;o+=1){const s=e[o],i=ei(s);i&&(t+=e.slice(n,o)+i,n=o+1)}return`"${n===0?e:t+e.slice(n)}"`}const vt=-1,Un=-2,Hn=-3,Fn=-4,Gn=-5,yt=-6;function Wn(e,t){return ti(JSON.parse(e))}function ti(e,t){if(typeof e=="number")return o(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function o(s,i=!1){if(s===vt)return;if(s===Hn)return NaN;if(s===Fn)return 1/0;if(s===Gn)return-1/0;if(s===yt)return-0;if(i)throw new Error("Invalid input");if(s in r)return r[s];const a=n[s];if(!a||typeof a!="object")r[s]=a;else if(Array.isArray(a))if(typeof a[0]=="string"){const c=a[0];switch(c){case"Date":r[s]=new Date(a[1]);break;case"Set":const u=new Set;r[s]=u;for(let d=1;d<a.length;d+=1)u.add(o(a[d]));break;case"Map":const f=new Map;r[s]=f;for(let d=1;d<a.length;d+=2)f.set(o(a[d]),o(a[d+1]));break;case"RegExp":r[s]=new RegExp(a[1],a[2]);break;case"Object":r[s]=Object(a[1]);break;case"BigInt":r[s]=BigInt(a[1]);break;case"null":const l=Object.create(null);r[s]=l;for(let d=1;d<a.length;d+=2)l[a[d]]=o(a[d+1]);break;default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(a.length);r[s]=c;for(let u=0;u<a.length;u+=1){const f=a[u];f!==Un&&(c[u]=o(f))}}else{const c={};r[s]=c;for(const u in a){const f=a[u];c[u]=o(f)}}return r[s]}return o(0)}function zn(e,t){const n=[],r=new Map,o=[];for(const u in t)o.push({key:u,fn:t[u]});const s=[];let i=0;function a(u){if(typeof u=="function")throw new gt("Cannot stringify a function",s);if(r.has(u))return r.get(u);if(u===void 0)return vt;if(Number.isNaN(u))return Hn;if(u===1/0)return Fn;if(u===-1/0)return Gn;if(u===0&&1/u<0)return yt;const f=i++;r.set(u,f);for(const{key:d,fn:h}of o){const b=h(u);if(b)return n[f]=`["${d}",${a(b)}]`,f}let l="";if(Bn(u))l=_t(u);else switch(Zs(u)){case"Number":case"String":case"Boolean":l=`["Object",${_t(u)}]`;break;case"BigInt":l=`["BigInt",${u}]`;break;case"Date":l=`["Date","${u.toISOString()}"]`;break;case"RegExp":const{source:h,flags:b}=u;l=b?`["RegExp",${ve(h)},"${b}"]`:`["RegExp",${ve(h)}]`;break;case"Array":l="[";for(let y=0;y<u.length;y+=1)y>0&&(l+=","),y in u?(s.push(`[${y}]`),l+=a(u[y]),s.pop()):l+=Un;l+="]";break;case"Set":l='["Set"';for(const y of u)l+=`,${a(y)}`;l+="]";break;case"Map":l='["Map"';for(const[y,k]of u)s.push(`.get(${Bn(y)?_t(y):"..."})`),l+=`,${a(y)},${a(k)}`;l+="]";break;default:if(!Xs(u))throw new gt("Cannot stringify arbitrary non-POJOs",s);if(Object.getOwnPropertySymbols(u).length>0)throw new gt("Cannot stringify POJOs with symbolic keys",s);if(Object.getPrototypeOf(u)===null){l='["null"';for(const y in u)s.push(`.${y}`),l+=`,${ve(y)},${a(u[y])}`,s.pop();l+="]"}else{l="{";let y=!1;for(const k in u)y&&(l+=","),y=!0,s.push(`.${k}`),l+=`${ve(k)}:${a(u[k])}`,s.pop();l+="}"}}return n[f]=l,f}const c=a(e);return c<0?`${c}`:`[${n.join(",")}]`}function _t(e){const t=typeof e;return t==="string"?ve(e):e instanceof String?ve(e.toString()):e===void 0?vt.toString():e===0&&1/e<0?yt.toString():t==="bigint"?`["BigInt","${e}"]`:String(e)}function ni(e,t,{initialize:n,type:r}){let o=`${t.$id}-${e.toString()}`,s=new mt(o,{type:r}),i=!1,a=0;m.watch(()=>t[e],f=>{i||(a=Date.now(),s.postMessage({timestamp:a,state:Wn(zn(f))})),i=!1},{deep:!0}),s.onmessage=f=>{if(f===void 0){s.postMessage({timestamp:a,state:Wn(zn(t[e]))});return}f.timestamp<=a||(i=!0,a=f.timestamp,t[e]=f.state)};let c=()=>s.postMessage(void 0),u=()=>s.close();return n&&c(),{sync:c,unshare:u}}var ri=(e,t)=>Object.keys(t).includes(e),oi=({initialize:e=!0,enable:t=!0,type:n})=>({store:r,options:o})=>{var a,c;let s=((a=o==null?void 0:o.share)==null?void 0:a.enable)??t,i=((c=o==null?void 0:o.share)==null?void 0:c.omit)??[];!s||Object.keys(r.$state).forEach(u=>{var f;i.includes(u)||!ri(u,r.$state)||ni(u,r,{initialize:((f=o==null?void 0:o.share)==null?void 0:f.initialize)??e,type:n})})};const qn=wr();qn.use(oi({enable:!0,initialize:!0}));const si={install:(e,t)=>{const n=(t==null?void 0:t.router)||Qo,r=new je(n,t==null?void 0:t.getMeta);if(e.use(n),e.use(qn),e.provide("$registry",r),t!=null&&t.components)for(const[o,s]of Object.entries(t.components))e.component(o,s)}};B.DoctypeMeta=Rr,B.Registry=je,B.Stonecrop=si,B.useStonecrop=Nr,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
|
43
43
|
//# sourceMappingURL=stonecrop.umd.cjs.map
|