snow-cms 1.4.3 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,49 +1,44 @@
1
- import{g as ks,c as xs,I as As,S as ou,s as su,P as Mn,a as In,p as kr,E as lu,b as Fr,e as Hr,D as cu,d as uu,f as Jn,h as fu,i as du,C as pu,j as ae,k as hu,m as mu,l as gu,r as go,n as vo,o as Es,q as yo,K as vu,t as yu,u as wo,F as ke,R as Ki,v as zi,w as wu,N as _u,x as bu,y as ku,z as Qn,A as _o,B as Gi,G as Yn,H as Zi,J as Cs,L as rn,T as Pr,M as xu,O as Au,Q as Eu,U as Cu,V as Su,W as Mu,X as Iu,Y as bo,Z as ko,_ as Br,$ as Ss,a0 as Ji,a1 as Ms,a2 as Lu,a3 as Nu,a4 as Tu,a5 as Ou,a6 as $u}from"./milkdown.js";const xi=!1;var Qi=Array.isArray,Du=Array.prototype.indexOf,kn=Array.prototype.includes,jr=Array.from,Is=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,Ru=Object.getOwnPropertyDescriptors,Ls=Object.prototype,Fu=Array.prototype,Xi=Object.getPrototypeOf,xo=Object.isExtensible;function Rn(e){return typeof e=="function"}const Dt=()=>{};function Hu(e){return typeof e?.then=="function"}function Ns(e){for(var t=0;t<e.length;t++)e[t]()}function Ts(){var e,t,n=new Promise((r,i)=>{e=r,t=i});return{promise:n,resolve:e,reject:t}}const _e=2,xr=4,qr=8,Os=1<<24,St=16,it=32,an=64,ea=128,Ke=512,ye=1024,Ne=2048,Mt=4096,Pe=8192,_t=16384,ta=32768,en=65536,Ao=1<<17,$s=1<<18,Ln=1<<19,Pu=1<<20,wt=1<<25,tn=32768,Ai=1<<21,na=1<<22,Rt=1<<23,wn=Symbol("$state"),Ds=Symbol("legacy props"),Bu=Symbol(""),mn=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Rs(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ju(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function qu(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Vu(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Uu(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Yu(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Wu(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ku(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function zu(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Gu(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Zu(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Ju=1,Qu=2,Fs=4,Xu=8,ef=16,tf=1,nf=4,rf=8,af=16,of=1,sf=2,ve=Symbol(),lf="http://www.w3.org/1999/xhtml";function cf(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Hs(e){return e===this.v}function Ps(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Bs(e){return!Ps(e,this.v)}let uf=!1;const ff=[];function Ei(e,t=!1,n=!1){return hr(e,new Map,"",ff,null,n)}function hr(e,t,n,r,i=null,a=!1){if(typeof e=="object"&&e!==null){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(Qi(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var l=0;l<e.length;l+=1){var c=e[l];l in e&&(s[l]=hr(c,t,n,r,null,a))}return s}if(Xi(e)===Ls){s={},t.set(e,s),i!==null&&t.set(i,s);for(var f in e)s[f]=hr(e[f],t,n,r,null,a);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON=="function"&&!a)return hr(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}let Ae=null;function xn(e){Ae=e}function Ar(e){return qs().get(e)}function Er(e,t){return qs().set(e,t),t}function se(e,t=!1,n){Ae={p:Ae,i:!1,c:null,e:null,s:e,x:null,l:null}}function le(e){var t=Ae,n=t.e;if(n!==null){t.e=null;for(var r of n)ul(r)}return e!==void 0&&(t.x=e),t.i=!0,Ae=t.p,e??{}}function js(){return!0}function qs(e){return Ae===null&&Rs(),Ae.c??=new Map(df(Ae)||void 0)}function df(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}let Kt=[];function Vs(){var e=Kt;Kt=[],Ns(e)}function ut(e){if(Kt.length===0&&!_n){var t=Kt;queueMicrotask(()=>{t===Kt&&Vs()})}Kt.push(e)}function pf(){for(;Kt.length>0;)Vs()}function Us(e){var t=te;if(t===null)return X.f|=Rt,e;if((t.f&ta)===0){if((t.f&ea)===0)throw e;t.b.error(e)}else An(e,t)}function An(e,t){for(;t!==null;){if((t.f&ea)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e}const hf=-7169;function he(e,t){e.f=e.f&hf|t}function ra(e){(e.f&Ke)!==0||e.deps===null?he(e,ye):he(e,Mt)}function Ys(e){if(e!==null)for(const t of e)(t.f&_e)===0||(t.f&tn)===0||(t.f^=tn,Ys(t.deps))}function Ws(e,t,n){(e.f&Ne)!==0?t.add(e):(e.f&Mt)!==0&&n.add(e),Ys(e.deps),he(e,ye)}const fr=new Set;let ne=null,Ci=null,Qe=null,He=[],Vr=null,Si=!1,_n=!1;class bt{committed=!1;current=new Map;previous=new Map;#t=new Set;#o=new Set;#e=0;#i=0;#a=null;#r=new Set;#n=new Set;skipped_effects=new Set;is_fork=!1;#s=!1;is_deferred(){return this.is_fork||this.#i>0}process(t){He=[],this.apply();var n=[],r=[];for(const i of t)this.#l(i,n,r);if(this.is_deferred()){this.#c(r),this.#c(n);for(const i of this.skipped_effects)Js(i)}else{for(const i of this.#t)i();this.#t.clear(),this.#e===0&&this.#u(),Ci=this,ne=null,Eo(r),Eo(n),Ci=null,this.#a?.resolve()}Qe=null}#l(t,n,r){t.f^=ye;for(var i=t.first,a=null;i!==null;){var o=i.f,s=(o&(it|an))!==0,l=s&&(o&ye)!==0,c=l||(o&Pe)!==0||this.skipped_effects.has(i);if(!c&&i.fn!==null){s?i.f^=ye:a!==null&&(o&(xr|qr|Os))!==0?a.b.defer_effect(i):(o&xr)!==0?n.push(i):tr(i)&&((o&St)!==0&&this.#n.add(i),Wn(i));var f=i.first;if(f!==null){i=f;continue}}var u=i.parent;for(i=i.next;i===null&&u!==null;)u===a&&(a=null),i=u.next,u=u.parent}}#c(t){for(var n=0;n<t.length;n+=1)Ws(t[n],this.#r,this.#n)}capture(t,n){n!==ve&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&Rt)===0&&(this.current.set(t,t.v),Qe?.set(t,t.v))}activate(){ne=this,this.apply()}deactivate(){ne===this&&(ne=null,Qe=null)}flush(){if(this.activate(),He.length>0){if(zs(),ne!==null&&ne!==this)return}else this.#e===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#o)t(this);this.#o.clear()}#u(){if(fr.size>1){this.previous.clear();var t=Qe,n=!0;for(const i of fr){if(i===this){n=!1;continue}const a=[];for(const[s,l]of this.current){if(i.current.has(s))if(n&&l!==i.current.get(s))i.current.set(s,l);else continue;a.push(s)}if(a.length===0)continue;const o=[...i.current.keys()].filter(s=>!this.current.has(s));if(o.length>0){var r=He;He=[];const s=new Set,l=new Map;for(const c of a)Gs(c,o,s,l);if(He.length>0){ne=i,i.apply();for(const c of He)i.#l(c,[],[]);i.deactivate()}He=r}}ne=null,Qe=t}this.committed=!0,fr.delete(this)}increment(t){this.#e+=1,t&&(this.#i+=1)}decrement(t){this.#e-=1,t&&(this.#i-=1),!this.#s&&(this.#s=!0,ut(()=>{this.#s=!1,this.is_deferred()?He.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#r)this.#n.delete(t),he(t,Ne),At(t);for(const t of this.#n)he(t,Mt),At(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#o.add(t)}settled(){return(this.#a??=Ts()).promise}static ensure(){if(ne===null){const t=ne=new bt;fr.add(ne),_n||ut(()=>{ne===t&&t.flush()})}return ne}apply(){}}function Ks(e){var t=_n;_n=!0;try{for(var n;;){if(pf(),He.length===0&&(ne?.flush(),He.length===0))return Vr=null,n;zs()}}finally{_n=t}}function zs(){Si=!0;var e=null;try{for(var t=0;He.length>0;){var n=bt.ensure();if(t++>1e3){var r,i;mf()}n.process(He),Ft.clear()}}finally{Si=!1,Vr=null}}function mf(){try{Yu()}catch(e){An(e,Vr)}}let vt=null;function Eo(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(_t|Pe))===0&&tr(r)&&(vt=new Set,Wn(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?ml(r):r.fn=null),vt?.size>0)){Ft.clear();for(const i of vt){if((i.f&(_t|Pe))!==0)continue;const a=[i];let o=i.parent;for(;o!==null;)vt.has(o)&&(vt.delete(o),a.push(o)),o=o.parent;for(let s=a.length-1;s>=0;s--){const l=a[s];(l.f&(_t|Pe))===0&&Wn(l)}}vt.clear()}}vt=null}}function Gs(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const i of e.reactions){const a=i.f;(a&_e)!==0?Gs(i,t,n,r):(a&(na|St))!==0&&(a&Ne)===0&&Zs(i,t,r)&&(he(i,Ne),At(i))}}function Zs(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const i of e.deps){if(kn.call(t,i))return!0;if((i.f&_e)!==0&&Zs(i,t,n))return n.set(i,!0),!0}return n.set(e,!1),!1}function At(e){for(var t=Vr=e;t.parent!==null;){t=t.parent;var n=t.f;if(Si&&t===te&&(n&St)!==0&&(n&$s)===0)return;if((n&(an|it))!==0){if((n&ye)===0)return;t.f^=ye}}He.push(t)}function Js(e){if(!((e.f&it)!==0&&(e.f&ye)!==0)){he(e,ye);for(var t=e.first;t!==null;)Js(t),t=t.next}}function gf(e){let t=0,n=Et(0),r;return()=>{aa()&&(y(n),Kr(()=>(t===0&&(r=Ut(()=>e(()=>Vn(n)))),t+=1,()=>{ut(()=>{t-=1,t===0&&(r?.(),r=void 0,Vn(n))})})))}}var vf=en|Ln|ea;function yf(e,t,n){new wf(e,t,n)}class wf{parent;is_pending=!1;#t;#o=null;#e;#i;#a;#r=null;#n=null;#s=null;#l=null;#c=null;#u=0;#d=0;#h=!1;#p=!1;#m=new Set;#g=new Set;#f=null;#b=gf(()=>(this.#f=Et(this.#u),()=>{this.#f=null}));constructor(t,n,r){this.#t=t,this.#e=n,this.#i=r,this.parent=te.b,this.is_pending=!!this.#e.pending,this.#a=er(()=>{te.b=this;{var i=this.#w();try{this.#r=We(()=>r(i))}catch(a){this.error(a)}this.#d>0?this.#y():this.is_pending=!1}return()=>{this.#c?.remove()}},vf)}#k(){try{this.#r=We(()=>this.#i(this.#t))}catch(t){this.error(t)}}#x(){const t=this.#e.pending;t&&(this.#n=We(()=>t(this.#t)),ut(()=>{var n=this.#w();this.#r=this.#v(()=>(bt.ensure(),We(()=>this.#i(n)))),this.#d>0?this.#y():(Gt(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#w(){var t=this.#t;return this.is_pending&&(this.#c=Ht(),this.#t.before(this.#c),t=this.#c),t}defer_effect(t){Ws(t,this.#m,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#e.pending}#v(t){var n=te,r=X,i=Ae;ht(this.#a),Ge(this.#a),xn(this.#a.ctx);try{return t()}catch(a){return Us(a),null}finally{ht(n),Ge(r),xn(i)}}#y(){const t=this.#e.pending;this.#r!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),yl(this.#r,this.#l)),this.#n===null&&(this.#n=We(()=>t(this.#t)))}#_(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#_(t);return}if(this.#d+=t,this.#d===0){this.is_pending=!1;for(const n of this.#m)he(n,Ne),At(n);for(const n of this.#g)he(n,Mt),At(n);this.#m.clear(),this.#g.clear(),this.#n&&Gt(this.#n,()=>{this.#n=null}),this.#l&&(this.#t.before(this.#l),this.#l=null)}}update_pending_count(t){this.#_(t),this.#u+=t,!(!this.#f||this.#h)&&(this.#h=!0,ut(()=>{this.#h=!1,this.#f&&kt(this.#f,this.#u)}))}get_effect_pending(){return this.#b(),y(this.#f)}error(t){var n=this.#e.onerror;let r=this.#e.failed;if(this.#p||!n&&!r)throw t;this.#r&&(Re(this.#r),this.#r=null),this.#n&&(Re(this.#n),this.#n=null),this.#s&&(Re(this.#s),this.#s=null);var i=!1,a=!1;const o=()=>{if(i){cf();return}i=!0,a&&Zu(),bt.ensure(),this.#u=0,this.#s!==null&&Gt(this.#s,()=>{this.#s=null}),this.is_pending=this.has_pending_snippet(),this.#r=this.#v(()=>(this.#p=!1,We(()=>this.#i(this.#t)))),this.#d>0?this.#y():this.is_pending=!1};ut(()=>{try{a=!0,n?.(t,o),a=!1}catch(s){An(s,this.#a&&this.#a.parent)}r&&(this.#s=this.#v(()=>{bt.ensure(),this.#p=!0;try{return We(()=>{r(this.#t,()=>t,()=>o)})}catch(s){return An(s,this.#a.parent),null}finally{this.#p=!1}}))})}}function _f(e,t,n,r){const i=Ur;var a=e.filter(p=>!p.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=ne,s=te,l=Qs(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(p=>p.promise)):null;function f(p){l();try{r(p)}catch(d){(s.f&_t)===0&&An(d,s)}o?.deactivate(),Cr()}if(n.length===0){c.then(()=>f(t.map(i)));return}function u(){l(),Promise.all(n.map(p=>bf(p))).then(p=>f([...t.map(i),...p])).catch(p=>An(p,s))}c?c.then(u):u()}function Qs(){var e=te,t=X,n=Ae,r=ne;return function(a=!0){ht(e),Ge(t),xn(n),a&&r?.activate()}}function Cr(){ht(null),Ge(null),xn(null)}function Ur(e){var t=_e|Ne,n=X!==null&&(X.f&_e)!==0?X:null;return te!==null&&(te.f|=Ln),{ctx:Ae,deps:null,effects:null,equals:Hs,f:t,fn:e,reactions:null,rv:0,v:ve,wv:0,parent:n??te,ac:null}}function bf(e,t,n){let r=te;r===null&&ju();var i=r.b,a=void 0,o=Et(ve),s=!X,l=new Map;return Nf(()=>{var c=Ts();a=c.promise;try{Promise.resolve(e()).then(c.resolve,c.reject).then(()=>{f===ne&&f.committed&&f.deactivate(),Cr()})}catch(d){c.reject(d),Cr()}var f=ne;if(s){var u=i.is_rendered();i.update_pending_count(1),f.increment(u),l.get(f)?.reject(mn),l.delete(f),l.set(f,c)}const p=(d,h=void 0)=>{if(f.activate(),h)h!==mn&&(o.f|=Rt,kt(o,h));else{(o.f&Rt)!==0&&(o.f^=Rt),kt(o,d);for(const[g,m]of l){if(l.delete(g),g===f)break;m.reject(mn)}}s&&(i.update_pending_count(-1),f.decrement(u))};c.promise.then(p,d=>p(null,d||"unknown"))}),oa(()=>{for(const c of l.values())c.reject(mn)}),new Promise(c=>{function f(u){function p(){u===a?c(o):f(a)}u.then(p,p)}f(a)})}function ft(e){const t=Ur(e);return wl(t),t}function Xs(e){const t=Ur(e);return t.equals=Bs,t}function el(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Re(t[n])}}function kf(e){for(var t=e.parent;t!==null;){if((t.f&_e)===0)return(t.f&_t)===0?t:null;t=t.parent}return null}function ia(e){var t,n=te;ht(kf(e));try{e.f&=~tn,el(e),t=xl(e)}finally{ht(n)}return t}function tl(e){var t=ia(e);if(!e.equals(t)&&(e.wv=bl(),(!ne?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){he(e,ye);return}jt||(Qe!==null?(aa()||ne?.is_fork)&&Qe.set(e,t):ra(e))}let Mi=new Set;const Ft=new Map;let nl=!1;function Et(e,t){var n={f:0,v:e,reactions:null,equals:Hs,rv:0,wv:0};return n}function K(e,t){const n=Et(e);return wl(n),n}function rl(e,t=!1,n=!0){const r=Et(e);return t||(r.equals=Bs),r}function U(e,t,n=!1){X!==null&&(!et||(X.f&Ao)!==0)&&js()&&(X.f&(_e|St|na|Ao))!==0&&(ze===null||!kn.call(ze,e))&&Gu();let r=n?Xe(t):t;return kt(e,r)}function kt(e,t){if(!e.equals(t)){var n=e.v;jt?Ft.set(e,t):Ft.set(e,n),e.v=t;var r=bt.ensure();if(r.capture(e,n),(e.f&_e)!==0){const i=e;(e.f&Ne)!==0&&ia(i),ra(i)}e.wv=bl(),il(e,Ne),te!==null&&(te.f&ye)!==0&&(te.f&(it|an))===0&&(Ye===null?Of([e]):Ye.push(e)),!r.is_fork&&Mi.size>0&&!nl&&xf()}return t}function xf(){nl=!1;for(const e of Mi)(e.f&ye)!==0&&he(e,Mt),tr(e)&&Wn(e);Mi.clear()}function Af(e,t=1){var n=y(e),r=t===1?n++:n--;return U(e,n),r}function Vn(e){U(e,e.v+1)}function il(e,t){var n=e.reactions;if(n!==null)for(var r=n.length,i=0;i<r;i++){var a=n[i],o=a.f,s=(o&Ne)===0;if(s&&he(a,t),(o&_e)!==0){var l=a;Qe?.delete(l),(o&tn)===0&&(o&Ke&&(a.f|=tn),il(l,Mt))}else s&&((o&St)!==0&&vt!==null&&vt.add(a),At(a))}}function Xe(e){if(typeof e!="object"||e===null||wn in e)return e;const t=Xi(e);if(t!==Ls&&t!==Fu)return e;var n=new Map,r=Qi(e),i=K(0),a=Zt,o=s=>{if(Zt===a)return s();var l=X,c=Zt;Ge(null),Mo(a);var f=s();return Ge(l),Mo(c),f};return r&&n.set("length",K(e.length)),new Proxy(e,{defineProperty(s,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&Ku();var f=n.get(l);return f===void 0?f=o(()=>{var u=K(c.value);return n.set(l,u),u}):U(f,c.value,!0),!0},deleteProperty(s,l){var c=n.get(l);if(c===void 0){if(l in s){const f=o(()=>K(ve));n.set(l,f),Vn(i)}}else U(c,ve),Vn(i);return!0},get(s,l,c){if(l===wn)return e;var f=n.get(l),u=l in s;if(f===void 0&&(!u||$t(s,l)?.writable)&&(f=o(()=>{var d=Xe(u?s[l]:ve),h=K(d);return h}),n.set(l,f)),f!==void 0){var p=y(f);return p===ve?void 0:p}return Reflect.get(s,l,c)},getOwnPropertyDescriptor(s,l){var c=Reflect.getOwnPropertyDescriptor(s,l);if(c&&"value"in c){var f=n.get(l);f&&(c.value=y(f))}else if(c===void 0){var u=n.get(l),p=u?.v;if(u!==void 0&&p!==ve)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return c},has(s,l){if(l===wn)return!0;var c=n.get(l),f=c!==void 0&&c.v!==ve||Reflect.has(s,l);if(c!==void 0||te!==null&&(!f||$t(s,l)?.writable)){c===void 0&&(c=o(()=>{var p=f?Xe(s[l]):ve,d=K(p);return d}),n.set(l,c));var u=y(c);if(u===ve)return!1}return f},set(s,l,c,f){var u=n.get(l),p=l in s;if(r&&l==="length")for(var d=c;d<u.v;d+=1){var h=n.get(d+"");h!==void 0?U(h,ve):d in s&&(h=o(()=>K(ve)),n.set(d+"",h))}if(u===void 0)(!p||$t(s,l)?.writable)&&(u=o(()=>K(void 0)),U(u,Xe(c)),n.set(l,u));else{p=u.v!==ve;var g=o(()=>Xe(c));U(u,g)}var m=Reflect.getOwnPropertyDescriptor(s,l);if(m?.set&&m.set.call(f,c),!p){if(r&&typeof l=="string"){var v=n.get("length"),w=Number(l);Number.isInteger(w)&&w>=v.v&&U(v,w+1)}Vn(i)}return!0},ownKeys(s){y(i);var l=Reflect.ownKeys(s).filter(u=>{var p=n.get(u);return p===void 0||p.v!==ve});for(var[c,f]of n)f.v!==ve&&!(c in s)&&l.push(c);return l},setPrototypeOf(){zu()}})}var Ii,Yr,al,ol,sl;function Ef(){if(Ii===void 0){Ii=window,Yr=document,al=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;ol=$t(t,"firstChild").get,sl=$t(t,"nextSibling").get,xo(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),xo(n)&&(n.__t=void 0)}}function Ht(e=""){return document.createTextNode(e)}function Tt(e){return ol.call(e)}function Xn(e){return sl.call(e)}function I(e,t){return Tt(e)}function xe(e,t=!1){{var n=Tt(e);return n instanceof Comment&&n.data===""?Xn(n):n}}function R(e,t=1,n=!1){let r=e;for(;t--;)r=Xn(r);return r}function Cf(e){e.textContent=""}function ll(){return!1}let Co=!1;function Sf(){Co||(Co=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Wr(e){var t=X,n=te;Ge(null),ht(null);try{return e()}finally{Ge(t),ht(n)}}function cl(e,t,n,r=n){e.addEventListener(t,()=>Wr(n));const i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),Sf()}function Mf(e){te===null&&(X===null&&Uu(),Vu()),jt&&qu()}function If(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function It(e,t,n){var r=te;r!==null&&(r.f&Pe)!==0&&(e|=Pe);var i={ctx:Ae,deps:null,nodes:null,f:e|Ne|Ke,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{Wn(i),i.f|=ta}catch(s){throw Re(i),s}else t!==null&&At(i);var a=i;if(n&&a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&Ln)===0&&(a=a.first,(e&St)!==0&&(e&en)!==0&&a!==null&&(a.f|=en)),a!==null&&(a.parent=r,r!==null&&If(a,r),X!==null&&(X.f&_e)!==0&&(e&an)===0)){var o=X;(o.effects??=[]).push(a)}return i}function aa(){return X!==null&&!et}function oa(e){const t=It(qr,null,!1);return he(t,ye),t.teardown=e,t}function pt(e){Mf();var t=te.f,n=!X&&(t&it)!==0&&(t&ta)===0;if(n){var r=Ae;(r.e??=[]).push(e)}else return ul(e)}function ul(e){return It(xr|Pu,e,!1)}function Lf(e){bt.ensure();const t=It(an|Ln,e,!0);return(n={})=>new Promise(r=>{n.outro?Gt(t,()=>{Re(t),r(void 0)}):(Re(t),r(void 0))})}function fl(e){return It(xr,e,!1)}function Nf(e){return It(na|Ln,e,!0)}function Kr(e,t=0){return It(qr|t,e,!0)}function ee(e,t=[],n=[],r=[]){_f(r,t,n,i=>{It(qr,()=>e(...i.map(y)),!0)})}function er(e,t=0){var n=It(St|t,e,!0);return n}function We(e){return It(it|Ln,e,!0)}function dl(e){var t=e.teardown;if(t!==null){const n=jt,r=X;So(!0),Ge(null);try{t.call(null)}finally{So(n),Ge(r)}}}function pl(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const i=n.ac;i!==null&&Wr(()=>{i.abort(mn)});var r=n.next;(n.f&an)!==0?n.parent=null:Re(n,t),n=r}}function Tf(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&it)===0&&Re(t),t=n}}function Re(e,t=!0){var n=!1;(t||(e.f&$s)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(hl(e.nodes.start,e.nodes.end),n=!0),pl(e,t&&!n),Sr(e,0),he(e,_t);var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)a.stop();dl(e);var i=e.parent;i!==null&&i.first!==null&&ml(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function hl(e,t){for(;e!==null;){var n=e===t?null:Xn(e);e.remove(),e=n}}function ml(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Gt(e,t,n=!0){var r=[];gl(e,r,!0);var i=()=>{n&&Re(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function gl(e,t,n){if((e.f&Pe)===0){e.f^=Pe;var r=e.nodes&&e.nodes.t;if(r!==null)for(const s of r)(s.is_global||n)&&t.push(s);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&en)!==0||(i.f&it)!==0&&(e.f&St)!==0;gl(i,t,o?n:!1),i=a}}}function sa(e){vl(e,!0)}function vl(e,t){if((e.f&Pe)!==0){e.f^=Pe,(e.f&ye)===0&&(he(e,Ne),At(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&en)!==0||(n.f&it)!==0;vl(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(const o of a)(o.is_global||t)&&o.in()}}function yl(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Xn(n);t.append(n),n=i}}let mr=!1,jt=!1;function So(e){jt=e}let X=null,et=!1;function Ge(e){X=e}let te=null;function ht(e){te=e}let ze=null;function wl(e){X!==null&&(ze===null?ze=[e]:ze.push(e))}let Oe=null,Fe=0,Ye=null;function Of(e){Ye=e}let _l=1,zt=0,Zt=zt;function Mo(e){Zt=e}function bl(){return++_l}function tr(e){var t=e.f;if((t&Ne)!==0)return!0;if(t&_e&&(e.f&=~tn),(t&Mt)!==0){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(tr(a)&&tl(a),a.wv>e.wv)return!0}(t&Ke)!==0&&Qe===null&&he(e,ye)}return!1}function kl(e,t,n=!0){var r=e.reactions;if(r!==null&&!(ze!==null&&kn.call(ze,e)))for(var i=0;i<r.length;i++){var a=r[i];(a.f&_e)!==0?kl(a,t,!1):t===a&&(n?he(a,Ne):(a.f&ye)!==0&&he(a,Mt),At(a))}}function xl(e){var t=Oe,n=Fe,r=Ye,i=X,a=ze,o=Ae,s=et,l=Zt,c=e.f;Oe=null,Fe=0,Ye=null,X=(c&(it|an))===0?e:null,ze=null,xn(e.ctx),et=!1,Zt=++zt,e.ac!==null&&(Wr(()=>{e.ac.abort(mn)}),e.ac=null);try{e.f|=Ai;var f=e.fn,u=f(),p=e.deps,d=ne?.is_fork;if(Oe!==null){var h;if(d||Sr(e,Fe),p!==null&&Fe>0)for(p.length=Fe+Oe.length,h=0;h<Oe.length;h++)p[Fe+h]=Oe[h];else e.deps=p=Oe;if(aa()&&(e.f&Ke)!==0)for(h=Fe;h<p.length;h++)(p[h].reactions??=[]).push(e)}else!d&&p!==null&&Fe<p.length&&(Sr(e,Fe),p.length=Fe);if(js()&&Ye!==null&&!et&&p!==null&&(e.f&(_e|Mt|Ne))===0)for(h=0;h<Ye.length;h++)kl(Ye[h],e);if(i!==null&&i!==e){if(zt++,i.deps!==null)for(let g=0;g<n;g+=1)i.deps[g].rv=zt;if(t!==null)for(const g of t)g.rv=zt;Ye!==null&&(r===null?r=Ye:r.push(...Ye))}return(e.f&Rt)!==0&&(e.f^=Rt),u}catch(g){return Us(g)}finally{e.f^=Ai,Oe=t,Fe=n,Ye=r,X=i,ze=a,xn(o),et=s,Zt=l}}function $f(e,t){let n=t.reactions;if(n!==null){var r=Du.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&(t.f&_e)!==0&&(Oe===null||!kn.call(Oe,t))){var a=t;(a.f&Ke)!==0&&(a.f^=Ke,a.f&=~tn),ra(a),el(a),Sr(a,0)}}function Sr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)$f(e,n[r])}function Wn(e){var t=e.f;if((t&_t)===0){he(e,ye);var n=te,r=mr;te=e,mr=!0;try{(t&(St|Os))!==0?Tf(e):pl(e),dl(e);var i=xl(e);e.teardown=typeof i=="function"?i:null,e.wv=_l;var a;xi&&uf&&(e.f&Ne)!==0&&e.deps}finally{mr=r,te=n}}}async function Df(){await Promise.resolve(),Ks()}function y(e){var t=e.f,n=(t&_e)!==0;if(X!==null&&!et){var r=te!==null&&(te.f&_t)!==0;if(!r&&(ze===null||!kn.call(ze,e))){var i=X.deps;if((X.f&Ai)!==0)e.rv<zt&&(e.rv=zt,Oe===null&&i!==null&&i[Fe]===e?Fe++:Oe===null?Oe=[e]:Oe.push(e));else{(X.deps??=[]).push(e);var a=e.reactions;a===null?e.reactions=[X]:kn.call(a,X)||a.push(X)}}}if(jt&&Ft.has(e))return Ft.get(e);if(n){var o=e;if(jt){var s=o.v;return((o.f&ye)===0&&o.reactions!==null||El(o))&&(s=ia(o)),Ft.set(o,s),s}var l=(o.f&Ke)===0&&!et&&X!==null&&(mr||(X.f&Ke)!==0),c=o.deps===null;tr(o)&&(l&&(o.f|=Ke),tl(o)),l&&!c&&Al(o)}if(Qe?.has(e))return Qe.get(e);if((e.f&Rt)!==0)throw e.v;return e.v}function Al(e){if(e.deps!==null){e.f|=Ke;for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&_e)!==0&&(t.f&Ke)===0&&Al(t)}}function El(e){if(e.v===ve)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(Ft.has(t)||(t.f&_e)!==0&&El(t))return!0;return!1}function Ut(e){var t=et;try{return et=!0,e()}finally{et=t}}const Rf=["touchstart","touchmove"];function Ff(e){return Rf.includes(e)}const Cl=new Set,Li=new Set;function Hf(e,t,n,r={}){function i(a){if(r.capture||Bn.call(t,a),!a.cancelBubble)return Wr(()=>n?.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ut(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function on(e,t,n,r,i){var a={capture:r,passive:i},o=Hf(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&oa(()=>{t.removeEventListener(e,o,a)})}function Ve(e){for(var t=0;t<e.length;t++)Cl.add(e[t]);for(var n of Li)n(e)}let Io=null;function Bn(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Io=e;var o=0,s=Io===e&&e.__root;if(s){var l=i.indexOf(s);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var c=i.indexOf(t);if(c===-1)return;l<=c&&(o=l)}if(a=i[o]||e.target,a!==t){Is(e,"currentTarget",{configurable:!0,get(){return a||n}});var f=X,u=te;Ge(null),ht(null);try{for(var p,d=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a["__"+r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(m){p?d.push(m):p=m}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let m of d)queueMicrotask(()=>{throw m});throw p}}finally{e.__root=t,delete e.currentTarget,Ge(f),ht(u)}}}function Sl(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function Mr(e,t){var n=te;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function z(e,t){var n=(t&of)!==0,r=(t&sf)!==0,i,a=!e.startsWith("<!>");return()=>{i===void 0&&(i=Sl(a?e:"<!>"+e),n||(i=Tt(i)));var o=r||al?document.importNode(i,!0):i.cloneNode(!0);if(n){var s=Tt(o),l=o.lastChild;Mr(s,l)}else Mr(o,o);return o}}function ct(){var e=document.createDocumentFragment(),t=document.createComment(""),n=Ht();return e.append(t,n),Mr(t,n),e}function q(e,t){e!==null&&e.before(t)}function ce(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function Pf(e,t){return Bf(e,t)}const cn=new Map;function Bf(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0}){Ef();var s=new Set,l=u=>{for(var p=0;p<u.length;p++){var d=u[p];if(!s.has(d)){s.add(d);var h=Ff(d);t.addEventListener(d,Bn,{passive:h});var g=cn.get(d);g===void 0?(document.addEventListener(d,Bn,{passive:h}),cn.set(d,1)):cn.set(d,g+1)}}};l(jr(Cl)),Li.add(l);var c=void 0,f=Lf(()=>{var u=n??t.appendChild(Ht());return yf(u,{pending:()=>{}},p=>{if(a){se({});var d=Ae;d.c=a}i&&(r.$$events=i),c=e(p,r)||{},a&&le()}),()=>{for(var p of s){t.removeEventListener(p,Bn);var d=cn.get(p);--d===0?(document.removeEventListener(p,Bn),cn.delete(p)):cn.set(p,d)}Li.delete(l),u!==n&&u.parentNode?.removeChild(u)}});return jf.set(c,f),c}let jf=new WeakMap;class la{anchor;#t=new Map;#o=new Map;#e=new Map;#i=new Set;#a=!0;constructor(t,n=!0){this.anchor=t,this.#a=n}#r=()=>{var t=ne;if(this.#t.has(t)){var n=this.#t.get(t),r=this.#o.get(n);if(r)sa(r),this.#i.delete(n);else{var i=this.#e.get(n);i&&(this.#o.set(n,i.effect),this.#e.delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[a,o]of this.#t){if(this.#t.delete(a),a===t)break;const s=this.#e.get(o);s&&(Re(s.effect),this.#e.delete(o))}for(const[a,o]of this.#o){if(a===n||this.#i.has(a))continue;const s=()=>{if(Array.from(this.#t.values()).includes(a)){var c=document.createDocumentFragment();yl(o,c),c.append(Ht()),this.#e.set(a,{effect:o,fragment:c})}else Re(o);this.#i.delete(a),this.#o.delete(a)};this.#a||!r?(this.#i.add(a),Gt(o,s,!1)):s()}}};#n=t=>{this.#t.delete(t);const n=Array.from(this.#t.values());for(const[r,i]of this.#e)n.includes(r)||(Re(i.effect),this.#e.delete(r))};ensure(t,n){var r=ne,i=ll();if(n&&!this.#o.has(t)&&!this.#e.has(t))if(i){var a=document.createDocumentFragment(),o=Ht();a.append(o),this.#e.set(t,{effect:We(()=>n(o)),fragment:a})}else this.#o.set(t,We(()=>n(this.anchor)));if(this.#t.set(r,t),i){for(const[s,l]of this.#o)s===t?r.skipped_effects.delete(l):r.skipped_effects.add(l);for(const[s,l]of this.#e)s===t?r.skipped_effects.delete(l.effect):r.skipped_effects.add(l.effect);r.oncommit(this.#r),r.ondiscard(this.#n)}else this.#r()}}const qf=0,fi=1;function tt(e,t,n,r,i){var a=ve,o=Et(a),s=Et(a),l=new la(e);er(()=>{var c=t(),f=!1;if(Hu(c)){var u=Qs(),p=!1;const d=h=>{if(!f){p=!0,u(!1),bt.ensure();try{h()}finally{Cr(),_n||Ks()}}};c.then(h=>{d(()=>{kt(o,h),l.ensure(fi,r&&(g=>r(g,o)))})},h=>{d(()=>{if(kt(s,h),l.ensure(fi,i&&(g=>i(g,s))),!i)throw s.v})}),ut(()=>{p||d(()=>{l.ensure(qf,n)})})}else kt(o,c),l.ensure(fi,r&&(d=>r(d,o)));return()=>{f=!0}})}function Le(e,t,n=!1){var r=new la(e),i=n?en:0;function a(o,s){r.ensure(o,s)}er(()=>{var o=!1;t((s,l=!0)=>{o=!0,a(l,s)}),o||a(!1,null)},i)}function Ni(e,t){return t}function Vf(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let u=t[s];Gt(u,()=>{if(a){if(a.pending.delete(u),a.done.add(u),a.pending.size===0){var p=e.outrogroups;Ti(jr(a.done)),p.delete(a),p.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var c=n,f=c.parentNode;Cf(f),f.append(c),e.items.clear()}Ti(t,!l)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Ti(e,t=!0){for(var n=0;n<e.length;n++)Re(e[n],t)}var Lo;function qt(e,t,n,r,i,a=null){var o=e,s=new Map,l=(t&Fs)!==0;if(l){var c=e;o=c.appendChild(Ht())}var f=null,u=Xs(()=>{var v=n();return Qi(v)?v:v==null?[]:jr(v)}),p,d=!0;function h(){m.fallback=f,Uf(m,p,o,t,r),f!==null&&(p.length===0?(f.f&wt)===0?sa(f):(f.f^=wt,jn(f,null,o)):Gt(f,()=>{f=null}))}var g=er(()=>{p=y(u);for(var v=p.length,w=new Set,k=ne,L=ll(),$=0;$<v;$+=1){var N=p[$],E=r(N,$),P=d?null:s.get(E);P?(P.v&&kt(P.v,N),P.i&&kt(P.i,$),L&&k.skipped_effects.delete(P.e)):(P=Yf(s,d?o:Lo??=Ht(),N,E,$,i,t,n),d||(P.e.f|=wt),s.set(E,P)),w.add(E)}if(v===0&&a&&!f&&(d?f=We(()=>a(o)):(f=We(()=>a(Lo??=Ht())),f.f|=wt)),!d)if(L){for(const[G,V]of s)w.has(G)||k.skipped_effects.add(V.e);k.oncommit(h),k.ondiscard(()=>{})}else h();y(u)}),m={effect:g,items:s,outrogroups:null,fallback:f};d=!1}function Fn(e){for(;e!==null&&(e.f&it)===0;)e=e.next;return e}function Uf(e,t,n,r,i){var a=(r&Xu)!==0,o=t.length,s=e.items,l=Fn(e.effect.first),c,f=null,u,p=[],d=[],h,g,m,v;if(a)for(v=0;v<o;v+=1)h=t[v],g=i(h,v),m=s.get(g).e,(m.f&wt)===0&&(m.nodes?.a?.measure(),(u??=new Set).add(m));for(v=0;v<o;v+=1){if(h=t[v],g=i(h,v),m=s.get(g).e,e.outrogroups!==null)for(const V of e.outrogroups)V.pending.delete(m),V.done.delete(m);if((m.f&wt)!==0)if(m.f^=wt,m===l)jn(m,null,n);else{var w=f?f.next:l;m===e.effect.last&&(e.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),Nt(e,f,m),Nt(e,m,w),jn(m,w,n),f=m,p=[],d=[],l=Fn(f.next);continue}if((m.f&Pe)!==0&&(sa(m),a&&(m.nodes?.a?.unfix(),(u??=new Set).delete(m))),m!==l){if(c!==void 0&&c.has(m)){if(p.length<d.length){var k=d[0],L;f=k.prev;var $=p[0],N=p[p.length-1];for(L=0;L<p.length;L+=1)jn(p[L],k,n);for(L=0;L<d.length;L+=1)c.delete(d[L]);Nt(e,$.prev,N.next),Nt(e,f,$),Nt(e,N,k),l=k,f=N,v-=1,p=[],d=[]}else c.delete(m),jn(m,l,n),Nt(e,m.prev,m.next),Nt(e,m,f===null?e.effect.first:f.next),Nt(e,f,m),f=m;continue}for(p=[],d=[];l!==null&&l!==m;)(c??=new Set).add(l),d.push(l),l=Fn(l.next);if(l===null)continue}(m.f&wt)===0&&p.push(m),f=m,l=Fn(m.next)}if(e.outrogroups!==null){for(const V of e.outrogroups)V.pending.size===0&&(Ti(jr(V.done)),e.outrogroups?.delete(V));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||c!==void 0){var E=[];if(c!==void 0)for(m of c)(m.f&Pe)===0&&E.push(m);for(;l!==null;)(l.f&Pe)===0&&l!==e.fallback&&E.push(l),l=Fn(l.next);var P=E.length;if(P>0){var G=(r&Fs)!==0&&o===0?n:null;if(a){for(v=0;v<P;v+=1)E[v].nodes?.a?.measure();for(v=0;v<P;v+=1)E[v].nodes?.a?.fix()}Vf(e,E,G)}}a&&ut(()=>{if(u!==void 0)for(m of u)m.nodes?.a?.apply()})}function Yf(e,t,n,r,i,a,o,s){var l=(o&Ju)!==0?(o&ef)===0?rl(n,!1,!1):Et(n):null,c=(o&Qu)!==0?Et(i):null;return{v:l,i:c,e:We(()=>(a(t,l??n,c??i,s),()=>{e.delete(r)}))}}function jn(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&(t.f&wt)===0?t.nodes.start:n;r!==null;){var o=Xn(r);if(a.before(r),r===i)return;r=o}}function Nt(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Be(e,t,n=!1,r=!1,i=!1){var a=e,o="";ee(()=>{var s=te;if(o!==(o=t()??"")&&(s.nodes!==null&&(hl(s.nodes.start,s.nodes.end),s.nodes=null),o!=="")){var l=o+"";n?l=`<svg>${l}</svg>`:r&&(l=`<math>${l}</math>`);var c=Sl(l);if((n||r)&&(c=Tt(c)),Mr(Tt(c),c.lastChild),n||r)for(;Tt(c);)a.before(Tt(c));else a.before(c)}})}function gr(e,t,n){var r=new la(e);er(()=>{var i=t()??null;r.ensure(i,i&&(a=>n(a,i)))},en)}function Wf(e,t,n){fl(()=>{var r=Ut(()=>t(e,n?.())||{});if(r?.destroy)return()=>r.destroy()})}const No=[...`
2
- \r\f \v\uFEFF`];function Kf(e,t,n){var r=e==null?"":""+e;if(n){for(var i in n)if(n[i])r=r?r+" "+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||No.includes(r[o-1]))&&(s===r.length||No.includes(r[s]))?r=(o===0?"":r.substring(0,o))+r.substring(s+1):o=s}}return r===""?null:r}function To(e,t=!1){var n=t?" !important;":";",r="";for(var i in e){var a=e[i];a!=null&&a!==""&&(r+=" "+i+": "+a+n)}return r}function zf(e,t){if(t){var n="",r,i;return Array.isArray(t)?(r=t[0],i=t[1]):r=t,r&&(n+=To(r)),i&&(n+=To(i,!0)),n=n.trim(),n===""?null:n}return String(e)}function Ml(e,t,n,r,i,a){var o=e.__className;if(o!==n||o===void 0){var s=Kf(n,r,a);s==null?e.removeAttribute("class"):e.className=s,e.__className=n}else if(a&&i!==a)for(var l in a){var c=!!a[l];(i==null||c!==!!i[l])&&e.classList.toggle(l,c)}return a}function di(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Gf(e,t,n,r){var i=e.__style;if(i!==t){var a=zf(t,r);a==null?e.removeAttribute("style"):e.style.cssText=a,e.__style=t}else r&&(Array.isArray(r)?(di(e,n?.[0],r[0]),di(e,n?.[1],r[1],"important")):di(e,n,r));return r}const Zf=Symbol("is custom element"),Jf=Symbol("is html");function Qf(e,t){var n=Il(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function Q(e,t,n,r){var i=Il(e);i[t]!==(i[t]=n)&&(t==="loading"&&(e[Bu]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Xf(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Il(e){return e.__attributes??={[Zf]:e.nodeName.includes("-"),[Jf]:e.namespaceURI===lf}}var Oo=new Map;function Xf(e){var t=e.getAttribute("is")||e.nodeName,n=Oo.get(t);if(n)return n;Oo.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){r=Ru(i);for(var o in r)r[o].set&&n.push(o);i=Xi(i)}return n}function Pt(e,t,n=t){var r=new WeakSet;cl(e,"input",async i=>{var a=i?e.defaultValue:e.value;if(a=pi(e)?hi(a):a,n(a),ne!==null&&r.add(ne),await Df(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,l=e.value.length;if(e.value=a??"",s!==null){var c=e.value.length;o===s&&s===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=o,e.selectionEnd=Math.min(s,c))}}}),Ut(t)==null&&e.value&&(n(pi(e)?hi(e.value):e.value),ne!==null&&r.add(ne)),Kr(()=>{var i=t();if(e===document.activeElement){var a=Ci??ne;if(r.has(a))return}pi(e)&&i===hi(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function ed(e,t,n=t){cl(e,"change",r=>{var i=r?e.defaultChecked:e.checked;n(i)}),Ut(t)==null&&n(e.checked),Kr(()=>{var r=t();e.checked=!!r})}function pi(e){var t=e.type;return t==="number"||t==="range"}function hi(e){return e===""?null:+e}function $o(e,t){return e===t||e?.[wn]===t}function En(e={},t,n,r){return fl(()=>{var i,a;return Kr(()=>{i=a,a=[],Ut(()=>{e!==n(...a)&&(t(e,...a),i&&$o(n(...i),e)&&t(null,...i))})}),()=>{ut(()=>{a&&$o(n(...a),e)&&t(null,...a)})}}),e}function ca(e,t,n){if(e==null)return t(void 0),n&&n(void 0),Dt;const r=Ut(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const un=[];function Ll(e,t){return{subscribe:mt(e,t).subscribe}}function mt(e,t=Dt){let n=null;const r=new Set;function i(s){if(Ps(e,s)&&(e=s,n)){const l=!un.length;for(const c of r)c[1](),un.push(c,e);if(l){for(let c=0;c<un.length;c+=2)un[c][0](un[c+1]);un.length=0}}}function a(s){i(s(e))}function o(s,l=Dt){const c=[s,l];return r.add(c),r.size===1&&(n=t(i,a)||Dt),s(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}function td(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 a=t.length<2;return Ll(n,(o,s)=>{let l=!1;const c=[];let f=0,u=Dt;const p=()=>{if(f)return;u();const h=t(r?c[0]:c,o,s);a?o(h):u=typeof h=="function"?h:Dt},d=i.map((h,g)=>ca(h,m=>{c[g]=m,f&=~(1<<g),l&&p()},()=>{f|=1<<g}));return l=!0,p(),function(){Ns(d),u(),l=!1}})}function qe(e){let t;return ca(e,n=>t=n)(),t}let dr=!1,Oi=Symbol();function H(e,t,n){const r=n[t]??={store:null,source:rl(void 0),unsubscribe:Dt};if(r.store!==e&&!(Oi in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=Dt;else{var i=!0;r.unsubscribe=ca(e,a=>{i?r.source.v=a:U(r.source,a)}),i=!1}return e&&Oi in n?qe(e):y(r.source)}function re(e,t){return e.set(t),t}function me(){const e={};function t(){oa(()=>{for(var n in e)e[n].unsubscribe();Is(e,Oi,{enumerable:!1,value:!0})})}return[e,t]}function nd(e){var t=dr;try{return dr=!1,[e(),dr]}finally{dr=t}}const rd={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Rn(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];Rn(i)&&(i=i());const a=$t(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Rn(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const i=$t(r,t);return i&&!i.configurable&&(i.configurable=!0),i}}},has(e,t){if(t===wn||t===Ds)return!1;for(let n of e.props)if(Rn(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(Rn(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function vr(...e){return new Proxy({props:e},rd)}function je(e,t,n,r){var i=(n&rf)!==0,a=(n&af)!==0,o=r,s=!0,l=()=>(s&&(s=!1,o=a?Ut(r):r),o),c;if(i){var f=wn in e||Ds in e;c=$t(e,t)?.set??(f&&t in e?w=>e[t]=w:void 0)}var u,p=!1;i?[u,p]=nd(()=>e[t]):u=e[t],u===void 0&&r!==void 0&&(u=l(),c&&(Wu(),c(u)));var d;if(d=()=>{var w=e[t];return w===void 0?l():(s=!0,w)},(n&nf)===0)return d;if(c){var h=e.$$legacy;return(function(w,k){return arguments.length>0?((!k||h||p)&&c(k?d():w),w):d()})}var g=!1,m=((n&tf)!==0?Ur:Xs)(()=>(g=!1,d()));i&&y(m);var v=te;return(function(w,k){if(arguments.length>0){const L=k?y(m):i?Xe(w):w;return U(m,L),g=!0,o!==void 0&&(o=L),w}return jt&&g||(v.f&_t)!==0?m.v:y(m)})}function Ue(e){Ae===null&&Rs(),pt(()=>{const t=Ut(e);if(typeof t=="function")return t})}const id="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(id);const ad='<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>',od='<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>',sd='<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>';function Nl(e){return typeof e>"u"||e===null}function ld(e){return typeof e=="object"&&e!==null}function cd(e){return Array.isArray(e)?e:Nl(e)?[]:[e]}function ud(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function fd(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function dd(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var pd=Nl,hd=ld,md=cd,gd=fd,vd=dd,yd=ud,pe={isNothing:pd,isObject:hd,toArray:md,repeat:gd,isNegativeZero:vd,extend:yd};function Tl(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
+ import{r as e,t}from"./rolldown-runtime.js";import{_ as n,a as r,b as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b,y as x}from"./milkdown.js";var S=Array.isArray,C=Array.prototype.indexOf,w=Array.prototype.includes,T=Array.from,ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,ne=Object.getOwnPropertyDescriptors,re=Object.prototype,ie=Array.prototype,ae=Object.getPrototypeOf,oe=Object.isExtensible;function se(e){return typeof e==`function`}var ce=()=>{};function le(e){return typeof e?.then==`function`}function ue(e){for(var t=0;t<e.length;t++)e[t]()}function de(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var fe=1024,pe=2048,me=4096,he=8192,ge=16384,_e=32768,ve=1<<25,ye=65536,be=1<<19,xe=1<<20,Se=1<<25,Ce=65536,we=1<<21,Te=1<<22,Ee=1<<23,De=Symbol(`$state`),Oe=Symbol(`legacy props`),ke=Symbol(``),Ae=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},je=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function Me(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ne(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Pe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Fe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ie(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Le(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Re(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ze(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Be(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function Ve(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function He(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ue(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function We(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ge={},E=Symbol(),Ke=`http://www.w3.org/1999/xhtml`,qe=`http://www.w3.org/2000/svg`,Je=`http://www.w3.org/1998/Math/MathML`;function Ye(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Xe(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var D=!1;function Ze(e){D=e}var O;function Qe(e){if(e===null)throw Ye(),Ge;return O=e}function $e(){return Qe(Hn(O))}function k(e){if(D){if(Hn(O)!==null)throw Ye(),Ge;O=e}}function et(e=1){if(D){for(var t=e,n=O;t--;)n=Hn(n);O=n}}function tt(e=!0){for(var t=0,n=O;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Hn(n);e&&n.remove(),n=i}}function nt(e){if(!e||e.nodeType!==8)throw Ye(),Ge;return e.data}function rt(e){return e===this.v}function it(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function at(e){return!it(e,this.v)}var ot=!1,st=!1,ct=[];function lt(e,t=!1,n=!1){return ut(e,new Map,``,ct,null,n)}function ut(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(S(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=ut(l,t,n,r,null,a))}return s}if(ae(e)===re){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=ut(e[u],t,n,r,null,a);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON==`function`&&!a)return ut(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}var A=null;function dt(e){A=e}function ft(e){return ht(`getContext`).get(e)}function pt(e,t){let n=ht(`setContext`);if(ot){var r=W.f;!U&&r&32&&!A.i||Be()}return n.set(e,t),t}function j(e,t=!1,n){A={p:A,i:!1,c:null,e:null,s:e,x:null,r:W,l:st&&!t?{s:null,u:null,$:[]}:null}}function M(e){var t=A,n=t.e;if(n!==null){t.e=null;for(var r of n)ar(r)}return e!==void 0&&(t.x=e),t.i=!0,A=t.p,e??{}}function mt(){return!st||A!==null&&A.l===null}function ht(e){return A===null&&Me(e),A.c??=new Map(gt(A)||void 0)}function gt(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var _t=[];function vt(){var e=_t;_t=[],ue(e)}function yt(e){if(_t.length===0&&!Ht){var t=_t;queueMicrotask(()=>{t===_t&&vt()})}_t.push(e)}function bt(){for(;_t.length>0;)vt()}function xt(e){var t=W;if(t===null)return U.f|=Ee,e;if(!(t.f&32768)&&!(t.f&4))throw e;St(e,t)}function St(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Ct=~(pe|me|fe);function N(e,t){e.f=e.f&Ct|t}function wt(e){e.f&512||e.deps===null?N(e,fe):N(e,me)}function Tt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=Ce,Tt(t.deps))}function Et(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Tt(e.deps),N(e,fe)}function Dt(e,t,n){if(e==null)return t(void 0),n&&n(void 0),ce;let r=Xr(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}var Ot=[];function kt(e,t){return{subscribe:At(e,t).subscribe}}function At(e,t=ce){let n=null,r=new Set;function i(t){if(it(e,t)&&(e=t,n)){let t=!Ot.length;for(let t of r)t[1](),Ot.push(t,e);if(t){for(let e=0;e<Ot.length;e+=2)Ot[e][0](Ot[e+1]);Ot.length=0}}}function a(t){i(t(e))}function o(o,s=ce){let c=[o,s];return r.add(c),r.size===1&&(n=t(i,a)||ce),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}function jt(e,t,n){let r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw Error(`derived() expects stores as input, got a falsy value`);let a=t.length<2;return kt(n,(e,n)=>{let o=!1,s=[],c=0,l=ce,u=()=>{if(c)return;l();let i=t(r?s[0]:s,e,n);a?e(i):l=typeof i==`function`?i:ce},d=i.map((e,t)=>Dt(e,e=>{s[t]=e,c&=~(1<<t),o&&u()},()=>{c|=1<<t}));return o=!0,u(),function(){ue(d),l(),o=!1}})}function Mt(e){let t;return Dt(e,e=>t=e)(),t}var Nt=!1,Pt=!1,Ft=Symbol();function P(e,t,n){let r=n[t]??={store:null,source:Dn(void 0),unsubscribe:ce};if(r.store!==e&&!(Ft in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=ce;else{var i=!0;r.unsubscribe=Dt(e,e=>{i?r.source.v=e:z(r.source,e)}),i=!1}return e&&Ft in n?Mt(e):G(r.source)}function F(e,t){return It(e,t),t}function I(){let e={};function t(){rr(()=>{for(var t in e)e[t].unsubscribe();ee(e,Ft,{enumerable:!1,value:!0})})}return[e,t]}function It(e,t){Nt=!0;try{e.set(t)}finally{Nt=!1}}function Lt(e){var t=Pt;try{return Pt=!1,[e(),Pt]}finally{Pt=t}}var Rt=new Set,L=null,zt=null,Bt=null,Vt=null,Ht=!1,Ut=!1,Wt=null,Gt=null,Kt=0,qt=1,Jt=class e{id=qt++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=[];#s=new Set;#c=new Set;#l=new Map;is_fork=!1;#u=!1;#d=new Set;#f(){return this.is_fork||this.#r.size>0}#p(){for(let n of this.#d)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#l.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#l.get(e);if(t){this.#l.delete(e);for(var n of t.d)N(n,pe),this.schedule(n);for(n of t.m)N(n,me),this.schedule(n)}}#m(){if(Kt++>1e3&&(Rt.delete(this),Xt()),!this.#f()){for(let e of this.#s)this.#c.delete(e),N(e,pe),this.schedule(e);for(let e of this.#c)N(e,me),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=Wt=[],r=[],i=Gt=[];for(let e of t)try{this.#h(e,n,r)}catch(t){throw rn(e),t}if(L=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(Wt=null,Gt=null,this.#f()||this.#p()){this.#g(r),this.#g(n);for(let[e,t]of this.#l)nn(e,t)}else{this.#n.size===0&&Rt.delete(this),this.#s.clear(),this.#c.clear();for(let e of this.#e)e(this);this.#e.clear(),zt=this,Qt(r),Qt(n),zt=null,this.#i?.resolve()}var o=L;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(Rt.add(o),o.#m()),Rt.has(this)||this.#_()}#h(e,t,n){e.f^=fe;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#l.has(r))&&r.fn!==null){a?r.f^=fe:i&4?t.push(r):ot&&i&16777224?n.push(r):Vr(r)&&(i&16&&this.#c.add(r),Kr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(e){for(var t=0;t<e.length;t+=1)Et(e[t],this.#s,this.#c)}capture(e,t,n=!1){t!==E&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,n]),Bt?.set(e,e.v))}activate(){L=this}deactivate(){L=null,Bt=null}flush(){try{Ut=!0,L=this,this.#m()}finally{Kt=0,Vt=null,Wt=null,Gt=null,Ut=!1,L=null,Bt=null,wn.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),Rt.delete(this)}register_created_effect(e){this.#o.push(e)}#_(){for(let l of Rt){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){l.activate();var i=new Set,a=new Map;for(var o of t)$t(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#o)!(e.f&155648)&&en(e,s,a)&&(e.f&4194320?(N(e,pe),l.schedule(e)):l.#s.add(e));if(l.#a.length>0){l.apply();for(var c of l.#a)l.#h(c,[],[]);l.#a=[]}l.deactivate()}}for(let e of Rt)e.#d.has(this)&&(e.#d.delete(this),e.#d.size===0&&!e.#f()&&(e.activate(),e.#m()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#u||n||(this.#u=!0,yt(()=>{this.#u=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#s.add(t);for(let e of t)this.#c.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=de()).promise}static ensure(){if(L===null){let t=L=new e;Ut||(Rt.add(L),Ht||yt(()=>{L===t&&t.flush()}))}return L}apply(){if(!ot||!this.is_fork&&Rt.size===1){Bt=null;return}Bt=new Map;for(let[e,[t]]of this.current)Bt.set(e,t);for(let n of Rt)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#d.add(n);else for(let[e,t]of n.previous)Bt.has(e)||Bt.set(e,t)}}schedule(e){if(Vt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(Wt!==null&&t===W&&(ot||(U===null||!(U.f&2))&&!Nt))return;if(n&96){if(!(n&1024))return;t.f^=fe}}this.#a.push(t)}};function Yt(e){var t=Ht;Ht=!0;try{var n;for(e&&(L!==null&&!L.is_fork&&L.flush(),n=e());;){if(bt(),L===null)return n;L.flush()}}finally{Ht=t}}function Xt(){try{Re()}catch(e){St(e,Vt)}}var Zt=null;function Qt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Vr(r)&&(Zt=new Set,Kr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&_r(r),Zt?.size>0)){wn.clear();for(let e of Zt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Zt.has(n)&&(Zt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Kr(n)}}Zt.clear()}}Zt=null}}function $t(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?$t(i,t,n,r):e&4194320&&!(e&2048)&&en(i,t,r)&&(N(i,pe),tn(i))}}function en(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(w.call(t,r))return!0;if(r.f&2&&en(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function tn(e){L.schedule(e)}function nn(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),N(e,fe);for(var n=e.first;n!==null;)nn(n,t),n=n.next}}function rn(e){N(e,fe);for(var t=e.first;t!==null;)rn(t),t=t.next}function an(e){let t=0,n=En(0),r;return()=>{nr()&&(G(n),lr(()=>(t===0&&(r=Xr(()=>e(()=>jn(n)))),t+=1,()=>{yt(()=>{--t,t===0&&(r?.(),r=void 0,jn(n))})})))}}var on=ye|be;function sn(e,t,n,r){new cn(e,t,n,r)}var cn=class{parent;is_pending=!1;transform_error;#e;#t=D?O:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=an(()=>(this.#m=En(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=W;t.b=this,t.f|=128,n(e)},this.parent=W.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=ur(()=>{if(D){let e=this.#t;$e();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},on),D&&(this.#e=O)}#g(){try{this.#a=dr(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=dr(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=dr(()=>e(this.#e)),yt(()=>{var e=this.#c=document.createDocumentFragment(),t=Bn();e.append(t),this.#a=this.#x(()=>dr(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,vr(this.#o,()=>{this.#o=null}),this.#b(L))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=dr(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Sr(this.#a,e);let t=this.#n.pending;this.#o=dr(()=>t(this.#e))}else this.#b(L)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Et(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=W,n=U,r=A;kr(this.#i),Or(this.#i),dt(this.#i.ctx);try{return Jt.ensure(),e()}catch(e){return xt(e),null}finally{kr(t),Or(n),dt(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&vr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,yt(()=>{this.#d=!1,this.#m&&On(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),G(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(hr(this.#a),null),this.#o&&=(hr(this.#o),null),this.#s&&=(hr(this.#s),null),D&&(Qe(this.#t),et(),Qe(tt()));var r=!1,i=!1;let a=()=>{if(r){Xe();return}r=!0,i&&We(),this.#s!==null&&vr(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){St(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return dr(()=>{var t=W;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return St(e,this.#i.parent),null}}))};yt(()=>{var t;try{t=this.transform_error(e)}catch(e){St(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>St(e,this.#i&&this.#i.parent)):o(t)})}};function ln(e,t,n,r){let i=mt()?pn:gn;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=W,s=un(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||St(e,o)}dn()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=fn();function d(){Promise.all(n.map(e=>mn(e))).then(e=>l([...t.map(i),...e])).catch(e=>St(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),dn()}):d()}function un(){var e=W,t=U,n=A,r=L;return function(i=!0){kr(e),Or(t),dt(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function dn(e=!0){kr(null),Or(null),dt(null),e&&L?.deactivate()}function fn(){var e=W,t=e.b,n=L,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function pn(e){var t=2|pe,n=U!==null&&U.f&2?U:null;return W!==null&&(W.f|=be),{ctx:A,deps:null,effects:null,equals:rt,f:t,fn:e,reactions:null,rv:0,v:E,wv:0,parent:n??W,ac:null}}function mn(e,t,n){let r=W;r===null&&Ne();var i=void 0,a=En(E),o=!U,s=new Map;return cr(()=>{var t=W,n=de();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(dn)}catch(e){n.reject(e),dn()}var c=L;if(o){if(t.f&32768)var l=fn();if(r.b.is_rendered())s.get(c)?.reject(Ae),s.delete(c);else{for(let e of s.values())e.reject(Ae);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===Ae),!(n===Ae||t.f&16384)){if(c.activate(),n)a.f|=Ee,On(a,n);else{a.f&8388608&&(a.f^=Ee),On(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(Ae)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),rr(()=>{for(let e of s.values())e.reject(Ae)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function hn(e){let t=pn(e);return ot||jr(t),t}function gn(e){let t=pn(e);return t.equals=at,t}function _n(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)hr(t[n])}}function vn(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function yn(e){var t,n=W;kr(vn(e));try{e.f&=~Ce,_n(e),t=Ur(e)}finally{kr(n)}return t}function bn(e){var t=e.v,n=yn(e);if(!e.equals(n)&&(e.wv=Br(),(!L?.is_fork||e.deps===null)&&(e.v=n,L?.capture(e,t,!0),e.deps===null))){N(e,fe);return}Tr||(Bt===null?wt(e):(nr()||L?.is_fork)&&Bt.set(e,n))}function xn(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(Ae),t.teardown=ce,t.ac=null,Gr(t,0),pr(t))}function Sn(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&Kr(t)}var Cn=new Set,wn=new Map,Tn=!1;function En(e,t){return{f:0,v:e,reactions:null,equals:rt,rv:0,wv:0}}function R(e,t){let n=En(e,t);return jr(n),n}function Dn(e,t=!1,n=!0){let r=En(e);return t||(r.equals=at),st&&n&&A!==null&&A.l!==null&&(A.l.s??=[]).push(r),r}function z(e,t,n=!1){return U!==null&&(!Dr||U.f&131072)&&mt()&&U.f&4325394&&(Ar===null||!w.call(Ar,e))&&Ue(),On(e,n?Nn(t):t,Gt)}function On(e,t,n=null){if(!e.equals(t)){var r=e.v;Tr?wn.set(e,t):wn.set(e,r),e.v=t;var i=Jt.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&yn(t),Bt===null&&wt(t)}e.wv=Br(),Mn(e,pe,n),mt()&&W!==null&&W.f&1024&&!(W.f&96)&&(Pr===null?Fr([e]):Pr.push(e)),!i.is_fork&&Cn.size>0&&!Tn&&kn()}return t}function kn(){Tn=!1;for(let e of Cn)e.f&1024&&N(e,me),Vr(e)&&Kr(e);Cn.clear()}function An(e,t=1){var n=G(e),r=t===1?n++:n--;return z(e,n),r}function jn(e){z(e,e.v+1)}function Mn(e,t,n){var r=e.reactions;if(r!==null)for(var i=mt(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===W)){var l=(c&pe)===0;if(l&&N(s,t),c&2){var u=s;Bt?.delete(u),c&65536||(c&512&&(s.f|=Ce),Mn(u,me,n))}else if(l){var d=s;c&16&&Zt!==null&&Zt.add(d),n===null?tn(d):n.push(d)}}}}function Nn(e){if(typeof e!=`object`||!e||De in e)return e;let t=ae(e);if(t!==re&&t!==ie)return e;var n=new Map,r=S(e),i=R(0),a=null,o=Rr,s=e=>{if(Rr===o)return e();var t=U,n=Rr;Or(null),zr(o);var r=e();return Or(t),zr(n),r};return r&&n.set(`length`,R(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&Ve();var i=n.get(t);return i===void 0?s(()=>{var e=R(r.value,a);return n.set(t,e),e}):z(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>R(E,a));n.set(t,e),jn(i)}}else z(r,E),jn(i);return!0},get(t,r,i){if(r===De)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||te(t,r)?.writable)&&(o=s(()=>R(Nn(c?t[r]:E),a)),n.set(r,o)),o!==void 0){var l=G(o);return l===E?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=G(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==E)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===De)return!0;var r=n.get(t),i=r!==void 0&&r.v!==E||Reflect.has(e,t);return(r!==void 0||W!==null&&(!i||te(e,t)?.writable))&&(r===void 0&&(r=s(()=>R(i?Nn(e[t]):E,a)),n.set(t,r)),G(r)===E)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>R(E,a)),n.set(d+``,f)):z(f,E)}if(l===void 0)(!u||te(e,t)?.writable)&&(l=s(()=>R(void 0,a)),z(l,Nn(o)),n.set(t,l));else{u=l.v!==E;var p=s(()=>Nn(o));z(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&z(h,g+1)}jn(i)}return!0},ownKeys(e){G(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==E});for(var[r,a]of n)a.v!==E&&!(r in e)&&t.push(r);return t},setPrototypeOf(){He()}})}var Pn,Fn,In,Ln,Rn;function zn(){if(Pn===void 0){Pn=window,Fn=document,In=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ln=te(t,`firstChild`).get,Rn=te(t,`nextSibling`).get,oe(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),oe(n)&&(n.__t=void 0)}}function Bn(e=``){return document.createTextNode(e)}function Vn(e){return Ln.call(e)}function Hn(e){return Rn.call(e)}function B(e,t){if(!D)return Vn(e);var n=Vn(O);if(n===null)n=O.appendChild(Bn());else if(t&&n.nodeType!==3){var r=Bn();return n?.before(r),Qe(r),r}return t&&qn(n),Qe(n),n}function Un(e,t=!1){if(!D){var n=Vn(e);return n instanceof Comment&&n.data===``?Hn(n):n}if(t){if(O?.nodeType!==3){var r=Bn();return O?.before(r),Qe(r),r}qn(O)}return O}function V(e,t=1,n=!1){let r=D?O:e;for(var i;t--;)i=r,r=Hn(r);if(!D)return r;if(n){if(r?.nodeType!==3){var a=Bn();return r===null?i?.after(a):r.before(a),Qe(a),a}qn(r)}return Qe(r),r}function Wn(e){e.textContent=``}function Gn(){return!ot||Zt!==null?!1:(W.f&_e)!==0}function Kn(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function qn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Jn(e){D&&Vn(e)!==null&&Wn(e)}var Yn=!1;function Xn(){Yn||(Yn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Zn(e){var t=U,n=W;Or(null),kr(null);try{return e()}finally{Or(t),kr(n)}}function Qn(e,t,n,r=n){e.addEventListener(t,()=>Zn(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),Xn()}function $n(e){W===null&&(U===null&&Le(e),Ie()),Tr&&Fe(e)}function er(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function tr(e,t){var n=W;n!==null&&n.f&8192&&(e|=he);var r={ctx:A,deps:null,nodes:null,f:e|pe|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};L?.register_created_effect(r);var i=r;if(e&4)Wt===null?Jt.ensure().schedule(r):Wt.push(r);else if(t!==null){try{Kr(r)}catch(e){throw hr(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ye))}if(i!==null&&(i.parent=n,n!==null&&er(i,n),U!==null&&U.f&2&&!(e&64))){var a=U;(a.effects??=[]).push(i)}return r}function nr(){return U!==null&&!Dr}function rr(e){let t=tr(8,null);return N(t,fe),t.teardown=e,t}function ir(e){$n(`$effect`);var t=W.f;if(!U&&t&32&&!(t&32768)){var n=A;(n.e??=[]).push(e)}else return ar(e)}function ar(e){return tr(4|xe,e)}function or(e){Jt.ensure();let t=tr(64|be,e);return(e={})=>new Promise(n=>{e.outro?vr(t,()=>{hr(t),n(void 0)}):(hr(t),n(void 0))})}function sr(e){return tr(4,e)}function cr(e){return tr(Te|be,e)}function lr(e,t=0){return tr(8|t,e)}function H(e,t=[],n=[],r=[]){ln(r,t,n,t=>{tr(8,()=>e(...t.map(G)))})}function ur(e,t=0){return tr(16|t,e)}function dr(e){return tr(32|be,e)}function fr(e){var t=e.teardown;if(t!==null){let e=Tr,n=U;Er(!0),Or(null);try{t.call(null)}finally{Er(e),Or(n)}}}function pr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Zn(()=>{e.abort(Ae)});var r=n.next;n.f&64?n.parent=null:hr(n,t),n=r}}function mr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||hr(t),t=n}}function hr(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(gr(e.nodes.start,e.nodes.end),n=!0),N(e,ve),pr(e,t&&!n),Gr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();fr(e),e.f^=ve,e.f|=ge;var i=e.parent;i!==null&&i.first!==null&&_r(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function gr(e,t){for(;e!==null;){var n=e===t?null:Hn(e);e.remove(),e=n}}function _r(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function vr(e,t,n=!0){var r=[];yr(e,r,!0);var i=()=>{n&&hr(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function yr(e,t,n){if(!(e.f&8192)){e.f^=he;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;yr(i,t,o?n:!1),i=a}}}function br(e){xr(e,!0)}function xr(e,t){if(e.f&8192){e.f^=he,e.f&1024||(N(e,pe),Jt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;xr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Sr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Hn(n);t.append(n),n=i}}var Cr=null,wr=!1,Tr=!1;function Er(e){Tr=e}var U=null,Dr=!1;function Or(e){U=e}var W=null;function kr(e){W=e}var Ar=null;function jr(e){U!==null&&(!ot||U.f&2)&&(Ar===null?Ar=[e]:Ar.push(e))}var Mr=null,Nr=0,Pr=null;function Fr(e){Pr=e}var Ir=1,Lr=0,Rr=Lr;function zr(e){Rr=e}function Br(){return++Ir}function Vr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~Ce),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Vr(a)&&bn(a),a.wv>e.wv)return!0}t&512&&Bt===null&&N(e,fe)}return!1}function Hr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!ot&&Ar!==null&&w.call(Ar,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Hr(a,t,!1):t===a&&(n?N(a,pe):a.f&1024&&N(a,me),tn(a))}}function Ur(e){var t=Mr,n=Nr,r=Pr,i=U,a=Ar,o=A,s=Dr,c=Rr,l=e.f;Mr=null,Nr=0,Pr=null,U=l&96?null:e,Ar=null,dt(e.ctx),Dr=!1,Rr=++Lr,e.ac!==null&&(Zn(()=>{e.ac.abort(Ae)}),e.ac=null);try{e.f|=we;var u=e.fn,d=u();e.f|=_e;var f=e.deps,p=L?.is_fork;if(Mr!==null){var m;if(p||Gr(e,Nr),f!==null&&Nr>0)for(f.length=Nr+Mr.length,m=0;m<Mr.length;m++)f[Nr+m]=Mr[m];else e.deps=f=Mr;if(nr()&&e.f&512)for(m=Nr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Nr<f.length&&(Gr(e,Nr),f.length=Nr);if(mt()&&Pr!==null&&!Dr&&f!==null&&!(e.f&6146))for(m=0;m<Pr.length;m++)Hr(Pr[m],e);if(i!==null&&i!==e){if(Lr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Lr;if(t!==null)for(let e of t)e.rv=Lr;Pr!==null&&(r===null?r=Pr:r.push(...Pr))}return e.f&8388608&&(e.f^=Ee),d}catch(e){return xt(e)}finally{e.f^=we,Mr=t,Nr=n,Pr=r,U=i,Ar=a,dt(o),Dr=s,Rr=c}}function Wr(e,t){let n=t.reactions;if(n!==null){var r=C.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Mr===null||!w.call(Mr,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~Ce),wt(a),xn(a),Gr(a,0)}}function Gr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Wr(e,n[r])}function Kr(e){var t=e.f;if(!(t&16384)){N(e,fe);var n=W,r=wr;W=e,wr=!0;try{t&16777232?mr(e):pr(e),fr(e);var i=Ur(e);e.teardown=typeof i==`function`?i:null,e.wv=Ir}finally{wr=r,W=n}}}async function qr(){if(ot)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Yt()}function G(e){var t=(e.f&2)!=0;if(Cr?.add(e),U!==null&&!Dr&&!(W!==null&&W.f&16384)&&(Ar===null||!w.call(Ar,e))){var n=U.deps;if(U.f&2097152)e.rv<Lr&&(e.rv=Lr,Mr===null&&n!==null&&n[Nr]===e?Nr++:Mr===null?Mr=[e]:Mr.push(e));else{(U.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[U]:w.call(r,U)||r.push(U)}}if(Tr&&wn.has(e))return wn.get(e);if(t){var i=e;if(Tr){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Yr(i))&&(a=yn(i)),wn.set(i,a),a}var o=(i.f&512)==0&&!Dr&&U!==null&&(wr||(U.f&512)!=0),s=(i.f&_e)===0;Vr(i)&&(o&&(i.f|=512),bn(i)),o&&!s&&(Sn(i),Jr(i))}if(Bt?.has(e))return Bt.get(e);if(e.f&8388608)throw e.v;return e.v}function Jr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Sn(t),Jr(t))}function Yr(e){if(e.v===E)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(wn.has(t)||t.f&2&&Yr(t))return!0;return!1}function Xr(e){var t=Dr;try{return Dr=!0,e()}finally{Dr=t}}function Zr(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(De in e)Qr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&De in n&&Qr(n)}}}function Qr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Qr(e[n],t)}catch{}let n=ae(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=ne(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var $r=[`touchstart`,`touchmove`];function ei(e){return $r.includes(e)}var ti=Symbol(`events`),ni=new Set,ri=new Set;function ii(e){if(!D)return;e.removeAttribute(`onload`),e.removeAttribute(`onerror`);let t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function ai(e,t,n,r={}){function i(e){if(r.capture||li.call(t,e),!e.cancelBubble)return Zn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?yt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function oi(e,t,n,r,i){var a={capture:r,passive:i},o=ai(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&rr(()=>{t.removeEventListener(e,o,a)})}function K(e,t,n){(t[ti]??={})[e]=n}function si(e){for(var t=0;t<e.length;t++)ni.add(e[t]);for(var n of ri)n(e)}var ci=null;function li(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;ci=e;var o=0,s=ci===e&&e[ti];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[ti]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){ee(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=U,d=W;Or(null),kr(null);try{for(var f,p=[];a!==null;){var m=a.assignedSlot||a.parentNode||a.host||null;try{var h=a[ti]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble||m===t||m===null)break;a=m}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[ti]=t,delete e.currentTarget,Or(u),kr(d)}}}var ui=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function di(e){return ui?.createHTML(e)??e}function fi(e){var t=Kn(`template`);return t.innerHTML=di(e.replaceAll(`<!>`,`<!---->`)),t.content}function pi(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function q(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(D)return pi(O,null),O;i===void 0&&(i=fi(a?e:`<!>`+e),n||(i=Vn(i)));var t=r||In?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Vn(t),s=t.lastChild;pi(o,s)}else pi(t,t);return t}}function mi(){if(D)return pi(O,null),O;var e=document.createDocumentFragment(),t=document.createComment(``),n=Bn();return e.append(t,n),pi(t,n),e}function J(e,t){if(D){var n=W;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=O),$e();return}e!==null&&e.before(t)}function Y(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function hi(e,t){return _i(e,t)}var gi=new Map;function _i(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){zn();var c=void 0,l=or(()=>{var o=n??t.appendChild(Bn());sn(o,{pending:()=>{}},t=>{j({});var n=A;if(a&&(n.c=a),i&&(r.$$events=i),D&&pi(t,null),c=e(t,r)||{},D&&(W.nodes.end=O,O===null||O.nodeType!==8||O.data!==`]`))throw Ye(),Ge;M()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=ei(r);for(let e of[t,document]){var a=gi.get(e);a===void 0&&(a=new Map,gi.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,li,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(T(ni)),ri.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=gi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,li),r.delete(e),r.size===0&&gi.delete(n)):r.set(e,i)}ri.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return vi.set(c,l),c}var vi=new WeakMap,yi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)br(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(hr(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Sr(r,t),t.append(Bn()),this.#n.set(e,{effect:r,fragment:t})}else hr(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),vr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(hr(n.effect),this.#n.delete(e))};ensure(e,t){var n=L,r=Gn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Bn();i.append(a),this.#n.set(e,{effect:dr(()=>t(a)),fragment:i})}else this.#t.set(e,dr(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else D&&(this.anchor=O),this.#a(n)}},bi=0,xi=1,Si=2;function Ci(e,t,n,r,i){D&&$e();var a=mt(),o=E,s=a?En(o):Dn(o,!1,!1),c=a?En(o):Dn(o,!1,!1),l=new yi(e);ur(()=>{var a=L;a.deactivate();var o=t();a.activate();var u=!1;let d=D&&le(o)===(e.data===`[!`);if(d&&(Qe(tt()),Ze(!1)),le(o)){var f=un(),p=!1;let e=e=>{if(!u){p=!0,f(!1),Jt.ensure(),D&&Ze(!1);try{e()}finally{dn(!1),Ht||Yt()}}};o.then(t=>{e(()=>{On(s,t),l.ensure(xi,r&&(e=>r(e,s)))})},t=>{e(()=>{if(On(c,t),l.ensure(Si,i&&(e=>i(e,c))),!i)throw c.v})}),D?l.ensure(bi,n):yt(()=>{p||e(()=>{l.ensure(bi,n)})})}else On(s,o),l.ensure(xi,r&&(e=>r(e,s)));return d&&Ze(!0),()=>{u=!0}})}function wi(e,t,n=!1){var r;D&&(r=O,$e());var i=new yi(e),a=n?ye:0;function o(e,t){if(D){var n=nt(r);if(e!==parseInt(n.substring(1))){var a=tt();Qe(a),i.anchor=a,Ze(!1),i.ensure(e,t),Ze(!0);return}}i.ensure(e,t)}ur(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Ti(e,t){return t}function Ei(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];vr(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Di(e,T(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;Wn(u),u.append(l),e.items.clear()}Di(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Di(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=Se,Sr(a,document.createDocumentFragment())):hr(t[i],n)}}var Oi;function ki(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=D?Qe(Vn(c)):c.appendChild(Bn())}D&&$e();var l=null,u=gn(()=>{var e=n();return S(e)?e:e==null?[]:T(e)}),d,f=new Map,p=!0;function m(e){g.effect.f&16384||(g.pending.delete(e),g.fallback=l,ji(g,d,o,t,r),l!==null&&(d.length===0?l.f&33554432?(l.f^=Se,Ni(l,null,o)):br(l):vr(l,()=>{l=null})))}function h(e){g.pending.delete(e)}var g={effect:ur(()=>{d=G(u);var e=d.length;let c=!1;D&&nt(o)===`[!`!=(e===0)&&(o=tt(),Qe(o),Ze(!1),c=!0);for(var g=new Set,_=L,v=Gn(),y=0;y<e;y+=1){D&&O.nodeType===8&&O.data===`]`&&(o=O,c=!0,Ze(!1));var b=d[y],x=r(b,y),S=p?null:s.get(x);S?(S.v&&On(S.v,b),S.i&&On(S.i,y),v&&_.unskip_effect(S.e)):(S=Mi(s,p?o:Oi??=Bn(),b,x,y,i,t,n),p||(S.e.f|=Se),s.set(x,S)),g.add(x)}if(e===0&&a&&!l&&(p?l=dr(()=>a(o)):(l=dr(()=>a(Oi??=Bn())),l.f|=Se)),e>g.size&&Pe(``,``,``),D&&e>0&&Qe(tt()),!p)if(f.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(m),_.ondiscard(h)}else m(_);c&&Ze(!0),G(u)}),flags:t,items:s,pending:f,outrogroups:null,fallback:l};p=!1,D&&(o=O)}function Ai(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function ji(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=Ai(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(br(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432)if(g.f^=Se,g===c)Ni(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Pi(e,u,g),Pi(e,g,v),Ni(g,v,n),u=g,f=[],p=[],c=Ai(u.next);continue}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],S=f[f.length-1];for(b=0;b<f.length;b+=1)Ni(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);Pi(e,x.prev,S.next),Pi(e,u,x),Pi(e,S,y),c=y,u=S,--_,f=[],p=[]}else l.delete(g),Ni(g,c,n),Pi(e,g.prev,g.next),Pi(e,g,u===null?e.effect.first:u.next),Pi(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=Ai(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=Ai(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Di(e,T(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=Ai(c.next);var w=C.length;if(w>0){var ee=r&4&&o===0?n:null;if(a){for(_=0;_<w;_+=1)C[_].nodes?.a?.measure();for(_=0;_<w;_+=1)C[_].nodes?.a?.fix()}Ei(e,C,ee)}}a&&yt(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Mi(e,t,n,r,i,a,o,s){var c=o&1?o&16?En(n):Dn(n,!1,!1):null,l=o&2?En(i):null;return{v:c,i:l,e:dr(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ni(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Hn(r);if(a.before(r),r===i)return;r=o}}function Pi(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Fi(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;D&&(o=Qe(Vn(c)))}H(()=>{var e=W;if(s===(s=t()??``)){D&&$e();return}if(n&&!D){e.nodes=null,c.innerHTML=s,s!==``&&pi(Vn(c),c.lastChild);return}if(e.nodes!==null&&(gr(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(D){for(var a=O.data,l=$e(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=Hn(l);if(l===null)throw Ye(),Ge;pi(O,u),o=Qe(l);return}var d=Kn(r?`svg`:i?`math`:`template`,r?qe:i?Je:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(pi(Vn(f),f.lastChild),r||i)for(;Vn(f);)o.before(Vn(f));else o.before(f)}})}function Ii(e,t,n){var r;D&&(r=O,$e());var i=new yi(e);ur(()=>{var e=t()??null;if(D&&nt(r)===`[`!=(e!==null)){var a=tt();Qe(a),i.anchor=a,Ze(!1),i.ensure(e,e&&(t=>n(t,e))),Ze(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ye)}function Li(e,t,n){sr(()=>{var r=Xr(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};lr(()=>{var e=n();Zr(e),i&&it(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}var Ri=[...`
2
+ \r\f\xA0\v`];function zi(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Ri.includes(r[o-1]))&&(s===r.length||Ri.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Bi(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Vi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Hi(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Vi)),i&&c.push(...Object.keys(i).map(Vi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Vi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Bi(r)),i&&(n+=Bi(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Ui(e,t,n,r,i,a){var o=e.__className;if(D||o!==n||o===void 0){var s=zi(n,r,a);(!D||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Wi(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Gi(e,t,n,r){var i=e.__style;if(D||i!==t){var a=Hi(t,r);(!D||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(Wi(e,n?.[0],r[0]),Wi(e,n?.[1],r[1],`important`)):Wi(e,n,r));return r}var Ki=Symbol(`is custom element`),qi=Symbol(`is html`),Ji=je?`link`:`LINK`,Yi=je?`progress`:`PROGRESS`;function Xi(e){if(D){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;X(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;X(e,`checked`,null),e.checked=r}}};e.__on_r=n,yt(n),Xn()}}function Zi(e,t){var n=Qi(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==Yi)||(e.value=t??``)}function X(e,t,n,r){var i=Qi(e);D&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ji)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ke]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ea(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Qi(e){return e.__attributes??={[Ki]:e.nodeName.includes(`-`),[qi]:e.namespaceURI===Ke}}var $i=new Map;function ea(e){var t=e.getAttribute(`is`)||e.nodeName,n=$i.get(t);if(n)return n;$i.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=ne(i),r)r[o].set&&n.push(o);i=ae(i)}return n}function ta(e,t,n=t){var r=new WeakSet;Qn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ra(e)?ia(a):a,n(a),L!==null&&r.add(L),await qr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(D&&e.defaultValue!==e.value||Xr(t)==null&&e.value)&&(n(ra(e)?ia(e.value):e.value),L!==null&&r.add(L)),lr(()=>{var n=t();if(e===document.activeElement){var i=ot?zt:L;if(r.has(i))return}ra(e)&&n===ia(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function na(e,t,n=t){Qn(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(D&&e.defaultChecked!==e.checked||Xr(t)==null)&&n(e.checked),lr(()=>{e.checked=!!t()})}function ra(e){var t=e.type;return t===`number`||t===`range`}function ia(e){return e===``?null:+e}function aa(e,t){return e===t||e?.[De]===t}function oa(e={},t,n,r){var i=A.r,a=W;return sr(()=>{var o,s;return lr(()=>{o=s,s=r?.()||[],Xr(()=>{e!==n(...s)&&(t(e,...s),o&&aa(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&aa(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var sa={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(se(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];se(i)&&(i=i());let a=te(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(se(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=te(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===De||t===Oe)return!1;for(let n of e.props)if(se(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(se(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function ca(...e){return new Proxy({props:e},sa)}function la(e,t,n,r){var i=!st||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?Xr(r):r),s);let u;if(a){var d=De in e||Oe in e;u=te(e,t)?.set??(d&&t in e?n=>e[t]=n:void 0)}var f,p=!1;a?[f,p]=Lt(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=l(),u&&(i&&ze(t),u(f)));var m=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return m;if(u){var h=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||h||p)&&u(t?m():e),e):m()})}var g=!1,_=(n&1?pn:gn)(()=>(g=!1,m()));a&&G(_);var v=W;return(function(e,t){if(arguments.length>0){let n=t?G(_):i&&a?Nn(e):e;return z(_,n),g=!0,s!==void 0&&(s=n),e}return Tr&&g||v.f&16384?_.v:G(_)})}function ua(e){A===null&&Me(`onMount`),st&&A.l!==null?da(A).m.push(e):ir(()=>{let t=Xr(e);if(typeof t==`function`)return t})}function da(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var fa=`<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>`,pa=`<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>`,ma=`<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>`;function ha(e){return e==null}function ga(e){return typeof e==`object`&&!!e}function _a(e){return Array.isArray(e)?e:ha(e)?[]:[e]}function va(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function ya(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function ba(e){return e===0&&1/e==-1/0}var Z={isNothing:ha,isObject:ga,toArray:_a,repeat:ya,isNegativeZero:ba,extend:va};function xa(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+=`
3
3
 
4
- `+e.mark.snippet),r+" "+n):r}function Kn(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Tl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Kn.prototype=Object.create(Error.prototype);Kn.prototype.constructor=Kn;Kn.prototype.toString=function(t){return this.name+": "+Tl(this,t)};var Ie=Kn;function mi(e,t,n,r,i){var a="",o="",s=Math.floor(i/2)-1;return r-t>s&&(a=" ... ",t=r-s+a.length),n-r>s&&(o=" ...",n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+a.length}}function gi(e,t){return pe.repeat(" ",t-e.length)+e}function wd(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=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s="",l,c,f=Math.min(e.line+t.linesAfter,i.length).toString().length,u=t.maxLength-(t.indent+f+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=mi(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),u),s=pe.repeat(" ",t.indent)+gi((e.line-l+1).toString(),f)+" | "+c.str+`
5
- `+s;for(c=mi(e.buffer,r[o],i[o],e.position,u),s+=pe.repeat(" ",t.indent)+gi((e.line+1).toString(),f)+" | "+c.str+`
6
- `,s+=pe.repeat("-",t.indent+f+3+c.pos)+`^
7
- `,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)c=mi(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),u),s+=pe.repeat(" ",t.indent)+gi((e.line+l+1).toString(),f)+" | "+c.str+`
8
- `;return s.replace(/\n$/,"")}var _d=wd,bd=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],kd=["scalar","sequence","mapping"];function xd(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Ad(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(bd.indexOf(n)===-1)throw new Ie('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=xd(t.styleAliases||null),kd.indexOf(this.kind)===-1)throw new Ie('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var we=Ad;function Do(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(a,o){a.tag===r.tag&&a.kind===r.kind&&a.multi===r.multi&&(i=o)}),n[i]=r}),n}function Ed(){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 $i(e){return this.extend(e)}$i.prototype.extend=function(t){var n=[],r=[];if(t instanceof we)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 Ie("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(a){if(!(a instanceof we))throw new Ie("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Ie("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Ie("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(a){if(!(a instanceof we))throw new Ie("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create($i.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Do(i,"implicit"),i.compiledExplicit=Do(i,"explicit"),i.compiledTypeMap=Ed(i.compiledImplicit,i.compiledExplicit),i};var Ol=$i,$l=new we("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Dl=new we("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Rl=new we("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Fl=new Ol({explicit:[$l,Dl,Rl]});function Cd(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Sd(){return null}function Md(e){return e===null}var Hl=new we("tag:yaml.org,2002:null",{kind:"scalar",resolve:Cd,construct:Sd,predicate:Md,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Id(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 Ld(e){return e==="true"||e==="True"||e==="TRUE"}function Nd(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Pl=new we("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Id,construct:Ld,predicate:Nd,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 Td(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Od(e){return 48<=e&&e<=55}function $d(e){return 48<=e&&e<=57}function Dd(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(!Td(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Od(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!$d(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function Rd(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 Fd(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!pe.isNegativeZero(e)}var Bl=new we("tag:yaml.org,2002:int",{kind:"scalar",resolve:Dd,construct:Rd,predicate:Fd,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"]}}),Hd=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Pd(e){return!(e===null||!Hd.test(e)||e[e.length-1]==="_")}function Bd(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 jd=/^[-+]?[0-9]+e/;function qd(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(pe.isNegativeZero(e))return"-0.0";return n=e.toString(10),jd.test(n)?n.replace("e",".e"):n}function Vd(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||pe.isNegativeZero(e))}var jl=new we("tag:yaml.org,2002:float",{kind:"scalar",resolve:Pd,construct:Bd,predicate:Vd,represent:qd,defaultStyle:"lowercase"}),ql=Fl.extend({implicit:[Hl,Pl,Bl,jl]}),Vl=ql,Ul=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Yl=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 Ud(e){return e===null?!1:Ul.exec(e)!==null||Yl.exec(e)!==null}function Yd(e){var t,n,r,i,a,o,s,l=0,c=null,f,u,p;if(t=Ul.exec(e),t===null&&(t=Yl.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(a=+t[4],o=+t[5],s=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(f=+t[10],u=+(t[11]||0),c=(f*60+u)*6e4,t[9]==="-"&&(c=-c)),p=new Date(Date.UTC(n,r,i,a,o,s,l)),c&&p.setTime(p.getTime()-c),p}function Wd(e){return e.toISOString()}var Wl=new we("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Ud,construct:Yd,instanceOf:Date,represent:Wd});function Kd(e){return e==="<<"||e===null}var Kl=new we("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Kd}),ua=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
- \r`;function zd(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=ua;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function Gd(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=ua,o=0,s=[];for(t=0;t<i;t++)t%4===0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}function Zd(e){var t="",n=0,r,i,a=e.length,o=ua;for(r=0;r<a;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=a%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 Jd(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var zl=new we("tag:yaml.org,2002:binary",{kind:"scalar",resolve:zd,construct:Gd,predicate:Jd,represent:Zd}),Qd=Object.prototype.hasOwnProperty,Xd=Object.prototype.toString;function ep(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,Xd.call(i)!=="[object Object]")return!1;for(a in i)if(Qd.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function tp(e){return e!==null?e:[]}var Gl=new we("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ep,construct:tp}),np=Object.prototype.toString;function rp(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],np.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function ip(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var Zl=new we("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:rp,construct:ip}),ap=Object.prototype.hasOwnProperty;function op(e){if(e===null)return!0;var t,n=e;for(t in n)if(ap.call(n,t)&&n[t]!==null)return!1;return!0}function sp(e){return e!==null?e:{}}var Jl=new we("tag:yaml.org,2002:set",{kind:"mapping",resolve:op,construct:sp}),fa=Vl.extend({implicit:[Wl,Kl],explicit:[zl,Gl,Zl,Jl]}),Vt=Object.prototype.hasOwnProperty,Ir=1,Ql=2,Xl=3,Lr=4,vi=1,lp=2,Ro=3,cp=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,up=/[\x85\u2028\u2029]/,fp=/[,\[\]\{\}]/,ec=/^(?:!|!!|![a-z\-]+!)$/i,tc=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Fo(e){return Object.prototype.toString.call(e)}function dt(e){return e===10||e===13}function Jt(e){return e===9||e===32}function De(e){return e===9||e===32||e===10||e===13}function gn(e){return e===44||e===91||e===93||e===123||e===125}function dp(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function pp(e){return e===120?2:e===117?4:e===85?8:0}function hp(e){return 48<=e&&e<=57?e-48:-1}function Ho(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
10
- `: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 mp(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function nc(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var rc=new Array(256),ic=new Array(256);for(var fn=0;fn<256;fn++)rc[fn]=Ho(fn)?1:0,ic[fn]=Ho(fn);function gp(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||fa,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 ac(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=_d(n),new Ie(t,n)}function F(e,t){throw ac(e,t)}function Nr(e,t){e.onWarning&&e.onWarning.call(null,ac(e,t))}var Po={YAML:function(t,n,r){var i,a,o;t.version!==null&&F(t,"duplication of %YAML directive"),r.length!==1&&F(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&F(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&F(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Nr(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,a;r.length!==2&&F(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],ec.test(i)||F(t,"ill-formed tag handle (first argument) of the TAG directive"),Vt.call(t.tagMap,i)&&F(t,'there is a previously declared suffix for "'+i+'" tag handle'),tc.test(a)||F(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{F(t,"tag prefix is malformed: "+a)}t.tagMap[i]=a}};function Bt(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||F(e,"expected valid JSON character");else cp.test(s)&&F(e,"the stream contains non-printable characters");e.result+=s}}function Bo(e,t,n,r){var i,a,o,s;for(pe.isObject(n)||F(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Vt.call(t,a)||(nc(t,a,n[a]),r[a]=!0)}function vn(e,t,n,r,i,a,o,s,l){var c,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,f=i.length;c<f;c+=1)Array.isArray(i[c])&&F(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Fo(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&Fo(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(c=0,f=a.length;c<f;c+=1)Bo(e,t,a[c],n);else Bo(e,t,a,n);else!e.json&&!Vt.call(n,i)&&Vt.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,F(e,"duplicated mapping key")),nc(t,i,a),delete n[i];return t}function da(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++):F(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function fe(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Jt(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(dt(i))for(da(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&&Nr(e,"deficient indentation"),r}function zr(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||De(n)))}function pa(e,t){t===1?e.result+=" ":t>1&&(e.result+=pe.repeat(`
11
- `,t-1))}function vp(e,t,n){var r,i,a,o,s,l,c,f,u=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),De(d)||gn(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),De(i)||n&&gn(i)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),De(i)||n&&gn(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),De(r))break}else{if(e.position===e.lineStart&&zr(e)||n&&gn(d))break;if(dt(d))if(l=e.line,c=e.lineStart,f=e.lineIndent,fe(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=f;break}}s&&(Bt(e,a,o,!1),pa(e,e.line-l),a=o=e.position,s=!1),Jt(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return Bt(e,a,o,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function yp(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(Bt(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 dt(n)?(Bt(e,r,i,!0),pa(e,fe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&zr(e)?F(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);F(e,"unexpected end of the stream within a single quoted scalar")}function wp(e,t){var n,r,i,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return Bt(e,n,e.position,!0),e.position++,!0;if(s===92){if(Bt(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),dt(s))fe(e,!1,t);else if(s<256&&rc[s])e.result+=ic[s],e.position++;else if((o=pp(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=dp(s))>=0?a=(a<<4)+o:F(e,"expected hexadecimal character");e.result+=mp(a),e.position++}else F(e,"unknown escape sequence");n=r=e.position}else dt(s)?(Bt(e,n,r,!0),pa(e,fe(e,!1,t)),n=r=e.position):e.position===e.lineStart&&zr(e)?F(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}F(e,"unexpected end of the stream within a double quoted scalar")}function _p(e,t){var n=!0,r,i,a,o=e.tag,s,l=e.anchor,c,f,u,p,d,h=Object.create(null),g,m,v,w;if(w=e.input.charCodeAt(e.position),w===91)f=93,d=!1,s=[];else if(w===123)f=125,d=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),w=e.input.charCodeAt(++e.position);w!==0;){if(fe(e,!0,t),w=e.input.charCodeAt(e.position),w===f)return e.position++,e.tag=o,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=s,!0;n?w===44&&F(e,"expected the node content, but found ','"):F(e,"missed comma between flow collection entries"),m=g=v=null,u=p=!1,w===63&&(c=e.input.charCodeAt(e.position+1),De(c)&&(u=p=!0,e.position++,fe(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,Cn(e,t,Ir,!1,!0),m=e.tag,g=e.result,fe(e,!0,t),w=e.input.charCodeAt(e.position),(p||e.line===r)&&w===58&&(u=!0,w=e.input.charCodeAt(++e.position),fe(e,!0,t),Cn(e,t,Ir,!1,!0),v=e.result),d?vn(e,s,h,m,g,v,r,i,a):u?s.push(vn(e,null,h,m,g,v,r,i,a)):s.push(g),fe(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(n=!0,w=e.input.charCodeAt(++e.position)):n=!1}F(e,"unexpected end of the stream within a flow collection")}function bp(e,t){var n,r,i=vi,a=!1,o=!1,s=t,l=0,c=!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)vi===i?i=u===43?Ro:lp:F(e,"repeat of a chomping mode identifier");else if((f=hp(u))>=0)f===0?F(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?F(e,"repeat of an indentation width identifier"):(s=t+f-1,o=!0);else break;if(Jt(u)){do u=e.input.charCodeAt(++e.position);while(Jt(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!dt(u)&&u!==0)}for(;u!==0;){for(da(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),dt(u)){l++;continue}if(e.lineIndent<s){i===Ro?e.result+=pe.repeat(`
12
- `,a?1+l:l):i===vi&&a&&(e.result+=`
13
- `);break}for(r?Jt(u)?(c=!0,e.result+=pe.repeat(`
14
- `,a?1+l:l)):c?(c=!1,e.result+=pe.repeat(`
15
- `,l+1)):l===0?a&&(e.result+=" "):e.result+=pe.repeat(`
16
- `,l):e.result+=pe.repeat(`
17
- `,a?1+l:l),a=!0,o=!0,l=0,n=e.position;!dt(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Bt(e,n,e.position,!1)}return!0}function jo(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,F(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!De(o))));){if(s=!0,e.position++,fe(e,!0,-1)&&e.lineIndent<=t){a.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,Cn(e,t,Xl,!1,!0),a.push(e.result),fe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)F(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function kp(e,t,n){var r,i,a,o,s,l,c=e.tag,f=e.anchor,u={},p=Object.create(null),d=null,h=null,g=null,m=!1,v=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),w=e.input.charCodeAt(e.position);w!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,F(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),a=e.line,(w===63||w===58)&&De(r))w===63?(m&&(vn(e,u,p,d,h,null,o,s,l),d=h=g=null),v=!0,m=!0,i=!0):m?(m=!1,i=!0):F(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=r;else{if(o=e.line,s=e.lineStart,l=e.position,!Cn(e,n,Ql,!1,!0))break;if(e.line===a){for(w=e.input.charCodeAt(e.position);Jt(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),De(w)||F(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(vn(e,u,p,d,h,null,o,s,l),d=h=g=null),v=!0,m=!1,i=!1,d=e.tag,h=e.result;else if(v)F(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(v)F(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===a||e.lineIndent>t)&&(m&&(o=e.line,s=e.lineStart,l=e.position),Cn(e,t,Lr,!0,i)&&(m?h=e.result:g=e.result),m||(vn(e,u,p,d,h,g,o,s,l),d=h=g=null),fe(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&w!==0)F(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&vn(e,u,p,d,h,null,o,s,l),v&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),v}function xp(e){var t,n=!1,r=!1,i,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&F(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?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):F(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!De(o);)o===33&&(r?F(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),ec.test(i)||F(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),fp.test(a)&&F(e,"tag suffix cannot contain flow indicator characters")}a&&!tc.test(a)&&F(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{F(e,"tag name is malformed: "+a)}return n?e.tag=a:Vt.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:F(e,'undeclared tag handle "'+i+'"'),!0}function Ap(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&F(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!De(n)&&!gn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&F(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ep(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&&!De(r)&&!gn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&F(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Vt.call(e.anchorMap,n)||F(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],fe(e,!0,-1),!0}function Cn(e,t,n,r,i){var a,o,s,l=1,c=!1,f=!1,u,p,d,h,g,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Lr===n||Xl===n,r&&fe(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;xp(e)||Ap(e);)fe(e,!0,-1)?(c=!0,s=a,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):s=!1;if(s&&(s=c||i),(l===1||Lr===n)&&(Ir===n||Ql===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?s&&(jo(e,m)||kp(e,m,g))||_p(e,g)?f=!0:(o&&bp(e,g)||yp(e,g)||wp(e,g)?f=!0:Ep(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&F(e,"alias node should not have any properties")):vp(e,g,Ir===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=s&&jo(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&F(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if(h=e.implicitTypes[u],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Vt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,d=e.typeMap.multi[e.kind||"fallback"],u=0,p=d.length;u<p;u+=1)if(e.tag.slice(0,d[u].tag.length)===d[u].tag){h=d[u];break}h||F(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&F(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):F(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 Cp(e){var t=e.position,n,r,i,a=!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&&(fe(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!De(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&F(e,"directive name must not be less than one character in length");o!==0;){for(;Jt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!dt(o));break}if(dt(o))break;for(n=e.position;o!==0&&!De(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&da(e),Vt.call(Po,r)?Po[r](e,r,i):Nr(e,'unknown document directive "'+r+'"')}if(fe(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,fe(e,!0,-1)):a&&F(e,"directives end mark is expected"),Cn(e,e.lineIndent-1,Lr,!1,!0),fe(e,!0,-1),e.checkLineBreaks&&up.test(e.input.slice(t,e.position))&&Nr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&zr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,fe(e,!0,-1));return}if(e.position<e.length-1)F(e,"end of the stream or a document separator is expected");else return}function oc(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
18
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new gp(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,F(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;)Cp(n);return n.documents}function Sp(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=oc(e,n);if(typeof t!="function")return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function Mp(e,t){var n=oc(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ie("expected a single document in the stream, but found more")}}var Ip=Sp,Lp=Mp,sc={loadAll:Ip,load:Lp},lc=Object.prototype.toString,cc=Object.prototype.hasOwnProperty,ha=65279,Np=9,zn=10,Tp=13,Op=32,$p=33,Dp=34,Di=35,Rp=37,Fp=38,Hp=39,Pp=42,uc=44,Bp=45,Tr=58,jp=61,qp=62,Vp=63,Up=64,fc=91,dc=93,Yp=96,pc=123,Wp=124,hc=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 Kp=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],zp=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Gp(e,t){var n,r,i,a,o,s,l;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&cc.call(l.styleAliases,s)&&(s=l.styleAliases[s]),n[o]=s;return n}function Zp(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 Ie("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+pe.repeat("0",r-t.length)+t}var Jp=1,Gn=2;function Qp(e){this.schema=e.schema||fa,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=pe.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Gp(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==='"'?Gn:Jp,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 qo(e,t){for(var n=pe.repeat(" ",t),r=0,i=-1,a="",o,s=e.length;r<s;)i=e.indexOf(`
4
+ `+e.mark.snippet),r+` `+n):r}function Sa(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=xa(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}Sa.prototype=Object.create(Error.prototype),Sa.prototype.constructor=Sa,Sa.prototype.toString=function(e){return this.name+`: `+xa(this,e)};var Ca=Sa;function wa(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function Ta(e,t){return Z.repeat(` `,t-e.length)+e}function Ea(e,t){if(t=Object.create(t||null),!e.buffer)return null;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=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s=``,c,l,u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=wa(e.buffer,r[o-c],i[o-c],e.position-(r[o]-r[o-c]),d),s=Z.repeat(` `,t.indent)+Ta((e.line-c+1).toString(),u)+` | `+l.str+`
5
+ `+s;for(l=wa(e.buffer,r[o],i[o],e.position,d),s+=Z.repeat(` `,t.indent)+Ta((e.line+1).toString(),u)+` | `+l.str+`
6
+ `,s+=Z.repeat(`-`,t.indent+u+3+l.pos)+`^
7
+ `,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)l=wa(e.buffer,r[o+c],i[o+c],e.position-(r[o]-r[o+c]),d),s+=Z.repeat(` `,t.indent)+Ta((e.line+c+1).toString(),u)+` | `+l.str+`
8
+ `;return s.replace(/\n$/,``)}var Da=Ea,Oa=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],ka=[`scalar`,`sequence`,`mapping`];function Aa(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function ja(e,t){if(t||={},Object.keys(t).forEach(function(t){if(Oa.indexOf(t)===-1)throw new Ca(`Unknown option "`+t+`" 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(e){return e},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=Aa(t.styleAliases||null),ka.indexOf(this.kind)===-1)throw new Ca(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}var Ma=ja;function Na(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function Pa(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Fa(e){return this.extend(e)}Fa.prototype.extend=function(e){var t=[],n=[];if(e instanceof Ma)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new Ca(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof Ma))throw new Ca(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new Ca(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(e.multi)throw new Ca(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),n.forEach(function(e){if(!(e instanceof Ma))throw new Ca(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(Fa.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=Na(r,`implicit`),r.compiledExplicit=Na(r,`explicit`),r.compiledTypeMap=Pa(r.compiledImplicit,r.compiledExplicit),r};var Ia=Fa,La=new Ma(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:function(e){return e===null?``:e}}),Ra=new Ma(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:function(e){return e===null?[]:e}}),za=new Ma(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:function(e){return e===null?{}:e}}),Ba=new Ia({explicit:[La,Ra,za]});function Va(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}function Ha(){return null}function Ua(e){return e===null}var Wa=new Ma(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:Va,construct:Ha,predicate:Ua,represent:{canonical:function(){return`~`},lowercase:function(){return`null`},uppercase:function(){return`NULL`},camelcase:function(){return`Null`},empty:function(){return``}},defaultStyle:`lowercase`});function Ga(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 Ka(e){return e===`true`||e===`True`||e===`TRUE`}function qa(e){return Object.prototype.toString.call(e)===`[object Boolean]`}var Ja=new Ma(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:Ga,construct:Ka,predicate:qa,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 Ya(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Xa(e){return 48<=e&&e<=55}function Za(e){return 48<=e&&e<=57}function Qa(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(!Ya(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!Xa(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!Za(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}function $a(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&&!Z.isNegativeZero(e)}var to=new Ma(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:Qa,construct:$a,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`]}}),no=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=e.replace(/_/g,``).toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}var ao=/^[-+]?[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(e===1/0)switch(t){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(e===-1/0)switch(t){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(Z.isNegativeZero(e))return`-0.0`;return n=e.toString(10),ao.test(n)?n.replace(`e`,`.e`):n}function so(e){return Object.prototype.toString.call(e)===`[object Number]`&&(e%1!=0||Z.isNegativeZero(e))}var co=new Ma(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:ro,construct:io,predicate:so,represent:oo,defaultStyle:`lowercase`}),lo=Ba.extend({implicit:[Wa,Ja,to,co]}),uo=lo,fo=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),po=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 mo(e){return e===null?!1:fo.exec(e)!==null||po.exec(e)!==null}function ho(e){var t,n,r,i,a,o,s,c=0,l=null,u,d,f;if(t=fo.exec(e),t===null&&(t=po.exec(e)),t===null)throw 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(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=`0`;c=+c}return t[9]&&(u=+t[10],d=+(t[11]||0),l=(u*60+d)*6e4,t[9]===`-`&&(l=-l)),f=new Date(Date.UTC(n,r,i,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}function go(e){return e.toISOString()}var _o=new Ma(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:mo,construct:ho,instanceOf:Date,represent:go});function vo(e){return e===`<<`||e===null}var yo=new Ma(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:vo}),bo=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`;function xo(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=bo;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}function So(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=bo,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}function Co(e){var t=``,n=0,r,i,a=e.length,o=bo;for(r=0;r<a;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=a%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 wo(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}var To=new Ma(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:xo,construct:So,predicate:wo,represent:Co}),Eo=Object.prototype.hasOwnProperty,Do=Object.prototype.toString;function Oo(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,Do.call(i)!==`[object Object]`)return!1;for(a in i)if(Eo.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function ko(e){return e===null?[]:e}var Ao=new Ma(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:Oo,construct:ko}),jo=Object.prototype.toString;function Mo(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],jo.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function No(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var Po=new Ma(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:Mo,construct:No}),Fo=Object.prototype.hasOwnProperty;function Io(e){if(e===null)return!0;var t,n=e;for(t in n)if(Fo.call(n,t)&&n[t]!==null)return!1;return!0}function Lo(e){return e===null?{}:e}var Ro=new Ma(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:Io,construct:Lo}),zo=uo.extend({implicit:[_o,yo],explicit:[To,Ao,Po,Ro]}),Bo=Object.prototype.hasOwnProperty,Vo=1,Ho=2,Uo=3,Wo=4,Go=1,Ko=2,qo=3,Jo=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Yo=/[\x85\u2028\u2029]/,Xo=/[,\[\]\{\}]/,Zo=/^(?:!|!!|![a-z\-]+!)$/i,Qo=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function $o(e){return Object.prototype.toString.call(e)}function es(e){return e===10||e===13}function ts(e){return e===9||e===32}function ns(e){return e===9||e===32||e===10||e===13}function rs(e){return e===44||e===91||e===93||e===123||e===125}function is(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function as(e){return e===120?2:e===117?4:e===85?8:0}function os(e){return 48<=e&&e<=57?e-48:-1}function ss(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
10
+ `:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`…`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}function cs(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function ls(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var us=Array(256),ds=Array(256),fs=0;fs<256;fs++)us[fs]=ss(fs)?1:0,ds[fs]=ss(fs);function ps(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||zo,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 ms(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=Da(n),new Ca(t,n)}function Q(e,t){throw ms(e,t)}function hs(e,t){e.onWarning&&e.onWarning.call(null,ms(e,t))}var gs={YAML:function(e,t,n){var r,i,a;e.version!==null&&Q(e,`duplication of %YAML directive`),n.length!==1&&Q(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&Q(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&Q(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&hs(e,`unsupported YAML version of the document`)},TAG:function(e,t,n){var r,i;n.length!==2&&Q(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],Zo.test(r)||Q(e,`ill-formed tag handle (first argument) of the TAG directive`),Bo.call(e.tagMap,r)&&Q(e,`there is a previously declared suffix for "`+r+`" tag handle`),Qo.test(i)||Q(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{Q(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i}};function _s(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||Q(e,`expected valid JSON character`);else Jo.test(s)&&Q(e,`the stream contains non-printable characters`);e.result+=s}}function vs(e,t,n,r){var i,a,o,s;for(Z.isObject(n)||Q(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Bo.call(t,a)||(ls(t,a,n[a]),r[a]=!0)}function ys(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&Q(e,`nested arrays are not supported inside keys`),typeof i==`object`&&$o(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&$o(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)vs(e,t,a[l],n);else vs(e,t,a,n);else !e.json&&!Bo.call(n,i)&&Bo.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,Q(e,`duplicated mapping key`)),ls(t,i,a),delete n[i];return t}function bs(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Q(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function $(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;ts(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(es(i))for(bs(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&&hs(e,`deficient indentation`),r}function xs(e){var t=e.position,n=e.input.charCodeAt(t);return!!((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||ns(n)))}function Ss(e,t){t===1?e.result+=` `:t>1&&(e.result+=Z.repeat(`
11
+ `,t-1))}function Cs(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(ns(p)||rs(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),ns(i)||n&&rs(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),ns(i)||n&&rs(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),ns(r))break}else if(e.position===e.lineStart&&xs(e)||n&&rs(p))break;else if(es(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,$(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(_s(e,a,o,!1),Ss(e,e.line-c),a=o=e.position,!1),ts(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return _s(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}function ws(e,t){var n=e.input.charCodeAt(e.position),r,i;if(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(_s(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 es(n)?(_s(e,r,i,!0),Ss(e,$(e,!1,t)),r=i=e.position):e.position===e.lineStart&&xs(e)?Q(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);Q(e,`unexpected end of the stream within a single quoted scalar`)}function Ts(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return _s(e,n,e.position,!0),e.position++,!0;else if(s===92){if(_s(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),es(s))$(e,!1,t);else if(s<256&&us[s])e.result+=ds[s],e.position++;else if((o=as(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=is(s))>=0?a=(a<<4)+o:Q(e,`expected hexadecimal character`);e.result+=cs(a),e.position++}else Q(e,`unknown escape sequence`);n=r=e.position}else es(s)?(_s(e,n,r,!0),Ss(e,$(e,!1,t)),n=r=e.position):e.position===e.lineStart&&xs(e)?Q(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);Q(e,`unexpected end of the stream within a double quoted scalar`)}function Es(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if($(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&Q(e,`expected the node content, but found ','`):Q(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),ns(l)&&(d=f=!0,e.position++,$(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,Ns(e,t,Vo,!1,!0),g=e.tag,h=e.result,$(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),$(e,!0,t),Ns(e,t,Vo,!1,!0),_=e.result),p?ys(e,s,m,g,h,_,r,i,a):d?s.push(ys(e,null,m,g,h,_,r,i,a)):s.push(h),$(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}Q(e,`unexpected end of the stream within a flow collection`)}function Ds(e,t){var n,r,i=Go,a=!1,o=!1,s=t,c=0,l=!1,u,d=e.input.charCodeAt(e.position);if(d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Go===i?i=d===43?qo:Ko:Q(e,`repeat of a chomping mode identifier`);else if((u=os(d))>=0)u===0?Q(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?Q(e,`repeat of an indentation width identifier`):(s=t+u-1,o=!0);else break;if(ts(d)){do d=e.input.charCodeAt(++e.position);while(ts(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!es(d)&&d!==0)}for(;d!==0;){for(bs(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),es(d)){c++;continue}if(e.lineIndent<s){i===qo?e.result+=Z.repeat(`
12
+ `,a?1+c:c):i===Go&&a&&(e.result+=`
13
+ `);break}for(r?ts(d)?(l=!0,e.result+=Z.repeat(`
14
+ `,a?1+c:c)):l?(l=!1,e.result+=Z.repeat(`
15
+ `,c+1)):c===0?a&&(e.result+=` `):e.result+=Z.repeat(`
16
+ `,c):e.result+=Z.repeat(`
17
+ `,a?1+c:c),a=!0,o=!0,c=0,n=e.position;!es(d)&&d!==0;)d=e.input.charCodeAt(++e.position);_s(e,n,e.position,!1)}return!0}function Os(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Q(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!ns(o))));){if(s=!0,e.position++,$(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,Ns(e,t,Uo,!1,!0),a.push(e.result),$(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)Q(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}function ks(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Q(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&ns(r))v===63?(g&&(ys(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):Q(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!Ns(e,n,Ho,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);ts(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),ns(v)||Q(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(ys(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)Q(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)Q(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),Ns(e,t,Wo,!0,i)&&(g?m=e.result:h=e.result),g||(ys(e,d,f,p,m,h,o,s,c),p=m=h=null),$(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)Q(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&ys(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}function As(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&Q(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?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):Q(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!ns(o);)o===33&&(r?Q(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),Zo.test(i)||Q(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),Xo.test(a)&&Q(e,`tag suffix cannot contain flow indicator characters`)}a&&!Qo.test(a)&&Q(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{Q(e,`tag name is malformed: `+a)}return n?e.tag=a:Bo.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:Q(e,`undeclared tag handle "`+i+`"`),!0}function js(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&Q(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ns(n)&&!rs(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Q(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}function Ms(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ns(r)&&!rs(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Q(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),Bo.call(e.anchorMap,n)||Q(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],$(e,!0,-1),!0}function Ns(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Wo===n||Uo===n,r&&$(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;As(e)||js(e);)$(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||Wo===n)&&(h=Vo===n||Ho===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(Os(e,g)||ks(e,g,h))||Es(e,h)?u=!0:(o&&Ds(e,h)||ws(e,h)||Ts(e,h)?u=!0:Ms(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&Q(e,`alias node should not have any properties`)):Cs(e,h,Vo===n)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&Os(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===`?`){for(e.result!==null&&e.kind!==`scalar`&&Q(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==`!`){if(Bo.call(e.typeMap[e.kind||`fallback`],e.tag))m=e.typeMap[e.kind||`fallback`][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||`fallback`],d=0,f=p.length;d<f;d+=1)if(e.tag.slice(0,p[d].tag.length)===p[d].tag){m=p[d];break}m||Q(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&m.kind!==e.kind&&Q(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+m.kind+`", not "`+e.kind+`"`),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Q(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),e.tag!==null||e.anchor!==null||u}function Ps(e){var t=e.position,n,r,i,a=!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&&($(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!ns(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&Q(e,`directive name must not be less than one character in length`);o!==0;){for(;ts(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!es(o));break}if(es(o))break;for(n=e.position;o!==0&&!ns(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&bs(e),Bo.call(gs,r)?gs[r](e,r,i):hs(e,`unknown document directive "`+r+`"`)}if($(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,$(e,!0,-1)):a&&Q(e,`directives end mark is expected`),Ns(e,e.lineIndent-1,Wo,!1,!0),$(e,!0,-1),e.checkLineBreaks&&Yo.test(e.input.slice(t,e.position))&&hs(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&xs(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,$(e,!0,-1));return}if(e.position<e.length-1)Q(e,`end of the stream or a document separator is expected`);else return}function Fs(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
18
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new ps(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,Q(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;)Ps(n);return n.documents}function Is(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=Fs(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function Ls(e,t){var n=Fs(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ca(`expected a single document in the stream, but found more`)}}var Rs={loadAll:Is,load:Ls},zs=Object.prototype.toString,Bs=Object.prototype.hasOwnProperty,Vs=65279,Hs=9,Us=10,Ws=13,Gs=32,Ks=33,qs=34,Js=35,Ys=37,Xs=38,Zs=39,Qs=42,$s=44,ec=45,tc=58,nc=61,rc=62,ic=63,ac=64,oc=91,sc=93,cc=96,lc=123,uc=124,dc=125,fc={};fc[0]=`\\0`,fc[7]=`\\a`,fc[8]=`\\b`,fc[9]=`\\t`,fc[10]=`\\n`,fc[11]=`\\v`,fc[12]=`\\f`,fc[13]=`\\r`,fc[27]=`\\e`,fc[34]=`\\"`,fc[92]=`\\\\`,fc[133]=`\\N`,fc[160]=`\\_`,fc[8232]=`\\L`,fc[8233]=`\\P`;var pc=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],mc=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function hc(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&Bs.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}function gc(e){var t=e.toString(16).toUpperCase(),n,r;if(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 Ca(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+Z.repeat(`0`,r-t.length)+t}var _c=1,vc=2;function yc(e){this.schema=e.schema||zo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Z.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===`"`?vc:_c,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 bc(e,t){for(var n=Z.repeat(` `,t),r=0,i=-1,a=``,o,s=e.length;r<s;)i=e.indexOf(`
19
19
  `,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
20
- `&&(a+=n),a+=o;return a}function Ri(e,t){return`
21
- `+pe.repeat(" ",e.indent*t)}function Xp(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 Or(e){return e===Op||e===Np}function Zn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ha||65536<=e&&e<=1114111}function Vo(e){return Zn(e)&&e!==ha&&e!==Tp&&e!==zn}function Uo(e,t,n){var r=Vo(e),i=r&&!Or(e);return(n?r:r&&e!==uc&&e!==fc&&e!==dc&&e!==pc&&e!==hc)&&e!==Di&&!(t===Tr&&!i)||Vo(t)&&!Or(t)&&e===Di||t===Tr&&i}function eh(e){return Zn(e)&&e!==ha&&!Or(e)&&e!==Bp&&e!==Vp&&e!==Tr&&e!==uc&&e!==fc&&e!==dc&&e!==pc&&e!==hc&&e!==Di&&e!==Fp&&e!==Pp&&e!==$p&&e!==Wp&&e!==jp&&e!==qp&&e!==Hp&&e!==Dp&&e!==Rp&&e!==Up&&e!==Yp}function th(e){return!Or(e)&&e!==Tr}function qn(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 mc(e){var t=/^\n* /;return t.test(e)}var gc=1,Fi=2,vc=3,yc=4,hn=5;function nh(e,t,n,r,i,a,o,s){var l,c=0,f=null,u=!1,p=!1,d=r!==-1,h=-1,g=eh(qn(e,0))&&th(qn(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=qn(e,l),!Zn(c))return hn;g=g&&Uo(c,f,s),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=qn(e,l),c===zn)u=!0,d&&(p=p||l-h-1>r&&e[h+1]!==" ",h=l);else if(!Zn(c))return hn;g=g&&Uo(c,f,s),f=c}p=p||d&&l-h-1>r&&e[h+1]!==" "}return!u&&!p?g&&!o&&!i(e)?gc:a===Gn?hn:Fi:n>9&&mc(e)?hn:o?a===Gn?hn:Fi:p?yc:vc}function rh(e,t,n,r,i){e.dump=(function(){if(t.length===0)return e.quotingType===Gn?'""':"''";if(!e.noCompatMode&&(Kp.indexOf(t)!==-1||zp.test(t)))return e.quotingType===Gn?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function l(c){return Xp(e,c)}switch(nh(t,s,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case gc:return t;case Fi:return"'"+t.replace(/'/g,"''")+"'";case vc:return"|"+Yo(t,e.indent)+Wo(qo(t,a));case yc:return">"+Yo(t,e.indent)+Wo(qo(ih(t,o),a));case hn:return'"'+ah(t)+'"';default:throw new Ie("impossible error: invalid scalar style")}})()}function Yo(e,t){var n=mc(e)?String(t):"",r=e[e.length-1]===`
22
- `,i=r&&(e[e.length-2]===`
20
+ `&&(a+=n),a+=o;return a}function xc(e,t){return`
21
+ `+Z.repeat(` `,e.indent*t)}function Sc(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 Cc(e){return e===Gs||e===Hs}function wc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Vs||65536<=e&&e<=1114111}function Tc(e){return wc(e)&&e!==Vs&&e!==Ws&&e!==Us}function Ec(e,t,n){var r=Tc(e),i=r&&!Cc(e);return(n?r:r&&e!==$s&&e!==oc&&e!==sc&&e!==lc&&e!==dc)&&e!==Js&&!(t===tc&&!i)||Tc(t)&&!Cc(t)&&e===Js||t===tc&&i}function Dc(e){return wc(e)&&e!==Vs&&!Cc(e)&&e!==ec&&e!==ic&&e!==tc&&e!==$s&&e!==oc&&e!==sc&&e!==lc&&e!==dc&&e!==Js&&e!==Xs&&e!==Qs&&e!==Ks&&e!==uc&&e!==nc&&e!==rc&&e!==Zs&&e!==qs&&e!==Ys&&e!==ac&&e!==cc}function Oc(e){return!Cc(e)&&e!==tc}function kc(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 Ac(e){return/^\n* /.test(e)}var jc=1,Mc=2,Nc=3,Pc=4,Fc=5;function Ic(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=Dc(kc(e,0))&&Oc(kc(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=kc(e,c),!wc(l))return Fc;h&&=Ec(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=kc(e,c),l===Us)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!wc(l))return Fc;h&&=Ec(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?jc:a===vc?Fc:Mc:n>9&&Ac(e)?Fc:o?a===vc?Fc:Mc:f?Pc:Nc}function Lc(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===vc?`""`:`''`;if(!e.noCompatMode&&(pc.indexOf(t)!==-1||mc.test(t)))return e.quotingType===vc?`"`+t+`"`:`'`+t+`'`;var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function c(t){return Sc(e,t)}switch(Ic(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!r,i)){case jc:return t;case Mc:return`'`+t.replace(/'/g,`''`)+`'`;case Nc:return`|`+Rc(t,e.indent)+zc(bc(t,a));case Pc:return`>`+Rc(t,e.indent)+zc(bc(Bc(t,o),a));case Fc:return`"`+Hc(t)+`"`;default:throw new Ca(`impossible error: invalid scalar style`)}}()}function Rc(e,t){var n=Ac(e)?String(t):``,r=e[e.length-1]===`
22
+ `;return n+(r&&(e[e.length-2]===`
23
23
  `||e===`
24
- `),a=i?"+":r?"":"-";return n+a+`
25
- `}function Wo(e){return e[e.length-1]===`
26
- `?e.slice(0,-1):e}function ih(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var c=e.indexOf(`
27
- `);return c=c!==-1?c:e.length,n.lastIndex=c,Ko(e.slice(0,c),t)})(),i=e[0]===`
28
- `||e[0]===" ",a,o;o=n.exec(e);){var s=o[1],l=o[2];a=l[0]===" ",r+=s+(!i&&!a&&l!==""?`
29
- `:"")+Ko(l,t),i=a}return r}function Ko(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,l="";r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,l+=`
30
- `+e.slice(i,a),i=a+1),o=s;return l+=`
31
- `,e.length-i>t&&o>i?l+=e.slice(i,o)+`
32
- `+e.slice(o+1):l+=e.slice(i),l.slice(1)}function ah(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=qn(e,i),r=Se[n],!r&&Zn(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||Zp(n);return t}function oh(e,t,n){var r="",i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(Ct(e,t,s,!1,!1)||typeof s>"u"&&Ct(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function zo(e,t,n,r){var i="",a=e.tag,o,s,l;for(o=0,s=n.length;o<s;o+=1)l=n[o],e.replacer&&(l=e.replacer.call(n,String(o),l)),(Ct(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Ct(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Ri(e,t)),e.dump&&zn===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function sh(e,t,n){var r="",i=e.tag,a=Object.keys(n),o,s,l,c,f;for(o=0,s=a.length;o<s;o+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),l=a[o],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),Ct(e,t,l,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ct(e,t,c,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function lh(e,t,n,r){var i="",a=e.tag,o=Object.keys(n),s,l,c,f,u,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Ie("sortKeys must be a boolean or a function");for(s=0,l=o.length;s<l;s+=1)p="",(!r||i!=="")&&(p+=Ri(e,t)),c=o[s],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),Ct(e,t+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&zn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=Ri(e,t)),Ct(e,t+1,f,!0,u)&&(e.dump&&zn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=a,e.dump=i||"{}"}function Go(e,t,n){var r,i,a,o,s,l;for(i=n?e.explicitTypes:e.implicitTypes,a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag="?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,lc.call(s.represent)==="[object Function]")r=s.represent(t,l);else if(cc.call(s.represent,l))r=s.represent[l](t,l);else throw new Ie("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function Ct(e,t,n,r,i,a,o){e.tag=null,e.dump=n,Go(e,n,!1)||Go(e,n,!0);var s=lc.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>t);var f=s==="[object Object]"||s==="[object Array]",u,p;if(f&&(u=e.duplicates.indexOf(n),p=u!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(i=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(lh(e,t,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(sh(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?zo(e,t-1,e.dump,i):zo(e,t,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(oh(e,t,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&rh(e,e.dump,t,a,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ie("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function ch(e,t){var n=[],r=[],i,a;for(Hi(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(a)}function Hi(e,t,n){var r,i,a;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,a=e.length;i<a;i+=1)Hi(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Hi(e[r[i]],t,n)}function uh(e,t){t=t||{};var n=new Qp(t);n.noRefs||ch(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Ct(n,0,r,!0,!0)?n.dump+`
33
- `:""}var fh=uh,dh={dump:fh};function ma(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 ph=we,hh=Ol,mh=Fl,gh=ql,vh=Vl,yh=fa,wh=sc.load,_h=sc.loadAll,bh=dh.dump,kh=Ie,xh={binary:zl,float:jl,map:Rl,null:Hl,pairs:Zl,set:Jl,timestamp:Wl,bool:Pl,int:Bl,merge:Kl,omap:Gl,seq:Dl,str:$l},Ah=ma("safeLoad","load"),Eh=ma("safeLoadAll","loadAll"),Ch=ma("safeDump","dump"),Gr={Type:ph,Schema:hh,FAILSAFE_SCHEMA:mh,JSON_SCHEMA:gh,CORE_SCHEMA:vh,DEFAULT_SCHEMA:yh,load:wh,loadAll:_h,dump:bh,YAMLException:kh,types:xh,safeLoad:Ah,safeLoadAll:Eh,safeDump:Ch};const nt=mt(),rt=mt(),Ee=mt({}),ga=mt(-1),Te=mt(0),at=mt(),Ce=Ll(null,e=>(Sh().then(e).catch(t=>console.error("Failed to load config.",t)),()=>{})),va=td(Ce,(e,t)=>{const n=e?.custom_actions;return n?(Mh(n).then(t).catch(r=>console.error("Failed to load cms actions.",r)),()=>{}):null});async function Sh(){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 Gr.load(await t.text())}async function Mh(e){const t=`../../cms-config/${e}`;return(await import(new URL(t,window.location.href).href)).default}var Ih=z('<nav><ul><li><a href="##posts" data-tooltip="Posts" data-placement="bottom"><!></a></li> <li><a href="##media" data-tooltip="Media Files" data-placement="bottom"><!></a></li></ul> <ul><li><a href="##exit" class="secondary" data-tooltip="Exit" data-placement="bottom"><!></a></li></ul></nav>');function Lh(e,t){se(t,!0);const n=()=>H(va,"$cmsActions",i),r=()=>H(at,"$backend",i),[i,a]=me();function o(L){L.preventDefault();const $=new URL(L.currentTarget.href).hash.replaceAll("#","");t.onselectview($),L.currentTarget.blur()}async function s(L){L.preventDefault(),n()?.onLogout&&await n().onLogout(),r()?.logout?await r().logout():history.back()}var l=Ih(),c=I(l),f=I(c),u=I(f);u.__click=o;var p=I(u);Be(p,()=>ad);var d=R(f,2),h=I(d);h.__click=o;var g=I(h);Be(g,()=>od);var m=R(c,2),v=I(m),w=I(v);w.__click=s;var k=I(w);Be(k,()=>sd),q(e,l),le(),a()}Ve(["click"]);const Nh='<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>';var Th=z('<li class="svelte-s7v0ur"><a href="##select"><!> </a></li>');function Oh(e,t){se(t,!0);const n=()=>H(nt,"$selectedCollection",i),r=()=>H(Ce,"$config",i),[i,a]=me();let o=ft(()=>n()?.name===t.name?"selected":"");function s(d){d.preventDefault(),re(nt,r().collections.find(h=>h.name===t.name))}var l=Th(),c=I(l);let f;c.__click=s;var u=I(c);Be(u,()=>Nh);var p=R(u,1,!0);ee(()=>{f=Ml(c,1,"collectionNav svelte-s7v0ur",null,f,{selected:y(o)}),ce(p,t.label)}),q(e,l),le(),a()}Ve(["click"]);var yr={exports:{}},$h=yr.exports,Zo;function Dh(){return Zo||(Zo=1,(function(e,t){(function(n,r){e.exports=r()})($h,(function(){var n=1e3,r=6e4,i=36e5,a="millisecond",o="second",s="minute",l="hour",c="day",f="week",u="month",p="quarter",d="year",h="date",g="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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,w={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(C){var x=["th","st","nd","rd"],b=C%100;return"["+C+(x[(b-20)%10]||x[b]||x[0])+"]"}},k=function(C,x,b){var S=String(C);return!S||S.length>=x?C:""+Array(x+1-S.length).join(b)+C},L={s:k,z:function(C){var x=-C.utcOffset(),b=Math.abs(x),S=Math.floor(b/60),A=b%60;return(x<=0?"+":"-")+k(S,2,"0")+":"+k(A,2,"0")},m:function C(x,b){if(x.date()<b.date())return-C(b,x);var S=12*(b.year()-x.year())+(b.month()-x.month()),A=x.clone().add(S,u),O=b-A<0,D=x.clone().add(S+(O?-1:1),u);return+(-(S+(b-A)/(O?A-D:D-A))||0)},a:function(C){return C<0?Math.ceil(C)||0:Math.floor(C)},p:function(C){return{M:u,y:d,w:f,d:c,D:h,h:l,m:s,s:o,ms:a,Q:p}[C]||String(C||"").toLowerCase().replace(/s$/,"")},u:function(C){return C===void 0}},$="en",N={};N[$]=w;var E="$isDayjsObject",P=function(C){return C instanceof Y||!(!C||!C[E])},G=function C(x,b,S){var A;if(!x)return $;if(typeof x=="string"){var O=x.toLowerCase();N[O]&&(A=O),b&&(N[O]=b,A=O);var D=x.split("-");if(!A&&D.length>1)return C(D[0])}else{var W=x.name;N[W]=x,A=W}return!S&&A&&($=A),A||!S&&$},V=function(C,x){if(P(C))return C.clone();var b=typeof x=="object"?x:{};return b.date=C,b.args=arguments,new Y(b)},T=L;T.l=G,T.i=P,T.w=function(C,x){return V(C,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var Y=(function(){function C(b){this.$L=G(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[E]=!0}var x=C.prototype;return x.parse=function(b){this.$d=(function(S){var A=S.date,O=S.utc;if(A===null)return new Date(NaN);if(T.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var D=A.match(m);if(D){var W=D[2]-1||0,Z=(D[7]||"0").substring(0,3);return O?new Date(Date.UTC(D[1],W,D[3]||1,D[4]||0,D[5]||0,D[6]||0,Z)):new Date(D[1],W,D[3]||1,D[4]||0,D[5]||0,D[6]||0,Z)}}return new Date(A)})(b),this.init()},x.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},x.$utils=function(){return T},x.isValid=function(){return this.$d.toString()!==g},x.isSame=function(b,S){var A=V(b);return this.startOf(S)<=A&&A<=this.endOf(S)},x.isAfter=function(b,S){return V(b)<this.startOf(S)},x.isBefore=function(b,S){return this.endOf(S)<V(b)},x.$g=function(b,S,A){return T.u(b)?this[S]:this.set(A,b)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(b,S){var A=this,O=!!T.u(S)||S,D=T.p(b),W=function(be,oe){var ge=T.w(A.$u?Date.UTC(A.$y,oe,be):new Date(A.$y,oe,be),A);return O?ge:ge.endOf(c)},Z=function(be,oe){return T.w(A.toDate()[be].apply(A.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(oe)),A)},M=this.$W,j=this.$M,J=this.$D,ue="set"+(this.$u?"UTC":"");switch(D){case d:return O?W(1,0):W(31,11);case u:return O?W(1,j):W(0,j+1);case f:var de=this.$locale().weekStart||0,Me=(M<de?M+7:M)-de;return W(O?J-Me:J+(6-Me),j);case c:case h:return Z(ue+"Hours",0);case l:return Z(ue+"Minutes",1);case s:return Z(ue+"Seconds",2);case o:return Z(ue+"Milliseconds",3);default:return this.clone()}},x.endOf=function(b){return this.startOf(b,!1)},x.$set=function(b,S){var A,O=T.p(b),D="set"+(this.$u?"UTC":""),W=(A={},A[c]=D+"Date",A[h]=D+"Date",A[u]=D+"Month",A[d]=D+"FullYear",A[l]=D+"Hours",A[s]=D+"Minutes",A[o]=D+"Seconds",A[a]=D+"Milliseconds",A)[O],Z=O===c?this.$D+(S-this.$W):S;if(O===u||O===d){var M=this.clone().set(h,1);M.$d[W](Z),M.init(),this.$d=M.set(h,Math.min(this.$D,M.daysInMonth())).$d}else W&&this.$d[W](Z);return this.init(),this},x.set=function(b,S){return this.clone().$set(b,S)},x.get=function(b){return this[T.p(b)]()},x.add=function(b,S){var A,O=this;b=Number(b);var D=T.p(S),W=function(j){var J=V(O);return T.w(J.date(J.date()+Math.round(j*b)),O)};if(D===u)return this.set(u,this.$M+b);if(D===d)return this.set(d,this.$y+b);if(D===c)return W(1);if(D===f)return W(7);var Z=(A={},A[s]=r,A[l]=i,A[o]=n,A)[D]||1,M=this.$d.getTime()+b*Z;return T.w(M,this)},x.subtract=function(b,S){return this.add(-1*b,S)},x.format=function(b){var S=this,A=this.$locale();if(!this.isValid())return A.invalidDate||g;var O=b||"YYYY-MM-DDTHH:mm:ssZ",D=T.z(this),W=this.$H,Z=this.$m,M=this.$M,j=A.weekdays,J=A.months,ue=A.meridiem,de=function(oe,ge,Je,Lt){return oe&&(oe[ge]||oe(S,O))||Je[ge].slice(0,Lt)},Me=function(oe){return T.s(W%12||12,oe,"0")},be=ue||function(oe,ge,Je){var Lt=oe<12?"AM":"PM";return Je?Lt.toLowerCase():Lt};return O.replace(v,(function(oe,ge){return ge||(function(Je){switch(Je){case"YY":return String(S.$y).slice(-2);case"YYYY":return T.s(S.$y,4,"0");case"M":return M+1;case"MM":return T.s(M+1,2,"0");case"MMM":return de(A.monthsShort,M,J,3);case"MMMM":return de(J,M);case"D":return S.$D;case"DD":return T.s(S.$D,2,"0");case"d":return String(S.$W);case"dd":return de(A.weekdaysMin,S.$W,j,2);case"ddd":return de(A.weekdaysShort,S.$W,j,3);case"dddd":return j[S.$W];case"H":return String(W);case"HH":return T.s(W,2,"0");case"h":return Me(1);case"hh":return Me(2);case"a":return be(W,Z,!0);case"A":return be(W,Z,!1);case"m":return String(Z);case"mm":return T.s(Z,2,"0");case"s":return String(S.$s);case"ss":return T.s(S.$s,2,"0");case"SSS":return T.s(S.$ms,3,"0");case"Z":return D}return null})(oe)||D.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(b,S,A){var O,D=this,W=T.p(S),Z=V(b),M=(Z.utcOffset()-this.utcOffset())*r,j=this-Z,J=function(){return T.m(D,Z)};switch(W){case d:O=J()/12;break;case u:O=J();break;case p:O=J()/3;break;case f:O=(j-M)/6048e5;break;case c:O=(j-M)/864e5;break;case l:O=j/i;break;case s:O=j/r;break;case o:O=j/n;break;default:O=j}return A?O:T.a(O)},x.daysInMonth=function(){return this.endOf(u).$D},x.$locale=function(){return N[this.$L]},x.locale=function(b,S){if(!b)return this.$L;var A=this.clone(),O=G(b,S,!0);return O&&(A.$L=O),A},x.clone=function(){return T.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},C})(),B=Y.prototype;return V.prototype=B,[["$ms",a],["$s",o],["$m",s],["$H",l],["$W",c],["$M",u],["$y",d],["$D",h]].forEach((function(C){B[C[1]]=function(x){return this.$g(x,C[0],C[1])}})),V.extend=function(C,x){return C.$i||(C(x,Y,V),C.$i=!0),V},V.locale=G,V.isDayjs=P,V.unix=function(C){return V(1e3*C)},V.en=N[$],V.Ls=N,V.p={},V}))})(yr)),yr.exports}var Rh=Dh();const $e=ks(Rh);var Fh=z('<div class="item svelte-i3qvht"><input type="checkbox" name="entry-select"/> <a href="#editor" class="entry-info svelte-i3qvht"><div class="entry-name svelte-i3qvht"> </div> <div class="entry-status svelte-i3qvht"> </div> <div class="entry-date svelte-i3qvht"> </div></a></div>');function Hh(e,t){se(t,!0);const n=()=>H(s,"$selectedEntries",r),[r,i]=me();let a=t.entry.fields.draft?"draft":"published",o=$e(t.entry.fields.date).format("MM/DD/YY");const s=Ar("selectedEntries");function l(k){k.target.checked?re(s,[...n(),t.entry]):re(s,n().filter(L=>L!==t.entry))}function c(){re(Ee,{}),re(rt,t.entry)}var f=Fh(),u=I(f);u.__change=l;var p=R(u,2);p.__click=c;var d=I(p),h=I(d),g=R(d,2),m=I(g),v=R(g,2),w=I(v);ee(()=>{ce(h,t.entry.fields.title),ce(m,a),ce(w,o)}),q(e,f),le(),i()}Ve(["change","click"]);var Ph=z("<div> </div>"),Bh=z('<div class="toast"><div aria-busy="true"></div> <!></div>');function Zr(e,t){var n=Bh(),r=R(I(n),2);{var i=a=>{var o=Ph(),s=I(o);ee(()=>ce(s,t.msg)),q(a,o)};Le(r,a=>{t.msg&&a(i)})}q(e,n)}const jh='<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>';var qh=z('<div class="toast warning"><!> <details class="svelte-bipkou"><summary> </summary> </details></div>');function xt(e,t){var n=qh(),r=I(n);Be(r,()=>jh);var i=R(r,2),a=I(i),o=I(a),s=R(a);ee(()=>{ce(o,t.msg),ce(s,` ${t.details??""}`)}),q(e,n)}const wc='<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>',Jo='<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>';var Vh=z('<div id="empty" class="svelte-vl570e"><p>This collection has no entries.</p> <button class="svelte-vl570e"><!>Create New Entry</button></div>'),Uh=z('<div id="items" class="svelte-vl570e"></div>'),Yh=z('<main class="svelte-vl570e"><header class="svelte-vl570e"> <div id="listActions" class="svelte-vl570e"><button class="outline svelte-vl570e"><!>Delete</button> <button class="svelte-vl570e"><!>New</button></div></header> <!> <!> <!></main>');function Wh(e,t){se(t,!0);const n=()=>H(nt,"$selectedCollection",o),r=()=>H(at,"$backend",o),i=()=>H(l,"$selectedEntries",o),a=()=>H(va,"$cmsActions",o),[o,s]=me(),l=mt([]);Er("selectedEntries",l);let c=K(void 0),f=K(void 0),u=K(Xe([])),p=K(void 0);pt(()=>{y(p)!==n()?.name&&d()});async function d(){try{if(!r()||!n().name)return;U(p,n().name,!0),U(c,r().getFiles(n().name),!0),U(u,await y(c)||[],!0)}catch{}}function h(){re(rt,null),re(Ee,{}),window.location.hash="#/editor"}async function g(){try{await r().deleteFiles(i()),a()?.onDelete&&(U(f,a().onDelete(i()),!0),await y(f)),re(l,[]),d()}catch(B){console.error("Error deleting files",B)}}var m=Yh(),v=I(m),w=I(v),k=R(w),L=I(k);L.__click=g;var $=I(L);Be($,()=>wc);var N=R(L,2);N.__click=h;var E=I(N);Be(E,()=>Jo);var P=R(v,2);{var G=B=>{var C=Vh(),x=R(I(C),2);x.__click=h;var b=I(x);Be(b,()=>Jo),q(B,C)},V=B=>{var C=Uh();qt(C,21,()=>y(u),x=>x.name,(x,b)=>{Hh(x,{get entry(){return y(b)}})}),q(B,C)};Le(P,B=>{y(u).length===0?B(G):B(V,!1)})}var T=R(P,2);tt(T,()=>y(c),B=>{Zr(B,{msg:"Loading"})},void 0,(B,C)=>{xt(B,{msg:"Error getting entries",get details(){return y(C).message}})});var Y=R(T,2);tt(Y,()=>y(f),null,void 0,(B,C)=>{xt(B,{msg:"'On delete' event action failed",get details(){return y(C).message}})}),ee(()=>{ce(w,`${(n()?.label||"")??""} `),L.disabled=i().length===0}),q(e,m),le(),s()}Ve(["click"]);var Kh=z('<div class="svelte-1vgyypt"><input type="checkbox" name="media-select" class="svelte-1vgyypt"/> <img loading="lazy" crossorigin="use-credentials" class="svelte-1vgyypt"/> <small class="svelte-1vgyypt"> </small></div>');function zh(e,t){se(t,!0);const n=()=>H(a,"$selectedMediaFiles",r),[r,i]=me(),a=Ar("selectedMediaFiles");function o(p){p.target.checked?re(a,[...n(),t.media]):re(a,n().filter(d=>d!==t.media))}var s=Kh(),l=I(s);l.__change=o;var c=R(l,2),f=R(c,2),u=I(f);ee(()=>{Q(c,"src",t.media.url_preview),Q(c,"alt",t.media.alt),ce(u,t.media.name)}),q(e,s),le(),i()}Ve(["change"]);const Qo='<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>';var Gh=z('<div id="empty" class="svelte-1gxvaku"><p>No files found.</p> <button class="svelte-1gxvaku"><!>Upload a File</button></div>'),Zh=z('<div id="items" class="svelte-1gxvaku"></div>'),Jh=z('<main class="svelte-1gxvaku"><header class="svelte-1gxvaku">Media Files <div id="listActions" class="svelte-1gxvaku"><button class="outline svelte-1gxvaku"><!>Delete</button> <button class="svelte-1gxvaku"><!>Upload</button></div></header> <!> <!></main>');function Qh(e,t){se(t,!0);const n=()=>H(at,"$backend",i),r=()=>H(o,"$selectedMediaFiles",i),[i,a]=me(),o=mt([]);Er("selectedMediaFiles",o);let s=K(void 0),l=K(Xe([]));async function c(){try{U(s,n()?.getMediaFiles(),!0),U(l,await y(s)||[],!0)}catch{}}async function f(){await n().uploadMediaFile(),c()}async function u(){try{await n().deleteFiles(r()),re(o,[]),c()}catch(E){console.error("Error deleting files",E)}}Ue(()=>{c()});var p=Jh(),d=I(p),h=R(I(d)),g=I(h);g.__click=u;var m=I(g);Be(m,()=>wc);var v=R(g,2);v.__click=f;var w=I(v);Be(w,()=>Qo);var k=R(d,2);{var L=E=>{var P=Gh(),G=R(I(P),2);G.__click=f;var V=I(G);Be(V,()=>Qo),q(E,P)},$=E=>{var P=Zh();qt(P,21,()=>y(l),G=>G.name,(G,V)=>{zh(G,{get media(){return y(V)}})}),q(E,P)};Le(k,E=>{y(l).length===0?E(L):E($,!1)})}var N=R(k,2);tt(N,()=>y(s),E=>{Zr(E,{msg:"Loading"})},void 0,(E,P)=>{xt(E,{msg:"Error getting entries",get details(){return y(P).message}})}),ee(()=>g.disabled=r().length===0),q(e,p),le(),a()}Ve(["click"]);var Xh=z('<aside class="svelte-bdf84k"><ul class="svelte-bdf84k"><!></ul></aside> <!>',1),em=z('<!> <div id="dash" class="page svelte-bdf84k"><!></div>',1);function tm(e,t){se(t,!0);const n=()=>H(Ce,"$config",i),r=()=>H(nt,"$selectedCollection",i),[i,a]=me();let o=K("posts"),s=ft(()=>n()?.collections);pt(()=>{r()||re(nt,y(s)?.[0])});function l(g){U(o,g,!0)}var c=em(),f=xe(c);Lh(f,{onselectview:l});var u=R(f,2),p=I(u);{var d=g=>{var m=Xh(),v=xe(m),w=I(v),k=I(w);{var L=N=>{var E=ct(),P=xe(E);qt(P,17,()=>y(s),Ni,(G,V)=>{Oh(G,vr(()=>y(V)))}),q(N,E)};Le(k,N=>{y(s)&&N(L)})}var $=R(v,2);Wh($,{}),q(g,m)},h=g=>{var m=ct(),v=xe(m);{var w=k=>{Qh(k,{})};Le(v,k=>{y(o)==="media"&&k(w)},!0)}q(g,m)};Le(p,g=>{y(o)==="posts"?g(d):g(h,!1)})}q(e,c),le(),a()}const nm='<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>',ya=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.window.document._=0}catch{return!1}return"showOpenFilePicker"in self})(),rm=ya?Promise.resolve().then(function(){return cm}):Promise.resolve().then(function(){return mm});async function wa(...e){return(await rm).default(...e)}const im=ya?Promise.resolve().then(function(){return fm}):Promise.resolve().then(function(){return vm});async function am(...e){return(await im).default(...e)}const om=ya?Promise.resolve().then(function(){return pm}):Promise.resolve().then(function(){return wm});async function Pi(...e){return(await om).default(...e)}const sm=async e=>{const t=await e.getFile();return t.handle=e,t};var lm=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((i,a)=>{t[a]={description:i.description||"Files",accept:{}},i.mimeTypes?i.mimeTypes.map(o=>{t[a].accept[o]=i.extensions||[]}):t[a].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(sm));return e[0].multiple?r:r[0]},cm={__proto__:null,default:lm};function wr(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 wr=function(n){this.s=n,this.n=n.next},wr.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 wr(e)}const _c=async(e,t,n=e.name,r)=>{const i=[],a=[];var o,s=!1,l=!1;try{for(var c,f=(function(u){var p,d,h,g=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,h=Symbol.iterator);g--;){if(d&&(p=u[d])!=null)return p.call(u);if(h&&(p=u[h])!=null)return new wr(p.call(u));d="@@asyncIterator",h="@@iterator"}throw new TypeError("Object is not async iterable")})(e.values());s=!(c=await f.next()).done;s=!1){const u=c.value,p=`${n}/${u.name}`;u.kind==="file"?a.push(u.getFile().then(d=>(d.directoryHandle=e,d.handle=u,Object.defineProperty(d,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>p})))):u.kind!=="directory"||!t||r&&r(u)||i.push(_c(u,t,p,r))}}catch(u){l=!0,o=u}finally{try{s&&f.return!=null&&await f.return()}finally{if(l)throw o}}return[...(await Promise.all(i)).flat(),...await Promise.all(a)]};var um=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]:_c(t,e.recursive,void 0,e.skipDirectory)},fm={__proto__:null,default:um},dm=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const a=[];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((c,f)=>{a[f]={description:c.description||"Files",accept:{}},c.mimeTypes?(f===0&&o&&c.mimeTypes.push(o),c.mimeTypes.map(u=>{a[f].accept[u]=c.extensions||[]})):o?a[f].accept[o]=c.extensions||[]:a[f].accept["*/*"]=c.extensions||[]}),n)try{await n.getFile()}catch(c){if(n=null,r)throw c}const s=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:a,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(s);const l=await s.createWritable();return"stream"in e?(await e.stream().pipeTo(l),s):"body"in e?(await e.body.pipeTo(l),s):(await l.write(await e),await l.close(),s)},pm={__proto__:null,default:dm},hm=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),r.addEventListener("cancel",()=>{r.remove(),n(new DOMException("The user aborted a request.","AbortError"))}),r.addEventListener("change",()=>{r.remove(),t(r.multiple?Array.from(r.files):r.files[0])}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),mm={__proto__:null,default:hm},gm=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,r.style.display="none",document.body.append(r),r.addEventListener("cancel",()=>{r.remove(),n(new DOMException("The user aborted a request.","AbortError"))}),r.addEventListener("change",()=>{r.remove();let i=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(i=i.filter(a=>a.webkitRelativePath.split("/").every(o=>!e[0].skipDirectory({name:o,kind:"directory"})))):i=i.filter(a=>a.webkitRelativePath.split("/").length===2),t(i)}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),vm={__proto__:null,default:gm},ym=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,s){const l=o.getReader(),c=new ReadableStream({start:p=>(async function d(){return l.read().then(({done:h,value:g})=>{if(!h)return p.enqueue(g),d();p.close()})})()}),f=new Response(c),u=await f.blob();return l.releaseLock(),new Blob([u],{type:s})})(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await r);const i=()=>{typeof a=="function"&&a()},a=t.legacySetup&&t.legacySetup(i,()=>a(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},wm={__proto__:null,default:ym},_r={exports:{}},_m=_r.exports,Xo;function bm(){return Xo||(Xo=1,(function(e,t){(function(n,r){e.exports=r()})(_m,(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|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,a=/\d\d/,o=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,l={},c=function(m){return(m=+m)+(m>68?1900:2e3)},f=function(m){return function(v){this[m]=+v}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var w=v.match(/([+-]|\d\d)/g),k=60*w[1]+(+w[2]||0);return k===0?0:w[0]==="+"?-k:k})(m)}],p=function(m){var v=l[m];return v&&(v.indexOf?v:v.s.concat(v.f))},d=function(m,v){var w,k=l.meridiem;if(k){for(var L=1;L<=24;L+=1)if(m.indexOf(k(L,0,v))>-1){w=L>12;break}}else w=m===(v?"pm":"PM");return w},h={A:[s,function(m){this.afternoon=d(m,!1)}],a:[s,function(m){this.afternoon=d(m,!0)}],Q:[i,function(m){this.month=3*(m-1)+1}],S:[i,function(m){this.milliseconds=100*+m}],SS:[a,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[o,f("seconds")],ss:[o,f("seconds")],m:[o,f("minutes")],mm:[o,f("minutes")],H:[o,f("hours")],h:[o,f("hours")],HH:[o,f("hours")],hh:[o,f("hours")],D:[o,f("day")],DD:[a,f("day")],Do:[s,function(m){var v=l.ordinal,w=m.match(/\d+/);if(this.day=w[0],v)for(var k=1;k<=31;k+=1)v(k).replace(/\[|\]/g,"")===m&&(this.day=k)}],w:[o,f("week")],ww:[a,f("week")],M:[o,f("month")],MM:[a,f("month")],MMM:[s,function(m){var v=p("months"),w=(p("monthsShort")||v.map((function(k){return k.slice(0,3)}))).indexOf(m)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[s,function(m){var v=p("months").indexOf(m)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,f("year")],YY:[a,function(m){this.year=c(m)}],YYYY:[/\d{4}/,f("year")],Z:u,ZZ:u};function g(m){var v,w;v=m,w=l&&l.formats;for(var k=(m=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(V,T,Y){var B=Y&&Y.toUpperCase();return T||w[Y]||n[Y]||w[B].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(C,x,b){return x||b.slice(1)}))}))).match(r),L=k.length,$=0;$<L;$+=1){var N=k[$],E=h[N],P=E&&E[0],G=E&&E[1];k[$]=G?{regex:P,parser:G}:N.replace(/^\[|\]$/g,"")}return function(V){for(var T={},Y=0,B=0;Y<L;Y+=1){var C=k[Y];if(typeof C=="string")B+=C.length;else{var x=C.regex,b=C.parser,S=V.slice(B),A=x.exec(S)[0];b.call(T,A),V=V.replace(A,"")}}return(function(O){var D=O.afternoon;if(D!==void 0){var W=O.hours;D?W<12&&(O.hours+=12):W===12&&(O.hours=0),delete O.afternoon}})(T),T}}return function(m,v,w){w.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(c=m.parseTwoDigitYear);var k=v.prototype,L=k.parse;k.parse=function($){var N=$.date,E=$.utc,P=$.args;this.$u=E;var G=P[1];if(typeof G=="string"){var V=P[2]===!0,T=P[3]===!0,Y=V||T,B=P[2];T&&(B=P[2]),l=this.$locale(),!V&&B&&(l=w.Ls[B]),this.$d=(function(S,A,O,D){try{if(["x","X"].indexOf(A)>-1)return new Date((A==="X"?1e3:1)*S);var W=g(A)(S),Z=W.year,M=W.month,j=W.day,J=W.hours,ue=W.minutes,de=W.seconds,Me=W.milliseconds,be=W.zone,oe=W.week,ge=new Date,Je=j||(Z||M?1:ge.getDate()),Lt=Z||ge.getFullYear(),cr=0;Z&&!M||(cr=M>0?M-1:ge.getMonth());var ur,si=J||0,li=ue||0,ci=de||0,ui=Me||0;return be?new Date(Date.UTC(Lt,cr,Je,si,li,ci,ui+60*be.offset*1e3)):O?new Date(Date.UTC(Lt,cr,Je,si,li,ci,ui)):(ur=new Date(Lt,cr,Je,si,li,ci,ui),oe&&(ur=D(ur).week(oe).toDate()),ur)}catch{return new Date("")}})(N,G,E,w),this.init(),B&&B!==!0&&(this.$L=this.locale(B).$L),Y&&N!=this.format(G)&&(this.$d=new Date("")),l={}}else if(G instanceof Array)for(var C=G.length,x=1;x<=C;x+=1){P[1]=G[x-1];var b=w.apply(this,P);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}x===C&&(this.$d=new Date(""))}else L.call(this,$)}}}))})(_r)),_r.exports}var km=bm();const bc=ks(km);$e.extend(bc);const _a="../../cms-config/",es=`Unable to parse markdown entry. Backend must implement 'replacePreviewLinks()'
34
- and return a valid string.`;function $r(e,t){let n=$e(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 xm(e,t){const n=e?.previews.styles.find(i=>i.name===t)?.files;if(!n)return;const r=[];return n.forEach(i=>{const a=`${_a}${i}`;r.push(new URL(a,window.location.href).href)}),r.map(i=>`<link rel="stylesheet" href="${i}">`).join(`
35
- `)}async function Am(e,t){const n=e?.previews.templates.find(i=>i.name===t)?.template;if(!n)return;const r=new URL(`${_a}${n}`,window.location.href).href;try{const i=await fetch(r);if(!i.ok)throw new Error(`Unable to fetch file ${r}`);return await i.text()}catch(i){console.error(i);return}}function Em(e,t){return e?.replace("{{styles}}",t).replaceAll("{{",'<span data-tag="').replaceAll("}}",'"></span>')}async function kc(e,t,n){let r;switch(e.widget){case"markdown":if(!n?.replacePreviewLinks)throw new Error(es);if(r=await n?.replacePreviewLinks(t),r==null)throw new Error(es);break;case"datetime":let i;switch(e.type){case"time":i=$e(t.toString(),"hh:mm").toISOString();break;case"date":i=$e(t.toString(),"YYYY-MM-DD").toISOString();break;default:i=$e(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($e(t.toString(),"YYYY-MM-DDThh:mm").toISOString());break;case"time":r=new Date($e(t.toString(),"hh:mm").toISOString());break;case"date":r=new Date($e(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 Cm(e,t){const{slug:n,extension:r}=e,{title:i,date:a}=t,o=i.toLowerCase().replaceAll(/\W+/g,"-"),s=$e(a);return`${n.replaceAll("{{slug}}",o).replaceAll("{{year}}",s.format("YYYY")).replaceAll("{{month}}",s.format("MM")).replaceAll("{{day}}",s.format("DD")).replaceAll("{{hour}}",s.format("HH")).replaceAll("{{minute}}",s.format("mm")).replaceAll("{{second}}",s.format("ss"))}.${r}`}function Sm(e,t){const n={...t},{date:r,body:i}={...n.fields};delete n.fields.body;const a=Gr.dump(n.fields,{quotingType:'"',forceQuotes:!0});return n.date=r,n.body=i,n.collection=e.name,n.name||(n.name=Cm(e,n.fields)),n.raw=`---
36
- ${a}---
37
-
38
- ${n.body}`,n}function ba(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(a=>a.length>0).map(a=>a.trim())}function Mm(e){switch(e){case".md":case".markdown":return"text/markdown";default:return"text/plain"}}function nr(e){const t=/!?\[.+\]\(.+\)/g,n=/!?\[.+\]\(/,r=/\)/;return e.match(t)?.map(a=>a.replace(n,"").replace(r,""))||[]}async function Im(e,t){const{file:n}=qe(e).backend;if(!n)return;const i=await import(new URL(`${_a}${n}`,window.location.href).href),a={configStore:e,backendStore:t,getStoreValueFunc:qe,getContentsFunc:ba,parseLinksFunc:nr,fileOpenFunc:wa};return i.default.init(a)}var Lm=z('<button form="entry-data">Save</button>'),Nm=z('<button form="entry-data">Save</button>'),Tm=z('<button form="entry-data" disabled>Save</button>'),Om=z('<nav><ul><li><a href="##back" class="svelte-g1hcr7"><!></a></li></ul> <ul><li class="svelte-g1hcr7"> <span class="svelte-g1hcr7">/</span> </li></ul> <ul><li><!></li></ul></nav>');function $m(e,t){se(t,!0);const n=()=>H(rt,"$editingEntry",c),r=()=>H(Te,"$loadedWidgets",c),i=()=>H(ga,"$loadingWidgets",c),a=()=>H(Ee,"$draftEntry",c),o=()=>H(nt,"$selectedCollection",c),s=()=>H(at,"$backend",c),l=()=>H(p,"$submitted",c),[c,f]=me(),u=Ar("formState"),p=Ar("submitted");let d=K(!1),h=K(Xe(Ei(n()))),g=K(void 0),m=!1;pt(()=>{!m&&r()===i()&&(U(g,Ei(a()),!0),m=!0)}),pt(()=>{const b=JSON.stringify(n())!==JSON.stringify(y(h)),S=JSON.stringify(a())!==JSON.stringify(y(g));(b||S)&&v()});async function v(){const{entryForm:b}=u;b&&(U(d,!await w(b)),U(h,n(),!0),U(g,a(),!0))}async function w(b){if(!n())return!1;const S=new FormData(b);for(const[A,O]of S){const D=o().fields.find(J=>J.name===A),W=n()?.fields[D.name]??n()[D.name],Z=await kc(D,O,s());let M,j;switch(D.widget){case"datetime":M=new Date(W).getTime(),j=Z.getTime();break;case"markdown":M=W.trim().replaceAll(`\r
24
+ `)?`+`:r?``:`-`)+`
25
+ `}function zc(e){return e[e.length-1]===`
26
+ `?e.slice(0,-1):e}function Bc(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var r=e.indexOf(`
27
+ `);return r=r===-1?e.length:r,n.lastIndex=r,Vc(e.slice(0,r),t)}(),i=e[0]===`
28
+ `||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
29
+ `:``)+Vc(c,t),i=a}return r}function Vc(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
30
+ `+e.slice(i,a),i=a+1),o=s;return c+=`
31
+ `,e.length-i>t&&o>i?c+=e.slice(i,o)+`
32
+ `+e.slice(o+1):c+=e.slice(i),c.slice(1)}function Hc(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=kc(e,i),r=fc[n],!r&&wc(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||gc(n);return t}function Uc(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(Jc(e,t,s,!1,!1)||s===void 0&&Jc(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}function Wc(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(Jc(e,t+1,c,!0,!0,!1,!0)||c===void 0&&Jc(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=xc(e,t)),e.dump&&Us===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}function Gc(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),Jc(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),Jc(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}function Kc(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new Ca(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=xc(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),Jc(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&&Us===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=xc(e,t)),Jc(e,t+1,u,!0,d)&&(e.dump&&Us===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}function qc(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,zs.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(Bs.call(s.represent,c))r=s.represent[c](t,c);else throw new Ca(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}function Jc(e,t,n,r,i,a,o){e.tag=null,e.dump=n,qc(e,n,!1)||qc(e,n,!0);var s=zs.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(Kc(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Gc(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Wc(e,t-1,e.dump,i):Wc(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Uc(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&Lc(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new Ca(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}function Yc(e,t){var n=[],r=[],i,a;for(Xc(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}function Xc(e,t,n){var r,i,a;if(typeof e==`object`&&e)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,a=e.length;i<a;i+=1)Xc(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Xc(e[r[i]],t,n)}function Zc(e,t){t||={};var n=new yc(t);n.noRefs||Yc(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),Jc(n,0,r,!0,!0)?n.dump+`
33
+ `:``}var Qc={dump:Zc};function $c(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}var el={Type:Ma,Schema:Ia,FAILSAFE_SCHEMA:Ba,JSON_SCHEMA:lo,CORE_SCHEMA:uo,DEFAULT_SCHEMA:zo,load:Rs.load,loadAll:Rs.loadAll,dump:Qc.dump,YAMLException:Ca,types:{binary:To,float:co,map:za,null:Wa,pairs:Po,set:Ro,timestamp:_o,bool:Ja,int:to,merge:yo,omap:Ao,seq:Ra,str:La},safeLoad:$c(`safeLoad`,`load`),safeLoadAll:$c(`safeLoadAll`,`loadAll`),safeDump:$c(`safeDump`,`dump`)},tl=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),nl=function(e,t){return new URL(e,t).href},rl={},il=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=nl(t,n),t in rl)return;rl[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:tl,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},al=At(),ol=At(),sl=At({}),cl=At(-1),ll=At(0),ul=At(),dl=kt(null,e=>(pl().then(e).catch(e=>console.error(`Failed to load config.`,e)),()=>{})),fl=jt(dl,(e,t)=>{let n=e?.custom_actions;return n?(ml(n).then(t).catch(e=>console.error(`Failed to load cms actions.`,e)),()=>{}):null});async function pl(){let e=new URL(`../../cms-config/config.yml`,window.location.href).href,t=await fetch(e);if(!t.ok)throw Error(`Unable to fetch file ${e}`);return el.load(await t.text())}async function ml(e){let t=`../../cms-config/${e}`,n=new URL(t,window.location.href).href;return(await il(()=>import(n),[],import.meta.url)).default}var hl=q(`<nav><ul><li><a href="##posts" data-tooltip="Posts" data-placement="bottom"></a></li> <li><a href="##media" data-tooltip="Media Files" data-placement="bottom"></a></li></ul> <ul><li><a href="##exit" class="secondary" data-tooltip="Exit" data-placement="bottom"></a></li></ul></nav>`);function gl(e,t){j(t,!0);let n=()=>P(fl,`$cmsActions`,i),r=()=>P(ul,`$backend`,i),[i,a]=I();function o(e){e.preventDefault();let n=new URL(e.currentTarget.href).hash.replaceAll(`#`,``);t.onselectview(n),e.currentTarget.blur()}async function s(e){e.preventDefault(),n()?.onLogout&&await n().onLogout(),r()?.logout?await r().logout():history.back()}var c=hl(),l=B(c),u=B(l),d=B(u);Fi(d,()=>fa,!0),k(d),k(u);var f=V(u,2),p=B(f);Fi(p,()=>pa,!0),k(p),k(f),k(l);var m=V(l,2),h=B(m),g=B(h);Fi(g,()=>ma,!0),k(g),k(h),k(m),k(c),K(`click`,d,o),K(`click`,p,o),K(`click`,g,s),J(e,c),M(),a()}si([`click`]);var _l=`<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>`,vl=q(`<li class="svelte-s7v0ur"><a href="##select"><!> </a></li>`);function yl(e,t){j(t,!0);let n=()=>P(al,`$selectedCollection`,i),r=()=>P(dl,`$config`,i),[i,a]=I(),o=hn(()=>n()?.name===t.name?`selected`:``);function s(e){e.preventDefault(),F(al,r().collections.find(e=>e.name===t.name))}var c=vl(),l=B(c);let u;var d=B(l);Fi(d,()=>_l);var f=V(d,1,!0);k(l),k(c),H(()=>{u=Ui(l,1,`collectionNav svelte-s7v0ur`,null,u,{selected:G(o)}),Y(f,t.label)}),K(`click`,l,s),J(e,c),M(),a()}si([`click`]);var bl=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|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,g={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(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof ee||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),te=ee.prototype;return w.prototype=te,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){te[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,ee,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}))()),xl=q(`<div class="item svelte-i3qvht"><input type="checkbox" name="entry-select"/> <a href="#editor" class="entry-info svelte-i3qvht"><div class="entry-name svelte-i3qvht"> </div> <div class="entry-status svelte-i3qvht"> </div> <div class="entry-date svelte-i3qvht"> </div></a></div>`);function Sl(e,t){j(t,!0);let n=()=>P(s,`$selectedEntries`,r),[r,i]=I(),a=t.entry.fields.draft?`draft`:`published`,o=(0,bl.default)(t.entry.fields.date).format(`MM/DD/YY`),s=ft(`selectedEntries`);function c(e){e.target.checked?F(s,[...n(),t.entry]):F(s,n().filter(e=>e!==t.entry))}function l(){F(sl,{}),F(ol,t.entry)}var u=xl(),d=B(u),f=V(d,2),p=B(f),m=B(p,!0);k(p);var h=V(p,2),g=B(h,!0);k(h);var _=V(h,2),v=B(_,!0);k(_),k(f),k(u),H(()=>{Y(m,t.entry.fields.title),Y(g,a),Y(v,o)}),K(`change`,d,c),K(`click`,f,l),J(e,u),M(),i()}si([`change`,`click`]);var Cl=q(`<div> </div>`),wl=q(`<div class="toast"><div aria-busy="true"></div> <!></div>`);function Tl(e,t){var n=wl(),r=V(B(n),2),i=e=>{var n=Cl(),r=B(n,!0);k(n),H(()=>Y(r,t.msg)),J(e,n)};wi(r,e=>{t.msg&&e(i)}),k(n),J(e,n)}var El=`<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>`,Dl=q(`<div class="toast warning"><!> <details class="svelte-bipkou"><summary> </summary> </details></div>`);function Ol(e,t){var n=Dl(),r=B(n);Fi(r,()=>El);var i=V(r,2),a=B(i),o=B(a,!0);k(a);var s=V(a);k(i),k(n),H(()=>{Y(o,t.msg),Y(s,` ${t.details??``}`)}),J(e,n)}var kl=`<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>`,Al=`<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>`,jl=q(`<div id="empty" class="svelte-vl570e"><p>This collection has no entries.</p> <button class="svelte-vl570e"><!>Create New Entry</button></div>`),Ml=q(`<div id="items" class="svelte-vl570e"></div>`),Nl=q(`<main class="svelte-vl570e"><header class="svelte-vl570e"> <div id="listActions" class="svelte-vl570e"><button class="outline svelte-vl570e"><!>Delete</button> <button class="svelte-vl570e"><!>New</button></div></header> <!> <!> <!></main>`);function Pl(e,t){j(t,!0);let n=()=>P(al,`$selectedCollection`,o),r=()=>P(ul,`$backend`,o),i=()=>P(c,`$selectedEntries`,o),a=()=>P(fl,`$cmsActions`,o),[o,s]=I(),c=At([]);pt(`selectedEntries`,c);let l=R(void 0),u=R(void 0),d=R(Nn([])),f=R(void 0);ir(()=>{G(f)!==n()?.name&&p()});async function p(){try{if(!r()||!n().name)return;z(f,n().name,!0),z(l,r().getFiles(n().name),!0),z(d,await G(l)||[],!0)}catch{}}function m(){F(ol,null),F(sl,{}),window.location.hash=`#/editor`}async function h(){try{await r().deleteFiles(i()),a()?.onDelete&&(z(u,a().onDelete(i()),!0),await G(u)),F(c,[]),p()}catch(e){console.error(`Error deleting files`,e)}}var g=Nl(),_=B(g),v=B(_),y=V(v),b=B(y);Fi(B(b),()=>kl),et(),k(b);var x=V(b,2);Fi(B(x),()=>Al),et(),k(x),k(y),k(_);var S=V(_,2),C=e=>{var t=jl(),n=V(B(t),2);Fi(B(n),()=>Al),et(),k(n),k(t),K(`click`,n,m),J(e,t)},w=e=>{var t=Ml();ki(t,21,()=>G(d),e=>e.name,(e,t)=>{Sl(e,{get entry(){return G(t)}})}),k(t),J(e,t)};wi(S,e=>{G(d).length===0?e(C):e(w,-1)});var T=V(S,2);Ci(T,()=>G(l),e=>{Tl(e,{msg:`Loading`})},void 0,(e,t)=>{Ol(e,{msg:`Error getting entries`,get details(){return G(t).message}})}),Ci(V(T,2),()=>G(u),null,void 0,(e,t)=>{Ol(e,{msg:`'On delete' event action failed`,get details(){return G(t).message}})}),k(g),H(()=>{Y(v,`${(n()?.label||``)??``} `),b.disabled=i().length===0}),K(`click`,b,h),K(`click`,x,m),J(e,g),M(),s()}si([`click`]);var Fl=q(`<div class="svelte-1vgyypt"><input type="checkbox" name="media-select" class="svelte-1vgyypt"/> <img loading="lazy" crossorigin="use-credentials" class="svelte-1vgyypt"/> <small class="svelte-1vgyypt"> </small></div>`);function Il(e,t){j(t,!0);let n=()=>P(a,`$selectedMediaFiles`,r),[r,i]=I(),a=ft(`selectedMediaFiles`);function o(e){e.target.checked?F(a,[...n(),t.media]):F(a,n().filter(e=>e!==t.media))}var s=Fl(),c=B(s),l=V(c,2),u=V(l,2),d=B(u,!0);k(u),k(s),H(()=>{X(l,`src`,t.media.url_preview),X(l,`alt`,t.media.alt),Y(d,t.media.name)}),K(`change`,c,o),J(e,s),M(),i()}si([`change`]);var Ll=`<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>`,Rl=q(`<div id="empty" class="svelte-1gxvaku"><p>No files found.</p> <button class="svelte-1gxvaku"><!>Upload a File</button></div>`),zl=q(`<div id="items" class="svelte-1gxvaku"></div>`),Bl=q(`<main class="svelte-1gxvaku"><header class="svelte-1gxvaku">Media Files <div id="listActions" class="svelte-1gxvaku"><button class="outline svelte-1gxvaku"><!>Delete</button> <button class="svelte-1gxvaku"><!>Upload</button></div></header> <!> <!></main>`);function Vl(e,t){j(t,!0);let n=()=>P(ul,`$backend`,i),r=()=>P(o,`$selectedMediaFiles`,i),[i,a]=I(),o=At([]);pt(`selectedMediaFiles`,o);let s=R(void 0),c=R(Nn([]));async function l(){try{z(s,n()?.getMediaFiles(),!0),z(c,await G(s)||[],!0)}catch{}}async function u(){await n().uploadMediaFile(),l()}async function d(){try{await n().deleteFiles(r()),F(o,[]),l()}catch(e){console.error(`Error deleting files`,e)}}ua(()=>{l()});var f=Bl(),p=B(f),m=V(B(p)),h=B(m);Fi(B(h),()=>kl),et(),k(h);var g=V(h,2);Fi(B(g),()=>Ll),et(),k(g),k(m),k(p);var _=V(p,2),v=e=>{var t=Rl(),n=V(B(t),2);Fi(B(n),()=>Ll),et(),k(n),k(t),K(`click`,n,u),J(e,t)},y=e=>{var t=zl();ki(t,21,()=>G(c),e=>e.name,(e,t)=>{Il(e,{get media(){return G(t)}})}),k(t),J(e,t)};wi(_,e=>{G(c).length===0?e(v):e(y,-1)}),Ci(V(_,2),()=>G(s),e=>{Tl(e,{msg:`Loading`})},void 0,(e,t)=>{Ol(e,{msg:`Error getting entries`,get details(){return G(t).message}})}),k(f),H(()=>h.disabled=r().length===0),K(`click`,h,d),K(`click`,g,u),J(e,f),M(),a()}si([`click`]);var Hl=q(`<aside class="svelte-bdf84k"><ul class="svelte-bdf84k"><!></ul></aside> <!>`,1),Ul=q(`<!> <div id="dash" class="page svelte-bdf84k"><!></div>`,1);function Wl(e,t){j(t,!0);let n=()=>P(dl,`$config`,i),r=()=>P(al,`$selectedCollection`,i),[i,a]=I(),o=R(`posts`),s=hn(()=>n()?.collections);ir(()=>{r()||F(al,G(s)?.[0])});function c(e){z(o,e,!0)}var l=Ul(),u=Un(l);gl(u,{onselectview:c});var d=V(u,2),f=B(d),p=e=>{var t=Hl(),n=Un(t),r=B(n),i=B(r),a=e=>{var t=mi();ki(Un(t),17,()=>G(s),Ti,(e,t)=>{yl(e,ca(()=>G(t)))}),J(e,t)};wi(i,e=>{G(s)&&e(a)}),k(r),k(n),Pl(V(n,2),{}),J(e,t)},m=e=>{Vl(e,{})};wi(f,e=>{G(o)===`posts`?e(p):G(o)===`media`&&e(m,1)}),k(d),J(e,l),M(),a()}var Gl=`<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>`,Kl=(()=>{if(typeof self>`u`)return!1;if(`top`in self&&self!==top)try{top.window.document._=0}catch{return!1}return`showOpenFilePicker`in self})(),ql=Kl?Promise.resolve().then(function(){return eu}):Promise.resolve().then(function(){return au});async function Jl(...e){return(await ql).default(...e)}var Yl=Kl?Promise.resolve().then(function(){return ru}):Promise.resolve().then(function(){return ou});async function Xl(...e){return(await Yl).default(...e)}var Zl=Kl?Promise.resolve().then(function(){return iu}):Promise.resolve().then(function(){return su});async function Ql(...e){return(await Zl).default(...e)}var $l=async e=>{let t=await e.getFile();return t.handle=e,t},eu={__proto__:null,default:async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach((e,n)=>{t[n]={description:e.description||`Files`,accept:{}},e.mimeTypes?e.mimeTypes.map(r=>{t[n].accept[r]=e.extensions||[]}):t[n].accept[`*/*`]=e.extensions||[]});let 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($l));return e[0].multiple?r:r[0]}};function tu(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return tu=function(e){this.s=e,this.n=e.next},tu.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new tu(e)}var nu=async(e,t,n=e.name,r)=>{let i=[],a=[];var o,s=!1,c=!1;try{for(var l,u=function(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new tu(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}(e.values());s=!(l=await u.next()).done;s=!1){let o=l.value,s=`${n}/${o.name}`;o.kind===`file`?a.push(o.getFile().then(t=>(t.directoryHandle=e,t.handle=o,Object.defineProperty(t,`webkitRelativePath`,{configurable:!0,enumerable:!0,get:()=>s})))):o.kind!==`directory`||!t||r&&r(o)||i.push(nu(o,t,s,r))}}catch(e){c=!0,o=e}finally{try{s&&u.return!=null&&await u.return()}finally{if(c)throw o}}return[...(await Promise.all(i)).flat(),...await Promise.all(a)]},ru={__proto__:null,default:async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||`read`;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:nu(t,e.recursive,void 0,e.skipDirectory)}},iu={__proto__:null,default:async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||`Untitled`;let a=[],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((e,t)=>{a[t]={description:e.description||`Files`,accept:{}},e.mimeTypes?(t===0&&o&&e.mimeTypes.push(o),e.mimeTypes.map(n=>{a[t].accept[n]=e.extensions||[]})):o?a[t].accept[o]=e.extensions||[]:a[t].accept[`*/*`]=e.extensions||[]}),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let s=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:a,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(s);let c=await s.createWritable();return`stream`in e?(await e.stream().pipeTo(c),s):`body`in e?(await e.body.pipeTo(c),s):(await c.write(await e),await c.close(),s)}},au={__proto__:null,default:async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{let r=document.createElement(`input`);r.type=`file`;let i=[...e.map(e=>e.mimeTypes||[]),...e.map(e=>e.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||``,r.style.display=`none`,document.body.append(r),r.addEventListener(`cancel`,()=>{r.remove(),n(new DOMException(`The user aborted a request.`,`AbortError`))}),r.addEventListener(`change`,()=>{r.remove(),t(r.multiple?Array.from(r.files):r.files[0])}),`showPicker`in HTMLInputElement.prototype?r.showPicker():r.click()}))},ou={__proto__:null,default:async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{let r=document.createElement(`input`);r.type=`file`,r.webkitdirectory=!0,r.style.display=`none`,document.body.append(r),r.addEventListener(`cancel`,()=>{r.remove(),n(new DOMException(`The user aborted a request.`,`AbortError`))}),r.addEventListener(`change`,()=>{r.remove();let n=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(n=n.filter(t=>t.webkitRelativePath.split(`/`).every(t=>!e[0].skipDirectory({name:t,kind:`directory`})))):n=n.filter(e=>e.webkitRelativePath.split(`/`).length===2),t(n)}),`showPicker`in HTMLInputElement.prototype?r.showPicker():r.click()}))},su={__proto__:null,default:async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement(`a`),r=e;`body`in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then(({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()})}()}),i=await new Response(r).blob();return n.releaseLock(),new Blob([i],{type:t})}(e.body,e.headers.get(`content-type`))),n.download=t.fileName||`Untitled`,n.href=URL.createObjectURL(await r);let i=()=>{typeof a==`function`&&a()},a=t.legacySetup&&t.legacySetup(i,()=>a(),n);return n.addEventListener(`click`,()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null}},cu=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={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`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))}))(),1);bl.default.extend(cu.default);var lu=`../../cms-config/`,uu=`Unable to parse markdown entry. Backend must implement 'replacePreviewLinks()'
34
+ and return a valid string.`;function du(e,t){let n=(0,bl.default)(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 fu(e,t){let n=e?.previews.styles.find(e=>e.name===t)?.files;if(!n)return;let r=[];return n.forEach(e=>{let t=`${lu}${e}`;r.push(new URL(t,window.location.href).href)}),r.map(e=>`<link rel="stylesheet" href="${e}">`).join(`
35
+ `)}async function pu(e,t){let n=e?.previews.templates.find(e=>e.name===t)?.template;if(!n)return;let r=new URL(`${lu}${n}`,window.location.href).href;try{let e=await fetch(r);if(!e.ok)throw Error(`Unable to fetch file ${r}`);return await e.text()}catch(e){console.error(e);return}}function mu(e,t){return e?.replace(`{{styles}}`,t).replaceAll(`{{`,`<span data-tag="`).replaceAll(`}}`,`"></span>`)}async function hu(e,t,n){let r;switch(e.widget){case`markdown`:if(!n?.replacePreviewLinks||(r=await n?.replacePreviewLinks(t),r==null))throw Error(uu);break;case`datetime`:let i;switch(e.type){case`time`:i=(0,bl.default)(t.toString(),`hh:mm`).toISOString();break;case`date`:i=(0,bl.default)(t.toString(),`YYYY-MM-DD`).toISOString();break;default:i=(0,bl.default)(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((0,bl.default)(t.toString(),`YYYY-MM-DDThh:mm`).toISOString());break;case`time`:r=new Date((0,bl.default)(t.toString(),`hh:mm`).toISOString());break;case`date`:r=new Date((0,bl.default)(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 gu(e,t){let{slug:n,extension:r}=e,{title:i,date:a}=t,o=i.toLowerCase().replaceAll(/\W+/g,`-`),s=(0,bl.default)(a);return`${n.replaceAll(`{{slug}}`,o).replaceAll(`{{year}}`,s.format(`YYYY`)).replaceAll(`{{month}}`,s.format(`MM`)).replaceAll(`{{day}}`,s.format(`DD`)).replaceAll(`{{hour}}`,s.format(`HH`)).replaceAll(`{{minute}}`,s.format(`mm`)).replaceAll(`{{second}}`,s.format(`ss`))}.${r}`}function _u(e,t){let n={...t},{date:r,body:i}={...n.fields};delete n.fields.body;let a=el.dump(n.fields,{quotingType:`"`,forceQuotes:!0});return n.date=r,n.body=i,n.collection=e.name,n.name||=gu(e,n.fields),n.raw=`---\n${a}---\n\n${n.body}`,n}function vu(e){if(!/^---(\r?\n)/.test(e.trim()))return[`date: 0001-01-01T12:00:00-00:00`,e.trim()];let t=`{#{br}#}`;return e.trim().replace(`---`,t).replace(`---`,t).split(t).filter(e=>e.length>0).map(e=>e.trim())}function yu(e){switch(e){case`.md`:case`.markdown`:return`text/markdown`;default:return`text/plain`}}function bu(e){let t=/!?\[.+\]\(.+\)/g,n=/!?\[.+\]\(/,r=/\)/;return e.match(t)?.map(e=>e.replace(n,``).replace(r,``))||[]}async function xu(e,t){let{file:n}=Mt(e).backend;if(!n)return;let r=new URL(`${lu}${n}`,window.location.href).href,i=await il(()=>import(r),[],import.meta.url),a={configStore:e,backendStore:t,getStoreValueFunc:Mt,getContentsFunc:vu,parseLinksFunc:bu,fileOpenFunc:Jl};return i.default.init(a)}var Su=q(`<button form="entry-data">Save</button>`),Cu=q(`<button form="entry-data">Save</button>`),wu=q(`<button form="entry-data" disabled="">Save</button>`),Tu=q(`<nav><ul><li><a href="##back" class="svelte-g1hcr7"></a></li></ul> <ul><li class="svelte-g1hcr7"> <span class="svelte-g1hcr7">/</span> </li></ul> <ul><li><!></li></ul></nav>`);function Eu(e,t){j(t,!0);let n=()=>P(ol,`$editingEntry`,l),r=()=>P(ll,`$loadedWidgets`,l),i=()=>P(cl,`$loadingWidgets`,l),a=()=>P(sl,`$draftEntry`,l),o=()=>P(al,`$selectedCollection`,l),s=()=>P(ul,`$backend`,l),c=()=>P(f,`$submitted`,l),[l,u]=I(),d=ft(`formState`),f=ft(`submitted`),p=R(!1),m=R(Nn(lt(n()))),h=R(void 0),g=!1;ir(()=>{!g&&r()===i()&&(z(h,lt(a()),!0),g=!0)}),ir(()=>{let e=JSON.stringify(n())!==JSON.stringify(G(m)),t=JSON.stringify(a())!==JSON.stringify(G(h));(e||t)&&_()});async function _(){let{entryForm:e}=d;e&&(z(p,!await v(e)),z(m,n(),!0),z(h,a(),!0))}async function v(e){if(!n())return!1;let t=new FormData(e);for(let[e,r]of t){let t=o().fields.find(t=>t.name===e),i=n()?.fields[t.name]??n()[t.name],a=await hu(t,r,s()),c,l;switch(t.widget){case`datetime`:c=new Date(i).getTime(),l=a.getTime();break;case`markdown`:c=i.trim().replaceAll(`\r
39
36
  `,`
40
- `),j=Z.trim().replaceAll(`\r
37
+ `),l=a.trim().replaceAll(`\r
41
38
  `,`
42
- `);break;case"hidden":switch(D.type){case"datetime-local":case"date":case"time":M=new Date(W).getTime(),j=Z.getTime();break;default:M=W,j=Z;break}break;default:M=W,j=Z;break}if(M!==j)return!1}return!0}function k(b){b.preventDefault(),history.back()}var L=Om(),$=I(L),N=I($),E=I(N);E.__click=k;var P=I(E);Be(P,()=>nm);var G=R($,2),V=I(G),T=I(V),Y=R(T,2),B=R(G,2),C=I(B),x=I(C);tt(x,l,b=>{var S=Tm();q(b,S)},(b,S)=>{var A=Lm();ee(()=>A.disabled=!y(d)),q(b,A)},(b,S)=>{var A=Nm();ee(()=>A.disabled=!y(d)),q(b,A)}),ee(()=>{ce(T,`${o()?.label??""} `),ce(Y,` ${(n()?.fields.title||"New File")??""}`)}),q(e,L),le(),f()}Ve(["click"]);var Dm=z('<label class="editorInput"> <input type="checkbox" role="switch" form="ignore"/> <input type="hidden"/></label>');function Rm(e,t){se(t,!0);const n=()=>H(Ee,"$draftEntry",o),r=()=>H(nt,"$selectedCollection",o),i=()=>H(rt,"$editingEntry",o),a=()=>H(Te,"$loadedWidgets",o),[o,s]=me();let l=je(t,"checked",7,!1),c=je(t,"required",3,!1);function f(){const m={...n()};l()==null?m[t.name]=r()?.fields.find(v=>v.name===t.name).default:m[t.name]=l(),re(Ee,m)}async function u(){i()&&l(i().fields[t.name]),f(),re(Te,a()+1)}Ue(()=>{u()});var p=Dm(),d=I(p),h=R(d);h.__change=f;var g=R(h,2);ee(()=>{Q(p,"for",t.name),ce(d,`${t.label??""} `),Q(h,"id",t.name),Q(h,"name",t.name),h.required=c(),Q(g,"id",t.name),Q(g,"name",t.name),Qf(g,l()),g.required=c()}),ed(h,l),q(e,p),le(),s()}Ve(["change"]);var Fm=z('<input type="time"/>'),Hm=z('<input type="date"/>'),Pm=z('<input type="datetime-local"/>'),Bm=z('<label class="editorInput"> <!></label>');function jm(e,t){se(t,!0);const n=()=>H(Ee,"$draftEntry",a),r=()=>H(rt,"$editingEntry",a),i=()=>H(Te,"$loadedWidgets",a),[a,o]=me();let s=je(t,"type",3,"datetime-local"),l=je(t,"value",23,()=>$r(s(),new Date)),c=je(t,"required",3,!0);function f(){const v={...n()};v[t.name]=l(),re(Ee,v)}async function u(){if(r()){const v=r().fields;l($r(s(),new Date(v[t.name])))}f(),re(Te,i()+1)}Ue(()=>{u()});var p=Bm(),d=I(p),h=R(d);{var g=v=>{var w=Fm();w.__input=f,ee(()=>{Q(w,"id",t.name),Q(w,"name",t.name),w.required=c()}),Pt(w,l),q(v,w)},m=v=>{var w=ct(),k=xe(w);{var L=N=>{var E=Hm();E.__input=f,ee(()=>{Q(E,"id",t.name),Q(E,"name",t.name),E.required=c()}),Pt(E,l),q(N,E)},$=N=>{var E=Pm();E.__input=f,ee(()=>{Q(E,"id",t.name),Q(E,"name",t.name),E.required=c()}),Pt(E,l),q(N,E)};Le(k,N=>{s()==="date"?N(L):N($,!1)},!0)}q(v,w)};Le(h,v=>{s()==="time"?v(g):v(m,!1)})}ee(()=>{Q(p,"for",t.name),ce(d,`${t.label??""} `)}),q(e,p),le(),o()}Ve(["input"]);var qm=z('<input type="text"/>'),Vm=z("<textarea></textarea>"),Um=z('<label class="editorInput"> <!></label>');function ts(e,t){se(t,!0);const n=()=>H(Ee,"$draftEntry",o),r=()=>H(nt,"$selectedCollection",o),i=()=>H(rt,"$editingEntry",o),a=()=>H(Te,"$loadedWidgets",o),[o,s]=me();let l=je(t,"multiline",3,!1),c=je(t,"required",3,!0),f=je(t,"value",7,"");function u(){const w={...n()};f()?w[t.name]=f():w[t.name]=r()?.fields.find(k=>k.name===t.name).label,re(Ee,w)}async function p(){i()&&f(t.name==="body"?i().body:i().fields[t.name]),u(),re(Te,a()+1)}Ue(()=>{p()});var d=Um(),h=I(d),g=R(h);{var m=w=>{var k=qm();k.__input=u,ee(()=>{Q(k,"id",t.name),Q(k,"name",t.name),k.required=c()}),Pt(k,f),q(w,k)},v=w=>{var k=Vm();k.__input=u,ee(()=>{Q(k,"id",t.name),Q(k,"name",t.name),k.required=c()}),Pt(k,f),q(w,k)};Le(g,w=>{l()?w(v,!1):w(m)})}ee(()=>{Q(d,"for",t.name),ce(h,`${t.label??""} `)}),q(e,d),le(),s()}Ve(["input"]);var Ym=z('<label class="editorInput"> <input type="number"/></label>');function Wm(e,t){se(t,!0);const n=()=>H(Ee,"$draftEntry",a),r=()=>H(rt,"$editingEntry",a),i=()=>H(Te,"$loadedWidgets",a),[a,o]=me();let s=je(t,"value",7),l=je(t,"required",3,!0);function c(){const h={...n()};h[t.name]=s(),re(Ee,h)}async function f(){r()&&s(r().fields[t.name]),c(),re(Te,i()+1)}Ue(()=>{f()});var u=Ym(),p=I(u),d=R(p);d.__input=c,ee(()=>{Q(u,"for",t.name),ce(p,`${t.label??""} `),Q(d,"id",t.name),Q(d,"name",t.name),Q(d,"step",t.step),Q(d,"min",t.min),Q(d,"max",t.max),d.required=l()}),Pt(d,s),q(e,u),le(),o()}Ve(["input"]);const Km='<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>',zm='<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>',Gm='<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>',Zm='<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>',Jm='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>horizontal-rule</title><path d="M19,13H5V11H19V13Z" /></svg>',Qm='<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>',Xm='<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>',eg='<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>';var tg=z('<option class="svelte-8wonn1"> </option>'),ng=z('<button class="secondary svelte-8wonn1"><!></button>'),rg=z('<div class="editor-menu svelte-8wonn1"><select name="text-type" form="ignore" class="svelte-8wonn1"></select> <!></div>');function ig(e,t){se(t,!0);let n=K(void 0),r=K(void 0);const i=c(),a=[{name:"bold",icon:Km},{name:"italic",icon:zm},{name:"listBulleted",icon:Gm},{name:"listNumbered",icon:Zm},{name:"quote",icon:Qm},{name:"horizontalRule",icon:Jm},{name:"link",icon:Xm},{name:"image",icon:eg}];function o(d){d.preventDefault();const{action:h}=d.currentTarget.dataset;t.onactionselect(h)}function s(d){const h=d.currentTarget.value;t.ontexttypeselect(h)}function l(){const h=document.getSelection().focusNode?.parentElement;if(!y(r).contains(h))return;const{localName:g}=h;switch(g){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":y(n).value=parseInt(g.split("").at(-1));break;default:y(n).value="p";break}}function c(){const d=[];for(let h=0;h<=6;h++){let g;h===0?g={title:"Normal",value:"p"}:g={title:`Heading ${h}`,value:h},d.push(g)}return d}Ue(()=>{U(r,document.querySelector("#md-editor"),!0)});var f=rg();on("selectionchange",Yr,l);var u=I(f);u.__change=s,qt(u,21,()=>i,Ni,(d,h)=>{var g=tg(),m=I(g),v={};ee(()=>{ce(m,y(h).title),v!==(v=y(h).value)&&(g.value=(g.__value=y(h).value)??"")}),q(d,g)}),En(u,d=>U(n,d),()=>y(n));var p=R(u,2);qt(p,17,()=>a,Ni,(d,h)=>{var g=ng();g.__click=o;var m=I(g);Be(m,()=>y(h).icon),ee(()=>Q(g,"data-action",y(h).name)),q(d,g)}),q(e,f),le()}Ve(["change","click"]);var ag=z('<div id="link-editor-container" class="svelte-1qtwn58"><div id="link-editor" class="svelte-1qtwn58"><div class="svelte-1qtwn58">Enter link:</div> <input form="md-link-editor" type="url" name="url" placeholder="https://example.com" required class="svelte-1qtwn58"/> <button class="secondary svelte-1qtwn58" form="md-link-editor" type="submit">Save</button></div></div>');function og(e,t){se(t,!0);let n=K(!1),r=K(void 0),i=K(void 0);pt(()=>{y(n)&&y(i).focus()});function a(){const d=document.getSelection();if(d.focusNode.parentElement.localName==="a"){t.onsaveurl({});return}else if(y(n))U(n,!y(n)),y(i).value="";else{const{startOffset:h,endOffset:g}=d.getRangeAt(0);U(n,h!==g)}}function o(d){d.preventDefault();const h=y(i).value;y(i).value="",U(n,!1),t.onsaveurl({href:h})}function s(){if(!y(n))return;const h=document.getSelection().focusNode;y(r).contains(h)||(U(n,!1),y(i).value="",t.onsaveurl(null))}Ue(()=>{const d=document.querySelector("#md-link-editor");return d.addEventListener("submit",o),()=>{d.removeEventListener("submit",o)}});var l={toggleEditor:a},c=ag();on("selectionchange",Yr,s);let f;var u=I(c),p=R(I(u),2);return En(p,d=>U(i,d),()=>y(i)),En(u,d=>U(r,d),()=>y(r)),ee(()=>f=Gf(c,"",f,{visibility:y(n)?"visible":"hidden"})),q(e,c),le(l)}var sg=z('<div><img alt="" loading="lazy" crossorigin="use-credentials" class="svelte-kkm0gm"/> <small class="svelte-kkm0gm"> </small></div>'),lg=z('<dialog open><article><header>Select Image</header> <div class="images svelte-kkm0gm"></div> <footer class="svelte-kkm0gm"><button class="secondary svelte-kkm0gm">Cancel</button> <button class="svelte-kkm0gm">Select</button></footer></article></dialog>');function cg(e,t){se(t,!0);const n=()=>H(at,"$backend",r),[r,i]=me();let a=K(Xe([])),o=K(void 0);async function s(){const v=await n()?.getMediaFiles();U(a,v||[],!0)}function l(v){U(o,v,!0)}function c(v){v.preventDefault(),t.onselectimg(y(o))}function f(v){v.preventDefault(),v.currentTarget===v.target&&t.onselectimg(null)}Ue(()=>{s();const{body:v}=document;return v.classList.add("contain-scroll"),()=>{v.classList.remove("contain-scroll")}});var u=lg();u.__click=f;var p=I(u),d=R(I(p),2);qt(d,21,()=>y(a),v=>v.name,(v,w)=>{var k=sg();let L;k.__click=()=>l(y(w));var $=I(k),N=R($,2),E=I(N);ee(()=>{L=Ml(k,1,"img-container svelte-kkm0gm",null,L,{selected:y(o)===y(w)}),Q($,"src",y(w).url_preview),ce(E,y(w).name)}),q(v,k)});var h=R(d,2),g=I(h);g.__click=f;var m=R(g,2);m.__click=c,ee(()=>m.disabled=!y(o)),q(e,u),le(),i()}Ve(["click"]);var ug=typeof global=="object"&&global&&global.Object===Object&&global,fg=typeof self=="object"&&self&&self.Object===Object&&self,xc=ug||fg||Function("return this")(),Dr=xc.Symbol,Ac=Object.prototype,dg=Ac.hasOwnProperty,pg=Ac.toString,Hn=Dr?Dr.toStringTag:void 0;function hg(e){var t=dg.call(e,Hn),n=e[Hn];try{e[Hn]=void 0;var r=!0}catch{}var i=pg.call(e);return r&&(t?e[Hn]=n:delete e[Hn]),i}var mg=Object.prototype,gg=mg.toString;function vg(e){return gg.call(e)}var yg="[object Null]",wg="[object Undefined]",ns=Dr?Dr.toStringTag:void 0;function _g(e){return e==null?e===void 0?wg:yg:ns&&ns in Object(e)?hg(e):vg(e)}function bg(e){return e!=null&&typeof e=="object"}var kg="[object Symbol]";function xg(e){return typeof e=="symbol"||bg(e)&&_g(e)==kg}var Ag=/\s/;function Eg(e){for(var t=e.length;t--&&Ag.test(e.charAt(t)););return t}var Cg=/^\s+/;function Sg(e){return e&&e.slice(0,Eg(e)+1).replace(Cg,"")}function Bi(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var rs=NaN,Mg=/^[-+]0x[0-9a-f]+$/i,Ig=/^0b[01]+$/i,Lg=/^0o[0-7]+$/i,Ng=parseInt;function is(e){if(typeof e=="number")return e;if(xg(e))return rs;if(Bi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Bi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Sg(e);var n=Ig.test(e);return n||Lg.test(e)?Ng(e.slice(2),n?2:8):Mg.test(e)?rs:+e}var yi=function(){return xc.Date.now()},Tg="Expected a function",Og=Math.max,$g=Math.min;function Dg(e,t,n){var r,i,a,o,s,l,c=0,f=!1,u=!1,p=!0;if(typeof e!="function")throw new TypeError(Tg);t=is(t)||0,Bi(n)&&(f=!!n.leading,u="maxWait"in n,a=u?Og(is(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p);function d(N){var E=r,P=i;return r=i=void 0,c=N,o=e.apply(P,E),o}function h(N){return c=N,s=setTimeout(v,t),f?d(N):o}function g(N){var E=N-l,P=N-c,G=t-E;return u?$g(G,a-P):G}function m(N){var E=N-l,P=N-c;return l===void 0||E>=t||E<0||u&&P>=a}function v(){var N=yi();if(m(N))return w(N);s=setTimeout(v,g(N))}function w(N){return s=void 0,p&&r?d(N):(r=i=void 0,o)}function k(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function L(){return s===void 0?o:w(yi())}function $(){var N=yi(),E=m(N);if(r=arguments,i=this,l=N,E){if(s===void 0)return h(l);if(u)return clearTimeout(s),s=setTimeout(v,t),d(l)}return s===void 0&&(s=setTimeout(v,t)),o}return $.cancel=k,$.flush=L,$}class Ec{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=t=>(this.beforeMountedListeners.push(t),this),this.mounted=t=>(this.mountedListeners.push(t),this),this.updated=t=>(this.updatedListeners.push(t),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(t){return this.markdownUpdatedListeners.push(t),this}blur(t){return this.blurListeners.push(t),this}focus(t){return this.focusListeners.push(t),this}destroy(t){return this.destroyListeners.push(t),this}selectionUpdated(t){return this.selectionUpdatedListeners.push(t),this}}const ji=xs(new Ec,"listener"),Rg=new In("MILKDOWN_LISTENER"),Cc=e=>(e.inject(ji,new Ec),async()=>{await e.wait(As);const t=e.get(ji),{listeners:n}=t;n.beforeMount.forEach(l=>l(e)),await e.wait(ou);const r=e.get(su);let i=null,a=null,o=null;const s=new Mn({key:Rg,view:()=>({destroy:()=>{n.destroy.forEach(l=>l(e))}}),props:{handleDOMEvents:{focus:()=>(n.focus.forEach(l=>l(e)),!1),blur:()=>(n.blur.forEach(l=>l(e)),!1)}},state:{init:(l,c)=>{i=c.doc,a=r(c.doc)},apply:l=>{const c=l.selection;return(!o&&c||o&&!c.eq(o))&&(n.selectionUpdated.forEach(u=>{u(e,c,o)}),o=c),!(l.docChanged||l.storedMarksSet)||l.getMeta("addToHistory")===!1?void 0:Dg(()=>{const{doc:u}=l;if(n.updated.length>0&&i&&!i.eq(u)&&n.updated.forEach(p=>{p(e,u,i)}),n.markdownUpdated.length>0&&i&&!i.eq(u)){const p=r(u);n.markdownUpdated.forEach(d=>{d(e,p,a)}),a=p}i=u},200)()}}});e.update(kr,l=>l.concat(s)),await e.wait(lu),n.mounted.forEach(l=>l(e))});Cc.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};function ie(e,t){const n=hu(e),r=i=>async()=>{r.key=n,await i.wait(pu);const a=t(i);return i.get(ae).create(n,a),r.run=o=>i.get(ae).call(e,o),()=>{i.get(ae).remove(n)}};return r}function ot(e){const t=n=>async()=>{await n.wait(Es);const r=e(n);return n.update(wo,i=>[...i,r]),t.inputRule=r,()=>{n.update(wo,i=>i.filter(a=>a!==r))}};return t}function Fg(e,t){const n=r=>async()=>{const i=t(r);return r.update(yo,a=>[...a.filter(o=>o[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(yo,a=>a.filter(([o])=>o!==e))}};return n.type=r=>{const i=r.get(Fr).marks[e];if(!i)throw gu(e);return i},n}function ka(e,t){const n=r=>async()=>{const i=t(r);return r.update(vo,a=>[...a.filter(o=>o[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(vo,a=>a.filter(([o])=>o!==e))}};return n.type=r=>{const i=r.get(Fr).nodes[e];if(!i)throw mu(e);return i},n}function rr(e){let t;const n=r=>async()=>(await r.wait(Es),t=e(r),r.update(kr,i=>[...i,t]),()=>{r.update(kr,i=>i.filter(a=>a!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function Hg(e){const t=n=>async()=>{await n.wait(vu);const r=n.get(yu),i=e(n),a=r.addObjectKeymap(i);return t.keymap=i,()=>{a()}};return t}function Yt(e,t){const n=xs(e,t),r=i=>(i.inject(n),()=>()=>{i.remove(n)});return r.key=n,r}function Ze(e,t){const n=Yt(t,e),r=ka(e,a=>a.get(n.key)(a)),i=[n,r];return i.id=r.id,i.node=r,i.type=a=>r.type(a),i.ctx=n,i.key=n.key,i.extendSchema=a=>{const o=a(t);return Ze(e,o)},i}function ir(e,t){const n=Yt(t,e),r=Fg(e,a=>a.get(n.key)(a)),i=[n,r];return i.id=r.id,i.mark=r,i.type=a=>r.type(a),i.ctx=n,i.key=n.key,i.extendSchema=a=>{const o=a(t);return ir(e,o)},i}function st(e,t){const n=Object.fromEntries(Object.entries(t).map(([o,{shortcuts:s,priority:l}])=>[o,{shortcuts:s,priority:l}])),r=Yt(n,`${e}Keymap`),i=Hg(o=>{const s=o.get(r.key),l=Object.entries(t).flatMap(([c,{command:f}])=>{const u=s[c],p=[u.shortcuts].flat(),d=u.priority;return p.map(h=>[h,{key:h,onRun:f,priority:d}])});return Object.fromEntries(l)}),a=[r,i];return a.ctx=r,a.shortcuts=i,a.key=r.key,a.keymap=i.keymap,a}const lt=(e,t=()=>({}))=>Yt(t,`${e}Attr`),Jr=(e,t=()=>({}))=>Yt(t,`${e}Attr`);function Nn(e,t,n){const r=Yt({},e),i=o=>async()=>{await o.wait(As);const l={plugin:t(o),options:o.get(r.key)};return o.update(go,c=>[...c,l]),()=>{o.update(go,c=>c.filter(f=>f!==l))}},a=[r,i];return a.id=e,a.plugin=i,a.options=r,a}function Pg(){return e=>{const t=document.createElement("div"),n=e.get(Fr),r=e.get(Hr),i=cu.fromSchema(n).serializeFragment(r.state.doc.content);return t.appendChild(i),t.innerHTML}}function as(e,t=!1){return n=>{const r=n.get(Hr),a=n.get(uu)(e);if(!a)return;if(!t){const{state:f}=r;return r.dispatch(f.tr.replace(0,f.doc.content.size,new Jn(a.content,0,0)))}const o=n.get(Fr),s=n.get(fu),l=n.get(kr),c=du.create({schema:o,doc:a,plugins:l,...s});r.updateState(c)}}function Bg(e,t){return function(n,r){let{$from:i,$to:a,node:o}=n.selection;if(o&&o.isBlock||i.depth<2||!i.sameParent(a))return!1;let s=i.node(-1);if(s.type!=e)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=e||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let u=ke.empty,p=i.index(-1)?1:i.index(-2)?2:3;for(let v=i.depth-p;v>=i.depth-3;v--)u=ke.from(i.node(v).copy(u));let d=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;u=u.append(ke.from(e.createAndFill()));let h=i.before(i.depth-(p-1)),g=n.tr.replace(h,i.after(-d),new Jn(u,4-p,0)),m=-1;g.doc.nodesBetween(h,g.doc.content.size,(v,w)=>{if(m>-1)return!1;v.isTextblock&&v.content.size==0&&(m=w+1)}),m>-1&&g.setSelection(zi.near(g.doc.resolve(m))),r(g.scrollIntoView())}return!0}let l=a.pos==i.end()?s.contentMatchAt(0).defaultType:null,c=n.tr.delete(i.pos,a.pos),f=l?[null,{type:l}]:void 0;return wu(c.doc,i.pos,2,f)?(r&&r(c.split(i.pos,2,f).scrollIntoView()),!0):!1}}function jg(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?qg(t,n,e,a):Vg(t,n,a):!0:!1}}function qg(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Ki(a-1,o,a,o,new Jn(ke.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new _u(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const s=bu(r);if(s==null)return!1;i.lift(r,s);let l=i.doc.resolve(i.mapping.map(a,-1)-1);return ku(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0}function Vg(e,t,n){let r=e.tr,i=n.parent;for(let d=n.end,h=n.endIndex-1,g=n.startIndex;h>g;h--)d-=i.child(h).nodeSize,r.delete(d-1,d+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,l=n.endIndex==i.childCount,c=a.node(-1),f=a.index(-1);if(!c.canReplace(f+(s?0:1),f+1,o.content.append(l?ke.empty:ke.from(i))))return!1;let u=a.pos,p=u+o.nodeSize;return r.step(new Ki(u-(s?1:0),p+(l?1:0),u+1,p-1,new Jn((s?ke.empty:ke.from(i.copy(ke.empty))).append(l?ke.empty:ke.from(i.copy(ke.empty))),s?0:1,l?0:1),s?0:1)),t(r.scrollIntoView()),!0}function Ug(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,l=s.child(o-1);if(l.type!=e)return!1;if(n){let c=l.lastChild&&l.lastChild.type==s.type,f=ke.from(c?e.create():null),u=new Jn(ke.from(e.create(null,ke.from(s.type.create(null,f)))),c?3:1,0),p=a.start,d=a.end;n(t.tr.step(new Ki(p-(c?3:1),d,p,d,u,1,!0)).scrollIntoView())}return!0}}function Yg(e){const t=new Map;if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Qn(e,"definition",function(r){const i=os(r.identifier);i&&!t.get(i)&&t.set(i,r)}),n;function n(r){const i=os(r);return t.get(i)}}function os(e){return String(e||"").toUpperCase()}function Wg(){return function(e){const t=Yg(e);Qn(e,function(n,r,i){if(n.type==="definition"&&i!==void 0&&typeof r=="number")return i.children.splice(r,1),[_o,r];if(n.type==="imageReference"||n.type==="linkReference"){const a=t(n.identifier);if(a&&i&&typeof r=="number")return i.children[r]=n.type==="imageReference"?{type:"image",url:a.url,title:a.title,alt:n.alt}:{type:"link",url:a.url,title:a.title,children:n.children},[_o,r]}})}}function Sc(e,t){if(!(t.childCount>=1&&t.lastChild?.type.name==="hardbreak")){e.next(t.content);return}const r=[];t.content.forEach((i,a,o)=>{o!==t.childCount-1&&r.push(i)}),e.next(ke.fromArray(r))}function _(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e}const xa=Jr("emphasis");_(xa,{displayName:"Attr<emphasis>",group:"Emphasis"});const Tn=ir("emphasis",e=>({attrs:{marker:{default:e.get(Cs).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:t=>t==="italic"}],toDOM:t=>["em",e.get(xa.key)(t)],parseMarkdown:{match:t=>t.type==="emphasis",runner:(t,n,r)=>{t.openMark(r,{marker:n.marker}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="emphasis",runner:(t,n)=>{t.withMark(n,"emphasis",void 0,{marker:n.attrs.marker})}}}));_(Tn.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"});_(Tn.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});const Qr=ie("ToggleEmphasis",e=>()=>Gi(Tn.type(e)));_(Qr,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});const Mc=ot(e=>Br(/(?:^|[^*])\*([^*]+)\*$/,Tn.type(e),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:t,start:n})=>t.startsWith("*")?{}:{fullMatch:t.slice(1),start:n+1}}));_(Mc,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});const Ic=ot(e=>Br(/\b_(?![_\s])(.*?[^_\s])_\b/,Tn.type(e),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:t,start:n})=>t.startsWith("_")?{}:{fullMatch:t.slice(1),start:n+1}}));_(Ic,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});const Aa=st("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{const t=e.get(ae);return()=>t.call(Qr.key)}}});_(Aa.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"});_(Aa.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});const Ea=Jr("strong");_(Ea,{displayName:"Attr<strong>",group:"Strong"});const ar=ir("strong",e=>({attrs:{marker:{default:e.get(Cs).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{tag:"strong"},{style:"font-style",getAttrs:t=>t==="bold"},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:t=>["strong",e.get(Ea.key)(t)],parseMarkdown:{match:t=>t.type==="strong",runner:(t,n,r)=>{t.openMark(r,{marker:n.marker}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="strong",runner:(t,n)=>{t.withMark(n,"strong",void 0,{marker:n.attrs.marker})}}}));_(ar.mark,{displayName:"MarkSchema<strong>",group:"Strong"});_(ar.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});const Xr=ie("ToggleStrong",e=>()=>Gi(ar.type(e)));_(Xr,{displayName:"Command<toggleStrongCommand>",group:"Strong"});const Lc=ot(e=>Br(new RegExp("(?<![\\w:/])(?:\\*\\*|__)([^*_]+?)(?:\\*\\*|__)(?![\\w/])$"),ar.type(e),{getAttr:t=>({marker:t[0].startsWith("*")?"*":"_"})}));_(Lc,{displayName:"InputRule<strong>",group:"Strong"});const Ca=st("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{const t=e.get(ae);return()=>t.call(Xr.key)}}});_(Ca.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"});_(Ca.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});const Sa=Jr("inlineCode");_(Sa,{displayName:"Attr<inlineCode>",group:"InlineCode"});const Ot=ir("inlineCode",e=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(Sa.key)(t)],parseMarkdown:{match:t=>t.type==="inlineCode",runner:(t,n,r)=>{t.openMark(r),t.addText(n.value),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="inlineCode",runner:(t,n,r)=>{t.withMark(n,"inlineCode",r.text||"")}}}));_(Ot.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"});_(Ot.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});const Ma=ie("ToggleInlineCode",e=>()=>(t,n)=>{const{selection:r,tr:i}=t;if(r.empty)return!1;const{from:a,to:o}=r;return t.doc.rangeHasMark(a,o,Ot.type(e))?(n?.(i.removeMark(a,o,Ot.type(e))),!0):(Object.keys(t.schema.marks).filter(c=>c!==Ot.type.name).map(c=>t.schema.marks[c]).forEach(c=>{i.removeMark(a,o,c)}),n?.(i.addMark(a,o,Ot.type(e).create())),!0)});_(Ma,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});const Nc=ot(e=>Br(/(?:`)([^`]+)(?:`)$/,Ot.type(e)));_(Nc,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});const Ia=st("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{const t=e.get(ae);return()=>t.call(Ma.key)}}});_(Ia.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"});_(Ia.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});const La=Jr("link");_(La,{displayName:"Attr<link>",group:"Link"});const bn=ir("link",e=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:t=>{if(!(t instanceof HTMLElement))throw rn(t);return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(La.key)(t),...t.attrs}],parseMarkdown:{match:t=>t.type==="link",runner:(t,n,r)=>{const i=n.url,a=n.title;t.openMark(r,{href:i,title:a}),t.next(n.children),t.closeMark(r)}},toMarkdown:{match:t=>t.type.name==="link",runner:(t,n)=>{t.withMark(n,"link",void 0,{title:n.attrs.title,url:n.attrs.href})}}}));_(bn.mark,{displayName:"MarkSchema<link>",group:"Link"});const Na=ie("ToggleLink",e=>(t={})=>Gi(bn.type(e),t));_(Na,{displayName:"Command<toggleLinkCommand>",group:"Link"});const Tc=ie("UpdateLink",e=>(t={})=>(n,r)=>{if(!r)return!1;let i,a=-1;const{selection:o}=n,{from:s,to:l}=o;if(n.doc.nodesBetween(s,s===l?l+1:l,(h,g)=>{if(bn.type(e).isInSet(h.marks))return i=h,a=g,!1}),!i)return!1;const c=i.marks.find(({type:h})=>h===bn.type(e));if(!c)return!1;const f=a,u=a+i.nodeSize,{tr:p}=n,d=bn.type(e).create({...c.attrs,...t});return d?(r(p.removeMark(f,u,c).addMark(f,u,d).setSelection(new Pr(p.selection.$anchor)).scrollIntoView()),!0):!1});_(Tc,{displayName:"Command<updateLinkCommand>",group:"Link"});const Oc=ka("doc",()=>({content:"block+",parseMarkdown:{match:({type:e})=>e==="root",runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>e.type.name==="doc",runner:(e,t)=>{e.openNode("root"),e.next(t.content)}}}));_(Oc,{displayName:"NodeSchema<doc>",group:"Doc"});function Kg(e){return Lu(e,t=>t.type==="html"&&["<br />","<br>","<br >","<br/>"].includes(t.value?.trim()),(t,n)=>{if(!n.length)return;const r=n[n.length-1];if(!r)return;const i=r.children.indexOf(t);i!==-1&&r.children.splice(i,1)},!0)}const ei=Nn("remark-preserve-empty-line",()=>()=>Kg);_(ei.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"});_(ei.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});const Ta=lt("paragraph");_(Ta,{displayName:"Attr<paragraph>",group:"Paragraph"});const sn=Ze("paragraph",e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(Ta.key)(t),0],parseMarkdown:{match:t=>t.type==="paragraph",runner:(t,n,r)=>{t.openNode(r),n.children?t.next(n.children):t.addText(n.value||""),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="paragraph",runner:(t,n)=>{const i=e.get(Hr).state?.doc.lastChild;t.openNode("paragraph"),(!n.content||n.content.size===0)&&n!==i&&zg(e)?t.addNode("html",void 0,"<br />"):Sc(t,n),t.closeNode()}}}));function zg(e){let t=!1;try{e.get(ei.id),t=!0}catch{t=!1}return t}_(sn.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"});_(sn.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});const ti=ie("TurnIntoText",e=>()=>Yn(sn.type(e)));_(ti,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});const Oa=st("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{const t=e.get(ae);return()=>t.call(ti.key)}}});_(Oa.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"});_(Oa.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});const Gg=Array(6).fill(0).map((e,t)=>t+1);function Zg(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,"-")}const ni=Yt(Zg,"headingIdGenerator");_(ni,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});const $a=lt("heading");_($a,{displayName:"Attr<heading>",group:"Heading"});const ln=Ze("heading",e=>{const t=e.get(ni.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:Gg.map(n=>({tag:`h${n}`,getAttrs:r=>{if(!(r instanceof HTMLElement))throw rn(r);return{level:n,id:r.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get($a.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:n})=>n==="heading",runner:(n,r,i)=>{const a=r.depth;n.openNode(i,{level:a}),n.next(r.children),n.closeNode()}},toMarkdown:{match:n=>n.type.name==="heading",runner:(n,r)=>{n.openNode("heading",void 0,{depth:r.attrs.level}),Sc(n,r),n.closeNode()}}}});_(ln.node,{displayName:"NodeSchema<heading>",group:"Heading"});_(ln.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});const $c=ot(e=>Ss(/^(?<hashes>#+)\s$/,ln.type(e),t=>{const n=t.groups?.hashes?.length||0,r=e.get(Hr),{$from:i}=r.state.selection,a=i.node();if(a.type.name==="heading"){let o=Number(a.attrs.level)+Number(n);return o>6&&(o=6),{level:o}}return{level:n}}));_($c,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});const yt=ie("WrapInHeading",e=>t=>(t??=1,t<1?Yn(sn.type(e)):Yn(ln.type(e),{level:t})));_(yt,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});const Da=ie("DowngradeHeading",e=>()=>(t,n,r)=>{const{$from:i}=t.selection,a=i.node();if(a.type!==ln.type(e)||!t.selection.empty||i.parentOffset!==0)return!1;const o=a.attrs.level-1;return o?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...a.attrs,level:o})),!0):Yn(sn.type(e))(t,n,r)});_(Da,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});const Ra=st("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{const t=e.get(ae);return()=>t.call(yt.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{const t=e.get(ae);return()=>t.call(yt.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{const t=e.get(ae);return()=>t.call(yt.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{const t=e.get(ae);return()=>t.call(yt.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{const t=e.get(ae);return()=>t.call(yt.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{const t=e.get(ae);return()=>t.call(yt.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{const t=e.get(ae);return()=>t.call(Da.key)}}});_(Ra.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"});_(Ra.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});const Fa=lt("blockquote");_(Fa,{displayName:"Attr<blockquote>",group:"Blockquote"});const or=Ze("blockquote",e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(Fa.key)(t),0],parseMarkdown:{match:({type:t})=>t==="blockquote",runner:(t,n,r)=>{t.openNode(r).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="blockquote",runner:(t,n)=>{t.openNode("blockquote").next(n.content).closeNode()}}}));_(or.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"});_(or.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});const Dc=ot(e=>Ji(/^\s*>\s$/,or.type(e)));_(Dc,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});const ri=ie("WrapInBlockquote",e=>()=>Zi(or.type(e)));_(ri,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});const Ha=st("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{const t=e.get(ae);return()=>t.call(ri.key)}}});_(Ha.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"});_(Ha.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});const Pa=lt("codeBlock",()=>({pre:{},code:{}}));_(Pa,{displayName:"Attr<codeBlock>",group:"CodeBlock"});const sr=Ze("code_block",e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>{if(!(t instanceof HTMLElement))throw rn(t);return{language:t.dataset.language}}}],toDOM:t=>{const n=e.get(Pa.key)(t),r=t.attrs.language,i=r&&r.length>0?{"data-language":r}:void 0;return["pre",{...n.pre,...i},["code",n.code,0]]},parseMarkdown:{match:({type:t})=>t==="code",runner:(t,n,r)=>{const i=n.lang??"",a=n.value;t.openNode(r,{language:i}),a&&t.addText(a),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="code_block",runner:(t,n)=>{t.addNode("code",void 0,n.content.firstChild?.text||"",{lang:n.attrs.language})}}}));_(sr.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"});_(sr.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});const Rc=ot(e=>Ss(/^```(?<language>[a-z]*)?[\s\n]$/,sr.type(e),t=>({language:t.groups?.language??""})));_(Rc,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});const Ba=ie("CreateCodeBlock",e=>(t="")=>Yn(sr.type(e),{language:t}));_(Ba,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});const Jg=ie("UpdateCodeBlockLanguage",()=>({pos:e,language:t}={pos:-1,language:""})=>(n,r)=>e>=0?(r?.(n.tr.setNodeAttribute(e,"language",t)),!0):!1);_(Jg,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});const ja=st("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{const t=e.get(ae);return()=>t.call(Ba.key)}}});_(ja.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"});_(ja.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});const qa=lt("image");_(qa,{displayName:"Attr<image>",group:"Image"});const On=Ze("image",e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:t=>{if(!(t instanceof HTMLElement))throw rn(t);return{src:t.getAttribute("src")||"",alt:t.getAttribute("alt")||"",title:t.getAttribute("title")||t.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(qa.key)(t),...t.attrs}],parseMarkdown:{match:({type:t})=>t==="image",runner:(t,n,r)=>{const i=n.url,a=n.alt,o=n.title;t.addNode(r,{src:i,alt:a,title:o})}},toMarkdown:{match:t=>t.type.name==="image",runner:(t,n)=>{t.addNode("image",void 0,void 0,{title:n.attrs.title,url:n.attrs.src,alt:n.attrs.alt})}}}));_(On.node,{displayName:"NodeSchema<image>",group:"Image"});_(On.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});const Va=ie("InsertImage",e=>(t={})=>(n,r)=>{if(!r)return!0;const{src:i="",alt:a="",title:o=""}=t,s=On.type(e).create({src:i,alt:a,title:o});return s&&r(n.tr.replaceSelectionWith(s).scrollIntoView()),!0});_(Va,{displayName:"Command<insertImageCommand>",group:"Image"});const Fc=ie("UpdateImage",e=>(t={})=>(n,r)=>{const i=Au(n.selection,On.type(e));if(!i)return!1;const{node:a,pos:o}=i,s={...a.attrs},{src:l,alt:c,title:f}=t;return l!==void 0&&(s.src=l),c!==void 0&&(s.alt=c),f!==void 0&&(s.title=f),r?.(n.tr.setNodeMarkup(o,void 0,s).scrollIntoView()),!0});_(Fc,{displayName:"Command<updateImageCommand>",group:"Image"});const Qg=ot(e=>new Ms(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,r,i)=>{const[a,o,s="",l]=n;return a?t.tr.replaceWith(r,i,On.type(e).create({src:s,alt:o,title:l})):null}));_(Qg,{displayName:"InputRule<insertImageInputRule>",group:"Image"});const Rr=lt("hardbreak",e=>({"data-type":"hardbreak","data-is-inline":e.attrs.isInline}));_(Rr,{displayName:"Attr<hardbreak>",group:"Hardbreak"});const Qt=Ze("hardbreak",e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?["span",e.get(Rr.key)(t)," "]:["br",e.get(Rr.key)(t)],parseMarkdown:{match:({type:t})=>t==="break",runner:(t,n,r)=>{t.addNode(r,{isInline:!!n.data?.isInline})}},leafText:()=>`
43
- `,toMarkdown:{match:t=>t.type.name==="hardbreak",runner:(t,n)=>{n.attrs.isInline?t.addNode("text",void 0,`
44
- `):t.addNode("break")}}}));_(Qt.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"});_(Qt.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});const Ua=ie("InsertHardbreak",e=>()=>(t,n)=>{const{selection:r,tr:i}=t;if(!(r instanceof Pr))return!1;if(r.empty){const a=r.$from.node();if(a.childCount>0&&a.lastChild?.type.name==="hardbreak")return n?.(i.replaceRangeWith(r.to-1,r.to,t.schema.node("paragraph")).setSelection(zi.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(i.setMeta("hardbreak",!0).replaceSelectionWith(Qt.type(e).create()).scrollIntoView()),!0});_(Ua,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});const Ya=st("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{const t=e.get(ae);return()=>t.call(Ua.key)}}});_(Ya.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"});_(Ya.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});const Wa=lt("hr");_(Wa,{displayName:"Attr<hr>",group:"Hr"});const lr=Ze("hr",e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(Wa.key)(t)],parseMarkdown:{match:({type:t})=>t==="thematicBreak",runner:(t,n,r)=>{t.addNode(r)}},toMarkdown:{match:t=>t.type.name==="hr",runner:t=>{t.addNode("thematicBreak")}}}));_(lr.node,{displayName:"NodeSchema<hr>",group:"Hr"});_(lr.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});const Hc=ot(e=>new Ms(/^(?:---|___\s|\*\*\*\s)$/,(t,n,r,i)=>{const{tr:a}=t;return n[0]&&a.replaceWith(r-1,i,lr.type(e).create()),a}));_(Hc,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});const Ka=ie("InsertHr",e=>()=>(t,n)=>{if(!n)return!0;const r=sn.node.type(e).create(),{tr:i,selection:a}=t,{from:o}=a,s=lr.type(e).create();if(!s)return!0;const l=i.replaceSelectionWith(s).insert(o,r),c=zi.findFrom(l.doc.resolve(o),1,!0);return c&&n(l.setSelection(c).scrollIntoView()),!0});_(Ka,{displayName:"Command<insertHrCommand>",group:"Hr"});const za=lt("bulletList");_(za,{displayName:"Attr<bulletList>",group:"BulletList"});const $n=Ze("bullet_list",e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:t=>{if(!(t instanceof HTMLElement))throw rn(t);return{spread:t.dataset.spread==="true"}}}],toDOM:t=>["ul",{...e.get(za.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t,ordered:n})=>t==="list"&&!n,runner:(t,n,r)=>{const i=n.spread!=null?`${n.spread}`:"false";t.openNode(r,{spread:i}).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="bullet_list",runner:(t,n)=>{t.openNode("list",void 0,{ordered:!1,spread:n.attrs.spread}).next(n.content).closeNode()}}}));_($n.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"});_($n.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});const Pc=ot(e=>Ji(/^\s*([-+*])\s$/,$n.type(e)));_(Pc,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});const ii=ie("WrapInBulletList",e=>()=>Zi($n.type(e)));_(ii,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});const Ga=st("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{const t=e.get(ae);return()=>t.call(ii.key)}}});_(Ga.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"});_(Ga.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});const Za=lt("orderedList");_(Za,{displayName:"Attr<orderedList>",group:"OrderedList"});const Dn=Ze("ordered_list",e=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:t=>{if(!(t instanceof HTMLElement))throw rn(t);return{spread:t.dataset.spread,order:t.hasAttribute("start")?Number(t.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(Za.key)(t),...t.attrs.order===1?{}:t.attrs.order,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t,ordered:n})=>t==="list"&&!!n,runner:(t,n,r)=>{const i=n.spread!=null?`${n.spread}`:"true";t.openNode(r,{spread:i}).next(n.children).closeNode()}},toMarkdown:{match:t=>t.type.name==="ordered_list",runner:(t,n)=>{t.openNode("list",void 0,{ordered:!0,start:1,spread:n.attrs.spread==="true"}),t.next(n.content),t.closeNode()}}}));_(Dn.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"});_(Dn.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});const Bc=ot(e=>Ji(/^\s*(\d+)\.\s$/,Dn.type(e),t=>({order:Number(t[1])}),(t,n)=>n.childCount+n.attrs.order===Number(t[1])));_(Bc,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});const ai=ie("WrapInOrderedList",e=>()=>Zi(Dn.type(e)));_(ai,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});const Ja=st("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{const t=e.get(ae);return()=>t.call(ai.key)}}});_(Ja.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"});_(Ja.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});const Qa=lt("listItem");_(Qa,{displayName:"Attr<listItem>",group:"ListItem"});const Wt=Ze("list_item",e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:t=>{if(!(t instanceof HTMLElement))throw rn(t);return{label:t.dataset.label,listType:t.dataset.listType,spread:t.dataset.spread==="true"}}}],toDOM:t=>["li",{...e.get(Qa.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:t})=>t==="listItem",runner:(t,n,r)=>{const i=n.label!=null?`${n.label}.`:"•",a=n.label!=null?"ordered":"bullet",o=n.spread!=null?`${n.spread}`:"true";t.openNode(r,{label:i,listType:a,spread:o}),t.next(n.children),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="list_item",runner:(t,n)=>{t.openNode("listItem",void 0,{spread:n.attrs.spread}),t.next(n.content),t.closeNode()}}}));_(Wt.node,{displayName:"NodeSchema<listItem>",group:"ListItem"});_(Wt.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});const Xa=ie("SinkListItem",e=>()=>Ug(Wt.type(e)));_(Xa,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});const eo=ie("LiftListItem",e=>()=>jg(Wt.type(e)));_(eo,{displayName:"Command<liftListItemCommand>",group:"ListItem"});const to=ie("SplitListItem",e=>()=>Bg(Wt.type(e)));_(to,{displayName:"Command<splitListItemCommand>",group:"ListItem"});function Xg(e){return(t,n,r)=>{const{selection:i}=t;if(!(i instanceof Pr))return!1;const{empty:a,$from:o}=i;return!a||o.parentOffset!==0||o.node(-1).type!==Wt.type(e)?!1:xu(t,n,r)}}const no=ie("LiftFirstListItem",e=>()=>Xg(e));_(no,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});const ro=st("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{const t=e.get(ae);return()=>t.call(to.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{const t=e.get(ae);return()=>t.call(Xa.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{const t=e.get(ae);return()=>t.call(eo.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:e=>{const t=e.get(ae);return()=>t.call(no.key)}}});_(ro.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"});_(ro.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});const jc=ka("text",()=>({group:"inline",parseMarkdown:{match:({type:e})=>e==="text",runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>e.type.name==="text",runner:(e,t)=>{e.addNode("text",void 0,t.text)}}}));_(jc,{displayName:"NodeSchema<text>",group:"Text"});const io=lt("html");_(io,{displayName:"Attr<html>",group:"Html"});const ao=Ze("html",e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:t=>{const n=document.createElement("span"),r={...e.get(io.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",r,t.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:t=>({value:t.dataset.value??""})}],parseMarkdown:{match:({type:t})=>t==="html",runner:(t,n,r)=>{t.addNode(r,{value:n.value})}},toMarkdown:{match:t=>t.type.name==="html",runner:(t,n)=>{t.addNode("html",void 0,n.attrs.value)}}}));_(ao.node,{displayName:"NodeSchema<html>",group:"Html"});_(ao.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});const ev=[Oc,Ta,sn,ni,$a,ln,Rr,Qt,Fa,or,Pa,sr,Wa,lr,qa,On,za,$n,Za,Dn,Qa,Wt,xa,Tn,Ea,ar,Sa,Ot,La,bn,io,ao,jc].flat(),tv=[Dc,Pc,Bc,Rc,Hc,$c].flat(),nv=[Mc,Ic,Nc,Lc],rv=ie("IsMarkSelected",()=>e=>t=>{if(!e)return!1;const{doc:n,selection:r}=t;return n.rangeHasMark(r.from,r.to,e)}),iv=ie("IsNoteSelected",()=>e=>t=>e?Eu(t,e).hasNode:!1),av=ie("ClearTextInCurrentBlock",()=>()=>(e,t)=>{let n=e.tr;const{$from:r,$to:i}=n.selection,{pos:a}=r,{pos:o}=i,s=a-r.node().content.size;return s<0?!1:(n=n.deleteRange(s,o),t?.(n),!0)}),ov=ie("SetBlockType",()=>e=>(t,n)=>{const{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;const a=t.tr,{from:o,to:s}=a.selection;try{a.setBlockType(o,s,r,i)}catch{return!1}return n?.(a),!0}),sv=ie("WrapInBlockType",()=>e=>(t,n)=>{const{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let a=t.tr;try{const{$from:o,$to:s}=a.selection,l=o.blockRange(s),c=l&&Cu(l,r,i);if(!c)return!1;a=a.wrap(l,c)}catch{return!1}return n?.(a),!0}),lv=ie("AddBlockType",()=>e=>(t,n)=>{const{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;const a=t.tr;try{const o=r instanceof Su?r:r.createAndFill(i);if(!o)return!1;a.replaceSelectionWith(o)}catch{return!1}return n?.(a),!0}),cv=ie("SelectTextNearPos",()=>e=>(t,n)=>{const{pos:r}=e??{};if(r==null)return!1;const i=(o,s,l)=>Math.min(Math.max(o,s),l),a=t.tr;try{const o=t.doc.resolve(i(r,0,t.doc.content.size));a.setSelection(Pr.near(o))}catch{return!1}return n?.(a.scrollIntoView()),!0}),uv=[ti,ri,yt,Da,Ba,Ua,Ka,Va,Fc,ai,ii,Xa,to,eo,no,Qr,Ma,Xr,Na,Tc,rv,iv,av,ov,sv,lv,cv],fv=[Ha,ja,Ya,Ra,ro,Ja,Ga,Oa,Aa,Ia,Ca].flat(),oo=Nn("remarkAddOrderInList",()=>()=>e=>{Qn(e,"list",t=>{if(t.ordered){const n=t.start??1;t.children.forEach((r,i)=>{r.label=i+n})}})});_(oo.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"});_(oo.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});const so=Nn("remarkLineBreak",()=>()=>e=>{const t=/[\t ]*(?:\r?\n|\r)/g;Qn(e,"text",(n,r,i)=>{if(!n.value||typeof n.value!="string")return;const a=[];let o=0;t.lastIndex=0;let s=t.exec(n.value);for(;s;){const c=s.index;o!==c&&a.push({type:"text",value:n.value.slice(o,c)}),a.push({type:"break",data:{isInline:!0}}),o=c+s[0].length,s=t.exec(n.value)}if(a.length>0&&i&&typeof r=="number")return o<n.value.length&&a.push({type:"text",value:n.value.slice(o)}),i.children.splice(r,1,...a),r+a.length})});_(so.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"});_(so.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});const lo=Nn("remarkInlineLink",()=>Wg);_(lo.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"});_(lo.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});const dv=e=>!!e.children,pv=e=>e.type==="html";function hv(e,t){return n(e,0,null)[0];function n(r,i,a){if(dv(r)){const o=[];for(let s=0,l=r.children.length;s<l;s++){const c=r.children[s];if(c){const f=n(c,s,r);if(f)for(let u=0,p=f.length;u<p;u++){const d=f[u];d&&o.push(d)}}}r.children=o}return t(r,i,a)}}const mv=["root","blockquote","listItem"],co=Nn("remarkHTMLTransformer",()=>()=>e=>{hv(e,(t,n,r)=>pv(t)?(r&&mv.includes(r.type)&&(t.children=[{...t}],delete t.value,t.type="paragraph"),[t]):[t])});_(co.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"});_(co.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});const uo=Nn("remarkMarker",()=>()=>(e,t)=>{const n=r=>t.value.charAt(r.position.start.offset);Qn(e,r=>["strong","emphasis"].includes(r.type),r=>{r.marker=n(r)})});_(uo.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"});_(uo.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});const qc=rr(()=>{let e=!1;const t=new In("MILKDOWN_INLINE_NODES_CURSOR"),n=new Mn({key:t,state:{init(){return!1},apply(r){if(!r.selection.empty)return!1;const i=r.selection.$from,a=i.nodeBefore,o=i.nodeAfter;return!!(a&&o&&a.isInline&&!a.isText&&o.isInline&&!o.isText)}},props:{handleDOMEvents:{compositionend:(r,i)=>e?(e=!1,requestAnimationFrame(()=>{if(n.getState(r.state)){const o=r.state.selection.from;i.preventDefault(),r.dispatch(r.state.tr.insertText(i.data||"",o))}}),!0):!1,compositionstart:r=>(n.getState(r.state)&&(e=!0),!1),beforeinput:(r,i)=>{if(n.getState(r.state)&&i instanceof InputEvent&&i.data&&!e){const o=r.state.selection.from;return i.preventDefault(),r.dispatch(r.state.tr.insertText(i.data||"",o)),!0}return!1}},decorations(r){if(n.getState(r)){const o=r.selection.$from.pos,s=document.createElement("span"),l=bo.widget(o,s,{side:-1}),c=document.createElement("span"),f=bo.widget(o,c);return setTimeout(()=>{s.contentEditable="true",c.contentEditable="true"}),ko.create(r.doc,[l,f])}return ko.empty}}});return n});_(qc,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});const Vc=rr(e=>new Mn({key:new In("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(t,n,r)=>{if(!t.length)return;const[i]=t;if(!i)return;const[a]=i.steps;if(i.getMeta("hardbreak")){if(!(a instanceof Mu))return;const{from:l}=a;return r.tr.setNodeMarkup(l,Qt.type(e),void 0,[])}if(a instanceof Iu){let l=r.tr;const{from:c,to:f}=a;return r.doc.nodesBetween(c,f,(u,p)=>{u.type===Qt.type(e)&&(l=l.setNodeMarkup(p,Qt.type(e),void 0,[]))}),l}}}));_(Vc,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});const fo=Yt(["table","code_block"],"hardbreakFilterNodes");_(fo,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});const Uc=rr(e=>{const t=e.get(fo.key);return new Mn({key:new In("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(n,r)=>{const i=n.getMeta("hardbreak"),[a]=n.steps;if(i&&a){const{from:o}=a,s=r.doc.resolve(o);let l=s.depth,c=!0;for(;l>0;)t.includes(s.node(l).type.name)&&(c=!1),l--;return c}return!0}})});_(Uc,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});const Yc=rr(e=>{const t=new In("MILKDOWN_HEADING_ID"),n=r=>{if(r.composing)return;const i=e.get(ni.key),a=r.state.tr.setMeta("addToHistory",!1);let o=!1;const s={};r.state.doc.descendants((l,c)=>{if(l.type===ln.type(e)){if(l.textContent.trim().length===0)return;const f=l.attrs;let u=i(l);s[u]?(s[u]+=1,u+=`-#${s[u]}`):s[u]=1,f.id!==u&&(o=!0,a.setMeta(t,!0).setNodeMarkup(c,void 0,{...f,id:u}))}}),o&&r.dispatch(a)};return new Mn({key:t,view:r=>(n(r),{update:(i,a)=>{i.state.doc.eq(a.doc)||n(i)}})})});_(Yc,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});const Wc=rr(e=>{const t=(n,r,i)=>{if(!i.selection||n.some(u=>u.getMeta("addToHistory")===!1||!u.isGeneric))return null;const a=Dn.type(e),o=$n.type(e),s=Wt.type(e),l=(u,p)=>{let d=!1;const h=`${p+1}.`;return u.label!==h&&(u.label=h,d=!0),d};let c=i.tr,f=!1;return i.doc.descendants((u,p,d,h)=>{if(u.type===o){const g=u.maybeChild(0);g?.type===s&&g.attrs.listType==="ordered"&&(f=!0,c.setNodeMarkup(p,a,{spread:"true"}),u.descendants((m,v,w,k)=>{if(m.type===s){const L={...m.attrs};l(L,k)&&(c=c.setNodeMarkup(v,void 0,L))}return!1}))}else if(u.type===s&&d?.type===a){const g={...u.attrs};let m=!1;g.listType!=="ordered"&&(g.listType="ordered",m=!0),d?.maybeChild(0)&&(m=l(g,h)),m&&(c=c.setNodeMarkup(p,void 0,g),f=!0)}}),f?c.setMeta("addToHistory",!1):null};return new Mn({key:new In("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:t})});_(Wc,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});const gv=[Vc,fo,Uc,qc,oo,lo,so,co,uo,ei,Yc,Wc].flat(),vv=[ev,tv,nv,uv,fv,gv].flat();var yv=z('<label class="editorInput"> <div id="md-editor" class="svelte-g1hz34"><!> <div></div> <!></div> <input type="hidden" class="svelte-g1hz34"/></label> <!> <!>',1);function wv(e,t){se(t,!0);const n=()=>H(Ee,"$draftEntry",s),r=()=>H(nt,"$selectedCollection",s),i=()=>H(rt,"$editingEntry",s),a=()=>H(at,"$backend",s),o=()=>H(Te,"$loadedWidgets",s),[s,l]=me();let c=je(t,"value",7,""),f=je(t,"required",3,!0),u=K(void 0),p=K(void 0),d=K(!1),h=K(void 0),g=K(void 0),m=K(void 0),v=K(void 0);pt(()=>{c()!==y(p)&&w(c())});function w(M){const j={...n()};M?y(m)&&(j[t.name]=Pg()(y(m).ctx).replaceAll("<img ",'<img crossorigin="use-credentials" ')):j[t.name]=r()?.fields.find(J=>J.name===t.name).label,re(Ee,j),U(p,c(),!0)}function k(){if(!y(h))return;const M=document.getSelection();M.removeAllRanges();const j=document.createRange(),{startOffset:J,endOffset:ue}=y(h).range;j.setStart(y(h).node,J),j.setEnd(y(h).node,ue),M.addRange(j)}function L(M){U(d,!1),k(),M&&y(m).action(j=>{const J=j.get(ae),ue={alt:M.name,src:M.url_preview};J.call(Va.key,ue)})}function $(M){if(k(),!M)return;const{href:j}=M,J=document.getSelection(),{textContent:ue}=J.focusNode,{startOffset:de,endOffset:Me}=J.getRangeAt(0),be=ue.substring(de,Me);y(m).action(oe=>{const ge=oe.get(ae),Je={title:be,href:j};ge.call(Na.key,Je)})}function N(M){y(m).action(j=>{const J=j.get(ae);M==="p"?J.call(ti.key):J.call(yt.key,M)})}function E(M){y(m).action(j=>{const J=j.get(ae);switch(M){case"bold":J.call(Xr.key);break;case"italic":J.call(Qr.key);break;case"listBulleted":J.call(ii.key);break;case"listNumbered":J.call(ai.key);break;case"quote":J.call(ri.key);break;case"horizontalRule":J.call(Ka.key);break;case"link":y(g).toggleEditor();break;case"image":y(h)&&U(d,!0);break}})}function P(){const M=document.getSelection(),j=M.focusNode;y(v)?.contains(j)&&U(h,{node:M.focusNode,range:M.getRangeAt(0)},!0)}function G(M){U(m,M,!0),U(v,document.querySelector(".milkdown .ProseMirror"),!0),as(c())(y(m).ctx),w(c())}async function V(M){Nu.make().config(j=>{j.set(Tu,M),j.set(Ou,c()),j.get(ji).markdownUpdated((J,ue,de)=>{c(ue)})}).config($u).use(vv).use(Cc).create().then(G)}async function T(){if(i()){try{const M=t.name==="body"?i().body:i().fields[t.name];U(u,a().replacePublicLinks(M),!0),c(await y(u)),y(m)&&as(c())(y(m).ctx)}catch{}re(Te,o()+1)}}Ue(()=>{T()});var Y=yv();on("selectionchange",Yr,P);var B=xe(Y),C=I(B),x=R(C),b=I(x);ig(b,{ontexttypeselect:N,onactionselect:E});var S=R(b,2);Wf(S,M=>V?.(M));var A=R(S,2);En(og(A,{onsaveurl:$}),M=>U(g,M,!0),()=>y(g));var O=R(x,2),D=R(B,2);tt(D,()=>y(u),M=>{Zr(M,{msg:"Loading"})},void 0,(M,j)=>{xt(M,{msg:"Unable to load",get details(){return y(j).message}})});var W=R(D,2);{var Z=M=>{cg(M,{onselectimg:L})};Le(W,M=>{y(d)&&M(Z)})}ee(()=>{Q(B,"for",t.name),ce(C,`${t.label??""} `),Q(O,"id",t.name),Q(O,"name",t.name),O.required=f()}),Pt(O,c),q(e,Y),le(),l()}var _v=z('<input type="hidden"/>');function bv(e,t){se(t,!0);const n=()=>H(Ee,"$draftEntry",a),r=()=>H(rt,"$editingEntry",a),i=()=>H(Te,"$loadedWidgets",a),[a,o]=me();let s=je(t,"value",7);function l(){const u={...n()};u[t.name]=s(),re(Ee,u)}async function c(){if(r()?.fields[t.name])switch(t.type){case"datetime-local":case"date":case"time":s($r(t.type,new Date(r().fields[t.name])));break;default:s(r().fields[t.name]);break}else if(!s())switch(t.type){case"datetime-local":case"date":case"time":s($r(t.type,new Date));break;case"boolean":s("false");break}l(),re(Te,i()+1)}Ue(()=>{c()});var f=_v();ee(()=>{Q(f,"id",t.name),Q(f,"name",t.name)}),Pt(f,s),q(e,f),le(),o()}var kv=z('<iframe title="Preview" sandbox="allow-same-origin" class="svelte-8q9z6e"></iframe>');function xv(e,t){se(t,!0);const n=()=>H(nt,"$selectedCollection",s),r=()=>H(Ce,"$config",s),i=()=>H(Te,"$loadedWidgets",s),a=()=>H(ga,"$loadingWidgets",s),o=()=>H(Ee,"$draftEntry",s),[s,l]=me();$e.extend(bc);let c=ft(()=>n()?.preview||r()?.previews.default),f=ft(()=>xm(r(),y(c))),u=K(void 0),p=ft(()=>Em(y(u),y(f))),d=K(void 0),h=K(void 0),g=!1;pt(()=>{!g&&i()===a()&&(U(h,Ei(o()),!0),g=!0)}),pt(()=>{JSON.stringify(o())!==JSON.stringify(y(h))&&v()});function m(){v()}function v(){if(y(d)?.contentDocument){for(const k in o()){const L=n()?.fields.find(E=>E.name===k);let $=o()[k];if(L.name==="date")switch(L?.type){case"time":$=$e(o()[k],"hh:mm").format(L.time_format);break;case"date":$=$e(o()[k],"YYYY-MM-DD").format(L.date_format);break;default:$=$e(o()[k],"YYYY-MM-DDThh:mm").format(L.datetime_format)}y(d).contentDocument.querySelectorAll(`[data-tag="${k}"]`).forEach(E=>{E.innerHTML!==$&&(E.innerHTML=$)})}U(h,o(),!0)}}Ue(async()=>{U(u,await Am(r(),y(c)),!0)});var w=kv();En(w,k=>U(d,k),()=>y(d)),ee(()=>Q(w,"srcdoc",y(p))),on("load",w,m),q(e,w),le(),l()}var Av=z('<!> <div class="page svelte-1cczf35"><section id="inputArea" class="svelte-1cczf35"><header class="svelte-1cczf35">Edit</header> <form id="entry-data" class="svelte-1cczf35"><!></form> <form id="md-link-editor" class="svelte-1cczf35"></form> <form id="ignore" class="svelte-1cczf35"></form></section> <section id="previewArea" class="svelte-1cczf35"><header class="svelte-1cczf35">Preview</header> <!></section></div> <!> <!> <!>',1);function Ev(e,t){se(t,!0);const n=()=>H(rt,"$editingEntry",s),r=()=>H(nt,"$selectedCollection",s),i=()=>H(at,"$backend",s),a=()=>H(p,"$submitted",s),o=()=>H(va,"$cmsActions",s),[s,l]=me();let c=K(void 0),f=K(void 0);const u=Xe({entryForm:null});Er("formState",u);const p=mt(null);Er("submitted",p);const d={string:ts,text:ts,datetime:jm,boolean:Rm,number:Wm,markdown:wv,hidden:bv};async function h(T){T.preventDefault();const Y=n()?{...n()}:{fields:{}},B=new FormData(T.target);for(const[x,b]of B.entries()){const S=r().fields.find(A=>A.name===x);try{U(c,kc(S,b,i()),!0),Y.fields[x]=await y(c)}catch(A){console.error("Error parsing form entry.",A);return}}const C=Sm(r(),Y);re(p,i().saveFile(r(),C));try{re(rt,await a()),o()?.onSave&&(U(f,o().onSave(n()),!0),await y(f))}catch(x){console.warn("Issue saving post.",x)}}Ue(()=>{re(Te,0),re(ga,r().fields.length)});var g=Av(),m=xe(g);$m(m,{});var v=R(m,2),w=I(v),k=R(I(w),2),L=I(k);{var $=T=>{var Y=ct(),B=xe(Y);qt(B,1,()=>r().fields,C=>C.name,(C,x)=>{const b=ft(()=>d[y(x).widget]),S=ft(()=>y(x)?.default);var A=ct(),O=xe(A);{var D=Z=>{var M=ct(),j=xe(M);gr(j,()=>y(b),(J,ue)=>{ue(J,vr(()=>y(x),{get checked(){return y(S)}}))}),q(Z,M)},W=Z=>{var M=ct(),j=xe(M);{var J=de=>{var Me=ct(),be=xe(Me);gr(be,()=>y(b),(oe,ge)=>{ge(oe,vr(()=>y(x),{get value(){return y(S)},multiline:!0}))}),q(de,Me)},ue=de=>{var Me=ct(),be=xe(Me);gr(be,()=>y(b),(oe,ge)=>{ge(oe,vr(()=>y(x),{get value(){return y(S)}}))}),q(de,Me)};Le(j,de=>{y(x).widget==="text"?de(J):de(ue,!1)},!0)}q(Z,M)};Le(O,Z=>{y(x).widget==="boolean"?Z(D):Z(W,!1)})}q(C,A)}),q(T,Y)};Le(L,T=>{r()&&T($)})}En(k,T=>u.entryForm=T,()=>u?.entryForm);var N=R(w,2),E=R(I(N),2);xv(E,{});var P=R(v,2);tt(P,()=>y(c),null,void 0,(T,Y)=>{xt(T,{msg:"Unable to save",get details(){return y(Y).message}})});var G=R(P,2);tt(G,a,T=>{Zr(T,{msg:"Saving"})},void 0,(T,Y)=>{xt(T,{msg:"Unable to save",get details(){return y(Y).message}})});var V=R(G,2);tt(V,()=>y(f),null,void 0,(T,Y)=>{xt(T,{msg:"'On save' event action failed",get details(){return y(Y).message}})}),on("submit",k,h),q(e,g),le(),l()}const Cv=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),Sv=function(e,t){return new URL(e,t).href},ss={},wi=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(u=>Promise.resolve(u).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),l=s?.nonce||s?.getAttribute("nonce");i=c(n.map(f=>{if(f=Sv(f,r),f in ss)return;ss[f]=!0;const u=f.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(r)for(let h=o.length-1;h>=0;h--){const g=o[h];if(g.href===f&&(!u||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${p}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":Cv,u||(d.as="script"),d.crossOrigin="",d.href=f,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((h,g)=>{d.addEventListener("load",h),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};async function Mv(e,t){let n;try{n=await t.text()}catch(s){console.error("Error constructing doc",s);return}const[r,i]=ba(n),a=Gr.load(r);return{_id:t.webkitRelativePath,name:t.name,collection:e,date:a.date,raw:n,fields:a,body:i,handle:t.handle,directoryHandle:t.directoryHandle}}function Kc(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 br,zc,Gc,Xt,gt,Un;async function Iv(){if(Xt=qe(Ce).repo_folder,!Xt){console.error("Missing 'repo_folder' config");return}return await Lv(),br.plugin(zc),br.plugin(Gc),gt=new br(`${Xt}-local`,{adapter:"idb"}),[["name","collection"],["date","collection"],["asset"],["url"],["url_preview"]].map(t=>({index:{fields:t},ddoc:t.join("-")})).forEach(t=>Tv(t)),console.log("Using local CMS backend"),po}async function Lv(){br=(await wi(async()=>{const{default:e}=await import("./index.es.js");return{default:e}},[],import.meta.url)).default,zc=(await wi(async()=>{const{default:e}=await import("./index.es2.js");return{default:e}},[],import.meta.url)).default,Gc=(await wi(async()=>{const{default:e}=await import("./index-browser.es.js");return{default:e}},[],import.meta.url)).default}async function Nv(){return{title:"Local Backend Enabled",message:"Select the local project directory to continue.",button:"Select Project Directory",action:$v}}async function Tv(e){try{const t=await gt.createIndex(e);console.log("Create index",e,t)}catch(t){console.error("Create index error",t)}}async function Ov(e){try{const t=await gt.get(e._id);e._rev=t._rev}catch(t){console.warn("Existing doc error",t)}}async function $v(){if(!Xt)return;const e=[],t=qe(Ce);t.collections.forEach(c=>{const p=`\\/?${c.folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`;e.push({name:c.name,regex:new RegExp(p,"i")})});const a=`\\/?${t.media_folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`,o=new RegExp(a,"i"),s=["node_modules"],l={recursive:!0,id:`snow-cms-${Xt}`,skipDirectory:c=>c.name.startsWith(".")||s.includes(c.name)};try{const c=await am(l),f=[],u=[];c.forEach(g=>{if(!Un&&g.directoryHandle?.name===Xt&&(Un=g.directoryHandle),o.test(g.webkitRelativePath)){f.push(Kc(t,g));return}const v=e.find(({name:w,regex:k})=>k.test(g.webkitRelativePath));v&&u.push(Mv(v.name,g))});const p=await Promise.all(u);p.push(...f);const d=[];p.forEach(g=>d.push(Ov(g))),await Promise.all(d);const h=await gt.bulkDocs(p);at.set(po)}catch(c){console.error("Open directory error",c)}}async function Dv(e){try{return(await gt.find({selector:{collection:e,date:{$gte:null}},sort:[{date:"desc"}],limit:200})).docs}catch(t){throw console.error("Error finding docs",t),t}}async function Rv(e,t){const n=qe(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),a={fileName:t.name,extensions:[r],id:i},o=new Blob([t.raw],{type:Mm(r)});if(t.handle)await Pi(o,a,t.handle,!0);else{let l=await Pi(o,a);t.handle=l}const s=await gt.put(t);return console.log(s),t._rev=s.rev,t}catch(r){throw console.error("Save file error",r),r}}async function Fv(e){try{e.forEach(r=>r._deleted=!0);const t=await gt.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 Hv(){try{return(await gt.find({selector:{asset:{$gt:""}},limit:200})).docs}catch(e){return console.error("Error finding docs",e),null}}async function Pv(){try{const t=await wa({mimeTypes:["image/*"],description:"Image Files"}),n="."+t.name.split(".").at(-1),r={fileName:t.name,extensions:[n],id:`snow-cms-upload-${Xt}`},i=await Pi(t,r);if(!Un){console.warn("File not saved to db: No root dir handle found.");return}const a=await Un.resolve(i);a.unshift(Un.name);const o={name:i.name,lastModifiedDate:new Date,type:t.type,webkitRelativePath:a.join("/"),handle:i},s=Kc(qe(Ce),o),l=await gt.put(s);console.log(l)}catch(e){console.error("Upload file error",e)}}async function Zc(e,t){const n=[];t.forEach(a=>{const o={limit:200};e==="public"?o.selector={url:a}:o.selector={url_preview:a};const s=gt.find(o);n.push(s)});const r=await Promise.all(n),i=[];return r.forEach(a=>i.push(...a.docs)),i}async function Bv(e){let t=e;try{const n=nr(t);return n.length===0?e:((await Zc("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 jv(e){let t=e;try{const n=nr(t);return n.length===0?e:((await Zc("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 po={init:Iv,getLoginConfig:Nv,getFiles:Dv,saveFile:Rv,deleteFiles:Fv,getMediaFiles:Hv,uploadMediaFile:Pv,replacePublicLinks:Bv,replacePreviewLinks:jv};function oi(){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 Jc(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,a)=>Jc.bind(null,e,a,i,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((i,a)=>a.hook.bind(null,i,r),n)():n(r))}function qv(e,t,n,r){const i=r;e.registry[n]||(e.registry[n]=[]),t==="before"&&(r=(a,o)=>Promise.resolve().then(i.bind(null,o)).then(a.bind(null,o))),t==="after"&&(r=(a,o)=>{let s;return Promise.resolve().then(a.bind(null,o)).then(l=>(s=l,i(s,o))).then(()=>s)}),t==="error"&&(r=(a,o)=>Promise.resolve().then(a.bind(null,o)).catch(s=>i(s,o))),e.registry[n].push({hook:r,orig:i})}function Vv(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 ls=Function.bind,cs=ls.bind(ls);function Uv(e,t,n){const r=cs(Vv,null).apply(null,[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach(i=>{const a=[t,i];e[i]=e.api[i]=cs(qv,null).apply(null,a)})}function Yv(){const e={registry:{}},t=Jc.bind(null,e);return Uv(t,e),t}const Wv={Collection:Yv};var Kv="0.0.0-development",zv=`octokit-endpoint.js/${Kv} ${oi()}`,Gv={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":zv},mediaType:{format:""}};function Zv(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function Jv(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 Qc(e,t){const n=Object.assign({},e);return Object.keys(t).forEach(r=>{Jv(t[r])?r in e?n[r]=Qc(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function us(e){for(const t in e)e[t]===void 0&&delete e[t];return e}function qi(e,t,n){if(typeof t=="string"){let[i,a]=t.split(" ");n=Object.assign(a?{method:i,url:a}:{url:i},n)}else n=Object.assign({},t);n.headers=Zv(n.headers),us(n),us(n.headers);const r=Qc(e||{},n);return n.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(r.mediaType.previews=e.mediaType.previews.filter(i=>!r.mediaType.previews.includes(i)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(i=>i.replace(/-preview/,""))),r}function Qv(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 Xv=/\{[^{}}]+\}/g;function e0(e){return e.replace(new RegExp("(?:^\\W+)|(?:(?<!\\W)\\W+$)","g"),"").split(/,/)}function t0(e){const t=e.match(Xv);return t?t.map(e0).reduce((n,r)=>n.concat(r),[]):[]}function fs(e,t){const n={__proto__:null};for(const r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function Xc(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 yn(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Pn(e,t,n){return t=e==="+"||e==="#"?Xc(t):yn(t),n?yn(n)+"="+t:t}function dn(e){return e!=null}function _i(e){return e===";"||e==="&"||e==="?"}function n0(e,t,n,r){var i=e[n],a=[];if(dn(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),a.push(Pn(t,i,_i(t)?n:""));else if(r==="*")Array.isArray(i)?i.filter(dn).forEach(function(o){a.push(Pn(t,o,_i(t)?n:""))}):Object.keys(i).forEach(function(o){dn(i[o])&&a.push(Pn(t,i[o],o))});else{const o=[];Array.isArray(i)?i.filter(dn).forEach(function(s){o.push(Pn(t,s))}):Object.keys(i).forEach(function(s){dn(i[s])&&(o.push(yn(s)),o.push(Pn(t,i[s].toString())))}),_i(t)?a.push(yn(n)+"="+o.join(",")):o.length!==0&&a.push(o.join(","))}else t===";"?dn(i)&&a.push(yn(n)):i===""&&(t==="&"||t==="?")?a.push(yn(n)+"="):i===""&&a.push("");return a}function r0(e){return{expand:i0.bind(null,e)}}function i0(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,a){if(i){let s="";const l=[];if(n.indexOf(i.charAt(0))!==-1&&(s=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(c){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(c);l.push(n0(t,s,f[1],f[2]||f[3]))}),s&&s!=="+"){var o=",";return s==="?"?o="&":s!=="#"&&(o=s),(l.length!==0?s:"")+l.join(o)}else return l.join(",")}else return Xc(a)}),e==="/"?e:e.replace(/\/$/,"")}function eu(e){let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),i,a=fs(e,["method","baseUrl","url","headers","request","mediaType"]);const o=t0(n);n=r0(n).expand(a),/^http/.test(n)||(n=e.baseUrl+n);const s=Object.keys(e).filter(f=>o.includes(f)).concat("baseUrl"),l=fs(a,s);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&e.mediaType.previews?.length)){const f=r.accept.match(new RegExp("(?<![\\w-])[\\w-]+(?=-preview)","g"))||[];r.accept=f.concat(e.mediaType.previews).map(u=>{const p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${u}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=Qv(n,l):"data"in l?i=l.data:Object.keys(l).length&&(i=l),!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 a0(e,t,n){return eu(qi(e,t,n))}function tu(e,t){const n=qi(e,t),r=a0.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:tu.bind(null,n),merge:qi.bind(null,n),parse:eu})}var o0=tu(null,Gv),pn={},ds;function s0(){if(ds)return pn;ds=1;const e=function(){};e.prototype=Object.create(null);const t=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,n=/\\([\v\u0020-\u00ff])/gu,r=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,i={type:"",parameters:new e};Object.freeze(i.parameters),Object.freeze(i);function a(s){if(typeof s!="string")throw new TypeError("argument header is required and must be a string");let l=s.indexOf(";");const c=l!==-1?s.slice(0,l).trim():s.trim();if(r.test(c)===!1)throw new TypeError("invalid media type");const f={type:c.toLowerCase(),parameters:new e};if(l===-1)return f;let u,p,d;for(t.lastIndex=l;p=t.exec(s);){if(p.index!==l)throw new TypeError("invalid parameter format");l+=p[0].length,u=p[1].toLowerCase(),d=p[2],d[0]==='"'&&(d=d.slice(1,d.length-1),n.test(d)&&(d=d.replace(n,"$1"))),f.parameters[u]=d}if(l!==s.length)throw new TypeError("invalid parameter format");return f}function o(s){if(typeof s!="string")return i;let l=s.indexOf(";");const c=l!==-1?s.slice(0,l).trim():s.trim();if(r.test(c)===!1)return i;const f={type:c.toLowerCase(),parameters:new e};if(l===-1)return f;let u,p,d;for(t.lastIndex=l;p=t.exec(s);){if(p.index!==l)return i;l+=p[0].length,u=p[1].toLowerCase(),d=p[2],d[0]==='"'&&(d=d.slice(1,d.length-1),n.test(d)&&(d=d.replace(n,"$1"))),f.parameters[u]=d}return l!==s.length?i:f}return pn.default={parse:a,safeParse:o},pn.parse=a,pn.safeParse=o,pn.defaultContentType=i,pn}var l0=s0();class pr extends Error{name;status;request;response;constructor(t,n,r){super(t,{cause:r.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in r&&(this.response=r.response);const i=Object.assign({},r.request);r.request.headers.authorization&&(i.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(new RegExp("(?<! ) .*$")," [REDACTED]")})),i.url=i.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=i}}var c0="10.0.7",u0={headers:{"user-agent":`octokit-request.js/${c0} ${oi()}`}};function f0(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)}var ps=()=>"";async function hs(e){const t=e.request?.fetch||globalThis.fetch;if(!t)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");const n=e.request?.log||console,r=e.request?.parseSuccessResponseBody!==!1,i=f0(e.body)||Array.isArray(e.body)?JSON.stringify(e.body):e.body,a=Object.fromEntries(Object.entries(e.headers).map(([u,p])=>[u,String(p)]));let o;try{o=await t(e.url,{method:e.method,body:i,redirect:e.request?.redirect,headers:a,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(u){let p="Unknown Error";if(u instanceof Error){if(u.name==="AbortError")throw u.status=500,u;p=u.message,u.name==="TypeError"&&"cause"in u&&(u.cause instanceof Error?p=u.cause.message:typeof u.cause=="string"&&(p=u.cause))}const d=new pr(p,500,{request:e});throw d.cause=u,d}const s=o.status,l=o.url,c={};for(const[u,p]of o.headers)c[u]=p;const f={url:l,status:s,headers:c,data:""};if("deprecation"in c){const u=c.link&&c.link.match(/<([^<>]+)>; rel="deprecation"/),p=u&&u.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${c.sunset}${p?`. See ${p}`:""}`)}if(s===204||s===205)return f;if(e.method==="HEAD"){if(s<400)return f;throw new pr(o.statusText,s,{response:f,request:e})}if(s===304)throw f.data=await bi(o),new pr("Not modified",s,{response:f,request:e});if(s>=400)throw f.data=await bi(o),new pr(p0(f.data),s,{response:f,request:e});return f.data=r?await bi(o):o.body,f}async function bi(e){const t=e.headers.get("content-type");if(!t)return e.text().catch(ps);const n=l0.safeParse(t);if(d0(n)){let r="";try{return r=await e.text(),JSON.parse(r)}catch{return r}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"?e.text().catch(ps):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function d0(e){return e.type==="application/json"||e.type==="application/scim+json"}function p0(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){const t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(n=>JSON.stringify(n)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function Vi(e,t){const n=e.defaults(t);return Object.assign(function(i,a){const o=n.merge(i,a);if(!o.request||!o.request.hook)return hs(n.parse(o));const s=(l,c)=>hs(n.parse(n.merge(l,c)));return Object.assign(s,{endpoint:n,defaults:Vi.bind(null,n)}),o.request.hook(s,o)},{endpoint:n,defaults:Vi.bind(null,n)})}var Ui=Vi(o0,u0);var h0="0.0.0-development";function m0(e){return`Request failed due to following response errors:
45
- `+e.errors.map(t=>` - ${t.message}`).join(`
46
- `)}var g0=class extends Error{constructor(e,t,n){super(m0(n)),this.request=e,this.headers=t,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},v0=["method","baseUrl","url","headers","request","query","mediaType","operationName"],y0=["query","method","url"],ms=/\/api\/v3\/?$/;function w0(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(y0.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,s)=>v0.includes(s)?(o[s]=r[s],o):(o.variables||(o.variables={}),o.variables[s]=r[s],o),{}),a=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return ms.test(a)&&(i.url=a.replace(ms,"/api/graphql")),e(i).then(o=>{if(o.data.errors){const s={};for(const l of Object.keys(o.headers))s[l]=o.headers[l];throw new g0(i,s,o.data)}return o.data.data})}function ho(e,t){const n=e.defaults(t);return Object.assign((i,a)=>w0(n,i,a),{defaults:ho.bind(null,n),endpoint:n.endpoint})}ho(Ui,{headers:{"user-agent":`octokit-graphql.js/${h0} ${oi()}`},method:"POST",url:"/graphql"});function _0(e){return ho(e,{method:"POST",url:"/graphql"})}var ki="(?:[a-zA-Z0-9_-]+)",gs="\\.",vs=new RegExp(`^${ki}${gs}${ki}${gs}${ki}$`),b0=vs.test.bind(vs);async function k0(e){const t=b0(e),n=e.startsWith("v1.")||e.startsWith("ghs_"),r=e.startsWith("ghu_");return{type:"token",token:e,tokenType:t?"app":n?"installation":r?"user-to-server":"oauth"}}function x0(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function A0(e,t,n,r){const i=t.endpoint.merge(n,r);return i.headers.authorization=x0(e),t(i)}var E0=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(k0.bind(null,t),{hook:A0.bind(null,t)})};const nu="7.0.6",ys=()=>{},C0=console.warn.bind(console),S0=console.error.bind(console);function M0(e={}){return typeof e.debug!="function"&&(e.debug=ys),typeof e.info!="function"&&(e.info=ys),typeof e.warn!="function"&&(e.warn=C0),typeof e.error!="function"&&(e.error=S0),e}const ws=`octokit-core.js/${nu} ${oi()}`;class I0{static VERSION=nu;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 plugins=[];static plugin(...t){const n=this.plugins;return class extends this{static plugins=n.concat(t.filter(i=>!n.includes(i)))}}constructor(t={}){const n=new Wv.Collection,r={baseUrl:Ui.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} ${ws}`:ws,t.baseUrl&&(r.baseUrl=t.baseUrl),t.previews&&(r.mediaType.previews=t.previews),t.timeZone&&(r.headers["time-zone"]=t.timeZone),this.request=Ui.defaults(r),this.graphql=_0(this.request).defaults(r),this.log=M0(t.log),this.hook=n,t.authStrategy){const{authStrategy:a,...o}=t,s=a(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},t.auth));n.wrap("request",s.hook),this.auth=s}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{const a=E0(t.auth);n.wrap("request",a.hook),this.auth=a}const i=this.constructor;for(let a=0;a<i.plugins.length;++a)Object.assign(this,i.plugins[a](this,t))}request;graphql;log;hook;auth}function ru(e,t,n,r){return e.graphql(`
39
+ `);break;case`hidden`:switch(t.type){case`datetime-local`:case`date`:case`time`:c=new Date(i).getTime(),l=a.getTime();break;default:c=i,l=a;break}break;default:c=i,l=a;break}if(c!==l)return!1}return!0}function y(e){e.preventDefault(),history.back()}var b=Tu(),x=B(b),S=B(x),C=B(S);Fi(C,()=>Gl,!0),k(C),k(S),k(x);var w=V(x,2),T=B(w),ee=B(T),te=V(ee,2);k(T),k(w);var ne=V(w,2),re=B(ne);Ci(B(re),c,e=>{J(e,wu())},(e,t)=>{var n=Su();H(()=>n.disabled=!G(p)),J(e,n)},(e,t)=>{var n=Cu();H(()=>n.disabled=!G(p)),J(e,n)}),k(re),k(ne),k(b),H(()=>{Y(ee,`${o()?.label??``} `),Y(te,` ${(n()?.fields.title||`New File`)??``}`)}),K(`click`,C,y),J(e,b),M(),u()}si([`click`]);var Du=q(`<label class="editorInput"> <input type="checkbox" role="switch" form="ignore"/> <input type="hidden"/></label>`);function Ou(e,t){j(t,!0);let n=()=>P(sl,`$draftEntry`,o),r=()=>P(al,`$selectedCollection`,o),i=()=>P(ol,`$editingEntry`,o),a=()=>P(ll,`$loadedWidgets`,o),[o,s]=I(),c=la(t,`checked`,7,!1),l=la(t,`required`,3,!1);function u(){let e={...n()};c()==null?e[t.name]=r()?.fields.find(e=>e.name===t.name).default:e[t.name]=c(),F(sl,e)}async function d(){i()&&c(i().fields[t.name]),u(),F(ll,a()+1)}ua(()=>{d()});var f=Du(),p=B(f),m=V(p);Xi(m);var h=V(m,2);Xi(h),k(f),H(()=>{X(f,`for`,t.name),Y(p,`${t.label??``} `),X(m,`id`,t.name),X(m,`name`,t.name),m.required=l(),X(h,`id`,t.name),X(h,`name`,t.name),Zi(h,c()),h.required=l()}),K(`change`,m,u),na(m,c),J(e,f),M(),s()}si([`change`]);var ku=q(`<input type="time"/>`),Au=q(`<input type="date"/>`),ju=q(`<input type="datetime-local"/>`),Mu=q(`<label class="editorInput"> <!></label>`);function Nu(e,t){j(t,!0);let n=()=>P(sl,`$draftEntry`,a),r=()=>P(ol,`$editingEntry`,a),i=()=>P(ll,`$loadedWidgets`,a),[a,o]=I(),s=la(t,`type`,3,`datetime-local`),c=la(t,`value`,23,()=>du(s(),new Date)),l=la(t,`required`,3,!0);function u(){let e={...n()};e[t.name]=c(),F(sl,e)}async function d(){if(r()){let e=r().fields;c(du(s(),new Date(e[t.name])))}u(),F(ll,i()+1)}ua(()=>{d()});var f=Mu(),p=B(f),m=V(p),h=e=>{var n=ku();Xi(n),H(()=>{X(n,`id`,t.name),X(n,`name`,t.name),n.required=l()}),K(`input`,n,u),ta(n,c),J(e,n)},g=e=>{var n=Au();Xi(n),H(()=>{X(n,`id`,t.name),X(n,`name`,t.name),n.required=l()}),K(`input`,n,u),ta(n,c),J(e,n)},_=e=>{var n=ju();Xi(n),H(()=>{X(n,`id`,t.name),X(n,`name`,t.name),n.required=l()}),K(`input`,n,u),ta(n,c),J(e,n)};wi(m,e=>{s()===`time`?e(h):s()===`date`?e(g,1):e(_,-1)}),k(f),H(()=>{X(f,`for`,t.name),Y(p,`${t.label??``} `)}),J(e,f),M(),o()}si([`input`]);var Pu=q(`<input type="text"/>`),Fu=q(`<textarea></textarea>`),Iu=q(`<label class="editorInput"> <!></label>`);function Lu(e,t){j(t,!0);let n=()=>P(sl,`$draftEntry`,o),r=()=>P(al,`$selectedCollection`,o),i=()=>P(ol,`$editingEntry`,o),a=()=>P(ll,`$loadedWidgets`,o),[o,s]=I(),c=la(t,`multiline`,3,!1),l=la(t,`required`,3,!0),u=la(t,`value`,7,``);function d(){let e={...n()};u()?e[t.name]=u():e[t.name]=r()?.fields.find(e=>e.name===t.name).label,F(sl,e)}async function f(){i()&&u(t.name===`body`?i().body:i().fields[t.name]),d(),F(ll,a()+1)}ua(()=>{f()});var p=Iu(),m=B(p),h=V(m),g=e=>{var n=Pu();Xi(n),H(()=>{X(n,`id`,t.name),X(n,`name`,t.name),n.required=l()}),K(`input`,n,d),ta(n,u),J(e,n)},_=e=>{var n=Fu();Jn(n),H(()=>{X(n,`id`,t.name),X(n,`name`,t.name),n.required=l()}),K(`input`,n,d),ta(n,u),J(e,n)};wi(h,e=>{c()?e(_,-1):e(g)}),k(p),H(()=>{X(p,`for`,t.name),Y(m,`${t.label??``} `)}),J(e,p),M(),s()}si([`input`]);var Ru=q(`<label class="editorInput"> <input type="number"/></label>`);function zu(e,t){j(t,!0);let n=()=>P(sl,`$draftEntry`,a),r=()=>P(ol,`$editingEntry`,a),i=()=>P(ll,`$loadedWidgets`,a),[a,o]=I(),s=la(t,`value`,7),c=la(t,`required`,3,!0);function l(){let e={...n()};e[t.name]=s(),F(sl,e)}async function u(){r()&&s(r().fields[t.name]),l(),F(ll,i()+1)}ua(()=>{u()});var d=Ru(),f=B(d),p=V(f);Xi(p),k(d),H(()=>{X(d,`for`,t.name),Y(f,`${t.label??``} `),X(p,`id`,t.name),X(p,`name`,t.name),X(p,`step`,t.step),X(p,`min`,t.min),X(p,`max`,t.max),p.required=c()}),K(`input`,p,l),ta(p,s),J(e,d),M(),o()}si([`input`]);var Bu=`<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>`,Vu=`<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>`,Hu=`<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>`,Uu=`<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>`,Wu=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>horizontal-rule</title><path d="M19,13H5V11H19V13Z" /></svg>`,Gu=`<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>`,Ku=`<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>`,qu=`<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>`,Ju=q(`<option class="svelte-8wonn1"> </option>`),Yu=q(`<button class="secondary svelte-8wonn1"></button>`),Xu=q(`<div class="editor-menu svelte-8wonn1"><select name="text-type" form="ignore" class="svelte-8wonn1"></select> <!></div>`);function Zu(e,t){j(t,!0);let n=R(void 0),r=R(void 0),i=l(),a=[{name:`bold`,icon:Bu},{name:`italic`,icon:Vu},{name:`listBulleted`,icon:Hu},{name:`listNumbered`,icon:Uu},{name:`quote`,icon:Gu},{name:`horizontalRule`,icon:Wu},{name:`link`,icon:Ku},{name:`image`,icon:qu}];function o(e){e.preventDefault();let{action:n}=e.currentTarget.dataset;t.onactionselect(n)}function s(e){let n=e.currentTarget.value;t.ontexttypeselect(n)}function c(){let e=document.getSelection().focusNode?.parentElement;if(!G(r).contains(e))return;let{localName:t}=e;switch(t){case`h1`:case`h2`:case`h3`:case`h4`:case`h5`:case`h6`:G(n).value=parseInt(t.split(``).at(-1));break;default:G(n).value=`p`;break}}function l(){let e=[];for(let t=0;t<=6;t++){let n;n=t===0?{title:`Normal`,value:`p`}:{title:`Heading ${t}`,value:t},e.push(n)}return e}ua(()=>{z(r,document.querySelector(`#md-editor`),!0)});var u=Xu();oi(`selectionchange`,Fn,c);var d=B(u);ki(d,21,()=>i,Ti,(e,t)=>{var n=Ju(),r=B(n,!0);k(n);var i={};H(()=>{Y(r,G(t).title),i!==(i=G(t).value)&&(n.value=(n.__value=G(t).value)??``)}),J(e,n)}),k(d),oa(d,e=>z(n,e),()=>G(n)),ki(V(d,2),17,()=>a,Ti,(e,t)=>{var n=Yu();Fi(n,()=>G(t).icon,!0),k(n),H(()=>X(n,`data-action`,G(t).name)),K(`click`,n,o),J(e,n)}),k(u),K(`change`,d,s),J(e,u),M()}si([`change`,`click`]);var Qu=q(`<div id="link-editor-container" class="svelte-1qtwn58"><div id="link-editor" class="svelte-1qtwn58"><div class="svelte-1qtwn58">Enter link:</div> <input form="md-link-editor" type="url" name="url" placeholder="https://example.com" required="" class="svelte-1qtwn58"/> <button class="secondary svelte-1qtwn58" form="md-link-editor" type="submit">Save</button></div></div>`);function $u(e,t){j(t,!0);let n=R(!1),r=R(void 0),i=R(void 0);ir(()=>{G(n)&&G(i).focus()});function a(){let e=document.getSelection();if(e.focusNode.parentElement.localName===`a`){t.onsaveurl({});return}else if(G(n))z(n,!G(n)),G(i).value=``;else{let{startOffset:t,endOffset:r}=e.getRangeAt(0);z(n,t!==r)}}function o(e){e.preventDefault();let r=G(i).value;G(i).value=``,z(n,!1),t.onsaveurl({href:r})}function s(){if(!G(n))return;let e=document.getSelection().focusNode;G(r).contains(e)||(z(n,!1),G(i).value=``,t.onsaveurl(null))}ua(()=>{let e=document.querySelector(`#md-link-editor`);return e.addEventListener(`submit`,o),()=>{e.removeEventListener(`submit`,o)}});var c={toggleEditor:a},l=Qu();oi(`selectionchange`,Fn,s);let u;var d=B(l);return oa(V(B(d),2),e=>z(i,e),()=>G(i)),et(2),k(d),oa(d,e=>z(r,e),()=>G(r)),k(l),H(()=>u=Gi(l,``,u,{visibility:G(n)?`visible`:`hidden`})),J(e,l),M(c)}var ed=q(`<div><img alt="" loading="lazy" crossorigin="use-credentials" class="svelte-kkm0gm"/> <small class="svelte-kkm0gm"> </small></div>`),td=q(`<dialog open=""><article><header>Select Image</header> <div class="images svelte-kkm0gm"></div> <footer class="svelte-kkm0gm"><button class="secondary svelte-kkm0gm">Cancel</button> <button class="svelte-kkm0gm">Select</button></footer></article></dialog>`);function nd(e,t){j(t,!0);let n=()=>P(ul,`$backend`,r),[r,i]=I(),a=R(Nn([])),o=R(void 0);async function s(){z(a,await n()?.getMediaFiles()||[],!0)}function c(e){z(o,e,!0)}function l(e){e.preventDefault(),t.onselectimg(G(o))}function u(e){e.preventDefault(),e.currentTarget===e.target&&t.onselectimg(null)}ua(()=>{s();let{body:e}=document;return e.classList.add(`contain-scroll`),()=>{e.classList.remove(`contain-scroll`)}});var d=td(),f=B(d),p=V(B(f),2);ki(p,21,()=>G(a),e=>e.name,(e,t)=>{var n=ed();let r;var i=B(n),a=V(i,2),s=B(a,!0);k(a),k(n),H(()=>{r=Ui(n,1,`img-container svelte-kkm0gm`,null,r,{selected:G(o)===G(t)}),X(i,`src`,G(t).url_preview),Y(s,G(t).name)}),K(`click`,n,()=>c(G(t))),J(e,n)}),k(p);var m=V(p,2),h=B(m),g=V(h,2);k(m),k(f),k(d),H(()=>g.disabled=!G(o)),K(`click`,d,u),K(`click`,h,u),K(`click`,g,l),J(e,d),M(),i()}si([`click`]);var rd=q(`<label class="editorInput"> <div id="md-editor" class="svelte-g1hz34"><!> <div></div> <!></div> <input type="hidden" class="svelte-g1hz34"/></label> <!> <!>`,1);function id(e,t){j(t,!0);let S=()=>P(sl,`$draftEntry`,te),C=()=>P(al,`$selectedCollection`,te),w=()=>P(ol,`$editingEntry`,te),T=()=>P(ul,`$backend`,te),ee=()=>P(ll,`$loadedWidgets`,te),[te,ne]=I(),re=la(t,`value`,7,``),ie=la(t,`required`,3,!0),ae=R(void 0),oe=R(void 0),se=R(!1),ce=R(void 0),le=R(void 0),ue=R(void 0),de=R(void 0);ir(()=>{re()!==G(oe)&&fe(re())});function fe(e){let n={...S()};e?G(ue)&&(n[t.name]=h()(G(ue).ctx).replaceAll(`<img `,`<img crossorigin="use-credentials" `)):n[t.name]=C()?.fields.find(e=>e.name===t.name).label,F(sl,n),z(oe,re(),!0)}function pe(){if(!G(ce))return;let e=document.getSelection();e.removeAllRanges();let t=document.createRange(),{startOffset:n,endOffset:r}=G(ce).range;t.setStart(G(ce).node,n),t.setEnd(G(ce).node,r),e.addRange(t)}function me(e){z(se,!1),pe(),e&&G(ue).action(t=>{let n=t.get(b),r={alt:e.name,src:e.url_preview};n.call(u.key,r)})}function he(e){if(pe(),!e)return;let{href:t}=e,n=document.getSelection(),{textContent:r}=n.focusNode,{startOffset:i,endOffset:a}=n.getRangeAt(0),o=r.substring(i,a);G(ue).action(e=>{let n=e.get(b),r={title:o,href:t};n.call(m.key,r)})}function ge(e){G(ue).action(t=>{let n=t.get(b);e===`p`?n.call(a.key):n.call(o.key,e)})}function _e(e){G(ue).action(t=>{let n=t.get(b);switch(e){case`bold`:n.call(_.key);break;case`italic`:n.call(r.key);break;case`listBulleted`:n.call(y.key);break;case`listNumbered`:n.call(s.key);break;case`quote`:n.call(d.key);break;case`horizontalRule`:n.call(g.key);break;case`link`:G(le).toggleEditor();break;case`image`:G(ce)&&z(se,!0);break}})}function ve(){let e=document.getSelection(),t=e.focusNode;G(de)?.contains(t)&&z(ce,{node:e.focusNode,range:e.getRangeAt(0)},!0)}function ye(e){z(ue,e,!0),z(de,document.querySelector(`.milkdown .ProseMirror`),!0),f(re())(G(ue).ctx),fe(re())}async function be(e){n.make().config(t=>{t.set(i,e),t.set(x,re()),t.get(c).markdownUpdated((e,t,n)=>{re(t)})}).config(v).use(p).use(l).create().then(ye)}async function xe(){if(w()){try{let e=t.name===`body`?w().body:w().fields[t.name];z(ae,T().replacePublicLinks(e),!0),re(await G(ae)),G(ue)&&f(re())(G(ue).ctx)}catch{}F(ll,ee()+1)}}ua(()=>{xe()});var Se=rd();oi(`selectionchange`,Fn,ve);var Ce=Un(Se),we=B(Ce),Te=V(we),Ee=B(Te);Zu(Ee,{ontexttypeselect:ge,onactionselect:_e});var De=V(Ee,2);Li(De,e=>be?.(e)),oa($u(V(De,2),{onsaveurl:he}),e=>z(le,e,!0),()=>G(le)),k(Te);var Oe=V(Te,2);Xi(Oe),k(Ce);var ke=V(Ce,2);Ci(ke,()=>G(ae),e=>{Tl(e,{msg:`Loading`})},void 0,(e,t)=>{Ol(e,{msg:`Unable to load`,get details(){return G(t).message}})});var Ae=V(ke,2),je=e=>{nd(e,{onselectimg:me})};wi(Ae,e=>{G(se)&&e(je)}),H(()=>{X(Ce,`for`,t.name),Y(we,`${t.label??``} `),X(Oe,`id`,t.name),X(Oe,`name`,t.name),Oe.required=ie()}),ta(Oe,re),J(e,Se),M(),ne()}var ad=q(`<input type="hidden"/>`);function od(e,t){j(t,!0);let n=()=>P(sl,`$draftEntry`,a),r=()=>P(ol,`$editingEntry`,a),i=()=>P(ll,`$loadedWidgets`,a),[a,o]=I(),s=la(t,`value`,7);function c(){let e={...n()};e[t.name]=s(),F(sl,e)}async function l(){if(r()?.fields[t.name])switch(t.type){case`datetime-local`:case`date`:case`time`:s(du(t.type,new Date(r().fields[t.name])));break;default:s(r().fields[t.name]);break}else if(!s())switch(t.type){case`datetime-local`:case`date`:case`time`:s(du(t.type,new Date));break;case`boolean`:s(`false`);break}c(),F(ll,i()+1)}ua(()=>{l()});var u=ad();Xi(u),H(()=>{X(u,`id`,t.name),X(u,`name`,t.name)}),ta(u,s),J(e,u),M(),o()}var sd=q(`<iframe title="Preview" sandbox="allow-same-origin" class="svelte-8q9z6e"></iframe>`);function cd(e,t){j(t,!0);let n=()=>P(al,`$selectedCollection`,s),r=()=>P(dl,`$config`,s),i=()=>P(ll,`$loadedWidgets`,s),a=()=>P(cl,`$loadingWidgets`,s),o=()=>P(sl,`$draftEntry`,s),[s,c]=I();bl.default.extend(cu.default);let l=hn(()=>n()?.preview||r()?.previews.default),u=hn(()=>fu(r(),G(l))),d=R(void 0),f=hn(()=>mu(G(d),G(u))),p=R(void 0),m=R(void 0),h=!1;ir(()=>{!h&&i()===a()&&(z(m,lt(o()),!0),h=!0)}),ir(()=>{JSON.stringify(o())!==JSON.stringify(G(m))&&_()});function g(){_()}function _(){if(G(p)?.contentDocument){for(let e in o()){let t=n()?.fields.find(t=>t.name===e),r=o()[e];if(t.name===`date`)switch(t?.type){case`time`:r=(0,bl.default)(o()[e],`hh:mm`).format(t.time_format);break;case`date`:r=(0,bl.default)(o()[e],`YYYY-MM-DD`).format(t.date_format);break;default:r=(0,bl.default)(o()[e],`YYYY-MM-DDThh:mm`).format(t.datetime_format)}G(p).contentDocument.querySelectorAll(`[data-tag="${e}"]`).forEach(e=>{e.innerHTML!==r&&(e.innerHTML=r)})}z(m,o(),!0)}}ua(async()=>{z(d,await pu(r(),G(l)),!0)});var v=sd();oa(v,e=>z(p,e),()=>G(p)),H(()=>X(v,`srcdoc`,G(f))),oi(`load`,v,g),ii(v),J(e,v),M(),c()}var ld=q(`<!> <div class="page svelte-1cczf35"><section id="inputArea" class="svelte-1cczf35"><header class="svelte-1cczf35">Edit</header> <form id="entry-data" class="svelte-1cczf35"><!></form> <form id="md-link-editor" class="svelte-1cczf35"></form> <form id="ignore" class="svelte-1cczf35"></form></section> <section id="previewArea" class="svelte-1cczf35"><header class="svelte-1cczf35">Preview</header> <!></section></div> <!> <!> <!>`,1);function ud(e,t){j(t,!0);let n=()=>P(ol,`$editingEntry`,s),r=()=>P(al,`$selectedCollection`,s),i=()=>P(ul,`$backend`,s),a=()=>P(f,`$submitted`,s),o=()=>P(fl,`$cmsActions`,s),[s,c]=I(),l=R(void 0),u=R(void 0),d=Nn({entryForm:null});pt(`formState`,d);let f=At(null);pt(`submitted`,f);let p={string:Lu,text:Lu,datetime:Nu,boolean:Ou,number:zu,markdown:id,hidden:od};async function m(e){e.preventDefault();let t=n()?{...n()}:{fields:{}},s=new FormData(e.target);for(let[e,n]of s.entries()){let a=r().fields.find(t=>t.name===e);try{z(l,hu(a,n,i()),!0),t.fields[e]=await G(l)}catch(e){console.error(`Error parsing form entry.`,e);return}}let c=_u(r(),t);F(f,i().saveFile(r(),c));try{F(ol,await a()),o()?.onSave&&(z(u,o().onSave(n()),!0),await G(u))}catch(e){console.warn(`Issue saving post.`,e)}}ua(()=>{F(ll,0),F(cl,r().fields.length)});var h=ld(),g=Un(h);Eu(g,{});var _=V(g,2),v=B(_),y=V(B(v),2),b=B(y),x=e=>{var t=mi();ki(Un(t),1,()=>r().fields,e=>e.name,(e,t)=>{let n=hn(()=>p[G(t).widget]),r=hn(()=>G(t)?.default);var i=mi(),a=Un(i),o=e=>{var i=mi();Ii(Un(i),()=>G(n),(e,n)=>{n(e,ca(()=>G(t),{get checked(){return G(r)}}))}),J(e,i)},s=e=>{var i=mi();Ii(Un(i),()=>G(n),(e,n)=>{n(e,ca(()=>G(t),{get value(){return G(r)},multiline:!0}))}),J(e,i)},c=e=>{var i=mi();Ii(Un(i),()=>G(n),(e,n)=>{n(e,ca(()=>G(t),{get value(){return G(r)}}))}),J(e,i)};wi(a,e=>{G(t).widget===`boolean`?e(o):G(t).widget===`text`?e(s,1):e(c,-1)}),J(e,i)}),J(e,t)};wi(b,e=>{r()&&e(x)}),k(y),oa(y,e=>d.entryForm=e,()=>d?.entryForm),et(4),k(v);var S=V(v,2);cd(V(B(S),2),{}),k(S),k(_);var C=V(_,2);Ci(C,()=>G(l),null,void 0,(e,t)=>{Ol(e,{msg:`Unable to save`,get details(){return G(t).message}})});var w=V(C,2);Ci(w,a,e=>{Tl(e,{msg:`Saving`})},void 0,(e,t)=>{Ol(e,{msg:`Unable to save`,get details(){return G(t).message}})}),Ci(V(w,2),()=>G(u),null,void 0,(e,t)=>{Ol(e,{msg:`'On save' event action failed`,get details(){return G(t).message}})}),oi(`submit`,y,m),J(e,h),M(),c()}async function dd(e,t){let n;try{n=await t.text()}catch(e){console.error(`Error constructing doc`,e);return}let[r,i]=vu(n),a=el.load(r);return{_id:t.webkitRelativePath,name:t.name,collection:e,date:a.date,raw:n,fields:a,body:i,handle:t.handle,directoryHandle:t.directoryHandle}}function fd(e,t){let 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}}var pd,md,hd,gd,_d,vd;async function yd(){if(gd=Mt(dl).repo_folder,!gd){console.error(`Missing 'repo_folder' config`);return}return await bd(),pd.plugin(md),pd.plugin(hd),_d=new pd(`${gd}-local`,{adapter:`idb`}),[[`name`,`collection`],[`date`,`collection`],[`asset`],[`url`],[`url_preview`]].map(e=>({index:{fields:e},ddoc:e.join(`-`)})).forEach(e=>Sd(e)),console.log(`Using local CMS backend`),Nd}async function bd(){pd=(await il(async()=>{let{default:e}=await import(`./index4.es.js`);return{default:e}},[],import.meta.url)).default,md=(await il(async()=>{let{default:e}=await import(`./index2.es.js`);return{default:e}},[],import.meta.url)).default,hd=(await il(async()=>{let{default:e}=await import(`./index-browser2.es.js`);return{default:e}},[],import.meta.url)).default}async function xd(){return{title:`Local Backend Enabled`,message:`Select the local project directory to continue.`,button:`Select Project Directory`,action:wd}}async function Sd(e){try{let t=await _d.createIndex(e);console.log(`Create index`,e,t)}catch(e){console.error(`Create index error`,e)}}async function Cd(e){try{e._rev=(await _d.get(e._id))._rev}catch(e){console.warn(`Existing doc error`,e)}}async function wd(){if(!gd)return;let e=[],t=Mt(dl);t.collections.forEach(t=>{let n=`\\/?${t.folder.split(`/`).join(`\\/`)}\\/[^_][\\w-]+\\.\\w+`;e.push({name:t.name,regex:new RegExp(n,`i`)})});let n=`\\/?${t.media_folder.split(`/`).join(`\\/`)}\\/[^_][\\w-]+\\.\\w+`,r=new RegExp(n,`i`),i=[`node_modules`],a={recursive:!0,id:`snow-cms-${gd}`,skipDirectory:e=>e.name.startsWith(`.`)||i.includes(e.name)};try{let n=await Xl(a),i=[],o=[];n.forEach(n=>{if(!vd&&n.directoryHandle?.name===gd&&(vd=n.directoryHandle),r.test(n.webkitRelativePath)){i.push(fd(t,n));return}let a=e.find(({name:e,regex:t})=>t.test(n.webkitRelativePath));a&&o.push(dd(a.name,n))});let s=await Promise.all(o);s.push(...i);let c=[];s.forEach(e=>c.push(Cd(e))),await Promise.all(c),await _d.bulkDocs(s),ul.set(Nd)}catch(e){console.error(`Open directory error`,e)}}async function Td(e){try{return(await _d.find({selector:{collection:e,date:{$gte:null}},sort:[{date:`desc`}],limit:200})).docs}catch(e){throw console.error(`Error finding docs`,e),e}}async function Ed(e,t){let n=Mt(dl).repo_folder;t._id||=[n,e.folder,t.name].join(`/`);try{let r=`.${e.extension}`,i=`snow-cms-save-${n}-${e.folder.split(/[\/\\]/).at(-1)}`.substring(0,32),a={fileName:t.name,extensions:[r],id:i},o=new Blob([t.raw],{type:yu(r)});t.handle?await Ql(o,a,t.handle,!0):t.handle=await Ql(o,a);let s=await _d.put(t);return console.log(s),t._rev=s.rev,t}catch(e){throw console.error(`Save file error`,e),e}}async function Dd(e){try{e.forEach(e=>e._deleted=!0);let t=await _d.bulkDocs(e);console.log(t);let n=[];e.forEach(e=>{e.handle&&n.push(e.handle.remove())}),await Promise.all(n)}catch(e){throw console.error(`Delete files error`,e),e}}async function Od(){try{return(await _d.find({selector:{asset:{$gt:``}},limit:200})).docs}catch(e){return console.error(`Error finding docs`,e),null}}async function kd(){try{let e=await Jl({mimeTypes:[`image/*`],description:`Image Files`}),t=`.`+e.name.split(`.`).at(-1),n=await Ql(e,{fileName:e.name,extensions:[t],id:`snow-cms-upload-${gd}`});if(!vd){console.warn(`File not saved to db: No root dir handle found.`);return}let r=await vd.resolve(n);r.unshift(vd.name);let i={name:n.name,lastModifiedDate:new Date,type:e.type,webkitRelativePath:r.join(`/`),handle:n},a=fd(Mt(dl),i),o=await _d.put(a);console.log(o)}catch(e){console.error(`Upload file error`,e)}}async function Ad(e,t){let n=[];t.forEach(t=>{let r={limit:200};e===`public`?r.selector={url:t}:r.selector={url_preview:t};let i=_d.find(r);n.push(i)});let r=await Promise.all(n),i=[];return r.forEach(e=>i.push(...e.docs)),i}async function jd(e){let t=e;try{let n=bu(t);return n.length===0?e:((await Ad(`public`,n)).forEach(e=>{t=t.replaceAll(e.url,e.url_preview)}),t)}catch(e){throw console.error(`Error processing public links`,e),e}}async function Md(e){let t=e;try{let n=bu(t);return n.length===0?e:((await Ad(`preview`,n)).forEach(e=>{t=t.replaceAll(e.url_preview,e.url)}),t)}catch(e){throw console.error(`Error processing preview links`,e),e}}var Nd={init:yd,getLoginConfig:xd,getFiles:Td,saveFile:Ed,deleteFiles:Dd,getMediaFiles:Od,uploadMediaFile:kd,replacePublicLinks:jd,replacePreviewLinks:Md};function Pd(){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 Fd(e,t,n,r){if(typeof n!=`function`)throw Error(`method for before hook must be a function`);return r||={},Array.isArray(t)?t.reverse().reduce((t,n)=>Fd.bind(null,e,n,t,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((e,t)=>t.hook.bind(null,e,r),n)():n(r))}function Id(e,t,n,r){let i=r;e.registry[n]||(e.registry[n]=[]),t===`before`&&(r=(e,t)=>Promise.resolve().then(i.bind(null,t)).then(e.bind(null,t))),t===`after`&&(r=(e,t)=>{let n;return Promise.resolve().then(e.bind(null,t)).then(e=>(n=e,i(n,t))).then(()=>n)}),t===`error`&&(r=(e,t)=>Promise.resolve().then(e.bind(null,t)).catch(e=>i(e,t))),e.registry[n].push({hook:r,orig:i})}function Ld(e,t,n){if(!e.registry[t])return;let r=e.registry[t].map(e=>e.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}var Rd=Function.bind,zd=Rd.bind(Rd);function Bd(e,t,n){let r=zd(Ld,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,[`before`,`error`,`after`,`wrap`].forEach(r=>{let i=n?[t,r,n]:[t,r];e[r]=e.api[r]=zd(Id,null).apply(null,i)})}function Vd(){let e=Symbol(`Singular`),t={registry:{}},n=Fd.bind(null,t,e);return Bd(n,t,e),n}function Hd(){let e={registry:{}},t=Fd.bind(null,e);return Bd(t,e),t}var Ud={Singular:Vd,Collection:Hd},Wd=`octokit-endpoint.js/0.0.0-development ${Pd()}`,Gd={method:`GET`,baseUrl:`https://api.github.com`,headers:{accept:`application/vnd.github.v3+json`,"user-agent":Wd},mediaType:{format:``}};function Kd(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function qd(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let 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 Jd(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(r=>{qd(t[r])&&r in e?n[r]=Jd(e[r],t[r]):Object.assign(n,{[r]:t[r]})}),n}function Yd(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function Xd(e,t,n){if(typeof t==`string`){let[e,r]=t.split(` `);n=Object.assign(r?{method:e,url:r}:{url:e},n)}else n=Object.assign({},t);n.headers=Kd(n.headers),Yd(n),Yd(n.headers);let r=Jd(e||{},n);return n.url===`/graphql`&&(e&&e.mediaType.previews?.length&&(r.mediaType.previews=e.mediaType.previews.filter(e=>!r.mediaType.previews.includes(e)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(e=>e.replace(/-preview/,``))),r}function Zd(e,t){let n=/\?/.test(e)?`&`:`?`,r=Object.keys(t);return r.length===0?e:e+n+r.map(e=>e===`q`?`q=`+t.q.split(`+`).map(encodeURIComponent).join(`+`):`${e}=${encodeURIComponent(t[e])}`).join(`&`)}var Qd=/\{[^{}}]+\}/g;function $d(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,``).split(/,/)}function ef(e){let t=e.match(Qd);return t?t.map($d).reduce((e,t)=>e.concat(t),[]):[]}function tf(e,t){let n={__proto__:null};for(let r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function nf(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,`[`).replace(/%5D/g,`]`)),e}).join(``)}function rf(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return`%`+e.charCodeAt(0).toString(16).toUpperCase()})}function af(e,t,n){return t=e===`+`||e===`#`?nf(t):rf(t),n?rf(n)+`=`+t:t}function of(e){return e!=null}function sf(e){return e===`;`||e===`&`||e===`?`}function cf(e,t,n,r){var i=e[n],a=[];if(of(i)&&i!==``)if(typeof i==`string`||typeof i==`number`||typeof i==`boolean`)i=i.toString(),r&&r!==`*`&&(i=i.substring(0,parseInt(r,10))),a.push(af(t,i,sf(t)?n:``));else if(r===`*`)Array.isArray(i)?i.filter(of).forEach(function(e){a.push(af(t,e,sf(t)?n:``))}):Object.keys(i).forEach(function(e){of(i[e])&&a.push(af(t,i[e],e))});else{let e=[];Array.isArray(i)?i.filter(of).forEach(function(n){e.push(af(t,n))}):Object.keys(i).forEach(function(n){of(i[n])&&(e.push(rf(n)),e.push(af(t,i[n].toString())))}),sf(t)?a.push(rf(n)+`=`+e.join(`,`)):e.length!==0&&a.push(e.join(`,`))}else t===`;`?of(i)&&a.push(rf(n)):i===``&&(t===`&`||t===`?`)?a.push(rf(n)+`=`):i===``&&a.push(``);return a}function lf(e){return{expand:uf.bind(null,e)}}function uf(e,t){var n=[`+`,`#`,`.`,`/`,`;`,`?`,`&`];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(e,r,i){if(r){let e=``,i=[];if(n.indexOf(r.charAt(0))!==-1&&(e=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(n){var r=/([^:\*]*)(?::(\d+)|(\*))?/.exec(n);i.push(cf(t,e,r[1],r[2]||r[3]))}),e&&e!==`+`){var a=`,`;return e===`?`?a=`&`:e!==`#`&&(a=e),(i.length===0?``:e)+i.join(a)}else return i.join(`,`)}else return nf(i)}),e===`/`?e:e.replace(/\/$/,``)}function df(e){let t=e.method.toUpperCase(),n=(e.url||`/`).replace(/:([a-z]\w+)/g,`{$1}`),r=Object.assign({},e.headers),i,a=tf(e,[`method`,`baseUrl`,`url`,`headers`,`request`,`mediaType`]),o=ef(n);n=lf(n).expand(a),/^http/.test(n)||(n=e.baseUrl+n);let s=tf(a,Object.keys(e).filter(e=>o.includes(e)).concat(`baseUrl`));return/application\/octet-stream/i.test(r.accept)||(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(t=>t.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(`,`)),n.endsWith(`/graphql`)&&e.mediaType.previews?.length&&(r.accept=(r.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[]).concat(e.mediaType.previews).map(t=>`application/vnd.github.${t}-preview${e.mediaType.format?`.${e.mediaType.format}`:`+json`}`).join(`,`))),[`GET`,`HEAD`].includes(t)?n=Zd(n,s):`data`in s?i=s.data:Object.keys(s).length&&(i=s),!r[`content-type`]&&i!==void 0&&(r[`content-type`]=`application/json; charset=utf-8`),[`PATCH`,`PUT`].includes(t)&&i===void 0&&(i=``),Object.assign({method:t,url:n,headers:r},i===void 0?null:{body:i},e.request?{request:e.request}:null)}function ff(e,t,n){return df(Xd(e,t,n))}function pf(e,t){let n=Xd(e,t),r=ff.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:pf.bind(null,n),merge:Xd.bind(null,n),parse:df})}var mf=pf(null,Gd),hf=t(((e,t)=>{var n=function(){};n.prototype=Object.create(null);var r=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,i=/\\([\v\u0020-\u00ff])/gu,a=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,o={type:``,parameters:new n};Object.freeze(o.parameters),Object.freeze(o);function s(e){if(typeof e!=`string`)throw TypeError(`argument header is required and must be a string`);let t=e.indexOf(`;`),o=t===-1?e.trim():e.slice(0,t).trim();if(a.test(o)===!1)throw TypeError(`invalid media type`);let s={type:o.toLowerCase(),parameters:new n};if(t===-1)return s;let c,l,u;for(r.lastIndex=t;l=r.exec(e);){if(l.index!==t)throw TypeError(`invalid parameter format`);t+=l[0].length,c=l[1].toLowerCase(),u=l[2],u[0]===`"`&&(u=u.slice(1,u.length-1),i.test(u)&&(u=u.replace(i,`$1`))),s.parameters[c]=u}if(t!==e.length)throw TypeError(`invalid parameter format`);return s}function c(e){if(typeof e!=`string`)return o;let t=e.indexOf(`;`),s=t===-1?e.trim():e.slice(0,t).trim();if(a.test(s)===!1)return o;let c={type:s.toLowerCase(),parameters:new n};if(t===-1)return c;let l,u,d;for(r.lastIndex=t;u=r.exec(e);){if(u.index!==t)return o;t+=u[0].length,l=u[1].toLowerCase(),d=u[2],d[0]===`"`&&(d=d.slice(1,d.length-1),i.test(d)&&(d=d.replace(i,`$1`))),c.parameters[l]=d}return t===e.length?c:o}t.exports.default={parse:s,safeParse:c},t.exports.parse=s,t.exports.safeParse=c,t.exports.defaultContentType=o}))(),gf=class extends Error{name;status;request;response;constructor(e,t,n){super(e,{cause:n.cause}),this.name=`HttpError`,this.status=Number.parseInt(t),Number.isNaN(this.status)&&(this.status=0),`response`in n&&(this.response=n.response);let r=Object.assign({},n.request);n.request.headers.authorization&&(r.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?<! ) .*$/,` [REDACTED]`)})),r.url=r.url.replace(/\bclient_secret=\w+/g,`client_secret=[REDACTED]`).replace(/\baccess_token=\w+/g,`access_token=[REDACTED]`),this.request=r}},_f=`10.0.7`,vf={headers:{"user-agent":`octokit-request.js/${_f} ${Pd()}`}};function yf(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}var bf=()=>``;async function xf(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw 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`);let n=e.request?.log||console,r=e.request?.parseSuccessResponseBody!==!1,i=yf(e.body)||Array.isArray(e.body)?JSON.stringify(e.body):e.body,a=Object.fromEntries(Object.entries(e.headers).map(([e,t])=>[e,String(t)])),o;try{o=await t(e.url,{method:e.method,body:i,redirect:e.request?.redirect,headers:a,signal:e.request?.signal,...e.body&&{duplex:`half`}})}catch(t){let n=`Unknown Error`;if(t instanceof Error){if(t.name===`AbortError`)throw t.status=500,t;n=t.message,t.name===`TypeError`&&`cause`in t&&(t.cause instanceof Error?n=t.cause.message:typeof t.cause==`string`&&(n=t.cause))}let r=new gf(n,500,{request:e});throw r.cause=t,r}let s=o.status,c=o.url,l={};for(let[e,t]of o.headers)l[e]=t;let u={url:c,status:s,headers:l,data:``};if(`deprecation`in l){let t=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),r=t&&t.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${r?`. See ${r}`:``}`)}if(s===204||s===205)return u;if(e.method===`HEAD`){if(s<400)return u;throw new gf(o.statusText,s,{response:u,request:e})}if(s===304)throw u.data=await Sf(o),new gf(`Not modified`,s,{response:u,request:e});if(s>=400)throw u.data=await Sf(o),new gf(wf(u.data),s,{response:u,request:e});return u.data=r?await Sf(o):o.body,u}async function Sf(e){let t=e.headers.get(`content-type`);if(!t)return e.text().catch(bf);let n=(0,hf.safeParse)(t);if(Cf(n)){let t=``;try{return t=await e.text(),JSON.parse(t)}catch{return t}}else if(n.type.startsWith(`text/`)||n.parameters.charset?.toLowerCase()===`utf-8`)return e.text().catch(bf);else return e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function Cf(e){return e.type===`application/json`||e.type===`application/scim+json`}function wf(e){if(typeof e==`string`)return e;if(e instanceof ArrayBuffer)return`Unknown error`;if(`message`in e){let t=`documentation_url`in e?` - ${e.documentation_url}`:``;return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(e=>JSON.stringify(e)).join(`, `)}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function Tf(e,t){let n=e.defaults(t);return Object.assign(function(e,t){let r=n.merge(e,t);if(!r.request||!r.request.hook)return xf(n.parse(r));let i=(e,t)=>xf(n.parse(n.merge(e,t)));return Object.assign(i,{endpoint:n,defaults:Tf.bind(null,n)}),r.request.hook(i,r)},{endpoint:n,defaults:Tf.bind(null,n)})}var Ef=Tf(mf,vf),Df=`0.0.0-development`;function Of(e){return`Request failed due to following response errors:
40
+ `+e.errors.map(e=>` - ${e.message}`).join(`
41
+ `)}var kf=class extends Error{constructor(e,t,n){super(Of(n)),this.request=e,this.headers=t,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name=`GraphqlResponseError`;errors;data},Af=[`method`,`baseUrl`,`url`,`headers`,`request`,`query`,`mediaType`,`operationName`],jf=[`query`,`method`,`url`],Mf=/\/api\/v3\/?$/;function Nf(e,t,n){if(n){if(typeof t==`string`&&`query`in n)return Promise.reject(Error(`[@octokit/graphql] "query" cannot be used as variable name`));for(let e in n)if(jf.includes(e))return Promise.reject(Error(`[@octokit/graphql] "${e}" cannot be used as variable name`))}let r=typeof t==`string`?Object.assign({query:t},n):t,i=Object.keys(r).reduce((e,t)=>Af.includes(t)?(e[t]=r[t],e):(e.variables||={},e.variables[t]=r[t],e),{}),a=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return Mf.test(a)&&(i.url=a.replace(Mf,`/api/graphql`)),e(i).then(e=>{if(e.data.errors){let t={};for(let n of Object.keys(e.headers))t[n]=e.headers[n];throw new kf(i,t,e.data)}return e.data.data})}function Pf(e,t){let n=e.defaults(t);return Object.assign((e,t)=>Nf(n,e,t),{defaults:Pf.bind(null,n),endpoint:n.endpoint})}Pf(Ef,{headers:{"user-agent":`octokit-graphql.js/${Df} ${Pd()}`},method:`POST`,url:`/graphql`});function Ff(e){return Pf(e,{method:`POST`,url:`/graphql`})}var If=`(?:[a-zA-Z0-9_-]+)`,Lf=`\\.`,Rf=RegExp(`^${If}${Lf}${If}${Lf}${If}$`),zf=Rf.test.bind(Rf);async function Bf(e){let t=zf(e),n=e.startsWith(`v1.`)||e.startsWith(`ghs_`),r=e.startsWith(`ghu_`);return{type:`token`,token:e,tokenType:t?`app`:n?`installation`:r?`user-to-server`:`oauth`}}function Vf(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Hf(e,t,n,r){let i=t.endpoint.merge(n,r);return i.headers.authorization=Vf(e),t(i)}var Uf=function(e){if(!e)throw Error(`[@octokit/auth-token] No token passed to createTokenAuth`);if(typeof e!=`string`)throw Error(`[@octokit/auth-token] Token passed to createTokenAuth is not a string`);return e=e.replace(/^(token|bearer) +/i,``),Object.assign(Bf.bind(null,e),{hook:Hf.bind(null,e)})},Wf=`7.0.6`,Gf=()=>{},Kf=console.warn.bind(console),qf=console.error.bind(console);function Jf(e={}){return typeof e.debug!=`function`&&(e.debug=Gf),typeof e.info!=`function`&&(e.info=Gf),typeof e.warn!=`function`&&(e.warn=Kf),typeof e.error!=`function`&&(e.error=qf),e}var Yf=`octokit-core.js/${Wf} ${Pd()}`,Xf=class{static VERSION=Wf;static defaults(e){return class extends this{constructor(...t){let n=t[0]||{};if(typeof e==`function`){super(e(n));return}super(Object.assign({},e,n,n.userAgent&&e.userAgent?{userAgent:`${n.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let t=this.plugins;return class extends this{static plugins=t.concat(e.filter(e=>!t.includes(e)))}}constructor(e={}){let t=new Ud.Collection,n={baseUrl:Ef.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:t.bind(null,`request`)}),mediaType:{previews:[],format:``}};if(n.headers[`user-agent`]=e.userAgent?`${e.userAgent} ${Yf}`:Yf,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers[`time-zone`]=e.timeZone),this.request=Ef.defaults(n),this.graphql=Ff(this.request).defaults(n),this.log=Jf(e.log),this.hook=t,e.authStrategy){let{authStrategy:n,...r}=e,i=n(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:r},e.auth));t.wrap(`request`,i.hook),this.auth=i}else if(!e.auth)this.auth=async()=>({type:`unauthenticated`});else{let n=Uf(e.auth);t.wrap(`request`,n.hook),this.auth=n}let r=this.constructor;for(let t=0;t<r.plugins.length;++t)Object.assign(this,r.plugins[t](this,e))}request;graphql;log;hook;auth};function Zf(e,t,n,r){return e.graphql(`
47
42
  query GetRepoPath($repoOwner: String!, $repoName: String!, $path: String!) {
48
43
  repository(owner: $repoOwner, name: $repoName) {
49
44
  object(expression: $path) {
@@ -64,7 +59,7 @@ ${n.body}`,n}function ba(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
64
59
  }
65
60
  }
66
61
  }
67
- `,{repoOwner:t,repoName:n,path:r})}function L0(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 N0(e,t,n,r){return e.graphql(`
62
+ `,{repoOwner:t,repoName:n,path:r})}function Qf(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 $f(e,t,n,r){return e.graphql(`
68
63
  query GetRefOid($owner: String!, $name: String!, $refName: String!) {
69
64
  repository(owner: $owner, name: $name) {
70
65
  id
@@ -75,7 +70,7 @@ ${n.body}`,n}function ba(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
75
70
  }
76
71
  }
77
72
  }
78
- `,{name:n,owner:t,refName:r})}function T0(e,t,n,r,i,a){return e.graphql(`
73
+ `,{name:n,owner:t,refName:r})}function ep(e,t,n,r,i,a){return e.graphql(`
79
74
  mutation CreateCommit($branchName: String!, $repoNameWithOwner: String!, $expectedHeadOid: GitObjectID!, $headline: String!, $changes: FileChanges!) {
80
75
  createCommitOnBranch(input: {
81
76
  branch: {repositoryNameWithOwner: $repoNameWithOwner, branchName: $branchName},
@@ -86,4 +81,4 @@ ${n.body}`,n}function ba(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
86
81
  clientMutationId
87
82
  }
88
83
  }
89
- `,{repoNameWithOwner:t,branchName:n,headline:r,expectedHeadOid:i,changes:a})}async function O0(e,t,n){return(await fetch(`data:${e};${t},${n}`)).blob()}function $0(e,t=!1){return new Promise((n,r)=>{const i=new FileReader;i.onerror=a=>r(a),i.onload=()=>{const{result:a}=i,o=t?a.replace(/^data:.+\/.+;base64,/,""):a;n(o)},i.readAsDataURL(e)})}function D0(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 R0(e,t,n){const{id:r,text:i}=n.object,[a,o]=ba(i),s=Gr.load(a);return{_id:r,name:n.name,collection:e,path:t,date:s.date,raw:i,fields:s,body:o}}async function F0(e,t,n,r,i){const[a,o]=t.backend.repo.split("/"),{id:s,oid:l}=i.object,c=await L0(e,a,o,l),f=`${r}/${i.name}`;let u=f;if(c.status===200)try{const{content:d,encoding:h}=c.data,g=D0(i.extension),m=await O0(g,h,d);u=URL.createObjectURL(m)}catch(d){console.error("Error creating preview url.",d)}return{_id:s,name:i.name,path:n,url:f,url_preview:u}}let Sn=[];const iu=`${window.location.origin}${window.location.pathname}`,H0="SNOW_CMS:",Yi={state:`${H0}:GH_AUTH:STATE`};let nn;async function P0(){const e=qe(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"),a=localStorage.getItem(Yi.state);if(n){au();return}if(r&&a)if(i===a){console.log("Valid auth state"),history.replaceState({},"",iu);const o=e.api_root??window.location.origin,s=e.auth_endpoint??"/api/github/oauth/token",l=`${o}${s}`,f={method:"post",headers:{"content-type":"application/json"},body:JSON.stringify({code:r})},u=await fetch(l,f),p=await u.json();if(!u.ok)throw new Error(p.error??"Token error");const{authentication:d}=p;nn=new I0({auth:d.token});const{data:{total_count:h,installations:g}}=await nn.request("GET /user/installations",{headers:{"X-GitHub-Api-Version":"2022-11-28"}}),m=e.app_name.replaceAll(" ","-").toLowerCase();if(h<=0){await _s(l,d.token),bs(m);return}if(!g.find(w=>w.app_slug===m)){await _s(l,d.token),bs(m);return}at.set(Wi)}else throw localStorage.removeItem(Yi.state),new Error("Invalid auth state");return console.log("Using GitHub CMS backend"),Wi}async function _s(e,t){const n={method:"delete",headers:{Authorization:`token ${t}`}};if(!(await fetch(e,n)).ok)throw new Error("Delete token error")}function bs(e){const t=new URL(`https://github.com/apps/${e}/installations/new`);window.location.assign(t.href)}async function B0(){return{title:"GitHub Log in",button:"Log in with GitHub",action:au}}async function au(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",qe(Ce).backend.client_id),r.set("redirect_uri",iu),r.set("state",n),localStorage.setItem(Yi.state,n),window.location.assign(t.href)}async function j0(e){try{const t=qe(Ce),n=t.collections.find(f=>f.name===e),{repo:r,branch:i}=t.backend,[a,o]=r.split("/"),s=`${i}:${n.folder}`,{repository:l}=await ru(nn,a,o,s);if(!l)throw new Error("Error getting repo path");const c=[];return l.object?.entries.forEach(f=>{/^[\._]/.test(f.name)||c.push(R0(e,n.folder,f))}),c.sort((f,u)=>u.date.getTime()-f.date.getTime()),c}catch(t){throw console.error("Error fetching files",t),t}}async function q0(e,t){try{const n=`Update ${t.name}`,r={additions:[{path:`${e.folder}/${t.name}`,contents:btoa(t.raw)}]};return await mo(n,r),t}catch(n){throw console.error("Error saving file.",n),n}}async function V0(e){try{const t=`Delete ${e.length} file(s)`,n={deletions:e.map(r=>({path:`${r.path}/${r.name}`}))};await mo(t,n),e.forEach(r=>{r.url_preview&&URL.revokeObjectURL(r.url_preview)}),Sn=[...Sn.filter(r=>e.every(i=>r.id!==i.id))]}catch(t){throw console.error("Error deleting files.",t),t}}async function U0(){try{const e=qe(Ce),{media_folder:t,public_folder:n}=e,{repo:r,branch:i}=e.backend,[a,o]=r.split("/"),s=`${i}:${e.media_folder}`,{repository:l}=await ru(nn,a,o,s);if(!l)throw new Error("Error getting repo path");const c=[];l.object?.entries.forEach(u=>{if(/^[\._]/.test(u.name))return;const p=F0(nn,e,t,n,u);c.push(p)});const f=await Promise.all(c);return Sn.forEach(u=>{u.url_preview&&URL.revokeObjectURL(u.url_preview)}),Sn=f,f}catch(e){throw console.error("Error getting media files",e),e}}async function Y0(){try{const e=qe(Ce).media_folder,n=await wa({mimeTypes:["image/*"],description:"Image Files"}),r=await $0(n,!0),i=`Update ${n.name}`,a={additions:[{path:`${e}/${n.name}`,contents:r}]};await mo(i,a)}catch(e){console.error("Upload file error",e)}}async function W0(e){let t=e;try{const n=nr(t);return n.length===0?e:(Sn.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 K0(e){let t=e;try{const n=nr(t);return n.length===0?e:(Sn.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 mo(e,t){const n=qe(Ce),{repo:r,branch:i}=n.backend,[a,o]=r.split("/"),s=i,{repository:l}=await N0(nn,a,o,s);if(!l)throw new Error("Error getting oid");const{oid:c}=l.ref.target;if(!(await T0(nn,r,i,e,c,t))?.createCommitOnBranch)throw new Error("Error creating commit")}const Wi={init:P0,getLoginConfig:B0,getFiles:j0,saveFile:q0,deleteFiles:V0,getMediaFiles:U0,uploadMediaFile:Y0,replacePublicLinks:W0,replacePreviewLinks:K0};var z0=z('<input autocomplete="on" required/>'),G0=z('<button form="login"> </button>'),Z0=z('<div aria-busy="true"></div>'),J0=z('<dialog open><article><header><h3> </h3></header> <p> </p> <form id="login"><!></form> <footer><!></footer></article></dialog> <!> <!>',1);function Q0(e,t){se(t,!0);const n=()=>H(Ce,"$config",r),[r,i]=me();let a=ft(()=>n()?.local_backend?"local":n()?.backend?.name),o=K(void 0),s=K(void 0),l=K(void 0),c=K(null),f=K(2);pt(()=>{y(a)&&!y(o)&&p()});async function u(Y){Y.preventDefault();try{const B=new FormData(Y.target);U(c,y(l).action(B),!0)}catch(B){console.error("Error logging in.",B)}}async function p(){try{if(y(f)<=0)return;if(!y(a))throw new Error("Missing backend name");switch(y(a)){case"local":U(o,po.init(),!0);break;case"github":U(o,Wi.init(),!0);break;case"custom":U(o,Im(Ce,at),!0);break;default:throw new Error(`Unsupported backend: ${y(a)}`)}U(s,await y(o),!0),y(s).getLoginConfig&&U(l,await y(s).getLoginConfig(),!0)}catch(Y){console.error("Error initializing backend.",Y),Af(f,-1),console.log("Re-trying init. Attempts left ",y(f)),p()}}var d=J0(),h=xe(d),g=I(h),m=I(g),v=I(m),w=I(v),k=R(m,2),L=I(k),$=R(k,2),N=I($);{var E=Y=>{const B=ft(()=>Object.entries(y(l).fields));var C=ct(),x=xe(C);qt(x,17,()=>y(B),b=>b[0],(b,S)=>{const A=ft(()=>{const[D,W]=y(S);return{name:D,type:W}});var O=z0();ee(()=>{Q(O,"type",y(A).type),Q(O,"name",y(A).name),Q(O,"placeholder",y(A).name)}),q(b,O)}),q(Y,C)};Le(N,Y=>{y(l)?.fields&&Y(E)})}var P=R($,2),G=I(P);tt(G,()=>y(c),Y=>{var B=Z0();q(Y,B)},(Y,B)=>{var C=G0(),x=I(C);ee(()=>ce(x,y(l)?.button??"Log in")),q(Y,C)});var V=R(h,2);tt(V,()=>y(o),null,void 0,(Y,B)=>{xt(Y,{msg:"Error initializing backend.",get details(){return y(B).message}})});var T=R(V,2);tt(T,()=>y(c),null,void 0,(Y,B)=>{xt(Y,{msg:"Error logging in.",get details(){return y(B).message}})}),ee(()=>{ce(w,y(l)?.title??"Log in"),ce(L,y(l)?.message??"Log in to continue.")}),on("submit",$,u),q(e,d),le(),i()}var X0=z("<!> <!>",1);function ey(e,t){se(t,!0);const n=()=>H(at,"$backend",r),[r,i]=me(),a={"":tm,editor:Ev};let o=K(void 0);function s(){const p=window.location.hash.replace(/#\/?/,""),d=a[p];d?U(o,d,!0):(console.warn(`Page not found: ${p}`),window.location.hash="")}Ue(()=>{s()});var l=X0();on("hashchange",Ii,s);var c=xe(l);gr(c,()=>y(o),(p,d)=>{d(p,{})});var f=R(c,2);{var u=p=>{Q0(p,{})};Le(f,p=>{n()||p(u)})}q(e,l),le(),i()}function ty(){const e=document.getElementById("app");e.childElementCount>0||Pf(ey,{target:e})}ty();
84
+ `,{repoNameWithOwner:t,branchName:n,headline:r,expectedHeadOid:i,changes:a})}async function tp(e,t,n){return(await fetch(`data:${e};${t},${n}`)).blob()}function np(e,t=!1){return new Promise((n,r)=>{let i=new FileReader;i.onerror=e=>r(e),i.onload=()=>{let{result:e}=i;n(t?e.replace(/^data:.+\/.+;base64,/,``):e)},i.readAsDataURL(e)})}function rp(e){let t=e.replace(`^.`,``),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 ip(e,t,n){let{id:r,text:i}=n.object,[a,o]=vu(i),s=el.load(a);return{_id:r,name:n.name,collection:e,path:t,date:s.date,raw:i,fields:s,body:o}}async function ap(e,t,n,r,i){let[a,o]=t.backend.repo.split(`/`),{id:s,oid:c}=i.object,l=await Qf(e,a,o,c),u=`${r}/${i.name}`,d=u;if(l.status===200)try{let{content:e,encoding:t}=l.data,n=await tp(rp(i.extension),t,e);d=URL.createObjectURL(n)}catch(e){console.error(`Error creating preview url.`,e)}return{_id:s,name:i.name,path:n,url:u,url_preview:d}}var op=[],sp=`${window.location.origin}${window.location.pathname}`,cp={state:`SNOW_CMS::GH_AUTH:STATE`},lp;async function up(){let e=Mt(dl).backend;if(!e.repo)throw Error(`Missing backend 'repo' config.`);if(!e.app_name)throw Error(`Missing backend 'app_name' config.`);let t=new URLSearchParams(window.location.search),n=t.get(`setup_action`),r=t.get(`code`),i=t.get(`state`),a=localStorage.getItem(cp.state);if(n){mp(null);return}if(r&&a)if(i===a){console.log(`Valid auth state`),history.replaceState({},``,sp);let t=`${e.api_root??window.location.origin}${e.auth_endpoint??`/api/github/oauth/token`}`,n={code:r},i={method:`post`,headers:{"content-type":`application/json`},body:JSON.stringify(n)},a=await fetch(t,i),o=await a.json();if(!a.ok)throw Error(o.error??`Token error`);let{authentication:s}=o;lp=new Xf({auth:s.token});let{data:{total_count:c,installations:l}}=await lp.request(`GET /user/installations`,{headers:{"X-GitHub-Api-Version":`2022-11-28`}}),u=e.app_name.replaceAll(` `,`-`).toLowerCase();if(c<=0){await dp(t,s.token),fp(u);return}if(!l.find(e=>e.app_slug===u)){await dp(t,s.token),fp(u);return}ul.set(Cp)}else throw localStorage.removeItem(cp.state),Error(`Invalid auth state`);return console.log(`Using GitHub CMS backend`),Cp}async function dp(e,t){let n={method:`delete`,headers:{Authorization:`token ${t}`}};if(!(await fetch(e,n)).ok)throw Error(`Delete token error`)}function fp(e){let t=new URL(`https://github.com/apps/${e}/installations/new`);window.location.assign(t.href)}async function pp(){return{title:`GitHub Log in`,button:`Log in with GitHub`,action:mp}}async function mp(e){let t=new URL(`https://github.com/login/oauth/authorize`),n=Math.random().toString(36).substring(2),r=t.searchParams;r.set(`client_id`,Mt(dl).backend.client_id),r.set(`redirect_uri`,sp),r.set(`state`,n),localStorage.setItem(cp.state,n),window.location.assign(t.href)}async function hp(e){try{let t=Mt(dl),n=t.collections.find(t=>t.name===e),{repo:r,branch:i}=t.backend,[a,o]=r.split(`/`),s=`${i}:${n.folder}`,{repository:c}=await Zf(lp,a,o,s);if(!c)throw Error(`Error getting repo path`);let l=[];return c.object?.entries.forEach(t=>{/^[\._]/.test(t.name)||l.push(ip(e,n.folder,t))}),l.sort((e,t)=>t.date.getTime()-e.date.getTime()),l}catch(e){throw console.error(`Error fetching files`,e),e}}async function gp(e,t){try{return await Sp(`Update ${t.name}`,{additions:[{path:`${e.folder}/${t.name}`,contents:btoa(t.raw)}]}),t}catch(e){throw console.error(`Error saving file.`,e),e}}async function _p(e){try{await Sp(`Delete ${e.length} file(s)`,{deletions:e.map(e=>({path:`${e.path}/${e.name}`}))}),e.forEach(e=>{e.url_preview&&URL.revokeObjectURL(e.url_preview)}),op=[...op.filter(t=>e.every(e=>t.id!==e.id))]}catch(e){throw console.error(`Error deleting files.`,e),e}}async function vp(){try{let e=Mt(dl),{media_folder:t,public_folder:n}=e,{repo:r,branch:i}=e.backend,[a,o]=r.split(`/`),s=`${i}:${e.media_folder}`,{repository:c}=await Zf(lp,a,o,s);if(!c)throw Error(`Error getting repo path`);let l=[];c.object?.entries.forEach(r=>{if(/^[\._]/.test(r.name))return;let i=ap(lp,e,t,n,r);l.push(i)});let u=await Promise.all(l);return op.forEach(e=>{e.url_preview&&URL.revokeObjectURL(e.url_preview)}),op=u,u}catch(e){throw console.error(`Error getting media files`,e),e}}async function yp(){try{let e=Mt(dl).media_folder,t=await Jl({mimeTypes:[`image/*`],description:`Image Files`}),n=await np(t,!0);await Sp(`Update ${t.name}`,{additions:[{path:`${e}/${t.name}`,contents:n}]})}catch(e){console.error(`Upload file error`,e)}}async function bp(e){let t=e;try{let n=bu(t);return n.length===0?e:(op.filter(e=>e.url&&n.includes(e.url)).forEach(e=>{t=t.replaceAll(e.url,e.url_preview)}),t)}catch(e){throw console.error(`Error processing public links`,e),e}}async function xp(e){let t=e;try{let n=bu(t);return n.length===0?e:(op.filter(e=>e.url_preview&&n.includes(e.url_preview)).forEach(e=>{t=t.replaceAll(e.url_preview,e.url)}),t)}catch(e){throw console.error(`Error processing preview links`,e),e}}async function Sp(e,t){let{repo:n,branch:r}=Mt(dl).backend,[i,a]=n.split(`/`),{repository:o}=await $f(lp,i,a,r);if(!o)throw Error(`Error getting oid`);let{oid:s}=o.ref.target;if(!(await ep(lp,n,r,e,s,t))?.createCommitOnBranch)throw Error(`Error creating commit`)}var Cp={init:up,getLoginConfig:pp,getFiles:hp,saveFile:gp,deleteFiles:_p,getMediaFiles:vp,uploadMediaFile:yp,replacePublicLinks:bp,replacePreviewLinks:xp},wp=q(`<input autocomplete="on" required=""/>`),Tp=q(`<button form="login"> </button>`),Ep=q(`<div aria-busy="true"></div>`),Dp=q(`<dialog open=""><article><header><h3> </h3></header> <p> </p> <form id="login"><!></form> <footer><!></footer></article></dialog> <!> <!>`,1);function Op(e,t){j(t,!0);let n=()=>P(dl,`$config`,r),[r,i]=I(),a=hn(()=>n()?.local_backend?`local`:n()?.backend?.name),o=R(void 0),s=R(void 0),c=R(void 0),l=R(null),u=R(2);ir(()=>{G(a)&&!G(o)&&f()});async function d(e){e.preventDefault();try{let t=new FormData(e.target);z(l,G(c).action(t),!0)}catch(e){console.error(`Error logging in.`,e)}}async function f(){try{if(G(u)<=0)return;if(!G(a))throw Error(`Missing backend name`);switch(G(a)){case`local`:z(o,Nd.init(),!0);break;case`github`:z(o,Cp.init(),!0);break;case`custom`:z(o,xu(dl,ul),!0);break;default:throw Error(`Unsupported backend: ${G(a)}`)}z(s,await G(o),!0),G(s).getLoginConfig&&z(c,await G(s).getLoginConfig(),!0)}catch(e){console.error(`Error initializing backend.`,e),An(u,-1),console.log(`Re-trying init. Attempts left `,G(u)),f()}}var p=Dp(),m=Un(p),h=B(m),g=B(h),_=B(g),v=B(_,!0);k(_),k(g);var y=V(g,2),b=B(y,!0);k(y);var x=V(y,2),S=B(x),C=e=>{let t=hn(()=>Object.entries(G(c).fields));var n=mi();ki(Un(n),17,()=>G(t),e=>e[0],(e,t)=>{let n=hn(()=>{let[e,n]=G(t);return{name:e,type:n}});var r=wp();H(()=>{X(r,`type`,G(n).type),X(r,`name`,G(n).name),X(r,`placeholder`,G(n).name)}),J(e,r)}),J(e,n)};wi(S,e=>{G(c)?.fields&&e(C)}),k(x);var w=V(x,2);Ci(B(w),()=>G(l),e=>{J(e,Ep())},(e,t)=>{var n=Tp(),r=B(n,!0);k(n),H(()=>Y(r,G(c)?.button??`Log in`)),J(e,n)}),k(w),k(h),k(m);var T=V(m,2);Ci(T,()=>G(o),null,void 0,(e,t)=>{Ol(e,{msg:`Error initializing backend.`,get details(){return G(t).message}})}),Ci(V(T,2),()=>G(l),null,void 0,(e,t)=>{Ol(e,{msg:`Error logging in.`,get details(){return G(t).message}})}),H(()=>{Y(v,G(c)?.title??`Log in`),Y(b,G(c)?.message??`Log in to continue.`)}),oi(`submit`,x,d),J(e,p),M(),i()}var kp=q(`<!> <!>`,1);function Ap(e,t){j(t,!0);let n=()=>P(ul,`$backend`,r),[r,i]=I(),a={"":Wl,editor:ud},o=R(void 0);function s(){let e=window.location.hash.replace(/#\/?/,``),t=a[e];t?z(o,t,!0):(console.warn(`Page not found: ${e}`),window.location.hash=``)}ua(()=>{s()});var c=kp();oi(`hashchange`,Pn,s);var l=Un(c);Ii(l,()=>G(o),(e,t)=>{t(e,{})});var u=V(l,2),d=e=>{Op(e,{})};wi(u,e=>{n()||e(d)}),J(e,c),M(),i()}function jp(){let e=document.getElementById(`app`);e.childElementCount>0||hi(Ap,{target:e})}jp();