snow-cms 1.0.0 → 1.0.3

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +28 -28
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -34,7 +34,7 @@ I created this project because I wanted a CMS with a rich-text markdown widget,
34
34
  ### Installing
35
35
 
36
36
  ```bash
37
- TODO: add install command
37
+ npm i snow-cms
38
38
  ```
39
39
 
40
40
  ### Import the CMS into your project
package/dist/index.js CHANGED
@@ -1,47 +1,47 @@
1
- var ol=Object.defineProperty;var cl=(e,t,n)=>t in e?ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>(cl(e,typeof t!="symbol"?t+"":t,n),n);function b(){}function ot(e,t){for(const n in t)e[n]=t[n];return e}function al(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function qr(e){return e()}function Un(){return Object.create(null)}function ue(e){e.forEach(qr)}function Wt(e){return typeof e=="function"}function ie(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let It;function $t(e,t){return e===t?!0:(It||(It=document.createElement("a")),It.href=t,e===It.href)}function sl(e){return Object.keys(e).length===0}function En(e,...t){if(e==null){for(const r of t)r(void 0);return b}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Ie(e){let t;return En(e,n=>t=n)(),t}function W(e,t,n){e.$$.on_destroy.push(En(t,n))}function he(e,t,n){return e.set(n),t}function ul(e){return e&&Wt(e.destroy)?e.destroy:b}const zt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function w(e,t){e.appendChild(t)}function N(e,t,n){e.insertBefore(t,n||null)}function H(e){e.parentNode&&e.parentNode.removeChild(e)}function sn(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function k(e){return document.createElement(e)}function fl(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function te(e){return document.createTextNode(e)}function q(){return te(" ")}function Oe(){return te("")}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ue(e){return function(t){return t.preventDefault(),e.call(this,t)}}function m(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Yr(e){return e===""?null:+e}function dl(e){return Array.from(e.childNodes)}function _e(e,t){t=""+t,e.data!==t&&(e.data=t)}function ve(e,t){e.value=t??""}function Bn(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function jt(e,t,n){e.classList.toggle(t,!!n)}function pl(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class ze{constructor(t=!1){oe(this,"is_svg",!1);oe(this,"e");oe(this,"n");oe(this,"t");oe(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=fl(n.nodeName):this.e=k(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)N(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(H)}}function Je(e,t){return new e(t)}let Lt;function We(e){Lt=e}function At(){if(!Lt)throw new Error("Function called outside component initialization");return Lt}function je(e){At().$$.on_mount.push(e)}function hl(e){At().$$.after_update.push(e)}function Zt(){const e=At();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const l=pl(t,n,{cancelable:r});return i.slice().forEach(o=>{o.call(e,l)}),!l.defaultPrevented}return!0}}function Cn(e,t){return At().$$.context.set(e,t),t}function Sn(e){return At().$$.context.get(e)}const mt=[],ct=[];let vt=[];const Gn=[],ml=Promise.resolve();let un=!1;function gl(){un||(un=!0,ml.then(xn))}function fn(e){vt.push(e)}const tn=new Set;let ft=0;function xn(){if(ft!==0)return;const e=Lt;do{try{for(;ft<mt.length;){const t=mt[ft];ft++,We(t),_l(t.$$)}}catch(t){throw mt.length=0,ft=0,t}for(We(null),mt.length=0,ft=0;ct.length;)ct.pop()();for(let t=0;t<vt.length;t+=1){const n=vt[t];tn.has(n)||(tn.add(n),n())}vt.length=0}while(mt.length);for(;Gn.length;)Gn.pop()();un=!1,tn.clear(),We(e)}function _l(e){if(e.fragment!==null){e.update(),ue(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(fn)}}function wl(e){const t=[],n=[];vt.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),vt=t}const Nt=new Set;let rt;function ye(){rt={r:0,c:[],p:rt}}function ke(){rt.r||ue(rt.c),rt=rt.p}function I(e,t){e&&e.i&&(Nt.delete(e),e.i(t))}function V(e,t,n,r){if(e&&e.o){if(Nt.has(e))return;Nt.add(e),rt.c.push(()=>{Nt.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function se(e,t){const n=t.token={};function r(i,l,o,c){if(t.token!==n)return;t.resolved=c;let a=t.ctx;o!==void 0&&(a=a.slice(),a[o]=c);const s=i&&(t.current=i)(a);let f=!1;t.block&&(t.blocks?t.blocks.forEach((u,d)=>{d!==l&&u&&(ye(),V(u,1,1,()=>{t.blocks[d]===u&&(t.blocks[d]=null)}),ke())}):t.block.d(1),s.c(),I(s,1),s.m(t.mount(),t.anchor),f=!0),t.block=s,t.blocks&&(t.blocks[l]=s),f&&xn()}if(al(e)){const i=At();if(e.then(l=>{We(i),r(t.then,1,t.value,l),We(null)},l=>{if(We(i),r(t.catch,2,t.error,l),We(null),!t.hasCatch)throw l}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}}function Pe(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}function Ee(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Ur(e,t){e.d(1),t.delete(e.key)}function Ln(e,t){V(e,1,1,()=>{t.delete(e.key)})}function Ft(e,t,n,r,i,l,o,c,a,s,f,u){let d=e.length,p=l.length,g=d;const h={};for(;g--;)h[e[g].key]=g;const v=[],A=new Map,E=new Map,T=[];for(g=p;g--;){const F=u(i,l,g),C=n(F);let P=o.get(C);P?T.push(()=>P.p(F,t)):(P=s(C,F),P.c()),A.set(C,v[g]=P),C in h&&E.set(C,Math.abs(g-h[C]))}const j=new Set,D=new Set;function R(F){I(F,1),F.m(c,f),o.set(F.key,F),f=F.first,p--}for(;d&&p;){const F=v[p-1],C=e[d-1],P=F.key,M=C.key;F===C?(f=F.first,d--,p--):A.has(M)?!o.has(P)||j.has(P)?R(F):D.has(M)?d--:E.get(P)>E.get(M)?(D.add(P),R(F)):(j.add(M),d--):(a(C,o),d--)}for(;d--;){const F=e[d];A.has(F.key)||a(F,o)}for(;p;)R(v[p-1]);return ue(T),v}function at(e,t){const n={},r={},i={$$scope:1};let l=e.length;for(;l--;){const o=e[l],c=t[l];if(c){for(const a in o)a in c||(r[a]=1);for(const a in c)i[a]||(n[a]=c[a],i[a]=1);e[l]=c}else for(const a in o)i[a]=1}for(const o in r)o in n||(n[o]=void 0);return n}function st(e){return typeof e=="object"&&e!==null?e:{}}function J(e){e&&e.c()}function K(e,t,n){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),fn(()=>{const l=e.$$.on_mount.map(qr).filter(Wt);e.$$.on_destroy?e.$$.on_destroy.push(...l):ue(l),e.$$.on_mount=[]}),i.forEach(fn)}function X(e,t){const n=e.$$;n.fragment!==null&&(wl(n.after_update),ue(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function bl(e,t){e.$$.dirty[0]===-1&&(mt.push(e),gl(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ce(e,t,n,r,i,l,o=null,c=[-1]){const a=Lt;We(e);const s=e.$$={fragment:null,ctx:[],props:l,update:b,not_equal:i,bound:Un(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(a?a.$$.context:[])),callbacks:Un(),dirty:c,skip_bound:!1,root:t.target||a.$$.root};o&&o(s.root);let f=!1;if(s.ctx=n?n(e,t.props||{},(u,d,...p)=>{const g=p.length?p[0]:d;return s.ctx&&i(s.ctx[u],s.ctx[u]=g)&&(!s.skip_bound&&s.bound[u]&&s.bound[u](g),f&&bl(e,u)),d}):[],s.update(),f=!0,ue(s.before_update),s.fragment=r?r(s.ctx):!1,t.target){if(t.hydrate){const u=dl(t.target);s.fragment&&s.fragment.l(u),u.forEach(H)}else s.fragment&&s.fragment.c();t.intro&&I(e.$$.fragment),K(e,t.target,t.anchor),xn()}We(a)}class ae{constructor(){oe(this,"$$");oe(this,"$$set")}$destroy(){X(this,1),this.$destroy=b}$on(t,n){if(!Wt(n))return b;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!sl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const vl="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(vl);const yl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-multiple</title><path d="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z" /></svg>',kl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>folder-multiple-image</title><path d="M7,15L11.5,9L15,13.5L17.5,10.5L21,15M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z" /></svg>',Al='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>logout</title><path d="M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z" /></svg>',dt=[];function Br(e,t){return{subscribe:tt(e,t).subscribe}}function tt(e,t=b){let n;const r=new Set;function i(c){if(ie(e,c)&&(e=c,n)){const a=!dt.length;for(const s of r)s[1](),dt.push(s,e);if(a){for(let s=0;s<dt.length;s+=2)dt[s][0](dt[s+1]);dt.length=0}}}function l(c){i(c(e))}function o(c,a=b){const s=[c,a];return r.add(s),r.size===1&&(n=t(i,l)||b),c(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:l,subscribe:o}}function El(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=t.length<2;return Br(n,(o,c)=>{let a=!1;const s=[];let f=0,u=b;const d=()=>{if(f)return;u();const g=t(r?s[0]:s,o,c);l?o(g):u=Wt(g)?g:b},p=i.map((g,h)=>En(g,v=>{s[h]=v,f&=~(1<<h),a&&d()},()=>{f|=1<<h}));return a=!0,d(),function(){ue(p),u(),a=!1}})}/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Gr(e){return typeof e>"u"||e===null}function Cl(e){return typeof e=="object"&&e!==null}function Sl(e){return Array.isArray(e)?e:Gr(e)?[]:[e]}function xl(e,t){var n,r,i,l;if(t)for(l=Object.keys(t),n=0,r=l.length;n<r;n+=1)i=l[n],e[i]=t[i];return e}function Ll(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Tl(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Ml=Gr,Ol=Cl,Dl=Sl,Fl=Ll,Hl=Tl,Il=xl,ge={isNothing:Ml,isObject:Ol,toArray:Dl,repeat:Fl,isNegativeZero:Hl,extend:Il};function Wr(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
1
+ var cl=Object.defineProperty;var al=(e,t,n)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>(al(e,typeof t!="symbol"?t+"":t,n),n);function b(){}function ot(e,t){for(const n in t)e[n]=t[n];return e}function sl(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Yr(e){return e()}function Bn(){return Object.create(null)}function ue(e){e.forEach(Yr)}function zt(e){return typeof e=="function"}function ie(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Nt;function jt(e,t){return e===t?!0:(Nt||(Nt=document.createElement("a")),Nt.href=t,e===Nt.href)}function ul(e){return Object.keys(e).length===0}function Cn(e,...t){if(e==null){for(const r of t)r(void 0);return b}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Ie(e){let t;return Cn(e,n=>t=n)(),t}function W(e,t,n){e.$$.on_destroy.push(Cn(t,n))}function he(e,t,n){return e.set(n),t}function fl(e){return e&&zt(e.destroy)?e.destroy:b}const Zt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function w(e,t){e.appendChild(t)}function N(e,t,n){e.insertBefore(t,n||null)}function H(e){e.parentNode&&e.parentNode.removeChild(e)}function un(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function k(e){return document.createElement(e)}function dl(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function ee(e){return document.createTextNode(e)}function q(){return ee(" ")}function Oe(){return ee("")}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ue(e){return function(t){return t.preventDefault(),e.call(this,t)}}function m(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ur(e){return e===""?null:+e}function pl(e){return Array.from(e.childNodes)}function _e(e,t){t=""+t,e.data!==t&&(e.data=t)}function ve(e,t){e.value=t??""}function Gn(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function Vt(e,t,n){e.classList.toggle(t,!!n)}function hl(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class ze{constructor(t=!1){oe(this,"is_svg",!1);oe(this,"e");oe(this,"n");oe(this,"t");oe(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=dl(n.nodeName):this.e=k(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)N(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(H)}}function Je(e,t){return new e(t)}let Tt;function We(e){Tt=e}function At(){if(!Tt)throw new Error("Function called outside component initialization");return Tt}function je(e){At().$$.on_mount.push(e)}function ml(e){At().$$.after_update.push(e)}function Kt(){const e=At();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const l=hl(t,n,{cancelable:r});return i.slice().forEach(o=>{o.call(e,l)}),!l.defaultPrevented}return!0}}function Sn(e,t){return At().$$.context.set(e,t),t}function xn(e){return At().$$.context.get(e)}const mt=[],ct=[];let vt=[];const Wn=[],gl=Promise.resolve();let fn=!1;function _l(){fn||(fn=!0,gl.then(Ln))}function dn(e){vt.push(e)}const nn=new Set;let ft=0;function Ln(){if(ft!==0)return;const e=Tt;do{try{for(;ft<mt.length;){const t=mt[ft];ft++,We(t),wl(t.$$)}}catch(t){throw mt.length=0,ft=0,t}for(We(null),mt.length=0,ft=0;ct.length;)ct.pop()();for(let t=0;t<vt.length;t+=1){const n=vt[t];nn.has(n)||(nn.add(n),n())}vt.length=0}while(mt.length);for(;Wn.length;)Wn.pop()();fn=!1,nn.clear(),We(e)}function wl(e){if(e.fragment!==null){e.update(),ue(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(dn)}}function bl(e){const t=[],n=[];vt.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),vt=t}const Rt=new Set;let rt;function ye(){rt={r:0,c:[],p:rt}}function ke(){rt.r||ue(rt.c),rt=rt.p}function I(e,t){e&&e.i&&(Rt.delete(e),e.i(t))}function V(e,t,n,r){if(e&&e.o){if(Rt.has(e))return;Rt.add(e),rt.c.push(()=>{Rt.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function se(e,t){const n=t.token={};function r(i,l,o,c){if(t.token!==n)return;t.resolved=c;let a=t.ctx;o!==void 0&&(a=a.slice(),a[o]=c);const s=i&&(t.current=i)(a);let f=!1;t.block&&(t.blocks?t.blocks.forEach((u,d)=>{d!==l&&u&&(ye(),V(u,1,1,()=>{t.blocks[d]===u&&(t.blocks[d]=null)}),ke())}):t.block.d(1),s.c(),I(s,1),s.m(t.mount(),t.anchor),f=!0),t.block=s,t.blocks&&(t.blocks[l]=s),f&&Ln()}if(sl(e)){const i=At();if(e.then(l=>{We(i),r(t.then,1,t.value,l),We(null)},l=>{if(We(i),r(t.catch,2,t.error,l),We(null),!t.hasCatch)throw l}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}}function Pe(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}function Ee(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Br(e,t){e.d(1),t.delete(e.key)}function Tn(e,t){V(e,1,1,()=>{t.delete(e.key)})}function Ht(e,t,n,r,i,l,o,c,a,s,f,u){let d=e.length,p=l.length,g=d;const h={};for(;g--;)h[e[g].key]=g;const v=[],A=new Map,E=new Map,T=[];for(g=p;g--;){const F=u(i,l,g),C=n(F);let P=o.get(C);P?T.push(()=>P.p(F,t)):(P=s(C,F),P.c()),A.set(C,v[g]=P),C in h&&E.set(C,Math.abs(g-h[C]))}const j=new Set,D=new Set;function R(F){I(F,1),F.m(c,f),o.set(F.key,F),f=F.first,p--}for(;d&&p;){const F=v[p-1],C=e[d-1],P=F.key,M=C.key;F===C?(f=F.first,d--,p--):A.has(M)?!o.has(P)||j.has(P)?R(F):D.has(M)?d--:E.get(P)>E.get(M)?(D.add(P),R(F)):(j.add(M),d--):(a(C,o),d--)}for(;d--;){const F=e[d];A.has(F.key)||a(F,o)}for(;p;)R(v[p-1]);return ue(T),v}function at(e,t){const n={},r={},i={$$scope:1};let l=e.length;for(;l--;){const o=e[l],c=t[l];if(c){for(const a in o)a in c||(r[a]=1);for(const a in c)i[a]||(n[a]=c[a],i[a]=1);e[l]=c}else for(const a in o)i[a]=1}for(const o in r)o in n||(n[o]=void 0);return n}function st(e){return typeof e=="object"&&e!==null?e:{}}function J(e){e&&e.c()}function K(e,t,n){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),dn(()=>{const l=e.$$.on_mount.map(Yr).filter(zt);e.$$.on_destroy?e.$$.on_destroy.push(...l):ue(l),e.$$.on_mount=[]}),i.forEach(dn)}function X(e,t){const n=e.$$;n.fragment!==null&&(bl(n.after_update),ue(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function vl(e,t){e.$$.dirty[0]===-1&&(mt.push(e),_l(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ce(e,t,n,r,i,l,o=null,c=[-1]){const a=Tt;We(e);const s=e.$$={fragment:null,ctx:[],props:l,update:b,not_equal:i,bound:Bn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(a?a.$$.context:[])),callbacks:Bn(),dirty:c,skip_bound:!1,root:t.target||a.$$.root};o&&o(s.root);let f=!1;if(s.ctx=n?n(e,t.props||{},(u,d,...p)=>{const g=p.length?p[0]:d;return s.ctx&&i(s.ctx[u],s.ctx[u]=g)&&(!s.skip_bound&&s.bound[u]&&s.bound[u](g),f&&vl(e,u)),d}):[],s.update(),f=!0,ue(s.before_update),s.fragment=r?r(s.ctx):!1,t.target){if(t.hydrate){const u=pl(t.target);s.fragment&&s.fragment.l(u),u.forEach(H)}else s.fragment&&s.fragment.c();t.intro&&I(e.$$.fragment),K(e,t.target,t.anchor),Ln()}We(a)}class ae{constructor(){oe(this,"$$");oe(this,"$$set")}$destroy(){X(this,1),this.$destroy=b}$on(t,n){if(!zt(n))return b;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!ul(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const yl="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(yl);const kl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-multiple</title><path d="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z" /></svg>',Al='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>folder-multiple-image</title><path d="M7,15L11.5,9L15,13.5L17.5,10.5L21,15M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z" /></svg>',El='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>logout</title><path d="M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z" /></svg>',dt=[];function Gr(e,t){return{subscribe:tt(e,t).subscribe}}function tt(e,t=b){let n;const r=new Set;function i(c){if(ie(e,c)&&(e=c,n)){const a=!dt.length;for(const s of r)s[1](),dt.push(s,e);if(a){for(let s=0;s<dt.length;s+=2)dt[s][0](dt[s+1]);dt.length=0}}}function l(c){i(c(e))}function o(c,a=b){const s=[c,a];return r.add(s),r.size===1&&(n=t(i,l)||b),c(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:l,subscribe:o}}function Cl(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=t.length<2;return Gr(n,(o,c)=>{let a=!1;const s=[];let f=0,u=b;const d=()=>{if(f)return;u();const g=t(r?s[0]:s,o,c);l?o(g):u=zt(g)?g:b},p=i.map((g,h)=>Cn(g,v=>{s[h]=v,f&=~(1<<h),a&&d()},()=>{f|=1<<h}));return a=!0,d(),function(){ue(p),u(),a=!1}})}/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Wr(e){return typeof e>"u"||e===null}function Sl(e){return typeof e=="object"&&e!==null}function xl(e){return Array.isArray(e)?e:Wr(e)?[]:[e]}function Ll(e,t){var n,r,i,l;if(t)for(l=Object.keys(t),n=0,r=l.length;n<r;n+=1)i=l[n],e[i]=t[i];return e}function Tl(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Ml(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Ol=Wr,Dl=Sl,Fl=xl,Hl=Tl,Il=Ml,Nl=Ll,ge={isNothing:Ol,isObject:Dl,toArray:Fl,repeat:Hl,isNegativeZero:Il,extend:Nl};function zr(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
2
2
 
3
- `+e.mark.snippet),r+" "+n):r}function Tt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Wr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Tt.prototype=Object.create(Error.prototype);Tt.prototype.constructor=Tt;Tt.prototype.toString=function(t){return this.name+": "+Wr(this,t)};var Le=Tt;function nn(e,t,n,r,i){var l="",o="",c=Math.floor(i/2)-1;return r-t>c&&(l=" ... ",t=r-c+l.length),n-r>c&&(o=" ...",n=r+c-o.length),{str:l+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+l.length}}function rn(e,t){return ge.repeat(" ",t-e.length)+e}function Nl(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],l,o=-1;l=n.exec(e.buffer);)i.push(l.index),r.push(l.index+l[0].length),e.position<=l.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var c="",a,s,f=Math.min(e.line+t.linesAfter,i.length).toString().length,u=t.maxLength-(t.indent+f+3);for(a=1;a<=t.linesBefore&&!(o-a<0);a++)s=nn(e.buffer,r[o-a],i[o-a],e.position-(r[o]-r[o-a]),u),c=ge.repeat(" ",t.indent)+rn((e.line-a+1).toString(),f)+" | "+s.str+`
4
- `+c;for(s=nn(e.buffer,r[o],i[o],e.position,u),c+=ge.repeat(" ",t.indent)+rn((e.line+1).toString(),f)+" | "+s.str+`
3
+ `+e.mark.snippet),r+" "+n):r}function Mt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=zr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Mt.prototype=Object.create(Error.prototype);Mt.prototype.constructor=Mt;Mt.prototype.toString=function(t){return this.name+": "+zr(this,t)};var Le=Mt;function rn(e,t,n,r,i){var l="",o="",c=Math.floor(i/2)-1;return r-t>c&&(l=" ... ",t=r-c+l.length),n-r>c&&(o=" ...",n=r+c-o.length),{str:l+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+l.length}}function ln(e,t){return ge.repeat(" ",t-e.length)+e}function Rl(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],l,o=-1;l=n.exec(e.buffer);)i.push(l.index),r.push(l.index+l[0].length),e.position<=l.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var c="",a,s,f=Math.min(e.line+t.linesAfter,i.length).toString().length,u=t.maxLength-(t.indent+f+3);for(a=1;a<=t.linesBefore&&!(o-a<0);a++)s=rn(e.buffer,r[o-a],i[o-a],e.position-(r[o]-r[o-a]),u),c=ge.repeat(" ",t.indent)+ln((e.line-a+1).toString(),f)+" | "+s.str+`
4
+ `+c;for(s=rn(e.buffer,r[o],i[o],e.position,u),c+=ge.repeat(" ",t.indent)+ln((e.line+1).toString(),f)+" | "+s.str+`
5
5
  `,c+=ge.repeat("-",t.indent+f+3+s.pos)+`^
6
- `,a=1;a<=t.linesAfter&&!(o+a>=i.length);a++)s=nn(e.buffer,r[o+a],i[o+a],e.position-(r[o]-r[o+a]),u),c+=ge.repeat(" ",t.indent)+rn((e.line+a+1).toString(),f)+" | "+s.str+`
7
- `;return c.replace(/\n$/,"")}var Rl=Nl,Pl=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],$l=["scalar","sequence","mapping"];function jl(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Vl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Pl.indexOf(n)===-1)throw new Le('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=jl(t.styleAliases||null),$l.indexOf(this.kind)===-1)throw new Le('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var be=Vl;function Wn(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(l,o){l.tag===r.tag&&l.kind===r.kind&&l.multi===r.multi&&(i=o)}),n[i]=r}),n}function ql(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function dn(e){return this.extend(e)}dn.prototype.extend=function(t){var n=[],r=[];if(t instanceof be)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Le("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof be))throw new Le("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new Le("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new Le("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(l){if(!(l instanceof be))throw new Le("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(dn.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Wn(i,"implicit"),i.compiledExplicit=Wn(i,"explicit"),i.compiledTypeMap=ql(i.compiledImplicit,i.compiledExplicit),i};var zr=dn,Zr=new be("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Kr=new be("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Xr=new be("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Qr=new zr({explicit:[Zr,Kr,Xr]});function Yl(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Ul(){return null}function Bl(e){return e===null}var Jr=new be("tag:yaml.org,2002:null",{kind:"scalar",resolve:Yl,construct:Ul,predicate:Bl,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Gl(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Wl(e){return e==="true"||e==="True"||e==="TRUE"}function zl(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ei=new be("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Gl,construct:Wl,predicate:zl,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Zl(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Kl(e){return 48<=e&&e<=55}function Xl(e){return 48<=e&&e<=57}function Ql(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Zl(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Kl(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!Xl(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function Jl(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function eo(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ge.isNegativeZero(e)}var ti=new be("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ql,construct:Jl,predicate:eo,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),to=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function no(e){return!(e===null||!to.test(e)||e[e.length-1]==="_")}function ro(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var io=/^[-+]?[0-9]+e/;function lo(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ge.isNegativeZero(e))return"-0.0";return n=e.toString(10),io.test(n)?n.replace("e",".e"):n}function oo(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var ni=new be("tag:yaml.org,2002:float",{kind:"scalar",resolve:no,construct:ro,predicate:oo,represent:lo,defaultStyle:"lowercase"}),ri=Qr.extend({implicit:[Jr,ei,ti,ni]}),ii=ri,li=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),oi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function co(e){return e===null?!1:li.exec(e)!==null||oi.exec(e)!==null}function ao(e){var t,n,r,i,l,o,c,a=0,s=null,f,u,d;if(t=li.exec(e),t===null&&(t=oi.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(l=+t[4],o=+t[5],c=+t[6],t[7]){for(a=t[7].slice(0,3);a.length<3;)a+="0";a=+a}return t[9]&&(f=+t[10],u=+(t[11]||0),s=(f*60+u)*6e4,t[9]==="-"&&(s=-s)),d=new Date(Date.UTC(n,r,i,l,o,c,a)),s&&d.setTime(d.getTime()-s),d}function so(e){return e.toISOString()}var ci=new be("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:co,construct:ao,instanceOf:Date,represent:so});function uo(e){return e==="<<"||e===null}var ai=new be("tag:yaml.org,2002:merge",{kind:"scalar",resolve:uo}),Tn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function fo(e){if(e===null)return!1;var t,n,r=0,i=e.length,l=Tn;for(n=0;n<i;n++)if(t=l.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function po(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,l=Tn,o=0,c=[];for(t=0;t<i;t++)t%4===0&&t&&(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)),o=o<<6|l.indexOf(r.charAt(t));return n=i%4*6,n===0?(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)):n===18?(c.push(o>>10&255),c.push(o>>2&255)):n===12&&c.push(o>>4&255),new Uint8Array(c)}function ho(e){var t="",n=0,r,i,l=e.length,o=Tn;for(r=0;r<l;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=l%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function mo(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var si=new be("tag:yaml.org,2002:binary",{kind:"scalar",resolve:fo,construct:po,predicate:mo,represent:ho}),go=Object.prototype.hasOwnProperty,_o=Object.prototype.toString;function wo(e){if(e===null)return!0;var t=[],n,r,i,l,o,c=e;for(n=0,r=c.length;n<r;n+=1){if(i=c[n],o=!1,_o.call(i)!=="[object Object]")return!1;for(l in i)if(go.call(i,l))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(l)===-1)t.push(l);else return!1}return!0}function bo(e){return e!==null?e:[]}var ui=new be("tag:yaml.org,2002:omap",{kind:"sequence",resolve:wo,construct:bo}),vo=Object.prototype.toString;function yo(e){if(e===null)return!0;var t,n,r,i,l,o=e;for(l=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],vo.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;l[t]=[i[0],r[i[0]]]}return!0}function ko(e){if(e===null)return[];var t,n,r,i,l,o=e;for(l=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),l[t]=[i[0],r[i[0]]];return l}var fi=new be("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yo,construct:ko}),Ao=Object.prototype.hasOwnProperty;function Eo(e){if(e===null)return!0;var t,n=e;for(t in n)if(Ao.call(n,t)&&n[t]!==null)return!1;return!0}function Co(e){return e!==null?e:{}}var di=new be("tag:yaml.org,2002:set",{kind:"mapping",resolve:Eo,construct:Co}),Mn=ii.extend({implicit:[ci,ai],explicit:[si,ui,fi,di]}),et=Object.prototype.hasOwnProperty,Vt=1,pi=2,hi=3,qt=4,ln=1,So=2,zn=3,xo=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Lo=/[\x85\u2028\u2029]/,To=/[,\[\]\{\}]/,mi=/^(?:!|!!|![a-z\-]+!)$/i,gi=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Zn(e){return Object.prototype.toString.call(e)}function Be(e){return e===10||e===13}function it(e){return e===9||e===32}function Me(e){return e===9||e===32||e===10||e===13}function _t(e){return e===44||e===91||e===93||e===123||e===125}function Mo(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Oo(e){return e===120?2:e===117?4:e===85?8:0}function Do(e){return 48<=e&&e<=57?e-48:-1}function Kn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Fo(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var _i=new Array(256),wi=new Array(256);for(var pt=0;pt<256;pt++)_i[pt]=Kn(pt)?1:0,wi[pt]=Kn(pt);function Ho(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Mn,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function bi(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Rl(n),new Le(t,n)}function Y(e,t){throw bi(e,t)}function Yt(e,t){e.onWarning&&e.onWarning.call(null,bi(e,t))}var Xn={YAML:function(t,n,r){var i,l,o;t.version!==null&&Y(t,"duplication of %YAML directive"),r.length!==1&&Y(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Y(t,"ill-formed argument of the YAML directive"),l=parseInt(i[1],10),o=parseInt(i[2],10),l!==1&&Y(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Yt(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,l;r.length!==2&&Y(t,"TAG directive accepts exactly two arguments"),i=r[0],l=r[1],mi.test(i)||Y(t,"ill-formed tag handle (first argument) of the TAG directive"),et.call(t.tagMap,i)&&Y(t,'there is a previously declared suffix for "'+i+'" tag handle'),gi.test(l)||Y(t,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{Y(t,"tag prefix is malformed: "+l)}t.tagMap[i]=l}};function Qe(e,t,n,r){var i,l,o,c;if(t<n){if(c=e.input.slice(t,n),r)for(i=0,l=c.length;i<l;i+=1)o=c.charCodeAt(i),o===9||32<=o&&o<=1114111||Y(e,"expected valid JSON character");else xo.test(c)&&Y(e,"the stream contains non-printable characters");e.result+=c}}function Qn(e,t,n,r){var i,l,o,c;for(ge.isObject(n)||Y(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,c=i.length;o<c;o+=1)l=i[o],et.call(t,l)||(t[l]=n[l],r[l]=!0)}function wt(e,t,n,r,i,l,o,c,a){var s,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),s=0,f=i.length;s<f;s+=1)Array.isArray(i[s])&&Y(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Zn(i[s])==="[object Object]"&&(i[s]="[object Object]");if(typeof i=="object"&&Zn(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(s=0,f=l.length;s<f;s+=1)Qn(e,t,l[s],n);else Qn(e,t,l,n);else!e.json&&!et.call(n,i)&&et.call(t,i)&&(e.line=o||e.line,e.lineStart=c||e.lineStart,e.position=a||e.position,Y(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:l}):t[i]=l,delete n[i];return t}function On(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function pe(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;it(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Be(i))for(On(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Yt(e,"deficient indentation"),r}function Kt(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Me(n)))}function Dn(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
10
- `,t-1))}function Io(e,t,n){var r,i,l,o,c,a,s,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),Me(p)||_t(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),Me(i)||n&&_t(i)))return!1;for(e.kind="scalar",e.result="",l=o=e.position,c=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),Me(i)||n&&_t(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),Me(r))break}else{if(e.position===e.lineStart&&Kt(e)||n&&_t(p))break;if(Be(p))if(a=e.line,s=e.lineStart,f=e.lineIndent,pe(e,!1,-1),e.lineIndent>=t){c=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=a,e.lineStart=s,e.lineIndent=f;break}}c&&(Qe(e,l,o,!1),Dn(e,e.line-a),l=o=e.position,c=!1),it(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return Qe(e,l,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function No(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Qe(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Be(n)?(Qe(e,r,i,!0),Dn(e,pe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Kt(e)?Y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Y(e,"unexpected end of the stream within a single quoted scalar")}function Ro(e,t){var n,r,i,l,o,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Qe(e,n,e.position,!0),e.position++,!0;if(c===92){if(Qe(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),Be(c))pe(e,!1,t);else if(c<256&&_i[c])e.result+=wi[c],e.position++;else if((o=Oo(c))>0){for(i=o,l=0;i>0;i--)c=e.input.charCodeAt(++e.position),(o=Mo(c))>=0?l=(l<<4)+o:Y(e,"expected hexadecimal character");e.result+=Fo(l),e.position++}else Y(e,"unknown escape sequence");n=r=e.position}else Be(c)?(Qe(e,n,r,!0),Dn(e,pe(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Kt(e)?Y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}Y(e,"unexpected end of the stream within a double quoted scalar")}function Po(e,t){var n=!0,r,i,l,o=e.tag,c,a=e.anchor,s,f,u,d,p,g=Object.create(null),h,v,A,E;if(E=e.input.charCodeAt(e.position),E===91)f=93,p=!1,c=[];else if(E===123)f=125,p=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),E=e.input.charCodeAt(++e.position);E!==0;){if(pe(e,!0,t),E=e.input.charCodeAt(e.position),E===f)return e.position++,e.tag=o,e.anchor=a,e.kind=p?"mapping":"sequence",e.result=c,!0;n?E===44&&Y(e,"expected the node content, but found ','"):Y(e,"missed comma between flow collection entries"),v=h=A=null,u=d=!1,E===63&&(s=e.input.charCodeAt(e.position+1),Me(s)&&(u=d=!0,e.position++,pe(e,!0,t))),r=e.line,i=e.lineStart,l=e.position,yt(e,t,Vt,!1,!0),v=e.tag,h=e.result,pe(e,!0,t),E=e.input.charCodeAt(e.position),(d||e.line===r)&&E===58&&(u=!0,E=e.input.charCodeAt(++e.position),pe(e,!0,t),yt(e,t,Vt,!1,!0),A=e.result),p?wt(e,c,g,v,h,A,r,i,l):u?c.push(wt(e,null,g,v,h,A,r,i,l)):c.push(h),pe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}Y(e,"unexpected end of the stream within a flow collection")}function $o(e,t){var n,r,i=ln,l=!1,o=!1,c=t,a=0,s=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)ln===i?i=u===43?zn:So:Y(e,"repeat of a chomping mode identifier");else if((f=Do(u))>=0)f===0?Y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Y(e,"repeat of an indentation width identifier"):(c=t+f-1,o=!0);else break;if(it(u)){do u=e.input.charCodeAt(++e.position);while(it(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!Be(u)&&u!==0)}for(;u!==0;){for(On(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<c)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>c&&(c=e.lineIndent),Be(u)){a++;continue}if(e.lineIndent<c){i===zn?e.result+=ge.repeat(`
11
- `,l?1+a:a):i===ln&&l&&(e.result+=`
6
+ `,a=1;a<=t.linesAfter&&!(o+a>=i.length);a++)s=rn(e.buffer,r[o+a],i[o+a],e.position-(r[o]-r[o+a]),u),c+=ge.repeat(" ",t.indent)+ln((e.line+a+1).toString(),f)+" | "+s.str+`
7
+ `;return c.replace(/\n$/,"")}var Pl=Rl,$l=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],jl=["scalar","sequence","mapping"];function Vl(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function ql(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if($l.indexOf(n)===-1)throw new Le('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Vl(t.styleAliases||null),jl.indexOf(this.kind)===-1)throw new Le('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var be=ql;function zn(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(l,o){l.tag===r.tag&&l.kind===r.kind&&l.multi===r.multi&&(i=o)}),n[i]=r}),n}function Yl(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function pn(e){return this.extend(e)}pn.prototype.extend=function(t){var n=[],r=[];if(t instanceof be)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Le("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof be))throw new Le("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new Le("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new Le("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(l){if(!(l instanceof be))throw new Le("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(pn.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=zn(i,"implicit"),i.compiledExplicit=zn(i,"explicit"),i.compiledTypeMap=Yl(i.compiledImplicit,i.compiledExplicit),i};var Zr=pn,Kr=new be("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Xr=new be("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Qr=new be("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Jr=new Zr({explicit:[Kr,Xr,Qr]});function Ul(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Bl(){return null}function Gl(e){return e===null}var ei=new be("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ul,construct:Bl,predicate:Gl,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Wl(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function zl(e){return e==="true"||e==="True"||e==="TRUE"}function Zl(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ti=new be("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Wl,construct:zl,predicate:Zl,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Kl(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Xl(e){return 48<=e&&e<=55}function Ql(e){return 48<=e&&e<=57}function Jl(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Kl(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Xl(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!Ql(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function eo(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function to(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ge.isNegativeZero(e)}var ni=new be("tag:yaml.org,2002:int",{kind:"scalar",resolve:Jl,construct:eo,predicate:to,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),no=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ro(e){return!(e===null||!no.test(e)||e[e.length-1]==="_")}function io(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var lo=/^[-+]?[0-9]+e/;function oo(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ge.isNegativeZero(e))return"-0.0";return n=e.toString(10),lo.test(n)?n.replace("e",".e"):n}function co(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var ri=new be("tag:yaml.org,2002:float",{kind:"scalar",resolve:ro,construct:io,predicate:co,represent:oo,defaultStyle:"lowercase"}),ii=Jr.extend({implicit:[ei,ti,ni,ri]}),li=ii,oi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ci=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ao(e){return e===null?!1:oi.exec(e)!==null||ci.exec(e)!==null}function so(e){var t,n,r,i,l,o,c,a=0,s=null,f,u,d;if(t=oi.exec(e),t===null&&(t=ci.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(l=+t[4],o=+t[5],c=+t[6],t[7]){for(a=t[7].slice(0,3);a.length<3;)a+="0";a=+a}return t[9]&&(f=+t[10],u=+(t[11]||0),s=(f*60+u)*6e4,t[9]==="-"&&(s=-s)),d=new Date(Date.UTC(n,r,i,l,o,c,a)),s&&d.setTime(d.getTime()-s),d}function uo(e){return e.toISOString()}var ai=new be("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ao,construct:so,instanceOf:Date,represent:uo});function fo(e){return e==="<<"||e===null}var si=new be("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fo}),Mn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`;function po(e){if(e===null)return!1;var t,n,r=0,i=e.length,l=Mn;for(n=0;n<i;n++)if(t=l.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function ho(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,l=Mn,o=0,c=[];for(t=0;t<i;t++)t%4===0&&t&&(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)),o=o<<6|l.indexOf(r.charAt(t));return n=i%4*6,n===0?(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)):n===18?(c.push(o>>10&255),c.push(o>>2&255)):n===12&&c.push(o>>4&255),new Uint8Array(c)}function mo(e){var t="",n=0,r,i,l=e.length,o=Mn;for(r=0;r<l;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=l%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function go(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ui=new be("tag:yaml.org,2002:binary",{kind:"scalar",resolve:po,construct:ho,predicate:go,represent:mo}),_o=Object.prototype.hasOwnProperty,wo=Object.prototype.toString;function bo(e){if(e===null)return!0;var t=[],n,r,i,l,o,c=e;for(n=0,r=c.length;n<r;n+=1){if(i=c[n],o=!1,wo.call(i)!=="[object Object]")return!1;for(l in i)if(_o.call(i,l))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(l)===-1)t.push(l);else return!1}return!0}function vo(e){return e!==null?e:[]}var fi=new be("tag:yaml.org,2002:omap",{kind:"sequence",resolve:bo,construct:vo}),yo=Object.prototype.toString;function ko(e){if(e===null)return!0;var t,n,r,i,l,o=e;for(l=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],yo.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;l[t]=[i[0],r[i[0]]]}return!0}function Ao(e){if(e===null)return[];var t,n,r,i,l,o=e;for(l=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),l[t]=[i[0],r[i[0]]];return l}var di=new be("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ko,construct:Ao}),Eo=Object.prototype.hasOwnProperty;function Co(e){if(e===null)return!0;var t,n=e;for(t in n)if(Eo.call(n,t)&&n[t]!==null)return!1;return!0}function So(e){return e!==null?e:{}}var pi=new be("tag:yaml.org,2002:set",{kind:"mapping",resolve:Co,construct:So}),On=li.extend({implicit:[ai,si],explicit:[ui,fi,di,pi]}),et=Object.prototype.hasOwnProperty,qt=1,hi=2,mi=3,Yt=4,on=1,xo=2,Zn=3,Lo=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,To=/[\x85\u2028\u2029]/,Mo=/[,\[\]\{\}]/,gi=/^(?:!|!!|![a-z\-]+!)$/i,_i=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Kn(e){return Object.prototype.toString.call(e)}function Be(e){return e===10||e===13}function it(e){return e===9||e===32}function Me(e){return e===9||e===32||e===10||e===13}function _t(e){return e===44||e===91||e===93||e===123||e===125}function Oo(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Do(e){return e===120?2:e===117?4:e===85?8:0}function Fo(e){return 48<=e&&e<=57?e-48:-1}function Xn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Ho(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var wi=new Array(256),bi=new Array(256);for(var pt=0;pt<256;pt++)wi[pt]=Xn(pt)?1:0,bi[pt]=Xn(pt);function Io(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||On,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function vi(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Pl(n),new Le(t,n)}function Y(e,t){throw vi(e,t)}function Ut(e,t){e.onWarning&&e.onWarning.call(null,vi(e,t))}var Qn={YAML:function(t,n,r){var i,l,o;t.version!==null&&Y(t,"duplication of %YAML directive"),r.length!==1&&Y(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Y(t,"ill-formed argument of the YAML directive"),l=parseInt(i[1],10),o=parseInt(i[2],10),l!==1&&Y(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Ut(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,l;r.length!==2&&Y(t,"TAG directive accepts exactly two arguments"),i=r[0],l=r[1],gi.test(i)||Y(t,"ill-formed tag handle (first argument) of the TAG directive"),et.call(t.tagMap,i)&&Y(t,'there is a previously declared suffix for "'+i+'" tag handle'),_i.test(l)||Y(t,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{Y(t,"tag prefix is malformed: "+l)}t.tagMap[i]=l}};function Qe(e,t,n,r){var i,l,o,c;if(t<n){if(c=e.input.slice(t,n),r)for(i=0,l=c.length;i<l;i+=1)o=c.charCodeAt(i),o===9||32<=o&&o<=1114111||Y(e,"expected valid JSON character");else Lo.test(c)&&Y(e,"the stream contains non-printable characters");e.result+=c}}function Jn(e,t,n,r){var i,l,o,c;for(ge.isObject(n)||Y(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,c=i.length;o<c;o+=1)l=i[o],et.call(t,l)||(t[l]=n[l],r[l]=!0)}function wt(e,t,n,r,i,l,o,c,a){var s,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),s=0,f=i.length;s<f;s+=1)Array.isArray(i[s])&&Y(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Kn(i[s])==="[object Object]"&&(i[s]="[object Object]");if(typeof i=="object"&&Kn(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(s=0,f=l.length;s<f;s+=1)Jn(e,t,l[s],n);else Jn(e,t,l,n);else!e.json&&!et.call(n,i)&&et.call(t,i)&&(e.line=o||e.line,e.lineStart=c||e.lineStart,e.position=a||e.position,Y(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:l}):t[i]=l,delete n[i];return t}function Dn(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function pe(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;it(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Be(i))for(Dn(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Ut(e,"deficient indentation"),r}function Xt(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Me(n)))}function Fn(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
10
+ `,t-1))}function No(e,t,n){var r,i,l,o,c,a,s,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),Me(p)||_t(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),Me(i)||n&&_t(i)))return!1;for(e.kind="scalar",e.result="",l=o=e.position,c=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),Me(i)||n&&_t(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),Me(r))break}else{if(e.position===e.lineStart&&Xt(e)||n&&_t(p))break;if(Be(p))if(a=e.line,s=e.lineStart,f=e.lineIndent,pe(e,!1,-1),e.lineIndent>=t){c=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=a,e.lineStart=s,e.lineIndent=f;break}}c&&(Qe(e,l,o,!1),Fn(e,e.line-a),l=o=e.position,c=!1),it(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return Qe(e,l,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function Ro(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Qe(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Be(n)?(Qe(e,r,i,!0),Fn(e,pe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Xt(e)?Y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Y(e,"unexpected end of the stream within a single quoted scalar")}function Po(e,t){var n,r,i,l,o,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Qe(e,n,e.position,!0),e.position++,!0;if(c===92){if(Qe(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),Be(c))pe(e,!1,t);else if(c<256&&wi[c])e.result+=bi[c],e.position++;else if((o=Do(c))>0){for(i=o,l=0;i>0;i--)c=e.input.charCodeAt(++e.position),(o=Oo(c))>=0?l=(l<<4)+o:Y(e,"expected hexadecimal character");e.result+=Ho(l),e.position++}else Y(e,"unknown escape sequence");n=r=e.position}else Be(c)?(Qe(e,n,r,!0),Fn(e,pe(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Xt(e)?Y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}Y(e,"unexpected end of the stream within a double quoted scalar")}function $o(e,t){var n=!0,r,i,l,o=e.tag,c,a=e.anchor,s,f,u,d,p,g=Object.create(null),h,v,A,E;if(E=e.input.charCodeAt(e.position),E===91)f=93,p=!1,c=[];else if(E===123)f=125,p=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),E=e.input.charCodeAt(++e.position);E!==0;){if(pe(e,!0,t),E=e.input.charCodeAt(e.position),E===f)return e.position++,e.tag=o,e.anchor=a,e.kind=p?"mapping":"sequence",e.result=c,!0;n?E===44&&Y(e,"expected the node content, but found ','"):Y(e,"missed comma between flow collection entries"),v=h=A=null,u=d=!1,E===63&&(s=e.input.charCodeAt(e.position+1),Me(s)&&(u=d=!0,e.position++,pe(e,!0,t))),r=e.line,i=e.lineStart,l=e.position,yt(e,t,qt,!1,!0),v=e.tag,h=e.result,pe(e,!0,t),E=e.input.charCodeAt(e.position),(d||e.line===r)&&E===58&&(u=!0,E=e.input.charCodeAt(++e.position),pe(e,!0,t),yt(e,t,qt,!1,!0),A=e.result),p?wt(e,c,g,v,h,A,r,i,l):u?c.push(wt(e,null,g,v,h,A,r,i,l)):c.push(h),pe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}Y(e,"unexpected end of the stream within a flow collection")}function jo(e,t){var n,r,i=on,l=!1,o=!1,c=t,a=0,s=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)on===i?i=u===43?Zn:xo:Y(e,"repeat of a chomping mode identifier");else if((f=Fo(u))>=0)f===0?Y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Y(e,"repeat of an indentation width identifier"):(c=t+f-1,o=!0);else break;if(it(u)){do u=e.input.charCodeAt(++e.position);while(it(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!Be(u)&&u!==0)}for(;u!==0;){for(Dn(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<c)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>c&&(c=e.lineIndent),Be(u)){a++;continue}if(e.lineIndent<c){i===Zn?e.result+=ge.repeat(`
11
+ `,l?1+a:a):i===on&&l&&(e.result+=`
12
12
  `);break}for(r?it(u)?(s=!0,e.result+=ge.repeat(`
13
13
  `,l?1+a:a)):s?(s=!1,e.result+=ge.repeat(`
14
14
  `,a+1)):a===0?l&&(e.result+=" "):e.result+=ge.repeat(`
15
15
  `,a):e.result+=ge.repeat(`
16
- `,l?1+a:a),l=!0,o=!0,a=0,n=e.position;!Be(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Qe(e,n,e.position,!1)}return!0}function Jn(e,t){var n,r=e.tag,i=e.anchor,l=[],o,c=!1,a;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),a=e.input.charCodeAt(e.position);a!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),!(a!==45||(o=e.input.charCodeAt(e.position+1),!Me(o))));){if(c=!0,e.position++,pe(e,!0,-1)&&e.lineIndent<=t){l.push(null),a=e.input.charCodeAt(e.position);continue}if(n=e.line,yt(e,t,hi,!1,!0),l.push(e.result),pe(e,!0,-1),a=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&a!==0)Y(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=l,!0):!1}function jo(e,t,n){var r,i,l,o,c,a,s=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,g=null,h=null,v=!1,A=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),E=e.input.charCodeAt(e.position);E!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),l=e.line,(E===63||E===58)&&Me(r))E===63?(v&&(wt(e,u,d,p,g,null,o,c,a),p=g=h=null),A=!0,v=!0,i=!0):v?(v=!1,i=!0):Y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,E=r;else{if(o=e.line,c=e.lineStart,a=e.position,!yt(e,n,pi,!1,!0))break;if(e.line===l){for(E=e.input.charCodeAt(e.position);it(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),Me(E)||Y(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(wt(e,u,d,p,g,null,o,c,a),p=g=h=null),A=!0,v=!1,i=!1,p=e.tag,g=e.result;else if(A)Y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=f,!0}else if(A)Y(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=f,!0}if((e.line===l||e.lineIndent>t)&&(v&&(o=e.line,c=e.lineStart,a=e.position),yt(e,t,qt,!0,i)&&(v?g=e.result:h=e.result),v||(wt(e,u,d,p,g,h,o,c,a),p=g=h=null),pe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>t)&&E!==0)Y(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&wt(e,u,d,p,g,null,o,c,a),A&&(e.tag=s,e.anchor=f,e.kind="mapping",e.result=u),A}function Vo(e){var t,n=!1,r=!1,i,l,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&Y(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(l=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):Y(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Me(o);)o===33&&(r?Y(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),mi.test(i)||Y(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);l=e.input.slice(t,e.position),To.test(l)&&Y(e,"tag suffix cannot contain flow indicator characters")}l&&!gi.test(l)&&Y(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{Y(e,"tag name is malformed: "+l)}return n?e.tag=l:et.call(e.tagMap,i)?e.tag=e.tagMap[i]+l:i==="!"?e.tag="!"+l:i==="!!"?e.tag="tag:yaml.org,2002:"+l:Y(e,'undeclared tag handle "'+i+'"'),!0}function qo(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&Y(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Me(n)&&!_t(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Yo(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Me(r)&&!_t(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),et.call(e.anchorMap,n)||Y(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],pe(e,!0,-1),!0}function yt(e,t,n,r,i){var l,o,c,a=1,s=!1,f=!1,u,d,p,g,h,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=o=c=qt===n||hi===n,r&&pe(e,!0,-1)&&(s=!0,e.lineIndent>t?a=1:e.lineIndent===t?a=0:e.lineIndent<t&&(a=-1)),a===1)for(;Vo(e)||qo(e);)pe(e,!0,-1)?(s=!0,c=l,e.lineIndent>t?a=1:e.lineIndent===t?a=0:e.lineIndent<t&&(a=-1)):c=!1;if(c&&(c=s||i),(a===1||qt===n)&&(Vt===n||pi===n?h=t:h=t+1,v=e.position-e.lineStart,a===1?c&&(Jn(e,v)||jo(e,v,h))||Po(e,h)?f=!0:(o&&$o(e,h)||No(e,h)||Ro(e,h)?f=!0:Yo(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&Y(e,"alias node should not have any properties")):Io(e,h,Vt===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):a===0&&(f=c&&Jn(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(et.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,p=e.typeMap.multi[e.kind||"fallback"],u=0,d=p.length;u<d;u+=1)if(e.tag.slice(0,p[u].tag.length)===p[u].tag){g=p[u];break}g||Y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&Y(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Y(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Uo(e){var t=e.position,n,r,i,l=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(pe(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(l=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Me(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&Y(e,"directive name must not be less than one character in length");o!==0;){for(;it(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Be(o));break}if(Be(o))break;for(n=e.position;o!==0&&!Me(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&On(e),et.call(Xn,r)?Xn[r](e,r,i):Yt(e,'unknown document directive "'+r+'"')}if(pe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,pe(e,!0,-1)):l&&Y(e,"directives end mark is expected"),yt(e,e.lineIndent-1,qt,!1,!0),pe(e,!0,-1),e.checkLineBreaks&&Lo.test(e.input.slice(t,e.position))&&Yt(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Kt(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,pe(e,!0,-1));return}if(e.position<e.length-1)Y(e,"end of the stream or a document separator is expected");else return}function vi(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Ho(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,Y(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Uo(n);return n.documents}function Bo(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=vi(e,n);if(typeof t!="function")return r;for(var i=0,l=r.length;i<l;i+=1)t(r[i])}function Go(e,t){var n=vi(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Le("expected a single document in the stream, but found more")}}var Wo=Bo,zo=Go,yi={loadAll:Wo,load:zo},ki=Object.prototype.toString,Ai=Object.prototype.hasOwnProperty,Fn=65279,Zo=9,Mt=10,Ko=13,Xo=32,Qo=33,Jo=34,pn=35,ec=37,tc=38,nc=39,rc=42,Ei=44,ic=45,Ut=58,lc=61,oc=62,cc=63,ac=64,Ci=91,Si=93,sc=96,xi=123,uc=124,Li=125,Se={};Se[0]="\\0";Se[7]="\\a";Se[8]="\\b";Se[9]="\\t";Se[10]="\\n";Se[11]="\\v";Se[12]="\\f";Se[13]="\\r";Se[27]="\\e";Se[34]='\\"';Se[92]="\\\\";Se[133]="\\N";Se[160]="\\_";Se[8232]="\\L";Se[8233]="\\P";var fc=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],dc=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function pc(e,t){var n,r,i,l,o,c,a;if(t===null)return{};for(n={},r=Object.keys(t),i=0,l=r.length;i<l;i+=1)o=r[i],c=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),a=e.compiledTypeMap.fallback[o],a&&Ai.call(a.styleAliases,c)&&(c=a.styleAliases[c]),n[o]=c;return n}function hc(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Le("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",r-t.length)+t}var mc=1,Ot=2;function gc(e){this.schema=e.schema||Mn,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=pc(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ot:mc,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function er(e,t){for(var n=ge.repeat(" ",t),r=0,i=-1,l="",o,c=e.length;r<c;)i=e.indexOf(`
16
+ `,l?1+a:a),l=!0,o=!0,a=0,n=e.position;!Be(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Qe(e,n,e.position,!1)}return!0}function er(e,t){var n,r=e.tag,i=e.anchor,l=[],o,c=!1,a;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),a=e.input.charCodeAt(e.position);a!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),!(a!==45||(o=e.input.charCodeAt(e.position+1),!Me(o))));){if(c=!0,e.position++,pe(e,!0,-1)&&e.lineIndent<=t){l.push(null),a=e.input.charCodeAt(e.position);continue}if(n=e.line,yt(e,t,mi,!1,!0),l.push(e.result),pe(e,!0,-1),a=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&a!==0)Y(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=l,!0):!1}function Vo(e,t,n){var r,i,l,o,c,a,s=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,g=null,h=null,v=!1,A=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),E=e.input.charCodeAt(e.position);E!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),l=e.line,(E===63||E===58)&&Me(r))E===63?(v&&(wt(e,u,d,p,g,null,o,c,a),p=g=h=null),A=!0,v=!0,i=!0):v?(v=!1,i=!0):Y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,E=r;else{if(o=e.line,c=e.lineStart,a=e.position,!yt(e,n,hi,!1,!0))break;if(e.line===l){for(E=e.input.charCodeAt(e.position);it(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),Me(E)||Y(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(wt(e,u,d,p,g,null,o,c,a),p=g=h=null),A=!0,v=!1,i=!1,p=e.tag,g=e.result;else if(A)Y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=f,!0}else if(A)Y(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=f,!0}if((e.line===l||e.lineIndent>t)&&(v&&(o=e.line,c=e.lineStart,a=e.position),yt(e,t,Yt,!0,i)&&(v?g=e.result:h=e.result),v||(wt(e,u,d,p,g,h,o,c,a),p=g=h=null),pe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>t)&&E!==0)Y(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&wt(e,u,d,p,g,null,o,c,a),A&&(e.tag=s,e.anchor=f,e.kind="mapping",e.result=u),A}function qo(e){var t,n=!1,r=!1,i,l,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&Y(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(l=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):Y(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Me(o);)o===33&&(r?Y(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),gi.test(i)||Y(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);l=e.input.slice(t,e.position),Mo.test(l)&&Y(e,"tag suffix cannot contain flow indicator characters")}l&&!_i.test(l)&&Y(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{Y(e,"tag name is malformed: "+l)}return n?e.tag=l:et.call(e.tagMap,i)?e.tag=e.tagMap[i]+l:i==="!"?e.tag="!"+l:i==="!!"?e.tag="tag:yaml.org,2002:"+l:Y(e,'undeclared tag handle "'+i+'"'),!0}function Yo(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&Y(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Me(n)&&!_t(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Uo(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Me(r)&&!_t(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),et.call(e.anchorMap,n)||Y(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],pe(e,!0,-1),!0}function yt(e,t,n,r,i){var l,o,c,a=1,s=!1,f=!1,u,d,p,g,h,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=o=c=Yt===n||mi===n,r&&pe(e,!0,-1)&&(s=!0,e.lineIndent>t?a=1:e.lineIndent===t?a=0:e.lineIndent<t&&(a=-1)),a===1)for(;qo(e)||Yo(e);)pe(e,!0,-1)?(s=!0,c=l,e.lineIndent>t?a=1:e.lineIndent===t?a=0:e.lineIndent<t&&(a=-1)):c=!1;if(c&&(c=s||i),(a===1||Yt===n)&&(qt===n||hi===n?h=t:h=t+1,v=e.position-e.lineStart,a===1?c&&(er(e,v)||Vo(e,v,h))||$o(e,h)?f=!0:(o&&jo(e,h)||Ro(e,h)||Po(e,h)?f=!0:Uo(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&Y(e,"alias node should not have any properties")):No(e,h,qt===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):a===0&&(f=c&&er(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(et.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,p=e.typeMap.multi[e.kind||"fallback"],u=0,d=p.length;u<d;u+=1)if(e.tag.slice(0,p[u].tag.length)===p[u].tag){g=p[u];break}g||Y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&Y(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Y(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Bo(e){var t=e.position,n,r,i,l=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(pe(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(l=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Me(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&Y(e,"directive name must not be less than one character in length");o!==0;){for(;it(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Be(o));break}if(Be(o))break;for(n=e.position;o!==0&&!Me(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Dn(e),et.call(Qn,r)?Qn[r](e,r,i):Ut(e,'unknown document directive "'+r+'"')}if(pe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,pe(e,!0,-1)):l&&Y(e,"directives end mark is expected"),yt(e,e.lineIndent-1,Yt,!1,!0),pe(e,!0,-1),e.checkLineBreaks&&To.test(e.input.slice(t,e.position))&&Ut(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xt(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,pe(e,!0,-1));return}if(e.position<e.length-1)Y(e,"end of the stream or a document separator is expected");else return}function yi(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Io(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,Y(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Bo(n);return n.documents}function Go(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=yi(e,n);if(typeof t!="function")return r;for(var i=0,l=r.length;i<l;i+=1)t(r[i])}function Wo(e,t){var n=yi(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Le("expected a single document in the stream, but found more")}}var zo=Go,Zo=Wo,ki={loadAll:zo,load:Zo},Ai=Object.prototype.toString,Ei=Object.prototype.hasOwnProperty,Hn=65279,Ko=9,Ot=10,Xo=13,Qo=32,Jo=33,ec=34,hn=35,tc=37,nc=38,rc=39,ic=42,Ci=44,lc=45,Bt=58,oc=61,cc=62,ac=63,sc=64,Si=91,xi=93,uc=96,Li=123,fc=124,Ti=125,Se={};Se[0]="\\0";Se[7]="\\a";Se[8]="\\b";Se[9]="\\t";Se[10]="\\n";Se[11]="\\v";Se[12]="\\f";Se[13]="\\r";Se[27]="\\e";Se[34]='\\"';Se[92]="\\\\";Se[133]="\\N";Se[160]="\\_";Se[8232]="\\L";Se[8233]="\\P";var dc=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],pc=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function hc(e,t){var n,r,i,l,o,c,a;if(t===null)return{};for(n={},r=Object.keys(t),i=0,l=r.length;i<l;i+=1)o=r[i],c=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),a=e.compiledTypeMap.fallback[o],a&&Ei.call(a.styleAliases,c)&&(c=a.styleAliases[c]),n[o]=c;return n}function mc(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Le("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",r-t.length)+t}var gc=1,Dt=2;function _c(e){this.schema=e.schema||On,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=hc(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Dt:gc,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function tr(e,t){for(var n=ge.repeat(" ",t),r=0,i=-1,l="",o,c=e.length;r<c;)i=e.indexOf(`
18
18
  `,r),i===-1?(o=e.slice(r),r=c):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
19
- `&&(l+=n),l+=o;return l}function hn(e,t){return`
20
- `+ge.repeat(" ",e.indent*t)}function _c(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Bt(e){return e===Xo||e===Zo}function Dt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Fn||65536<=e&&e<=1114111}function tr(e){return Dt(e)&&e!==Fn&&e!==Ko&&e!==Mt}function nr(e,t,n){var r=tr(e),i=r&&!Bt(e);return(n?r:r&&e!==Ei&&e!==Ci&&e!==Si&&e!==xi&&e!==Li)&&e!==pn&&!(t===Ut&&!i)||tr(t)&&!Bt(t)&&e===pn||t===Ut&&i}function wc(e){return Dt(e)&&e!==Fn&&!Bt(e)&&e!==ic&&e!==cc&&e!==Ut&&e!==Ei&&e!==Ci&&e!==Si&&e!==xi&&e!==Li&&e!==pn&&e!==tc&&e!==rc&&e!==Qo&&e!==uc&&e!==lc&&e!==oc&&e!==nc&&e!==Jo&&e!==ec&&e!==ac&&e!==sc}function bc(e){return!Bt(e)&&e!==Ut}function St(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function Ti(e){var t=/^\n* /;return t.test(e)}var Mi=1,mn=2,Oi=3,Di=4,gt=5;function vc(e,t,n,r,i,l,o,c){var a,s=0,f=null,u=!1,d=!1,p=r!==-1,g=-1,h=wc(St(e,0))&&bc(St(e,e.length-1));if(t||o)for(a=0;a<e.length;s>=65536?a+=2:a++){if(s=St(e,a),!Dt(s))return gt;h=h&&nr(s,f,c),f=s}else{for(a=0;a<e.length;s>=65536?a+=2:a++){if(s=St(e,a),s===Mt)u=!0,p&&(d=d||a-g-1>r&&e[g+1]!==" ",g=a);else if(!Dt(s))return gt;h=h&&nr(s,f,c),f=s}d=d||p&&a-g-1>r&&e[g+1]!==" "}return!u&&!d?h&&!o&&!i(e)?Mi:l===Ot?gt:mn:n>9&&Ti(e)?gt:o?l===Ot?gt:mn:d?Di:Oi}function yc(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Ot?'""':"''";if(!e.noCompatMode&&(fc.indexOf(t)!==-1||dc.test(t)))return e.quotingType===Ot?'"'+t+'"':"'"+t+"'";var l=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),c=r||e.flowLevel>-1&&n>=e.flowLevel;function a(s){return _c(e,s)}switch(vc(t,c,e.indent,o,a,e.quotingType,e.forceQuotes&&!r,i)){case Mi:return t;case mn:return"'"+t.replace(/'/g,"''")+"'";case Oi:return"|"+rr(t,e.indent)+ir(er(t,l));case Di:return">"+rr(t,e.indent)+ir(er(kc(t,o),l));case gt:return'"'+Ac(t)+'"';default:throw new Le("impossible error: invalid scalar style")}}()}function rr(e,t){var n=Ti(e)?String(t):"",r=e[e.length-1]===`
19
+ `&&(l+=n),l+=o;return l}function mn(e,t){return`
20
+ `+ge.repeat(" ",e.indent*t)}function wc(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Gt(e){return e===Qo||e===Ko}function Ft(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Hn||65536<=e&&e<=1114111}function nr(e){return Ft(e)&&e!==Hn&&e!==Xo&&e!==Ot}function rr(e,t,n){var r=nr(e),i=r&&!Gt(e);return(n?r:r&&e!==Ci&&e!==Si&&e!==xi&&e!==Li&&e!==Ti)&&e!==hn&&!(t===Bt&&!i)||nr(t)&&!Gt(t)&&e===hn||t===Bt&&i}function bc(e){return Ft(e)&&e!==Hn&&!Gt(e)&&e!==lc&&e!==ac&&e!==Bt&&e!==Ci&&e!==Si&&e!==xi&&e!==Li&&e!==Ti&&e!==hn&&e!==nc&&e!==ic&&e!==Jo&&e!==fc&&e!==oc&&e!==cc&&e!==rc&&e!==ec&&e!==tc&&e!==sc&&e!==uc}function vc(e){return!Gt(e)&&e!==Bt}function xt(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function Mi(e){var t=/^\n* /;return t.test(e)}var Oi=1,gn=2,Di=3,Fi=4,gt=5;function yc(e,t,n,r,i,l,o,c){var a,s=0,f=null,u=!1,d=!1,p=r!==-1,g=-1,h=bc(xt(e,0))&&vc(xt(e,e.length-1));if(t||o)for(a=0;a<e.length;s>=65536?a+=2:a++){if(s=xt(e,a),!Ft(s))return gt;h=h&&rr(s,f,c),f=s}else{for(a=0;a<e.length;s>=65536?a+=2:a++){if(s=xt(e,a),s===Ot)u=!0,p&&(d=d||a-g-1>r&&e[g+1]!==" ",g=a);else if(!Ft(s))return gt;h=h&&rr(s,f,c),f=s}d=d||p&&a-g-1>r&&e[g+1]!==" "}return!u&&!d?h&&!o&&!i(e)?Oi:l===Dt?gt:gn:n>9&&Mi(e)?gt:o?l===Dt?gt:gn:d?Fi:Di}function kc(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Dt?'""':"''";if(!e.noCompatMode&&(dc.indexOf(t)!==-1||pc.test(t)))return e.quotingType===Dt?'"'+t+'"':"'"+t+"'";var l=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),c=r||e.flowLevel>-1&&n>=e.flowLevel;function a(s){return wc(e,s)}switch(yc(t,c,e.indent,o,a,e.quotingType,e.forceQuotes&&!r,i)){case Oi:return t;case gn:return"'"+t.replace(/'/g,"''")+"'";case Di:return"|"+ir(t,e.indent)+lr(tr(t,l));case Fi:return">"+ir(t,e.indent)+lr(tr(Ac(t,o),l));case gt:return'"'+Ec(t)+'"';default:throw new Le("impossible error: invalid scalar style")}}()}function ir(e,t){var n=Mi(e)?String(t):"",r=e[e.length-1]===`
21
21
  `,i=r&&(e[e.length-2]===`
22
22
  `||e===`
23
23
  `),l=i?"+":r?"":"-";return n+l+`
24
- `}function ir(e){return e[e.length-1]===`
25
- `?e.slice(0,-1):e}function kc(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var s=e.indexOf(`
26
- `);return s=s!==-1?s:e.length,n.lastIndex=s,lr(e.slice(0,s),t)}(),i=e[0]===`
24
+ `}function lr(e){return e[e.length-1]===`
25
+ `?e.slice(0,-1):e}function Ac(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var s=e.indexOf(`
26
+ `);return s=s!==-1?s:e.length,n.lastIndex=s,or(e.slice(0,s),t)}(),i=e[0]===`
27
27
  `||e[0]===" ",l,o;o=n.exec(e);){var c=o[1],a=o[2];l=a[0]===" ",r+=c+(!i&&!l&&a!==""?`
28
- `:"")+lr(a,t),i=l}return r}function lr(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,l,o=0,c=0,a="";r=n.exec(e);)c=r.index,c-i>t&&(l=o>i?o:c,a+=`
28
+ `:"")+or(a,t),i=l}return r}function or(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,l,o=0,c=0,a="";r=n.exec(e);)c=r.index,c-i>t&&(l=o>i?o:c,a+=`
29
29
  `+e.slice(i,l),i=l+1),o=c;return a+=`
30
30
  `,e.length-i>t&&o>i?a+=e.slice(i,o)+`
31
- `+e.slice(o+1):a+=e.slice(i),a.slice(1)}function Ac(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=St(e,i),r=Se[n],!r&&Dt(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||hc(n);return t}function Ec(e,t,n){var r="",i=e.tag,l,o,c;for(l=0,o=n.length;l<o;l+=1)c=n[l],e.replacer&&(c=e.replacer.call(n,String(l),c)),(Ze(e,t,c,!1,!1)||typeof c>"u"&&Ze(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function or(e,t,n,r){var i="",l=e.tag,o,c,a;for(o=0,c=n.length;o<c;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(Ze(e,t+1,a,!0,!0,!1,!0)||typeof a>"u"&&Ze(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=hn(e,t)),e.dump&&Mt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=l,e.dump=i||"[]"}function Cc(e,t,n){var r="",i=e.tag,l=Object.keys(n),o,c,a,s,f;for(o=0,c=l.length;o<c;o+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),a=l[o],s=n[a],e.replacer&&(s=e.replacer.call(n,a,s)),Ze(e,t,a,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ze(e,t,s,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function Sc(e,t,n,r){var i="",l=e.tag,o=Object.keys(n),c,a,s,f,u,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Le("sortKeys must be a boolean or a function");for(c=0,a=o.length;c<a;c+=1)d="",(!r||i!=="")&&(d+=hn(e,t)),s=o[c],f=n[s],e.replacer&&(f=e.replacer.call(n,s,f)),Ze(e,t+1,s,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Mt===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=hn(e,t)),Ze(e,t+1,f,!0,u)&&(e.dump&&Mt===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=l,e.dump=i||"{}"}function cr(e,t,n){var r,i,l,o,c,a;for(i=n?e.explicitTypes:e.implicitTypes,l=0,o=i.length;l<o;l+=1)if(c=i[l],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(n?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(a=e.styleMap[c.tag]||c.defaultStyle,ki.call(c.represent)==="[object Function]")r=c.represent(t,a);else if(Ai.call(c.represent,a))r=c.represent[a](t,a);else throw new Le("!<"+c.tag+'> tag resolver accepts not "'+a+'" style');e.dump=r}return!0}return!1}function Ze(e,t,n,r,i,l,o){e.tag=null,e.dump=n,cr(e,n,!1)||cr(e,n,!0);var c=ki.call(e.dump),a=r,s;r&&(r=e.flowLevel<0||e.flowLevel>t);var f=c==="[object Object]"||c==="[object Array]",u,d;if(f&&(u=e.duplicates.indexOf(n),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),c==="[object Object]")r&&Object.keys(e.dump).length!==0?(Sc(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Cc(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(c==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?or(e,t-1,e.dump,i):or(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Ec(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&yc(e,e.dump,t,l,a);else{if(c==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Le("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(s=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?s="!"+s:s.slice(0,18)==="tag:yaml.org,2002:"?s="!!"+s.slice(18):s="!<"+s+">",e.dump=s+" "+e.dump)}return!0}function xc(e,t){var n=[],r=[],i,l;for(gn(e,n,r),i=0,l=r.length;i<l;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(l)}function gn(e,t,n){var r,i,l;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,l=e.length;i<l;i+=1)gn(e[i],t,n);else for(r=Object.keys(e),i=0,l=r.length;i<l;i+=1)gn(e[r[i]],t,n)}function Lc(e,t){t=t||{};var n=new gc(t);n.noRefs||xc(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Ze(n,0,r,!0,!0)?n.dump+`
32
- `:""}var Tc=Lc,Mc={dump:Tc};function Hn(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Oc=be,Dc=zr,Fc=Qr,Hc=ri,Ic=ii,Nc=Mn,Rc=yi.load,Pc=yi.loadAll,$c=Mc.dump,jc=Le,Vc={binary:si,float:ni,map:Xr,null:Jr,pairs:fi,set:di,timestamp:ci,bool:ei,int:ti,merge:ai,omap:ui,seq:Kr,str:Zr},qc=Hn("safeLoad","load"),Yc=Hn("safeLoadAll","loadAll"),Uc=Hn("safeDump","dump"),Xt={Type:Oc,Schema:Dc,FAILSAFE_SCHEMA:Fc,JSON_SCHEMA:Hc,CORE_SCHEMA:Ic,DEFAULT_SCHEMA:Nc,load:Rc,loadAll:Pc,dump:$c,YAMLException:jc,types:Vc,safeLoad:qc,safeLoadAll:Yc,safeDump:Uc};const $e=tt(),Fe=tt(),we=tt({}),Ve=tt(),Ce=Br(null,e=>(Bc().then(e).catch(t=>console.error("Failed to load config.",t)),()=>{})),In=El(Ce,(e,t)=>{const n=e==null?void 0:e.custom_actions;return n?(Gc(n).then(t).catch(r=>console.error("Failed to load cms actions.",r)),()=>{}):null});async function Bc(){const e=new URL("../../cms-config/config.yml",window.location.href).href,t=await fetch(e);if(!t.ok)throw new Error(`Unable to fetch file ${e}`);return Xt.load(await t.text())}async function Gc(e){const t=`../../cms-config/${e}`;return(await import(new URL(t,window.location.href).href)).default}function Wc(e){let t,n,r,i,l,o,c,a,s,f,u,d,p;return{c(){t=k("nav"),n=k("ul"),r=k("li"),i=k("a"),l=q(),o=k("li"),c=k("a"),a=q(),s=k("ul"),f=k("li"),u=k("a"),m(i,"href","##posts"),m(i,"data-tooltip","Posts"),m(i,"data-placement","bottom"),m(c,"href","##media"),m(c,"data-tooltip","Media Files"),m(c,"data-placement","bottom"),m(u,"href","##exit"),m(u,"class","secondary"),m(u,"data-tooltip","Exit"),m(u,"data-placement","bottom")},m(g,h){N(g,t,h),w(t,n),w(n,r),w(r,i),i.innerHTML=yl,w(n,l),w(n,o),w(o,c),c.innerHTML=kl,w(t,a),w(t,s),w(s,f),w(f,u),u.innerHTML=Al,d||(p=[Z(i,"click",Ue(e[0])),Z(c,"click",Ue(e[0])),Z(u,"click",Ue(e[1]))],d=!0)},p:b,i:b,o:b,d(g){g&&H(t),d=!1,ue(p)}}}function zc(e,t,n){let r,i;W(e,Ve,a=>n(2,r=a)),W(e,In,a=>n(3,i=a));const l=Zt();function o(a){const s=new URL(a.currentTarget.href).hash.replaceAll("#","");l("selectview",s),a.currentTarget.blur()}async function c(){i!=null&&i.onLogout&&await i.onLogout(),r!=null&&r.logout?await r.logout():history.back()}return[o,c]}class Zc extends ae{constructor(t){super(),ce(this,t,zc,Wc,ie,{})}}const Kc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-edit</title><path d="M10 19.11L12.11 17H7V15H14V15.12L16.12 13H7V11H17V12.12L18.24 10.89C18.72 10.41 19.35 10.14 20.04 10.14C20.37 10.14 20.7 10.21 21 10.33V5C21 3.89 20.1 3 19 3H5C3.89 3 3 3.89 3 5V19C3 20.11 3.9 21 5 21H10V19.11M7 7H17V9H7V7M21.7 14.35L20.7 15.35L18.65 13.3L19.65 12.3C19.86 12.09 20.21 12.09 20.42 12.3L21.7 13.58C21.91 13.79 21.91 14.14 21.7 14.35M12 19.94L18.06 13.88L20.11 15.93L14.06 22H12V19.94Z" /></svg>';function Xc(e){let t,n,r,i,l,o;return{c(){t=k("li"),n=k("a"),r=new ze(!1),i=te(e[0]),r.a=i,m(n,"href","##placeholder"),m(n,"class","collectionNav svelte-1r1578h"),jt(n,"selected",e[1]),m(t,"class","svelte-1r1578h")},m(c,a){N(c,t,a),w(t,n),r.m(Kc,n),w(n,i),l||(o=Z(n,"click",Ue(e[2])),l=!0)},p(c,[a]){a&1&&_e(i,c[0]),a&2&&jt(n,"selected",c[1])},i:b,o:b,d(c){c&&H(t),l=!1,o()}}}function Qc(e,t,n){let r,i,l;W(e,Ce,s=>n(5,i=s)),W(e,$e,s=>n(4,l=s));let{name:o}=t,{label:c}=t;function a(){he($e,l=i.collections.find(s=>s.name===o),l)}return e.$$set=s=>{"name"in s&&n(3,o=s.name),"label"in s&&n(0,c=s.label)},e.$$.update=()=>{e.$$.dirty&24&&n(1,r=(l==null?void 0:l.name)===o?"selected":"")},[c,r,a,o,l]}class Jc extends ae{constructor(t){super(),ce(this,t,Qc,Xc,ie,{name:3,label:0})}}var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ad(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ii={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Fi,function(){var n=1e3,r=6e4,i=36e5,l="millisecond",o="second",c="minute",a="hour",s="day",f="week",u="month",d="quarter",p="year",g="date",h="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var y=["th","st","nd","rd"],_=O%100;return"["+O+(y[(_-20)%10]||y[_]||y[0])+"]"}},T=function(O,y,_){var x=String(O);return!x||x.length>=y?O:""+Array(y+1-x.length).join(_)+O},j={s:T,z:function(O){var y=-O.utcOffset(),_=Math.abs(y),x=Math.floor(_/60),L=_%60;return(y<=0?"+":"-")+T(x,2,"0")+":"+T(L,2,"0")},m:function O(y,_){if(y.date()<_.date())return-O(_,y);var x=12*(_.year()-y.year())+(_.month()-y.month()),L=y.clone().add(x,u),$=_-L<0,G=y.clone().add(x+($?-1:1),u);return+(-(x+(_-L)/($?L-G:G-L))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:u,y:p,w:f,d:s,D:g,h:a,m:c,s:o,ms:l,Q:d}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},D="en",R={};R[D]=E;var F="$isDayjsObject",C=function(O){return O instanceof B||!(!O||!O[F])},P=function O(y,_,x){var L;if(!y)return D;if(typeof y=="string"){var $=y.toLowerCase();R[$]&&(L=$),_&&(R[$]=_,L=$);var G=y.split("-");if(!L&&G.length>1)return O(G[0])}else{var Q=y.name;R[Q]=y,L=Q}return!x&&L&&(D=L),L||!x&&D},M=function(O,y){if(C(O))return O.clone();var _=typeof y=="object"?y:{};return _.date=O,_.args=arguments,new B(_)},S=j;S.l=P,S.i=C,S.w=function(O,y){return M(O,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var B=function(){function O(_){this.$L=P(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[F]=!0}var y=O.prototype;return y.parse=function(_){this.$d=function(x){var L=x.date,$=x.utc;if(L===null)return new Date(NaN);if(S.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var G=L.match(v);if(G){var Q=G[2]-1||0,ne=(G[7]||"0").substring(0,3);return $?new Date(Date.UTC(G[1],Q,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ne)):new Date(G[1],Q,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ne)}}return new Date(L)}(_),this.init()},y.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return this.$d.toString()!==h},y.isSame=function(_,x){var L=M(_);return this.startOf(x)<=L&&L<=this.endOf(x)},y.isAfter=function(_,x){return M(_)<this.startOf(x)},y.isBefore=function(_,x){return this.endOf(x)<M(_)},y.$g=function(_,x,L){return S.u(_)?this[x]:this.set(L,_)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(_,x){var L=this,$=!!S.u(x)||x,G=S.p(_),Q=function(De,de){var xe=S.w(L.$u?Date.UTC(L.$y,de,De):new Date(L.$y,de,De),L);return $?xe:xe.endOf(s)},ne=function(De,de){return S.w(L.toDate()[De].apply(L.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(de)),L)},le=this.$W,fe=this.$M,Ae=this.$D,qe="set"+(this.$u?"UTC":"");switch(G){case p:return $?Q(1,0):Q(31,11);case u:return $?Q(1,fe):Q(0,fe+1);case f:var He=this.$locale().weekStart||0,Ne=(le<He?le+7:le)-He;return Q($?Ae-Ne:Ae+(6-Ne),fe);case s:case g:return ne(qe+"Hours",0);case a:return ne(qe+"Minutes",1);case c:return ne(qe+"Seconds",2);case o:return ne(qe+"Milliseconds",3);default:return this.clone()}},y.endOf=function(_){return this.startOf(_,!1)},y.$set=function(_,x){var L,$=S.p(_),G="set"+(this.$u?"UTC":""),Q=(L={},L[s]=G+"Date",L[g]=G+"Date",L[u]=G+"Month",L[p]=G+"FullYear",L[a]=G+"Hours",L[c]=G+"Minutes",L[o]=G+"Seconds",L[l]=G+"Milliseconds",L)[$],ne=$===s?this.$D+(x-this.$W):x;if($===u||$===p){var le=this.clone().set(g,1);le.$d[Q](ne),le.init(),this.$d=le.set(g,Math.min(this.$D,le.daysInMonth())).$d}else Q&&this.$d[Q](ne);return this.init(),this},y.set=function(_,x){return this.clone().$set(_,x)},y.get=function(_){return this[S.p(_)]()},y.add=function(_,x){var L,$=this;_=Number(_);var G=S.p(x),Q=function(fe){var Ae=M($);return S.w(Ae.date(Ae.date()+Math.round(fe*_)),$)};if(G===u)return this.set(u,this.$M+_);if(G===p)return this.set(p,this.$y+_);if(G===s)return Q(1);if(G===f)return Q(7);var ne=(L={},L[c]=r,L[a]=i,L[o]=n,L)[G]||1,le=this.$d.getTime()+_*ne;return S.w(le,this)},y.subtract=function(_,x){return this.add(-1*_,x)},y.format=function(_){var x=this,L=this.$locale();if(!this.isValid())return L.invalidDate||h;var $=_||"YYYY-MM-DDTHH:mm:ssZ",G=S.z(this),Q=this.$H,ne=this.$m,le=this.$M,fe=L.weekdays,Ae=L.months,qe=L.meridiem,He=function(de,xe,Re,Ye){return de&&(de[xe]||de(x,$))||Re[xe].slice(0,Ye)},Ne=function(de){return S.s(Q%12||12,de,"0")},De=qe||function(de,xe,Re){var Ye=de<12?"AM":"PM";return Re?Ye.toLowerCase():Ye};return $.replace(A,function(de,xe){return xe||function(Re){switch(Re){case"YY":return String(x.$y).slice(-2);case"YYYY":return S.s(x.$y,4,"0");case"M":return le+1;case"MM":return S.s(le+1,2,"0");case"MMM":return He(L.monthsShort,le,Ae,3);case"MMMM":return He(Ae,le);case"D":return x.$D;case"DD":return S.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return He(L.weekdaysMin,x.$W,fe,2);case"ddd":return He(L.weekdaysShort,x.$W,fe,3);case"dddd":return fe[x.$W];case"H":return String(Q);case"HH":return S.s(Q,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return De(Q,ne,!0);case"A":return De(Q,ne,!1);case"m":return String(ne);case"mm":return S.s(ne,2,"0");case"s":return String(x.$s);case"ss":return S.s(x.$s,2,"0");case"SSS":return S.s(x.$ms,3,"0");case"Z":return G}return null}(de)||G.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(_,x,L){var $,G=this,Q=S.p(x),ne=M(_),le=(ne.utcOffset()-this.utcOffset())*r,fe=this-ne,Ae=function(){return S.m(G,ne)};switch(Q){case p:$=Ae()/12;break;case u:$=Ae();break;case d:$=Ae()/3;break;case f:$=(fe-le)/6048e5;break;case s:$=(fe-le)/864e5;break;case a:$=fe/i;break;case c:$=fe/r;break;case o:$=fe/n;break;default:$=fe}return L?$:S.a($)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return R[this.$L]},y.locale=function(_,x){if(!_)return this.$L;var L=this.clone(),$=P(_,x,!0);return $&&(L.$L=$),L},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},O}(),z=B.prototype;return M.prototype=z,[["$ms",l],["$s",o],["$m",c],["$H",a],["$W",s],["$M",u],["$y",p],["$D",g]].forEach(function(O){z[O[1]]=function(y){return this.$g(y,O[0],O[1])}}),M.extend=function(O,y){return O.$i||(O(y,B,M),O.$i=!0),M},M.locale=P,M.isDayjs=C,M.unix=function(O){return M(1e3*O)},M.en=R[D],M.Ls=R,M.p={},M})})(Ii);var ea=Ii.exports;const Te=Hi(ea);function ta(e){let t,n,r,i,l,o=e[0].fields.title+"",c,a,s,f,u,d,p;return{c(){t=k("div"),n=k("input"),r=q(),i=k("a"),l=k("div"),c=te(o),a=q(),s=k("div"),s.textContent=`${e[2]}`,f=q(),u=k("div"),u.textContent=`${e[3]}`,m(n,"type","checkbox"),m(n,"name","entry-select"),m(l,"class","entry-name svelte-fj87yn"),m(s,"class","entry-status svelte-fj87yn"),m(u,"class","entry-date svelte-fj87yn"),m(i,"href","#/editor"),m(i,"class","entry-info svelte-fj87yn"),m(t,"class","item svelte-fj87yn")},m(g,h){N(g,t,h),w(t,n),w(t,r),w(t,i),w(i,l),w(l,c),w(i,a),w(i,s),w(i,f),w(i,u),d||(p=[Z(n,"change",e[4]),Z(i,"click",e[5])],d=!0)},p(g,[h]){h&1&&o!==(o=g[0].fields.title+"")&&_e(c,o)},i:b,o:b,d(g){g&&H(t),d=!1,ue(p)}}}function na(e,t,n){let r,i,l;W(e,Fe,d=>n(6,r=d)),W(e,we,d=>n(7,i=d));const o=Sn("selectedEntries");W(e,o,d=>n(8,l=d));let{entry:c}=t,a=c.fields.draft?"draft":"published",s=Te(c.fields.date).format("MM/DD/YY");function f(d){d.target.checked?he(o,l=[...l,c],l):he(o,l=l.filter(p=>p!==c),l)}function u(d){he(we,i={},i),he(Fe,r=c,r)}return e.$$set=d=>{"entry"in d&&n(0,c=d.entry)},[c,o,a,s,f,u]}class ra extends ae{constructor(t){super(),ce(this,t,na,ta,ie,{entry:0})}}function ar(e){let t,n;return{c(){t=k("div"),n=te(e[0])},m(r,i){N(r,t,i),w(t,n)},p(r,i){i&1&&_e(n,r[0])},d(r){r&&H(t)}}}function ia(e){let t,n,r,i=e[0]&&ar(e);return{c(){t=k("div"),n=k("div"),r=q(),i&&i.c(),m(n,"aria-busy","true"),m(t,"class","toast")},m(l,o){N(l,t,o),w(t,n),w(t,r),i&&i.m(t,null)},p(l,[o]){l[0]?i?i.p(l,o):(i=ar(l),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:b,o:b,d(l){l&&H(t),i&&i.d()}}}function la(e,t,n){let{msg:r=null}=t;return e.$$set=i=>{"msg"in i&&n(0,r=i.msg)},[r]}class Qt extends ae{constructor(t){super(),ce(this,t,la,ia,ie,{msg:0})}}const oa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>alert</title><path d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z" /></svg>';function ca(e){let t,n,r,i,l,o,c,a;return{c(){t=k("div"),n=new ze(!1),r=q(),i=k("details"),l=k("summary"),o=te(e[0]),c=q(),a=te(e[1]),n.a=r,m(i,"class","svelte-1pbztc4"),m(t,"class","toast warning")},m(s,f){N(s,t,f),n.m(oa,t),w(t,r),w(t,i),w(i,l),w(l,o),w(i,c),w(i,a)},p(s,[f]){f&1&&_e(o,s[0]),f&2&&_e(a,s[1])},i:b,o:b,d(s){s&&H(t)}}}function aa(e,t,n){let{msg:r}=t,{details:i}=t;return e.$$set=l=>{"msg"in l&&n(0,r=l.msg),"details"in l&&n(1,i=l.details)},[r,i]}class Ke extends ae{constructor(t){super(),ce(this,t,aa,ca,ie,{msg:0,details:1})}}const Ni='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>trash-can-outline</title><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>',Ri='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>pencil</title><path d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" /></svg>';function sr(e,t,n){const r=e.slice();return r[14]=t[n],r}function sa(e){let t,n=[],r=new Map,i,l=Ee(e[3]);const o=c=>c[14].name;for(let c=0;c<l.length;c+=1){let a=sr(e,l,c),s=o(a);r.set(s,n[c]=ur(s,a))}return{c(){t=k("div");for(let c=0;c<n.length;c+=1)n[c].c();m(t,"id","items"),m(t,"class","svelte-14m9h86")},m(c,a){N(c,t,a);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(c,a){a&8&&(l=Ee(c[3]),ye(),n=Ft(n,a,o,1,c,l,r,t,Ln,ur,null,sr),ke())},i(c){if(!i){for(let a=0;a<l.length;a+=1)I(n[a]);i=!0}},o(c){for(let a=0;a<n.length;a+=1)V(n[a]);i=!1},d(c){c&&H(t);for(let a=0;a<n.length;a+=1)n[a].d()}}}function ua(e){let t,n,r,i,l,o,c,a;return{c(){t=k("div"),n=k("p"),n.textContent="This collection has no entries.",r=q(),i=k("button"),l=new ze(!1),o=te("Create New Entry"),l.a=o,m(i,"class","svelte-14m9h86"),m(t,"id","empty"),m(t,"class","svelte-14m9h86")},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),l.m(Ri,i),w(i,o),c||(a=Z(i,"click",e[6]),c=!0)},p:b,i:b,o:b,d(s){s&&H(t),c=!1,a()}}}function ur(e,t){let n,r,i;return r=new ra({props:{entry:t[14]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(l,o){N(l,n,o),K(r,l,o),i=!0},p(l,o){t=l;const c={};o&8&&(c.entry=t[14]),r.$set(c)},i(l){i||(I(r.$$.fragment,l),i=!0)},o(l){V(r.$$.fragment,l),i=!1},d(l){l&&H(n),X(r,l)}}}function fa(e){let t,n;return t=new Ke({props:{msg:"Error getting entries",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&2&&(l.details=r[13].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function da(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function pa(e){let t,n;return t=new Qt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ha(e){let t,n;return t=new Ke({props:{msg:"'On delete' event action failed",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[13].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ma(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ga(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function _a(e){var O;let t,n,r=(((O=e[0])==null?void 0:O.label)||"")+"",i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T,j,D,R,F,C;const P=[ua,sa],M=[];function S(y,_){return y[3].length===0?0:1}v=S(e),A=M[v]=P[v](e);let B={ctx:e,current:null,token:null,hasCatch:!0,pending:pa,then:da,catch:fa,error:13,blocks:[,,,]};se(T=e[1],B);let z={ctx:e,current:null,token:null,hasCatch:!0,pending:ga,then:ma,catch:ha,error:13,blocks:[,,,]};return se(D=e[2],z),{c(){t=k("main"),n=k("header"),i=te(r),l=q(),o=k("div"),c=k("button"),a=new ze(!1),s=te("Delete"),u=q(),d=k("button"),p=new ze(!1),g=te("New"),h=q(),A.c(),E=q(),B.block.c(),j=q(),z.block.c(),a.a=s,m(c,"class","outline svelte-14m9h86"),c.disabled=f=e[4].length===0,p.a=g,m(d,"class","svelte-14m9h86"),m(o,"id","listActions"),m(o,"class","svelte-14m9h86"),m(n,"class","svelte-14m9h86"),m(t,"class","svelte-14m9h86")},m(y,_){N(y,t,_),w(t,n),w(n,i),w(n,l),w(n,o),w(o,c),a.m(Ni,c),w(c,s),w(o,u),w(o,d),p.m(Ri,d),w(d,g),w(t,h),M[v].m(t,null),w(t,E),B.block.m(t,B.anchor=null),B.mount=()=>t,B.anchor=j,w(t,j),z.block.m(t,z.anchor=null),z.mount=()=>t,z.anchor=null,R=!0,F||(C=[Z(c,"click",e[7]),Z(d,"click",e[6])],F=!0)},p(y,[_]){var L;e=y,(!R||_&1)&&r!==(r=(((L=e[0])==null?void 0:L.label)||"")+"")&&_e(i,r),(!R||_&16&&f!==(f=e[4].length===0))&&(c.disabled=f);let x=v;v=S(e),v===x?M[v].p(e,_):(ye(),V(M[x],1,1,()=>{M[x]=null}),ke(),A=M[v],A?A.p(e,_):(A=M[v]=P[v](e),A.c()),I(A,1),A.m(t,E)),B.ctx=e,_&2&&T!==(T=e[1])&&se(T,B)||Pe(B,e,_),z.ctx=e,_&4&&D!==(D=e[2])&&se(D,z)||Pe(z,e,_)},i(y){R||(I(A),I(B.block),I(z.block),R=!0)},o(y){V(A);for(let _=0;_<3;_+=1){const x=B.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=z.blocks[_];V(x)}R=!1},d(y){y&&H(t),M[v].d(),B.block.d(),B.token=null,B=null,z.block.d(),z.token=null,z=null,F=!1,ue(C)}}}function wa(e,t,n){let r,i,l,o,c,a;W(e,In,v=>n(9,i=v)),W(e,Ve,v=>n(8,l=v)),W(e,we,v=>n(10,o=v)),W(e,Fe,v=>n(11,c=v)),W(e,$e,v=>n(0,a=v));const s=tt([]);W(e,s,v=>n(4,r=v)),Cn("selectedEntries",s);let f,u,d=[];async function p(v){try{n(1,f=l==null?void 0:l.getFiles(a==null?void 0:a.name)),n(3,d=await f||[])}catch{}}function g(){he(Fe,c=null,c),he(we,o={},o),window.location.hash="#/editor"}async function h(){try{await l.deleteFiles(r),i!=null&&i.onDelete&&(n(2,u=i.onDelete(r)),await u),he(s,r=[],r),p()}catch(v){console.error("Error deleting files",v)}}return e.$$.update=()=>{e.$$.dirty&257&&p()},[a,f,u,d,r,s,g,h,l]}class ba extends ae{constructor(t){super(),ce(this,t,wa,_a,ie,{})}}function va(e){let t,n,r,i,l,o,c,a,s=e[0].name+"",f,u,d;return{c(){t=k("div"),n=k("input"),r=q(),i=k("img"),c=q(),a=k("small"),f=te(s),m(n,"type","checkbox"),m(n,"name","media-select"),m(n,"class","svelte-9g6man"),$t(i.src,l=e[0].url_preview)||m(i,"src",l),m(i,"alt",o=e[0].alt),m(i,"loading","lazy"),m(i,"class","svelte-9g6man"),m(a,"class","svelte-9g6man"),m(t,"class","svelte-9g6man")},m(p,g){N(p,t,g),w(t,n),w(t,r),w(t,i),w(t,c),w(t,a),w(a,f),u||(d=Z(n,"change",e[2]),u=!0)},p(p,[g]){g&1&&!$t(i.src,l=p[0].url_preview)&&m(i,"src",l),g&1&&o!==(o=p[0].alt)&&m(i,"alt",o),g&1&&s!==(s=p[0].name+"")&&_e(f,s)},i:b,o:b,d(p){p&&H(t),u=!1,d()}}}function ya(e,t,n){let r;const i=Sn("selectedMediaFiles");W(e,i,c=>n(3,r=c));let{media:l}=t;function o(c){c.target.checked?he(i,r=[...r,l],r):he(i,r=r.filter(a=>a!==l),r)}return e.$$set=c=>{"media"in c&&n(0,l=c.media)},[l,i,o]}class ka extends ae{constructor(t){super(),ce(this,t,ya,va,ie,{media:0})}}const Pi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>file-upload</title><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z" /></svg>';function fr(e,t,n){const r=e.slice();return r[9]=t[n],r}function Aa(e){let t,n=[],r=new Map,i,l=Ee(e[1]);const o=c=>c[9].name;for(let c=0;c<l.length;c+=1){let a=fr(e,l,c),s=o(a);r.set(s,n[c]=dr(s,a))}return{c(){t=k("div");for(let c=0;c<n.length;c+=1)n[c].c();m(t,"id","items"),m(t,"class","svelte-12p8acg")},m(c,a){N(c,t,a);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(c,a){a&2&&(l=Ee(c[1]),ye(),n=Ft(n,a,o,1,c,l,r,t,Ln,dr,null,fr),ke())},i(c){if(!i){for(let a=0;a<l.length;a+=1)I(n[a]);i=!0}},o(c){for(let a=0;a<n.length;a+=1)V(n[a]);i=!1},d(c){c&&H(t);for(let a=0;a<n.length;a+=1)n[a].d()}}}function Ea(e){let t,n,r,i,l,o,c,a;return{c(){t=k("div"),n=k("p"),n.textContent="No files found.",r=q(),i=k("button"),l=new ze(!1),o=te("Upload a File"),l.a=o,m(i,"class","svelte-12p8acg"),m(t,"id","empty"),m(t,"class","svelte-12p8acg")},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),l.m(Pi,i),w(i,o),c||(a=Z(i,"click",e[4]),c=!0)},p:b,i:b,o:b,d(s){s&&H(t),c=!1,a()}}}function dr(e,t){let n,r,i;return r=new ka({props:{media:t[9]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(l,o){N(l,n,o),K(r,l,o),i=!0},p(l,o){t=l;const c={};o&2&&(c.media=t[9]),r.$set(c)},i(l){i||(I(r.$$.fragment,l),i=!0)},o(l){V(r.$$.fragment,l),i=!1},d(l){l&&H(n),X(r,l)}}}function Ca(e){let t,n;return t=new Ke({props:{msg:"Error getting entries",details:e[8].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[8].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Sa(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function xa(e){let t,n;return t=new Qt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function La(e){let t,n,r,i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T,j;const D=[Ea,Aa],R=[];function F(P,M){return P[1].length===0?0:1}g=F(e),h=R[g]=D[g](e);let C={ctx:e,current:null,token:null,hasCatch:!0,pending:xa,then:Sa,catch:Ca,error:8,blocks:[,,,]};return se(A=e[0],C),{c(){t=k("main"),n=k("header"),r=te(`Media Files
33
- `),i=k("div"),l=k("button"),o=new ze(!1),c=te("Delete"),s=q(),f=k("button"),u=new ze(!1),d=te("Upload"),p=q(),h.c(),v=q(),C.block.c(),o.a=c,m(l,"class","outline svelte-12p8acg"),l.disabled=a=e[2].length===0,u.a=d,m(f,"class","svelte-12p8acg"),m(i,"id","listActions"),m(i,"class","svelte-12p8acg"),m(n,"class","svelte-12p8acg"),m(t,"class","svelte-12p8acg")},m(P,M){N(P,t,M),w(t,n),w(n,r),w(n,i),w(i,l),o.m(Ni,l),w(l,c),w(i,s),w(i,f),u.m(Pi,f),w(f,d),w(t,p),R[g].m(t,null),w(t,v),C.block.m(t,C.anchor=null),C.mount=()=>t,C.anchor=null,E=!0,T||(j=[Z(l,"click",e[5]),Z(f,"click",e[4])],T=!0)},p(P,[M]){e=P,(!E||M&4&&a!==(a=e[2].length===0))&&(l.disabled=a);let S=g;g=F(e),g===S?R[g].p(e,M):(ye(),V(R[S],1,1,()=>{R[S]=null}),ke(),h=R[g],h?h.p(e,M):(h=R[g]=D[g](e),h.c()),I(h,1),h.m(t,v)),C.ctx=e,M&1&&A!==(A=e[0])&&se(A,C)||Pe(C,e,M)},i(P){E||(I(h),I(C.block),E=!0)},o(P){V(h);for(let M=0;M<3;M+=1){const S=C.blocks[M];V(S)}E=!1},d(P){P&&H(t),R[g].d(),C.block.d(),C.token=null,C=null,T=!1,ue(j)}}}function Ta(e,t,n){let r,i;W(e,Ve,u=>n(6,i=u));const l=tt([]);W(e,l,u=>n(2,r=u)),Cn("selectedMediaFiles",l);let o,c=[];async function a(u){try{n(0,o=i==null?void 0:i.getMediaFiles()),n(1,c=await o||[])}catch{}}async function s(){await i.uploadMediaFile(),a()}async function f(){try{await i.deleteFiles(r),he(l,r=[],r),a()}catch(u){console.error("Error deleting files",u)}}return e.$$.update=()=>{e.$$.dirty&64&&a()},[o,c,r,l,s,f,i]}class Ma extends ae{constructor(t){super(),ce(this,t,Ta,La,ie,{})}}function pr(e,t,n){const r=e.slice();return r[5]=t[n],r}function Oa(e){let t,n;return t=new Ma({}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Da(e){let t,n,r,i,l,o=e[0]&&hr(e);return i=new ba({}),{c(){t=k("aside"),n=k("ul"),o&&o.c(),r=q(),J(i.$$.fragment),m(n,"class","svelte-17x5uzj"),m(t,"class","svelte-17x5uzj")},m(c,a){N(c,t,a),w(t,n),o&&o.m(n,null),N(c,r,a),K(i,c,a),l=!0},p(c,a){c[0]?o?(o.p(c,a),a&1&&I(o,1)):(o=hr(c),o.c(),I(o,1),o.m(n,null)):o&&(ye(),V(o,1,1,()=>{o=null}),ke())},i(c){l||(I(o),I(i.$$.fragment,c),l=!0)},o(c){V(o),V(i.$$.fragment,c),l=!1},d(c){c&&(H(t),H(r)),o&&o.d(),X(i,c)}}}function hr(e){let t,n,r=Ee(e[0]),i=[];for(let o=0;o<r.length;o+=1)i[o]=mr(pr(e,r,o));const l=o=>V(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();t=Oe()},m(o,c){for(let a=0;a<i.length;a+=1)i[a]&&i[a].m(o,c);N(o,t,c),n=!0},p(o,c){if(c&1){r=Ee(o[0]);let a;for(a=0;a<r.length;a+=1){const s=pr(o,r,a);i[a]?(i[a].p(s,c),I(i[a],1)):(i[a]=mr(s),i[a].c(),I(i[a],1),i[a].m(t.parentNode,t))}for(ye(),a=r.length;a<i.length;a+=1)l(a);ke()}},i(o){if(!n){for(let c=0;c<r.length;c+=1)I(i[c]);n=!0}},o(o){i=i.filter(Boolean);for(let c=0;c<i.length;c+=1)V(i[c]);n=!1},d(o){o&&H(t),sn(i,o)}}}function mr(e){let t,n;const r=[e[5]];let i={};for(let l=0;l<r.length;l+=1)i=ot(i,r[l]);return t=new Jc({props:i}),{c(){J(t.$$.fragment)},m(l,o){K(t,l,o),n=!0},p(l,o){const c=o&1?at(r,[st(l[5])]):{};t.$set(c)},i(l){n||(I(t.$$.fragment,l),n=!0)},o(l){V(t.$$.fragment,l),n=!1},d(l){X(t,l)}}}function Fa(e){let t,n,r,i,l,o;t=new Zc({}),t.$on("selectview",e[2]);const c=[Da,Oa],a=[];function s(f,u){return f[1]==="posts"?0:f[1]==="media"?1:-1}return~(i=s(e))&&(l=a[i]=c[i](e)),{c(){J(t.$$.fragment),n=q(),r=k("div"),l&&l.c(),m(r,"id","dash"),m(r,"class","page svelte-17x5uzj")},m(f,u){K(t,f,u),N(f,n,u),N(f,r,u),~i&&a[i].m(r,null),o=!0},p(f,[u]){let d=i;i=s(f),i===d?~i&&a[i].p(f,u):(l&&(ye(),V(a[d],1,1,()=>{a[d]=null}),ke()),~i?(l=a[i],l?l.p(f,u):(l=a[i]=c[i](f),l.c()),I(l,1),l.m(r,null)):l=null)},i(f){o||(I(t.$$.fragment,f),I(l),o=!0)},o(f){V(t.$$.fragment,f),V(l),o=!1},d(f){f&&(H(n),H(r)),X(t,f),~i&&a[i].d()}}}function Ha(e,t,n){let r,i,l;W(e,$e,a=>n(3,i=a)),W(e,Ce,a=>n(4,l=a));let o="posts";function c(a){n(1,o=a.detail)}return e.$$.update=()=>{e.$$.dirty&16&&n(0,r=l==null?void 0:l.collections),e.$$.dirty&9&&(i||he($e,i=r==null?void 0:r[0],i))},[r,o,c,i,l]}class Ia extends ae{constructor(t){super(),ce(this,t,Ha,Fa,ie,{})}}const Na='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>arrow-left</title><path d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" /></svg>',Nn=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.window.document._=0}catch{return!1}return"showOpenFilePicker"in self})(),Ra=Nn?Promise.resolve().then(function(){return Ya}):Promise.resolve().then(function(){return Za});async function Rn(...e){return(await Ra).default(...e)}const Pa=Nn?Promise.resolve().then(function(){return Ba}):Promise.resolve().then(function(){return Xa});async function $a(...e){return(await Pa).default(...e)}const ja=Nn?Promise.resolve().then(function(){return Wa}):Promise.resolve().then(function(){return Ja});async function _n(...e){return(await ja).default(...e)}const Va=async e=>{const t=await e.getFile();return t.handle=e,t};var qa=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((i,l)=>{t[l]={description:i.description||"Files",accept:{}},i.mimeTypes?i.mimeTypes.map(o=>{t[l].accept[o]=i.extensions||[]}):t[l].accept["*/*"]=i.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Va));return e[0].multiple?r:r[0]},Ya={__proto__:null,default:qa};function Rt(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return Rt=function(n){this.s=n,this.n=n.next},Rt.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var r=this.s.return;return r===void 0?Promise.resolve({value:n,done:!0}):t(r.apply(this.s,arguments))},throw:function(n){var r=this.s.return;return r===void 0?Promise.reject(n):t(r.apply(this.s,arguments))}},new Rt(e)}const $i=async(e,t,n=e.name,r)=>{const i=[],l=[];var o,c=!1,a=!1;try{for(var s,f=function(u){var d,p,g,h=2;for(typeof Symbol<"u"&&(p=Symbol.asyncIterator,g=Symbol.iterator);h--;){if(p&&(d=u[p])!=null)return d.call(u);if(g&&(d=u[g])!=null)return new Rt(d.call(u));p="@@asyncIterator",g="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());c=!(s=await f.next()).done;c=!1){const u=s.value,d=`${n}/${u.name}`;u.kind==="file"?l.push(u.getFile().then(p=>(p.directoryHandle=e,p.handle=u,Object.defineProperty(p,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>d})))):u.kind!=="directory"||!t||r&&r(u)||i.push($i(u,t,d,r))}}catch(u){a=!0,o=u}finally{try{c&&f.return!=null&&await f.return()}finally{if(a)throw o}}return[...(await Promise.all(i)).flat(),...await Promise.all(l)]};var Ua=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:$i(t,e.recursive,void 0,e.skipDirectory)},Ba={__proto__:null,default:Ua},Ga=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const l=[];let o=null;if(e instanceof Blob&&e.type?o=e.type:e.headers&&e.headers.get("content-type")&&(o=e.headers.get("content-type")),t.forEach((s,f)=>{l[f]={description:s.description||"Files",accept:{}},s.mimeTypes?(f===0&&o&&s.mimeTypes.push(o),s.mimeTypes.map(u=>{l[f].accept[u]=s.extensions||[]})):o?l[f].accept[o]=s.extensions||[]:l[f].accept["*/*"]=s.extensions||[]}),n)try{await n.getFile()}catch(s){if(n=null,r)throw s}const c=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:l,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(c);const a=await c.createWritable();return"stream"in e?(await e.stream().pipeTo(a),c):"body"in e?(await e.body.pipeTo(a),c):(await a.write(await e),await a.close(),c)},Wa={__proto__:null,default:Ga},za=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const r=document.createElement("input");r.type="file";const i=[...e.map(a=>a.mimeTypes||[]),...e.map(a=>a.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||"",r.style.display="none",document.body.append(r);const l=a=>{typeof o=="function"&&o(),t(a)},o=e[0].legacySetup&&e[0].legacySetup(l,()=>o(n),r),c=()=>{window.removeEventListener("focus",c),r.remove()};r.addEventListener("click",()=>{window.addEventListener("focus",c)}),r.addEventListener("change",()=>{window.removeEventListener("focus",c),r.remove(),l(r.multiple?Array.from(r.files):r.files[0])}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Za={__proto__:null,default:za},Ka=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0;const i=o=>{typeof l=="function"&&l(),t(o)},l=e[0].legacySetup&&e[0].legacySetup(i,()=>l(n),r);r.addEventListener("change",()=>{let o=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(o=o.filter(c=>c.webkitRelativePath.split("/").every(a=>!e[0].skipDirectory({name:a,kind:"directory"})))):o=o.filter(c=>c.webkitRelativePath.split("/").length===2),i(o)}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Xa={__proto__:null,default:Ka},Qa=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let r=e;"body"in e&&(r=await async function(o,c){const a=o.getReader(),s=new ReadableStream({start:d=>async function p(){return a.read().then(({done:g,value:h})=>{if(!g)return d.enqueue(h),p();d.close()})}()}),f=new Response(s),u=await f.blob();return a.releaseLock(),new Blob([u],{type:c})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await r);const i=()=>{typeof l=="function"&&l()},l=t.legacySetup&&t.legacySetup(i,()=>l(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},Ja={__proto__:null,default:Qa},ji={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Fi,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d\d/,l=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,c={},a=function(h){return(h=+h)+(h>68?1900:2e3)},s=function(h){return function(v){this[h]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(h){(this.zone||(this.zone={})).offset=function(v){if(!v||v==="Z")return 0;var A=v.match(/([+-]|\d\d)/g),E=60*A[1]+(+A[2]||0);return E===0?0:A[0]==="+"?-E:E}(h)}],u=function(h){var v=c[h];return v&&(v.indexOf?v:v.s.concat(v.f))},d=function(h,v){var A,E=c.meridiem;if(E){for(var T=1;T<=24;T+=1)if(h.indexOf(E(T,0,v))>-1){A=T>12;break}}else A=h===(v?"pm":"PM");return A},p={A:[o,function(h){this.afternoon=d(h,!1)}],a:[o,function(h){this.afternoon=d(h,!0)}],S:[/\d/,function(h){this.milliseconds=100*+h}],SS:[i,function(h){this.milliseconds=10*+h}],SSS:[/\d{3}/,function(h){this.milliseconds=+h}],s:[l,s("seconds")],ss:[l,s("seconds")],m:[l,s("minutes")],mm:[l,s("minutes")],H:[l,s("hours")],h:[l,s("hours")],HH:[l,s("hours")],hh:[l,s("hours")],D:[l,s("day")],DD:[i,s("day")],Do:[o,function(h){var v=c.ordinal,A=h.match(/\d+/);if(this.day=A[0],v)for(var E=1;E<=31;E+=1)v(E).replace(/\[|\]/g,"")===h&&(this.day=E)}],M:[l,s("month")],MM:[i,s("month")],MMM:[o,function(h){var v=u("months"),A=(u("monthsShort")||v.map(function(E){return E.slice(0,3)})).indexOf(h)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[o,function(h){var v=u("months").indexOf(h)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,s("year")],YY:[i,function(h){this.year=a(h)}],YYYY:[/\d{4}/,s("year")],Z:f,ZZ:f};function g(h){var v,A;v=h,A=c&&c.formats;for(var E=(h=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(P,M,S){var B=S&&S.toUpperCase();return M||A[S]||n[S]||A[B].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(z,O,y){return O||y.slice(1)})})).match(r),T=E.length,j=0;j<T;j+=1){var D=E[j],R=p[D],F=R&&R[0],C=R&&R[1];E[j]=C?{regex:F,parser:C}:D.replace(/^\[|\]$/g,"")}return function(P){for(var M={},S=0,B=0;S<T;S+=1){var z=E[S];if(typeof z=="string")B+=z.length;else{var O=z.regex,y=z.parser,_=P.slice(B),x=O.exec(_)[0];y.call(M,x),P=P.replace(x,"")}}return function(L){var $=L.afternoon;if($!==void 0){var G=L.hours;$?G<12&&(L.hours+=12):G===12&&(L.hours=0),delete L.afternoon}}(M),M}}return function(h,v,A){A.p.customParseFormat=!0,h&&h.parseTwoDigitYear&&(a=h.parseTwoDigitYear);var E=v.prototype,T=E.parse;E.parse=function(j){var D=j.date,R=j.utc,F=j.args;this.$u=R;var C=F[1];if(typeof C=="string"){var P=F[2]===!0,M=F[3]===!0,S=P||M,B=F[2];M&&(B=F[2]),c=this.$locale(),!P&&B&&(c=A.Ls[B]),this.$d=function(_,x,L){try{if(["x","X"].indexOf(x)>-1)return new Date((x==="X"?1e3:1)*_);var $=g(x)(_),G=$.year,Q=$.month,ne=$.day,le=$.hours,fe=$.minutes,Ae=$.seconds,qe=$.milliseconds,He=$.zone,Ne=new Date,De=ne||(G||Q?1:Ne.getDate()),de=G||Ne.getFullYear(),xe=0;G&&!Q||(xe=Q>0?Q-1:Ne.getMonth());var Re=le||0,Ye=fe||0,U=Ae||0,ee=qe||0;return He?new Date(Date.UTC(de,xe,De,Re,Ye,U,ee+60*He.offset*1e3)):L?new Date(Date.UTC(de,xe,De,Re,Ye,U,ee)):new Date(de,xe,De,Re,Ye,U,ee)}catch{return new Date("")}}(D,C,R),this.init(),B&&B!==!0&&(this.$L=this.locale(B).$L),S&&D!=this.format(C)&&(this.$d=new Date("")),c={}}else if(C instanceof Array)for(var z=C.length,O=1;O<=z;O+=1){F[1]=C[O-1];var y=A.apply(this,F);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}O===z&&(this.$d=new Date(""))}else T.call(this,j)}}})})(ji);var es=ji.exports;const Vi=Hi(es);Te.extend(Vi);const Pn="../../cms-config/",gr=`Unable to parse markdown entry. Backend must implement 'replacePreviewLinks()'
34
- and return a valid string.`;function Gt(e,t){let n=Te(t),r="";switch(e){case"datetime-local":r=n.format("YYYY-MM-DDTHH:mm");break;case"date":r=n.format("YYYY-MM-DD");break;case"time":r=n.format("HH:mm");break}return r}function ts(e,t){var i;const n=(i=e==null?void 0:e.previews.styles.find(l=>l.name===t))==null?void 0:i.files;if(!n)return;const r=[];return n.forEach(l=>{const o=`${Pn}${l}`;r.push(new URL(o,window.location.href).href)}),r.map(l=>`<link rel="stylesheet" href="${l}">`).join(`
35
- `)}async function ns(e,t){var i;const n=(i=e==null?void 0:e.previews.templates.find(l=>l.name===t))==null?void 0:i.template;if(!n)return;const r=new URL(`${Pn}${n}`,window.location.href).href;try{const l=await fetch(r);if(!l.ok)throw new Error(`Unable to fetch file ${r}`);return await l.text()}catch(l){console.error(l);return}}function rs(e,t){return e==null?void 0:e.replace("{{styles}}",t).replaceAll("{{",'<span data-tag="').replaceAll("}}",'"></span>')}async function qi(e,t,n){let r;switch(e.widget){case"markdown":if(!(n!=null&&n.replacePreviewLinks))throw new Error(gr);if(r=await(n==null?void 0:n.replacePreviewLinks(t)),r==null)throw new Error(gr);break;case"datetime":let i;switch(e.type){case"time":i=Te(t.toString(),"hh:mm").toISOString();break;case"date":i=Te(t.toString(),"YYYY-MM-DD").toISOString();break;default:i=Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString();break}r=new Date(i);break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;case"hidden":switch(e.type){case"datetime-local":r=new Date(Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString());break;case"time":r=new Date(Te(t.toString(),"hh:mm").toISOString());break;case"date":r=new Date(Te(t.toString(),"YYYY-MM-DD").toISOString());break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;default:r=t;break}break;default:r=t;break}return r}function is(e,t){const{slug:n,extension:r}=e,{title:i,date:l}=t,o=i.toLowerCase().replaceAll(/\W+/g,"-"),c=Te(l);return`${n.replaceAll("{{slug}}",o).replaceAll("{{year}}",c.format("YYYY")).replaceAll("{{month}}",c.format("MM")).replaceAll("{{day}}",c.format("DD")).replaceAll("{{hour}}",c.format("HH")).replaceAll("{{minute}}",c.format("mm")).replaceAll("{{second}}",c.format("ss"))}.${r}`}function ls(e,t){const n={...t},{date:r,body:i}={...n.fields};delete n.fields.body;const l=Xt.dump(n.fields,{quotingType:'"',forceQuotes:!0});return n.date=r,n.body=i,n.collection=e.name,n.name||(n.name=is(e,n.fields)),n.raw=`---
31
+ `+e.slice(o+1):a+=e.slice(i),a.slice(1)}function Ec(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=xt(e,i),r=Se[n],!r&&Ft(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||mc(n);return t}function Cc(e,t,n){var r="",i=e.tag,l,o,c;for(l=0,o=n.length;l<o;l+=1)c=n[l],e.replacer&&(c=e.replacer.call(n,String(l),c)),(Ze(e,t,c,!1,!1)||typeof c>"u"&&Ze(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function cr(e,t,n,r){var i="",l=e.tag,o,c,a;for(o=0,c=n.length;o<c;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(Ze(e,t+1,a,!0,!0,!1,!0)||typeof a>"u"&&Ze(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=mn(e,t)),e.dump&&Ot===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=l,e.dump=i||"[]"}function Sc(e,t,n){var r="",i=e.tag,l=Object.keys(n),o,c,a,s,f;for(o=0,c=l.length;o<c;o+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),a=l[o],s=n[a],e.replacer&&(s=e.replacer.call(n,a,s)),Ze(e,t,a,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ze(e,t,s,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function xc(e,t,n,r){var i="",l=e.tag,o=Object.keys(n),c,a,s,f,u,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Le("sortKeys must be a boolean or a function");for(c=0,a=o.length;c<a;c+=1)d="",(!r||i!=="")&&(d+=mn(e,t)),s=o[c],f=n[s],e.replacer&&(f=e.replacer.call(n,s,f)),Ze(e,t+1,s,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Ot===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=mn(e,t)),Ze(e,t+1,f,!0,u)&&(e.dump&&Ot===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=l,e.dump=i||"{}"}function ar(e,t,n){var r,i,l,o,c,a;for(i=n?e.explicitTypes:e.implicitTypes,l=0,o=i.length;l<o;l+=1)if(c=i[l],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(n?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(a=e.styleMap[c.tag]||c.defaultStyle,Ai.call(c.represent)==="[object Function]")r=c.represent(t,a);else if(Ei.call(c.represent,a))r=c.represent[a](t,a);else throw new Le("!<"+c.tag+'> tag resolver accepts not "'+a+'" style');e.dump=r}return!0}return!1}function Ze(e,t,n,r,i,l,o){e.tag=null,e.dump=n,ar(e,n,!1)||ar(e,n,!0);var c=Ai.call(e.dump),a=r,s;r&&(r=e.flowLevel<0||e.flowLevel>t);var f=c==="[object Object]"||c==="[object Array]",u,d;if(f&&(u=e.duplicates.indexOf(n),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),c==="[object Object]")r&&Object.keys(e.dump).length!==0?(xc(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Sc(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(c==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?cr(e,t-1,e.dump,i):cr(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Cc(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&kc(e,e.dump,t,l,a);else{if(c==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Le("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(s=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?s="!"+s:s.slice(0,18)==="tag:yaml.org,2002:"?s="!!"+s.slice(18):s="!<"+s+">",e.dump=s+" "+e.dump)}return!0}function Lc(e,t){var n=[],r=[],i,l;for(_n(e,n,r),i=0,l=r.length;i<l;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(l)}function _n(e,t,n){var r,i,l;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,l=e.length;i<l;i+=1)_n(e[i],t,n);else for(r=Object.keys(e),i=0,l=r.length;i<l;i+=1)_n(e[r[i]],t,n)}function Tc(e,t){t=t||{};var n=new _c(t);n.noRefs||Lc(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Ze(n,0,r,!0,!0)?n.dump+`
32
+ `:""}var Mc=Tc,Oc={dump:Mc};function In(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Dc=be,Fc=Zr,Hc=Jr,Ic=ii,Nc=li,Rc=On,Pc=ki.load,$c=ki.loadAll,jc=Oc.dump,Vc=Le,qc={binary:ui,float:ri,map:Qr,null:ei,pairs:di,set:pi,timestamp:ai,bool:ti,int:ni,merge:si,omap:fi,seq:Xr,str:Kr},Yc=In("safeLoad","load"),Uc=In("safeLoadAll","loadAll"),Bc=In("safeDump","dump"),Qt={Type:Dc,Schema:Fc,FAILSAFE_SCHEMA:Hc,JSON_SCHEMA:Ic,CORE_SCHEMA:Nc,DEFAULT_SCHEMA:Rc,load:Pc,loadAll:$c,dump:jc,YAMLException:Vc,types:qc,safeLoad:Yc,safeLoadAll:Uc,safeDump:Bc};const $e=tt(),Fe=tt(),we=tt({}),Ve=tt(),Ce=Gr(null,e=>(Gc().then(e).catch(t=>console.error("Failed to load config.",t)),()=>{})),Nn=Cl(Ce,(e,t)=>{const n=e==null?void 0:e.custom_actions;return n?(Wc(n).then(t).catch(r=>console.error("Failed to load cms actions.",r)),()=>{}):null});async function Gc(){const e=new URL("../../cms-config/config.yml",window.location.href).href,t=await fetch(e);if(!t.ok)throw new Error(`Unable to fetch file ${e}`);return Qt.load(await t.text())}async function Wc(e){const t=`../../cms-config/${e}`;return(await import(new URL(t,window.location.href).href)).default}function zc(e){let t,n,r,i,l,o,c,a,s,f,u,d,p;return{c(){t=k("nav"),n=k("ul"),r=k("li"),i=k("a"),l=q(),o=k("li"),c=k("a"),a=q(),s=k("ul"),f=k("li"),u=k("a"),m(i,"href","##posts"),m(i,"data-tooltip","Posts"),m(i,"data-placement","bottom"),m(c,"href","##media"),m(c,"data-tooltip","Media Files"),m(c,"data-placement","bottom"),m(u,"href","##exit"),m(u,"class","secondary"),m(u,"data-tooltip","Exit"),m(u,"data-placement","bottom")},m(g,h){N(g,t,h),w(t,n),w(n,r),w(r,i),i.innerHTML=kl,w(n,l),w(n,o),w(o,c),c.innerHTML=Al,w(t,a),w(t,s),w(s,f),w(f,u),u.innerHTML=El,d||(p=[Z(i,"click",Ue(e[0])),Z(c,"click",Ue(e[0])),Z(u,"click",Ue(e[1]))],d=!0)},p:b,i:b,o:b,d(g){g&&H(t),d=!1,ue(p)}}}function Zc(e,t,n){let r,i;W(e,Ve,a=>n(2,r=a)),W(e,Nn,a=>n(3,i=a));const l=Kt();function o(a){const s=new URL(a.currentTarget.href).hash.replaceAll("#","");l("selectview",s),a.currentTarget.blur()}async function c(){i!=null&&i.onLogout&&await i.onLogout(),r!=null&&r.logout?await r.logout():history.back()}return[o,c]}class Kc extends ae{constructor(t){super(),ce(this,t,Zc,zc,ie,{})}}const Xc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-edit</title><path d="M10 19.11L12.11 17H7V15H14V15.12L16.12 13H7V11H17V12.12L18.24 10.89C18.72 10.41 19.35 10.14 20.04 10.14C20.37 10.14 20.7 10.21 21 10.33V5C21 3.89 20.1 3 19 3H5C3.89 3 3 3.89 3 5V19C3 20.11 3.9 21 5 21H10V19.11M7 7H17V9H7V7M21.7 14.35L20.7 15.35L18.65 13.3L19.65 12.3C19.86 12.09 20.21 12.09 20.42 12.3L21.7 13.58C21.91 13.79 21.91 14.14 21.7 14.35M12 19.94L18.06 13.88L20.11 15.93L14.06 22H12V19.94Z" /></svg>';function Qc(e){let t,n,r,i,l,o;return{c(){t=k("li"),n=k("a"),r=new ze(!1),i=ee(e[0]),r.a=i,m(n,"href","##placeholder"),m(n,"class","collectionNav svelte-1r1578h"),Vt(n,"selected",e[1]),m(t,"class","svelte-1r1578h")},m(c,a){N(c,t,a),w(t,n),r.m(Xc,n),w(n,i),l||(o=Z(n,"click",Ue(e[2])),l=!0)},p(c,[a]){a&1&&_e(i,c[0]),a&2&&Vt(n,"selected",c[1])},i:b,o:b,d(c){c&&H(t),l=!1,o()}}}function Jc(e,t,n){let r,i,l;W(e,Ce,s=>n(5,i=s)),W(e,$e,s=>n(4,l=s));let{name:o}=t,{label:c}=t;function a(){he($e,l=i.collections.find(s=>s.name===o),l)}return e.$$set=s=>{"name"in s&&n(3,o=s.name),"label"in s&&n(0,c=s.label)},e.$$.update=()=>{e.$$.dirty&24&&n(1,r=(l==null?void 0:l.name)===o?"selected":"")},[c,r,a,o,l]}class ea extends ae{constructor(t){super(),ce(this,t,Jc,Qc,ie,{name:3,label:0})}}var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sd(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ni={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Hi,function(){var n=1e3,r=6e4,i=36e5,l="millisecond",o="second",c="minute",a="hour",s="day",f="week",u="month",d="quarter",p="year",g="date",h="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var y=["th","st","nd","rd"],_=O%100;return"["+O+(y[(_-20)%10]||y[_]||y[0])+"]"}},T=function(O,y,_){var x=String(O);return!x||x.length>=y?O:""+Array(y+1-x.length).join(_)+O},j={s:T,z:function(O){var y=-O.utcOffset(),_=Math.abs(y),x=Math.floor(_/60),L=_%60;return(y<=0?"+":"-")+T(x,2,"0")+":"+T(L,2,"0")},m:function O(y,_){if(y.date()<_.date())return-O(_,y);var x=12*(_.year()-y.year())+(_.month()-y.month()),L=y.clone().add(x,u),$=_-L<0,G=y.clone().add(x+($?-1:1),u);return+(-(x+(_-L)/($?L-G:G-L))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:u,y:p,w:f,d:s,D:g,h:a,m:c,s:o,ms:l,Q:d}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},D="en",R={};R[D]=E;var F="$isDayjsObject",C=function(O){return O instanceof B||!(!O||!O[F])},P=function O(y,_,x){var L;if(!y)return D;if(typeof y=="string"){var $=y.toLowerCase();R[$]&&(L=$),_&&(R[$]=_,L=$);var G=y.split("-");if(!L&&G.length>1)return O(G[0])}else{var Q=y.name;R[Q]=y,L=Q}return!x&&L&&(D=L),L||!x&&D},M=function(O,y){if(C(O))return O.clone();var _=typeof y=="object"?y:{};return _.date=O,_.args=arguments,new B(_)},S=j;S.l=P,S.i=C,S.w=function(O,y){return M(O,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var B=function(){function O(_){this.$L=P(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[F]=!0}var y=O.prototype;return y.parse=function(_){this.$d=function(x){var L=x.date,$=x.utc;if(L===null)return new Date(NaN);if(S.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var G=L.match(v);if(G){var Q=G[2]-1||0,ne=(G[7]||"0").substring(0,3);return $?new Date(Date.UTC(G[1],Q,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ne)):new Date(G[1],Q,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ne)}}return new Date(L)}(_),this.init()},y.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return this.$d.toString()!==h},y.isSame=function(_,x){var L=M(_);return this.startOf(x)<=L&&L<=this.endOf(x)},y.isAfter=function(_,x){return M(_)<this.startOf(x)},y.isBefore=function(_,x){return this.endOf(x)<M(_)},y.$g=function(_,x,L){return S.u(_)?this[x]:this.set(L,_)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(_,x){var L=this,$=!!S.u(x)||x,G=S.p(_),Q=function(De,de){var xe=S.w(L.$u?Date.UTC(L.$y,de,De):new Date(L.$y,de,De),L);return $?xe:xe.endOf(s)},ne=function(De,de){return S.w(L.toDate()[De].apply(L.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(de)),L)},le=this.$W,fe=this.$M,Ae=this.$D,qe="set"+(this.$u?"UTC":"");switch(G){case p:return $?Q(1,0):Q(31,11);case u:return $?Q(1,fe):Q(0,fe+1);case f:var He=this.$locale().weekStart||0,Ne=(le<He?le+7:le)-He;return Q($?Ae-Ne:Ae+(6-Ne),fe);case s:case g:return ne(qe+"Hours",0);case a:return ne(qe+"Minutes",1);case c:return ne(qe+"Seconds",2);case o:return ne(qe+"Milliseconds",3);default:return this.clone()}},y.endOf=function(_){return this.startOf(_,!1)},y.$set=function(_,x){var L,$=S.p(_),G="set"+(this.$u?"UTC":""),Q=(L={},L[s]=G+"Date",L[g]=G+"Date",L[u]=G+"Month",L[p]=G+"FullYear",L[a]=G+"Hours",L[c]=G+"Minutes",L[o]=G+"Seconds",L[l]=G+"Milliseconds",L)[$],ne=$===s?this.$D+(x-this.$W):x;if($===u||$===p){var le=this.clone().set(g,1);le.$d[Q](ne),le.init(),this.$d=le.set(g,Math.min(this.$D,le.daysInMonth())).$d}else Q&&this.$d[Q](ne);return this.init(),this},y.set=function(_,x){return this.clone().$set(_,x)},y.get=function(_){return this[S.p(_)]()},y.add=function(_,x){var L,$=this;_=Number(_);var G=S.p(x),Q=function(fe){var Ae=M($);return S.w(Ae.date(Ae.date()+Math.round(fe*_)),$)};if(G===u)return this.set(u,this.$M+_);if(G===p)return this.set(p,this.$y+_);if(G===s)return Q(1);if(G===f)return Q(7);var ne=(L={},L[c]=r,L[a]=i,L[o]=n,L)[G]||1,le=this.$d.getTime()+_*ne;return S.w(le,this)},y.subtract=function(_,x){return this.add(-1*_,x)},y.format=function(_){var x=this,L=this.$locale();if(!this.isValid())return L.invalidDate||h;var $=_||"YYYY-MM-DDTHH:mm:ssZ",G=S.z(this),Q=this.$H,ne=this.$m,le=this.$M,fe=L.weekdays,Ae=L.months,qe=L.meridiem,He=function(de,xe,Re,Ye){return de&&(de[xe]||de(x,$))||Re[xe].slice(0,Ye)},Ne=function(de){return S.s(Q%12||12,de,"0")},De=qe||function(de,xe,Re){var Ye=de<12?"AM":"PM";return Re?Ye.toLowerCase():Ye};return $.replace(A,function(de,xe){return xe||function(Re){switch(Re){case"YY":return String(x.$y).slice(-2);case"YYYY":return S.s(x.$y,4,"0");case"M":return le+1;case"MM":return S.s(le+1,2,"0");case"MMM":return He(L.monthsShort,le,Ae,3);case"MMMM":return He(Ae,le);case"D":return x.$D;case"DD":return S.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return He(L.weekdaysMin,x.$W,fe,2);case"ddd":return He(L.weekdaysShort,x.$W,fe,3);case"dddd":return fe[x.$W];case"H":return String(Q);case"HH":return S.s(Q,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return De(Q,ne,!0);case"A":return De(Q,ne,!1);case"m":return String(ne);case"mm":return S.s(ne,2,"0");case"s":return String(x.$s);case"ss":return S.s(x.$s,2,"0");case"SSS":return S.s(x.$ms,3,"0");case"Z":return G}return null}(de)||G.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(_,x,L){var $,G=this,Q=S.p(x),ne=M(_),le=(ne.utcOffset()-this.utcOffset())*r,fe=this-ne,Ae=function(){return S.m(G,ne)};switch(Q){case p:$=Ae()/12;break;case u:$=Ae();break;case d:$=Ae()/3;break;case f:$=(fe-le)/6048e5;break;case s:$=(fe-le)/864e5;break;case a:$=fe/i;break;case c:$=fe/r;break;case o:$=fe/n;break;default:$=fe}return L?$:S.a($)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return R[this.$L]},y.locale=function(_,x){if(!_)return this.$L;var L=this.clone(),$=P(_,x,!0);return $&&(L.$L=$),L},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},O}(),z=B.prototype;return M.prototype=z,[["$ms",l],["$s",o],["$m",c],["$H",a],["$W",s],["$M",u],["$y",p],["$D",g]].forEach(function(O){z[O[1]]=function(y){return this.$g(y,O[0],O[1])}}),M.extend=function(O,y){return O.$i||(O(y,B,M),O.$i=!0),M},M.locale=P,M.isDayjs=C,M.unix=function(O){return M(1e3*O)},M.en=R[D],M.Ls=R,M.p={},M})})(Ni);var ta=Ni.exports;const Te=Ii(ta);function na(e){let t,n,r,i,l,o=e[0].fields.title+"",c,a,s,f,u,d,p;return{c(){t=k("div"),n=k("input"),r=q(),i=k("a"),l=k("div"),c=ee(o),a=q(),s=k("div"),s.textContent=`${e[2]}`,f=q(),u=k("div"),u.textContent=`${e[3]}`,m(n,"type","checkbox"),m(n,"name","entry-select"),m(l,"class","entry-name svelte-fj87yn"),m(s,"class","entry-status svelte-fj87yn"),m(u,"class","entry-date svelte-fj87yn"),m(i,"href","#/editor"),m(i,"class","entry-info svelte-fj87yn"),m(t,"class","item svelte-fj87yn")},m(g,h){N(g,t,h),w(t,n),w(t,r),w(t,i),w(i,l),w(l,c),w(i,a),w(i,s),w(i,f),w(i,u),d||(p=[Z(n,"change",e[4]),Z(i,"click",e[5])],d=!0)},p(g,[h]){h&1&&o!==(o=g[0].fields.title+"")&&_e(c,o)},i:b,o:b,d(g){g&&H(t),d=!1,ue(p)}}}function ra(e,t,n){let r,i,l;W(e,Fe,d=>n(6,r=d)),W(e,we,d=>n(7,i=d));const o=xn("selectedEntries");W(e,o,d=>n(8,l=d));let{entry:c}=t,a=c.fields.draft?"draft":"published",s=Te(c.fields.date).format("MM/DD/YY");function f(d){d.target.checked?he(o,l=[...l,c],l):he(o,l=l.filter(p=>p!==c),l)}function u(d){he(we,i={},i),he(Fe,r=c,r)}return e.$$set=d=>{"entry"in d&&n(0,c=d.entry)},[c,o,a,s,f,u]}class ia extends ae{constructor(t){super(),ce(this,t,ra,na,ie,{entry:0})}}function sr(e){let t,n;return{c(){t=k("div"),n=ee(e[0])},m(r,i){N(r,t,i),w(t,n)},p(r,i){i&1&&_e(n,r[0])},d(r){r&&H(t)}}}function la(e){let t,n,r,i=e[0]&&sr(e);return{c(){t=k("div"),n=k("div"),r=q(),i&&i.c(),m(n,"aria-busy","true"),m(t,"class","toast")},m(l,o){N(l,t,o),w(t,n),w(t,r),i&&i.m(t,null)},p(l,[o]){l[0]?i?i.p(l,o):(i=sr(l),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:b,o:b,d(l){l&&H(t),i&&i.d()}}}function oa(e,t,n){let{msg:r=null}=t;return e.$$set=i=>{"msg"in i&&n(0,r=i.msg)},[r]}class Jt extends ae{constructor(t){super(),ce(this,t,oa,la,ie,{msg:0})}}const ca='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>alert</title><path d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z" /></svg>';function aa(e){let t,n,r,i,l,o,c,a;return{c(){t=k("div"),n=new ze(!1),r=q(),i=k("details"),l=k("summary"),o=ee(e[0]),c=q(),a=ee(e[1]),n.a=r,m(i,"class","svelte-1pbztc4"),m(t,"class","toast warning")},m(s,f){N(s,t,f),n.m(ca,t),w(t,r),w(t,i),w(i,l),w(l,o),w(i,c),w(i,a)},p(s,[f]){f&1&&_e(o,s[0]),f&2&&_e(a,s[1])},i:b,o:b,d(s){s&&H(t)}}}function sa(e,t,n){let{msg:r}=t,{details:i}=t;return e.$$set=l=>{"msg"in l&&n(0,r=l.msg),"details"in l&&n(1,i=l.details)},[r,i]}class Ke extends ae{constructor(t){super(),ce(this,t,sa,aa,ie,{msg:0,details:1})}}const Ri='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>trash-can-outline</title><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>',Pi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>pencil</title><path d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" /></svg>';function ur(e,t,n){const r=e.slice();return r[14]=t[n],r}function ua(e){let t,n=[],r=new Map,i,l=Ee(e[3]);const o=c=>c[14].name;for(let c=0;c<l.length;c+=1){let a=ur(e,l,c),s=o(a);r.set(s,n[c]=fr(s,a))}return{c(){t=k("div");for(let c=0;c<n.length;c+=1)n[c].c();m(t,"id","items"),m(t,"class","svelte-14m9h86")},m(c,a){N(c,t,a);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(c,a){a&8&&(l=Ee(c[3]),ye(),n=Ht(n,a,o,1,c,l,r,t,Tn,fr,null,ur),ke())},i(c){if(!i){for(let a=0;a<l.length;a+=1)I(n[a]);i=!0}},o(c){for(let a=0;a<n.length;a+=1)V(n[a]);i=!1},d(c){c&&H(t);for(let a=0;a<n.length;a+=1)n[a].d()}}}function fa(e){let t,n,r,i,l,o,c,a;return{c(){t=k("div"),n=k("p"),n.textContent="This collection has no entries.",r=q(),i=k("button"),l=new ze(!1),o=ee("Create New Entry"),l.a=o,m(i,"class","svelte-14m9h86"),m(t,"id","empty"),m(t,"class","svelte-14m9h86")},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),l.m(Pi,i),w(i,o),c||(a=Z(i,"click",e[6]),c=!0)},p:b,i:b,o:b,d(s){s&&H(t),c=!1,a()}}}function fr(e,t){let n,r,i;return r=new ia({props:{entry:t[14]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(l,o){N(l,n,o),K(r,l,o),i=!0},p(l,o){t=l;const c={};o&8&&(c.entry=t[14]),r.$set(c)},i(l){i||(I(r.$$.fragment,l),i=!0)},o(l){V(r.$$.fragment,l),i=!1},d(l){l&&H(n),X(r,l)}}}function da(e){let t,n;return t=new Ke({props:{msg:"Error getting entries",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&2&&(l.details=r[13].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function pa(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ha(e){let t,n;return t=new Jt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ma(e){let t,n;return t=new Ke({props:{msg:"'On delete' event action failed",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[13].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ga(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function _a(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function wa(e){var O;let t,n,r=(((O=e[0])==null?void 0:O.label)||"")+"",i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T,j,D,R,F,C;const P=[fa,ua],M=[];function S(y,_){return y[3].length===0?0:1}v=S(e),A=M[v]=P[v](e);let B={ctx:e,current:null,token:null,hasCatch:!0,pending:ha,then:pa,catch:da,error:13,blocks:[,,,]};se(T=e[1],B);let z={ctx:e,current:null,token:null,hasCatch:!0,pending:_a,then:ga,catch:ma,error:13,blocks:[,,,]};return se(D=e[2],z),{c(){t=k("main"),n=k("header"),i=ee(r),l=q(),o=k("div"),c=k("button"),a=new ze(!1),s=ee("Delete"),u=q(),d=k("button"),p=new ze(!1),g=ee("New"),h=q(),A.c(),E=q(),B.block.c(),j=q(),z.block.c(),a.a=s,m(c,"class","outline svelte-14m9h86"),c.disabled=f=e[4].length===0,p.a=g,m(d,"class","svelte-14m9h86"),m(o,"id","listActions"),m(o,"class","svelte-14m9h86"),m(n,"class","svelte-14m9h86"),m(t,"class","svelte-14m9h86")},m(y,_){N(y,t,_),w(t,n),w(n,i),w(n,l),w(n,o),w(o,c),a.m(Ri,c),w(c,s),w(o,u),w(o,d),p.m(Pi,d),w(d,g),w(t,h),M[v].m(t,null),w(t,E),B.block.m(t,B.anchor=null),B.mount=()=>t,B.anchor=j,w(t,j),z.block.m(t,z.anchor=null),z.mount=()=>t,z.anchor=null,R=!0,F||(C=[Z(c,"click",e[7]),Z(d,"click",e[6])],F=!0)},p(y,[_]){var L;e=y,(!R||_&1)&&r!==(r=(((L=e[0])==null?void 0:L.label)||"")+"")&&_e(i,r),(!R||_&16&&f!==(f=e[4].length===0))&&(c.disabled=f);let x=v;v=S(e),v===x?M[v].p(e,_):(ye(),V(M[x],1,1,()=>{M[x]=null}),ke(),A=M[v],A?A.p(e,_):(A=M[v]=P[v](e),A.c()),I(A,1),A.m(t,E)),B.ctx=e,_&2&&T!==(T=e[1])&&se(T,B)||Pe(B,e,_),z.ctx=e,_&4&&D!==(D=e[2])&&se(D,z)||Pe(z,e,_)},i(y){R||(I(A),I(B.block),I(z.block),R=!0)},o(y){V(A);for(let _=0;_<3;_+=1){const x=B.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=z.blocks[_];V(x)}R=!1},d(y){y&&H(t),M[v].d(),B.block.d(),B.token=null,B=null,z.block.d(),z.token=null,z=null,F=!1,ue(C)}}}function ba(e,t,n){let r,i,l,o,c,a;W(e,Nn,v=>n(9,i=v)),W(e,Ve,v=>n(8,l=v)),W(e,we,v=>n(10,o=v)),W(e,Fe,v=>n(11,c=v)),W(e,$e,v=>n(0,a=v));const s=tt([]);W(e,s,v=>n(4,r=v)),Sn("selectedEntries",s);let f,u,d=[];async function p(v){try{n(1,f=l==null?void 0:l.getFiles(a==null?void 0:a.name)),n(3,d=await f||[])}catch{}}function g(){he(Fe,c=null,c),he(we,o={},o),window.location.hash="#/editor"}async function h(){try{await l.deleteFiles(r),i!=null&&i.onDelete&&(n(2,u=i.onDelete(r)),await u),he(s,r=[],r),p()}catch(v){console.error("Error deleting files",v)}}return e.$$.update=()=>{e.$$.dirty&257&&p()},[a,f,u,d,r,s,g,h,l]}class va extends ae{constructor(t){super(),ce(this,t,ba,wa,ie,{})}}function ya(e){let t,n,r,i,l,o,c,a,s=e[0].name+"",f,u,d;return{c(){t=k("div"),n=k("input"),r=q(),i=k("img"),c=q(),a=k("small"),f=ee(s),m(n,"type","checkbox"),m(n,"name","media-select"),m(n,"class","svelte-9g6man"),jt(i.src,l=e[0].url_preview)||m(i,"src",l),m(i,"alt",o=e[0].alt),m(i,"loading","lazy"),m(i,"crossorigin","use-credentials"),m(i,"class","svelte-9g6man"),m(a,"class","svelte-9g6man"),m(t,"class","svelte-9g6man")},m(p,g){N(p,t,g),w(t,n),w(t,r),w(t,i),w(t,c),w(t,a),w(a,f),u||(d=Z(n,"change",e[2]),u=!0)},p(p,[g]){g&1&&!jt(i.src,l=p[0].url_preview)&&m(i,"src",l),g&1&&o!==(o=p[0].alt)&&m(i,"alt",o),g&1&&s!==(s=p[0].name+"")&&_e(f,s)},i:b,o:b,d(p){p&&H(t),u=!1,d()}}}function ka(e,t,n){let r;const i=xn("selectedMediaFiles");W(e,i,c=>n(3,r=c));let{media:l}=t;function o(c){c.target.checked?he(i,r=[...r,l],r):he(i,r=r.filter(a=>a!==l),r)}return e.$$set=c=>{"media"in c&&n(0,l=c.media)},[l,i,o]}class Aa extends ae{constructor(t){super(),ce(this,t,ka,ya,ie,{media:0})}}const $i='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>file-upload</title><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z" /></svg>';function dr(e,t,n){const r=e.slice();return r[9]=t[n],r}function Ea(e){let t,n=[],r=new Map,i,l=Ee(e[1]);const o=c=>c[9].name;for(let c=0;c<l.length;c+=1){let a=dr(e,l,c),s=o(a);r.set(s,n[c]=pr(s,a))}return{c(){t=k("div");for(let c=0;c<n.length;c+=1)n[c].c();m(t,"id","items"),m(t,"class","svelte-12p8acg")},m(c,a){N(c,t,a);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(c,a){a&2&&(l=Ee(c[1]),ye(),n=Ht(n,a,o,1,c,l,r,t,Tn,pr,null,dr),ke())},i(c){if(!i){for(let a=0;a<l.length;a+=1)I(n[a]);i=!0}},o(c){for(let a=0;a<n.length;a+=1)V(n[a]);i=!1},d(c){c&&H(t);for(let a=0;a<n.length;a+=1)n[a].d()}}}function Ca(e){let t,n,r,i,l,o,c,a;return{c(){t=k("div"),n=k("p"),n.textContent="No files found.",r=q(),i=k("button"),l=new ze(!1),o=ee("Upload a File"),l.a=o,m(i,"class","svelte-12p8acg"),m(t,"id","empty"),m(t,"class","svelte-12p8acg")},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),l.m($i,i),w(i,o),c||(a=Z(i,"click",e[4]),c=!0)},p:b,i:b,o:b,d(s){s&&H(t),c=!1,a()}}}function pr(e,t){let n,r,i;return r=new Aa({props:{media:t[9]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(l,o){N(l,n,o),K(r,l,o),i=!0},p(l,o){t=l;const c={};o&2&&(c.media=t[9]),r.$set(c)},i(l){i||(I(r.$$.fragment,l),i=!0)},o(l){V(r.$$.fragment,l),i=!1},d(l){l&&H(n),X(r,l)}}}function Sa(e){let t,n;return t=new Ke({props:{msg:"Error getting entries",details:e[8].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[8].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function xa(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function La(e){let t,n;return t=new Jt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Ta(e){let t,n,r,i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T,j;const D=[Ca,Ea],R=[];function F(P,M){return P[1].length===0?0:1}g=F(e),h=R[g]=D[g](e);let C={ctx:e,current:null,token:null,hasCatch:!0,pending:La,then:xa,catch:Sa,error:8,blocks:[,,,]};return se(A=e[0],C),{c(){t=k("main"),n=k("header"),r=ee(`Media Files
33
+ `),i=k("div"),l=k("button"),o=new ze(!1),c=ee("Delete"),s=q(),f=k("button"),u=new ze(!1),d=ee("Upload"),p=q(),h.c(),v=q(),C.block.c(),o.a=c,m(l,"class","outline svelte-12p8acg"),l.disabled=a=e[2].length===0,u.a=d,m(f,"class","svelte-12p8acg"),m(i,"id","listActions"),m(i,"class","svelte-12p8acg"),m(n,"class","svelte-12p8acg"),m(t,"class","svelte-12p8acg")},m(P,M){N(P,t,M),w(t,n),w(n,r),w(n,i),w(i,l),o.m(Ri,l),w(l,c),w(i,s),w(i,f),u.m($i,f),w(f,d),w(t,p),R[g].m(t,null),w(t,v),C.block.m(t,C.anchor=null),C.mount=()=>t,C.anchor=null,E=!0,T||(j=[Z(l,"click",e[5]),Z(f,"click",e[4])],T=!0)},p(P,[M]){e=P,(!E||M&4&&a!==(a=e[2].length===0))&&(l.disabled=a);let S=g;g=F(e),g===S?R[g].p(e,M):(ye(),V(R[S],1,1,()=>{R[S]=null}),ke(),h=R[g],h?h.p(e,M):(h=R[g]=D[g](e),h.c()),I(h,1),h.m(t,v)),C.ctx=e,M&1&&A!==(A=e[0])&&se(A,C)||Pe(C,e,M)},i(P){E||(I(h),I(C.block),E=!0)},o(P){V(h);for(let M=0;M<3;M+=1){const S=C.blocks[M];V(S)}E=!1},d(P){P&&H(t),R[g].d(),C.block.d(),C.token=null,C=null,T=!1,ue(j)}}}function Ma(e,t,n){let r,i;W(e,Ve,u=>n(6,i=u));const l=tt([]);W(e,l,u=>n(2,r=u)),Sn("selectedMediaFiles",l);let o,c=[];async function a(u){try{n(0,o=i==null?void 0:i.getMediaFiles()),n(1,c=await o||[])}catch{}}async function s(){await i.uploadMediaFile(),a()}async function f(){try{await i.deleteFiles(r),he(l,r=[],r),a()}catch(u){console.error("Error deleting files",u)}}return e.$$.update=()=>{e.$$.dirty&64&&a()},[o,c,r,l,s,f,i]}class Oa extends ae{constructor(t){super(),ce(this,t,Ma,Ta,ie,{})}}function hr(e,t,n){const r=e.slice();return r[5]=t[n],r}function Da(e){let t,n;return t=new Oa({}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Fa(e){let t,n,r,i,l,o=e[0]&&mr(e);return i=new va({}),{c(){t=k("aside"),n=k("ul"),o&&o.c(),r=q(),J(i.$$.fragment),m(n,"class","svelte-17x5uzj"),m(t,"class","svelte-17x5uzj")},m(c,a){N(c,t,a),w(t,n),o&&o.m(n,null),N(c,r,a),K(i,c,a),l=!0},p(c,a){c[0]?o?(o.p(c,a),a&1&&I(o,1)):(o=mr(c),o.c(),I(o,1),o.m(n,null)):o&&(ye(),V(o,1,1,()=>{o=null}),ke())},i(c){l||(I(o),I(i.$$.fragment,c),l=!0)},o(c){V(o),V(i.$$.fragment,c),l=!1},d(c){c&&(H(t),H(r)),o&&o.d(),X(i,c)}}}function mr(e){let t,n,r=Ee(e[0]),i=[];for(let o=0;o<r.length;o+=1)i[o]=gr(hr(e,r,o));const l=o=>V(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();t=Oe()},m(o,c){for(let a=0;a<i.length;a+=1)i[a]&&i[a].m(o,c);N(o,t,c),n=!0},p(o,c){if(c&1){r=Ee(o[0]);let a;for(a=0;a<r.length;a+=1){const s=hr(o,r,a);i[a]?(i[a].p(s,c),I(i[a],1)):(i[a]=gr(s),i[a].c(),I(i[a],1),i[a].m(t.parentNode,t))}for(ye(),a=r.length;a<i.length;a+=1)l(a);ke()}},i(o){if(!n){for(let c=0;c<r.length;c+=1)I(i[c]);n=!0}},o(o){i=i.filter(Boolean);for(let c=0;c<i.length;c+=1)V(i[c]);n=!1},d(o){o&&H(t),un(i,o)}}}function gr(e){let t,n;const r=[e[5]];let i={};for(let l=0;l<r.length;l+=1)i=ot(i,r[l]);return t=new ea({props:i}),{c(){J(t.$$.fragment)},m(l,o){K(t,l,o),n=!0},p(l,o){const c=o&1?at(r,[st(l[5])]):{};t.$set(c)},i(l){n||(I(t.$$.fragment,l),n=!0)},o(l){V(t.$$.fragment,l),n=!1},d(l){X(t,l)}}}function Ha(e){let t,n,r,i,l,o;t=new Kc({}),t.$on("selectview",e[2]);const c=[Fa,Da],a=[];function s(f,u){return f[1]==="posts"?0:f[1]==="media"?1:-1}return~(i=s(e))&&(l=a[i]=c[i](e)),{c(){J(t.$$.fragment),n=q(),r=k("div"),l&&l.c(),m(r,"id","dash"),m(r,"class","page svelte-17x5uzj")},m(f,u){K(t,f,u),N(f,n,u),N(f,r,u),~i&&a[i].m(r,null),o=!0},p(f,[u]){let d=i;i=s(f),i===d?~i&&a[i].p(f,u):(l&&(ye(),V(a[d],1,1,()=>{a[d]=null}),ke()),~i?(l=a[i],l?l.p(f,u):(l=a[i]=c[i](f),l.c()),I(l,1),l.m(r,null)):l=null)},i(f){o||(I(t.$$.fragment,f),I(l),o=!0)},o(f){V(t.$$.fragment,f),V(l),o=!1},d(f){f&&(H(n),H(r)),X(t,f),~i&&a[i].d()}}}function Ia(e,t,n){let r,i,l;W(e,$e,a=>n(3,i=a)),W(e,Ce,a=>n(4,l=a));let o="posts";function c(a){n(1,o=a.detail)}return e.$$.update=()=>{e.$$.dirty&16&&n(0,r=l==null?void 0:l.collections),e.$$.dirty&9&&(i||he($e,i=r==null?void 0:r[0],i))},[r,o,c,i,l]}class Na extends ae{constructor(t){super(),ce(this,t,Ia,Ha,ie,{})}}const Ra='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>arrow-left</title><path d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" /></svg>',Rn=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.window.document._=0}catch{return!1}return"showOpenFilePicker"in self})(),Pa=Rn?Promise.resolve().then(function(){return Ua}):Promise.resolve().then(function(){return Ka});async function Pn(...e){return(await Pa).default(...e)}const $a=Rn?Promise.resolve().then(function(){return Ga}):Promise.resolve().then(function(){return Qa});async function ja(...e){return(await $a).default(...e)}const Va=Rn?Promise.resolve().then(function(){return za}):Promise.resolve().then(function(){return es});async function wn(...e){return(await Va).default(...e)}const qa=async e=>{const t=await e.getFile();return t.handle=e,t};var Ya=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((i,l)=>{t[l]={description:i.description||"Files",accept:{}},i.mimeTypes?i.mimeTypes.map(o=>{t[l].accept[o]=i.extensions||[]}):t[l].accept["*/*"]=i.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(qa));return e[0].multiple?r:r[0]},Ua={__proto__:null,default:Ya};function Pt(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return Pt=function(n){this.s=n,this.n=n.next},Pt.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var r=this.s.return;return r===void 0?Promise.resolve({value:n,done:!0}):t(r.apply(this.s,arguments))},throw:function(n){var r=this.s.return;return r===void 0?Promise.reject(n):t(r.apply(this.s,arguments))}},new Pt(e)}const ji=async(e,t,n=e.name,r)=>{const i=[],l=[];var o,c=!1,a=!1;try{for(var s,f=function(u){var d,p,g,h=2;for(typeof Symbol<"u"&&(p=Symbol.asyncIterator,g=Symbol.iterator);h--;){if(p&&(d=u[p])!=null)return d.call(u);if(g&&(d=u[g])!=null)return new Pt(d.call(u));p="@@asyncIterator",g="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());c=!(s=await f.next()).done;c=!1){const u=s.value,d=`${n}/${u.name}`;u.kind==="file"?l.push(u.getFile().then(p=>(p.directoryHandle=e,p.handle=u,Object.defineProperty(p,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>d})))):u.kind!=="directory"||!t||r&&r(u)||i.push(ji(u,t,d,r))}}catch(u){a=!0,o=u}finally{try{c&&f.return!=null&&await f.return()}finally{if(a)throw o}}return[...(await Promise.all(i)).flat(),...await Promise.all(l)]};var Ba=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:ji(t,e.recursive,void 0,e.skipDirectory)},Ga={__proto__:null,default:Ba},Wa=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const l=[];let o=null;if(e instanceof Blob&&e.type?o=e.type:e.headers&&e.headers.get("content-type")&&(o=e.headers.get("content-type")),t.forEach((s,f)=>{l[f]={description:s.description||"Files",accept:{}},s.mimeTypes?(f===0&&o&&s.mimeTypes.push(o),s.mimeTypes.map(u=>{l[f].accept[u]=s.extensions||[]})):o?l[f].accept[o]=s.extensions||[]:l[f].accept["*/*"]=s.extensions||[]}),n)try{await n.getFile()}catch(s){if(n=null,r)throw s}const c=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:l,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(c);const a=await c.createWritable();return"stream"in e?(await e.stream().pipeTo(a),c):"body"in e?(await e.body.pipeTo(a),c):(await a.write(await e),await a.close(),c)},za={__proto__:null,default:Wa},Za=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const r=document.createElement("input");r.type="file";const i=[...e.map(a=>a.mimeTypes||[]),...e.map(a=>a.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||"",r.style.display="none",document.body.append(r);const l=a=>{typeof o=="function"&&o(),t(a)},o=e[0].legacySetup&&e[0].legacySetup(l,()=>o(n),r),c=()=>{window.removeEventListener("focus",c),r.remove()};r.addEventListener("click",()=>{window.addEventListener("focus",c)}),r.addEventListener("change",()=>{window.removeEventListener("focus",c),r.remove(),l(r.multiple?Array.from(r.files):r.files[0])}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Ka={__proto__:null,default:Za},Xa=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0;const i=o=>{typeof l=="function"&&l(),t(o)},l=e[0].legacySetup&&e[0].legacySetup(i,()=>l(n),r);r.addEventListener("change",()=>{let o=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(o=o.filter(c=>c.webkitRelativePath.split("/").every(a=>!e[0].skipDirectory({name:a,kind:"directory"})))):o=o.filter(c=>c.webkitRelativePath.split("/").length===2),i(o)}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Qa={__proto__:null,default:Xa},Ja=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let r=e;"body"in e&&(r=await async function(o,c){const a=o.getReader(),s=new ReadableStream({start:d=>async function p(){return a.read().then(({done:g,value:h})=>{if(!g)return d.enqueue(h),p();d.close()})}()}),f=new Response(s),u=await f.blob();return a.releaseLock(),new Blob([u],{type:c})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await r);const i=()=>{typeof l=="function"&&l()},l=t.legacySetup&&t.legacySetup(i,()=>l(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},es={__proto__:null,default:Ja},Vi={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Hi,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d\d/,l=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,c={},a=function(h){return(h=+h)+(h>68?1900:2e3)},s=function(h){return function(v){this[h]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(h){(this.zone||(this.zone={})).offset=function(v){if(!v||v==="Z")return 0;var A=v.match(/([+-]|\d\d)/g),E=60*A[1]+(+A[2]||0);return E===0?0:A[0]==="+"?-E:E}(h)}],u=function(h){var v=c[h];return v&&(v.indexOf?v:v.s.concat(v.f))},d=function(h,v){var A,E=c.meridiem;if(E){for(var T=1;T<=24;T+=1)if(h.indexOf(E(T,0,v))>-1){A=T>12;break}}else A=h===(v?"pm":"PM");return A},p={A:[o,function(h){this.afternoon=d(h,!1)}],a:[o,function(h){this.afternoon=d(h,!0)}],S:[/\d/,function(h){this.milliseconds=100*+h}],SS:[i,function(h){this.milliseconds=10*+h}],SSS:[/\d{3}/,function(h){this.milliseconds=+h}],s:[l,s("seconds")],ss:[l,s("seconds")],m:[l,s("minutes")],mm:[l,s("minutes")],H:[l,s("hours")],h:[l,s("hours")],HH:[l,s("hours")],hh:[l,s("hours")],D:[l,s("day")],DD:[i,s("day")],Do:[o,function(h){var v=c.ordinal,A=h.match(/\d+/);if(this.day=A[0],v)for(var E=1;E<=31;E+=1)v(E).replace(/\[|\]/g,"")===h&&(this.day=E)}],M:[l,s("month")],MM:[i,s("month")],MMM:[o,function(h){var v=u("months"),A=(u("monthsShort")||v.map(function(E){return E.slice(0,3)})).indexOf(h)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[o,function(h){var v=u("months").indexOf(h)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,s("year")],YY:[i,function(h){this.year=a(h)}],YYYY:[/\d{4}/,s("year")],Z:f,ZZ:f};function g(h){var v,A;v=h,A=c&&c.formats;for(var E=(h=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(P,M,S){var B=S&&S.toUpperCase();return M||A[S]||n[S]||A[B].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(z,O,y){return O||y.slice(1)})})).match(r),T=E.length,j=0;j<T;j+=1){var D=E[j],R=p[D],F=R&&R[0],C=R&&R[1];E[j]=C?{regex:F,parser:C}:D.replace(/^\[|\]$/g,"")}return function(P){for(var M={},S=0,B=0;S<T;S+=1){var z=E[S];if(typeof z=="string")B+=z.length;else{var O=z.regex,y=z.parser,_=P.slice(B),x=O.exec(_)[0];y.call(M,x),P=P.replace(x,"")}}return function(L){var $=L.afternoon;if($!==void 0){var G=L.hours;$?G<12&&(L.hours+=12):G===12&&(L.hours=0),delete L.afternoon}}(M),M}}return function(h,v,A){A.p.customParseFormat=!0,h&&h.parseTwoDigitYear&&(a=h.parseTwoDigitYear);var E=v.prototype,T=E.parse;E.parse=function(j){var D=j.date,R=j.utc,F=j.args;this.$u=R;var C=F[1];if(typeof C=="string"){var P=F[2]===!0,M=F[3]===!0,S=P||M,B=F[2];M&&(B=F[2]),c=this.$locale(),!P&&B&&(c=A.Ls[B]),this.$d=function(_,x,L){try{if(["x","X"].indexOf(x)>-1)return new Date((x==="X"?1e3:1)*_);var $=g(x)(_),G=$.year,Q=$.month,ne=$.day,le=$.hours,fe=$.minutes,Ae=$.seconds,qe=$.milliseconds,He=$.zone,Ne=new Date,De=ne||(G||Q?1:Ne.getDate()),de=G||Ne.getFullYear(),xe=0;G&&!Q||(xe=Q>0?Q-1:Ne.getMonth());var Re=le||0,Ye=fe||0,Et=Ae||0,U=qe||0;return He?new Date(Date.UTC(de,xe,De,Re,Ye,Et,U+60*He.offset*1e3)):L?new Date(Date.UTC(de,xe,De,Re,Ye,Et,U)):new Date(de,xe,De,Re,Ye,Et,U)}catch{return new Date("")}}(D,C,R),this.init(),B&&B!==!0&&(this.$L=this.locale(B).$L),S&&D!=this.format(C)&&(this.$d=new Date("")),c={}}else if(C instanceof Array)for(var z=C.length,O=1;O<=z;O+=1){F[1]=C[O-1];var y=A.apply(this,F);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}O===z&&(this.$d=new Date(""))}else T.call(this,j)}}})})(Vi);var ts=Vi.exports;const qi=Ii(ts);Te.extend(qi);const $n="../../cms-config/",_r=`Unable to parse markdown entry. Backend must implement 'replacePreviewLinks()'
34
+ and return a valid string.`;function Wt(e,t){let n=Te(t),r="";switch(e){case"datetime-local":r=n.format("YYYY-MM-DDTHH:mm");break;case"date":r=n.format("YYYY-MM-DD");break;case"time":r=n.format("HH:mm");break}return r}function ns(e,t){var i;const n=(i=e==null?void 0:e.previews.styles.find(l=>l.name===t))==null?void 0:i.files;if(!n)return;const r=[];return n.forEach(l=>{const o=`${$n}${l}`;r.push(new URL(o,window.location.href).href)}),r.map(l=>`<link rel="stylesheet" href="${l}">`).join(`
35
+ `)}async function rs(e,t){var i;const n=(i=e==null?void 0:e.previews.templates.find(l=>l.name===t))==null?void 0:i.template;if(!n)return;const r=new URL(`${$n}${n}`,window.location.href).href;try{const l=await fetch(r);if(!l.ok)throw new Error(`Unable to fetch file ${r}`);return await l.text()}catch(l){console.error(l);return}}function is(e,t){return e==null?void 0:e.replace("{{styles}}",t).replaceAll("{{",'<span data-tag="').replaceAll("}}",'"></span>')}async function Yi(e,t,n){let r;switch(e.widget){case"markdown":if(!(n!=null&&n.replacePreviewLinks))throw new Error(_r);if(r=await(n==null?void 0:n.replacePreviewLinks(t)),r==null)throw new Error(_r);break;case"datetime":let i;switch(e.type){case"time":i=Te(t.toString(),"hh:mm").toISOString();break;case"date":i=Te(t.toString(),"YYYY-MM-DD").toISOString();break;default:i=Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString();break}r=new Date(i);break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;case"hidden":switch(e.type){case"datetime-local":r=new Date(Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString());break;case"time":r=new Date(Te(t.toString(),"hh:mm").toISOString());break;case"date":r=new Date(Te(t.toString(),"YYYY-MM-DD").toISOString());break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;default:r=t;break}break;default:r=t;break}return r}function ls(e,t){const{slug:n,extension:r}=e,{title:i,date:l}=t,o=i.toLowerCase().replaceAll(/\W+/g,"-"),c=Te(l);return`${n.replaceAll("{{slug}}",o).replaceAll("{{year}}",c.format("YYYY")).replaceAll("{{month}}",c.format("MM")).replaceAll("{{day}}",c.format("DD")).replaceAll("{{hour}}",c.format("HH")).replaceAll("{{minute}}",c.format("mm")).replaceAll("{{second}}",c.format("ss"))}.${r}`}function os(e,t){const n={...t},{date:r,body:i}={...n.fields};delete n.fields.body;const l=Qt.dump(n.fields,{quotingType:'"',forceQuotes:!0});return n.date=r,n.body=i,n.collection=e.name,n.name||(n.name=ls(e,n.fields)),n.raw=`---
36
36
  ${l}---
37
37
 
38
- ${n.body}`,n}function $n(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-01-01T12:00:00-00:00",e.trim()];const t="---",n="{#{br}#}";return e.trim().replace(t,n).replace(t,n).split(n).filter(l=>l.length>0).map(l=>l.trim())}function os(e){switch(e){case".md":case".markdown":return"text/markdown";default:return"text/plain"}}function Ht(e){var l;const t=/!?\[.+\]\(.+\)/g,n=/!?\[.+\]\(/,r=/\)/;return((l=e.match(t))==null?void 0:l.map(o=>o.replace(n,"").replace(r,"")))||[]}async function cs(e,t){const{file:n}=Ie(e).backend;if(!n)return;const i=await import(new URL(`${Pn}${n}`,window.location.href).href),l={configStore:e,backendStore:t,getStoreValueFunc:Ie,getContentsFunc:$n,parseLinksFunc:Ht,fileOpenFunc:Rn};return i.default.init(l)}function as(e){let t,n,r;return{c(){t=k("button"),n=te("Save"),m(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,l){N(i,t,l),w(t,n)},p(i,l){l&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&H(t)}}}function ss(e){let t,n,r;return{c(){t=k("button"),n=te("Save"),m(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,l){N(i,t,l),w(t,n)},p(i,l){l&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&H(t)}}}function us(e){let t;return{c(){t=k("button"),t.textContent="Save",m(t,"form","entry-data"),t.disabled=!0},m(n,r){N(n,t,r)},p:b,d(n){n&&H(t)}}}function fs(e){var R,F;let t,n,r,i,l,o,c,a=((R=e[2])==null?void 0:R.label)+"",s,f,u,d,p=(((F=e[0])==null?void 0:F.fields.title)||"New File")+"",g,h,v,A,E,T,j,D={ctx:e,current:null,token:null,hasCatch:!0,pending:us,then:ss,catch:as,value:10,error:11};return se(E=e[3],D),{c(){t=k("nav"),n=k("ul"),r=k("li"),i=k("a"),l=q(),o=k("ul"),c=k("li"),s=te(a),f=q(),u=k("span"),u.textContent="/",d=q(),g=te(p),h=q(),v=k("ul"),A=k("li"),D.block.c(),m(i,"href","##placeholder"),m(i,"class","svelte-1gmahua"),m(u,"class","svelte-1gmahua"),m(c,"class","svelte-1gmahua")},m(C,P){N(C,t,P),w(t,n),w(n,r),w(r,i),i.innerHTML=Na,w(t,l),w(t,o),w(o,c),w(c,s),w(c,f),w(c,u),w(c,d),w(c,g),w(t,h),w(t,v),w(v,A),D.block.m(A,D.anchor=null),D.mount=()=>A,D.anchor=null,T||(j=Z(i,"click",Ue(ds)),T=!0)},p(C,[P]){var M,S;e=C,P&4&&a!==(a=((M=e[2])==null?void 0:M.label)+"")&&_e(s,a),P&1&&p!==(p=(((S=e[0])==null?void 0:S.fields.title)||"New File")+"")&&_e(g,p),D.ctx=e,P&8&&E!==(E=e[3])&&se(E,D)||Pe(D,e,P)},i:b,o:b,d(C){C&&H(t),D.block.d(),D.token=null,D=null,T=!1,j()}}}function ds(){window.location.hash=""}function ps(e,t,n){let r,i,l,o,c;W(e,Ve,p=>n(7,r=p)),W(e,Fe,p=>n(0,i=p)),W(e,$e,p=>n(2,l=p)),W(e,we,p=>n(5,o=p));let a,s=!1;const f=Sn("submitted");W(e,f,p=>n(3,c=p));async function u(p){a&&n(1,s=!await d())}async function d(){if(!i)return!1;const p=new FormData(a);for(const[g,h]of p){const v=l.fields.find(D=>D.name===g),A=(i==null?void 0:i.fields[v.name])??i[v.name],E=await qi(v,h,r);let T,j;switch(v.widget){case"datetime":T=new Date(A).getTime(),j=E.getTime();break;case"markdown":T=A.trim().replaceAll(`\r
38
+ ${n.body}`,n}function jn(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-01-01T12:00:00-00:00",e.trim()];const t="---",n="{#{br}#}";return e.trim().replace(t,n).replace(t,n).split(n).filter(l=>l.length>0).map(l=>l.trim())}function cs(e){switch(e){case".md":case".markdown":return"text/markdown";default:return"text/plain"}}function It(e){var l;const t=/!?\[.+\]\(.+\)/g,n=/!?\[.+\]\(/,r=/\)/;return((l=e.match(t))==null?void 0:l.map(o=>o.replace(n,"").replace(r,"")))||[]}async function as(e,t){const{file:n}=Ie(e).backend;if(!n)return;const i=await import(new URL(`${$n}${n}`,window.location.href).href),l={configStore:e,backendStore:t,getStoreValueFunc:Ie,getContentsFunc:jn,parseLinksFunc:It,fileOpenFunc:Pn};return i.default.init(l)}function ss(e){let t,n,r;return{c(){t=k("button"),n=ee("Save"),m(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,l){N(i,t,l),w(t,n)},p(i,l){l&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&H(t)}}}function us(e){let t,n,r;return{c(){t=k("button"),n=ee("Save"),m(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,l){N(i,t,l),w(t,n)},p(i,l){l&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&H(t)}}}function fs(e){let t;return{c(){t=k("button"),t.textContent="Save",m(t,"form","entry-data"),t.disabled=!0},m(n,r){N(n,t,r)},p:b,d(n){n&&H(t)}}}function ds(e){var R,F;let t,n,r,i,l,o,c,a=((R=e[2])==null?void 0:R.label)+"",s,f,u,d,p=(((F=e[0])==null?void 0:F.fields.title)||"New File")+"",g,h,v,A,E,T,j,D={ctx:e,current:null,token:null,hasCatch:!0,pending:fs,then:us,catch:ss,value:10,error:11};return se(E=e[3],D),{c(){t=k("nav"),n=k("ul"),r=k("li"),i=k("a"),l=q(),o=k("ul"),c=k("li"),s=ee(a),f=q(),u=k("span"),u.textContent="/",d=q(),g=ee(p),h=q(),v=k("ul"),A=k("li"),D.block.c(),m(i,"href","##placeholder"),m(i,"class","svelte-1gmahua"),m(u,"class","svelte-1gmahua"),m(c,"class","svelte-1gmahua")},m(C,P){N(C,t,P),w(t,n),w(n,r),w(r,i),i.innerHTML=Ra,w(t,l),w(t,o),w(o,c),w(c,s),w(c,f),w(c,u),w(c,d),w(c,g),w(t,h),w(t,v),w(v,A),D.block.m(A,D.anchor=null),D.mount=()=>A,D.anchor=null,T||(j=Z(i,"click",Ue(ps)),T=!0)},p(C,[P]){var M,S;e=C,P&4&&a!==(a=((M=e[2])==null?void 0:M.label)+"")&&_e(s,a),P&1&&p!==(p=(((S=e[0])==null?void 0:S.fields.title)||"New File")+"")&&_e(g,p),D.ctx=e,P&8&&E!==(E=e[3])&&se(E,D)||Pe(D,e,P)},i:b,o:b,d(C){C&&H(t),D.block.d(),D.token=null,D=null,T=!1,j()}}}function ps(){window.location.hash=""}function hs(e,t,n){let r,i,l,o,c;W(e,Ve,p=>n(7,r=p)),W(e,Fe,p=>n(0,i=p)),W(e,$e,p=>n(2,l=p)),W(e,we,p=>n(5,o=p));let a,s=!1;const f=xn("submitted");W(e,f,p=>n(3,c=p));async function u(p){a&&n(1,s=!await d())}async function d(){if(!i)return!1;const p=new FormData(a);for(const[g,h]of p){const v=l.fields.find(D=>D.name===g),A=(i==null?void 0:i.fields[v.name])??i[v.name],E=await Yi(v,h,r);let T,j;switch(v.widget){case"datetime":T=new Date(A).getTime(),j=E.getTime();break;case"markdown":T=A.trim().replaceAll(`\r
39
39
  `,`
40
40
  `),j=E.trim().replaceAll(`\r
41
41
  `,`
42
- `);break;case"hidden":switch(v.type){case"datetime-local":case"date":case"time":T=new Date(A).getTime(),j=E.getTime();break;default:T=A,j=E;break}break;default:T=A,j=E;break}if(T!==j)return!1}return!0}return je(()=>{a=document.querySelector("#entry-data")}),e.$$.update=()=>{e.$$.dirty&33&&u()},[i,s,l,c,f,o]}class hs extends ae{constructor(t){super(),ce(this,t,ps,fs,ie,{})}}function ms(e){let t,n,r,i,l,o,c,a;return{c(){t=k("label"),n=te(e[2]),r=q(),i=k("input"),l=q(),o=k("input"),m(i,"type","checkbox"),m(i,"role","switch"),m(i,"id",e[1]),m(i,"name",e[1]),m(i,"form","ignore"),i.required=e[3],m(o,"type","hidden"),m(o,"id",e[1]),m(o,"name",e[1]),o.value=e[0],o.required=e[3],m(t,"class","editorInput"),m(t,"for",e[1])},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),i.checked=e[0],w(t,l),w(t,o),c||(a=[Z(i,"change",e[5]),Z(i,"change",e[4])],c=!0)},p(s,[f]){f&4&&_e(n,s[2]),f&2&&m(i,"id",s[1]),f&2&&m(i,"name",s[1]),f&8&&(i.required=s[3]),f&1&&(i.checked=s[0]),f&2&&m(o,"id",s[1]),f&2&&m(o,"name",s[1]),f&1&&(o.value=s[0]),f&8&&(o.required=s[3]),f&2&&m(t,"for",s[1])},i:b,o:b,d(s){s&&H(t),c=!1,ue(a)}}}function gs(e,t,n){let r,i,l;W(e,Fe,p=>n(6,r=p)),W(e,we,p=>n(7,i=p)),W(e,$e,p=>n(8,l=p));let{name:o}=t,{label:c}=t,{checked:a=!1}=t,{required:s=!0}=t;function f(){const p={...i};a==null?p[o]=l==null?void 0:l.fields.find(g=>g.name===o).default:p[o]=a,he(we,i=p,i)}async function u(){r&&n(0,a=r.fields[o]),f()}je(()=>{u()});function d(){a=this.checked,n(0,a)}return e.$$set=p=>{"name"in p&&n(1,o=p.name),"label"in p&&n(2,c=p.label),"checked"in p&&n(0,a=p.checked),"required"in p&&n(3,s=p.required)},[a,o,c,s,f,d]}class _s extends ae{constructor(t){super(),ce(this,t,gs,ms,ie,{name:1,label:2,checked:0,required:3})}}function ws(e){let t,n,r;return{c(){t=k("input"),m(t,"type","datetime-local"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[8]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function bs(e){let t,n,r;return{c(){t=k("input"),m(t,"type","date"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function vs(e){let t,n,r;return{c(){t=k("input"),m(t,"type","time"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function ys(e){let t,n,r;function i(c,a){return c[3]==="time"?vs:c[3]==="date"?bs:ws}let l=i(e),o=l(e);return{c(){t=k("label"),n=te(e[2]),r=q(),o.c(),m(t,"class","editorInput"),m(t,"for",e[1])},m(c,a){N(c,t,a),w(t,n),w(t,r),o.m(t,null)},p(c,[a]){a&4&&_e(n,c[2]),l===(l=i(c))&&o?o.p(c,a):(o.d(1),o=l(c),o&&(o.c(),o.m(t,null))),a&2&&m(t,"for",c[1])},i:b,o:b,d(c){c&&H(t),o.d()}}}function ks(e,t,n){let r,i;W(e,Fe,h=>n(9,r=h)),W(e,we,h=>n(10,i=h));let{name:l}=t,{label:o}=t,{type:c="datetime-local"}=t,{value:a=Gt(c,new Date)}=t,{required:s=!0}=t;function f(){const h={...i};h[l]=a,he(we,i=h,i)}async function u(){if(r){const h=r.fields;n(0,a=Gt(c,new Date(h[l])))}f()}je(()=>{u()});function d(){a=this.value,n(0,a)}function p(){a=this.value,n(0,a)}function g(){a=this.value,n(0,a)}return e.$$set=h=>{"name"in h&&n(1,l=h.name),"label"in h&&n(2,o=h.label),"type"in h&&n(3,c=h.type),"value"in h&&n(0,a=h.value),"required"in h&&n(4,s=h.required)},[a,l,o,c,s,f,d,p,g]}class As extends ae{constructor(t){super(),ce(this,t,ks,ys,ie,{name:1,label:2,type:3,value:0,required:4})}}function Es(e){let t,n,r;return{c(){t=k("textarea"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function Cs(e){let t,n,r;return{c(){t=k("input"),m(t,"type","text"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&t.value!==i[0]&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function Ss(e){let t,n,r;function i(c,a){return c[3]?Es:Cs}let l=i(e),o=l(e);return{c(){t=k("label"),n=te(e[2]),r=q(),o.c(),m(t,"class","editorInput"),m(t,"for",e[1])},m(c,a){N(c,t,a),w(t,n),w(t,r),o.m(t,null)},p(c,[a]){a&4&&_e(n,c[2]),l===(l=i(c))&&o?o.p(c,a):(o.d(1),o=l(c),o&&(o.c(),o.m(t,null))),a&2&&m(t,"for",c[1])},i:b,o:b,d(c){c&&H(t),o.d()}}}function xs(e,t,n){let r,i,l;W(e,Fe,h=>n(8,r=h)),W(e,we,h=>n(9,i=h)),W(e,$e,h=>n(10,l=h));let{name:o}=t,{label:c}=t,{multiline:a=!1}=t,{required:s=!0}=t,{value:f=""}=t;function u(){const h={...i};f?h[o]=f:h[o]=l==null?void 0:l.fields.find(v=>v.name===o).label,he(we,i=h,i)}async function d(){r&&n(0,f=o==="body"?r.body:r.fields[o]),u()}je(()=>{d()});function p(){f=this.value,n(0,f)}function g(){f=this.value,n(0,f)}return e.$$set=h=>{"name"in h&&n(1,o=h.name),"label"in h&&n(2,c=h.label),"multiline"in h&&n(3,a=h.multiline),"required"in h&&n(4,s=h.required),"value"in h&&n(0,f=h.value)},[f,o,c,a,s,u,p,g]}class _r extends ae{constructor(t){super(),ce(this,t,xs,Ss,ie,{name:1,label:2,multiline:3,required:4,value:0})}}function Ls(e){let t,n,r,i,l,o;return{c(){t=k("label"),n=te(e[2]),r=q(),i=k("input"),m(i,"type","number"),m(i,"id",e[1]),m(i,"name",e[1]),m(i,"step",e[3]),m(i,"min",e[4]),m(i,"max",e[5]),i.required=e[6],m(t,"class","editorInput"),m(t,"for",e[1])},m(c,a){N(c,t,a),w(t,n),w(t,r),w(t,i),ve(i,e[0]),l||(o=[Z(i,"input",e[8]),Z(i,"input",e[7])],l=!0)},p(c,[a]){a&4&&_e(n,c[2]),a&2&&m(i,"id",c[1]),a&2&&m(i,"name",c[1]),a&8&&m(i,"step",c[3]),a&16&&m(i,"min",c[4]),a&32&&m(i,"max",c[5]),a&64&&(i.required=c[6]),a&1&&Yr(i.value)!==c[0]&&ve(i,c[0]),a&2&&m(t,"for",c[1])},i:b,o:b,d(c){c&&H(t),l=!1,ue(o)}}}function Ts(e,t,n){let r,i;W(e,Fe,h=>n(9,r=h)),W(e,we,h=>n(10,i=h));let{name:l}=t,{label:o}=t,{value:c}=t,{step:a}=t,{min:s}=t,{max:f}=t,{required:u=!0}=t;function d(){const h={...i};h[l]=c,he(we,i=h,i)}async function p(){r&&n(0,c=r.fields[l]),d()}je(()=>{p()});function g(){c=Yr(this.value),n(0,c)}return e.$$set=h=>{"name"in h&&n(1,l=h.name),"label"in h&&n(2,o=h.label),"value"in h&&n(0,c=h.value),"step"in h&&n(3,a=h.step),"min"in h&&n(4,s=h.min),"max"in h&&n(5,f=h.max),"required"in h&&n(6,u=h.required)},[c,l,o,a,s,f,u,d,g]}class Ms extends ae{constructor(t){super(),ce(this,t,Ts,Ls,ie,{name:1,label:2,value:0,step:3,min:4,max:5,required:6})}}const Os=function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),Ds=function(e,t){return new URL(e,t).href},wr={},Xe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const l=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(a=>{if(a=Ds(a,r),a in wr)return;wr[a]=!0;const s=a.endsWith(".css"),f=s?'[rel="stylesheet"]':"";if(!!r)for(let p=l.length-1;p>=0;p--){const g=l[p];if(g.href===a&&(!s||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${f}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":Os,s||(d.as="script",d.crossOrigin=""),d.href=a,c&&d.setAttribute("nonce",c),document.head.appendChild(d),s)return new Promise((p,g)=>{d.addEventListener("load",p),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}return i.then(()=>t()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})},Fs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-bold</title><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',Hs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-italic</title><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',Is='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-bulleted</title><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>',Ns='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-numbered</title><path d="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z" /></svg>',Rs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>horizontal-rule</title><path d="M19,13H5V11H19V13Z" /></svg>',Ps='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-quote-close</title><path d="M14,17H17L19,13V7H13V13H16M6,17H9L11,13V7H5V13H8L6,17Z" /></svg>',$s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>link</title><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>',js='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>image</title><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" /></svg>',{document:Vs}=zt;function br(e,t,n){const r=e.slice();return r[9]=t[n],r}function vr(e,t,n){const r=e.slice();return r[12]=t[n],r}function yr(e){let t,n=e[12].title+"",r;return{c(){t=k("option"),r=te(n),t.__value=e[12].value,ve(t,t.__value),m(t,"class","svelte-niyo7g")},m(i,l){N(i,t,l),w(t,r)},p:b,d(i){i&&H(t)}}}function kr(e){let t,n,r=e[9].icon+"",i,l,o;return{c(){t=k("button"),n=new ze(!1),i=q(),n.a=i,m(t,"class","secondary svelte-niyo7g"),m(t,"data-action",e[9].name)},m(c,a){N(c,t,a),n.m(r,t),w(t,i),l||(o=Z(t,"click",Ue(e[3])),l=!0)},p:b,d(c){c&&H(t),l=!1,o()}}}function qs(e){let t,n,r,i,l,o,c=Ee(e[1]),a=[];for(let u=0;u<c.length;u+=1)a[u]=yr(vr(e,c,u));let s=Ee(e[2]),f=[];for(let u=0;u<s.length;u+=1)f[u]=kr(br(e,s,u));return{c(){t=q(),n=k("div"),r=k("select");for(let u=0;u<a.length;u+=1)a[u].c();i=q();for(let u=0;u<f.length;u+=1)f[u].c();m(r,"name","text-type"),m(r,"form","ignore"),m(r,"class","svelte-niyo7g"),m(n,"class","editor-menu svelte-niyo7g")},m(u,d){N(u,t,d),N(u,n,d),w(n,r);for(let p=0;p<a.length;p+=1)a[p]&&a[p].m(r,null);e[6](r),w(n,i);for(let p=0;p<f.length;p+=1)f[p]&&f[p].m(n,null);l||(o=[Z(Vs,"selectionchange",e[5]),Z(r,"change",e[4])],l=!0)},p(u,[d]){if(d&2){c=Ee(u[1]);let p;for(p=0;p<c.length;p+=1){const g=vr(u,c,p);a[p]?a[p].p(g,d):(a[p]=yr(g),a[p].c(),a[p].m(r,null))}for(;p<a.length;p+=1)a[p].d(1);a.length=c.length}if(d&12){s=Ee(u[2]);let p;for(p=0;p<s.length;p+=1){const g=br(u,s,p);f[p]?f[p].p(g,d):(f[p]=kr(g),f[p].c(),f[p].m(n,null))}for(;p<f.length;p+=1)f[p].d(1);f.length=s.length}},i:b,o:b,d(u){u&&(H(t),H(n)),sn(a,u),e[6](null),sn(f,u),l=!1,ue(o)}}}function Ys(){const e=[];for(let t=0;t<=6;t++){let n;t===0?n={title:"Normal",value:"p"}:n={title:`Heading ${t}`,value:t},e.push(n)}return e}function Us(e,t,n){const r=Zt();let i,l;const o=Ys(),c=[{name:"bold",icon:Fs},{name:"italic",icon:Hs},{name:"listBulleted",icon:Is},{name:"listNumbered",icon:Ns},{name:"quote",icon:Ps},{name:"horizontalRule",icon:Rs},{name:"link",icon:$s},{name:"image",icon:js}];function a(d){const{action:p}=d.currentTarget.dataset;r("menuaction",p)}function s(d){const p=d.currentTarget.value;r("menutexttype",p)}function f(){var h;const p=(h=document.getSelection().focusNode)==null?void 0:h.parentElement;if(!l.contains(p))return;const{localName:g}=p;switch(g){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":n(0,i.value=parseInt(g.split("").at(-1)),i);break;default:n(0,i.value="p",i);break}}je(()=>{l=document.querySelector("#md-editor")});function u(d){ct[d?"unshift":"push"](()=>{i=d,n(0,i),n(1,o)})}return[i,o,c,a,s,f,u]}class Bs extends ae{constructor(t){super(),ce(this,t,Us,qs,ie,{})}}const{document:Gs}=zt;function Ws(e){let t,n,r,i,l,o,c,a,s,f;return{c(){t=q(),n=k("div"),r=k("div"),i=k("div"),i.textContent="Enter link:",l=q(),o=k("input"),c=q(),a=k("button"),a.textContent="Save",m(i,"class","svelte-1vifg91"),m(o,"form","md-link-editor"),m(o,"type","url"),m(o,"name","url"),m(o,"placeholder","https://example.com"),o.required=!0,m(o,"class","svelte-1vifg91"),m(a,"class","secondary svelte-1vifg91"),m(a,"form","md-link-editor"),m(a,"type","submit"),m(r,"id","link-editor"),m(r,"class","svelte-1vifg91"),m(n,"id","link-editor-container"),m(n,"class","svelte-1vifg91"),Bn(n,"visibility",e[0]?"visible":"hidden")},m(u,d){N(u,t,d),N(u,n,d),w(n,r),w(r,i),w(r,l),w(r,o),e[5](o),w(r,c),w(r,a),e[6](r),s||(f=Z(Gs,"selectionchange",e[3]),s=!0)},p(u,[d]){d&1&&Bn(n,"visibility",u[0]?"visible":"hidden")},i:b,o:b,d(u){u&&(H(t),H(n)),e[5](null),e[6](null),s=!1,f()}}}function zs(e,t,n){const r=Zt();let i=!1,l,o;function c(){const d=document.getSelection();if(d.focusNode.parentElement.localName==="a"){r("saveurl",{});return}else if(i)n(0,i=!i),n(2,o.value="",o);else{const{startOffset:p,endOffset:g}=d.getRangeAt(0);n(0,i=p!==g)}}function a(d){d.preventDefault();const p=o.value;n(2,o.value="",o),n(0,i=!1),r("saveurl",{href:p})}function s(){if(!i)return;const p=document.getSelection().focusNode;l.contains(p)||(n(0,i=!1),n(2,o.value="",o),r("saveurl",null))}je(()=>{const d=document.querySelector("#md-link-editor");return d.addEventListener("submit",a),()=>{d.removeEventListener("submit",a)}}),hl(()=>{i&&o.focus()});function f(d){ct[d?"unshift":"push"](()=>{o=d,n(2,o)})}function u(d){ct[d?"unshift":"push"](()=>{l=d,n(1,l)})}return[i,l,o,s,c,f,u]}class Zs extends ae{constructor(t){super(),ce(this,t,zs,Ws,ie,{toggleEditor:4})}get toggleEditor(){return this.$$.ctx[4]}}function Ar(e,t,n){const r=e.slice();return r[9]=t[n],r}function Er(e,t){let n,r,i,l,o,c=t[9].name+"",a,s,f,u;function d(){return t[6](t[9])}return{key:e,first:null,c(){n=k("div"),r=k("img"),l=q(),o=k("small"),a=te(c),s=q(),$t(r.src,i=t[9].url_preview)||m(r,"src",i),m(r,"alt",""),m(r,"loading","lazy"),m(r,"class","svelte-157z34i"),m(o,"class","svelte-157z34i"),m(n,"class","img-container svelte-157z34i"),jt(n,"selected",t[1]===t[9]),this.first=n},m(p,g){N(p,n,g),w(n,r),w(n,l),w(n,o),w(o,a),w(n,s),f||(u=Z(n,"click",d),f=!0)},p(p,g){t=p,g&1&&!$t(r.src,i=t[9].url_preview)&&m(r,"src",i),g&1&&c!==(c=t[9].name+"")&&_e(a,c),g&3&&jt(n,"selected",t[1]===t[9])},d(p){p&&H(n),f=!1,u()}}}function Ks(e){let t,n,r,i,l,o=[],c=new Map,a,s,f,u,d,p,g,h,v,A=Ee(e[0]);const E=T=>T[9].name;for(let T=0;T<A.length;T+=1){let j=Ar(e,A,T),D=E(j);c.set(D,o[T]=Er(D,j))}return{c(){t=k("dialog"),n=k("article"),r=k("header"),r.textContent="Select Image",i=q(),l=k("div");for(let T=0;T<o.length;T+=1)o[T].c();a=q(),s=k("footer"),f=k("button"),f.textContent="Cancel",u=q(),d=k("button"),p=te("Select"),m(l,"class","images svelte-157z34i"),m(f,"class","secondary svelte-157z34i"),d.disabled=g=!e[1],m(d,"class","svelte-157z34i"),m(s,"class","svelte-157z34i"),t.open=!0},m(T,j){N(T,t,j),w(t,n),w(n,r),w(n,i),w(n,l);for(let D=0;D<o.length;D+=1)o[D]&&o[D].m(l,null);w(n,a),w(n,s),w(s,f),w(s,u),w(s,d),w(d,p),h||(v=[Z(f,"click",Ue(e[4])),Z(d,"click",Ue(e[3])),Z(t,"click",e[4])],h=!0)},p(T,[j]){j&7&&(A=Ee(T[0]),o=Ft(o,j,E,1,T,A,c,l,Ur,Er,null,Ar)),j&2&&g!==(g=!T[1])&&(d.disabled=g)},i:b,o:b,d(T){T&&H(t);for(let j=0;j<o.length;j+=1)o[j].d();h=!1,ue(v)}}}function Xs(e,t,n){let r;W(e,Ve,d=>n(5,r=d));const i=Zt();let l=[],o;async function c(d){const p=await(r==null?void 0:r.getMediaFiles());n(0,l=p||[])}function a(d){n(1,o=d)}function s(){i("selectimg",{img:o})}function f(d){d.currentTarget===d.target&&i("selectimg",{})}je(()=>{const{body:d}=document;return d.classList.add("contain-scroll"),()=>{d.classList.remove("contain-scroll")}});const u=d=>a(d);return e.$$.update=()=>{e.$$.dirty&32&&c()},[l,o,a,s,f,r,u]}class Qs extends ae{constructor(t){super(),ce(this,t,Xs,Ks,ie,{})}}const{document:Js}=zt;function eu(e){let t,n;return t=new Ke({props:{msg:"Unable to load",details:e[47].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i[0]&16&&(l.details=r[47].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function tu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function nu(e){let t,n;return t=new Qt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Cr(e){let t,n;return t=new Qs({}),t.$on("selectimg",e[7]),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ru(e){let t,n,r,i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T;o=new Bs({}),o.$on("menutexttype",e[9]),o.$on("menuaction",e[10]);let j={};f=new Zs({props:j}),e[13](f),f.$on("saveurl",e[8]);let D={ctx:e,current:null,token:null,hasCatch:!0,pending:nu,then:tu,catch:eu,error:47,blocks:[,,,]};se(g=e[4],D);let R=e[5]&&Cr(e);return{c(){t=q(),n=k("label"),r=te(e[2]),i=q(),l=k("div"),J(o.$$.fragment),c=q(),a=k("div"),s=q(),J(f.$$.fragment),u=q(),d=k("input"),p=q(),D.block.c(),h=q(),R&&R.c(),v=Oe(),m(l,"id","md-editor"),m(l,"class","svelte-1rfhu7q"),m(d,"type","hidden"),m(d,"id",e[1]),m(d,"name",e[1]),d.required=e[3],m(d,"class","svelte-1rfhu7q"),m(n,"class","editorInput"),m(n,"for",e[1])},m(F,C){N(F,t,C),N(F,n,C),w(n,r),w(n,i),w(n,l),K(o,l,null),w(l,c),w(l,a),w(l,s),K(f,l,null),w(n,u),w(n,d),ve(d,e[0]),N(F,p,C),D.block.m(F,D.anchor=C),D.mount=()=>h.parentNode,D.anchor=h,N(F,h,C),R&&R.m(F,C),N(F,v,C),A=!0,E||(T=[Z(Js,"selectionchange",e[11]),ul(e[12].call(null,a)),Z(d,"input",e[14])],E=!0)},p(F,C){e=F,(!A||C[0]&4)&&_e(r,e[2]);const P={};f.$set(P),(!A||C[0]&2)&&m(d,"id",e[1]),(!A||C[0]&2)&&m(d,"name",e[1]),(!A||C[0]&8)&&(d.required=e[3]),C[0]&1&&ve(d,e[0]),(!A||C[0]&2)&&m(n,"for",e[1]),D.ctx=e,C[0]&16&&g!==(g=e[4])&&se(g,D)||Pe(D,e,C),e[5]?R?(R.p(e,C),C[0]&32&&I(R,1)):(R=Cr(e),R.c(),I(R,1),R.m(v.parentNode,v)):R&&(ye(),V(R,1,1,()=>{R=null}),ke())},i(F){A||(I(o.$$.fragment,F),I(f.$$.fragment,F),I(D.block),I(R),A=!0)},o(F){V(o.$$.fragment,F),V(f.$$.fragment,F);for(let C=0;C<3;C+=1){const P=D.blocks[C];V(P)}V(R),A=!1},d(F){F&&(H(t),H(n),H(p),H(h),H(v)),X(o),e[13](null),X(f),D.block.d(F),D.token=null,D=null,R&&R.d(F),E=!1,ue(T)}}}function iu(e,t,n){let r,i,l,o;W(e,Ve,U=>n(38,r=U)),W(e,Fe,U=>n(39,i=U)),W(e,we,U=>n(40,l=U)),W(e,$e,U=>n(41,o=U));let{name:c}=t,{label:a}=t,{value:s=""}=t,{required:f=!0}=t,u,d,p,g,h,v,A,E,T,j,D,R,F,C,P,M,S,B,z,O,y,_=!1,x,L,$,G;async function Q(){const U=await Xe(()=>import("./index.es.js").then(en=>en.a5),[],import.meta.url),ee=await Xe(()=>import("./index.es2.js"),[],import.meta.url),re=await Xe(()=>import("./index.es3.js"),[],import.meta.url),me=await Xe(()=>import("./index.es4.js"),[],import.meta.url),nt=await Xe(()=>import("./index.es5.js"),[],import.meta.url);u=U.Editor,d=U.rootCtx,p=U.defaultValueCtx,g=U.commandsCtx,h=ee.listener,v=ee.listenerCtx,A=re.commonmark,E=re.turnIntoTextCommand,T=re.wrapInHeadingCommand,j=re.toggleStrongCommand,D=re.toggleEmphasisCommand,R=re.wrapInBulletListCommand,F=re.wrapInOrderedListCommand,C=re.wrapInBlockquoteCommand,P=re.insertHrCommand,M=re.toggleLinkCommand,S=re.insertImageCommand,B=me.nord,z=nt.getHTML,O=nt.replaceAll}function ne(U){const ee={...l};U?$&&(ee[c]=z()($.ctx)):ee[c]=o==null?void 0:o.fields.find(re=>re.name===c).label,he(we,l=ee,l)}function le(){if(!x)return;const U=document.getSelection();U.removeAllRanges();const ee=document.createRange(),{startOffset:re,endOffset:me}=x.range;ee.setStart(x.node,re),ee.setEnd(x.node,me),U.addRange(ee)}function fe(U){n(5,_=!1),le();const{img:ee}=U.detail;ee&&$.action(re=>{const me=re.get(g),nt={alt:ee.name,src:ee.url_preview};me.call(S.key,nt)})}function Ae(U){if(le(),!U.detail)return;const{href:ee}=U.detail,re=document.getSelection(),{textContent:me}=re.focusNode,{startOffset:nt,endOffset:en}=re.getRangeAt(0),nl=me.substring(nt,en);$.action(rl=>{const il=rl.get(g),ll={title:nl,href:ee};il.call(M.key,ll)})}function qe(U){const ee=U.detail;$.action(re=>{const me=re.get(g);ee==="p"?me.call(E.key):me.call(T.key,ee)})}function He(U){const ee=U.detail;$.action(re=>{const me=re.get(g);switch(ee){case"bold":me.call(j.key);break;case"italic":me.call(D.key);break;case"listBulleted":me.call(R.key);break;case"listNumbered":me.call(F.key);break;case"quote":me.call(C.key);break;case"horizontalRule":me.call(P.key);break;case"link":L.toggleEditor();break;case"image":x&&n(5,_=!0);break}})}function Ne(){const U=document.getSelection(),ee=U.focusNode;G.contains(ee)&&(x={node:U.focusNode,range:U.getRangeAt(0)})}function De(U){$=U,G=document.querySelector(".milkdown .editor"),O(s)($.ctx),ne(s)}async function de(U){await Q(),u.make().config(ee=>{ee.set(d,U),ee.set(p,s),ee.get(v).markdownUpdated((re,me,nt)=>{n(0,s=me)})}).config(B).use(A).use(h).create().then(De)}async function xe(){if(i)try{const U=c==="body"?i.body:i.fields[c];n(4,y=r.replacePublicLinks(U)),n(0,s=await y),$&&O(s)($.ctx)}catch{}}je(()=>{xe()});function Re(U){ct[U?"unshift":"push"](()=>{L=U,n(6,L)})}function Ye(){s=this.value,n(0,s)}return e.$$set=U=>{"name"in U&&n(1,c=U.name),"label"in U&&n(2,a=U.label),"value"in U&&n(0,s=U.value),"required"in U&&n(3,f=U.required)},e.$$.update=()=>{e.$$.dirty[0]&1&&ne(s)},[s,c,a,f,y,_,L,fe,Ae,qe,He,Ne,de,Re,Ye]}class lu extends ae{constructor(t){super(),ce(this,t,iu,ru,ie,{name:1,label:2,value:0,required:3},null,[-1,-1])}}function ou(e){let t,n,r;return{c(){t=k("input"),m(t,"type","hidden"),m(t,"id",e[1]),m(t,"name",e[1])},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=Z(t,"input",e[3]),n=!0)},p(i,[l]){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&1&&ve(t,i[0])},i:b,o:b,d(i){i&&H(t),n=!1,r()}}}function cu(e,t,n){let r,i;W(e,Fe,u=>n(4,r=u)),W(e,we,u=>n(5,i=u));let{name:l}=t,{type:o="text"}=t,{value:c}=t;function a(){const u={...i};u[l]=c,he(we,i=u,i)}async function s(){if(r!=null&&r.fields[l])switch(o){case"datetime-local":case"date":case"time":n(0,c=Gt(o,new Date(r.fields[l])));break;default:n(0,c=r.fields[l]);break}else if(!c)switch(o){case"datetime-local":case"date":case"time":n(0,c=Gt(o,new Date));break;case"boolean":n(0,c="false");break}a()}je(()=>{s()});function f(){c=this.value,n(0,c)}return e.$$set=u=>{"name"in u&&n(1,l=u.name),"type"in u&&n(2,o=u.type),"value"in u&&n(0,c=u.value)},[c,l,o,f]}class au extends ae{constructor(t){super(),ce(this,t,cu,ou,ie,{name:1,type:2,value:0})}}function su(e){let t,n,r;return{c(){t=k("iframe"),m(t,"title","Preview"),m(t,"sandbox","allow-same-origin"),m(t,"srcdoc",e[1]),m(t,"class","svelte-1sw5k8j")},m(i,l){N(i,t,l),e[9](t),n||(r=Z(t,"load",e[2]),n=!0)},p(i,[l]){l&2&&m(t,"srcdoc",i[1])},i:b,o:b,d(i){i&&H(t),e[9](null),n=!1,r()}}}function uu(e,t,n){let r,i,l,o,c,a;W(e,we,g=>n(6,o=g)),W(e,$e,g=>n(7,c=g)),W(e,Ce,g=>n(8,a=g)),Te.extend(Vi);let s,f;function u(){d()}function d(g){if(f!=null&&f.contentDocument)for(const h in o){const v=c==null?void 0:c.fields.find(T=>T.name===h);let A=o[h];if(v.name==="date")switch(v==null?void 0:v.type){case"time":A=Te(o[h],"hh:mm").format(v.time_format);break;case"date":A=Te(o[h],"YYYY-MM-DD").format(v.date_format);break;default:A=Te(o[h],"YYYY-MM-DDThh:mm").format(v.datetime_format)}f.contentDocument.querySelectorAll(`[data-tag="${h}"]`).forEach(T=>{T.innerHTML!==A&&(T.innerHTML=A)})}}function p(g){ct[g?"unshift":"push"](()=>{f=g,n(0,f)})}return e.$$.update=()=>{e.$$.dirty&384&&n(5,r=(c==null?void 0:c.preview)||(a==null?void 0:a.previews.default)),e.$$.dirty&288&&n(4,i=ts(a,r)),e.$$.dirty&288&&(async()=>n(3,s=await ns(a,r)))(),e.$$.dirty&24&&n(1,l=rs(s,i)),e.$$.dirty&192&&d()},[f,l,u,s,i,r,o,c,a,p]}class fu extends ae{constructor(t){super(),ce(this,t,uu,su,ie,{})}}function Sr(e,t,n){var o;const r=e.slice();r[11]=t[n];const i=r[5][r[11].widget];r[12]=i;const l=(o=r[11])==null?void 0:o.default;return r[13]=l,r}function xr(e){let t=[],n=new Map,r,i,l=Ee(e[3].fields);const o=c=>c[11].name;for(let c=0;c<l.length;c+=1){let a=Sr(e,l,c),s=o(a);n.set(s,t[c]=Lr(s,a))}return{c(){for(let c=0;c<t.length;c+=1)t[c].c();r=Oe()},m(c,a){for(let s=0;s<t.length;s+=1)t[s]&&t[s].m(c,a);N(c,r,a),i=!0},p(c,a){a&40&&(l=Ee(c[3].fields),ye(),t=Ft(t,a,o,1,c,l,n,r.parentNode,Ln,Lr,r,Sr),ke())},i(c){if(!i){for(let a=0;a<l.length;a+=1)I(t[a]);i=!0}},o(c){for(let a=0;a<t.length;a+=1)V(t[a]);i=!1},d(c){c&&H(r);for(let a=0;a<t.length;a+=1)t[a].d(c)}}}function du(e){let t,n,r;const i=[e[11],{value:e[13]}];var l=e[12];function o(c,a){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return a!==void 0&&a&8&&(s=ot(s,at(i,[st(c[11]),{value:c[13]}]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(c,a){t&&K(t,c,a),N(c,n,a),r=!0},p(c,a){if(a&8&&l!==(l=c[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(c,a)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=a&8?at(i,[st(c[11]),{value:c[13]}]):{};t.$set(s)}},i(c){r||(t&&I(t.$$.fragment,c),r=!0)},o(c){t&&V(t.$$.fragment,c),r=!1},d(c){c&&H(n),t&&X(t,c)}}}function pu(e){let t,n,r;const i=[e[11],{value:e[13]},{multiline:!0}];var l=e[12];function o(c,a){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return a!==void 0&&a&8&&(s=ot(s,at(i,[st(c[11]),{value:c[13]},i[2]]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(c,a){t&&K(t,c,a),N(c,n,a),r=!0},p(c,a){if(a&8&&l!==(l=c[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(c,a)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=a&8?at(i,[st(c[11]),{value:c[13]},i[2]]):{};t.$set(s)}},i(c){r||(t&&I(t.$$.fragment,c),r=!0)},o(c){t&&V(t.$$.fragment,c),r=!1},d(c){c&&H(n),t&&X(t,c)}}}function hu(e){let t,n,r;const i=[e[11],{checked:e[13]}];var l=e[12];function o(c,a){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return a!==void 0&&a&8&&(s=ot(s,at(i,[st(c[11]),{checked:c[13]}]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(c,a){t&&K(t,c,a),N(c,n,a),r=!0},p(c,a){if(a&8&&l!==(l=c[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(c,a)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=a&8?at(i,[st(c[11]),{checked:c[13]}]):{};t.$set(s)}},i(c){r||(t&&I(t.$$.fragment,c),r=!0)},o(c){t&&V(t.$$.fragment,c),r=!1},d(c){c&&H(n),t&&X(t,c)}}}function Lr(e,t){let n,r,i,l,o;const c=[hu,pu,du],a=[];function s(f,u){return f[11].widget==="boolean"?0:f[11].widget==="text"?1:2}return r=s(t),i=a[r]=c[r](t),{key:e,first:null,c(){n=Oe(),i.c(),l=Oe(),this.first=n},m(f,u){N(f,n,u),a[r].m(f,u),N(f,l,u),o=!0},p(f,u){t=f;let d=r;r=s(t),r===d?a[r].p(t,u):(ye(),V(a[d],1,1,()=>{a[d]=null}),ke(),i=a[r],i?i.p(t,u):(i=a[r]=c[r](t),i.c()),I(i,1),i.m(l.parentNode,l))},i(f){o||(I(i),o=!0)},o(f){V(i),o=!1},d(f){f&&(H(n),H(l)),a[r].d(f)}}}function mu(e){let t,n;return t=new Ke({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function gu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function _u(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function wu(e){let t,n;return t=new Ke({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function bu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function vu(e){let t,n;return t=new Qt({props:{msg:"Saving"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function yu(e){let t,n;return t=new Ke({props:{msg:"'On save' event action failed",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&2&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ku(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Au(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Eu(e){let t,n,r,i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T,j,D,R,F,C,P,M;t=new hs({});let S=e[3]&&xr(e);v=new fu({});let B={ctx:e,current:null,token:null,hasCatch:!0,pending:_u,then:gu,catch:mu,error:10,blocks:[,,,]};se(E=e[0],B);let z={ctx:e,current:null,token:null,hasCatch:!0,pending:vu,then:bu,catch:wu,error:10,blocks:[,,,]};se(j=e[2],z);let O={ctx:e,current:null,token:null,hasCatch:!0,pending:Au,then:ku,catch:yu,error:10,blocks:[,,,]};return se(F=e[1],O),{c(){J(t.$$.fragment),n=q(),r=k("div"),i=k("section"),l=k("header"),l.textContent="Edit",o=q(),c=k("form"),S&&S.c(),a=q(),s=k("form"),f=q(),u=k("form"),d=q(),p=k("section"),g=k("header"),g.textContent="Preview",h=q(),J(v.$$.fragment),A=q(),B.block.c(),T=q(),z.block.c(),D=q(),R=Oe(),O.block.c(),m(l,"class","svelte-14qwct"),m(c,"id","entry-data"),m(c,"class","svelte-14qwct"),m(s,"id","md-link-editor"),m(s,"class","svelte-14qwct"),m(u,"id","ignore"),m(u,"class","svelte-14qwct"),m(i,"id","inputArea"),m(i,"class","svelte-14qwct"),m(g,"class","svelte-14qwct"),m(p,"id","previewArea"),m(p,"class","svelte-14qwct"),m(r,"class","page svelte-14qwct")},m(y,_){K(t,y,_),N(y,n,_),N(y,r,_),w(r,i),w(i,l),w(i,o),w(i,c),S&&S.m(c,null),w(i,a),w(i,s),w(i,f),w(i,u),w(r,d),w(r,p),w(p,g),w(p,h),K(v,p,null),N(y,A,_),B.block.m(y,B.anchor=_),B.mount=()=>T.parentNode,B.anchor=T,N(y,T,_),z.block.m(y,z.anchor=_),z.mount=()=>D.parentNode,z.anchor=D,N(y,D,_),N(y,R,_),O.block.m(y,O.anchor=_),O.mount=()=>R.parentNode,O.anchor=R,C=!0,P||(M=Z(c,"submit",Ue(e[6])),P=!0)},p(y,[_]){e=y,e[3]?S?(S.p(e,_),_&8&&I(S,1)):(S=xr(e),S.c(),I(S,1),S.m(c,null)):S&&(ye(),V(S,1,1,()=>{S=null}),ke()),B.ctx=e,_&1&&E!==(E=e[0])&&se(E,B)||Pe(B,e,_),z.ctx=e,_&4&&j!==(j=e[2])&&se(j,z)||Pe(z,e,_),O.ctx=e,_&2&&F!==(F=e[1])&&se(F,O)||Pe(O,e,_)},i(y){C||(I(t.$$.fragment,y),I(S),I(v.$$.fragment,y),I(B.block),I(z.block),I(O.block),C=!0)},o(y){V(t.$$.fragment,y),V(S),V(v.$$.fragment,y);for(let _=0;_<3;_+=1){const x=B.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=z.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=O.blocks[_];V(x)}C=!1},d(y){y&&(H(n),H(r),H(A),H(T),H(D),H(R)),X(t,y),S&&S.d(),X(v),B.block.d(y),B.token=null,B=null,z.block.d(y),z.token=null,z=null,O.block.d(y),O.token=null,O=null,P=!1,M()}}}function Cu(e,t,n){let r,i,l,o,c;W(e,Fe,p=>n(7,r=p)),W(e,In,p=>n(8,i=p)),W(e,$e,p=>n(3,o=p)),W(e,Ve,p=>n(9,c=p));const a=tt();W(e,a,p=>n(2,l=p)),Cn("submitted",a);let s,f;const u={string:_r,text:_r,datetime:As,boolean:_s,number:Ms,markdown:lu,hidden:au};async function d(p){const g=r?{...r}:{fields:{}},h=new FormData(p.target);for(const[A,E]of h.entries()){const T=o.fields.find(j=>j.name===A);try{n(0,s=qi(T,E,c)),g.fields[A]=await s}catch(j){console.error("Error parsing form entry.",j);return}}const v=ls(o,g);he(a,l=c.saveFile(o,v),l);try{he(Fe,r=await l,r),i!=null&&i.onSave&&(n(1,f=i.onSave(r)),await f)}catch(A){console.warn("Issue saving post.",A)}}return[s,f,l,o,a,u,d]}class Su extends ae{constructor(t){super(),ce(this,t,Cu,Eu,ie,{})}}async function xu(e,t){let n;try{n=await t.text()}catch(c){console.error("Error constructing doc",c);return}const[r,i]=$n(n),l=Xt.load(r);return{_id:t.webkitRelativePath,name:t.name,collection:e,date:l.date,raw:n,fields:l,body:i,handle:t.handle,directoryHandle:t.directoryHandle}}function Yi(e,t){const n=t.lastModifiedDate,r=`${e.public_folder}/${t.name}`;return{_id:t.webkitRelativePath,name:t.name,date:n,asset:t.type,url:r,url_preview:r,handle:t.handle,directoryHandle:t.directoryHandle}}let Pt,Ui,Bi,lt,Ge,xt;async function Lu(){if(lt=Ie(Ce).repo_folder,!lt){console.error("Missing 'repo_folder' config");return}return await Tu(),Pt.plugin(Ui),Pt.plugin(Bi),Ge=new Pt(`${lt}-local`,{adapter:"idb"}),[["name","collection"],["date","collection"],["asset"],["url"],["url_preview"]].map(t=>({index:{fields:t},ddoc:t.join("-")})).forEach(t=>Ou(t)),console.log("Using local CMS backend"),jn}async function Tu(){Pt=(await Xe(()=>import("./index.es6.js"),[],import.meta.url)).default,Ui=(await Xe(()=>import("./index.es7.js"),[],import.meta.url)).default,Bi=(await Xe(()=>import("./index-browser.es.js"),[],import.meta.url)).default}async function Mu(){return{title:"Local Backend Enabled",message:"Select the local project directory to continue.",button:"Select Project Directory",action:Fu}}async function Ou(e){try{const t=await Ge.createIndex(e);console.log("Create index",e,t)}catch(t){console.error("Create index error",t)}}async function Du(e){try{const t=await Ge.get(e._id);e._rev=t._rev}catch(t){console.warn("Existing doc error",t)}}async function Fu(){if(!lt)return;const e=[],t=Ie(Ce);t.collections.forEach(s=>{const d=`\\/?${s.folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`;e.push({name:s.name,regex:new RegExp(d,"i")})});const l=`\\/?${t.media_folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`,o=new RegExp(l,"i"),c=["node_modules"],a={recursive:!0,id:`snow-cms-${lt}`,skipDirectory:s=>s.name.startsWith(".")||c.includes(s.name)};try{const s=await $a(a),f=[],u=[];s.forEach(h=>{var E;if(!xt&&((E=h.directoryHandle)==null?void 0:E.name)===lt&&(xt=h.directoryHandle),o.test(h.webkitRelativePath)){f.push(Yi(t,h));return}const A=e.find(({name:T,regex:j})=>j.test(h.webkitRelativePath));A&&u.push(xu(A.name,h))});const d=await Promise.all(u);d.push(...f);const p=[];d.forEach(h=>p.push(Du(h))),await Promise.all(p);const g=await Ge.bulkDocs(d);Ve.set(jn)}catch(s){console.error("Open directory error",s)}}async function Hu(e){try{return(await Ge.find({selector:{collection:e,date:{$gte:null}},sort:[{date:"desc"}]})).docs}catch(t){throw console.error("Error finding docs",t),t}}async function Iu(e,t){const n=Ie(Ce).repo_folder;t._id||(t._id=[n,e.folder,t.name].join("/"));try{const r=`.${e.extension}`,i=`snow-cms-save-${n}-${e.folder.split(/[\/\\]/).at(-1)}`.substring(0,32),l={fileName:t.name,extensions:[r],id:i},o=new Blob([t.raw],{type:os(r)});if(t.handle)await _n(o,l,t.handle,!0);else{let a=await _n(o,l);t.handle=a}const c=await Ge.put(t);return console.log(c),t._rev=c.rev,t}catch(r){throw console.error("Save file error",r),r}}async function Nu(e){try{e.forEach(r=>r._deleted=!0);const t=await Ge.bulkDocs(e);console.log(t);const n=[];e.forEach(r=>{r.handle&&n.push(r.handle.remove())}),await Promise.all(n)}catch(t){throw console.error("Delete files error",t),t}}async function Ru(){try{return(await Ge.find({selector:{asset:{$gt:""}}})).docs}catch(e){return console.error("Error finding docs",e),null}}async function Pu(){try{const t=await Rn({mimeTypes:["image/*"],description:"Image Files"}),n="."+t.name.split(".").at(-1),r={fileName:t.name,extensions:[n],id:`snow-cms-upload-${lt}`},i=await _n(t,r);if(!xt){console.warn("File not saved to db: No root dir handle found.");return}const l=await xt.resolve(i);l.unshift(xt.name);const o={name:i.name,lastModifiedDate:new Date,type:t.type,webkitRelativePath:l.join("/"),handle:i},c=Yi(Ie(Ce),o),a=await Ge.put(c);console.log(a)}catch(e){console.error("Upload file error",e)}}async function Gi(e,t){const n=[];t.forEach(l=>{const o={};e==="public"?o.selector={url:l}:o.selector={url_preview:l};const c=Ge.find(o);n.push(c)});const r=await Promise.all(n),i=[];return r.forEach(l=>i.push(...l.docs)),i}async function $u(e){let t=e;try{const n=Ht(t);return n.length===0?e:((await Gi("public",n)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function ju(e){let t=e;try{const n=Ht(t);return n.length===0?e:((await Gi("preview",n)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}const jn={init:Lu,getLoginConfig:Mu,getFiles:Hu,saveFile:Iu,deleteFiles:Nu,getMediaFiles:Ru,uploadMediaFile:Pu,replacePublicLinks:$u,replacePreviewLinks:ju};function Jt(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}function Vn(e,t,n,r){if(typeof n!="function")throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(t)?t.reverse().reduce((i,l)=>Vn.bind(null,e,l,i,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((i,l)=>l.hook.bind(null,i,r),n)():n(r))}function Vu(e,t,n,r){const i=r;e.registry[n]||(e.registry[n]=[]),t==="before"&&(r=(l,o)=>Promise.resolve().then(i.bind(null,o)).then(l.bind(null,o))),t==="after"&&(r=(l,o)=>{let c;return Promise.resolve().then(l.bind(null,o)).then(a=>(c=a,i(c,o))).then(()=>c)}),t==="error"&&(r=(l,o)=>Promise.resolve().then(l.bind(null,o)).catch(c=>i(c,o))),e.registry[n].push({hook:r,orig:i})}function qu(e,t,n){if(!e.registry[t])return;const r=e.registry[t].map(i=>i.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}const Tr=Function.bind,Mr=Tr.bind(Tr);function Wi(e,t,n){const r=Mr(qu,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach(i=>{const l=n?[t,i,n]:[t,i];e[i]=e.api[i]=Mr(Vu,null).apply(null,l)})}function Yu(){const e=Symbol("Singular"),t={registry:{}},n=Vn.bind(null,t,e);return Wi(n,t,e),n}function Uu(){const e={registry:{}},t=Vn.bind(null,e);return Wi(t,e),t}const Bu={Singular:Yu,Collection:Uu};var Gu="0.0.0-development",Wu=`octokit-endpoint.js/${Gu} ${Jt()}`,zu={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Wu},mediaType:{format:""}};function Zu(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function Ku(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function zi(e,t){const n=Object.assign({},e);return Object.keys(t).forEach(r=>{Ku(t[r])?r in e?n[r]=zi(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function Or(e){for(const t in e)e[t]===void 0&&delete e[t];return e}function wn(e,t,n){var i;if(typeof t=="string"){let[l,o]=t.split(" ");n=Object.assign(o?{method:l,url:o}:{url:l},n)}else n=Object.assign({},t);n.headers=Zu(n.headers),Or(n),Or(n.headers);const r=zi(e||{},n);return n.url==="/graphql"&&(e&&((i=e.mediaType.previews)!=null&&i.length)&&(r.mediaType.previews=e.mediaType.previews.filter(l=>!r.mediaType.previews.includes(l)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(l=>l.replace(/-preview/,""))),r}function Xu(e,t){const n=/\?/.test(e)?"&":"?",r=Object.keys(t);return r.length===0?e:e+n+r.map(i=>i==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(t[i])}`).join("&")}var Qu=/\{[^}]+\}/g;function Ju(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function ef(e){const t=e.match(Qu);return t?t.map(Ju).reduce((n,r)=>n.concat(r),[]):[]}function Dr(e,t){const n={__proto__:null};for(const r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function Zi(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function bt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Et(e,t,n){return t=e==="+"||e==="#"?Zi(t):bt(t),n?bt(n)+"="+t:t}function ht(e){return e!=null}function on(e){return e===";"||e==="&"||e==="?"}function tf(e,t,n,r){var i=e[n],l=[];if(ht(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),l.push(Et(t,i,on(t)?n:""));else if(r==="*")Array.isArray(i)?i.filter(ht).forEach(function(o){l.push(Et(t,o,on(t)?n:""))}):Object.keys(i).forEach(function(o){ht(i[o])&&l.push(Et(t,i[o],o))});else{const o=[];Array.isArray(i)?i.filter(ht).forEach(function(c){o.push(Et(t,c))}):Object.keys(i).forEach(function(c){ht(i[c])&&(o.push(bt(c)),o.push(Et(t,i[c].toString())))}),on(t)?l.push(bt(n)+"="+o.join(",")):o.length!==0&&l.push(o.join(","))}else t===";"?ht(i)&&l.push(bt(n)):i===""&&(t==="&"||t==="?")?l.push(bt(n)+"="):i===""&&l.push("");return l}function nf(e){return{expand:rf.bind(null,e)}}function rf(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,l){if(i){let c="";const a=[];if(n.indexOf(i.charAt(0))!==-1&&(c=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(s){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);a.push(tf(t,c,f[1],f[2]||f[3]))}),c&&c!=="+"){var o=",";return c==="?"?o="&":c!=="#"&&(o=c),(a.length!==0?c:"")+a.join(o)}else return a.join(",")}else return Zi(l)}),e==="/"?e:e.replace(/\/$/,"")}function Ki(e){var f;let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),i,l=Dr(e,["method","baseUrl","url","headers","request","mediaType"]);const o=ef(n);n=nf(n).expand(l),/^http/.test(n)||(n=e.baseUrl+n);const c=Object.keys(e).filter(u=>o.includes(u)).concat("baseUrl"),a=Dr(l,c);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&(f=e.mediaType.previews)!=null&&f.length)){const u=r.accept.match(/[\w-]+(?=-preview)/g)||[];r.accept=u.concat(e.mediaType.previews).map(d=>{const p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=Xu(n,a):"data"in a?i=a.data:Object.keys(a).length&&(i=a),!r["content-type"]&&typeof i<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof i>"u"&&(i=""),Object.assign({method:t,url:n,headers:r},typeof i<"u"?{body:i}:null,e.request?{request:e.request}:null)}function lf(e,t,n){return Ki(wn(e,t,n))}function Xi(e,t){const n=wn(e,t),r=lf.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:Xi.bind(null,n),merge:wn.bind(null,n),parse:Ki})}var of=Xi(null,zu);class Ct extends Error{constructor(n,r,i){super(n);oe(this,"name");oe(this,"status");oe(this,"request");oe(this,"response");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=r,"response"in i&&(this.response=i.response);const l=Object.assign({},i.request);i.request.headers.authorization&&(l.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),l.url=l.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=l}}var cf="0.0.0-development";function af(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function sf(e){return e.arrayBuffer()}function Fr(e){var c,a,s,f;const t=e.request&&e.request.log?e.request.log:console,n=((c=e.request)==null?void 0:c.parseSuccessResponseBody)!==!1;(af(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let r={},i,l,{fetch:o}=globalThis;if((a=e.request)!=null&&a.fetch&&(o=e.request.fetch),!o)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");return o(e.url,{method:e.method,body:e.body,redirect:(s=e.request)==null?void 0:s.redirect,headers:Object.fromEntries(Object.entries(e.headers).map(([u,d])=>[u,String(d)])),signal:(f=e.request)==null?void 0:f.signal,...e.body&&{duplex:"half"}}).then(async u=>{l=u.url,i=u.status;for(const d of u.headers)r[d[0]]=d[1];if("deprecation"in r){const d=r.link&&r.link.match(/<([^>]+)>; rel="deprecation"/),p=d&&d.pop();t.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${r.sunset}${p?`. See ${p}`:""}`)}if(!(i===204||i===205)){if(e.method==="HEAD"){if(i<400)return;throw new Ct(u.statusText,i,{response:{url:l,status:i,headers:r,data:void 0},request:e})}if(i===304)throw new Ct("Not modified",i,{response:{url:l,status:i,headers:r,data:await cn(u)},request:e});if(i>=400){const d=await cn(u);throw new Ct(uf(d),i,{response:{url:l,status:i,headers:r,data:d},request:e})}return n?await cn(u):u.body}}).then(u=>({status:i,url:l,headers:r,data:u})).catch(u=>{if(u instanceof Ct)throw u;if(u.name==="AbortError")throw u;let d=u.message;throw u.name==="TypeError"&&"cause"in u&&(u.cause instanceof Error?d=u.cause.message:typeof u.cause=="string"&&(d=u.cause)),new Ct(d,500,{request:e})})}async function cn(e){const t=e.headers.get("content-type");return/application\/json/.test(t)?e.json().catch(()=>e.text()).catch(()=>""):!t||/^text\/|charset=utf-8$/.test(t)?e.text():sf(e)}function uf(e){if(typeof e=="string")return e;let t;return"documentation_url"in e?t=` - ${e.documentation_url}`:t="","message"in e?Array.isArray(e.errors)?`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}${t}`:`${e.message}${t}`:`Unknown error: ${JSON.stringify(e)}`}function bn(e,t){const n=e.defaults(t);return Object.assign(function(i,l){const o=n.merge(i,l);if(!o.request||!o.request.hook)return Fr(n.parse(o));const c=(a,s)=>Fr(n.parse(n.merge(a,s)));return Object.assign(c,{endpoint:n,defaults:bn.bind(null,n)}),o.request.hook(c,o)},{endpoint:n,defaults:bn.bind(null,n)})}var vn=bn(of,{headers:{"user-agent":`octokit-request.js/${cf} ${Jt()}`}}),ff="0.0.0-development";function df(e){return`Request failed due to following response errors:
42
+ `);break;case"hidden":switch(v.type){case"datetime-local":case"date":case"time":T=new Date(A).getTime(),j=E.getTime();break;default:T=A,j=E;break}break;default:T=A,j=E;break}if(T!==j)return!1}return!0}return je(()=>{a=document.querySelector("#entry-data")}),e.$$.update=()=>{e.$$.dirty&33&&u()},[i,s,l,c,f,o]}class ms extends ae{constructor(t){super(),ce(this,t,hs,ds,ie,{})}}function gs(e){let t,n,r,i,l,o,c,a;return{c(){t=k("label"),n=ee(e[2]),r=q(),i=k("input"),l=q(),o=k("input"),m(i,"type","checkbox"),m(i,"role","switch"),m(i,"id",e[1]),m(i,"name",e[1]),m(i,"form","ignore"),i.required=e[3],m(o,"type","hidden"),m(o,"id",e[1]),m(o,"name",e[1]),o.value=e[0],o.required=e[3],m(t,"class","editorInput"),m(t,"for",e[1])},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),i.checked=e[0],w(t,l),w(t,o),c||(a=[Z(i,"change",e[5]),Z(i,"change",e[4])],c=!0)},p(s,[f]){f&4&&_e(n,s[2]),f&2&&m(i,"id",s[1]),f&2&&m(i,"name",s[1]),f&8&&(i.required=s[3]),f&1&&(i.checked=s[0]),f&2&&m(o,"id",s[1]),f&2&&m(o,"name",s[1]),f&1&&(o.value=s[0]),f&8&&(o.required=s[3]),f&2&&m(t,"for",s[1])},i:b,o:b,d(s){s&&H(t),c=!1,ue(a)}}}function _s(e,t,n){let r,i,l;W(e,Fe,p=>n(6,r=p)),W(e,we,p=>n(7,i=p)),W(e,$e,p=>n(8,l=p));let{name:o}=t,{label:c}=t,{checked:a=!1}=t,{required:s=!0}=t;function f(){const p={...i};a==null?p[o]=l==null?void 0:l.fields.find(g=>g.name===o).default:p[o]=a,he(we,i=p,i)}async function u(){r&&n(0,a=r.fields[o]),f()}je(()=>{u()});function d(){a=this.checked,n(0,a)}return e.$$set=p=>{"name"in p&&n(1,o=p.name),"label"in p&&n(2,c=p.label),"checked"in p&&n(0,a=p.checked),"required"in p&&n(3,s=p.required)},[a,o,c,s,f,d]}class ws extends ae{constructor(t){super(),ce(this,t,_s,gs,ie,{name:1,label:2,checked:0,required:3})}}function bs(e){let t,n,r;return{c(){t=k("input"),m(t,"type","datetime-local"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[8]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function vs(e){let t,n,r;return{c(){t=k("input"),m(t,"type","date"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function ys(e){let t,n,r;return{c(){t=k("input"),m(t,"type","time"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function ks(e){let t,n,r;function i(c,a){return c[3]==="time"?ys:c[3]==="date"?vs:bs}let l=i(e),o=l(e);return{c(){t=k("label"),n=ee(e[2]),r=q(),o.c(),m(t,"class","editorInput"),m(t,"for",e[1])},m(c,a){N(c,t,a),w(t,n),w(t,r),o.m(t,null)},p(c,[a]){a&4&&_e(n,c[2]),l===(l=i(c))&&o?o.p(c,a):(o.d(1),o=l(c),o&&(o.c(),o.m(t,null))),a&2&&m(t,"for",c[1])},i:b,o:b,d(c){c&&H(t),o.d()}}}function As(e,t,n){let r,i;W(e,Fe,h=>n(9,r=h)),W(e,we,h=>n(10,i=h));let{name:l}=t,{label:o}=t,{type:c="datetime-local"}=t,{value:a=Wt(c,new Date)}=t,{required:s=!0}=t;function f(){const h={...i};h[l]=a,he(we,i=h,i)}async function u(){if(r){const h=r.fields;n(0,a=Wt(c,new Date(h[l])))}f()}je(()=>{u()});function d(){a=this.value,n(0,a)}function p(){a=this.value,n(0,a)}function g(){a=this.value,n(0,a)}return e.$$set=h=>{"name"in h&&n(1,l=h.name),"label"in h&&n(2,o=h.label),"type"in h&&n(3,c=h.type),"value"in h&&n(0,a=h.value),"required"in h&&n(4,s=h.required)},[a,l,o,c,s,f,d,p,g]}class Es extends ae{constructor(t){super(),ce(this,t,As,ks,ie,{name:1,label:2,type:3,value:0,required:4})}}function Cs(e){let t,n,r;return{c(){t=k("textarea"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function Ss(e){let t,n,r;return{c(){t=k("input"),m(t,"type","text"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&t.value!==i[0]&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function xs(e){let t,n,r;function i(c,a){return c[3]?Cs:Ss}let l=i(e),o=l(e);return{c(){t=k("label"),n=ee(e[2]),r=q(),o.c(),m(t,"class","editorInput"),m(t,"for",e[1])},m(c,a){N(c,t,a),w(t,n),w(t,r),o.m(t,null)},p(c,[a]){a&4&&_e(n,c[2]),l===(l=i(c))&&o?o.p(c,a):(o.d(1),o=l(c),o&&(o.c(),o.m(t,null))),a&2&&m(t,"for",c[1])},i:b,o:b,d(c){c&&H(t),o.d()}}}function Ls(e,t,n){let r,i,l;W(e,Fe,h=>n(8,r=h)),W(e,we,h=>n(9,i=h)),W(e,$e,h=>n(10,l=h));let{name:o}=t,{label:c}=t,{multiline:a=!1}=t,{required:s=!0}=t,{value:f=""}=t;function u(){const h={...i};f?h[o]=f:h[o]=l==null?void 0:l.fields.find(v=>v.name===o).label,he(we,i=h,i)}async function d(){r&&n(0,f=o==="body"?r.body:r.fields[o]),u()}je(()=>{d()});function p(){f=this.value,n(0,f)}function g(){f=this.value,n(0,f)}return e.$$set=h=>{"name"in h&&n(1,o=h.name),"label"in h&&n(2,c=h.label),"multiline"in h&&n(3,a=h.multiline),"required"in h&&n(4,s=h.required),"value"in h&&n(0,f=h.value)},[f,o,c,a,s,u,p,g]}class wr extends ae{constructor(t){super(),ce(this,t,Ls,xs,ie,{name:1,label:2,multiline:3,required:4,value:0})}}function Ts(e){let t,n,r,i,l,o;return{c(){t=k("label"),n=ee(e[2]),r=q(),i=k("input"),m(i,"type","number"),m(i,"id",e[1]),m(i,"name",e[1]),m(i,"step",e[3]),m(i,"min",e[4]),m(i,"max",e[5]),i.required=e[6],m(t,"class","editorInput"),m(t,"for",e[1])},m(c,a){N(c,t,a),w(t,n),w(t,r),w(t,i),ve(i,e[0]),l||(o=[Z(i,"input",e[8]),Z(i,"input",e[7])],l=!0)},p(c,[a]){a&4&&_e(n,c[2]),a&2&&m(i,"id",c[1]),a&2&&m(i,"name",c[1]),a&8&&m(i,"step",c[3]),a&16&&m(i,"min",c[4]),a&32&&m(i,"max",c[5]),a&64&&(i.required=c[6]),a&1&&Ur(i.value)!==c[0]&&ve(i,c[0]),a&2&&m(t,"for",c[1])},i:b,o:b,d(c){c&&H(t),l=!1,ue(o)}}}function Ms(e,t,n){let r,i;W(e,Fe,h=>n(9,r=h)),W(e,we,h=>n(10,i=h));let{name:l}=t,{label:o}=t,{value:c}=t,{step:a}=t,{min:s}=t,{max:f}=t,{required:u=!0}=t;function d(){const h={...i};h[l]=c,he(we,i=h,i)}async function p(){r&&n(0,c=r.fields[l]),d()}je(()=>{p()});function g(){c=Ur(this.value),n(0,c)}return e.$$set=h=>{"name"in h&&n(1,l=h.name),"label"in h&&n(2,o=h.label),"value"in h&&n(0,c=h.value),"step"in h&&n(3,a=h.step),"min"in h&&n(4,s=h.min),"max"in h&&n(5,f=h.max),"required"in h&&n(6,u=h.required)},[c,l,o,a,s,f,u,d,g]}class Os extends ae{constructor(t){super(),ce(this,t,Ms,Ts,ie,{name:1,label:2,value:0,step:3,min:4,max:5,required:6})}}const Ds=function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),Fs=function(e,t){return new URL(e,t).href},br={},Xe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const l=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(a=>{if(a=Fs(a,r),a in br)return;br[a]=!0;const s=a.endsWith(".css"),f=s?'[rel="stylesheet"]':"";if(!!r)for(let p=l.length-1;p>=0;p--){const g=l[p];if(g.href===a&&(!s||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${f}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":Ds,s||(d.as="script",d.crossOrigin=""),d.href=a,c&&d.setAttribute("nonce",c),document.head.appendChild(d),s)return new Promise((p,g)=>{d.addEventListener("load",p),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}return i.then(()=>t()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})},Hs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-bold</title><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',Is='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-italic</title><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',Ns='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-bulleted</title><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>',Rs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-numbered</title><path d="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z" /></svg>',Ps='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>horizontal-rule</title><path d="M19,13H5V11H19V13Z" /></svg>',$s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-quote-close</title><path d="M14,17H17L19,13V7H13V13H16M6,17H9L11,13V7H5V13H8L6,17Z" /></svg>',js='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>link</title><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>',Vs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>image</title><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" /></svg>',{document:qs}=Zt;function vr(e,t,n){const r=e.slice();return r[9]=t[n],r}function yr(e,t,n){const r=e.slice();return r[12]=t[n],r}function kr(e){let t,n=e[12].title+"",r;return{c(){t=k("option"),r=ee(n),t.__value=e[12].value,ve(t,t.__value),m(t,"class","svelte-niyo7g")},m(i,l){N(i,t,l),w(t,r)},p:b,d(i){i&&H(t)}}}function Ar(e){let t,n,r=e[9].icon+"",i,l,o;return{c(){t=k("button"),n=new ze(!1),i=q(),n.a=i,m(t,"class","secondary svelte-niyo7g"),m(t,"data-action",e[9].name)},m(c,a){N(c,t,a),n.m(r,t),w(t,i),l||(o=Z(t,"click",Ue(e[3])),l=!0)},p:b,d(c){c&&H(t),l=!1,o()}}}function Ys(e){let t,n,r,i,l,o,c=Ee(e[1]),a=[];for(let u=0;u<c.length;u+=1)a[u]=kr(yr(e,c,u));let s=Ee(e[2]),f=[];for(let u=0;u<s.length;u+=1)f[u]=Ar(vr(e,s,u));return{c(){t=q(),n=k("div"),r=k("select");for(let u=0;u<a.length;u+=1)a[u].c();i=q();for(let u=0;u<f.length;u+=1)f[u].c();m(r,"name","text-type"),m(r,"form","ignore"),m(r,"class","svelte-niyo7g"),m(n,"class","editor-menu svelte-niyo7g")},m(u,d){N(u,t,d),N(u,n,d),w(n,r);for(let p=0;p<a.length;p+=1)a[p]&&a[p].m(r,null);e[6](r),w(n,i);for(let p=0;p<f.length;p+=1)f[p]&&f[p].m(n,null);l||(o=[Z(qs,"selectionchange",e[5]),Z(r,"change",e[4])],l=!0)},p(u,[d]){if(d&2){c=Ee(u[1]);let p;for(p=0;p<c.length;p+=1){const g=yr(u,c,p);a[p]?a[p].p(g,d):(a[p]=kr(g),a[p].c(),a[p].m(r,null))}for(;p<a.length;p+=1)a[p].d(1);a.length=c.length}if(d&12){s=Ee(u[2]);let p;for(p=0;p<s.length;p+=1){const g=vr(u,s,p);f[p]?f[p].p(g,d):(f[p]=Ar(g),f[p].c(),f[p].m(n,null))}for(;p<f.length;p+=1)f[p].d(1);f.length=s.length}},i:b,o:b,d(u){u&&(H(t),H(n)),un(a,u),e[6](null),un(f,u),l=!1,ue(o)}}}function Us(){const e=[];for(let t=0;t<=6;t++){let n;t===0?n={title:"Normal",value:"p"}:n={title:`Heading ${t}`,value:t},e.push(n)}return e}function Bs(e,t,n){const r=Kt();let i,l;const o=Us(),c=[{name:"bold",icon:Hs},{name:"italic",icon:Is},{name:"listBulleted",icon:Ns},{name:"listNumbered",icon:Rs},{name:"quote",icon:$s},{name:"horizontalRule",icon:Ps},{name:"link",icon:js},{name:"image",icon:Vs}];function a(d){const{action:p}=d.currentTarget.dataset;r("menuaction",p)}function s(d){const p=d.currentTarget.value;r("menutexttype",p)}function f(){var h;const p=(h=document.getSelection().focusNode)==null?void 0:h.parentElement;if(!l.contains(p))return;const{localName:g}=p;switch(g){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":n(0,i.value=parseInt(g.split("").at(-1)),i);break;default:n(0,i.value="p",i);break}}je(()=>{l=document.querySelector("#md-editor")});function u(d){ct[d?"unshift":"push"](()=>{i=d,n(0,i),n(1,o)})}return[i,o,c,a,s,f,u]}class Gs extends ae{constructor(t){super(),ce(this,t,Bs,Ys,ie,{})}}const{document:Ws}=Zt;function zs(e){let t,n,r,i,l,o,c,a,s,f;return{c(){t=q(),n=k("div"),r=k("div"),i=k("div"),i.textContent="Enter link:",l=q(),o=k("input"),c=q(),a=k("button"),a.textContent="Save",m(i,"class","svelte-1vifg91"),m(o,"form","md-link-editor"),m(o,"type","url"),m(o,"name","url"),m(o,"placeholder","https://example.com"),o.required=!0,m(o,"class","svelte-1vifg91"),m(a,"class","secondary svelte-1vifg91"),m(a,"form","md-link-editor"),m(a,"type","submit"),m(r,"id","link-editor"),m(r,"class","svelte-1vifg91"),m(n,"id","link-editor-container"),m(n,"class","svelte-1vifg91"),Gn(n,"visibility",e[0]?"visible":"hidden")},m(u,d){N(u,t,d),N(u,n,d),w(n,r),w(r,i),w(r,l),w(r,o),e[5](o),w(r,c),w(r,a),e[6](r),s||(f=Z(Ws,"selectionchange",e[3]),s=!0)},p(u,[d]){d&1&&Gn(n,"visibility",u[0]?"visible":"hidden")},i:b,o:b,d(u){u&&(H(t),H(n)),e[5](null),e[6](null),s=!1,f()}}}function Zs(e,t,n){const r=Kt();let i=!1,l,o;function c(){const d=document.getSelection();if(d.focusNode.parentElement.localName==="a"){r("saveurl",{});return}else if(i)n(0,i=!i),n(2,o.value="",o);else{const{startOffset:p,endOffset:g}=d.getRangeAt(0);n(0,i=p!==g)}}function a(d){d.preventDefault();const p=o.value;n(2,o.value="",o),n(0,i=!1),r("saveurl",{href:p})}function s(){if(!i)return;const p=document.getSelection().focusNode;l.contains(p)||(n(0,i=!1),n(2,o.value="",o),r("saveurl",null))}je(()=>{const d=document.querySelector("#md-link-editor");return d.addEventListener("submit",a),()=>{d.removeEventListener("submit",a)}}),ml(()=>{i&&o.focus()});function f(d){ct[d?"unshift":"push"](()=>{o=d,n(2,o)})}function u(d){ct[d?"unshift":"push"](()=>{l=d,n(1,l)})}return[i,l,o,s,c,f,u]}class Ks extends ae{constructor(t){super(),ce(this,t,Zs,zs,ie,{toggleEditor:4})}get toggleEditor(){return this.$$.ctx[4]}}function Er(e,t,n){const r=e.slice();return r[9]=t[n],r}function Cr(e,t){let n,r,i,l,o,c=t[9].name+"",a,s,f,u;function d(){return t[6](t[9])}return{key:e,first:null,c(){n=k("div"),r=k("img"),l=q(),o=k("small"),a=ee(c),s=q(),jt(r.src,i=t[9].url_preview)||m(r,"src",i),m(r,"alt",""),m(r,"loading","lazy"),m(r,"crossorigin","use-credentials"),m(r,"class","svelte-157z34i"),m(o,"class","svelte-157z34i"),m(n,"class","img-container svelte-157z34i"),Vt(n,"selected",t[1]===t[9]),this.first=n},m(p,g){N(p,n,g),w(n,r),w(n,l),w(n,o),w(o,a),w(n,s),f||(u=Z(n,"click",d),f=!0)},p(p,g){t=p,g&1&&!jt(r.src,i=t[9].url_preview)&&m(r,"src",i),g&1&&c!==(c=t[9].name+"")&&_e(a,c),g&3&&Vt(n,"selected",t[1]===t[9])},d(p){p&&H(n),f=!1,u()}}}function Xs(e){let t,n,r,i,l,o=[],c=new Map,a,s,f,u,d,p,g,h,v,A=Ee(e[0]);const E=T=>T[9].name;for(let T=0;T<A.length;T+=1){let j=Er(e,A,T),D=E(j);c.set(D,o[T]=Cr(D,j))}return{c(){t=k("dialog"),n=k("article"),r=k("header"),r.textContent="Select Image",i=q(),l=k("div");for(let T=0;T<o.length;T+=1)o[T].c();a=q(),s=k("footer"),f=k("button"),f.textContent="Cancel",u=q(),d=k("button"),p=ee("Select"),m(l,"class","images svelte-157z34i"),m(f,"class","secondary svelte-157z34i"),d.disabled=g=!e[1],m(d,"class","svelte-157z34i"),m(s,"class","svelte-157z34i"),t.open=!0},m(T,j){N(T,t,j),w(t,n),w(n,r),w(n,i),w(n,l);for(let D=0;D<o.length;D+=1)o[D]&&o[D].m(l,null);w(n,a),w(n,s),w(s,f),w(s,u),w(s,d),w(d,p),h||(v=[Z(f,"click",Ue(e[4])),Z(d,"click",Ue(e[3])),Z(t,"click",e[4])],h=!0)},p(T,[j]){j&7&&(A=Ee(T[0]),o=Ht(o,j,E,1,T,A,c,l,Br,Cr,null,Er)),j&2&&g!==(g=!T[1])&&(d.disabled=g)},i:b,o:b,d(T){T&&H(t);for(let j=0;j<o.length;j+=1)o[j].d();h=!1,ue(v)}}}function Qs(e,t,n){let r;W(e,Ve,d=>n(5,r=d));const i=Kt();let l=[],o;async function c(d){const p=await(r==null?void 0:r.getMediaFiles());n(0,l=p||[])}function a(d){n(1,o=d)}function s(){i("selectimg",{img:o})}function f(d){d.currentTarget===d.target&&i("selectimg",{})}je(()=>{const{body:d}=document;return d.classList.add("contain-scroll"),()=>{d.classList.remove("contain-scroll")}});const u=d=>a(d);return e.$$.update=()=>{e.$$.dirty&32&&c()},[l,o,a,s,f,r,u]}class Js extends ae{constructor(t){super(),ce(this,t,Qs,Xs,ie,{})}}const{document:eu}=Zt;function tu(e){let t,n;return t=new Ke({props:{msg:"Unable to load",details:e[48].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i[0]&16&&(l.details=r[48].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function nu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ru(e){let t,n;return t=new Jt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Sr(e){let t,n;return t=new Js({}),t.$on("selectimg",e[7]),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function iu(e){let t,n,r,i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T;o=new Gs({}),o.$on("menutexttype",e[9]),o.$on("menuaction",e[10]);let j={};f=new Ks({props:j}),e[13](f),f.$on("saveurl",e[8]);let D={ctx:e,current:null,token:null,hasCatch:!0,pending:ru,then:nu,catch:tu,error:48,blocks:[,,,]};se(g=e[4],D);let R=e[5]&&Sr(e);return{c(){t=q(),n=k("label"),r=ee(e[2]),i=q(),l=k("div"),J(o.$$.fragment),c=q(),a=k("div"),s=q(),J(f.$$.fragment),u=q(),d=k("input"),p=q(),D.block.c(),h=q(),R&&R.c(),v=Oe(),m(l,"id","md-editor"),m(l,"class","svelte-1rfhu7q"),m(d,"type","hidden"),m(d,"id",e[1]),m(d,"name",e[1]),d.required=e[3],m(d,"class","svelte-1rfhu7q"),m(n,"class","editorInput"),m(n,"for",e[1])},m(F,C){N(F,t,C),N(F,n,C),w(n,r),w(n,i),w(n,l),K(o,l,null),w(l,c),w(l,a),w(l,s),K(f,l,null),w(n,u),w(n,d),ve(d,e[0]),N(F,p,C),D.block.m(F,D.anchor=C),D.mount=()=>h.parentNode,D.anchor=h,N(F,h,C),R&&R.m(F,C),N(F,v,C),A=!0,E||(T=[Z(eu,"selectionchange",e[11]),fl(e[12].call(null,a)),Z(d,"input",e[14])],E=!0)},p(F,C){e=F,(!A||C[0]&4)&&_e(r,e[2]);const P={};f.$set(P),(!A||C[0]&2)&&m(d,"id",e[1]),(!A||C[0]&2)&&m(d,"name",e[1]),(!A||C[0]&8)&&(d.required=e[3]),C[0]&1&&ve(d,e[0]),(!A||C[0]&2)&&m(n,"for",e[1]),D.ctx=e,C[0]&16&&g!==(g=e[4])&&se(g,D)||Pe(D,e,C),e[5]?R?(R.p(e,C),C[0]&32&&I(R,1)):(R=Sr(e),R.c(),I(R,1),R.m(v.parentNode,v)):R&&(ye(),V(R,1,1,()=>{R=null}),ke())},i(F){A||(I(o.$$.fragment,F),I(f.$$.fragment,F),I(D.block),I(R),A=!0)},o(F){V(o.$$.fragment,F),V(f.$$.fragment,F);for(let C=0;C<3;C+=1){const P=D.blocks[C];V(P)}V(R),A=!1},d(F){F&&(H(t),H(n),H(p),H(h),H(v)),X(o),e[13](null),X(f),D.block.d(F),D.token=null,D=null,R&&R.d(F),E=!1,ue(T)}}}function lu(e,t,n){let r,i,l,o;W(e,Ve,U=>n(38,r=U)),W(e,Fe,U=>n(39,i=U)),W(e,we,U=>n(40,l=U)),W(e,$e,U=>n(41,o=U));let{name:c}=t,{label:a}=t,{value:s=""}=t,{required:f=!0}=t,u,d,p,g,h,v,A,E,T,j,D,R,F,C,P,M,S,B,z,O,y,_=!1,x,L,$,G;async function Q(){const U=await Xe(()=>import("./index.es.js").then(tn=>tn.a5),[],import.meta.url),te=await Xe(()=>import("./index.es2.js"),[],import.meta.url),re=await Xe(()=>import("./index.es3.js"),[],import.meta.url),me=await Xe(()=>import("./index.es4.js"),[],import.meta.url),nt=await Xe(()=>import("./index.es5.js"),[],import.meta.url);u=U.Editor,d=U.rootCtx,p=U.defaultValueCtx,g=U.commandsCtx,h=te.listener,v=te.listenerCtx,A=re.commonmark,E=re.turnIntoTextCommand,T=re.wrapInHeadingCommand,j=re.toggleStrongCommand,D=re.toggleEmphasisCommand,R=re.wrapInBulletListCommand,F=re.wrapInOrderedListCommand,C=re.wrapInBlockquoteCommand,P=re.insertHrCommand,M=re.toggleLinkCommand,S=re.insertImageCommand,B=me.nord,z=nt.getHTML,O=nt.replaceAll}function ne(U){const te={...l};U?$&&(te[c]=z()($.ctx).replaceAll("<img ",'<img crossorigin="use-credentials" ')):te[c]=o==null?void 0:o.fields.find(re=>re.name===c).label,he(we,l=te,l)}function le(){if(!x)return;const U=document.getSelection();U.removeAllRanges();const te=document.createRange(),{startOffset:re,endOffset:me}=x.range;te.setStart(x.node,re),te.setEnd(x.node,me),U.addRange(te)}function fe(U){n(5,_=!1),le();const{img:te}=U.detail;te&&$.action(re=>{const me=re.get(g),nt={alt:te.name,src:te.url_preview};me.call(S.key,nt)})}function Ae(U){if(le(),!U.detail)return;const{href:te}=U.detail,re=document.getSelection(),{textContent:me}=re.focusNode,{startOffset:nt,endOffset:tn}=re.getRangeAt(0),rl=me.substring(nt,tn);$.action(il=>{const ll=il.get(g),ol={title:rl,href:te};ll.call(M.key,ol)})}function qe(U){const te=U.detail;$.action(re=>{const me=re.get(g);te==="p"?me.call(E.key):me.call(T.key,te)})}function He(U){const te=U.detail;$.action(re=>{const me=re.get(g);switch(te){case"bold":me.call(j.key);break;case"italic":me.call(D.key);break;case"listBulleted":me.call(R.key);break;case"listNumbered":me.call(F.key);break;case"quote":me.call(C.key);break;case"horizontalRule":me.call(P.key);break;case"link":L.toggleEditor();break;case"image":x&&n(5,_=!0);break}})}function Ne(){const U=document.getSelection(),te=U.focusNode;G.contains(te)&&(x={node:U.focusNode,range:U.getRangeAt(0)})}function De(U){$=U,G=document.querySelector(".milkdown .editor"),O(s)($.ctx),ne(s)}async function de(U){await Q(),u.make().config(te=>{te.set(d,U),te.set(p,s),te.get(v).markdownUpdated((re,me,nt)=>{n(0,s=me)})}).config(B).use(A).use(h).create().then(De)}function xe(U){de(U)}async function Re(){if(i)try{const U=c==="body"?i.body:i.fields[c];n(4,y=r.replacePublicLinks(U)),n(0,s=await y),$&&O(s)($.ctx)}catch{}}je(()=>{Re()});function Ye(U){ct[U?"unshift":"push"](()=>{L=U,n(6,L)})}function Et(){s=this.value,n(0,s)}return e.$$set=U=>{"name"in U&&n(1,c=U.name),"label"in U&&n(2,a=U.label),"value"in U&&n(0,s=U.value),"required"in U&&n(3,f=U.required)},e.$$.update=()=>{e.$$.dirty[0]&1&&ne(s)},[s,c,a,f,y,_,L,fe,Ae,qe,He,Ne,xe,Ye,Et]}class ou extends ae{constructor(t){super(),ce(this,t,lu,iu,ie,{name:1,label:2,value:0,required:3},null,[-1,-1])}}function cu(e){let t,n,r;return{c(){t=k("input"),m(t,"type","hidden"),m(t,"id",e[1]),m(t,"name",e[1])},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=Z(t,"input",e[3]),n=!0)},p(i,[l]){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&1&&ve(t,i[0])},i:b,o:b,d(i){i&&H(t),n=!1,r()}}}function au(e,t,n){let r,i;W(e,Fe,u=>n(4,r=u)),W(e,we,u=>n(5,i=u));let{name:l}=t,{type:o="text"}=t,{value:c}=t;function a(){const u={...i};u[l]=c,he(we,i=u,i)}async function s(){if(r!=null&&r.fields[l])switch(o){case"datetime-local":case"date":case"time":n(0,c=Wt(o,new Date(r.fields[l])));break;default:n(0,c=r.fields[l]);break}else if(!c)switch(o){case"datetime-local":case"date":case"time":n(0,c=Wt(o,new Date));break;case"boolean":n(0,c="false");break}a()}je(()=>{s()});function f(){c=this.value,n(0,c)}return e.$$set=u=>{"name"in u&&n(1,l=u.name),"type"in u&&n(2,o=u.type),"value"in u&&n(0,c=u.value)},[c,l,o,f]}class su extends ae{constructor(t){super(),ce(this,t,au,cu,ie,{name:1,type:2,value:0})}}function uu(e){let t,n,r;return{c(){t=k("iframe"),m(t,"title","Preview"),m(t,"sandbox","allow-same-origin"),m(t,"srcdoc",e[1]),m(t,"class","svelte-1sw5k8j")},m(i,l){N(i,t,l),e[9](t),n||(r=Z(t,"load",e[2]),n=!0)},p(i,[l]){l&2&&m(t,"srcdoc",i[1])},i:b,o:b,d(i){i&&H(t),e[9](null),n=!1,r()}}}function fu(e,t,n){let r,i,l,o,c,a;W(e,we,g=>n(6,o=g)),W(e,$e,g=>n(7,c=g)),W(e,Ce,g=>n(8,a=g)),Te.extend(qi);let s,f;function u(){d()}function d(g){if(f!=null&&f.contentDocument)for(const h in o){const v=c==null?void 0:c.fields.find(T=>T.name===h);let A=o[h];if(v.name==="date")switch(v==null?void 0:v.type){case"time":A=Te(o[h],"hh:mm").format(v.time_format);break;case"date":A=Te(o[h],"YYYY-MM-DD").format(v.date_format);break;default:A=Te(o[h],"YYYY-MM-DDThh:mm").format(v.datetime_format)}f.contentDocument.querySelectorAll(`[data-tag="${h}"]`).forEach(T=>{T.innerHTML!==A&&(T.innerHTML=A)})}}function p(g){ct[g?"unshift":"push"](()=>{f=g,n(0,f)})}return e.$$.update=()=>{e.$$.dirty&384&&n(5,r=(c==null?void 0:c.preview)||(a==null?void 0:a.previews.default)),e.$$.dirty&288&&n(4,i=ns(a,r)),e.$$.dirty&288&&(async()=>n(3,s=await rs(a,r)))(),e.$$.dirty&24&&n(1,l=is(s,i)),e.$$.dirty&192&&d()},[f,l,u,s,i,r,o,c,a,p]}class du extends ae{constructor(t){super(),ce(this,t,fu,uu,ie,{})}}function xr(e,t,n){var o;const r=e.slice();r[11]=t[n];const i=r[5][r[11].widget];r[12]=i;const l=(o=r[11])==null?void 0:o.default;return r[13]=l,r}function Lr(e){let t=[],n=new Map,r,i,l=Ee(e[3].fields);const o=c=>c[11].name;for(let c=0;c<l.length;c+=1){let a=xr(e,l,c),s=o(a);n.set(s,t[c]=Tr(s,a))}return{c(){for(let c=0;c<t.length;c+=1)t[c].c();r=Oe()},m(c,a){for(let s=0;s<t.length;s+=1)t[s]&&t[s].m(c,a);N(c,r,a),i=!0},p(c,a){a&40&&(l=Ee(c[3].fields),ye(),t=Ht(t,a,o,1,c,l,n,r.parentNode,Tn,Tr,r,xr),ke())},i(c){if(!i){for(let a=0;a<l.length;a+=1)I(t[a]);i=!0}},o(c){for(let a=0;a<t.length;a+=1)V(t[a]);i=!1},d(c){c&&H(r);for(let a=0;a<t.length;a+=1)t[a].d(c)}}}function pu(e){let t,n,r;const i=[e[11],{value:e[13]}];var l=e[12];function o(c,a){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return a!==void 0&&a&8&&(s=ot(s,at(i,[st(c[11]),{value:c[13]}]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(c,a){t&&K(t,c,a),N(c,n,a),r=!0},p(c,a){if(a&8&&l!==(l=c[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(c,a)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=a&8?at(i,[st(c[11]),{value:c[13]}]):{};t.$set(s)}},i(c){r||(t&&I(t.$$.fragment,c),r=!0)},o(c){t&&V(t.$$.fragment,c),r=!1},d(c){c&&H(n),t&&X(t,c)}}}function hu(e){let t,n,r;const i=[e[11],{value:e[13]},{multiline:!0}];var l=e[12];function o(c,a){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return a!==void 0&&a&8&&(s=ot(s,at(i,[st(c[11]),{value:c[13]},i[2]]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(c,a){t&&K(t,c,a),N(c,n,a),r=!0},p(c,a){if(a&8&&l!==(l=c[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(c,a)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=a&8?at(i,[st(c[11]),{value:c[13]},i[2]]):{};t.$set(s)}},i(c){r||(t&&I(t.$$.fragment,c),r=!0)},o(c){t&&V(t.$$.fragment,c),r=!1},d(c){c&&H(n),t&&X(t,c)}}}function mu(e){let t,n,r;const i=[e[11],{checked:e[13]}];var l=e[12];function o(c,a){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return a!==void 0&&a&8&&(s=ot(s,at(i,[st(c[11]),{checked:c[13]}]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(c,a){t&&K(t,c,a),N(c,n,a),r=!0},p(c,a){if(a&8&&l!==(l=c[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(c,a)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=a&8?at(i,[st(c[11]),{checked:c[13]}]):{};t.$set(s)}},i(c){r||(t&&I(t.$$.fragment,c),r=!0)},o(c){t&&V(t.$$.fragment,c),r=!1},d(c){c&&H(n),t&&X(t,c)}}}function Tr(e,t){let n,r,i,l,o;const c=[mu,hu,pu],a=[];function s(f,u){return f[11].widget==="boolean"?0:f[11].widget==="text"?1:2}return r=s(t),i=a[r]=c[r](t),{key:e,first:null,c(){n=Oe(),i.c(),l=Oe(),this.first=n},m(f,u){N(f,n,u),a[r].m(f,u),N(f,l,u),o=!0},p(f,u){t=f;let d=r;r=s(t),r===d?a[r].p(t,u):(ye(),V(a[d],1,1,()=>{a[d]=null}),ke(),i=a[r],i?i.p(t,u):(i=a[r]=c[r](t),i.c()),I(i,1),i.m(l.parentNode,l))},i(f){o||(I(i),o=!0)},o(f){V(i),o=!1},d(f){f&&(H(n),H(l)),a[r].d(f)}}}function gu(e){let t,n;return t=new Ke({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function _u(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function wu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function bu(e){let t,n;return t=new Ke({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function vu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function yu(e){let t,n;return t=new Jt({props:{msg:"Saving"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ku(e){let t,n;return t=new Ke({props:{msg:"'On save' event action failed",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&2&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Au(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Eu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Cu(e){let t,n,r,i,l,o,c,a,s,f,u,d,p,g,h,v,A,E,T,j,D,R,F,C,P,M;t=new ms({});let S=e[3]&&Lr(e);v=new du({});let B={ctx:e,current:null,token:null,hasCatch:!0,pending:wu,then:_u,catch:gu,error:10,blocks:[,,,]};se(E=e[0],B);let z={ctx:e,current:null,token:null,hasCatch:!0,pending:yu,then:vu,catch:bu,error:10,blocks:[,,,]};se(j=e[2],z);let O={ctx:e,current:null,token:null,hasCatch:!0,pending:Eu,then:Au,catch:ku,error:10,blocks:[,,,]};return se(F=e[1],O),{c(){J(t.$$.fragment),n=q(),r=k("div"),i=k("section"),l=k("header"),l.textContent="Edit",o=q(),c=k("form"),S&&S.c(),a=q(),s=k("form"),f=q(),u=k("form"),d=q(),p=k("section"),g=k("header"),g.textContent="Preview",h=q(),J(v.$$.fragment),A=q(),B.block.c(),T=q(),z.block.c(),D=q(),R=Oe(),O.block.c(),m(l,"class","svelte-14qwct"),m(c,"id","entry-data"),m(c,"class","svelte-14qwct"),m(s,"id","md-link-editor"),m(s,"class","svelte-14qwct"),m(u,"id","ignore"),m(u,"class","svelte-14qwct"),m(i,"id","inputArea"),m(i,"class","svelte-14qwct"),m(g,"class","svelte-14qwct"),m(p,"id","previewArea"),m(p,"class","svelte-14qwct"),m(r,"class","page svelte-14qwct")},m(y,_){K(t,y,_),N(y,n,_),N(y,r,_),w(r,i),w(i,l),w(i,o),w(i,c),S&&S.m(c,null),w(i,a),w(i,s),w(i,f),w(i,u),w(r,d),w(r,p),w(p,g),w(p,h),K(v,p,null),N(y,A,_),B.block.m(y,B.anchor=_),B.mount=()=>T.parentNode,B.anchor=T,N(y,T,_),z.block.m(y,z.anchor=_),z.mount=()=>D.parentNode,z.anchor=D,N(y,D,_),N(y,R,_),O.block.m(y,O.anchor=_),O.mount=()=>R.parentNode,O.anchor=R,C=!0,P||(M=Z(c,"submit",Ue(e[6])),P=!0)},p(y,[_]){e=y,e[3]?S?(S.p(e,_),_&8&&I(S,1)):(S=Lr(e),S.c(),I(S,1),S.m(c,null)):S&&(ye(),V(S,1,1,()=>{S=null}),ke()),B.ctx=e,_&1&&E!==(E=e[0])&&se(E,B)||Pe(B,e,_),z.ctx=e,_&4&&j!==(j=e[2])&&se(j,z)||Pe(z,e,_),O.ctx=e,_&2&&F!==(F=e[1])&&se(F,O)||Pe(O,e,_)},i(y){C||(I(t.$$.fragment,y),I(S),I(v.$$.fragment,y),I(B.block),I(z.block),I(O.block),C=!0)},o(y){V(t.$$.fragment,y),V(S),V(v.$$.fragment,y);for(let _=0;_<3;_+=1){const x=B.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=z.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=O.blocks[_];V(x)}C=!1},d(y){y&&(H(n),H(r),H(A),H(T),H(D),H(R)),X(t,y),S&&S.d(),X(v),B.block.d(y),B.token=null,B=null,z.block.d(y),z.token=null,z=null,O.block.d(y),O.token=null,O=null,P=!1,M()}}}function Su(e,t,n){let r,i,l,o,c;W(e,Fe,p=>n(7,r=p)),W(e,Nn,p=>n(8,i=p)),W(e,$e,p=>n(3,o=p)),W(e,Ve,p=>n(9,c=p));const a=tt();W(e,a,p=>n(2,l=p)),Sn("submitted",a);let s,f;const u={string:wr,text:wr,datetime:Es,boolean:ws,number:Os,markdown:ou,hidden:su};async function d(p){const g=r?{...r}:{fields:{}},h=new FormData(p.target);for(const[A,E]of h.entries()){const T=o.fields.find(j=>j.name===A);try{n(0,s=Yi(T,E,c)),g.fields[A]=await s}catch(j){console.error("Error parsing form entry.",j);return}}const v=os(o,g);he(a,l=c.saveFile(o,v),l);try{he(Fe,r=await l,r),i!=null&&i.onSave&&(n(1,f=i.onSave(r)),await f)}catch(A){console.warn("Issue saving post.",A)}}return[s,f,l,o,a,u,d]}class xu extends ae{constructor(t){super(),ce(this,t,Su,Cu,ie,{})}}async function Lu(e,t){let n;try{n=await t.text()}catch(c){console.error("Error constructing doc",c);return}const[r,i]=jn(n),l=Qt.load(r);return{_id:t.webkitRelativePath,name:t.name,collection:e,date:l.date,raw:n,fields:l,body:i,handle:t.handle,directoryHandle:t.directoryHandle}}function Ui(e,t){const n=t.lastModifiedDate,r=`${e.public_folder}/${t.name}`;return{_id:t.webkitRelativePath,name:t.name,date:n,asset:t.type,url:r,url_preview:r,handle:t.handle,directoryHandle:t.directoryHandle}}let $t,Bi,Gi,lt,Ge,Lt;async function Tu(){if(lt=Ie(Ce).repo_folder,!lt){console.error("Missing 'repo_folder' config");return}return await Mu(),$t.plugin(Bi),$t.plugin(Gi),Ge=new $t(`${lt}-local`,{adapter:"idb"}),[["name","collection"],["date","collection"],["asset"],["url"],["url_preview"]].map(t=>({index:{fields:t},ddoc:t.join("-")})).forEach(t=>Du(t)),console.log("Using local CMS backend"),Vn}async function Mu(){$t=(await Xe(()=>import("./index.es6.js"),[],import.meta.url)).default,Bi=(await Xe(()=>import("./index.es7.js"),[],import.meta.url)).default,Gi=(await Xe(()=>import("./index-browser.es.js"),[],import.meta.url)).default}async function Ou(){return{title:"Local Backend Enabled",message:"Select the local project directory to continue.",button:"Select Project Directory",action:Hu}}async function Du(e){try{const t=await Ge.createIndex(e);console.log("Create index",e,t)}catch(t){console.error("Create index error",t)}}async function Fu(e){try{const t=await Ge.get(e._id);e._rev=t._rev}catch(t){console.warn("Existing doc error",t)}}async function Hu(){if(!lt)return;const e=[],t=Ie(Ce);t.collections.forEach(s=>{const d=`\\/?${s.folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`;e.push({name:s.name,regex:new RegExp(d,"i")})});const l=`\\/?${t.media_folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`,o=new RegExp(l,"i"),c=["node_modules"],a={recursive:!0,id:`snow-cms-${lt}`,skipDirectory:s=>s.name.startsWith(".")||c.includes(s.name)};try{const s=await ja(a),f=[],u=[];s.forEach(h=>{var E;if(!Lt&&((E=h.directoryHandle)==null?void 0:E.name)===lt&&(Lt=h.directoryHandle),o.test(h.webkitRelativePath)){f.push(Ui(t,h));return}const A=e.find(({name:T,regex:j})=>j.test(h.webkitRelativePath));A&&u.push(Lu(A.name,h))});const d=await Promise.all(u);d.push(...f);const p=[];d.forEach(h=>p.push(Fu(h))),await Promise.all(p);const g=await Ge.bulkDocs(d);Ve.set(Vn)}catch(s){console.error("Open directory error",s)}}async function Iu(e){try{return(await Ge.find({selector:{collection:e,date:{$gte:null}},sort:[{date:"desc"}]})).docs}catch(t){throw console.error("Error finding docs",t),t}}async function Nu(e,t){const n=Ie(Ce).repo_folder;t._id||(t._id=[n,e.folder,t.name].join("/"));try{const r=`.${e.extension}`,i=`snow-cms-save-${n}-${e.folder.split(/[\/\\]/).at(-1)}`.substring(0,32),l={fileName:t.name,extensions:[r],id:i},o=new Blob([t.raw],{type:cs(r)});if(t.handle)await wn(o,l,t.handle,!0);else{let a=await wn(o,l);t.handle=a}const c=await Ge.put(t);return console.log(c),t._rev=c.rev,t}catch(r){throw console.error("Save file error",r),r}}async function Ru(e){try{e.forEach(r=>r._deleted=!0);const t=await Ge.bulkDocs(e);console.log(t);const n=[];e.forEach(r=>{r.handle&&n.push(r.handle.remove())}),await Promise.all(n)}catch(t){throw console.error("Delete files error",t),t}}async function Pu(){try{return(await Ge.find({selector:{asset:{$gt:""}}})).docs}catch(e){return console.error("Error finding docs",e),null}}async function $u(){try{const t=await Pn({mimeTypes:["image/*"],description:"Image Files"}),n="."+t.name.split(".").at(-1),r={fileName:t.name,extensions:[n],id:`snow-cms-upload-${lt}`},i=await wn(t,r);if(!Lt){console.warn("File not saved to db: No root dir handle found.");return}const l=await Lt.resolve(i);l.unshift(Lt.name);const o={name:i.name,lastModifiedDate:new Date,type:t.type,webkitRelativePath:l.join("/"),handle:i},c=Ui(Ie(Ce),o),a=await Ge.put(c);console.log(a)}catch(e){console.error("Upload file error",e)}}async function Wi(e,t){const n=[];t.forEach(l=>{const o={};e==="public"?o.selector={url:l}:o.selector={url_preview:l};const c=Ge.find(o);n.push(c)});const r=await Promise.all(n),i=[];return r.forEach(l=>i.push(...l.docs)),i}async function ju(e){let t=e;try{const n=It(t);return n.length===0?e:((await Wi("public",n)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function Vu(e){let t=e;try{const n=It(t);return n.length===0?e:((await Wi("preview",n)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}const Vn={init:Tu,getLoginConfig:Ou,getFiles:Iu,saveFile:Nu,deleteFiles:Ru,getMediaFiles:Pu,uploadMediaFile:$u,replacePublicLinks:ju,replacePreviewLinks:Vu};function en(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}function qn(e,t,n,r){if(typeof n!="function")throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(t)?t.reverse().reduce((i,l)=>qn.bind(null,e,l,i,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((i,l)=>l.hook.bind(null,i,r),n)():n(r))}function qu(e,t,n,r){const i=r;e.registry[n]||(e.registry[n]=[]),t==="before"&&(r=(l,o)=>Promise.resolve().then(i.bind(null,o)).then(l.bind(null,o))),t==="after"&&(r=(l,o)=>{let c;return Promise.resolve().then(l.bind(null,o)).then(a=>(c=a,i(c,o))).then(()=>c)}),t==="error"&&(r=(l,o)=>Promise.resolve().then(l.bind(null,o)).catch(c=>i(c,o))),e.registry[n].push({hook:r,orig:i})}function Yu(e,t,n){if(!e.registry[t])return;const r=e.registry[t].map(i=>i.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}const Mr=Function.bind,Or=Mr.bind(Mr);function zi(e,t,n){const r=Or(Yu,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach(i=>{const l=n?[t,i,n]:[t,i];e[i]=e.api[i]=Or(qu,null).apply(null,l)})}function Uu(){const e=Symbol("Singular"),t={registry:{}},n=qn.bind(null,t,e);return zi(n,t,e),n}function Bu(){const e={registry:{}},t=qn.bind(null,e);return zi(t,e),t}const Gu={Singular:Uu,Collection:Bu};var Wu="0.0.0-development",zu=`octokit-endpoint.js/${Wu} ${en()}`,Zu={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":zu},mediaType:{format:""}};function Ku(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function Xu(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function Zi(e,t){const n=Object.assign({},e);return Object.keys(t).forEach(r=>{Xu(t[r])?r in e?n[r]=Zi(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function Dr(e){for(const t in e)e[t]===void 0&&delete e[t];return e}function bn(e,t,n){var i;if(typeof t=="string"){let[l,o]=t.split(" ");n=Object.assign(o?{method:l,url:o}:{url:l},n)}else n=Object.assign({},t);n.headers=Ku(n.headers),Dr(n),Dr(n.headers);const r=Zi(e||{},n);return n.url==="/graphql"&&(e&&((i=e.mediaType.previews)!=null&&i.length)&&(r.mediaType.previews=e.mediaType.previews.filter(l=>!r.mediaType.previews.includes(l)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(l=>l.replace(/-preview/,""))),r}function Qu(e,t){const n=/\?/.test(e)?"&":"?",r=Object.keys(t);return r.length===0?e:e+n+r.map(i=>i==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(t[i])}`).join("&")}var Ju=/\{[^}]+\}/g;function ef(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function tf(e){const t=e.match(Ju);return t?t.map(ef).reduce((n,r)=>n.concat(r),[]):[]}function Fr(e,t){const n={__proto__:null};for(const r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function Ki(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function bt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Ct(e,t,n){return t=e==="+"||e==="#"?Ki(t):bt(t),n?bt(n)+"="+t:t}function ht(e){return e!=null}function cn(e){return e===";"||e==="&"||e==="?"}function nf(e,t,n,r){var i=e[n],l=[];if(ht(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),l.push(Ct(t,i,cn(t)?n:""));else if(r==="*")Array.isArray(i)?i.filter(ht).forEach(function(o){l.push(Ct(t,o,cn(t)?n:""))}):Object.keys(i).forEach(function(o){ht(i[o])&&l.push(Ct(t,i[o],o))});else{const o=[];Array.isArray(i)?i.filter(ht).forEach(function(c){o.push(Ct(t,c))}):Object.keys(i).forEach(function(c){ht(i[c])&&(o.push(bt(c)),o.push(Ct(t,i[c].toString())))}),cn(t)?l.push(bt(n)+"="+o.join(",")):o.length!==0&&l.push(o.join(","))}else t===";"?ht(i)&&l.push(bt(n)):i===""&&(t==="&"||t==="?")?l.push(bt(n)+"="):i===""&&l.push("");return l}function rf(e){return{expand:lf.bind(null,e)}}function lf(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,l){if(i){let c="";const a=[];if(n.indexOf(i.charAt(0))!==-1&&(c=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(s){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);a.push(nf(t,c,f[1],f[2]||f[3]))}),c&&c!=="+"){var o=",";return c==="?"?o="&":c!=="#"&&(o=c),(a.length!==0?c:"")+a.join(o)}else return a.join(",")}else return Ki(l)}),e==="/"?e:e.replace(/\/$/,"")}function Xi(e){var f;let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),i,l=Fr(e,["method","baseUrl","url","headers","request","mediaType"]);const o=tf(n);n=rf(n).expand(l),/^http/.test(n)||(n=e.baseUrl+n);const c=Object.keys(e).filter(u=>o.includes(u)).concat("baseUrl"),a=Fr(l,c);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&(f=e.mediaType.previews)!=null&&f.length)){const u=r.accept.match(/[\w-]+(?=-preview)/g)||[];r.accept=u.concat(e.mediaType.previews).map(d=>{const p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=Qu(n,a):"data"in a?i=a.data:Object.keys(a).length&&(i=a),!r["content-type"]&&typeof i<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof i>"u"&&(i=""),Object.assign({method:t,url:n,headers:r},typeof i<"u"?{body:i}:null,e.request?{request:e.request}:null)}function of(e,t,n){return Xi(bn(e,t,n))}function Qi(e,t){const n=bn(e,t),r=of.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:Qi.bind(null,n),merge:bn.bind(null,n),parse:Xi})}var cf=Qi(null,Zu);class St extends Error{constructor(n,r,i){super(n);oe(this,"name");oe(this,"status");oe(this,"request");oe(this,"response");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=r,"response"in i&&(this.response=i.response);const l=Object.assign({},i.request);i.request.headers.authorization&&(l.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),l.url=l.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=l}}var af="0.0.0-development";function sf(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function uf(e){return e.arrayBuffer()}function Hr(e){var c,a,s,f;const t=e.request&&e.request.log?e.request.log:console,n=((c=e.request)==null?void 0:c.parseSuccessResponseBody)!==!1;(sf(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let r={},i,l,{fetch:o}=globalThis;if((a=e.request)!=null&&a.fetch&&(o=e.request.fetch),!o)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");return o(e.url,{method:e.method,body:e.body,redirect:(s=e.request)==null?void 0:s.redirect,headers:Object.fromEntries(Object.entries(e.headers).map(([u,d])=>[u,String(d)])),signal:(f=e.request)==null?void 0:f.signal,...e.body&&{duplex:"half"}}).then(async u=>{l=u.url,i=u.status;for(const d of u.headers)r[d[0]]=d[1];if("deprecation"in r){const d=r.link&&r.link.match(/<([^>]+)>; rel="deprecation"/),p=d&&d.pop();t.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${r.sunset}${p?`. See ${p}`:""}`)}if(!(i===204||i===205)){if(e.method==="HEAD"){if(i<400)return;throw new St(u.statusText,i,{response:{url:l,status:i,headers:r,data:void 0},request:e})}if(i===304)throw new St("Not modified",i,{response:{url:l,status:i,headers:r,data:await an(u)},request:e});if(i>=400){const d=await an(u);throw new St(ff(d),i,{response:{url:l,status:i,headers:r,data:d},request:e})}return n?await an(u):u.body}}).then(u=>({status:i,url:l,headers:r,data:u})).catch(u=>{if(u instanceof St)throw u;if(u.name==="AbortError")throw u;let d=u.message;throw u.name==="TypeError"&&"cause"in u&&(u.cause instanceof Error?d=u.cause.message:typeof u.cause=="string"&&(d=u.cause)),new St(d,500,{request:e})})}async function an(e){const t=e.headers.get("content-type");return/application\/json/.test(t)?e.json().catch(()=>e.text()).catch(()=>""):!t||/^text\/|charset=utf-8$/.test(t)?e.text():uf(e)}function ff(e){if(typeof e=="string")return e;let t;return"documentation_url"in e?t=` - ${e.documentation_url}`:t="","message"in e?Array.isArray(e.errors)?`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}${t}`:`${e.message}${t}`:`Unknown error: ${JSON.stringify(e)}`}function vn(e,t){const n=e.defaults(t);return Object.assign(function(i,l){const o=n.merge(i,l);if(!o.request||!o.request.hook)return Hr(n.parse(o));const c=(a,s)=>Hr(n.parse(n.merge(a,s)));return Object.assign(c,{endpoint:n,defaults:vn.bind(null,n)}),o.request.hook(c,o)},{endpoint:n,defaults:vn.bind(null,n)})}var yn=vn(cf,{headers:{"user-agent":`octokit-request.js/${af} ${en()}`}}),df="0.0.0-development";function pf(e){return`Request failed due to following response errors:
43
43
  `+e.errors.map(t=>` - ${t.message}`).join(`
44
- `)}var pf=class extends Error{constructor(t,n,r){super(df(r));oe(this,"name","GraphqlResponseError");oe(this,"errors");oe(this,"data");this.request=t,this.headers=n,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},hf=["method","baseUrl","url","headers","request","query","mediaType"],mf=["query","method","url"],Hr=/\/api\/v3\/?$/;function gf(e,t,n){if(n){if(typeof t=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(const o in n)if(mf.includes(o))return Promise.reject(new Error(`[@octokit/graphql] "${o}" cannot be used as variable name`))}const r=typeof t=="string"?Object.assign({query:t},n):t,i=Object.keys(r).reduce((o,c)=>hf.includes(c)?(o[c]=r[c],o):(o.variables||(o.variables={}),o.variables[c]=r[c],o),{}),l=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return Hr.test(l)&&(i.url=l.replace(Hr,"/api/graphql")),e(i).then(o=>{if(o.data.errors){const c={};for(const a of Object.keys(o.headers))c[a]=o.headers[a];throw new pf(i,c,o.data)}return o.data.data})}function qn(e,t){const n=e.defaults(t);return Object.assign((i,l)=>gf(n,i,l),{defaults:qn.bind(null,n),endpoint:n.endpoint})}qn(vn,{headers:{"user-agent":`octokit-graphql.js/${ff} ${Jt()}`},method:"POST",url:"/graphql"});function _f(e){return qn(e,{method:"POST",url:"/graphql"})}var wf=/^v1\./,bf=/^ghs_/,vf=/^ghu_/;async function yf(e){const t=e.split(/\./).length===3,n=wf.test(e)||bf.test(e),r=vf.test(e);return{type:"token",token:e,tokenType:t?"app":n?"installation":r?"user-to-server":"oauth"}}function kf(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Af(e,t,n,r){const i=t.endpoint.merge(n,r);return i.headers.authorization=kf(e),t(i)}var Ef=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(yf.bind(null,t),{hook:Af.bind(null,t)})};const Qi="6.1.2",Ir=()=>{},Cf=console.warn.bind(console),Sf=console.error.bind(console),Nr=`octokit-core.js/${Qi} ${Jt()}`;class yn{constructor(t={}){oe(this,"request");oe(this,"graphql");oe(this,"log");oe(this,"hook");oe(this,"auth");const n=new Bu.Collection,r={baseUrl:vn.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=t.userAgent?`${t.userAgent} ${Nr}`:Nr,t.baseUrl&&(r.baseUrl=t.baseUrl),t.previews&&(r.mediaType.previews=t.previews),t.timeZone&&(r.headers["time-zone"]=t.timeZone),this.request=vn.defaults(r),this.graphql=_f(this.request).defaults(r),this.log=Object.assign({debug:Ir,info:Ir,warn:Cf,error:Sf},t.log),this.hook=n,t.authStrategy){const{authStrategy:l,...o}=t,c=l(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},t.auth));n.wrap("request",c.hook),this.auth=c}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{const l=Ef(t.auth);n.wrap("request",l.hook),this.auth=l}const i=this.constructor;for(let l=0;l<i.plugins.length;++l)Object.assign(this,i.plugins[l](this,t))}static defaults(t){return class extends this{constructor(...r){const i=r[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugin(...t){var i;const n=this.plugins;return i=class extends this{},oe(i,"plugins",n.concat(t.filter(l=>!n.includes(l)))),i}}oe(yn,"VERSION",Qi),oe(yn,"plugins",[]);function Ji(e,t,n,r){return e.graphql(`
44
+ `)}var hf=class extends Error{constructor(t,n,r){super(pf(r));oe(this,"name","GraphqlResponseError");oe(this,"errors");oe(this,"data");this.request=t,this.headers=n,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},mf=["method","baseUrl","url","headers","request","query","mediaType"],gf=["query","method","url"],Ir=/\/api\/v3\/?$/;function _f(e,t,n){if(n){if(typeof t=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(const o in n)if(gf.includes(o))return Promise.reject(new Error(`[@octokit/graphql] "${o}" cannot be used as variable name`))}const r=typeof t=="string"?Object.assign({query:t},n):t,i=Object.keys(r).reduce((o,c)=>mf.includes(c)?(o[c]=r[c],o):(o.variables||(o.variables={}),o.variables[c]=r[c],o),{}),l=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return Ir.test(l)&&(i.url=l.replace(Ir,"/api/graphql")),e(i).then(o=>{if(o.data.errors){const c={};for(const a of Object.keys(o.headers))c[a]=o.headers[a];throw new hf(i,c,o.data)}return o.data.data})}function Yn(e,t){const n=e.defaults(t);return Object.assign((i,l)=>_f(n,i,l),{defaults:Yn.bind(null,n),endpoint:n.endpoint})}Yn(yn,{headers:{"user-agent":`octokit-graphql.js/${df} ${en()}`},method:"POST",url:"/graphql"});function wf(e){return Yn(e,{method:"POST",url:"/graphql"})}var bf=/^v1\./,vf=/^ghs_/,yf=/^ghu_/;async function kf(e){const t=e.split(/\./).length===3,n=bf.test(e)||vf.test(e),r=yf.test(e);return{type:"token",token:e,tokenType:t?"app":n?"installation":r?"user-to-server":"oauth"}}function Af(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Ef(e,t,n,r){const i=t.endpoint.merge(n,r);return i.headers.authorization=Af(e),t(i)}var Cf=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(kf.bind(null,t),{hook:Ef.bind(null,t)})};const Ji="6.1.2",Nr=()=>{},Sf=console.warn.bind(console),xf=console.error.bind(console),Rr=`octokit-core.js/${Ji} ${en()}`;class kn{constructor(t={}){oe(this,"request");oe(this,"graphql");oe(this,"log");oe(this,"hook");oe(this,"auth");const n=new Gu.Collection,r={baseUrl:yn.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=t.userAgent?`${t.userAgent} ${Rr}`:Rr,t.baseUrl&&(r.baseUrl=t.baseUrl),t.previews&&(r.mediaType.previews=t.previews),t.timeZone&&(r.headers["time-zone"]=t.timeZone),this.request=yn.defaults(r),this.graphql=wf(this.request).defaults(r),this.log=Object.assign({debug:Nr,info:Nr,warn:Sf,error:xf},t.log),this.hook=n,t.authStrategy){const{authStrategy:l,...o}=t,c=l(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},t.auth));n.wrap("request",c.hook),this.auth=c}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{const l=Cf(t.auth);n.wrap("request",l.hook),this.auth=l}const i=this.constructor;for(let l=0;l<i.plugins.length;++l)Object.assign(this,i.plugins[l](this,t))}static defaults(t){return class extends this{constructor(...r){const i=r[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugin(...t){var i;const n=this.plugins;return i=class extends this{},oe(i,"plugins",n.concat(t.filter(l=>!n.includes(l)))),i}}oe(kn,"VERSION",Ji),oe(kn,"plugins",[]);function el(e,t,n,r){return e.graphql(`
45
45
  query GetRepoPath($repoOwner: String!, $repoName: String!, $path: String!) {
46
46
  repository(owner: $repoOwner, name: $repoName) {
47
47
  object(expression: $path) {
@@ -62,7 +62,7 @@ ${n.body}`,n}function $n(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
62
62
  }
63
63
  }
64
64
  }
65
- `,{repoOwner:t,repoName:n,path:r})}function xf(e,t,n,r){return e.request("GET /repos/{owner}/{repo}/git/blobs/{file_sha}",{owner:t,repo:n,file_sha:r,headers:{"X-GitHub-Api-Version":"2022-11-28"}})}function Lf(e,t,n,r){return e.graphql(`
65
+ `,{repoOwner:t,repoName:n,path:r})}function Lf(e,t,n,r){return e.request("GET /repos/{owner}/{repo}/git/blobs/{file_sha}",{owner:t,repo:n,file_sha:r,headers:{"X-GitHub-Api-Version":"2022-11-28"}})}function Tf(e,t,n,r){return e.graphql(`
66
66
  query GetRefOid($owner: String!, $name: String!, $refName: String!) {
67
67
  repository(owner: $owner, name: $name) {
68
68
  id
@@ -73,7 +73,7 @@ ${n.body}`,n}function $n(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
73
73
  }
74
74
  }
75
75
  }
76
- `,{name:n,owner:t,refName:r})}function Tf(e,t,n,r,i,l){return e.graphql(`
76
+ `,{name:n,owner:t,refName:r})}function Mf(e,t,n,r,i,l){return e.graphql(`
77
77
  mutation CreateCommit($branchName: String!, $repoNameWithOwner: String!, $expectedHeadOid: GitObjectID!, $headline: String!, $changes: FileChanges!) {
78
78
  createCommitOnBranch(input: {
79
79
  branch: {repositoryNameWithOwner: $repoNameWithOwner, branchName: $branchName},
@@ -84,4 +84,4 @@ ${n.body}`,n}function $n(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
84
84
  clientMutationId
85
85
  }
86
86
  }
87
- `,{repoNameWithOwner:t,branchName:n,headline:r,expectedHeadOid:i,changes:l})}async function Mf(e,t,n){return(await fetch(`data:${e};${t},${n}`)).blob()}function Of(e,t=!1){return new Promise((n,r)=>{const i=new FileReader;i.onerror=l=>r(l),i.onload=()=>{const{result:l}=i,o=t?l.replace(/^data:.+\/.+;base64,/,""):l;n(o)},i.readAsDataURL(e)})}function Df(e){const t=e.replace("^.","");let n;switch(t){case"apng":case"avif":case"bmp":case"gif":case"jpeg":case"png":case"tiff":case"webp":n=`image/${t}`;break;case"ico":n="image/vnd.microsoft.icon";break;case"jpg":n="image/jpeg";break;case"svg":n="image/svg+xml";break;case"tif":n="image/tiff";break;default:n="application/octet-stream"}return n}function Ff(e,t,n){const{id:r,text:i}=n.object,[l,o]=$n(i),c=Xt.load(l);return{_id:r,name:n.name,collection:e,path:t,date:c.date,raw:i,fields:c,body:o}}async function Hf(e,t,n,r,i){const[l,o]=t.backend.repo.split("/"),{id:c,oid:a}=i.object,s=await xf(e,l,o,a),f=`${r}/${i.name}`;let u=f;if(s.status===200)try{const{content:p,encoding:g}=s.data,h=Df(i.extension),v=await Mf(h,g,p);u=URL.createObjectURL(v)}catch(p){console.error("Error creating preview url.",p)}return{_id:c,name:i.name,path:n,url:f,url_preview:u}}let kt=[];const el=`${window.location.origin}${window.location.pathname}`,If="SNOW_CMS:",kn={state:`${If}:GH_AUTH:STATE`};let ut;async function Nf(){const e=Ie(Ce).backend;if(!e.repo)throw new Error("Missing backend 'repo' config.");if(!e.app_name)throw new Error("Missing backend 'app_name' config.");const t=new URLSearchParams(window.location.search),n=t.get("setup_action"),r=t.get("code"),i=t.get("state"),l=localStorage.getItem(kn.state);if(n){tl();return}if(r&&l)if(i===l){console.log("Valid auth state"),history.replaceState({},"",el);const o=e.api_root??window.location.origin,c=e.auth_endpoint??"/api/github/oauth/token",a={code:r},s=await fetch(`${o}${c}`,{method:"post",headers:{"content-type":"application/json"},body:JSON.stringify(a)}),f=await s.json();if(!s.ok)throw new Error(f.error??"Token error");const{authentication:u}=f;ut=new yn({auth:u.token});const{data:{total_count:d,installations:p}}=await ut.request("GET /user/installations",{headers:{"X-GitHub-Api-Version":"2022-11-28"}}),g=e.app_name.replaceAll(" ","-").toLowerCase();if(d<=0){Rr(g);return}if(!p.find(v=>v.app_slug===g)){Rr(g);return}Ve.set(An)}else throw localStorage.removeItem(kn.state),new Error("Invalid auth state");return console.log("Using GitHub CMS backend"),An}function Rr(e){const t=new URL(`https://github.com/apps/${e}/installations/new`);window.location.assign(t.href)}async function Rf(){return{title:"GitHub Log in",button:"Log in with GitHub",action:tl}}async function tl(e){const t=new URL("https://github.com/login/oauth/authorize"),n=Math.random().toString(36).substring(2),r=t.searchParams;r.set("client_id",Ie(Ce).backend.client_id),r.set("redirect_uri",el),r.set("state",n),localStorage.setItem(kn.state,n),window.location.assign(t.href)}async function Pf(e){var t;try{const n=Ie(Ce),r=n.collections.find(u=>u.name===e),{repo:i,branch:l}=n.backend,[o,c]=i.split("/"),a=`${l}:${r.folder}`,{repository:s}=await Ji(ut,o,c,a);if(!s)throw new Error("Error getting repo path");const f=[];return(t=s.object)==null||t.entries.forEach(u=>{/^[\._]/.test(u.name)||f.push(Ff(e,r.folder,u))}),f.sort((u,d)=>d.date.getTime()-u.date.getTime()),f}catch(n){throw console.error("Error fetching files",n),n}}async function $f(e,t){try{const n=`Update ${t.name}`,r={additions:[{path:`${e.folder}/${t.name}`,contents:btoa(t.raw)}]};return await Yn(n,r),t}catch(n){throw console.error("Error saving file.",n),n}}async function jf(e){try{const t=`Delete ${e.length} file(s)`,n={deletions:e.map(r=>({path:`${r.path}/${r.name}`}))};await Yn(t,n),e.forEach(r=>{r.url_preview&&URL.revokeObjectURL(r.url_preview)}),kt=[...kt.filter(r=>e.every(i=>r.id!==i.id))]}catch(t){throw console.error("Error deleting files.",t),t}}async function Vf(){var e;try{const t=Ie(Ce),{media_folder:n,public_folder:r}=t,{repo:i,branch:l}=t.backend,[o,c]=i.split("/"),a=`${l}:${t.media_folder}`,{repository:s}=await Ji(ut,o,c,a);if(!s)throw new Error("Error getting repo path");const f=[];(e=s.object)==null||e.entries.forEach(d=>{if(/^[\._]/.test(d.name))return;const p=Hf(ut,t,n,r,d);f.push(p)});const u=await Promise.all(f);return kt.forEach(d=>{d.url_preview&&URL.revokeObjectURL(d.url_preview)}),kt=u,u}catch(t){throw console.error("Error getting media files",t),t}}async function qf(){try{const e=Ie(Ce).media_folder,n=await Rn({mimeTypes:["image/*"],description:"Image Files"}),r=await Of(n,!0),i=`Update ${n.name}`,l={additions:[{path:`${e}/${n.name}`,contents:r}]};await Yn(i,l)}catch(e){console.error("Upload file error",e)}}async function Yf(e){let t=e;try{const n=Ht(t);return n.length===0?e:(kt.filter(i=>i.url&&n.includes(i.url)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function Uf(e){let t=e;try{const n=Ht(t);return n.length===0?e:(kt.filter(i=>i.url_preview&&n.includes(i.url_preview)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}async function Yn(e,t){const n=Ie(Ce),{repo:r,branch:i}=n.backend,[l,o]=r.split("/"),c=i,{repository:a}=await Lf(ut,l,o,c);if(!a)throw new Error("Error getting oid");const{oid:s}=a.ref.target,f=await Tf(ut,r,i,e,s,t);if(!(f!=null&&f.createCommitOnBranch))throw new Error("Error creating commit")}const An={init:Nf,getLoginConfig:Rf,getFiles:Pf,saveFile:$f,deleteFiles:jf,getMediaFiles:Vf,uploadMediaFile:qf,replacePublicLinks:Yf,replacePreviewLinks:Uf};function Pr(e,t,n){const r=e.slice();r[12]=t[n];const i=r[12];return r[13]=i[0],r[14]=i[1],r}function an(e){const t=e.slice(),n=Object.entries(t[1].fields);return t[11]=n,t}function $r(e){let t=[],n=new Map,r,i=Ee(e[11]);const l=o=>o[12][0];for(let o=0;o<i.length;o+=1){let c=Pr(e,i,o),a=l(c);n.set(a,t[o]=jr(a,c))}return{c(){for(let o=0;o<t.length;o+=1)t[o].c();r=Oe()},m(o,c){for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(o,c);N(o,r,c)},p(o,c){c&2&&(i=Ee(o[11]),t=Ft(t,c,l,1,o,i,n,r.parentNode,Ur,jr,r,Pr))},d(o){o&&H(r);for(let c=0;c<t.length;c+=1)t[c].d(o)}}}function jr(e,t){let n,r,i,l;return{key:e,first:null,c(){n=k("input"),m(n,"type",r=t[14]),m(n,"name",i=t[13]),m(n,"placeholder",l=t[13]),m(n,"autocomplete","on"),n.required=!0,this.first=n},m(o,c){N(o,n,c)},p(o,c){t=o,c&2&&r!==(r=t[14])&&m(n,"type",r),c&2&&i!==(i=t[13])&&m(n,"name",i),c&2&&l!==(l=t[13])&&m(n,"placeholder",l)},d(o){o&&H(n)}}}function Bf(e){return{c:b,m:b,p:b,d:b}}function Gf(e){var i;let t,n=(((i=e[1])==null?void 0:i.button)??"Log in")+"",r;return{c(){t=k("button"),r=te(n),m(t,"form","login")},m(l,o){N(l,t,o),w(t,r)},p(l,o){var c;o&2&&n!==(n=(((c=l[1])==null?void 0:c.button)??"Log in")+"")&&_e(r,n)},d(l){l&&H(t)}}}function Wf(e){let t;return{c(){t=k("div"),m(t,"aria-busy","true")},m(n,r){N(n,t,r)},p:b,d(n){n&&H(t)}}}function zf(e){let t,n;return t=new Ke({props:{msg:"Error initializing backend.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[9].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Zf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Kf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Xf(e){let t,n;return t=new Ke({props:{msg:"Error logging in.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[9].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Qf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Jf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ed(e){var B,z,O;let t,n,r,i,l=(((B=e[1])==null?void 0:B.title)??"Log in")+"",o,c,a,s=(((z=e[1])==null?void 0:z.message)??"Log in to continue.")+"",f,u,d,p,g,h,v,A,E,T,j,D,R,F,C=((O=e[1])==null?void 0:O.fields)&&$r(an(e)),P={ctx:e,current:null,token:null,hasCatch:!1,pending:Wf,then:Gf,catch:Bf,value:10};se(h=e[2],P);let M={ctx:e,current:null,token:null,hasCatch:!0,pending:Kf,then:Zf,catch:zf,error:9,blocks:[,,,]};se(A=e[0],M);let S={ctx:e,current:null,token:null,hasCatch:!0,pending:Jf,then:Qf,catch:Xf,error:9,blocks:[,,,]};return se(j=e[2],S),{c(){t=k("dialog"),n=k("article"),r=k("header"),i=k("h3"),o=te(l),c=q(),a=k("p"),f=te(s),u=q(),d=k("form"),C&&C.c(),p=q(),g=k("footer"),P.block.c(),v=q(),M.block.c(),E=q(),T=Oe(),S.block.c(),m(d,"id","login"),t.open=!0},m(y,_){N(y,t,_),w(t,n),w(n,r),w(r,i),w(i,o),w(n,c),w(n,a),w(a,f),w(n,u),w(n,d),C&&C.m(d,null),w(n,p),w(n,g),P.block.m(g,P.anchor=null),P.mount=()=>g,P.anchor=null,N(y,v,_),M.block.m(y,M.anchor=_),M.mount=()=>E.parentNode,M.anchor=E,N(y,E,_),N(y,T,_),S.block.m(y,S.anchor=_),S.mount=()=>T.parentNode,S.anchor=T,D=!0,R||(F=Z(d,"submit",Ue(e[3])),R=!0)},p(y,[_]){var x,L,$;e=y,(!D||_&2)&&l!==(l=(((x=e[1])==null?void 0:x.title)??"Log in")+"")&&_e(o,l),(!D||_&2)&&s!==(s=(((L=e[1])==null?void 0:L.message)??"Log in to continue.")+"")&&_e(f,s),($=e[1])!=null&&$.fields?C?C.p(an(e),_):(C=$r(an(e)),C.c(),C.m(d,null)):C&&(C.d(1),C=null),P.ctx=e,_&4&&h!==(h=e[2])&&se(h,P)||Pe(P,e,_),M.ctx=e,_&1&&A!==(A=e[0])&&se(A,M)||Pe(M,e,_),S.ctx=e,_&4&&j!==(j=e[2])&&se(j,S)||Pe(S,e,_)},i(y){D||(I(M.block),I(S.block),D=!0)},o(y){for(let _=0;_<3;_+=1){const x=M.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=S.blocks[_];V(x)}D=!1},d(y){y&&(H(t),H(v),H(E),H(T)),C&&C.d(),P.block.d(),P.token=null,P=null,M.block.d(y),M.token=null,M=null,S.block.d(y),S.token=null,S=null,R=!1,F()}}}function td(e,t,n){let r,i;W(e,Ce,d=>n(4,i=d));let l,o,c,a,s=2;async function f(d){try{const p=new FormData(d.target);n(2,a=c.action(p))}catch(p){console.error("Error logging in.",p)}}async function u(){try{if(s<=0)return;if(!r)throw new Error("Missing backend name");switch(r){case"local":n(0,l=jn.init());break;case"github":n(0,l=An.init());break;case"custom":n(0,l=cs(Ce,Ve));break;default:throw new Error(`Unsupported backend: ${r}`)}o=await l,o.getLoginConfig&&n(1,c=await o.getLoginConfig())}catch(d){console.error("Error initializing backend.",d),s--,console.log("Re-trying init. Attempts left ",s),u()}}return e.$$.update=()=>{var d;e.$$.dirty&16&&(r=i!=null&&i.local_backend?"local":(d=i==null?void 0:i.backend)==null?void 0:d.name),e.$$.dirty&16&&i&&u()},[l,c,a,f,i]}class nd extends ae{constructor(t){super(),ce(this,t,td,ed,ie,{})}}const{window:rd}=zt;function Vr(e){let t,n;return t=new nd({}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function id(e){let t,n,r,i,l,o;var c=e[0];function a(f,u){return{}}c&&(t=Je(c,a()));let s=!e[1]&&Vr();return{c(){t&&J(t.$$.fragment),n=q(),s&&s.c(),r=Oe()},m(f,u){t&&K(t,f,u),N(f,n,u),s&&s.m(f,u),N(f,r,u),i=!0,l||(o=Z(rd,"hashchange",e[2]),l=!0)},p(f,[u]){if(u&1&&c!==(c=f[0])){if(t){ye();const d=t;V(d.$$.fragment,1,0,()=>{X(d,1)}),ke()}c?(t=Je(c,a()),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}f[1]?s&&(ye(),V(s,1,1,()=>{s=null}),ke()):s?u&2&&I(s,1):(s=Vr(),s.c(),I(s,1),s.m(r.parentNode,r))},i(f){i||(t&&I(t.$$.fragment,f),I(s),i=!0)},o(f){t&&V(t.$$.fragment,f),V(s),i=!1},d(f){f&&(H(n),H(r)),t&&X(t,f),s&&s.d(f),l=!1,o()}}}function ld(e,t,n){let r;W(e,Ve,c=>n(1,r=c));const i={"":Ia,editor:Su};let l;function o(){const c=window.location.hash.replace(/#\/?/,""),a=i[c];a?n(0,l=a):(console.warn(`Page not found: ${c}`),window.location.hash="")}return je(()=>{o()}),[l,r,o]}class od extends ae{constructor(t){super(),ce(this,t,ld,id,ie,{})}}new od({target:document.getElementById("app")});export{ad as a,Fi as c,Hi as g};
87
+ `,{repoNameWithOwner:t,branchName:n,headline:r,expectedHeadOid:i,changes:l})}async function Of(e,t,n){return(await fetch(`data:${e};${t},${n}`)).blob()}function Df(e,t=!1){return new Promise((n,r)=>{const i=new FileReader;i.onerror=l=>r(l),i.onload=()=>{const{result:l}=i,o=t?l.replace(/^data:.+\/.+;base64,/,""):l;n(o)},i.readAsDataURL(e)})}function Ff(e){const t=e.replace("^.","");let n;switch(t){case"apng":case"avif":case"bmp":case"gif":case"jpeg":case"png":case"tiff":case"webp":n=`image/${t}`;break;case"ico":n="image/vnd.microsoft.icon";break;case"jpg":n="image/jpeg";break;case"svg":n="image/svg+xml";break;case"tif":n="image/tiff";break;default:n="application/octet-stream"}return n}function Hf(e,t,n){const{id:r,text:i}=n.object,[l,o]=jn(i),c=Qt.load(l);return{_id:r,name:n.name,collection:e,path:t,date:c.date,raw:i,fields:c,body:o}}async function If(e,t,n,r,i){const[l,o]=t.backend.repo.split("/"),{id:c,oid:a}=i.object,s=await Lf(e,l,o,a),f=`${r}/${i.name}`;let u=f;if(s.status===200)try{const{content:p,encoding:g}=s.data,h=Ff(i.extension),v=await Of(h,g,p);u=URL.createObjectURL(v)}catch(p){console.error("Error creating preview url.",p)}return{_id:c,name:i.name,path:n,url:f,url_preview:u}}let kt=[];const tl=`${window.location.origin}${window.location.pathname}`,Nf="SNOW_CMS:",An={state:`${Nf}:GH_AUTH:STATE`};let ut;async function Rf(){const e=Ie(Ce).backend;if(!e.repo)throw new Error("Missing backend 'repo' config.");if(!e.app_name)throw new Error("Missing backend 'app_name' config.");const t=new URLSearchParams(window.location.search),n=t.get("setup_action"),r=t.get("code"),i=t.get("state"),l=localStorage.getItem(An.state);if(n){nl();return}if(r&&l)if(i===l){console.log("Valid auth state"),history.replaceState({},"",tl);const o=e.api_root??window.location.origin,c=e.auth_endpoint??"/api/github/oauth/token",s={method:"post",headers:{"content-type":"application/json"},body:JSON.stringify({code:r})},f=await fetch(`${o}${c}`,s),u=await f.json();if(!f.ok)throw new Error(u.error??"Token error");const{authentication:d}=u;ut=new kn({auth:d.token});const{data:{total_count:p,installations:g}}=await ut.request("GET /user/installations",{headers:{"X-GitHub-Api-Version":"2022-11-28"}}),h=e.app_name.replaceAll(" ","-").toLowerCase();if(p<=0){Pr(h);return}if(!g.find(A=>A.app_slug===h)){Pr(h);return}Ve.set(En)}else throw localStorage.removeItem(An.state),new Error("Invalid auth state");return console.log("Using GitHub CMS backend"),En}function Pr(e){const t=new URL(`https://github.com/apps/${e}/installations/new`);window.location.assign(t.href)}async function Pf(){return{title:"GitHub Log in",button:"Log in with GitHub",action:nl}}async function nl(e){const t=new URL("https://github.com/login/oauth/authorize"),n=Math.random().toString(36).substring(2),r=t.searchParams;r.set("client_id",Ie(Ce).backend.client_id),r.set("redirect_uri",tl),r.set("state",n),localStorage.setItem(An.state,n),window.location.assign(t.href)}async function $f(e){var t;try{const n=Ie(Ce),r=n.collections.find(u=>u.name===e),{repo:i,branch:l}=n.backend,[o,c]=i.split("/"),a=`${l}:${r.folder}`,{repository:s}=await el(ut,o,c,a);if(!s)throw new Error("Error getting repo path");const f=[];return(t=s.object)==null||t.entries.forEach(u=>{/^[\._]/.test(u.name)||f.push(Hf(e,r.folder,u))}),f.sort((u,d)=>d.date.getTime()-u.date.getTime()),f}catch(n){throw console.error("Error fetching files",n),n}}async function jf(e,t){try{const n=`Update ${t.name}`,r={additions:[{path:`${e.folder}/${t.name}`,contents:btoa(t.raw)}]};return await Un(n,r),t}catch(n){throw console.error("Error saving file.",n),n}}async function Vf(e){try{const t=`Delete ${e.length} file(s)`,n={deletions:e.map(r=>({path:`${r.path}/${r.name}`}))};await Un(t,n),e.forEach(r=>{r.url_preview&&URL.revokeObjectURL(r.url_preview)}),kt=[...kt.filter(r=>e.every(i=>r.id!==i.id))]}catch(t){throw console.error("Error deleting files.",t),t}}async function qf(){var e;try{const t=Ie(Ce),{media_folder:n,public_folder:r}=t,{repo:i,branch:l}=t.backend,[o,c]=i.split("/"),a=`${l}:${t.media_folder}`,{repository:s}=await el(ut,o,c,a);if(!s)throw new Error("Error getting repo path");const f=[];(e=s.object)==null||e.entries.forEach(d=>{if(/^[\._]/.test(d.name))return;const p=If(ut,t,n,r,d);f.push(p)});const u=await Promise.all(f);return kt.forEach(d=>{d.url_preview&&URL.revokeObjectURL(d.url_preview)}),kt=u,u}catch(t){throw console.error("Error getting media files",t),t}}async function Yf(){try{const e=Ie(Ce).media_folder,n=await Pn({mimeTypes:["image/*"],description:"Image Files"}),r=await Df(n,!0),i=`Update ${n.name}`,l={additions:[{path:`${e}/${n.name}`,contents:r}]};await Un(i,l)}catch(e){console.error("Upload file error",e)}}async function Uf(e){let t=e;try{const n=It(t);return n.length===0?e:(kt.filter(i=>i.url&&n.includes(i.url)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function Bf(e){let t=e;try{const n=It(t);return n.length===0?e:(kt.filter(i=>i.url_preview&&n.includes(i.url_preview)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}async function Un(e,t){const n=Ie(Ce),{repo:r,branch:i}=n.backend,[l,o]=r.split("/"),c=i,{repository:a}=await Tf(ut,l,o,c);if(!a)throw new Error("Error getting oid");const{oid:s}=a.ref.target,f=await Mf(ut,r,i,e,s,t);if(!(f!=null&&f.createCommitOnBranch))throw new Error("Error creating commit")}const En={init:Rf,getLoginConfig:Pf,getFiles:$f,saveFile:jf,deleteFiles:Vf,getMediaFiles:qf,uploadMediaFile:Yf,replacePublicLinks:Uf,replacePreviewLinks:Bf};function $r(e,t,n){const r=e.slice();r[12]=t[n];const i=r[12];return r[13]=i[0],r[14]=i[1],r}function sn(e){const t=e.slice(),n=Object.entries(t[1].fields);return t[11]=n,t}function jr(e){let t=[],n=new Map,r,i=Ee(e[11]);const l=o=>o[12][0];for(let o=0;o<i.length;o+=1){let c=$r(e,i,o),a=l(c);n.set(a,t[o]=Vr(a,c))}return{c(){for(let o=0;o<t.length;o+=1)t[o].c();r=Oe()},m(o,c){for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(o,c);N(o,r,c)},p(o,c){c&2&&(i=Ee(o[11]),t=Ht(t,c,l,1,o,i,n,r.parentNode,Br,Vr,r,$r))},d(o){o&&H(r);for(let c=0;c<t.length;c+=1)t[c].d(o)}}}function Vr(e,t){let n,r,i,l;return{key:e,first:null,c(){n=k("input"),m(n,"type",r=t[14]),m(n,"name",i=t[13]),m(n,"placeholder",l=t[13]),m(n,"autocomplete","on"),n.required=!0,this.first=n},m(o,c){N(o,n,c)},p(o,c){t=o,c&2&&r!==(r=t[14])&&m(n,"type",r),c&2&&i!==(i=t[13])&&m(n,"name",i),c&2&&l!==(l=t[13])&&m(n,"placeholder",l)},d(o){o&&H(n)}}}function Gf(e){return{c:b,m:b,p:b,d:b}}function Wf(e){var i;let t,n=(((i=e[1])==null?void 0:i.button)??"Log in")+"",r;return{c(){t=k("button"),r=ee(n),m(t,"form","login")},m(l,o){N(l,t,o),w(t,r)},p(l,o){var c;o&2&&n!==(n=(((c=l[1])==null?void 0:c.button)??"Log in")+"")&&_e(r,n)},d(l){l&&H(t)}}}function zf(e){let t;return{c(){t=k("div"),m(t,"aria-busy","true")},m(n,r){N(n,t,r)},p:b,d(n){n&&H(t)}}}function Zf(e){let t,n;return t=new Ke({props:{msg:"Error initializing backend.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[9].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Kf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Xf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Qf(e){let t,n;return t=new Ke({props:{msg:"Error logging in.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[9].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Jf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ed(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function td(e){var B,z,O;let t,n,r,i,l=(((B=e[1])==null?void 0:B.title)??"Log in")+"",o,c,a,s=(((z=e[1])==null?void 0:z.message)??"Log in to continue.")+"",f,u,d,p,g,h,v,A,E,T,j,D,R,F,C=((O=e[1])==null?void 0:O.fields)&&jr(sn(e)),P={ctx:e,current:null,token:null,hasCatch:!1,pending:zf,then:Wf,catch:Gf,value:10};se(h=e[2],P);let M={ctx:e,current:null,token:null,hasCatch:!0,pending:Xf,then:Kf,catch:Zf,error:9,blocks:[,,,]};se(A=e[0],M);let S={ctx:e,current:null,token:null,hasCatch:!0,pending:ed,then:Jf,catch:Qf,error:9,blocks:[,,,]};return se(j=e[2],S),{c(){t=k("dialog"),n=k("article"),r=k("header"),i=k("h3"),o=ee(l),c=q(),a=k("p"),f=ee(s),u=q(),d=k("form"),C&&C.c(),p=q(),g=k("footer"),P.block.c(),v=q(),M.block.c(),E=q(),T=Oe(),S.block.c(),m(d,"id","login"),t.open=!0},m(y,_){N(y,t,_),w(t,n),w(n,r),w(r,i),w(i,o),w(n,c),w(n,a),w(a,f),w(n,u),w(n,d),C&&C.m(d,null),w(n,p),w(n,g),P.block.m(g,P.anchor=null),P.mount=()=>g,P.anchor=null,N(y,v,_),M.block.m(y,M.anchor=_),M.mount=()=>E.parentNode,M.anchor=E,N(y,E,_),N(y,T,_),S.block.m(y,S.anchor=_),S.mount=()=>T.parentNode,S.anchor=T,D=!0,R||(F=Z(d,"submit",Ue(e[3])),R=!0)},p(y,[_]){var x,L,$;e=y,(!D||_&2)&&l!==(l=(((x=e[1])==null?void 0:x.title)??"Log in")+"")&&_e(o,l),(!D||_&2)&&s!==(s=(((L=e[1])==null?void 0:L.message)??"Log in to continue.")+"")&&_e(f,s),($=e[1])!=null&&$.fields?C?C.p(sn(e),_):(C=jr(sn(e)),C.c(),C.m(d,null)):C&&(C.d(1),C=null),P.ctx=e,_&4&&h!==(h=e[2])&&se(h,P)||Pe(P,e,_),M.ctx=e,_&1&&A!==(A=e[0])&&se(A,M)||Pe(M,e,_),S.ctx=e,_&4&&j!==(j=e[2])&&se(j,S)||Pe(S,e,_)},i(y){D||(I(M.block),I(S.block),D=!0)},o(y){for(let _=0;_<3;_+=1){const x=M.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=S.blocks[_];V(x)}D=!1},d(y){y&&(H(t),H(v),H(E),H(T)),C&&C.d(),P.block.d(),P.token=null,P=null,M.block.d(y),M.token=null,M=null,S.block.d(y),S.token=null,S=null,R=!1,F()}}}function nd(e,t,n){let r,i;W(e,Ce,d=>n(4,i=d));let l,o,c,a,s=2;async function f(d){try{const p=new FormData(d.target);n(2,a=c.action(p))}catch(p){console.error("Error logging in.",p)}}async function u(){try{if(s<=0)return;if(!r)throw new Error("Missing backend name");switch(r){case"local":n(0,l=Vn.init());break;case"github":n(0,l=En.init());break;case"custom":n(0,l=as(Ce,Ve));break;default:throw new Error(`Unsupported backend: ${r}`)}o=await l,o.getLoginConfig&&n(1,c=await o.getLoginConfig())}catch(d){console.error("Error initializing backend.",d),s--,console.log("Re-trying init. Attempts left ",s),u()}}return e.$$.update=()=>{var d;e.$$.dirty&16&&(r=i!=null&&i.local_backend?"local":(d=i==null?void 0:i.backend)==null?void 0:d.name),e.$$.dirty&16&&i&&u()},[l,c,a,f,i]}class rd extends ae{constructor(t){super(),ce(this,t,nd,td,ie,{})}}const{window:id}=Zt;function qr(e){let t,n;return t=new rd({}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ld(e){let t,n,r,i,l,o;var c=e[0];function a(f,u){return{}}c&&(t=Je(c,a()));let s=!e[1]&&qr();return{c(){t&&J(t.$$.fragment),n=q(),s&&s.c(),r=Oe()},m(f,u){t&&K(t,f,u),N(f,n,u),s&&s.m(f,u),N(f,r,u),i=!0,l||(o=Z(id,"hashchange",e[2]),l=!0)},p(f,[u]){if(u&1&&c!==(c=f[0])){if(t){ye();const d=t;V(d.$$.fragment,1,0,()=>{X(d,1)}),ke()}c?(t=Je(c,a()),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}f[1]?s&&(ye(),V(s,1,1,()=>{s=null}),ke()):s?u&2&&I(s,1):(s=qr(),s.c(),I(s,1),s.m(r.parentNode,r))},i(f){i||(t&&I(t.$$.fragment,f),I(s),i=!0)},o(f){t&&V(t.$$.fragment,f),V(s),i=!1},d(f){f&&(H(n),H(r)),t&&X(t,f),s&&s.d(f),l=!1,o()}}}function od(e,t,n){let r;W(e,Ve,c=>n(1,r=c));const i={"":Na,editor:xu};let l;function o(){const c=window.location.hash.replace(/#\/?/,""),a=i[c];a?n(0,l=a):(console.warn(`Page not found: ${c}`),window.location.hash="")}return je(()=>{o()}),[l,r,o]}class cd extends ae{constructor(t){super(),ce(this,t,od,ld,ie,{})}}new cd({target:document.getElementById("app")});export{sd as a,Hi as c,Ii as g};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-cms",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "A configurable CMS built with Svelte.",
5
5
  "keywords": [],
6
6
  "author": "Sammy-T",