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