@micacms/editor-ui 0.2.2 → 0.3.0
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/assets/ChangesView-D7n3k873.js +7 -0
- package/dist/assets/ChangesView-D7n3k873.js.map +1 -0
- package/dist/assets/{CollectionView-BL9-uTTb.js → CollectionView-Cu_ytsrZ.js} +2 -2
- package/dist/assets/{CollectionView-BL9-uTTb.js.map → CollectionView-Cu_ytsrZ.js.map} +1 -1
- package/dist/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-C4yhYMWf.js +2 -0
- package/dist/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-C4yhYMWf.js.map +1 -0
- package/dist/assets/{DashboardView-Dn6J5mjy.js → DashboardView-7y5LY2BH.js} +2 -2
- package/dist/assets/{DashboardView-Dn6J5mjy.js.map → DashboardView-7y5LY2BH.js.map} +1 -1
- package/dist/assets/{EntryView-EdKf-RGT.js → EntryView-IyBqYorV.js} +2 -2
- package/dist/assets/EntryView-IyBqYorV.js.map +1 -0
- package/dist/assets/LoginView-C8sJvqmb.js +2 -0
- package/dist/assets/LoginView-C8sJvqmb.js.map +1 -0
- package/dist/assets/{MediaView-DZ8c7Ftz.js → MediaView-BVODAshv.js} +2 -2
- package/dist/assets/MediaView-BVODAshv.js.map +1 -0
- package/dist/assets/{NotFoundView-DAJd7RdP.js → NotFoundView-K-fMCruW.js} +2 -2
- package/dist/assets/{NotFoundView-DAJd7RdP.js.map → NotFoundView-K-fMCruW.js.map} +1 -1
- package/dist/assets/{ObjectField-BWAzmqNb.js → ObjectField-CAJPaAKa.js} +2 -2
- package/dist/assets/{ObjectField-BWAzmqNb.js.map → ObjectField-CAJPaAKa.js.map} +1 -1
- package/dist/assets/PageHeader.vue_vue_type_script_setup_true_lang-IPw0xrLa.js +7 -0
- package/dist/assets/{PageHeader.vue_vue_type_script_setup_true_lang-BHQH-Q7U.js.map → PageHeader.vue_vue_type_script_setup_true_lang-IPw0xrLa.js.map} +1 -1
- package/dist/assets/{RepeaterField-Dk1Wne4m.js → RepeaterField-BAnvha76.js} +2 -2
- package/dist/assets/{RepeaterField-Dk1Wne4m.js.map → RepeaterField-BAnvha76.js.map} +1 -1
- package/dist/assets/SingletonView-C3AqQe6a.js +2 -0
- package/dist/assets/SingletonView-C3AqQe6a.js.map +1 -0
- package/dist/assets/{SystemView-BQLC-ZJl.css → SystemView-CBvzzAoO.css} +1 -1
- package/dist/assets/SystemView-DKA_QdVz.js +3 -0
- package/dist/assets/SystemView-DKA_QdVz.js.map +1 -0
- package/dist/assets/{arrow-right-DY4A7pBS.js → arrow-right-s8aI3aOk.js} +2 -2
- package/dist/assets/{arrow-right-DY4A7pBS.js.map → arrow-right-s8aI3aOk.js.map} +1 -1
- package/dist/assets/{arrow-up-jX6XH6AV.js → arrow-up-BeQh5rSe.js} +2 -2
- package/dist/assets/{arrow-up-jX6XH6AV.js.map → arrow-up-BeQh5rSe.js.map} +1 -1
- package/dist/assets/{chevron-down-DOqSqKRs.js → chevron-down-BgnDSY3E.js} +2 -2
- package/dist/assets/{chevron-down-DOqSqKRs.js.map → chevron-down-BgnDSY3E.js.map} +1 -1
- package/dist/assets/{index-BsCcwhm6.js → index-9WVbsgdk.js} +4 -4
- package/dist/assets/index-9WVbsgdk.js.map +1 -0
- package/dist/assets/index-DDeMbcSl.css +1 -0
- package/dist/assets/{plus-CFEffUqP.js → plus-D6xxK_qW.js} +2 -2
- package/dist/assets/{plus-CFEffUqP.js.map → plus-D6xxK_qW.js.map} +1 -1
- package/dist/assets/{useField-Czeyhihg.js → useField-CQv2TS4g.js} +2 -2
- package/dist/assets/{useField-Czeyhihg.js.map → useField-CQv2TS4g.js.map} +1 -1
- package/dist/assets/{useUnsavedChanges-CCE0XMQT.js → useUnsavedChanges-bO5Ha9y6.js} +5 -5
- package/dist/assets/useUnsavedChanges-bO5Ha9y6.js.map +1 -0
- package/dist/brand/apple-touch-icon.png +0 -0
- package/dist/brand/favicon.ico +0 -0
- package/dist/brand/micacms-favicon.svg +1 -0
- package/dist/brand/micacms-wordmark-light.svg +1 -0
- package/dist/brand/micacms-wordmark.svg +1 -0
- package/dist/index.html +6 -4
- package/package.json +2 -2
- package/dist/assets/ChangesView-aU_TiQsk.js +0 -7
- package/dist/assets/ChangesView-aU_TiQsk.js.map +0 -1
- package/dist/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-A3xi1Pww.js +0 -2
- package/dist/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-A3xi1Pww.js.map +0 -1
- package/dist/assets/EntryView-EdKf-RGT.js.map +0 -1
- package/dist/assets/LoginView-CNEoMKDH.js +0 -2
- package/dist/assets/LoginView-CNEoMKDH.js.map +0 -1
- package/dist/assets/MediaView-DZ8c7Ftz.js.map +0 -1
- package/dist/assets/PageHeader.vue_vue_type_script_setup_true_lang-BHQH-Q7U.js +0 -7
- package/dist/assets/SingletonView-Cq9s9GNX.js +0 -2
- package/dist/assets/SingletonView-Cq9s9GNX.js.map +0 -1
- package/dist/assets/SystemView-D6jgVaUD.js +0 -3
- package/dist/assets/SystemView-D6jgVaUD.js.map +0 -1
- package/dist/assets/index-BsCcwhm6.js.map +0 -1
- package/dist/assets/index-D9ZqpwC5.css +0 -1
- package/dist/assets/useUnsavedChanges-CCE0XMQT.js.map +0 -1
- package/dist/brand/mica-favicon.svg +0 -14
- package/dist/brand/mica-logo-glimmer-light.svg +0 -15
- package/dist/brand/mica-logo-glimmer.svg +0 -15
- package/dist/brand/mica-mark-glimmer.svg +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardView-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardView-7y5LY2BH.js","assets/PageHeader.vue_vue_type_script_setup_true_lang-IPw0xrLa.js","assets/CollectionView-Cu_ytsrZ.js","assets/format-Cpnr2As6.js","assets/plus-D6xxK_qW.js","assets/arrow-up-BeQh5rSe.js","assets/EntryView-IyBqYorV.js","assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-C4yhYMWf.js","assets/useUnsavedChanges-bO5Ha9y6.js","assets/useField-CQv2TS4g.js","assets/arrow-right-s8aI3aOk.js","assets/SingletonView-C3AqQe6a.js","assets/MediaView-BVODAshv.js","assets/ChangesView-D7n3k873.js","assets/SystemView-DKA_QdVz.js","assets/SystemView-CBvzzAoO.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var ul=Object.defineProperty;var fl=(e,t,n)=>t in e?ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ln=(e,t,n)=>fl(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
|
|
3
3
|
* @vue/shared v3.5.42
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
@@ -24,7 +24,7 @@ var ul=Object.defineProperty;var fl=(e,t,n)=>t in e?ul(e,t,{enumerable:!0,config
|
|
|
24
24
|
* vue-router v4.6.4
|
|
25
25
|
* (c) 2025 Eduardo San Martin Morote
|
|
26
26
|
* @license MIT
|
|
27
|
-
*/let hu=()=>location.protocol+"//"+location.host;function sl(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let o=r.includes(e.slice(i))?e.slice(i).length:1,l=r.slice(o);return l[0]!=="/"&&(l="/"+l),mi(l,"")}return mi(n,e)+s+r}function pu(e,t,n,s){let r=[],i=[],o=null;const l=({state:p})=>{const m=sl(e,location),E=n.value,_=t.value;let I=0;if(p){if(n.value=m,t.value=p,o&&o===E){o=null;return}I=_?p.position-_.position:0}else s(m);r.forEach(T=>{T(n.value,E,{delta:I,type:or.pop,direction:I?I>0?Bs.forward:Bs.back:Bs.unknown})})};function c(){o=n.value}function u(p){r.push(p);const m=()=>{const E=r.indexOf(p);E>-1&&r.splice(E,1)};return i.push(m),m}function a(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(q({},p.state,{scroll:As()}),"")}}function f(){for(const p of i)p();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",a),document.removeEventListener("visibilitychange",a)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",a),document.addEventListener("visibilitychange",a),{pauseListeners:c,listen:u,destroy:f}}function Ei(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?As():null}}function gu(e){const{history:t,location:n}=window,s={value:sl(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(c,u,a){const f=e.indexOf("#"),p=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+c:hu()+e+c;try{t[a?"replaceState":"pushState"](u,"",p),r.value=u}catch(m){console.error(m),n[a?"replace":"assign"](p)}}function o(c,u){i(c,q({},t.state,Ei(r.value.back,c,r.value.forward,!0),u,{position:r.value.position}),!0),s.value=c}function l(c,u){const a=q({},r.value,t.state,{forward:c,scroll:As()});i(a.current,a,!0),i(c,q({},Ei(s.value,c,null),{position:a.position+1},u),!1),s.value=c}return{location:s,state:r,push:l,replace:o}}function mu(e){e=eu(e);const t=gu(e),n=pu(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=q({location:"",base:e,go:s,createHref:nu.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Mt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var he=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(he||{});const _u={type:Mt.Static,value:""},yu=/[a-zA-Z0-9_]/;function vu(e){if(!e)return[[]];if(e==="/")return[[_u]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${u}": ${m}`)}let n=he.Static,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,c,u="",a="";function f(){u&&(n===he.Static?i.push({type:Mt.Static,value:u}):n===he.Param||n===he.ParamRegExp||n===he.ParamRegExpEnd?(i.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Mt.Param,value:u,regexp:a,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),u="")}function p(){u+=c}for(;l<e.length;){if(c=e[l++],c==="\\"&&n!==he.ParamRegExp){s=n,n=he.EscapeNext;continue}switch(n){case he.Static:c==="/"?(u&&f(),o()):c===":"?(f(),n=he.Param):p();break;case he.EscapeNext:p(),n=s;break;case he.Param:c==="("?n=he.ParamRegExp:yu.test(c)?p():(f(),n=he.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case he.ParamRegExp:c===")"?a[a.length-1]=="\\"?a=a.slice(0,-1)+c:n=he.ParamRegExpEnd:a+=c;break;case he.ParamRegExpEnd:f(),n=he.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,a="";break;default:t("Unknown state");break}}return n===he.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),o(),r}const xi="[^/]+?",bu={sensitive:!1,strict:!1,start:!0,end:!0};var Re=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Re||{});const Eu=/[.+*?^${}()[\]/\\]/g;function xu(e,t){const n=q({},bu,t),s=[];let r=n.start?"^":"";const i=[];for(const u of e){const a=u.length?[]:[Re.Root];n.strict&&!u.length&&(r+="/");for(let f=0;f<u.length;f++){const p=u[f];let m=Re.Segment+(n.sensitive?Re.BonusCaseSensitive:0);if(p.type===Mt.Static)f||(r+="/"),r+=p.value.replace(Eu,"\\$&"),m+=Re.Static;else if(p.type===Mt.Param){const{value:E,repeatable:_,optional:I,regexp:T}=p;i.push({name:E,repeatable:_,optional:I});const A=T||xi;if(A!==xi){m+=Re.BonusCustomRegExp;try{`${A}`}catch(O){throw new Error(`Invalid custom RegExp for param "${E}" (${A}): `+O.message)}}let M=_?`((?:${A})(?:/(?:${A}))*)`:`(${A})`;f||(M=I&&u.length<2?`(?:/${M})`:"/"+M),I&&(M+="?"),r+=M,m+=Re.Dynamic,I&&(m+=Re.BonusOptional),_&&(m+=Re.BonusRepeatable),A===".*"&&(m+=Re.BonusWildcard)}a.push(m)}s.push(a)}if(n.strict&&n.end){const u=s.length-1;s[u][s[u].length-1]+=Re.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const o=new RegExp(r,n.sensitive?"":"i");function l(u){const a=u.match(o),f={};if(!a)return null;for(let p=1;p<a.length;p++){const m=a[p]||"",E=i[p-1];f[E.name]=m&&E.repeatable?m.split("/"):m}return f}function c(u){let a="",f=!1;for(const p of e){(!f||!a.endsWith("/"))&&(a+="/"),f=!1;for(const m of p)if(m.type===Mt.Static)a+=m.value;else if(m.type===Mt.Param){const{value:E,repeatable:_,optional:I}=m,T=E in u?u[E]:"";if($e(T)&&!_)throw new Error(`Provided param "${E}" is an array but it is not repeatable (* or + modifiers)`);const A=$e(T)?T.join("/"):T;if(!A)if(I)p.length<2&&(a.endsWith("/")?a=a.slice(0,-1):f=!0);else throw new Error(`Missing required param "${E}"`);a+=A}}return a||"/"}return{re:o,score:s,keys:i,parse:l,stringify:c}}function wu(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Re.Static+Re.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Re.Static+Re.Segment?1:-1:0}function rl(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const i=wu(s[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-s.length)===1){if(wi(s))return 1;if(wi(r))return-1}return r.length-s.length}function wi(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Au={strict:!1,end:!0,sensitive:!1};function Su(e,t,n){const s=xu(vu(e.path),n),r=q(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ru(e,t){const n=[],s=new Map;t=gi(Au,t);function r(f){return s.get(f)}function i(f,p,m){const E=!m,_=Si(f);_.aliasOf=m&&m.record;const I=gi(t,f),T=[_];if("alias"in f){const O=typeof f.alias=="string"?[f.alias]:f.alias;for(const U of O)T.push(Si(q({},_,{components:m?m.record.components:_.components,path:U,aliasOf:m?m.record:_})))}let A,M;for(const O of T){const{path:U}=O;if(p&&U[0]!=="/"){const ie=p.record.path,V=ie[ie.length-1]==="/"?"":"/";O.path=p.record.path+(U&&V+U)}if(A=Su(O,p,I),m?m.alias.push(A):(M=M||A,M!==A&&M.alias.push(A),E&&f.name&&!Ri(A)&&o(f.name)),il(A)&&c(A),_.children){const ie=_.children;for(let V=0;V<ie.length;V++)i(ie[V],A,m&&m.children[V])}m=m||A}return M?()=>{o(M)}:xn}function o(f){if(el(f)){const p=s.get(f);p&&(s.delete(f),n.splice(n.indexOf(p),1),p.children.forEach(o),p.alias.forEach(o))}else{const p=n.indexOf(f);p>-1&&(n.splice(p,1),f.record.name&&s.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function l(){return n}function c(f){const p=Ou(f,n);n.splice(p,0,f),f.record.name&&!Ri(f)&&s.set(f.record.name,f)}function u(f,p){let m,E={},_,I;if("name"in f&&f.name){if(m=s.get(f.name),!m)throw on(ue.MATCHER_NOT_FOUND,{location:f});I=m.record.name,E=q(Ai(p.params,m.keys.filter(M=>!M.optional).concat(m.parent?m.parent.keys.filter(M=>M.optional):[]).map(M=>M.name)),f.params&&Ai(f.params,m.keys.map(M=>M.name))),_=m.stringify(E)}else if(f.path!=null)_=f.path,m=n.find(M=>M.re.test(_)),m&&(E=m.parse(_),I=m.record.name);else{if(m=p.name?s.get(p.name):n.find(M=>M.re.test(p.path)),!m)throw on(ue.MATCHER_NOT_FOUND,{location:f,currentLocation:p});I=m.record.name,E=q({},p.params,f.params),_=m.stringify(E)}const T=[];let A=m;for(;A;)T.unshift(A.record),A=A.parent;return{name:I,path:_,params:E,matched:T,meta:Tu(T)}}e.forEach(f=>i(f));function a(){n.length=0,s.clear()}return{addRoute:i,resolve:u,removeRoute:o,clearRoutes:a,getRoutes:l,getRecordMatcher:r}}function Ai(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Si(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Cu(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 Cu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Ri(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Tu(e){return e.reduce((t,n)=>q(t,n.meta),{})}function Ou(e,t){let n=0,s=t.length;for(;n!==s;){const i=n+s>>1;rl(e,t[i])<0?s=i:n=i+1}const r=Pu(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Pu(e){let t=e;for(;t=t.parent;)if(il(t)&&rl(e,t)===0)return t}function il({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ci(e){const t=Pe(Ss),n=Pe(Ir),s=re(()=>{const c=ee(e.to);return t.resolve(c)}),r=re(()=>{const{matched:c}=s.value,{length:u}=c,a=c[u-1],f=n.matched;if(!a||!f.length)return-1;const p=f.findIndex(rn.bind(null,a));if(p>-1)return p;const m=Ti(c[u-2]);return u>1&&Ti(a)===m&&f[f.length-1].path!==m?f.findIndex(rn.bind(null,c[u-2])):p}),i=re(()=>r.value>-1&&ku(n.params,s.value.params)),o=re(()=>r.value>-1&&r.value===n.matched.length-1&&Zo(n.params,s.value.params));function l(c={}){if(Du(c)){const u=t[ee(e.replace)?"replace":"push"](ee(e.to)).catch(xn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:s,href:re(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}function Iu(e){return e.length===1?e[0]:e}const Nu=ln({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"},viewTransition:Boolean},useLink:Ci,setup(e,{slots:t}){const n=ms(Ci(e)),{options:s}=Pe(Ss),r=re(()=>({[Oi(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Oi(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Iu(t.default(n));return e.custom?i:On("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Mu=Nu;function Du(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 ku(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!$e(r)||r.length!==s.length||s.some((i,o)=>i.valueOf()!==r[o].valueOf()))return!1}return!0}function Ti(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Oi=(e,t,n)=>e??t??n,Lu=ln({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Pe(cr),r=re(()=>e.route||s.value),i=Pe(bi,0),o=re(()=>{let u=ee(i);const{matched:a}=r.value;let f;for(;(f=a[u])&&!f.components;)u++;return u}),l=re(()=>r.value.matched[o.value]);zn(bi,re(()=>o.value+1)),zn(Pr,l),zn(cr,r);const c=Ve();return vn(()=>[c.value,l.value,e.name],([u,a,f],[p,m,E])=>{a&&(a.instances[f]=u,m&&m!==a&&u&&u===p&&(a.leaveGuards.size||(a.leaveGuards=m.leaveGuards),a.updateGuards.size||(a.updateGuards=m.updateGuards))),u&&a&&(!m||!rn(a,m)||!p)&&(a.enterCallbacks[f]||[]).forEach(_=>_(u))},{flush:"post"}),()=>{const u=r.value,a=e.name,f=l.value,p=f&&f.components[a];if(!p)return Pi(n.default,{Component:p,route:u});const m=f.props[a],E=m?m===!0?u.params:typeof m=="function"?m(u):m:null,I=On(p,q({},E,t,{onVnodeUnmounted:T=>{T.component.isUnmounted&&(f.instances[a]=null)},ref:c}));return Pi(n.default,{Component:I,route:u})||I}}});function Pi(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Fu=Lu;function Vu(e){const t=Ru(e.routes,e),n=e.parseQuery||uu,s=e.stringifyQuery||vi,r=e.history,i=dn(),o=dn(),l=dn(),c=$l(bt);let u=bt;qt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const a=js.bind(null,b=>""+b),f=js.bind(null,qa),p=js.bind(null,Pn);function m(b,D){let P,k;return el(b)?(P=t.getRecordMatcher(b),k=D):k=b,t.addRoute(k,P)}function E(b){const D=t.getRecordMatcher(b);D&&t.removeRoute(D)}function _(){return t.getRoutes().map(b=>b.record)}function I(b){return!!t.getRecordMatcher(b)}function T(b,D){if(D=q({},D||c.value),typeof b=="string"){const g=Hs(n,b,D.path),v=t.resolve({path:g.path},D),x=r.createHref(g.fullPath);return q(g,v,{params:p(v.params),hash:Pn(g.hash),redirectedFrom:void 0,href:x})}let P;if(b.path!=null)P=q({},b,{path:Hs(n,b.path,D.path).path});else{const g=q({},b.params);for(const v in g)g[v]==null&&delete g[v];P=q({},b,{params:f(g)}),D.params=f(D.params)}const k=t.resolve(P,D),$=b.hash||"";k.params=a(p(k.params));const d=Ya(s,q({},b,{hash:Ga($),path:k.path})),h=r.createHref(d);return q({fullPath:d,hash:$,query:s===vi?fu(b.query):b.query||{}},k,{redirectedFrom:void 0,href:h})}function A(b){return typeof b=="string"?Hs(n,b,c.value.path):q({},b)}function M(b,D){if(u!==b)return on(ue.NAVIGATION_CANCELLED,{from:D,to:b})}function O(b){return V(b)}function U(b){return O(q(A(b),{replace:!0}))}function ie(b,D){const P=b.matched[b.matched.length-1];if(P&&P.redirect){const{redirect:k}=P;let $=typeof k=="function"?k(b,D):k;return typeof $=="string"&&($=$.includes("?")||$.includes("#")?$=A($):{path:$},$.params={}),q({query:b.query,hash:b.hash,params:$.path!=null?{}:b.params},$)}}function V(b,D){const P=u=T(b),k=c.value,$=b.state,d=b.force,h=b.replace===!0,g=ie(P,k);if(g)return V(q(A(g),{state:typeof g=="object"?q({},$,g.state):$,force:d,replace:h}),D||P);const v=P;v.redirectedFrom=D;let x;return!d&&Qa(s,k,P)&&(x=on(ue.NAVIGATION_DUPLICATED,{to:v,from:k}),Ke(k,k,!0,!1)),(x?Promise.resolve(x):we(v,k)).catch(y=>lt(y)?lt(y,ue.NAVIGATION_GUARD_REDIRECT)?y:vt(y):W(y,v,k)).then(y=>{if(y){if(lt(y,ue.NAVIGATION_GUARD_REDIRECT))return V(q({replace:h},A(y.to),{state:typeof y.to=="object"?q({},$,y.to.state):$,force:d}),D||v)}else y=Ge(v,k,!0,h,$);return Ie(v,k,y),y})}function oe(b,D){const P=M(b,D);return P?Promise.reject(P):Promise.resolve()}function le(b){const D=Ut.values().next().value;return D&&typeof D.runWithContext=="function"?D.runWithContext(b):b()}function we(b,D){let P;const[k,$,d]=du(b,D);P=$s(k.reverse(),"beforeRouteLeave",b,D);for(const g of k)g.leaveGuards.forEach(v=>{P.push(wt(v,b,D))});const h=oe.bind(null,b,D);return P.push(h),Le(P).then(()=>{P=[];for(const g of i.list())P.push(wt(g,b,D));return P.push(h),Le(P)}).then(()=>{P=$s($,"beforeRouteUpdate",b,D);for(const g of $)g.updateGuards.forEach(v=>{P.push(wt(v,b,D))});return P.push(h),Le(P)}).then(()=>{P=[];for(const g of d)if(g.beforeEnter)if($e(g.beforeEnter))for(const v of g.beforeEnter)P.push(wt(v,b,D));else P.push(wt(g.beforeEnter,b,D));return P.push(h),Le(P)}).then(()=>(b.matched.forEach(g=>g.enterCallbacks={}),P=$s(d,"beforeRouteEnter",b,D,le),P.push(h),Le(P))).then(()=>{P=[];for(const g of o.list())P.push(wt(g,b,D));return P.push(h),Le(P)}).catch(g=>lt(g,ue.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function Ie(b,D,P){l.list().forEach(k=>le(()=>k(b,D,P)))}function Ge(b,D,P,k,$){const d=M(b,D);if(d)return d;const h=D===bt,g=qt?history.state:{};P&&(k||h?r.replace(b.fullPath,q({scroll:h&&g&&g.scroll},$)):r.push(b.fullPath,$)),c.value=b,Ke(b,D,P,h),vt()}let ke;function rt(){ke||(ke=r.listen((b,D,P)=>{if(!Ct.listening)return;const k=T(b),$=ie(k,Ct.currentRoute.value);if($){V(q($,{replace:!0,force:!0}),k).catch(xn);return}u=k;const d=c.value;qt&&iu(yi(d.fullPath,P.delta),As()),we(k,d).catch(h=>lt(h,ue.NAVIGATION_ABORTED|ue.NAVIGATION_CANCELLED)?h:lt(h,ue.NAVIGATION_GUARD_REDIRECT)?(V(q(A(h.to),{force:!0}),k).then(g=>{lt(g,ue.NAVIGATION_ABORTED|ue.NAVIGATION_DUPLICATED)&&!P.delta&&P.type===or.pop&&r.go(-1,!1)}).catch(xn),Promise.reject()):(P.delta&&r.go(-P.delta,!1),W(h,k,d))).then(h=>{h=h||Ge(k,d,!1),h&&(P.delta&&!lt(h,ue.NAVIGATION_CANCELLED)?r.go(-P.delta,!1):P.type===or.pop&<(h,ue.NAVIGATION_ABORTED|ue.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),Ie(k,d,h)}).catch(xn)}))}let Ft=dn(),pe=dn(),Q;function W(b,D,P){vt(b);const k=pe.list();return k.length?k.forEach($=>$(b,D,P)):console.error(b),Promise.reject(b)}function it(){return Q&&c.value!==bt?Promise.resolve():new Promise((b,D)=>{Ft.add([b,D])})}function vt(b){return Q||(Q=!b,rt(),Ft.list().forEach(([D,P])=>b?P(b):D()),Ft.reset()),b}function Ke(b,D,P,k){const{scrollBehavior:$}=e;if(!qt||!$)return Promise.resolve();const d=!P&&ou(yi(b.fullPath,0))||(k||!P)&&history.state&&history.state.scroll||null;return lo().then(()=>$(b,D,d)).then(h=>h&&ru(h)).catch(h=>W(h,b,D))}const Oe=b=>r.go(b);let Vt;const Ut=new Set,Ct={currentRoute:c,listening:!0,addRoute:m,removeRoute:E,clearRoutes:t.clearRoutes,hasRoute:I,getRoutes:_,resolve:T,options:e,push:O,replace:U,go:Oe,back:()=>Oe(-1),forward:()=>Oe(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:pe.add,isReady:it,install(b){b.component("RouterLink",Mu),b.component("RouterView",Fu),b.config.globalProperties.$router=Ct,Object.defineProperty(b.config.globalProperties,"$route",{enumerable:!0,get:()=>ee(c)}),qt&&!Vt&&c.value===bt&&(Vt=!0,O(r.location).catch(k=>{}));const D={};for(const k in bt)Object.defineProperty(D,k,{get:()=>c.value[k],enumerable:!0});b.provide(Ss,Ct),b.provide(Ir,so(D)),b.provide(cr,c);const P=b.unmount;Ut.add(b),b.unmount=function(){Ut.delete(b),Ut.size<1&&(u=bt,ke&&ke(),ke=null,c.value=bt,Vt=!1,Q=!1),P()}}};function Le(b){return b.reduce((D,P)=>D.then(()=>le(P)),Promise.resolve())}return Ct}function Uu(){return Pe(Ss)}function ol(e){return Pe(Ir)}const ju="/admin/brand/mica-logo-glimmer-light.svg",Hu="/admin/brand/mica-logo-glimmer.svg";/**
|
|
27
|
+
*/let hu=()=>location.protocol+"//"+location.host;function sl(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let o=r.includes(e.slice(i))?e.slice(i).length:1,l=r.slice(o);return l[0]!=="/"&&(l="/"+l),mi(l,"")}return mi(n,e)+s+r}function pu(e,t,n,s){let r=[],i=[],o=null;const l=({state:p})=>{const m=sl(e,location),E=n.value,_=t.value;let I=0;if(p){if(n.value=m,t.value=p,o&&o===E){o=null;return}I=_?p.position-_.position:0}else s(m);r.forEach(T=>{T(n.value,E,{delta:I,type:or.pop,direction:I?I>0?Bs.forward:Bs.back:Bs.unknown})})};function c(){o=n.value}function u(p){r.push(p);const m=()=>{const E=r.indexOf(p);E>-1&&r.splice(E,1)};return i.push(m),m}function a(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(q({},p.state,{scroll:As()}),"")}}function f(){for(const p of i)p();i=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",a),document.removeEventListener("visibilitychange",a)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",a),document.addEventListener("visibilitychange",a),{pauseListeners:c,listen:u,destroy:f}}function Ei(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?As():null}}function gu(e){const{history:t,location:n}=window,s={value:sl(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(c,u,a){const f=e.indexOf("#"),p=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+c:hu()+e+c;try{t[a?"replaceState":"pushState"](u,"",p),r.value=u}catch(m){console.error(m),n[a?"replace":"assign"](p)}}function o(c,u){i(c,q({},t.state,Ei(r.value.back,c,r.value.forward,!0),u,{position:r.value.position}),!0),s.value=c}function l(c,u){const a=q({},r.value,t.state,{forward:c,scroll:As()});i(a.current,a,!0),i(c,q({},Ei(s.value,c,null),{position:a.position+1},u),!1),s.value=c}return{location:s,state:r,push:l,replace:o}}function mu(e){e=eu(e);const t=gu(e),n=pu(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=q({location:"",base:e,go:s,createHref:nu.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let Mt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var he=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(he||{});const _u={type:Mt.Static,value:""},yu=/[a-zA-Z0-9_]/;function vu(e){if(!e)return[[]];if(e==="/")return[[_u]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${u}": ${m}`)}let n=he.Static,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,c,u="",a="";function f(){u&&(n===he.Static?i.push({type:Mt.Static,value:u}):n===he.Param||n===he.ParamRegExp||n===he.ParamRegExpEnd?(i.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Mt.Param,value:u,regexp:a,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),u="")}function p(){u+=c}for(;l<e.length;){if(c=e[l++],c==="\\"&&n!==he.ParamRegExp){s=n,n=he.EscapeNext;continue}switch(n){case he.Static:c==="/"?(u&&f(),o()):c===":"?(f(),n=he.Param):p();break;case he.EscapeNext:p(),n=s;break;case he.Param:c==="("?n=he.ParamRegExp:yu.test(c)?p():(f(),n=he.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case he.ParamRegExp:c===")"?a[a.length-1]=="\\"?a=a.slice(0,-1)+c:n=he.ParamRegExpEnd:a+=c;break;case he.ParamRegExpEnd:f(),n=he.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,a="";break;default:t("Unknown state");break}}return n===he.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),o(),r}const xi="[^/]+?",bu={sensitive:!1,strict:!1,start:!0,end:!0};var Re=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Re||{});const Eu=/[.+*?^${}()[\]/\\]/g;function xu(e,t){const n=q({},bu,t),s=[];let r=n.start?"^":"";const i=[];for(const u of e){const a=u.length?[]:[Re.Root];n.strict&&!u.length&&(r+="/");for(let f=0;f<u.length;f++){const p=u[f];let m=Re.Segment+(n.sensitive?Re.BonusCaseSensitive:0);if(p.type===Mt.Static)f||(r+="/"),r+=p.value.replace(Eu,"\\$&"),m+=Re.Static;else if(p.type===Mt.Param){const{value:E,repeatable:_,optional:I,regexp:T}=p;i.push({name:E,repeatable:_,optional:I});const A=T||xi;if(A!==xi){m+=Re.BonusCustomRegExp;try{`${A}`}catch(O){throw new Error(`Invalid custom RegExp for param "${E}" (${A}): `+O.message)}}let M=_?`((?:${A})(?:/(?:${A}))*)`:`(${A})`;f||(M=I&&u.length<2?`(?:/${M})`:"/"+M),I&&(M+="?"),r+=M,m+=Re.Dynamic,I&&(m+=Re.BonusOptional),_&&(m+=Re.BonusRepeatable),A===".*"&&(m+=Re.BonusWildcard)}a.push(m)}s.push(a)}if(n.strict&&n.end){const u=s.length-1;s[u][s[u].length-1]+=Re.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const o=new RegExp(r,n.sensitive?"":"i");function l(u){const a=u.match(o),f={};if(!a)return null;for(let p=1;p<a.length;p++){const m=a[p]||"",E=i[p-1];f[E.name]=m&&E.repeatable?m.split("/"):m}return f}function c(u){let a="",f=!1;for(const p of e){(!f||!a.endsWith("/"))&&(a+="/"),f=!1;for(const m of p)if(m.type===Mt.Static)a+=m.value;else if(m.type===Mt.Param){const{value:E,repeatable:_,optional:I}=m,T=E in u?u[E]:"";if($e(T)&&!_)throw new Error(`Provided param "${E}" is an array but it is not repeatable (* or + modifiers)`);const A=$e(T)?T.join("/"):T;if(!A)if(I)p.length<2&&(a.endsWith("/")?a=a.slice(0,-1):f=!0);else throw new Error(`Missing required param "${E}"`);a+=A}}return a||"/"}return{re:o,score:s,keys:i,parse:l,stringify:c}}function wu(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===Re.Static+Re.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Re.Static+Re.Segment?1:-1:0}function rl(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const i=wu(s[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-s.length)===1){if(wi(s))return 1;if(wi(r))return-1}return r.length-s.length}function wi(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Au={strict:!1,end:!0,sensitive:!1};function Su(e,t,n){const s=xu(vu(e.path),n),r=q(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ru(e,t){const n=[],s=new Map;t=gi(Au,t);function r(f){return s.get(f)}function i(f,p,m){const E=!m,_=Si(f);_.aliasOf=m&&m.record;const I=gi(t,f),T=[_];if("alias"in f){const O=typeof f.alias=="string"?[f.alias]:f.alias;for(const U of O)T.push(Si(q({},_,{components:m?m.record.components:_.components,path:U,aliasOf:m?m.record:_})))}let A,M;for(const O of T){const{path:U}=O;if(p&&U[0]!=="/"){const ie=p.record.path,V=ie[ie.length-1]==="/"?"":"/";O.path=p.record.path+(U&&V+U)}if(A=Su(O,p,I),m?m.alias.push(A):(M=M||A,M!==A&&M.alias.push(A),E&&f.name&&!Ri(A)&&o(f.name)),il(A)&&c(A),_.children){const ie=_.children;for(let V=0;V<ie.length;V++)i(ie[V],A,m&&m.children[V])}m=m||A}return M?()=>{o(M)}:xn}function o(f){if(el(f)){const p=s.get(f);p&&(s.delete(f),n.splice(n.indexOf(p),1),p.children.forEach(o),p.alias.forEach(o))}else{const p=n.indexOf(f);p>-1&&(n.splice(p,1),f.record.name&&s.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function l(){return n}function c(f){const p=Ou(f,n);n.splice(p,0,f),f.record.name&&!Ri(f)&&s.set(f.record.name,f)}function u(f,p){let m,E={},_,I;if("name"in f&&f.name){if(m=s.get(f.name),!m)throw on(ue.MATCHER_NOT_FOUND,{location:f});I=m.record.name,E=q(Ai(p.params,m.keys.filter(M=>!M.optional).concat(m.parent?m.parent.keys.filter(M=>M.optional):[]).map(M=>M.name)),f.params&&Ai(f.params,m.keys.map(M=>M.name))),_=m.stringify(E)}else if(f.path!=null)_=f.path,m=n.find(M=>M.re.test(_)),m&&(E=m.parse(_),I=m.record.name);else{if(m=p.name?s.get(p.name):n.find(M=>M.re.test(p.path)),!m)throw on(ue.MATCHER_NOT_FOUND,{location:f,currentLocation:p});I=m.record.name,E=q({},p.params,f.params),_=m.stringify(E)}const T=[];let A=m;for(;A;)T.unshift(A.record),A=A.parent;return{name:I,path:_,params:E,matched:T,meta:Tu(T)}}e.forEach(f=>i(f));function a(){n.length=0,s.clear()}return{addRoute:i,resolve:u,removeRoute:o,clearRoutes:a,getRoutes:l,getRecordMatcher:r}}function Ai(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Si(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Cu(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 Cu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Ri(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Tu(e){return e.reduce((t,n)=>q(t,n.meta),{})}function Ou(e,t){let n=0,s=t.length;for(;n!==s;){const i=n+s>>1;rl(e,t[i])<0?s=i:n=i+1}const r=Pu(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function Pu(e){let t=e;for(;t=t.parent;)if(il(t)&&rl(e,t)===0)return t}function il({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ci(e){const t=Pe(Ss),n=Pe(Ir),s=re(()=>{const c=ee(e.to);return t.resolve(c)}),r=re(()=>{const{matched:c}=s.value,{length:u}=c,a=c[u-1],f=n.matched;if(!a||!f.length)return-1;const p=f.findIndex(rn.bind(null,a));if(p>-1)return p;const m=Ti(c[u-2]);return u>1&&Ti(a)===m&&f[f.length-1].path!==m?f.findIndex(rn.bind(null,c[u-2])):p}),i=re(()=>r.value>-1&&ku(n.params,s.value.params)),o=re(()=>r.value>-1&&r.value===n.matched.length-1&&Zo(n.params,s.value.params));function l(c={}){if(Du(c)){const u=t[ee(e.replace)?"replace":"push"](ee(e.to)).catch(xn);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:s,href:re(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}function Iu(e){return e.length===1?e[0]:e}const Nu=ln({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"},viewTransition:Boolean},useLink:Ci,setup(e,{slots:t}){const n=ms(Ci(e)),{options:s}=Pe(Ss),r=re(()=>({[Oi(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Oi(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Iu(t.default(n));return e.custom?i:On("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Mu=Nu;function Du(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 ku(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!$e(r)||r.length!==s.length||s.some((i,o)=>i.valueOf()!==r[o].valueOf()))return!1}return!0}function Ti(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Oi=(e,t,n)=>e??t??n,Lu=ln({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Pe(cr),r=re(()=>e.route||s.value),i=Pe(bi,0),o=re(()=>{let u=ee(i);const{matched:a}=r.value;let f;for(;(f=a[u])&&!f.components;)u++;return u}),l=re(()=>r.value.matched[o.value]);zn(bi,re(()=>o.value+1)),zn(Pr,l),zn(cr,r);const c=Ve();return vn(()=>[c.value,l.value,e.name],([u,a,f],[p,m,E])=>{a&&(a.instances[f]=u,m&&m!==a&&u&&u===p&&(a.leaveGuards.size||(a.leaveGuards=m.leaveGuards),a.updateGuards.size||(a.updateGuards=m.updateGuards))),u&&a&&(!m||!rn(a,m)||!p)&&(a.enterCallbacks[f]||[]).forEach(_=>_(u))},{flush:"post"}),()=>{const u=r.value,a=e.name,f=l.value,p=f&&f.components[a];if(!p)return Pi(n.default,{Component:p,route:u});const m=f.props[a],E=m?m===!0?u.params:typeof m=="function"?m(u):m:null,I=On(p,q({},E,t,{onVnodeUnmounted:T=>{T.component.isUnmounted&&(f.instances[a]=null)},ref:c}));return Pi(n.default,{Component:I,route:u})||I}}});function Pi(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Fu=Lu;function Vu(e){const t=Ru(e.routes,e),n=e.parseQuery||uu,s=e.stringifyQuery||vi,r=e.history,i=dn(),o=dn(),l=dn(),c=$l(bt);let u=bt;qt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const a=js.bind(null,b=>""+b),f=js.bind(null,qa),p=js.bind(null,Pn);function m(b,D){let P,k;return el(b)?(P=t.getRecordMatcher(b),k=D):k=b,t.addRoute(k,P)}function E(b){const D=t.getRecordMatcher(b);D&&t.removeRoute(D)}function _(){return t.getRoutes().map(b=>b.record)}function I(b){return!!t.getRecordMatcher(b)}function T(b,D){if(D=q({},D||c.value),typeof b=="string"){const g=Hs(n,b,D.path),v=t.resolve({path:g.path},D),x=r.createHref(g.fullPath);return q(g,v,{params:p(v.params),hash:Pn(g.hash),redirectedFrom:void 0,href:x})}let P;if(b.path!=null)P=q({},b,{path:Hs(n,b.path,D.path).path});else{const g=q({},b.params);for(const v in g)g[v]==null&&delete g[v];P=q({},b,{params:f(g)}),D.params=f(D.params)}const k=t.resolve(P,D),$=b.hash||"";k.params=a(p(k.params));const d=Ya(s,q({},b,{hash:Ga($),path:k.path})),h=r.createHref(d);return q({fullPath:d,hash:$,query:s===vi?fu(b.query):b.query||{}},k,{redirectedFrom:void 0,href:h})}function A(b){return typeof b=="string"?Hs(n,b,c.value.path):q({},b)}function M(b,D){if(u!==b)return on(ue.NAVIGATION_CANCELLED,{from:D,to:b})}function O(b){return V(b)}function U(b){return O(q(A(b),{replace:!0}))}function ie(b,D){const P=b.matched[b.matched.length-1];if(P&&P.redirect){const{redirect:k}=P;let $=typeof k=="function"?k(b,D):k;return typeof $=="string"&&($=$.includes("?")||$.includes("#")?$=A($):{path:$},$.params={}),q({query:b.query,hash:b.hash,params:$.path!=null?{}:b.params},$)}}function V(b,D){const P=u=T(b),k=c.value,$=b.state,d=b.force,h=b.replace===!0,g=ie(P,k);if(g)return V(q(A(g),{state:typeof g=="object"?q({},$,g.state):$,force:d,replace:h}),D||P);const v=P;v.redirectedFrom=D;let x;return!d&&Qa(s,k,P)&&(x=on(ue.NAVIGATION_DUPLICATED,{to:v,from:k}),Ke(k,k,!0,!1)),(x?Promise.resolve(x):we(v,k)).catch(y=>lt(y)?lt(y,ue.NAVIGATION_GUARD_REDIRECT)?y:vt(y):W(y,v,k)).then(y=>{if(y){if(lt(y,ue.NAVIGATION_GUARD_REDIRECT))return V(q({replace:h},A(y.to),{state:typeof y.to=="object"?q({},$,y.to.state):$,force:d}),D||v)}else y=Ge(v,k,!0,h,$);return Ie(v,k,y),y})}function oe(b,D){const P=M(b,D);return P?Promise.reject(P):Promise.resolve()}function le(b){const D=Ut.values().next().value;return D&&typeof D.runWithContext=="function"?D.runWithContext(b):b()}function we(b,D){let P;const[k,$,d]=du(b,D);P=$s(k.reverse(),"beforeRouteLeave",b,D);for(const g of k)g.leaveGuards.forEach(v=>{P.push(wt(v,b,D))});const h=oe.bind(null,b,D);return P.push(h),Le(P).then(()=>{P=[];for(const g of i.list())P.push(wt(g,b,D));return P.push(h),Le(P)}).then(()=>{P=$s($,"beforeRouteUpdate",b,D);for(const g of $)g.updateGuards.forEach(v=>{P.push(wt(v,b,D))});return P.push(h),Le(P)}).then(()=>{P=[];for(const g of d)if(g.beforeEnter)if($e(g.beforeEnter))for(const v of g.beforeEnter)P.push(wt(v,b,D));else P.push(wt(g.beforeEnter,b,D));return P.push(h),Le(P)}).then(()=>(b.matched.forEach(g=>g.enterCallbacks={}),P=$s(d,"beforeRouteEnter",b,D,le),P.push(h),Le(P))).then(()=>{P=[];for(const g of o.list())P.push(wt(g,b,D));return P.push(h),Le(P)}).catch(g=>lt(g,ue.NAVIGATION_CANCELLED)?g:Promise.reject(g))}function Ie(b,D,P){l.list().forEach(k=>le(()=>k(b,D,P)))}function Ge(b,D,P,k,$){const d=M(b,D);if(d)return d;const h=D===bt,g=qt?history.state:{};P&&(k||h?r.replace(b.fullPath,q({scroll:h&&g&&g.scroll},$)):r.push(b.fullPath,$)),c.value=b,Ke(b,D,P,h),vt()}let ke;function rt(){ke||(ke=r.listen((b,D,P)=>{if(!Ct.listening)return;const k=T(b),$=ie(k,Ct.currentRoute.value);if($){V(q($,{replace:!0,force:!0}),k).catch(xn);return}u=k;const d=c.value;qt&&iu(yi(d.fullPath,P.delta),As()),we(k,d).catch(h=>lt(h,ue.NAVIGATION_ABORTED|ue.NAVIGATION_CANCELLED)?h:lt(h,ue.NAVIGATION_GUARD_REDIRECT)?(V(q(A(h.to),{force:!0}),k).then(g=>{lt(g,ue.NAVIGATION_ABORTED|ue.NAVIGATION_DUPLICATED)&&!P.delta&&P.type===or.pop&&r.go(-1,!1)}).catch(xn),Promise.reject()):(P.delta&&r.go(-P.delta,!1),W(h,k,d))).then(h=>{h=h||Ge(k,d,!1),h&&(P.delta&&!lt(h,ue.NAVIGATION_CANCELLED)?r.go(-P.delta,!1):P.type===or.pop&<(h,ue.NAVIGATION_ABORTED|ue.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),Ie(k,d,h)}).catch(xn)}))}let Ft=dn(),pe=dn(),Q;function W(b,D,P){vt(b);const k=pe.list();return k.length?k.forEach($=>$(b,D,P)):console.error(b),Promise.reject(b)}function it(){return Q&&c.value!==bt?Promise.resolve():new Promise((b,D)=>{Ft.add([b,D])})}function vt(b){return Q||(Q=!b,rt(),Ft.list().forEach(([D,P])=>b?P(b):D()),Ft.reset()),b}function Ke(b,D,P,k){const{scrollBehavior:$}=e;if(!qt||!$)return Promise.resolve();const d=!P&&ou(yi(b.fullPath,0))||(k||!P)&&history.state&&history.state.scroll||null;return lo().then(()=>$(b,D,d)).then(h=>h&&ru(h)).catch(h=>W(h,b,D))}const Oe=b=>r.go(b);let Vt;const Ut=new Set,Ct={currentRoute:c,listening:!0,addRoute:m,removeRoute:E,clearRoutes:t.clearRoutes,hasRoute:I,getRoutes:_,resolve:T,options:e,push:O,replace:U,go:Oe,back:()=>Oe(-1),forward:()=>Oe(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:pe.add,isReady:it,install(b){b.component("RouterLink",Mu),b.component("RouterView",Fu),b.config.globalProperties.$router=Ct,Object.defineProperty(b.config.globalProperties,"$route",{enumerable:!0,get:()=>ee(c)}),qt&&!Vt&&c.value===bt&&(Vt=!0,O(r.location).catch(k=>{}));const D={};for(const k in bt)Object.defineProperty(D,k,{get:()=>c.value[k],enumerable:!0});b.provide(Ss,Ct),b.provide(Ir,so(D)),b.provide(cr,c);const P=b.unmount;Ut.add(b),b.unmount=function(){Ut.delete(b),Ut.size<1&&(u=bt,ke&&ke(),ke=null,c.value=bt,Vt=!1,Q=!1),P()}}};function Le(b){return b.reduce((D,P)=>D.then(()=>le(P)),Promise.resolve())}return Ct}function Uu(){return Pe(Ss)}function ol(e){return Pe(Ir)}const ju="/admin/brand/micacms-wordmark-light.svg",Hu="/admin/brand/micacms-wordmark.svg";/**
|
|
28
28
|
* @license @lucide/vue v1.37.0 - ISC
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the ISC license.
|
|
@@ -114,5 +114,5 @@ var ul=Object.defineProperty;var fl=(e,t,n)=>t in e?ul(e,t,{enumerable:!0,config
|
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const ff=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],df=yt("x",ff),ar="/api";class Zt extends Error{constructor(n,s,r,i=[]){super(r);Ln(this,"status");Ln(this,"code");Ln(this,"issues");this.name="ApiError",this.status=n,this.code=s,this.issues=i}get isUnauthenticated(){return this.status===401}}function hf(){const e=/(?:^|;\s*)mica_csrf=([^;]*)/.exec(document.cookie);return e!=null&&e[1]?decodeURIComponent(e[1]):""}async function ae(e,t={}){var u,a,f;const n=new URL(`${ar}${e}`,window.location.origin);for(const[p,m]of Object.entries(t.query??{}))m!==void 0&&m!==""&&n.searchParams.set(p,String(m));const s={},r=t.method??"GET";r!=="GET"&&(s["x-csrf-token"]=hf());const i=t.body instanceof FormData;t.body!==void 0&&!i&&(s["content-type"]="application/json");let o;try{o=await fetch(n,{method:r,headers:s,credentials:"same-origin",signal:t.signal,body:i?t.body:t.body!==void 0?JSON.stringify(t.body):void 0})}catch(p){throw p.name==="AbortError"?p:new Zt(0,"network_error","Could not reach the server. Check your connection.")}if(o.status===204)return;const l=await o.text(),c=l?JSON.parse(l):null;if(!o.ok){const p=c;throw new Zt(o.status,((u=p==null?void 0:p.error)==null?void 0:u.code)??"error",((a=p==null?void 0:p.error)==null?void 0:a.message)??`Request failed (${o.status}).`,((f=p==null?void 0:p.error)==null?void 0:f.issues)??[])}return c}const zt={auth:{me:()=>ae("/auth/me"),config:()=>ae("/auth/config"),signInUrl:e=>`${ar}/auth/login?returnTo=${encodeURIComponent(e)}`,logout:()=>ae("/auth/logout",{method:"POST"})},schema:()=>ae("/admin/schema"),overview:()=>ae("/admin/overview"),system:()=>ae("/admin/system"),entries:{list:(e,t={})=>ae(`/admin/collections/${e}/entries`,{query:t}),get:(e,t)=>ae(`/admin/collections/${e}/entries/${t}`),create:(e,t)=>ae(`/admin/collections/${e}/entries`,{method:"POST",body:t}),update:(e,t,n)=>ae(`/admin/collections/${e}/entries/${t}`,{method:"PUT",body:n}),remove:(e,t)=>ae(`/admin/collections/${e}/entries/${t}`,{method:"DELETE"}),reorder:(e,t)=>ae(`/admin/collections/${e}/reorder`,{method:"POST",body:{slugs:t}}),suggestSlug:(e,t,n)=>ae(`/admin/collections/${e}/slug`,{query:{source:t,except:n}}),references:(e,t)=>ae(`/admin/collections/${e}/entries/${t}/references`)},singletons:{get:e=>ae(`/admin/singletons/${e}`),save:(e,t,n)=>ae(`/admin/singletons/${e}`,{method:"PUT",body:{data:t,revision:n}})},staging:{changes:()=>ae("/admin/changes"),publish:(e,t)=>ae("/admin/publish",{method:"POST",body:{message:e,expectedBase:t}}),push:()=>ae("/admin/publish/push",{method:"POST"}),discard:e=>ae("/admin/changes/discard",{method:"POST",body:{paths:e}}),compare:e=>ae(`/admin/changes/compare?${new URLSearchParams(e)}`)},media:{list:()=>ae("/admin/media"),upload:(e,t={})=>{const n=new FormData;for(const s of e)n.append("file",s);return t.accept&&n.append("accept",t.accept),t.directory&&n.append("directory",t.directory),ae("/admin/media",{method:"POST",body:n})},url:e=>`${ar}/admin/media/file/${e.split("/").map(encodeURIComponent).join("/")}`}},Ye=Ve(null);let Kn=null;function ll(){return{schema:re(()=>Ye.value),collections:re(()=>{var e;return((e=Ye.value)==null?void 0:e.collections)??[]}),singletons:re(()=>{var e;return((e=Ye.value)==null?void 0:e.singletons)??[]}),loaded:re(()=>Ye.value!==null),async load(e=!1){return Ye.value&&!e?Ye.value:(Kn??(Kn=zt.schema().then(t=>(Ye.value=t,Kn=null,t))),Kn)},collection(e){var t;return(t=Ye.value)==null?void 0:t.collections.find(n=>n.name===e)},singleton(e){var t;return(t=Ye.value)==null?void 0:t.singletons.find(n=>n.name===e)},reset(){Ye.value=null,Kn=null}}}const Bt=Ve(null),$t=Ve(!1),Gs=Ve(!1),Ks=Ve(null);function Rs(){return{identity:re(()=>Bt.value),isActive:re(()=>$t.value),checked:re(()=>Gs.value),config:re(()=>Ks.value),showsIdentity:re(()=>{var e;return((e=Ks.value)==null?void 0:e.authRequired)===!0}),async restore(){try{const e=await zt.auth.config();if(Ks.value=e,!e.authRequired){Bt.value=null,$t.value=!0;return}const t=await zt.auth.me();Bt.value=t.identity,$t.value=!0}catch(e){(!(e instanceof Zt)||!e.isUnauthenticated)&&console.error("Failed to restore session",e),Bt.value=null,$t.value=!1}finally{Gs.value=!0}},signIn(e="/admin/"){window.location.href=zt.auth.signInUrl(e)},async signOut(){let e=null;try{({endSession:e}=await zt.auth.logout())}finally{Bt.value=null,$t.value=!1}e&&(window.location.href=e)},clear(){Bt.value=null,$t.value=!1,Gs.value=!0}}}function pf(e){const t=new Map;for(const n of e){const s=n.owner,r=s.kind==="entry"?`entry:${s.collection}/${s.slug}`:s.kind==="singleton"?`singleton:${s.name}`:s.kind==="order"?`order:${s.collection}`:s.kind==="media"?"media":`other:${n.path}`;let i=t.get(r);i||(i={key:r,label:s.label,link:s.kind==="entry"&&(n.kind!=="delete"||s.renamedFrom)?{name:"entry",params:{collection:s.collection,slug:s.slug}}:s.kind==="singleton"?{name:"singleton",params:{name:s.name}}:s.kind==="media"?{name:"media"}:null,fileChanges:[],target:s.kind==="entry"?{kind:"entry",collection:s.collection,slug:s.slug,...s.renamedFrom?{from:s.renamedFrom}:{}}:s.kind==="singleton"?{kind:"singleton",name:s.name}:s.kind==="order"?{kind:"order",collection:s.collection}:null},t.set(r,i)),i.fileChanges.push(n)}return[...t.values()]}const Yn=Ve(null),Mi=re(()=>{var e;return pf(((e=Yn.value)==null?void 0:e.changes)??[])});let Wn=null;function gf(){return{status:re(()=>Yn.value),edits:Mi,editCount:re(()=>Mi.value.length),async refresh(){return Wn??(Wn=zt.staging.changes().then(e=>{Yn.value=e}).catch(()=>{}).finally(()=>{Wn=null})),Wn},reset(){Yn.value=null,Wn=null}}}const mf={class:"flex min-h-full"},_f={class:"flex-1 space-y-5 overflow-y-auto px-2 py-3","aria-label":"Main"},yf=["aria-label"],vf={key:0},bf={key:1},Ef={key:0,class:"border-t border-white/10 p-2"},xf={class:"flex items-center gap-2.5 rounded-md px-2 py-2"},wf={class:"grid h-6 w-6 shrink-0 place-items-center rounded-full bg-accent text-[10px] font-semibold text-white","aria-hidden":"true"},Af={class:"min-w-0 flex-1"},Sf={class:"block truncate text-xs font-medium text-white/80"},Rf={class:"flex min-w-0 flex-1 flex-col"},Cf={class:"sticky top-0 z-10 flex h-14 items-center gap-3 border-b border-line bg-white/90 px-4 backdrop-blur lg:hidden"},Tf=["aria-expanded"],Of={class:"min-w-0 flex-1 bg-surface"},Pf=ln({__name:"AppShell",setup(e){const t=ol(),n=Uu(),s=Rs(),r=gf(),{collections:i,singletons:o}=ll(),l=Ve(!1);vn(()=>t.fullPath,()=>{l.value=!1,r.refresh()}),vo(()=>void r.refresh());const c=re(()=>{var f,p;return(((f=s.identity.value)==null?void 0:f.name)||((p=s.identity.value)==null?void 0:p.email)||"").split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(m=>{var E;return((E=m[0])==null?void 0:E.toUpperCase())??""}).join("")||"?"});async function u(){await s.signOut(),await n.push({name:"login"})}return(a,f)=>{var m,E;const p=Eo("RouterLink");return fe(),Me("div",mf,[l.value?(fe(),Me("div",{key:0,class:"fixed inset-0 z-20 bg-black/25 lg:hidden","aria-hidden":"true",onClick:f[0]||(f[0]=_=>l.value=!1)})):Kt("",!0),Z("aside",{id:"main-navigation",class:en(["fixed inset-y-0 left-0 z-30 flex w-[220px] shrink-0 flex-col border-r border-white/10 bg-[#111110] text-white transition-transform lg:static lg:translate-x-0",l.value?"translate-x-0":"-translate-x-full"])},[f[10]||(f[10]=Z("div",{class:"flex h-14 items-center border-b border-white/10 px-3"},[Z("img",{src:ju,alt:"Mica",class:"h-7 w-auto"})],-1)),Z("nav",_f,[Z("div",null,[K(p,{to:{name:"dashboard"},class:"nav-link"},{default:at(()=>[K(ee(Zu),{size:14,"aria-hidden":"true"}),f[2]||(f[2]=It(" Overview ",-1))]),_:1}),K(p,{to:{name:"changes"},class:"nav-link"},{default:at(()=>[K(ee(of),{size:14,"aria-hidden":"true"}),f[3]||(f[3]=Z("span",{class:"flex-1"},"Publish",-1)),ee(r).editCount.value>0?(fe(),Me("span",{key:0,class:"rounded-full bg-accent px-1.5 py-0.5 font-mono text-[10px] font-semibold leading-none text-white","aria-label":`${ee(r).editCount.value} pending edit${ee(r).editCount.value===1?"":"s"}`},At(ee(r).editCount.value),9,yf)):Kt("",!0)]),_:1})]),ee(i).length?(fe(),Me("div",vf,[f[5]||(f[5]=Z("p",{class:"nav-heading"},"Content",-1)),(fe(!0),Me(Ee,null,Zs(ee(i),_=>(fe(),Rt(p,{key:_.name,to:{name:"collection",params:{collection:_.name}},class:"nav-link"},{default:at(()=>[K(ee(Ju),{size:14,"aria-hidden":"true"}),It(" "+At(_.label),1)]),_:2},1032,["to"]))),128)),K(p,{to:{name:"media"},class:"nav-link"},{default:at(()=>[K(ee(Qu),{size:14,"aria-hidden":"true"}),f[4]||(f[4]=It(" Media ",-1))]),_:1})])):Kt("",!0),ee(o).length?(fe(),Me("div",bf,[f[6]||(f[6]=Z("p",{class:"nav-heading"},"Settings",-1)),(fe(!0),Me(Ee,null,Zs(ee(o),_=>(fe(),Rt(p,{key:_.name,to:{name:"singleton",params:{name:_.name}},class:"nav-link"},{default:at(()=>[K(ee(uf),{size:14,"aria-hidden":"true"}),It(" "+At(_.label),1)]),_:2},1032,["to"]))),128))])):Kt("",!0),Z("div",null,[f[8]||(f[8]=Z("p",{class:"nav-heading"},"Deployment",-1)),K(p,{to:{name:"system"},class:"nav-link"},{default:at(()=>[K(ee(cf),{size:14,"aria-hidden":"true"}),f[7]||(f[7]=It(" System ",-1))]),_:1})])]),ee(s).showsIdentity.value?(fe(),Me("div",Ef,[Z("div",xf,[Z("span",wf,At(c.value),1),Z("span",Af,[Z("span",Sf,At(((m=ee(s).identity.value)==null?void 0:m.name)||((E=ee(s).identity.value)==null?void 0:E.email)),1)])]),Z("button",{type:"button",class:"sidebar-signout mt-1 w-full",onClick:u},[K(ee(tf),{size:14,"aria-hidden":"true"}),f[9]||(f[9]=It(" Sign out ",-1))])])):Kt("",!0)],2),Z("div",Rf,[Z("header",Cf,[Z("button",{type:"button",class:"btn-ghost -ml-1 px-2","aria-expanded":l.value,"aria-controls":"main-navigation",onClick:f[1]||(f[1]=_=>l.value=!l.value)},[K(ee(sf),{size:20,"aria-hidden":"true"}),f[11]||(f[11]=Z("span",{class:"sr-only"},"Toggle navigation",-1))],8,Tf),f[12]||(f[12]=Z("img",{src:Hu,alt:"Mica",class:"h-7 w-auto"},null,-1))]),Z("main",Of,[yc(a.$slots,"default",{},void 0,!0)])])])}}}),If=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Nf=If(Pf,[["__scopeId","data-v-3e138196"]]),In=Ve([]);let Mf=1;function Ws(e,t,n){const s=Mf++;return In.value=[...In.value,{id:s,kind:e,message:t,detail:n}],e!=="error"&&setTimeout(()=>cl(s),4e3),s}function cl(e){In.value=In.value.filter(t=>t.id!==e)}function al(){return{toasts:Xn(In),success:(e,t)=>Ws("success",e,t),error:(e,t)=>Ws("error",e,t),info:(e,t)=>Ws("info",e,t),dismiss:cl}}const Df={class:"pointer-events-none fixed inset-x-0 bottom-0 z-50 flex flex-col items-center gap-2 p-4 sm:items-end",role:"status","aria-live":"assertive"},kf={class:"min-w-0 flex-1"},Lf={class:"text-sm font-medium"},Ff={key:0,class:"mt-0.5 text-sm opacity-80"},Vf=["onClick"],Uf=ln({__name:"ToastStack",setup(e){const{toasts:t,dismiss:n}=al(),s={success:"border-success/15 bg-success-soft text-success",error:"border-danger/15 bg-danger-soft text-danger",info:"border-info/15 bg-info-soft text-info"},r={success:"bg-success",error:"bg-danger",info:"bg-info"};return(i,o)=>(fe(),Me("div",Df,[(fe(!0),Me(Ee,null,Zs(ee(t),l=>(fe(),Me("div",{key:l.id,class:en(["pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-md border p-4 shadow-lg",s[l.kind]])},[Z("span",{class:en(["mt-1.5 h-2 w-2 shrink-0 rounded-full",r[l.kind]]),"aria-hidden":"true"},null,2),Z("div",kf,[Z("p",Lf,At(l.message),1),l.detail?(fe(),Me("p",Ff,At(l.detail),1)):Kt("",!0)]),Z("button",{type:"button",class:"-m-1 shrink-0 rounded p-1 opacity-60 hover:opacity-100",onClick:c=>ee(n)(l.id)},[K(ee(df),{size:16,"aria-hidden":"true"}),o[0]||(o[0]=Z("span",{class:"sr-only"},"Dismiss",-1))],8,Vf)],2))),128))]))}}),jf=ln({__name:"App",setup(e){const t=ol(),n=Rs(),s=re(()=>n.isActive.value&&!t.meta.public);return(r,i)=>{const o=Eo("RouterView");return fe(),Me(Ee,null,[K(Uf),s.value?(fe(),Rt(Nf,{key:0},{default:at(()=>[K(o,null,{default:at(({Component:l,route:c})=>[(fe(),Rt(_c(l),{key:c.fullPath}))]),_:1})]),_:1})):(fe(),Rt(o,{key:1}))],64)}}}),Hf="modulepreload",Bf=function(e){return"/admin/"+e},Di={},Qe=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(a=>Promise.resolve(a).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=o(n.map(u=>{if(u=Bf(u),u in Di)return;Di[u]=!0;const a=u.endsWith(".css"),f=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const p=document.createElement("link");if(p.rel=a?"stylesheet":Hf,a||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),a)return new Promise((m,E)=>{p.addEventListener("load",m),p.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},$f=[{path:"/login",name:"login",component:()=>Qe(()=>import("./LoginView-CNEoMKDH.js"),[]),meta:{public:!0,title:"Sign in"}},{path:"/",name:"dashboard",component:()=>Qe(()=>import("./DashboardView-Dn6J5mjy.js"),__vite__mapDeps([0,1])),meta:{title:"Overview"}},{path:"/collections/:collection",name:"collection",component:()=>Qe(()=>import("./CollectionView-BL9-uTTb.js"),__vite__mapDeps([2,1,3,4,5])),props:!0},{path:"/collections/:collection/new",name:"entry-new",component:()=>Qe(()=>import("./EntryView-EdKf-RGT.js"),__vite__mapDeps([6,7,8,9,10,4,1])),props:!0},{path:"/collections/:collection/:slug",name:"entry",component:()=>Qe(()=>import("./EntryView-EdKf-RGT.js"),__vite__mapDeps([6,7,8,9,10,4,1])),props:!0},{path:"/singletons/:name",name:"singleton",component:()=>Qe(()=>import("./SingletonView-Cq9s9GNX.js"),__vite__mapDeps([11,8,9,10,4,1])),props:!0},{path:"/media",name:"media",component:()=>Qe(()=>import("./MediaView-DZ8c7Ftz.js"),__vite__mapDeps([12,1,3])),meta:{title:"Media"}},{path:"/changes",name:"changes",component:()=>Qe(()=>import("./ChangesView-aU_TiQsk.js"),__vite__mapDeps([13,9,7,1])),meta:{title:"Publish"}},{path:"/system",name:"system",component:()=>Qe(()=>import("./SystemView-D6jgVaUD.js"),__vite__mapDeps([14,1,3,10,15])),meta:{title:"System"}},{path:"/:pathMatch(.*)*",name:"not-found",component:()=>Qe(()=>import("./NotFoundView-DAJd7RdP.js"),[]),meta:{title:"Not found"}}],Cs=Vu({history:mu("/admin/"),routes:$f,scrollBehavior:(e,t,n)=>n??{top:0}});Cs.beforeEach(async e=>{const t=Rs();return t.checked.value||await t.restore(),e.meta.public?t.isActive.value?{name:"dashboard"}:!0:t.isActive.value?(await ll().load(),!0):{name:"login",query:e.fullPath==="/"?{}:{redirect:e.fullPath}}});Cs.afterEach(e=>{const t=typeof e.meta.title=="string"?e.meta.title:null;document.title=t?`${t} · Mica`:"Mica"});const Nr=Ia(jf);Nr.config.errorHandler=e=>{if(e instanceof Zt&&e.isUnauthenticated){Rs().clear(),Cs.push({name:"login"});return}console.error(e),al().error(e instanceof Zt?e.message:"Something went wrong.",e instanceof Error&&!(e instanceof Zt)?e.message:void 0)};Nr.use(Cs);Nr.mount("#app");export{Zt as A,Uu as B,en as C,yt as D,yc as E,Ee as F,pr as G,lo as H,dc as I,On as J,qf as K,Bl as L,$l as M,Kf as N,Qc as O,Jf as P,Qe as Q,qc as R,_c as S,zf as T,bs as U,Zf as V,ed as W,df as X,If as Y,Yf as Z,Hu as _,Z as a,Kt as b,Me as c,ln as d,It as e,ol as f,re as g,fe as h,zt as i,K as j,Zs as k,ee as l,gf as m,al as n,vo as o,Eo as p,vn as q,Ve as r,Wf as s,At as t,Rs as u,Qf as v,at as w,Rt as x,ll as y,Xf as z};
|
|
118
|
-
//# sourceMappingURL=index-
|
|
117
|
+
*/const ff=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],df=yt("x",ff),ar="/api";class Zt extends Error{constructor(n,s,r,i=[]){super(r);Ln(this,"status");Ln(this,"code");Ln(this,"issues");this.name="ApiError",this.status=n,this.code=s,this.issues=i}get isUnauthenticated(){return this.status===401}}function hf(){const e=/(?:^|;\s*)mica_csrf=([^;]*)/.exec(document.cookie);return e!=null&&e[1]?decodeURIComponent(e[1]):""}async function ae(e,t={}){var u,a,f;const n=new URL(`${ar}${e}`,window.location.origin);for(const[p,m]of Object.entries(t.query??{}))m!==void 0&&m!==""&&n.searchParams.set(p,String(m));const s={},r=t.method??"GET";r!=="GET"&&(s["x-csrf-token"]=hf());const i=t.body instanceof FormData;t.body!==void 0&&!i&&(s["content-type"]="application/json");let o;try{o=await fetch(n,{method:r,headers:s,credentials:"same-origin",signal:t.signal,body:i?t.body:t.body!==void 0?JSON.stringify(t.body):void 0})}catch(p){throw p.name==="AbortError"?p:new Zt(0,"network_error","Could not reach the server. Check your connection.")}if(o.status===204)return;const l=await o.text(),c=l?JSON.parse(l):null;if(!o.ok){const p=c;throw new Zt(o.status,((u=p==null?void 0:p.error)==null?void 0:u.code)??"error",((a=p==null?void 0:p.error)==null?void 0:a.message)??`Request failed (${o.status}).`,((f=p==null?void 0:p.error)==null?void 0:f.issues)??[])}return c}const zt={auth:{me:()=>ae("/auth/me"),config:()=>ae("/auth/config"),signInUrl:e=>`${ar}/auth/login?returnTo=${encodeURIComponent(e)}`,logout:()=>ae("/auth/logout",{method:"POST"})},schema:()=>ae("/admin/schema"),overview:()=>ae("/admin/overview"),system:()=>ae("/admin/system"),entries:{list:(e,t={})=>ae(`/admin/collections/${e}/entries`,{query:t}),get:(e,t)=>ae(`/admin/collections/${e}/entries/${t}`),create:(e,t)=>ae(`/admin/collections/${e}/entries`,{method:"POST",body:t}),update:(e,t,n)=>ae(`/admin/collections/${e}/entries/${t}`,{method:"PUT",body:n}),remove:(e,t)=>ae(`/admin/collections/${e}/entries/${t}`,{method:"DELETE"}),reorder:(e,t)=>ae(`/admin/collections/${e}/reorder`,{method:"POST",body:{slugs:t}}),suggestSlug:(e,t,n)=>ae(`/admin/collections/${e}/slug`,{query:{source:t,except:n}}),references:(e,t)=>ae(`/admin/collections/${e}/entries/${t}/references`)},singletons:{get:e=>ae(`/admin/singletons/${e}`),save:(e,t,n)=>ae(`/admin/singletons/${e}`,{method:"PUT",body:{data:t,revision:n}})},staging:{changes:()=>ae("/admin/changes"),publish:(e,t)=>ae("/admin/publish",{method:"POST",body:{message:e,expectedBase:t}}),push:()=>ae("/admin/publish/push",{method:"POST"}),discard:e=>ae("/admin/changes/discard",{method:"POST",body:{paths:e}}),compare:e=>ae(`/admin/changes/compare?${new URLSearchParams(e)}`)},media:{list:()=>ae("/admin/media"),upload:(e,t={})=>{const n=new FormData;for(const s of e)n.append("file",s);return t.accept&&n.append("accept",t.accept),t.directory&&n.append("directory",t.directory),ae("/admin/media",{method:"POST",body:n})},url:e=>`${ar}/admin/media/file/${e.split("/").map(encodeURIComponent).join("/")}`}},Ye=Ve(null);let Kn=null;function ll(){return{schema:re(()=>Ye.value),collections:re(()=>{var e;return((e=Ye.value)==null?void 0:e.collections)??[]}),singletons:re(()=>{var e;return((e=Ye.value)==null?void 0:e.singletons)??[]}),loaded:re(()=>Ye.value!==null),async load(e=!1){return Ye.value&&!e?Ye.value:(Kn??(Kn=zt.schema().then(t=>(Ye.value=t,Kn=null,t))),Kn)},collection(e){var t;return(t=Ye.value)==null?void 0:t.collections.find(n=>n.name===e)},singleton(e){var t;return(t=Ye.value)==null?void 0:t.singletons.find(n=>n.name===e)},reset(){Ye.value=null,Kn=null}}}const Bt=Ve(null),$t=Ve(!1),Gs=Ve(!1),Ks=Ve(null);function Rs(){return{identity:re(()=>Bt.value),isActive:re(()=>$t.value),checked:re(()=>Gs.value),config:re(()=>Ks.value),showsIdentity:re(()=>{var e;return((e=Ks.value)==null?void 0:e.authRequired)===!0}),async restore(){try{const e=await zt.auth.config();if(Ks.value=e,!e.authRequired){Bt.value=null,$t.value=!0;return}const t=await zt.auth.me();Bt.value=t.identity,$t.value=!0}catch(e){(!(e instanceof Zt)||!e.isUnauthenticated)&&console.error("Failed to restore session",e),Bt.value=null,$t.value=!1}finally{Gs.value=!0}},signIn(e="/admin/"){window.location.href=zt.auth.signInUrl(e)},async signOut(){let e=null;try{({endSession:e}=await zt.auth.logout())}finally{Bt.value=null,$t.value=!1}e&&(window.location.href=e)},clear(){Bt.value=null,$t.value=!1,Gs.value=!0}}}function pf(e){const t=new Map;for(const n of e){const s=n.owner,r=s.kind==="entry"?`entry:${s.collection}/${s.slug}`:s.kind==="singleton"?`singleton:${s.name}`:s.kind==="order"?`order:${s.collection}`:s.kind==="media"?"media":`other:${n.path}`;let i=t.get(r);i||(i={key:r,label:s.label,link:s.kind==="entry"&&(n.kind!=="delete"||s.renamedFrom)?{name:"entry",params:{collection:s.collection,slug:s.slug}}:s.kind==="singleton"?{name:"singleton",params:{name:s.name}}:s.kind==="media"?{name:"media"}:null,fileChanges:[],target:s.kind==="entry"?{kind:"entry",collection:s.collection,slug:s.slug,...s.renamedFrom?{from:s.renamedFrom}:{}}:s.kind==="singleton"?{kind:"singleton",name:s.name}:s.kind==="order"?{kind:"order",collection:s.collection}:null},t.set(r,i)),i.fileChanges.push(n)}return[...t.values()]}const Yn=Ve(null),Mi=re(()=>{var e;return pf(((e=Yn.value)==null?void 0:e.changes)??[])});let Wn=null;function gf(){return{status:re(()=>Yn.value),edits:Mi,editCount:re(()=>Mi.value.length),async refresh(){return Wn??(Wn=zt.staging.changes().then(e=>{Yn.value=e}).catch(()=>{}).finally(()=>{Wn=null})),Wn},reset(){Yn.value=null,Wn=null}}}const mf={class:"flex min-h-full"},_f={class:"flex-1 space-y-5 overflow-y-auto px-2 py-3","aria-label":"Main"},yf=["aria-label"],vf={key:0},bf={key:1},Ef={key:0,class:"border-t border-creme/10 p-2"},xf={class:"flex items-center gap-2.5 rounded-md px-2 py-2"},wf={class:"grid h-6 w-6 shrink-0 place-items-center rounded-full bg-creme text-[10px] font-semibold text-aubergine","aria-hidden":"true"},Af={class:"min-w-0 flex-1"},Sf={class:"block truncate text-xs font-medium text-creme/80"},Rf={class:"flex min-w-0 flex-1 flex-col"},Cf={class:"sticky top-0 z-10 flex h-14 items-center gap-3 border-b border-line bg-surface/90 px-4 backdrop-blur lg:hidden"},Tf=["aria-expanded"],Of={class:"min-w-0 flex-1 bg-surface"},Pf=ln({__name:"AppShell",setup(e){const t=ol(),n=Uu(),s=Rs(),r=gf(),{collections:i,singletons:o}=ll(),l=Ve(!1);vn(()=>t.fullPath,()=>{l.value=!1,r.refresh()}),vo(()=>void r.refresh());const c=re(()=>{var f,p;return(((f=s.identity.value)==null?void 0:f.name)||((p=s.identity.value)==null?void 0:p.email)||"").split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(m=>{var E;return((E=m[0])==null?void 0:E.toUpperCase())??""}).join("")||"?"});async function u(){await s.signOut(),await n.push({name:"login"})}return(a,f)=>{var m,E;const p=Eo("RouterLink");return fe(),Me("div",mf,[l.value?(fe(),Me("div",{key:0,class:"fixed inset-0 z-20 bg-ink/25 lg:hidden","aria-hidden":"true",onClick:f[0]||(f[0]=_=>l.value=!1)})):Kt("",!0),Z("aside",{id:"main-navigation",class:en(["fixed inset-y-0 left-0 z-30 flex w-[220px] shrink-0 flex-col border-r border-creme/10 bg-aubergine text-creme transition-transform lg:static lg:translate-x-0",l.value?"translate-x-0":"-translate-x-full"])},[f[10]||(f[10]=Z("div",{class:"flex h-14 items-center border-b border-creme/10 px-3"},[Z("img",{src:ju,alt:"micacms",class:"h-5 w-auto"})],-1)),Z("nav",_f,[Z("div",null,[K(p,{to:{name:"dashboard"},class:"nav-link"},{default:at(()=>[K(ee(Zu),{size:14,"aria-hidden":"true"}),f[2]||(f[2]=It(" Overview ",-1))]),_:1}),K(p,{to:{name:"changes"},class:"nav-link"},{default:at(()=>[K(ee(of),{size:14,"aria-hidden":"true"}),f[3]||(f[3]=Z("span",{class:"flex-1"},"Publish",-1)),ee(r).editCount.value>0?(fe(),Me("span",{key:0,class:"rounded-full bg-creme px-1.5 py-0.5 font-mono text-[10px] font-semibold leading-none text-aubergine","aria-label":`${ee(r).editCount.value} pending edit${ee(r).editCount.value===1?"":"s"}`},At(ee(r).editCount.value),9,yf)):Kt("",!0)]),_:1})]),ee(i).length?(fe(),Me("div",vf,[f[5]||(f[5]=Z("p",{class:"nav-heading"},"Content",-1)),(fe(!0),Me(Ee,null,Zs(ee(i),_=>(fe(),Rt(p,{key:_.name,to:{name:"collection",params:{collection:_.name}},class:"nav-link"},{default:at(()=>[K(ee(Ju),{size:14,"aria-hidden":"true"}),It(" "+At(_.label),1)]),_:2},1032,["to"]))),128)),K(p,{to:{name:"media"},class:"nav-link"},{default:at(()=>[K(ee(Qu),{size:14,"aria-hidden":"true"}),f[4]||(f[4]=It(" Media ",-1))]),_:1})])):Kt("",!0),ee(o).length?(fe(),Me("div",bf,[f[6]||(f[6]=Z("p",{class:"nav-heading"},"Settings",-1)),(fe(!0),Me(Ee,null,Zs(ee(o),_=>(fe(),Rt(p,{key:_.name,to:{name:"singleton",params:{name:_.name}},class:"nav-link"},{default:at(()=>[K(ee(uf),{size:14,"aria-hidden":"true"}),It(" "+At(_.label),1)]),_:2},1032,["to"]))),128))])):Kt("",!0),Z("div",null,[f[8]||(f[8]=Z("p",{class:"nav-heading"},"Deployment",-1)),K(p,{to:{name:"system"},class:"nav-link"},{default:at(()=>[K(ee(cf),{size:14,"aria-hidden":"true"}),f[7]||(f[7]=It(" System ",-1))]),_:1})])]),ee(s).showsIdentity.value?(fe(),Me("div",Ef,[Z("div",xf,[Z("span",wf,At(c.value),1),Z("span",Af,[Z("span",Sf,At(((m=ee(s).identity.value)==null?void 0:m.name)||((E=ee(s).identity.value)==null?void 0:E.email)),1)])]),Z("button",{type:"button",class:"sidebar-signout mt-1 w-full",onClick:u},[K(ee(tf),{size:14,"aria-hidden":"true"}),f[9]||(f[9]=It(" Sign out ",-1))])])):Kt("",!0)],2),Z("div",Rf,[Z("header",Cf,[Z("button",{type:"button",class:"btn-ghost -ml-1 px-2","aria-expanded":l.value,"aria-controls":"main-navigation",onClick:f[1]||(f[1]=_=>l.value=!l.value)},[K(ee(sf),{size:20,"aria-hidden":"true"}),f[11]||(f[11]=Z("span",{class:"sr-only"},"Toggle navigation",-1))],8,Tf),f[12]||(f[12]=Z("img",{src:Hu,alt:"micacms",class:"h-5 w-auto"},null,-1))]),Z("main",Of,[yc(a.$slots,"default",{},void 0,!0)])])])}}}),If=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Nf=If(Pf,[["__scopeId","data-v-73dfb86b"]]),In=Ve([]);let Mf=1;function Ws(e,t,n){const s=Mf++;return In.value=[...In.value,{id:s,kind:e,message:t,detail:n}],e!=="error"&&setTimeout(()=>cl(s),4e3),s}function cl(e){In.value=In.value.filter(t=>t.id!==e)}function al(){return{toasts:Xn(In),success:(e,t)=>Ws("success",e,t),error:(e,t)=>Ws("error",e,t),info:(e,t)=>Ws("info",e,t),dismiss:cl}}const Df={class:"pointer-events-none fixed inset-x-0 bottom-0 z-50 flex flex-col items-center gap-2 p-4 sm:items-end",role:"status","aria-live":"assertive"},kf={class:"min-w-0 flex-1"},Lf={class:"text-sm font-medium"},Ff={key:0,class:"mt-0.5 text-sm opacity-80"},Vf=["onClick"],Uf=ln({__name:"ToastStack",setup(e){const{toasts:t,dismiss:n}=al(),s={success:"border-success/15 bg-success-soft text-success",error:"border-danger/15 bg-danger-soft text-danger",info:"border-info/15 bg-info-soft text-info"},r={success:"bg-success",error:"bg-danger",info:"bg-info"};return(i,o)=>(fe(),Me("div",Df,[(fe(!0),Me(Ee,null,Zs(ee(t),l=>(fe(),Me("div",{key:l.id,class:en(["pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-md border p-4 shadow-lg",s[l.kind]])},[Z("span",{class:en(["mt-1.5 h-2 w-2 shrink-0 rounded-full",r[l.kind]]),"aria-hidden":"true"},null,2),Z("div",kf,[Z("p",Lf,At(l.message),1),l.detail?(fe(),Me("p",Ff,At(l.detail),1)):Kt("",!0)]),Z("button",{type:"button",class:"-m-1 shrink-0 rounded p-1 opacity-60 hover:opacity-100",onClick:c=>ee(n)(l.id)},[K(ee(df),{size:16,"aria-hidden":"true"}),o[0]||(o[0]=Z("span",{class:"sr-only"},"Dismiss",-1))],8,Vf)],2))),128))]))}}),jf=ln({__name:"App",setup(e){const t=ol(),n=Rs(),s=re(()=>n.isActive.value&&!t.meta.public);return(r,i)=>{const o=Eo("RouterView");return fe(),Me(Ee,null,[K(Uf),s.value?(fe(),Rt(Nf,{key:0},{default:at(()=>[K(o,null,{default:at(({Component:l,route:c})=>[(fe(),Rt(_c(l),{key:c.fullPath}))]),_:1})]),_:1})):(fe(),Rt(o,{key:1}))],64)}}}),Hf="modulepreload",Bf=function(e){return"/admin/"+e},Di={},Qe=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(a=>Promise.resolve(a).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=o(n.map(u=>{if(u=Bf(u),u in Di)return;Di[u]=!0;const a=u.endsWith(".css"),f=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const p=document.createElement("link");if(p.rel=a?"stylesheet":Hf,a||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),a)return new Promise((m,E)=>{p.addEventListener("load",m),p.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},$f=[{path:"/login",name:"login",component:()=>Qe(()=>import("./LoginView-C8sJvqmb.js"),[]),meta:{public:!0,title:"Sign in"}},{path:"/",name:"dashboard",component:()=>Qe(()=>import("./DashboardView-7y5LY2BH.js"),__vite__mapDeps([0,1])),meta:{title:"Overview"}},{path:"/collections/:collection",name:"collection",component:()=>Qe(()=>import("./CollectionView-Cu_ytsrZ.js"),__vite__mapDeps([2,1,3,4,5])),props:!0},{path:"/collections/:collection/new",name:"entry-new",component:()=>Qe(()=>import("./EntryView-IyBqYorV.js"),__vite__mapDeps([6,7,8,9,10,4,1])),props:!0},{path:"/collections/:collection/:slug",name:"entry",component:()=>Qe(()=>import("./EntryView-IyBqYorV.js"),__vite__mapDeps([6,7,8,9,10,4,1])),props:!0},{path:"/singletons/:name",name:"singleton",component:()=>Qe(()=>import("./SingletonView-C3AqQe6a.js"),__vite__mapDeps([11,8,9,10,4,1])),props:!0},{path:"/media",name:"media",component:()=>Qe(()=>import("./MediaView-BVODAshv.js"),__vite__mapDeps([12,1,3])),meta:{title:"Media"}},{path:"/changes",name:"changes",component:()=>Qe(()=>import("./ChangesView-D7n3k873.js"),__vite__mapDeps([13,9,7,1])),meta:{title:"Publish"}},{path:"/system",name:"system",component:()=>Qe(()=>import("./SystemView-DKA_QdVz.js"),__vite__mapDeps([14,1,3,10,15])),meta:{title:"System"}},{path:"/:pathMatch(.*)*",name:"not-found",component:()=>Qe(()=>import("./NotFoundView-K-fMCruW.js"),[]),meta:{title:"Not found"}}],Cs=Vu({history:mu("/admin/"),routes:$f,scrollBehavior:(e,t,n)=>n??{top:0}});Cs.beforeEach(async e=>{const t=Rs();return t.checked.value||await t.restore(),e.meta.public?t.isActive.value?{name:"dashboard"}:!0:t.isActive.value?(await ll().load(),!0):{name:"login",query:e.fullPath==="/"?{}:{redirect:e.fullPath}}});Cs.afterEach(e=>{const t=typeof e.meta.title=="string"?e.meta.title:null;document.title=t?`${t} · Mica`:"Mica"});const Nr=Ia(jf);Nr.config.errorHandler=e=>{if(e instanceof Zt&&e.isUnauthenticated){Rs().clear(),Cs.push({name:"login"});return}console.error(e),al().error(e instanceof Zt?e.message:"Something went wrong.",e instanceof Error&&!(e instanceof Zt)?e.message:void 0)};Nr.use(Cs);Nr.mount("#app");export{Zt as A,Uu as B,en as C,yt as D,yc as E,Ee as F,pr as G,lo as H,dc as I,On as J,qf as K,Bl as L,$l as M,Kf as N,Qc as O,Jf as P,Qe as Q,qc as R,_c as S,zf as T,bs as U,Zf as V,ed as W,df as X,If as Y,Yf as Z,Hu as _,Z as a,Kt as b,Me as c,ln as d,It as e,ol as f,re as g,fe as h,zt as i,K as j,Zs as k,ee as l,gf as m,al as n,vo as o,Eo as p,vn as q,Ve as r,Wf as s,At as t,Rs as u,Qf as v,at as w,Rt as x,ll as y,Xf as z};
|
|
118
|
+
//# sourceMappingURL=index-9WVbsgdk.js.map
|