@xtrable-ltd/nanoesis 0.1.36 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/adapter-azure-blob.js +1 -1
  2. package/dist/adapter-sharp.js +4 -1
  3. package/dist/{chunk-2OWUWOGB.js → chunk-APYNH4WV.js} +1 -1
  4. package/dist/{chunk-AH2MVN2O.js → chunk-PC4CBVFU.js} +11 -10
  5. package/dist/editor-api.js +2 -2
  6. package/dist/index.d.ts +16 -8
  7. package/dist/index.js +1 -1
  8. package/dist/mcp.js +3 -3
  9. package/editor/assets/{MigrationsPane-DNIZD5v9.js → MigrationsPane-Gl4TRput.js} +1 -1
  10. package/editor/assets/{TemplatesPane-tI-X3c-0.js → TemplatesPane-B61rHJkg.js} +7 -7
  11. package/editor/assets/{cssMode-BHqRWMex.js → cssMode-bYk8sP3U.js} +1 -1
  12. package/editor/assets/{freemarker2-CfiPR_ij.js → freemarker2-BU4rgrfa.js} +1 -1
  13. package/editor/assets/{handlebars-0ARiDNDT.js → handlebars-CZr10U1G.js} +1 -1
  14. package/editor/assets/{html-Dp9xFEzA.js → html-BHiPgbpO.js} +1 -1
  15. package/editor/assets/{htmlMode-Di7FTYZK.js → htmlMode-CRDc1TY9.js} +1 -1
  16. package/editor/assets/{index-CMn2xISn.js → index-CHzAqQHp.js} +52 -52
  17. package/editor/assets/{javascript-CzNePMtj.js → javascript-BnirEF_x.js} +1 -1
  18. package/editor/assets/{jsonMode-CrPeML79.js → jsonMode-CGYlgPX5.js} +1 -1
  19. package/editor/assets/{liquid-Cfq-Fp7b.js → liquid-CE01l5IB.js} +1 -1
  20. package/editor/assets/{mdx-sMGe_OUc.js → mdx-WWDFUE9y.js} +1 -1
  21. package/editor/assets/{python-lEgAHzP3.js → python-336D9sQt.js} +1 -1
  22. package/editor/assets/{razor-BbvZMZxa.js → razor-D-m82ylU.js} +1 -1
  23. package/editor/assets/{tsMode-DMVtz8YS.js → tsMode-Dtinbfel.js} +1 -1
  24. package/editor/assets/{typescript-D-p3vFTx.js → typescript-C3y5Ddzl.js} +1 -1
  25. package/editor/assets/{xml-CmbnTHPn.js → xml-Dh77Kjd0.js} +1 -1
  26. package/editor/assets/{yaml-HnvHlCHy.js → yaml-4PsSVpRL.js} +1 -1
  27. package/editor/index.html +1 -1
  28. package/package.json +1 -1
@@ -1,23 +1,23 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-tI-X3c-0.js","./TemplatesPane-C-T4XiLp.css","./MigrationsPane-DNIZD5v9.js","./MigrationsPane-BAHPPSXP.css"])))=>i.map(i=>d[i]);
2
- var rE=Object.defineProperty;var b0=t=>{throw TypeError(t)};var sE=(t,e,n)=>e in t?rE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ye=(t,e,n)=>sE(t,typeof e!="symbol"?e+"":e,n),kc=(t,e,n)=>e.has(t)||b0("Cannot "+n);var V=(t,e,n)=>(kc(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?b0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ye=(t,e,n,r)=>(kc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),rt=(t,e,n)=>(kc(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const Q1=!1;var Jf=Array.isArray,aE=Array.prototype.indexOf,xa=Array.prototype.includes,Vl=Array.from,iE=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,Z1=Object.getOwnPropertyDescriptors,oE=Object.prototype,uE=Array.prototype,eh=Object.getPrototypeOf,E0=Object.isExtensible;function co(t){return typeof t=="function"}const th=()=>{};function lE(t){return t()}function bd(t){for(var e=0;e<t.length;e++)t[e]()}function J1(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function cE(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const n=[];for(const r of t)if(n.push(r),n.length===e)break;return n}const Tn=2,Fi=4,hu=8,nh=1<<24,Cr=16,Dr=32,ta=64,Ed=128,gr=512,an=1024,pn=2048,ns=4096,Pn=8192,vr=16384,Xa=32768,_d=1<<25,As=65536,Al=1<<17,dE=1<<18,eo=1<<19,em=1<<20,Vr=1<<25,Ha=65536,yl=1<<21,Ai=1<<22,Qs=1<<23,Qr=Symbol("$state"),tm=Symbol("legacy props"),fE=Symbol(""),il=Symbol("attributes"),Td=Symbol("class"),Ad=Symbol("style"),_o=Symbol("text"),ol=Symbol("form reset"),Xl=new class extends Error{constructor(){super(...arguments);ye(this,"name","StaleReactionError");ye(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var K1;const rh=!!((K1=globalThis.document)!=null&&K1.contentType)&&globalThis.document.contentType.includes("xml");function nm(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function hE(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function pE(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function mE(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function gE(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function vE(t){throw new Error("https://svelte.dev/e/effect_orphan")}function bE(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function EE(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function _E(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function TE(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function AE(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function yE(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const NE=1,wE=2,rm=4,SE=8,IE=16,CE=1,LE=2,OE=4,xE=8,RE=16,DE=1,kE=2,Zt=Symbol("uninitialized"),sm="http://www.w3.org/1999/xhtml",PE="http://www.w3.org/2000/svg",ME="@attach";function BE(){console.warn("https://svelte.dev/e/derived_inert")}function FE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function UE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function am(t){return t===this.v}function HE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function im(t){return!HE(t,this.v)}let to=!1,qE=!1;function jE(){to=!0}let Ct=null;function Ui(t){Ct=t}function $E(t){return YE().get(t)}function at(t,e=!1,n){Ct={p:Ct,i:!1,c:null,e:null,s:t,x:null,r:Ze,l:to&&!e?{s:null,u:null,$:[]}:null}}function it(t){var e=Ct,n=e.e;if(n!==null){e.e=null;for(var r of n)Lm(r)}return e.i=!0,Ct=e.p,{}}function no(){return!to||Ct!==null&&Ct.l===null}function YE(t){return Ct===null&&nm(),Ct.c??(Ct.c=new Map(zE(Ct)||void 0))}function zE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let Ta=[];function om(){var t=Ta;Ta=[],bd(t)}function xr(t){if(Ta.length===0&&!Co){var e=Ta;queueMicrotask(()=>{e===Ta&&om()})}Ta.push(t)}function WE(){for(;Ta.length>0;)om()}function um(t){var e=Ze;if(e===null)return et.f|=Qs,t;if((e.f&Xa)===0&&(e.f&Fi)===0)throw t;Ys(t,e)}function Ys(t,e){for(;e!==null;){if((e.f&Ed)!==0){if((e.f&Xa)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const GE=-7169;function zt(t,e){t.f=t.f&GE|e}function sh(t){(t.f&gr)!==0||t.deps===null?zt(t,an):zt(t,ns)}function lm(t){if(t!==null)for(const e of t)(e.f&Tn)===0||(e.f&Ha)===0||(e.f^=Ha,lm(e.deps))}function cm(t,e,n){(t.f&pn)!==0?e.add(t):(t.f&ns)!==0&&n.add(t),lm(t.deps),zt(t,an)}let Pu=!1;function KE(t){var e=Pu;try{return Pu=!1,[t(),Pu]}finally{Pu=e}}let Pc=null,li=null,Fe=null,Io=null,bn=null,yd=null,Co=!1,Mc=!1,Ei=null,ul=null;var _0=0;let VE=1;var Li,Us,wa,Oi,xi,Sa,Ri,ms,au,zn,iu,Hs,zr,Wr,Di,Ia,vt,Nd,To,wd,dm,fm,ll,XE,Sd,di;const Yl=class Yl{constructor(){Ue(this,vt);ye(this,"id",VE++);Ue(this,Li,!1);ye(this,"linked",!0);Ue(this,Us,null);Ue(this,wa,null);ye(this,"async_deriveds",new Map);ye(this,"current",new Map);ye(this,"previous",new Map);ye(this,"unblocked",new Set);Ue(this,Oi,new Set);Ue(this,xi,new Set);Ue(this,Sa,new Set);Ue(this,Ri,0);Ue(this,ms,new Map);Ue(this,au,null);Ue(this,zn,[]);Ue(this,iu,[]);Ue(this,Hs,new Set);Ue(this,zr,new Set);Ue(this,Wr,new Map);Ue(this,Di,new Set);ye(this,"is_fork",!1);Ue(this,Ia,!1)}skip_effect(e){V(this,Wr).has(e)||V(this,Wr).set(e,{d:[],m:[]}),V(this,Di).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=V(this,Wr).get(e);if(r){V(this,Wr).delete(e);for(var s of r.d)zt(s,pn),n(s);for(s of r.m)zt(s,ns),n(s)}V(this,Di).add(e)}capture(e,n,r=!1){e.v!==Zt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Qs)===0&&(this.current.set(e,[n,r]),bn==null||bn.set(e,n)),this.is_fork||(e.v=n)}activate(){Fe=this}deactivate(){Fe=null,bn=null}flush(){try{Mc=!0,Fe=this,rt(this,vt,To).call(this)}finally{_0=0,yd=null,Ei=null,ul=null,Mc=!1,Fe=null,bn=null,Ra.clear()}}discard(){for(const e of V(this,xi))e(this);V(this,xi).clear(),V(this,Sa).clear(),rt(this,vt,di).call(this)}register_created_effect(e){V(this,iu).push(e)}increment(e,n){if(Ye(this,Ri,V(this,Ri)+1),e){let r=V(this,ms).get(n)??0;V(this,ms).set(n,r+1)}}decrement(e,n){if(Ye(this,Ri,V(this,Ri)-1),e){let r=V(this,ms).get(n)??0;r===1?V(this,ms).delete(n):V(this,ms).set(n,r-1)}V(this,Ia)||(Ye(this,Ia,!0),xr(()=>{Ye(this,Ia,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)V(this,Hs).add(r);for(const r of n)V(this,zr).add(r);e.clear(),n.clear()}oncommit(e){V(this,Oi).add(e)}ondiscard(e){V(this,xi).add(e)}on_fork_commit(e){V(this,Sa).add(e)}run_fork_commit_callbacks(){for(const e of V(this,Sa))e(this);V(this,Sa).clear()}settled(){return(V(this,au)??Ye(this,au,J1())).promise}static ensure(){var e;if(Fe===null){const n=Fe=new Yl;rt(e=n,vt,Sd).call(e),!Mc&&!Co&&xr(()=>{V(n,Li)||n.flush()})}return Fe}apply(){{bn=null;return}}schedule(e){var s;if(yd=e,(s=e.b)!=null&&s.is_pending&&(e.f&(Fi|hu|nh))!==0&&(e.f&Xa)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(Ei!==null&&n===Ze&&(et===null||(et.f&Tn)===0))return;if((r&(ta|Dr))!==0){if((r&an)===0)return;n.f^=an}}V(this,zn).push(n)}};Li=new WeakMap,Us=new WeakMap,wa=new WeakMap,Oi=new WeakMap,xi=new WeakMap,Sa=new WeakMap,Ri=new WeakMap,ms=new WeakMap,au=new WeakMap,zn=new WeakMap,iu=new WeakMap,Hs=new WeakMap,zr=new WeakMap,Wr=new WeakMap,Di=new WeakMap,Ia=new WeakMap,vt=new WeakSet,Nd=function(){if(this.is_fork)return!0;for(const r of V(this,ms).keys()){for(var e=r,n=!1;e.parent!==null;){if(V(this,Wr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},To=function(){var l,d,h,g;if(Ye(this,Li,!0),_0++>1e3&&(rt(this,vt,di).call(this),ZE()),!rt(this,vt,Nd).call(this)){for(const f of V(this,Hs))V(this,zr).delete(f),zt(f,pn),this.schedule(f);for(const f of V(this,zr))zt(f,ns),this.schedule(f)}const e=V(this,zn);Ye(this,zn,[]),this.apply();var n=Ei=[],r=[],s=ul=[];for(const f of e)try{rt(this,vt,wd).call(this,f,n,r)}catch(p){throw mm(f),p}if(Fe=null,s.length>0){var a=Yl.ensure();for(const f of s)a.schedule(f)}if(Ei=null,ul=null,rt(this,vt,Nd).call(this)){rt(this,vt,ll).call(this,r),rt(this,vt,ll).call(this,n);for(const[f,p]of V(this,Wr))pm(f,p);s.length>0&&rt(l=Fe,vt,To).call(l);return}const i=rt(this,vt,dm).call(this);if(i){rt(d=i,vt,fm).call(d,this);return}V(this,Hs).clear(),V(this,zr).clear();for(const f of V(this,Oi))f(this);V(this,Oi).clear(),Io=this,T0(r),T0(n),Io=null,(h=V(this,au))==null||h.resolve();var o=Fe;if(this.linked&&V(this,Ri)===0&&rt(this,vt,di).call(this),V(this,zn).length>0){o===null&&(o=this,rt(this,vt,Sd).call(this));const f=o;V(f,zn).push(...V(this,zn).filter(p=>!V(f,zn).includes(p)))}o!==null&&rt(g=o,vt,To).call(g)},wd=function(e,n,r){e.f^=an;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Dr|ta))!==0,o=i&&(a&an)!==0,l=o||(a&Pn)!==0||V(this,Wr).has(s);if(!l&&s.fn!==null){i?s.f^=an:(a&Fi)!==0?n.push(s):gu(s)&&((a&Cr)!==0&&V(this,zr).add(s),$i(s));var d=s.first;if(d!==null){s=d;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},dm=function(){for(var e=V(this,Us);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=V(e,Us)}return null},fm=function(e){var r;for(const[s,a]of e.current)!this.previous.has(s)&&e.previous.has(s)&&this.previous.set(s,e.previous.get(s)),this.current.set(s,a);for(const[s,a]of e.async_deriveds){const i=this.async_deriveds.get(s);i&&a.promise.then(i.resolve)}const n=s=>{var a=s.reactions;if(a!==null)for(const l of a){var i=l.f;if((i&Tn)!==0)n(l);else{var o=l;i&(Ai|Cr)&&!this.async_deriveds.has(o)&&(V(this,zr).delete(o),zt(o,pn),this.schedule(o))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),rt(r=e,vt,di).call(r),Fe=this,rt(this,vt,To).call(this)},ll=function(e){for(var n=0;n<e.length;n+=1)cm(e[n],V(this,Hs),V(this,zr))},XE=function(){var h;rt(this,vt,di).call(this);for(let g=Pc;g!==null;g=V(g,wa)){var e=g.id<this.id,n=[];for(const[f,[p,v]]of this.current){if(g.current.has(f)){var r=g.current.get(f)[0];if(e&&p!==r)g.current.set(f,[p,v]);else continue}n.push(f)}if(e)for(const[f,p]of this.async_deriveds){const v=g.async_deriveds.get(f);v&&p.promise.then(v.resolve)}if(V(g,Li)){var s=[...g.current.keys()].filter(f=>!this.current.has(f));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const f of V(this,Di))g.unskip_effect(f,p=>{var v;(p.f&(Cr|Ai))!==0?g.schedule(p):rt(v=g,vt,ll).call(v,[p])});g.activate();var a=new Set,i=new Map;for(var o of n)hm(o,s,a,i);i=new Map;var l=[...g.current.keys()].filter(f=>this.current.has(f)?this.current.get(f)[0]!==f.v:!0);if(l.length>0)for(const f of V(this,iu))(f.f&(vr|Pn|Al))===0&&ah(f,l,i)&&((f.f&(Ai|Cr))!==0?(zt(f,pn),g.schedule(f)):V(g,Hs).add(f));if(V(g,zn).length>0&&!V(g,Ia)){g.apply();for(var d of V(g,zn))rt(h=g,vt,wd).call(h,d,[],[]);Ye(g,zn,[])}g.deactivate()}}}},Sd=function(){li===null?Pc=li=this:(Ye(li,wa,this),Ye(this,Us,li)),li=this},di=function(){var e=V(this,Us),n=V(this,wa);e===null?Pc=n:Ye(e,wa,n),n===null?li=e:Ye(n,Us,e),this.linked=!1};let qa=Yl;function QE(t){var e=Co;Co=!0;try{for(var n;;){if(WE(),Fe===null)return n;Fe.flush()}}finally{Co=e}}function ZE(){try{bE()}catch(t){Ys(t,yd)}}let Ar=null;function T0(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(vr|Pn))===0&&gu(r)&&(Ar=new Set,$i(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Rm(r),(Ar==null?void 0:Ar.size)>0)){Ra.clear();for(const s of Ar){if((s.f&(vr|Pn))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)Ar.has(i)&&(Ar.delete(i),a.push(i)),i=i.parent;for(let o=a.length-1;o>=0;o--){const l=a[o];(l.f&(vr|Pn))===0&&$i(l)}}Ar.clear()}}Ar=null}}function hm(t,e,n,r){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const s of t.reactions){const a=s.f;(a&Tn)!==0?hm(s,e,n,r):(a&(Ai|Cr))!==0&&(a&pn)===0&&ah(s,e,r)&&(zt(s,pn),ih(s))}}function ah(t,e,n){const r=n.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const s of t.deps){if(xa.call(e,s))return!0;if((s.f&Tn)!==0&&ah(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function ih(t){Fe.schedule(t)}function pm(t,e){if(!((t.f&Dr)!==0&&(t.f&an)!==0)){(t.f&pn)!==0?e.d.push(t):(t.f&ns)!==0&&e.m.push(t),zt(t,an);for(var n=t.first;n!==null;)pm(n,e),n=n.next}}function mm(t){zt(t,an);for(var e=t.first;e!==null;)mm(e),e=e.next}function JE(t){let e=0,n=ja(0),r;return()=>{ch()&&(u(n),Zl(()=>(e===0&&(r=ra(()=>t(()=>Lo(n)))),e+=1,()=>{xr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,Lo(n))})})))}}var e_=As|eo;function t_(t,e,n,r){new n_(t,e,n,r)}var or,Zf,ur,Ca,Un,lr,Rn,Wn,gs,La,qs,ki,ou,uu,vs,zl,Wt,r_,s_,a_,Id,cl,dl,Cd,Ld;class n_{constructor(e,n,r,s){Ue(this,Wt);ye(this,"parent");ye(this,"is_pending",!1);ye(this,"transform_error");Ue(this,or);Ue(this,Zf,null);Ue(this,ur);Ue(this,Ca);Ue(this,Un);Ue(this,lr,null);Ue(this,Rn,null);Ue(this,Wn,null);Ue(this,gs,null);Ue(this,La,0);Ue(this,qs,0);Ue(this,ki,!1);Ue(this,ou,new Set);Ue(this,uu,new Set);Ue(this,vs,null);Ue(this,zl,JE(()=>(Ye(this,vs,ja(V(this,La))),()=>{Ye(this,vs,null)})));var a;Ye(this,or,e),Ye(this,ur,n),Ye(this,Ca,i=>{var o=Ze;o.b=this,o.f|=Ed,r(i)}),this.parent=Ze.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),Ye(this,Un,Qa(()=>{rt(this,Wt,Id).call(this)},e_))}defer_effect(e){cm(e,V(this,ou),V(this,uu))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!V(this,ur).pending}update_pending_count(e,n){rt(this,Wt,Cd).call(this,e,n),Ye(this,La,V(this,La)+e),!(!V(this,vs)||V(this,ki))&&(Ye(this,ki,!0),xr(()=>{Ye(this,ki,!1),V(this,vs)&&qi(V(this,vs),V(this,La))}))}get_effect_pending(){return V(this,zl).call(this),u(V(this,vs))}error(e){if(!V(this,ur).onerror&&!V(this,ur).failed)throw e;Fe!=null&&Fe.is_fork?(V(this,lr)&&Fe.skip_effect(V(this,lr)),V(this,Rn)&&Fe.skip_effect(V(this,Rn)),V(this,Wn)&&Fe.skip_effect(V(this,Wn)),Fe.on_fork_commit(()=>{rt(this,Wt,Ld).call(this,e)})):rt(this,Wt,Ld).call(this,e)}}or=new WeakMap,Zf=new WeakMap,ur=new WeakMap,Ca=new WeakMap,Un=new WeakMap,lr=new WeakMap,Rn=new WeakMap,Wn=new WeakMap,gs=new WeakMap,La=new WeakMap,qs=new WeakMap,ki=new WeakMap,ou=new WeakMap,uu=new WeakMap,vs=new WeakMap,zl=new WeakMap,Wt=new WeakSet,r_=function(){try{Ye(this,lr,qn(()=>V(this,Ca).call(this,V(this,or))))}catch(e){this.error(e)}},s_=function(e){const n=V(this,ur).failed;n&&Ye(this,Wn,qn(()=>{n(V(this,or),()=>e,()=>()=>{})}))},a_=function(){const e=V(this,ur).pending;e&&(this.is_pending=!0,Ye(this,Rn,qn(()=>e(V(this,or)))),xr(()=>{var n=Ye(this,gs,document.createDocumentFragment()),r=Zr();n.append(r),Ye(this,lr,rt(this,Wt,dl).call(this,()=>qn(()=>V(this,Ca).call(this,r)))),V(this,qs)===0&&(V(this,or).before(n),Ye(this,gs,null),Da(V(this,Rn),()=>{Ye(this,Rn,null)}),rt(this,Wt,cl).call(this,Fe))}))},Id=function(){try{if(this.is_pending=this.has_pending_snippet(),Ye(this,qs,0),Ye(this,La,0),Ye(this,lr,qn(()=>{V(this,Ca).call(this,V(this,or))})),V(this,qs)>0){var e=Ye(this,gs,document.createDocumentFragment());hh(V(this,lr),e);const n=V(this,ur).pending;Ye(this,Rn,qn(()=>n(V(this,or))))}else rt(this,Wt,cl).call(this,Fe)}catch(n){this.error(n)}},cl=function(e){this.is_pending=!1,e.transfer_effects(V(this,ou),V(this,uu))},dl=function(e){var n=Ze,r=et,s=Ct;rs(V(this,Un)),Er(V(this,Un)),Ui(V(this,Un).ctx);try{return qa.ensure(),e()}catch(a){return um(a),null}finally{rs(n),Er(r),Ui(s)}},Cd=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&rt(r=this.parent,Wt,Cd).call(r,e,n);return}Ye(this,qs,V(this,qs)+e),V(this,qs)===0&&(rt(this,Wt,cl).call(this,n),V(this,Rn)&&Da(V(this,Rn),()=>{Ye(this,Rn,null)}),V(this,gs)&&(V(this,or).before(V(this,gs)),Ye(this,gs,null)))},Ld=function(e){V(this,lr)&&(En(V(this,lr)),Ye(this,lr,null)),V(this,Rn)&&(En(V(this,Rn)),Ye(this,Rn,null)),V(this,Wn)&&(En(V(this,Wn)),Ye(this,Wn,null));var n=V(this,ur).onerror;let r=V(this,ur).failed;var s=!1,a=!1;const i=()=>{if(s){UE();return}s=!0,a&&yE(),V(this,Wn)!==null&&Da(V(this,Wn),()=>{Ye(this,Wn,null)}),rt(this,Wt,dl).call(this,()=>{rt(this,Wt,Id).call(this)})},o=l=>{try{a=!0,n==null||n(l,i),a=!1}catch(d){Ys(d,V(this,Un)&&V(this,Un).parent)}r&&Ye(this,Wn,rt(this,Wt,dl).call(this,()=>{try{return qn(()=>{var d=Ze;d.b=this,d.f|=Ed,r(V(this,or),()=>l,()=>i)})}catch(d){return Ys(d,V(this,Un).parent),null}}))};xr(()=>{var l;try{l=this.transform_error(e)}catch(d){Ys(d,V(this,Un)&&V(this,Un).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,d=>Ys(d,V(this,Un)&&V(this,Un).parent)):o(l)})};function gm(t,e,n,r){const s=no()?Hi:oh;var a=t.filter(f=>!f.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Ze,o=i_(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(f=>f.promise)):null;function d(f){if((i.f&vr)===0){o();try{r(f)}catch(p){Ys(p,i)}Nl()}}var h=vm();if(n.length===0){l.then(()=>d(e.map(s))).finally(h);return}function g(){Promise.all(n.map(f=>o_(f))).then(f=>d([...e.map(s),...f])).catch(f=>Ys(f,i)).finally(h)}l?l.then(()=>{o(),g(),Nl()}):g()}function i_(){var t=Ze,e=et,n=Ct,r=Fe;return function(a=!0){rs(t),Er(e),Ui(n),a&&(t.f&vr)===0&&(r==null||r.activate(),r==null||r.apply())}}function Nl(t=!0){rs(null),Er(null),Ui(null),t&&(Fe==null||Fe.deactivate())}function vm(){var t=Ze,e=t.b,n=Fe,r=e.is_rendered();return e.update_pending_count(1,n),n.increment(r,t),()=>{e.update_pending_count(-1,n),n.decrement(r,t)}}function Hi(t){var e=Tn|pn;return Ze!==null&&(Ze.f|=eo),{ctx:Ct,deps:null,effects:null,equals:am,f:e,fn:t,reactions:null,rv:0,v:Zt,wv:0,parent:Ze,ac:null}}const Mu=Symbol("obsolete");function o_(t,e,n){let r=Ze;r===null&&hE();var s=void 0,a=ja(Zt),i=!et,o=new Set;return b_(()=>{var p;var l=Ze,d=J1();s=d.promise;try{Promise.resolve(t()).then(d.resolve,v=>{v!==Xl&&d.reject(v)}).finally(Nl)}catch(v){d.reject(v),Nl()}var h=Fe;if(i){if((l.f&Xa)!==0)var g=vm();if(r.b.is_rendered())(p=h.async_deriveds.get(l))==null||p.reject(Mu);else for(const v of o.values())v.reject(Mu);o.add(d),h.async_deriveds.set(l,d)}const f=(v,b=void 0)=>{g==null||g(),o.delete(d),b!==Mu&&(h.activate(),b?(a.f|=Qs,qi(a,b)):((a.f&Qs)!==0&&(a.f^=Qs),qi(a,v)),h.deactivate())};d.promise.then(f,v=>f(null,v||"unknown"))}),mu(()=>{for(const l of o)l.reject(Mu)}),new Promise(l=>{function d(h){function g(){h===s?l(a):d(s)}h.then(g,g)}d(s)})}function _e(t){const e=Hi(t);return Pm(e),e}function oh(t){const e=Hi(t);return e.equals=im,e}function u_(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)En(e[n])}}function uh(t){var e,n=Ze,r=t.parent;if(!ys&&r!==null&&t.v!==Zt&&(r.f&(vr|Pn))!==0)return BE(),t.v;rs(r);try{t.f&=~Ha,u_(t),e=Um(t)}finally{rs(n)}return e}function bm(t){var e=uh(t);if(!t.equals(e)&&(t.wv=Bm(),(!(Fe!=null&&Fe.is_fork)||t.deps===null)&&(Fe!==null?(Fe.capture(t,e,!0),Io==null||Io.capture(t,e,!0)):t.v=e,t.deps===null))){zt(t,an);return}ys||(bn!==null?(ch()||Fe!=null&&Fe.is_fork)&&bn.set(t,e):sh(t))}function l_(t){var e,n;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(n=r.ac)==null||n.abort(Xl),r.fn!==null&&(r.teardown=th),r.ac=null,Yo(r,0),dh(r))}function Em(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&$i(e)}let wl=new Set;const Ra=new Map;let _m=!1;function ja(t,e){var n={f:0,v:t,reactions:null,equals:am,rv:0,wv:0};return n}function Q(t,e){const n=ja(t);return Pm(n),n}function c_(t,e=!1,n=!0){var s;const r=ja(t);return e||(r.equals=im),to&&n&&Ct!==null&&Ct.l!==null&&((s=Ct.l).s??(s.s=[])).push(r),r}function T(t,e,n=!1){et!==null&&(!Lr||(et.f&Al)!==0)&&no()&&(et.f&(Tn|Cr|Ai|Al))!==0&&(br===null||!xa.call(br,t))&&AE();let r=n?ct(e):e;return qi(t,r,ul)}function qi(t,e,n=null){if(!t.equals(e)){Ra.set(t,ys?e:t.v);var r=qa.ensure();if(r.capture(t,e),(t.f&Tn)!==0){const s=t;(t.f&pn)!==0&&uh(s),bn===null&&sh(s)}t.wv=Bm(),Tm(t,pn,n),no()&&Ze!==null&&(Ze.f&an)!==0&&(Ze.f&(Dr|ta))===0&&(ir===null?T_([t]):ir.push(t)),!r.is_fork&&wl.size>0&&!_m&&d_()}return e}function d_(){_m=!1;for(const t of wl){(t.f&an)!==0&&zt(t,ns);let e;try{e=gu(t)}catch{e=!0}e&&$i(t)}wl.clear()}function Lo(t){T(t,t.v+1)}function Tm(t,e,n){var r=t.reactions;if(r!==null)for(var s=no(),a=r.length,i=0;i<a;i++){var o=r[i],l=o.f;if(!(!s&&o===Ze)){var d=(l&pn)===0;if(d&&zt(o,e),(l&Al)!==0)wl.add(o);else if((l&Tn)!==0){var h=o;bn==null||bn.delete(h),(l&Ha)===0&&(l&gr&&(Ze===null||(Ze.f&yl)===0)&&(o.f|=Ha),Tm(h,ns,n))}else if(d){var g=o;(l&Cr)!==0&&Ar!==null&&Ar.add(g),n!==null?n.push(g):ih(g)}}}}function ct(t){if(typeof t!="object"||t===null||Qr in t)return t;const e=eh(t);if(e!==oE&&e!==uE)return t;var n=new Map,r=Jf(t),s=Q(0),a=ka,i=o=>{if(ka===a)return o();var l=et,d=ka;Er(null),S0(a);var h=o();return Er(l),S0(d),h};return r&&n.set("length",Q(t.length)),new Proxy(t,{defineProperty(o,l,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&_E();var h=n.get(l);return h===void 0?i(()=>{var g=Q(d.value);return n.set(l,g),g}):T(h,d.value,!0),!0},deleteProperty(o,l){var d=n.get(l);if(d===void 0){if(l in o){const h=i(()=>Q(Zt));n.set(l,h),Lo(s)}}else T(d,Zt),Lo(s);return!0},get(o,l,d){var p;if(l===Qr)return t;var h=n.get(l),g=l in o;if(h===void 0&&(!g||(p=Xs(o,l))!=null&&p.writable)&&(h=i(()=>{var v=ct(g?o[l]:Zt),b=Q(v);return b}),n.set(l,h)),h!==void 0){var f=u(h);return f===Zt?void 0:f}return Reflect.get(o,l,d)},getOwnPropertyDescriptor(o,l){var d=Reflect.getOwnPropertyDescriptor(o,l);if(d&&"value"in d){var h=n.get(l);h&&(d.value=u(h))}else if(d===void 0){var g=n.get(l),f=g==null?void 0:g.v;if(g!==void 0&&f!==Zt)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return d},has(o,l){var f;if(l===Qr)return!0;var d=n.get(l),h=d!==void 0&&d.v!==Zt||Reflect.has(o,l);if(d!==void 0||Ze!==null&&(!h||(f=Xs(o,l))!=null&&f.writable)){d===void 0&&(d=i(()=>{var p=h?ct(o[l]):Zt,v=Q(p);return v}),n.set(l,d));var g=u(d);if(g===Zt)return!1}return h},set(o,l,d,h){var O;var g=n.get(l),f=l in o;if(r&&l==="length")for(var p=d;p<g.v;p+=1){var v=n.get(p+"");v!==void 0?T(v,Zt):p in o&&(v=i(()=>Q(Zt)),n.set(p+"",v))}if(g===void 0)(!f||(O=Xs(o,l))!=null&&O.writable)&&(g=i(()=>Q(void 0)),T(g,ct(d)),n.set(l,g));else{f=g.v!==Zt;var b=i(()=>ct(d));T(g,b)}var E=Reflect.getOwnPropertyDescriptor(o,l);if(E!=null&&E.set&&E.set.call(h,d),!f){if(r&&typeof l=="string"){var _=n.get("length"),R=Number(l);Number.isInteger(R)&&R>=_.v&&T(_,R+1)}Lo(s)}return!0},ownKeys(o){u(s);var l=Reflect.ownKeys(o).filter(g=>{var f=n.get(g);return f===void 0||f.v!==Zt});for(var[d,h]of n)h.v!==Zt&&!(d in o)&&l.push(d);return l},setPrototypeOf(){TE()}})}function A0(t){try{if(t!==null&&typeof t=="object"&&Qr in t)return t[Qr]}catch{}return t}function Am(t,e){return Object.is(A0(t),A0(e))}var y0,ym,Nm,wm;function f_(){if(y0===void 0){y0=window,ym=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Nm=Xs(e,"firstChild").get,wm=Xs(e,"nextSibling").get,E0(t)&&(t[Td]=void 0,t[il]=null,t[Ad]=void 0,t.__e=void 0),E0(n)&&(n[_o]=void 0)}}function Zr(t=""){return document.createTextNode(t)}function ji(t){return Nm.call(t)}function pu(t){return wm.call(t)}function y(t,e){return ji(t)}function tt(t,e=!1){{var n=ji(t);return n instanceof Comment&&n.data===""?pu(n):n}}function C(t,e=1,n=!1){let r=t;for(;e--;)r=pu(r);return r}function h_(t){t.textContent=""}function Sm(){return!1}function Im(t,e,n){return document.createElementNS(e??sm,t,void 0)}function $a(t,e){if(e){const n=document.body;t.autofocus=!0,xr(()=>{document.activeElement===n&&t.focus()})}}let N0=!1;function p_(){N0||(N0=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[ol])==null||e.call(n)})},{capture:!0}))}function Ql(t){var e=et,n=Ze;Er(null),rs(null);try{return t()}finally{Er(e),rs(n)}}function lh(t,e,n,r=n){t.addEventListener(e,()=>Ql(n));const s=t[ol];s?t[ol]=()=>{s(),r(!0)}:t[ol]=()=>r(!0),p_()}function Cm(t){Ze===null&&(et===null&&vE(),gE()),ys&&mE()}function m_(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Pr(t,e){var n=Ze;n!==null&&(n.f&Pn)!==0&&(t|=Pn);var r={ctx:Ct,deps:null,nodes:null,f:t|pn|gr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Fe==null||Fe.register_created_effect(r);var s=r;if((t&Fi)!==0)Ei!==null?Ei.push(r):qa.ensure().schedule(r);else if(e!==null){try{$i(r)}catch(i){throw En(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&eo)===0&&(s=s.first,(t&Cr)!==0&&(t&As)!==0&&s!==null&&(s.f|=As))}if(s!==null&&(s.parent=n,n!==null&&m_(s,n),et!==null&&(et.f&Tn)!==0&&(t&ta)===0)){var a=et;(a.effects??(a.effects=[])).push(s)}return r}function ch(){return et!==null&&!Lr}function mu(t){const e=Pr(hu,null);return zt(e,an),e.teardown=t,e}function Rt(t){Cm();var e=Ze.f,n=!et&&(e&Dr)!==0&&(e&Xa)===0;if(n){var r=Ct;(r.e??(r.e=[])).push(t)}else return Lm(t)}function Lm(t){return Pr(Fi|em,t)}function g_(t){return Cm(),Pr(hu|em,t)}function v_(t){qa.ensure();const e=Pr(ta|eo,t);return(n={})=>new Promise(r=>{n.outro?Da(e,()=>{En(e),r(void 0)}):(En(e),r(void 0))})}function ro(t){return Pr(Fi,t)}function b_(t){return Pr(Ai|eo,t)}function Zl(t,e=0){return Pr(hu|e,t)}function re(t,e=[],n=[],r=[]){gm(r,e,n,s=>{Pr(hu,()=>t(...s.map(u)))})}function Qa(t,e=0){var n=Pr(Cr|e,t);return n}function Om(t,e=0){var n=Pr(nh|e,t);return n}function qn(t){return Pr(Dr|eo,t)}function xm(t){var e=t.teardown;if(e!==null){const n=ys,r=et;w0(!0),Er(null);try{e.call(null)}finally{w0(n),Er(r)}}}function dh(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Ql(()=>{s.abort(Xl)});var r=n.next;(n.f&ta)!==0?n.parent=null:En(n,e),n=r}}function E_(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Dr)===0&&En(e),e=n}}function En(t,e=!0){var n=!1;(e||(t.f&dE)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(__(t.nodes.start,t.nodes.end),n=!0),zt(t,_d),dh(t,e&&!n),Yo(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();xm(t),t.f^=_d,t.f|=vr;var s=t.parent;s!==null&&s.first!==null&&Rm(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function __(t,e){for(;t!==null;){var n=t===e?null:pu(t);t.remove(),t=n}}function Rm(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Da(t,e,n=!0){var r=[];Dm(t,r,!0);var s=()=>{n&&En(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var o of r)o.out(i)}else s()}function Dm(t,e,n){if((t.f&Pn)===0){t.f^=Pn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var a=s.next;if((s.f&ta)===0){var i=(s.f&As)!==0||(s.f&Dr)!==0&&(t.f&Cr)!==0;Dm(s,e,i?n:!1)}s=a}}}function fh(t){km(t,!0)}function km(t,e){if((t.f&Pn)!==0){t.f^=Pn,(t.f&an)===0&&(zt(t,pn),qa.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&As)!==0||(n.f&Dr)!==0;km(n,s?e:!1),n=r}var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)(i.is_global||e)&&i.in()}}function hh(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:pu(n);e.append(n),n=s}}let fl=!1,ys=!1;function w0(t){ys=t}let et=null,Lr=!1;function Er(t){et=t}let Ze=null;function rs(t){Ze=t}let br=null;function Pm(t){et!==null&&(br===null?br=[t]:br.push(t))}let Hn=null,Yn=0,ir=null;function T_(t){ir=t}let Mm=1,Aa=0,ka=Aa;function S0(t){ka=t}function Bm(){return++Mm}function gu(t){var e=t.f;if((e&pn)!==0)return!0;if(e&Tn&&(t.f&=~Ha),(e&ns)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(gu(a)&&bm(a),a.wv>t.wv)return!0}(e&gr)!==0&&bn===null&&zt(t,an)}return!1}function Fm(t,e,n=!0){var r=t.reactions;if(r!==null&&!(br!==null&&xa.call(br,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&Tn)!==0?Fm(a,e,!1):e===a&&(n?zt(a,pn):(a.f&an)!==0&&zt(a,ns),ih(a))}}function Um(t){var b;var e=Hn,n=Yn,r=ir,s=et,a=br,i=Ct,o=Lr,l=ka,d=t.f;Hn=null,Yn=0,ir=null,et=(d&(Dr|ta))===0?t:null,br=null,Ui(t.ctx),Lr=!1,ka=++Aa,t.ac!==null&&(Ql(()=>{t.ac.abort(Xl)}),t.ac=null);try{t.f|=yl;var h=t.fn,g=h();t.f|=Xa;var f=t.deps,p=Fe==null?void 0:Fe.is_fork;if(Hn!==null){var v;if(p||Yo(t,Yn),f!==null&&Yn>0)for(f.length=Yn+Hn.length,v=0;v<Hn.length;v++)f[Yn+v]=Hn[v];else t.deps=f=Hn;if(ch()&&(t.f&gr)!==0)for(v=Yn;v<f.length;v++)((b=f[v]).reactions??(b.reactions=[])).push(t)}else!p&&f!==null&&Yn<f.length&&(Yo(t,Yn),f.length=Yn);if(no()&&ir!==null&&!Lr&&f!==null&&(t.f&(Tn|ns|pn))===0)for(v=0;v<ir.length;v++)Fm(ir[v],t);if(s!==null&&s!==t){if(Aa++,s.deps!==null)for(let E=0;E<n;E+=1)s.deps[E].rv=Aa;if(e!==null)for(const E of e)E.rv=Aa;ir!==null&&(r===null?r=ir:r.push(...ir))}return(t.f&Qs)!==0&&(t.f^=Qs),g}catch(E){return um(E)}finally{t.f^=yl,Hn=e,Yn=n,ir=r,et=s,br=a,Ui(i),Lr=o,ka=l}}function A_(t,e){let n=e.reactions;if(n!==null){var r=aE.call(n,t);if(r!==-1){var s=n.length-1;s===0?n=e.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(e.f&Tn)!==0&&(Hn===null||!xa.call(Hn,e))){var a=e;(a.f&gr)!==0&&(a.f^=gr,a.f&=~Ha),a.v!==Zt&&sh(a),l_(a),Yo(a,0)}}function Yo(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)A_(t,n[r])}function $i(t){var e=t.f;if((e&vr)===0){zt(t,an);var n=Ze,r=fl;Ze=t,fl=!0;try{(e&(Cr|nh))!==0?E_(t):dh(t),xm(t);var s=Um(t);t.teardown=typeof s=="function"?s:null,t.wv=Mm;var a;Q1&&qE&&(t.f&pn)!==0&&t.deps}finally{fl=r,Ze=n}}}async function Hm(){await Promise.resolve(),QE()}function u(t){var e=t.f,n=(e&Tn)!==0;if(et!==null&&!Lr){var r=Ze!==null&&(Ze.f&vr)!==0;if(!r&&(br===null||!xa.call(br,t))){var s=et.deps;if((et.f&yl)!==0)t.rv<Aa&&(t.rv=Aa,Hn===null&&s!==null&&s[Yn]===t?Yn++:Hn===null?Hn=[t]:Hn.push(t));else{et.deps??(et.deps=[]),xa.call(et.deps,t)||et.deps.push(t);var a=t.reactions;a===null?t.reactions=[et]:xa.call(a,et)||a.push(et)}}}if(ys&&Ra.has(t))return Ra.get(t);if(n){var i=t;if(ys){var o=i.v;return((i.f&an)===0&&i.reactions!==null||jm(i))&&(o=uh(i)),Ra.set(i,o),o}var l=(i.f&gr)===0&&!Lr&&et!==null&&(fl||(et.f&gr)!==0),d=(i.f&Xa)===0;gu(i)&&(l&&(i.f|=gr),bm(i)),l&&!d&&(Em(i),qm(i))}if(bn!=null&&bn.has(t))return bn.get(t);if((t.f&Qs)!==0)throw t.v;return t.v}function qm(t){if(t.f|=gr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&Tn)!==0&&(e.f&gr)===0&&(Em(e),qm(e))}function jm(t){if(t.v===Zt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Ra.has(e)||(e.f&Tn)!==0&&jm(e))return!0;return!1}function ra(t){var e=Lr;try{return Lr=!0,t()}finally{Lr=e}}function y_(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Qr in t)Od(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Qr in n&&Od(n)}}}function Od(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{Od(t[r],e)}catch{}const n=eh(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Z1(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function N_(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const w_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function S_(t){return w_.includes(t)}const I_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function C_(t){return t=t.toLowerCase(),I_[t]??t}const L_=["touchstart","touchmove"];function O_(t){return L_.includes(t)}const ya=Symbol("events"),$m=new Set,xd=new Set;function Ym(t,e,n,r={}){function s(a){if(r.capture||Rd.call(e,a),!a.cancelBubble)return Ql(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?xr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function He(t,e,n,r,s){var a={capture:r,passive:s},i=Ym(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&mu(()=>{e.removeEventListener(t,i,a)})}function ie(t,e,n){(e[ya]??(e[ya]={}))[t]=n}function Tt(t){for(var e=0;e<t.length;e++)$m.add(t[e]);for(var n of xd)n(t)}let I0=null;function Rd(t){var E,_;var e=this,n=e.ownerDocument,r=t.type,s=((E=t.composedPath)==null?void 0:E.call(t))||[],a=s[0]||t.target;I0=t;var i=0,o=I0===t&&t[ya];if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t[ya]=e;return}var d=s.indexOf(e);if(d===-1)return;l<=d&&(i=l)}if(a=s[i]||t.target,a!==e){iE(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=et,g=Ze;Er(null),rs(null);try{for(var f,p=[];a!==null;){var v=a.assignedSlot||a.parentNode||a.host||null;try{var b=(_=a[ya])==null?void 0:_[r];b!=null&&(!a.disabled||t.target===a)&&b.call(a,t)}catch(R){f?p.push(R):f=R}if(t.cancelBubble||v===e||v===null)break;a=v}if(f){for(let R of p)queueMicrotask(()=>{throw R});throw f}}finally{t[ya]=e,delete t.currentTarget,Er(h),rs(g)}}}var V1;const Bc=((V1=globalThis==null?void 0:globalThis.window)==null?void 0:V1.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function x_(t){return(Bc==null?void 0:Bc.createHTML(t))??t}function zm(t){var e=Im("template");return e.innerHTML=x_(t.replaceAll("<!>","<!---->")),e.content}function Yi(t,e){var n=Ze;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function z(t,e){var n=(e&DE)!==0,r=(e&kE)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=zm(a?t:"<!>"+t),n||(s=ji(s)));var i=r||ym?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=ji(i),l=i.lastChild;Yi(o,l)}else Yi(i,i);return i}}function R_(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=zm(s),o=ji(i);a=ji(o)}var l=a.cloneNode(!0);return Yi(l,l),l}}function D_(t,e){return R_(t,e,"svg")}function Sl(t=""){{var e=Zr(t+"");return Yi(e,e),e}}function Kn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Zr();return t.append(e,n),Yi(e,n),t}function F(t,e){t!==null&&t.before(e)}function ae(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[_o]??(t[_o]=t.nodeValue))&&(t[_o]=n,t.nodeValue=`${n}`)}function k_(t,e){return P_(t,e)}const Bu=new Map;function P_(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:o}){f_();var l=void 0,d=v_(()=>{var h=n??e.appendChild(Zr());t_(h,{pending:()=>{}},p=>{at({});var v=Ct;a&&(v.c=a),s&&(r.$$events=s),l=t(p,r)||{},it()},o);var g=new Set,f=p=>{for(var v=0;v<p.length;v++){var b=p[v];if(!g.has(b)){g.add(b);var E=O_(b);for(const O of[e,document]){var _=Bu.get(O);_===void 0&&(_=new Map,Bu.set(O,_));var R=_.get(b);R===void 0?(O.addEventListener(b,Rd,{passive:E}),_.set(b,1)):_.set(b,R+1)}}}};return f(Vl($m)),xd.add(f),()=>{var E;for(var p of g)for(const _ of[e,document]){var v=Bu.get(_),b=v.get(p);--b==0?(_.removeEventListener(p,Rd),v.delete(p),v.size===0&&Bu.delete(_)):v.set(p,b)}xd.delete(f),h!==n&&((E=h.parentNode)==null||E.removeChild(h))}});return M_.set(l,d),l}let M_=new WeakMap;var Nr,Gr,Gn,Oa,lu,cu,Wl;class vu{constructor(e,n=!0){ye(this,"anchor");Ue(this,Nr,new Map);Ue(this,Gr,new Map);Ue(this,Gn,new Map);Ue(this,Oa,new Set);Ue(this,lu,!0);Ue(this,cu,e=>{if(V(this,Nr).has(e)){var n=V(this,Nr).get(e),r=V(this,Gr).get(n);if(r)fh(r),V(this,Oa).delete(n);else{var s=V(this,Gn).get(n);s&&(V(this,Gr).set(n,s.effect),V(this,Gn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of V(this,Nr)){if(V(this,Nr).delete(a),a===e)break;const o=V(this,Gn).get(i);o&&(En(o.effect),V(this,Gn).delete(i))}for(const[a,i]of V(this,Gr)){if(a===n||V(this,Oa).has(a))continue;const o=()=>{if(Array.from(V(this,Nr).values()).includes(a)){var d=document.createDocumentFragment();hh(i,d),d.append(Zr()),V(this,Gn).set(a,{effect:i,fragment:d})}else En(i);V(this,Oa).delete(a),V(this,Gr).delete(a)};V(this,lu)||!r?(V(this,Oa).add(a),Da(i,o,!1)):o()}}});Ue(this,Wl,e=>{V(this,Nr).delete(e);const n=Array.from(V(this,Nr).values());for(const[r,s]of V(this,Gn))n.includes(r)||(En(s.effect),V(this,Gn).delete(r))});this.anchor=e,Ye(this,lu,n)}ensure(e,n){var r=Fe,s=Sm();if(n&&!V(this,Gr).has(e)&&!V(this,Gn).has(e))if(s){var a=document.createDocumentFragment(),i=Zr();a.append(i),V(this,Gn).set(e,{effect:qn(()=>n(i)),fragment:a})}else V(this,Gr).set(e,qn(()=>n(this.anchor)));if(V(this,Nr).set(r,e),s){for(const[o,l]of V(this,Gr))o===e?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of V(this,Gn))o===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(V(this,cu)),r.ondiscard(V(this,Wl))}else V(this,cu).call(this,r)}}Nr=new WeakMap,Gr=new WeakMap,Gn=new WeakMap,Oa=new WeakMap,lu=new WeakMap,cu=new WeakMap,Wl=new WeakMap;function ce(t,e,n=!1){var r=new vu(t),s=n?As:0;function a(i,o){r.ensure(i,o)}Qa(()=>{var i=!1;e((o,l=0)=>{i=!0,a(l,o)}),i||a(-1,null)},s)}const B_=Symbol("NaN");function F_(t,e,n){var r=new vu(t),s=!no();Qa(()=>{var a=e();a!==a&&(a=B_),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function zo(t,e){return e}function U_(t,e,n){for(var r=[],s=e.length,a,i=e.length,o=0;o<s;o++){let g=e[o];Da(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var f=t.outrogroups;Dd(t,Vl(a.done)),f.delete(a),f.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var l=r.length===0&&n!==null;if(l){var d=n,h=d.parentNode;h_(h),h.append(d),t.items.clear()}Dd(t,e,!l)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function Dd(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const o of i)r.add(t.items.get(o).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Vr;const i=document.createDocumentFragment();hh(a,i)}else En(e[s],n)}}var C0;function St(t,e,n,r,s,a=null){var i=t,o=new Map,l=(e&rm)!==0;if(l){var d=t;i=d.appendChild(Zr())}var h=null,g=oh(()=>{var O=n();return Jf(O)?O:O==null?[]:Vl(O)}),f,p=new Map,v=!0;function b(O){(R.effect.f&vr)===0&&(R.pending.delete(O),R.fallback=h,H_(R,f,i,e,r),h!==null&&(f.length===0?(h.f&Vr)===0?fh(h):(h.f^=Vr,Ao(h,null,i)):Da(h,()=>{h=null})))}function E(O){R.pending.delete(O)}var _=Qa(()=>{f=u(g);for(var O=f.length,B=new Set,M=Fe,J=Sm(),H=0;H<O;H+=1){var G=f[H],X=r(G,H),ee=v?null:o.get(X);ee?(ee.v&&qi(ee.v,G),ee.i&&qi(ee.i,H),J&&M.unskip_effect(ee.e)):(ee=q_(o,v?i:C0??(C0=Zr()),G,X,H,s,e,n),v||(ee.e.f|=Vr),o.set(X,ee)),B.add(X)}if(O===0&&a&&!h&&(v?h=qn(()=>a(i)):(h=qn(()=>a(C0??(C0=Zr()))),h.f|=Vr)),O>B.size&&pE(),!v)if(p.set(M,B),J){for(const[A,j]of o)B.has(A)||M.skip_effect(j.e);M.oncommit(b),M.ondiscard(E)}else b(M);u(g)}),R={effect:_,items:o,pending:p,outrogroups:null,fallback:h};v=!1}function fo(t){for(;t!==null&&(t.f&Dr)===0;)t=t.next;return t}function H_(t,e,n,r,s){var ee,A,j,w,S,x,k,W,$;var a=(r&SE)!==0,i=e.length,o=t.items,l=fo(t.effect.first),d,h=null,g,f=[],p=[],v,b,E,_;if(a)for(_=0;_<i;_+=1)v=e[_],b=s(v,_),E=o.get(b).e,(E.f&Vr)===0&&((A=(ee=E.nodes)==null?void 0:ee.a)==null||A.measure(),(g??(g=new Set)).add(E));for(_=0;_<i;_+=1){if(v=e[_],b=s(v,_),E=o.get(b).e,t.outrogroups!==null)for(const Y of t.outrogroups)Y.pending.delete(E),Y.done.delete(E);if((E.f&Pn)!==0&&(fh(E),a&&((w=(j=E.nodes)==null?void 0:j.a)==null||w.unfix(),(g??(g=new Set)).delete(E))),(E.f&Vr)!==0)if(E.f^=Vr,E===l)Ao(E,null,n);else{var R=h?h.next:l;E===t.effect.last&&(t.effect.last=E.prev),E.prev&&(E.prev.next=E.next),E.next&&(E.next.prev=E.prev),ks(t,h,E),ks(t,E,R),Ao(E,R,n),h=E,f=[],p=[],l=fo(h.next);continue}if(E!==l){if(d!==void 0&&d.has(E)){if(f.length<p.length){var O=p[0],B;h=O.prev;var M=f[0],J=f[f.length-1];for(B=0;B<f.length;B+=1)Ao(f[B],O,n);for(B=0;B<p.length;B+=1)d.delete(p[B]);ks(t,M.prev,J.next),ks(t,h,M),ks(t,J,O),l=O,h=J,_-=1,f=[],p=[]}else d.delete(E),Ao(E,l,n),ks(t,E.prev,E.next),ks(t,E,h===null?t.effect.first:h.next),ks(t,h,E),h=E;continue}for(f=[],p=[];l!==null&&l!==E;)(d??(d=new Set)).add(l),p.push(l),l=fo(l.next);if(l===null)continue}(E.f&Vr)===0&&f.push(E),h=E,l=fo(E.next)}if(t.outrogroups!==null){for(const Y of t.outrogroups)Y.pending.size===0&&(Dd(t,Vl(Y.done)),(S=t.outrogroups)==null||S.delete(Y));t.outrogroups.size===0&&(t.outrogroups=null)}if(l!==null||d!==void 0){var H=[];if(d!==void 0)for(E of d)(E.f&Pn)===0&&H.push(E);for(;l!==null;)(l.f&Pn)===0&&l!==t.fallback&&H.push(l),l=fo(l.next);var G=H.length;if(G>0){var X=(r&rm)!==0&&i===0?n:null;if(a){for(_=0;_<G;_+=1)(k=(x=H[_].nodes)==null?void 0:x.a)==null||k.measure();for(_=0;_<G;_+=1)($=(W=H[_].nodes)==null?void 0:W.a)==null||$.fix()}U_(t,H,X)}}a&&xr(()=>{var Y,U;if(g!==void 0)for(E of g)(U=(Y=E.nodes)==null?void 0:Y.a)==null||U.apply()})}function q_(t,e,n,r,s,a,i,o){var l=(i&NE)!==0?(i&IE)===0?c_(n,!1,!1):ja(n):null,d=(i&wE)!==0?ja(s):null;return{v:l,i:d,e:qn(()=>(a(e,l??n,d??s,o),()=>{t.delete(r)}))}}function Ao(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Vr)===0?e.nodes.start:n;r!==null;){var i=pu(r);if(a.before(r),r===s)return;r=i}}function ks(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function j_(t,e,...n){var r=new vu(t);Qa(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},As)}function kd(t,e,n){var r=new vu(t);Qa(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},As)}function $_(t,e,n,r,s,a){var i=null,o=t,l=new vu(o,!1);Qa(()=>{const d=e()||null;var h=PE;if(d===null){l.ensure(null,null);return}return l.ensure(d,g=>{if(d){if(i=Im(d,h),Yi(i,i),r){var f=i.appendChild(Zr());r(i,f)}Ze.nodes.end=i,g.before(i)}}),()=>{}},As),mu(()=>{})}function Y_(t,e,n){ro(()=>{var r=ra(()=>e(t,n==null?void 0:n())||{});if(r!=null&&r.destroy)return()=>r.destroy()})}function z_(t,e){var n=void 0,r;Om(()=>{n!==(n=e())&&(r&&(En(r),r=null),n&&(r=qn(()=>{ro(()=>n(t))})))})}function Wm(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=Wm(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function W_(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Wm(t))&&(r&&(r+=" "),r+=e);return r}function Gm(t){return typeof t=="object"?W_(t):t??""}const L0=[...`
3
- \r\f \v\uFEFF`];function G_(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,i=0;(i=r.indexOf(s,i))>=0;){var o=i+a;(i===0||L0.includes(r[i-1]))&&(o===r.length||L0.includes(r[o]))?r=(i===0?"":r.substring(0,i))+r.substring(o+1):i=o}}return r===""?null:r}function O0(t,e=!1){var n=e?" !important;":";",r="";for(var s of Object.keys(t)){var a=t[s];a!=null&&a!==""&&(r+=" "+s+": "+a+n)}return r}function Fc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function K_(t,e){if(e){var n="",r,s;if(Array.isArray(e)?(r=e[0],s=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(Fc)),s&&l.push(...Object.keys(s).map(Fc));var d=0,h=-1;const b=t.length;for(var g=0;g<b;g++){var f=t[g];if(o?f==="/"&&t[g-1]==="*"&&(o=!1):a?a===f&&(a=!1):f==="/"&&t[g+1]==="*"?o=!0:f==='"'||f==="'"?a=f:f==="("?i++:f===")"&&i--,!o&&a===!1&&i===0){if(f===":"&&h===-1)h=g;else if(f===";"||g===b-1){if(h!==-1){var p=Fc(t.substring(d,h).trim());if(!l.includes(p)){f!==";"&&g++;var v=t.substring(d,g).trim();n+=" "+v+";"}}d=g+1,h=-1}}}}return r&&(n+=O0(r)),s&&(n+=O0(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Ve(t,e,n,r,s,a){var i=t[Td];if(i!==n||i===void 0){var o=G_(n,r,a);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t[Td]=n}else if(a&&s!==a)for(var l in a){var d=!!a[l];(s==null||d!==!!s[l])&&t.classList.toggle(l,d)}return a}function Uc(t,e={},n,r){for(var s in n){var a=n[s];e[s]!==a&&(n[s]==null?t.style.removeProperty(s):t.style.setProperty(s,a,r))}}function Jl(t,e,n,r){var s=t[Ad];if(s!==e){var a=K_(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[Ad]=e}else r&&(Array.isArray(r)?(Uc(t,n==null?void 0:n[0],r[0]),Uc(t,n==null?void 0:n[1],r[1],"important")):Uc(t,n,r));return r}function Il(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Jf(e))return FE();for(var r of t.options)r.selected=e.includes(Oo(r));return}for(r of t.options){var s=Oo(r);if(Am(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Km(t){var e=new MutationObserver(()=>{Il(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),mu(()=>{e.disconnect()})}function Ya(t,e,n=e){var r=new WeakSet,s=!0;lh(t,"change",a=>{var i=a?"[selected]":":checked",o;if(t.multiple)o=[].map.call(t.querySelectorAll(i),Oo);else{var l=t.querySelector(i)??t.querySelector("option:not([disabled])");o=l&&Oo(l)}n(o),t.__value=o,Fe!==null&&r.add(Fe)}),ro(()=>{var a=e();if(t===document.activeElement){var i=Fe;if(r.has(i))return}if(Il(t,a,s),s&&a===void 0){var o=t.querySelector(":checked");o!==null&&(a=Oo(o),n(a))}t.__value=a,s=!1}),Km(t)}function Oo(t){return"__value"in t?t.__value:t.value}const ho=Symbol("class"),po=Symbol("style"),Vm=Symbol("is custom element"),Xm=Symbol("is html"),V_=rh?"option":"OPTION",X_=rh?"select":"SELECT",Q_=rh?"progress":"PROGRESS";function Z_(t,e){var n=ec(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Q_)||(t.value=e??"")}function J_(t,e){var n=ec(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function eT(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ee(t,e,n,r){var s=ec(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[fE]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Qm(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function tT(t,e,n,r,s=!1,a=!1){var i=ec(t),o=i[Vm],l=!i[Xm],d=e||{},h=t.nodeName===V_;for(var g in e)g in n||(n[g]=null);n.class?n.class=Gm(n.class):n[ho]&&(n.class=null),n[po]&&(n.style??(n.style=null));var f=Qm(t);for(const O in n){let B=n[O];if(h&&O==="value"&&B==null){t.value=t.__value="",d[O]=B;continue}if(O==="class"){var p=t.namespaceURI==="http://www.w3.org/1999/xhtml";Ve(t,p,B,r,e==null?void 0:e[ho],n[ho]),d[O]=B,d[ho]=n[ho];continue}if(O==="style"){Jl(t,B,e==null?void 0:e[po],n[po]),d[O]=B,d[po]=n[po];continue}var v=d[O];if(!(B===v&&!(B===void 0&&t.hasAttribute(O)))){d[O]=B;var b=O[0]+O[1];if(b!=="$$")if(b==="on"){const M={},J="$$"+O;let H=O.slice(2);var E=S_(H);if(N_(H)&&(H=H.slice(0,-7),M.capture=!0),!E&&v){if(B!=null)continue;t.removeEventListener(H,d[J],M),d[J]=null}if(E)ie(H,t,B),Tt([H]);else if(B!=null){let G=function(X){d[O].call(this,X)};d[J]=Ym(H,t,G,M)}}else if(O==="style")Ee(t,O,B);else if(O==="autofocus")$a(t,!!B);else if(!o&&(O==="__value"||O==="value"&&B!=null))t.value=t.__value=B;else if(O==="selected"&&h)eT(t,B);else{var _=O;l||(_=C_(_));var R=_==="defaultValue"||_==="defaultChecked";if(B==null&&!o&&!R)if(i[O]=null,_==="value"||_==="checked"){let M=t;const J=e===void 0;if(_==="value"){let H=M.defaultValue;M.removeAttribute(_),M.defaultValue=H,M.value=M.__value=J?H:null}else{let H=M.defaultChecked;M.removeAttribute(_),M.defaultChecked=H,M.checked=J?H:!1}}else t.removeAttribute(O);else R||f.includes(_)&&(o||typeof B!="string")?(t[_]=B,_ in i&&(i[_]=Zt)):typeof B!="function"&&Ee(t,_,B)}}}return d}function x0(t,e,n=[],r=[],s=[],a,i=!1,o=!1){gm(s,n,r,l=>{var d=void 0,h={},g=t.nodeName===X_,f=!1;if(Om(()=>{var v=e(...l.map(u)),b=tT(t,d,v,a,i,o);f&&g&&"value"in v&&Il(t,v.value);for(let _ of Object.getOwnPropertySymbols(h))v[_]||En(h[_]);for(let _ of Object.getOwnPropertySymbols(v)){var E=v[_];_.description===ME&&(!d||E!==d[_])&&(h[_]&&En(h[_]),h[_]=qn(()=>z_(t,()=>E))),b[_]=E}d=b}),g){var p=t;ro(()=>{Il(p,d.value,!0),Km(p)})}f=!0})}function ec(t){return t[il]??(t[il]={[Vm]:t.nodeName.includes("-"),[Xm]:t.namespaceURI===sm})}var R0=new Map;function Qm(t){var e=t.getAttribute("is")||t.nodeName,n=R0.get(e);if(n)return n;R0.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=Z1(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=eh(s)}return n}function wt(t,e,n=e){var r=new WeakSet;lh(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=qc(t)?jc(a):a,n(a),Fe!==null&&r.add(Fe),await Hm(),a!==(a=e())){var i=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=a??"",o!==null){var d=t.value.length;i===o&&o===l&&d>l?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=i,t.selectionEnd=Math.min(o,d))}}}),ra(e)==null&&t.value&&(n(qc(t)?jc(t.value):t.value),Fe!==null&&r.add(Fe)),Zl(()=>{var s=e();if(t===document.activeElement){var a=Fe;if(r.has(a))return}qc(t)&&s===jc(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const Hc=new Set;function nT(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var o of e)i=i[o]??(i[o]=[]);i.push(n),lh(n,"change",()=>{var l=n.__value;a&&(l=rT(i,l,n.checked)),s(l)},()=>s(a?[]:null)),Zl(()=>{var l=r();a?(l=l||[],n.checked=l.includes(n.__value)):n.checked=Am(n.__value,l)}),mu(()=>{var l=i.indexOf(n);l!==-1&&i.splice(l,1)}),Hc.has(i)||(Hc.add(i),xr(()=>{i.sort((l,d)=>l.compareDocumentPosition(d)===4?-1:1),Hc.delete(i)})),xr(()=>{})}function rT(t,e,n){for(var r=new Set,s=0;s<t.length;s+=1)t[s].checked&&r.add(t[s].__value);return n||r.delete(e),Array.from(r)}function qc(t){var e=t.type;return e==="number"||e==="range"}function jc(t){return t===""?null:+t}var js,Pi,du,Gl,Zm;const Kl=class Kl{constructor(e){Ue(this,Gl);Ue(this,js,new WeakMap);Ue(this,Pi);Ue(this,du);Ye(this,du,e)}observe(e,n){var r=V(this,js).get(e)||new Set;return r.add(n),V(this,js).set(e,r),rt(this,Gl,Zm).call(this).observe(e,V(this,du)),()=>{var s=V(this,js).get(e);s.delete(n),s.size===0&&(V(this,js).delete(e),V(this,Pi).unobserve(e))}}};js=new WeakMap,Pi=new WeakMap,du=new WeakMap,Gl=new WeakSet,Zm=function(){return V(this,Pi)??Ye(this,Pi,new ResizeObserver(e=>{for(var n of e){Kl.entries.set(n.target,n);for(var r of V(this,js).get(n.target)||[])r(n)}}))},ye(Kl,"entries",new WeakMap);let Pd=Kl;var sT=new Pd({box:"border-box"});function aT(t,e,n){var r=sT.observe(t,()=>n(t[e]));ro(()=>(ra(()=>n(t[e])),r))}function $c(t,e){return t===e||(t==null?void 0:t[Qr])===e}function mn(t={},e,n,r){var s=Ct.r,a=Ze;return ro(()=>{var i,o;return Zl(()=>{i=o,o=[],ra(()=>{$c(n(...o),t)||(e(t,...o),i&&$c(n(...i),t)&&e(null,...i))})}),()=>{let l=a;for(;l!==s&&l.parent!==null&&l.parent.f&_d;)l=l.parent;const d=()=>{o&&$c(n(...o),t)&&e(null,...o)},h=l.teardown;l.teardown=()=>{d(),h==null||h()}}}),t}function Jm(t=!1){const e=Ct,n=e.l.u;if(!n)return;let r=()=>y_(e.s);if(t){let s=0,a={};const i=Hi(()=>{let o=!1;const l=e.s;for(const d in l)l[d]!==a[d]&&(a[d]=l[d],o=!0);return o&&s++,s});r=()=>u(i)}n.b.length&&g_(()=>{D0(e,r),bd(n.b)}),Rt(()=>{const s=ra(()=>n.m.map(lE));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&Rt(()=>{D0(e,r),bd(n.a)})}function D0(t,e){if(t.l.s)for(const n of t.l.s)u(n);e()}const iT={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Jt(t,e,n){return new Proxy({props:t,exclude:e},iT)}const oT={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(co(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r)return r[e]}},set(t,e,n){let r=t.props.length;for(;r--;){let s=t.props[r];co(s)&&(s=s());const a=Xs(s,e);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(co(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=Xs(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Qr||e===tm)return!1;for(let n of t.props)if(co(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(co(n)&&(n=n()),!!n){for(const r in n)e.includes(r)||e.push(r);for(const r of Object.getOwnPropertySymbols(n))e.includes(r)||e.push(r)}return e}};function on(...t){return new Proxy({props:t},oT)}function Vn(t,e,n,r){var B;var s=!to||(n&LE)!==0,a=(n&xE)!==0,i=(n&RE)!==0,o=r,l=!0,d=void 0,h=()=>i&&s?(d??(d=Hi(r)),u(d)):(l&&(l=!1,o=i?ra(r):r),o);let g;if(a){var f=Qr in t||tm in t;g=((B=Xs(t,e))==null?void 0:B.set)??(f&&e in t?M=>t[e]=M:void 0)}var p,v=!1;a?[p,v]=KE(()=>t[e]):p=t[e],p===void 0&&r!==void 0&&(p=h(),g&&(s&&EE(),g(p)));var b;if(s?b=()=>{var M=t[e];return M===void 0?h():(l=!0,M)}:b=()=>{var M=t[e];return M!==void 0&&(o=void 0),M===void 0?o:M},s&&(n&OE)===0)return b;if(g){var E=t.$$legacy;return(function(M,J){return arguments.length>0?((!s||!J||E||v)&&g(J?b():M),M):b()})}var _=!1,R=((n&CE)!==0?Hi:oh)(()=>(_=!1,b()));a&&u(R);var O=Ze;return(function(M,J){if(arguments.length>0){const H=J?u(R):s&&a?ct(M):M;return T(R,H),_=!0,o!==void 0&&(o=H),M}return ys&&_||(O.f&vr)!==0?R.v:u(R)})}function Za(t){Ct===null&&nm(),to&&Ct.l!==null?uT(Ct).m.push(t):Rt(()=>{const e=ra(t);if(typeof e=="function")return e})}function uT(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const lT="5";var X1;typeof window<"u"&&((X1=window.__svelte??(window.__svelte={})).v??(X1.v=new Set)).add(lT);jE();function _s(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ph(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ");return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}const cT={html:"text/html; charset=utf-8",json:"application/json; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",css:"text/css; charset=utf-8",txt:"text/plain; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",avif:"image/avif",gif:"image/gif",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",map:"application/json; charset=utf-8"};function dT(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return cT[e]??"application/octet-stream"}class Na extends Error{constructor(e){super(e),this.name="ContentParseError"}}const fT=new Set(["template","title","isPublished","fields","created","published","updated"]);function Md(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Bd(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function hT(t){return Md(t)&&Object.values(t).every(Bd)}function pT(t,e){if(Bd(e))return e;if(Array.isArray(e)){if(e.every(Bd)||e.every(hT))return e;throw new Na(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new Na(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Fu(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Na(`"${e}" must be a string when present.`);return n}}function tc(t){return eg(t).item}function eg(t){if(!Md(t))throw new Na("A content item must be a JSON object.");if(typeof t.title!="string")throw new Na('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new Na(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!Md(t.fields))throw new Na('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([d,h])=>[d,pT(d,h)]))}const r=Fu(t,"template"),s=Fu(t,"created"),a=Fu(t,"published"),i=Fu(t,"updated"),o=Object.keys(t).filter(d=>!fT.has(d)).sort();return{item:{title:t.title,isPublished:e,fields:n,...r!==void 0&&{template:r},...s!==void 0&&{created:s},...a!==void 0&&{published:a},...i!==void 0&&{updated:i}},diagnostics:{unknownTopLevelKeys:o}}}function k0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function tg(t){if(!k0(t))return{order:[]};const e=Array.isArray(t.order)?t.order.filter(a=>typeof a=="string"):[],n=typeof t.name=="string"?t.name:void 0,r=typeof t.defaultTemplate=="string"?t.defaultTemplate:void 0,s=k0(t.collection)?{recursive:t.collection.recursive===!0}:void 0;return{order:e,...n!==void 0&&{name:n},...r!==void 0&&{defaultTemplate:r},...s!==void 0&&{collection:s}}}class ng extends Error{constructor(e){super(`No such file in content source: ${e}`),this.path=e,this.name="NotFoundError"}}const rg="_sort.json",mT="_redirects.json",gT="_site.json",vT="assets",P0=".json",st={content:"content",templates:"templates",components:"components",public:"public"};function Jr(...t){return t.filter(e=>e!=="").join("/")}async function mh(t,e=st.content){return sg(t,e,"","")}async function sg(t,e,n,r){const[s,a]=await Promise.all([t.list(e),_T(t,e)]),i=new Map;for(const l of s)if(l.kind==="file"){if(l.name===rg||l.name===mT||l.name===gT||!l.name.endsWith(P0))continue;const d=l.name.slice(0,-P0.length),h=await bT(t,Jr(e,l.name),d,r);h!==void 0&&i.set(d,h)}else{if(l.name===vT)continue;const d=Jr(r,l.name);i.set(l.name,await sg(t,Jr(e,l.name),l.name,d))}const o=a.name??(n===""?"":ph(n));return{kind:"dir",slug:n,name:o,path:r,children:TT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function bT(t,e,n,r){try{return await ET(t,e,n,r)}catch(s){if(s instanceof ng)return;throw s}}async function ET(t,e,n,r){const s=await t.readText(e);try{const{item:a,diagnostics:i}=eg(JSON.parse(s));return{kind:"item",slug:n,path:Jr(r,n),item:a,...i.unknownTopLevelKeys.length>0&&{parseDiagnostics:i}}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function _T(t,e){const n=Jr(e,rg);if(!await t.exists(n))return{order:[]};try{return tg(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function TT(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}function gh(t,e=st.components){return vh(t,e,"html")}function ag(t,e=st.components){return vh(t,e,"css")}function ig(t,e=st.components){return vh(t,e,"js")}async function vh(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const o of await t.list(i)){const l=Jr(i,o.name);if(o.kind==="dir")await a(l);else if(o.name.endsWith(r)){const d=o.name.slice(0,-r.length).toLowerCase();try{s.set(d,await t.readText(l))}catch(h){if(!(h instanceof ng))throw h}}}};return await a(e),s}async function Cl(t,e,n=st.templates){return t.readText(Jr(n,`${e}.html`))}function AT(t,e,n=st.templates){return Eh(t,Jr(n,`${e}.css`))}function yT(t,e,n=st.templates){return Eh(t,Jr(n,`${e}.js`))}const bu="document";function bh(t,e=st.templates){return Eh(t,Jr(e,`${bu}.html`))}async function Eh(t,e){try{return await t.readText(e)}catch{return}}const NT=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ht="�";var I;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const Bn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function og(t){return t>=55296&&t<=57343}function wT(t){return t>=56320&&t<=57343}function ST(t,e){return(t-55296)*1024+9216+e}function ug(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function lg(t){return t>=64976&&t<=65007||NT.has(t)}var ne;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ne||(ne={}));const IT=65536;class CT{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=IT,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:a}=this,i=s+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(wT(n))return this.pos++,this._addGap(),ST(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(ne.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const r=this.html.charCodeAt(n);return r===I.CARRIAGE_RETURN?I.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let e=this.html.charCodeAt(this.pos);return e===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):e===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,og(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===I.LINE_FEED||e===I.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){ug(e)?this._err(ne.controlCharacterInInputStream):lg(e)&&this._err(ne.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var lt;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(lt||(lt={}));function cg(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const LT=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),OT=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function xT(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=OT.get(t))!==null&&e!==void 0?e:t}var hn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(hn||(hn={}));const RT=32;var zs;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(zs||(zs={}));function Fd(t){return t>=hn.ZERO&&t<=hn.NINE}function DT(t){return t>=hn.UPPER_A&&t<=hn.UPPER_F||t>=hn.LOWER_A&&t<=hn.LOWER_F}function kT(t){return t>=hn.UPPER_A&&t<=hn.UPPER_Z||t>=hn.LOWER_A&&t<=hn.LOWER_Z||Fd(t)}function PT(t){return t===hn.EQUALS||kT(t)}var fn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(fn||(fn={}));var bs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(bs||(bs={}));class MT{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=fn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bs.Strict}startEntity(e){this.decodeMode=e,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case fn.EntityStart:return e.charCodeAt(n)===hn.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(e,n));case fn.NumericStart:return this.stateNumericStart(e,n);case fn.NumericDecimal:return this.stateNumericDecimal(e,n);case fn.NumericHex:return this.stateNumericHex(e,n);case fn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|RT)===hn.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(e.substr(n,a),s),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(Fd(s)||DT(s))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(Fd(s))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===hn.SEMI)this.consumed+=1;else if(this.decodeMode===bs.Strict)return 0;return this.emitCodePoint(xT(this.result),this.consumed),this.errors&&(e!==hn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&zs.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=BT(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===bs.Attribute&&(a===0||PT(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&zs.VALUE_LENGTH)>>14,a!==0){if(i===hn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==bs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,s=(r[n]&zs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[e]&~zs.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==bs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}}function BT(t,e,n,r){const s=(e&zs.BRANCH_LENGTH)>>7,a=e&zs.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const l=r-a;return l<0||l>=s?-1:t[n+l]-1}let i=n,o=i+s-1;for(;i<=o;){const l=i+o>>>1,d=t[l];if(d<r)i=l+1;else if(d>r)o=l-1;else return t[l+s]}return-1}var pe;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(pe||(pe={}));var Pa;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Pa||(Pa={}));var dr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(dr||(dr={}));var Z;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(Z||(Z={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const FT=new Map([[Z.A,c.A],[Z.ADDRESS,c.ADDRESS],[Z.ANNOTATION_XML,c.ANNOTATION_XML],[Z.APPLET,c.APPLET],[Z.AREA,c.AREA],[Z.ARTICLE,c.ARTICLE],[Z.ASIDE,c.ASIDE],[Z.B,c.B],[Z.BASE,c.BASE],[Z.BASEFONT,c.BASEFONT],[Z.BGSOUND,c.BGSOUND],[Z.BIG,c.BIG],[Z.BLOCKQUOTE,c.BLOCKQUOTE],[Z.BODY,c.BODY],[Z.BR,c.BR],[Z.BUTTON,c.BUTTON],[Z.CAPTION,c.CAPTION],[Z.CENTER,c.CENTER],[Z.CODE,c.CODE],[Z.COL,c.COL],[Z.COLGROUP,c.COLGROUP],[Z.DD,c.DD],[Z.DESC,c.DESC],[Z.DETAILS,c.DETAILS],[Z.DIALOG,c.DIALOG],[Z.DIR,c.DIR],[Z.DIV,c.DIV],[Z.DL,c.DL],[Z.DT,c.DT],[Z.EM,c.EM],[Z.EMBED,c.EMBED],[Z.FIELDSET,c.FIELDSET],[Z.FIGCAPTION,c.FIGCAPTION],[Z.FIGURE,c.FIGURE],[Z.FONT,c.FONT],[Z.FOOTER,c.FOOTER],[Z.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[Z.FORM,c.FORM],[Z.FRAME,c.FRAME],[Z.FRAMESET,c.FRAMESET],[Z.H1,c.H1],[Z.H2,c.H2],[Z.H3,c.H3],[Z.H4,c.H4],[Z.H5,c.H5],[Z.H6,c.H6],[Z.HEAD,c.HEAD],[Z.HEADER,c.HEADER],[Z.HGROUP,c.HGROUP],[Z.HR,c.HR],[Z.HTML,c.HTML],[Z.I,c.I],[Z.IMG,c.IMG],[Z.IMAGE,c.IMAGE],[Z.INPUT,c.INPUT],[Z.IFRAME,c.IFRAME],[Z.KEYGEN,c.KEYGEN],[Z.LABEL,c.LABEL],[Z.LI,c.LI],[Z.LINK,c.LINK],[Z.LISTING,c.LISTING],[Z.MAIN,c.MAIN],[Z.MALIGNMARK,c.MALIGNMARK],[Z.MARQUEE,c.MARQUEE],[Z.MATH,c.MATH],[Z.MENU,c.MENU],[Z.META,c.META],[Z.MGLYPH,c.MGLYPH],[Z.MI,c.MI],[Z.MO,c.MO],[Z.MN,c.MN],[Z.MS,c.MS],[Z.MTEXT,c.MTEXT],[Z.NAV,c.NAV],[Z.NOBR,c.NOBR],[Z.NOFRAMES,c.NOFRAMES],[Z.NOEMBED,c.NOEMBED],[Z.NOSCRIPT,c.NOSCRIPT],[Z.OBJECT,c.OBJECT],[Z.OL,c.OL],[Z.OPTGROUP,c.OPTGROUP],[Z.OPTION,c.OPTION],[Z.P,c.P],[Z.PARAM,c.PARAM],[Z.PLAINTEXT,c.PLAINTEXT],[Z.PRE,c.PRE],[Z.RB,c.RB],[Z.RP,c.RP],[Z.RT,c.RT],[Z.RTC,c.RTC],[Z.RUBY,c.RUBY],[Z.S,c.S],[Z.SCRIPT,c.SCRIPT],[Z.SEARCH,c.SEARCH],[Z.SECTION,c.SECTION],[Z.SELECT,c.SELECT],[Z.SOURCE,c.SOURCE],[Z.SMALL,c.SMALL],[Z.SPAN,c.SPAN],[Z.STRIKE,c.STRIKE],[Z.STRONG,c.STRONG],[Z.STYLE,c.STYLE],[Z.SUB,c.SUB],[Z.SUMMARY,c.SUMMARY],[Z.SUP,c.SUP],[Z.TABLE,c.TABLE],[Z.TBODY,c.TBODY],[Z.TEMPLATE,c.TEMPLATE],[Z.TEXTAREA,c.TEXTAREA],[Z.TFOOT,c.TFOOT],[Z.TD,c.TD],[Z.TH,c.TH],[Z.THEAD,c.THEAD],[Z.TITLE,c.TITLE],[Z.TR,c.TR],[Z.TRACK,c.TRACK],[Z.TT,c.TT],[Z.U,c.U],[Z.UL,c.UL],[Z.SVG,c.SVG],[Z.VAR,c.VAR],[Z.WBR,c.WBR],[Z.XMP,c.XMP]]);function nc(t){var e;return(e=FT.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const be=c,UT={[pe.HTML]:new Set([be.ADDRESS,be.APPLET,be.AREA,be.ARTICLE,be.ASIDE,be.BASE,be.BASEFONT,be.BGSOUND,be.BLOCKQUOTE,be.BODY,be.BR,be.BUTTON,be.CAPTION,be.CENTER,be.COL,be.COLGROUP,be.DD,be.DETAILS,be.DIR,be.DIV,be.DL,be.DT,be.EMBED,be.FIELDSET,be.FIGCAPTION,be.FIGURE,be.FOOTER,be.FORM,be.FRAME,be.FRAMESET,be.H1,be.H2,be.H3,be.H4,be.H5,be.H6,be.HEAD,be.HEADER,be.HGROUP,be.HR,be.HTML,be.IFRAME,be.IMG,be.INPUT,be.LI,be.LINK,be.LISTING,be.MAIN,be.MARQUEE,be.MENU,be.META,be.NAV,be.NOEMBED,be.NOFRAMES,be.NOSCRIPT,be.OBJECT,be.OL,be.P,be.PARAM,be.PLAINTEXT,be.PRE,be.SCRIPT,be.SECTION,be.SELECT,be.SOURCE,be.STYLE,be.SUMMARY,be.TABLE,be.TBODY,be.TD,be.TEMPLATE,be.TEXTAREA,be.TFOOT,be.TH,be.THEAD,be.TITLE,be.TR,be.TRACK,be.UL,be.WBR,be.XMP]),[pe.MATHML]:new Set([be.MI,be.MO,be.MN,be.MS,be.MTEXT,be.ANNOTATION_XML]),[pe.SVG]:new Set([be.TITLE,be.FOREIGN_OBJECT,be.DESC]),[pe.XLINK]:new Set,[pe.XML]:new Set,[pe.XMLNS]:new Set},Ud=new Set([be.H1,be.H2,be.H3,be.H4,be.H5,be.H6]),HT=new Set([Z.STYLE,Z.SCRIPT,Z.XMP,Z.IFRAME,Z.NOEMBED,Z.NOFRAMES,Z.PLAINTEXT]);function qT(t,e){return HT.has(t)||e&&t===Z.NOSCRIPT}var D;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(D||(D={}));const $n={DATA:D.DATA,RCDATA:D.RCDATA,RAWTEXT:D.RAWTEXT,SCRIPT_DATA:D.SCRIPT_DATA,PLAINTEXT:D.PLAINTEXT,CDATA_SECTION:D.CDATA_SECTION};function jT(t){return t>=I.DIGIT_0&&t<=I.DIGIT_9}function yo(t){return t>=I.LATIN_CAPITAL_A&&t<=I.LATIN_CAPITAL_Z}function $T(t){return t>=I.LATIN_SMALL_A&&t<=I.LATIN_SMALL_Z}function Ps(t){return $T(t)||yo(t)}function M0(t){return Ps(t)||jT(t)}function Uu(t){return t+32}function dg(t){return t===I.SPACE||t===I.LINE_FEED||t===I.TABULATION||t===I.FORM_FEED}function B0(t){return dg(t)||t===I.SOLIDUS||t===I.GREATER_THAN_SIGN}function YT(t){return t===I.NULL?ne.nullCharacterReference:t>1114111?ne.characterReferenceOutsideUnicodeRange:og(t)?ne.surrogateCharacterReference:lg(t)?ne.noncharacterCharacterReference:ug(t)||t===I.CARRIAGE_RETURN?ne.controlCharacterReference:null}class zT{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=D.DATA,this.returnState=D.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new CT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new MT(LT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=YT(r);s&&this._err(s,1)}}:void 0)}_err(e,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:lt.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:lt.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:lt.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:lt.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(cg(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ne.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=nc(e.tagName),e.type===lt.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(ne.endTagWithAttributes),e.selfClosing&&this._err(ne.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case lt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case lt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case lt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:lt.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=dg(e)?lt.WHITESPACE_CHARACTER:e===I.NULL?lt.NULL_CHARACTER:lt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(lt.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=D.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bs.Attribute:bs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===D.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===D.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===D.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case D.DATA:{this._stateData(e);break}case D.RCDATA:{this._stateRcdata(e);break}case D.RAWTEXT:{this._stateRawtext(e);break}case D.SCRIPT_DATA:{this._stateScriptData(e);break}case D.PLAINTEXT:{this._statePlaintext(e);break}case D.TAG_OPEN:{this._stateTagOpen(e);break}case D.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case D.TAG_NAME:{this._stateTagName(e);break}case D.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case D.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case D.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case D.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case D.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case D.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case D.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case D.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case D.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case D.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case D.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case D.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case D.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case D.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case D.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case D.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case D.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case D.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case D.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case D.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case D.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case D.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case D.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case D.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case D.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case D.BOGUS_COMMENT:{this._stateBogusComment(e);break}case D.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case D.COMMENT_START:{this._stateCommentStart(e);break}case D.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case D.COMMENT:{this._stateComment(e);break}case D.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case D.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case D.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case D.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case D.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case D.COMMENT_END:{this._stateCommentEnd(e);break}case D.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case D.DOCTYPE:{this._stateDoctype(e);break}case D.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case D.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case D.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case D.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case D.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case D.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case D.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case D.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case D.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case D.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case D.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case D.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case D.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case D.CDATA_SECTION:{this._stateCdataSection(e);break}case D.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case D.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case D.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case D.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case I.LESS_THAN_SIGN:{this.state=D.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(e);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=D.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case I.LESS_THAN_SIGN:{this.state=D.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ps(e))this._createStartTagToken(),this.state=D.TAG_NAME,this._stateTagName(e);else switch(e){case I.EXCLAMATION_MARK:{this.state=D.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=D.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=D.BOGUS_COMMENT,this._stateBogusComment(e);break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=D.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ps(e))this._createEndTagToken(),this.state=D.TAG_NAME,this._stateTagName(e);else switch(e){case I.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=D.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=D.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.tagName+=Ht;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(yo(e)?Uu(e):e)}}_stateRcdataLessThanSign(e){e===I.SOLIDUS?this.state=D.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=D.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ps(e)?(this.state=D.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=D.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=D.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=D.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=D.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===I.SOLIDUS?this.state=D.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=D.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ps(e)?(this.state=D.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=D.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case I.SOLIDUS:{this.state=D.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=D.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=D.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ps(e)?(this.state=D.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===I.HYPHEN_MINUS?(this.state=D.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===I.HYPHEN_MINUS?(this.state=D.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=D.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===I.SOLIDUS?this.state=D.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ps(e)?(this._emitChars("<"),this.state=D.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ps(e)?(this.state=D.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&B0(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=D.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===I.SOLIDUS?(this.state=D.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&B0(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=D.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=D.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case I.EQUALS_SIGN:{this._err(ne.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=D.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=D.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=D.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=D.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(ne.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.name+=Ht;break}default:this.currentAttr.name+=String.fromCodePoint(yo(e)?Uu(e):e)}}_stateAfterAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=D.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=D.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=D.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=D.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=D.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingAttributeValue),this.state=D.DATA,this.emitCurrentTagToken();break}default:this.state=D.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case I.QUOTATION_MARK:{this.state=D.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case I.APOSTROPHE:{this.state=D.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=D.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=D.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(ne.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=D.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=D.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=D.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBetweenAttributes),this.state=D.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case I.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=D.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.unexpectedSolidusInTag),this.state=D.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentComment(n);break}case I.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ht;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Bn.DASH_DASH,!0)?(this._createCommentToken(Bn.DASH_DASH.length+1),this.state=D.COMMENT_START):this._consumeSequenceIfMatch(Bn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bn.DOCTYPE.length+1),this.state=D.DOCTYPE):this._consumeSequenceIfMatch(Bn.CDATA_START,!0)?this.inForeignNode?this.state=D.CDATA_SECTION:(this._err(ne.cdataInHtmlContent),this._createCommentToken(Bn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=D.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ne.incorrectlyOpenedComment),this._createCommentToken(2),this.state=D.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=D.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=D.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=D.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=D.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{n.data+="<",this.state=D.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ht;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case I.EXCLAMATION_MARK:{n.data+="!",this.state=D.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=D.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===I.HYPHEN_MINUS?this.state=D.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=D.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===I.HYPHEN_MINUS?this.state=D.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=D.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==I.GREATER_THAN_SIGN&&e!==I.EOF&&this._err(ne.nestedComment),this.state=D.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_END;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=D.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentComment(n);break}case I.EXCLAMATION_MARK:{this.state=D.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{n.data+="-";break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=D.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{n.data+="--!",this.state=D.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.incorrectlyClosedComment),this.state=D.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=D.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=D.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBeforeDoctypeName),this.state=D.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(yo(e))this._createDoctypeToken(String.fromCharCode(Uu(e))),this.state=D.DOCTYPE_NAME;else switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(ne.unexpectedNullCharacter),this._createDoctypeToken(Ht),this.state=D.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=D.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.name+=Ht;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(yo(e)?Uu(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Bn.PUBLIC,!1)?this.state=D.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bn.SYSTEM,!1)?this.state=D.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ne.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case I.QUOTATION_MARK:{this.state=D.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case I.APOSTROPHE:{this.state=D.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.QUOTATION_MARK:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case I.QUOTATION_MARK:{this.state=D.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case I.APOSTROPHE:{this.state=D.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.NULL:{this._err(ne.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case I.RIGHT_SQUARE_BRACKET:{this.state=D.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(ne.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===I.RIGHT_SQUARE_BRACKET?this.state=D.CDATA_SECTION_END:(this._emitChars("]"),this.state=D.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case I.GREATER_THAN_SIGN:{this.state=D.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=D.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&M0(this.preprocessor.peek(1))?D.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){M0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===I.SEMICOLON&&this._err(ne.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const fg=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),F0=new Set([...fg,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Ll=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),WT=new Set([...Ll,c.OL,c.UL]),GT=new Set([...Ll,c.BUTTON]),U0=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),H0=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),KT=new Set([c.TR,c.TEMPLATE,c.HTML]),VT=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),XT=new Set([c.TABLE,c.TEMPLATE,c.HTML]),QT=new Set([c.TD,c.TH]);class ZT{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===pe.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const s=this._indexOf(e)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==pe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Ud,pe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(QT,pe.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(XT,pe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(VT,pe.HTML)}clearBackToTableRowContext(){this.clearBackTo(KT,pe.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case pe.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case pe.SVG:{if(H0.has(s))return!1;break}case pe.MATHML:{if(U0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Ll)}hasInListItemScope(e){return this.hasInDynamicScope(e,WT)}hasInButtonScope(e){return this.hasInDynamicScope(e,GT)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case pe.HTML:{if(Ud.has(n))return!0;if(Ll.has(n))return!1;break}case pe.SVG:{if(H0.has(n))return!1;break}case pe.MATHML:{if(U0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===pe.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&fg.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&F0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&F0.has(this.currentTagId);)this.pop()}}const Yc=3;var Kr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Kr||(Kr={}));const q0={type:Kr.Marker};class JT{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const l=this.entries[o];if(l.type===Kr.Marker)break;const{element:d}=l;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===i){const h=this.treeAdapter.getAttrList(d);h.length===s&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Yc)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Yc)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(l=>s.get(l.name)===l.value)&&(a+=1,a>=Yc&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(q0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Kr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Kr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(q0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Kr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Kr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Kr.Element&&n.element===e)}}const ps={createDocument(){return{nodeName:"#document",mode:dr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const s=t.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=e,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};ps.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(ps.isTextNode(n)){n.value+=e;return}}ps.appendChild(t,ps.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&ps.isTextNode(r)?r.value+=e:ps.insertBefore(t,ps.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},hg="html",e2="about:legacy-compat",t2="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",pg=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],n2=[...pg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],r2=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),mg=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],s2=[...mg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function j0(t,e){return e.some(n=>t.startsWith(n))}function a2(t){return t.name===hg&&t.publicId===null&&(t.systemId===null||t.systemId===e2)}function i2(t){if(t.name!==hg)return dr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===t2)return dr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),r2.has(n))return dr.QUIRKS;let r=e===null?n2:pg;if(j0(n,r))return dr.QUIRKS;if(r=e===null?mg:s2,j0(n,r))return dr.LIMITED_QUIRKS}return dr.NO_QUIRKS}const $0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},o2="definitionurl",u2="definitionURL",l2=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),c2=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:pe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:pe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:pe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:pe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:pe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:pe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:pe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:pe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:pe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:pe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:pe.XMLNS}]]),d2=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),f2=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function h2(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===Pa.COLOR||r===Pa.SIZE||r===Pa.FACE)||f2.has(e)}function gg(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===o2){t.attrs[e].name=u2;break}}function vg(t){for(let e=0;e<t.attrs.length;e++){const n=l2.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function _h(t){for(let e=0;e<t.attrs.length;e++){const n=c2.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function p2(t){const e=d2.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=nc(t.tagName))}function m2(t,e){return e===pe.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function g2(t,e,n){if(e===pe.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Pa.ENCODING){const s=n[r].value.toLowerCase();return s===$0.TEXT_HTML||s===$0.APPLICATION_XML}}return e===pe.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function v2(t,e,n,r){return(!r||r===pe.HTML)&&g2(t,e,n)||(!r||r===pe.MATHML)&&m2(t,e)}const b2="hidden",E2=8,_2=3;var P;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(P||(P={}));const T2={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},bg=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),Y0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ps,onParseError:null};class Eg{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=P.INITIAL,this.originalInsertionMode=P.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Y0,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new zT(this.options,this),this.activeFormattingElements=new JT(this.treeAdapter),this.fragmentContextID=r?nc(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new ZT(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...Y0,...n};e??(e=r.treeAdapter.createElement(Z.TEMPLATE,pe.HTML,[]));const s=r.treeAdapter.createElement("documentmock",pe.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(P.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const a=(s=e.location)!==null&&s!==void 0?s:T2,i={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(i)}onItemPush(e,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),n){let a,i;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,i=this.fragmentContextID):{current:a,currentTagId:i}=this.openElements,this._setContextModes(a,i)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===pe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,pe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=P.TEXT}switchToPlaintextParsing(){this.insertionMode=P.TEXT,this.originalInsertionMode=P.IN_BODY,this.tokenizer.state=$n.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Z.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==pe.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=$n.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=$n.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=$n.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=$n.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),e.location){const i=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,pe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,pe.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Z.HTML,pe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,i=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:l,endCol:d,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:l,endCol:d,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),a=n.type===lt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===Z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===pe.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,pe.HTML)}_processToken(e){switch(e.type){case lt.CHARACTER:{this.onCharacter(e);break}case lt.NULL_CHARACTER:{this.onNullCharacter(e);break}case lt.COMMENT:{this.onComment(e);break}case lt.DOCTYPE:{this.onDoctype(e);break}case lt.START_TAG:{this._processStartTag(e);break}case lt.END_TAG:{this.onEndTag(e);break}case lt.EOF:{this.onEof(e);break}case lt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return v2(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Kr.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=P.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=P.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=P.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=P.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=P.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=P.IN_TABLE;return}case c.BODY:{this.insertionMode=P.IN_BODY;return}case c.FRAMESET:{this.insertionMode=P.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?P.AFTER_HEAD:P.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=P.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=P.IN_HEAD;return}break}}this.insertionMode=P.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=P.IN_SELECT_IN_TABLE;return}}this.insertionMode=P.IN_SELECT}_isElementCausesFosterParenting(e){return bg.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===pe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return UT[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){QA(this,e);return}switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{xo(this,e);break}case P.BEFORE_HEAD:{Ro(this,e);break}case P.IN_HEAD:{Do(this,e);break}case P.IN_HEAD_NO_SCRIPT:{ko(this,e);break}case P.AFTER_HEAD:{Po(this,e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:{Tg(this,e);break}case P.TEXT:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{zc(this,e);break}case P.IN_TABLE_TEXT:{Ig(this,e);break}case P.IN_COLUMN_GROUP:{Ol(this,e);break}case P.AFTER_BODY:{xl(this,e);break}case P.AFTER_AFTER_BODY:{hl(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){XA(this,e);return}switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{xo(this,e);break}case P.BEFORE_HEAD:{Ro(this,e);break}case P.IN_HEAD:{Do(this,e);break}case P.IN_HEAD_NO_SCRIPT:{ko(this,e);break}case P.AFTER_HEAD:{Po(this,e);break}case P.TEXT:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{zc(this,e);break}case P.IN_COLUMN_GROUP:{Ol(this,e);break}case P.AFTER_BODY:{xl(this,e);break}case P.AFTER_AFTER_BODY:{hl(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Hd(this,e);return}switch(this.insertionMode){case P.INITIAL:case P.BEFORE_HTML:case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_TEMPLATE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{Hd(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.AFTER_BODY:{C2(this,e);break}case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{L2(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case P.INITIAL:{O2(this,e);break}case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:{this._err(e,ne.misplacedDoctype);break}case P.IN_TABLE_TEXT:{go(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?ZA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{x2(this,e);break}case P.BEFORE_HEAD:{D2(this,e);break}case P.IN_HEAD:{Mr(this,e);break}case P.IN_HEAD_NO_SCRIPT:{M2(this,e);break}case P.AFTER_HEAD:{F2(this,e);break}case P.IN_BODY:{Ln(this,e);break}case P.IN_TABLE:{zi(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.IN_CAPTION:{kA(this,e);break}case P.IN_COLUMN_GROUP:{yh(this,e);break}case P.IN_TABLE_BODY:{ac(this,e);break}case P.IN_ROW:{ic(this,e);break}case P.IN_CELL:{BA(this,e);break}case P.IN_SELECT:{Og(this,e);break}case P.IN_SELECT_IN_TABLE:{UA(this,e);break}case P.IN_TEMPLATE:{qA(this,e);break}case P.AFTER_BODY:{$A(this,e);break}case P.IN_FRAMESET:{YA(this,e);break}case P.AFTER_FRAMESET:{WA(this,e);break}case P.AFTER_AFTER_BODY:{KA(this,e);break}case P.AFTER_AFTER_FRAMESET:{VA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?JA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{R2(this,e);break}case P.BEFORE_HEAD:{k2(this,e);break}case P.IN_HEAD:{P2(this,e);break}case P.IN_HEAD_NO_SCRIPT:{B2(this,e);break}case P.AFTER_HEAD:{U2(this,e);break}case P.IN_BODY:{sc(this,e);break}case P.TEXT:{NA(this,e);break}case P.IN_TABLE:{Wo(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.IN_CAPTION:{PA(this,e);break}case P.IN_COLUMN_GROUP:{MA(this,e);break}case P.IN_TABLE_BODY:{qd(this,e);break}case P.IN_ROW:{Lg(this,e);break}case P.IN_CELL:{FA(this,e);break}case P.IN_SELECT:{xg(this,e);break}case P.IN_SELECT_IN_TABLE:{HA(this,e);break}case P.IN_TEMPLATE:{jA(this,e);break}case P.AFTER_BODY:{Dg(this,e);break}case P.IN_FRAMESET:{zA(this,e);break}case P.AFTER_FRAMESET:{GA(this,e);break}case P.AFTER_AFTER_BODY:{hl(this,e);break}}}onEof(e){switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{xo(this,e);break}case P.BEFORE_HEAD:{Ro(this,e);break}case P.IN_HEAD:{Do(this,e);break}case P.IN_HEAD_NO_SCRIPT:{ko(this,e);break}case P.AFTER_HEAD:{Po(this,e);break}case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{wg(this,e);break}case P.TEXT:{wA(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.IN_TEMPLATE:{Rg(this,e);break}case P.AFTER_BODY:case P.IN_FRAMESET:case P.AFTER_FRAMESET:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{Ah(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===I.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.TEXT:case P.IN_COLUMN_GROUP:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{this._insertCharacters(e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:case P.AFTER_BODY:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{_g(this,e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{zc(this,e);break}case P.IN_TABLE_TEXT:{Sg(this,e);break}}}}function A2(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):Ng(t,e),n}function y2(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const s=t.openElements.items[r];if(s===e.element)break;t._isSpecialElement(s,t.openElements.tagIDs[r])&&(n=s)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function N2(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let a=0,i=s;i!==n;a++,i=s){s=t.openElements.getCommonAncestor(i);const o=t.activeFormattingElements.getElementEntry(i),l=o&&a>=_2;!o||l?(l&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(i)):(i=w2(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function w2(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function S2(t,e,n){const r=t.treeAdapter.getTagName(e),s=nc(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&a===pe.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function I2(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,s.tagID)}function Th(t,e){for(let n=0;n<E2;n++){const r=A2(t,e);if(!r)break;const s=y2(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=N2(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&S2(t,i,a),I2(t,s,r)}}function Hd(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function C2(t,e){t._appendCommentNode(e,t.openElements.items[0])}function L2(t,e){t._appendCommentNode(e,t.document)}function Ah(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],s=t.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],i=t.treeAdapter.getNodeSourceCodeLocation(a);i&&!i.endTag&&t._setEndLocation(a,e)}}}}function O2(t,e){t._setDocumentType(e);const n=e.forceQuirks?dr.QUIRKS:i2(e);a2(e)||t._err(e,ne.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=P.BEFORE_HTML}function mo(t,e){t._err(e,ne.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,dr.QUIRKS),t.insertionMode=P.BEFORE_HTML,t._processToken(e)}function x2(t,e){e.tagID===c.HTML?(t._insertElement(e,pe.HTML),t.insertionMode=P.BEFORE_HEAD):xo(t,e)}function R2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&xo(t,e)}function xo(t,e){t._insertFakeRootElement(),t.insertionMode=P.BEFORE_HEAD,t._processToken(e)}function D2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.HEAD:{t._insertElement(e,pe.HTML),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD;break}default:Ro(t,e)}}function k2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Ro(t,e):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Ro(t,e){t._insertFakeElement(Z.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD,t._processToken(e)}function Mr(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,$n.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,$n.RAWTEXT):(t._insertElement(e,pe.HTML),t.insertionMode=P.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,$n.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,$n.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=P.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(P.IN_TEMPLATE);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Do(t,e)}}function P2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=P.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Do(t,e);break}case c.TEMPLATE:{Ja(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Ja(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,ne.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Do(t,e){t.openElements.pop(),t.insertionMode=P.AFTER_HEAD,t._processToken(e)}function M2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{Mr(t,e);break}case c.NOSCRIPT:{t._err(e,ne.nestedNoscriptInHead);break}default:ko(t,e)}}function B2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=P.IN_HEAD;break}case c.BR:{ko(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function ko(t,e){const n=e.type===lt.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=P.IN_HEAD,t._processToken(e)}function F2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BODY:{t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,ne.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),Mr(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Po(t,e)}}function U2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Po(t,e);break}case c.TEMPLATE:{Ja(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Po(t,e){t._insertFakeElement(Z.BODY,c.BODY),t.insertionMode=P.IN_BODY,rc(t,e)}function rc(t,e){switch(e.type){case lt.CHARACTER:{Tg(t,e);break}case lt.WHITESPACE_CHARACTER:{_g(t,e);break}case lt.COMMENT:{Hd(t,e);break}case lt.START_TAG:{Ln(t,e);break}case lt.END_TAG:{sc(t,e);break}case lt.EOF:{wg(t,e);break}}}function _g(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Tg(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function H2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function q2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function j2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET)}function $2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function Y2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Ud.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,pe.HTML)}function z2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function W2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),n||(t.formElement=t.openElements.current))}function G2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function K2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.tokenizer.state=$n.PLAINTEXT}function V2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1}function X2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Z.A);n&&(Th(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Q2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Z2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(Th(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function J2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function eA(t,e){t.treeAdapter.getDocumentMode(t.document)!==dr.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_TABLE}function Ag(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function yg(t){const e=cg(t,Pa.TYPE);return e!=null&&e.toLowerCase()===b2}function tA(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),yg(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function nA(t,e){t._appendElement(e,pe.HTML),e.ackSelfClosing=!0}function rA(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function sA(t,e){e.tagName=Z.IMG,e.tagID=c.IMG,Ag(t,e)}function aA(t,e){t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.tokenizer.state=$n.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=P.TEXT}function iA(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,$n.RAWTEXT)}function oA(t,e){t.framesetOk=!1,t._switchToTextParsing(e,$n.RAWTEXT)}function z0(t,e){t._switchToTextParsing(e,$n.RAWTEXT)}function uA(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===P.IN_TABLE||t.insertionMode===P.IN_CAPTION||t.insertionMode===P.IN_TABLE_BODY||t.insertionMode===P.IN_ROW||t.insertionMode===P.IN_CELL?P.IN_SELECT_IN_TABLE:P.IN_SELECT}function lA(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function cA(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,pe.HTML)}function dA(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,pe.HTML)}function fA(t,e){t._reconstructActiveFormattingElements(),gg(e),_h(e),e.selfClosing?t._appendElement(e,pe.MATHML):t._insertElement(e,pe.MATHML),e.ackSelfClosing=!0}function hA(t,e){t._reconstructActiveFormattingElements(),vg(e),_h(e),e.selfClosing?t._appendElement(e,pe.SVG):t._insertElement(e,pe.SVG),e.ackSelfClosing=!0}function W0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function Ln(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{Q2(t,e);break}case c.A:{X2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{Y2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{$2(t,e);break}case c.LI:case c.DD:case c.DT:{G2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{Ag(t,e);break}case c.HR:{rA(t,e);break}case c.RB:case c.RTC:{cA(t,e);break}case c.RT:case c.RP:{dA(t,e);break}case c.PRE:case c.LISTING:{z2(t,e);break}case c.XMP:{iA(t,e);break}case c.SVG:{hA(t,e);break}case c.HTML:{H2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{Mr(t,e);break}case c.BODY:{q2(t,e);break}case c.FORM:{W2(t,e);break}case c.NOBR:{Z2(t,e);break}case c.MATH:{fA(t,e);break}case c.TABLE:{eA(t,e);break}case c.INPUT:{tA(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{nA(t,e);break}case c.IMAGE:{sA(t,e);break}case c.BUTTON:{V2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{J2(t,e);break}case c.IFRAME:{oA(t,e);break}case c.SELECT:{uA(t,e);break}case c.OPTION:case c.OPTGROUP:{lA(t,e);break}case c.NOEMBED:case c.NOFRAMES:{z0(t,e);break}case c.FRAMESET:{j2(t,e);break}case c.TEXTAREA:{aA(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?z0(t,e):W0(t,e);break}case c.PLAINTEXT:{K2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:W0(t,e)}}function pA(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function mA(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,Dg(t,e))}function gA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function vA(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function bA(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(Z.P,c.P),t._closePElement()}function EA(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function _A(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function TA(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function AA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function yA(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Z.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function Ng(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const a=t.openElements.items[s],i=t.openElements.tagIDs[s];if(r===i&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(a,i))break}}function sc(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{Th(t,e);break}case c.P:{bA(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{gA(t,e);break}case c.LI:{EA(t);break}case c.DD:case c.DT:{_A(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{TA(t);break}case c.BR:{yA(t);break}case c.BODY:{pA(t,e);break}case c.HTML:{mA(t,e);break}case c.FORM:{vA(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{AA(t,e);break}case c.TEMPLATE:{Ja(t,e);break}default:Ng(t,e)}}function wg(t,e){t.tmplInsertionModeStack.length>0?Rg(t,e):Ah(t,e)}function NA(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function wA(t,e){t._err(e,ne.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function zc(t,e){if(t.openElements.currentTagId!==void 0&&bg.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=P.IN_TABLE_TEXT,e.type){case lt.CHARACTER:{Ig(t,e);break}case lt.WHITESPACE_CHARACTER:{Sg(t,e);break}}else Eu(t,e)}function SA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CAPTION}function IA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_COLUMN_GROUP}function CA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.COLGROUP,c.COLGROUP),t.insertionMode=P.IN_COLUMN_GROUP,yh(t,e)}function LA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_TABLE_BODY}function OA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.TBODY,c.TBODY),t.insertionMode=P.IN_TABLE_BODY,ac(t,e)}function xA(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function RA(t,e){yg(e)?t._appendElement(e,pe.HTML):Eu(t,e),e.ackSelfClosing=!0}function DA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,pe.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function zi(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{OA(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}case c.COL:{CA(t,e);break}case c.FORM:{DA(t,e);break}case c.TABLE:{xA(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{LA(t,e);break}case c.INPUT:{RA(t,e);break}case c.CAPTION:{SA(t,e);break}case c.COLGROUP:{IA(t,e);break}default:Eu(t,e)}}function Wo(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Ja(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Eu(t,e)}}function Eu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,rc(t,e),t.fosterParentingEnabled=n}function Sg(t,e){t.pendingCharacterTokens.push(e)}function Ig(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function go(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Eu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Cg=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function kA(t,e){const n=e.tagID;Cg.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,zi(t,e)):Ln(t,e)}function PA(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,n===c.TABLE&&Wo(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:sc(t,e)}}function yh(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.COL:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{Mr(t,e);break}default:Ol(t,e)}}function MA(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TEMPLATE:{Ja(t,e);break}case c.COL:break;default:Ol(t,e)}}function Ol(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE,t._processToken(e))}function ac(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(Z.TR,c.TR),t.insertionMode=P.IN_ROW,ic(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,zi(t,e));break}default:zi(t,e)}}function qd(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,Wo(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:Wo(t,e)}}function ic(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,ac(t,e));break}default:zi(t,e)}}function Lg(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,qd(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,qd(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:Wo(t,e)}}function BA(t,e){const n=e.tagID;Cg.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),ic(t,e)):Ln(t,e)}function FA(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Lg(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:sc(t,e)}}function Og(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}}}function xg(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Ja(t,e);break}}}function UA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Og(t,e)}function HA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):xg(t,e)}function qA(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{Mr(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=P.IN_TABLE,t.insertionMode=P.IN_TABLE,zi(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=P.IN_COLUMN_GROUP,t.insertionMode=P.IN_COLUMN_GROUP,yh(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=P.IN_TABLE_BODY,t.insertionMode=P.IN_TABLE_BODY,ac(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=P.IN_ROW,t.insertionMode=P.IN_ROW,ic(t,e);break}default:t.tmplInsertionModeStack[0]=P.IN_BODY,t.insertionMode=P.IN_BODY,Ln(t,e)}}function jA(t,e){e.tagID===c.TEMPLATE&&Ja(t,e)}function Rg(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Ah(t,e)}function $A(t,e){e.tagID===c.HTML?Ln(t,e):xl(t,e)}function Dg(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=P.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else xl(t,e)}function xl(t,e){t.insertionMode=P.IN_BODY,rc(t,e)}function YA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.FRAMESET:{t._insertElement(e,pe.HTML);break}case c.FRAME:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{Mr(t,e);break}}}function zA(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=P.AFTER_FRAMESET))}function WA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function GA(t,e){e.tagID===c.HTML&&(t.insertionMode=P.AFTER_AFTER_FRAMESET)}function KA(t,e){e.tagID===c.HTML?Ln(t,e):hl(t,e)}function hl(t,e){t.insertionMode=P.IN_BODY,rc(t,e)}function VA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function XA(t,e){e.chars=Ht,t._insertCharacters(e)}function QA(t,e){t._insertCharacters(e),t.framesetOk=!1}function kg(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==pe.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function ZA(t,e){if(h2(e))kg(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===pe.MATHML?gg(e):r===pe.SVG&&(p2(e),vg(e)),_h(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function JA(t,e){if(e.tagID===c.P||e.tagID===c.BR){kg(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===pe.HTML){t._endTagOutsideForeignContent(e);break}const s=t.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,t.openElements.shortenToLength(n);break}}}function Pg(t,e){return function(r){let s,a=0,i="";for(;s=t.exec(r);)a!==s.index&&(i+=r.substring(a,s.index)),i+=e.get(s[0].charCodeAt(0)),a=s.index+1;return i+r.substring(a)}}const ey=Pg(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),ty=Pg(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),ny=new Set([Z.AREA,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BR,Z.COL,Z.EMBED,Z.FRAME,Z.HR,Z.IMG,Z.INPUT,Z.KEYGEN,Z.LINK,Z.META,Z.PARAM,Z.SOURCE,Z.TRACK,Z.WBR]);function Mg(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===pe.HTML&&ny.has(e.treeAdapter.getTagName(t))}const ry={treeAdapter:ps,scriptingEnabled:!0};function sy(t,e){const n={...ry,...e};return Mg(t,n)?"":Bg(t,n)}function Bg(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===Z.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===pe.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=ay(a,e);return n}function ay(t,e){return e.treeAdapter.isElementNode(t)?iy(t,e):e.treeAdapter.isTextNode(t)?uy(t,e):e.treeAdapter.isCommentNode(t)?ly(t,e):e.treeAdapter.isDocumentTypeNode(t)?cy(t,e):""}function iy(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${oy(t,e)}>${Mg(t,e)?"":`${Bg(t,e)}</${n}>`}`}function oy(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case pe.XML:{n+=`xml:${r.name}`;break}case pe.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case pe.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${ey(r.value)}"`}return n}function uy(t,e){const{treeAdapter:n}=e,r=n.getTextNodeContent(t),s=n.getParentNode(t),a=s&&n.isElementNode(s)&&n.getTagName(s);return a&&n.getNamespaceURI(s)===pe.HTML&&qT(a,e.scriptingEnabled)?r:ty(r)}function ly(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function cy(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function dy(t,e){return Eg.parse(t,e)}function Nh(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Eg.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Xn(t){return"tagName"in t}function ss(t){return t.nodeName==="#text"}function xt(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function Zs(t,e){return t.attrs.some(n=>n.name===e)}function G0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function wh(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Js(t){return Nh(t).childNodes}function fy(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function Wi(t){return fy(t)?dy(t).childNodes:Nh(t).childNodes}function hy(t){const e=Nh("");return e.childNodes=t,sy(e)}const Sh={image:{type:"image",valueKind:"asset",control:"image",multiline:!1},file:{type:"file",valueKind:"asset",control:"file",multiline:!1},url:{type:"url",valueKind:"url",control:"url",multiline:!1},email:{type:"email",valueKind:"text",control:"email",multiline:!1},phone:{type:"phone",valueKind:"text",control:"phone",multiline:!1},date:{type:"date",valueKind:"text",control:"date",multiline:!1},time:{type:"time",valueKind:"text",control:"time",multiline:!1},code:{type:"code",valueKind:"text",control:"code",multiline:!0},richtext:{type:"richtext",valueKind:"html",control:"richtext",multiline:!0},authors:{type:"authors",valueKind:"authors",control:"authors",multiline:!1},text:{type:"text",valueKind:"text",control:"text",multiline:!0},shorttext:{type:"shorttext",valueKind:"text",control:"shorttext",multiline:!1}};function py(t){return Object.prototype.hasOwnProperty.call(Sh,t)}function za(t){return Sh[t].valueKind}const my=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),gy=new Set(["code","pre","kbd","samp"]),vy=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Ma(t){if(t.annotation!==void 0&&py(t.annotation))return t.annotation;if(t.attribute!==void 0){const e=t.attribute,n=(t.valuePrefix??"").toLowerCase();if(e==="href"){if(n.endsWith("mailto:"))return"email";if(n.endsWith("tel:"))return"phone";if(t.wholeValue)return t.download===!0?"file":"url"}return t.wholeValue&&e==="src"?t.tag==="img"?"image":"file":t.wholeValue&&t.tag==="source"&&e==="srcset"?"file":"shorttext"}return gy.has(t.tag)?"code":my.has(t.tag)?"shorttext":vy.has(t.tag)?"text":"shorttext"}const by=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function Ts(t){const e=[];for(const n of t.matchAll(by)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Ba(t){var r;const e=t.trim(),n=Ts(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function oc(t,e){return t.replace(/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g,(n,r)=>{const s=r.split(".");return e({raw:n,name:s[0]??"",path:s,dotted:s.length>1})})}function Ih(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function Fg(t){const e=K0(xt(t,"data-minlength")),n=K0(xt(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function K0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function Xr(t,e=new Map){return Hg(t,e,new Set)}function Ug(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=Hg(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function Hg(t,e,n){const r=[],s=new Map,a=h=>{const g=s.get(h);if(g!==void 0)return g;const f={name:h,type:"shorttext",label:ph(h),required:!1,multiline:!1};return s.set(h,f),r.push(h),f},i=(h,g)=>{if(s.has(h))return;const f=a(h);f.type=g,f.multiline=Sh[g].multiline},o=h=>{const g=xt(h,"data-field")??Ey(h);if(g===void 0)return;const f=a(g);Zs(h,"data-required")&&(f.required=!0);const p=xt(h,"data-help");p!==void 0&&(f.help=p);const v=xt(h,"data-label");v!==void 0&&(f.label=v);const{minLength:b,maxLength:E}=Fg(h);b!==void 0&&(f.minLength=b),E!==void 0&&(f.maxLength=E)},l=h=>{const g=Ba(h);for(const f of Ts(h))f.dotted||i(f.name,Ma({tag:"",wholeValue:(g==null?void 0:g.name)===f.name}))},d=h=>{for(const g of h){if(!Xn(g)){ss(g)&&l(g.value);continue}const f=xt(g,"data-each");if(f!==void 0){const b=a(f);b.type="url",b.multiple=!0;const E=xt(g,"data-pick-from");E!==void 0&&(b.pickFrom=E),o(g);continue}if(Zs(g,"data-each-in"))continue;const p=xt(g,"data-type"),v=e.has(g.tagName)?Ug(g.tagName,e,n):void 0;for(const b of g.attrs){const E=Ba(b.value);for(const _ of Ts(b.value)){if(_.dotted)continue;const R=(E==null?void 0:E.name)===_.name,O=R?v==null?void 0:v.get(b.name):void 0;i(_.name,O??Ma({tag:g.tagName,attribute:b.name,wholeValue:R,valuePrefix:Ih(b.value),download:Zs(g,"download"),...p!==void 0&&{annotation:p}}))}}for(const b of g.childNodes){if(!ss(b))continue;const E=Ba(b.value);for(const _ of Ts(b.value))_.dotted||i(_.name,Ma({tag:g.tagName,wholeValue:(E==null?void 0:E.name)===_.name,...p!==void 0&&{annotation:p}}))}o(g),d(g.childNodes)}};return d(Wi(t)),r.map(h=>_y(s.get(h)))}function Ey(t){for(const e of t.attrs){const n=Ts(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(ss(e)){const n=Ts(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function _y(t){return{name:t.name,type:t.type,label:t.label,required:t.required,multiline:t.multiline,...t.help!==void 0&&{help:t.help},...t.minLength!==void 0&&{minLength:t.minLength},...t.maxLength!==void 0&&{maxLength:t.maxLength},...t.multiple!==void 0&&{multiple:t.multiple},...t.pickFrom!==void 0&&{pickFrom:t.pickFrom}}}function Ty(t,e){if(t===e)return!1;const n=za(t),r=za(e);return r==="html"?!1:n==="html"||t==="date"&&e==="time"||t==="time"&&e==="date"||(a=>a==="shorttext"||a==="text"||a==="code"||a==="email"||a==="phone")(t)&&(e==="date"||e==="time")?!0:!(n===r||r==="text")}function Ay(t,e){const n=new Map(t.map(o=>[o.name,o])),r=new Map(e.map(o=>[o.name,o])),s=[],a=[],i=[];for(const[o,l]of n){const d=r.get(o);d===void 0?a.push({name:o,type:l.type}):d.type!==l.type&&i.push({name:o,from:l.type,to:d.type,destructive:Ty(l.type,d.type)})}for(const[o,l]of r)n.has(o)||s.push({name:o,type:l.type});return{added:s.sort((o,l)=>o.name.localeCompare(l.name)),removed:a.sort((o,l)=>o.name.localeCompare(l.name)),typeChanged:i.sort((o,l)=>o.name.localeCompare(l.name))}}const V0=/^(.+)@v([1-9]\d*)$/;function Ch(t){const e=V0.exec(t);if(!e)return null;const n=e[1];return V0.test(n)?null:{base:n,version:Number.parseInt(e[2],10)}}function jd(t){return Ch(t)!==null}function dk(t){const e=Ch(t);return e?e.base:t}function yy(t){const e=Ch(t);return e?e.version:null}const X0="ref:";function uc(t){return t.startsWith(X0)?t.slice(X0.length):void 0}function Q0(t){const e=new Set,n=r=>{for(const s of r)if(Xn(s)){for(const a of s.attrs){const i=uc(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(Wi(t)),[...e].sort()}function $d(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,o=new Set,l=new Map,d=new Set,h=g=>{for(const f of g){if(!Xn(f))continue;const p=Ny(f);p!==void 0&&o.add(p);const v=xt(f,"data-each-in");if(v!==void 0){r.push(v);continue}const b=xt(f,"data-each");if(b!==void 0&&s.push(b),Zs(f,"data-required")){const O=Z0(f);O!==void 0&&n.add(O)}const E=Fg(f);if(E.minLength!==void 0||E.maxLength!==void 0){const O=Z0(f);O!==void 0&&l.set(O,E)}const _=xt(f,"data-type"),R=e.has(f.tagName)?Ug(f.tagName,e,new Set):void 0;for(const O of f.attrs){const B=uc(O.value);B!==void 0&&d.add(B);const M=Ba(O.value);if(M===null||M.dotted)continue;const J=(R==null?void 0:R.get(O.name))??Ma({tag:f.tagName,attribute:O.name,wholeValue:!0,valuePrefix:Ih(O.value),download:Zs(f,"download"),..._!==void 0&&{annotation:_}});J==="image"?a.add(M.name):J==="file"?i.add(M.name):J==="richtext"&&o.add(M.name)}h(f.childNodes)}};return h(Wi(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...o],constraints:l,references:[...d].sort()}}function Ny(t){const e=t.childNodes.filter(i=>!(ss(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!ss(n))return;const r=Ba(n.value);if(r===null||r.dotted)return;const s=xt(t,"data-type"),a=Ma({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return za(a)==="html"?r.name:void 0}function Z0(t){const e=xt(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=Ts(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(ss(n)){const r=Ts(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function wy(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Sy(t){return JSON.stringify(t).slice(1,-1)}function Rl(t){let e="";for(const r of t){const s=r.codePointAt(0);s!==void 0&&s>32&&(e+=r)}const n=e.toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")?"#":t}function Iy(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(n===null||typeof n!="object")continue;const r=n,s=typeof r.name=="string"?r.name:"";s.trim()!==""&&e.push({name:s,...typeof r.user=="string"&&r.user!==""&&{user:r.user},...typeof r.href=="string"&&r.href!==""&&{href:r.href}})}return e}function Cy(t){if(t.length===0)return"";if(t.length===1)return t[0]??"";const e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`}function Ly(t,e){const n=Iy(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return wy((s==null?void 0:s.displayName)??r.name)});return Cy(n)}const J0="public, max-age=31536000, immutable",Oy=[400,800,1200,1600],xy={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function Ry(t){return t==="jpeg"?"jpg":t}function qg(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function jg(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t[n]??0,e=Math.imul(e,16777619);return(e>>>0).toString(36)}function $g(t,e,n,r,s){var v;const a=qg(t),i=t.slice(0,t.lastIndexOf(".")>=0?t.lastIndexOf("."):t.length),o=[],l=new Map;for(const b of[...r].sort((E,_)=>E.width-_.width)){const E=`${i}.${e}-${b.width}.${Ry(b.format)}`,_=s(b);o.push(_===void 0?{path:E,contents:Dy,cacheControl:J0,present:!0}:{path:E,contents:_,cacheControl:J0});const R=l.get(b.format)??[];R.push({url:`/${E}`,width:b.width}),l.set(b.format,R)}const d=b=>(l.get(b)??[]).map(E=>`${E.url} ${E.width}w`).join(", "),h=["avif","webp"].filter(b=>l.has(b)).map(b=>({format:b,mime:xy[b],srcset:d(b)})),g=l.get(a)??[],f=((v=g[g.length-1])==null?void 0:v.url)??`/${t}`,p={width:n.width,height:n.height,sources:h,fallbackSrc:f,...n.blurDataUri!==void 0&&{blurDataUri:n.blurDataUri}};return{artifacts:o,info:p}}const Dy=new Uint8Array(0);async function ky(t,e,n){const r=qg(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:Oy,formats:s}),i=jg(t),o=new Map,l=[];for(const f of a.variants)o.set(ep(f),f.bytes),l.push({format:f.format,width:f.width});const{artifacts:d,info:h}=$g(e,i,{width:a.sourceWidth,height:a.sourceHeight,...Yd(a.blurDataUri)},l,f=>o.get(ep(f))),g={sourceWidth:a.sourceWidth,sourceHeight:a.sourceHeight,variants:[...l].sort((f,p)=>f.width-p.width),...Yd(a.blurDataUri)};return{artifacts:d,info:h,cached:g}}function Py(t,e,n){return $g(t,e,{width:n.sourceWidth,height:n.sourceHeight,...Yd(n.blurDataUri)},n.variants,()=>{})}function ep(t){return`${t.format}-${t.width}`}function Yd(t){return t!==void 0?{blurDataUri:t}:{}}function Yg(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${Wc(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Wc(i)}"`).join(""),s=`<img src="${Wc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const My=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],By=["data-type","data-field","data-required","data-help","data-label"];function zd(t){const e={components:t.components,usedComponents:new Set,...t.context!==void 0&&{context:t.context},...t.media!==void 0&&{media:t.media},...t.authorDirectory!==void 0&&{authorDirectory:t.authorDirectory},...t.componentStyles!==void 0&&{componentStyles:t.componentStyles}},n=Go(Wi(t.template),t.scope,e),r=t.document===void 0?n:Kg(Go(Wi(t.document),t.scope,e),n);return Fy(r,t,e),hy(r)}function Fy(t,e,n){var i,o,l,d;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const h=Js(`<style>
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-B61rHJkg.js","./TemplatesPane-C-T4XiLp.css","./MigrationsPane-Gl4TRput.js","./MigrationsPane-BAHPPSXP.css"])))=>i.map(i=>d[i]);
2
+ var nE=Object.defineProperty;var b0=t=>{throw TypeError(t)};var rE=(t,e,n)=>e in t?nE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ye=(t,e,n)=>rE(t,typeof e!="symbol"?e+"":e,n),kc=(t,e,n)=>e.has(t)||b0("Cannot "+n);var V=(t,e,n)=>(kc(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?b0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ye=(t,e,n,r)=>(kc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),rt=(t,e,n)=>(kc(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const Q1=!1;var Jf=Array.isArray,sE=Array.prototype.indexOf,xa=Array.prototype.includes,Vl=Array.from,aE=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,Z1=Object.getOwnPropertyDescriptors,iE=Object.prototype,oE=Array.prototype,eh=Object.getPrototypeOf,E0=Object.isExtensible;function co(t){return typeof t=="function"}const th=()=>{};function uE(t){return t()}function bd(t){for(var e=0;e<t.length;e++)t[e]()}function J1(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function lE(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const n=[];for(const r of t)if(n.push(r),n.length===e)break;return n}const Tn=2,Fi=4,hu=8,nh=1<<24,Cr=16,Dr=32,ta=64,Ed=128,gr=512,an=1024,pn=2048,ns=4096,Pn=8192,vr=16384,Xa=32768,_d=1<<25,As=65536,Al=1<<17,cE=1<<18,eo=1<<19,em=1<<20,Vr=1<<25,Ha=65536,yl=1<<21,Ai=1<<22,Qs=1<<23,Qr=Symbol("$state"),tm=Symbol("legacy props"),dE=Symbol(""),il=Symbol("attributes"),Td=Symbol("class"),Ad=Symbol("style"),_o=Symbol("text"),ol=Symbol("form reset"),Xl=new class extends Error{constructor(){super(...arguments);ye(this,"name","StaleReactionError");ye(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var K1;const rh=!!((K1=globalThis.document)!=null&&K1.contentType)&&globalThis.document.contentType.includes("xml");function nm(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function fE(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hE(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function pE(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function mE(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gE(t){throw new Error("https://svelte.dev/e/effect_orphan")}function vE(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bE(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function EE(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function _E(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function TE(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function AE(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const yE=1,NE=2,rm=4,wE=8,SE=16,IE=1,CE=2,LE=4,OE=8,xE=16,RE=1,DE=2,Zt=Symbol("uninitialized"),sm="http://www.w3.org/1999/xhtml",kE="http://www.w3.org/2000/svg",PE="@attach";function ME(){console.warn("https://svelte.dev/e/derived_inert")}function BE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function FE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function am(t){return t===this.v}function UE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function im(t){return!UE(t,this.v)}let to=!1,HE=!1;function qE(){to=!0}let Ct=null;function Ui(t){Ct=t}function jE(t){return $E().get(t)}function at(t,e=!1,n){Ct={p:Ct,i:!1,c:null,e:null,s:t,x:null,r:Ze,l:to&&!e?{s:null,u:null,$:[]}:null}}function it(t){var e=Ct,n=e.e;if(n!==null){e.e=null;for(var r of n)Lm(r)}return e.i=!0,Ct=e.p,{}}function no(){return!to||Ct!==null&&Ct.l===null}function $E(t){return Ct===null&&nm(),Ct.c??(Ct.c=new Map(YE(Ct)||void 0))}function YE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let Ta=[];function om(){var t=Ta;Ta=[],bd(t)}function xr(t){if(Ta.length===0&&!Co){var e=Ta;queueMicrotask(()=>{e===Ta&&om()})}Ta.push(t)}function zE(){for(;Ta.length>0;)om()}function um(t){var e=Ze;if(e===null)return et.f|=Qs,t;if((e.f&Xa)===0&&(e.f&Fi)===0)throw t;Ys(t,e)}function Ys(t,e){for(;e!==null;){if((e.f&Ed)!==0){if((e.f&Xa)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const WE=-7169;function zt(t,e){t.f=t.f&WE|e}function sh(t){(t.f&gr)!==0||t.deps===null?zt(t,an):zt(t,ns)}function lm(t){if(t!==null)for(const e of t)(e.f&Tn)===0||(e.f&Ha)===0||(e.f^=Ha,lm(e.deps))}function cm(t,e,n){(t.f&pn)!==0?e.add(t):(t.f&ns)!==0&&n.add(t),lm(t.deps),zt(t,an)}let Pu=!1;function GE(t){var e=Pu;try{return Pu=!1,[t(),Pu]}finally{Pu=e}}let Pc=null,li=null,Fe=null,Io=null,bn=null,yd=null,Co=!1,Mc=!1,Ei=null,ul=null;var _0=0;let KE=1;var Li,Us,wa,Oi,xi,Sa,Ri,ms,au,zn,iu,Hs,zr,Wr,Di,Ia,vt,Nd,To,wd,dm,fm,ll,VE,Sd,di;const Yl=class Yl{constructor(){Ue(this,vt);ye(this,"id",KE++);Ue(this,Li,!1);ye(this,"linked",!0);Ue(this,Us,null);Ue(this,wa,null);ye(this,"async_deriveds",new Map);ye(this,"current",new Map);ye(this,"previous",new Map);ye(this,"unblocked",new Set);Ue(this,Oi,new Set);Ue(this,xi,new Set);Ue(this,Sa,new Set);Ue(this,Ri,0);Ue(this,ms,new Map);Ue(this,au,null);Ue(this,zn,[]);Ue(this,iu,[]);Ue(this,Hs,new Set);Ue(this,zr,new Set);Ue(this,Wr,new Map);Ue(this,Di,new Set);ye(this,"is_fork",!1);Ue(this,Ia,!1)}skip_effect(e){V(this,Wr).has(e)||V(this,Wr).set(e,{d:[],m:[]}),V(this,Di).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=V(this,Wr).get(e);if(r){V(this,Wr).delete(e);for(var s of r.d)zt(s,pn),n(s);for(s of r.m)zt(s,ns),n(s)}V(this,Di).add(e)}capture(e,n,r=!1){e.v!==Zt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Qs)===0&&(this.current.set(e,[n,r]),bn==null||bn.set(e,n)),this.is_fork||(e.v=n)}activate(){Fe=this}deactivate(){Fe=null,bn=null}flush(){try{Mc=!0,Fe=this,rt(this,vt,To).call(this)}finally{_0=0,yd=null,Ei=null,ul=null,Mc=!1,Fe=null,bn=null,Ra.clear()}}discard(){for(const e of V(this,xi))e(this);V(this,xi).clear(),V(this,Sa).clear(),rt(this,vt,di).call(this)}register_created_effect(e){V(this,iu).push(e)}increment(e,n){if(Ye(this,Ri,V(this,Ri)+1),e){let r=V(this,ms).get(n)??0;V(this,ms).set(n,r+1)}}decrement(e,n){if(Ye(this,Ri,V(this,Ri)-1),e){let r=V(this,ms).get(n)??0;r===1?V(this,ms).delete(n):V(this,ms).set(n,r-1)}V(this,Ia)||(Ye(this,Ia,!0),xr(()=>{Ye(this,Ia,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)V(this,Hs).add(r);for(const r of n)V(this,zr).add(r);e.clear(),n.clear()}oncommit(e){V(this,Oi).add(e)}ondiscard(e){V(this,xi).add(e)}on_fork_commit(e){V(this,Sa).add(e)}run_fork_commit_callbacks(){for(const e of V(this,Sa))e(this);V(this,Sa).clear()}settled(){return(V(this,au)??Ye(this,au,J1())).promise}static ensure(){var e;if(Fe===null){const n=Fe=new Yl;rt(e=n,vt,Sd).call(e),!Mc&&!Co&&xr(()=>{V(n,Li)||n.flush()})}return Fe}apply(){{bn=null;return}}schedule(e){var s;if(yd=e,(s=e.b)!=null&&s.is_pending&&(e.f&(Fi|hu|nh))!==0&&(e.f&Xa)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(Ei!==null&&n===Ze&&(et===null||(et.f&Tn)===0))return;if((r&(ta|Dr))!==0){if((r&an)===0)return;n.f^=an}}V(this,zn).push(n)}};Li=new WeakMap,Us=new WeakMap,wa=new WeakMap,Oi=new WeakMap,xi=new WeakMap,Sa=new WeakMap,Ri=new WeakMap,ms=new WeakMap,au=new WeakMap,zn=new WeakMap,iu=new WeakMap,Hs=new WeakMap,zr=new WeakMap,Wr=new WeakMap,Di=new WeakMap,Ia=new WeakMap,vt=new WeakSet,Nd=function(){if(this.is_fork)return!0;for(const r of V(this,ms).keys()){for(var e=r,n=!1;e.parent!==null;){if(V(this,Wr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},To=function(){var l,d,f,g;if(Ye(this,Li,!0),_0++>1e3&&(rt(this,vt,di).call(this),QE()),!rt(this,vt,Nd).call(this)){for(const h of V(this,Hs))V(this,zr).delete(h),zt(h,pn),this.schedule(h);for(const h of V(this,zr))zt(h,ns),this.schedule(h)}const e=V(this,zn);Ye(this,zn,[]),this.apply();var n=Ei=[],r=[],s=ul=[];for(const h of e)try{rt(this,vt,wd).call(this,h,n,r)}catch(p){throw mm(h),p}if(Fe=null,s.length>0){var a=Yl.ensure();for(const h of s)a.schedule(h)}if(Ei=null,ul=null,rt(this,vt,Nd).call(this)){rt(this,vt,ll).call(this,r),rt(this,vt,ll).call(this,n);for(const[h,p]of V(this,Wr))pm(h,p);s.length>0&&rt(l=Fe,vt,To).call(l);return}const i=rt(this,vt,dm).call(this);if(i){rt(d=i,vt,fm).call(d,this);return}V(this,Hs).clear(),V(this,zr).clear();for(const h of V(this,Oi))h(this);V(this,Oi).clear(),Io=this,T0(r),T0(n),Io=null,(f=V(this,au))==null||f.resolve();var o=Fe;if(this.linked&&V(this,Ri)===0&&rt(this,vt,di).call(this),V(this,zn).length>0){o===null&&(o=this,rt(this,vt,Sd).call(this));const h=o;V(h,zn).push(...V(this,zn).filter(p=>!V(h,zn).includes(p)))}o!==null&&rt(g=o,vt,To).call(g)},wd=function(e,n,r){e.f^=an;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Dr|ta))!==0,o=i&&(a&an)!==0,l=o||(a&Pn)!==0||V(this,Wr).has(s);if(!l&&s.fn!==null){i?s.f^=an:(a&Fi)!==0?n.push(s):gu(s)&&((a&Cr)!==0&&V(this,zr).add(s),$i(s));var d=s.first;if(d!==null){s=d;continue}}for(;s!==null;){var f=s.next;if(f!==null){s=f;break}s=s.parent}}},dm=function(){for(var e=V(this,Us);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=V(e,Us)}return null},fm=function(e){var r;for(const[s,a]of e.current)!this.previous.has(s)&&e.previous.has(s)&&this.previous.set(s,e.previous.get(s)),this.current.set(s,a);for(const[s,a]of e.async_deriveds){const i=this.async_deriveds.get(s);i&&a.promise.then(i.resolve)}const n=s=>{var a=s.reactions;if(a!==null)for(const l of a){var i=l.f;if((i&Tn)!==0)n(l);else{var o=l;i&(Ai|Cr)&&!this.async_deriveds.has(o)&&(V(this,zr).delete(o),zt(o,pn),this.schedule(o))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),rt(r=e,vt,di).call(r),Fe=this,rt(this,vt,To).call(this)},ll=function(e){for(var n=0;n<e.length;n+=1)cm(e[n],V(this,Hs),V(this,zr))},VE=function(){var f;rt(this,vt,di).call(this);for(let g=Pc;g!==null;g=V(g,wa)){var e=g.id<this.id,n=[];for(const[h,[p,v]]of this.current){if(g.current.has(h)){var r=g.current.get(h)[0];if(e&&p!==r)g.current.set(h,[p,v]);else continue}n.push(h)}if(e)for(const[h,p]of this.async_deriveds){const v=g.async_deriveds.get(h);v&&p.promise.then(v.resolve)}if(V(g,Li)){var s=[...g.current.keys()].filter(h=>!this.current.has(h));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const h of V(this,Di))g.unskip_effect(h,p=>{var v;(p.f&(Cr|Ai))!==0?g.schedule(p):rt(v=g,vt,ll).call(v,[p])});g.activate();var a=new Set,i=new Map;for(var o of n)hm(o,s,a,i);i=new Map;var l=[...g.current.keys()].filter(h=>this.current.has(h)?this.current.get(h)[0]!==h.v:!0);if(l.length>0)for(const h of V(this,iu))(h.f&(vr|Pn|Al))===0&&ah(h,l,i)&&((h.f&(Ai|Cr))!==0?(zt(h,pn),g.schedule(h)):V(g,Hs).add(h));if(V(g,zn).length>0&&!V(g,Ia)){g.apply();for(var d of V(g,zn))rt(f=g,vt,wd).call(f,d,[],[]);Ye(g,zn,[])}g.deactivate()}}}},Sd=function(){li===null?Pc=li=this:(Ye(li,wa,this),Ye(this,Us,li)),li=this},di=function(){var e=V(this,Us),n=V(this,wa);e===null?Pc=n:Ye(e,wa,n),n===null?li=e:Ye(n,Us,e),this.linked=!1};let qa=Yl;function XE(t){var e=Co;Co=!0;try{for(var n;;){if(zE(),Fe===null)return n;Fe.flush()}}finally{Co=e}}function QE(){try{vE()}catch(t){Ys(t,yd)}}let Ar=null;function T0(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(vr|Pn))===0&&gu(r)&&(Ar=new Set,$i(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Rm(r),(Ar==null?void 0:Ar.size)>0)){Ra.clear();for(const s of Ar){if((s.f&(vr|Pn))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)Ar.has(i)&&(Ar.delete(i),a.push(i)),i=i.parent;for(let o=a.length-1;o>=0;o--){const l=a[o];(l.f&(vr|Pn))===0&&$i(l)}}Ar.clear()}}Ar=null}}function hm(t,e,n,r){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const s of t.reactions){const a=s.f;(a&Tn)!==0?hm(s,e,n,r):(a&(Ai|Cr))!==0&&(a&pn)===0&&ah(s,e,r)&&(zt(s,pn),ih(s))}}function ah(t,e,n){const r=n.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const s of t.deps){if(xa.call(e,s))return!0;if((s.f&Tn)!==0&&ah(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function ih(t){Fe.schedule(t)}function pm(t,e){if(!((t.f&Dr)!==0&&(t.f&an)!==0)){(t.f&pn)!==0?e.d.push(t):(t.f&ns)!==0&&e.m.push(t),zt(t,an);for(var n=t.first;n!==null;)pm(n,e),n=n.next}}function mm(t){zt(t,an);for(var e=t.first;e!==null;)mm(e),e=e.next}function ZE(t){let e=0,n=ja(0),r;return()=>{ch()&&(u(n),Zl(()=>(e===0&&(r=ra(()=>t(()=>Lo(n)))),e+=1,()=>{xr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,Lo(n))})})))}}var JE=As|eo;function e_(t,e,n,r){new t_(t,e,n,r)}var or,Zf,ur,Ca,Un,lr,Rn,Wn,gs,La,qs,ki,ou,uu,vs,zl,Wt,n_,r_,s_,Id,cl,dl,Cd,Ld;class t_{constructor(e,n,r,s){Ue(this,Wt);ye(this,"parent");ye(this,"is_pending",!1);ye(this,"transform_error");Ue(this,or);Ue(this,Zf,null);Ue(this,ur);Ue(this,Ca);Ue(this,Un);Ue(this,lr,null);Ue(this,Rn,null);Ue(this,Wn,null);Ue(this,gs,null);Ue(this,La,0);Ue(this,qs,0);Ue(this,ki,!1);Ue(this,ou,new Set);Ue(this,uu,new Set);Ue(this,vs,null);Ue(this,zl,ZE(()=>(Ye(this,vs,ja(V(this,La))),()=>{Ye(this,vs,null)})));var a;Ye(this,or,e),Ye(this,ur,n),Ye(this,Ca,i=>{var o=Ze;o.b=this,o.f|=Ed,r(i)}),this.parent=Ze.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),Ye(this,Un,Qa(()=>{rt(this,Wt,Id).call(this)},JE))}defer_effect(e){cm(e,V(this,ou),V(this,uu))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!V(this,ur).pending}update_pending_count(e,n){rt(this,Wt,Cd).call(this,e,n),Ye(this,La,V(this,La)+e),!(!V(this,vs)||V(this,ki))&&(Ye(this,ki,!0),xr(()=>{Ye(this,ki,!1),V(this,vs)&&qi(V(this,vs),V(this,La))}))}get_effect_pending(){return V(this,zl).call(this),u(V(this,vs))}error(e){if(!V(this,ur).onerror&&!V(this,ur).failed)throw e;Fe!=null&&Fe.is_fork?(V(this,lr)&&Fe.skip_effect(V(this,lr)),V(this,Rn)&&Fe.skip_effect(V(this,Rn)),V(this,Wn)&&Fe.skip_effect(V(this,Wn)),Fe.on_fork_commit(()=>{rt(this,Wt,Ld).call(this,e)})):rt(this,Wt,Ld).call(this,e)}}or=new WeakMap,Zf=new WeakMap,ur=new WeakMap,Ca=new WeakMap,Un=new WeakMap,lr=new WeakMap,Rn=new WeakMap,Wn=new WeakMap,gs=new WeakMap,La=new WeakMap,qs=new WeakMap,ki=new WeakMap,ou=new WeakMap,uu=new WeakMap,vs=new WeakMap,zl=new WeakMap,Wt=new WeakSet,n_=function(){try{Ye(this,lr,qn(()=>V(this,Ca).call(this,V(this,or))))}catch(e){this.error(e)}},r_=function(e){const n=V(this,ur).failed;n&&Ye(this,Wn,qn(()=>{n(V(this,or),()=>e,()=>()=>{})}))},s_=function(){const e=V(this,ur).pending;e&&(this.is_pending=!0,Ye(this,Rn,qn(()=>e(V(this,or)))),xr(()=>{var n=Ye(this,gs,document.createDocumentFragment()),r=Zr();n.append(r),Ye(this,lr,rt(this,Wt,dl).call(this,()=>qn(()=>V(this,Ca).call(this,r)))),V(this,qs)===0&&(V(this,or).before(n),Ye(this,gs,null),Da(V(this,Rn),()=>{Ye(this,Rn,null)}),rt(this,Wt,cl).call(this,Fe))}))},Id=function(){try{if(this.is_pending=this.has_pending_snippet(),Ye(this,qs,0),Ye(this,La,0),Ye(this,lr,qn(()=>{V(this,Ca).call(this,V(this,or))})),V(this,qs)>0){var e=Ye(this,gs,document.createDocumentFragment());hh(V(this,lr),e);const n=V(this,ur).pending;Ye(this,Rn,qn(()=>n(V(this,or))))}else rt(this,Wt,cl).call(this,Fe)}catch(n){this.error(n)}},cl=function(e){this.is_pending=!1,e.transfer_effects(V(this,ou),V(this,uu))},dl=function(e){var n=Ze,r=et,s=Ct;rs(V(this,Un)),Er(V(this,Un)),Ui(V(this,Un).ctx);try{return qa.ensure(),e()}catch(a){return um(a),null}finally{rs(n),Er(r),Ui(s)}},Cd=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&rt(r=this.parent,Wt,Cd).call(r,e,n);return}Ye(this,qs,V(this,qs)+e),V(this,qs)===0&&(rt(this,Wt,cl).call(this,n),V(this,Rn)&&Da(V(this,Rn),()=>{Ye(this,Rn,null)}),V(this,gs)&&(V(this,or).before(V(this,gs)),Ye(this,gs,null)))},Ld=function(e){V(this,lr)&&(En(V(this,lr)),Ye(this,lr,null)),V(this,Rn)&&(En(V(this,Rn)),Ye(this,Rn,null)),V(this,Wn)&&(En(V(this,Wn)),Ye(this,Wn,null));var n=V(this,ur).onerror;let r=V(this,ur).failed;var s=!1,a=!1;const i=()=>{if(s){FE();return}s=!0,a&&AE(),V(this,Wn)!==null&&Da(V(this,Wn),()=>{Ye(this,Wn,null)}),rt(this,Wt,dl).call(this,()=>{rt(this,Wt,Id).call(this)})},o=l=>{try{a=!0,n==null||n(l,i),a=!1}catch(d){Ys(d,V(this,Un)&&V(this,Un).parent)}r&&Ye(this,Wn,rt(this,Wt,dl).call(this,()=>{try{return qn(()=>{var d=Ze;d.b=this,d.f|=Ed,r(V(this,or),()=>l,()=>i)})}catch(d){return Ys(d,V(this,Un).parent),null}}))};xr(()=>{var l;try{l=this.transform_error(e)}catch(d){Ys(d,V(this,Un)&&V(this,Un).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,d=>Ys(d,V(this,Un)&&V(this,Un).parent)):o(l)})};function gm(t,e,n,r){const s=no()?Hi:oh;var a=t.filter(h=>!h.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Ze,o=a_(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(h=>h.promise)):null;function d(h){if((i.f&vr)===0){o();try{r(h)}catch(p){Ys(p,i)}Nl()}}var f=vm();if(n.length===0){l.then(()=>d(e.map(s))).finally(f);return}function g(){Promise.all(n.map(h=>i_(h))).then(h=>d([...e.map(s),...h])).catch(h=>Ys(h,i)).finally(f)}l?l.then(()=>{o(),g(),Nl()}):g()}function a_(){var t=Ze,e=et,n=Ct,r=Fe;return function(a=!0){rs(t),Er(e),Ui(n),a&&(t.f&vr)===0&&(r==null||r.activate(),r==null||r.apply())}}function Nl(t=!0){rs(null),Er(null),Ui(null),t&&(Fe==null||Fe.deactivate())}function vm(){var t=Ze,e=t.b,n=Fe,r=e.is_rendered();return e.update_pending_count(1,n),n.increment(r,t),()=>{e.update_pending_count(-1,n),n.decrement(r,t)}}function Hi(t){var e=Tn|pn;return Ze!==null&&(Ze.f|=eo),{ctx:Ct,deps:null,effects:null,equals:am,f:e,fn:t,reactions:null,rv:0,v:Zt,wv:0,parent:Ze,ac:null}}const Mu=Symbol("obsolete");function i_(t,e,n){let r=Ze;r===null&&fE();var s=void 0,a=ja(Zt),i=!et,o=new Set;return v_(()=>{var p;var l=Ze,d=J1();s=d.promise;try{Promise.resolve(t()).then(d.resolve,v=>{v!==Xl&&d.reject(v)}).finally(Nl)}catch(v){d.reject(v),Nl()}var f=Fe;if(i){if((l.f&Xa)!==0)var g=vm();if(r.b.is_rendered())(p=f.async_deriveds.get(l))==null||p.reject(Mu);else for(const v of o.values())v.reject(Mu);o.add(d),f.async_deriveds.set(l,d)}const h=(v,_=void 0)=>{g==null||g(),o.delete(d),_!==Mu&&(f.activate(),_?(a.f|=Qs,qi(a,_)):((a.f&Qs)!==0&&(a.f^=Qs),qi(a,v)),f.deactivate())};d.promise.then(h,v=>h(null,v||"unknown"))}),mu(()=>{for(const l of o)l.reject(Mu)}),new Promise(l=>{function d(f){function g(){f===s?l(a):d(s)}f.then(g,g)}d(s)})}function _e(t){const e=Hi(t);return Pm(e),e}function oh(t){const e=Hi(t);return e.equals=im,e}function o_(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)En(e[n])}}function uh(t){var e,n=Ze,r=t.parent;if(!ys&&r!==null&&t.v!==Zt&&(r.f&(vr|Pn))!==0)return ME(),t.v;rs(r);try{t.f&=~Ha,o_(t),e=Um(t)}finally{rs(n)}return e}function bm(t){var e=uh(t);if(!t.equals(e)&&(t.wv=Bm(),(!(Fe!=null&&Fe.is_fork)||t.deps===null)&&(Fe!==null?(Fe.capture(t,e,!0),Io==null||Io.capture(t,e,!0)):t.v=e,t.deps===null))){zt(t,an);return}ys||(bn!==null?(ch()||Fe!=null&&Fe.is_fork)&&bn.set(t,e):sh(t))}function u_(t){var e,n;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(n=r.ac)==null||n.abort(Xl),r.fn!==null&&(r.teardown=th),r.ac=null,Yo(r,0),dh(r))}function Em(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&$i(e)}let wl=new Set;const Ra=new Map;let _m=!1;function ja(t,e){var n={f:0,v:t,reactions:null,equals:am,rv:0,wv:0};return n}function Q(t,e){const n=ja(t);return Pm(n),n}function l_(t,e=!1,n=!0){var s;const r=ja(t);return e||(r.equals=im),to&&n&&Ct!==null&&Ct.l!==null&&((s=Ct.l).s??(s.s=[])).push(r),r}function T(t,e,n=!1){et!==null&&(!Lr||(et.f&Al)!==0)&&no()&&(et.f&(Tn|Cr|Ai|Al))!==0&&(br===null||!xa.call(br,t))&&TE();let r=n?ct(e):e;return qi(t,r,ul)}function qi(t,e,n=null){if(!t.equals(e)){Ra.set(t,ys?e:t.v);var r=qa.ensure();if(r.capture(t,e),(t.f&Tn)!==0){const s=t;(t.f&pn)!==0&&uh(s),bn===null&&sh(s)}t.wv=Bm(),Tm(t,pn,n),no()&&Ze!==null&&(Ze.f&an)!==0&&(Ze.f&(Dr|ta))===0&&(ir===null?__([t]):ir.push(t)),!r.is_fork&&wl.size>0&&!_m&&c_()}return e}function c_(){_m=!1;for(const t of wl){(t.f&an)!==0&&zt(t,ns);let e;try{e=gu(t)}catch{e=!0}e&&$i(t)}wl.clear()}function Lo(t){T(t,t.v+1)}function Tm(t,e,n){var r=t.reactions;if(r!==null)for(var s=no(),a=r.length,i=0;i<a;i++){var o=r[i],l=o.f;if(!(!s&&o===Ze)){var d=(l&pn)===0;if(d&&zt(o,e),(l&Al)!==0)wl.add(o);else if((l&Tn)!==0){var f=o;bn==null||bn.delete(f),(l&Ha)===0&&(l&gr&&(Ze===null||(Ze.f&yl)===0)&&(o.f|=Ha),Tm(f,ns,n))}else if(d){var g=o;(l&Cr)!==0&&Ar!==null&&Ar.add(g),n!==null?n.push(g):ih(g)}}}}function ct(t){if(typeof t!="object"||t===null||Qr in t)return t;const e=eh(t);if(e!==iE&&e!==oE)return t;var n=new Map,r=Jf(t),s=Q(0),a=ka,i=o=>{if(ka===a)return o();var l=et,d=ka;Er(null),S0(a);var f=o();return Er(l),S0(d),f};return r&&n.set("length",Q(t.length)),new Proxy(t,{defineProperty(o,l,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&EE();var f=n.get(l);return f===void 0?i(()=>{var g=Q(d.value);return n.set(l,g),g}):T(f,d.value,!0),!0},deleteProperty(o,l){var d=n.get(l);if(d===void 0){if(l in o){const f=i(()=>Q(Zt));n.set(l,f),Lo(s)}}else T(d,Zt),Lo(s);return!0},get(o,l,d){var p;if(l===Qr)return t;var f=n.get(l),g=l in o;if(f===void 0&&(!g||(p=Xs(o,l))!=null&&p.writable)&&(f=i(()=>{var v=ct(g?o[l]:Zt),_=Q(v);return _}),n.set(l,f)),f!==void 0){var h=u(f);return h===Zt?void 0:h}return Reflect.get(o,l,d)},getOwnPropertyDescriptor(o,l){var d=Reflect.getOwnPropertyDescriptor(o,l);if(d&&"value"in d){var f=n.get(l);f&&(d.value=u(f))}else if(d===void 0){var g=n.get(l),h=g==null?void 0:g.v;if(g!==void 0&&h!==Zt)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return d},has(o,l){var h;if(l===Qr)return!0;var d=n.get(l),f=d!==void 0&&d.v!==Zt||Reflect.has(o,l);if(d!==void 0||Ze!==null&&(!f||(h=Xs(o,l))!=null&&h.writable)){d===void 0&&(d=i(()=>{var p=f?ct(o[l]):Zt,v=Q(p);return v}),n.set(l,d));var g=u(d);if(g===Zt)return!1}return f},set(o,l,d,f){var O;var g=n.get(l),h=l in o;if(r&&l==="length")for(var p=d;p<g.v;p+=1){var v=n.get(p+"");v!==void 0?T(v,Zt):p in o&&(v=i(()=>Q(Zt)),n.set(p+"",v))}if(g===void 0)(!h||(O=Xs(o,l))!=null&&O.writable)&&(g=i(()=>Q(void 0)),T(g,ct(d)),n.set(l,g));else{h=g.v!==Zt;var _=i(()=>ct(d));T(g,_)}var E=Reflect.getOwnPropertyDescriptor(o,l);if(E!=null&&E.set&&E.set.call(f,d),!h){if(r&&typeof l=="string"){var b=n.get("length"),x=Number(l);Number.isInteger(x)&&x>=b.v&&T(b,x+1)}Lo(s)}return!0},ownKeys(o){u(s);var l=Reflect.ownKeys(o).filter(g=>{var h=n.get(g);return h===void 0||h.v!==Zt});for(var[d,f]of n)f.v!==Zt&&!(d in o)&&l.push(d);return l},setPrototypeOf(){_E()}})}function A0(t){try{if(t!==null&&typeof t=="object"&&Qr in t)return t[Qr]}catch{}return t}function Am(t,e){return Object.is(A0(t),A0(e))}var y0,ym,Nm,wm;function d_(){if(y0===void 0){y0=window,ym=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Nm=Xs(e,"firstChild").get,wm=Xs(e,"nextSibling").get,E0(t)&&(t[Td]=void 0,t[il]=null,t[Ad]=void 0,t.__e=void 0),E0(n)&&(n[_o]=void 0)}}function Zr(t=""){return document.createTextNode(t)}function ji(t){return Nm.call(t)}function pu(t){return wm.call(t)}function y(t,e){return ji(t)}function tt(t,e=!1){{var n=ji(t);return n instanceof Comment&&n.data===""?pu(n):n}}function C(t,e=1,n=!1){let r=t;for(;e--;)r=pu(r);return r}function f_(t){t.textContent=""}function Sm(){return!1}function Im(t,e,n){return document.createElementNS(e??sm,t,void 0)}function $a(t,e){if(e){const n=document.body;t.autofocus=!0,xr(()=>{document.activeElement===n&&t.focus()})}}let N0=!1;function h_(){N0||(N0=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[ol])==null||e.call(n)})},{capture:!0}))}function Ql(t){var e=et,n=Ze;Er(null),rs(null);try{return t()}finally{Er(e),rs(n)}}function lh(t,e,n,r=n){t.addEventListener(e,()=>Ql(n));const s=t[ol];s?t[ol]=()=>{s(),r(!0)}:t[ol]=()=>r(!0),h_()}function Cm(t){Ze===null&&(et===null&&gE(),mE()),ys&&pE()}function p_(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Pr(t,e){var n=Ze;n!==null&&(n.f&Pn)!==0&&(t|=Pn);var r={ctx:Ct,deps:null,nodes:null,f:t|pn|gr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Fe==null||Fe.register_created_effect(r);var s=r;if((t&Fi)!==0)Ei!==null?Ei.push(r):qa.ensure().schedule(r);else if(e!==null){try{$i(r)}catch(i){throw En(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&eo)===0&&(s=s.first,(t&Cr)!==0&&(t&As)!==0&&s!==null&&(s.f|=As))}if(s!==null&&(s.parent=n,n!==null&&p_(s,n),et!==null&&(et.f&Tn)!==0&&(t&ta)===0)){var a=et;(a.effects??(a.effects=[])).push(s)}return r}function ch(){return et!==null&&!Lr}function mu(t){const e=Pr(hu,null);return zt(e,an),e.teardown=t,e}function Rt(t){Cm();var e=Ze.f,n=!et&&(e&Dr)!==0&&(e&Xa)===0;if(n){var r=Ct;(r.e??(r.e=[])).push(t)}else return Lm(t)}function Lm(t){return Pr(Fi|em,t)}function m_(t){return Cm(),Pr(hu|em,t)}function g_(t){qa.ensure();const e=Pr(ta|eo,t);return(n={})=>new Promise(r=>{n.outro?Da(e,()=>{En(e),r(void 0)}):(En(e),r(void 0))})}function ro(t){return Pr(Fi,t)}function v_(t){return Pr(Ai|eo,t)}function Zl(t,e=0){return Pr(hu|e,t)}function re(t,e=[],n=[],r=[]){gm(r,e,n,s=>{Pr(hu,()=>t(...s.map(u)))})}function Qa(t,e=0){var n=Pr(Cr|e,t);return n}function Om(t,e=0){var n=Pr(nh|e,t);return n}function qn(t){return Pr(Dr|eo,t)}function xm(t){var e=t.teardown;if(e!==null){const n=ys,r=et;w0(!0),Er(null);try{e.call(null)}finally{w0(n),Er(r)}}}function dh(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Ql(()=>{s.abort(Xl)});var r=n.next;(n.f&ta)!==0?n.parent=null:En(n,e),n=r}}function b_(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Dr)===0&&En(e),e=n}}function En(t,e=!0){var n=!1;(e||(t.f&cE)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(E_(t.nodes.start,t.nodes.end),n=!0),zt(t,_d),dh(t,e&&!n),Yo(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();xm(t),t.f^=_d,t.f|=vr;var s=t.parent;s!==null&&s.first!==null&&Rm(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function E_(t,e){for(;t!==null;){var n=t===e?null:pu(t);t.remove(),t=n}}function Rm(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Da(t,e,n=!0){var r=[];Dm(t,r,!0);var s=()=>{n&&En(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var o of r)o.out(i)}else s()}function Dm(t,e,n){if((t.f&Pn)===0){t.f^=Pn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var a=s.next;if((s.f&ta)===0){var i=(s.f&As)!==0||(s.f&Dr)!==0&&(t.f&Cr)!==0;Dm(s,e,i?n:!1)}s=a}}}function fh(t){km(t,!0)}function km(t,e){if((t.f&Pn)!==0){t.f^=Pn,(t.f&an)===0&&(zt(t,pn),qa.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&As)!==0||(n.f&Dr)!==0;km(n,s?e:!1),n=r}var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)(i.is_global||e)&&i.in()}}function hh(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:pu(n);e.append(n),n=s}}let fl=!1,ys=!1;function w0(t){ys=t}let et=null,Lr=!1;function Er(t){et=t}let Ze=null;function rs(t){Ze=t}let br=null;function Pm(t){et!==null&&(br===null?br=[t]:br.push(t))}let Hn=null,Yn=0,ir=null;function __(t){ir=t}let Mm=1,Aa=0,ka=Aa;function S0(t){ka=t}function Bm(){return++Mm}function gu(t){var e=t.f;if((e&pn)!==0)return!0;if(e&Tn&&(t.f&=~Ha),(e&ns)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(gu(a)&&bm(a),a.wv>t.wv)return!0}(e&gr)!==0&&bn===null&&zt(t,an)}return!1}function Fm(t,e,n=!0){var r=t.reactions;if(r!==null&&!(br!==null&&xa.call(br,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&Tn)!==0?Fm(a,e,!1):e===a&&(n?zt(a,pn):(a.f&an)!==0&&zt(a,ns),ih(a))}}function Um(t){var _;var e=Hn,n=Yn,r=ir,s=et,a=br,i=Ct,o=Lr,l=ka,d=t.f;Hn=null,Yn=0,ir=null,et=(d&(Dr|ta))===0?t:null,br=null,Ui(t.ctx),Lr=!1,ka=++Aa,t.ac!==null&&(Ql(()=>{t.ac.abort(Xl)}),t.ac=null);try{t.f|=yl;var f=t.fn,g=f();t.f|=Xa;var h=t.deps,p=Fe==null?void 0:Fe.is_fork;if(Hn!==null){var v;if(p||Yo(t,Yn),h!==null&&Yn>0)for(h.length=Yn+Hn.length,v=0;v<Hn.length;v++)h[Yn+v]=Hn[v];else t.deps=h=Hn;if(ch()&&(t.f&gr)!==0)for(v=Yn;v<h.length;v++)((_=h[v]).reactions??(_.reactions=[])).push(t)}else!p&&h!==null&&Yn<h.length&&(Yo(t,Yn),h.length=Yn);if(no()&&ir!==null&&!Lr&&h!==null&&(t.f&(Tn|ns|pn))===0)for(v=0;v<ir.length;v++)Fm(ir[v],t);if(s!==null&&s!==t){if(Aa++,s.deps!==null)for(let E=0;E<n;E+=1)s.deps[E].rv=Aa;if(e!==null)for(const E of e)E.rv=Aa;ir!==null&&(r===null?r=ir:r.push(...ir))}return(t.f&Qs)!==0&&(t.f^=Qs),g}catch(E){return um(E)}finally{t.f^=yl,Hn=e,Yn=n,ir=r,et=s,br=a,Ui(i),Lr=o,ka=l}}function T_(t,e){let n=e.reactions;if(n!==null){var r=sE.call(n,t);if(r!==-1){var s=n.length-1;s===0?n=e.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(e.f&Tn)!==0&&(Hn===null||!xa.call(Hn,e))){var a=e;(a.f&gr)!==0&&(a.f^=gr,a.f&=~Ha),a.v!==Zt&&sh(a),u_(a),Yo(a,0)}}function Yo(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)T_(t,n[r])}function $i(t){var e=t.f;if((e&vr)===0){zt(t,an);var n=Ze,r=fl;Ze=t,fl=!0;try{(e&(Cr|nh))!==0?b_(t):dh(t),xm(t);var s=Um(t);t.teardown=typeof s=="function"?s:null,t.wv=Mm;var a;Q1&&HE&&(t.f&pn)!==0&&t.deps}finally{fl=r,Ze=n}}}async function Hm(){await Promise.resolve(),XE()}function u(t){var e=t.f,n=(e&Tn)!==0;if(et!==null&&!Lr){var r=Ze!==null&&(Ze.f&vr)!==0;if(!r&&(br===null||!xa.call(br,t))){var s=et.deps;if((et.f&yl)!==0)t.rv<Aa&&(t.rv=Aa,Hn===null&&s!==null&&s[Yn]===t?Yn++:Hn===null?Hn=[t]:Hn.push(t));else{et.deps??(et.deps=[]),xa.call(et.deps,t)||et.deps.push(t);var a=t.reactions;a===null?t.reactions=[et]:xa.call(a,et)||a.push(et)}}}if(ys&&Ra.has(t))return Ra.get(t);if(n){var i=t;if(ys){var o=i.v;return((i.f&an)===0&&i.reactions!==null||jm(i))&&(o=uh(i)),Ra.set(i,o),o}var l=(i.f&gr)===0&&!Lr&&et!==null&&(fl||(et.f&gr)!==0),d=(i.f&Xa)===0;gu(i)&&(l&&(i.f|=gr),bm(i)),l&&!d&&(Em(i),qm(i))}if(bn!=null&&bn.has(t))return bn.get(t);if((t.f&Qs)!==0)throw t.v;return t.v}function qm(t){if(t.f|=gr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&Tn)!==0&&(e.f&gr)===0&&(Em(e),qm(e))}function jm(t){if(t.v===Zt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Ra.has(e)||(e.f&Tn)!==0&&jm(e))return!0;return!1}function ra(t){var e=Lr;try{return Lr=!0,t()}finally{Lr=e}}function A_(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Qr in t)Od(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Qr in n&&Od(n)}}}function Od(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{Od(t[r],e)}catch{}const n=eh(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Z1(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function y_(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const N_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function w_(t){return N_.includes(t)}const S_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function I_(t){return t=t.toLowerCase(),S_[t]??t}const C_=["touchstart","touchmove"];function L_(t){return C_.includes(t)}const ya=Symbol("events"),$m=new Set,xd=new Set;function Ym(t,e,n,r={}){function s(a){if(r.capture||Rd.call(e,a),!a.cancelBubble)return Ql(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?xr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function He(t,e,n,r,s){var a={capture:r,passive:s},i=Ym(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&mu(()=>{e.removeEventListener(t,i,a)})}function ie(t,e,n){(e[ya]??(e[ya]={}))[t]=n}function Tt(t){for(var e=0;e<t.length;e++)$m.add(t[e]);for(var n of xd)n(t)}let I0=null;function Rd(t){var E,b;var e=this,n=e.ownerDocument,r=t.type,s=((E=t.composedPath)==null?void 0:E.call(t))||[],a=s[0]||t.target;I0=t;var i=0,o=I0===t&&t[ya];if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t[ya]=e;return}var d=s.indexOf(e);if(d===-1)return;l<=d&&(i=l)}if(a=s[i]||t.target,a!==e){aE(t,"currentTarget",{configurable:!0,get(){return a||n}});var f=et,g=Ze;Er(null),rs(null);try{for(var h,p=[];a!==null;){var v=a.assignedSlot||a.parentNode||a.host||null;try{var _=(b=a[ya])==null?void 0:b[r];_!=null&&(!a.disabled||t.target===a)&&_.call(a,t)}catch(x){h?p.push(x):h=x}if(t.cancelBubble||v===e||v===null)break;a=v}if(h){for(let x of p)queueMicrotask(()=>{throw x});throw h}}finally{t[ya]=e,delete t.currentTarget,Er(f),rs(g)}}}var V1;const Bc=((V1=globalThis==null?void 0:globalThis.window)==null?void 0:V1.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function O_(t){return(Bc==null?void 0:Bc.createHTML(t))??t}function zm(t){var e=Im("template");return e.innerHTML=O_(t.replaceAll("<!>","<!---->")),e.content}function Yi(t,e){var n=Ze;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function z(t,e){var n=(e&RE)!==0,r=(e&DE)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=zm(a?t:"<!>"+t),n||(s=ji(s)));var i=r||ym?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=ji(i),l=i.lastChild;Yi(o,l)}else Yi(i,i);return i}}function x_(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=zm(s),o=ji(i);a=ji(o)}var l=a.cloneNode(!0);return Yi(l,l),l}}function R_(t,e){return x_(t,e,"svg")}function Sl(t=""){{var e=Zr(t+"");return Yi(e,e),e}}function Kn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Zr();return t.append(e,n),Yi(e,n),t}function F(t,e){t!==null&&t.before(e)}function ae(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[_o]??(t[_o]=t.nodeValue))&&(t[_o]=n,t.nodeValue=`${n}`)}function D_(t,e){return k_(t,e)}const Bu=new Map;function k_(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:o}){d_();var l=void 0,d=g_(()=>{var f=n??e.appendChild(Zr());e_(f,{pending:()=>{}},p=>{at({});var v=Ct;a&&(v.c=a),s&&(r.$$events=s),l=t(p,r)||{},it()},o);var g=new Set,h=p=>{for(var v=0;v<p.length;v++){var _=p[v];if(!g.has(_)){g.add(_);var E=L_(_);for(const O of[e,document]){var b=Bu.get(O);b===void 0&&(b=new Map,Bu.set(O,b));var x=b.get(_);x===void 0?(O.addEventListener(_,Rd,{passive:E}),b.set(_,1)):b.set(_,x+1)}}}};return h(Vl($m)),xd.add(h),()=>{var E;for(var p of g)for(const b of[e,document]){var v=Bu.get(b),_=v.get(p);--_==0?(b.removeEventListener(p,Rd),v.delete(p),v.size===0&&Bu.delete(b)):v.set(p,_)}xd.delete(h),f!==n&&((E=f.parentNode)==null||E.removeChild(f))}});return P_.set(l,d),l}let P_=new WeakMap;var Nr,Gr,Gn,Oa,lu,cu,Wl;class vu{constructor(e,n=!0){ye(this,"anchor");Ue(this,Nr,new Map);Ue(this,Gr,new Map);Ue(this,Gn,new Map);Ue(this,Oa,new Set);Ue(this,lu,!0);Ue(this,cu,e=>{if(V(this,Nr).has(e)){var n=V(this,Nr).get(e),r=V(this,Gr).get(n);if(r)fh(r),V(this,Oa).delete(n);else{var s=V(this,Gn).get(n);s&&(V(this,Gr).set(n,s.effect),V(this,Gn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of V(this,Nr)){if(V(this,Nr).delete(a),a===e)break;const o=V(this,Gn).get(i);o&&(En(o.effect),V(this,Gn).delete(i))}for(const[a,i]of V(this,Gr)){if(a===n||V(this,Oa).has(a))continue;const o=()=>{if(Array.from(V(this,Nr).values()).includes(a)){var d=document.createDocumentFragment();hh(i,d),d.append(Zr()),V(this,Gn).set(a,{effect:i,fragment:d})}else En(i);V(this,Oa).delete(a),V(this,Gr).delete(a)};V(this,lu)||!r?(V(this,Oa).add(a),Da(i,o,!1)):o()}}});Ue(this,Wl,e=>{V(this,Nr).delete(e);const n=Array.from(V(this,Nr).values());for(const[r,s]of V(this,Gn))n.includes(r)||(En(s.effect),V(this,Gn).delete(r))});this.anchor=e,Ye(this,lu,n)}ensure(e,n){var r=Fe,s=Sm();if(n&&!V(this,Gr).has(e)&&!V(this,Gn).has(e))if(s){var a=document.createDocumentFragment(),i=Zr();a.append(i),V(this,Gn).set(e,{effect:qn(()=>n(i)),fragment:a})}else V(this,Gr).set(e,qn(()=>n(this.anchor)));if(V(this,Nr).set(r,e),s){for(const[o,l]of V(this,Gr))o===e?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of V(this,Gn))o===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(V(this,cu)),r.ondiscard(V(this,Wl))}else V(this,cu).call(this,r)}}Nr=new WeakMap,Gr=new WeakMap,Gn=new WeakMap,Oa=new WeakMap,lu=new WeakMap,cu=new WeakMap,Wl=new WeakMap;function ce(t,e,n=!1){var r=new vu(t),s=n?As:0;function a(i,o){r.ensure(i,o)}Qa(()=>{var i=!1;e((o,l=0)=>{i=!0,a(l,o)}),i||a(-1,null)},s)}const M_=Symbol("NaN");function B_(t,e,n){var r=new vu(t),s=!no();Qa(()=>{var a=e();a!==a&&(a=M_),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function zo(t,e){return e}function F_(t,e,n){for(var r=[],s=e.length,a,i=e.length,o=0;o<s;o++){let g=e[o];Da(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var h=t.outrogroups;Dd(t,Vl(a.done)),h.delete(a),h.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var l=r.length===0&&n!==null;if(l){var d=n,f=d.parentNode;f_(f),f.append(d),t.items.clear()}Dd(t,e,!l)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function Dd(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const o of i)r.add(t.items.get(o).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Vr;const i=document.createDocumentFragment();hh(a,i)}else En(e[s],n)}}var C0;function St(t,e,n,r,s,a=null){var i=t,o=new Map,l=(e&rm)!==0;if(l){var d=t;i=d.appendChild(Zr())}var f=null,g=oh(()=>{var O=n();return Jf(O)?O:O==null?[]:Vl(O)}),h,p=new Map,v=!0;function _(O){(x.effect.f&vr)===0&&(x.pending.delete(O),x.fallback=f,U_(x,h,i,e,r),f!==null&&(h.length===0?(f.f&Vr)===0?fh(f):(f.f^=Vr,Ao(f,null,i)):Da(f,()=>{f=null})))}function E(O){x.pending.delete(O)}var b=Qa(()=>{h=u(g);for(var O=h.length,M=new Set,B=Fe,J=Sm(),H=0;H<O;H+=1){var G=h[H],X=r(G,H),ee=v?null:o.get(X);ee?(ee.v&&qi(ee.v,G),ee.i&&qi(ee.i,H),J&&B.unskip_effect(ee.e)):(ee=H_(o,v?i:C0??(C0=Zr()),G,X,H,s,e,n),v||(ee.e.f|=Vr),o.set(X,ee)),M.add(X)}if(O===0&&a&&!f&&(v?f=qn(()=>a(i)):(f=qn(()=>a(C0??(C0=Zr()))),f.f|=Vr)),O>M.size&&hE(),!v)if(p.set(B,M),J){for(const[A,j]of o)M.has(A)||B.skip_effect(j.e);B.oncommit(_),B.ondiscard(E)}else _(B);u(g)}),x={effect:b,items:o,pending:p,outrogroups:null,fallback:f};v=!1}function fo(t){for(;t!==null&&(t.f&Dr)===0;)t=t.next;return t}function U_(t,e,n,r,s){var ee,A,j,w,S,R,k,W,$;var a=(r&wE)!==0,i=e.length,o=t.items,l=fo(t.effect.first),d,f=null,g,h=[],p=[],v,_,E,b;if(a)for(b=0;b<i;b+=1)v=e[b],_=s(v,b),E=o.get(_).e,(E.f&Vr)===0&&((A=(ee=E.nodes)==null?void 0:ee.a)==null||A.measure(),(g??(g=new Set)).add(E));for(b=0;b<i;b+=1){if(v=e[b],_=s(v,b),E=o.get(_).e,t.outrogroups!==null)for(const Y of t.outrogroups)Y.pending.delete(E),Y.done.delete(E);if((E.f&Pn)!==0&&(fh(E),a&&((w=(j=E.nodes)==null?void 0:j.a)==null||w.unfix(),(g??(g=new Set)).delete(E))),(E.f&Vr)!==0)if(E.f^=Vr,E===l)Ao(E,null,n);else{var x=f?f.next:l;E===t.effect.last&&(t.effect.last=E.prev),E.prev&&(E.prev.next=E.next),E.next&&(E.next.prev=E.prev),ks(t,f,E),ks(t,E,x),Ao(E,x,n),f=E,h=[],p=[],l=fo(f.next);continue}if(E!==l){if(d!==void 0&&d.has(E)){if(h.length<p.length){var O=p[0],M;f=O.prev;var B=h[0],J=h[h.length-1];for(M=0;M<h.length;M+=1)Ao(h[M],O,n);for(M=0;M<p.length;M+=1)d.delete(p[M]);ks(t,B.prev,J.next),ks(t,f,B),ks(t,J,O),l=O,f=J,b-=1,h=[],p=[]}else d.delete(E),Ao(E,l,n),ks(t,E.prev,E.next),ks(t,E,f===null?t.effect.first:f.next),ks(t,f,E),f=E;continue}for(h=[],p=[];l!==null&&l!==E;)(d??(d=new Set)).add(l),p.push(l),l=fo(l.next);if(l===null)continue}(E.f&Vr)===0&&h.push(E),f=E,l=fo(E.next)}if(t.outrogroups!==null){for(const Y of t.outrogroups)Y.pending.size===0&&(Dd(t,Vl(Y.done)),(S=t.outrogroups)==null||S.delete(Y));t.outrogroups.size===0&&(t.outrogroups=null)}if(l!==null||d!==void 0){var H=[];if(d!==void 0)for(E of d)(E.f&Pn)===0&&H.push(E);for(;l!==null;)(l.f&Pn)===0&&l!==t.fallback&&H.push(l),l=fo(l.next);var G=H.length;if(G>0){var X=(r&rm)!==0&&i===0?n:null;if(a){for(b=0;b<G;b+=1)(k=(R=H[b].nodes)==null?void 0:R.a)==null||k.measure();for(b=0;b<G;b+=1)($=(W=H[b].nodes)==null?void 0:W.a)==null||$.fix()}F_(t,H,X)}}a&&xr(()=>{var Y,U;if(g!==void 0)for(E of g)(U=(Y=E.nodes)==null?void 0:Y.a)==null||U.apply()})}function H_(t,e,n,r,s,a,i,o){var l=(i&yE)!==0?(i&SE)===0?l_(n,!1,!1):ja(n):null,d=(i&NE)!==0?ja(s):null;return{v:l,i:d,e:qn(()=>(a(e,l??n,d??s,o),()=>{t.delete(r)}))}}function Ao(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Vr)===0?e.nodes.start:n;r!==null;){var i=pu(r);if(a.before(r),r===s)return;r=i}}function ks(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function q_(t,e,...n){var r=new vu(t);Qa(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},As)}function kd(t,e,n){var r=new vu(t);Qa(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},As)}function j_(t,e,n,r,s,a){var i=null,o=t,l=new vu(o,!1);Qa(()=>{const d=e()||null;var f=kE;if(d===null){l.ensure(null,null);return}return l.ensure(d,g=>{if(d){if(i=Im(d,f),Yi(i,i),r){var h=i.appendChild(Zr());r(i,h)}Ze.nodes.end=i,g.before(i)}}),()=>{}},As),mu(()=>{})}function $_(t,e,n){ro(()=>{var r=ra(()=>e(t,n==null?void 0:n())||{});if(r!=null&&r.destroy)return()=>r.destroy()})}function Y_(t,e){var n=void 0,r;Om(()=>{n!==(n=e())&&(r&&(En(r),r=null),n&&(r=qn(()=>{ro(()=>n(t))})))})}function Wm(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=Wm(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function z_(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Wm(t))&&(r&&(r+=" "),r+=e);return r}function Gm(t){return typeof t=="object"?z_(t):t??""}const L0=[...`
3
+ \r\f \v\uFEFF`];function W_(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,i=0;(i=r.indexOf(s,i))>=0;){var o=i+a;(i===0||L0.includes(r[i-1]))&&(o===r.length||L0.includes(r[o]))?r=(i===0?"":r.substring(0,i))+r.substring(o+1):i=o}}return r===""?null:r}function O0(t,e=!1){var n=e?" !important;":";",r="";for(var s of Object.keys(t)){var a=t[s];a!=null&&a!==""&&(r+=" "+s+": "+a+n)}return r}function Fc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function G_(t,e){if(e){var n="",r,s;if(Array.isArray(e)?(r=e[0],s=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(Fc)),s&&l.push(...Object.keys(s).map(Fc));var d=0,f=-1;const _=t.length;for(var g=0;g<_;g++){var h=t[g];if(o?h==="/"&&t[g-1]==="*"&&(o=!1):a?a===h&&(a=!1):h==="/"&&t[g+1]==="*"?o=!0:h==='"'||h==="'"?a=h:h==="("?i++:h===")"&&i--,!o&&a===!1&&i===0){if(h===":"&&f===-1)f=g;else if(h===";"||g===_-1){if(f!==-1){var p=Fc(t.substring(d,f).trim());if(!l.includes(p)){h!==";"&&g++;var v=t.substring(d,g).trim();n+=" "+v+";"}}d=g+1,f=-1}}}}return r&&(n+=O0(r)),s&&(n+=O0(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Ve(t,e,n,r,s,a){var i=t[Td];if(i!==n||i===void 0){var o=W_(n,r,a);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t[Td]=n}else if(a&&s!==a)for(var l in a){var d=!!a[l];(s==null||d!==!!s[l])&&t.classList.toggle(l,d)}return a}function Uc(t,e={},n,r){for(var s in n){var a=n[s];e[s]!==a&&(n[s]==null?t.style.removeProperty(s):t.style.setProperty(s,a,r))}}function Jl(t,e,n,r){var s=t[Ad];if(s!==e){var a=G_(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[Ad]=e}else r&&(Array.isArray(r)?(Uc(t,n==null?void 0:n[0],r[0]),Uc(t,n==null?void 0:n[1],r[1],"important")):Uc(t,n,r));return r}function Il(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Jf(e))return BE();for(var r of t.options)r.selected=e.includes(Oo(r));return}for(r of t.options){var s=Oo(r);if(Am(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Km(t){var e=new MutationObserver(()=>{Il(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),mu(()=>{e.disconnect()})}function Ya(t,e,n=e){var r=new WeakSet,s=!0;lh(t,"change",a=>{var i=a?"[selected]":":checked",o;if(t.multiple)o=[].map.call(t.querySelectorAll(i),Oo);else{var l=t.querySelector(i)??t.querySelector("option:not([disabled])");o=l&&Oo(l)}n(o),t.__value=o,Fe!==null&&r.add(Fe)}),ro(()=>{var a=e();if(t===document.activeElement){var i=Fe;if(r.has(i))return}if(Il(t,a,s),s&&a===void 0){var o=t.querySelector(":checked");o!==null&&(a=Oo(o),n(a))}t.__value=a,s=!1}),Km(t)}function Oo(t){return"__value"in t?t.__value:t.value}const ho=Symbol("class"),po=Symbol("style"),Vm=Symbol("is custom element"),Xm=Symbol("is html"),K_=rh?"option":"OPTION",V_=rh?"select":"SELECT",X_=rh?"progress":"PROGRESS";function Q_(t,e){var n=ec(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==X_)||(t.value=e??"")}function Z_(t,e){var n=ec(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function J_(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ee(t,e,n,r){var s=ec(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[dE]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Qm(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function eT(t,e,n,r,s=!1,a=!1){var i=ec(t),o=i[Vm],l=!i[Xm],d=e||{},f=t.nodeName===K_;for(var g in e)g in n||(n[g]=null);n.class?n.class=Gm(n.class):n[ho]&&(n.class=null),n[po]&&(n.style??(n.style=null));var h=Qm(t);for(const O in n){let M=n[O];if(f&&O==="value"&&M==null){t.value=t.__value="",d[O]=M;continue}if(O==="class"){var p=t.namespaceURI==="http://www.w3.org/1999/xhtml";Ve(t,p,M,r,e==null?void 0:e[ho],n[ho]),d[O]=M,d[ho]=n[ho];continue}if(O==="style"){Jl(t,M,e==null?void 0:e[po],n[po]),d[O]=M,d[po]=n[po];continue}var v=d[O];if(!(M===v&&!(M===void 0&&t.hasAttribute(O)))){d[O]=M;var _=O[0]+O[1];if(_!=="$$")if(_==="on"){const B={},J="$$"+O;let H=O.slice(2);var E=w_(H);if(y_(H)&&(H=H.slice(0,-7),B.capture=!0),!E&&v){if(M!=null)continue;t.removeEventListener(H,d[J],B),d[J]=null}if(E)ie(H,t,M),Tt([H]);else if(M!=null){let G=function(X){d[O].call(this,X)};d[J]=Ym(H,t,G,B)}}else if(O==="style")Ee(t,O,M);else if(O==="autofocus")$a(t,!!M);else if(!o&&(O==="__value"||O==="value"&&M!=null))t.value=t.__value=M;else if(O==="selected"&&f)J_(t,M);else{var b=O;l||(b=I_(b));var x=b==="defaultValue"||b==="defaultChecked";if(M==null&&!o&&!x)if(i[O]=null,b==="value"||b==="checked"){let B=t;const J=e===void 0;if(b==="value"){let H=B.defaultValue;B.removeAttribute(b),B.defaultValue=H,B.value=B.__value=J?H:null}else{let H=B.defaultChecked;B.removeAttribute(b),B.defaultChecked=H,B.checked=J?H:!1}}else t.removeAttribute(O);else x||h.includes(b)&&(o||typeof M!="string")?(t[b]=M,b in i&&(i[b]=Zt)):typeof M!="function"&&Ee(t,b,M)}}}return d}function x0(t,e,n=[],r=[],s=[],a,i=!1,o=!1){gm(s,n,r,l=>{var d=void 0,f={},g=t.nodeName===V_,h=!1;if(Om(()=>{var v=e(...l.map(u)),_=eT(t,d,v,a,i,o);h&&g&&"value"in v&&Il(t,v.value);for(let b of Object.getOwnPropertySymbols(f))v[b]||En(f[b]);for(let b of Object.getOwnPropertySymbols(v)){var E=v[b];b.description===PE&&(!d||E!==d[b])&&(f[b]&&En(f[b]),f[b]=qn(()=>Y_(t,()=>E))),_[b]=E}d=_}),g){var p=t;ro(()=>{Il(p,d.value,!0),Km(p)})}h=!0})}function ec(t){return t[il]??(t[il]={[Vm]:t.nodeName.includes("-"),[Xm]:t.namespaceURI===sm})}var R0=new Map;function Qm(t){var e=t.getAttribute("is")||t.nodeName,n=R0.get(e);if(n)return n;R0.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=Z1(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=eh(s)}return n}function wt(t,e,n=e){var r=new WeakSet;lh(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=qc(t)?jc(a):a,n(a),Fe!==null&&r.add(Fe),await Hm(),a!==(a=e())){var i=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=a??"",o!==null){var d=t.value.length;i===o&&o===l&&d>l?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=i,t.selectionEnd=Math.min(o,d))}}}),ra(e)==null&&t.value&&(n(qc(t)?jc(t.value):t.value),Fe!==null&&r.add(Fe)),Zl(()=>{var s=e();if(t===document.activeElement){var a=Fe;if(r.has(a))return}qc(t)&&s===jc(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const Hc=new Set;function tT(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var o of e)i=i[o]??(i[o]=[]);i.push(n),lh(n,"change",()=>{var l=n.__value;a&&(l=nT(i,l,n.checked)),s(l)},()=>s(a?[]:null)),Zl(()=>{var l=r();a?(l=l||[],n.checked=l.includes(n.__value)):n.checked=Am(n.__value,l)}),mu(()=>{var l=i.indexOf(n);l!==-1&&i.splice(l,1)}),Hc.has(i)||(Hc.add(i),xr(()=>{i.sort((l,d)=>l.compareDocumentPosition(d)===4?-1:1),Hc.delete(i)})),xr(()=>{})}function nT(t,e,n){for(var r=new Set,s=0;s<t.length;s+=1)t[s].checked&&r.add(t[s].__value);return n||r.delete(e),Array.from(r)}function qc(t){var e=t.type;return e==="number"||e==="range"}function jc(t){return t===""?null:+t}var js,Pi,du,Gl,Zm;const Kl=class Kl{constructor(e){Ue(this,Gl);Ue(this,js,new WeakMap);Ue(this,Pi);Ue(this,du);Ye(this,du,e)}observe(e,n){var r=V(this,js).get(e)||new Set;return r.add(n),V(this,js).set(e,r),rt(this,Gl,Zm).call(this).observe(e,V(this,du)),()=>{var s=V(this,js).get(e);s.delete(n),s.size===0&&(V(this,js).delete(e),V(this,Pi).unobserve(e))}}};js=new WeakMap,Pi=new WeakMap,du=new WeakMap,Gl=new WeakSet,Zm=function(){return V(this,Pi)??Ye(this,Pi,new ResizeObserver(e=>{for(var n of e){Kl.entries.set(n.target,n);for(var r of V(this,js).get(n.target)||[])r(n)}}))},ye(Kl,"entries",new WeakMap);let Pd=Kl;var rT=new Pd({box:"border-box"});function sT(t,e,n){var r=rT.observe(t,()=>n(t[e]));ro(()=>(ra(()=>n(t[e])),r))}function $c(t,e){return t===e||(t==null?void 0:t[Qr])===e}function mn(t={},e,n,r){var s=Ct.r,a=Ze;return ro(()=>{var i,o;return Zl(()=>{i=o,o=[],ra(()=>{$c(n(...o),t)||(e(t,...o),i&&$c(n(...i),t)&&e(null,...i))})}),()=>{let l=a;for(;l!==s&&l.parent!==null&&l.parent.f&_d;)l=l.parent;const d=()=>{o&&$c(n(...o),t)&&e(null,...o)},f=l.teardown;l.teardown=()=>{d(),f==null||f()}}}),t}function Jm(t=!1){const e=Ct,n=e.l.u;if(!n)return;let r=()=>A_(e.s);if(t){let s=0,a={};const i=Hi(()=>{let o=!1;const l=e.s;for(const d in l)l[d]!==a[d]&&(a[d]=l[d],o=!0);return o&&s++,s});r=()=>u(i)}n.b.length&&m_(()=>{D0(e,r),bd(n.b)}),Rt(()=>{const s=ra(()=>n.m.map(uE));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&Rt(()=>{D0(e,r),bd(n.a)})}function D0(t,e){if(t.l.s)for(const n of t.l.s)u(n);e()}const aT={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Jt(t,e,n){return new Proxy({props:t,exclude:e},aT)}const iT={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(co(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r)return r[e]}},set(t,e,n){let r=t.props.length;for(;r--;){let s=t.props[r];co(s)&&(s=s());const a=Xs(s,e);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(co(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=Xs(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Qr||e===tm)return!1;for(let n of t.props)if(co(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(co(n)&&(n=n()),!!n){for(const r in n)e.includes(r)||e.push(r);for(const r of Object.getOwnPropertySymbols(n))e.includes(r)||e.push(r)}return e}};function on(...t){return new Proxy({props:t},iT)}function Vn(t,e,n,r){var M;var s=!to||(n&CE)!==0,a=(n&OE)!==0,i=(n&xE)!==0,o=r,l=!0,d=void 0,f=()=>i&&s?(d??(d=Hi(r)),u(d)):(l&&(l=!1,o=i?ra(r):r),o);let g;if(a){var h=Qr in t||tm in t;g=((M=Xs(t,e))==null?void 0:M.set)??(h&&e in t?B=>t[e]=B:void 0)}var p,v=!1;a?[p,v]=GE(()=>t[e]):p=t[e],p===void 0&&r!==void 0&&(p=f(),g&&(s&&bE(),g(p)));var _;if(s?_=()=>{var B=t[e];return B===void 0?f():(l=!0,B)}:_=()=>{var B=t[e];return B!==void 0&&(o=void 0),B===void 0?o:B},s&&(n&LE)===0)return _;if(g){var E=t.$$legacy;return(function(B,J){return arguments.length>0?((!s||!J||E||v)&&g(J?_():B),B):_()})}var b=!1,x=((n&IE)!==0?Hi:oh)(()=>(b=!1,_()));a&&u(x);var O=Ze;return(function(B,J){if(arguments.length>0){const H=J?u(x):s&&a?ct(B):B;return T(x,H),b=!0,o!==void 0&&(o=H),B}return ys&&b||(O.f&vr)!==0?x.v:u(x)})}function Za(t){Ct===null&&nm(),to&&Ct.l!==null?oT(Ct).m.push(t):Rt(()=>{const e=ra(t);if(typeof e=="function")return e})}function oT(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const uT="5";var X1;typeof window<"u"&&((X1=window.__svelte??(window.__svelte={})).v??(X1.v=new Set)).add(uT);qE();function _s(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ph(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ");return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}const lT={html:"text/html; charset=utf-8",json:"application/json; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",css:"text/css; charset=utf-8",txt:"text/plain; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",avif:"image/avif",gif:"image/gif",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",map:"application/json; charset=utf-8"};function cT(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return lT[e]??"application/octet-stream"}class Na extends Error{constructor(e){super(e),this.name="ContentParseError"}}const dT=new Set(["template","title","isPublished","fields","created","published","updated"]);function Md(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Bd(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function fT(t){return Md(t)&&Object.values(t).every(Bd)}function hT(t,e){if(Bd(e))return e;if(Array.isArray(e)){if(e.every(Bd)||e.every(fT))return e;throw new Na(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new Na(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Fu(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Na(`"${e}" must be a string when present.`);return n}}function tc(t){return eg(t).item}function eg(t){if(!Md(t))throw new Na("A content item must be a JSON object.");if(typeof t.title!="string")throw new Na('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new Na(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!Md(t.fields))throw new Na('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([d,f])=>[d,hT(d,f)]))}const r=Fu(t,"template"),s=Fu(t,"created"),a=Fu(t,"published"),i=Fu(t,"updated"),o=Object.keys(t).filter(d=>!dT.has(d)).sort();return{item:{title:t.title,isPublished:e,fields:n,...r!==void 0&&{template:r},...s!==void 0&&{created:s},...a!==void 0&&{published:a},...i!==void 0&&{updated:i}},diagnostics:{unknownTopLevelKeys:o}}}function k0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function tg(t){if(!k0(t))return{order:[]};const e=Array.isArray(t.order)?t.order.filter(a=>typeof a=="string"):[],n=typeof t.name=="string"?t.name:void 0,r=typeof t.defaultTemplate=="string"?t.defaultTemplate:void 0,s=k0(t.collection)?{recursive:t.collection.recursive===!0}:void 0;return{order:e,...n!==void 0&&{name:n},...r!==void 0&&{defaultTemplate:r},...s!==void 0&&{collection:s}}}class ng extends Error{constructor(e){super(`No such file in content source: ${e}`),this.path=e,this.name="NotFoundError"}}const rg="_sort.json",pT="_redirects.json",mT="_site.json",gT="assets",P0=".json",st={content:"content",templates:"templates",components:"components",public:"public"};function Jr(...t){return t.filter(e=>e!=="").join("/")}async function mh(t,e=st.content){return sg(t,e,"","")}async function sg(t,e,n,r){const[s,a]=await Promise.all([t.list(e),ET(t,e)]),i=new Map;for(const l of s)if(l.kind==="file"){if(l.name===rg||l.name===pT||l.name===mT||!l.name.endsWith(P0))continue;const d=l.name.slice(0,-P0.length),f=await vT(t,Jr(e,l.name),d,r);f!==void 0&&i.set(d,f)}else{if(l.name===gT)continue;const d=Jr(r,l.name);i.set(l.name,await sg(t,Jr(e,l.name),l.name,d))}const o=a.name??(n===""?"":ph(n));return{kind:"dir",slug:n,name:o,path:r,children:_T(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function vT(t,e,n,r){try{return await bT(t,e,n,r)}catch(s){if(s instanceof ng)return;throw s}}async function bT(t,e,n,r){const s=await t.readText(e);try{const{item:a,diagnostics:i}=eg(JSON.parse(s));return{kind:"item",slug:n,path:Jr(r,n),item:a,...i.unknownTopLevelKeys.length>0&&{parseDiagnostics:i}}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function ET(t,e){const n=Jr(e,rg);if(!await t.exists(n))return{order:[]};try{return tg(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function _T(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}function gh(t,e=st.components){return vh(t,e,"html")}function ag(t,e=st.components){return vh(t,e,"css")}function ig(t,e=st.components){return vh(t,e,"js")}async function vh(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const o of await t.list(i)){const l=Jr(i,o.name);if(o.kind==="dir")await a(l);else if(o.name.endsWith(r)){const d=o.name.slice(0,-r.length).toLowerCase();try{s.set(d,await t.readText(l))}catch(f){if(!(f instanceof ng))throw f}}}};return await a(e),s}async function Cl(t,e,n=st.templates){return t.readText(Jr(n,`${e}.html`))}function TT(t,e,n=st.templates){return Eh(t,Jr(n,`${e}.css`))}function AT(t,e,n=st.templates){return Eh(t,Jr(n,`${e}.js`))}const bu="document";function bh(t,e=st.templates){return Eh(t,Jr(e,`${bu}.html`))}async function Eh(t,e){try{return await t.readText(e)}catch{return}}const yT=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ht="�";var I;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const Bn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function og(t){return t>=55296&&t<=57343}function NT(t){return t>=56320&&t<=57343}function wT(t,e){return(t-55296)*1024+9216+e}function ug(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function lg(t){return t>=64976&&t<=65007||yT.has(t)}var ne;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ne||(ne={}));const ST=65536;class IT{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=ST,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:a}=this,i=s+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(NT(n))return this.pos++,this._addGap(),wT(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(ne.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const r=this.html.charCodeAt(n);return r===I.CARRIAGE_RETURN?I.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let e=this.html.charCodeAt(this.pos);return e===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):e===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,og(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===I.LINE_FEED||e===I.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){ug(e)?this._err(ne.controlCharacterInInputStream):lg(e)&&this._err(ne.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var lt;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(lt||(lt={}));function cg(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const CT=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),LT=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function OT(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=LT.get(t))!==null&&e!==void 0?e:t}var hn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(hn||(hn={}));const xT=32;var zs;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(zs||(zs={}));function Fd(t){return t>=hn.ZERO&&t<=hn.NINE}function RT(t){return t>=hn.UPPER_A&&t<=hn.UPPER_F||t>=hn.LOWER_A&&t<=hn.LOWER_F}function DT(t){return t>=hn.UPPER_A&&t<=hn.UPPER_Z||t>=hn.LOWER_A&&t<=hn.LOWER_Z||Fd(t)}function kT(t){return t===hn.EQUALS||DT(t)}var fn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(fn||(fn={}));var bs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(bs||(bs={}));class PT{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=fn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bs.Strict}startEntity(e){this.decodeMode=e,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case fn.EntityStart:return e.charCodeAt(n)===hn.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(e,n));case fn.NumericStart:return this.stateNumericStart(e,n);case fn.NumericDecimal:return this.stateNumericDecimal(e,n);case fn.NumericHex:return this.stateNumericHex(e,n);case fn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|xT)===hn.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(e.substr(n,a),s),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(Fd(s)||RT(s))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(Fd(s))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===hn.SEMI)this.consumed+=1;else if(this.decodeMode===bs.Strict)return 0;return this.emitCodePoint(OT(this.result),this.consumed),this.errors&&(e!==hn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&zs.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=MT(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===bs.Attribute&&(a===0||kT(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&zs.VALUE_LENGTH)>>14,a!==0){if(i===hn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==bs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,s=(r[n]&zs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[e]&~zs.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==bs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}}function MT(t,e,n,r){const s=(e&zs.BRANCH_LENGTH)>>7,a=e&zs.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const l=r-a;return l<0||l>=s?-1:t[n+l]-1}let i=n,o=i+s-1;for(;i<=o;){const l=i+o>>>1,d=t[l];if(d<r)i=l+1;else if(d>r)o=l-1;else return t[l+s]}return-1}var pe;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(pe||(pe={}));var Pa;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Pa||(Pa={}));var dr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(dr||(dr={}));var Z;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(Z||(Z={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const BT=new Map([[Z.A,c.A],[Z.ADDRESS,c.ADDRESS],[Z.ANNOTATION_XML,c.ANNOTATION_XML],[Z.APPLET,c.APPLET],[Z.AREA,c.AREA],[Z.ARTICLE,c.ARTICLE],[Z.ASIDE,c.ASIDE],[Z.B,c.B],[Z.BASE,c.BASE],[Z.BASEFONT,c.BASEFONT],[Z.BGSOUND,c.BGSOUND],[Z.BIG,c.BIG],[Z.BLOCKQUOTE,c.BLOCKQUOTE],[Z.BODY,c.BODY],[Z.BR,c.BR],[Z.BUTTON,c.BUTTON],[Z.CAPTION,c.CAPTION],[Z.CENTER,c.CENTER],[Z.CODE,c.CODE],[Z.COL,c.COL],[Z.COLGROUP,c.COLGROUP],[Z.DD,c.DD],[Z.DESC,c.DESC],[Z.DETAILS,c.DETAILS],[Z.DIALOG,c.DIALOG],[Z.DIR,c.DIR],[Z.DIV,c.DIV],[Z.DL,c.DL],[Z.DT,c.DT],[Z.EM,c.EM],[Z.EMBED,c.EMBED],[Z.FIELDSET,c.FIELDSET],[Z.FIGCAPTION,c.FIGCAPTION],[Z.FIGURE,c.FIGURE],[Z.FONT,c.FONT],[Z.FOOTER,c.FOOTER],[Z.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[Z.FORM,c.FORM],[Z.FRAME,c.FRAME],[Z.FRAMESET,c.FRAMESET],[Z.H1,c.H1],[Z.H2,c.H2],[Z.H3,c.H3],[Z.H4,c.H4],[Z.H5,c.H5],[Z.H6,c.H6],[Z.HEAD,c.HEAD],[Z.HEADER,c.HEADER],[Z.HGROUP,c.HGROUP],[Z.HR,c.HR],[Z.HTML,c.HTML],[Z.I,c.I],[Z.IMG,c.IMG],[Z.IMAGE,c.IMAGE],[Z.INPUT,c.INPUT],[Z.IFRAME,c.IFRAME],[Z.KEYGEN,c.KEYGEN],[Z.LABEL,c.LABEL],[Z.LI,c.LI],[Z.LINK,c.LINK],[Z.LISTING,c.LISTING],[Z.MAIN,c.MAIN],[Z.MALIGNMARK,c.MALIGNMARK],[Z.MARQUEE,c.MARQUEE],[Z.MATH,c.MATH],[Z.MENU,c.MENU],[Z.META,c.META],[Z.MGLYPH,c.MGLYPH],[Z.MI,c.MI],[Z.MO,c.MO],[Z.MN,c.MN],[Z.MS,c.MS],[Z.MTEXT,c.MTEXT],[Z.NAV,c.NAV],[Z.NOBR,c.NOBR],[Z.NOFRAMES,c.NOFRAMES],[Z.NOEMBED,c.NOEMBED],[Z.NOSCRIPT,c.NOSCRIPT],[Z.OBJECT,c.OBJECT],[Z.OL,c.OL],[Z.OPTGROUP,c.OPTGROUP],[Z.OPTION,c.OPTION],[Z.P,c.P],[Z.PARAM,c.PARAM],[Z.PLAINTEXT,c.PLAINTEXT],[Z.PRE,c.PRE],[Z.RB,c.RB],[Z.RP,c.RP],[Z.RT,c.RT],[Z.RTC,c.RTC],[Z.RUBY,c.RUBY],[Z.S,c.S],[Z.SCRIPT,c.SCRIPT],[Z.SEARCH,c.SEARCH],[Z.SECTION,c.SECTION],[Z.SELECT,c.SELECT],[Z.SOURCE,c.SOURCE],[Z.SMALL,c.SMALL],[Z.SPAN,c.SPAN],[Z.STRIKE,c.STRIKE],[Z.STRONG,c.STRONG],[Z.STYLE,c.STYLE],[Z.SUB,c.SUB],[Z.SUMMARY,c.SUMMARY],[Z.SUP,c.SUP],[Z.TABLE,c.TABLE],[Z.TBODY,c.TBODY],[Z.TEMPLATE,c.TEMPLATE],[Z.TEXTAREA,c.TEXTAREA],[Z.TFOOT,c.TFOOT],[Z.TD,c.TD],[Z.TH,c.TH],[Z.THEAD,c.THEAD],[Z.TITLE,c.TITLE],[Z.TR,c.TR],[Z.TRACK,c.TRACK],[Z.TT,c.TT],[Z.U,c.U],[Z.UL,c.UL],[Z.SVG,c.SVG],[Z.VAR,c.VAR],[Z.WBR,c.WBR],[Z.XMP,c.XMP]]);function nc(t){var e;return(e=BT.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const be=c,FT={[pe.HTML]:new Set([be.ADDRESS,be.APPLET,be.AREA,be.ARTICLE,be.ASIDE,be.BASE,be.BASEFONT,be.BGSOUND,be.BLOCKQUOTE,be.BODY,be.BR,be.BUTTON,be.CAPTION,be.CENTER,be.COL,be.COLGROUP,be.DD,be.DETAILS,be.DIR,be.DIV,be.DL,be.DT,be.EMBED,be.FIELDSET,be.FIGCAPTION,be.FIGURE,be.FOOTER,be.FORM,be.FRAME,be.FRAMESET,be.H1,be.H2,be.H3,be.H4,be.H5,be.H6,be.HEAD,be.HEADER,be.HGROUP,be.HR,be.HTML,be.IFRAME,be.IMG,be.INPUT,be.LI,be.LINK,be.LISTING,be.MAIN,be.MARQUEE,be.MENU,be.META,be.NAV,be.NOEMBED,be.NOFRAMES,be.NOSCRIPT,be.OBJECT,be.OL,be.P,be.PARAM,be.PLAINTEXT,be.PRE,be.SCRIPT,be.SECTION,be.SELECT,be.SOURCE,be.STYLE,be.SUMMARY,be.TABLE,be.TBODY,be.TD,be.TEMPLATE,be.TEXTAREA,be.TFOOT,be.TH,be.THEAD,be.TITLE,be.TR,be.TRACK,be.UL,be.WBR,be.XMP]),[pe.MATHML]:new Set([be.MI,be.MO,be.MN,be.MS,be.MTEXT,be.ANNOTATION_XML]),[pe.SVG]:new Set([be.TITLE,be.FOREIGN_OBJECT,be.DESC]),[pe.XLINK]:new Set,[pe.XML]:new Set,[pe.XMLNS]:new Set},Ud=new Set([be.H1,be.H2,be.H3,be.H4,be.H5,be.H6]),UT=new Set([Z.STYLE,Z.SCRIPT,Z.XMP,Z.IFRAME,Z.NOEMBED,Z.NOFRAMES,Z.PLAINTEXT]);function HT(t,e){return UT.has(t)||e&&t===Z.NOSCRIPT}var D;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(D||(D={}));const $n={DATA:D.DATA,RCDATA:D.RCDATA,RAWTEXT:D.RAWTEXT,SCRIPT_DATA:D.SCRIPT_DATA,PLAINTEXT:D.PLAINTEXT,CDATA_SECTION:D.CDATA_SECTION};function qT(t){return t>=I.DIGIT_0&&t<=I.DIGIT_9}function yo(t){return t>=I.LATIN_CAPITAL_A&&t<=I.LATIN_CAPITAL_Z}function jT(t){return t>=I.LATIN_SMALL_A&&t<=I.LATIN_SMALL_Z}function Ps(t){return jT(t)||yo(t)}function M0(t){return Ps(t)||qT(t)}function Uu(t){return t+32}function dg(t){return t===I.SPACE||t===I.LINE_FEED||t===I.TABULATION||t===I.FORM_FEED}function B0(t){return dg(t)||t===I.SOLIDUS||t===I.GREATER_THAN_SIGN}function $T(t){return t===I.NULL?ne.nullCharacterReference:t>1114111?ne.characterReferenceOutsideUnicodeRange:og(t)?ne.surrogateCharacterReference:lg(t)?ne.noncharacterCharacterReference:ug(t)||t===I.CARRIAGE_RETURN?ne.controlCharacterReference:null}class YT{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=D.DATA,this.returnState=D.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new IT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new PT(CT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=$T(r);s&&this._err(s,1)}}:void 0)}_err(e,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:lt.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:lt.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:lt.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:lt.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(cg(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ne.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=nc(e.tagName),e.type===lt.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(ne.endTagWithAttributes),e.selfClosing&&this._err(ne.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case lt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case lt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case lt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:lt.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=dg(e)?lt.WHITESPACE_CHARACTER:e===I.NULL?lt.NULL_CHARACTER:lt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(lt.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=D.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bs.Attribute:bs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===D.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===D.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===D.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case D.DATA:{this._stateData(e);break}case D.RCDATA:{this._stateRcdata(e);break}case D.RAWTEXT:{this._stateRawtext(e);break}case D.SCRIPT_DATA:{this._stateScriptData(e);break}case D.PLAINTEXT:{this._statePlaintext(e);break}case D.TAG_OPEN:{this._stateTagOpen(e);break}case D.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case D.TAG_NAME:{this._stateTagName(e);break}case D.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case D.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case D.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case D.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case D.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case D.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case D.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case D.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case D.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case D.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case D.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case D.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case D.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case D.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case D.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case D.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case D.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case D.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case D.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case D.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case D.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case D.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case D.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case D.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case D.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case D.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case D.BOGUS_COMMENT:{this._stateBogusComment(e);break}case D.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case D.COMMENT_START:{this._stateCommentStart(e);break}case D.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case D.COMMENT:{this._stateComment(e);break}case D.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case D.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case D.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case D.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case D.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case D.COMMENT_END:{this._stateCommentEnd(e);break}case D.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case D.DOCTYPE:{this._stateDoctype(e);break}case D.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case D.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case D.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case D.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case D.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case D.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case D.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case D.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case D.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case D.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case D.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case D.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case D.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case D.CDATA_SECTION:{this._stateCdataSection(e);break}case D.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case D.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case D.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case D.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case I.LESS_THAN_SIGN:{this.state=D.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(e);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=D.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case I.LESS_THAN_SIGN:{this.state=D.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ps(e))this._createStartTagToken(),this.state=D.TAG_NAME,this._stateTagName(e);else switch(e){case I.EXCLAMATION_MARK:{this.state=D.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=D.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=D.BOGUS_COMMENT,this._stateBogusComment(e);break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=D.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ps(e))this._createEndTagToken(),this.state=D.TAG_NAME,this._stateTagName(e);else switch(e){case I.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=D.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=D.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.tagName+=Ht;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(yo(e)?Uu(e):e)}}_stateRcdataLessThanSign(e){e===I.SOLIDUS?this.state=D.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=D.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ps(e)?(this.state=D.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=D.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=D.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=D.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=D.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===I.SOLIDUS?this.state=D.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=D.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ps(e)?(this.state=D.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=D.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case I.SOLIDUS:{this.state=D.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=D.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=D.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ps(e)?(this.state=D.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===I.HYPHEN_MINUS?(this.state=D.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===I.HYPHEN_MINUS?(this.state=D.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=D.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=D.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===I.SOLIDUS?this.state=D.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ps(e)?(this._emitChars("<"),this.state=D.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ps(e)?(this.state=D.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&B0(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=D.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=D.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case I.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===I.SOLIDUS?(this.state=D.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&B0(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=D.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=D.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=D.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case I.EQUALS_SIGN:{this._err(ne.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=D.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=D.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=D.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=D.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(ne.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.name+=Ht;break}default:this.currentAttr.name+=String.fromCodePoint(yo(e)?Uu(e):e)}}_stateAfterAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=D.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=D.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=D.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=D.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=D.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingAttributeValue),this.state=D.DATA,this.emitCurrentTagToken();break}default:this.state=D.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case I.QUOTATION_MARK:{this.state=D.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case I.APOSTROPHE:{this.state=D.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=D.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=D.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(ne.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=D.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=D.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=D.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBetweenAttributes),this.state=D.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case I.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=D.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.unexpectedSolidusInTag),this.state=D.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentComment(n);break}case I.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ht;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Bn.DASH_DASH,!0)?(this._createCommentToken(Bn.DASH_DASH.length+1),this.state=D.COMMENT_START):this._consumeSequenceIfMatch(Bn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bn.DOCTYPE.length+1),this.state=D.DOCTYPE):this._consumeSequenceIfMatch(Bn.CDATA_START,!0)?this.inForeignNode?this.state=D.CDATA_SECTION:(this._err(ne.cdataInHtmlContent),this._createCommentToken(Bn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=D.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ne.incorrectlyOpenedComment),this._createCommentToken(2),this.state=D.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=D.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=D.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=D.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=D.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{n.data+="<",this.state=D.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ht;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case I.EXCLAMATION_MARK:{n.data+="!",this.state=D.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=D.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===I.HYPHEN_MINUS?this.state=D.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=D.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===I.HYPHEN_MINUS?this.state=D.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=D.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==I.GREATER_THAN_SIGN&&e!==I.EOF&&this._err(ne.nestedComment),this.state=D.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{this.state=D.COMMENT_END;break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=D.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentComment(n);break}case I.EXCLAMATION_MARK:{this.state=D.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{n.data+="-";break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=D.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case I.HYPHEN_MINUS:{n.data+="--!",this.state=D.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(ne.incorrectlyClosedComment),this.state=D.DATA,this.emitCurrentComment(n);break}case I.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=D.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=D.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBeforeDoctypeName),this.state=D.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(yo(e))this._createDoctypeToken(String.fromCharCode(Uu(e))),this.state=D.DOCTYPE_NAME;else switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(ne.unexpectedNullCharacter),this._createDoctypeToken(Ht),this.state=D.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=D.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.name+=Ht;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(yo(e)?Uu(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Bn.PUBLIC,!1)?this.state=D.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bn.SYSTEM,!1)?this.state=D.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ne.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.publicId="",this.state=D.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case I.QUOTATION_MARK:{this.state=D.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case I.APOSTROPHE:{this.state=D.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.QUOTATION_MARK:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=D.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{n.systemId="",this.state=D.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.DATA,this.emitCurrentDoctype(n);break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case I.QUOTATION_MARK:{this.state=D.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case I.APOSTROPHE:{this.state=D.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ht;break}case I.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=D.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=D.DATA;break}case I.NULL:{this._err(ne.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case I.RIGHT_SQUARE_BRACKET:{this.state=D.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(ne.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===I.RIGHT_SQUARE_BRACKET?this.state=D.CDATA_SECTION_END:(this._emitChars("]"),this.state=D.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case I.GREATER_THAN_SIGN:{this.state=D.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=D.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&M0(this.preprocessor.peek(1))?D.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){M0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===I.SEMICOLON&&this._err(ne.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const fg=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),F0=new Set([...fg,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Ll=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),zT=new Set([...Ll,c.OL,c.UL]),WT=new Set([...Ll,c.BUTTON]),U0=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),H0=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),GT=new Set([c.TR,c.TEMPLATE,c.HTML]),KT=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),VT=new Set([c.TABLE,c.TEMPLATE,c.HTML]),XT=new Set([c.TD,c.TH]);class QT{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===pe.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const s=this._indexOf(e)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==pe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Ud,pe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(XT,pe.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(VT,pe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(KT,pe.HTML)}clearBackToTableRowContext(){this.clearBackTo(GT,pe.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case pe.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case pe.SVG:{if(H0.has(s))return!1;break}case pe.MATHML:{if(U0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Ll)}hasInListItemScope(e){return this.hasInDynamicScope(e,zT)}hasInButtonScope(e){return this.hasInDynamicScope(e,WT)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case pe.HTML:{if(Ud.has(n))return!0;if(Ll.has(n))return!1;break}case pe.SVG:{if(H0.has(n))return!1;break}case pe.MATHML:{if(U0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===pe.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&fg.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&F0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&F0.has(this.currentTagId);)this.pop()}}const Yc=3;var Kr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Kr||(Kr={}));const q0={type:Kr.Marker};class ZT{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const l=this.entries[o];if(l.type===Kr.Marker)break;const{element:d}=l;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===i){const f=this.treeAdapter.getAttrList(d);f.length===s&&r.push({idx:o,attrs:f})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Yc)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Yc)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(l=>s.get(l.name)===l.value)&&(a+=1,a>=Yc&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(q0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Kr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Kr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(q0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Kr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Kr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Kr.Element&&n.element===e)}}const ps={createDocument(){return{nodeName:"#document",mode:dr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const s=t.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=e,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};ps.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(ps.isTextNode(n)){n.value+=e;return}}ps.appendChild(t,ps.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&ps.isTextNode(r)?r.value+=e:ps.insertBefore(t,ps.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},hg="html",JT="about:legacy-compat",e2="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",pg=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],t2=[...pg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],n2=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),mg=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],r2=[...mg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function j0(t,e){return e.some(n=>t.startsWith(n))}function s2(t){return t.name===hg&&t.publicId===null&&(t.systemId===null||t.systemId===JT)}function a2(t){if(t.name!==hg)return dr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===e2)return dr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),n2.has(n))return dr.QUIRKS;let r=e===null?t2:pg;if(j0(n,r))return dr.QUIRKS;if(r=e===null?mg:r2,j0(n,r))return dr.LIMITED_QUIRKS}return dr.NO_QUIRKS}const $0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},i2="definitionurl",o2="definitionURL",u2=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),l2=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:pe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:pe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:pe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:pe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:pe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:pe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:pe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:pe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:pe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:pe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:pe.XMLNS}]]),c2=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),d2=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function f2(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===Pa.COLOR||r===Pa.SIZE||r===Pa.FACE)||d2.has(e)}function gg(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===i2){t.attrs[e].name=o2;break}}function vg(t){for(let e=0;e<t.attrs.length;e++){const n=u2.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function _h(t){for(let e=0;e<t.attrs.length;e++){const n=l2.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function h2(t){const e=c2.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=nc(t.tagName))}function p2(t,e){return e===pe.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function m2(t,e,n){if(e===pe.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Pa.ENCODING){const s=n[r].value.toLowerCase();return s===$0.TEXT_HTML||s===$0.APPLICATION_XML}}return e===pe.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function g2(t,e,n,r){return(!r||r===pe.HTML)&&m2(t,e,n)||(!r||r===pe.MATHML)&&p2(t,e)}const v2="hidden",b2=8,E2=3;var P;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(P||(P={}));const _2={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},bg=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),Y0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ps,onParseError:null};class Eg{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=P.INITIAL,this.originalInsertionMode=P.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Y0,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new YT(this.options,this),this.activeFormattingElements=new ZT(this.treeAdapter),this.fragmentContextID=r?nc(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new QT(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...Y0,...n};e??(e=r.treeAdapter.createElement(Z.TEMPLATE,pe.HTML,[]));const s=r.treeAdapter.createElement("documentmock",pe.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(P.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const a=(s=e.location)!==null&&s!==void 0?s:_2,i={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(i)}onItemPush(e,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),n){let a,i;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,i=this.fragmentContextID):{current:a,currentTagId:i}=this.openElements,this._setContextModes(a,i)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===pe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,pe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=P.TEXT}switchToPlaintextParsing(){this.insertionMode=P.TEXT,this.originalInsertionMode=P.IN_BODY,this.tokenizer.state=$n.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Z.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==pe.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=$n.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=$n.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=$n.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=$n.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),e.location){const i=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,pe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,pe.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Z.HTML,pe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,i=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:l,endCol:d,endOffset:f}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:l,endCol:d,endOffset:f})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),a=n.type===lt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===Z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===pe.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,pe.HTML)}_processToken(e){switch(e.type){case lt.CHARACTER:{this.onCharacter(e);break}case lt.NULL_CHARACTER:{this.onNullCharacter(e);break}case lt.COMMENT:{this.onComment(e);break}case lt.DOCTYPE:{this.onDoctype(e);break}case lt.START_TAG:{this._processStartTag(e);break}case lt.END_TAG:{this.onEndTag(e);break}case lt.EOF:{this.onEof(e);break}case lt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return g2(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Kr.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=P.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=P.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=P.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=P.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=P.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=P.IN_TABLE;return}case c.BODY:{this.insertionMode=P.IN_BODY;return}case c.FRAMESET:{this.insertionMode=P.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?P.AFTER_HEAD:P.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=P.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=P.IN_HEAD;return}break}}this.insertionMode=P.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=P.IN_SELECT_IN_TABLE;return}}this.insertionMode=P.IN_SELECT}_isElementCausesFosterParenting(e){return bg.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===pe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return FT[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){XA(this,e);return}switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{xo(this,e);break}case P.BEFORE_HEAD:{Ro(this,e);break}case P.IN_HEAD:{Do(this,e);break}case P.IN_HEAD_NO_SCRIPT:{ko(this,e);break}case P.AFTER_HEAD:{Po(this,e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:{Tg(this,e);break}case P.TEXT:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{zc(this,e);break}case P.IN_TABLE_TEXT:{Ig(this,e);break}case P.IN_COLUMN_GROUP:{Ol(this,e);break}case P.AFTER_BODY:{xl(this,e);break}case P.AFTER_AFTER_BODY:{hl(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){VA(this,e);return}switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{xo(this,e);break}case P.BEFORE_HEAD:{Ro(this,e);break}case P.IN_HEAD:{Do(this,e);break}case P.IN_HEAD_NO_SCRIPT:{ko(this,e);break}case P.AFTER_HEAD:{Po(this,e);break}case P.TEXT:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{zc(this,e);break}case P.IN_COLUMN_GROUP:{Ol(this,e);break}case P.AFTER_BODY:{xl(this,e);break}case P.AFTER_AFTER_BODY:{hl(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Hd(this,e);return}switch(this.insertionMode){case P.INITIAL:case P.BEFORE_HTML:case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_TEMPLATE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{Hd(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.AFTER_BODY:{I2(this,e);break}case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{C2(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case P.INITIAL:{L2(this,e);break}case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:{this._err(e,ne.misplacedDoctype);break}case P.IN_TABLE_TEXT:{go(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?QA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{O2(this,e);break}case P.BEFORE_HEAD:{R2(this,e);break}case P.IN_HEAD:{Mr(this,e);break}case P.IN_HEAD_NO_SCRIPT:{P2(this,e);break}case P.AFTER_HEAD:{B2(this,e);break}case P.IN_BODY:{Ln(this,e);break}case P.IN_TABLE:{zi(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.IN_CAPTION:{DA(this,e);break}case P.IN_COLUMN_GROUP:{yh(this,e);break}case P.IN_TABLE_BODY:{ac(this,e);break}case P.IN_ROW:{ic(this,e);break}case P.IN_CELL:{MA(this,e);break}case P.IN_SELECT:{Og(this,e);break}case P.IN_SELECT_IN_TABLE:{FA(this,e);break}case P.IN_TEMPLATE:{HA(this,e);break}case P.AFTER_BODY:{jA(this,e);break}case P.IN_FRAMESET:{$A(this,e);break}case P.AFTER_FRAMESET:{zA(this,e);break}case P.AFTER_AFTER_BODY:{GA(this,e);break}case P.AFTER_AFTER_FRAMESET:{KA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?ZA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{x2(this,e);break}case P.BEFORE_HEAD:{D2(this,e);break}case P.IN_HEAD:{k2(this,e);break}case P.IN_HEAD_NO_SCRIPT:{M2(this,e);break}case P.AFTER_HEAD:{F2(this,e);break}case P.IN_BODY:{sc(this,e);break}case P.TEXT:{yA(this,e);break}case P.IN_TABLE:{Wo(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.IN_CAPTION:{kA(this,e);break}case P.IN_COLUMN_GROUP:{PA(this,e);break}case P.IN_TABLE_BODY:{qd(this,e);break}case P.IN_ROW:{Lg(this,e);break}case P.IN_CELL:{BA(this,e);break}case P.IN_SELECT:{xg(this,e);break}case P.IN_SELECT_IN_TABLE:{UA(this,e);break}case P.IN_TEMPLATE:{qA(this,e);break}case P.AFTER_BODY:{Dg(this,e);break}case P.IN_FRAMESET:{YA(this,e);break}case P.AFTER_FRAMESET:{WA(this,e);break}case P.AFTER_AFTER_BODY:{hl(this,e);break}}}onEof(e){switch(this.insertionMode){case P.INITIAL:{mo(this,e);break}case P.BEFORE_HTML:{xo(this,e);break}case P.BEFORE_HEAD:{Ro(this,e);break}case P.IN_HEAD:{Do(this,e);break}case P.IN_HEAD_NO_SCRIPT:{ko(this,e);break}case P.AFTER_HEAD:{Po(this,e);break}case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{wg(this,e);break}case P.TEXT:{NA(this,e);break}case P.IN_TABLE_TEXT:{go(this,e);break}case P.IN_TEMPLATE:{Rg(this,e);break}case P.AFTER_BODY:case P.IN_FRAMESET:case P.AFTER_FRAMESET:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{Ah(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===I.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.TEXT:case P.IN_COLUMN_GROUP:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{this._insertCharacters(e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:case P.AFTER_BODY:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{_g(this,e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{zc(this,e);break}case P.IN_TABLE_TEXT:{Sg(this,e);break}}}}function T2(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):Ng(t,e),n}function A2(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const s=t.openElements.items[r];if(s===e.element)break;t._isSpecialElement(s,t.openElements.tagIDs[r])&&(n=s)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function y2(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let a=0,i=s;i!==n;a++,i=s){s=t.openElements.getCommonAncestor(i);const o=t.activeFormattingElements.getElementEntry(i),l=o&&a>=E2;!o||l?(l&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(i)):(i=N2(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function N2(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function w2(t,e,n){const r=t.treeAdapter.getTagName(e),s=nc(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&a===pe.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function S2(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,s.tagID)}function Th(t,e){for(let n=0;n<b2;n++){const r=T2(t,e);if(!r)break;const s=A2(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=y2(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&w2(t,i,a),S2(t,s,r)}}function Hd(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function I2(t,e){t._appendCommentNode(e,t.openElements.items[0])}function C2(t,e){t._appendCommentNode(e,t.document)}function Ah(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],s=t.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],i=t.treeAdapter.getNodeSourceCodeLocation(a);i&&!i.endTag&&t._setEndLocation(a,e)}}}}function L2(t,e){t._setDocumentType(e);const n=e.forceQuirks?dr.QUIRKS:a2(e);s2(e)||t._err(e,ne.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=P.BEFORE_HTML}function mo(t,e){t._err(e,ne.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,dr.QUIRKS),t.insertionMode=P.BEFORE_HTML,t._processToken(e)}function O2(t,e){e.tagID===c.HTML?(t._insertElement(e,pe.HTML),t.insertionMode=P.BEFORE_HEAD):xo(t,e)}function x2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&xo(t,e)}function xo(t,e){t._insertFakeRootElement(),t.insertionMode=P.BEFORE_HEAD,t._processToken(e)}function R2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.HEAD:{t._insertElement(e,pe.HTML),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD;break}default:Ro(t,e)}}function D2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Ro(t,e):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Ro(t,e){t._insertFakeElement(Z.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD,t._processToken(e)}function Mr(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,$n.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,$n.RAWTEXT):(t._insertElement(e,pe.HTML),t.insertionMode=P.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,$n.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,$n.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=P.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(P.IN_TEMPLATE);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Do(t,e)}}function k2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=P.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Do(t,e);break}case c.TEMPLATE:{Ja(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Ja(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,ne.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Do(t,e){t.openElements.pop(),t.insertionMode=P.AFTER_HEAD,t._processToken(e)}function P2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{Mr(t,e);break}case c.NOSCRIPT:{t._err(e,ne.nestedNoscriptInHead);break}default:ko(t,e)}}function M2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=P.IN_HEAD;break}case c.BR:{ko(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function ko(t,e){const n=e.type===lt.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=P.IN_HEAD,t._processToken(e)}function B2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BODY:{t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,ne.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),Mr(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Po(t,e)}}function F2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Po(t,e);break}case c.TEMPLATE:{Ja(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Po(t,e){t._insertFakeElement(Z.BODY,c.BODY),t.insertionMode=P.IN_BODY,rc(t,e)}function rc(t,e){switch(e.type){case lt.CHARACTER:{Tg(t,e);break}case lt.WHITESPACE_CHARACTER:{_g(t,e);break}case lt.COMMENT:{Hd(t,e);break}case lt.START_TAG:{Ln(t,e);break}case lt.END_TAG:{sc(t,e);break}case lt.EOF:{wg(t,e);break}}}function _g(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Tg(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function U2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function H2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function q2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET)}function j2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function $2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Ud.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,pe.HTML)}function Y2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function z2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),n||(t.formElement=t.openElements.current))}function W2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function G2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.tokenizer.state=$n.PLAINTEXT}function K2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1}function V2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Z.A);n&&(Th(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function X2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Q2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(Th(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Z2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function J2(t,e){t.treeAdapter.getDocumentMode(t.document)!==dr.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_TABLE}function Ag(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function yg(t){const e=cg(t,Pa.TYPE);return e!=null&&e.toLowerCase()===v2}function eA(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),yg(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function tA(t,e){t._appendElement(e,pe.HTML),e.ackSelfClosing=!0}function nA(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function rA(t,e){e.tagName=Z.IMG,e.tagID=c.IMG,Ag(t,e)}function sA(t,e){t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.tokenizer.state=$n.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=P.TEXT}function aA(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,$n.RAWTEXT)}function iA(t,e){t.framesetOk=!1,t._switchToTextParsing(e,$n.RAWTEXT)}function z0(t,e){t._switchToTextParsing(e,$n.RAWTEXT)}function oA(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===P.IN_TABLE||t.insertionMode===P.IN_CAPTION||t.insertionMode===P.IN_TABLE_BODY||t.insertionMode===P.IN_ROW||t.insertionMode===P.IN_CELL?P.IN_SELECT_IN_TABLE:P.IN_SELECT}function uA(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function lA(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,pe.HTML)}function cA(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,pe.HTML)}function dA(t,e){t._reconstructActiveFormattingElements(),gg(e),_h(e),e.selfClosing?t._appendElement(e,pe.MATHML):t._insertElement(e,pe.MATHML),e.ackSelfClosing=!0}function fA(t,e){t._reconstructActiveFormattingElements(),vg(e),_h(e),e.selfClosing?t._appendElement(e,pe.SVG):t._insertElement(e,pe.SVG),e.ackSelfClosing=!0}function W0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function Ln(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{X2(t,e);break}case c.A:{V2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{$2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{j2(t,e);break}case c.LI:case c.DD:case c.DT:{W2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{Ag(t,e);break}case c.HR:{nA(t,e);break}case c.RB:case c.RTC:{lA(t,e);break}case c.RT:case c.RP:{cA(t,e);break}case c.PRE:case c.LISTING:{Y2(t,e);break}case c.XMP:{aA(t,e);break}case c.SVG:{fA(t,e);break}case c.HTML:{U2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{Mr(t,e);break}case c.BODY:{H2(t,e);break}case c.FORM:{z2(t,e);break}case c.NOBR:{Q2(t,e);break}case c.MATH:{dA(t,e);break}case c.TABLE:{J2(t,e);break}case c.INPUT:{eA(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{tA(t,e);break}case c.IMAGE:{rA(t,e);break}case c.BUTTON:{K2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{Z2(t,e);break}case c.IFRAME:{iA(t,e);break}case c.SELECT:{oA(t,e);break}case c.OPTION:case c.OPTGROUP:{uA(t,e);break}case c.NOEMBED:case c.NOFRAMES:{z0(t,e);break}case c.FRAMESET:{q2(t,e);break}case c.TEXTAREA:{sA(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?z0(t,e):W0(t,e);break}case c.PLAINTEXT:{G2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:W0(t,e)}}function hA(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function pA(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,Dg(t,e))}function mA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function gA(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function vA(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(Z.P,c.P),t._closePElement()}function bA(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function EA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function _A(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function TA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function AA(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Z.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function Ng(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const a=t.openElements.items[s],i=t.openElements.tagIDs[s];if(r===i&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(a,i))break}}function sc(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{Th(t,e);break}case c.P:{vA(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{mA(t,e);break}case c.LI:{bA(t);break}case c.DD:case c.DT:{EA(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{_A(t);break}case c.BR:{AA(t);break}case c.BODY:{hA(t,e);break}case c.HTML:{pA(t,e);break}case c.FORM:{gA(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{TA(t,e);break}case c.TEMPLATE:{Ja(t,e);break}default:Ng(t,e)}}function wg(t,e){t.tmplInsertionModeStack.length>0?Rg(t,e):Ah(t,e)}function yA(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function NA(t,e){t._err(e,ne.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function zc(t,e){if(t.openElements.currentTagId!==void 0&&bg.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=P.IN_TABLE_TEXT,e.type){case lt.CHARACTER:{Ig(t,e);break}case lt.WHITESPACE_CHARACTER:{Sg(t,e);break}}else Eu(t,e)}function wA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CAPTION}function SA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_COLUMN_GROUP}function IA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.COLGROUP,c.COLGROUP),t.insertionMode=P.IN_COLUMN_GROUP,yh(t,e)}function CA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_TABLE_BODY}function LA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.TBODY,c.TBODY),t.insertionMode=P.IN_TABLE_BODY,ac(t,e)}function OA(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function xA(t,e){yg(e)?t._appendElement(e,pe.HTML):Eu(t,e),e.ackSelfClosing=!0}function RA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,pe.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function zi(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{LA(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}case c.COL:{IA(t,e);break}case c.FORM:{RA(t,e);break}case c.TABLE:{OA(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{CA(t,e);break}case c.INPUT:{xA(t,e);break}case c.CAPTION:{wA(t,e);break}case c.COLGROUP:{SA(t,e);break}default:Eu(t,e)}}function Wo(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Ja(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Eu(t,e)}}function Eu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,rc(t,e),t.fosterParentingEnabled=n}function Sg(t,e){t.pendingCharacterTokens.push(e)}function Ig(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function go(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Eu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Cg=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function DA(t,e){const n=e.tagID;Cg.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,zi(t,e)):Ln(t,e)}function kA(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,n===c.TABLE&&Wo(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:sc(t,e)}}function yh(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.COL:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{Mr(t,e);break}default:Ol(t,e)}}function PA(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TEMPLATE:{Ja(t,e);break}case c.COL:break;default:Ol(t,e)}}function Ol(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE,t._processToken(e))}function ac(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(Z.TR,c.TR),t.insertionMode=P.IN_ROW,ic(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,zi(t,e));break}default:zi(t,e)}}function qd(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,Wo(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:Wo(t,e)}}function ic(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,ac(t,e));break}default:zi(t,e)}}function Lg(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,qd(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,qd(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:Wo(t,e)}}function MA(t,e){const n=e.tagID;Cg.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),ic(t,e)):Ln(t,e)}function BA(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Lg(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:sc(t,e)}}function Og(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}}}function xg(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Ja(t,e);break}}}function FA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Og(t,e)}function UA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):xg(t,e)}function HA(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{Mr(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=P.IN_TABLE,t.insertionMode=P.IN_TABLE,zi(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=P.IN_COLUMN_GROUP,t.insertionMode=P.IN_COLUMN_GROUP,yh(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=P.IN_TABLE_BODY,t.insertionMode=P.IN_TABLE_BODY,ac(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=P.IN_ROW,t.insertionMode=P.IN_ROW,ic(t,e);break}default:t.tmplInsertionModeStack[0]=P.IN_BODY,t.insertionMode=P.IN_BODY,Ln(t,e)}}function qA(t,e){e.tagID===c.TEMPLATE&&Ja(t,e)}function Rg(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Ah(t,e)}function jA(t,e){e.tagID===c.HTML?Ln(t,e):xl(t,e)}function Dg(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=P.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else xl(t,e)}function xl(t,e){t.insertionMode=P.IN_BODY,rc(t,e)}function $A(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.FRAMESET:{t._insertElement(e,pe.HTML);break}case c.FRAME:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{Mr(t,e);break}}}function YA(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=P.AFTER_FRAMESET))}function zA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function WA(t,e){e.tagID===c.HTML&&(t.insertionMode=P.AFTER_AFTER_FRAMESET)}function GA(t,e){e.tagID===c.HTML?Ln(t,e):hl(t,e)}function hl(t,e){t.insertionMode=P.IN_BODY,rc(t,e)}function KA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function VA(t,e){e.chars=Ht,t._insertCharacters(e)}function XA(t,e){t._insertCharacters(e),t.framesetOk=!1}function kg(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==pe.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function QA(t,e){if(f2(e))kg(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===pe.MATHML?gg(e):r===pe.SVG&&(h2(e),vg(e)),_h(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function ZA(t,e){if(e.tagID===c.P||e.tagID===c.BR){kg(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===pe.HTML){t._endTagOutsideForeignContent(e);break}const s=t.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,t.openElements.shortenToLength(n);break}}}function Pg(t,e){return function(r){let s,a=0,i="";for(;s=t.exec(r);)a!==s.index&&(i+=r.substring(a,s.index)),i+=e.get(s[0].charCodeAt(0)),a=s.index+1;return i+r.substring(a)}}const JA=Pg(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),ey=Pg(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),ty=new Set([Z.AREA,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BR,Z.COL,Z.EMBED,Z.FRAME,Z.HR,Z.IMG,Z.INPUT,Z.KEYGEN,Z.LINK,Z.META,Z.PARAM,Z.SOURCE,Z.TRACK,Z.WBR]);function Mg(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===pe.HTML&&ty.has(e.treeAdapter.getTagName(t))}const ny={treeAdapter:ps,scriptingEnabled:!0};function ry(t,e){const n={...ny,...e};return Mg(t,n)?"":Bg(t,n)}function Bg(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===Z.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===pe.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=sy(a,e);return n}function sy(t,e){return e.treeAdapter.isElementNode(t)?ay(t,e):e.treeAdapter.isTextNode(t)?oy(t,e):e.treeAdapter.isCommentNode(t)?uy(t,e):e.treeAdapter.isDocumentTypeNode(t)?ly(t,e):""}function ay(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${iy(t,e)}>${Mg(t,e)?"":`${Bg(t,e)}</${n}>`}`}function iy(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case pe.XML:{n+=`xml:${r.name}`;break}case pe.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case pe.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${JA(r.value)}"`}return n}function oy(t,e){const{treeAdapter:n}=e,r=n.getTextNodeContent(t),s=n.getParentNode(t),a=s&&n.isElementNode(s)&&n.getTagName(s);return a&&n.getNamespaceURI(s)===pe.HTML&&HT(a,e.scriptingEnabled)?r:ey(r)}function uy(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function ly(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function cy(t,e){return Eg.parse(t,e)}function Nh(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Eg.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Xn(t){return"tagName"in t}function ss(t){return t.nodeName==="#text"}function xt(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function Zs(t,e){return t.attrs.some(n=>n.name===e)}function G0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function wh(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Js(t){return Nh(t).childNodes}function dy(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function Wi(t){return dy(t)?cy(t).childNodes:Nh(t).childNodes}function fy(t){const e=Nh("");return e.childNodes=t,ry(e)}const Sh={image:{type:"image",valueKind:"asset",control:"image",multiline:!1},file:{type:"file",valueKind:"asset",control:"file",multiline:!1},url:{type:"url",valueKind:"url",control:"url",multiline:!1},email:{type:"email",valueKind:"text",control:"email",multiline:!1},phone:{type:"phone",valueKind:"text",control:"phone",multiline:!1},date:{type:"date",valueKind:"text",control:"date",multiline:!1},time:{type:"time",valueKind:"text",control:"time",multiline:!1},code:{type:"code",valueKind:"text",control:"code",multiline:!0},richtext:{type:"richtext",valueKind:"html",control:"richtext",multiline:!0},authors:{type:"authors",valueKind:"authors",control:"authors",multiline:!1},text:{type:"text",valueKind:"text",control:"text",multiline:!0},shorttext:{type:"shorttext",valueKind:"text",control:"shorttext",multiline:!1}};function hy(t){return Object.prototype.hasOwnProperty.call(Sh,t)}function za(t){return Sh[t].valueKind}const py=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),my=new Set(["code","pre","kbd","samp"]),gy=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Ma(t){if(t.annotation!==void 0&&hy(t.annotation))return t.annotation;if(t.attribute!==void 0){const e=t.attribute,n=(t.valuePrefix??"").toLowerCase();if(e==="href"){if(n.endsWith("mailto:"))return"email";if(n.endsWith("tel:"))return"phone";if(t.wholeValue)return t.download===!0?"file":"url"}return t.wholeValue&&e==="src"?t.tag==="img"?"image":"file":t.wholeValue&&t.tag==="source"&&e==="srcset"?"file":"shorttext"}return my.has(t.tag)?"code":py.has(t.tag)?"shorttext":gy.has(t.tag)?"text":"shorttext"}const vy=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function Ts(t){const e=[];for(const n of t.matchAll(vy)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Ba(t){var r;const e=t.trim(),n=Ts(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function oc(t,e){return t.replace(/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g,(n,r)=>{const s=r.split(".");return e({raw:n,name:s[0]??"",path:s,dotted:s.length>1})})}function Ih(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function Fg(t){const e=K0(xt(t,"data-minlength")),n=K0(xt(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function K0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function Xr(t,e=new Map){return Hg(t,e,new Set)}function Ug(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=Hg(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function Hg(t,e,n){const r=[],s=new Map,a=f=>{const g=s.get(f);if(g!==void 0)return g;const h={name:f,type:"shorttext",label:ph(f),required:!1,multiline:!1};return s.set(f,h),r.push(f),h},i=(f,g)=>{if(s.has(f))return;const h=a(f);h.type=g,h.multiline=Sh[g].multiline},o=f=>{const g=xt(f,"data-field")??by(f);if(g===void 0)return;const h=a(g);Zs(f,"data-required")&&(h.required=!0);const p=xt(f,"data-help");p!==void 0&&(h.help=p);const v=xt(f,"data-label");v!==void 0&&(h.label=v);const{minLength:_,maxLength:E}=Fg(f);_!==void 0&&(h.minLength=_),E!==void 0&&(h.maxLength=E)},l=f=>{const g=Ba(f);for(const h of Ts(f))h.dotted||i(h.name,Ma({tag:"",wholeValue:(g==null?void 0:g.name)===h.name}))},d=f=>{for(const g of f){if(!Xn(g)){ss(g)&&l(g.value);continue}const h=xt(g,"data-each");if(h!==void 0){const _=a(h);_.type="url",_.multiple=!0;const E=xt(g,"data-pick-from");E!==void 0&&(_.pickFrom=E),o(g);continue}if(Zs(g,"data-each-in"))continue;const p=xt(g,"data-type"),v=e.has(g.tagName)?Ug(g.tagName,e,n):void 0;for(const _ of g.attrs){const E=Ba(_.value);for(const b of Ts(_.value)){if(b.dotted)continue;const x=(E==null?void 0:E.name)===b.name,O=x?v==null?void 0:v.get(_.name):void 0;i(b.name,O??Ma({tag:g.tagName,attribute:_.name,wholeValue:x,valuePrefix:Ih(_.value),download:Zs(g,"download"),...p!==void 0&&{annotation:p}}))}}for(const _ of g.childNodes){if(!ss(_))continue;const E=Ba(_.value);for(const b of Ts(_.value))b.dotted||i(b.name,Ma({tag:g.tagName,wholeValue:(E==null?void 0:E.name)===b.name,...p!==void 0&&{annotation:p}}))}o(g),d(g.childNodes)}};return d(Wi(t)),r.map(f=>Ey(s.get(f)))}function by(t){for(const e of t.attrs){const n=Ts(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(ss(e)){const n=Ts(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function Ey(t){return{name:t.name,type:t.type,label:t.label,required:t.required,multiline:t.multiline,...t.help!==void 0&&{help:t.help},...t.minLength!==void 0&&{minLength:t.minLength},...t.maxLength!==void 0&&{maxLength:t.maxLength},...t.multiple!==void 0&&{multiple:t.multiple},...t.pickFrom!==void 0&&{pickFrom:t.pickFrom}}}function _y(t,e){if(t===e)return!1;const n=za(t),r=za(e);return r==="html"?!1:n==="html"||t==="date"&&e==="time"||t==="time"&&e==="date"||(a=>a==="shorttext"||a==="text"||a==="code"||a==="email"||a==="phone")(t)&&(e==="date"||e==="time")?!0:!(n===r||r==="text")}function Ty(t,e){const n=new Map(t.map(o=>[o.name,o])),r=new Map(e.map(o=>[o.name,o])),s=[],a=[],i=[];for(const[o,l]of n){const d=r.get(o);d===void 0?a.push({name:o,type:l.type}):d.type!==l.type&&i.push({name:o,from:l.type,to:d.type,destructive:_y(l.type,d.type)})}for(const[o,l]of r)n.has(o)||s.push({name:o,type:l.type});return{added:s.sort((o,l)=>o.name.localeCompare(l.name)),removed:a.sort((o,l)=>o.name.localeCompare(l.name)),typeChanged:i.sort((o,l)=>o.name.localeCompare(l.name))}}const V0=/^(.+)@v([1-9]\d*)$/;function Ch(t){const e=V0.exec(t);if(!e)return null;const n=e[1];return V0.test(n)?null:{base:n,version:Number.parseInt(e[2],10)}}function jd(t){return Ch(t)!==null}function dk(t){const e=Ch(t);return e?e.base:t}function Ay(t){const e=Ch(t);return e?e.version:null}const X0="ref:";function uc(t){return t.startsWith(X0)?t.slice(X0.length):void 0}function Q0(t){const e=new Set,n=r=>{for(const s of r)if(Xn(s)){for(const a of s.attrs){const i=uc(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(Wi(t)),[...e].sort()}function $d(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,o=new Set,l=new Map,d=new Set,f=g=>{for(const h of g){if(!Xn(h))continue;const p=yy(h);p!==void 0&&o.add(p);const v=xt(h,"data-each-in");if(v!==void 0){r.push(v);continue}const _=xt(h,"data-each");if(_!==void 0&&s.push(_),Zs(h,"data-required")){const O=Z0(h);O!==void 0&&n.add(O)}const E=Fg(h);if(E.minLength!==void 0||E.maxLength!==void 0){const O=Z0(h);O!==void 0&&l.set(O,E)}const b=xt(h,"data-type"),x=e.has(h.tagName)?Ug(h.tagName,e,new Set):void 0;for(const O of h.attrs){const M=uc(O.value);M!==void 0&&d.add(M);const B=Ba(O.value);if(B===null||B.dotted)continue;const J=(x==null?void 0:x.get(O.name))??Ma({tag:h.tagName,attribute:O.name,wholeValue:!0,valuePrefix:Ih(O.value),download:Zs(h,"download"),...b!==void 0&&{annotation:b}});J==="image"?a.add(B.name):J==="file"?i.add(B.name):J==="richtext"&&o.add(B.name)}f(h.childNodes)}};return f(Wi(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...o],constraints:l,references:[...d].sort()}}function yy(t){const e=t.childNodes.filter(i=>!(ss(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!ss(n))return;const r=Ba(n.value);if(r===null||r.dotted)return;const s=xt(t,"data-type"),a=Ma({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return za(a)==="html"?r.name:void 0}function Z0(t){const e=xt(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=Ts(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(ss(n)){const r=Ts(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function Ny(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function wy(t){return JSON.stringify(t).slice(1,-1)}function Rl(t){let e="";for(const r of t){const s=r.codePointAt(0);s!==void 0&&s>32&&(e+=r)}const n=e.toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")?"#":t}function Sy(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(n===null||typeof n!="object")continue;const r=n,s=typeof r.name=="string"?r.name:"";s.trim()!==""&&e.push({name:s,...typeof r.user=="string"&&r.user!==""&&{user:r.user},...typeof r.href=="string"&&r.href!==""&&{href:r.href}})}return e}function Iy(t){if(t.length===0)return"";if(t.length===1)return t[0]??"";const e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`}function Cy(t,e){const n=Sy(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return Ny((s==null?void 0:s.displayName)??r.name)});return Iy(n)}const J0="public, max-age=31536000, immutable",Ly=[1600],Oy={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function xy(t){return t==="jpeg"?"jpg":t}function Ry(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function qg(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t[n]??0,e=Math.imul(e,16777619);return(e>>>0).toString(36)}function jg(t,e,n,r,s){var E;const a=Ry(t),i=t.slice(0,t.lastIndexOf(".")>=0?t.lastIndexOf("."):t.length),o=[],l=new Map;for(const b of[...r].sort((x,O)=>x.width-O.width)){const x=`${i}.${e}-${b.width}.${xy(b.format)}`,O=s(b);o.push(O===void 0?{path:x,contents:Dy,cacheControl:J0,present:!0}:{path:x,contents:O,cacheControl:J0});const M=l.get(b.format)??[];M.push({url:`/${x}`,width:b.width}),l.set(b.format,M)}const d=b=>(l.get(b)??[]).map(x=>`${x.url} ${x.width}w`).join(", "),f=[...l.keys()],g=l.has(a)?a:f[0],h=["avif","webp"].filter(b=>b!==g&&l.has(b)).map(b=>({format:b,mime:Oy[b],srcset:d(b)})),p=g===void 0?[]:l.get(g)??[],v=((E=p[p.length-1])==null?void 0:E.url)??`/${t}`,_={width:n.width,height:n.height,sources:h,fallbackSrc:v,...n.blurDataUri!==void 0&&{blurDataUri:n.blurDataUri}};return{artifacts:o,info:_}}const Dy=new Uint8Array(0);async function ky(t,e,n){const r=await n.encode(t,{widths:Ly,formats:["webp"]}),s=qg(t),a=new Map,i=[];for(const f of r.variants)a.set(ep(f),f.bytes),i.push({format:f.format,width:f.width});const{artifacts:o,info:l}=jg(e,s,{width:r.sourceWidth,height:r.sourceHeight,...Yd(r.blurDataUri)},i,f=>a.get(ep(f))),d={sourceWidth:r.sourceWidth,sourceHeight:r.sourceHeight,variants:[...i].sort((f,g)=>f.width-g.width),...Yd(r.blurDataUri)};return{artifacts:o,info:l,cached:d}}function Py(t,e,n){return jg(t,e,{width:n.sourceWidth,height:n.sourceHeight,...Yd(n.blurDataUri)},n.variants,()=>{})}function ep(t){return`${t.format}-${t.width}`}function Yd(t){return t!==void 0?{blurDataUri:t}:{}}function $g(t,e){const n=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Wc(i)}"`).join(""),r=`<img src="${Wc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${n}>`;return t.sources.length===0?r:`<picture>${t.sources.map(a=>`<source type="${a.mime}" srcset="${Wc(a.srcset)}">`).join("")}${r}</picture>`}const My=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],By=["data-type","data-field","data-required","data-help","data-label"];function zd(t){const e={components:t.components,usedComponents:new Set,...t.context!==void 0&&{context:t.context},...t.media!==void 0&&{media:t.media},...t.authorDirectory!==void 0&&{authorDirectory:t.authorDirectory},...t.componentStyles!==void 0&&{componentStyles:t.componentStyles}},n=Go(Wi(t.template),t.scope,e),r=t.document===void 0?n:Gg(Go(Wi(t.document),t.scope,e),n);return Fy(r,t,e),fy(r)}function Fy(t,e,n){var i,o,l,d;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const f=Js(`<style>
4
4
  ${r}
5
- </style>`),g=Wd(t,"head");g?g.childNodes.push(...h):t.unshift(...h)}const s=[],a=(o=e.templateScript)==null?void 0:o.trim();a&&s.push(a);for(const h of[...n.usedComponents].sort()){const g=(d=(l=e.componentScripts)==null?void 0:l.get(h))==null?void 0:d.trim();g&&s.push(g)}if(s.length>0){const h=s.flatMap(f=>Js(`<script>
6
- ${f}
7
- <\/script>`)),g=Wd(t,"body");g?g.childNodes.push(...h):t.push(...h)}}function Wd(t,e){for(const n of t){if(!Xn(n))continue;if(n.tagName===e)return n;const r=Wd(n.childNodes,e);if(r!==void 0)return r}}function tp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function Gd(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function lc(t){return e=>{const n=t[e.name];if(tp(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return tp(r)?r.url:Gd(r)}return e.dotted?"":Gd(n)}}function Go(t,e,n){const r=[];for(const s of t)Xn(s)?r.push(...zg(s,e,n)):(ss(s)&&(s.value=oc(s.value,lc(e))),r.push(s));return r}function zg(t,e,n){if(Zs(t,"data-each-in")||Zs(t,"data-each"))return Uy(t,e,n);if(n.components.has(t.tagName))return $y(t,e,n);Hy(t,e,n);const r=xt(t,"data-type");for(const a of By)wh(t,a);if(t.tagName==="img"&&n.media!==void 0){const a=n.media.image(xt(t,"src")??"");if(a!==void 0){const i=t.attrs.map(o=>[o.name,o.value]);return Js(Yg(a,i))}}if(jy(t))return rp(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return rp(t,e,"raw"),[t];const s=qy(t,r);if((s==null?void 0:s.kind)==="html"){const a=Js(Gd(e[s.token.name]));return t.childNodes=Wg(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=Js(Ly(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=Go(t.childNodes,e,n),[t])}function Wg(t,e){var r;const n=[];for(const s of t){if(!Xn(s)){n.push(s);continue}if(s.childNodes=Wg(s.childNodes,e),s.tagName==="img"){const i=xt(s,"src"),o=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(o!==void 0){const l=s.attrs.map(d=>[d.name,d.value]);n.push(...Js(Yg(o,l)));continue}i!==void 0&&G0(s,"src",np(i,e))}const a=xt(s,"href");a!==void 0&&G0(s,"href",np(a,e)),n.push(s)}return n}function np(t,e){var r;const n=Kd(t,e);return Rl(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Kd(t,e){var r,s;const n=uc(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function Uy(t,e,n){if(n.context===void 0)return[];const r=xt(t,"data-each-in");let s;if(r!==void 0){const i=xt(t,"data-limit"),o=i!==void 0?Number.parseInt(i,10):void 0,l=xt(t,"data-sort");s=n.context.collection(r,{...l!==void 0&&{sort:l},...o!==void 0&&!Number.isNaN(o)&&{limit:o}})}else{const i=xt(t,"data-each")??"",o=e[i];s=(Array.isArray(o)?o.filter(d=>typeof d=="string"):typeof o=="string"?[o]:[]).map(d=>{var h;return(h=n.context)==null?void 0:h.reference(d)}).filter(d=>d!==void 0)}const a=[];for(const i of s){const o=Gg(t);for(const l of My)wh(o,l);a.push(...zg(o,{...e,item:i},n))}return a}function Gg(t){if(Xn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(Gg),e}return{...t}}function Hy(t,e,n){var r;for(const s of t.attrs){if(Ts(s.value).length===0){const g=Kd(s.value,n);g!==void 0&&(s.value=Rl(g));continue}const a=xt(t,"data-type"),i=Ba(s.value)!==null,o=Ma({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:Ih(s.value),download:Zs(t,"download"),...a!==void 0&&{annotation:a}});let l=oc(s.value,lc(e));const d=Kd(l,n);d!==void 0&&(l=d);const h=(r=n.media)==null?void 0:r.file(l);h!==void 0&&(l=h),i&&za(o)==="url"&&(l=Rl(l)),s.value=l}}function rp(t,e,n){const r=lc(e);for(const s of t.childNodes)ss(s)&&(s.value=oc(s.value,a=>{const i=r(a);return n==="json"?Sy(i):i}))}function qy(t,e){const n=t.childNodes.filter(i=>!(ss(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!ss(r))return null;const s=Ba(r.value);if(s===null||s.dotted)return null;const a=Ma({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:za(a)}}function jy(t){var e;return t.tagName==="script"&&((e=xt(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function $y(t,e,n){var h,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=lc(e),a={};for(const f of t.attrs)a[f.name]=oc(f.value,s);const i=Go(t.childNodes,e,n),o=Go(Wi(r),a,n),l=Kg(o,i);n.usedComponents.add(t.tagName);const d=(g=(h=n.componentStyles)==null?void 0:h.get(t.tagName))==null?void 0:g.trim();if(d){const f=l.find(Xn);if(f!==void 0){const p=Js(`<style>@scope {
5
+ </style>`),g=Wd(t,"head");g?g.childNodes.push(...f):t.unshift(...f)}const s=[],a=(o=e.templateScript)==null?void 0:o.trim();a&&s.push(a);for(const f of[...n.usedComponents].sort()){const g=(d=(l=e.componentScripts)==null?void 0:l.get(f))==null?void 0:d.trim();g&&s.push(g)}if(s.length>0){const f=s.flatMap(h=>Js(`<script>
6
+ ${h}
7
+ <\/script>`)),g=Wd(t,"body");g?g.childNodes.push(...f):t.push(...f)}}function Wd(t,e){for(const n of t){if(!Xn(n))continue;if(n.tagName===e)return n;const r=Wd(n.childNodes,e);if(r!==void 0)return r}}function tp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function Gd(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function lc(t){return e=>{const n=t[e.name];if(tp(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return tp(r)?r.url:Gd(r)}return e.dotted?"":Gd(n)}}function Go(t,e,n){const r=[];for(const s of t)Xn(s)?r.push(...Yg(s,e,n)):(ss(s)&&(s.value=oc(s.value,lc(e))),r.push(s));return r}function Yg(t,e,n){if(Zs(t,"data-each-in")||Zs(t,"data-each"))return Uy(t,e,n);if(n.components.has(t.tagName))return $y(t,e,n);Hy(t,e,n);const r=xt(t,"data-type");for(const a of By)wh(t,a);if(t.tagName==="img"&&n.media!==void 0){const a=n.media.image(xt(t,"src")??"");if(a!==void 0){const i=t.attrs.map(o=>[o.name,o.value]);return Js($g(a,i))}}if(jy(t))return rp(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return rp(t,e,"raw"),[t];const s=qy(t,r);if((s==null?void 0:s.kind)==="html"){const a=Js(Gd(e[s.token.name]));return t.childNodes=zg(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=Js(Cy(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=Go(t.childNodes,e,n),[t])}function zg(t,e){var r;const n=[];for(const s of t){if(!Xn(s)){n.push(s);continue}if(s.childNodes=zg(s.childNodes,e),s.tagName==="img"){const i=xt(s,"src"),o=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(o!==void 0){const l=s.attrs.map(d=>[d.name,d.value]);n.push(...Js($g(o,l)));continue}i!==void 0&&G0(s,"src",np(i,e))}const a=xt(s,"href");a!==void 0&&G0(s,"href",np(a,e)),n.push(s)}return n}function np(t,e){var r;const n=Kd(t,e);return Rl(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Kd(t,e){var r,s;const n=uc(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function Uy(t,e,n){if(n.context===void 0)return[];const r=xt(t,"data-each-in");let s;if(r!==void 0){const i=xt(t,"data-limit"),o=i!==void 0?Number.parseInt(i,10):void 0,l=xt(t,"data-sort");s=n.context.collection(r,{...l!==void 0&&{sort:l},...o!==void 0&&!Number.isNaN(o)&&{limit:o}})}else{const i=xt(t,"data-each")??"",o=e[i];s=(Array.isArray(o)?o.filter(d=>typeof d=="string"):typeof o=="string"?[o]:[]).map(d=>{var f;return(f=n.context)==null?void 0:f.reference(d)}).filter(d=>d!==void 0)}const a=[];for(const i of s){const o=Wg(t);for(const l of My)wh(o,l);a.push(...Yg(o,{...e,item:i},n))}return a}function Wg(t){if(Xn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(Wg),e}return{...t}}function Hy(t,e,n){var r;for(const s of t.attrs){if(Ts(s.value).length===0){const g=Kd(s.value,n);g!==void 0&&(s.value=Rl(g));continue}const a=xt(t,"data-type"),i=Ba(s.value)!==null,o=Ma({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:Ih(s.value),download:Zs(t,"download"),...a!==void 0&&{annotation:a}});let l=oc(s.value,lc(e));const d=Kd(l,n);d!==void 0&&(l=d);const f=(r=n.media)==null?void 0:r.file(l);f!==void 0&&(l=f),i&&za(o)==="url"&&(l=Rl(l)),s.value=l}}function rp(t,e,n){const r=lc(e);for(const s of t.childNodes)ss(s)&&(s.value=oc(s.value,a=>{const i=r(a);return n==="json"?wy(i):i}))}function qy(t,e){const n=t.childNodes.filter(i=>!(ss(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!ss(r))return null;const s=Ba(r.value);if(s===null||s.dotted)return null;const a=Ma({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:za(a)}}function jy(t){var e;return t.tagName==="script"&&((e=xt(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function $y(t,e,n){var f,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=lc(e),a={};for(const h of t.attrs)a[h.name]=oc(h.value,s);const i=Go(t.childNodes,e,n),o=Go(Wi(r),a,n),l=Gg(o,i);n.usedComponents.add(t.tagName);const d=(g=(f=n.componentStyles)==null?void 0:f.get(t.tagName))==null?void 0:g.trim();if(d){const h=l.find(Xn);if(h!==void 0){const p=Js(`<style>@scope {
8
8
  ${d}
9
- }</style>`);f.childNodes=[...p,...f.childNodes]}}return l}function Kg(t,e){const n=new Map,r=[];for(const s of e){const a=Xn(s)?xt(s,"slot"):void 0;if(a!==void 0){Xn(s)&&wh(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return Vd(t,n,r)}function Vd(t,e,n){const r=[];for(const s of t)if(Xn(s)&&s.tagName==="slot"){const a=xt(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...Vd(s.childNodes,e,n))}else Xn(s)&&(s.childNodes=Vd(s.childNodes,e,n)),r.push(s);return r}async function sp(t,e,n){const r=new Array(t.length),s=Math.max(1,Math.min(Math.floor(e),t.length));let a=0;const i=async()=>{for(;a<t.length;){const o=a++;r[o]=await n(t[o],o)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Yy(t){return t.split("/").filter(e=>e!=="")}function cr(t){const e=Yy(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}function zy(t){return t===void 0?"":t.replace(/\/+$/,"")}const Wy=4;async function Gy(t,e,n={}){const[r,s,a,i]=await Promise.all([mh(t),gh(t),ag(t),ig(t)]),o=Vg(r,e,void 0);if(o===void 0)return;const l=n.draft??o.node.item,d=l.template??o.dirTemplate;if(d===void 0)return;const[h,g,f,p]=await Promise.all([Cl(t,d),AT(t,d),yT(t,d),bh(t)]),v=$d(h,s),b={...o.node,item:l};let E,_=[];if(n.media!==void 0)E=n.media;else{const O=Ky(b,v),B=await Vy(t,[O],n.imageEncoder,Wy);E=Xy(O,B.imageInfoByPublished,B.fileUrlByPublished),_=B.mediaArtifacts}return{html:zd({template:h,scope:Lh(l,{path:b.path,baseUrl:void 0}),components:s,context:Xg(r),media:E,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...p!==void 0&&{document:p},...g!==void 0&&{templateStyle:g},...f!==void 0&&{templateScript:f}}),mediaArtifacts:_}}function Vg(t,e,n){const r=t.defaultTemplate??n;for(const s of t.children)if(s.kind==="item"){if(s.path===e)return{node:s,dirTemplate:r}}else{const a=Vg(s,e,r);if(a!==void 0)return a}}function Ky(t,e){const n=Qy(t.path),r=t.item.fields,s=[];for(const l of e.fileFields)for(const d of op(r[l]))s.push({ref:d,published:ip(n,d)});const a=[],i=new Set,o=l=>{i.has(l)||(i.add(l),a.push({ref:l,published:ip(n,l)}))};for(const l of e.imageFields)for(const d of op(r[l]))o(d);for(const l of e.richTextFields){const d=r[l];if(typeof d=="string")for(const h of Zy(d))o(h)}return{images:a,files:s}}async function Vy(t,e,n,r,s,a,i){const o=p=>{const v=new Set,b=[];for(const E of e)for(const{published:_}of p(E))v.has(_)||(v.add(_),b.push(_));return b},l=[],d=o(p=>p.files),h=await sp(d,r,async p=>await ap(t,`content/${p}`)),g=new Map;d.forEach((p,v)=>{const b=h[v];b!==void 0&&(l.push({path:p,contents:b}),g.set(p,`/${p}`))});const f=new Map;if(n!==void 0){const p=o(b=>b.images),v=await sp(p,r,async b=>{const E=await ap(t,`content/${b}`);if(E===void 0)return;const _=jg(E),R=a==null?void 0:a.get(_);return R!==void 0?{...Py(b,_,R),cached:R}:await ky(E,b,n)});p.forEach((b,E)=>{const _=v[E];_!==void 0&&(l.push(..._.artifacts),f.set(b,_.info))})}return{mediaArtifacts:l,imageInfoByPublished:f,fileUrlByPublished:g}}function Xy(t,e,n){const r=new Map;for(const{ref:a,published:i}of t.images){const o=e.get(i);o!==void 0&&r.set(a,o)}const s=new Map;for(const{ref:a,published:i}of t.files){const o=n.get(i);o!==void 0&&s.set(a,o)}return{image:a=>r.get(a),file:a=>s.get(a)}}async function ap(t,e){try{return await t.readBytes(e)}catch{return}}function Qy(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function ip(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function Zy(t){const e=[],n=r=>{for(const s of r)if(Xn(s)){if(s.tagName==="img"){const a=xt(s,"src");a!==void 0&&Jy(a)&&e.push(a)}n(s.childNodes)}};return n(Js(t)),e}function Jy(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function op(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Lh(t,e){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated},...e!==void 0&&{url:cr(e.path),site_url:zy(e.baseUrl)}}}function e3(t){const e=new Map,n=new Map,r=s=>{n.set(s.path,s);for(const a of s.children)a.kind==="item"?e.set(a.path,a):r(a)};return r(t),{items:e,dirs:n}}function up(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function Xg(t){const{items:e,dirs:n}=e3(t),r=s=>({url:cr(s.path),fields:Lh(s.item)});return{collection(s,a){var f;const i=n.get(up(s));if(i===void 0)return[];const o=((f=i.collection)==null?void 0:f.recursive)??!1,l=[],d=p=>{for(const v of p.children)v.kind==="item"?v.slug!=="index"&&v.item.isPublished&&l.push(v):o&&d(v)};d(i);const h=t3(l,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(up(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function t3(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const o=Lh(i.item)[n];return o==null?"":String(o)},a=[...t].sort((i,o)=>s(i).localeCompare(s(o)));return r==="desc"?a.reverse():a}async function n3(t){var w;const[e,n,r]=await Promise.all([mh(t),gh(t),bh(t)]),{items:s,dirs:a,published:i}=r3(e);let o=null;if(r!==void 0)try{o=$d(r,n)}catch{o=null}const l=(o==null?void 0:o.requiredFields)??[],d=(o==null?void 0:o.constraints)??new Map,h=new Set(r!==void 0?Xr(r,n).map(S=>S.name):[]),g=[],f=(S,x,k,W)=>{g.push({severity:S,code:x,message:k,...W!==void 0&&{path:W}})},p=(S,x,k)=>{const W=s.get(cp(S));W===void 0?f("error","reference-missing",`"${x}" references "${S}" (${k}), which does not exist.`,x):W.item.isPublished||f("error","reference-unpublished",`"${x}" references "${S}" (${k}), which is not published.`,x)},v=(S,x,k)=>{for(const[W,{minLength:$,maxLength:Y}]of S){const U=x[W];if(typeof U!="string"||U==="")continue;const{length:K}=U;$!==void 0&&K<$&&f("warning","value-too-short",`"${k}" field "${W}" is ${K} characters; the minimum is ${$}.`,k),Y!==void 0&&K>Y&&f("warning","value-too-long",`"${k}" field "${W}" is ${K} characters; the maximum is ${Y}.`,k)}},b=new Map,E=new Map,_=async S=>{const x=b.get(S);if(x!==void 0||b.has(S))return x??null;let k;try{const W=await Cl(t,S);E.set(S,W),k=$d(W,n)}catch{k=null}return b.set(S,k),k},R=new Map,O=S=>{const x=R.get(S);if(x!==void 0)return x;const k=E.get(S),W=new Set(k!==void 0?Xr(k,n).map($=>$.name):[]);return R.set(S,W),W},B=new Map,M=async S=>{if(B.has(S))return B.get(S)??null;const x=await H(S);if(x===null)return B.set(S,null),null;let k;try{k=await Cl(t,x)}catch{return B.set(S,null),null}const W=E.get(S);if(W===void 0)return B.set(S,null),null;const $=Ay(Xr(k,n),Xr(W,n)),Y=new Set($.typeChanged.filter(U=>U.destructive&&za(U.from)!==za(U.to)).map(U=>U.name));return B.set(S,Y),Y},J=new Map,H=async S=>{if(J.has(S))return J.get(S)??null;const x=S.lastIndexOf("/"),k=x===-1?"templates":`templates/${S.slice(0,x)}`,W=x===-1?S:S.slice(x+1);let $;try{$=await t.list(k)}catch{return J.set(S,null),null}let Y=0,U=null;const K=`${W}@v`;for(const te of $){if(te.kind!=="file"||!te.name.endsWith(".html"))continue;const fe=te.name.slice(0,-5);if(!fe.startsWith(K))continue;const me=yy(fe);me!==null&&me>Y&&(Y=me,U=x===-1?fe:`${S.slice(0,x)}/${fe}`)}return J.set(S,U),U},G=new Map;for(const{node:S,templateName:x}of i){const k=G.get(cr(S.path))??[];k.push(S.path),G.set(cr(S.path),k);const W=((w=S.parseDiagnostics)==null?void 0:w.unknownTopLevelKeys)??[];if(W.length>0&&f("warning","content.unknown-top-level-key",`"${S.path}" has top-level key${W.length===1?"":"s"} the parser does not recognise: ${W.map(U=>`"${U}"`).join(", ")}. They were dropped — content values belong under "fields" (and system keys are case-sensitive: "isPublished", not "IsPublished").`,S.path),x===void 0){f("error","no-template",`"${S.path}" has no template (no per-item or folder default).`,S.path);continue}const $=await _(x);if($===null){const U=jd(x)?" (the snapshot may have been deleted while this item still pins to it — restore it, rebind the item to current via the Migrations workspace, or delete this item).":"";f("error","template-missing",`"${S.path}" uses template "${x}", which does not exist.${U}`,S.path);continue}if(!jd(x)){const U=O(x),K=Object.keys(S.item.fields),te=K.filter(me=>!U.has(me)&&!h.has(me));te.length>0&&f("warning","content.schema-drift",`"${S.path}" has field${te.length===1?"":"s"} not rendered by template "${x}": ${te.map(me=>`"${me}"`).join(", ")}. Open the Migrations workspace to drop, rename, or keep them.`,S.path);const fe=await M(x);if(fe!==null&&fe.size>0){const me=K.filter(ge=>fe.has(ge));me.length>0&&f("warning","content.type-drift",`"${S.path}" has field${me.length===1?"":"s"} whose stored value now renders under a different kind in template "${x}": ${me.map(ge=>`"${ge}"`).join(", ")}. The value carries over but may look different (e.g. rich text shown as escaped text). Re-edit the field, or revert the template's type change if it wasn't intended.`,S.path)}}const Y=s3(S.item);for(const U of $.requiredFields)lp(Y[U])&&f("error","required-empty",`"${S.path}" is missing required field "${U}".`,S.path);for(const U of l)lp(Y[U])&&f("error","required-empty",`"${S.path}" is missing required meta field "${U}" (document shell).`,S.path);v($.constraints,Y,S.path),v(d,Y,S.path);for(const U of $.queryLoopPaths)a.has(cp(U))||f("error","loop-target-missing",`"${S.path}" loops over "${U}", which is not a directory.`,S.path);for(const U of $.curatedLoopFields)for(const K of a3(S.item.fields[U]))p(K,S.path,`field "${U}"`);for(const[U,K]of Object.entries(Y)){if(typeof K!="string")continue;const te=uc(K);if(te!==void 0&&p(te,S.path,`field "${U}"`),$.richTextFields.includes(U))for(const fe of Q0(K))p(fe,S.path,`field "${U}"`)}}const X=st.templates;if(o!==null)for(const S of o.references)p(S,`${X}/${bu}.html`,"link");for(const[S,x]of b)if(x!==null)for(const k of x.references)p(k,`${X}/${S}.html`,"link");for(const[S,x]of n)for(const k of Q0(x))p(k,`${st.components}/${S}.html`,"link");for(const[S,x]of G)x.length>1&&f("error","url-collision",`URL ${S} is produced by multiple items: ${x.join(", ")}.`);const ee=new Map;for(const S of await i3(t)){const k=S.slice(S.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),W=ee.get(k)??[];W.push(`${st.components}/${S}`),ee.set(k,W)}for(const[S,x]of[...ee].sort(([k],[W])=>k.localeCompare(W)))x.length>1&&f("error","component-tag-collision",`Multiple components resolve to <${S}>: ${x.join(", ")}.`);const A=g.filter(S=>S.severity==="error"),j=g.filter(S=>S.severity==="warning");return{diagnostics:g,errors:A,warnings:j,ok:A.length===0}}function r3(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const o=a.defaultTemplate??i;for(const l of a.children){if(l.kind==="dir"){s(l,o);continue}e.set(l.path,l),l.item.isPublished&&r.push({node:l,templateName:l.item.template??o})}};return s(t,void 0),{items:e,dirs:n,published:r}}function s3(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function lp(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function a3(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function cp(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function i3(t){const e=st.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const o=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,o):i.name.endsWith(".html")&&n.push(o)}};return await r(e,""),n.sort()}function Gc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let Qg="";function Fa(t){return`${Qg}${t}`}function o3(t){Qg=t.replace(/\/+$/,"")}async function u3(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&o3(e.apiUrl)}catch{}}async function Ge(t,e={}){const n=typeof t=="string"?Fa(t):t,r=await dp(n,e,pt.token);if(r.status!==401||pt.token===null)return r;const s=await pt.refresh();return s===null?r:dp(n,e,s)}async function dp(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function ei(t,e){const n=await Ge(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const Hu="nanoesis.jwt",l3=540*1e3;function c3(){let t=Q("loading"),e=Q(null),n=Q(null),r=Q(!1),s=null;function a(_,R){T(e,_,!0),T(n,R,!0),T(t,"authenticated"),localStorage.setItem(Hu,_),o()}function i(){T(e,null),T(n,null),T(t,"unauthenticated"),localStorage.removeItem(Hu),l()}function o(){l(),s=setInterval(()=>{d()},l3)}function l(){s!==null&&(clearInterval(s),s=null)}async function d(){if(u(e)===null)return null;const _=u(e),R=await fetch(Fa("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${_}`}});if(!R.ok)return i(),null;const O=await R.json().catch(()=>({}));return!O.ok||O.token===void 0||O.principal===void 0?(i(),null):(a(O.token,O.principal),O.token)}async function h(){T(t,"loading");let _;try{_=await fetch(Fa("/api/auth/state"))}catch{T(t,"no-auth");return}if(_.status===404){T(t,"no-auth");return}if(!_.ok){T(t,"unauthenticated");return}const R=await _.json();T(r,R.firstRun,!0);const O=localStorage.getItem(Hu);O!==null&&O!==""&&(T(e,O,!0),await d()!==null)||T(t,"unauthenticated")}async function g(_,R){const O=await fetch(Fa("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:_,password:R})}),B=await O.json().catch(()=>({}));return!O.ok||!B.ok||B.token===void 0||B.principal===void 0?{ok:!1,error:B.error??`HTTP ${O.status}`}:(T(r,!1),a(B.token,B.principal),{ok:!0})}async function f(){if(u(e)!==null)try{await Ge("/api/logout",{method:"POST"})}catch{}i()}async function p(_,R){const O=await Ge("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:_,newPassword:R})}),B=await O.json().catch(()=>({}));return!O.ok||!B.ok||B.token===void 0?{ok:!1,error:B.error??`HTTP ${O.status}`}:(T(e,B.token,!0),localStorage.setItem(Hu,B.token),{ok:!0})}async function v(){const _=await Ge("/api/me/token",{method:"POST"}),R=await _.json().catch(()=>({}));return!_.ok||R.ok!==!0||R.token===void 0?{ok:!1,error:R.error??`HTTP ${_.status}`}:{ok:!0,token:R.token,...R.expiresAt!==void 0&&{expiresAt:R.expiresAt}}}async function b(){const _=await Ge("/api/me/token",{method:"DELETE"});return _.ok?{ok:!0}:{ok:!1,error:(await _.json().catch(()=>({}))).error??`HTTP ${_.status}`}}function E(){return u(t)==="no-auth"}return{get status(){return u(t)},get token(){return u(e)},get principal(){return u(n)},get firstRun(){return u(r)},get canAuthor(){return E()||Gc(u(n),"author")},get canDevelop(){return E()||Gc(u(n),"developer")},get isAdmin(){return E()||Gc(u(n),"admin")},init:h,login:g,logout:f,refresh:d,changePassword:p,createMcpToken:v,revokeMcpTokens:b}}const pt=c3(),fp={name:null,logoUrl:null};async function d3(){try{const t=await fetch(Fa("/api/branding"));if(!t.ok)return fp;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:Fa(e.logoUrl)}}catch{return fp}}function f3(t){return ei("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function h3(t){return ei("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function p3(){return ei("/api/branding/logo",{method:"DELETE"})}function m3(){let t=Q(null),e=Q(null);async function n(){const r=await d3();T(t,r.name,!0),T(e,r.logoUrl,!0)}return{get name(){return u(t)},get logoUrl(){return u(e)},load:n}}const Dn=m3();let Mo=Q(null);const g3={get pending(){return u(Mo)}};function hp(t=""){return new Promise(e=>{T(Mo,{current:t,resolve:e},!0)})}function qu(t){u(Mo)!==null&&(u(Mo).resolve(t),T(Mo,null))}var v3=z(`<h2 class="svelte-trwq3g">Image description</h2> <p class="hint svelte-trwq3g">Describe the image for readers using a screen reader and for when it fails to load.
10
- Leave it empty if the image is purely decorative.</p> <label class="field svelte-trwq3g"><span class="svelte-trwq3g">Alt text</span> <textarea rows="3" placeholder="e.g. Two people texting, frowning at their phones" class="svelte-trwq3g"></textarea></label> <div class="actions svelte-trwq3g"><button type="button" class="ghost svelte-trwq3g">Cancel</button> <button type="button" class="primary svelte-trwq3g">Save</button></div>`,1),b3=z('<dialog aria-label="Image description" class="svelte-trwq3g"><!></dialog>');function E3(t,e){at(e,!0);let n=Q(void 0),r=Q("");const s=_e(()=>g3.pending);Rt(()=>{var d,h;if(u(s)===null){(d=u(n))==null||d.close();return}T(r,u(s).current,!0),(h=u(n))==null||h.showModal()});function a(){qu(u(r).trim())}var i=b3(),o=y(i);{var l=d=>{var h=v3(),g=C(tt(h),4),f=C(y(g),2);$a(f,!0);var p=C(g,2),v=y(p),b=C(v,2);ie("keydown",f,E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),a())}),wt(f,()=>u(r),E=>T(r,E)),ie("click",v,()=>qu(null)),ie("click",b,a),F(d,h)};ce(o,d=>{u(s)!==null&&d(l)})}mn(i,d=>T(n,d),()=>u(n)),He("close",i,()=>qu(null)),He("cancel",i,()=>qu(null)),F(t,i),it()}Tt(["keydown","click"]);const _3="modulepreload",T3=function(t,e){return new URL(t,e).href},pp={},mp=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=i(n.map(h=>{if(h=T3(h,r),h in pp)return;pp[h]=!0;const g=h.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(!!r)for(let b=o.length-1;b>=0;b--){const E=o[b];if(E.href===h&&(!g||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":_3,g||(v.as="script"),v.crossOrigin="",v.href=h,d&&v.setAttribute("nonce",d),document.head.appendChild(v),g)return new Promise((b,E)=>{v.addEventListener("load",b),v.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function sa(t){return Array.isArray?Array.isArray(t):Jg(t)==="[object Array]"}function A3(t){if(typeof t=="string")return t;if(typeof t=="bigint")return t.toString();const e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Xd(t){return t==null?"":A3(t)}function kn(t){return typeof t=="string"}function pl(t){return typeof t=="number"}function y3(t){return t===!0||t===!1||N3(t)&&Jg(t)=="[object Boolean]"}function Zg(t){return typeof t=="object"}function N3(t){return Zg(t)&&t!==null}function jn(t){return t!=null}function ju(t){return!t.trim().length}function Jg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const w3="Incorrect 'index' type",S3=t=>`Invalid value for key ${t}`,I3=t=>`Pattern length exceeds max of ${t}.`,C3=t=>`Missing ${t} property in key`,L3=t=>`Property 'weight' in key '${t}' must be a positive integer`,gp=Object.prototype.hasOwnProperty;class O3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=ev(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ev(t){let e=null,n=null,r=null,s=1,a=null;if(kn(t)||sa(t))r=t,e=vp(t),n=Qd(t);else{if(!gp.call(t,"name"))throw new Error(C3("name"));const i=t.name;if(r=i,gp.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(L3(i));e=vp(i),n=Qd(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function vp(t){return sa(t)?t:t.split(".")}function Qd(t){return sa(t)?t.join("."):t}function x3(t,e){const n=[];let r=!1;const s=(a,i,o,l)=>{if(jn(a))if(!i[o])n.push(l!==void 0?{v:a,i:l}:a);else{const d=i[o],h=a[d];if(!jn(h))return;if(o===i.length-1&&(kn(h)||pl(h)||y3(h)||typeof h=="bigint"))n.push(l!==void 0?{v:Xd(h),i:l}:Xd(h));else if(sa(h)){r=!0;for(let g=0,f=h.length;g<f;g+=1)s(h[g],i,o+1,g)}else i.length&&s(h,i,o+1,l)}};return s(t,kn(e)?e.split("."):e,0),r?n:n[0]}const R3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},D3={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},k3={location:0,threshold:.6,distance:100},P3={useExtendedSearch:!1,useTokenSearch:!1,getFn:x3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},je=Object.freeze({...D3,...R3,...k3,...P3}),M3=/[^ ]+/g;function B3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(M3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),o=parseFloat(Math.round(i*r)/r);return n.set(a,o),o},clear(){n.clear()}}}class Oh{constructor({getFn:e=je.getFn,fieldNormWeight:n=je.fieldNormWeight}={}){this.norm=B3(n,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,kn(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();kn(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}removeAll(e){for(let n=e.length-1;n>=0;n-=1)this.records.splice(e[n],1);for(let n=0,r=this.records.length;n<r;n+=1)this.records[n].i=n}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!jn(e)||ju(e))return;const r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){const r={i:n,$:{}};this.keys.forEach((s,a)=>{const i=s.getFn?s.getFn(e):this.getFn(e,s.path);if(jn(i)){if(sa(i)){const o=[];for(let l=0,d=i.length;l<d;l+=1){const h=i[l];if(jn(h)){if(kn(h)){if(!ju(h)){const g={v:h,i:l,n:this.norm.get(h)};o.push(g)}}else if(jn(h.v)){const g=kn(h.v)?h.v:Xd(h.v);if(!ju(g)){const f={v:g,i:h.i,n:this.norm.get(g)};o.push(f)}}}}r.$[a]=o}else if(kn(i)&&!ju(i)){const o={v:i,n:this.norm.get(i)};r.$[a]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function tv(t,e,{getFn:n=je.getFn,fieldNormWeight:r=je.fieldNormWeight}={}){const s=new Oh({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(ev)),s.setSources(e),s.create(),s}function F3(t,{getFn:e=je.getFn,fieldNormWeight:n=je.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new Oh({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function U3(t=[],e=je.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const o=t[a];o&&r===-1?r=a:!o&&r!==-1&&(s=a-1,s-r+1>=e&&n.push([r,s]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const _a=32;function H3(t,e,n,{location:r=je.location,distance:s=je.distance,threshold:a=je.threshold,findAllMatches:i=je.findAllMatches,minMatchCharLength:o=je.minMatchCharLength,includeMatches:l=je.includeMatches,ignoreLocation:d=je.ignoreLocation}={}){if(e.length>_a)throw new Error(I3(_a));const h=e.length,g=t.length,f=Math.max(0,Math.min(r,g));let p=a,v=f;const b=(G,X)=>{const ee=G/h;if(d)return ee;const A=Math.abs(f-X);return s?ee+A/s:A?1:ee},E=o>1||l,_=E?Array(g):[];let R;for(;(R=t.indexOf(e,v))>-1;){const G=b(0,R);if(p=Math.min(G,p),v=R+h,E){let X=0;for(;X<h;)_[R+X]=1,X+=1}}v=-1;let O=[],B=1,M=h+g;const J=1<<h-1;for(let G=0;G<h;G+=1){let X=0,ee=M;for(;X<ee;)b(G,f+ee)<=p?X=ee:M=ee,ee=Math.floor((M-X)/2+X);M=ee;let A=Math.max(1,f-ee+1);const j=i?g:Math.min(f+ee,g)+h,w=Array(j+2);w[j+1]=(1<<G)-1;for(let x=j;x>=A;x-=1){const k=x-1,W=n[t[k]];if(E&&(_[k]=+!!W),w[x]=(w[x+1]<<1|1)&W,G&&(w[x]|=(O[x+1]|O[x])<<1|1|O[x+1]),w[x]&J&&(B=b(G,k),B<=p)){if(p=B,v=k,v<=f)break;A=Math.max(1,2*f-v)}}if(b(G+1,f)>p)break;O=w}const H={isMatch:v>=0,score:Math.max(.001,B)};if(E){const G=U3(_,o);G.length?l&&(H.indices=G):H.isMatch=!1}return H}function q3(t){const e={};for(let n=0,r=t.length;n<r;n+=1){const s=t.charAt(n);e[s]=(e[s]||0)|1<<r-n-1}return e}function xh(t){if(t.length<=1)return t;t.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const e=[t[0]];for(let n=1,r=t.length;n<r;n+=1){const s=e[e.length-1],a=t[n];a[0]<=s[1]+1?s[1]=Math.max(s[1],a[1]):e.push(a)}return e}const nv={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},j3=new RegExp("["+Object.keys(nv).join("")+"]","g"),Ko=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(j3,e=>nv[e]):t=>t;class Rh{constructor(e,{location:n=je.location,threshold:r=je.threshold,distance:s=je.distance,includeMatches:a=je.includeMatches,findAllMatches:i=je.findAllMatches,minMatchCharLength:o=je.minMatchCharLength,isCaseSensitive:l=je.isCaseSensitive,ignoreDiacritics:d=je.ignoreDiacritics,ignoreLocation:h=je.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h},e=l?e:e.toLowerCase(),e=d?Ko(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(p,v)=>{this.chunks.push({pattern:p,alphabet:q3(p),startIndex:v})},f=this.pattern.length;if(f>_a){let p=0;const v=f%_a,b=f-v;for(;p<b;)g(this.pattern.substr(p,_a),p),p+=_a;if(v){const E=f-_a;g(this.pattern.substr(E),E)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?Ko(e):e,this.pattern===e){const b={isMatch:!0,score:0};return s&&(b.indices=[[0,e.length-1]]),b}const{location:a,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,ignoreLocation:h}=this.options,g=[];let f=0,p=!1;this.chunks.forEach(({pattern:b,alphabet:E,startIndex:_})=>{const{isMatch:R,score:O,indices:B}=H3(e,b,E,{location:a+_,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,includeMatches:s,ignoreLocation:h});R&&(p=!0),f+=O,R&&B&&g.push(...B)});const v={isMatch:p,score:p?f/this.chunks.length:1};return p&&s&&(v.indices=xh(g)),v}}class aa{constructor(e){this.pattern=e}static isMultiMatch(e){return bp(e,this.multiRegex)}static isSingleMatch(e){return bp(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function bp(t,e){const n=t.match(e);return n?n[1]:null}class $3 extends aa{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Y3 extends aa{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class z3 extends aa{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class W3 extends aa{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class G3 extends aa{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class K3 extends aa{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class rv extends aa{constructor(e,{location:n=je.location,threshold:r=je.threshold,distance:s=je.distance,includeMatches:a=je.includeMatches,findAllMatches:i=je.findAllMatches,minMatchCharLength:o=je.minMatchCharLength,isCaseSensitive:l=je.isCaseSensitive,ignoreDiacritics:d=je.ignoreDiacritics,ignoreLocation:h=je.ignoreLocation}={}){super(e),this._bitapSearch=new Rh(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class sv extends aa{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const s=[],a=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+a,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?0:1,indices:s}}}const Zd=[$3,sv,z3,W3,K3,G3,Y3,rv],Ep=Zd.length,V3="\0",X3="|";function Q3(t){const e=[],n=t.length;let r=0;for(;r<n;){for(;r<n&&t[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&t[s]!==" "&&t[s]!=='"';)s++;if(s<n&&t[s]==='"'){for(s++;s<n;){if(t[s]==='"'){const a=s+1;if(a>=n||t[a]===" "){s++;break}if(t[a]==="$"&&(a+1>=n||t[a+1]===" ")){s+=2;break}}s++}e.push(t.substring(r,s)),r=s}else{for(;s<n&&t[s]!==" ";)s++;e.push(t.substring(r,s)),r=s}}return e}function Z3(t,e={}){return t.replace(/\\\|/g,V3).split(X3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=Q3(s.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,l=a.length;o<l;o+=1){const d=a[o];let h=!1,g=-1;for(;!h&&++g<Ep;){const f=Zd[g],p=f.isMultiMatch(d);p&&(i.push(new f(p,e)),h=!0)}if(!h)for(g=-1;++g<Ep;){const f=Zd[g],p=f.isSingleMatch(d);if(p){i.push(new f(p,e));break}}}return i})}const J3=new Set([rv.type,sv.type]);class eN{constructor(e,{isCaseSensitive:n=je.isCaseSensitive,ignoreDiacritics:r=je.ignoreDiacritics,includeMatches:s=je.includeMatches,minMatchCharLength:a=je.minMatchCharLength,ignoreLocation:i=je.ignoreLocation,findAllMatches:o=je.findAllMatches,location:l=je.location,threshold:d=je.threshold,distance:h=je.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:o,ignoreLocation:i,location:l,threshold:d,distance:h},e=n?e:e.toLowerCase(),e=r?Ko(e):e,this.pattern=e,this.query=Z3(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:s,ignoreDiacritics:a}=this.options;e=s?e:e.toLowerCase(),e=a?Ko(e):e;let i=0;const o=[];let l=0,d=!1;for(let h=0,g=n.length;h<g;h+=1){const f=n[h];o.length=0,i=0,d=!1;for(let p=0,v=f.length;p<v;p+=1){const b=f[p],{isMatch:E,indices:_,score:R}=b.search(e);if(E){i+=1,l+=R;const O=b.constructor.type;O.startsWith("inverse")&&(d=!0),r&&(J3.has(O)?o.push(..._):o.push(_))}else{l=0,i=0,o.length=0,d=!1;break}}if(i){const p={isMatch:!0,score:l/i};return d&&(p.hasInverse=!0),r&&(p.indices=xh(o)),p}}return{isMatch:!1,score:1}}}const Jd=[];function Dh(...t){Jd.push(...t)}function Dl(t,e){for(let n=0,r=Jd.length;n<r;n+=1){const s=Jd[n];if(s.condition(t,e))return new s(t,e)}return new Rh(t,e)}const kl={AND:"$and",OR:"$or"},ef={PATH:"$path",PATTERN:"$val"},tf=t=>!!(t[kl.AND]||t[kl.OR]),tN=t=>!!t[ef.PATH],nN=t=>!sa(t)&&Zg(t)&&!tf(t),_p=t=>({[kl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function av(t,e,{auto:n=!0}={}){const r=s=>{if(kn(s)){const l={keyId:null,pattern:s};return n&&(l.searcher=Dl(s,e)),l}const a=Object.keys(s),i=tN(s);if(!i&&a.length>1&&!tf(s))return r(_p(s));if(nN(s)){const l=i?s[ef.PATH]:a[0],d=i?s[ef.PATTERN]:s[l];if(!kn(d))throw new Error(S3(l));const h={keyId:Qd(l),pattern:d};return n&&(h.searcher=Dl(d,e)),h}const o={children:[],operator:a[0]};return a.forEach(l=>{const d=s[l];sa(d)&&d.forEach(h=>{o.children.push(r(h))})}),o};return tf(t)||(t=_p(t)),r(t)}function nf(t,{ignoreFieldNorm:e=je.ignoreFieldNorm}){let n=1;return t.forEach(({key:r,norm:s,score:a})=>{const i=r?r.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(e?1:s))}),n}function rN(t,{ignoreFieldNorm:e=je.ignoreFieldNorm}){t.forEach(n=>{n.score=nf(n.matches,{ignoreFieldNorm:e})})}class sN{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const n=this.heap;for(;e>0;){const r=e-1>>1;if(n[e].score<=n[r].score)break;const s=n[e];n[e]=n[r],n[r]=s,e=r}}_sinkDown(e){const n=this.heap,r=n.length;let s=e;do{e=s;const a=2*e+1,i=2*e+2;if(a<r&&n[a].score>n[s].score&&(s=a),i<r&&n[i].score>n[s].score&&(s=i),s!==e){const o=n[e];n[e]=n[s],n[s]=o}}while(s!==e)}}function aN(t,e){const n=t.matches;e.matches=[],jn(n)&&n.forEach(r=>{if(!jn(r.indices)||!r.indices.length)return;const{indices:s,value:a}=r,i={indices:s,value:a};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),e.matches.push(i)})}function iN(t,e){e.score=t.score}function oN(t,e,{includeMatches:n=je.includeMatches,includeScore:r=je.includeScore}={}){const s=[];return n&&s.push(aN),r&&s.push(iN),t.map(a=>{const{idx:i}=a,o={item:e[i],refIndex:i};return s.length&&s.forEach(l=>{l(a,o)}),o})}const uN=/\b\w+\b/g;function rf({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=Ko(n)),n.match(uN)||[]}}}function lN(t,e,n){const r=new Map,s=new Map;let a=0;function i(o,l,d,h){const g=n.tokenize(o);if(!g.length)return;a++;const f=new Map;for(const p of g)f.set(p,(f.get(p)||0)+1);for(const[p,v]of f){const b={docIdx:l,keyIdx:d,subIdx:h,tf:v};let E=r.get(p);E||(E=[],r.set(p,E)),E.push(b),s.set(p,(s.get(p)||0)+1)}}for(const o of t){const{i:l,v:d,$:h}=o;if(d!==void 0){i(d,l,-1,-1);continue}if(h)for(let g=0;g<e;g++){const f=h[g];if(f)if(Array.isArray(f))for(const p of f)i(p.v,l,g,p.i??-1);else i(f.v,l,g,-1)}}return{terms:r,fieldCount:a,df:s}}function cN(t,e,n,r){const{i:s,v:a,$:i}=e;function o(l,d,h){const g=r.tokenize(l);if(!g.length)return;t.fieldCount++;const f=new Map;for(const p of g)f.set(p,(f.get(p)||0)+1);for(const[p,v]of f){const b={docIdx:s,keyIdx:d,subIdx:h,tf:v};let E=t.terms.get(p);E||(E=[],t.terms.set(p,E)),E.push(b),t.df.set(p,(t.df.get(p)||0)+1)}}if(a!==void 0){o(a,-1,-1);return}if(i)for(let l=0;l<n;l++){const d=i[l];if(d)if(Array.isArray(d))for(const h of d)o(h.v,l,h.i??-1);else o(d.v,l,-1)}}function Tp(t,e){for(const[n,r]of t.terms){const s=r.filter(i=>i.docIdx!==e),a=r.length-s.length;a>0&&(t.fieldCount-=a,t.df.set(n,(t.df.get(n)||0)-a),s.length===0?(t.terms.delete(n),t.df.delete(n)):t.terms.set(n,s))}}class ia{constructor(e,n,r){this.options={...je,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new O3(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const n=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,r=Dl(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Oh))throw new Error(w3);if(this._myIndex=n||tv(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=rf({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=lN(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(jn(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const n=this._myIndex.records[this._myIndex.records.length-1],r=rf({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});cN(this._invertedIndex,n,this._myIndex.keys.length,r)}}remove(e=()=>!1){const n=[],r=[];for(let s=0,a=this._docs.length;s<a;s+=1)e(this._docs[s],s)&&(n.push(this._docs[s]),r.push(s));if(r.length){if(this._invertedIndex)for(const s of r)Tp(this._invertedIndex,s);for(let s=r.length-1;s>=0;s-=1)this._docs.splice(r[s],1);this._myIndex.removeAll(r)}return n}removeAt(e){this._invertedIndex&&Tp(this._invertedIndex,e);const n=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),n}getIndex(){return this._myIndex}search(e,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:i,sortFn:o,ignoreFieldNorm:l}=this.options;if(kn(e)&&!e.trim()){let g=this._docs.map((f,p)=>({item:f,refIndex:p}));return pl(r)&&r>-1&&(g=g.slice(0,r)),g}const d=pl(r)&&r>0&&kn(e);let h;if(d){const g=new sN(r);kn(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:l}),h=g.extractSorted(o)}else h=kn(e)?kn(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),rN(h,{ignoreFieldNorm:l}),i&&h.sort(o),pl(r)&&r>-1&&(h=h.slice(0,r));return oN(h,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{records:a}=this._myIndex,i=n?null:[];return a.forEach(({v:o,i:l,n:d})=>{if(!jn(o))return;const{isMatch:h,score:g,indices:f}=s.searchIn(o);if(h){const p={item:o,idx:l,matches:[{score:g,value:o,norm:d,indices:f}]};n?(p.score=nf(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):i.push(p)}}),i}_searchLogical(e){const n=av(e,this.options),r=(o,l,d)=>{if(!("children"in o)){const{keyId:p,searcher:v}=o;let b;return p===null?(b=[],this._myIndex.keys.forEach((E,_)=>{b.push(...this._findMatches({key:E,value:l[_],searcher:v}))})):b=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:v}),b&&b.length?[{idx:d,item:l,matches:b}]:[]}const{children:h,operator:g}=o,f=[];for(let p=0,v=h.length;p<v;p+=1){const b=h[p],E=r(b,l,d);if(E.length)f.push(...E);else if(g===kl.AND)return[]}return f},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:o,i:l})=>{if(jn(o)){const d=r(n,o,l);d.length&&(a.has(l)||(a.set(l,{idx:l,item:o,matches:[]}),i.push(a.get(l))),d.forEach(({matches:h})=>{a.get(l).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,o=n?null:[];return i.forEach(({$:l,i:d})=>{if(!jn(l))return;const h=[];let g=!1,f=!1;if(a.forEach((p,v)=>{const b=this._findMatches({key:p,value:l[v],searcher:s});b.length?(h.push(...b),b[0].hasInverse&&(f=!0)):g=!0}),!(f&&g)&&h.length){const p={idx:d,item:l,matches:h};n?(p.score=nf(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):o.push(p)}}),o}_findMatches({key:e,value:n,searcher:r}){if(!jn(n))return[];const s=[];if(sa(n))n.forEach(({v:a,i,n:o})=>{if(!jn(a))return;const{isMatch:l,score:d,indices:h,hasInverse:g}=r.searchIn(a);l&&s.push({score:d,key:e,value:a,idx:i,norm:o,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:o,score:l,indices:d,hasInverse:h}=r.searchIn(a);o&&s.push({score:l,key:e,value:a,norm:i,indices:d,hasInverse:h})}return s}}class dN{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=rf({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(e),s=n._invertedIndex,{df:a,fieldCount:i}=s;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new Rh(o,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const l=a.get(o)||0,d=Math.log(1+(i-l+.5)/(l+.5));this.idfWeights.push(d)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let l=0;l<this.termSearchers.length;l++){const d=this.termSearchers[l].searchIn(e),h=this.idfWeights[l];s+=h,d.isMatch&&(a++,r+=h*(1-d.score),d.indices&&n.push(...d.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(o.indices=xh(n)),o}}ia.version="7.3.0";ia.createIndex=tv;ia.parseIndex=F3;ia.config=je;ia.match=function(t,e,n){return Dl(t,{...je,...n}).searchIn(e)};ia.parseQuery=av;Dh(eN);Dh(dN);ia.use=function(...t){t.forEach(e=>Dh(e))};function fN(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=l=>{a.has(l.path)||(a.add(l.path),s.push(l))};for(const l of t)l.title.toLowerCase()===r&&i(l);for(const l of t)l.title.toLowerCase().startsWith(r)&&i(l);for(const l of t)l.title.toLowerCase().includes(r)&&i(l);const o=new ia(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const l of o.search(e))i(l.item);return s.slice(0,n)}const hN=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function iv(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function ov(...t){return t.filter(e=>e!=="").join("/")}function pN(t){return hN.has(iv(t))}function mN(t){return ov(st.content,t,"assets")}function Gi(t,e){return ov(st.content,t,e)}function cc(t,e){return uv(Gi(t,e))}function uv(t){return Fa(`/api/read?path=${encodeURIComponent(t)}`)}function lv(t){return`assets/${t}`}function cv(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=iv(t),s=_s(n)||"image";return r===""?s:`${s}.${r}`}function gN(t){return typeof t=="object"&&t!==null&&t.notFound===!0}var $s,Mi,fu,Bi;class vN{constructor(e){Ue(this,$s);Ue(this,Mi,new Map);Ue(this,fu,new Map);Ue(this,Bi,new Map);Ye(this,$s,e)}list(e){return Kc(V(this,fu),e,()=>V(this,$s).list(e))}readText(e){return Kc(V(this,Mi),e,()=>V(this,$s).readText(e),gN)}exists(e){return Kc(V(this,Bi),e,()=>V(this,$s).exists(e))}readBytes(e){return V(this,$s).readBytes(e)}invalidate(e){V(this,Mi).delete(e),V(this,Bi).delete(e)}clear(){V(this,Mi).clear(),V(this,fu).clear(),V(this,Bi).clear()}}$s=new WeakMap,Mi=new WeakMap,fu=new WeakMap,Bi=new WeakMap;function Kc(t,e,n,r=()=>!1){const s=t.get(e);if(s!==void 0)return s;const a=n();return t.set(e,a),a.catch(i=>{r(i)||t.delete(e)}),a}function Ap(t,e){const n=new Error(t===404?`Not found: ${e}`:`Read failed (${t}): ${e}`);return t===404&&(n.notFound=!0),n}class bN{async list(e){return await(await Ge(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await Ge(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw Ap(n.status,e);return n.text()}async readBytes(e){const n=await Ge(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw Ap(n.status,e);return new Uint8Array(await n.arrayBuffer())}async exists(e){return(await(await Ge(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function ml(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function yp(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Vc=Q(0);const kh={get value(){return u(Vc)},bump(){T(Vc,u(Vc)+1)}};function EN(t){return{image:()=>{},file:e=>_N(e)?cc(t,e):void 0}}function _N(t){return t.startsWith("assets/")}async function sf(t,e){const n=new Map,r=async a=>(n.has(a)||n.set(a,await e(a)),n.get(a)),s=await AN(t,r);return NN(s,r)}function Ph(t){return t.startsWith("/")&&!t.startsWith("//")}function dv(t){return`data:${t.contentType};base64,${TN(t.bytes)}`}function TN(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}async function AN(t,e){var a;const n=new Set([...t.matchAll(/<link\b[^>]*>/gi)].map(i=>i[0])),r=new Map;for(const i of n){const o=(a=i.match(/\bhref="([^"]*)"/i))==null?void 0:a[1];if(o===void 0||!Ph(o))continue;const l=await e(o);if(l!==void 0)if(/\brel="[^"]*stylesheet[^"]*"/i.test(i)){const d=new TextDecoder().decode(l.bytes);r.set(i,`<style>
9
+ }</style>`);h.childNodes=[...p,...h.childNodes]}}return l}function Gg(t,e){const n=new Map,r=[];for(const s of e){const a=Xn(s)?xt(s,"slot"):void 0;if(a!==void 0){Xn(s)&&wh(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return Vd(t,n,r)}function Vd(t,e,n){const r=[];for(const s of t)if(Xn(s)&&s.tagName==="slot"){const a=xt(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...Vd(s.childNodes,e,n))}else Xn(s)&&(s.childNodes=Vd(s.childNodes,e,n)),r.push(s);return r}async function sp(t,e,n){const r=new Array(t.length),s=Math.max(1,Math.min(Math.floor(e),t.length));let a=0;const i=async()=>{for(;a<t.length;){const o=a++;r[o]=await n(t[o],o)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Yy(t){return t.split("/").filter(e=>e!=="")}function cr(t){const e=Yy(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}function zy(t){return t===void 0?"":t.replace(/\/+$/,"")}const Wy=4;async function Gy(t,e,n={}){const[r,s,a,i]=await Promise.all([mh(t),gh(t),ag(t),ig(t)]),o=Kg(r,e,void 0);if(o===void 0)return;const l=n.draft??o.node.item,d=l.template??o.dirTemplate;if(d===void 0)return;const[f,g,h,p]=await Promise.all([Cl(t,d),TT(t,d),AT(t,d),bh(t)]),v=$d(f,s),_={...o.node,item:l};let E,b=[];if(n.media!==void 0)E=n.media;else{const O=Ky(_,v),M=await Vy(t,[O],n.imageEncoder,Wy);E=Xy(O,M.imageInfoByPublished,M.fileUrlByPublished),b=M.mediaArtifacts}return{html:zd({template:f,scope:Lh(l,{path:_.path,baseUrl:void 0}),components:s,context:Vg(r),media:E,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...p!==void 0&&{document:p},...g!==void 0&&{templateStyle:g},...h!==void 0&&{templateScript:h}}),mediaArtifacts:b}}function Kg(t,e,n){const r=t.defaultTemplate??n;for(const s of t.children)if(s.kind==="item"){if(s.path===e)return{node:s,dirTemplate:r}}else{const a=Kg(s,e,r);if(a!==void 0)return a}}function Ky(t,e){const n=Qy(t.path),r=t.item.fields,s=[];for(const l of e.fileFields)for(const d of op(r[l]))s.push({ref:d,published:ip(n,d)});const a=[],i=new Set,o=l=>{i.has(l)||(i.add(l),a.push({ref:l,published:ip(n,l)}))};for(const l of e.imageFields)for(const d of op(r[l]))o(d);for(const l of e.richTextFields){const d=r[l];if(typeof d=="string")for(const f of Zy(d))o(f)}return{images:a,files:s}}async function Vy(t,e,n,r,s,a,i){const o=p=>{const v=new Set,_=[];for(const E of e)for(const{published:b}of p(E))v.has(b)||(v.add(b),_.push(b));return _},l=[],d=o(p=>p.files),f=await sp(d,r,async p=>await ap(t,`content/${p}`)),g=new Map;d.forEach((p,v)=>{const _=f[v];_!==void 0&&(l.push({path:p,contents:_}),g.set(p,`/${p}`))});const h=new Map;if(n!==void 0){const p=o(_=>_.images),v=await sp(p,r,async _=>{const E=await ap(t,`content/${_}`);if(E===void 0)return;const b=qg(E),x=a==null?void 0:a.get(b);return x!==void 0?{...Py(_,b,x),cached:x}:await ky(E,_,n)});p.forEach((_,E)=>{const b=v[E];b!==void 0&&(l.push(...b.artifacts),h.set(_,b.info))})}return{mediaArtifacts:l,imageInfoByPublished:h,fileUrlByPublished:g}}function Xy(t,e,n){const r=new Map;for(const{ref:a,published:i}of t.images){const o=e.get(i);o!==void 0&&r.set(a,o)}const s=new Map;for(const{ref:a,published:i}of t.files){const o=n.get(i);o!==void 0&&s.set(a,o)}return{image:a=>r.get(a),file:a=>s.get(a)}}async function ap(t,e){try{return await t.readBytes(e)}catch{return}}function Qy(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function ip(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function Zy(t){const e=[],n=r=>{for(const s of r)if(Xn(s)){if(s.tagName==="img"){const a=xt(s,"src");a!==void 0&&Jy(a)&&e.push(a)}n(s.childNodes)}};return n(Js(t)),e}function Jy(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function op(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Lh(t,e){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated},...e!==void 0&&{url:cr(e.path),site_url:zy(e.baseUrl)}}}function e3(t){const e=new Map,n=new Map,r=s=>{n.set(s.path,s);for(const a of s.children)a.kind==="item"?e.set(a.path,a):r(a)};return r(t),{items:e,dirs:n}}function up(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function Vg(t){const{items:e,dirs:n}=e3(t),r=s=>({url:cr(s.path),fields:Lh(s.item)});return{collection(s,a){var h;const i=n.get(up(s));if(i===void 0)return[];const o=((h=i.collection)==null?void 0:h.recursive)??!1,l=[],d=p=>{for(const v of p.children)v.kind==="item"?v.slug!=="index"&&v.item.isPublished&&l.push(v):o&&d(v)};d(i);const f=t3(l,a.sort);return(a.limit!==void 0?f.slice(0,a.limit):f).map(r)},reference(s){const a=e.get(up(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function t3(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const o=Lh(i.item)[n];return o==null?"":String(o)},a=[...t].sort((i,o)=>s(i).localeCompare(s(o)));return r==="desc"?a.reverse():a}async function n3(t){var w;const[e,n,r]=await Promise.all([mh(t),gh(t),bh(t)]),{items:s,dirs:a,published:i}=r3(e);let o=null;if(r!==void 0)try{o=$d(r,n)}catch{o=null}const l=(o==null?void 0:o.requiredFields)??[],d=(o==null?void 0:o.constraints)??new Map,f=new Set(r!==void 0?Xr(r,n).map(S=>S.name):[]),g=[],h=(S,R,k,W)=>{g.push({severity:S,code:R,message:k,...W!==void 0&&{path:W}})},p=(S,R,k)=>{const W=s.get(cp(S));W===void 0?h("error","reference-missing",`"${R}" references "${S}" (${k}), which does not exist.`,R):W.item.isPublished||h("error","reference-unpublished",`"${R}" references "${S}" (${k}), which is not published.`,R)},v=(S,R,k)=>{for(const[W,{minLength:$,maxLength:Y}]of S){const U=R[W];if(typeof U!="string"||U==="")continue;const{length:K}=U;$!==void 0&&K<$&&h("warning","value-too-short",`"${k}" field "${W}" is ${K} characters; the minimum is ${$}.`,k),Y!==void 0&&K>Y&&h("warning","value-too-long",`"${k}" field "${W}" is ${K} characters; the maximum is ${Y}.`,k)}},_=new Map,E=new Map,b=async S=>{const R=_.get(S);if(R!==void 0||_.has(S))return R??null;let k;try{const W=await Cl(t,S);E.set(S,W),k=$d(W,n)}catch{k=null}return _.set(S,k),k},x=new Map,O=S=>{const R=x.get(S);if(R!==void 0)return R;const k=E.get(S),W=new Set(k!==void 0?Xr(k,n).map($=>$.name):[]);return x.set(S,W),W},M=new Map,B=async S=>{if(M.has(S))return M.get(S)??null;const R=await H(S);if(R===null)return M.set(S,null),null;let k;try{k=await Cl(t,R)}catch{return M.set(S,null),null}const W=E.get(S);if(W===void 0)return M.set(S,null),null;const $=Ty(Xr(k,n),Xr(W,n)),Y=new Set($.typeChanged.filter(U=>U.destructive&&za(U.from)!==za(U.to)).map(U=>U.name));return M.set(S,Y),Y},J=new Map,H=async S=>{if(J.has(S))return J.get(S)??null;const R=S.lastIndexOf("/"),k=R===-1?"templates":`templates/${S.slice(0,R)}`,W=R===-1?S:S.slice(R+1);let $;try{$=await t.list(k)}catch{return J.set(S,null),null}let Y=0,U=null;const K=`${W}@v`;for(const te of $){if(te.kind!=="file"||!te.name.endsWith(".html"))continue;const fe=te.name.slice(0,-5);if(!fe.startsWith(K))continue;const me=Ay(fe);me!==null&&me>Y&&(Y=me,U=R===-1?fe:`${S.slice(0,R)}/${fe}`)}return J.set(S,U),U},G=new Map;for(const{node:S,templateName:R}of i){const k=G.get(cr(S.path))??[];k.push(S.path),G.set(cr(S.path),k);const W=((w=S.parseDiagnostics)==null?void 0:w.unknownTopLevelKeys)??[];if(W.length>0&&h("warning","content.unknown-top-level-key",`"${S.path}" has top-level key${W.length===1?"":"s"} the parser does not recognise: ${W.map(U=>`"${U}"`).join(", ")}. They were dropped — content values belong under "fields" (and system keys are case-sensitive: "isPublished", not "IsPublished").`,S.path),R===void 0){h("error","no-template",`"${S.path}" has no template (no per-item or folder default).`,S.path);continue}const $=await b(R);if($===null){const U=jd(R)?" (the snapshot may have been deleted while this item still pins to it — restore it, rebind the item to current via the Migrations workspace, or delete this item).":"";h("error","template-missing",`"${S.path}" uses template "${R}", which does not exist.${U}`,S.path);continue}if(!jd(R)){const U=O(R),K=Object.keys(S.item.fields),te=K.filter(me=>!U.has(me)&&!f.has(me));te.length>0&&h("warning","content.schema-drift",`"${S.path}" has field${te.length===1?"":"s"} not rendered by template "${R}": ${te.map(me=>`"${me}"`).join(", ")}. Open the Migrations workspace to drop, rename, or keep them.`,S.path);const fe=await B(R);if(fe!==null&&fe.size>0){const me=K.filter(ge=>fe.has(ge));me.length>0&&h("warning","content.type-drift",`"${S.path}" has field${me.length===1?"":"s"} whose stored value now renders under a different kind in template "${R}": ${me.map(ge=>`"${ge}"`).join(", ")}. The value carries over but may look different (e.g. rich text shown as escaped text). Re-edit the field, or revert the template's type change if it wasn't intended.`,S.path)}}const Y=s3(S.item);for(const U of $.requiredFields)lp(Y[U])&&h("error","required-empty",`"${S.path}" is missing required field "${U}".`,S.path);for(const U of l)lp(Y[U])&&h("error","required-empty",`"${S.path}" is missing required meta field "${U}" (document shell).`,S.path);v($.constraints,Y,S.path),v(d,Y,S.path);for(const U of $.queryLoopPaths)a.has(cp(U))||h("error","loop-target-missing",`"${S.path}" loops over "${U}", which is not a directory.`,S.path);for(const U of $.curatedLoopFields)for(const K of a3(S.item.fields[U]))p(K,S.path,`field "${U}"`);for(const[U,K]of Object.entries(Y)){if(typeof K!="string")continue;const te=uc(K);if(te!==void 0&&p(te,S.path,`field "${U}"`),$.richTextFields.includes(U))for(const fe of Q0(K))p(fe,S.path,`field "${U}"`)}}const X=st.templates;if(o!==null)for(const S of o.references)p(S,`${X}/${bu}.html`,"link");for(const[S,R]of _)if(R!==null)for(const k of R.references)p(k,`${X}/${S}.html`,"link");for(const[S,R]of n)for(const k of Q0(R))p(k,`${st.components}/${S}.html`,"link");for(const[S,R]of G)R.length>1&&h("error","url-collision",`URL ${S} is produced by multiple items: ${R.join(", ")}.`);const ee=new Map;for(const S of await i3(t)){const k=S.slice(S.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),W=ee.get(k)??[];W.push(`${st.components}/${S}`),ee.set(k,W)}for(const[S,R]of[...ee].sort(([k],[W])=>k.localeCompare(W)))R.length>1&&h("error","component-tag-collision",`Multiple components resolve to <${S}>: ${R.join(", ")}.`);const A=g.filter(S=>S.severity==="error"),j=g.filter(S=>S.severity==="warning");return{diagnostics:g,errors:A,warnings:j,ok:A.length===0}}function r3(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const o=a.defaultTemplate??i;for(const l of a.children){if(l.kind==="dir"){s(l,o);continue}e.set(l.path,l),l.item.isPublished&&r.push({node:l,templateName:l.item.template??o})}};return s(t,void 0),{items:e,dirs:n,published:r}}function s3(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function lp(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function a3(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function cp(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function i3(t){const e=st.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const o=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,o):i.name.endsWith(".html")&&n.push(o)}};return await r(e,""),n.sort()}function Gc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let Xg="";function Fa(t){return`${Xg}${t}`}function o3(t){Xg=t.replace(/\/+$/,"")}async function u3(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&o3(e.apiUrl)}catch{}}async function Ge(t,e={}){const n=typeof t=="string"?Fa(t):t,r=await dp(n,e,pt.token);if(r.status!==401||pt.token===null)return r;const s=await pt.refresh();return s===null?r:dp(n,e,s)}async function dp(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function ei(t,e){const n=await Ge(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const Hu="nanoesis.jwt",l3=540*1e3;function c3(){let t=Q("loading"),e=Q(null),n=Q(null),r=Q(!1),s=null;function a(b,x){T(e,b,!0),T(n,x,!0),T(t,"authenticated"),localStorage.setItem(Hu,b),o()}function i(){T(e,null),T(n,null),T(t,"unauthenticated"),localStorage.removeItem(Hu),l()}function o(){l(),s=setInterval(()=>{d()},l3)}function l(){s!==null&&(clearInterval(s),s=null)}async function d(){if(u(e)===null)return null;const b=u(e),x=await fetch(Fa("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${b}`}});if(!x.ok)return i(),null;const O=await x.json().catch(()=>({}));return!O.ok||O.token===void 0||O.principal===void 0?(i(),null):(a(O.token,O.principal),O.token)}async function f(){T(t,"loading");let b;try{b=await fetch(Fa("/api/auth/state"))}catch{T(t,"no-auth");return}if(b.status===404){T(t,"no-auth");return}if(!b.ok){T(t,"unauthenticated");return}const x=await b.json();T(r,x.firstRun,!0);const O=localStorage.getItem(Hu);O!==null&&O!==""&&(T(e,O,!0),await d()!==null)||T(t,"unauthenticated")}async function g(b,x){const O=await fetch(Fa("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:b,password:x})}),M=await O.json().catch(()=>({}));return!O.ok||!M.ok||M.token===void 0||M.principal===void 0?{ok:!1,error:M.error??`HTTP ${O.status}`}:(T(r,!1),a(M.token,M.principal),{ok:!0})}async function h(){if(u(e)!==null)try{await Ge("/api/logout",{method:"POST"})}catch{}i()}async function p(b,x){const O=await Ge("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:b,newPassword:x})}),M=await O.json().catch(()=>({}));return!O.ok||!M.ok||M.token===void 0?{ok:!1,error:M.error??`HTTP ${O.status}`}:(T(e,M.token,!0),localStorage.setItem(Hu,M.token),{ok:!0})}async function v(){const b=await Ge("/api/me/token",{method:"POST"}),x=await b.json().catch(()=>({}));return!b.ok||x.ok!==!0||x.token===void 0?{ok:!1,error:x.error??`HTTP ${b.status}`}:{ok:!0,token:x.token,...x.expiresAt!==void 0&&{expiresAt:x.expiresAt}}}async function _(){const b=await Ge("/api/me/token",{method:"DELETE"});return b.ok?{ok:!0}:{ok:!1,error:(await b.json().catch(()=>({}))).error??`HTTP ${b.status}`}}function E(){return u(t)==="no-auth"}return{get status(){return u(t)},get token(){return u(e)},get principal(){return u(n)},get firstRun(){return u(r)},get canAuthor(){return E()||Gc(u(n),"author")},get canDevelop(){return E()||Gc(u(n),"developer")},get isAdmin(){return E()||Gc(u(n),"admin")},init:f,login:g,logout:h,refresh:d,changePassword:p,createMcpToken:v,revokeMcpTokens:_}}const pt=c3(),fp={name:null,logoUrl:null};async function d3(){try{const t=await fetch(Fa("/api/branding"));if(!t.ok)return fp;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:Fa(e.logoUrl)}}catch{return fp}}function f3(t){return ei("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function h3(t){return ei("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function p3(){return ei("/api/branding/logo",{method:"DELETE"})}function m3(){let t=Q(null),e=Q(null);async function n(){const r=await d3();T(t,r.name,!0),T(e,r.logoUrl,!0)}return{get name(){return u(t)},get logoUrl(){return u(e)},load:n}}const Dn=m3();let Mo=Q(null);const g3={get pending(){return u(Mo)}};function hp(t=""){return new Promise(e=>{T(Mo,{current:t,resolve:e},!0)})}function qu(t){u(Mo)!==null&&(u(Mo).resolve(t),T(Mo,null))}var v3=z(`<h2 class="svelte-trwq3g">Image description</h2> <p class="hint svelte-trwq3g">Describe the image for readers using a screen reader and for when it fails to load.
10
+ Leave it empty if the image is purely decorative.</p> <label class="field svelte-trwq3g"><span class="svelte-trwq3g">Alt text</span> <textarea rows="3" placeholder="e.g. Two people texting, frowning at their phones" class="svelte-trwq3g"></textarea></label> <div class="actions svelte-trwq3g"><button type="button" class="ghost svelte-trwq3g">Cancel</button> <button type="button" class="primary svelte-trwq3g">Save</button></div>`,1),b3=z('<dialog aria-label="Image description" class="svelte-trwq3g"><!></dialog>');function E3(t,e){at(e,!0);let n=Q(void 0),r=Q("");const s=_e(()=>g3.pending);Rt(()=>{var d,f;if(u(s)===null){(d=u(n))==null||d.close();return}T(r,u(s).current,!0),(f=u(n))==null||f.showModal()});function a(){qu(u(r).trim())}var i=b3(),o=y(i);{var l=d=>{var f=v3(),g=C(tt(f),4),h=C(y(g),2);$a(h,!0);var p=C(g,2),v=y(p),_=C(v,2);ie("keydown",h,E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),a())}),wt(h,()=>u(r),E=>T(r,E)),ie("click",v,()=>qu(null)),ie("click",_,a),F(d,f)};ce(o,d=>{u(s)!==null&&d(l)})}mn(i,d=>T(n,d),()=>u(n)),He("close",i,()=>qu(null)),He("cancel",i,()=>qu(null)),F(t,i),it()}Tt(["keydown","click"]);const _3="modulepreload",T3=function(t,e){return new URL(t,e).href},pp={},mp=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=i(n.map(f=>{if(f=T3(f,r),f in pp)return;pp[f]=!0;const g=f.endsWith(".css"),h=g?'[rel="stylesheet"]':"";if(!!r)for(let _=o.length-1;_>=0;_--){const E=o[_];if(E.href===f&&(!g||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":_3,g||(v.as="script"),v.crossOrigin="",v.href=f,d&&v.setAttribute("nonce",d),document.head.appendChild(v),g)return new Promise((_,E)=>{v.addEventListener("load",_),v.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function sa(t){return Array.isArray?Array.isArray(t):Zg(t)==="[object Array]"}function A3(t){if(typeof t=="string")return t;if(typeof t=="bigint")return t.toString();const e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Xd(t){return t==null?"":A3(t)}function kn(t){return typeof t=="string"}function pl(t){return typeof t=="number"}function y3(t){return t===!0||t===!1||N3(t)&&Zg(t)=="[object Boolean]"}function Qg(t){return typeof t=="object"}function N3(t){return Qg(t)&&t!==null}function jn(t){return t!=null}function ju(t){return!t.trim().length}function Zg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const w3="Incorrect 'index' type",S3=t=>`Invalid value for key ${t}`,I3=t=>`Pattern length exceeds max of ${t}.`,C3=t=>`Missing ${t} property in key`,L3=t=>`Property 'weight' in key '${t}' must be a positive integer`,gp=Object.prototype.hasOwnProperty;class O3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=Jg(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Jg(t){let e=null,n=null,r=null,s=1,a=null;if(kn(t)||sa(t))r=t,e=vp(t),n=Qd(t);else{if(!gp.call(t,"name"))throw new Error(C3("name"));const i=t.name;if(r=i,gp.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(L3(i));e=vp(i),n=Qd(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function vp(t){return sa(t)?t:t.split(".")}function Qd(t){return sa(t)?t.join("."):t}function x3(t,e){const n=[];let r=!1;const s=(a,i,o,l)=>{if(jn(a))if(!i[o])n.push(l!==void 0?{v:a,i:l}:a);else{const d=i[o],f=a[d];if(!jn(f))return;if(o===i.length-1&&(kn(f)||pl(f)||y3(f)||typeof f=="bigint"))n.push(l!==void 0?{v:Xd(f),i:l}:Xd(f));else if(sa(f)){r=!0;for(let g=0,h=f.length;g<h;g+=1)s(f[g],i,o+1,g)}else i.length&&s(f,i,o+1,l)}};return s(t,kn(e)?e.split("."):e,0),r?n:n[0]}const R3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},D3={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},k3={location:0,threshold:.6,distance:100},P3={useExtendedSearch:!1,useTokenSearch:!1,getFn:x3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},je=Object.freeze({...D3,...R3,...k3,...P3}),M3=/[^ ]+/g;function B3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(M3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),o=parseFloat(Math.round(i*r)/r);return n.set(a,o),o},clear(){n.clear()}}}class Oh{constructor({getFn:e=je.getFn,fieldNormWeight:n=je.fieldNormWeight}={}){this.norm=B3(n,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,kn(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();kn(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}removeAll(e){for(let n=e.length-1;n>=0;n-=1)this.records.splice(e[n],1);for(let n=0,r=this.records.length;n<r;n+=1)this.records[n].i=n}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!jn(e)||ju(e))return;const r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){const r={i:n,$:{}};this.keys.forEach((s,a)=>{const i=s.getFn?s.getFn(e):this.getFn(e,s.path);if(jn(i)){if(sa(i)){const o=[];for(let l=0,d=i.length;l<d;l+=1){const f=i[l];if(jn(f)){if(kn(f)){if(!ju(f)){const g={v:f,i:l,n:this.norm.get(f)};o.push(g)}}else if(jn(f.v)){const g=kn(f.v)?f.v:Xd(f.v);if(!ju(g)){const h={v:g,i:f.i,n:this.norm.get(g)};o.push(h)}}}}r.$[a]=o}else if(kn(i)&&!ju(i)){const o={v:i,n:this.norm.get(i)};r.$[a]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function ev(t,e,{getFn:n=je.getFn,fieldNormWeight:r=je.fieldNormWeight}={}){const s=new Oh({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(Jg)),s.setSources(e),s.create(),s}function F3(t,{getFn:e=je.getFn,fieldNormWeight:n=je.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new Oh({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function U3(t=[],e=je.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const o=t[a];o&&r===-1?r=a:!o&&r!==-1&&(s=a-1,s-r+1>=e&&n.push([r,s]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const _a=32;function H3(t,e,n,{location:r=je.location,distance:s=je.distance,threshold:a=je.threshold,findAllMatches:i=je.findAllMatches,minMatchCharLength:o=je.minMatchCharLength,includeMatches:l=je.includeMatches,ignoreLocation:d=je.ignoreLocation}={}){if(e.length>_a)throw new Error(I3(_a));const f=e.length,g=t.length,h=Math.max(0,Math.min(r,g));let p=a,v=h;const _=(G,X)=>{const ee=G/f;if(d)return ee;const A=Math.abs(h-X);return s?ee+A/s:A?1:ee},E=o>1||l,b=E?Array(g):[];let x;for(;(x=t.indexOf(e,v))>-1;){const G=_(0,x);if(p=Math.min(G,p),v=x+f,E){let X=0;for(;X<f;)b[x+X]=1,X+=1}}v=-1;let O=[],M=1,B=f+g;const J=1<<f-1;for(let G=0;G<f;G+=1){let X=0,ee=B;for(;X<ee;)_(G,h+ee)<=p?X=ee:B=ee,ee=Math.floor((B-X)/2+X);B=ee;let A=Math.max(1,h-ee+1);const j=i?g:Math.min(h+ee,g)+f,w=Array(j+2);w[j+1]=(1<<G)-1;for(let R=j;R>=A;R-=1){const k=R-1,W=n[t[k]];if(E&&(b[k]=+!!W),w[R]=(w[R+1]<<1|1)&W,G&&(w[R]|=(O[R+1]|O[R])<<1|1|O[R+1]),w[R]&J&&(M=_(G,k),M<=p)){if(p=M,v=k,v<=h)break;A=Math.max(1,2*h-v)}}if(_(G+1,h)>p)break;O=w}const H={isMatch:v>=0,score:Math.max(.001,M)};if(E){const G=U3(b,o);G.length?l&&(H.indices=G):H.isMatch=!1}return H}function q3(t){const e={};for(let n=0,r=t.length;n<r;n+=1){const s=t.charAt(n);e[s]=(e[s]||0)|1<<r-n-1}return e}function xh(t){if(t.length<=1)return t;t.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const e=[t[0]];for(let n=1,r=t.length;n<r;n+=1){const s=e[e.length-1],a=t[n];a[0]<=s[1]+1?s[1]=Math.max(s[1],a[1]):e.push(a)}return e}const tv={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},j3=new RegExp("["+Object.keys(tv).join("")+"]","g"),Ko=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(j3,e=>tv[e]):t=>t;class Rh{constructor(e,{location:n=je.location,threshold:r=je.threshold,distance:s=je.distance,includeMatches:a=je.includeMatches,findAllMatches:i=je.findAllMatches,minMatchCharLength:o=je.minMatchCharLength,isCaseSensitive:l=je.isCaseSensitive,ignoreDiacritics:d=je.ignoreDiacritics,ignoreLocation:f=je.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:f},e=l?e:e.toLowerCase(),e=d?Ko(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(p,v)=>{this.chunks.push({pattern:p,alphabet:q3(p),startIndex:v})},h=this.pattern.length;if(h>_a){let p=0;const v=h%_a,_=h-v;for(;p<_;)g(this.pattern.substr(p,_a),p),p+=_a;if(v){const E=h-_a;g(this.pattern.substr(E),E)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?Ko(e):e,this.pattern===e){const _={isMatch:!0,score:0};return s&&(_.indices=[[0,e.length-1]]),_}const{location:a,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,ignoreLocation:f}=this.options,g=[];let h=0,p=!1;this.chunks.forEach(({pattern:_,alphabet:E,startIndex:b})=>{const{isMatch:x,score:O,indices:M}=H3(e,_,E,{location:a+b,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,includeMatches:s,ignoreLocation:f});x&&(p=!0),h+=O,x&&M&&g.push(...M)});const v={isMatch:p,score:p?h/this.chunks.length:1};return p&&s&&(v.indices=xh(g)),v}}class aa{constructor(e){this.pattern=e}static isMultiMatch(e){return bp(e,this.multiRegex)}static isSingleMatch(e){return bp(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function bp(t,e){const n=t.match(e);return n?n[1]:null}class $3 extends aa{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class Y3 extends aa{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class z3 extends aa{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class W3 extends aa{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class G3 extends aa{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class K3 extends aa{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class nv extends aa{constructor(e,{location:n=je.location,threshold:r=je.threshold,distance:s=je.distance,includeMatches:a=je.includeMatches,findAllMatches:i=je.findAllMatches,minMatchCharLength:o=je.minMatchCharLength,isCaseSensitive:l=je.isCaseSensitive,ignoreDiacritics:d=je.ignoreDiacritics,ignoreLocation:f=je.ignoreLocation}={}){super(e),this._bitapSearch=new Rh(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class rv extends aa{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const s=[],a=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+a,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?0:1,indices:s}}}const Zd=[$3,rv,z3,W3,K3,G3,Y3,nv],Ep=Zd.length,V3="\0",X3="|";function Q3(t){const e=[],n=t.length;let r=0;for(;r<n;){for(;r<n&&t[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&t[s]!==" "&&t[s]!=='"';)s++;if(s<n&&t[s]==='"'){for(s++;s<n;){if(t[s]==='"'){const a=s+1;if(a>=n||t[a]===" "){s++;break}if(t[a]==="$"&&(a+1>=n||t[a+1]===" ")){s+=2;break}}s++}e.push(t.substring(r,s)),r=s}else{for(;s<n&&t[s]!==" ";)s++;e.push(t.substring(r,s)),r=s}}return e}function Z3(t,e={}){return t.replace(/\\\|/g,V3).split(X3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=Q3(s.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,l=a.length;o<l;o+=1){const d=a[o];let f=!1,g=-1;for(;!f&&++g<Ep;){const h=Zd[g],p=h.isMultiMatch(d);p&&(i.push(new h(p,e)),f=!0)}if(!f)for(g=-1;++g<Ep;){const h=Zd[g],p=h.isSingleMatch(d);if(p){i.push(new h(p,e));break}}}return i})}const J3=new Set([nv.type,rv.type]);class eN{constructor(e,{isCaseSensitive:n=je.isCaseSensitive,ignoreDiacritics:r=je.ignoreDiacritics,includeMatches:s=je.includeMatches,minMatchCharLength:a=je.minMatchCharLength,ignoreLocation:i=je.ignoreLocation,findAllMatches:o=je.findAllMatches,location:l=je.location,threshold:d=je.threshold,distance:f=je.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:o,ignoreLocation:i,location:l,threshold:d,distance:f},e=n?e:e.toLowerCase(),e=r?Ko(e):e,this.pattern=e,this.query=Z3(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:s,ignoreDiacritics:a}=this.options;e=s?e:e.toLowerCase(),e=a?Ko(e):e;let i=0;const o=[];let l=0,d=!1;for(let f=0,g=n.length;f<g;f+=1){const h=n[f];o.length=0,i=0,d=!1;for(let p=0,v=h.length;p<v;p+=1){const _=h[p],{isMatch:E,indices:b,score:x}=_.search(e);if(E){i+=1,l+=x;const O=_.constructor.type;O.startsWith("inverse")&&(d=!0),r&&(J3.has(O)?o.push(...b):o.push(b))}else{l=0,i=0,o.length=0,d=!1;break}}if(i){const p={isMatch:!0,score:l/i};return d&&(p.hasInverse=!0),r&&(p.indices=xh(o)),p}}return{isMatch:!1,score:1}}}const Jd=[];function Dh(...t){Jd.push(...t)}function Dl(t,e){for(let n=0,r=Jd.length;n<r;n+=1){const s=Jd[n];if(s.condition(t,e))return new s(t,e)}return new Rh(t,e)}const kl={AND:"$and",OR:"$or"},ef={PATH:"$path",PATTERN:"$val"},tf=t=>!!(t[kl.AND]||t[kl.OR]),tN=t=>!!t[ef.PATH],nN=t=>!sa(t)&&Qg(t)&&!tf(t),_p=t=>({[kl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function sv(t,e,{auto:n=!0}={}){const r=s=>{if(kn(s)){const l={keyId:null,pattern:s};return n&&(l.searcher=Dl(s,e)),l}const a=Object.keys(s),i=tN(s);if(!i&&a.length>1&&!tf(s))return r(_p(s));if(nN(s)){const l=i?s[ef.PATH]:a[0],d=i?s[ef.PATTERN]:s[l];if(!kn(d))throw new Error(S3(l));const f={keyId:Qd(l),pattern:d};return n&&(f.searcher=Dl(d,e)),f}const o={children:[],operator:a[0]};return a.forEach(l=>{const d=s[l];sa(d)&&d.forEach(f=>{o.children.push(r(f))})}),o};return tf(t)||(t=_p(t)),r(t)}function nf(t,{ignoreFieldNorm:e=je.ignoreFieldNorm}){let n=1;return t.forEach(({key:r,norm:s,score:a})=>{const i=r?r.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(e?1:s))}),n}function rN(t,{ignoreFieldNorm:e=je.ignoreFieldNorm}){t.forEach(n=>{n.score=nf(n.matches,{ignoreFieldNorm:e})})}class sN{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const n=this.heap;for(;e>0;){const r=e-1>>1;if(n[e].score<=n[r].score)break;const s=n[e];n[e]=n[r],n[r]=s,e=r}}_sinkDown(e){const n=this.heap,r=n.length;let s=e;do{e=s;const a=2*e+1,i=2*e+2;if(a<r&&n[a].score>n[s].score&&(s=a),i<r&&n[i].score>n[s].score&&(s=i),s!==e){const o=n[e];n[e]=n[s],n[s]=o}}while(s!==e)}}function aN(t,e){const n=t.matches;e.matches=[],jn(n)&&n.forEach(r=>{if(!jn(r.indices)||!r.indices.length)return;const{indices:s,value:a}=r,i={indices:s,value:a};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),e.matches.push(i)})}function iN(t,e){e.score=t.score}function oN(t,e,{includeMatches:n=je.includeMatches,includeScore:r=je.includeScore}={}){const s=[];return n&&s.push(aN),r&&s.push(iN),t.map(a=>{const{idx:i}=a,o={item:e[i],refIndex:i};return s.length&&s.forEach(l=>{l(a,o)}),o})}const uN=/\b\w+\b/g;function rf({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=Ko(n)),n.match(uN)||[]}}}function lN(t,e,n){const r=new Map,s=new Map;let a=0;function i(o,l,d,f){const g=n.tokenize(o);if(!g.length)return;a++;const h=new Map;for(const p of g)h.set(p,(h.get(p)||0)+1);for(const[p,v]of h){const _={docIdx:l,keyIdx:d,subIdx:f,tf:v};let E=r.get(p);E||(E=[],r.set(p,E)),E.push(_),s.set(p,(s.get(p)||0)+1)}}for(const o of t){const{i:l,v:d,$:f}=o;if(d!==void 0){i(d,l,-1,-1);continue}if(f)for(let g=0;g<e;g++){const h=f[g];if(h)if(Array.isArray(h))for(const p of h)i(p.v,l,g,p.i??-1);else i(h.v,l,g,-1)}}return{terms:r,fieldCount:a,df:s}}function cN(t,e,n,r){const{i:s,v:a,$:i}=e;function o(l,d,f){const g=r.tokenize(l);if(!g.length)return;t.fieldCount++;const h=new Map;for(const p of g)h.set(p,(h.get(p)||0)+1);for(const[p,v]of h){const _={docIdx:s,keyIdx:d,subIdx:f,tf:v};let E=t.terms.get(p);E||(E=[],t.terms.set(p,E)),E.push(_),t.df.set(p,(t.df.get(p)||0)+1)}}if(a!==void 0){o(a,-1,-1);return}if(i)for(let l=0;l<n;l++){const d=i[l];if(d)if(Array.isArray(d))for(const f of d)o(f.v,l,f.i??-1);else o(d.v,l,-1)}}function Tp(t,e){for(const[n,r]of t.terms){const s=r.filter(i=>i.docIdx!==e),a=r.length-s.length;a>0&&(t.fieldCount-=a,t.df.set(n,(t.df.get(n)||0)-a),s.length===0?(t.terms.delete(n),t.df.delete(n)):t.terms.set(n,s))}}class ia{constructor(e,n,r){this.options={...je,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new O3(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const n=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,r=Dl(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Oh))throw new Error(w3);if(this._myIndex=n||ev(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=rf({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=lN(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(jn(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const n=this._myIndex.records[this._myIndex.records.length-1],r=rf({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});cN(this._invertedIndex,n,this._myIndex.keys.length,r)}}remove(e=()=>!1){const n=[],r=[];for(let s=0,a=this._docs.length;s<a;s+=1)e(this._docs[s],s)&&(n.push(this._docs[s]),r.push(s));if(r.length){if(this._invertedIndex)for(const s of r)Tp(this._invertedIndex,s);for(let s=r.length-1;s>=0;s-=1)this._docs.splice(r[s],1);this._myIndex.removeAll(r)}return n}removeAt(e){this._invertedIndex&&Tp(this._invertedIndex,e);const n=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),n}getIndex(){return this._myIndex}search(e,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:i,sortFn:o,ignoreFieldNorm:l}=this.options;if(kn(e)&&!e.trim()){let g=this._docs.map((h,p)=>({item:h,refIndex:p}));return pl(r)&&r>-1&&(g=g.slice(0,r)),g}const d=pl(r)&&r>0&&kn(e);let f;if(d){const g=new sN(r);kn(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:l}),f=g.extractSorted(o)}else f=kn(e)?kn(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),rN(f,{ignoreFieldNorm:l}),i&&f.sort(o),pl(r)&&r>-1&&(f=f.slice(0,r));return oN(f,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{records:a}=this._myIndex,i=n?null:[];return a.forEach(({v:o,i:l,n:d})=>{if(!jn(o))return;const{isMatch:f,score:g,indices:h}=s.searchIn(o);if(f){const p={item:o,idx:l,matches:[{score:g,value:o,norm:d,indices:h}]};n?(p.score=nf(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):i.push(p)}}),i}_searchLogical(e){const n=sv(e,this.options),r=(o,l,d)=>{if(!("children"in o)){const{keyId:p,searcher:v}=o;let _;return p===null?(_=[],this._myIndex.keys.forEach((E,b)=>{_.push(...this._findMatches({key:E,value:l[b],searcher:v}))})):_=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:v}),_&&_.length?[{idx:d,item:l,matches:_}]:[]}const{children:f,operator:g}=o,h=[];for(let p=0,v=f.length;p<v;p+=1){const _=f[p],E=r(_,l,d);if(E.length)h.push(...E);else if(g===kl.AND)return[]}return h},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:o,i:l})=>{if(jn(o)){const d=r(n,o,l);d.length&&(a.has(l)||(a.set(l,{idx:l,item:o,matches:[]}),i.push(a.get(l))),d.forEach(({matches:f})=>{a.get(l).matches.push(...f)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,o=n?null:[];return i.forEach(({$:l,i:d})=>{if(!jn(l))return;const f=[];let g=!1,h=!1;if(a.forEach((p,v)=>{const _=this._findMatches({key:p,value:l[v],searcher:s});_.length?(f.push(..._),_[0].hasInverse&&(h=!0)):g=!0}),!(h&&g)&&f.length){const p={idx:d,item:l,matches:f};n?(p.score=nf(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):o.push(p)}}),o}_findMatches({key:e,value:n,searcher:r}){if(!jn(n))return[];const s=[];if(sa(n))n.forEach(({v:a,i,n:o})=>{if(!jn(a))return;const{isMatch:l,score:d,indices:f,hasInverse:g}=r.searchIn(a);l&&s.push({score:d,key:e,value:a,idx:i,norm:o,indices:f,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:o,score:l,indices:d,hasInverse:f}=r.searchIn(a);o&&s.push({score:l,key:e,value:a,norm:i,indices:d,hasInverse:f})}return s}}class dN{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=rf({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(e),s=n._invertedIndex,{df:a,fieldCount:i}=s;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new Rh(o,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const l=a.get(o)||0,d=Math.log(1+(i-l+.5)/(l+.5));this.idfWeights.push(d)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let l=0;l<this.termSearchers.length;l++){const d=this.termSearchers[l].searchIn(e),f=this.idfWeights[l];s+=f,d.isMatch&&(a++,r+=f*(1-d.score),d.indices&&n.push(...d.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(o.indices=xh(n)),o}}ia.version="7.3.0";ia.createIndex=ev;ia.parseIndex=F3;ia.config=je;ia.match=function(t,e,n){return Dl(t,{...je,...n}).searchIn(e)};ia.parseQuery=sv;Dh(eN);Dh(dN);ia.use=function(...t){t.forEach(e=>Dh(e))};function fN(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=l=>{a.has(l.path)||(a.add(l.path),s.push(l))};for(const l of t)l.title.toLowerCase()===r&&i(l);for(const l of t)l.title.toLowerCase().startsWith(r)&&i(l);for(const l of t)l.title.toLowerCase().includes(r)&&i(l);const o=new ia(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const l of o.search(e))i(l.item);return s.slice(0,n)}const hN=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function av(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function iv(...t){return t.filter(e=>e!=="").join("/")}function pN(t){return hN.has(av(t))}function mN(t){return iv(st.content,t,"assets")}function Gi(t,e){return iv(st.content,t,e)}function cc(t,e){return ov(Gi(t,e))}function ov(t){return Fa(`/api/read?path=${encodeURIComponent(t)}`)}function uv(t){return`assets/${t}`}function lv(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=av(t),s=_s(n)||"image";return r===""?s:`${s}.${r}`}function gN(t){return typeof t=="object"&&t!==null&&t.notFound===!0}var $s,Mi,fu,Bi;class vN{constructor(e){Ue(this,$s);Ue(this,Mi,new Map);Ue(this,fu,new Map);Ue(this,Bi,new Map);Ye(this,$s,e)}list(e){return Kc(V(this,fu),e,()=>V(this,$s).list(e))}readText(e){return Kc(V(this,Mi),e,()=>V(this,$s).readText(e),gN)}exists(e){return Kc(V(this,Bi),e,()=>V(this,$s).exists(e))}readBytes(e){return V(this,$s).readBytes(e)}invalidate(e){V(this,Mi).delete(e),V(this,Bi).delete(e)}clear(){V(this,Mi).clear(),V(this,fu).clear(),V(this,Bi).clear()}}$s=new WeakMap,Mi=new WeakMap,fu=new WeakMap,Bi=new WeakMap;function Kc(t,e,n,r=()=>!1){const s=t.get(e);if(s!==void 0)return s;const a=n();return t.set(e,a),a.catch(i=>{r(i)||t.delete(e)}),a}function Ap(t,e){const n=new Error(t===404?`Not found: ${e}`:`Read failed (${t}): ${e}`);return t===404&&(n.notFound=!0),n}class bN{async list(e){return await(await Ge(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await Ge(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw Ap(n.status,e);return n.text()}async readBytes(e){const n=await Ge(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw Ap(n.status,e);return new Uint8Array(await n.arrayBuffer())}async exists(e){return(await(await Ge(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function ml(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function yp(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Vc=Q(0);const kh={get value(){return u(Vc)},bump(){T(Vc,u(Vc)+1)}};function EN(t){return{image:()=>{},file:e=>_N(e)?cc(t,e):void 0}}function _N(t){return t.startsWith("assets/")}async function sf(t,e){const n=new Map,r=async a=>(n.has(a)||n.set(a,await e(a)),n.get(a)),s=await AN(t,r);return NN(s,r)}function Ph(t){return t.startsWith("/")&&!t.startsWith("//")}function cv(t){return`data:${t.contentType};base64,${TN(t.bytes)}`}function TN(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}async function AN(t,e){var a;const n=new Set([...t.matchAll(/<link\b[^>]*>/gi)].map(i=>i[0])),r=new Map;for(const i of n){const o=(a=i.match(/\bhref="([^"]*)"/i))==null?void 0:a[1];if(o===void 0||!Ph(o))continue;const l=await e(o);if(l!==void 0)if(/\brel="[^"]*stylesheet[^"]*"/i.test(i)){const d=new TextDecoder().decode(l.bytes);r.set(i,`<style>
11
11
  ${await yN(d,e)}
12
- </style>`)}else r.set(i,i.replace(/(\bhref=")[^"]*"/i,`$1${dv(l)}"`))}let s=t;for(const[i,o]of r)s=s.split(i).join(o);return s}async function yN(t,e){const n=new Set;for(const s of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))Ph(s[1])&&n.add(s[1]);const r=await hv(n,e);return fv(t,r)}async function NN(t,e){const n=new Set,r=o=>{o!==void 0&&Ph(o)&&n.add(o)};for(const o of t.matchAll(/\s(?:src|poster)="([^"]*)"/g))r(o[1]);for(const o of t.matchAll(/\ssrcset="([^"]*)"/g))for(const l of Np(o[1]))r(l.url);for(const o of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))r(o[1]);const s=await hv(n,e),a=o=>s.get(o)??o,i=t.replace(/(\s(?:src|poster)=")([^"]*)"/g,(o,l,d)=>s.has(d)?`${l}${a(d)}"`:o).replace(/(\ssrcset=")([^"]*)"/g,(o,l,d)=>{const h=Np(d).map(({url:g,descriptor:f})=>[a(g),f].filter(p=>p!=="").join(" ")).join(", ");return`${l}${h}"`});return fv(i,s)}function fv(t,e){return t.replace(/url\(\s*(['"]?)([^)'"]*)\1\s*\)/gi,(n,r,s)=>e.has(s)?`url(${r}${e.get(s)}${r})`:n)}async function hv(t,e){const n=new Map;return await Promise.all([...t].map(async r=>{const s=await e(r);s!==void 0&&n.set(r,dv(s))})),n}function Np(t){return t.split(",").map(e=>e.trim()).filter(e=>e!=="").map(e=>{const[n,...r]=e.split(/\s+/);return{url:n??"",descriptor:r.join(" ")}})}const wN=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
12
+ </style>`)}else r.set(i,i.replace(/(\bhref=")[^"]*"/i,`$1${cv(l)}"`))}let s=t;for(const[i,o]of r)s=s.split(i).join(o);return s}async function yN(t,e){const n=new Set;for(const s of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))Ph(s[1])&&n.add(s[1]);const r=await fv(n,e);return dv(t,r)}async function NN(t,e){const n=new Set,r=o=>{o!==void 0&&Ph(o)&&n.add(o)};for(const o of t.matchAll(/\s(?:src|poster)="([^"]*)"/g))r(o[1]);for(const o of t.matchAll(/\ssrcset="([^"]*)"/g))for(const l of Np(o[1]))r(l.url);for(const o of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))r(o[1]);const s=await fv(n,e),a=o=>s.get(o)??o,i=t.replace(/(\s(?:src|poster)=")([^"]*)"/g,(o,l,d)=>s.has(d)?`${l}${a(d)}"`:o).replace(/(\ssrcset=")([^"]*)"/g,(o,l,d)=>{const f=Np(d).map(({url:g,descriptor:h})=>[a(g),h].filter(p=>p!=="").join(" ")).join(", ");return`${l}${f}"`});return dv(i,s)}function dv(t,e){return t.replace(/url\(\s*(['"]?)([^)'"]*)\1\s*\)/gi,(n,r,s)=>e.has(s)?`url(${r}${e.get(s)}${r})`:n)}async function fv(t,e){const n=new Map;return await Promise.all([...t].map(async r=>{const s=await e(r);s!==void 0&&n.set(r,cv(s))})),n}function Np(t){return t.split(",").map(e=>e.trim()).filter(e=>e!=="").map(e=>{const[n,...r]=e.split(/\s+/);return{url:n??"",descriptor:r.join(" ")}})}const wN=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
13
13
  <rect width='800' height='450' fill='#e2e8f0'/>
14
14
  <path d='M0 0 800 450 M800 0 0 450' stroke='#cbd5e1' stroke-width='2'/>
15
15
  <rect x='300' y='150' width='200' height='130' rx='10' fill='#cbd5e1'/>
16
16
  <circle cx='350' cy='195' r='18' fill='#94a3b8'/>
17
17
  <path d='M308 280 380 210 432 258 470 228 492 280Z' fill='#94a3b8'/>
18
18
  <text x='400' y='330' font-family='system-ui, sans-serif' font-size='24' fill='#64748b' text-anchor='middle'>image</text>
19
- </svg>`,pv=`data:image/svg+xml,${encodeURIComponent(wN)}`;function SN(t){switch(t.type){case"image":return pv;case"file":case"url":return"#";case"email":return"name@example.com";case"phone":return"+1 555-0100";case"date":return"2026-01-01";case"time":return"09:00";case"code":return`// ${t.label}`;case"richtext":return`<p>${t.label}, sample rich text. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`;case"authors":return[{name:"Ada Lovelace"},{name:"Alan Turing"}];case"text":return`${t.label}, sample paragraph text. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.`;case"shorttext":default:return t.label}}function IN(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=SN(n));return e}function CN(t,e){if(e===void 0)return t;const n={...t};for(const[r,s]of Object.entries(e))s!==""&&(n[r]=s);return n}function LN(t,e){const n={};if(e===void 0)return n;for(const r of t){if(r.multiple!==!0)continue;const s=e[r.name];if(s===void 0||s.trim()==="")continue;const a=s.split(/[\n,]+/).map(i=>i.trim()).filter(i=>i!=="");a.length>0&&(n[r.name]=a)}return n}function ON(t){return t.startsWith(`${st.components}/`)}function xN(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}const mv={htmlAttrs:"",headStyles:""};function RN(t){var s,a,i;if(t===void 0||t.trim()==="")return mv;const e=((a=(s=t.match(/<html\b([^>]*)>/i))==null?void 0:s[1])==null?void 0:a.trim())??"",n=((i=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i))==null?void 0:i[1])??"",r=[];for(const o of n.matchAll(/<link\b[^>]*>/gi))/\brel=(["'])[^"']*stylesheet[^"']*\1/i.test(o[0])&&r.push(o[0]);for(const o of n.matchAll(/<style\b[^>]*>[\s\S]*?<\/style>/gi))r.push(o[0]);return{htmlAttrs:e,headStyles:r.join(`
20
- `)}}function gv(t){const e=t.htmlAttrs.trim()===""?'lang="en"':t.htmlAttrs.trim(),n=t.headStyles.trim()===""?"":`
19
+ </svg>`,hv=`data:image/svg+xml,${encodeURIComponent(wN)}`;function SN(t){switch(t.type){case"image":return hv;case"file":case"url":return"#";case"email":return"name@example.com";case"phone":return"+1 555-0100";case"date":return"2026-01-01";case"time":return"09:00";case"code":return`// ${t.label}`;case"richtext":return`<p>${t.label}, sample rich text. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`;case"authors":return[{name:"Ada Lovelace"},{name:"Alan Turing"}];case"text":return`${t.label}, sample paragraph text. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.`;case"shorttext":default:return t.label}}function IN(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=SN(n));return e}function CN(t,e){if(e===void 0)return t;const n={...t};for(const[r,s]of Object.entries(e))s!==""&&(n[r]=s);return n}function LN(t,e){const n={};if(e===void 0)return n;for(const r of t){if(r.multiple!==!0)continue;const s=e[r.name];if(s===void 0||s.trim()==="")continue;const a=s.split(/[\n,]+/).map(i=>i.trim()).filter(i=>i!=="");a.length>0&&(n[r.name]=a)}return n}function ON(t){return t.startsWith(`${st.components}/`)}function xN(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}const pv={htmlAttrs:"",headStyles:""};function RN(t){var s,a,i;if(t===void 0||t.trim()==="")return pv;const e=((a=(s=t.match(/<html\b([^>]*)>/i))==null?void 0:s[1])==null?void 0:a.trim())??"",n=((i=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i))==null?void 0:i[1])??"",r=[];for(const o of n.matchAll(/<link\b[^>]*>/gi))/\brel=(["'])[^"']*stylesheet[^"']*\1/i.test(o[0])&&r.push(o[0]);for(const o of n.matchAll(/<style\b[^>]*>[\s\S]*?<\/style>/gi))r.push(o[0]);return{htmlAttrs:e,headStyles:r.join(`
20
+ `)}}function mv(t){const e=t.htmlAttrs.trim()===""?'lang="en"':t.htmlAttrs.trim(),n=t.headStyles.trim()===""?"":`
21
21
  ${t.headStyles}`;return`<!doctype html>
22
22
  <html ${e}>
23
23
  <head>
@@ -29,7 +29,7 @@ ${await yN(d,e)}
29
29
  <body>
30
30
  ${t.body}
31
31
  </body>
32
- </html>`}function DN(t,e,n=mv){const r=e.filter(a=>a.multiple!==!0).map(a=>`${a.name}="{${a.name}}"`).join(" "),s=r===""?`<${t}>`:`<${t} ${r}>`;return gv({htmlAttrs:n.htmlAttrs,headStyles:n.headStyles,title:`${t} preview`,body:`${s}Sample slot content</${t}>`})}function wp(){return{image:()=>{},file:t=>PN(t)?pv:void 0}}const kN=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function PN(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:kN.test(t)}const $e=new vN(new bN),af=new Map;let of,uf,lf,Pl,cf;const df=new Map;function _u(){df.clear()}function Mh(){return cf??(cf=mh($e)),cf}async function ff(){const t=[],e=n=>{for(const r of n.children)r.kind==="dir"&&(t.push(r.path),e(r))};return e(await Mh()),t.sort()}async function MN(){const t=await Ge("/api/authors");return t.ok?await t.json():[]}function so(){cf=void 0,kh.bump()}const Sp=".json",Bh="_sort.json",BN="assets",FN=new Set([Bh,"_redirects.json","_site.json"]);function hf(t,e){return t===""?e:`${t}/${e}`}function Fh(t){return t===""?st.content:`${st.content}/${t}`}async function Uh(t){try{return tg(JSON.parse(await $e.readText(`${t}/${Bh}`)))}catch{return{order:[]}}}function UN(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}async function HN(t){try{const{title:e}=tc(JSON.parse(await $e.readText(t)));return e===""?void 0:e}catch{return}}async function pf(t){return t===""?"Home":(await Uh(Fh(t))).name??ph(ml(t))}async function qN(t){return await HN(Ws(hf(t,"index")))??await pf(t)}async function vv(t){const e=Fh(t),[n,r]=await Promise.all([$e.list(e),Uh(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(FN.has(a.name)||!a.name.endsWith(Sp))continue;const i=a.name.slice(0,-Sp.length);try{const o=tc(JSON.parse(await $e.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:hf(t,i),title:o.title,isPublished:o.isPublished,template:o.template})}catch{}}else if(a.name!==BN){const i=hf(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await qN(i)})}return{entries:UN(s,r.order),defaultTemplate:r.defaultTemplate}}function jN(t){const e=[],n=(r,s)=>{const a=r.defaultTemplate??s;for(const i of r.children)i.kind==="item"?e.push({path:i.path,title:i.item.title,isPublished:i.item.isPublished,template:i.item.template??a}):n(i,a)};return n(t,void 0),e}async function bv(t,e=30){return t.trim()===""?[]:fN(jN(await Mh()),t,e)}async function $N(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await Uh(Fh(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function YN(t){const e=af.get(t);if(e!==void 0)return e;const n=await Cl($e,t);return af.set(t,n),n}function Tu(){return of??(of=gh($e)),of}function zN(){return uf??(uf=ag($e)),uf}function WN(){return lf??(lf=ig($e)),lf}async function GN(t){const[e,n]=await Promise.all([YN(t),Tu()]);return Xr(e,n)}function Ev(){return Pl??(Pl=bh($e)),Pl}async function KN(){const[t,e]=await Promise.all([Ev(),Tu()]);return t===void 0?[]:Xr(t,e).filter(n=>n.name!=="title")}const mf=`${st.templates}/${bu}.html`;function fk(){return $e.exists(mf)}const VN=`<!doctype html>
32
+ </html>`}function DN(t,e,n=pv){const r=e.filter(a=>a.multiple!==!0).map(a=>`${a.name}="{${a.name}}"`).join(" "),s=r===""?`<${t}>`:`<${t} ${r}>`;return mv({htmlAttrs:n.htmlAttrs,headStyles:n.headStyles,title:`${t} preview`,body:`${s}Sample slot content</${t}>`})}function wp(){return{image:()=>{},file:t=>PN(t)?hv:void 0}}const kN=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function PN(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:kN.test(t)}const $e=new vN(new bN),af=new Map;let of,uf,lf,Pl,cf;const df=new Map;function _u(){df.clear()}function Mh(){return cf??(cf=mh($e)),cf}async function ff(){const t=[],e=n=>{for(const r of n.children)r.kind==="dir"&&(t.push(r.path),e(r))};return e(await Mh()),t.sort()}async function MN(){const t=await Ge("/api/authors");return t.ok?await t.json():[]}function so(){cf=void 0,kh.bump()}const Sp=".json",Bh="_sort.json",BN="assets",FN=new Set([Bh,"_redirects.json","_site.json"]);function hf(t,e){return t===""?e:`${t}/${e}`}function Fh(t){return t===""?st.content:`${st.content}/${t}`}async function Uh(t){try{return tg(JSON.parse(await $e.readText(`${t}/${Bh}`)))}catch{return{order:[]}}}function UN(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}async function HN(t){try{const{title:e}=tc(JSON.parse(await $e.readText(t)));return e===""?void 0:e}catch{return}}async function pf(t){return t===""?"Home":(await Uh(Fh(t))).name??ph(ml(t))}async function qN(t){return await HN(Ws(hf(t,"index")))??await pf(t)}async function gv(t){const e=Fh(t),[n,r]=await Promise.all([$e.list(e),Uh(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(FN.has(a.name)||!a.name.endsWith(Sp))continue;const i=a.name.slice(0,-Sp.length);try{const o=tc(JSON.parse(await $e.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:hf(t,i),title:o.title,isPublished:o.isPublished,template:o.template})}catch{}}else if(a.name!==BN){const i=hf(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await qN(i)})}return{entries:UN(s,r.order),defaultTemplate:r.defaultTemplate}}function jN(t){const e=[],n=(r,s)=>{const a=r.defaultTemplate??s;for(const i of r.children)i.kind==="item"?e.push({path:i.path,title:i.item.title,isPublished:i.item.isPublished,template:i.item.template??a}):n(i,a)};return n(t,void 0),e}async function vv(t,e=30){return t.trim()===""?[]:fN(jN(await Mh()),t,e)}async function $N(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await Uh(Fh(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function YN(t){const e=af.get(t);if(e!==void 0)return e;const n=await Cl($e,t);return af.set(t,n),n}function Tu(){return of??(of=gh($e)),of}function zN(){return uf??(uf=ag($e)),uf}function WN(){return lf??(lf=ig($e)),lf}async function GN(t){const[e,n]=await Promise.all([YN(t),Tu()]);return Xr(e,n)}function bv(){return Pl??(Pl=bh($e)),Pl}async function KN(){const[t,e]=await Promise.all([bv(),Tu()]);return t===void 0?[]:Xr(t,e).filter(n=>n.name!=="title")}const mf=`${st.templates}/${bu}.html`;function fk(){return $e.exists(mf)}const VN=`<!doctype html>
33
33
  <html lang="en">
34
34
  <head>
35
35
  <meta charset="utf-8" />
@@ -41,18 +41,18 @@ ${await yN(d,e)}
41
41
  <slot></slot>
42
42
  </body>
43
43
  </html>
44
- `;async function hk(){if(await $e.exists(mf))return;const t=await Ge(`/api/write?path=${encodeURIComponent(mf)}`,{method:"POST",body:VN});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);$e.clear(),Pl=void 0}async function pk(){const t=await Tu();return[...t.entries()].map(([e,n])=>({tag:e,props:Xr(n,t).map(r=>r.name)}))}async function Ip(t){const e=await $e.readText(`${st.content}/${t}.json`);return tc(JSON.parse(e))}async function _v(t,e){const n=`${st.content}/${t}.json`,r=await Ge(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);$e.invalidate(n),so()}function XN(){return n3($e)}async function QN(){const t=await Ge("/api/publish/plan");if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");if(!t.ok)throw new Error(`Could not plan the publish (${t.status}).`);return await t.json()}async function ZN(){const t=await Ge("/api/publish",{method:"POST"});if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{ok:!0,written:e.written??0,...e.summary!==void 0&&{summary:e.summary}};if(t.status===422)return{ok:!1,errors:e.errors??["Validation failed."],...e.summary!==void 0&&{summary:e.summary}};throw new Error(`Publish failed (${t.status}).`)}async function JN(t){const e=await Ge(`/api/publish/progress?since=${t}`);return e.ok?await e.json():{running:!1,total:t,events:[]}}async function e6(){const t=await Ge("/api/scaffold",{method:"POST"});if(t.status===404)throw new Error("Scaffolding runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{created:e.created??[],skipped:e.skipped??[]};throw t.status===409?new Error("This site already has content, scaffolding is only for an empty site."):t.status===403?new Error("Only an admin can scaffold a starter site."):new Error(e.error??`Scaffold failed (${t.status})`)}async function Cp(t,e){const n=await $e.readText(`${st.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await _v(t,`${JSON.stringify(r,null,2)}
45
- `)}async function t6(t,e){return(await $e.list(mN(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function n6(t){return t6(t,e=>!pN(e))}async function Hh(t,e){const n=cv(e.name),r=lv(n),s=await Ge(`/api/write?path=${encodeURIComponent(Gi(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return _u(),r}async function r6(t,e){try{await Ml(Gi(t,e))}catch{}}async function gf(t){const e=[],n=async(r,s)=>{for(const a of await $e.list(r)){const i=s===""?a.name:`${s}/${a.name}`;a.kind==="dir"?await n(`${r}/${a.name}`,i):a.name.endsWith(".html")&&e.push(i.slice(0,-5))}};return await n(t,""),e.sort()}async function s6(){const t=[],e=async(n,r)=>{for(const s of await $e.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):t.push(a)}};return await e(st.public,""),t.sort()}const a6=["templates","components","public"],Tv=".gitkeep";function Av(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function qh(t){const e=Av(t),n=[],r=[];for(const s of await $e.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===Tv)continue;if(e){if(t===st.templates&&s.name===`${bu}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else r.push({kind:"file",name:s.name,path:a})}}return n.sort((s,a)=>s.name.localeCompare(a.name)),r.sort((s,a)=>s.name.localeCompare(a.name)),[...n,...r]}async function mk(t){const e=[t],n=async r=>{for(const s of await qh(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function gk(t,e){const n=e.split("/").map(i=>_s(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${Tv}`;if(await $e.exists(s))throw new Error(`"${r}" already exists.`);const a=await Ge(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return $e.clear(),r}async function vk(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(Av(t)?T6(t,r):Wa(t,r)),r)}async function bk(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");return r===t?t:(await Wa(t,r),r)}function i6(t,e){const n=t.slice(t.lastIndexOf("/")+1);return n===e?4:n.startsWith(e)?3:n.includes(e)?2:t.includes(e)?1:0}async function Ek(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([gf("templates"),gf("components"),s6()]);return[...n.map(i=>({label:i,path:`templates/${i}.html`,root:"templates"})),...r.map(i=>({label:i,path:`components/${i}.html`,root:"components"})),...s.map(i=>({label:i,path:`public/${i}`,root:"public"}))].map(i=>({hit:i,score:i6(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,o)=>o.score-i.score||i.hit.label.localeCompare(o.hit.label)).slice(0,30).map(i=>i.hit)}function _k(t){return $e.readText(t)}async function o6(t){const e=await Ge(`/api/read?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Not found: ${t}`);return URL.createObjectURL(await e.blob())}async function u6(t,e){return o6(Gi(t,e))}async function Tk(t){if(await $e.exists(t))throw new Error(`"${t}" already exists.`);const e=await Ge(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`);$e.clear()}async function Ak(t,e){const n=`${t}/${cv(e.name)}`,r=await Ge(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",body:await e.arrayBuffer()});if(!r.ok)throw new Error(`Upload failed (${r.status})`);return $e.clear(),_u(),n}async function yv(t,e,n){const r=`${st.content}/${t}.json`;if(await $e.exists(r))throw new Error(`"${t}" already exists.`);const s={title:e,isPublished:!1};n!==void 0&&n!==""&&(s.template=n),s.fields={};const a=await Ge(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
44
+ `;async function hk(){if(await $e.exists(mf))return;const t=await Ge(`/api/write?path=${encodeURIComponent(mf)}`,{method:"POST",body:VN});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);$e.clear(),Pl=void 0}async function pk(){const t=await Tu();return[...t.entries()].map(([e,n])=>({tag:e,props:Xr(n,t).map(r=>r.name)}))}async function Ip(t){const e=await $e.readText(`${st.content}/${t}.json`);return tc(JSON.parse(e))}async function Ev(t,e){const n=`${st.content}/${t}.json`,r=await Ge(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);$e.invalidate(n),so()}function XN(){return n3($e)}async function QN(){const t=await Ge("/api/publish/plan");if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");if(!t.ok)throw new Error(`Could not plan the publish (${t.status}).`);return await t.json()}async function ZN(){const t=await Ge("/api/publish",{method:"POST"});if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{ok:!0,written:e.written??0,...e.summary!==void 0&&{summary:e.summary}};if(t.status===422)return{ok:!1,errors:e.errors??["Validation failed."],...e.summary!==void 0&&{summary:e.summary}};throw new Error(`Publish failed (${t.status}).`)}async function JN(t){const e=await Ge(`/api/publish/progress?since=${t}`);return e.ok?await e.json():{running:!1,total:t,events:[]}}async function e6(){const t=await Ge("/api/scaffold",{method:"POST"});if(t.status===404)throw new Error("Scaffolding runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{created:e.created??[],skipped:e.skipped??[]};throw t.status===409?new Error("This site already has content, scaffolding is only for an empty site."):t.status===403?new Error("Only an admin can scaffold a starter site."):new Error(e.error??`Scaffold failed (${t.status})`)}async function Cp(t,e){const n=await $e.readText(`${st.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await Ev(t,`${JSON.stringify(r,null,2)}
45
+ `)}async function t6(t,e){return(await $e.list(mN(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function n6(t){return t6(t,e=>!pN(e))}async function Hh(t,e){const n=lv(e.name),r=uv(n),s=await Ge(`/api/write?path=${encodeURIComponent(Gi(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return _u(),r}async function r6(t,e){try{await Ml(Gi(t,e))}catch{}}async function gf(t){const e=[],n=async(r,s)=>{for(const a of await $e.list(r)){const i=s===""?a.name:`${s}/${a.name}`;a.kind==="dir"?await n(`${r}/${a.name}`,i):a.name.endsWith(".html")&&e.push(i.slice(0,-5))}};return await n(t,""),e.sort()}async function s6(){const t=[],e=async(n,r)=>{for(const s of await $e.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):t.push(a)}};return await e(st.public,""),t.sort()}const a6=["templates","components","public"],_v=".gitkeep";function Tv(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function qh(t){const e=Tv(t),n=[],r=[];for(const s of await $e.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===_v)continue;if(e){if(t===st.templates&&s.name===`${bu}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else r.push({kind:"file",name:s.name,path:a})}}return n.sort((s,a)=>s.name.localeCompare(a.name)),r.sort((s,a)=>s.name.localeCompare(a.name)),[...n,...r]}async function mk(t){const e=[t],n=async r=>{for(const s of await qh(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function gk(t,e){const n=e.split("/").map(i=>_s(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${_v}`;if(await $e.exists(s))throw new Error(`"${r}" already exists.`);const a=await Ge(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return $e.clear(),r}async function vk(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(Tv(t)?T6(t,r):Wa(t,r)),r)}async function bk(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");return r===t?t:(await Wa(t,r),r)}function i6(t,e){const n=t.slice(t.lastIndexOf("/")+1);return n===e?4:n.startsWith(e)?3:n.includes(e)?2:t.includes(e)?1:0}async function Ek(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([gf("templates"),gf("components"),s6()]);return[...n.map(i=>({label:i,path:`templates/${i}.html`,root:"templates"})),...r.map(i=>({label:i,path:`components/${i}.html`,root:"components"})),...s.map(i=>({label:i,path:`public/${i}`,root:"public"}))].map(i=>({hit:i,score:i6(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,o)=>o.score-i.score||i.hit.label.localeCompare(o.hit.label)).slice(0,30).map(i=>i.hit)}function _k(t){return $e.readText(t)}async function o6(t){const e=await Ge(`/api/read?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Not found: ${t}`);return URL.createObjectURL(await e.blob())}async function u6(t,e){return o6(Gi(t,e))}async function Tk(t){if(await $e.exists(t))throw new Error(`"${t}" already exists.`);const e=await Ge(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`);$e.clear()}async function Ak(t,e){const n=`${t}/${lv(e.name)}`,r=await Ge(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",body:await e.arrayBuffer()});if(!r.ok)throw new Error(`Upload failed (${r.status})`);return $e.clear(),_u(),n}async function Av(t,e,n){const r=`${st.content}/${t}.json`;if(await $e.exists(r))throw new Error(`"${t}" already exists.`);const s={title:e,isPublished:!1};n!==void 0&&n!==""&&(s.template=n),s.fields={};const a=await Ge(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
46
46
  `});if(!a.ok)throw new Error(`Create failed (${a.status})`);$e.clear(),so()}function l6(t){return $e.exists(`${st.content}/${t}.json`)}async function c6(t,e){const n=e.split("/").map(l=>({raw:l.trim(),slug:_s(l)})).filter(l=>l.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(l=>l.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${st.content}/${a}/${Bh}`;if(await $e.exists(i))throw new Error(`"${a}" already exists.`);const o=await Ge(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
47
47
  `});if(!o.ok)throw new Error(`Create folder failed (${o.status})`);return $e.clear(),so(),a}function Vo(t){return t===""?`${st.content}/_sort.json`:`${st.content}/${t}/_sort.json`}async function jh(t){try{const e=JSON.parse(await $e.readText(Vo(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function d6(t){const e=await jh(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function f6(t,e){const n=await jh(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await Ge(`/api/write?path=${encodeURIComponent(Vo(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
48
48
  `});if(!r.ok)throw new Error(`Save failed (${r.status})`);$e.invalidate(Vo(t))}async function h6(t,e){const n=await jh(t);n.order=[...e];const r=await Ge(`/api/write?path=${encodeURIComponent(Vo(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
49
49
  `});if(!r.ok)throw new Error(`Reorder failed (${r.status})`);$e.invalidate(Vo(t))}async function yk(t,e){const n=await Ge(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);$e.invalidate(t),t.startsWith("public/")&&_u(),$h(t);const r=await n.json().catch(()=>({}));return{...r.stamped!==void 0&&{stamped:r.stamped},...r.stampIncomplete===!0&&{stampIncomplete:!0},...r.schemaDelta!==void 0&&{schemaDelta:r.schemaDelta}}}function $h(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&(af.clear(),of=void 0,Pl=void 0,kh.bump()),t.some(n=>n.startsWith(`${st.components}/`))&&(uf=void 0,lf=void 0),t.some(n=>n.startsWith(`${st.content}/`))&&so()}function Ws(t){return`${st.content}/${t}.json`}function yi(t){return`${st.content}/${t}`}async function Ml(t){const e=await Ge(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);$e.clear(),_u(),$h(t)}async function Wa(t,e){const n=await Ge(`/api/rename?from=${encodeURIComponent(t)}&to=${encodeURIComponent(e)}`,{method:"POST"});if(!n.ok){const r=n.status===409?"a file or folder with that name already exists":`status ${n.status}`;throw new Error(`Rename failed, ${r}.`)}$e.clear(),_u(),$h(t,e)}const p6=/assets\/[A-Za-z0-9._-]+/g;async function m6(t,e,n){const r=Gi(t,n),s=Gi(e,n);if(r===s)return;const a=await Ge(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await Ge(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function g6(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;const a=e===""?r:`${e}/${r}`;if(await $e.exists(Ws(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await $e.readText(Ws(t));for(const o of new Set(i.match(p6)??[]))await m6(s,e,o);return await Wa(Ws(t),Ws(a)),so(),a}async function v6(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");const a=e===""?r:`${e}/${r}`;if(await $e.exists(yi(a)))throw new Error(`A folder named "${r}" already exists there.`);return await Wa(yi(t),yi(a)),so(),a}const vf=`${st.content}/_redirects.json`;async function b6(){try{const t=JSON.parse(await $e.readText(vf));return Array.isArray(t)?t:[]}catch{return[]}}async function $u(t,e){if(t!==e)try{const n=await b6();n.push({from:t,to:e});const r=await Ge(`/api/write?path=${encodeURIComponent(vf)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
50
50
  `});if(!r.ok)throw new Error(`status ${r.status}`);$e.invalidate(vf)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const bf=`${st.content}/_site.json`;async function E6(){try{const t=JSON.parse(await $e.readText(bf));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function _6(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
51
- `,r=await Ge(`/api/write?path=${encodeURIComponent(bf)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`);$e.invalidate(bf)}const Nv=["html","css","js"];async function Nk(t){const e=t.replace(/\.html$/,"");await Promise.all(Nv.map(n=>Ml(`${e}.${n}`)))}async function T6(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of Nv){const a=`${n}.${s}`;await $e.exists(a)&&await Wa(a,`${r}.${s}`)}}async function A6(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await Gy($e,t,{draft:e,media:EN(n)});return r===void 0?void 0:sf(r.html,Ef)}async function Ef(t){const e=df.get(t);if(e!==void 0)return e;const n=t.startsWith("/api/")?t:uv(`public/${t.slice(1)}`);try{const r=await Ge(n);if(!r.ok)return;const s=new Uint8Array(await r.arrayBuffer()),i={contentType:r.headers.get("content-type")??(t.startsWith("/api/")?"":dT(t)),bytes:s};return df.set(t,i),i}catch{return}}async function wk(t){return Xr(t,await Tu())}async function Sk(t,e,n){const[r,s,a,i,o]=await Promise.all([Tu(),zN(),WN(),Mh(),Ev()]),l=Xg(i),d=RN(o),h=p=>({...CN(IN(p),n),...LN(p,n)});if(ON(t)){const p=xN(t),v=new Map(r).set(p,e.html),b=Lp(new Map(s),p,e.css),E=Lp(new Map(a),p,e.js),_=Xr(e.html,v);return sf(zd({template:DN(p,_,d),scope:h(_),components:v,componentStyles:b,componentScripts:E,context:l,media:wp()}),Ef)}const g=Xr(e.html,r),f=zd({template:e.html,scope:h(g),components:r,componentStyles:s,componentScripts:a,context:l,media:wp(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}});return sf(gv({htmlAttrs:d.htmlAttrs,headStyles:d.headStyles,title:"Template preview",body:f}),Ef)}function Lp(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function y6(t,e){if(e==="title")return t.title;if(e==="created")return t.created??"";if(e==="published")return t.published??"";if(e==="updated")return t.updated??"";const n=t.fields[e];return n==null?"":Array.isArray(n)?n.some(r=>r!==null&&typeof r=="object")?JSON.stringify(n):n.map(String).join(", "):String(n)}const wv="nanoesis:tree-expanded";function N6(){try{const t=JSON.parse(localStorage.getItem(wv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const Ns=ct({}),Ni=ct({}),Ki=ct(N6());function Sv(){const t=Object.keys(Ki).filter(e=>Ki[e]);localStorage.setItem(wv,JSON.stringify(t))}function _i(t){return Ns[t]}function w6(t){return Ni[t]===!0}function fi(t){return t===""||Ki[t]===!0}async function dc(t){if(!(Ns[t]!==void 0||Ni[t])){Ni[t]=!0;try{Ns[t]=await vv(t)}finally{Ni[t]=!1}}}async function xn(t){Ni[t]=!0;try{Ns[t]=await vv(t)}finally{Ni[t]=!1}}async function S6(){await Promise.all(Object.keys(Ns).map(t=>xn(t)))}function _f(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function Iv(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function Tf(t,e,n){const r=Ns[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(Ns[t]={...r,entries:a})}function I6(t,e){const n=Iv(t);if(n!==null){n!==""&&Tf(_f(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}Tf(_f(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function C6(t,e){Iv(t)===null&&Tf(_f(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function L6(t,e){const n=Ns[t];if(n===void 0)return;const r=new Map(n.entries.map(a=>[a.slug,a])),s=[];for(const a of e){const i=r.get(a);i!==void 0&&(s.push(i),r.delete(a))}for(const a of r.values())s.push(a);Ns[t]={...n,entries:s}}async function Op(t){fi(t)?Ki[t]=!1:(Ki[t]=!0,await dc(t)),Sv()}async function vo(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ki[n]=!0,await dc(n);Sv()}const Cv="nanoesis:dev-tree-expanded";function O6(){try{const t=JSON.parse(localStorage.getItem(Cv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return Object.fromEntries(a6.map(t=>[t,!0]))}const Xo=ct({}),wi=ct({}),Ua=ct(O6());function Lv(){const t=Object.keys(Ua).filter(e=>Ua[e]);localStorage.setItem(Cv,JSON.stringify(t))}function Ik(t){return Xo[t]}function Ck(t){return wi[t]===!0}function Lk(t){return Ua[t]===!0}async function Ov(t){if(!(Xo[t]!==void 0||wi[t])){wi[t]=!0;try{Xo[t]=await qh(t)}finally{wi[t]=!1}}}async function x6(t){wi[t]=!0;try{Xo[t]=await qh(t)}finally{wi[t]=!1}}async function R6(){await Promise.all(Object.keys(Xo).map(t=>x6(t)))}async function Ok(t){Ua[t]?Ua[t]=!1:(Ua[t]=!0,await Ov(t)),Lv()}let Or=Q(null),Yh=Q(null);function xk(){return u(Or)}function Rk(){return u(Yh)}function Dk(t,e){T(Or,{entry:t,parent:e},!0)}function kk(t){T(Yh,t,!0)}function Pk(){T(Or,null),T(Yh,null)}const D6=new Set(["templates/home.html"]);function xv(t){return D6.has(t)}function Mk(t,e){if(u(Or)===null||e!=="dir"||xv(u(Or).entry.path))return!1;const n=u(Or).entry.path;return t!==n&&u(Or).parent!==t&&!t.startsWith(`${n}/`)&&n.split("/")[0]===t.split("/")[0]}function Bk(t){return u(Or)===null||xv(u(Or).entry.path)?!1:u(Or).parent!==t&&u(Or).entry.path.split("/")[0]===t}async function Fk(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ua[n]=!0,await Ov(n);Lv()}const k6=9e4;function P6(t){if(typeof t!="object"||t===null)return{changed:!1,added:0,removed:0};const e=t,n=typeof e.added=="number"?e.added:0,r=typeof e.removed=="number"?e.removed:0;return{changed:n>0||r>0,added:n,removed:r}}function M6(t){const e=t.intervalMs??k6;let n=null,r=!1;async function s(){if(!(r||!t.isVisible())){r=!0;try{const a=await t.reconcileOnce();a.changed&&t.onChanged(a)}catch{}finally{r=!1}}}return{start(){n===null&&(n=setInterval(()=>void s(),e))},stop(){n!==null&&(clearInterval(n),n=null)}}}let Kt=Q(null);const Yu={get pending(){return u(Kt)}};function Bl(t,e={}){return new Promise(n=>{T(Kt,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function Bo(t,e={}){return new Promise(n=>{T(Kt,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function Uk(t,e,n={}){return new Promise(r=>{T(Kt,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function B6(t,e){return new Promise(n=>{T(Kt,{kind:"decide",message:t,options:e,resolve:n},!0)})}function Fn(t,e={}){return new Promise(n=>{T(Kt,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Xc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="confirm"&&(u(Kt).resolve(t),T(Kt,null))}function Qc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="prompt"&&(u(Kt).resolve(t),T(Kt,null))}function Zc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="select"&&(u(Kt).resolve(t),T(Kt,null))}function zu(t){var e;((e=u(Kt))==null?void 0:e.kind)==="decide"&&(u(Kt).resolve(t),T(Kt,null))}function xp(){var t;((t=u(Kt))==null?void 0:t.kind)==="alert"&&(u(Kt).resolve(),T(Kt,null))}let Rp=Q(null);const Wu=ct({}),Af={get active(){return u(Rp)},get hasDirty(){return Object.keys(Wu).length>0},isDirty(t){return Wu[t]===!0},setActive(t){T(Rp,t,!0)},setDirty(t,e){e?Wu[t]=!0:delete Wu[t]}};async function Rv(t){const e=Af.active;if(e===null||!Af.isDirty(e.key))return!0;const n=t===void 0?"":`
51
+ `,r=await Ge(`/api/write?path=${encodeURIComponent(bf)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`);$e.invalidate(bf)}const yv=["html","css","js"];async function Nk(t){const e=t.replace(/\.html$/,"");await Promise.all(yv.map(n=>Ml(`${e}.${n}`)))}async function T6(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of yv){const a=`${n}.${s}`;await $e.exists(a)&&await Wa(a,`${r}.${s}`)}}async function A6(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await Gy($e,t,{draft:e,media:EN(n)});return r===void 0?void 0:sf(r.html,Ef)}async function Ef(t){const e=df.get(t);if(e!==void 0)return e;const n=t.startsWith("/api/")?t:ov(`public/${t.slice(1)}`);try{const r=await Ge(n);if(!r.ok)return;const s=new Uint8Array(await r.arrayBuffer()),i={contentType:r.headers.get("content-type")??(t.startsWith("/api/")?"":cT(t)),bytes:s};return df.set(t,i),i}catch{return}}async function wk(t){return Xr(t,await Tu())}async function Sk(t,e,n){const[r,s,a,i,o]=await Promise.all([Tu(),zN(),WN(),Mh(),bv()]),l=Vg(i),d=RN(o),f=p=>({...CN(IN(p),n),...LN(p,n)});if(ON(t)){const p=xN(t),v=new Map(r).set(p,e.html),_=Lp(new Map(s),p,e.css),E=Lp(new Map(a),p,e.js),b=Xr(e.html,v);return sf(zd({template:DN(p,b,d),scope:f(b),components:v,componentStyles:_,componentScripts:E,context:l,media:wp()}),Ef)}const g=Xr(e.html,r),h=zd({template:e.html,scope:f(g),components:r,componentStyles:s,componentScripts:a,context:l,media:wp(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}});return sf(mv({htmlAttrs:d.htmlAttrs,headStyles:d.headStyles,title:"Template preview",body:h}),Ef)}function Lp(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function y6(t,e){if(e==="title")return t.title;if(e==="created")return t.created??"";if(e==="published")return t.published??"";if(e==="updated")return t.updated??"";const n=t.fields[e];return n==null?"":Array.isArray(n)?n.some(r=>r!==null&&typeof r=="object")?JSON.stringify(n):n.map(String).join(", "):String(n)}const Nv="nanoesis:tree-expanded";function N6(){try{const t=JSON.parse(localStorage.getItem(Nv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const Ns=ct({}),Ni=ct({}),Ki=ct(N6());function wv(){const t=Object.keys(Ki).filter(e=>Ki[e]);localStorage.setItem(Nv,JSON.stringify(t))}function _i(t){return Ns[t]}function w6(t){return Ni[t]===!0}function fi(t){return t===""||Ki[t]===!0}async function dc(t){if(!(Ns[t]!==void 0||Ni[t])){Ni[t]=!0;try{Ns[t]=await gv(t)}finally{Ni[t]=!1}}}async function xn(t){Ni[t]=!0;try{Ns[t]=await gv(t)}finally{Ni[t]=!1}}async function S6(){await Promise.all(Object.keys(Ns).map(t=>xn(t)))}function _f(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function Sv(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function Tf(t,e,n){const r=Ns[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(Ns[t]={...r,entries:a})}function I6(t,e){const n=Sv(t);if(n!==null){n!==""&&Tf(_f(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}Tf(_f(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function C6(t,e){Sv(t)===null&&Tf(_f(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function L6(t,e){const n=Ns[t];if(n===void 0)return;const r=new Map(n.entries.map(a=>[a.slug,a])),s=[];for(const a of e){const i=r.get(a);i!==void 0&&(s.push(i),r.delete(a))}for(const a of r.values())s.push(a);Ns[t]={...n,entries:s}}async function Op(t){fi(t)?Ki[t]=!1:(Ki[t]=!0,await dc(t)),wv()}async function vo(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ki[n]=!0,await dc(n);wv()}const Iv="nanoesis:dev-tree-expanded";function O6(){try{const t=JSON.parse(localStorage.getItem(Iv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return Object.fromEntries(a6.map(t=>[t,!0]))}const Xo=ct({}),wi=ct({}),Ua=ct(O6());function Cv(){const t=Object.keys(Ua).filter(e=>Ua[e]);localStorage.setItem(Iv,JSON.stringify(t))}function Ik(t){return Xo[t]}function Ck(t){return wi[t]===!0}function Lk(t){return Ua[t]===!0}async function Lv(t){if(!(Xo[t]!==void 0||wi[t])){wi[t]=!0;try{Xo[t]=await qh(t)}finally{wi[t]=!1}}}async function x6(t){wi[t]=!0;try{Xo[t]=await qh(t)}finally{wi[t]=!1}}async function R6(){await Promise.all(Object.keys(Xo).map(t=>x6(t)))}async function Ok(t){Ua[t]?Ua[t]=!1:(Ua[t]=!0,await Lv(t)),Cv()}let Or=Q(null),Yh=Q(null);function xk(){return u(Or)}function Rk(){return u(Yh)}function Dk(t,e){T(Or,{entry:t,parent:e},!0)}function kk(t){T(Yh,t,!0)}function Pk(){T(Or,null),T(Yh,null)}const D6=new Set(["templates/home.html"]);function Ov(t){return D6.has(t)}function Mk(t,e){if(u(Or)===null||e!=="dir"||Ov(u(Or).entry.path))return!1;const n=u(Or).entry.path;return t!==n&&u(Or).parent!==t&&!t.startsWith(`${n}/`)&&n.split("/")[0]===t.split("/")[0]}function Bk(t){return u(Or)===null||Ov(u(Or).entry.path)?!1:u(Or).parent!==t&&u(Or).entry.path.split("/")[0]===t}async function Fk(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ua[n]=!0,await Lv(n);Cv()}const k6=9e4;function P6(t){if(typeof t!="object"||t===null)return{changed:!1,added:0,removed:0};const e=t,n=typeof e.added=="number"?e.added:0,r=typeof e.removed=="number"?e.removed:0;return{changed:n>0||r>0,added:n,removed:r}}function M6(t){const e=t.intervalMs??k6;let n=null,r=!1;async function s(){if(!(r||!t.isVisible())){r=!0;try{const a=await t.reconcileOnce();a.changed&&t.onChanged(a)}catch{}finally{r=!1}}}return{start(){n===null&&(n=setInterval(()=>void s(),e))},stop(){n!==null&&(clearInterval(n),n=null)}}}let Kt=Q(null);const Yu={get pending(){return u(Kt)}};function Bl(t,e={}){return new Promise(n=>{T(Kt,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function Bo(t,e={}){return new Promise(n=>{T(Kt,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function Uk(t,e,n={}){return new Promise(r=>{T(Kt,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function B6(t,e){return new Promise(n=>{T(Kt,{kind:"decide",message:t,options:e,resolve:n},!0)})}function Fn(t,e={}){return new Promise(n=>{T(Kt,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Xc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="confirm"&&(u(Kt).resolve(t),T(Kt,null))}function Qc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="prompt"&&(u(Kt).resolve(t),T(Kt,null))}function Zc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="select"&&(u(Kt).resolve(t),T(Kt,null))}function zu(t){var e;((e=u(Kt))==null?void 0:e.kind)==="decide"&&(u(Kt).resolve(t),T(Kt,null))}function xp(){var t;((t=u(Kt))==null?void 0:t.kind)==="alert"&&(u(Kt).resolve(),T(Kt,null))}let Rp=Q(null);const Wu=ct({}),Af={get active(){return u(Rp)},get hasDirty(){return Object.keys(Wu).length>0},isDirty(t){return Wu[t]===!0},setActive(t){T(Rp,t,!0)},setDirty(t,e){e?Wu[t]=!0:delete Wu[t]}};async function xv(t){const e=Af.active;if(e===null||!Af.isDirty(e.key))return!0;const n=t===void 0?"":`
52
52
 
53
53
  ${t}`,r=await B6(`You have unsaved changes to ${e.key}. Save them, discard them, or stay on this file?${n}`,{title:"Unsaved changes",primaryLabel:"Save",secondaryLabel:"Discard",cancelLabel:"Stay",secondaryDanger:!0});if(r==="cancel")return!1;if(r==="secondary")return e.discard(),!0;try{return await e.flush(),!0}catch(s){return await Fn(`Couldn't save ${e.key}: ${s instanceof Error?s.message:String(s)}
54
54
 
55
- You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}const Dv="nanoesis-restore:",kv="nanoesis:unit-values:",Pv="nanoesis:tree-expanded",Mv="nanoesis:dev-tree-expanded";function F6(t){t.removeItem(Pv),t.removeItem(Mv);for(let e=t.length-1;e>=0;e--){const n=t.key(e);n!==null&&(n.startsWith(Dv)||n.startsWith(kv))&&t.removeItem(n)}}function Dp(t,e){t.removeItem(`${Dv}${e}`),t.removeItem(`${kv}${e}`);for(const n of[Pv,Mv]){const r=t.getItem(n);if(r!==null)try{const s=JSON.parse(r);if(!Array.isArray(s))continue;const a=s.filter(i=>typeof i=="string"&&i!==e&&!i.startsWith(`${e}/`));a.length!==s.length&&t.setItem(n,JSON.stringify(a))}catch{}}}/**
55
+ You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}const Rv="nanoesis-restore:",Dv="nanoesis:unit-values:",kv="nanoesis:tree-expanded",Pv="nanoesis:dev-tree-expanded";function F6(t){t.removeItem(kv),t.removeItem(Pv);for(let e=t.length-1;e>=0;e--){const n=t.key(e);n!==null&&(n.startsWith(Rv)||n.startsWith(Dv))&&t.removeItem(n)}}function Dp(t,e){t.removeItem(`${Rv}${e}`),t.removeItem(`${Dv}${e}`);for(const n of[kv,Pv]){const r=t.getItem(n);if(r!==null)try{const s=JSON.parse(r);if(!Array.isArray(s))continue;const a=s.filter(i=>typeof i=="string"&&i!==e&&!i.startsWith(`${e}/`));a.length!==s.length&&t.setItem(n,JSON.stringify(a))}catch{}}}/**
56
56
  * @file
57
57
  * @license @lucide/svelte v1.16.0 - ISC
58
58
  *
@@ -70,37 +70,37 @@ You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
- */const q6=Symbol("lucide-context"),j6=()=>$E(q6);var $6=D_("<svg><!><!></svg>");function un(t,e){at(e,!0);const n=j6()??{},r=Vn(e,"color",19,()=>n.color??"currentColor"),s=Vn(e,"size",19,()=>n.size??24),a=Vn(e,"strokeWidth",19,()=>n.strokeWidth??2),i=Vn(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),o=Vn(e,"iconNode",19,()=>[]),l=Jt(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),d=_e(()=>i()?Number(a())*24/Number(s()):a());var h=$6();x0(h,p=>({...U6,...p,...l,width:s(),height:s(),stroke:r(),"stroke-width":u(d),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!H6(l)&&{"aria-hidden":"true"}]);var g=y(h);St(g,17,o,zo,(p,v)=>{var b=_e(()=>cE(u(v),2));let E=()=>u(b)[0],_=()=>u(b)[1];var R=Kn(),O=tt(R);$_(O,E,!0,(B,M)=>{x0(B,()=>({..._()}))}),F(p,R)});var f=C(g);j_(f,()=>e.children??th),F(t,h),it()}function zh(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M14 17H5"}],["path",{d:"M19 7h-9"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];un(t,on({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function Y6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];un(t,on({name:"plus"},()=>n,{get iconNode(){return r}}))}function Wh(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];un(t,on({name:"x"},()=>n,{get iconNode(){return r}}))}function z6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];un(t,on({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function W6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];un(t,on({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function Bv(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];un(t,on({name:"search"},()=>n,{get iconNode(){return r}}))}function G6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}]];un(t,on({name:"house"},()=>n,{get iconNode(){return r}}))}function K6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];un(t,on({name:"link"},()=>n,{get iconNode(){return r}}))}function V6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];un(t,on({name:"external-link"},()=>n,{get iconNode(){return r}}))}function yf(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]];un(t,on({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function X6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 10v6"}],["path",{d:"M9 13h6"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];un(t,on({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}function Q6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];un(t,on({name:"upload"},()=>n,{get iconNode(){return r}}))}function Z6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 12.5 8 15l2 2.5"}],["path",{d:"m14 12.5 2 2.5-2 2.5"}]];un(t,on({name:"file-code"},()=>n,{get iconNode(){return r}}))}function kp(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];un(t,on({name:"check"},()=>n,{get iconNode(){return r}}))}function J6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];un(t,on({name:"image"},()=>n,{get iconNode(){return r}}))}function ew(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];un(t,on({name:"file-text"},()=>n,{get iconNode(){return r}}))}function tw(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05"}]];un(t,on({name:"rocket"},()=>n,{get iconNode(){return r}}))}function nw(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]];un(t,on({name:"globe"},()=>n,{get iconNode(){return r}}))}function rw(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];un(t,on({name:"triangle-alert"},()=>n,{get iconNode(){return r}}))}let Gh=Q(null),Kh=Q(null);function Ti(){return u(Gh)}function Pp(){return u(Kh)}function sw(t,e){T(Gh,{entry:t,parent:e},!0)}function Jc(t){T(Kh,t,!0)}function Ms(){T(Gh,null),T(Kh,null)}let ed=Q(null);const Nf={get target(){return u(ed)},request(t){T(ed,t,!0)},clear(){T(ed,null)}};function aw(){let t=Q("content");return{get mode(){return u(t)},set(e){T(t,e,!0)}}}const wr=aw(),iw="nanoesis-restore:";function wf(t){return`${iw}${t}`}function ow(t,e,n){t.getItem(wf(e))===null&&t.setItem(wf(e),JSON.stringify(n))}function uw(t,e){const n=t.getItem(wf(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function lw(){let t=Q("saved"),e=null;return{get state(){return u(t)},get canRetry(){return u(t)==="error"&&e!==null},saving(){T(t,"saving")},saved(){T(t,"saved"),e=null},failed(n){T(t,"error"),e=n},retry(){e==null||e()},reset(){T(t,"saved"),e=null}}}const Fs=lw(),cw=new Set(["title","created","published","updated"]);function dw(t){let e;try{e=JSON.parse(t===""?"[]":t)}catch{return[]}if(!Array.isArray(e))return[];const n=[];for(const r of e){if(r===null||typeof r!="object")continue;const s=r,a=typeof s.name=="string"?s.name.trim():"";if(a==="")continue;const i={name:a};typeof s.user=="string"&&s.user!==""&&(i.user=s.user),typeof s.href=="string"&&s.href!==""&&(i.href=s.href),n.push(i)}return n}function fw(t,e,n){if(t.type==="authors")return dw(n);if(t.multiple||Array.isArray(e))return n.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(typeof e=="number"){const r=Number(n);return Number.isFinite(r)?r:n}return typeof e=="boolean"?n==="true":n}function hw(t){return t===""||Array.isArray(t)&&t.length===0}function Mp(t,e,n,r=t.isPublished){const s={...t.fields},a={title:t.title,created:t.created,published:t.published,updated:t.updated};for(const o of e){const l=n[o.name]??"";if(cw.has(o.name)){a[o.name]=o.name==="title"?l:l||void 0;continue}const d=fw(o,t.fields[o.name],l);hw(d)?delete s[o.name]:s[o.name]=d}const i={};return t.template!==void 0&&(i.template=t.template),i.title=a.title,i.isPublished=r,a.created!==void 0&&(i.created=a.created),a.published!==void 0&&(i.published=a.published),a.updated!==void 0&&(i.updated=a.updated),i.fields=s,`${JSON.stringify(i,null,2)}
74
- `}function Sf(t,e,n){if(e<0||e>=t.length)return[...t];const r=[...t],s=Math.max(0,Math.min(r.length-1,n)),[a]=r.splice(e,1);return r.splice(s,0,a),r}let pw=0;var mw=z('<li draggable="true"><span class="grip svelte-5hnbr8" aria-hidden="true"><!></span> <span class="name svelte-5hnbr8"> </span> <button type="button" class="remove svelte-5hnbr8"><!></button></li>'),gw=z('<ul class="pills svelte-5hnbr8"></ul>'),vw=z('<li role="option"> </li>'),bw=z('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),Ew=z('<div class="authors svelte-5hnbr8" role="group"><!> <div class="add svelte-5hnbr8"><input type="text" class="add-input svelte-5hnbr8" placeholder="Add an author…" autocomplete="off" role="combobox" aria-autocomplete="list"/> <!></div></div>');function _w(t,e){at(e,!0);function n(K){if(K.trim()==="")return[];try{const te=JSON.parse(K);return Array.isArray(te)?te.flatMap(fe=>{if(fe===null||typeof fe!="object")return[];const me=fe,ge=typeof me.name=="string"?me.name:"";return ge.trim()===""?[]:[{name:ge,...typeof me.user=="string"&&me.user!==""?{user:me.user}:{}}]}):[]}catch{return[]}}const r=_e(()=>n(e.value)),s=`authors-${++pw}`;let a=Q(ct([])),i=Q(""),o=Q(!1),l=Q(0),d=Q(void 0),h=Q(null),g=Q(null);Rt(()=>{MN().then(K=>T(a,K,!0))});const f=_e(()=>new Map(u(a).map(K=>[K.user,K.name]))),p=_e(()=>new Set(u(r).map(K=>K.user).filter(K=>K!==void 0)));function v(K){return K.user!==void 0?u(f).get(K.user)??K.name:K.name}const b=_e(()=>{const K=u(i).trim().toLowerCase();return K===""?[]:u(a).filter(te=>!u(p).has(te.user)&&te.name.toLowerCase().includes(K)).slice(0,6)}),E=_e(()=>u(o)&&u(i).trim()!==""),_=_e(()=>u(b).length),R=_e(()=>u(E)?u(l)<u(b).length?`${s}-opt-${u(l)}`:`${s}-guest`:void 0);function O(K){e.onchange(K.length===0?"":JSON.stringify(K))}function B(K){u(p).has(K.user)||(O([...u(r),{name:K.name,user:K.user}]),T(i,""))}function M(K){const te=K.trim();te!==""&&(O([...u(r),{name:te}]),T(i,""))}function J(){const K=u(b)[u(l)];K!==void 0?B(K):M(u(i))}function H(){var K,te;(te=(K=u(d))==null?void 0:K.children[u(l)])==null||te.scrollIntoView({block:"nearest"})}function G(K){if(!u(E)){K.key==="Enter"&&(K.preventDefault(),M(u(i)));return}const te=u(b).length+1;K.key==="ArrowDown"?(K.preventDefault(),T(l,(u(l)+1)%te),H()):K.key==="ArrowUp"?(K.preventDefault(),T(l,(u(l)-1+te)%te),H()):K.key==="Enter"?(K.preventDefault(),J()):K.key==="Escape"&&(K.preventDefault(),T(i,""))}function X(K){O(u(r).filter((te,fe)=>fe!==K))}function ee(K,te){var fe;T(h,K,!0),(fe=te.dataTransfer)==null||fe.setData("text/plain",String(K)),te.dataTransfer&&(te.dataTransfer.effectAllowed="move")}function A(K,te){u(h)!==null&&(te.preventDefault(),T(g,K,!0))}function j(K){u(h)!==null&&u(h)!==K&&O(Sf(u(r),u(h),K)),T(h,null),T(g,null)}function w(){T(h,null),T(g,null)}var S=Ew(),x=y(S);{var k=K=>{var te=gw();St(te,21,()=>u(r),zo,(fe,me,ge)=>{var Le=mw();let de;var ve=y(Le),Ie=y(ve);yf(Ie,{size:14});var se=C(ve,2),he=y(se),Ae=C(se,2),Ce=y(Ae);Wh(Ce,{size:14,"aria-hidden":"true"}),re((Me,ke)=>{de=Ve(Le,1,"pill svelte-5hnbr8",null,de,{guest:u(me).user===void 0,dragging:u(h)===ge,over:u(g)===ge&&u(h)!==ge}),Ee(se,"title",u(me).user??"Guest"),ae(he,Me),Ee(Ae,"aria-label",ke)},[()=>v(u(me)),()=>`Remove ${v(u(me))}`]),He("dragstart",Le,Me=>ee(ge,Me)),He("dragover",Le,Me=>A(ge,Me)),He("drop",Le,()=>j(ge)),He("dragend",Le,w),ie("click",Ae,()=>X(ge)),F(fe,Le)}),F(K,te)};ce(x,K=>{u(r).length>0&&K(k)})}var W=C(x,2),$=y(W),Y=C($,2);{var U=K=>{var te=bw(),fe=y(te);St(fe,19,()=>u(b),de=>de.user,(de,ve,Ie)=>{var se=vw();let he;var Ae=y(se);re(()=>{Ee(se,"id",`${s}-opt-${u(Ie)}`),he=Ve(se,1,"option svelte-5hnbr8",null,he,{active:u(Ie)===u(l)}),Ee(se,"aria-selected",u(Ie)===u(l)),ae(Ae,u(ve).name)}),ie("click",se,()=>B(u(ve))),He("mouseenter",se,()=>T(l,u(Ie),!0)),F(de,se)});var me=C(fe,2);let ge;var Le=y(me);mn(te,de=>T(d,de),()=>u(d)),re(de=>{Ee(te,"id",`${s}-listbox`),Ee(me,"id",`${s}-guest`),ge=Ve(me,1,"option guest-option svelte-5hnbr8",null,ge,{active:u(l)===u(_)}),Ee(me,"aria-selected",u(l)===u(_)),ae(Le,`Add “${de??""}” as a guest`)},[()=>u(i).trim()]),ie("click",me,()=>M(u(i))),He("mouseenter",me,()=>T(l,u(_),!0)),F(K,te)};ce(Y,K=>{u(E)&&K(U)})}re(()=>{Ee(S,"aria-labelledby",e.labelledBy),Ee($,"aria-expanded",u(E)),Ee($,"aria-controls",`${s}-listbox`),Ee($,"aria-activedescendant",u(R))}),ie("input",$,()=>T(l,0)),ie("keydown",$,G),He("focus",$,()=>{T(o,!0),T(l,0)}),He("blur",$,()=>setTimeout(()=>T(o,!1),120)),wt($,()=>u(i),K=>T(i,K)),F(t,S),it()}Tt(["click","input","keydown"]);var Tw=z('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),Aw=z('<p class="empty svelte-1nm0yno">No file selected.</p>'),yw=z('<li class="hint svelte-1nm0yno">Loading…</li>'),Nw=z('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),ww=z('<li><button type="button"> </button></li>'),Sw=z('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),Iw=z('<p class="error svelte-1nm0yno" role="alert"> </p>'),Cw=z('<div class="file-field svelte-1nm0yno" role="group"><!> <div class="actions svelte-1nm0yno"><button type="button" class="action svelte-1nm0yno"> </button> <label class="action upload svelte-1nm0yno">Upload… <input type="file" class="svelte-1nm0yno"/></label></div> <!> <!></div>');function Lw(t,e){at(e,!0);let n=Q(ct([])),r=Q(!1),s=Q(!1),a=!1,i=Q(null);const o=_e(()=>e.value.split("/").pop()??e.value);async function l(){T(s,!0);try{T(n,await n6(e.itemDir),!0),a=!0}finally{T(s,!1)}}function d(){T(r,!u(r)),u(r)&&!a&&l()}function h(X){var j;const ee=X.currentTarget,A=(j=ee.files)==null?void 0:j[0];ee.value="",A&&g(A)}async function g(X){T(i,null);try{e.onchange(await Hh(e.itemDir,X)),a=!1,u(r)&&await l()}catch(ee){T(i,ee instanceof Error?ee.message:String(ee),!0)}}var f=Cw(),p=y(f);{var v=X=>{var ee=Tw(),A=y(ee),j=y(A),w=C(A,2);re(S=>{Ee(A,"href",S),ae(j,u(o))},[()=>cc(e.itemDir,e.value)]),ie("click",w,()=>e.onchange("")),F(X,ee)},b=X=>{var ee=Aw();F(X,ee)};ce(p,X=>{e.value?X(v):X(b,-1)})}var E=C(p,2),_=y(E),R=y(_),O=C(_,2),B=C(y(O)),M=C(E,2);{var J=X=>{var ee=Sw(),A=y(ee);{var j=x=>{var k=yw();F(x,k)},w=x=>{var k=Nw();F(x,k)},S=x=>{var k=Kn(),W=tt(k);St(W,16,()=>u(n),$=>$,($,Y)=>{const U=_e(()=>lv(Y));var K=ww(),te=y(K);let fe;var me=y(te);re(()=>{fe=Ve(te,1,"file svelte-1nm0yno",null,fe,{selected:e.value===u(U)}),Ee(te,"aria-pressed",e.value===u(U)),ae(me,Y)}),ie("click",te,()=>e.onchange(u(U))),F($,K)}),F(x,k)};ce(A,x=>{u(s)?x(j):u(n).length===0?x(w,1):x(S,-1)})}F(X,ee)};ce(M,X=>{u(r)&&X(J)})}var H=C(M,2);{var G=X=>{var ee=Iw(),A=y(ee);re(()=>ae(A,u(i))),F(X,ee)};ce(H,X=>{u(i)&&X(G)})}re(()=>{Ee(f,"aria-labelledby",e.labelledBy),Ee(_,"aria-expanded",u(r)),ae(R,u(r)?"Hide files":"Choose from files")}),ie("click",_,d),ie("change",B,h),F(t,f),it()}Tt(["click","change"]);var Ow=z('<div class="preview svelte-s6anrr"><img class="preview-img svelte-s6anrr" alt=""/> <div class="preview-meta svelte-s6anrr"><span class="filename svelte-s6anrr"> </span> <div class="row svelte-s6anrr"><label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label> <button type="button" class="link svelte-s6anrr">Remove</button></div></div></div>'),xw=z('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),Rw=z('<p class="error svelte-s6anrr" role="alert"> </p>'),Dw=z('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function kw(t,e){at(e,!0);let n=Q(!1),r=Q(null),s=Q("");Rt(()=>{const p=e.value;if(p===""){T(s,"");return}if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(p)){T(s,p,!0);return}let v=null,b=!1;return u6(e.itemDir,p).then(E=>{if(b){URL.revokeObjectURL(E);return}v=E,T(s,E,!0)}).catch(()=>{b||T(s,"")}),()=>{b=!0,v!==null&&URL.revokeObjectURL(v)}});function a(p){var E;const v=p.currentTarget,b=(E=v.files)==null?void 0:E[0];v.value="",b&&i(b)}async function i(p){T(r,null),T(n,!0);try{e.onchange(await Hh(e.itemDir,p))}catch(v){T(r,v instanceof Error?v.message:String(v),!0)}finally{T(n,!1)}}var o=Dw(),l=y(o);{var d=p=>{var v=Ow(),b=y(v),E=C(b,2),_=y(E),R=y(_),O=C(_,2),B=y(O);let M;var J=y(B),H=C(J),G=C(B,2);re(()=>{Ee(b,"src",u(s)),ae(R,e.value),M=Ve(B,1,"action svelte-s6anrr",null,M,{busy:u(n)}),ae(J,`${u(n)?"Uploading…":"Replace…"} `),H.disabled=u(n)}),ie("change",H,a),ie("click",G,()=>e.onchange("")),F(p,v)},h=p=>{var v=xw();let b;var E=y(v),_=C(E);re(()=>{b=Ve(v,1,"action svelte-s6anrr",null,b,{busy:u(n)}),ae(E,`${u(n)?"Uploading…":"Upload image…"} `),_.disabled=u(n)}),ie("change",_,a),F(p,v)};ce(l,p=>{e.value?p(d):p(h,-1)})}var g=C(l,2);{var f=p=>{var v=Rw(),b=y(v);re(()=>ae(b,u(r))),F(p,v)};ce(g,p=>{u(r)&&p(f)})}re(()=>Ee(o,"aria-labelledby",e.labelledBy)),F(t,o),it()}Tt(["change","click"]);var Pw=z("<option> </option>"),Mw=z("<option>Top level</option>"),Bw=z("<option> </option>"),Fw=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Move</h3> <div class="manage svelte-wge2ya"><label class="grow svelte-wge2ya"><span class="visually-hidden svelte-wge2ya">Move to folder</span> <select class="svelte-wge2ya"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-wge2ya">Move</button></div></div>'),Uw=z('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),Hw=z('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),qw=z(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
75
- heading at the top of the form.</p>`),jw=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),$w=z('<dialog aria-label="Edit item" class="svelte-wge2ya"><form><h2 class="svelte-wge2ya">Edit item</h2> <label class="svelte-wge2ya"><span class="svelte-wge2ya">Template</span> <select class="svelte-wge2ya"></select> <span class="help svelte-wge2ya">Switching keeps any field values the new template doesn’t use.</span></label> <!> <!> <div class="actions svelte-wge2ya"><button type="button" class="ghost svelte-wge2ya">Cancel</button> <button type="submit" class="primary svelte-wge2ya">Save</button></div></form></dialog>');function Yw(t,e){at(e,!0);const n=Vn(e,"currentFolder",3,""),r=Vn(e,"folders",19,()=>[]);let s,a=Q(ct(e.templateName));const i="\0";let o=Q(i);const l=_e(()=>r().filter(M=>M!==n())),d=_e(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);Za(()=>s.showModal());function h(M){M.preventDefault(),u(a)!==e.templateName?e.onchangetemplate(u(a)):e.onclose()}var g=$w(),f=y(g),p=C(y(f),2),v=C(y(p),2);St(v,20,()=>u(d),M=>M,(M,J)=>{var H=Pw(),G=y(H),X={};re(()=>{ae(G,J),X!==(X=J)&&(H.value=(H.__value=J)??"")}),F(M,H)});var b=C(p,2);{var E=M=>{var J=Fw(),H=C(y(J),2),G=y(H),X=C(y(G),2),ee=y(X);ee.value=ee.__value=i;var A=C(ee);{var j=x=>{var k=Mw();k.value=k.__value="",F(x,k)};ce(A,x=>{n()!==""&&x(j)})}var w=C(A);St(w,16,()=>u(l),x=>x,(x,k)=>{var W=Bw(),$=y(W),Y={};re(()=>{ae($,`${k??""}/`),Y!==(Y=k)&&(W.value=(W.__value=k)??"")}),F(x,W)});var S=C(G,2);re(()=>S.disabled=u(o)===i),Ya(X,()=>u(o),x=>T(o,x)),ie("click",S,()=>e.onmove(u(o))),F(M,J)};ce(b,M=>{e.onmove&&M(E)})}var _=C(b,2);{var R=M=>{var J=jw(),H=C(y(J),2),G=y(H);{var X=S=>{var x=Uw();ie("click",x,function(...k){var W;(W=e.onrename)==null||W.apply(this,k)}),F(S,x)};ce(G,S=>{e.onrename&&S(X)})}var ee=C(G,2);{var A=S=>{var x=Hw();ie("click",x,function(...k){var W;(W=e.ondelete)==null||W.apply(this,k)}),F(S,x)};ce(ee,S=>{e.ondelete&&S(A)})}var j=C(H,2);{var w=S=>{var x=qw();F(S,x)};ce(j,S=>{e.onrename&&S(w)})}F(M,J)};ce(_,M=>{(e.onrename||e.ondelete)&&M(R)})}var O=C(_,2),B=y(O);mn(g,M=>s=M,()=>s),He("close",g,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),He("cancel",g,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),He("submit",f,h),Ya(v,()=>u(a),M=>T(a,M)),ie("click",B,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),F(t,g),it()}Tt(["click"]);let Fo=Q(null);const zw={get pending(){return u(Fo)}};function Fv(t=""){return new Promise(e=>{T(Fo,{current:t,resolve:e},!0)})}function ci(t){u(Fo)!==null&&(u(Fo).resolve(t),T(Fo,null))}const Vh="ref:";function Qo(t){return t.startsWith(Vh)}function If(t){return Qo(t)?t.slice(Vh.length):t}function Ww(t){return`${Vh}${t}`}var Gw=z('<!> <span class="target svelte-147ryxk"> </span>',1),Kw=z('<!> <span class="target svelte-147ryxk"> </span>',1),Vw=z('<span class="value svelte-147ryxk"><!></span> <button type="button" class="action svelte-147ryxk">Edit</button> <button type="button" class="action svelte-147ryxk">Clear</button>',1),Xw=z('<button type="button" class="action svelte-147ryxk">Set link…</button>'),Qw=z('<div class="link-field svelte-147ryxk" role="group"><!></div>');function Zw(t,e){at(e,!0);async function n(){const o=await Fv(e.value);o!==null&&e.onchange(o)}var r=Qw(),s=y(r);{var a=o=>{var l=Vw(),d=tt(l),h=y(d);{var g=E=>{var _=Gw(),R=tt(_);K6(R,{size:14,"aria-hidden":"true"});var O=C(R,2),B=y(O);re((M,J)=>{Ee(O,"title",M),ae(B,J)},[()=>`Page: ${If(e.value)}`,()=>If(e.value)]),F(E,_)},f=_e(()=>Qo(e.value)),p=E=>{var _=Kw(),R=tt(_);V6(R,{size:14,"aria-hidden":"true"});var O=C(R,2),B=y(O);re(()=>{Ee(O,"title",e.value),ae(B,e.value)}),F(E,_)};ce(h,E=>{u(f)?E(g):E(p,-1)})}var v=C(d,2),b=C(v,2);ie("click",v,n),ie("click",b,()=>e.onchange("")),F(o,l)},i=o=>{var l=Xw();ie("click",l,n),F(o,l)};ce(s,o=>{e.value?o(a):o(i,-1)})}re(()=>Ee(r,"aria-labelledby",e.labelledBy)),F(t,r),it()}Tt(["click"]);var Jw=z('<p class="note error svelte-1v8pkea"> </p>'),eS=z('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),tS=z('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),nS=z('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),rS=z('<section class="preview svelte-1v8pkea" aria-label="Preview"><header class="bar svelte-1v8pkea"><strong class="title svelte-1v8pkea">Preview</strong> <span class="dims svelte-1v8pkea" title="Current preview width"> </span> <button type="button" class="close svelte-1v8pkea" title="Close preview" aria-label="Close preview"><!></button></header> <div class="frame svelte-1v8pkea"><!></div></section>');function sS(t,e){at(e,!0);let n=Q(""),r=Q("loading"),s=Q(""),a=Q(0),i=Q(void 0),o={x:0,y:0};function l(){var H;try{const G=(H=u(i))==null?void 0:H.contentWindow;G&&(o={x:G.scrollX,y:G.scrollY})}catch{}}function d(){var H,G;try{(G=(H=u(i))==null?void 0:H.contentWindow)==null||G.scrollTo(o.x,o.y)}catch{}}let h;Rt(()=>{const H=e.previewItem,G=e.path;if(clearTimeout(h),H===null){T(r,"loading");return}return h=setTimeout(()=>void g(G,H),350),()=>clearTimeout(h)});async function g(H,G){try{const X=await A6(H,G);if(X===void 0){T(r,"empty");return}l(),T(n,X,!0),T(r,"ready")}catch(X){T(s,X instanceof Error?X.message:String(X),!0),T(r,"error")}}var f=rS(),p=y(f),v=C(y(p),2),b=y(v),E=C(v,2),_=y(E);Wh(_,{size:18,"aria-hidden":"true"});var R=C(p,2),O=y(R);{var B=H=>{var G=Jw(),X=y(G);re(()=>ae(X,`Couldn’t render preview: ${u(s)??""}`)),F(H,G)},M=H=>{var G=eS();F(H,G)},J=H=>{var G=nS(),X=tt(G);mn(X,j=>T(i,j),()=>u(i));var ee=C(X,2);{var A=j=>{var w=tS();F(j,w)};ce(ee,j=>{u(r)==="loading"&&j(A)})}re(()=>Ee(X,"srcdoc",u(n))),He("load",X,d),F(H,G)};ce(O,H=>{u(r)==="error"?H(B):u(r)==="empty"?H(M,1):H(J,-1)})}re(H=>ae(b,`${H??""}px`),[()=>Math.round(u(a))]),ie("click",E,function(...H){var G;(G=e.onclose)==null||G.apply(this,H)}),aT(R,"clientWidth",H=>T(a,H)),F(t,f),it()}Tt(["click"]);var Uv=typeof global=="object"&&global&&global.Object===Object&&global,aS=typeof self=="object"&&self&&self.Object===Object&&self,os=Uv||aS||Function("return this")(),na=os.Symbol,Hv=Object.prototype,iS=Hv.hasOwnProperty,oS=Hv.toString,bo=na?na.toStringTag:void 0;function uS(t){var e=iS.call(t,bo),n=t[bo];try{t[bo]=void 0;var r=!0}catch{}var s=oS.call(t);return r&&(e?t[bo]=n:delete t[bo]),s}var lS=Object.prototype,cS=lS.toString;function dS(t){return cS.call(t)}var fS="[object Null]",hS="[object Undefined]",Bp=na?na.toStringTag:void 0;function ao(t){return t==null?t===void 0?hS:fS:Bp&&Bp in Object(t)?uS(t):dS(t)}function ws(t){return t!=null&&typeof t=="object"}var Ga=Array.isArray;function oa(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function qv(t){return t}var pS="[object AsyncFunction]",mS="[object Function]",gS="[object GeneratorFunction]",vS="[object Proxy]";function Xh(t){if(!oa(t))return!1;var e=ao(t);return e==mS||e==gS||e==pS||e==vS}var td=os["__core-js_shared__"],Fp=(function(){var t=/[^.]+$/.exec(td&&td.keys&&td.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function bS(t){return!!Fp&&Fp in t}var ES=Function.prototype,_S=ES.toString;function ti(t){if(t!=null){try{return _S.call(t)}catch{}try{return t+""}catch{}}return""}var TS=/[\\^$.*+?()[\]{}|]/g,AS=/^\[object .+?Constructor\]$/,yS=Function.prototype,NS=Object.prototype,wS=yS.toString,SS=NS.hasOwnProperty,IS=RegExp("^"+wS.call(SS).replace(TS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CS(t){if(!oa(t)||bS(t))return!1;var e=Xh(t)?IS:AS;return e.test(ti(t))}function LS(t,e){return t==null?void 0:t[e]}function ni(t,e){var n=LS(t,e);return CS(n)?n:void 0}var Cf=ni(os,"WeakMap"),Up=Object.create,OS=(function(){function t(){}return function(e){if(!oa(e))return{};if(Up)return Up(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function xS(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function RS(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var DS=800,kS=16,PS=Date.now;function MS(t){var e=0,n=0;return function(){var r=PS(),s=kS-(r-n);if(n=r,s>0){if(++e>=DS)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function BS(t){return function(){return t}}var Fl=(function(){try{var t=ni(Object,"defineProperty");return t({},"",{}),t}catch{}})(),FS=Fl?function(t,e){return Fl(t,"toString",{configurable:!0,enumerable:!1,value:BS(e),writable:!0})}:qv,US=MS(FS);function HS(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var qS=9007199254740991,jS=/^(?:0|[1-9]\d*)$/;function jv(t,e){var n=typeof t;return e=e??qS,!!e&&(n=="number"||n!="symbol"&&jS.test(t))&&t>-1&&t%1==0&&t<e}function Qh(t,e,n){e=="__proto__"&&Fl?Fl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Au(t,e){return t===e||t!==t&&e!==e}var $S=Object.prototype,YS=$S.hasOwnProperty;function $v(t,e,n){var r=t[e];(!(YS.call(t,e)&&Au(r,n))||n===void 0&&!(e in t))&&Qh(t,e,n)}function zS(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),s?Qh(n,o,l):$v(n,o,l)}return n}var Hp=Math.max;function WS(t,e,n){return e=Hp(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=Hp(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=n(i),xS(t,this,o)}}function GS(t,e){return US(WS(t,e,qv),t+"")}var KS=9007199254740991;function Yv(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=KS}function fc(t){return t!=null&&Yv(t.length)&&!Xh(t)}function VS(t,e,n){if(!oa(n))return!1;var r=typeof e;return(r=="number"?fc(n)&&jv(e,n.length):r=="string"&&e in n)?Au(n[e],t):!1}function XS(t){return GS(function(e,n){var r=-1,s=n.length,a=s>1?n[s-1]:void 0,i=s>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(s--,a):void 0,i&&VS(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=n[r];o&&t(e,o,r,a)}return e})}var QS=Object.prototype;function Zh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||QS;return t===n}function ZS(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var JS="[object Arguments]";function qp(t){return ws(t)&&ao(t)==JS}var zv=Object.prototype,eI=zv.hasOwnProperty,tI=zv.propertyIsEnumerable,Lf=qp((function(){return arguments})())?qp:function(t){return ws(t)&&eI.call(t,"callee")&&!tI.call(t,"callee")};function nI(){return!1}var Wv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jp=Wv&&typeof module=="object"&&module&&!module.nodeType&&module,rI=jp&&jp.exports===Wv,$p=rI?os.Buffer:void 0,sI=$p?$p.isBuffer:void 0,Zo=sI||nI,aI="[object Arguments]",iI="[object Array]",oI="[object Boolean]",uI="[object Date]",lI="[object Error]",cI="[object Function]",dI="[object Map]",fI="[object Number]",hI="[object Object]",pI="[object RegExp]",mI="[object Set]",gI="[object String]",vI="[object WeakMap]",bI="[object ArrayBuffer]",EI="[object DataView]",_I="[object Float32Array]",TI="[object Float64Array]",AI="[object Int8Array]",yI="[object Int16Array]",NI="[object Int32Array]",wI="[object Uint8Array]",SI="[object Uint8ClampedArray]",II="[object Uint16Array]",CI="[object Uint32Array]",kt={};kt[_I]=kt[TI]=kt[AI]=kt[yI]=kt[NI]=kt[wI]=kt[SI]=kt[II]=kt[CI]=!0;kt[aI]=kt[iI]=kt[bI]=kt[oI]=kt[EI]=kt[uI]=kt[lI]=kt[cI]=kt[dI]=kt[fI]=kt[hI]=kt[pI]=kt[mI]=kt[gI]=kt[vI]=!1;function LI(t){return ws(t)&&Yv(t.length)&&!!kt[ao(t)]}function Jh(t){return function(e){return t(e)}}var Gv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Uo=Gv&&typeof module=="object"&&module&&!module.nodeType&&module,OI=Uo&&Uo.exports===Gv,nd=OI&&Uv.process,Vi=(function(){try{var t=Uo&&Uo.require&&Uo.require("util").types;return t||nd&&nd.binding&&nd.binding("util")}catch{}})(),Yp=Vi&&Vi.isTypedArray,e0=Yp?Jh(Yp):LI,xI=Object.prototype,RI=xI.hasOwnProperty;function Kv(t,e){var n=Ga(t),r=!n&&Lf(t),s=!n&&!r&&Zo(t),a=!n&&!r&&!s&&e0(t),i=n||r||s||a,o=i?ZS(t.length,String):[],l=o.length;for(var d in t)(e||RI.call(t,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||jv(d,l)))&&o.push(d);return o}function Vv(t,e){return function(n){return t(e(n))}}var DI=Vv(Object.keys,Object),kI=Object.prototype,PI=kI.hasOwnProperty;function MI(t){if(!Zh(t))return DI(t);var e=[];for(var n in Object(t))PI.call(t,n)&&n!="constructor"&&e.push(n);return e}function BI(t){return fc(t)?Kv(t):MI(t)}function FI(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var UI=Object.prototype,HI=UI.hasOwnProperty;function qI(t){if(!oa(t))return FI(t);var e=Zh(t),n=[];for(var r in t)r=="constructor"&&(e||!HI.call(t,r))||n.push(r);return n}function Xv(t){return fc(t)?Kv(t,!0):qI(t)}var Jo=ni(Object,"create");function jI(){this.__data__=Jo?Jo(null):{},this.size=0}function $I(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var YI="__lodash_hash_undefined__",zI=Object.prototype,WI=zI.hasOwnProperty;function GI(t){var e=this.__data__;if(Jo){var n=e[t];return n===YI?void 0:n}return WI.call(e,t)?e[t]:void 0}var KI=Object.prototype,VI=KI.hasOwnProperty;function XI(t){var e=this.__data__;return Jo?e[t]!==void 0:VI.call(e,t)}var QI="__lodash_hash_undefined__";function ZI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Jo&&e===void 0?QI:e,this}function Ka(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ka.prototype.clear=jI;Ka.prototype.delete=$I;Ka.prototype.get=GI;Ka.prototype.has=XI;Ka.prototype.set=ZI;function JI(){this.__data__=[],this.size=0}function hc(t,e){for(var n=t.length;n--;)if(Au(t[n][0],e))return n;return-1}var eC=Array.prototype,tC=eC.splice;function nC(t){var e=this.__data__,n=hc(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():tC.call(e,n,1),--this.size,!0}function rC(t){var e=this.__data__,n=hc(e,t);return n<0?void 0:e[n][1]}function sC(t){return hc(this.__data__,t)>-1}function aC(t,e){var n=this.__data__,r=hc(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Cs(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Cs.prototype.clear=JI;Cs.prototype.delete=nC;Cs.prototype.get=rC;Cs.prototype.has=sC;Cs.prototype.set=aC;var eu=ni(os,"Map");function iC(){this.size=0,this.__data__={hash:new Ka,map:new(eu||Cs),string:new Ka}}function oC(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pc(t,e){var n=t.__data__;return oC(e)?n[typeof e=="string"?"string":"hash"]:n.map}function uC(t){var e=pc(this,t).delete(t);return this.size-=e?1:0,e}function lC(t){return pc(this,t).get(t)}function cC(t){return pc(this,t).has(t)}function dC(t,e){var n=pc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ri(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ri.prototype.clear=iC;ri.prototype.delete=uC;ri.prototype.get=lC;ri.prototype.has=cC;ri.prototype.set=dC;function fC(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var Qv=Vv(Object.getPrototypeOf,Object),hC="[object Object]",pC=Function.prototype,mC=Object.prototype,Zv=pC.toString,gC=mC.hasOwnProperty,vC=Zv.call(Object);function bC(t){if(!ws(t)||ao(t)!=hC)return!1;var e=Qv(t);if(e===null)return!0;var n=gC.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Zv.call(n)==vC}function EC(){this.__data__=new Cs,this.size=0}function _C(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function TC(t){return this.__data__.get(t)}function AC(t){return this.__data__.has(t)}var yC=200;function NC(t,e){var n=this.__data__;if(n instanceof Cs){var r=n.__data__;if(!eu||r.length<yC-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ri(r)}return n.set(t,e),this.size=n.size,this}function es(t){var e=this.__data__=new Cs(t);this.size=e.size}es.prototype.clear=EC;es.prototype.delete=_C;es.prototype.get=TC;es.prototype.has=AC;es.prototype.set=NC;var Jv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zp=Jv&&typeof module=="object"&&module&&!module.nodeType&&module,wC=zp&&zp.exports===Jv,Wp=wC?os.Buffer:void 0,Gp=Wp?Wp.allocUnsafe:void 0;function eb(t,e){if(e)return t.slice();var n=t.length,r=Gp?Gp(n):new t.constructor(n);return t.copy(r),r}function SC(t,e){for(var n=-1,r=t==null?0:t.length,s=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[s++]=i)}return a}function IC(){return[]}var CC=Object.prototype,LC=CC.propertyIsEnumerable,Kp=Object.getOwnPropertySymbols,OC=Kp?function(t){return t==null?[]:(t=Object(t),SC(Kp(t),function(e){return LC.call(t,e)}))}:IC;function xC(t,e,n){var r=e(t);return Ga(t)?r:fC(r,n(t))}function Of(t){return xC(t,BI,OC)}var xf=ni(os,"DataView"),Rf=ni(os,"Promise"),Df=ni(os,"Set"),Vp="[object Map]",RC="[object Object]",Xp="[object Promise]",Qp="[object Set]",Zp="[object WeakMap]",Jp="[object DataView]",DC=ti(xf),kC=ti(eu),PC=ti(Rf),MC=ti(Df),BC=ti(Cf),Sr=ao;(xf&&Sr(new xf(new ArrayBuffer(1)))!=Jp||eu&&Sr(new eu)!=Vp||Rf&&Sr(Rf.resolve())!=Xp||Df&&Sr(new Df)!=Qp||Cf&&Sr(new Cf)!=Zp)&&(Sr=function(t){var e=ao(t),n=e==RC?t.constructor:void 0,r=n?ti(n):"";if(r)switch(r){case DC:return Jp;case kC:return Vp;case PC:return Xp;case MC:return Qp;case BC:return Zp}return e});var FC=Object.prototype,UC=FC.hasOwnProperty;function HC(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&UC.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Ul=os.Uint8Array;function t0(t){var e=new t.constructor(t.byteLength);return new Ul(e).set(new Ul(t)),e}function qC(t,e){var n=t0(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var jC=/\w*$/;function $C(t){var e=new t.constructor(t.source,jC.exec(t));return e.lastIndex=t.lastIndex,e}var e1=na?na.prototype:void 0,t1=e1?e1.valueOf:void 0;function YC(t){return t1?Object(t1.call(t)):{}}function tb(t,e){var n=e?t0(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var zC="[object Boolean]",WC="[object Date]",GC="[object Map]",KC="[object Number]",VC="[object RegExp]",XC="[object Set]",QC="[object String]",ZC="[object Symbol]",JC="[object ArrayBuffer]",e4="[object DataView]",t4="[object Float32Array]",n4="[object Float64Array]",r4="[object Int8Array]",s4="[object Int16Array]",a4="[object Int32Array]",i4="[object Uint8Array]",o4="[object Uint8ClampedArray]",u4="[object Uint16Array]",l4="[object Uint32Array]";function c4(t,e,n){var r=t.constructor;switch(e){case JC:return t0(t);case zC:case WC:return new r(+t);case e4:return qC(t);case t4:case n4:case r4:case s4:case a4:case i4:case o4:case u4:case l4:return tb(t,n);case GC:return new r;case KC:case QC:return new r(t);case VC:return $C(t);case XC:return new r;case ZC:return YC(t)}}function nb(t){return typeof t.constructor=="function"&&!Zh(t)?OS(Qv(t)):{}}var d4="[object Map]";function f4(t){return ws(t)&&Sr(t)==d4}var n1=Vi&&Vi.isMap,h4=n1?Jh(n1):f4,p4="[object Set]";function m4(t){return ws(t)&&Sr(t)==p4}var r1=Vi&&Vi.isSet,g4=r1?Jh(r1):m4,v4=1,rb="[object Arguments]",b4="[object Array]",E4="[object Boolean]",_4="[object Date]",T4="[object Error]",sb="[object Function]",A4="[object GeneratorFunction]",y4="[object Map]",N4="[object Number]",ab="[object Object]",w4="[object RegExp]",S4="[object Set]",I4="[object String]",C4="[object Symbol]",L4="[object WeakMap]",O4="[object ArrayBuffer]",x4="[object DataView]",R4="[object Float32Array]",D4="[object Float64Array]",k4="[object Int8Array]",P4="[object Int16Array]",M4="[object Int32Array]",B4="[object Uint8Array]",F4="[object Uint8ClampedArray]",U4="[object Uint16Array]",H4="[object Uint32Array]",Ot={};Ot[rb]=Ot[b4]=Ot[O4]=Ot[x4]=Ot[E4]=Ot[_4]=Ot[R4]=Ot[D4]=Ot[k4]=Ot[P4]=Ot[M4]=Ot[y4]=Ot[N4]=Ot[ab]=Ot[w4]=Ot[S4]=Ot[I4]=Ot[C4]=Ot[B4]=Ot[F4]=Ot[U4]=Ot[H4]=!0;Ot[T4]=Ot[sb]=Ot[L4]=!1;function gl(t,e,n,r,s,a){var i,o=e&v4;if(i!==void 0)return i;if(!oa(t))return t;var l=Ga(t);if(l)i=HC(t);else{var d=Sr(t),h=d==sb||d==A4;if(Zo(t))return eb(t,o);if(d==ab||d==rb||h&&!s)i=h?{}:nb(t);else{if(!Ot[d])return s?t:{};i=c4(t,d,o)}}a||(a=new es);var g=a.get(t);if(g)return g;a.set(t,i),g4(t)?t.forEach(function(v){i.add(gl(v,e,n,v,t,a))}):h4(t)&&t.forEach(function(v,b){i.set(b,gl(v,e,n,b,t,a))});var f=Of,p=l?void 0:f(t);return HS(p||t,function(v,b){p&&(b=v,v=t[b]),$v(i,b,gl(v,e,n,b,t,a))}),i}var q4=1,j4=4;function Si(t){return gl(t,q4|j4)}var $4="__lodash_hash_undefined__";function Y4(t){return this.__data__.set(t,$4),this}function z4(t){return this.__data__.has(t)}function Hl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ri;++e<n;)this.add(t[e])}Hl.prototype.add=Hl.prototype.push=Y4;Hl.prototype.has=z4;function W4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function G4(t,e){return t.has(e)}var K4=1,V4=2;function ib(t,e,n,r,s,a){var i=n&K4,o=t.length,l=e.length;if(o!=l&&!(i&&l>o))return!1;var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var g=-1,f=!0,p=n&V4?new Hl:void 0;for(a.set(t,e),a.set(e,t);++g<o;){var v=t[g],b=e[g];if(r)var E=i?r(b,v,g,e,t,a):r(v,b,g,t,e,a);if(E!==void 0){if(E)continue;f=!1;break}if(p){if(!W4(e,function(_,R){if(!G4(p,R)&&(v===_||s(v,_,n,r,a)))return p.push(R)})){f=!1;break}}else if(!(v===b||s(v,b,n,r,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function X4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function Q4(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Z4=1,J4=2,eL="[object Boolean]",tL="[object Date]",nL="[object Error]",rL="[object Map]",sL="[object Number]",aL="[object RegExp]",iL="[object Set]",oL="[object String]",uL="[object Symbol]",lL="[object ArrayBuffer]",cL="[object DataView]",s1=na?na.prototype:void 0,rd=s1?s1.valueOf:void 0;function dL(t,e,n,r,s,a,i){switch(n){case cL:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case lL:return!(t.byteLength!=e.byteLength||!a(new Ul(t),new Ul(e)));case eL:case tL:case sL:return Au(+t,+e);case nL:return t.name==e.name&&t.message==e.message;case aL:case oL:return t==e+"";case rL:var o=X4;case iL:var l=r&Z4;if(o||(o=Q4),t.size!=e.size&&!l)return!1;var d=i.get(t);if(d)return d==e;r|=J4,i.set(t,e);var h=ib(o(t),o(e),r,s,a,i);return i.delete(t),h;case uL:if(rd)return rd.call(t)==rd.call(e)}return!1}var fL=1,hL=Object.prototype,pL=hL.hasOwnProperty;function mL(t,e,n,r,s,a){var i=n&fL,o=Of(t),l=o.length,d=Of(e),h=d.length;if(l!=h&&!i)return!1;for(var g=l;g--;){var f=o[g];if(!(i?f in e:pL.call(e,f)))return!1}var p=a.get(t),v=a.get(e);if(p&&v)return p==e&&v==t;var b=!0;a.set(t,e),a.set(e,t);for(var E=i;++g<l;){f=o[g];var _=t[f],R=e[f];if(r)var O=i?r(R,_,f,e,t,a):r(_,R,f,t,e,a);if(!(O===void 0?_===R||s(_,R,n,r,a):O)){b=!1;break}E||(E=f=="constructor")}if(b&&!E){var B=t.constructor,M=e.constructor;B!=M&&"constructor"in t&&"constructor"in e&&!(typeof B=="function"&&B instanceof B&&typeof M=="function"&&M instanceof M)&&(b=!1)}return a.delete(t),a.delete(e),b}var gL=1,a1="[object Arguments]",i1="[object Array]",Gu="[object Object]",vL=Object.prototype,o1=vL.hasOwnProperty;function bL(t,e,n,r,s,a){var i=Ga(t),o=Ga(e),l=i?i1:Sr(t),d=o?i1:Sr(e);l=l==a1?Gu:l,d=d==a1?Gu:d;var h=l==Gu,g=d==Gu,f=l==d;if(f&&Zo(t)){if(!Zo(e))return!1;i=!0,h=!1}if(f&&!h)return a||(a=new es),i||e0(t)?ib(t,e,n,r,s,a):dL(t,e,l,n,r,s,a);if(!(n&gL)){var p=h&&o1.call(t,"__wrapped__"),v=g&&o1.call(e,"__wrapped__");if(p||v){var b=p?t.value():t,E=v?e.value():e;return a||(a=new es),s(b,E,n,r,a)}}return f?(a||(a=new es),mL(t,e,n,r,s,a)):!1}function ob(t,e,n,r,s){return t===e?!0:t==null||e==null||!ws(t)&&!ws(e)?t!==t&&e!==e:bL(t,e,n,r,ob,s)}function EL(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),o=i.length;o--;){var l=i[++s];if(n(a[l],l,a)===!1)break}return e}}var _L=EL();function kf(t,e,n){(n!==void 0&&!Au(t[e],n)||n===void 0&&!(e in t))&&Qh(t,e,n)}function TL(t){return ws(t)&&fc(t)}function Pf(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function AL(t){return zS(t,Xv(t))}function yL(t,e,n,r,s,a,i){var o=Pf(t,n),l=Pf(e,n),d=i.get(l);if(d){kf(t,n,d);return}var h=a?a(o,l,n+"",t,e,i):void 0,g=h===void 0;if(g){var f=Ga(l),p=!f&&Zo(l),v=!f&&!p&&e0(l);h=l,f||p||v?Ga(o)?h=o:TL(o)?h=RS(o):p?(g=!1,h=eb(l,!0)):v?(g=!1,h=tb(l,!0)):h=[]:bC(l)||Lf(l)?(h=o,Lf(o)?h=AL(o):(!oa(o)||Xh(o))&&(h=nb(l))):g=!1}g&&(i.set(l,h),s(h,l,r,a,i),i.delete(l)),kf(t,n,h)}function ub(t,e,n,r,s){t!==e&&_L(e,function(a,i){if(s||(s=new es),oa(a))yL(t,e,i,n,ub,r,s);else{var o=r?r(Pf(t,i),a,i+"",t,e,s):void 0;o===void 0&&(o=a),kf(t,i,o)}},Xv)}function n0(t,e){return ob(t,e)}var ea=XS(function(t,e,n){ub(t,e,n)}),Re=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(Re||{});class as{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Re.TYPE&Re.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Re.LEVEL|s:Re.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class Ii extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const lb=class Mf{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const s=this.query(n);if(s==null)throw new Ii(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),o=new a(e,i,r);return Mf.blots.set(o.domNode,o),o}find(e,n=!1){return Mf.find(e,n)}query(e,n=Re.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Re.LEVEL&Re.BLOCK?r=this.types.block:e&Re.LEVEL&Re.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&Re.LEVEL&r.scope&&n&Re.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,s="attrName"in n;if(!r&&!s)throw new Ii("Invalid definition");if(r&&n.blotName==="abstract")throw new Ii("Cannot register abstract class");const a=r?n.blotName:s?n.attrName:void 0;return this.types[a]=n,s?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(i=>i.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(i=>{(this.tags[i]==null||n.className==null)&&(this.tags[i]=n)}))),n})}};lb.blots=new WeakMap;let Xi=lb;function u1(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class NL extends as{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){u1(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(u1(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Br=NL;function sd(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class wL extends as{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[sd(this.keyName)]=n,!0):!1}remove(e){e.style[sd(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[sd(this.keyName)];return this.canAdd(e,n)?n:""}}const ua=wL;class SL{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Xi.find(this.domNode);if(e==null)return;const n=as.keys(this.domNode),r=Br.keys(this.domNode),s=ua.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Re.ATTRIBUTE);i instanceof as&&(this.attributes[i.attrName]=i)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const mc=SL,cb=class{constructor(e,n){this.scroll=e,this.domNode=n,Xi.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Ii("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Xi.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,s){const a=this.isolate(e,n);if(this.scroll.query(r,Re.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Re.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);a.wrap(i),i.format(r,s)}}insertAt(e,n,r){const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Ii(`Cannot wrap ${e}`);return r.appendChild(this),r}};cb.blotName="abstract";let db=cb;const fb=class extends db{static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};fb.scope=Re.INLINE_BLOT;let IL=fb;const In=IL;class CL{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),s=0;for(;r;){if(r===e)return s;s+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||n&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[s,a]=this.find(e);let i=e-a;const o=this.iterator(s);let l=o();for(;l&&i<e+n;){const d=l.length();e>i?r(l,e-i,Math.min(n,i+d-e)):r(l,0,Math.min(d,e+n-i)),i+=d,l=o()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let s=r();for(;s;)n=e(n,s),s=r();return n}}function l1(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Re.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const hb=class Bs extends db{constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Bs.uiClass&&this.uiNode.classList.add(Bs.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new CL,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=l1(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof Ii)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,s,a)=>{r.deleteAt(s,a)})}descendant(e,n=0){const[r,s]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof Bs?r.descendant(e,s):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(n,r,(i,o,l)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Bs&&(s=s.concat(i.descendants(e,o,a))),a-=l}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===Re.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Bs?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,o)=>{a.formatAt(i,o,r,s)})}insertAt(e,n,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,n,r);else{const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(i)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,s]=this.children.find(e,n),a=[[this,e]];return r instanceof Bs?a.concat(r.path(s,n)):(r!=null&&a.push([r,s]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof Bs&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,i)=>{const o=s.split(a,n);o!=null&&r.appendChild(o)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const i=this.scroll.find(a);i!=null&&(i.domNode.parentNode==null||i.domNode.parentNode===this.domNode)&&i.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,i)=>a===i?0:a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let i=null;a.nextSibling!=null&&(i=this.scroll.find(a.nextSibling));const o=l1(a,this.scroll);(o.next!==i||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,i||void 0))}),this.enforceAllowedChildren()}};hb.uiClass="";let LL=hb;const Rr=LL;function OL(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const hi=class pi extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(pi.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new mc(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof pi||(r=r.wrap(pi.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Re.INLINE);if(r==null)return;r instanceof as?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.formats()[r]!=null||this.scroll.query(r,Re.ATTRIBUTE)?this.isolate(e,n).format(r,s):super.formatAt(e,n,r,s)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof pi&&r.prev===this&&OL(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof pi&&this.attributes.move(r),r}};hi.allowedChildren=[hi,In],hi.blotName="inline",hi.scope=Re.INLINE_BLOT,hi.tagName="SPAN";let xL=hi;const r0=xL,mi=class Bf extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Bf.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new mc(this.domNode)}format(e,n){const r=this.scroll.query(e,Re.BLOCK);r!=null&&(r instanceof as?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(Bf.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.scroll.query(r,Re.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Re.INLINE)!=null)super.insertAt(e,n,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(n,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};mi.blotName="block",mi.scope=Re.BLOCK_BLOT,mi.tagName="P",mi.allowedChildren=[r0,mi,In];let RL=mi;const tu=RL,Ff=class extends Rr{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ff.blotName="container",Ff.scope=Re.BLOCK_BLOT;let DL=Ff;const gc=DL;class kL extends In{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,s){e===0&&n===this.length()?this.format(r,s):super.formatAt(e,n,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Qn=kL,PL={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},ML=100,gi=class extends Rr{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,PL),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=Re.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,s){this.update(),super.formatAt(e,n,r,s)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(l,d=!0)=>{l==null||l===this||l.domNode.parentNode!=null&&(r.has(l.domNode)||r.set(l.domNode,[]),d&&a(l.parent))},i=l=>{r.has(l.domNode)&&(l instanceof Rr&&l.children.forEach(i),r.delete(l.domNode),l.optimize(n))};let o=e;for(let l=0;o.length>0;l+=1){if(l>=ML)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const h=this.find(d.target,!0);h!=null&&(h.domNode===d.target&&(d.type==="childList"?(a(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(g=>{const f=this.find(g,!1);a(f,!1),f instanceof Rr&&f.children.forEach(p=>{a(p,!1)})})):d.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};gi.blotName="scroll",gi.defaultChild=tu,gi.allowedChildren=[tu,gc],gi.scope=Re.BLOCK_BLOT,gi.tagName="DIV";let BL=gi;const s0=BL,Uf=class pb extends In{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof pb&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Uf.blotName="text",Uf.scope=Re.INLINE_BLOT;let FL=Uf;const ql=FL,UL=Object.freeze(Object.defineProperty({__proto__:null,Attributor:as,AttributorStore:mc,BlockBlot:tu,ClassAttributor:Br,ContainerBlot:gc,EmbedBlot:Qn,InlineBlot:r0,LeafBlot:In,ParentBlot:Rr,Registry:Xi,Scope:Re,ScrollBlot:s0,StyleAttributor:ua,TextBlot:ql},Symbol.toStringTag,{value:"Module"}));var Gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ku={exports:{}},ad,c1;function HL(){if(c1)return ad;c1=1;var t=-1,e=1,n=0;function r(A,j,w,S,x){if(A===j)return A?[[n,A]]:[];if(w!=null){var k=X(A,j,w);if(k)return k}var W=o(A,j),$=A.substring(0,W);A=A.substring(W),j=j.substring(W),W=d(A,j);var Y=A.substring(A.length-W);A=A.substring(0,A.length-W),j=j.substring(0,j.length-W);var U=s(A,j);return $&&U.unshift([n,$]),Y&&U.push([n,Y]),R(U,x),S&&g(U),U}function s(A,j){var w;if(!A)return[[e,j]];if(!j)return[[t,A]];var S=A.length>j.length?A:j,x=A.length>j.length?j:A,k=S.indexOf(x);if(k!==-1)return w=[[e,S.substring(0,k)],[n,x],[e,S.substring(k+x.length)]],A.length>j.length&&(w[0][0]=w[2][0]=t),w;if(x.length===1)return[[t,A],[e,j]];var W=h(A,j);if(W){var $=W[0],Y=W[1],U=W[2],K=W[3],te=W[4],fe=r($,U),me=r(Y,K);return fe.concat([[n,te]],me)}return a(A,j)}function a(A,j){for(var w=A.length,S=j.length,x=Math.ceil((w+S)/2),k=x,W=2*x,$=new Array(W),Y=new Array(W),U=0;U<W;U++)$[U]=-1,Y[U]=-1;$[k+1]=0,Y[k+1]=0;for(var K=w-S,te=K%2!==0,fe=0,me=0,ge=0,Le=0,de=0;de<x;de++){for(var ve=-de+fe;ve<=de-me;ve+=2){var Ie=k+ve,se;ve===-de||ve!==de&&$[Ie-1]<$[Ie+1]?se=$[Ie+1]:se=$[Ie-1]+1;for(var he=se-ve;se<w&&he<S&&A.charAt(se)===j.charAt(he);)se++,he++;if($[Ie]=se,se>w)me+=2;else if(he>S)fe+=2;else if(te){var Ae=k+K-ve;if(Ae>=0&&Ae<W&&Y[Ae]!==-1){var Ce=w-Y[Ae];if(se>=Ce)return i(A,j,se,he)}}}for(var Me=-de+ge;Me<=de-Le;Me+=2){var Ae=k+Me,Ce;Me===-de||Me!==de&&Y[Ae-1]<Y[Ae+1]?Ce=Y[Ae+1]:Ce=Y[Ae-1]+1;for(var ke=Ce-Me;Ce<w&&ke<S&&A.charAt(w-Ce-1)===j.charAt(S-ke-1);)Ce++,ke++;if(Y[Ae]=Ce,Ce>w)Le+=2;else if(ke>S)ge+=2;else if(!te){var Ie=k+K-Me;if(Ie>=0&&Ie<W&&$[Ie]!==-1){var se=$[Ie],he=k+se-Ie;if(Ce=w-Ce,se>=Ce)return i(A,j,se,he)}}}}return[[t,A],[e,j]]}function i(A,j,w,S){var x=A.substring(0,w),k=j.substring(0,S),W=A.substring(w),$=j.substring(S),Y=r(x,k),U=r(W,$);return Y.concat(U)}function o(A,j){if(!A||!j||A.charAt(0)!==j.charAt(0))return 0;for(var w=0,S=Math.min(A.length,j.length),x=S,k=0;w<x;)A.substring(k,x)==j.substring(k,x)?(w=x,k=w):S=x,x=Math.floor((S-w)/2+w);return O(A.charCodeAt(x-1))&&x--,x}function l(A,j){var w=A.length,S=j.length;if(w==0||S==0)return 0;w>S?A=A.substring(w-S):w<S&&(j=j.substring(0,w));var x=Math.min(w,S);if(A==j)return x;for(var k=0,W=1;;){var $=A.substring(x-W),Y=j.indexOf($);if(Y==-1)return k;W+=Y,(Y==0||A.substring(x-W)==j.substring(0,W))&&(k=W,W++)}}function d(A,j){if(!A||!j||A.slice(-1)!==j.slice(-1))return 0;for(var w=0,S=Math.min(A.length,j.length),x=S,k=0;w<x;)A.substring(A.length-x,A.length-k)==j.substring(j.length-x,j.length-k)?(w=x,k=w):S=x,x=Math.floor((S-w)/2+w);return B(A.charCodeAt(A.length-x))&&x--,x}function h(A,j){var w=A.length>j.length?A:j,S=A.length>j.length?j:A;if(w.length<4||S.length*2<w.length)return null;function x(me,ge,Le){for(var de=me.substring(Le,Le+Math.floor(me.length/4)),ve=-1,Ie="",se,he,Ae,Ce;(ve=ge.indexOf(de,ve+1))!==-1;){var Me=o(me.substring(Le),ge.substring(ve)),ke=d(me.substring(0,Le),ge.substring(0,ve));Ie.length<ke+Me&&(Ie=ge.substring(ve-ke,ve)+ge.substring(ve,ve+Me),se=me.substring(0,Le-ke),he=me.substring(Le+Me),Ae=ge.substring(0,ve-ke),Ce=ge.substring(ve+Me))}return Ie.length*2>=me.length?[se,he,Ae,Ce,Ie]:null}var k=x(w,S,Math.ceil(w.length/4)),W=x(w,S,Math.ceil(w.length/2)),$;if(!k&&!W)return null;W?k?$=k[4].length>W[4].length?k:W:$=W:$=k;var Y,U,K,te;A.length>j.length?(Y=$[0],U=$[1],K=$[2],te=$[3]):(K=$[0],te=$[1],Y=$[2],U=$[3]);var fe=$[4];return[Y,U,K,te,fe]}function g(A){for(var j=!1,w=[],S=0,x=null,k=0,W=0,$=0,Y=0,U=0;k<A.length;)A[k][0]==n?(w[S++]=k,W=Y,$=U,Y=0,U=0,x=A[k][1]):(A[k][0]==e?Y+=A[k][1].length:U+=A[k][1].length,x&&x.length<=Math.max(W,$)&&x.length<=Math.max(Y,U)&&(A.splice(w[S-1],0,[t,x]),A[w[S-1]+1][0]=e,S--,S--,k=S>0?w[S-1]:-1,W=0,$=0,Y=0,U=0,x=null,j=!0)),k++;for(j&&R(A),_(A),k=1;k<A.length;){if(A[k-1][0]==t&&A[k][0]==e){var K=A[k-1][1],te=A[k][1],fe=l(K,te),me=l(te,K);fe>=me?(fe>=K.length/2||fe>=te.length/2)&&(A.splice(k,0,[n,te.substring(0,fe)]),A[k-1][1]=K.substring(0,K.length-fe),A[k+1][1]=te.substring(fe),k++):(me>=K.length/2||me>=te.length/2)&&(A.splice(k,0,[n,K.substring(0,me)]),A[k-1][0]=e,A[k-1][1]=te.substring(0,te.length-me),A[k+1][0]=t,A[k+1][1]=K.substring(me),k++),k++}k++}}var f=/[^a-zA-Z0-9]/,p=/\s/,v=/[\r\n]/,b=/\n\r?\n$/,E=/^\r?\n\r?\n/;function _(A){function j(me,ge){if(!me||!ge)return 6;var Le=me.charAt(me.length-1),de=ge.charAt(0),ve=Le.match(f),Ie=de.match(f),se=ve&&Le.match(p),he=Ie&&de.match(p),Ae=se&&Le.match(v),Ce=he&&de.match(v),Me=Ae&&me.match(b),ke=Ce&&ge.match(E);return Me||ke?5:Ae||Ce?4:ve&&!se&&he?3:se||he?2:ve||Ie?1:0}for(var w=1;w<A.length-1;){if(A[w-1][0]==n&&A[w+1][0]==n){var S=A[w-1][1],x=A[w][1],k=A[w+1][1],W=d(S,x);if(W){var $=x.substring(x.length-W);S=S.substring(0,S.length-W),x=$+x.substring(0,x.length-W),k=$+k}for(var Y=S,U=x,K=k,te=j(S,x)+j(x,k);x.charAt(0)===k.charAt(0);){S+=x.charAt(0),x=x.substring(1)+k.charAt(0),k=k.substring(1);var fe=j(S,x)+j(x,k);fe>=te&&(te=fe,Y=S,U=x,K=k)}A[w-1][1]!=Y&&(Y?A[w-1][1]=Y:(A.splice(w-1,1),w--),A[w][1]=U,K?A[w+1][1]=K:(A.splice(w+1,1),w--))}w++}}function R(A,j){A.push([n,""]);for(var w=0,S=0,x=0,k="",W="",$;w<A.length;){if(w<A.length-1&&!A[w][1]){A.splice(w,1);continue}switch(A[w][0]){case e:x++,W+=A[w][1],w++;break;case t:S++,k+=A[w][1],w++;break;case n:var Y=w-x-S-1;if(j){if(Y>=0&&J(A[Y][1])){var U=A[Y][1].slice(-1);if(A[Y][1]=A[Y][1].slice(0,-1),k=U+k,W=U+W,!A[Y][1]){A.splice(Y,1),w--;var K=Y-1;A[K]&&A[K][0]===e&&(x++,W=A[K][1]+W,K--),A[K]&&A[K][0]===t&&(S++,k=A[K][1]+k,K--),Y=K}}if(M(A[w][1])){var U=A[w][1].charAt(0);A[w][1]=A[w][1].slice(1),k+=U,W+=U}}if(w<A.length-1&&!A[w][1]){A.splice(w,1);break}if(k.length>0||W.length>0){k.length>0&&W.length>0&&($=o(W,k),$!==0&&(Y>=0?A[Y][1]+=W.substring(0,$):(A.splice(0,0,[n,W.substring(0,$)]),w++),W=W.substring($),k=k.substring($)),$=d(W,k),$!==0&&(A[w][1]=W.substring(W.length-$)+A[w][1],W=W.substring(0,W.length-$),k=k.substring(0,k.length-$)));var te=x+S;k.length===0&&W.length===0?(A.splice(w-te,te),w=w-te):k.length===0?(A.splice(w-te,te,[e,W]),w=w-te+1):W.length===0?(A.splice(w-te,te,[t,k]),w=w-te+1):(A.splice(w-te,te,[t,k],[e,W]),w=w-te+2)}w!==0&&A[w-1][0]===n?(A[w-1][1]+=A[w][1],A.splice(w,1)):w++,x=0,S=0,k="",W="";break}}A[A.length-1][1]===""&&A.pop();var fe=!1;for(w=1;w<A.length-1;)A[w-1][0]===n&&A[w+1][0]===n&&(A[w][1].substring(A[w][1].length-A[w-1][1].length)===A[w-1][1]?(A[w][1]=A[w-1][1]+A[w][1].substring(0,A[w][1].length-A[w-1][1].length),A[w+1][1]=A[w-1][1]+A[w+1][1],A.splice(w-1,1),fe=!0):A[w][1].substring(0,A[w+1][1].length)==A[w+1][1]&&(A[w-1][1]+=A[w+1][1],A[w][1]=A[w][1].substring(A[w+1][1].length)+A[w+1][1],A.splice(w+1,1),fe=!0)),w++;fe&&R(A,j)}function O(A){return A>=55296&&A<=56319}function B(A){return A>=56320&&A<=57343}function M(A){return B(A.charCodeAt(0))}function J(A){return O(A.charCodeAt(A.length-1))}function H(A){for(var j=[],w=0;w<A.length;w++)A[w][1].length>0&&j.push(A[w]);return j}function G(A,j,w,S){return J(A)||M(S)?null:H([[n,A],[t,j],[e,w],[n,S]])}function X(A,j,w){var S=typeof w=="number"?{index:w,length:0}:w.oldRange,x=typeof w=="number"?null:w.newRange,k=A.length,W=j.length;if(S.length===0&&(x===null||x.length===0)){var $=S.index,Y=A.slice(0,$),U=A.slice($),K=x?x.index:null;e:{var te=$+W-k;if(K!==null&&K!==te||te<0||te>W)break e;var fe=j.slice(0,te),me=j.slice(te);if(me!==U)break e;var ge=Math.min($,te),Le=Y.slice(0,ge),de=fe.slice(0,ge);if(Le!==de)break e;var ve=Y.slice(ge),Ie=fe.slice(ge);return G(Le,ve,Ie,U)}e:{if(K!==null&&K!==$)break e;var se=$,fe=j.slice(0,se),me=j.slice(se);if(fe!==Y)break e;var he=Math.min(k-se,W-se),Ae=U.slice(U.length-he),Ce=me.slice(me.length-he);if(Ae!==Ce)break e;var ve=U.slice(0,U.length-he),Ie=me.slice(0,me.length-he);return G(Y,ve,Ie,Ae)}}if(S.length>0&&x&&x.length===0)e:{var Le=A.slice(0,S.index),Ae=A.slice(S.index+S.length),ge=Le.length,he=Ae.length;if(W<ge+he)break e;var de=j.slice(0,ge),Ce=j.slice(W-he);if(Le!==de||Ae!==Ce)break e;var ve=A.slice(ge,k-he),Ie=j.slice(ge,W-he);return G(Le,ve,Ie,Ae)}return null}function ee(A,j,w,S){return r(A,j,w,S,!0)}return ee.INSERT=e,ee.DELETE=t,ee.EQUAL=n,ad=ee,ad}var No={exports:{}};No.exports;var d1;function gb(){return d1||(d1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",o="[object Boolean]",l="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",p="[object Number]",v="[object Object]",b="[object Promise]",E="[object RegExp]",_="[object Set]",R="[object String]",O="[object Symbol]",B="[object WeakMap]",M="[object ArrayBuffer]",J="[object DataView]",H="[object Float32Array]",G="[object Float64Array]",X="[object Int8Array]",ee="[object Int16Array]",A="[object Int32Array]",j="[object Uint8Array]",w="[object Uint8ClampedArray]",S="[object Uint16Array]",x="[object Uint32Array]",k=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,$=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,U={};U[a]=U[i]=U[M]=U[J]=U[o]=U[l]=U[H]=U[G]=U[X]=U[ee]=U[A]=U[f]=U[p]=U[v]=U[E]=U[_]=U[R]=U[O]=U[j]=U[w]=U[S]=U[x]=!0,U[d]=U[h]=U[B]=!1;var K=typeof Gs=="object"&&Gs&&Gs.Object===Object&&Gs,te=typeof self=="object"&&self&&self.Object===Object&&self,fe=K||te||Function("return this")(),me=e&&!e.nodeType&&e,ge=me&&!0&&t&&!t.nodeType&&t,Le=ge&&ge.exports===me;function de(m,N){return m.set(N[0],N[1]),m}function ve(m,N){return m.add(N),m}function Ie(m,N){for(var q=-1,oe=m?m.length:0;++q<oe&&N(m[q],q,m)!==!1;);return m}function se(m,N){for(var q=-1,oe=N.length,We=m.length;++q<oe;)m[We+q]=N[q];return m}function he(m,N,q,oe){for(var We=-1,Pe=m?m.length:0;++We<Pe;)q=N(q,m[We],We,m);return q}function Ae(m,N){for(var q=-1,oe=Array(m);++q<m;)oe[q]=N(q);return oe}function Ce(m,N){return m==null?void 0:m[N]}function Me(m){var N=!1;if(m!=null&&typeof m.toString!="function")try{N=!!(m+"")}catch{}return N}function ke(m){var N=-1,q=Array(m.size);return m.forEach(function(oe,We){q[++N]=[We,oe]}),q}function dt(m,N){return function(q){return m(N(q))}}function Be(m){var N=-1,q=Array(m.size);return m.forEach(function(oe){q[++N]=oe}),q}var It=Array.prototype,Dt=Function.prototype,Lt=Object.prototype,ft=fe["__core-js_shared__"],Vt=(function(){var m=/[^.]+$/.exec(ft&&ft.keys&&ft.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),qt=Dt.toString,Pt=Lt.hasOwnProperty,Gt=Lt.toString,Mt=RegExp("^"+qt.call(Pt).replace(k,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=Le?fe.Buffer:void 0,yt=fe.Symbol,Bt=fe.Uint8Array,ot=dt(Object.getPrototypeOf,Object),nt=Object.create,bt=Lt.propertyIsEnumerable,An=It.splice,yn=Object.getOwnPropertySymbols,ln=mt?mt.isBuffer:void 0,Zn=dt(Object.keys,Object),Jn=_r(fe,"DataView"),jt=_r(fe,"Map"),en=_r(fe,"Promise"),Hr=_r(fe,"Set"),us=_r(fe,"WeakMap"),er=_r(Object,"create"),ls=On(Jn),Ne=On(jt),ze=On(en),Qe=On(Hr),Je=On(us),L=yt?yt.prototype:void 0,ue=L?L.valueOf:void 0;function Te(m){var N=-1,q=m?m.length:0;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function De(){this.__data__=er?er(null):{}}function Xe(m){return this.has(m)&&delete this.__data__[m]}function Ke(m){var N=this.__data__;if(er){var q=N[m];return q===r?void 0:q}return Pt.call(N,m)?N[m]:void 0}function Et(m){var N=this.__data__;return er?N[m]!==void 0:Pt.call(N,m)}function cn(m,N){var q=this.__data__;return q[m]=er&&N===void 0?r:N,this}Te.prototype.clear=De,Te.prototype.delete=Xe,Te.prototype.get=Ke,Te.prototype.has=Et,Te.prototype.set=cn;function Nt(m){var N=-1,q=m?m.length:0;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function tr(){this.__data__=[]}function Os(m){var N=this.__data__,q=gt(N,m);if(q<0)return!1;var oe=N.length-1;return q==oe?N.pop():An.call(N,q,1),!0}function qr(m){var N=this.__data__,q=gt(N,m);return q<0?void 0:N[q][1]}function la(m){return gt(this.__data__,m)>-1}function ca(m,N){var q=this.__data__,oe=gt(q,m);return oe<0?q.push([m,N]):q[oe][1]=N,this}Nt.prototype.clear=tr,Nt.prototype.delete=Os,Nt.prototype.get=qr,Nt.prototype.has=la,Nt.prototype.set=ca;function Xt(m){var N=-1,q=m?m.length:0;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function da(){this.__data__={hash:new Te,map:new(jt||Nt),string:new Te}}function fa(m){return ba(this,m).delete(m)}function xs(m){return ba(this,m).get(m)}function ha(m){return ba(this,m).has(m)}function pa(m,N){return ba(this,m).set(m,N),this}Xt.prototype.clear=da,Xt.prototype.delete=fa,Xt.prototype.get=xs,Xt.prototype.has=ha,Xt.prototype.set=pa;function dn(m){this.__data__=new Nt(m)}function Rs(){this.__data__=new Nt}function ma(m){return this.__data__.delete(m)}function ga(m){return this.__data__.get(m)}function va(m){return this.__data__.has(m)}function Se(m,N){var q=this.__data__;if(q instanceof Nt){var oe=q.__data__;if(!jt||oe.length<n-1)return oe.push([m,N]),this;q=this.__data__=new Xt(oe)}return q.set(m,N),this}dn.prototype.clear=Rs,dn.prototype.delete=ma,dn.prototype.get=ga,dn.prototype.has=va,dn.prototype.set=Se;function we(m,N){var q=oo(m)||oi(m)?Ae(m.length,String):[],oe=q.length,We=!!oe;for(var Pe in m)Pt.call(m,Pe)&&!(We&&(Pe=="length"||Cc(Pe,oe)))&&q.push(Pe);return q}function qe(m,N,q){var oe=m[N];(!(Pt.call(m,N)&&Lu(oe,q))||q===void 0&&!(N in m))&&(m[N]=q)}function gt(m,N){for(var q=m.length;q--;)if(Lu(m[q][0],N))return q;return-1}function $t(m,N){return m&&io(N,lo(N),m)}function Yt(m,N,q,oe,We,Pe,ht){var ut;if(oe&&(ut=Pe?oe(m,We,Pe,ht):oe(m)),ut!==void 0)return ut;if(!$r(m))return m;var Qt=oo(m);if(Qt){if(ut=Sc(m),!N)return yc(m,ut)}else{var _t=ds(m),Nn=_t==h||_t==g;if(Ou(m))return rn(m,N);if(_t==v||_t==a||Nn&&!Pe){if(Me(m))return Pe?m:{};if(ut=jr(Nn?{}:m),!N)return Nc(m,$t(ut,m))}else{if(!U[_t])return Pe?m:{};ut=Ic(m,_t,Yt,N)}}ht||(ht=new dn);var Mn=ht.get(m);if(Mn)return Mn;if(ht.set(m,ut),!Qt)var sn=q?wc(m):lo(m);return Ie(sn||m,function(wn,vn){sn&&(vn=wn,wn=m[vn]),qe(ut,vn,Yt(wn,N,q,oe,vn,m,ht))}),ut}function tn(m){return $r(m)?nt(m):{}}function gn(m,N,q){var oe=N(m);return oo(m)?oe:se(oe,q(m))}function nn(m){return Gt.call(m)}function nr(m){if(!$r(m)||Oc(m))return!1;var N=uo(m)||Me(m)?Mt:$;return N.test(On(m))}function Ft(m){if(!Iu(m))return Zn(m);var N=[];for(var q in Object(m))Pt.call(m,q)&&q!="constructor"&&N.push(q);return N}function rn(m,N){if(N)return m.slice();var q=new m.constructor(m.length);return m.copy(q),q}function At(m){var N=new m.constructor(m.byteLength);return new Bt(N).set(new Bt(m)),N}function Ut(m,N){var q=N?At(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.byteLength)}function rr(m,N,q){var oe=N?q(ke(m),!0):ke(m);return he(oe,de,new m.constructor)}function sr(m){var N=new m.constructor(m.source,W.exec(m));return N.lastIndex=m.lastIndex,N}function _c(m,N,q){var oe=N?q(Be(m),!0):Be(m);return he(oe,ve,new m.constructor)}function Tc(m){return ue?Object(ue.call(m)):{}}function Ac(m,N){var q=N?At(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.length)}function yc(m,N){var q=-1,oe=m.length;for(N||(N=Array(oe));++q<oe;)N[q]=m[q];return N}function io(m,N,q,oe){q||(q={});for(var We=-1,Pe=N.length;++We<Pe;){var ht=N[We],ut=void 0;qe(q,ht,ut===void 0?m[ht]:ut)}return q}function Nc(m,N){return io(m,cs(m),N)}function wc(m){return gn(m,lo,cs)}function ba(m,N){var q=m.__data__;return Lc(N)?q[typeof N=="string"?"string":"hash"]:q.map}function _r(m,N){var q=Ce(m,N);return nr(q)?q:void 0}var cs=yn?dt(yn,Object):Rc,ds=nn;(Jn&&ds(new Jn(new ArrayBuffer(1)))!=J||jt&&ds(new jt)!=f||en&&ds(en.resolve())!=b||Hr&&ds(new Hr)!=_||us&&ds(new us)!=B)&&(ds=function(m){var N=Gt.call(m),q=N==v?m.constructor:void 0,oe=q?On(q):void 0;if(oe)switch(oe){case ls:return J;case Ne:return f;case ze:return b;case Qe:return _;case Je:return B}return N});function Sc(m){var N=m.length,q=m.constructor(N);return N&&typeof m[0]=="string"&&Pt.call(m,"index")&&(q.index=m.index,q.input=m.input),q}function jr(m){return typeof m.constructor=="function"&&!Iu(m)?tn(ot(m)):{}}function Ic(m,N,q,oe){var We=m.constructor;switch(N){case M:return At(m);case o:case l:return new We(+m);case J:return Ut(m,oe);case H:case G:case X:case ee:case A:case j:case w:case S:case x:return Ac(m,oe);case f:return rr(m,oe,q);case p:case R:return new We(m);case E:return sr(m);case _:return _c(m,oe,q);case O:return Tc(m)}}function Cc(m,N){return N=N??s,!!N&&(typeof m=="number"||Y.test(m))&&m>-1&&m%1==0&&m<N}function Lc(m){var N=typeof m;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?m!=="__proto__":m===null}function Oc(m){return!!Vt&&Vt in m}function Iu(m){var N=m&&m.constructor,q=typeof N=="function"&&N.prototype||Lt;return m===q}function On(m){if(m!=null){try{return qt.call(m)}catch{}try{return m+""}catch{}}return""}function Cu(m){return Yt(m,!0,!0)}function Lu(m,N){return m===N||m!==m&&N!==N}function oi(m){return xc(m)&&Pt.call(m,"callee")&&(!bt.call(m,"callee")||Gt.call(m)==a)}var oo=Array.isArray;function ui(m){return m!=null&&xu(m.length)&&!uo(m)}function xc(m){return Ru(m)&&ui(m)}var Ou=ln||Dc;function uo(m){var N=$r(m)?Gt.call(m):"";return N==h||N==g}function xu(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=s}function $r(m){var N=typeof m;return!!m&&(N=="object"||N=="function")}function Ru(m){return!!m&&typeof m=="object"}function lo(m){return ui(m)?we(m):Ft(m)}function Rc(){return[]}function Dc(){return!1}t.exports=Cu})(No,No.exports)),No.exports}var wo={exports:{}};wo.exports;var f1;function vb(){return f1||(f1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,o="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",f="[object Error]",p="[object Function]",v="[object GeneratorFunction]",b="[object Map]",E="[object Number]",_="[object Null]",R="[object Object]",O="[object Promise]",B="[object Proxy]",M="[object RegExp]",J="[object Set]",H="[object String]",G="[object Symbol]",X="[object Undefined]",ee="[object WeakMap]",A="[object ArrayBuffer]",j="[object DataView]",w="[object Float32Array]",S="[object Float64Array]",x="[object Int8Array]",k="[object Int16Array]",W="[object Int32Array]",$="[object Uint8Array]",Y="[object Uint8ClampedArray]",U="[object Uint16Array]",K="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,me=/^(?:0|[1-9]\d*)$/,ge={};ge[w]=ge[S]=ge[x]=ge[k]=ge[W]=ge[$]=ge[Y]=ge[U]=ge[K]=!0,ge[o]=ge[l]=ge[A]=ge[h]=ge[j]=ge[g]=ge[f]=ge[p]=ge[b]=ge[E]=ge[R]=ge[M]=ge[J]=ge[H]=ge[ee]=!1;var Le=typeof Gs=="object"&&Gs&&Gs.Object===Object&&Gs,de=typeof self=="object"&&self&&self.Object===Object&&self,ve=Le||de||Function("return this")(),Ie=e&&!e.nodeType&&e,se=Ie&&!0&&t&&!t.nodeType&&t,he=se&&se.exports===Ie,Ae=he&&Le.process,Ce=(function(){try{return Ae&&Ae.binding&&Ae.binding("util")}catch{}})(),Me=Ce&&Ce.isTypedArray;function ke(m,N){for(var q=-1,oe=m==null?0:m.length,We=0,Pe=[];++q<oe;){var ht=m[q];N(ht,q,m)&&(Pe[We++]=ht)}return Pe}function dt(m,N){for(var q=-1,oe=N.length,We=m.length;++q<oe;)m[We+q]=N[q];return m}function Be(m,N){for(var q=-1,oe=m==null?0:m.length;++q<oe;)if(N(m[q],q,m))return!0;return!1}function It(m,N){for(var q=-1,oe=Array(m);++q<m;)oe[q]=N(q);return oe}function Dt(m){return function(N){return m(N)}}function Lt(m,N){return m.has(N)}function ft(m,N){return m==null?void 0:m[N]}function Vt(m){var N=-1,q=Array(m.size);return m.forEach(function(oe,We){q[++N]=[We,oe]}),q}function qt(m,N){return function(q){return m(N(q))}}function Pt(m){var N=-1,q=Array(m.size);return m.forEach(function(oe){q[++N]=oe}),q}var Gt=Array.prototype,Mt=Function.prototype,mt=Object.prototype,yt=ve["__core-js_shared__"],Bt=Mt.toString,ot=mt.hasOwnProperty,nt=(function(){var m=/[^.]+$/.exec(yt&&yt.keys&&yt.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),bt=mt.toString,An=RegExp("^"+Bt.call(ot).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yn=he?ve.Buffer:void 0,ln=ve.Symbol,Zn=ve.Uint8Array,Jn=mt.propertyIsEnumerable,jt=Gt.splice,en=ln?ln.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,us=yn?yn.isBuffer:void 0,er=qt(Object.keys,Object),ls=cs(ve,"DataView"),Ne=cs(ve,"Map"),ze=cs(ve,"Promise"),Qe=cs(ve,"Set"),Je=cs(ve,"WeakMap"),L=cs(Object,"create"),ue=On(ls),Te=On(Ne),De=On(ze),Xe=On(Qe),Ke=On(Je),Et=ln?ln.prototype:void 0,cn=Et?Et.valueOf:void 0;function Nt(m){var N=-1,q=m==null?0:m.length;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function tr(){this.__data__=L?L(null):{},this.size=0}function Os(m){var N=this.has(m)&&delete this.__data__[m];return this.size-=N?1:0,N}function qr(m){var N=this.__data__;if(L){var q=N[m];return q===r?void 0:q}return ot.call(N,m)?N[m]:void 0}function la(m){var N=this.__data__;return L?N[m]!==void 0:ot.call(N,m)}function ca(m,N){var q=this.__data__;return this.size+=this.has(m)?0:1,q[m]=L&&N===void 0?r:N,this}Nt.prototype.clear=tr,Nt.prototype.delete=Os,Nt.prototype.get=qr,Nt.prototype.has=la,Nt.prototype.set=ca;function Xt(m){var N=-1,q=m==null?0:m.length;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function da(){this.__data__=[],this.size=0}function fa(m){var N=this.__data__,q=rn(N,m);if(q<0)return!1;var oe=N.length-1;return q==oe?N.pop():jt.call(N,q,1),--this.size,!0}function xs(m){var N=this.__data__,q=rn(N,m);return q<0?void 0:N[q][1]}function ha(m){return rn(this.__data__,m)>-1}function pa(m,N){var q=this.__data__,oe=rn(q,m);return oe<0?(++this.size,q.push([m,N])):q[oe][1]=N,this}Xt.prototype.clear=da,Xt.prototype.delete=fa,Xt.prototype.get=xs,Xt.prototype.has=ha,Xt.prototype.set=pa;function dn(m){var N=-1,q=m==null?0:m.length;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function Rs(){this.size=0,this.__data__={hash:new Nt,map:new(Ne||Xt),string:new Nt}}function ma(m){var N=_r(this,m).delete(m);return this.size-=N?1:0,N}function ga(m){return _r(this,m).get(m)}function va(m){return _r(this,m).has(m)}function Se(m,N){var q=_r(this,m),oe=q.size;return q.set(m,N),this.size+=q.size==oe?0:1,this}dn.prototype.clear=Rs,dn.prototype.delete=ma,dn.prototype.get=ga,dn.prototype.has=va,dn.prototype.set=Se;function we(m){var N=-1,q=m==null?0:m.length;for(this.__data__=new dn;++N<q;)this.add(m[N])}function qe(m){return this.__data__.set(m,r),this}function gt(m){return this.__data__.has(m)}we.prototype.add=we.prototype.push=qe,we.prototype.has=gt;function $t(m){var N=this.__data__=new Xt(m);this.size=N.size}function Yt(){this.__data__=new Xt,this.size=0}function tn(m){var N=this.__data__,q=N.delete(m);return this.size=N.size,q}function gn(m){return this.__data__.get(m)}function nn(m){return this.__data__.has(m)}function nr(m,N){var q=this.__data__;if(q instanceof Xt){var oe=q.__data__;if(!Ne||oe.length<n-1)return oe.push([m,N]),this.size=++q.size,this;q=this.__data__=new dn(oe)}return q.set(m,N),this.size=q.size,this}$t.prototype.clear=Yt,$t.prototype.delete=tn,$t.prototype.get=gn,$t.prototype.has=nn,$t.prototype.set=nr;function Ft(m,N){var q=oi(m),oe=!q&&Lu(m),We=!q&&!oe&&ui(m),Pe=!q&&!oe&&!We&&Ru(m),ht=q||oe||We||Pe,ut=ht?It(m.length,String):[],Qt=ut.length;for(var _t in m)ot.call(m,_t)&&!(ht&&(_t=="length"||We&&(_t=="offset"||_t=="parent")||Pe&&(_t=="buffer"||_t=="byteLength"||_t=="byteOffset")||Ic(_t,Qt)))&&ut.push(_t);return ut}function rn(m,N){for(var q=m.length;q--;)if(Cu(m[q][0],N))return q;return-1}function At(m,N,q){var oe=N(m);return oi(m)?oe:dt(oe,q(m))}function Ut(m){return m==null?m===void 0?X:_:en&&en in Object(m)?ds(m):Iu(m)}function rr(m){return $r(m)&&Ut(m)==o}function sr(m,N,q,oe,We){return m===N?!0:m==null||N==null||!$r(m)&&!$r(N)?m!==m&&N!==N:_c(m,N,q,oe,sr,We)}function _c(m,N,q,oe,We,Pe){var ht=oi(m),ut=oi(N),Qt=ht?l:jr(m),_t=ut?l:jr(N);Qt=Qt==o?R:Qt,_t=_t==o?R:_t;var Nn=Qt==R,Mn=_t==R,sn=Qt==_t;if(sn&&ui(m)){if(!ui(N))return!1;ht=!0,Nn=!1}if(sn&&!Nn)return Pe||(Pe=new $t),ht||Ru(m)?io(m,N,q,oe,We,Pe):Nc(m,N,Qt,q,oe,We,Pe);if(!(q&s)){var wn=Nn&&ot.call(m,"__wrapped__"),vn=Mn&&ot.call(N,"__wrapped__");if(wn||vn){var Ds=wn?m.value():m,fs=vn?N.value():N;return Pe||(Pe=new $t),We(Ds,fs,q,oe,Pe)}}return sn?(Pe||(Pe=new $t),wc(m,N,q,oe,We,Pe)):!1}function Tc(m){if(!xu(m)||Lc(m))return!1;var N=Ou(m)?An:fe;return N.test(On(m))}function Ac(m){return $r(m)&&uo(m.length)&&!!ge[Ut(m)]}function yc(m){if(!Oc(m))return er(m);var N=[];for(var q in Object(m))ot.call(m,q)&&q!="constructor"&&N.push(q);return N}function io(m,N,q,oe,We,Pe){var ht=q&s,ut=m.length,Qt=N.length;if(ut!=Qt&&!(ht&&Qt>ut))return!1;var _t=Pe.get(m);if(_t&&Pe.get(N))return _t==N;var Nn=-1,Mn=!0,sn=q&a?new we:void 0;for(Pe.set(m,N),Pe.set(N,m);++Nn<ut;){var wn=m[Nn],vn=N[Nn];if(oe)var Ds=ht?oe(vn,wn,Nn,N,m,Pe):oe(wn,vn,Nn,m,N,Pe);if(Ds!==void 0){if(Ds)continue;Mn=!1;break}if(sn){if(!Be(N,function(fs,Ea){if(!Lt(sn,Ea)&&(wn===fs||We(wn,fs,q,oe,Pe)))return sn.push(Ea)})){Mn=!1;break}}else if(!(wn===vn||We(wn,vn,q,oe,Pe))){Mn=!1;break}}return Pe.delete(m),Pe.delete(N),Mn}function Nc(m,N,q,oe,We,Pe,ht){switch(q){case j:if(m.byteLength!=N.byteLength||m.byteOffset!=N.byteOffset)return!1;m=m.buffer,N=N.buffer;case A:return!(m.byteLength!=N.byteLength||!Pe(new Zn(m),new Zn(N)));case h:case g:case E:return Cu(+m,+N);case f:return m.name==N.name&&m.message==N.message;case M:case H:return m==N+"";case b:var ut=Vt;case J:var Qt=oe&s;if(ut||(ut=Pt),m.size!=N.size&&!Qt)return!1;var _t=ht.get(m);if(_t)return _t==N;oe|=a,ht.set(m,N);var Nn=io(ut(m),ut(N),oe,We,Pe,ht);return ht.delete(m),Nn;case G:if(cn)return cn.call(m)==cn.call(N)}return!1}function wc(m,N,q,oe,We,Pe){var ht=q&s,ut=ba(m),Qt=ut.length,_t=ba(N),Nn=_t.length;if(Qt!=Nn&&!ht)return!1;for(var Mn=Qt;Mn--;){var sn=ut[Mn];if(!(ht?sn in N:ot.call(N,sn)))return!1}var wn=Pe.get(m);if(wn&&Pe.get(N))return wn==N;var vn=!0;Pe.set(m,N),Pe.set(N,m);for(var Ds=ht;++Mn<Qt;){sn=ut[Mn];var fs=m[sn],Ea=N[sn];if(oe)var v0=ht?oe(Ea,fs,sn,N,m,Pe):oe(fs,Ea,sn,m,N,Pe);if(!(v0===void 0?fs===Ea||We(fs,Ea,q,oe,Pe):v0)){vn=!1;break}Ds||(Ds=sn=="constructor")}if(vn&&!Ds){var Du=m.constructor,ku=N.constructor;Du!=ku&&"constructor"in m&&"constructor"in N&&!(typeof Du=="function"&&Du instanceof Du&&typeof ku=="function"&&ku instanceof ku)&&(vn=!1)}return Pe.delete(m),Pe.delete(N),vn}function ba(m){return At(m,lo,Sc)}function _r(m,N){var q=m.__data__;return Cc(N)?q[typeof N=="string"?"string":"hash"]:q.map}function cs(m,N){var q=ft(m,N);return Tc(q)?q:void 0}function ds(m){var N=ot.call(m,en),q=m[en];try{m[en]=void 0;var oe=!0}catch{}var We=bt.call(m);return oe&&(N?m[en]=q:delete m[en]),We}var Sc=Hr?function(m){return m==null?[]:(m=Object(m),ke(Hr(m),function(N){return Jn.call(m,N)}))}:Rc,jr=Ut;(ls&&jr(new ls(new ArrayBuffer(1)))!=j||Ne&&jr(new Ne)!=b||ze&&jr(ze.resolve())!=O||Qe&&jr(new Qe)!=J||Je&&jr(new Je)!=ee)&&(jr=function(m){var N=Ut(m),q=N==R?m.constructor:void 0,oe=q?On(q):"";if(oe)switch(oe){case ue:return j;case Te:return b;case De:return O;case Xe:return J;case Ke:return ee}return N});function Ic(m,N){return N=N??i,!!N&&(typeof m=="number"||me.test(m))&&m>-1&&m%1==0&&m<N}function Cc(m){var N=typeof m;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?m!=="__proto__":m===null}function Lc(m){return!!nt&&nt in m}function Oc(m){var N=m&&m.constructor,q=typeof N=="function"&&N.prototype||mt;return m===q}function Iu(m){return bt.call(m)}function On(m){if(m!=null){try{return Bt.call(m)}catch{}try{return m+""}catch{}}return""}function Cu(m,N){return m===N||m!==m&&N!==N}var Lu=rr((function(){return arguments})())?rr:function(m){return $r(m)&&ot.call(m,"callee")&&!Jn.call(m,"callee")},oi=Array.isArray;function oo(m){return m!=null&&uo(m.length)&&!Ou(m)}var ui=us||Dc;function xc(m,N){return sr(m,N)}function Ou(m){if(!xu(m))return!1;var N=Ut(m);return N==p||N==v||N==d||N==B}function uo(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=i}function xu(m){var N=typeof m;return m!=null&&(N=="object"||N=="function")}function $r(m){return m!=null&&typeof m=="object"}var Ru=Me?Dt(Me):Ac;function lo(m){return oo(m)?Ft(m):yc(m)}function Rc(){return[]}function Dc(){return!1}t.exports=xc})(wo,wo.exports)),wo.exports}var Vu={},h1;function qL(){if(h1)return Vu;h1=1,Object.defineProperty(Vu,"__esModule",{value:!0});const t=gb(),e=vb();var n;return(function(r){function s(l={},d={},h=!1){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});let g=t(d);h||(g=Object.keys(g).reduce((f,p)=>(g[p]!=null&&(f[p]=g[p]),f),{}));for(const f in l)l[f]!==void 0&&d[f]===void 0&&(g[f]=l[f]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(l={},d={}){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});const h=Object.keys(l).concat(Object.keys(d)).reduce((g,f)=>(e(l[f],d[f])||(g[f]=d[f]===void 0?null:d[f]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(l={},d={}){l=l||{};const h=Object.keys(d).reduce((g,f)=>(d[f]!==l[f]&&l[f]!==void 0&&(g[f]=d[f]),g),{});return Object.keys(l).reduce((g,f)=>(l[f]!==d[f]&&d[f]===void 0&&(g[f]=null),g),h)}r.invert=i;function o(l,d,h=!1){if(typeof l!="object")return d;if(typeof d!="object")return;if(!h)return d;const g=Object.keys(d).reduce((f,p)=>(l[p]===void 0&&(f[p]=d[p]),f),{});return Object.keys(g).length>0?g:void 0}r.transform=o})(n||(n={})),Vu.default=n,Vu}var Xu={},p1;function bb(){if(p1)return Xu;p1=1,Object.defineProperty(Xu,"__esModule",{value:!0});var t;return(function(e){function n(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=n})(t||(t={})),Xu.default=t,Xu}var Qu={},m1;function jL(){if(m1)return Qu;m1=1,Object.defineProperty(Qu,"__esModule",{value:!0});const t=bb();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,i=t.default.length(s);if(r>=i-a?(r=i-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),i=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(i)}}else return[]}}return Qu.default=e,Qu}var g1;function $L(){return g1||(g1=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=HL(),r=gb(),s=vb(),a=qL();e.AttributeMap=a.default;const i=bb();e.Op=i.default;const o=jL();e.OpIterator=o.default;const l="\0",d=(g,f)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(f)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(f)[0]}`);return[p,g[p],f[p]]};class h{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,p){this.handlers[f]=p}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const p=this.handlers[f];if(!p)throw new Error(`no handlers for embed type "${f}"`);return p}insert(f,p){const v={};return typeof f=="string"&&f.length===0?this:(v.insert=f,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,p){if(typeof f=="number"&&f<=0)return this;const v={retain:f};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v)}push(f){let p=this.ops.length,v=this.ops[p-1];if(f=r(f),typeof v=="object"){if(typeof f.delete=="number"&&typeof v.delete=="number")return this.ops[p-1]={delete:v.delete+f.delete},this;if(typeof v.delete=="number"&&f.insert!=null&&(p-=1,v=this.ops[p-1],typeof v!="object"))return this.ops.unshift(f),this;if(s(f.attributes,v.attributes)){if(typeof f.insert=="string"&&typeof v.insert=="string")return this.ops[p-1]={insert:v.insert+f.insert},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof v.retain=="number")return this.ops[p-1]={retain:v.retain+f.retain},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this}}return p===this.ops.length?this.ops.push(f):this.ops.splice(p,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const p=[],v=[];return this.forEach(b=>{(f(b)?p:v).push(b)}),[p,v]}reduce(f,p){return this.ops.reduce(f,p)}changeLength(){return this.reduce((f,p)=>p.insert?f+i.default.length(p):p.delete?f-p.delete:f,0)}length(){return this.reduce((f,p)=>f+i.default.length(p),0)}slice(f=0,p=1/0){const v=[],b=new o.default(this.ops);let E=0;for(;E<p&&b.hasNext();){let _;E<f?_=b.next(f-E):(_=b.next(p-E),v.push(_)),E+=i.default.length(_)}return new h(v)}compose(f){const p=new o.default(this.ops),v=new o.default(f.ops),b=[],E=v.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){let R=E.retain;for(;p.peekType()==="insert"&&p.peekLength()<=R;)R-=p.peekLength(),b.push(p.next());E.retain-R>0&&v.next(E.retain-R)}const _=new h(b);for(;p.hasNext()||v.hasNext();)if(v.peekType()==="insert")_.push(v.next());else if(p.peekType()==="delete")_.push(p.next());else{const R=Math.min(p.peekLength(),v.peekLength()),O=p.next(R),B=v.next(R);if(B.retain){const M={};if(typeof O.retain=="number")M.retain=typeof B.retain=="number"?R:B.retain;else if(typeof B.retain=="number")O.retain==null?M.insert=O.insert:M.retain=O.retain;else{const H=O.retain==null?"insert":"retain",[G,X,ee]=d(O[H],B.retain),A=h.getHandler(G);M[H]={[G]:A.compose(X,ee,H==="retain")}}const J=a.default.compose(O.attributes,B.attributes,typeof O.retain=="number");if(J&&(M.attributes=J),_.push(M),!v.hasNext()&&s(_.ops[_.ops.length-1],M)){const H=new h(p.rest());return _.concat(H).chop()}}else typeof B.delete=="number"&&(typeof O.retain=="number"||typeof O.retain=="object"&&O.retain!==null)&&_.push(B)}return _.chop()}concat(f){const p=new h(this.ops.slice());return f.ops.length>0&&(p.push(f.ops[0]),p.ops=p.ops.concat(f.ops.slice(1))),p}diff(f,p){if(this.ops===f.ops)return new h;const v=[this,f].map(O=>O.map(B=>{if(B.insert!=null)return typeof B.insert=="string"?B.insert:l;const M=O===f?"on":"with";throw new Error("diff() called "+M+" non-document")}).join("")),b=new h,E=n(v[0],v[1],p,!0),_=new o.default(this.ops),R=new o.default(f.ops);return E.forEach(O=>{let B=O[1].length;for(;B>0;){let M=0;switch(O[0]){case n.INSERT:M=Math.min(R.peekLength(),B),b.push(R.next(M));break;case n.DELETE:M=Math.min(B,_.peekLength()),_.next(M),b.delete(M);break;case n.EQUAL:M=Math.min(_.peekLength(),R.peekLength(),B);const J=_.next(M),H=R.next(M);s(J.insert,H.insert)?b.retain(M,a.default.diff(J.attributes,H.attributes)):b.push(H).delete(M);break}B-=M}}),b.chop()}eachLine(f,p=`
76
- `){const v=new o.default(this.ops);let b=new h,E=0;for(;v.hasNext();){if(v.peekType()!=="insert")return;const _=v.peek(),R=i.default.length(_)-v.peekLength(),O=typeof _.insert=="string"?_.insert.indexOf(p,R)-R:-1;if(O<0)b.push(v.next());else if(O>0)b.push(v.next(O));else{if(f(b,v.next(1).attributes||{},E)===!1)return;E+=1,b=new h}}b.length()>0&&f(b,{},E)}invert(f){const p=new h;return this.reduce((v,b)=>{if(b.insert)p.delete(i.default.length(b));else{if(typeof b.retain=="number"&&b.attributes==null)return p.retain(b.retain),v+b.retain;if(b.delete||typeof b.retain=="number"){const E=b.delete||b.retain;return f.slice(v,v+E).forEach(R=>{b.delete?p.push(R):b.retain&&b.attributes&&p.retain(i.default.length(R),a.default.invert(b.attributes,R.attributes))}),v+E}else if(typeof b.retain=="object"&&b.retain!==null){const E=f.slice(v,v+1),_=new o.default(E.ops).next(),[R,O,B]=d(b.retain,_.insert),M=h.getHandler(R);return p.retain({[R]:M.invert(O,B)},a.default.invert(b.attributes,_.attributes)),v+1}}return v},0),p.chop()}transform(f,p=!1){if(p=!!p,typeof f=="number")return this.transformPosition(f,p);const v=f,b=new o.default(this.ops),E=new o.default(v.ops),_=new h;for(;b.hasNext()||E.hasNext();)if(b.peekType()==="insert"&&(p||E.peekType()!=="insert"))_.retain(i.default.length(b.next()));else if(E.peekType()==="insert")_.push(E.next());else{const R=Math.min(b.peekLength(),E.peekLength()),O=b.next(R),B=E.next(R);if(O.delete)continue;if(B.delete)_.push(B);else{const M=O.retain,J=B.retain;let H=typeof J=="object"&&J!==null?J:R;if(typeof M=="object"&&M!==null&&typeof J=="object"&&J!==null){const G=Object.keys(M)[0];if(G===Object.keys(J)[0]){const X=h.getHandler(G);X&&(H={[G]:X.transform(M[G],J[G],p)})}}_.retain(H,a.default.transform(O.attributes,B.attributes,p))}}return _.chop()}transformPosition(f,p=!1){p=!!p;const v=new o.default(this.ops);let b=0;for(;v.hasNext()&&b<=f;){const E=v.peekLength(),_=v.peekType();if(v.next(),_==="delete"){f-=Math.min(E,f-b);continue}else _==="insert"&&(b<f||!p)&&(f+=E);b+=E}return f}}h.Op=i.default,h.OpIterator=o.default,h.AttributeMap=a.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h})(Ku,Ku.exports)),Ku.exports}var mr=$L();const xe=mb(mr);class Fr extends Qn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Fr.blotName="break";Fr.tagName="BR";let kr=class extends ql{};const YL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function vc(t){return t.replace(/[&<>"']/g,e=>YL[e])}const Yr=class Yr extends r0{static compare(e,n){const r=Yr.order.indexOf(e),s=Yr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(Yr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Re.BLOT)){const a=this.isolate(e,n);s&&a.wrap(r,s)}else super.formatAt(e,n,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof Yr&&Yr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};ye(Yr,"allowedChildren",[Yr,Fr,Qn,kr]),ye(Yr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let is=Yr;const v1=1;class _n extends tu{constructor(){super(...arguments);ye(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Eb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,Re.BLOCK)?n+r===this.length()&&this.format(s,a):super.formatAt(n,Math.min(r,this.length()-n-1),s,a),this.cache={})}insertAt(n,r,s){if(s!=null){super.insertAt(n,r,s),this.cache={};return}if(r.length===0)return;const a=r.split(`
73
+ */const q6=Symbol("lucide-context"),j6=()=>jE(q6);var $6=R_("<svg><!><!></svg>");function un(t,e){at(e,!0);const n=j6()??{},r=Vn(e,"color",19,()=>n.color??"currentColor"),s=Vn(e,"size",19,()=>n.size??24),a=Vn(e,"strokeWidth",19,()=>n.strokeWidth??2),i=Vn(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),o=Vn(e,"iconNode",19,()=>[]),l=Jt(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),d=_e(()=>i()?Number(a())*24/Number(s()):a());var f=$6();x0(f,p=>({...U6,...p,...l,width:s(),height:s(),stroke:r(),"stroke-width":u(d),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!H6(l)&&{"aria-hidden":"true"}]);var g=y(f);St(g,17,o,zo,(p,v)=>{var _=_e(()=>lE(u(v),2));let E=()=>u(_)[0],b=()=>u(_)[1];var x=Kn(),O=tt(x);j_(O,E,!0,(M,B)=>{x0(M,()=>({...b()}))}),F(p,x)});var h=C(g);q_(h,()=>e.children??th),F(t,f),it()}function zh(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M14 17H5"}],["path",{d:"M19 7h-9"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];un(t,on({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function Y6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];un(t,on({name:"plus"},()=>n,{get iconNode(){return r}}))}function Wh(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];un(t,on({name:"x"},()=>n,{get iconNode(){return r}}))}function z6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];un(t,on({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function W6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];un(t,on({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function Mv(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];un(t,on({name:"search"},()=>n,{get iconNode(){return r}}))}function G6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}]];un(t,on({name:"house"},()=>n,{get iconNode(){return r}}))}function K6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];un(t,on({name:"link"},()=>n,{get iconNode(){return r}}))}function V6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];un(t,on({name:"external-link"},()=>n,{get iconNode(){return r}}))}function yf(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]];un(t,on({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function X6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 10v6"}],["path",{d:"M9 13h6"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];un(t,on({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}function Q6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];un(t,on({name:"upload"},()=>n,{get iconNode(){return r}}))}function Z6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 12.5 8 15l2 2.5"}],["path",{d:"m14 12.5 2 2.5-2 2.5"}]];un(t,on({name:"file-code"},()=>n,{get iconNode(){return r}}))}function kp(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];un(t,on({name:"check"},()=>n,{get iconNode(){return r}}))}function J6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];un(t,on({name:"image"},()=>n,{get iconNode(){return r}}))}function ew(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];un(t,on({name:"file-text"},()=>n,{get iconNode(){return r}}))}function tw(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05"}]];un(t,on({name:"rocket"},()=>n,{get iconNode(){return r}}))}function nw(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]];un(t,on({name:"globe"},()=>n,{get iconNode(){return r}}))}function rw(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];un(t,on({name:"triangle-alert"},()=>n,{get iconNode(){return r}}))}let Gh=Q(null),Kh=Q(null);function Ti(){return u(Gh)}function Pp(){return u(Kh)}function sw(t,e){T(Gh,{entry:t,parent:e},!0)}function Jc(t){T(Kh,t,!0)}function Ms(){T(Gh,null),T(Kh,null)}let ed=Q(null);const Nf={get target(){return u(ed)},request(t){T(ed,t,!0)},clear(){T(ed,null)}};function aw(){let t=Q("content");return{get mode(){return u(t)},set(e){T(t,e,!0)}}}const wr=aw(),iw="nanoesis-restore:";function wf(t){return`${iw}${t}`}function ow(t,e,n){t.getItem(wf(e))===null&&t.setItem(wf(e),JSON.stringify(n))}function uw(t,e){const n=t.getItem(wf(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function lw(){let t=Q("saved"),e=null;return{get state(){return u(t)},get canRetry(){return u(t)==="error"&&e!==null},saving(){T(t,"saving")},saved(){T(t,"saved"),e=null},failed(n){T(t,"error"),e=n},retry(){e==null||e()},reset(){T(t,"saved"),e=null}}}const Fs=lw(),cw=new Set(["title","created","published","updated"]);function dw(t){let e;try{e=JSON.parse(t===""?"[]":t)}catch{return[]}if(!Array.isArray(e))return[];const n=[];for(const r of e){if(r===null||typeof r!="object")continue;const s=r,a=typeof s.name=="string"?s.name.trim():"";if(a==="")continue;const i={name:a};typeof s.user=="string"&&s.user!==""&&(i.user=s.user),typeof s.href=="string"&&s.href!==""&&(i.href=s.href),n.push(i)}return n}function fw(t,e,n){if(t.type==="authors")return dw(n);if(t.multiple||Array.isArray(e))return n.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(typeof e=="number"){const r=Number(n);return Number.isFinite(r)?r:n}return typeof e=="boolean"?n==="true":n}function hw(t){return t===""||Array.isArray(t)&&t.length===0}function Mp(t,e,n,r=t.isPublished){const s={...t.fields},a={title:t.title,created:t.created,published:t.published,updated:t.updated};for(const o of e){const l=n[o.name]??"";if(cw.has(o.name)){a[o.name]=o.name==="title"?l:l||void 0;continue}const d=fw(o,t.fields[o.name],l);hw(d)?delete s[o.name]:s[o.name]=d}const i={};return t.template!==void 0&&(i.template=t.template),i.title=a.title,i.isPublished=r,a.created!==void 0&&(i.created=a.created),a.published!==void 0&&(i.published=a.published),a.updated!==void 0&&(i.updated=a.updated),i.fields=s,`${JSON.stringify(i,null,2)}
74
+ `}function Sf(t,e,n){if(e<0||e>=t.length)return[...t];const r=[...t],s=Math.max(0,Math.min(r.length-1,n)),[a]=r.splice(e,1);return r.splice(s,0,a),r}let pw=0;var mw=z('<li draggable="true"><span class="grip svelte-5hnbr8" aria-hidden="true"><!></span> <span class="name svelte-5hnbr8"> </span> <button type="button" class="remove svelte-5hnbr8"><!></button></li>'),gw=z('<ul class="pills svelte-5hnbr8"></ul>'),vw=z('<li role="option"> </li>'),bw=z('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),Ew=z('<div class="authors svelte-5hnbr8" role="group"><!> <div class="add svelte-5hnbr8"><input type="text" class="add-input svelte-5hnbr8" placeholder="Add an author…" autocomplete="off" role="combobox" aria-autocomplete="list"/> <!></div></div>');function _w(t,e){at(e,!0);function n(K){if(K.trim()==="")return[];try{const te=JSON.parse(K);return Array.isArray(te)?te.flatMap(fe=>{if(fe===null||typeof fe!="object")return[];const me=fe,ge=typeof me.name=="string"?me.name:"";return ge.trim()===""?[]:[{name:ge,...typeof me.user=="string"&&me.user!==""?{user:me.user}:{}}]}):[]}catch{return[]}}const r=_e(()=>n(e.value)),s=`authors-${++pw}`;let a=Q(ct([])),i=Q(""),o=Q(!1),l=Q(0),d=Q(void 0),f=Q(null),g=Q(null);Rt(()=>{MN().then(K=>T(a,K,!0))});const h=_e(()=>new Map(u(a).map(K=>[K.user,K.name]))),p=_e(()=>new Set(u(r).map(K=>K.user).filter(K=>K!==void 0)));function v(K){return K.user!==void 0?u(h).get(K.user)??K.name:K.name}const _=_e(()=>{const K=u(i).trim().toLowerCase();return K===""?[]:u(a).filter(te=>!u(p).has(te.user)&&te.name.toLowerCase().includes(K)).slice(0,6)}),E=_e(()=>u(o)&&u(i).trim()!==""),b=_e(()=>u(_).length),x=_e(()=>u(E)?u(l)<u(_).length?`${s}-opt-${u(l)}`:`${s}-guest`:void 0);function O(K){e.onchange(K.length===0?"":JSON.stringify(K))}function M(K){u(p).has(K.user)||(O([...u(r),{name:K.name,user:K.user}]),T(i,""))}function B(K){const te=K.trim();te!==""&&(O([...u(r),{name:te}]),T(i,""))}function J(){const K=u(_)[u(l)];K!==void 0?M(K):B(u(i))}function H(){var K,te;(te=(K=u(d))==null?void 0:K.children[u(l)])==null||te.scrollIntoView({block:"nearest"})}function G(K){if(!u(E)){K.key==="Enter"&&(K.preventDefault(),B(u(i)));return}const te=u(_).length+1;K.key==="ArrowDown"?(K.preventDefault(),T(l,(u(l)+1)%te),H()):K.key==="ArrowUp"?(K.preventDefault(),T(l,(u(l)-1+te)%te),H()):K.key==="Enter"?(K.preventDefault(),J()):K.key==="Escape"&&(K.preventDefault(),T(i,""))}function X(K){O(u(r).filter((te,fe)=>fe!==K))}function ee(K,te){var fe;T(f,K,!0),(fe=te.dataTransfer)==null||fe.setData("text/plain",String(K)),te.dataTransfer&&(te.dataTransfer.effectAllowed="move")}function A(K,te){u(f)!==null&&(te.preventDefault(),T(g,K,!0))}function j(K){u(f)!==null&&u(f)!==K&&O(Sf(u(r),u(f),K)),T(f,null),T(g,null)}function w(){T(f,null),T(g,null)}var S=Ew(),R=y(S);{var k=K=>{var te=gw();St(te,21,()=>u(r),zo,(fe,me,ge)=>{var Le=mw();let de;var ve=y(Le),Ie=y(ve);yf(Ie,{size:14});var se=C(ve,2),he=y(se),Ae=C(se,2),Ce=y(Ae);Wh(Ce,{size:14,"aria-hidden":"true"}),re((Me,ke)=>{de=Ve(Le,1,"pill svelte-5hnbr8",null,de,{guest:u(me).user===void 0,dragging:u(f)===ge,over:u(g)===ge&&u(f)!==ge}),Ee(se,"title",u(me).user??"Guest"),ae(he,Me),Ee(Ae,"aria-label",ke)},[()=>v(u(me)),()=>`Remove ${v(u(me))}`]),He("dragstart",Le,Me=>ee(ge,Me)),He("dragover",Le,Me=>A(ge,Me)),He("drop",Le,()=>j(ge)),He("dragend",Le,w),ie("click",Ae,()=>X(ge)),F(fe,Le)}),F(K,te)};ce(R,K=>{u(r).length>0&&K(k)})}var W=C(R,2),$=y(W),Y=C($,2);{var U=K=>{var te=bw(),fe=y(te);St(fe,19,()=>u(_),de=>de.user,(de,ve,Ie)=>{var se=vw();let he;var Ae=y(se);re(()=>{Ee(se,"id",`${s}-opt-${u(Ie)}`),he=Ve(se,1,"option svelte-5hnbr8",null,he,{active:u(Ie)===u(l)}),Ee(se,"aria-selected",u(Ie)===u(l)),ae(Ae,u(ve).name)}),ie("click",se,()=>M(u(ve))),He("mouseenter",se,()=>T(l,u(Ie),!0)),F(de,se)});var me=C(fe,2);let ge;var Le=y(me);mn(te,de=>T(d,de),()=>u(d)),re(de=>{Ee(te,"id",`${s}-listbox`),Ee(me,"id",`${s}-guest`),ge=Ve(me,1,"option guest-option svelte-5hnbr8",null,ge,{active:u(l)===u(b)}),Ee(me,"aria-selected",u(l)===u(b)),ae(Le,`Add “${de??""}” as a guest`)},[()=>u(i).trim()]),ie("click",me,()=>B(u(i))),He("mouseenter",me,()=>T(l,u(b),!0)),F(K,te)};ce(Y,K=>{u(E)&&K(U)})}re(()=>{Ee(S,"aria-labelledby",e.labelledBy),Ee($,"aria-expanded",u(E)),Ee($,"aria-controls",`${s}-listbox`),Ee($,"aria-activedescendant",u(x))}),ie("input",$,()=>T(l,0)),ie("keydown",$,G),He("focus",$,()=>{T(o,!0),T(l,0)}),He("blur",$,()=>setTimeout(()=>T(o,!1),120)),wt($,()=>u(i),K=>T(i,K)),F(t,S),it()}Tt(["click","input","keydown"]);var Tw=z('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),Aw=z('<p class="empty svelte-1nm0yno">No file selected.</p>'),yw=z('<li class="hint svelte-1nm0yno">Loading…</li>'),Nw=z('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),ww=z('<li><button type="button"> </button></li>'),Sw=z('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),Iw=z('<p class="error svelte-1nm0yno" role="alert"> </p>'),Cw=z('<div class="file-field svelte-1nm0yno" role="group"><!> <div class="actions svelte-1nm0yno"><button type="button" class="action svelte-1nm0yno"> </button> <label class="action upload svelte-1nm0yno">Upload… <input type="file" class="svelte-1nm0yno"/></label></div> <!> <!></div>');function Lw(t,e){at(e,!0);let n=Q(ct([])),r=Q(!1),s=Q(!1),a=!1,i=Q(null);const o=_e(()=>e.value.split("/").pop()??e.value);async function l(){T(s,!0);try{T(n,await n6(e.itemDir),!0),a=!0}finally{T(s,!1)}}function d(){T(r,!u(r)),u(r)&&!a&&l()}function f(X){var j;const ee=X.currentTarget,A=(j=ee.files)==null?void 0:j[0];ee.value="",A&&g(A)}async function g(X){T(i,null);try{e.onchange(await Hh(e.itemDir,X)),a=!1,u(r)&&await l()}catch(ee){T(i,ee instanceof Error?ee.message:String(ee),!0)}}var h=Cw(),p=y(h);{var v=X=>{var ee=Tw(),A=y(ee),j=y(A),w=C(A,2);re(S=>{Ee(A,"href",S),ae(j,u(o))},[()=>cc(e.itemDir,e.value)]),ie("click",w,()=>e.onchange("")),F(X,ee)},_=X=>{var ee=Aw();F(X,ee)};ce(p,X=>{e.value?X(v):X(_,-1)})}var E=C(p,2),b=y(E),x=y(b),O=C(b,2),M=C(y(O)),B=C(E,2);{var J=X=>{var ee=Sw(),A=y(ee);{var j=R=>{var k=yw();F(R,k)},w=R=>{var k=Nw();F(R,k)},S=R=>{var k=Kn(),W=tt(k);St(W,16,()=>u(n),$=>$,($,Y)=>{const U=_e(()=>uv(Y));var K=ww(),te=y(K);let fe;var me=y(te);re(()=>{fe=Ve(te,1,"file svelte-1nm0yno",null,fe,{selected:e.value===u(U)}),Ee(te,"aria-pressed",e.value===u(U)),ae(me,Y)}),ie("click",te,()=>e.onchange(u(U))),F($,K)}),F(R,k)};ce(A,R=>{u(s)?R(j):u(n).length===0?R(w,1):R(S,-1)})}F(X,ee)};ce(B,X=>{u(r)&&X(J)})}var H=C(B,2);{var G=X=>{var ee=Iw(),A=y(ee);re(()=>ae(A,u(i))),F(X,ee)};ce(H,X=>{u(i)&&X(G)})}re(()=>{Ee(h,"aria-labelledby",e.labelledBy),Ee(b,"aria-expanded",u(r)),ae(x,u(r)?"Hide files":"Choose from files")}),ie("click",b,d),ie("change",M,f),F(t,h),it()}Tt(["click","change"]);var Ow=z('<div class="preview svelte-s6anrr"><img class="preview-img svelte-s6anrr" alt=""/> <div class="preview-meta svelte-s6anrr"><span class="filename svelte-s6anrr"> </span> <div class="row svelte-s6anrr"><label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label> <button type="button" class="link svelte-s6anrr">Remove</button></div></div></div>'),xw=z('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),Rw=z('<p class="error svelte-s6anrr" role="alert"> </p>'),Dw=z('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function kw(t,e){at(e,!0);let n=Q(!1),r=Q(null),s=Q("");Rt(()=>{const p=e.value;if(p===""){T(s,"");return}if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(p)){T(s,p,!0);return}let v=null,_=!1;return u6(e.itemDir,p).then(E=>{if(_){URL.revokeObjectURL(E);return}v=E,T(s,E,!0)}).catch(()=>{_||T(s,"")}),()=>{_=!0,v!==null&&URL.revokeObjectURL(v)}});function a(p){var E;const v=p.currentTarget,_=(E=v.files)==null?void 0:E[0];v.value="",_&&i(_)}async function i(p){T(r,null),T(n,!0);try{e.onchange(await Hh(e.itemDir,p))}catch(v){T(r,v instanceof Error?v.message:String(v),!0)}finally{T(n,!1)}}var o=Dw(),l=y(o);{var d=p=>{var v=Ow(),_=y(v),E=C(_,2),b=y(E),x=y(b),O=C(b,2),M=y(O);let B;var J=y(M),H=C(J),G=C(M,2);re(()=>{Ee(_,"src",u(s)),ae(x,e.value),B=Ve(M,1,"action svelte-s6anrr",null,B,{busy:u(n)}),ae(J,`${u(n)?"Uploading…":"Replace…"} `),H.disabled=u(n)}),ie("change",H,a),ie("click",G,()=>e.onchange("")),F(p,v)},f=p=>{var v=xw();let _;var E=y(v),b=C(E);re(()=>{_=Ve(v,1,"action svelte-s6anrr",null,_,{busy:u(n)}),ae(E,`${u(n)?"Uploading…":"Upload image…"} `),b.disabled=u(n)}),ie("change",b,a),F(p,v)};ce(l,p=>{e.value?p(d):p(f,-1)})}var g=C(l,2);{var h=p=>{var v=Rw(),_=y(v);re(()=>ae(_,u(r))),F(p,v)};ce(g,p=>{u(r)&&p(h)})}re(()=>Ee(o,"aria-labelledby",e.labelledBy)),F(t,o),it()}Tt(["change","click"]);var Pw=z("<option> </option>"),Mw=z("<option>Top level</option>"),Bw=z("<option> </option>"),Fw=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Move</h3> <div class="manage svelte-wge2ya"><label class="grow svelte-wge2ya"><span class="visually-hidden svelte-wge2ya">Move to folder</span> <select class="svelte-wge2ya"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-wge2ya">Move</button></div></div>'),Uw=z('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),Hw=z('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),qw=z(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
75
+ heading at the top of the form.</p>`),jw=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),$w=z('<dialog aria-label="Edit item" class="svelte-wge2ya"><form><h2 class="svelte-wge2ya">Edit item</h2> <label class="svelte-wge2ya"><span class="svelte-wge2ya">Template</span> <select class="svelte-wge2ya"></select> <span class="help svelte-wge2ya">Switching keeps any field values the new template doesn’t use.</span></label> <!> <!> <div class="actions svelte-wge2ya"><button type="button" class="ghost svelte-wge2ya">Cancel</button> <button type="submit" class="primary svelte-wge2ya">Save</button></div></form></dialog>');function Yw(t,e){at(e,!0);const n=Vn(e,"currentFolder",3,""),r=Vn(e,"folders",19,()=>[]);let s,a=Q(ct(e.templateName));const i="\0";let o=Q(i);const l=_e(()=>r().filter(B=>B!==n())),d=_e(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);Za(()=>s.showModal());function f(B){B.preventDefault(),u(a)!==e.templateName?e.onchangetemplate(u(a)):e.onclose()}var g=$w(),h=y(g),p=C(y(h),2),v=C(y(p),2);St(v,20,()=>u(d),B=>B,(B,J)=>{var H=Pw(),G=y(H),X={};re(()=>{ae(G,J),X!==(X=J)&&(H.value=(H.__value=J)??"")}),F(B,H)});var _=C(p,2);{var E=B=>{var J=Fw(),H=C(y(J),2),G=y(H),X=C(y(G),2),ee=y(X);ee.value=ee.__value=i;var A=C(ee);{var j=R=>{var k=Mw();k.value=k.__value="",F(R,k)};ce(A,R=>{n()!==""&&R(j)})}var w=C(A);St(w,16,()=>u(l),R=>R,(R,k)=>{var W=Bw(),$=y(W),Y={};re(()=>{ae($,`${k??""}/`),Y!==(Y=k)&&(W.value=(W.__value=k)??"")}),F(R,W)});var S=C(G,2);re(()=>S.disabled=u(o)===i),Ya(X,()=>u(o),R=>T(o,R)),ie("click",S,()=>e.onmove(u(o))),F(B,J)};ce(_,B=>{e.onmove&&B(E)})}var b=C(_,2);{var x=B=>{var J=jw(),H=C(y(J),2),G=y(H);{var X=S=>{var R=Uw();ie("click",R,function(...k){var W;(W=e.onrename)==null||W.apply(this,k)}),F(S,R)};ce(G,S=>{e.onrename&&S(X)})}var ee=C(G,2);{var A=S=>{var R=Hw();ie("click",R,function(...k){var W;(W=e.ondelete)==null||W.apply(this,k)}),F(S,R)};ce(ee,S=>{e.ondelete&&S(A)})}var j=C(H,2);{var w=S=>{var R=qw();F(S,R)};ce(j,S=>{e.onrename&&S(w)})}F(B,J)};ce(b,B=>{(e.onrename||e.ondelete)&&B(x)})}var O=C(b,2),M=y(O);mn(g,B=>s=B,()=>s),He("close",g,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),He("cancel",g,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),He("submit",h,f),Ya(v,()=>u(a),B=>T(a,B)),ie("click",M,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),F(t,g),it()}Tt(["click"]);let Fo=Q(null);const zw={get pending(){return u(Fo)}};function Bv(t=""){return new Promise(e=>{T(Fo,{current:t,resolve:e},!0)})}function ci(t){u(Fo)!==null&&(u(Fo).resolve(t),T(Fo,null))}const Vh="ref:";function Qo(t){return t.startsWith(Vh)}function If(t){return Qo(t)?t.slice(Vh.length):t}function Ww(t){return`${Vh}${t}`}var Gw=z('<!> <span class="target svelte-147ryxk"> </span>',1),Kw=z('<!> <span class="target svelte-147ryxk"> </span>',1),Vw=z('<span class="value svelte-147ryxk"><!></span> <button type="button" class="action svelte-147ryxk">Edit</button> <button type="button" class="action svelte-147ryxk">Clear</button>',1),Xw=z('<button type="button" class="action svelte-147ryxk">Set link…</button>'),Qw=z('<div class="link-field svelte-147ryxk" role="group"><!></div>');function Zw(t,e){at(e,!0);async function n(){const o=await Bv(e.value);o!==null&&e.onchange(o)}var r=Qw(),s=y(r);{var a=o=>{var l=Vw(),d=tt(l),f=y(d);{var g=E=>{var b=Gw(),x=tt(b);K6(x,{size:14,"aria-hidden":"true"});var O=C(x,2),M=y(O);re((B,J)=>{Ee(O,"title",B),ae(M,J)},[()=>`Page: ${If(e.value)}`,()=>If(e.value)]),F(E,b)},h=_e(()=>Qo(e.value)),p=E=>{var b=Kw(),x=tt(b);V6(x,{size:14,"aria-hidden":"true"});var O=C(x,2),M=y(O);re(()=>{Ee(O,"title",e.value),ae(M,e.value)}),F(E,b)};ce(f,E=>{u(h)?E(g):E(p,-1)})}var v=C(d,2),_=C(v,2);ie("click",v,n),ie("click",_,()=>e.onchange("")),F(o,l)},i=o=>{var l=Xw();ie("click",l,n),F(o,l)};ce(s,o=>{e.value?o(a):o(i,-1)})}re(()=>Ee(r,"aria-labelledby",e.labelledBy)),F(t,r),it()}Tt(["click"]);var Jw=z('<p class="note error svelte-1v8pkea"> </p>'),eS=z('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),tS=z('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),nS=z('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),rS=z('<section class="preview svelte-1v8pkea" aria-label="Preview"><header class="bar svelte-1v8pkea"><strong class="title svelte-1v8pkea">Preview</strong> <span class="dims svelte-1v8pkea" title="Current preview width"> </span> <button type="button" class="close svelte-1v8pkea" title="Close preview" aria-label="Close preview"><!></button></header> <div class="frame svelte-1v8pkea"><!></div></section>');function sS(t,e){at(e,!0);let n=Q(""),r=Q("loading"),s=Q(""),a=Q(0),i=Q(void 0),o={x:0,y:0};function l(){var H;try{const G=(H=u(i))==null?void 0:H.contentWindow;G&&(o={x:G.scrollX,y:G.scrollY})}catch{}}function d(){var H,G;try{(G=(H=u(i))==null?void 0:H.contentWindow)==null||G.scrollTo(o.x,o.y)}catch{}}let f;Rt(()=>{const H=e.previewItem,G=e.path;if(clearTimeout(f),H===null){T(r,"loading");return}return f=setTimeout(()=>void g(G,H),350),()=>clearTimeout(f)});async function g(H,G){try{const X=await A6(H,G);if(X===void 0){T(r,"empty");return}l(),T(n,X,!0),T(r,"ready")}catch(X){T(s,X instanceof Error?X.message:String(X),!0),T(r,"error")}}var h=rS(),p=y(h),v=C(y(p),2),_=y(v),E=C(v,2),b=y(E);Wh(b,{size:18,"aria-hidden":"true"});var x=C(p,2),O=y(x);{var M=H=>{var G=Jw(),X=y(G);re(()=>ae(X,`Couldn’t render preview: ${u(s)??""}`)),F(H,G)},B=H=>{var G=eS();F(H,G)},J=H=>{var G=nS(),X=tt(G);mn(X,j=>T(i,j),()=>u(i));var ee=C(X,2);{var A=j=>{var w=tS();F(j,w)};ce(ee,j=>{u(r)==="loading"&&j(A)})}re(()=>Ee(X,"srcdoc",u(n))),He("load",X,d),F(H,G)};ce(O,H=>{u(r)==="error"?H(M):u(r)==="empty"?H(B,1):H(J,-1)})}re(H=>ae(_,`${H??""}px`),[()=>Math.round(u(a))]),ie("click",E,function(...H){var G;(G=e.onclose)==null||G.apply(this,H)}),sT(x,"clientWidth",H=>T(a,H)),F(t,h),it()}Tt(["click"]);var Fv=typeof global=="object"&&global&&global.Object===Object&&global,aS=typeof self=="object"&&self&&self.Object===Object&&self,os=Fv||aS||Function("return this")(),na=os.Symbol,Uv=Object.prototype,iS=Uv.hasOwnProperty,oS=Uv.toString,bo=na?na.toStringTag:void 0;function uS(t){var e=iS.call(t,bo),n=t[bo];try{t[bo]=void 0;var r=!0}catch{}var s=oS.call(t);return r&&(e?t[bo]=n:delete t[bo]),s}var lS=Object.prototype,cS=lS.toString;function dS(t){return cS.call(t)}var fS="[object Null]",hS="[object Undefined]",Bp=na?na.toStringTag:void 0;function ao(t){return t==null?t===void 0?hS:fS:Bp&&Bp in Object(t)?uS(t):dS(t)}function ws(t){return t!=null&&typeof t=="object"}var Ga=Array.isArray;function oa(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Hv(t){return t}var pS="[object AsyncFunction]",mS="[object Function]",gS="[object GeneratorFunction]",vS="[object Proxy]";function Xh(t){if(!oa(t))return!1;var e=ao(t);return e==mS||e==gS||e==pS||e==vS}var td=os["__core-js_shared__"],Fp=(function(){var t=/[^.]+$/.exec(td&&td.keys&&td.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function bS(t){return!!Fp&&Fp in t}var ES=Function.prototype,_S=ES.toString;function ti(t){if(t!=null){try{return _S.call(t)}catch{}try{return t+""}catch{}}return""}var TS=/[\\^$.*+?()[\]{}|]/g,AS=/^\[object .+?Constructor\]$/,yS=Function.prototype,NS=Object.prototype,wS=yS.toString,SS=NS.hasOwnProperty,IS=RegExp("^"+wS.call(SS).replace(TS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CS(t){if(!oa(t)||bS(t))return!1;var e=Xh(t)?IS:AS;return e.test(ti(t))}function LS(t,e){return t==null?void 0:t[e]}function ni(t,e){var n=LS(t,e);return CS(n)?n:void 0}var Cf=ni(os,"WeakMap"),Up=Object.create,OS=(function(){function t(){}return function(e){if(!oa(e))return{};if(Up)return Up(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function xS(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function RS(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var DS=800,kS=16,PS=Date.now;function MS(t){var e=0,n=0;return function(){var r=PS(),s=kS-(r-n);if(n=r,s>0){if(++e>=DS)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function BS(t){return function(){return t}}var Fl=(function(){try{var t=ni(Object,"defineProperty");return t({},"",{}),t}catch{}})(),FS=Fl?function(t,e){return Fl(t,"toString",{configurable:!0,enumerable:!1,value:BS(e),writable:!0})}:Hv,US=MS(FS);function HS(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var qS=9007199254740991,jS=/^(?:0|[1-9]\d*)$/;function qv(t,e){var n=typeof t;return e=e??qS,!!e&&(n=="number"||n!="symbol"&&jS.test(t))&&t>-1&&t%1==0&&t<e}function Qh(t,e,n){e=="__proto__"&&Fl?Fl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Au(t,e){return t===e||t!==t&&e!==e}var $S=Object.prototype,YS=$S.hasOwnProperty;function jv(t,e,n){var r=t[e];(!(YS.call(t,e)&&Au(r,n))||n===void 0&&!(e in t))&&Qh(t,e,n)}function zS(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),s?Qh(n,o,l):jv(n,o,l)}return n}var Hp=Math.max;function WS(t,e,n){return e=Hp(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=Hp(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=n(i),xS(t,this,o)}}function GS(t,e){return US(WS(t,e,Hv),t+"")}var KS=9007199254740991;function $v(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=KS}function fc(t){return t!=null&&$v(t.length)&&!Xh(t)}function VS(t,e,n){if(!oa(n))return!1;var r=typeof e;return(r=="number"?fc(n)&&qv(e,n.length):r=="string"&&e in n)?Au(n[e],t):!1}function XS(t){return GS(function(e,n){var r=-1,s=n.length,a=s>1?n[s-1]:void 0,i=s>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(s--,a):void 0,i&&VS(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=n[r];o&&t(e,o,r,a)}return e})}var QS=Object.prototype;function Zh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||QS;return t===n}function ZS(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var JS="[object Arguments]";function qp(t){return ws(t)&&ao(t)==JS}var Yv=Object.prototype,eI=Yv.hasOwnProperty,tI=Yv.propertyIsEnumerable,Lf=qp((function(){return arguments})())?qp:function(t){return ws(t)&&eI.call(t,"callee")&&!tI.call(t,"callee")};function nI(){return!1}var zv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jp=zv&&typeof module=="object"&&module&&!module.nodeType&&module,rI=jp&&jp.exports===zv,$p=rI?os.Buffer:void 0,sI=$p?$p.isBuffer:void 0,Zo=sI||nI,aI="[object Arguments]",iI="[object Array]",oI="[object Boolean]",uI="[object Date]",lI="[object Error]",cI="[object Function]",dI="[object Map]",fI="[object Number]",hI="[object Object]",pI="[object RegExp]",mI="[object Set]",gI="[object String]",vI="[object WeakMap]",bI="[object ArrayBuffer]",EI="[object DataView]",_I="[object Float32Array]",TI="[object Float64Array]",AI="[object Int8Array]",yI="[object Int16Array]",NI="[object Int32Array]",wI="[object Uint8Array]",SI="[object Uint8ClampedArray]",II="[object Uint16Array]",CI="[object Uint32Array]",kt={};kt[_I]=kt[TI]=kt[AI]=kt[yI]=kt[NI]=kt[wI]=kt[SI]=kt[II]=kt[CI]=!0;kt[aI]=kt[iI]=kt[bI]=kt[oI]=kt[EI]=kt[uI]=kt[lI]=kt[cI]=kt[dI]=kt[fI]=kt[hI]=kt[pI]=kt[mI]=kt[gI]=kt[vI]=!1;function LI(t){return ws(t)&&$v(t.length)&&!!kt[ao(t)]}function Jh(t){return function(e){return t(e)}}var Wv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Uo=Wv&&typeof module=="object"&&module&&!module.nodeType&&module,OI=Uo&&Uo.exports===Wv,nd=OI&&Fv.process,Vi=(function(){try{var t=Uo&&Uo.require&&Uo.require("util").types;return t||nd&&nd.binding&&nd.binding("util")}catch{}})(),Yp=Vi&&Vi.isTypedArray,e0=Yp?Jh(Yp):LI,xI=Object.prototype,RI=xI.hasOwnProperty;function Gv(t,e){var n=Ga(t),r=!n&&Lf(t),s=!n&&!r&&Zo(t),a=!n&&!r&&!s&&e0(t),i=n||r||s||a,o=i?ZS(t.length,String):[],l=o.length;for(var d in t)(e||RI.call(t,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||qv(d,l)))&&o.push(d);return o}function Kv(t,e){return function(n){return t(e(n))}}var DI=Kv(Object.keys,Object),kI=Object.prototype,PI=kI.hasOwnProperty;function MI(t){if(!Zh(t))return DI(t);var e=[];for(var n in Object(t))PI.call(t,n)&&n!="constructor"&&e.push(n);return e}function BI(t){return fc(t)?Gv(t):MI(t)}function FI(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var UI=Object.prototype,HI=UI.hasOwnProperty;function qI(t){if(!oa(t))return FI(t);var e=Zh(t),n=[];for(var r in t)r=="constructor"&&(e||!HI.call(t,r))||n.push(r);return n}function Vv(t){return fc(t)?Gv(t,!0):qI(t)}var Jo=ni(Object,"create");function jI(){this.__data__=Jo?Jo(null):{},this.size=0}function $I(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var YI="__lodash_hash_undefined__",zI=Object.prototype,WI=zI.hasOwnProperty;function GI(t){var e=this.__data__;if(Jo){var n=e[t];return n===YI?void 0:n}return WI.call(e,t)?e[t]:void 0}var KI=Object.prototype,VI=KI.hasOwnProperty;function XI(t){var e=this.__data__;return Jo?e[t]!==void 0:VI.call(e,t)}var QI="__lodash_hash_undefined__";function ZI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Jo&&e===void 0?QI:e,this}function Ka(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ka.prototype.clear=jI;Ka.prototype.delete=$I;Ka.prototype.get=GI;Ka.prototype.has=XI;Ka.prototype.set=ZI;function JI(){this.__data__=[],this.size=0}function hc(t,e){for(var n=t.length;n--;)if(Au(t[n][0],e))return n;return-1}var eC=Array.prototype,tC=eC.splice;function nC(t){var e=this.__data__,n=hc(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():tC.call(e,n,1),--this.size,!0}function rC(t){var e=this.__data__,n=hc(e,t);return n<0?void 0:e[n][1]}function sC(t){return hc(this.__data__,t)>-1}function aC(t,e){var n=this.__data__,r=hc(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Cs(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Cs.prototype.clear=JI;Cs.prototype.delete=nC;Cs.prototype.get=rC;Cs.prototype.has=sC;Cs.prototype.set=aC;var eu=ni(os,"Map");function iC(){this.size=0,this.__data__={hash:new Ka,map:new(eu||Cs),string:new Ka}}function oC(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pc(t,e){var n=t.__data__;return oC(e)?n[typeof e=="string"?"string":"hash"]:n.map}function uC(t){var e=pc(this,t).delete(t);return this.size-=e?1:0,e}function lC(t){return pc(this,t).get(t)}function cC(t){return pc(this,t).has(t)}function dC(t,e){var n=pc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ri(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ri.prototype.clear=iC;ri.prototype.delete=uC;ri.prototype.get=lC;ri.prototype.has=cC;ri.prototype.set=dC;function fC(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var Xv=Kv(Object.getPrototypeOf,Object),hC="[object Object]",pC=Function.prototype,mC=Object.prototype,Qv=pC.toString,gC=mC.hasOwnProperty,vC=Qv.call(Object);function bC(t){if(!ws(t)||ao(t)!=hC)return!1;var e=Xv(t);if(e===null)return!0;var n=gC.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Qv.call(n)==vC}function EC(){this.__data__=new Cs,this.size=0}function _C(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function TC(t){return this.__data__.get(t)}function AC(t){return this.__data__.has(t)}var yC=200;function NC(t,e){var n=this.__data__;if(n instanceof Cs){var r=n.__data__;if(!eu||r.length<yC-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ri(r)}return n.set(t,e),this.size=n.size,this}function es(t){var e=this.__data__=new Cs(t);this.size=e.size}es.prototype.clear=EC;es.prototype.delete=_C;es.prototype.get=TC;es.prototype.has=AC;es.prototype.set=NC;var Zv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zp=Zv&&typeof module=="object"&&module&&!module.nodeType&&module,wC=zp&&zp.exports===Zv,Wp=wC?os.Buffer:void 0,Gp=Wp?Wp.allocUnsafe:void 0;function Jv(t,e){if(e)return t.slice();var n=t.length,r=Gp?Gp(n):new t.constructor(n);return t.copy(r),r}function SC(t,e){for(var n=-1,r=t==null?0:t.length,s=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[s++]=i)}return a}function IC(){return[]}var CC=Object.prototype,LC=CC.propertyIsEnumerable,Kp=Object.getOwnPropertySymbols,OC=Kp?function(t){return t==null?[]:(t=Object(t),SC(Kp(t),function(e){return LC.call(t,e)}))}:IC;function xC(t,e,n){var r=e(t);return Ga(t)?r:fC(r,n(t))}function Of(t){return xC(t,BI,OC)}var xf=ni(os,"DataView"),Rf=ni(os,"Promise"),Df=ni(os,"Set"),Vp="[object Map]",RC="[object Object]",Xp="[object Promise]",Qp="[object Set]",Zp="[object WeakMap]",Jp="[object DataView]",DC=ti(xf),kC=ti(eu),PC=ti(Rf),MC=ti(Df),BC=ti(Cf),Sr=ao;(xf&&Sr(new xf(new ArrayBuffer(1)))!=Jp||eu&&Sr(new eu)!=Vp||Rf&&Sr(Rf.resolve())!=Xp||Df&&Sr(new Df)!=Qp||Cf&&Sr(new Cf)!=Zp)&&(Sr=function(t){var e=ao(t),n=e==RC?t.constructor:void 0,r=n?ti(n):"";if(r)switch(r){case DC:return Jp;case kC:return Vp;case PC:return Xp;case MC:return Qp;case BC:return Zp}return e});var FC=Object.prototype,UC=FC.hasOwnProperty;function HC(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&UC.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Ul=os.Uint8Array;function t0(t){var e=new t.constructor(t.byteLength);return new Ul(e).set(new Ul(t)),e}function qC(t,e){var n=t0(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var jC=/\w*$/;function $C(t){var e=new t.constructor(t.source,jC.exec(t));return e.lastIndex=t.lastIndex,e}var e1=na?na.prototype:void 0,t1=e1?e1.valueOf:void 0;function YC(t){return t1?Object(t1.call(t)):{}}function eb(t,e){var n=e?t0(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var zC="[object Boolean]",WC="[object Date]",GC="[object Map]",KC="[object Number]",VC="[object RegExp]",XC="[object Set]",QC="[object String]",ZC="[object Symbol]",JC="[object ArrayBuffer]",e4="[object DataView]",t4="[object Float32Array]",n4="[object Float64Array]",r4="[object Int8Array]",s4="[object Int16Array]",a4="[object Int32Array]",i4="[object Uint8Array]",o4="[object Uint8ClampedArray]",u4="[object Uint16Array]",l4="[object Uint32Array]";function c4(t,e,n){var r=t.constructor;switch(e){case JC:return t0(t);case zC:case WC:return new r(+t);case e4:return qC(t);case t4:case n4:case r4:case s4:case a4:case i4:case o4:case u4:case l4:return eb(t,n);case GC:return new r;case KC:case QC:return new r(t);case VC:return $C(t);case XC:return new r;case ZC:return YC(t)}}function tb(t){return typeof t.constructor=="function"&&!Zh(t)?OS(Xv(t)):{}}var d4="[object Map]";function f4(t){return ws(t)&&Sr(t)==d4}var n1=Vi&&Vi.isMap,h4=n1?Jh(n1):f4,p4="[object Set]";function m4(t){return ws(t)&&Sr(t)==p4}var r1=Vi&&Vi.isSet,g4=r1?Jh(r1):m4,v4=1,nb="[object Arguments]",b4="[object Array]",E4="[object Boolean]",_4="[object Date]",T4="[object Error]",rb="[object Function]",A4="[object GeneratorFunction]",y4="[object Map]",N4="[object Number]",sb="[object Object]",w4="[object RegExp]",S4="[object Set]",I4="[object String]",C4="[object Symbol]",L4="[object WeakMap]",O4="[object ArrayBuffer]",x4="[object DataView]",R4="[object Float32Array]",D4="[object Float64Array]",k4="[object Int8Array]",P4="[object Int16Array]",M4="[object Int32Array]",B4="[object Uint8Array]",F4="[object Uint8ClampedArray]",U4="[object Uint16Array]",H4="[object Uint32Array]",Ot={};Ot[nb]=Ot[b4]=Ot[O4]=Ot[x4]=Ot[E4]=Ot[_4]=Ot[R4]=Ot[D4]=Ot[k4]=Ot[P4]=Ot[M4]=Ot[y4]=Ot[N4]=Ot[sb]=Ot[w4]=Ot[S4]=Ot[I4]=Ot[C4]=Ot[B4]=Ot[F4]=Ot[U4]=Ot[H4]=!0;Ot[T4]=Ot[rb]=Ot[L4]=!1;function gl(t,e,n,r,s,a){var i,o=e&v4;if(i!==void 0)return i;if(!oa(t))return t;var l=Ga(t);if(l)i=HC(t);else{var d=Sr(t),f=d==rb||d==A4;if(Zo(t))return Jv(t,o);if(d==sb||d==nb||f&&!s)i=f?{}:tb(t);else{if(!Ot[d])return s?t:{};i=c4(t,d,o)}}a||(a=new es);var g=a.get(t);if(g)return g;a.set(t,i),g4(t)?t.forEach(function(v){i.add(gl(v,e,n,v,t,a))}):h4(t)&&t.forEach(function(v,_){i.set(_,gl(v,e,n,_,t,a))});var h=Of,p=l?void 0:h(t);return HS(p||t,function(v,_){p&&(_=v,v=t[_]),jv(i,_,gl(v,e,n,_,t,a))}),i}var q4=1,j4=4;function Si(t){return gl(t,q4|j4)}var $4="__lodash_hash_undefined__";function Y4(t){return this.__data__.set(t,$4),this}function z4(t){return this.__data__.has(t)}function Hl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ri;++e<n;)this.add(t[e])}Hl.prototype.add=Hl.prototype.push=Y4;Hl.prototype.has=z4;function W4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function G4(t,e){return t.has(e)}var K4=1,V4=2;function ab(t,e,n,r,s,a){var i=n&K4,o=t.length,l=e.length;if(o!=l&&!(i&&l>o))return!1;var d=a.get(t),f=a.get(e);if(d&&f)return d==e&&f==t;var g=-1,h=!0,p=n&V4?new Hl:void 0;for(a.set(t,e),a.set(e,t);++g<o;){var v=t[g],_=e[g];if(r)var E=i?r(_,v,g,e,t,a):r(v,_,g,t,e,a);if(E!==void 0){if(E)continue;h=!1;break}if(p){if(!W4(e,function(b,x){if(!G4(p,x)&&(v===b||s(v,b,n,r,a)))return p.push(x)})){h=!1;break}}else if(!(v===_||s(v,_,n,r,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function X4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function Q4(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Z4=1,J4=2,eL="[object Boolean]",tL="[object Date]",nL="[object Error]",rL="[object Map]",sL="[object Number]",aL="[object RegExp]",iL="[object Set]",oL="[object String]",uL="[object Symbol]",lL="[object ArrayBuffer]",cL="[object DataView]",s1=na?na.prototype:void 0,rd=s1?s1.valueOf:void 0;function dL(t,e,n,r,s,a,i){switch(n){case cL:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case lL:return!(t.byteLength!=e.byteLength||!a(new Ul(t),new Ul(e)));case eL:case tL:case sL:return Au(+t,+e);case nL:return t.name==e.name&&t.message==e.message;case aL:case oL:return t==e+"";case rL:var o=X4;case iL:var l=r&Z4;if(o||(o=Q4),t.size!=e.size&&!l)return!1;var d=i.get(t);if(d)return d==e;r|=J4,i.set(t,e);var f=ab(o(t),o(e),r,s,a,i);return i.delete(t),f;case uL:if(rd)return rd.call(t)==rd.call(e)}return!1}var fL=1,hL=Object.prototype,pL=hL.hasOwnProperty;function mL(t,e,n,r,s,a){var i=n&fL,o=Of(t),l=o.length,d=Of(e),f=d.length;if(l!=f&&!i)return!1;for(var g=l;g--;){var h=o[g];if(!(i?h in e:pL.call(e,h)))return!1}var p=a.get(t),v=a.get(e);if(p&&v)return p==e&&v==t;var _=!0;a.set(t,e),a.set(e,t);for(var E=i;++g<l;){h=o[g];var b=t[h],x=e[h];if(r)var O=i?r(x,b,h,e,t,a):r(b,x,h,t,e,a);if(!(O===void 0?b===x||s(b,x,n,r,a):O)){_=!1;break}E||(E=h=="constructor")}if(_&&!E){var M=t.constructor,B=e.constructor;M!=B&&"constructor"in t&&"constructor"in e&&!(typeof M=="function"&&M instanceof M&&typeof B=="function"&&B instanceof B)&&(_=!1)}return a.delete(t),a.delete(e),_}var gL=1,a1="[object Arguments]",i1="[object Array]",Gu="[object Object]",vL=Object.prototype,o1=vL.hasOwnProperty;function bL(t,e,n,r,s,a){var i=Ga(t),o=Ga(e),l=i?i1:Sr(t),d=o?i1:Sr(e);l=l==a1?Gu:l,d=d==a1?Gu:d;var f=l==Gu,g=d==Gu,h=l==d;if(h&&Zo(t)){if(!Zo(e))return!1;i=!0,f=!1}if(h&&!f)return a||(a=new es),i||e0(t)?ab(t,e,n,r,s,a):dL(t,e,l,n,r,s,a);if(!(n&gL)){var p=f&&o1.call(t,"__wrapped__"),v=g&&o1.call(e,"__wrapped__");if(p||v){var _=p?t.value():t,E=v?e.value():e;return a||(a=new es),s(_,E,n,r,a)}}return h?(a||(a=new es),mL(t,e,n,r,s,a)):!1}function ib(t,e,n,r,s){return t===e?!0:t==null||e==null||!ws(t)&&!ws(e)?t!==t&&e!==e:bL(t,e,n,r,ib,s)}function EL(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),o=i.length;o--;){var l=i[++s];if(n(a[l],l,a)===!1)break}return e}}var _L=EL();function kf(t,e,n){(n!==void 0&&!Au(t[e],n)||n===void 0&&!(e in t))&&Qh(t,e,n)}function TL(t){return ws(t)&&fc(t)}function Pf(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function AL(t){return zS(t,Vv(t))}function yL(t,e,n,r,s,a,i){var o=Pf(t,n),l=Pf(e,n),d=i.get(l);if(d){kf(t,n,d);return}var f=a?a(o,l,n+"",t,e,i):void 0,g=f===void 0;if(g){var h=Ga(l),p=!h&&Zo(l),v=!h&&!p&&e0(l);f=l,h||p||v?Ga(o)?f=o:TL(o)?f=RS(o):p?(g=!1,f=Jv(l,!0)):v?(g=!1,f=eb(l,!0)):f=[]:bC(l)||Lf(l)?(f=o,Lf(o)?f=AL(o):(!oa(o)||Xh(o))&&(f=tb(l))):g=!1}g&&(i.set(l,f),s(f,l,r,a,i),i.delete(l)),kf(t,n,f)}function ob(t,e,n,r,s){t!==e&&_L(e,function(a,i){if(s||(s=new es),oa(a))yL(t,e,i,n,ob,r,s);else{var o=r?r(Pf(t,i),a,i+"",t,e,s):void 0;o===void 0&&(o=a),kf(t,i,o)}},Vv)}function n0(t,e){return ib(t,e)}var ea=XS(function(t,e,n){ob(t,e,n)}),Re=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(Re||{});class as{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Re.TYPE&Re.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Re.LEVEL|s:Re.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class Ii extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const ub=class Mf{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const s=this.query(n);if(s==null)throw new Ii(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),o=new a(e,i,r);return Mf.blots.set(o.domNode,o),o}find(e,n=!1){return Mf.find(e,n)}query(e,n=Re.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Re.LEVEL&Re.BLOCK?r=this.types.block:e&Re.LEVEL&Re.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&Re.LEVEL&r.scope&&n&Re.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,s="attrName"in n;if(!r&&!s)throw new Ii("Invalid definition");if(r&&n.blotName==="abstract")throw new Ii("Cannot register abstract class");const a=r?n.blotName:s?n.attrName:void 0;return this.types[a]=n,s?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(i=>i.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(i=>{(this.tags[i]==null||n.className==null)&&(this.tags[i]=n)}))),n})}};ub.blots=new WeakMap;let Xi=ub;function u1(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class NL extends as{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){u1(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(u1(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Br=NL;function sd(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class wL extends as{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[sd(this.keyName)]=n,!0):!1}remove(e){e.style[sd(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[sd(this.keyName)];return this.canAdd(e,n)?n:""}}const ua=wL;class SL{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Xi.find(this.domNode);if(e==null)return;const n=as.keys(this.domNode),r=Br.keys(this.domNode),s=ua.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Re.ATTRIBUTE);i instanceof as&&(this.attributes[i.attrName]=i)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const mc=SL,lb=class{constructor(e,n){this.scroll=e,this.domNode=n,Xi.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Ii("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Xi.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,s){const a=this.isolate(e,n);if(this.scroll.query(r,Re.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Re.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);a.wrap(i),i.format(r,s)}}insertAt(e,n,r){const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Ii(`Cannot wrap ${e}`);return r.appendChild(this),r}};lb.blotName="abstract";let cb=lb;const db=class extends cb{static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};db.scope=Re.INLINE_BLOT;let IL=db;const In=IL;class CL{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),s=0;for(;r;){if(r===e)return s;s+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||n&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[s,a]=this.find(e);let i=e-a;const o=this.iterator(s);let l=o();for(;l&&i<e+n;){const d=l.length();e>i?r(l,e-i,Math.min(n,i+d-e)):r(l,0,Math.min(d,e+n-i)),i+=d,l=o()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let s=r();for(;s;)n=e(n,s),s=r();return n}}function l1(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Re.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const fb=class Bs extends cb{constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Bs.uiClass&&this.uiNode.classList.add(Bs.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new CL,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=l1(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof Ii)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,s,a)=>{r.deleteAt(s,a)})}descendant(e,n=0){const[r,s]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof Bs?r.descendant(e,s):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(n,r,(i,o,l)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Bs&&(s=s.concat(i.descendants(e,o,a))),a-=l}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===Re.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Bs?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,o)=>{a.formatAt(i,o,r,s)})}insertAt(e,n,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,n,r);else{const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(i)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,s]=this.children.find(e,n),a=[[this,e]];return r instanceof Bs?a.concat(r.path(s,n)):(r!=null&&a.push([r,s]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof Bs&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,i)=>{const o=s.split(a,n);o!=null&&r.appendChild(o)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const i=this.scroll.find(a);i!=null&&(i.domNode.parentNode==null||i.domNode.parentNode===this.domNode)&&i.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,i)=>a===i?0:a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let i=null;a.nextSibling!=null&&(i=this.scroll.find(a.nextSibling));const o=l1(a,this.scroll);(o.next!==i||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,i||void 0))}),this.enforceAllowedChildren()}};fb.uiClass="";let LL=fb;const Rr=LL;function OL(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const hi=class pi extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(pi.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new mc(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof pi||(r=r.wrap(pi.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Re.INLINE);if(r==null)return;r instanceof as?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.formats()[r]!=null||this.scroll.query(r,Re.ATTRIBUTE)?this.isolate(e,n).format(r,s):super.formatAt(e,n,r,s)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof pi&&r.prev===this&&OL(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof pi&&this.attributes.move(r),r}};hi.allowedChildren=[hi,In],hi.blotName="inline",hi.scope=Re.INLINE_BLOT,hi.tagName="SPAN";let xL=hi;const r0=xL,mi=class Bf extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Bf.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new mc(this.domNode)}format(e,n){const r=this.scroll.query(e,Re.BLOCK);r!=null&&(r instanceof as?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(Bf.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.scroll.query(r,Re.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Re.INLINE)!=null)super.insertAt(e,n,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(n,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};mi.blotName="block",mi.scope=Re.BLOCK_BLOT,mi.tagName="P",mi.allowedChildren=[r0,mi,In];let RL=mi;const tu=RL,Ff=class extends Rr{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ff.blotName="container",Ff.scope=Re.BLOCK_BLOT;let DL=Ff;const gc=DL;class kL extends In{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,s){e===0&&n===this.length()?this.format(r,s):super.formatAt(e,n,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Qn=kL,PL={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},ML=100,gi=class extends Rr{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,PL),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=Re.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,s){this.update(),super.formatAt(e,n,r,s)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(l,d=!0)=>{l==null||l===this||l.domNode.parentNode!=null&&(r.has(l.domNode)||r.set(l.domNode,[]),d&&a(l.parent))},i=l=>{r.has(l.domNode)&&(l instanceof Rr&&l.children.forEach(i),r.delete(l.domNode),l.optimize(n))};let o=e;for(let l=0;o.length>0;l+=1){if(l>=ML)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const f=this.find(d.target,!0);f!=null&&(f.domNode===d.target&&(d.type==="childList"?(a(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(g=>{const h=this.find(g,!1);a(h,!1),h instanceof Rr&&h.children.forEach(p=>{a(p,!1)})})):d.type==="attributes"&&a(f.prev)),a(f))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};gi.blotName="scroll",gi.defaultChild=tu,gi.allowedChildren=[tu,gc],gi.scope=Re.BLOCK_BLOT,gi.tagName="DIV";let BL=gi;const s0=BL,Uf=class hb extends In{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof hb&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Uf.blotName="text",Uf.scope=Re.INLINE_BLOT;let FL=Uf;const ql=FL,UL=Object.freeze(Object.defineProperty({__proto__:null,Attributor:as,AttributorStore:mc,BlockBlot:tu,ClassAttributor:Br,ContainerBlot:gc,EmbedBlot:Qn,InlineBlot:r0,LeafBlot:In,ParentBlot:Rr,Registry:Xi,Scope:Re,ScrollBlot:s0,StyleAttributor:ua,TextBlot:ql},Symbol.toStringTag,{value:"Module"}));var Gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ku={exports:{}},ad,c1;function HL(){if(c1)return ad;c1=1;var t=-1,e=1,n=0;function r(A,j,w,S,R){if(A===j)return A?[[n,A]]:[];if(w!=null){var k=X(A,j,w);if(k)return k}var W=o(A,j),$=A.substring(0,W);A=A.substring(W),j=j.substring(W),W=d(A,j);var Y=A.substring(A.length-W);A=A.substring(0,A.length-W),j=j.substring(0,j.length-W);var U=s(A,j);return $&&U.unshift([n,$]),Y&&U.push([n,Y]),x(U,R),S&&g(U),U}function s(A,j){var w;if(!A)return[[e,j]];if(!j)return[[t,A]];var S=A.length>j.length?A:j,R=A.length>j.length?j:A,k=S.indexOf(R);if(k!==-1)return w=[[e,S.substring(0,k)],[n,R],[e,S.substring(k+R.length)]],A.length>j.length&&(w[0][0]=w[2][0]=t),w;if(R.length===1)return[[t,A],[e,j]];var W=f(A,j);if(W){var $=W[0],Y=W[1],U=W[2],K=W[3],te=W[4],fe=r($,U),me=r(Y,K);return fe.concat([[n,te]],me)}return a(A,j)}function a(A,j){for(var w=A.length,S=j.length,R=Math.ceil((w+S)/2),k=R,W=2*R,$=new Array(W),Y=new Array(W),U=0;U<W;U++)$[U]=-1,Y[U]=-1;$[k+1]=0,Y[k+1]=0;for(var K=w-S,te=K%2!==0,fe=0,me=0,ge=0,Le=0,de=0;de<R;de++){for(var ve=-de+fe;ve<=de-me;ve+=2){var Ie=k+ve,se;ve===-de||ve!==de&&$[Ie-1]<$[Ie+1]?se=$[Ie+1]:se=$[Ie-1]+1;for(var he=se-ve;se<w&&he<S&&A.charAt(se)===j.charAt(he);)se++,he++;if($[Ie]=se,se>w)me+=2;else if(he>S)fe+=2;else if(te){var Ae=k+K-ve;if(Ae>=0&&Ae<W&&Y[Ae]!==-1){var Ce=w-Y[Ae];if(se>=Ce)return i(A,j,se,he)}}}for(var Me=-de+ge;Me<=de-Le;Me+=2){var Ae=k+Me,Ce;Me===-de||Me!==de&&Y[Ae-1]<Y[Ae+1]?Ce=Y[Ae+1]:Ce=Y[Ae-1]+1;for(var ke=Ce-Me;Ce<w&&ke<S&&A.charAt(w-Ce-1)===j.charAt(S-ke-1);)Ce++,ke++;if(Y[Ae]=Ce,Ce>w)Le+=2;else if(ke>S)ge+=2;else if(!te){var Ie=k+K-Me;if(Ie>=0&&Ie<W&&$[Ie]!==-1){var se=$[Ie],he=k+se-Ie;if(Ce=w-Ce,se>=Ce)return i(A,j,se,he)}}}}return[[t,A],[e,j]]}function i(A,j,w,S){var R=A.substring(0,w),k=j.substring(0,S),W=A.substring(w),$=j.substring(S),Y=r(R,k),U=r(W,$);return Y.concat(U)}function o(A,j){if(!A||!j||A.charAt(0)!==j.charAt(0))return 0;for(var w=0,S=Math.min(A.length,j.length),R=S,k=0;w<R;)A.substring(k,R)==j.substring(k,R)?(w=R,k=w):S=R,R=Math.floor((S-w)/2+w);return O(A.charCodeAt(R-1))&&R--,R}function l(A,j){var w=A.length,S=j.length;if(w==0||S==0)return 0;w>S?A=A.substring(w-S):w<S&&(j=j.substring(0,w));var R=Math.min(w,S);if(A==j)return R;for(var k=0,W=1;;){var $=A.substring(R-W),Y=j.indexOf($);if(Y==-1)return k;W+=Y,(Y==0||A.substring(R-W)==j.substring(0,W))&&(k=W,W++)}}function d(A,j){if(!A||!j||A.slice(-1)!==j.slice(-1))return 0;for(var w=0,S=Math.min(A.length,j.length),R=S,k=0;w<R;)A.substring(A.length-R,A.length-k)==j.substring(j.length-R,j.length-k)?(w=R,k=w):S=R,R=Math.floor((S-w)/2+w);return M(A.charCodeAt(A.length-R))&&R--,R}function f(A,j){var w=A.length>j.length?A:j,S=A.length>j.length?j:A;if(w.length<4||S.length*2<w.length)return null;function R(me,ge,Le){for(var de=me.substring(Le,Le+Math.floor(me.length/4)),ve=-1,Ie="",se,he,Ae,Ce;(ve=ge.indexOf(de,ve+1))!==-1;){var Me=o(me.substring(Le),ge.substring(ve)),ke=d(me.substring(0,Le),ge.substring(0,ve));Ie.length<ke+Me&&(Ie=ge.substring(ve-ke,ve)+ge.substring(ve,ve+Me),se=me.substring(0,Le-ke),he=me.substring(Le+Me),Ae=ge.substring(0,ve-ke),Ce=ge.substring(ve+Me))}return Ie.length*2>=me.length?[se,he,Ae,Ce,Ie]:null}var k=R(w,S,Math.ceil(w.length/4)),W=R(w,S,Math.ceil(w.length/2)),$;if(!k&&!W)return null;W?k?$=k[4].length>W[4].length?k:W:$=W:$=k;var Y,U,K,te;A.length>j.length?(Y=$[0],U=$[1],K=$[2],te=$[3]):(K=$[0],te=$[1],Y=$[2],U=$[3]);var fe=$[4];return[Y,U,K,te,fe]}function g(A){for(var j=!1,w=[],S=0,R=null,k=0,W=0,$=0,Y=0,U=0;k<A.length;)A[k][0]==n?(w[S++]=k,W=Y,$=U,Y=0,U=0,R=A[k][1]):(A[k][0]==e?Y+=A[k][1].length:U+=A[k][1].length,R&&R.length<=Math.max(W,$)&&R.length<=Math.max(Y,U)&&(A.splice(w[S-1],0,[t,R]),A[w[S-1]+1][0]=e,S--,S--,k=S>0?w[S-1]:-1,W=0,$=0,Y=0,U=0,R=null,j=!0)),k++;for(j&&x(A),b(A),k=1;k<A.length;){if(A[k-1][0]==t&&A[k][0]==e){var K=A[k-1][1],te=A[k][1],fe=l(K,te),me=l(te,K);fe>=me?(fe>=K.length/2||fe>=te.length/2)&&(A.splice(k,0,[n,te.substring(0,fe)]),A[k-1][1]=K.substring(0,K.length-fe),A[k+1][1]=te.substring(fe),k++):(me>=K.length/2||me>=te.length/2)&&(A.splice(k,0,[n,K.substring(0,me)]),A[k-1][0]=e,A[k-1][1]=te.substring(0,te.length-me),A[k+1][0]=t,A[k+1][1]=K.substring(me),k++),k++}k++}}var h=/[^a-zA-Z0-9]/,p=/\s/,v=/[\r\n]/,_=/\n\r?\n$/,E=/^\r?\n\r?\n/;function b(A){function j(me,ge){if(!me||!ge)return 6;var Le=me.charAt(me.length-1),de=ge.charAt(0),ve=Le.match(h),Ie=de.match(h),se=ve&&Le.match(p),he=Ie&&de.match(p),Ae=se&&Le.match(v),Ce=he&&de.match(v),Me=Ae&&me.match(_),ke=Ce&&ge.match(E);return Me||ke?5:Ae||Ce?4:ve&&!se&&he?3:se||he?2:ve||Ie?1:0}for(var w=1;w<A.length-1;){if(A[w-1][0]==n&&A[w+1][0]==n){var S=A[w-1][1],R=A[w][1],k=A[w+1][1],W=d(S,R);if(W){var $=R.substring(R.length-W);S=S.substring(0,S.length-W),R=$+R.substring(0,R.length-W),k=$+k}for(var Y=S,U=R,K=k,te=j(S,R)+j(R,k);R.charAt(0)===k.charAt(0);){S+=R.charAt(0),R=R.substring(1)+k.charAt(0),k=k.substring(1);var fe=j(S,R)+j(R,k);fe>=te&&(te=fe,Y=S,U=R,K=k)}A[w-1][1]!=Y&&(Y?A[w-1][1]=Y:(A.splice(w-1,1),w--),A[w][1]=U,K?A[w+1][1]=K:(A.splice(w+1,1),w--))}w++}}function x(A,j){A.push([n,""]);for(var w=0,S=0,R=0,k="",W="",$;w<A.length;){if(w<A.length-1&&!A[w][1]){A.splice(w,1);continue}switch(A[w][0]){case e:R++,W+=A[w][1],w++;break;case t:S++,k+=A[w][1],w++;break;case n:var Y=w-R-S-1;if(j){if(Y>=0&&J(A[Y][1])){var U=A[Y][1].slice(-1);if(A[Y][1]=A[Y][1].slice(0,-1),k=U+k,W=U+W,!A[Y][1]){A.splice(Y,1),w--;var K=Y-1;A[K]&&A[K][0]===e&&(R++,W=A[K][1]+W,K--),A[K]&&A[K][0]===t&&(S++,k=A[K][1]+k,K--),Y=K}}if(B(A[w][1])){var U=A[w][1].charAt(0);A[w][1]=A[w][1].slice(1),k+=U,W+=U}}if(w<A.length-1&&!A[w][1]){A.splice(w,1);break}if(k.length>0||W.length>0){k.length>0&&W.length>0&&($=o(W,k),$!==0&&(Y>=0?A[Y][1]+=W.substring(0,$):(A.splice(0,0,[n,W.substring(0,$)]),w++),W=W.substring($),k=k.substring($)),$=d(W,k),$!==0&&(A[w][1]=W.substring(W.length-$)+A[w][1],W=W.substring(0,W.length-$),k=k.substring(0,k.length-$)));var te=R+S;k.length===0&&W.length===0?(A.splice(w-te,te),w=w-te):k.length===0?(A.splice(w-te,te,[e,W]),w=w-te+1):W.length===0?(A.splice(w-te,te,[t,k]),w=w-te+1):(A.splice(w-te,te,[t,k],[e,W]),w=w-te+2)}w!==0&&A[w-1][0]===n?(A[w-1][1]+=A[w][1],A.splice(w,1)):w++,R=0,S=0,k="",W="";break}}A[A.length-1][1]===""&&A.pop();var fe=!1;for(w=1;w<A.length-1;)A[w-1][0]===n&&A[w+1][0]===n&&(A[w][1].substring(A[w][1].length-A[w-1][1].length)===A[w-1][1]?(A[w][1]=A[w-1][1]+A[w][1].substring(0,A[w][1].length-A[w-1][1].length),A[w+1][1]=A[w-1][1]+A[w+1][1],A.splice(w-1,1),fe=!0):A[w][1].substring(0,A[w+1][1].length)==A[w+1][1]&&(A[w-1][1]+=A[w+1][1],A[w][1]=A[w][1].substring(A[w+1][1].length)+A[w+1][1],A.splice(w+1,1),fe=!0)),w++;fe&&x(A,j)}function O(A){return A>=55296&&A<=56319}function M(A){return A>=56320&&A<=57343}function B(A){return M(A.charCodeAt(0))}function J(A){return O(A.charCodeAt(A.length-1))}function H(A){for(var j=[],w=0;w<A.length;w++)A[w][1].length>0&&j.push(A[w]);return j}function G(A,j,w,S){return J(A)||B(S)?null:H([[n,A],[t,j],[e,w],[n,S]])}function X(A,j,w){var S=typeof w=="number"?{index:w,length:0}:w.oldRange,R=typeof w=="number"?null:w.newRange,k=A.length,W=j.length;if(S.length===0&&(R===null||R.length===0)){var $=S.index,Y=A.slice(0,$),U=A.slice($),K=R?R.index:null;e:{var te=$+W-k;if(K!==null&&K!==te||te<0||te>W)break e;var fe=j.slice(0,te),me=j.slice(te);if(me!==U)break e;var ge=Math.min($,te),Le=Y.slice(0,ge),de=fe.slice(0,ge);if(Le!==de)break e;var ve=Y.slice(ge),Ie=fe.slice(ge);return G(Le,ve,Ie,U)}e:{if(K!==null&&K!==$)break e;var se=$,fe=j.slice(0,se),me=j.slice(se);if(fe!==Y)break e;var he=Math.min(k-se,W-se),Ae=U.slice(U.length-he),Ce=me.slice(me.length-he);if(Ae!==Ce)break e;var ve=U.slice(0,U.length-he),Ie=me.slice(0,me.length-he);return G(Y,ve,Ie,Ae)}}if(S.length>0&&R&&R.length===0)e:{var Le=A.slice(0,S.index),Ae=A.slice(S.index+S.length),ge=Le.length,he=Ae.length;if(W<ge+he)break e;var de=j.slice(0,ge),Ce=j.slice(W-he);if(Le!==de||Ae!==Ce)break e;var ve=A.slice(ge,k-he),Ie=j.slice(ge,W-he);return G(Le,ve,Ie,Ae)}return null}function ee(A,j,w,S){return r(A,j,w,S,!0)}return ee.INSERT=e,ee.DELETE=t,ee.EQUAL=n,ad=ee,ad}var No={exports:{}};No.exports;var d1;function mb(){return d1||(d1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",o="[object Boolean]",l="[object Date]",d="[object Error]",f="[object Function]",g="[object GeneratorFunction]",h="[object Map]",p="[object Number]",v="[object Object]",_="[object Promise]",E="[object RegExp]",b="[object Set]",x="[object String]",O="[object Symbol]",M="[object WeakMap]",B="[object ArrayBuffer]",J="[object DataView]",H="[object Float32Array]",G="[object Float64Array]",X="[object Int8Array]",ee="[object Int16Array]",A="[object Int32Array]",j="[object Uint8Array]",w="[object Uint8ClampedArray]",S="[object Uint16Array]",R="[object Uint32Array]",k=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,$=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,U={};U[a]=U[i]=U[B]=U[J]=U[o]=U[l]=U[H]=U[G]=U[X]=U[ee]=U[A]=U[h]=U[p]=U[v]=U[E]=U[b]=U[x]=U[O]=U[j]=U[w]=U[S]=U[R]=!0,U[d]=U[f]=U[M]=!1;var K=typeof Gs=="object"&&Gs&&Gs.Object===Object&&Gs,te=typeof self=="object"&&self&&self.Object===Object&&self,fe=K||te||Function("return this")(),me=e&&!e.nodeType&&e,ge=me&&!0&&t&&!t.nodeType&&t,Le=ge&&ge.exports===me;function de(m,N){return m.set(N[0],N[1]),m}function ve(m,N){return m.add(N),m}function Ie(m,N){for(var q=-1,oe=m?m.length:0;++q<oe&&N(m[q],q,m)!==!1;);return m}function se(m,N){for(var q=-1,oe=N.length,We=m.length;++q<oe;)m[We+q]=N[q];return m}function he(m,N,q,oe){for(var We=-1,Pe=m?m.length:0;++We<Pe;)q=N(q,m[We],We,m);return q}function Ae(m,N){for(var q=-1,oe=Array(m);++q<m;)oe[q]=N(q);return oe}function Ce(m,N){return m==null?void 0:m[N]}function Me(m){var N=!1;if(m!=null&&typeof m.toString!="function")try{N=!!(m+"")}catch{}return N}function ke(m){var N=-1,q=Array(m.size);return m.forEach(function(oe,We){q[++N]=[We,oe]}),q}function dt(m,N){return function(q){return m(N(q))}}function Be(m){var N=-1,q=Array(m.size);return m.forEach(function(oe){q[++N]=oe}),q}var It=Array.prototype,Dt=Function.prototype,Lt=Object.prototype,ft=fe["__core-js_shared__"],Vt=(function(){var m=/[^.]+$/.exec(ft&&ft.keys&&ft.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),qt=Dt.toString,Pt=Lt.hasOwnProperty,Gt=Lt.toString,Mt=RegExp("^"+qt.call(Pt).replace(k,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=Le?fe.Buffer:void 0,yt=fe.Symbol,Bt=fe.Uint8Array,ot=dt(Object.getPrototypeOf,Object),nt=Object.create,bt=Lt.propertyIsEnumerable,An=It.splice,yn=Object.getOwnPropertySymbols,ln=mt?mt.isBuffer:void 0,Zn=dt(Object.keys,Object),Jn=_r(fe,"DataView"),jt=_r(fe,"Map"),en=_r(fe,"Promise"),Hr=_r(fe,"Set"),us=_r(fe,"WeakMap"),er=_r(Object,"create"),ls=On(Jn),Ne=On(jt),ze=On(en),Qe=On(Hr),Je=On(us),L=yt?yt.prototype:void 0,ue=L?L.valueOf:void 0;function Te(m){var N=-1,q=m?m.length:0;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function De(){this.__data__=er?er(null):{}}function Xe(m){return this.has(m)&&delete this.__data__[m]}function Ke(m){var N=this.__data__;if(er){var q=N[m];return q===r?void 0:q}return Pt.call(N,m)?N[m]:void 0}function Et(m){var N=this.__data__;return er?N[m]!==void 0:Pt.call(N,m)}function cn(m,N){var q=this.__data__;return q[m]=er&&N===void 0?r:N,this}Te.prototype.clear=De,Te.prototype.delete=Xe,Te.prototype.get=Ke,Te.prototype.has=Et,Te.prototype.set=cn;function Nt(m){var N=-1,q=m?m.length:0;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function tr(){this.__data__=[]}function Os(m){var N=this.__data__,q=gt(N,m);if(q<0)return!1;var oe=N.length-1;return q==oe?N.pop():An.call(N,q,1),!0}function qr(m){var N=this.__data__,q=gt(N,m);return q<0?void 0:N[q][1]}function la(m){return gt(this.__data__,m)>-1}function ca(m,N){var q=this.__data__,oe=gt(q,m);return oe<0?q.push([m,N]):q[oe][1]=N,this}Nt.prototype.clear=tr,Nt.prototype.delete=Os,Nt.prototype.get=qr,Nt.prototype.has=la,Nt.prototype.set=ca;function Xt(m){var N=-1,q=m?m.length:0;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function da(){this.__data__={hash:new Te,map:new(jt||Nt),string:new Te}}function fa(m){return ba(this,m).delete(m)}function xs(m){return ba(this,m).get(m)}function ha(m){return ba(this,m).has(m)}function pa(m,N){return ba(this,m).set(m,N),this}Xt.prototype.clear=da,Xt.prototype.delete=fa,Xt.prototype.get=xs,Xt.prototype.has=ha,Xt.prototype.set=pa;function dn(m){this.__data__=new Nt(m)}function Rs(){this.__data__=new Nt}function ma(m){return this.__data__.delete(m)}function ga(m){return this.__data__.get(m)}function va(m){return this.__data__.has(m)}function Se(m,N){var q=this.__data__;if(q instanceof Nt){var oe=q.__data__;if(!jt||oe.length<n-1)return oe.push([m,N]),this;q=this.__data__=new Xt(oe)}return q.set(m,N),this}dn.prototype.clear=Rs,dn.prototype.delete=ma,dn.prototype.get=ga,dn.prototype.has=va,dn.prototype.set=Se;function we(m,N){var q=oo(m)||oi(m)?Ae(m.length,String):[],oe=q.length,We=!!oe;for(var Pe in m)Pt.call(m,Pe)&&!(We&&(Pe=="length"||Cc(Pe,oe)))&&q.push(Pe);return q}function qe(m,N,q){var oe=m[N];(!(Pt.call(m,N)&&Lu(oe,q))||q===void 0&&!(N in m))&&(m[N]=q)}function gt(m,N){for(var q=m.length;q--;)if(Lu(m[q][0],N))return q;return-1}function $t(m,N){return m&&io(N,lo(N),m)}function Yt(m,N,q,oe,We,Pe,ht){var ut;if(oe&&(ut=Pe?oe(m,We,Pe,ht):oe(m)),ut!==void 0)return ut;if(!$r(m))return m;var Qt=oo(m);if(Qt){if(ut=Sc(m),!N)return yc(m,ut)}else{var _t=ds(m),Nn=_t==f||_t==g;if(Ou(m))return rn(m,N);if(_t==v||_t==a||Nn&&!Pe){if(Me(m))return Pe?m:{};if(ut=jr(Nn?{}:m),!N)return Nc(m,$t(ut,m))}else{if(!U[_t])return Pe?m:{};ut=Ic(m,_t,Yt,N)}}ht||(ht=new dn);var Mn=ht.get(m);if(Mn)return Mn;if(ht.set(m,ut),!Qt)var sn=q?wc(m):lo(m);return Ie(sn||m,function(wn,vn){sn&&(vn=wn,wn=m[vn]),qe(ut,vn,Yt(wn,N,q,oe,vn,m,ht))}),ut}function tn(m){return $r(m)?nt(m):{}}function gn(m,N,q){var oe=N(m);return oo(m)?oe:se(oe,q(m))}function nn(m){return Gt.call(m)}function nr(m){if(!$r(m)||Oc(m))return!1;var N=uo(m)||Me(m)?Mt:$;return N.test(On(m))}function Ft(m){if(!Iu(m))return Zn(m);var N=[];for(var q in Object(m))Pt.call(m,q)&&q!="constructor"&&N.push(q);return N}function rn(m,N){if(N)return m.slice();var q=new m.constructor(m.length);return m.copy(q),q}function At(m){var N=new m.constructor(m.byteLength);return new Bt(N).set(new Bt(m)),N}function Ut(m,N){var q=N?At(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.byteLength)}function rr(m,N,q){var oe=N?q(ke(m),!0):ke(m);return he(oe,de,new m.constructor)}function sr(m){var N=new m.constructor(m.source,W.exec(m));return N.lastIndex=m.lastIndex,N}function _c(m,N,q){var oe=N?q(Be(m),!0):Be(m);return he(oe,ve,new m.constructor)}function Tc(m){return ue?Object(ue.call(m)):{}}function Ac(m,N){var q=N?At(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.length)}function yc(m,N){var q=-1,oe=m.length;for(N||(N=Array(oe));++q<oe;)N[q]=m[q];return N}function io(m,N,q,oe){q||(q={});for(var We=-1,Pe=N.length;++We<Pe;){var ht=N[We],ut=void 0;qe(q,ht,ut===void 0?m[ht]:ut)}return q}function Nc(m,N){return io(m,cs(m),N)}function wc(m){return gn(m,lo,cs)}function ba(m,N){var q=m.__data__;return Lc(N)?q[typeof N=="string"?"string":"hash"]:q.map}function _r(m,N){var q=Ce(m,N);return nr(q)?q:void 0}var cs=yn?dt(yn,Object):Rc,ds=nn;(Jn&&ds(new Jn(new ArrayBuffer(1)))!=J||jt&&ds(new jt)!=h||en&&ds(en.resolve())!=_||Hr&&ds(new Hr)!=b||us&&ds(new us)!=M)&&(ds=function(m){var N=Gt.call(m),q=N==v?m.constructor:void 0,oe=q?On(q):void 0;if(oe)switch(oe){case ls:return J;case Ne:return h;case ze:return _;case Qe:return b;case Je:return M}return N});function Sc(m){var N=m.length,q=m.constructor(N);return N&&typeof m[0]=="string"&&Pt.call(m,"index")&&(q.index=m.index,q.input=m.input),q}function jr(m){return typeof m.constructor=="function"&&!Iu(m)?tn(ot(m)):{}}function Ic(m,N,q,oe){var We=m.constructor;switch(N){case B:return At(m);case o:case l:return new We(+m);case J:return Ut(m,oe);case H:case G:case X:case ee:case A:case j:case w:case S:case R:return Ac(m,oe);case h:return rr(m,oe,q);case p:case x:return new We(m);case E:return sr(m);case b:return _c(m,oe,q);case O:return Tc(m)}}function Cc(m,N){return N=N??s,!!N&&(typeof m=="number"||Y.test(m))&&m>-1&&m%1==0&&m<N}function Lc(m){var N=typeof m;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?m!=="__proto__":m===null}function Oc(m){return!!Vt&&Vt in m}function Iu(m){var N=m&&m.constructor,q=typeof N=="function"&&N.prototype||Lt;return m===q}function On(m){if(m!=null){try{return qt.call(m)}catch{}try{return m+""}catch{}}return""}function Cu(m){return Yt(m,!0,!0)}function Lu(m,N){return m===N||m!==m&&N!==N}function oi(m){return xc(m)&&Pt.call(m,"callee")&&(!bt.call(m,"callee")||Gt.call(m)==a)}var oo=Array.isArray;function ui(m){return m!=null&&xu(m.length)&&!uo(m)}function xc(m){return Ru(m)&&ui(m)}var Ou=ln||Dc;function uo(m){var N=$r(m)?Gt.call(m):"";return N==f||N==g}function xu(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=s}function $r(m){var N=typeof m;return!!m&&(N=="object"||N=="function")}function Ru(m){return!!m&&typeof m=="object"}function lo(m){return ui(m)?we(m):Ft(m)}function Rc(){return[]}function Dc(){return!1}t.exports=Cu})(No,No.exports)),No.exports}var wo={exports:{}};wo.exports;var f1;function gb(){return f1||(f1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,o="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",f="[object Boolean]",g="[object Date]",h="[object Error]",p="[object Function]",v="[object GeneratorFunction]",_="[object Map]",E="[object Number]",b="[object Null]",x="[object Object]",O="[object Promise]",M="[object Proxy]",B="[object RegExp]",J="[object Set]",H="[object String]",G="[object Symbol]",X="[object Undefined]",ee="[object WeakMap]",A="[object ArrayBuffer]",j="[object DataView]",w="[object Float32Array]",S="[object Float64Array]",R="[object Int8Array]",k="[object Int16Array]",W="[object Int32Array]",$="[object Uint8Array]",Y="[object Uint8ClampedArray]",U="[object Uint16Array]",K="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,me=/^(?:0|[1-9]\d*)$/,ge={};ge[w]=ge[S]=ge[R]=ge[k]=ge[W]=ge[$]=ge[Y]=ge[U]=ge[K]=!0,ge[o]=ge[l]=ge[A]=ge[f]=ge[j]=ge[g]=ge[h]=ge[p]=ge[_]=ge[E]=ge[x]=ge[B]=ge[J]=ge[H]=ge[ee]=!1;var Le=typeof Gs=="object"&&Gs&&Gs.Object===Object&&Gs,de=typeof self=="object"&&self&&self.Object===Object&&self,ve=Le||de||Function("return this")(),Ie=e&&!e.nodeType&&e,se=Ie&&!0&&t&&!t.nodeType&&t,he=se&&se.exports===Ie,Ae=he&&Le.process,Ce=(function(){try{return Ae&&Ae.binding&&Ae.binding("util")}catch{}})(),Me=Ce&&Ce.isTypedArray;function ke(m,N){for(var q=-1,oe=m==null?0:m.length,We=0,Pe=[];++q<oe;){var ht=m[q];N(ht,q,m)&&(Pe[We++]=ht)}return Pe}function dt(m,N){for(var q=-1,oe=N.length,We=m.length;++q<oe;)m[We+q]=N[q];return m}function Be(m,N){for(var q=-1,oe=m==null?0:m.length;++q<oe;)if(N(m[q],q,m))return!0;return!1}function It(m,N){for(var q=-1,oe=Array(m);++q<m;)oe[q]=N(q);return oe}function Dt(m){return function(N){return m(N)}}function Lt(m,N){return m.has(N)}function ft(m,N){return m==null?void 0:m[N]}function Vt(m){var N=-1,q=Array(m.size);return m.forEach(function(oe,We){q[++N]=[We,oe]}),q}function qt(m,N){return function(q){return m(N(q))}}function Pt(m){var N=-1,q=Array(m.size);return m.forEach(function(oe){q[++N]=oe}),q}var Gt=Array.prototype,Mt=Function.prototype,mt=Object.prototype,yt=ve["__core-js_shared__"],Bt=Mt.toString,ot=mt.hasOwnProperty,nt=(function(){var m=/[^.]+$/.exec(yt&&yt.keys&&yt.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),bt=mt.toString,An=RegExp("^"+Bt.call(ot).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yn=he?ve.Buffer:void 0,ln=ve.Symbol,Zn=ve.Uint8Array,Jn=mt.propertyIsEnumerable,jt=Gt.splice,en=ln?ln.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,us=yn?yn.isBuffer:void 0,er=qt(Object.keys,Object),ls=cs(ve,"DataView"),Ne=cs(ve,"Map"),ze=cs(ve,"Promise"),Qe=cs(ve,"Set"),Je=cs(ve,"WeakMap"),L=cs(Object,"create"),ue=On(ls),Te=On(Ne),De=On(ze),Xe=On(Qe),Ke=On(Je),Et=ln?ln.prototype:void 0,cn=Et?Et.valueOf:void 0;function Nt(m){var N=-1,q=m==null?0:m.length;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function tr(){this.__data__=L?L(null):{},this.size=0}function Os(m){var N=this.has(m)&&delete this.__data__[m];return this.size-=N?1:0,N}function qr(m){var N=this.__data__;if(L){var q=N[m];return q===r?void 0:q}return ot.call(N,m)?N[m]:void 0}function la(m){var N=this.__data__;return L?N[m]!==void 0:ot.call(N,m)}function ca(m,N){var q=this.__data__;return this.size+=this.has(m)?0:1,q[m]=L&&N===void 0?r:N,this}Nt.prototype.clear=tr,Nt.prototype.delete=Os,Nt.prototype.get=qr,Nt.prototype.has=la,Nt.prototype.set=ca;function Xt(m){var N=-1,q=m==null?0:m.length;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function da(){this.__data__=[],this.size=0}function fa(m){var N=this.__data__,q=rn(N,m);if(q<0)return!1;var oe=N.length-1;return q==oe?N.pop():jt.call(N,q,1),--this.size,!0}function xs(m){var N=this.__data__,q=rn(N,m);return q<0?void 0:N[q][1]}function ha(m){return rn(this.__data__,m)>-1}function pa(m,N){var q=this.__data__,oe=rn(q,m);return oe<0?(++this.size,q.push([m,N])):q[oe][1]=N,this}Xt.prototype.clear=da,Xt.prototype.delete=fa,Xt.prototype.get=xs,Xt.prototype.has=ha,Xt.prototype.set=pa;function dn(m){var N=-1,q=m==null?0:m.length;for(this.clear();++N<q;){var oe=m[N];this.set(oe[0],oe[1])}}function Rs(){this.size=0,this.__data__={hash:new Nt,map:new(Ne||Xt),string:new Nt}}function ma(m){var N=_r(this,m).delete(m);return this.size-=N?1:0,N}function ga(m){return _r(this,m).get(m)}function va(m){return _r(this,m).has(m)}function Se(m,N){var q=_r(this,m),oe=q.size;return q.set(m,N),this.size+=q.size==oe?0:1,this}dn.prototype.clear=Rs,dn.prototype.delete=ma,dn.prototype.get=ga,dn.prototype.has=va,dn.prototype.set=Se;function we(m){var N=-1,q=m==null?0:m.length;for(this.__data__=new dn;++N<q;)this.add(m[N])}function qe(m){return this.__data__.set(m,r),this}function gt(m){return this.__data__.has(m)}we.prototype.add=we.prototype.push=qe,we.prototype.has=gt;function $t(m){var N=this.__data__=new Xt(m);this.size=N.size}function Yt(){this.__data__=new Xt,this.size=0}function tn(m){var N=this.__data__,q=N.delete(m);return this.size=N.size,q}function gn(m){return this.__data__.get(m)}function nn(m){return this.__data__.has(m)}function nr(m,N){var q=this.__data__;if(q instanceof Xt){var oe=q.__data__;if(!Ne||oe.length<n-1)return oe.push([m,N]),this.size=++q.size,this;q=this.__data__=new dn(oe)}return q.set(m,N),this.size=q.size,this}$t.prototype.clear=Yt,$t.prototype.delete=tn,$t.prototype.get=gn,$t.prototype.has=nn,$t.prototype.set=nr;function Ft(m,N){var q=oi(m),oe=!q&&Lu(m),We=!q&&!oe&&ui(m),Pe=!q&&!oe&&!We&&Ru(m),ht=q||oe||We||Pe,ut=ht?It(m.length,String):[],Qt=ut.length;for(var _t in m)ot.call(m,_t)&&!(ht&&(_t=="length"||We&&(_t=="offset"||_t=="parent")||Pe&&(_t=="buffer"||_t=="byteLength"||_t=="byteOffset")||Ic(_t,Qt)))&&ut.push(_t);return ut}function rn(m,N){for(var q=m.length;q--;)if(Cu(m[q][0],N))return q;return-1}function At(m,N,q){var oe=N(m);return oi(m)?oe:dt(oe,q(m))}function Ut(m){return m==null?m===void 0?X:b:en&&en in Object(m)?ds(m):Iu(m)}function rr(m){return $r(m)&&Ut(m)==o}function sr(m,N,q,oe,We){return m===N?!0:m==null||N==null||!$r(m)&&!$r(N)?m!==m&&N!==N:_c(m,N,q,oe,sr,We)}function _c(m,N,q,oe,We,Pe){var ht=oi(m),ut=oi(N),Qt=ht?l:jr(m),_t=ut?l:jr(N);Qt=Qt==o?x:Qt,_t=_t==o?x:_t;var Nn=Qt==x,Mn=_t==x,sn=Qt==_t;if(sn&&ui(m)){if(!ui(N))return!1;ht=!0,Nn=!1}if(sn&&!Nn)return Pe||(Pe=new $t),ht||Ru(m)?io(m,N,q,oe,We,Pe):Nc(m,N,Qt,q,oe,We,Pe);if(!(q&s)){var wn=Nn&&ot.call(m,"__wrapped__"),vn=Mn&&ot.call(N,"__wrapped__");if(wn||vn){var Ds=wn?m.value():m,fs=vn?N.value():N;return Pe||(Pe=new $t),We(Ds,fs,q,oe,Pe)}}return sn?(Pe||(Pe=new $t),wc(m,N,q,oe,We,Pe)):!1}function Tc(m){if(!xu(m)||Lc(m))return!1;var N=Ou(m)?An:fe;return N.test(On(m))}function Ac(m){return $r(m)&&uo(m.length)&&!!ge[Ut(m)]}function yc(m){if(!Oc(m))return er(m);var N=[];for(var q in Object(m))ot.call(m,q)&&q!="constructor"&&N.push(q);return N}function io(m,N,q,oe,We,Pe){var ht=q&s,ut=m.length,Qt=N.length;if(ut!=Qt&&!(ht&&Qt>ut))return!1;var _t=Pe.get(m);if(_t&&Pe.get(N))return _t==N;var Nn=-1,Mn=!0,sn=q&a?new we:void 0;for(Pe.set(m,N),Pe.set(N,m);++Nn<ut;){var wn=m[Nn],vn=N[Nn];if(oe)var Ds=ht?oe(vn,wn,Nn,N,m,Pe):oe(wn,vn,Nn,m,N,Pe);if(Ds!==void 0){if(Ds)continue;Mn=!1;break}if(sn){if(!Be(N,function(fs,Ea){if(!Lt(sn,Ea)&&(wn===fs||We(wn,fs,q,oe,Pe)))return sn.push(Ea)})){Mn=!1;break}}else if(!(wn===vn||We(wn,vn,q,oe,Pe))){Mn=!1;break}}return Pe.delete(m),Pe.delete(N),Mn}function Nc(m,N,q,oe,We,Pe,ht){switch(q){case j:if(m.byteLength!=N.byteLength||m.byteOffset!=N.byteOffset)return!1;m=m.buffer,N=N.buffer;case A:return!(m.byteLength!=N.byteLength||!Pe(new Zn(m),new Zn(N)));case f:case g:case E:return Cu(+m,+N);case h:return m.name==N.name&&m.message==N.message;case B:case H:return m==N+"";case _:var ut=Vt;case J:var Qt=oe&s;if(ut||(ut=Pt),m.size!=N.size&&!Qt)return!1;var _t=ht.get(m);if(_t)return _t==N;oe|=a,ht.set(m,N);var Nn=io(ut(m),ut(N),oe,We,Pe,ht);return ht.delete(m),Nn;case G:if(cn)return cn.call(m)==cn.call(N)}return!1}function wc(m,N,q,oe,We,Pe){var ht=q&s,ut=ba(m),Qt=ut.length,_t=ba(N),Nn=_t.length;if(Qt!=Nn&&!ht)return!1;for(var Mn=Qt;Mn--;){var sn=ut[Mn];if(!(ht?sn in N:ot.call(N,sn)))return!1}var wn=Pe.get(m);if(wn&&Pe.get(N))return wn==N;var vn=!0;Pe.set(m,N),Pe.set(N,m);for(var Ds=ht;++Mn<Qt;){sn=ut[Mn];var fs=m[sn],Ea=N[sn];if(oe)var v0=ht?oe(Ea,fs,sn,N,m,Pe):oe(fs,Ea,sn,m,N,Pe);if(!(v0===void 0?fs===Ea||We(fs,Ea,q,oe,Pe):v0)){vn=!1;break}Ds||(Ds=sn=="constructor")}if(vn&&!Ds){var Du=m.constructor,ku=N.constructor;Du!=ku&&"constructor"in m&&"constructor"in N&&!(typeof Du=="function"&&Du instanceof Du&&typeof ku=="function"&&ku instanceof ku)&&(vn=!1)}return Pe.delete(m),Pe.delete(N),vn}function ba(m){return At(m,lo,Sc)}function _r(m,N){var q=m.__data__;return Cc(N)?q[typeof N=="string"?"string":"hash"]:q.map}function cs(m,N){var q=ft(m,N);return Tc(q)?q:void 0}function ds(m){var N=ot.call(m,en),q=m[en];try{m[en]=void 0;var oe=!0}catch{}var We=bt.call(m);return oe&&(N?m[en]=q:delete m[en]),We}var Sc=Hr?function(m){return m==null?[]:(m=Object(m),ke(Hr(m),function(N){return Jn.call(m,N)}))}:Rc,jr=Ut;(ls&&jr(new ls(new ArrayBuffer(1)))!=j||Ne&&jr(new Ne)!=_||ze&&jr(ze.resolve())!=O||Qe&&jr(new Qe)!=J||Je&&jr(new Je)!=ee)&&(jr=function(m){var N=Ut(m),q=N==x?m.constructor:void 0,oe=q?On(q):"";if(oe)switch(oe){case ue:return j;case Te:return _;case De:return O;case Xe:return J;case Ke:return ee}return N});function Ic(m,N){return N=N??i,!!N&&(typeof m=="number"||me.test(m))&&m>-1&&m%1==0&&m<N}function Cc(m){var N=typeof m;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?m!=="__proto__":m===null}function Lc(m){return!!nt&&nt in m}function Oc(m){var N=m&&m.constructor,q=typeof N=="function"&&N.prototype||mt;return m===q}function Iu(m){return bt.call(m)}function On(m){if(m!=null){try{return Bt.call(m)}catch{}try{return m+""}catch{}}return""}function Cu(m,N){return m===N||m!==m&&N!==N}var Lu=rr((function(){return arguments})())?rr:function(m){return $r(m)&&ot.call(m,"callee")&&!Jn.call(m,"callee")},oi=Array.isArray;function oo(m){return m!=null&&uo(m.length)&&!Ou(m)}var ui=us||Dc;function xc(m,N){return sr(m,N)}function Ou(m){if(!xu(m))return!1;var N=Ut(m);return N==p||N==v||N==d||N==M}function uo(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=i}function xu(m){var N=typeof m;return m!=null&&(N=="object"||N=="function")}function $r(m){return m!=null&&typeof m=="object"}var Ru=Me?Dt(Me):Ac;function lo(m){return oo(m)?Ft(m):yc(m)}function Rc(){return[]}function Dc(){return!1}t.exports=xc})(wo,wo.exports)),wo.exports}var Vu={},h1;function qL(){if(h1)return Vu;h1=1,Object.defineProperty(Vu,"__esModule",{value:!0});const t=mb(),e=gb();var n;return(function(r){function s(l={},d={},f=!1){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});let g=t(d);f||(g=Object.keys(g).reduce((h,p)=>(g[p]!=null&&(h[p]=g[p]),h),{}));for(const h in l)l[h]!==void 0&&d[h]===void 0&&(g[h]=l[h]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(l={},d={}){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});const f=Object.keys(l).concat(Object.keys(d)).reduce((g,h)=>(e(l[h],d[h])||(g[h]=d[h]===void 0?null:d[h]),g),{});return Object.keys(f).length>0?f:void 0}r.diff=a;function i(l={},d={}){l=l||{};const f=Object.keys(d).reduce((g,h)=>(d[h]!==l[h]&&l[h]!==void 0&&(g[h]=d[h]),g),{});return Object.keys(l).reduce((g,h)=>(l[h]!==d[h]&&d[h]===void 0&&(g[h]=null),g),f)}r.invert=i;function o(l,d,f=!1){if(typeof l!="object")return d;if(typeof d!="object")return;if(!f)return d;const g=Object.keys(d).reduce((h,p)=>(l[p]===void 0&&(h[p]=d[p]),h),{});return Object.keys(g).length>0?g:void 0}r.transform=o})(n||(n={})),Vu.default=n,Vu}var Xu={},p1;function vb(){if(p1)return Xu;p1=1,Object.defineProperty(Xu,"__esModule",{value:!0});var t;return(function(e){function n(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=n})(t||(t={})),Xu.default=t,Xu}var Qu={},m1;function jL(){if(m1)return Qu;m1=1,Object.defineProperty(Qu,"__esModule",{value:!0});const t=vb();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,i=t.default.length(s);if(r>=i-a?(r=i-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),i=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(i)}}else return[]}}return Qu.default=e,Qu}var g1;function $L(){return g1||(g1=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=HL(),r=mb(),s=gb(),a=qL();e.AttributeMap=a.default;const i=vb();e.Op=i.default;const o=jL();e.OpIterator=o.default;const l="\0",d=(g,h)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(h)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(h)[0]}`);return[p,g[p],h[p]]};class f{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,p){this.handlers[h]=p}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const p=this.handlers[h];if(!p)throw new Error(`no handlers for embed type "${h}"`);return p}insert(h,p){const v={};return typeof h=="string"&&h.length===0?this:(v.insert=h,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,p){if(typeof h=="number"&&h<=0)return this;const v={retain:h};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v)}push(h){let p=this.ops.length,v=this.ops[p-1];if(h=r(h),typeof v=="object"){if(typeof h.delete=="number"&&typeof v.delete=="number")return this.ops[p-1]={delete:v.delete+h.delete},this;if(typeof v.delete=="number"&&h.insert!=null&&(p-=1,v=this.ops[p-1],typeof v!="object"))return this.ops.unshift(h),this;if(s(h.attributes,v.attributes)){if(typeof h.insert=="string"&&typeof v.insert=="string")return this.ops[p-1]={insert:v.insert+h.insert},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof v.retain=="number")return this.ops[p-1]={retain:v.retain+h.retain},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this}}return p===this.ops.length?this.ops.push(h):this.ops.splice(p,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const p=[],v=[];return this.forEach(_=>{(h(_)?p:v).push(_)}),[p,v]}reduce(h,p){return this.ops.reduce(h,p)}changeLength(){return this.reduce((h,p)=>p.insert?h+i.default.length(p):p.delete?h-p.delete:h,0)}length(){return this.reduce((h,p)=>h+i.default.length(p),0)}slice(h=0,p=1/0){const v=[],_=new o.default(this.ops);let E=0;for(;E<p&&_.hasNext();){let b;E<h?b=_.next(h-E):(b=_.next(p-E),v.push(b)),E+=i.default.length(b)}return new f(v)}compose(h){const p=new o.default(this.ops),v=new o.default(h.ops),_=[],E=v.peek();if(E!=null&&typeof E.retain=="number"&&E.attributes==null){let x=E.retain;for(;p.peekType()==="insert"&&p.peekLength()<=x;)x-=p.peekLength(),_.push(p.next());E.retain-x>0&&v.next(E.retain-x)}const b=new f(_);for(;p.hasNext()||v.hasNext();)if(v.peekType()==="insert")b.push(v.next());else if(p.peekType()==="delete")b.push(p.next());else{const x=Math.min(p.peekLength(),v.peekLength()),O=p.next(x),M=v.next(x);if(M.retain){const B={};if(typeof O.retain=="number")B.retain=typeof M.retain=="number"?x:M.retain;else if(typeof M.retain=="number")O.retain==null?B.insert=O.insert:B.retain=O.retain;else{const H=O.retain==null?"insert":"retain",[G,X,ee]=d(O[H],M.retain),A=f.getHandler(G);B[H]={[G]:A.compose(X,ee,H==="retain")}}const J=a.default.compose(O.attributes,M.attributes,typeof O.retain=="number");if(J&&(B.attributes=J),b.push(B),!v.hasNext()&&s(b.ops[b.ops.length-1],B)){const H=new f(p.rest());return b.concat(H).chop()}}else typeof M.delete=="number"&&(typeof O.retain=="number"||typeof O.retain=="object"&&O.retain!==null)&&b.push(M)}return b.chop()}concat(h){const p=new f(this.ops.slice());return h.ops.length>0&&(p.push(h.ops[0]),p.ops=p.ops.concat(h.ops.slice(1))),p}diff(h,p){if(this.ops===h.ops)return new f;const v=[this,h].map(O=>O.map(M=>{if(M.insert!=null)return typeof M.insert=="string"?M.insert:l;const B=O===h?"on":"with";throw new Error("diff() called "+B+" non-document")}).join("")),_=new f,E=n(v[0],v[1],p,!0),b=new o.default(this.ops),x=new o.default(h.ops);return E.forEach(O=>{let M=O[1].length;for(;M>0;){let B=0;switch(O[0]){case n.INSERT:B=Math.min(x.peekLength(),M),_.push(x.next(B));break;case n.DELETE:B=Math.min(M,b.peekLength()),b.next(B),_.delete(B);break;case n.EQUAL:B=Math.min(b.peekLength(),x.peekLength(),M);const J=b.next(B),H=x.next(B);s(J.insert,H.insert)?_.retain(B,a.default.diff(J.attributes,H.attributes)):_.push(H).delete(B);break}M-=B}}),_.chop()}eachLine(h,p=`
76
+ `){const v=new o.default(this.ops);let _=new f,E=0;for(;v.hasNext();){if(v.peekType()!=="insert")return;const b=v.peek(),x=i.default.length(b)-v.peekLength(),O=typeof b.insert=="string"?b.insert.indexOf(p,x)-x:-1;if(O<0)_.push(v.next());else if(O>0)_.push(v.next(O));else{if(h(_,v.next(1).attributes||{},E)===!1)return;E+=1,_=new f}}_.length()>0&&h(_,{},E)}invert(h){const p=new f;return this.reduce((v,_)=>{if(_.insert)p.delete(i.default.length(_));else{if(typeof _.retain=="number"&&_.attributes==null)return p.retain(_.retain),v+_.retain;if(_.delete||typeof _.retain=="number"){const E=_.delete||_.retain;return h.slice(v,v+E).forEach(x=>{_.delete?p.push(x):_.retain&&_.attributes&&p.retain(i.default.length(x),a.default.invert(_.attributes,x.attributes))}),v+E}else if(typeof _.retain=="object"&&_.retain!==null){const E=h.slice(v,v+1),b=new o.default(E.ops).next(),[x,O,M]=d(_.retain,b.insert),B=f.getHandler(x);return p.retain({[x]:B.invert(O,M)},a.default.invert(_.attributes,b.attributes)),v+1}}return v},0),p.chop()}transform(h,p=!1){if(p=!!p,typeof h=="number")return this.transformPosition(h,p);const v=h,_=new o.default(this.ops),E=new o.default(v.ops),b=new f;for(;_.hasNext()||E.hasNext();)if(_.peekType()==="insert"&&(p||E.peekType()!=="insert"))b.retain(i.default.length(_.next()));else if(E.peekType()==="insert")b.push(E.next());else{const x=Math.min(_.peekLength(),E.peekLength()),O=_.next(x),M=E.next(x);if(O.delete)continue;if(M.delete)b.push(M);else{const B=O.retain,J=M.retain;let H=typeof J=="object"&&J!==null?J:x;if(typeof B=="object"&&B!==null&&typeof J=="object"&&J!==null){const G=Object.keys(B)[0];if(G===Object.keys(J)[0]){const X=f.getHandler(G);X&&(H={[G]:X.transform(B[G],J[G],p)})}}b.retain(H,a.default.transform(O.attributes,M.attributes,p))}}return b.chop()}transformPosition(h,p=!1){p=!!p;const v=new o.default(this.ops);let _=0;for(;v.hasNext()&&_<=h;){const E=v.peekLength(),b=v.peekType();if(v.next(),b==="delete"){h-=Math.min(E,h-_);continue}else b==="insert"&&(_<h||!p)&&(h+=E);_+=E}return h}}f.Op=i.default,f.OpIterator=o.default,f.AttributeMap=a.default,f.handlers={},e.default=f,t.exports=f,t.exports.default=f})(Ku,Ku.exports)),Ku.exports}var mr=$L();const xe=pb(mr);class Fr extends Qn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Fr.blotName="break";Fr.tagName="BR";let kr=class extends ql{};const YL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function vc(t){return t.replace(/[&<>"']/g,e=>YL[e])}const Yr=class Yr extends r0{static compare(e,n){const r=Yr.order.indexOf(e),s=Yr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(Yr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Re.BLOT)){const a=this.isolate(e,n);s&&a.wrap(r,s)}else super.formatAt(e,n,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof Yr&&Yr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};ye(Yr,"allowedChildren",[Yr,Fr,Qn,kr]),ye(Yr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let is=Yr;const v1=1;class _n extends tu{constructor(){super(...arguments);ye(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=bb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,Re.BLOCK)?n+r===this.length()&&this.format(s,a):super.formatAt(n,Math.min(r,this.length()-n-1),s,a),this.cache={})}insertAt(n,r,s){if(s!=null){super.insertAt(n,r,s),this.cache={};return}if(r.length===0)return;const a=r.split(`
77
77
  `),i=a.shift();i.length>0&&(n<this.length()-1||this.children.tail==null?super.insertAt(Math.min(n,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let o=this;a.reduce((l,d)=>(o=o.split(l,!0),o.insertAt(0,d),d.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Fr&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+v1),this.cache.length}moveChildren(n,r){super.moveChildren(n,r),this.cache={}}optimize(n){super.optimize(n),this.cache={}}path(n){return super.path(n,!0)}removeChild(n){super.removeChild(n),this.cache={}}split(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(n===0||n>=this.length()-v1)){const a=this.clone();return n===0?(this.parent.insertBefore(a,this),this):(this.parent.insertBefore(a,this.next),a)}const s=super.split(n,r);return this.cache={},s}}_n.blotName="block";_n.tagName="P";_n.defaultChild=Fr;_n.allowedChildren=[Fr,is,Qn,kr];class pr extends Qn{attach(){super.attach(),this.attributes=new mc(this.domNode)}delta(){return new xe().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,Re.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,n)}formatAt(e,n,r,s){this.format(r,s)}insertAt(e,n,r){if(r!=null){super.insertAt(e,n,r);return}const s=n.split(`
78
- `),a=s.pop(),i=s.map(l=>{const d=this.scroll.create(_n.blotName);return d.insertAt(0,l),d}),o=this.split(e);i.forEach(l=>{this.parent.insertBefore(l,o)}),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}pr.scope=Re.BLOCK_BLOT;function Eb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(In).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),fr(r,{},e)),new xe).insert(`
79
- `,fr(t))}function fr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return t==null||("formats"in t&&typeof t.formats=="function"&&(e={...e,...t.formats()},n&&delete e["code-token"]),t.parent==null||t.parent.statics.blotName==="scroll"||t.parent.statics.scope!==t.statics.scope)?e:fr(t.parent,e,n)}const ar=class ar extends Qn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(ar.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,n){if(this.savedLength!==0){super.format(e,n);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Re.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=ar.CONTENTS.length,r.optimize(),r.formatAt(s,ar.CONTENTS.length,e,n),this.savedLength=0)}index(e,n){return e===this.textNode?0:super.index(e,n)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const n=this.prev instanceof kr?this.prev:null,r=n?n.length():0,s=this.next instanceof kr?this.next:null,a=s?s.text:"",{textNode:i}=this,o=i.data.split(ar.CONTENTS).join("");i.data=ar.CONTENTS;let l;if(n)l=n,(o||s)&&(n.insertAt(n.length(),o+a),s&&s.remove());else if(s)l=s,s.insertAt(0,o);else{const d=document.createTextNode(o);l=this.scroll.create(d),this.parent.insertBefore(l,this)}if(this.remove(),e){const d=(f,p)=>n&&f===n.domNode?p:f===i?r+p-1:s&&f===s.domNode?r+o.length+p:null,h=d(e.start.node,e.start.offset),g=d(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:l.domNode,startOffset:h,endNode:l.domNode,endOffset:g}}return null}update(e,n){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(n.range=r)}}optimize(e){super.optimize(e);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=ar.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};ye(ar,"blotName","cursor"),ye(ar,"className","ql-cursor"),ye(ar,"tagName","span"),ye(ar,"CONTENTS","\uFEFF");let Qi=ar;var id={exports:{}},b1;function zL(){return b1||(b1=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(l,d,h){this.fn=l,this.context=d,this.once=h||!1}function a(l,d,h,g,f){if(typeof h!="function")throw new TypeError("The listener must be a function");var p=new s(h,g||l,f),v=n?n+d:d;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],p]:l._events[v].push(p):(l._events[v]=p,l._eventsCount++),l}function i(l,d){--l._eventsCount===0?l._events=new r:delete l._events[d]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],h,g;if(this._eventsCount===0)return d;for(g in h=this._events)e.call(h,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},o.prototype.listeners=function(d){var h=n?n+d:d,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var f=0,p=g.length,v=new Array(p);f<p;f++)v[f]=g[f].fn;return v},o.prototype.listenerCount=function(d){var h=n?n+d:d,g=this._events[h];return g?g.fn?1:g.length:0},o.prototype.emit=function(d,h,g,f,p,v){var b=n?n+d:d;if(!this._events[b])return!1;var E=this._events[b],_=arguments.length,R,O;if(E.fn){switch(E.once&&this.removeListener(d,E.fn,void 0,!0),_){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,h),!0;case 3:return E.fn.call(E.context,h,g),!0;case 4:return E.fn.call(E.context,h,g,f),!0;case 5:return E.fn.call(E.context,h,g,f,p),!0;case 6:return E.fn.call(E.context,h,g,f,p,v),!0}for(O=1,R=new Array(_-1);O<_;O++)R[O-1]=arguments[O];E.fn.apply(E.context,R)}else{var B=E.length,M;for(O=0;O<B;O++)switch(E[O].once&&this.removeListener(d,E[O].fn,void 0,!0),_){case 1:E[O].fn.call(E[O].context);break;case 2:E[O].fn.call(E[O].context,h);break;case 3:E[O].fn.call(E[O].context,h,g);break;case 4:E[O].fn.call(E[O].context,h,g,f);break;default:if(!R)for(M=1,R=new Array(_-1);M<_;M++)R[M-1]=arguments[M];E[O].fn.apply(E[O].context,R)}}return!0},o.prototype.on=function(d,h,g){return a(this,d,h,g,!1)},o.prototype.once=function(d,h,g){return a(this,d,h,g,!0)},o.prototype.removeListener=function(d,h,g,f){var p=n?n+d:d;if(!this._events[p])return this;if(!h)return i(this,p),this;var v=this._events[p];if(v.fn)v.fn===h&&(!f||v.once)&&(!g||v.context===g)&&i(this,p);else{for(var b=0,E=[],_=v.length;b<_;b++)(v[b].fn!==h||f&&!v[b].once||g&&v[b].context!==g)&&E.push(v[b]);E.length?this._events[p]=E.length===1?E[0]:E:i(this,p)}return this},o.prototype.removeAllListeners=function(d){var h;return d?(h=n?n+d:d,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(id)),id.exports}var WL=zL();const GL=mb(WL),Hf=new WeakMap,qf=["error","warn","log","info"];let jf="warn";function _b(t){if(jf&&qf.indexOf(t)<=qf.indexOf(jf)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console[t](...n)}}function Ls(t){return qf.reduce((e,n)=>(e[n]=_b.bind(console,n,t),e),{})}Ls.level=t=>{jf=t};_b.level=Ls.level;const od=Ls("quill:events"),KL=["selectionchange","mousedown","mouseup","click"];KL.forEach(t=>{document.addEventListener(t,function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const a=Hf.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Oe extends GL{constructor(){super(),this.domListeners={},this.on("error",od.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return od.log.call(od,...n),super.emit(...n)}handleDOM(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:i,handler:o}=a;(e.target===i||i.contains(e.target))&&o(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}ye(Oe,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),ye(Oe,"sources",{API:"api",SILENT:"silent",USER:"user"});const ud=Ls("quill:selection");class Va{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class VL{constructor(e,n){this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Va(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Oe.sources.USER),1)}),this.emitter.on(Oe.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Oe.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const i=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(i?Oe.sources.SILENT:s)}catch{}})}),this.emitter.on(Oe.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:o,endOffset:l}=s.range;this.setNativeRange(a,i,o,l),this.update(Oe.sources.SILENT)}}),this.update(Oe.sources.SILENT)}handleComposition(){this.emitter.on(Oe.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Oe.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Oe.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,n){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Re.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof In){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),n=Math.min(e+n,r-1)-e;let s,[a,i]=this.scroll.leaf(e);if(a==null)return null;if(n>0&&i===a.length()){const[h]=this.scroll.leaf(e+1);if(h){const[g]=this.scroll.line(e),[f]=this.scroll.line(e+1);g===f&&(a=h,i=0)}}[s,i]=a.position(i,!0);const o=document.createRange();if(n>0)return o.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),o.setEnd(s,i),o.getBoundingClientRect());let l="left",d;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(o.setStart(s,i),o.setEnd(s,i+1)):(o.setStart(s,i-1),o.setEnd(s,i),l="right"),d=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;d=a.domNode.getBoundingClientRect(),i>0&&(l="right")}return{bottom:d.top+d.height,height:d.height,left:d[l],right:d[l],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const n=e.getRangeAt(0);if(n==null)return null;const r=this.normalizeNative(n);return ud.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const n=this.getNativeRange();return n==null?[null,null]:[this.normalizedToRange(n),n]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&ld(this.root,document.activeElement)}normalizedToRange(e){const n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);const r=n.map(i=>{const[o,l]=i,d=this.scroll.find(o,!0),h=d.offset(this.scroll);return l===0?h:d instanceof In?h+d.index(o,l):h+d.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Va(a,s-a)}normalizeNative(e){if(!ld(this.root,e.startContainer)||!e.collapsed&&!ld(this.root,e.endContainer))return null;const n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),n}rangeToNative(e){const n=this.scroll.length(),r=(s,a)=>{s=Math.min(n-1,s);const[i,o]=this.scroll.leaf(s);return i?i.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ud.info("setNativeRange",e,n,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const i=document.getSelection();if(i!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(n=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const l=document.createRange();l.setStart(e,n),l.setEnd(r,s),i.removeAllRanges(),i.addRange(l)}}else i.removeAllRanges(),this.root.blur()}setRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oe.sources.API;if(typeof n=="string"&&(r=n,n=!1),ud.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,n)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!n0(n,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const i=this.cursor.restore();i&&this.setNativeRange(i.startNode,i.startOffset,i.endNode,i.endOffset)}const a=[Oe.events.SELECTION_CHANGE,Si(this.lastRange),Si(n),e];this.emitter.emit(Oe.events.EDITOR_CHANGE,...a),e!==Oe.sources.SILENT&&this.emitter.emit(...a)}}}function ld(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const XL=/^[ -~]*$/;class QL{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=E1(e),s=new xe;return JL(r.ops.slice()).reduce((i,o)=>{const l=mr.Op.length(o);let d=o.attributes||{},h=!1,g=!1;if(o.insert!=null){if(s.retain(l),typeof o.insert=="string"){const v=o.insert;g=!v.endsWith(`
80
- `)&&(n<=i||!!this.scroll.descendant(pr,i)[0]),this.scroll.insertAt(i,v);const[b,E]=this.scroll.line(i);let _=ea({},fr(b));if(b instanceof _n){const[R]=b.descendant(In,E);R&&(_=ea(_,fr(R)))}d=mr.AttributeMap.diff(_,d)||{}}else if(typeof o.insert=="object"){const v=Object.keys(o.insert)[0];if(v==null)return i;const b=this.scroll.query(v,Re.INLINE)!=null;if(b)(n<=i||this.scroll.descendant(pr,i)[0])&&(g=!0);else if(i>0){const[E,_]=this.scroll.descendant(In,i-1);E instanceof kr?E.value()[_]!==`
81
- `&&(h=!0):E instanceof Qn&&E.statics.scope===Re.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(i,v,o.insert[v]),b){const[E]=this.scroll.descendant(In,i);if(E){const _=ea({},fr(E));d=mr.AttributeMap.diff(_,d)||{}}}}n+=l}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const v=Object.keys(o.retain)[0];if(v==null)return i;this.scroll.updateEmbedAt(i,v,o.retain[v])}Object.keys(d).forEach(v=>{this.scroll.formatAt(i,l,v,d[v])});const f=h?1:0,p=g?1:0;return n+=f+p,s.retain(f),s.delete(p),i+l+f+p},0),s.reduce((i,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(i,o.delete),i):i+mr.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new xe().retain(e).delete(n))}formatLine(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(a=>{this.scroll.lines(e,Math.max(n,1)).forEach(i=>{i.format(a,r[a])})}),this.scroll.optimize();const s=new xe().retain(e).retain(n,Si(r));return this.update(s)}formatText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(a=>{this.scroll.formatAt(e,n,a,r[a])});const s=new xe().retain(e).retain(n,Si(r));return this.update(s)}getContents(e,n){return this.delta.slice(e,e+n)}getDelta(){return this.scroll.lines().reduce((e,n)=>e.concat(n.delta()),new xe)}getFormat(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];n===0?this.scroll.path(e).forEach(o=>{const[l]=o;l instanceof _n?r.push(l):l instanceof In&&s.push(l)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(In,e,n));const[a,i]=[r,s].map(o=>{const l=o.shift();if(l==null)return{};let d=fr(l);for(;Object.keys(d).length>0;){const h=o.shift();if(h==null)return d;d=ZL(fr(h),d)}return d});return{...a,...i}}getHTML(e,n){const[r,s]=this.scroll.line(e);if(r){const a=r.length();return r.length()>=s+n&&!(s===0&&n===a)?nu(r,s,n,!0):nu(this.scroll,e,n,!0)}return""}getText(e,n){return this.getContents(e,n).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,n){const r=E1(n),s=new xe().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,n,r){return this.scroll.insertAt(e,n,r),this.update(new xe().retain(e).insert({[n]:r}))}insertText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return n=n.replace(/\r\n/g,`
78
+ `),a=s.pop(),i=s.map(l=>{const d=this.scroll.create(_n.blotName);return d.insertAt(0,l),d}),o=this.split(e);i.forEach(l=>{this.parent.insertBefore(l,o)}),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}pr.scope=Re.BLOCK_BLOT;function bb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(In).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),fr(r,{},e)),new xe).insert(`
79
+ `,fr(t))}function fr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return t==null||("formats"in t&&typeof t.formats=="function"&&(e={...e,...t.formats()},n&&delete e["code-token"]),t.parent==null||t.parent.statics.blotName==="scroll"||t.parent.statics.scope!==t.statics.scope)?e:fr(t.parent,e,n)}const ar=class ar extends Qn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(ar.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,n){if(this.savedLength!==0){super.format(e,n);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Re.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=ar.CONTENTS.length,r.optimize(),r.formatAt(s,ar.CONTENTS.length,e,n),this.savedLength=0)}index(e,n){return e===this.textNode?0:super.index(e,n)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const n=this.prev instanceof kr?this.prev:null,r=n?n.length():0,s=this.next instanceof kr?this.next:null,a=s?s.text:"",{textNode:i}=this,o=i.data.split(ar.CONTENTS).join("");i.data=ar.CONTENTS;let l;if(n)l=n,(o||s)&&(n.insertAt(n.length(),o+a),s&&s.remove());else if(s)l=s,s.insertAt(0,o);else{const d=document.createTextNode(o);l=this.scroll.create(d),this.parent.insertBefore(l,this)}if(this.remove(),e){const d=(h,p)=>n&&h===n.domNode?p:h===i?r+p-1:s&&h===s.domNode?r+o.length+p:null,f=d(e.start.node,e.start.offset),g=d(e.end.node,e.end.offset);if(f!==null&&g!==null)return{startNode:l.domNode,startOffset:f,endNode:l.domNode,endOffset:g}}return null}update(e,n){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(n.range=r)}}optimize(e){super.optimize(e);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=ar.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};ye(ar,"blotName","cursor"),ye(ar,"className","ql-cursor"),ye(ar,"tagName","span"),ye(ar,"CONTENTS","\uFEFF");let Qi=ar;var id={exports:{}},b1;function zL(){return b1||(b1=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(l,d,f){this.fn=l,this.context=d,this.once=f||!1}function a(l,d,f,g,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new s(f,g||l,h),v=n?n+d:d;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],p]:l._events[v].push(p):(l._events[v]=p,l._eventsCount++),l}function i(l,d){--l._eventsCount===0?l._events=new r:delete l._events[d]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],f,g;if(this._eventsCount===0)return d;for(g in f=this._events)e.call(f,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},o.prototype.listeners=function(d){var f=n?n+d:d,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var h=0,p=g.length,v=new Array(p);h<p;h++)v[h]=g[h].fn;return v},o.prototype.listenerCount=function(d){var f=n?n+d:d,g=this._events[f];return g?g.fn?1:g.length:0},o.prototype.emit=function(d,f,g,h,p,v){var _=n?n+d:d;if(!this._events[_])return!1;var E=this._events[_],b=arguments.length,x,O;if(E.fn){switch(E.once&&this.removeListener(d,E.fn,void 0,!0),b){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,f),!0;case 3:return E.fn.call(E.context,f,g),!0;case 4:return E.fn.call(E.context,f,g,h),!0;case 5:return E.fn.call(E.context,f,g,h,p),!0;case 6:return E.fn.call(E.context,f,g,h,p,v),!0}for(O=1,x=new Array(b-1);O<b;O++)x[O-1]=arguments[O];E.fn.apply(E.context,x)}else{var M=E.length,B;for(O=0;O<M;O++)switch(E[O].once&&this.removeListener(d,E[O].fn,void 0,!0),b){case 1:E[O].fn.call(E[O].context);break;case 2:E[O].fn.call(E[O].context,f);break;case 3:E[O].fn.call(E[O].context,f,g);break;case 4:E[O].fn.call(E[O].context,f,g,h);break;default:if(!x)for(B=1,x=new Array(b-1);B<b;B++)x[B-1]=arguments[B];E[O].fn.apply(E[O].context,x)}}return!0},o.prototype.on=function(d,f,g){return a(this,d,f,g,!1)},o.prototype.once=function(d,f,g){return a(this,d,f,g,!0)},o.prototype.removeListener=function(d,f,g,h){var p=n?n+d:d;if(!this._events[p])return this;if(!f)return i(this,p),this;var v=this._events[p];if(v.fn)v.fn===f&&(!h||v.once)&&(!g||v.context===g)&&i(this,p);else{for(var _=0,E=[],b=v.length;_<b;_++)(v[_].fn!==f||h&&!v[_].once||g&&v[_].context!==g)&&E.push(v[_]);E.length?this._events[p]=E.length===1?E[0]:E:i(this,p)}return this},o.prototype.removeAllListeners=function(d){var f;return d?(f=n?n+d:d,this._events[f]&&i(this,f)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(id)),id.exports}var WL=zL();const GL=pb(WL),Hf=new WeakMap,qf=["error","warn","log","info"];let jf="warn";function Eb(t){if(jf&&qf.indexOf(t)<=qf.indexOf(jf)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console[t](...n)}}function Ls(t){return qf.reduce((e,n)=>(e[n]=Eb.bind(console,n,t),e),{})}Ls.level=t=>{jf=t};Eb.level=Ls.level;const od=Ls("quill:events"),KL=["selectionchange","mousedown","mouseup","click"];KL.forEach(t=>{document.addEventListener(t,function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const a=Hf.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Oe extends GL{constructor(){super(),this.domListeners={},this.on("error",od.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return od.log.call(od,...n),super.emit(...n)}handleDOM(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:i,handler:o}=a;(e.target===i||i.contains(e.target))&&o(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}ye(Oe,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),ye(Oe,"sources",{API:"api",SILENT:"silent",USER:"user"});const ud=Ls("quill:selection");class Va{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class VL{constructor(e,n){this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Va(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Oe.sources.USER),1)}),this.emitter.on(Oe.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Oe.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const i=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(i?Oe.sources.SILENT:s)}catch{}})}),this.emitter.on(Oe.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:o,endOffset:l}=s.range;this.setNativeRange(a,i,o,l),this.update(Oe.sources.SILENT)}}),this.update(Oe.sources.SILENT)}handleComposition(){this.emitter.on(Oe.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Oe.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Oe.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,n){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Re.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof In){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),n=Math.min(e+n,r-1)-e;let s,[a,i]=this.scroll.leaf(e);if(a==null)return null;if(n>0&&i===a.length()){const[f]=this.scroll.leaf(e+1);if(f){const[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===h&&(a=f,i=0)}}[s,i]=a.position(i,!0);const o=document.createRange();if(n>0)return o.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),o.setEnd(s,i),o.getBoundingClientRect());let l="left",d;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(o.setStart(s,i),o.setEnd(s,i+1)):(o.setStart(s,i-1),o.setEnd(s,i),l="right"),d=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;d=a.domNode.getBoundingClientRect(),i>0&&(l="right")}return{bottom:d.top+d.height,height:d.height,left:d[l],right:d[l],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const n=e.getRangeAt(0);if(n==null)return null;const r=this.normalizeNative(n);return ud.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const n=this.getNativeRange();return n==null?[null,null]:[this.normalizedToRange(n),n]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&ld(this.root,document.activeElement)}normalizedToRange(e){const n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);const r=n.map(i=>{const[o,l]=i,d=this.scroll.find(o,!0),f=d.offset(this.scroll);return l===0?f:d instanceof In?f+d.index(o,l):f+d.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Va(a,s-a)}normalizeNative(e){if(!ld(this.root,e.startContainer)||!e.collapsed&&!ld(this.root,e.endContainer))return null;const n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),n}rangeToNative(e){const n=this.scroll.length(),r=(s,a)=>{s=Math.min(n-1,s);const[i,o]=this.scroll.leaf(s);return i?i.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ud.info("setNativeRange",e,n,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const i=document.getSelection();if(i!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(n=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const l=document.createRange();l.setStart(e,n),l.setEnd(r,s),i.removeAllRanges(),i.addRange(l)}}else i.removeAllRanges(),this.root.blur()}setRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oe.sources.API;if(typeof n=="string"&&(r=n,n=!1),ud.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,n)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!n0(n,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const i=this.cursor.restore();i&&this.setNativeRange(i.startNode,i.startOffset,i.endNode,i.endOffset)}const a=[Oe.events.SELECTION_CHANGE,Si(this.lastRange),Si(n),e];this.emitter.emit(Oe.events.EDITOR_CHANGE,...a),e!==Oe.sources.SILENT&&this.emitter.emit(...a)}}}function ld(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const XL=/^[ -~]*$/;class QL{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=E1(e),s=new xe;return JL(r.ops.slice()).reduce((i,o)=>{const l=mr.Op.length(o);let d=o.attributes||{},f=!1,g=!1;if(o.insert!=null){if(s.retain(l),typeof o.insert=="string"){const v=o.insert;g=!v.endsWith(`
80
+ `)&&(n<=i||!!this.scroll.descendant(pr,i)[0]),this.scroll.insertAt(i,v);const[_,E]=this.scroll.line(i);let b=ea({},fr(_));if(_ instanceof _n){const[x]=_.descendant(In,E);x&&(b=ea(b,fr(x)))}d=mr.AttributeMap.diff(b,d)||{}}else if(typeof o.insert=="object"){const v=Object.keys(o.insert)[0];if(v==null)return i;const _=this.scroll.query(v,Re.INLINE)!=null;if(_)(n<=i||this.scroll.descendant(pr,i)[0])&&(g=!0);else if(i>0){const[E,b]=this.scroll.descendant(In,i-1);E instanceof kr?E.value()[b]!==`
81
+ `&&(f=!0):E instanceof Qn&&E.statics.scope===Re.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(i,v,o.insert[v]),_){const[E]=this.scroll.descendant(In,i);if(E){const b=ea({},fr(E));d=mr.AttributeMap.diff(b,d)||{}}}}n+=l}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const v=Object.keys(o.retain)[0];if(v==null)return i;this.scroll.updateEmbedAt(i,v,o.retain[v])}Object.keys(d).forEach(v=>{this.scroll.formatAt(i,l,v,d[v])});const h=f?1:0,p=g?1:0;return n+=h+p,s.retain(h),s.delete(p),i+l+h+p},0),s.reduce((i,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(i,o.delete),i):i+mr.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new xe().retain(e).delete(n))}formatLine(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(a=>{this.scroll.lines(e,Math.max(n,1)).forEach(i=>{i.format(a,r[a])})}),this.scroll.optimize();const s=new xe().retain(e).retain(n,Si(r));return this.update(s)}formatText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(a=>{this.scroll.formatAt(e,n,a,r[a])});const s=new xe().retain(e).retain(n,Si(r));return this.update(s)}getContents(e,n){return this.delta.slice(e,e+n)}getDelta(){return this.scroll.lines().reduce((e,n)=>e.concat(n.delta()),new xe)}getFormat(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];n===0?this.scroll.path(e).forEach(o=>{const[l]=o;l instanceof _n?r.push(l):l instanceof In&&s.push(l)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(In,e,n));const[a,i]=[r,s].map(o=>{const l=o.shift();if(l==null)return{};let d=fr(l);for(;Object.keys(d).length>0;){const f=o.shift();if(f==null)return d;d=ZL(fr(f),d)}return d});return{...a,...i}}getHTML(e,n){const[r,s]=this.scroll.line(e);if(r){const a=r.length();return r.length()>=s+n&&!(s===0&&n===a)?nu(r,s,n,!0):nu(this.scroll,e,n,!0)}return""}getText(e,n){return this.getContents(e,n).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,n){const r=E1(n),s=new xe().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,n,r){return this.scroll.insertAt(e,n,r),this.update(new xe().retain(e).insert({[n]:r}))}insertText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return n=n.replace(/\r\n/g,`
82
82
  `).replace(/\r/g,`
83
83
  `),this.scroll.insertAt(e,n),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,n.length,s,r[s])}),this.update(new xe().retain(e).insert(n,Si(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==_n.blotName)return!1;const n=e;return n.children.length>1?!1:n.children.head instanceof Fr}removeFormat(e,n){const r=this.getText(e,n),[s,a]=this.scroll.line(e+n);let i=0,o=new xe;s!=null&&(i=s.length()-a,o=s.delta().slice(a,a+i-1).insert(`
84
- `));const d=this.getContents(e,n+i).diff(new xe().insert(r).concat(o)),h=new xe().retain(e).concat(d);return this.applyDelta(h)}update(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(n.length===1&&n[0].type==="characterData"&&n[0].target.data.match(XL)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=fr(a),o=a.offset(this.scroll),l=n[0].oldValue.replace(Qi.CONTENTS,""),d=new xe().insert(l),h=new xe().insert(a.value()),g=r&&{oldRange:_1(r.oldRange,-o),newRange:_1(r.newRange,-o)};e=new xe().retain(o).concat(d.diff(h,g)).reduce((p,v)=>v.insert?p.insert(v.insert,i):p.push(v),new xe),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!n0(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function vi(t,e,n){if(t.length===0){const[p]=cd(n.pop());return e<=0?`</li></${p}>`:`</li></${p}>${vi([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:o},...l]=t,[d,h]=cd(o);if(i>e)return n.push(o),i===e+1?`<${d}><li${h}>${nu(r,s,a)}${vi(l,i,n)}`:`<${d}><li>${vi(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&o===g)return`</li><li${h}>${nu(r,s,a)}${vi(l,i,n)}`;const[f]=cd(n.pop());return`</li></${f}>${vi(t,e-1,n)}`}function nu(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in t&&typeof t.html=="function")return t.html(e,n);if(t instanceof kr)return vc(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof Rr){if(t.statics.blotName==="list-container"){const d=[];return t.children.forEachAt(e,n,(h,g,f)=>{const p="formats"in h&&typeof h.formats=="function"?h.formats():{};d.push({child:h,offset:g,length:f,indent:p.indent||0,type:p.list})}),vi(d,-1,[])}const s=[];if(t.children.forEachAt(e,n,(d,h,g)=>{s.push(nu(d,h,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[o,l]=a.split(`>${i}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${l}`:`${o}>${s.join("")}<${l}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function ZL(t,e){return Object.keys(e).reduce((n,r)=>{if(t[r]==null)return n;const s=e[r];return s===t[r]?n[r]=s:Array.isArray(s)?s.indexOf(t[r])<0?n[r]=s.concat([t[r]]):n[r]=s:n[r]=[s,t[r]],n},{})}function cd(t){const e=t==="ordered"?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function E1(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
84
+ `));const d=this.getContents(e,n+i).diff(new xe().insert(r).concat(o)),f=new xe().retain(e).concat(d);return this.applyDelta(f)}update(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(n.length===1&&n[0].type==="characterData"&&n[0].target.data.match(XL)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=fr(a),o=a.offset(this.scroll),l=n[0].oldValue.replace(Qi.CONTENTS,""),d=new xe().insert(l),f=new xe().insert(a.value()),g=r&&{oldRange:_1(r.oldRange,-o),newRange:_1(r.newRange,-o)};e=new xe().retain(o).concat(d.diff(f,g)).reduce((p,v)=>v.insert?p.insert(v.insert,i):p.push(v),new xe),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!n0(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function vi(t,e,n){if(t.length===0){const[p]=cd(n.pop());return e<=0?`</li></${p}>`:`</li></${p}>${vi([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:o},...l]=t,[d,f]=cd(o);if(i>e)return n.push(o),i===e+1?`<${d}><li${f}>${nu(r,s,a)}${vi(l,i,n)}`:`<${d}><li>${vi(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&o===g)return`</li><li${f}>${nu(r,s,a)}${vi(l,i,n)}`;const[h]=cd(n.pop());return`</li></${h}>${vi(t,e-1,n)}`}function nu(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in t&&typeof t.html=="function")return t.html(e,n);if(t instanceof kr)return vc(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof Rr){if(t.statics.blotName==="list-container"){const d=[];return t.children.forEachAt(e,n,(f,g,h)=>{const p="formats"in f&&typeof f.formats=="function"?f.formats():{};d.push({child:f,offset:g,length:h,indent:p.indent||0,type:p.list})}),vi(d,-1,[])}const s=[];if(t.children.forEachAt(e,n,(d,f,g)=>{s.push(nu(d,f,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[o,l]=a.split(`>${i}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${l}`:`${o}>${s.join("")}<${l}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function ZL(t,e){return Object.keys(e).reduce((n,r)=>{if(t[r]==null)return n;const s=e[r];return s===t[r]?n[r]=s:Array.isArray(s)?s.indexOf(t[r])<0?n[r]=s.concat([t[r]]):n[r]=s:n[r]=[s,t[r]],n},{})}function cd(t){const e=t==="ordered"?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function E1(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
85
85
  `).replace(/\r/g,`
86
86
  `);return e.insert(r,n.attributes)}return e.push(n)},new xe)}function _1(t,e){let{index:n,length:r}=t;return new Va(n+e,r)}function JL(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
87
87
  `).forEach((s,a)=>{a&&e.push({insert:`
88
- `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Ur{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}ye(Ur,"DEFAULTS",{});const Zu="\uFEFF";class a0 extends Qn{constructor(e,n){super(e,n),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(Zu),this.rightGuard=document.createTextNode(Zu),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,n)}restore(e){let n=null,r;const s=e.data.split(Zu).join("");if(e===this.leftGuard)if(this.prev instanceof kr){const a=this.prev.length();this.prev.insertAt(a,s),n={startNode:this.prev.domNode,startOffset:a+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),n={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof kr?(this.next.insertAt(0,s),n={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),n={startNode:r,startOffset:s.length}));return e.data=Zu,n}update(e,n){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(n.range=s)}})}}class eO{constructor(e,n){ye(this,"isComposing",!1);this.scroll=e,this.emitter=n,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const n=e.target instanceof Node?this.scroll.find(e.target,!0):null;n&&!(n instanceof a0)&&(this.emitter.emit(Oe.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Oe.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Oe.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Oe.events.COMPOSITION_END,e),this.isComposing=!1}}const jo=class jo{constructor(e,n){ye(this,"modules",{});this.quill=e,this.options=n}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const n=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new n(this.quill,this.options.modules[e]||{}),this.modules[e]}};ye(jo,"DEFAULTS",{modules:{}}),ye(jo,"themes",{default:jo});let Zi=jo;const tO=t=>t.parentElement||t.getRootNode().host||null,nO=t=>{const e=t.getBoundingClientRect(),n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,r="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*r,left:e.left}},Ju=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},T1=(t,e,n,r,s,a)=>t<n&&e>r?0:t<n?-(n-t+s):e>r?e-t>r-n?t+s-n:e-r+a:0,rO=(t,e)=>{var a,i,o;const n=t.ownerDocument;let r=e,s=t;for(;s;){const l=s===n.body,d=l?{top:0,right:((a=window.visualViewport)==null?void 0:a.width)??n.documentElement.clientWidth,bottom:((i=window.visualViewport)==null?void 0:i.height)??n.documentElement.clientHeight,left:0}:nO(s),h=getComputedStyle(s),g=T1(r.left,r.right,d.left,d.right,Ju(h.scrollPaddingLeft),Ju(h.scrollPaddingRight)),f=T1(r.top,r.bottom,d.top,d.bottom,Ju(h.scrollPaddingTop),Ju(h.scrollPaddingBottom));if(g||f)if(l)(o=n.defaultView)==null||o.scrollBy(g,f);else{const{scrollLeft:p,scrollTop:v}=s;f&&(s.scrollTop+=f),g&&(s.scrollLeft+=g);const b=s.scrollLeft-p,E=s.scrollTop-v;r={left:r.left-b,top:r.top-E,right:r.right-b,bottom:r.bottom-E}}s=l||h.position==="fixed"?null:tO(s)}},sO=100,aO=["block","break","cursor","inline","scroll","text"],iO=(t,e,n)=>{const r=new Xi;return aO.forEach(s=>{const a=e.query(s);a&&r.register(a)}),t.forEach(s=>{let a=e.query(s);a||n.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let i=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,i+=1,i>sO){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},Ci=Ls("quill"),el=new Xi;Rr.uiClass="ql-ui";const yr=class yr{static debug(e){e===!0&&(e="log"),Ls.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Hf.get(e)||el.find(e,n)}static import(e){return this.imports[e]==null&&Ci.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],n=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,n):Object.keys(e).forEach(s=>{this.register(s,e[s],n)})}else{const e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&Ci.warn(`Overwriting ${e} with`,n),this.imports[e]=n,(e.startsWith("blots/")||e.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&el.register(n),typeof n.register=="function"&&n.register(el)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=oO(e,n),this.container=this.options.container,this.container==null){Ci.error("Invalid Quill container",e);return}this.options.debug&&yr.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Hf.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Oe;const s=s0.blotName,a=this.options.registry.query(s);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new QL(this.scroll),this.selection=new VL(this.scroll,this.emitter),this.composition=new eO(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Oe.events.EDITOR_CHANGE,i=>{i===Oe.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Oe.events.SCROLL_UPDATE,(i,o)=>{const l=this.selection.lastRange,[d]=this.selection.getRange(),h=l&&d?{oldRange:l,newRange:d}:void 0;Tr.call(this,()=>this.editor.update(null,o,h),i)}),this.emitter.on(Oe.events.SCROLL_EMBED_UPDATE,(i,o)=>{const l=this.selection.lastRange,[d]=this.selection.getRange(),h=l&&d?{oldRange:l,newRange:d}:void 0;Tr.call(this,()=>{const g=new xe().retain(i.offset(this)).retain({[i.statics.blotName]:o});return this.editor.update(g,[],h)},yr.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
89
- `});this.setContents(i)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,n),e}blur(){this.selection.setRange(null)}deleteText(e,n,r){return[e,n,,r]=hs(e,n,r),Tr.call(this,()=>this.editor.deleteText(e,n),r,e,-1*n)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const n=e();return this.allowReadOnlyEdits=!1,n}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oe.sources.API;return Tr.call(this,()=>{const s=this.getSelection(!0);let a=new xe;if(s==null)return a;if(this.scroll.query(e,Re.BLOCK))a=this.editor.formatLine(s.index,s.length,{[e]:n});else{if(s.length===0)return this.selection.format(e,n),a;a=this.editor.formatText(s.index,s.length,{[e]:n})}return this.setSelection(s,Oe.sources.SILENT),a},r)}formatLine(e,n,r,s,a){let i;return[e,n,i,a]=hs(e,n,r,s,a),Tr.call(this,()=>this.editor.formatLine(e,n,i),a,e,0)}formatText(e,n,r,s,a){let i;return[e,n,i,a]=hs(e,n,r,s,a),Tr.call(this,()=>this.editor.formatText(e,n,i),a,e,0)}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,n):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,n]=hs(e,n),this.editor.getContents(e,n)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,n):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,n)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=hs(e,n),this.editor.getHTML(e,n)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=hs(e,n),this.editor.getText(e,n)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:yr.sources.API;return Tr.call(this,()=>this.editor.insertEmbed(e,n,r),s,e)}insertText(e,n,r,s,a){let i;return[e,,i,a]=hs(e,0,r,s,a),Tr.call(this,()=>this.editor.insertText(e,n,i),a,e,n.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,n,r){return[e,n,,r]=hs(e,n,r),Tr.call(this,()=>this.editor.removeFormat(e,n),r,e)}scrollRectIntoView(e){rO(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,n=e&&this.selection.getBounds(e.index,e.length);n&&this.scrollRectIntoView(n)}setContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;return Tr.call(this,()=>{e=new xe(e);const r=this.getLength(),s=this.editor.deleteText(0,r),a=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return s.compose(a).compose(i)},n)}setSelection(e,n,r){e==null?this.selection.setRange(null,n||yr.sources.API):([e,n,,r]=hs(e,n,r),this.selection.setRange(new Va(Math.max(0,e),n),r),r!==Oe.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;const r=new xe().insert(e);return this.setContents(r,n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe.sources.USER;const n=this.scroll.update(e);return this.selection.update(e),n}updateContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;return Tr.call(this,()=>(e=new xe(e),this.editor.applyDelta(e)),n,!0)}};ye(yr,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:el,theme:"default"}),ye(yr,"events",Oe.events),ye(yr,"sources",Oe.sources),ye(yr,"version","2.0.3"),ye(yr,"imports",{delta:xe,parchment:UL,"core/module":Ur,"core/theme":Zi});let le=yr;function A1(t){return typeof t=="string"?document.querySelector(t):t}function dd(t){return Object.entries(t??{}).reduce((e,n)=>{let[r,s]=n;return{...e,[r]:s===!0?{}:s}},{})}function y1(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function oO(t,e){const n=A1(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===le.DEFAULTS.theme?Zi:le.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=le.DEFAULTS,{modules:o,...l}=s.DEFAULTS;let d=dd(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const h=ea({},dd(a),dd(o),d),g={...i,...y1(l),...y1(e)};let f=e.registry;return f?e.formats&&Ci.warn('Ignoring "formats" option because "registry" is specified'):f=e.formats?iO(e.formats,g.registry,Ci):g.registry,{...g,registry:f,container:n,theme:s,modules:Object.entries(h).reduce((p,v)=>{let[b,E]=v;if(!E)return p;const _=le.import(`modules/${b}`);return _==null?(Ci.error(`Cannot load ${b} module. Are you sure you registered it?`),p):{...p,[b]:ea({},_.DEFAULTS||{},E)}},{}),bounds:A1(g.bounds)}}function Tr(t,e,n,r){if(!this.isEnabled()&&e===Oe.sources.USER&&!this.allowReadOnlyEdits)return new xe;let s=n==null?null:this.getSelection();const a=this.editor.delta,i=t();if(s!=null&&(n===!0&&(n=s.index),r==null?s=N1(s,i,e):r!==0&&(s=N1(s,n,r,e)),this.setSelection(s,Oe.sources.SILENT)),i.length()>0){const o=[Oe.events.TEXT_CHANGE,i,a,e];this.emitter.emit(Oe.events.EDITOR_CHANGE,...o),e!==Oe.sources.SILENT&&this.emitter.emit(...o)}return i}function hs(t,e,n,r,s){let a={};return typeof t.index=="number"&&typeof t.length=="number"?typeof e!="number"?(s=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):typeof e!="number"&&(s=r,r=n,n=e,e=0),typeof n=="object"?(a=n,s=r):typeof n=="string"&&(r!=null?a[n]=r:s=n),s=s||Oe.sources.API,[t,e,a,s]}function N1(t,e,n,r){const s=typeof n=="number"?n:0;if(t==null)return null;let a,i;return e&&typeof e.transformPosition=="function"?[a,i]=[t.index,t.index+t.length].map(o=>e.transformPosition(o,r!==Oe.sources.USER)):[a,i]=[t.index,t.index+t.length].map(o=>o<e||o===e&&r===Oe.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new Va(a,i-a)}class si extends gc{}function w1(t){return t instanceof _n||t instanceof pr}function S1(t){return typeof t.updateContent=="function"}class bi extends s0{constructor(e,n,r){let{emitter:s}=r;super(e,n),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",a=>this.handleDragStart(a))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Oe.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Oe.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(Oe.events.SCROLL_EMBED_UPDATE,e,n)}deleteAt(e,n){const[r,s]=this.line(e),[a]=this.line(e+n);if(super.deleteAt(e,n),a!=null&&r!==a&&s>0){if(r instanceof pr||a instanceof pr){this.optimize();return}const i=a.children.head instanceof Fr?null:a.children.head;r.moveChildren(a,i),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.optimize()}insertAt(e,n,r){if(e>=this.length())if(r==null||this.scroll.query(n,Re.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
88
+ `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Ur{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}ye(Ur,"DEFAULTS",{});const Zu="\uFEFF";class a0 extends Qn{constructor(e,n){super(e,n),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(Zu),this.rightGuard=document.createTextNode(Zu),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,n)}restore(e){let n=null,r;const s=e.data.split(Zu).join("");if(e===this.leftGuard)if(this.prev instanceof kr){const a=this.prev.length();this.prev.insertAt(a,s),n={startNode:this.prev.domNode,startOffset:a+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),n={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof kr?(this.next.insertAt(0,s),n={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),n={startNode:r,startOffset:s.length}));return e.data=Zu,n}update(e,n){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(n.range=s)}})}}class eO{constructor(e,n){ye(this,"isComposing",!1);this.scroll=e,this.emitter=n,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const n=e.target instanceof Node?this.scroll.find(e.target,!0):null;n&&!(n instanceof a0)&&(this.emitter.emit(Oe.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Oe.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Oe.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Oe.events.COMPOSITION_END,e),this.isComposing=!1}}const jo=class jo{constructor(e,n){ye(this,"modules",{});this.quill=e,this.options=n}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const n=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new n(this.quill,this.options.modules[e]||{}),this.modules[e]}};ye(jo,"DEFAULTS",{modules:{}}),ye(jo,"themes",{default:jo});let Zi=jo;const tO=t=>t.parentElement||t.getRootNode().host||null,nO=t=>{const e=t.getBoundingClientRect(),n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,r="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*r,left:e.left}},Ju=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},T1=(t,e,n,r,s,a)=>t<n&&e>r?0:t<n?-(n-t+s):e>r?e-t>r-n?t+s-n:e-r+a:0,rO=(t,e)=>{var a,i,o;const n=t.ownerDocument;let r=e,s=t;for(;s;){const l=s===n.body,d=l?{top:0,right:((a=window.visualViewport)==null?void 0:a.width)??n.documentElement.clientWidth,bottom:((i=window.visualViewport)==null?void 0:i.height)??n.documentElement.clientHeight,left:0}:nO(s),f=getComputedStyle(s),g=T1(r.left,r.right,d.left,d.right,Ju(f.scrollPaddingLeft),Ju(f.scrollPaddingRight)),h=T1(r.top,r.bottom,d.top,d.bottom,Ju(f.scrollPaddingTop),Ju(f.scrollPaddingBottom));if(g||h)if(l)(o=n.defaultView)==null||o.scrollBy(g,h);else{const{scrollLeft:p,scrollTop:v}=s;h&&(s.scrollTop+=h),g&&(s.scrollLeft+=g);const _=s.scrollLeft-p,E=s.scrollTop-v;r={left:r.left-_,top:r.top-E,right:r.right-_,bottom:r.bottom-E}}s=l||f.position==="fixed"?null:tO(s)}},sO=100,aO=["block","break","cursor","inline","scroll","text"],iO=(t,e,n)=>{const r=new Xi;return aO.forEach(s=>{const a=e.query(s);a&&r.register(a)}),t.forEach(s=>{let a=e.query(s);a||n.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let i=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,i+=1,i>sO){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},Ci=Ls("quill"),el=new Xi;Rr.uiClass="ql-ui";const yr=class yr{static debug(e){e===!0&&(e="log"),Ls.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Hf.get(e)||el.find(e,n)}static import(e){return this.imports[e]==null&&Ci.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],n=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,n):Object.keys(e).forEach(s=>{this.register(s,e[s],n)})}else{const e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&Ci.warn(`Overwriting ${e} with`,n),this.imports[e]=n,(e.startsWith("blots/")||e.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&el.register(n),typeof n.register=="function"&&n.register(el)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=oO(e,n),this.container=this.options.container,this.container==null){Ci.error("Invalid Quill container",e);return}this.options.debug&&yr.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Hf.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Oe;const s=s0.blotName,a=this.options.registry.query(s);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new QL(this.scroll),this.selection=new VL(this.scroll,this.emitter),this.composition=new eO(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Oe.events.EDITOR_CHANGE,i=>{i===Oe.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Oe.events.SCROLL_UPDATE,(i,o)=>{const l=this.selection.lastRange,[d]=this.selection.getRange(),f=l&&d?{oldRange:l,newRange:d}:void 0;Tr.call(this,()=>this.editor.update(null,o,f),i)}),this.emitter.on(Oe.events.SCROLL_EMBED_UPDATE,(i,o)=>{const l=this.selection.lastRange,[d]=this.selection.getRange(),f=l&&d?{oldRange:l,newRange:d}:void 0;Tr.call(this,()=>{const g=new xe().retain(i.offset(this)).retain({[i.statics.blotName]:o});return this.editor.update(g,[],f)},yr.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
89
+ `});this.setContents(i)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,n),e}blur(){this.selection.setRange(null)}deleteText(e,n,r){return[e,n,,r]=hs(e,n,r),Tr.call(this,()=>this.editor.deleteText(e,n),r,e,-1*n)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const n=e();return this.allowReadOnlyEdits=!1,n}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oe.sources.API;return Tr.call(this,()=>{const s=this.getSelection(!0);let a=new xe;if(s==null)return a;if(this.scroll.query(e,Re.BLOCK))a=this.editor.formatLine(s.index,s.length,{[e]:n});else{if(s.length===0)return this.selection.format(e,n),a;a=this.editor.formatText(s.index,s.length,{[e]:n})}return this.setSelection(s,Oe.sources.SILENT),a},r)}formatLine(e,n,r,s,a){let i;return[e,n,i,a]=hs(e,n,r,s,a),Tr.call(this,()=>this.editor.formatLine(e,n,i),a,e,0)}formatText(e,n,r,s,a){let i;return[e,n,i,a]=hs(e,n,r,s,a),Tr.call(this,()=>this.editor.formatText(e,n,i),a,e,0)}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,n):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,n]=hs(e,n),this.editor.getContents(e,n)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,n):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,n)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=hs(e,n),this.editor.getHTML(e,n)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=hs(e,n),this.editor.getText(e,n)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:yr.sources.API;return Tr.call(this,()=>this.editor.insertEmbed(e,n,r),s,e)}insertText(e,n,r,s,a){let i;return[e,,i,a]=hs(e,0,r,s,a),Tr.call(this,()=>this.editor.insertText(e,n,i),a,e,n.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,n,r){return[e,n,,r]=hs(e,n,r),Tr.call(this,()=>this.editor.removeFormat(e,n),r,e)}scrollRectIntoView(e){rO(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,n=e&&this.selection.getBounds(e.index,e.length);n&&this.scrollRectIntoView(n)}setContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;return Tr.call(this,()=>{e=new xe(e);const r=this.getLength(),s=this.editor.deleteText(0,r),a=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return s.compose(a).compose(i)},n)}setSelection(e,n,r){e==null?this.selection.setRange(null,n||yr.sources.API):([e,n,,r]=hs(e,n,r),this.selection.setRange(new Va(Math.max(0,e),n),r),r!==Oe.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;const r=new xe().insert(e);return this.setContents(r,n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe.sources.USER;const n=this.scroll.update(e);return this.selection.update(e),n}updateContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;return Tr.call(this,()=>(e=new xe(e),this.editor.applyDelta(e)),n,!0)}};ye(yr,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:el,theme:"default"}),ye(yr,"events",Oe.events),ye(yr,"sources",Oe.sources),ye(yr,"version","2.0.3"),ye(yr,"imports",{delta:xe,parchment:UL,"core/module":Ur,"core/theme":Zi});let le=yr;function A1(t){return typeof t=="string"?document.querySelector(t):t}function dd(t){return Object.entries(t??{}).reduce((e,n)=>{let[r,s]=n;return{...e,[r]:s===!0?{}:s}},{})}function y1(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function oO(t,e){const n=A1(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===le.DEFAULTS.theme?Zi:le.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=le.DEFAULTS,{modules:o,...l}=s.DEFAULTS;let d=dd(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const f=ea({},dd(a),dd(o),d),g={...i,...y1(l),...y1(e)};let h=e.registry;return h?e.formats&&Ci.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?iO(e.formats,g.registry,Ci):g.registry,{...g,registry:h,container:n,theme:s,modules:Object.entries(f).reduce((p,v)=>{let[_,E]=v;if(!E)return p;const b=le.import(`modules/${_}`);return b==null?(Ci.error(`Cannot load ${_} module. Are you sure you registered it?`),p):{...p,[_]:ea({},b.DEFAULTS||{},E)}},{}),bounds:A1(g.bounds)}}function Tr(t,e,n,r){if(!this.isEnabled()&&e===Oe.sources.USER&&!this.allowReadOnlyEdits)return new xe;let s=n==null?null:this.getSelection();const a=this.editor.delta,i=t();if(s!=null&&(n===!0&&(n=s.index),r==null?s=N1(s,i,e):r!==0&&(s=N1(s,n,r,e)),this.setSelection(s,Oe.sources.SILENT)),i.length()>0){const o=[Oe.events.TEXT_CHANGE,i,a,e];this.emitter.emit(Oe.events.EDITOR_CHANGE,...o),e!==Oe.sources.SILENT&&this.emitter.emit(...o)}return i}function hs(t,e,n,r,s){let a={};return typeof t.index=="number"&&typeof t.length=="number"?typeof e!="number"?(s=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):typeof e!="number"&&(s=r,r=n,n=e,e=0),typeof n=="object"?(a=n,s=r):typeof n=="string"&&(r!=null?a[n]=r:s=n),s=s||Oe.sources.API,[t,e,a,s]}function N1(t,e,n,r){const s=typeof n=="number"?n:0;if(t==null)return null;let a,i;return e&&typeof e.transformPosition=="function"?[a,i]=[t.index,t.index+t.length].map(o=>e.transformPosition(o,r!==Oe.sources.USER)):[a,i]=[t.index,t.index+t.length].map(o=>o<e||o===e&&r===Oe.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new Va(a,i-a)}class si extends gc{}function w1(t){return t instanceof _n||t instanceof pr}function S1(t){return typeof t.updateContent=="function"}class bi extends s0{constructor(e,n,r){let{emitter:s}=r;super(e,n),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",a=>this.handleDragStart(a))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Oe.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Oe.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(Oe.events.SCROLL_EMBED_UPDATE,e,n)}deleteAt(e,n){const[r,s]=this.line(e),[a]=this.line(e+n);if(super.deleteAt(e,n),a!=null&&r!==a&&s>0){if(r instanceof pr||a instanceof pr){this.optimize();return}const i=a.children.head instanceof Fr?null:a.children.head;r.moveChildren(a,i),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.optimize()}insertAt(e,n,r){if(e>=this.length())if(r==null||this.scroll.query(n,Re.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
90
90
  `)?s.insertAt(0,n.slice(0,-1),r):s.insertAt(0,n,r)}else{const s=this.scroll.create(n,r);this.appendChild(s)}else super.insertAt(e,n,r);this.optimize()}insertBefore(e,n){if(e.statics.scope===Re.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,n)}else super.insertBefore(e,n)}insertContents(e,n){const r=this.deltaToRenderBlocks(n.concat(new xe().insert(`
91
- `))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const l=a.type==="block"&&(a.delta.length()===0||!this.descendant(pr,e)[0]&&e<this.length()),d=a.type==="block"?a.delta:new xe().insert({[a.key]:a.value});fd(this,e,d);const h=a.type==="block"?1:0,g=e+d.length()+h;l&&this.insertAt(g-1,`
92
- `);const f=fr(this.line(e)[0]),p=mr.AttributeMap.diff(f,a.attributes)||{};Object.keys(p).forEach(v=>{this.formatAt(g-1,1,v,p[v])}),e=g}let[i,o]=this.children.find(e);if(r.length&&(i&&(i=i.split(o),o=0),r.forEach(l=>{if(l.type==="block"){const d=this.createBlock(l.attributes,i||void 0);fd(d,0,l.delta)}else{const d=this.create(l.key,l.value);this.insertBefore(d,i||void 0),Object.keys(l.attributes).forEach(h=>{d.format(h,l.attributes[h])})}})),s.type==="block"&&s.delta.length()){const l=i?i.offset(i.scroll)+o:this.length();fd(this,l,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const n=this.path(e).pop();if(!n)return[null,-1];const[r,s]=n;return r instanceof In?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(w1,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,a,i)=>{let o=[],l=i;return s.children.forEachAt(a,i,(d,h,g)=>{w1(d)?o.push(d):d instanceof gc&&(o=o.concat(r(d,h,l))),l-=g}),o};return r(this,e,n)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,n),e.length>0&&this.emitter.emit(Oe.events.SCROLL_OPTIMIZE,e,n))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let n=Oe.sources.USER;typeof e=="string"&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:s}=r;const a=this.find(s,!0);return a&&!S1(a)}),e.length>0&&this.emitter.emit(Oe.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Oe.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof pr,e);s&&s.statics.blotName===n&&S1(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const n=[];let r=new xe;return e.forEach(s=>{const a=s==null?void 0:s.insert;if(a)if(typeof a=="string"){const i=a.split(`
93
- `);i.slice(0,-1).forEach(l=>{r.insert(l,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new xe});const o=i[i.length-1];o&&r.insert(o,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Re.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new xe,n.push({type:"blockEmbed",key:i,value:a[i],attributes:s.attributes??{}}))}}),r.length()&&n.push({type:"block",delta:r,attributes:{}}),n}createBlock(e,n){let r;const s={};Object.entries(e).forEach(o=>{let[l,d]=o;this.query(l,Re.BLOCK&Re.BLOT)!=null?r=l:s[l]=d});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,n||void 0);const i=a.length();return Object.entries(s).forEach(o=>{let[l,d]=o;a.formatAt(0,i,l,d)}),a}}ye(bi,"blotName","scroll"),ye(bi,"className","ql-editor"),ye(bi,"tagName","DIV"),ye(bi,"defaultChild",_n),ye(bi,"allowedChildren",[_n,pr,si]);function fd(t,e,n){n.reduce((r,s)=>{const a=mr.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;t.insertAt(r,o);const[l]=t.descendant(In,r),d=fr(l);i=mr.AttributeMap.diff(d,i)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(t.insertAt(r,o,s.insert[o]),t.scroll.query(o,Re.INLINE)!=null){const[d]=t.descendant(In,r),h=fr(d);i=mr.AttributeMap.diff(h,i)||{}}}}return Object.keys(i).forEach(o=>{t.formatAt(r,a,o,i[o])}),r+a},e)}const i0={scope:Re.BLOCK,whitelist:["right","center","justify"]},uO=new as("align","align",i0),Tb=new Br("align","ql-align",i0),Ab=new ua("align","text-align",i0);class yb extends ua{value(e){let n=super.value(e);return n.startsWith("rgb(")?(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${n.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):n}}const lO=new Br("color","ql-color",{scope:Re.INLINE}),o0=new yb("color","color",{scope:Re.INLINE}),cO=new Br("background","ql-bg",{scope:Re.INLINE}),u0=new yb("background","background-color",{scope:Re.INLINE});class ai extends si{static create(e){const n=super.create(e);return n.setAttribute("spellcheck","false"),n}code(e,n){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
91
+ `))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const l=a.type==="block"&&(a.delta.length()===0||!this.descendant(pr,e)[0]&&e<this.length()),d=a.type==="block"?a.delta:new xe().insert({[a.key]:a.value});fd(this,e,d);const f=a.type==="block"?1:0,g=e+d.length()+f;l&&this.insertAt(g-1,`
92
+ `);const h=fr(this.line(e)[0]),p=mr.AttributeMap.diff(h,a.attributes)||{};Object.keys(p).forEach(v=>{this.formatAt(g-1,1,v,p[v])}),e=g}let[i,o]=this.children.find(e);if(r.length&&(i&&(i=i.split(o),o=0),r.forEach(l=>{if(l.type==="block"){const d=this.createBlock(l.attributes,i||void 0);fd(d,0,l.delta)}else{const d=this.create(l.key,l.value);this.insertBefore(d,i||void 0),Object.keys(l.attributes).forEach(f=>{d.format(f,l.attributes[f])})}})),s.type==="block"&&s.delta.length()){const l=i?i.offset(i.scroll)+o:this.length();fd(this,l,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const n=this.path(e).pop();if(!n)return[null,-1];const[r,s]=n;return r instanceof In?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(w1,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,a,i)=>{let o=[],l=i;return s.children.forEachAt(a,i,(d,f,g)=>{w1(d)?o.push(d):d instanceof gc&&(o=o.concat(r(d,f,l))),l-=g}),o};return r(this,e,n)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,n),e.length>0&&this.emitter.emit(Oe.events.SCROLL_OPTIMIZE,e,n))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let n=Oe.sources.USER;typeof e=="string"&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:s}=r;const a=this.find(s,!0);return a&&!S1(a)}),e.length>0&&this.emitter.emit(Oe.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Oe.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof pr,e);s&&s.statics.blotName===n&&S1(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const n=[];let r=new xe;return e.forEach(s=>{const a=s==null?void 0:s.insert;if(a)if(typeof a=="string"){const i=a.split(`
93
+ `);i.slice(0,-1).forEach(l=>{r.insert(l,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new xe});const o=i[i.length-1];o&&r.insert(o,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Re.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new xe,n.push({type:"blockEmbed",key:i,value:a[i],attributes:s.attributes??{}}))}}),r.length()&&n.push({type:"block",delta:r,attributes:{}}),n}createBlock(e,n){let r;const s={};Object.entries(e).forEach(o=>{let[l,d]=o;this.query(l,Re.BLOCK&Re.BLOT)!=null?r=l:s[l]=d});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,n||void 0);const i=a.length();return Object.entries(s).forEach(o=>{let[l,d]=o;a.formatAt(0,i,l,d)}),a}}ye(bi,"blotName","scroll"),ye(bi,"className","ql-editor"),ye(bi,"tagName","DIV"),ye(bi,"defaultChild",_n),ye(bi,"allowedChildren",[_n,pr,si]);function fd(t,e,n){n.reduce((r,s)=>{const a=mr.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;t.insertAt(r,o);const[l]=t.descendant(In,r),d=fr(l);i=mr.AttributeMap.diff(d,i)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(t.insertAt(r,o,s.insert[o]),t.scroll.query(o,Re.INLINE)!=null){const[d]=t.descendant(In,r),f=fr(d);i=mr.AttributeMap.diff(f,i)||{}}}}return Object.keys(i).forEach(o=>{t.formatAt(r,a,o,i[o])}),r+a},e)}const i0={scope:Re.BLOCK,whitelist:["right","center","justify"]},uO=new as("align","align",i0),_b=new Br("align","ql-align",i0),Tb=new ua("align","text-align",i0);class Ab extends ua{value(e){let n=super.value(e);return n.startsWith("rgb(")?(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${n.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):n}}const lO=new Br("color","ql-color",{scope:Re.INLINE}),o0=new Ab("color","color",{scope:Re.INLINE}),cO=new Br("background","ql-bg",{scope:Re.INLINE}),u0=new Ab("background","background-color",{scope:Re.INLINE});class ai extends si{static create(e){const n=super.create(e);return n.setAttribute("spellcheck","false"),n}code(e,n){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
94
94
  `).slice(e,e+n)}html(e,n){return`<pre>
95
95
  ${vc(this.code(e,n))}
96
- </pre>`}}class Cn extends _n{static register(){le.register(ai)}}ye(Cn,"TAB"," ");class l0 extends is{}l0.blotName="code";l0.tagName="CODE";Cn.blotName="code-block";Cn.className="ql-code-block";Cn.tagName="DIV";ai.blotName="code-block-container";ai.className="ql-code-block-container";ai.tagName="DIV";ai.allowedChildren=[Cn];Cn.allowedChildren=[kr,Fr,Qi];Cn.requiredContainer=ai;const c0={scope:Re.BLOCK,whitelist:["rtl"]},Nb=new as("direction","dir",c0),wb=new Br("direction","ql-direction",c0),Sb=new ua("direction","direction",c0),Ib={scope:Re.INLINE,whitelist:["serif","monospace"]},Cb=new Br("font","ql-font",Ib);class dO extends ua{value(e){return super.value(e).replace(/["']/g,"")}}const Lb=new dO("font","font-family",Ib),Ob=new Br("size","ql-size",{scope:Re.INLINE,whitelist:["small","large","huge"]}),xb=new ua("size","font-size",{scope:Re.INLINE,whitelist:["10px","18px","32px"]}),fO=Ls("quill:keyboard"),hO=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class bc extends Ur{static match(e,n){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!n[r]!==e[r]&&n[r]!==null)?!1:n.key===e.key||n.key===e.which}constructor(e,n){super(e,n),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=mO(e);if(s==null){fO.warn("Attempted to add invalid keyboard binding",s);return}typeof n=="function"&&(n={handler:n}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(i=>{const o={...s,key:i,...n,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(_=>bc.match(e,_));if(s.length===0)return;const a=le.find(e.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;const[o,l]=this.quill.getLine(i.index),[d,h]=this.quill.getLeaf(i.index),[g,f]=i.length===0?[d,h]:this.quill.getLeaf(i.index+i.length),p=d instanceof ql?d.value().slice(0,h):"",v=g instanceof ql?g.value().slice(f):"",b={collapsed:i.length===0,empty:i.length===0&&o.length()<=1,format:this.quill.getFormat(i),line:o,offset:l,prefix:p,suffix:v,event:e};s.some(_=>{if(_.collapsed!=null&&_.collapsed!==b.collapsed||_.empty!=null&&_.empty!==b.empty||_.offset!=null&&_.offset!==b.offset)return!1;if(Array.isArray(_.format)){if(_.format.every(R=>b.format[R]==null))return!1}else if(typeof _.format=="object"&&!Object.keys(_.format).every(R=>_.format[R]===!0?b.format[R]!=null:_.format[R]===!1?b.format[R]==null:n0(_.format[R],b.format[R])))return!1;return _.prefix!=null&&!_.prefix.test(b.prefix)||_.suffix!=null&&!_.suffix.test(b.suffix)?!1:_.handler.call(this,i,b,_)!==!0})&&e.preventDefault()})}handleBackspace(e,n){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(n.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[a]=this.quill.getLine(e.index);let i=new xe().retain(e.index-r).delete(r);if(n.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const d=a.formats(),h=this.quill.getFormat(e.index-1,1);if(s=mr.AttributeMap.diff(d,h)||{},Object.keys(s).length>0){const g=new xe().retain(e.index+a.length()-2).retain(1,s);i=i.compose(g)}}}this.quill.updateContents(i,le.sources.USER),this.quill.focus()}handleDelete(e,n){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(n.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[a]=this.quill.getLine(e.index);let i=new xe().retain(e.index).delete(r);if(n.offset>=a.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const l=a.formats(),d=this.quill.getFormat(e.index,1);s=mr.AttributeMap.diff(l,d)||{},Object.keys(s).length>0&&(i=i.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(i,le.sources.USER),this.quill.focus()}handleDeleteRange(e){d0({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,n){const r=Object.keys(n.format).reduce((a,i)=>(this.quill.scroll.query(i,Re.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new xe().retain(e.index).delete(e.length).insert(`
96
+ </pre>`}}class Cn extends _n{static register(){le.register(ai)}}ye(Cn,"TAB"," ");class l0 extends is{}l0.blotName="code";l0.tagName="CODE";Cn.blotName="code-block";Cn.className="ql-code-block";Cn.tagName="DIV";ai.blotName="code-block-container";ai.className="ql-code-block-container";ai.tagName="DIV";ai.allowedChildren=[Cn];Cn.allowedChildren=[kr,Fr,Qi];Cn.requiredContainer=ai;const c0={scope:Re.BLOCK,whitelist:["rtl"]},yb=new as("direction","dir",c0),Nb=new Br("direction","ql-direction",c0),wb=new ua("direction","direction",c0),Sb={scope:Re.INLINE,whitelist:["serif","monospace"]},Ib=new Br("font","ql-font",Sb);class dO extends ua{value(e){return super.value(e).replace(/["']/g,"")}}const Cb=new dO("font","font-family",Sb),Lb=new Br("size","ql-size",{scope:Re.INLINE,whitelist:["small","large","huge"]}),Ob=new ua("size","font-size",{scope:Re.INLINE,whitelist:["10px","18px","32px"]}),fO=Ls("quill:keyboard"),hO=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class bc extends Ur{static match(e,n){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!n[r]!==e[r]&&n[r]!==null)?!1:n.key===e.key||n.key===e.which}constructor(e,n){super(e,n),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=mO(e);if(s==null){fO.warn("Attempted to add invalid keyboard binding",s);return}typeof n=="function"&&(n={handler:n}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(i=>{const o={...s,key:i,...n,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(b=>bc.match(e,b));if(s.length===0)return;const a=le.find(e.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;const[o,l]=this.quill.getLine(i.index),[d,f]=this.quill.getLeaf(i.index),[g,h]=i.length===0?[d,f]:this.quill.getLeaf(i.index+i.length),p=d instanceof ql?d.value().slice(0,f):"",v=g instanceof ql?g.value().slice(h):"",_={collapsed:i.length===0,empty:i.length===0&&o.length()<=1,format:this.quill.getFormat(i),line:o,offset:l,prefix:p,suffix:v,event:e};s.some(b=>{if(b.collapsed!=null&&b.collapsed!==_.collapsed||b.empty!=null&&b.empty!==_.empty||b.offset!=null&&b.offset!==_.offset)return!1;if(Array.isArray(b.format)){if(b.format.every(x=>_.format[x]==null))return!1}else if(typeof b.format=="object"&&!Object.keys(b.format).every(x=>b.format[x]===!0?_.format[x]!=null:b.format[x]===!1?_.format[x]==null:n0(b.format[x],_.format[x])))return!1;return b.prefix!=null&&!b.prefix.test(_.prefix)||b.suffix!=null&&!b.suffix.test(_.suffix)?!1:b.handler.call(this,i,_,b)!==!0})&&e.preventDefault()})}handleBackspace(e,n){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(n.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[a]=this.quill.getLine(e.index);let i=new xe().retain(e.index-r).delete(r);if(n.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const d=a.formats(),f=this.quill.getFormat(e.index-1,1);if(s=mr.AttributeMap.diff(d,f)||{},Object.keys(s).length>0){const g=new xe().retain(e.index+a.length()-2).retain(1,s);i=i.compose(g)}}}this.quill.updateContents(i,le.sources.USER),this.quill.focus()}handleDelete(e,n){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(n.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[a]=this.quill.getLine(e.index);let i=new xe().retain(e.index).delete(r);if(n.offset>=a.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const l=a.formats(),d=this.quill.getFormat(e.index,1);s=mr.AttributeMap.diff(l,d)||{},Object.keys(s).length>0&&(i=i.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(i,le.sources.USER),this.quill.focus()}handleDeleteRange(e){d0({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,n){const r=Object.keys(n.format).reduce((a,i)=>(this.quill.scroll.query(i,Re.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new xe().retain(e.index).delete(e.length).insert(`
97
97
  `,r);this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(e.index+1,le.sources.SILENT),this.quill.focus()}}const pO={bindings:{bold:hd("bold"),italic:hd("italic"),underline:hd("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",le.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",le.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){e.format.indent!=null?this.quill.format("indent","-1",le.sources.USER):e.format.list!=null&&this.quill.format("list",!1,le.sources.USER)}},"indent code-block":I1(!0),"outdent code-block":I1(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,le.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=new xe().retain(t.index).delete(t.length).insert(" ");return this.quill.updateContents(n,le.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,le.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,le.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const n={list:!1};e.format.indent&&(n.indent=!1),this.quill.formatLine(t.index,t.length,n,le.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const[e,n]=this.quill.getLine(t.index),r={...e.formats(),list:"checked"},s=new xe().retain(t.index).insert(`
98
98
  `,r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(t.index+1,le.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const[n,r]=this.quill.getLine(t.index),s=new xe().retain(t.index).insert(`
99
99
  `,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(t.index+1,le.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const[n,r,s,a]=e.getTable(t),i=gO(n,r,s,a);if(i==null)return;let o=n.offset();if(i<0){const l=new xe().retain(o).insert(`
100
100
  `);this.quill.updateContents(l,le.sources.USER),this.quill.setSelection(t.index+1,t.length,le.sources.SILENT)}else if(i>0){o+=n.length();const l=new xe().retain(o).insert(`
101
- `);this.quill.updateContents(l,le.sources.USER),this.quill.setSelection(o,le.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:r}=e,s=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(s-1,le.sources.USER):this.quill.setSelection(s+r.length(),le.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(this.quill.scroll.query("list")==null)return!0;const{length:n}=e.prefix,[r,s]=this.quill.getLine(t.index);if(s>n)return!0;let a;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",le.sources.USER),this.quill.history.cutoff();const i=new xe().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,le.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,le.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const a=new xe().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,le.sources.USER),this.quill.setSelection(t.index-1,le.sources.SILENT),!1}return!0}},"embed left":tl("ArrowLeft",!1),"embed left shift":tl("ArrowLeft",!0),"embed right":tl("ArrowRight",!1),"embed right shift":tl("ArrowRight",!0),"table down":C1(!1),"table up":C1(!0)}};bc.DEFAULTS=pO;function I1(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,n){let{event:r}=n;const s=this.quill.scroll.query("code-block"),{TAB:a}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,a,le.sources.USER),this.quill.setSelection(e.index+a.length,le.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:l}=e;i.forEach((d,h)=>{t?(d.insertAt(0,a),h===0?o+=a.length:l+=a.length):d.domNode.textContent.startsWith(a)&&(d.deleteAt(0,a.length),h===0?o-=a.length:l-=a.length)}),this.quill.update(le.sources.USER),this.quill.setSelection(o,l,le.sources.SILENT)}}}function tl(t,e){return{key:t,shiftKey:e,altKey:null,[t==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;t==="ArrowRight"&&(s+=r.length+1);const[a]=this.quill.getLeaf(s);return a instanceof Qn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,le.sources.USER):this.quill.setSelection(r.index-1,le.sources.USER):e?this.quill.setSelection(r.index,r.length+1,le.sources.USER):this.quill.setSelection(r.index+r.length+1,le.sources.USER),!1):!0}}}function hd(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],le.sources.USER)}}}function C1(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const r=t?"prev":"next",s=n.line,a=s.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let i=a.children.head,o=s;for(;o.prev!=null;)o=o.prev,i=i.next;const l=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(l,0,le.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,le.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,le.sources.USER))}return!1}}}function mO(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=Si(t);else return null;return t.shortKey&&(t[hO]=t.shortKey,delete t.shortKey),t}function d0(t){let{quill:e,range:n}=t;const r=e.getLines(n);let s={};if(r.length>1){const a=r[0].formats(),i=r[r.length-1].formats();s=mr.AttributeMap.diff(i,a)||{}}e.deleteText(n,le.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,le.sources.USER),e.setSelection(n.index,le.sources.SILENT)}function gO(t,e,n,r){return e.prev==null&&e.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const vO=/font-weight:\s*normal/,bO=["P","OL","UL"],L1=t=>t&&bO.includes(t.tagName),EO=t=>{Array.from(t.querySelectorAll("br")).filter(e=>L1(e.previousElementSibling)&&L1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},_O=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(vO)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function TO(t){t.querySelector('[id^="docs-internal-guid-"]')&&(_O(t),EO(t))}const AO=/\bmso-list:[^;]*ignore/i,yO=/\bmso-list:[^;]*\bl(\d+)/i,NO=/\bmso-list:[^;]*\blevel(\d+)/i,wO=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(yO);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(NO),i=a?Number(a[1]):1,o=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=e.match(o),d=l&&l[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:d,element:t}},SO=t=>{var i,o;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(l=>{(l.getAttribute("style")||"").match(AO)?n.push(l):r.push(l)}),n.forEach(l=>{var d;return(d=l.parentNode)==null?void 0:d.removeChild(l)});const s=t.documentElement.innerHTML,a=r.map(l=>wO(l,s)).filter(l=>l);for(;a.length;){const l=[];let d=a.shift();for(;d;)l.push(d),d=a.length&&((i=a[0])==null?void 0:i.element)===d.element.nextElementSibling&&a[0].id===d.id?a.shift():null;const h=document.createElement("ul");l.forEach(p=>{const v=document.createElement("li");v.setAttribute("data-list",p.type),p.indent>1&&v.setAttribute("class",`ql-indent-${p.indent-1}`),v.innerHTML=p.element.innerHTML,h.appendChild(v)});const g=(o=l[0])==null?void 0:o.element,{parentNode:f}=g??{};g&&(f==null||f.replaceChild(h,g)),l.slice(1).forEach(p=>{let{element:v}=p;f==null||f.removeChild(v)})}};function IO(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&SO(t)}const CO=[IO,TO],LO=t=>{t.documentElement&&CO.forEach(e=>{e(t)})},OO=Ls("quill:clipboard"),xO=[[Node.TEXT_NODE,$O],[Node.TEXT_NODE,x1],["br",MO],[Node.ELEMENT_NODE,x1],[Node.ELEMENT_NODE,PO],[Node.ELEMENT_NODE,kO],[Node.ELEMENT_NODE,qO],["li",UO],["ol, ul",HO],["pre",BO],["tr",jO],["b",pd("bold")],["i",pd("italic")],["strike",pd("strike")],["style",FO]],RO=[uO,Nb].reduce((t,e)=>(t[e.keyName]=e,t),{}),O1=[Ab,u0,o0,Sb,Lb,xb].reduce((t,e)=>(t[e.keyName]=e,t),{});class Rb extends Ur{constructor(e,n){super(e,n),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],xO.concat(this.options.matchers??[]).forEach(r=>{let[s,a]=r;this.addMatcher(s,a)})}addMatcher(e,n){this.matchers.push([e,n])}convert(e){let{html:n,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Cn.blotName])return new xe().insert(r||"",{[Cn.blotName]:s[Cn.blotName]});if(!n)return new xe().insert(r||"",s);const a=this.convertHTML(n);return yu(a,`
101
+ `);this.quill.updateContents(l,le.sources.USER),this.quill.setSelection(o,le.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:r}=e,s=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(s-1,le.sources.USER):this.quill.setSelection(s+r.length(),le.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(this.quill.scroll.query("list")==null)return!0;const{length:n}=e.prefix,[r,s]=this.quill.getLine(t.index);if(s>n)return!0;let a;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",le.sources.USER),this.quill.history.cutoff();const i=new xe().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,le.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,le.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const a=new xe().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,le.sources.USER),this.quill.setSelection(t.index-1,le.sources.SILENT),!1}return!0}},"embed left":tl("ArrowLeft",!1),"embed left shift":tl("ArrowLeft",!0),"embed right":tl("ArrowRight",!1),"embed right shift":tl("ArrowRight",!0),"table down":C1(!1),"table up":C1(!0)}};bc.DEFAULTS=pO;function I1(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,n){let{event:r}=n;const s=this.quill.scroll.query("code-block"),{TAB:a}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,a,le.sources.USER),this.quill.setSelection(e.index+a.length,le.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:l}=e;i.forEach((d,f)=>{t?(d.insertAt(0,a),f===0?o+=a.length:l+=a.length):d.domNode.textContent.startsWith(a)&&(d.deleteAt(0,a.length),f===0?o-=a.length:l-=a.length)}),this.quill.update(le.sources.USER),this.quill.setSelection(o,l,le.sources.SILENT)}}}function tl(t,e){return{key:t,shiftKey:e,altKey:null,[t==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;t==="ArrowRight"&&(s+=r.length+1);const[a]=this.quill.getLeaf(s);return a instanceof Qn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,le.sources.USER):this.quill.setSelection(r.index-1,le.sources.USER):e?this.quill.setSelection(r.index,r.length+1,le.sources.USER):this.quill.setSelection(r.index+r.length+1,le.sources.USER),!1):!0}}}function hd(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],le.sources.USER)}}}function C1(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const r=t?"prev":"next",s=n.line,a=s.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let i=a.children.head,o=s;for(;o.prev!=null;)o=o.prev,i=i.next;const l=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(l,0,le.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,le.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,le.sources.USER))}return!1}}}function mO(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=Si(t);else return null;return t.shortKey&&(t[hO]=t.shortKey,delete t.shortKey),t}function d0(t){let{quill:e,range:n}=t;const r=e.getLines(n);let s={};if(r.length>1){const a=r[0].formats(),i=r[r.length-1].formats();s=mr.AttributeMap.diff(i,a)||{}}e.deleteText(n,le.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,le.sources.USER),e.setSelection(n.index,le.sources.SILENT)}function gO(t,e,n,r){return e.prev==null&&e.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const vO=/font-weight:\s*normal/,bO=["P","OL","UL"],L1=t=>t&&bO.includes(t.tagName),EO=t=>{Array.from(t.querySelectorAll("br")).filter(e=>L1(e.previousElementSibling)&&L1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},_O=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(vO)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function TO(t){t.querySelector('[id^="docs-internal-guid-"]')&&(_O(t),EO(t))}const AO=/\bmso-list:[^;]*ignore/i,yO=/\bmso-list:[^;]*\bl(\d+)/i,NO=/\bmso-list:[^;]*\blevel(\d+)/i,wO=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(yO);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(NO),i=a?Number(a[1]):1,o=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=e.match(o),d=l&&l[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:d,element:t}},SO=t=>{var i,o;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(l=>{(l.getAttribute("style")||"").match(AO)?n.push(l):r.push(l)}),n.forEach(l=>{var d;return(d=l.parentNode)==null?void 0:d.removeChild(l)});const s=t.documentElement.innerHTML,a=r.map(l=>wO(l,s)).filter(l=>l);for(;a.length;){const l=[];let d=a.shift();for(;d;)l.push(d),d=a.length&&((i=a[0])==null?void 0:i.element)===d.element.nextElementSibling&&a[0].id===d.id?a.shift():null;const f=document.createElement("ul");l.forEach(p=>{const v=document.createElement("li");v.setAttribute("data-list",p.type),p.indent>1&&v.setAttribute("class",`ql-indent-${p.indent-1}`),v.innerHTML=p.element.innerHTML,f.appendChild(v)});const g=(o=l[0])==null?void 0:o.element,{parentNode:h}=g??{};g&&(h==null||h.replaceChild(f,g)),l.slice(1).forEach(p=>{let{element:v}=p;h==null||h.removeChild(v)})}};function IO(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&SO(t)}const CO=[IO,TO],LO=t=>{t.documentElement&&CO.forEach(e=>{e(t)})},OO=Ls("quill:clipboard"),xO=[[Node.TEXT_NODE,$O],[Node.TEXT_NODE,x1],["br",MO],[Node.ELEMENT_NODE,x1],[Node.ELEMENT_NODE,PO],[Node.ELEMENT_NODE,kO],[Node.ELEMENT_NODE,qO],["li",UO],["ol, ul",HO],["pre",BO],["tr",jO],["b",pd("bold")],["i",pd("italic")],["strike",pd("strike")],["style",FO]],RO=[uO,yb].reduce((t,e)=>(t[e.keyName]=e,t),{}),O1=[Tb,u0,o0,wb,Cb,Ob].reduce((t,e)=>(t[e.keyName]=e,t),{});class xb extends Ur{constructor(e,n){super(e,n),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],xO.concat(this.options.matchers??[]).forEach(r=>{let[s,a]=r;this.addMatcher(s,a)})}addMatcher(e,n){this.matchers.push([e,n])}convert(e){let{html:n,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Cn.blotName])return new xe().insert(r||"",{[Cn.blotName]:s[Cn.blotName]});if(!n)return new xe().insert(r||"",s);const a=this.convertHTML(n);return yu(a,`
102
102
  `)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new xe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){LO(e)}convertHTML(e){const n=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(n);const r=n.body,s=new WeakMap,[a,i]=this.prepareMatching(r,s);return f0(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:le.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,le.sources.SILENT)}else{const s=this.convert({html:n,text:""});this.quill.updateContents(new xe().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),le.sources.SILENT)}}onCaptureCopy(e){var i,o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:a}=this.onCopy(r,n);(i=e.clipboardData)==null||i.setData("text/plain",a),(o=e.clipboardData)==null||o.setData("text/html",s),n&&d0({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
103
- `)}onCapturePaste(e){var i,o,l,d,h;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const n=this.quill.getSelection(!0);if(n==null)return;const r=(i=e.clipboardData)==null?void 0:i.getData("text/html");let s=(o=e.clipboardData)==null?void 0:o.getData("text/plain");if(!r&&!s){const g=(l=e.clipboardData)==null?void 0:l.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!r&&a.length>0){this.quill.uploader.upload(n,a);return}if(r&&a.length>0){const g=new DOMParser().parseFromString(r,"text/html");if(g.body.childElementCount===1&&((h=g.body.firstElementChild)==null?void 0:h.tagName)==="IMG"){this.quill.uploader.upload(n,a);return}}this.onPaste(n,{html:r,text:s})}onCopy(e){const n=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:n}}onPaste(e,n){let{text:r,html:s}=n;const a=this.quill.getFormat(e.index),i=this.convert({text:r,html:s},a);OO.log("onPaste",i,{text:r,html:s});const o=new xe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,le.sources.USER),this.quill.setSelection(o.length()-e.length,le.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach(l=>{if(n.has(l)){const d=n.get(l);d==null||d.push(o)}else n.set(l,[o])});break}}),[r,s]}}ye(Rb,"DEFAULTS",{matchers:[]});function ii(t,e,n,r){return r.query(e)?t.reduce((s,a)=>{if(!a.insert)return s;if(a.attributes&&a.attributes[e])return s.push(a);const i=n?{[e]:n}:{};return s.insert(a.insert,{...i,...a.attributes})},new xe):t}function yu(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length<e.length;--r){const s=t.ops[r];if(typeof s.insert!="string")break;n=s.insert+n}return n.slice(-1*e.length)===e}function Ks(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof Qn?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(t.tagName.toLowerCase())}function DO(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Ks(t.previousElementSibling,e)&&!Ks(t.nextElementSibling,e)}const nl=new WeakMap;function Db(t){return t==null?!1:(nl.has(t)||(t.tagName==="PRE"?nl.set(t,!0):nl.set(t,Db(t.parentNode))),nl.get(t))}function f0(t,e,n,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,i)=>i(e,a,t),new xe):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,i)=>{let o=f0(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(o=n.reduce((l,d)=>d(i,l,t),o),o=(s.get(i)||[]).reduce((l,d)=>d(i,l,t),o)),a.concat(o)},new xe):new xe}function pd(t){return(e,n,r)=>ii(n,t,!0,r)}function kO(t,e,n){const r=as.keys(t),s=Br.keys(t),a=ua.keys(t),i={};return r.concat(s).concat(a).forEach(o=>{let l=n.query(o,Re.ATTRIBUTE);l!=null&&(i[l.attrName]=l.value(t),i[l.attrName])||(l=RO[o],l!=null&&(l.attrName===o||l.keyName===o)&&(i[l.attrName]=l.value(t)||void 0),l=O1[o],l!=null&&(l.attrName===o||l.keyName===o)&&(l=O1[o],i[l.attrName]=l.value(t)||void 0))}),Object.entries(i).reduce((o,l)=>{let[d,h]=l;return ii(o,d,h,n)},e)}function PO(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Qn){const s={},a=r.value(t);if(a!=null)return s[r.blotName]=a,new xe().insert(s,r.formats(t,n))}else if(r.prototype instanceof tu&&!yu(e,`
103
+ `)}onCapturePaste(e){var i,o,l,d,f;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const n=this.quill.getSelection(!0);if(n==null)return;const r=(i=e.clipboardData)==null?void 0:i.getData("text/html");let s=(o=e.clipboardData)==null?void 0:o.getData("text/plain");if(!r&&!s){const g=(l=e.clipboardData)==null?void 0:l.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!r&&a.length>0){this.quill.uploader.upload(n,a);return}if(r&&a.length>0){const g=new DOMParser().parseFromString(r,"text/html");if(g.body.childElementCount===1&&((f=g.body.firstElementChild)==null?void 0:f.tagName)==="IMG"){this.quill.uploader.upload(n,a);return}}this.onPaste(n,{html:r,text:s})}onCopy(e){const n=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:n}}onPaste(e,n){let{text:r,html:s}=n;const a=this.quill.getFormat(e.index),i=this.convert({text:r,html:s},a);OO.log("onPaste",i,{text:r,html:s});const o=new xe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,le.sources.USER),this.quill.setSelection(o.length()-e.length,le.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach(l=>{if(n.has(l)){const d=n.get(l);d==null||d.push(o)}else n.set(l,[o])});break}}),[r,s]}}ye(xb,"DEFAULTS",{matchers:[]});function ii(t,e,n,r){return r.query(e)?t.reduce((s,a)=>{if(!a.insert)return s;if(a.attributes&&a.attributes[e])return s.push(a);const i=n?{[e]:n}:{};return s.insert(a.insert,{...i,...a.attributes})},new xe):t}function yu(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length<e.length;--r){const s=t.ops[r];if(typeof s.insert!="string")break;n=s.insert+n}return n.slice(-1*e.length)===e}function Ks(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof Qn?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(t.tagName.toLowerCase())}function DO(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Ks(t.previousElementSibling,e)&&!Ks(t.nextElementSibling,e)}const nl=new WeakMap;function Rb(t){return t==null?!1:(nl.has(t)||(t.tagName==="PRE"?nl.set(t,!0):nl.set(t,Rb(t.parentNode))),nl.get(t))}function f0(t,e,n,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,i)=>i(e,a,t),new xe):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,i)=>{let o=f0(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(o=n.reduce((l,d)=>d(i,l,t),o),o=(s.get(i)||[]).reduce((l,d)=>d(i,l,t),o)),a.concat(o)},new xe):new xe}function pd(t){return(e,n,r)=>ii(n,t,!0,r)}function kO(t,e,n){const r=as.keys(t),s=Br.keys(t),a=ua.keys(t),i={};return r.concat(s).concat(a).forEach(o=>{let l=n.query(o,Re.ATTRIBUTE);l!=null&&(i[l.attrName]=l.value(t),i[l.attrName])||(l=RO[o],l!=null&&(l.attrName===o||l.keyName===o)&&(i[l.attrName]=l.value(t)||void 0),l=O1[o],l!=null&&(l.attrName===o||l.keyName===o)&&(l=O1[o],i[l.attrName]=l.value(t)||void 0))}),Object.entries(i).reduce((o,l)=>{let[d,f]=l;return ii(o,d,f,n)},e)}function PO(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Qn){const s={},a=r.value(t);if(a!=null)return s[r.blotName]=a,new xe().insert(s,r.formats(t,n))}else if(r.prototype instanceof tu&&!yu(e,`
104
104
  `)&&e.insert(`
105
105
  `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return ii(e,r.blotName,r.formats(t,n),n);return e}function MO(t,e){return yu(e,`
106
106
  `)||e.insert(`
@@ -109,34 +109,34 @@ ${vc(this.code(e,n))}
109
109
  `)){if(Ks(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert(`
110
110
  `);if(e.length()>0&&t.nextSibling){let r=t.nextSibling;for(;r!=null;){if(Ks(r,n))return e.insert(`
111
111
  `);const s=n.query(r);if(s&&s.prototype instanceof pr)return e.insert(`
112
- `);r=r.firstChild}}}return e}function qO(t,e,n){var a;const r={},s=t.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),((a=s.fontWeight)!=null&&a.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,o)=>{let[l,d]=o;return ii(i,l,d,n)},e),parseFloat(s.textIndent||0)>0?new xe().insert(" ").concat(e):e}function jO(t,e,n){var s,a;const r=((s=t.parentElement)==null?void 0:s.tagName)==="TABLE"?t.parentElement:(a=t.parentElement)==null?void 0:a.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return ii(e,"table",o,n)}return e}function $O(t,e,n){var s;let r=t.data;if(((s=t.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(r.trim());if(!Db(t)){if(r.trim().length===0&&r.includes(`
113
- `)&&!DO(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&Ks(t.parentElement,n)||t.previousSibling instanceof Element&&Ks(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&Ks(t.parentElement,n)||t.nextSibling instanceof Element&&Ks(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class kb extends Ur{constructor(n,r){super(n,r);ye(this,"lastRecorded",0);ye(this,"ignoreChange",!1);ye(this,"stack",{undo:[],redo:[]});ye(this,"currentRange",null);this.quill.on(le.events.EDITOR_CHANGE,(s,a,i,o)=>{s===le.events.SELECTION_CHANGE?a&&o!==le.sources.SILENT&&(this.currentRange=a):s===le.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===le.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=$f(this.currentRange,a))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(n,r){if(this.stack[n].length===0)return;const s=this.stack[n].pop();if(!s)return;const a=this.quill.getContents(),i=s.delta.invert(a);this.stack[r].push({delta:i,range:$f(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,le.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(n,r){if(n.ops.length===0)return;this.stack.redo=[];let s=n.invert(r),a=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),a=o.range)}else this.lastRecorded=i;s.length()!==0&&(this.stack.undo.push({delta:s,range:a}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(n){R1(this.stack.undo,n),R1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,le.sources.USER);else{const r=zO(this.quill.scroll,n.delta);this.quill.setSelection(r,le.sources.USER)}}}ye(kb,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function R1(t,e){let n=e;for(let r=t.length-1;r>=0;r-=1){const s=t[r];t[r]={delta:n.transform(s.delta,!0),range:s.range&&$f(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function YO(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
114
- `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Re.BLOCK)!=null):!1}function zO(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return YO(t,e)&&(r-=1),r}function $f(t,e){if(!t)return t;const n=e.transformPosition(t.index),r=e.transformPosition(t.index+t.length);return{index:n,length:r-n}}class Pb extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("drop",r=>{var i;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const o=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(o,r.dataTransfer.files)}})}upload(e,n){const r=[];Array.from(n).forEach(s=>{var a;s&&((a=this.options.mimetypes)!=null&&a.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}Pb.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const n=e.map(r=>new Promise(s=>{const a=new FileReader;a.onload=()=>{s(a.result)},a.readAsDataURL(r)}));Promise.all(n).then(r=>{const s=r.reduce((a,i)=>a.insert({image:i}),new xe().retain(t.index).delete(t.length));this.quill.updateContents(s,Oe.sources.USER),this.quill.setSelection(t.index+r.length,Oe.sources.SILENT)})}};const WO=["insertText","insertReplacementText"];class GO extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(le.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){d0({range:e,quill:this.quill})}replaceText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(n){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new xe().retain(e.index).insert(n,r),le.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,le.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!WO.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=KO(e);if(r==null)return;const s=this.quill.selection.normalizeNative(n),a=s?this.quill.selection.normalizedToRange(s):null;a&&this.replaceText(a,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function KO(t){var e;return typeof t.data=="string"?t.data:(e=t.dataTransfer)!=null&&e.types.includes("text/plain")?t.dataTransfer.getData("text/plain"):null}const VO=/Mac/i.test(navigator.platform),XO=100,QO=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||VO&&t.key==="a"&&t.ctrlKey===!0);class ZO extends Ur{constructor(n,r){super(n,r);ye(this,"isListening",!1);ye(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(n,r){let{line:s,event:a}=r;if(!(s instanceof Rr)||!s.uiNode)return!0;const i=getComputedStyle(s.domNode).direction==="rtl";return i&&a.key!=="ArrowRight"||!i&&a.key!=="ArrowLeft"?!0:(this.quill.setSelection(n.index-1,n.length+(a.shiftKey?1:0),le.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&QO(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+XO,this.isListening)return;this.isListening=!0;const n=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",n,{once:!0})}handleSelectionChange(){const n=document.getSelection();if(!n)return;const r=n.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const s=this.quill.scroll.find(r.startContainer);if(!(s instanceof Rr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}le.register({"blots/block":_n,"blots/block/embed":pr,"blots/break":Fr,"blots/container":si,"blots/cursor":Qi,"blots/embed":a0,"blots/inline":is,"blots/scroll":bi,"blots/text":kr,"modules/clipboard":Rb,"modules/history":kb,"modules/keyboard":bc,"modules/uploader":Pb,"modules/input":GO,"modules/uiNode":ZO});class JO extends Br{add(e,n){let r=0;if(n==="+1"||n==="-1"){const s=this.value(e)||0;r=n==="+1"?s+1:s-1}else typeof n=="number"&&(r=n);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,n){return super.canAdd(e,n)||super.canAdd(e,parseInt(n,10))}value(e){return parseInt(super.value(e),10)||void 0}}const e8=new JO("indent","ql-indent",{scope:Re.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Yf extends _n{}ye(Yf,"blotName","blockquote"),ye(Yf,"tagName","blockquote");class zf extends _n{static formats(e){return this.tagName.indexOf(e.tagName)+1}}ye(zf,"blotName","header"),ye(zf,"tagName",["H1","H2","H3","H4","H5","H6"]);class Nu extends si{}Nu.blotName="list-container";Nu.tagName="OL";class wu extends _n{static create(e){const n=super.create();return n.setAttribute("data-list",e),n}static formats(e){return e.getAttribute("data-list")||void 0}static register(){le.register(Nu)}constructor(e,n){super(e,n);const r=n.ownerDocument.createElement("span"),s=a=>{if(!e.isEnabled())return;const i=this.statics.formats(n,e);i==="checked"?(this.format("list","unchecked"),a.preventDefault()):i==="unchecked"&&(this.format("list","checked"),a.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-list",n):super.format(e,n)}}wu.blotName="list";wu.tagName="LI";Nu.allowedChildren=[wu];wu.requiredContainer=Nu;class ru extends is{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}ye(ru,"blotName","bold"),ye(ru,"tagName",["STRONG","B"]);class Wf extends ru{}ye(Wf,"blotName","italic"),ye(Wf,"tagName",["EM","I"]);class Vs extends is{static create(e){const n=super.create(e);return n.setAttribute("href",this.sanitize(e)),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}static formats(e){return e.getAttribute("href")}static sanitize(e){return Mb(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,n){e!==this.statics.blotName||!n?super.format(e,n):this.domNode.setAttribute("href",this.constructor.sanitize(n))}}ye(Vs,"blotName","link"),ye(Vs,"tagName","A"),ye(Vs,"SANITIZED_URL","about:blank"),ye(Vs,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Mb(t,e){const n=document.createElement("a");n.href=t;const r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}class Gf extends is{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}ye(Gf,"blotName","script"),ye(Gf,"tagName",["SUB","SUP"]);class Kf extends ru{}ye(Kf,"blotName","strike"),ye(Kf,"tagName",["S","STRIKE"]);class Vf extends is{}ye(Vf,"blotName","underline"),ye(Vf,"tagName","U");class vl extends a0{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const n=super.create(e);return typeof e=="string"&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}ye(vl,"blotName","formula"),ye(vl,"className","ql-formula"),ye(vl,"tagName","SPAN");const D1=["alt","height","width"];class Xf extends Qn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return D1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return Mb(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){D1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}ye(Xf,"blotName","image"),ye(Xf,"tagName","IMG");const k1=["height","width"];class bl extends pr{static create(e){const n=super.create(e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen","true"),n.setAttribute("src",this.sanitize(e)),n}static formats(e){return k1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Vs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){k1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}ye(bl,"blotName","video"),ye(bl,"className","ql-video"),ye(bl,"tagName","IFRAME");const So=new Br("code-token","hljs",{scope:Re.INLINE});class Ss extends is{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(Cn.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),So.add(this.domNode,r)}format(e,n){e!==Ss.blotName?super.format(e,n):n?So.add(this.domNode,n):(So.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),So.value(this.domNode)||this.unwrap()}}Ss.blotName="code-token";Ss.className="ql-token";class hr extends Cn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("data-language",e),n}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-language",n):super.format(e,n)}replaceWith(e,n){return this.formatAt(0,this.length(),Ss.blotName,!1),super.replaceWith(e,n)}}class Ho extends ai{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===hr.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===hr.blotName&&(this.forceNext=!0),super.formatAt(e,n,r,s)}highlight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(i=>i!==this.uiNode).map(i=>i.textContent).join(`
112
+ `);r=r.firstChild}}}return e}function qO(t,e,n){var a;const r={},s=t.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),((a=s.fontWeight)!=null&&a.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,o)=>{let[l,d]=o;return ii(i,l,d,n)},e),parseFloat(s.textIndent||0)>0?new xe().insert(" ").concat(e):e}function jO(t,e,n){var s,a;const r=((s=t.parentElement)==null?void 0:s.tagName)==="TABLE"?t.parentElement:(a=t.parentElement)==null?void 0:a.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return ii(e,"table",o,n)}return e}function $O(t,e,n){var s;let r=t.data;if(((s=t.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(r.trim());if(!Rb(t)){if(r.trim().length===0&&r.includes(`
113
+ `)&&!DO(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&Ks(t.parentElement,n)||t.previousSibling instanceof Element&&Ks(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&Ks(t.parentElement,n)||t.nextSibling instanceof Element&&Ks(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class Db extends Ur{constructor(n,r){super(n,r);ye(this,"lastRecorded",0);ye(this,"ignoreChange",!1);ye(this,"stack",{undo:[],redo:[]});ye(this,"currentRange",null);this.quill.on(le.events.EDITOR_CHANGE,(s,a,i,o)=>{s===le.events.SELECTION_CHANGE?a&&o!==le.sources.SILENT&&(this.currentRange=a):s===le.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===le.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=$f(this.currentRange,a))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(n,r){if(this.stack[n].length===0)return;const s=this.stack[n].pop();if(!s)return;const a=this.quill.getContents(),i=s.delta.invert(a);this.stack[r].push({delta:i,range:$f(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,le.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(n,r){if(n.ops.length===0)return;this.stack.redo=[];let s=n.invert(r),a=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),a=o.range)}else this.lastRecorded=i;s.length()!==0&&(this.stack.undo.push({delta:s,range:a}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(n){R1(this.stack.undo,n),R1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,le.sources.USER);else{const r=zO(this.quill.scroll,n.delta);this.quill.setSelection(r,le.sources.USER)}}}ye(Db,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function R1(t,e){let n=e;for(let r=t.length-1;r>=0;r-=1){const s=t[r];t[r]={delta:n.transform(s.delta,!0),range:s.range&&$f(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function YO(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
114
+ `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Re.BLOCK)!=null):!1}function zO(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return YO(t,e)&&(r-=1),r}function $f(t,e){if(!t)return t;const n=e.transformPosition(t.index),r=e.transformPosition(t.index+t.length);return{index:n,length:r-n}}class kb extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("drop",r=>{var i;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const o=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(o,r.dataTransfer.files)}})}upload(e,n){const r=[];Array.from(n).forEach(s=>{var a;s&&((a=this.options.mimetypes)!=null&&a.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}kb.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const n=e.map(r=>new Promise(s=>{const a=new FileReader;a.onload=()=>{s(a.result)},a.readAsDataURL(r)}));Promise.all(n).then(r=>{const s=r.reduce((a,i)=>a.insert({image:i}),new xe().retain(t.index).delete(t.length));this.quill.updateContents(s,Oe.sources.USER),this.quill.setSelection(t.index+r.length,Oe.sources.SILENT)})}};const WO=["insertText","insertReplacementText"];class GO extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(le.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){d0({range:e,quill:this.quill})}replaceText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(n){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new xe().retain(e.index).insert(n,r),le.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,le.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!WO.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=KO(e);if(r==null)return;const s=this.quill.selection.normalizeNative(n),a=s?this.quill.selection.normalizedToRange(s):null;a&&this.replaceText(a,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function KO(t){var e;return typeof t.data=="string"?t.data:(e=t.dataTransfer)!=null&&e.types.includes("text/plain")?t.dataTransfer.getData("text/plain"):null}const VO=/Mac/i.test(navigator.platform),XO=100,QO=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||VO&&t.key==="a"&&t.ctrlKey===!0);class ZO extends Ur{constructor(n,r){super(n,r);ye(this,"isListening",!1);ye(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(n,r){let{line:s,event:a}=r;if(!(s instanceof Rr)||!s.uiNode)return!0;const i=getComputedStyle(s.domNode).direction==="rtl";return i&&a.key!=="ArrowRight"||!i&&a.key!=="ArrowLeft"?!0:(this.quill.setSelection(n.index-1,n.length+(a.shiftKey?1:0),le.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&QO(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+XO,this.isListening)return;this.isListening=!0;const n=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",n,{once:!0})}handleSelectionChange(){const n=document.getSelection();if(!n)return;const r=n.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const s=this.quill.scroll.find(r.startContainer);if(!(s instanceof Rr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}le.register({"blots/block":_n,"blots/block/embed":pr,"blots/break":Fr,"blots/container":si,"blots/cursor":Qi,"blots/embed":a0,"blots/inline":is,"blots/scroll":bi,"blots/text":kr,"modules/clipboard":xb,"modules/history":Db,"modules/keyboard":bc,"modules/uploader":kb,"modules/input":GO,"modules/uiNode":ZO});class JO extends Br{add(e,n){let r=0;if(n==="+1"||n==="-1"){const s=this.value(e)||0;r=n==="+1"?s+1:s-1}else typeof n=="number"&&(r=n);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,n){return super.canAdd(e,n)||super.canAdd(e,parseInt(n,10))}value(e){return parseInt(super.value(e),10)||void 0}}const e8=new JO("indent","ql-indent",{scope:Re.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Yf extends _n{}ye(Yf,"blotName","blockquote"),ye(Yf,"tagName","blockquote");class zf extends _n{static formats(e){return this.tagName.indexOf(e.tagName)+1}}ye(zf,"blotName","header"),ye(zf,"tagName",["H1","H2","H3","H4","H5","H6"]);class Nu extends si{}Nu.blotName="list-container";Nu.tagName="OL";class wu extends _n{static create(e){const n=super.create();return n.setAttribute("data-list",e),n}static formats(e){return e.getAttribute("data-list")||void 0}static register(){le.register(Nu)}constructor(e,n){super(e,n);const r=n.ownerDocument.createElement("span"),s=a=>{if(!e.isEnabled())return;const i=this.statics.formats(n,e);i==="checked"?(this.format("list","unchecked"),a.preventDefault()):i==="unchecked"&&(this.format("list","checked"),a.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-list",n):super.format(e,n)}}wu.blotName="list";wu.tagName="LI";Nu.allowedChildren=[wu];wu.requiredContainer=Nu;class ru extends is{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}ye(ru,"blotName","bold"),ye(ru,"tagName",["STRONG","B"]);class Wf extends ru{}ye(Wf,"blotName","italic"),ye(Wf,"tagName",["EM","I"]);class Vs extends is{static create(e){const n=super.create(e);return n.setAttribute("href",this.sanitize(e)),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}static formats(e){return e.getAttribute("href")}static sanitize(e){return Pb(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,n){e!==this.statics.blotName||!n?super.format(e,n):this.domNode.setAttribute("href",this.constructor.sanitize(n))}}ye(Vs,"blotName","link"),ye(Vs,"tagName","A"),ye(Vs,"SANITIZED_URL","about:blank"),ye(Vs,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Pb(t,e){const n=document.createElement("a");n.href=t;const r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}class Gf extends is{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}ye(Gf,"blotName","script"),ye(Gf,"tagName",["SUB","SUP"]);class Kf extends ru{}ye(Kf,"blotName","strike"),ye(Kf,"tagName",["S","STRIKE"]);class Vf extends is{}ye(Vf,"blotName","underline"),ye(Vf,"tagName","U");class vl extends a0{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const n=super.create(e);return typeof e=="string"&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}ye(vl,"blotName","formula"),ye(vl,"className","ql-formula"),ye(vl,"tagName","SPAN");const D1=["alt","height","width"];class Xf extends Qn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return D1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return Pb(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){D1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}ye(Xf,"blotName","image"),ye(Xf,"tagName","IMG");const k1=["height","width"];class bl extends pr{static create(e){const n=super.create(e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen","true"),n.setAttribute("src",this.sanitize(e)),n}static formats(e){return k1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Vs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){k1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}ye(bl,"blotName","video"),ye(bl,"className","ql-video"),ye(bl,"tagName","IFRAME");const So=new Br("code-token","hljs",{scope:Re.INLINE});class Ss extends is{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(Cn.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),So.add(this.domNode,r)}format(e,n){e!==Ss.blotName?super.format(e,n):n?So.add(this.domNode,n):(So.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),So.value(this.domNode)||this.unwrap()}}Ss.blotName="code-token";Ss.className="ql-token";class hr extends Cn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("data-language",e),n}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-language",n):super.format(e,n)}replaceWith(e,n){return this.formatAt(0,this.length(),Ss.blotName,!1),super.replaceWith(e,n)}}class Ho extends ai{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===hr.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===hr.blotName&&(this.forceNext=!0),super.formatAt(e,n,r,s)}highlight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(i=>i!==this.uiNode).map(i=>i.textContent).join(`
115
115
  `)}
116
- `,a=hr.formats(this.children.head.domNode);if(n||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const i=this.children.reduce((l,d)=>l.concat(Eb(d,!1)),new xe),o=e(s,a);i.diff(o).reduce((l,d)=>{let{retain:h,attributes:g}=d;return h?(g&&Object.keys(g).forEach(f=>{[hr.blotName,Ss.blotName].includes(f)&&this.formatAt(l,h,f,g[f])}),l+h):l},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?hr.formats(r.domNode):"plain"}">
116
+ `,a=hr.formats(this.children.head.domNode);if(n||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const i=this.children.reduce((l,d)=>l.concat(bb(d,!1)),new xe),o=e(s,a);i.diff(o).reduce((l,d)=>{let{retain:f,attributes:g}=d;return f?(g&&Object.keys(g).forEach(h=>{[hr.blotName,Ss.blotName].includes(h)&&this.formatAt(l,f,h,g[h])}),l+f):l},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?hr.formats(r.domNode):"plain"}">
117
117
  ${vc(this.code(e,n))}
118
- </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=hr.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}Ho.allowedChildren=[hr];hr.requiredContainer=Ho;hr.allowedChildren=[Ss,Qi,kr,Fr];const t8=(t,e,n)=>{if(typeof t.versionString=="string"){const r=t.versionString.split(".")[0];if(parseInt(r,10)>=11)return t.highlight(n,{language:e}).value}return t.highlight(e,n).value};class Bb extends Ur{static register(){le.register(Ss,!0),le.register(hr,!0),le.register(Ho,!0)}constructor(e,n){if(super(e,n),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,s)=>{let{key:a}=s;return r[a]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(le.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Ho))return;const n=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:a}=r;const i=n.ownerDocument.createElement("option");i.textContent=a,i.setAttribute("value",s),n.appendChild(i)}),n.addEventListener("change",()=>{e.format(hr.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=hr.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(le.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(le.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Ho):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(le.sources.SILENT),r!=null&&this.quill.setSelection(r,le.sources.SILENT)}highlightBlot(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(n=this.languages[n]?n:"plain",n==="plain")return vc(e).split(`
118
+ </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=hr.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}Ho.allowedChildren=[hr];hr.requiredContainer=Ho;hr.allowedChildren=[Ss,Qi,kr,Fr];const t8=(t,e,n)=>{if(typeof t.versionString=="string"){const r=t.versionString.split(".")[0];if(parseInt(r,10)>=11)return t.highlight(n,{language:e}).value}return t.highlight(e,n).value};class Mb extends Ur{static register(){le.register(Ss,!0),le.register(hr,!0),le.register(Ho,!0)}constructor(e,n){if(super(e,n),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,s)=>{let{key:a}=s;return r[a]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(le.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Ho))return;const n=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:a}=r;const i=n.ownerDocument.createElement("option");i.textContent=a,i.setAttribute("value",s),n.appendChild(i)}),n.addEventListener("change",()=>{e.format(hr.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=hr.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(le.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(le.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Ho):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(le.sources.SILENT),r!=null&&this.quill.setSelection(r,le.sources.SILENT)}highlightBlot(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(n=this.languages[n]?n:"plain",n==="plain")return vc(e).split(`
119
119
  `).reduce((s,a,i)=>(i!==0&&s.insert(`
120
120
  `,{[Cn.blotName]:n}),s.insert(a)),new xe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(Cn.className),r.innerHTML=t8(this.options.hljs,n,e),f0(this.quill.scroll,r,[(s,a)=>{const i=So.value(s);return i?a.compose(new xe().retain(a.length(),{[Ss.blotName]:i})):a}],[(s,a)=>s.data.split(`
121
121
  `).reduce((i,o,l)=>(l!==0&&i.insert(`
122
- `,{[Cn.blotName]:n}),i.insert(o)),a)],new WeakMap)}}Bb.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const $o=class $o extends _n{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",h0()),n}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,n){e===$o.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(e,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};ye($o,"blotName","table"),ye($o,"tagName","TD");let Ir=$o;class Is extends si{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),n=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===n.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(n=>{if(n.next==null)return;const r=n.formats(),s=n.next.formats();if(r.table!==s.table){const a=this.splitAfter(n);a&&a.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}ye(Is,"blotName","table-row"),ye(Is,"tagName","TR");class ts extends si{}ye(ts,"blotName","table-body"),ye(ts,"tagName","TBODY");class Ji extends si{balanceCells(){const e=this.descendants(Is),n=e.reduce((r,s)=>Math.max(s.children.length,r),0);e.forEach(r=>{new Array(n-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=Ir.formats(r.children.head.domNode));const a=this.scroll.create(Ir.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(ts);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e);s!=null&&s.remove()})}insertColumn(e){const[n]=this.descendant(ts);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=Ir.formats(r.children.head.domNode),i=this.scroll.create(Ir.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(ts);if(n==null||n.children.head==null)return;const r=h0(),s=this.scroll.create(Is.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(Ir.blotName,r);s.appendChild(i)});const a=n.children.at(e);n.insertBefore(s,a)}rows(){const e=this.children.head;return e==null?[]:e.children.map(n=>n)}}ye(Ji,"blotName","table-container"),ye(Ji,"tagName","TABLE");Ji.allowedChildren=[ts];ts.requiredContainer=Ji;ts.allowedChildren=[Is];Is.requiredContainer=ts;Is.allowedChildren=[Ir];Ir.requiredContainer=Is;function h0(){return`row-${Math.random().toString(36).slice(2,6)}`}class n8 extends Ur{static register(){le.register(Ir),le.register(Is),le.register(ts),le.register(Ji)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ji).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(le.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(le.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(le.sources.USER),this.quill.setSelection(n,le.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[n,r]=this.quill.getLine(e.index);if(n==null||n.statics.blotName!==Ir.blotName)return[null,null,null,-1];const s=n.parent;return[s.parent.parent,s,n,r]}insertColumn(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=a.cellOffset();r.insertColumn(i+e),this.quill.update(le.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(n.index+o,n.length,le.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=s.rowOffset();r.insertRow(i+e),this.quill.update(le.sources.USER),e>0?this.quill.setSelection(n,le.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,le.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,n){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce(a=>{const i=new Array(n).fill(`
123
- `).join("");return a.insert(i,{table:h0()})},new xe().retain(r.index));this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(r.index,le.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(le.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(le.events.TEXT_CHANGE,(r,s,a)=>{a===le.sources.USER&&this.balanceTables()}),!0):!1)})}}const P1=Ls("quill:toolbar");class p0 extends Ur{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),r8(a,this.options.container),(s=(r=e.container)==null?void 0:r.parentNode)==null||s.insertBefore(a,e.container),this.container=a}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){P1.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(a=>{var o;const i=(o=this.options.handlers)==null?void 0:o[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(le.events.EDITOR_CHANGE,()=>{const[a]=this.quill.selection.getRange();this.update(a)})}addHandler(e,n){this.handlers[e]=n}attach(e){let n=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){P1.warn("ignoring attaching to nonexistent format",n,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof Qn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new xe().retain(i.index).delete(i.length).insert({[n]:a}),le.sources.USER)}else this.quill.format(n,a,le.sources.USER);this.update(i)}),this.controls.push([n,e])}update(e){const n=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let i=null;if(e==null)i=null;else if(n[s]==null)i=a.querySelector("option[selected]");else if(!Array.isArray(n[s])){let o=n[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${o}"]`)}i==null?(a.value="",a.selectedIndex=-1):i.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const i=n[s],o=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}p0.DEFAULTS={};function M1(t,e,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),n!=null?(r.value=n,r.setAttribute("aria-label",`${e}: ${n}`)):r.setAttribute("aria-label",e),t.appendChild(r)}function r8(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(n=>{const r=document.createElement("span");r.classList.add("ql-formats"),n.forEach(s=>{if(typeof s=="string")M1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?s8(r,a,i):M1(r,a,i)}}),t.appendChild(r)})}function s8(t,e,n){const r=document.createElement("select");r.classList.add(`ql-${e}`),n.forEach(s=>{const a=document.createElement("option");s!==!1?a.setAttribute("value",String(s)):a.setAttribute("selected","selected"),r.appendChild(a)}),t.appendChild(r)}p0.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t!=null)if(t.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(n=>{this.quill.scroll.query(n,Re.INLINE)!=null&&this.quill.format(n,!1,le.sources.USER)})}else this.quill.removeFormat(t.index,t.length,le.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",le.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,le.sources.USER),this.quill.format("direction",t,le.sources.USER)},indent(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0,10);if(t==="+1"||t==="-1"){let s=t==="+1"?1:-1;n.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,le.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,le.sources.USER)},list(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e);t==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,le.sources.USER):this.quill.format("list","unchecked",le.sources.USER):this.quill.format("list",t,le.sources.USER)}}};const a8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',i8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',o8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',u8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',l8='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',c8='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',d8='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',f8='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',B1='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',h8='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',p8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',m8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',g8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',v8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',b8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',E8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',_8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',T8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',A8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',y8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',N8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',w8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',S8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',I8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',C8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',L8='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',O8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',x8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',R8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',D8='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',k8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',P8='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',M8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',su={align:{"":a8,center:i8,right:o8,justify:u8},background:l8,blockquote:c8,bold:d8,clean:f8,code:B1,"code-block":B1,color:h8,direction:{"":p8,rtl:m8},formula:g8,header:{1:v8,2:b8,3:E8,4:_8,5:T8,6:A8},italic:y8,image:N8,indent:{"+1":w8,"-1":S8},link:I8,list:{bullet:C8,check:L8,ordered:O8},script:{sub:x8,super:R8},strike:D8,table:k8,underline:P8,video:M8},B8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let F1=0;function U1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class Ec{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),U1(this.label,"aria-expanded"),U1(this.options,"aria-hidden")}buildItem(e){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&n.setAttribute("data-value",r),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(n,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),n}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=B8,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${F1}`,F1+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(n=>{const r=this.buildItem(n);e.appendChild(r),n.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const n=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class Fb extends Ec{constructor(e,n){super(e),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const n=super.buildItem(e);return n.style.backgroundColor=e.getAttribute("value")||"",n}selectItem(e,n){super.selectItem(e,n);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class Ub extends Ec{constructor(e,n){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=n[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,n){super.selectItem(e,n);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const F8=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class Hb{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,F8(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const n=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>s.right&&(i=s.right-a.right,this.root.style.left=`${n+i}px`),a.left<s.left&&(i=s.left-a.left,this.root.style.left=`${n+i}px`),a.bottom>s.bottom){const o=a.bottom-a.top,l=e.bottom-e.top+o;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const U8=[!1,"center","right","justify"],H8=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],q8=[!1,"serif","monospace"],j8=["1","2","3",!1],$8=["small",!1,"large","huge"];class Su extends Zi{constructor(e,n){super(e,n);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(a=>{a.container.contains(s.target)||a.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const n=super.addModule(e);return e==="toolbar"&&this.extendToolbar(n),n}buildButtons(e,n){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(a=>{if(a.startsWith("ql-")&&(a=a.slice(3),n[a]!=null))if(a==="direction")r.innerHTML=n[a][""]+n[a].rtl;else if(typeof n[a]=="string")r.innerHTML=n[a];else{const i=r.value||"";i!=null&&n[a][i]&&(r.innerHTML=n[a][i])}})})}buildPickers(e,n){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Eo(s,U8),typeof n.align=="object"))return new Ub(s,n.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const a=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Eo(s,H8,a==="background"?"#ffffff":"#000000"),new Fb(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Eo(s,q8):s.classList.contains("ql-header")?Eo(s,j8):s.classList.contains("ql-size")&&Eo(s,$8)),new Ec(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Oe.events.EDITOR_CHANGE,r)}}Su.DEFAULTS=ea({},Zi.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");t==null&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class qb extends Hb{constructor(e,n){super(e,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Oe.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Oe.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=Y8(e);case"formula":{if(!e)break;const n=this.quill.getSelection(!0);if(n!=null){const r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,Oe.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Oe.sources.USER),this.quill.setSelection(r+2,Oe.sources.USER)}break}}this.textbox.value="",this.hide()}}function Y8(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}function Eo(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===n?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),t.appendChild(s)})}const z8=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class jb extends qb{constructor(e,n){super(e,n),this.quill.on(Oe.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Oe.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Oe.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const l=this.quill.getBounds(s);l!=null&&this.position(l)}else{const l=o[o.length-1],d=this.quill.getIndex(l),h=Math.min(l.length()-1,s.index+s.length-d),g=this.quill.getBounds(new Va(d,h));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Oe.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const n=this.quill.getBounds(e);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(e){const n=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",n!==0&&(r.style.marginLeft=`${-1*n-r.offsetWidth/2}px`),n}}ye(jb,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class $b extends Su{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=z8),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new jb(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),su),this.buildPickers(e.container.querySelectorAll("select"),su))}}$b.DEFAULTS=ea({},Su.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,le.sources.USER)}}}}});const W8=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Yb extends qb{constructor(){super(...arguments);ye(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",n=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),n.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",n=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,Oe.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Oe.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Oe.sources.USER){const[a,i]=this.quill.scroll.descendant(Vs,n.index);if(a!=null){this.linkRange=new Va(n.index-i,a.length());const o=Vs.formats(a.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}ye(Yb,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class zb extends Su{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=W8),super(e,n),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),su),this.buildPickers(e.container.querySelectorAll("select"),su),this.tooltip=new Yb(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,r)=>{e.handlers.link.call(e,!r.format.link)}))}}zb.DEFAULTS=ea({},Su.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const e=this.quill.getSelection();if(e==null||e.length===0)return;let n=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:r}=this.quill.theme;r.edit("link",n)}else this.quill.format("link",!1,le.sources.USER)}}}}});le.register({"attributors/attribute/direction":Nb,"attributors/class/align":Tb,"attributors/class/background":cO,"attributors/class/color":lO,"attributors/class/direction":wb,"attributors/class/font":Cb,"attributors/class/size":Ob,"attributors/style/align":Ab,"attributors/style/background":u0,"attributors/style/color":o0,"attributors/style/direction":Sb,"attributors/style/font":Lb,"attributors/style/size":xb},!0);le.register({"formats/align":Tb,"formats/direction":wb,"formats/indent":e8,"formats/background":u0,"formats/color":o0,"formats/font":Cb,"formats/size":Ob,"formats/blockquote":Yf,"formats/code-block":Cn,"formats/header":zf,"formats/list":wu,"formats/bold":ru,"formats/code":l0,"formats/italic":Wf,"formats/link":Vs,"formats/script":Gf,"formats/strike":Kf,"formats/underline":Vf,"formats/formula":vl,"formats/image":Xf,"formats/video":bl,"modules/syntax":Bb,"modules/table":n8,"modules/toolbar":p0,"themes/bubble":$b,"themes/snow":zb,"ui/icons":su,"ui/picker":Ec,"ui/icon-picker":Ub,"ui/color-picker":Fb,"ui/tooltip":Hb},!0);const G8="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",K8="/api/read?path=",jl=new WeakMap;function V8(t){return typeof t=="string"&&t.includes(K8)}async function X8(t,e){try{const n=await Ge(e);if(!n.ok)return;const r=URL.createObjectURL(await n.blob()),s=jl.get(t);s!==void 0&&URL.revokeObjectURL(s),jl.set(t,r),t.setAttribute("src",r)}catch{}}function Wb(t){const e=jl.get(t);e!==void 0&&(URL.revokeObjectURL(e),jl.delete(t))}const Q8=le.import("formats/image");class m0 extends Q8{static create(e){if(V8(e)){const n=super.create(G8);return n.setAttribute("data-read",e),X8(n,e),n}return super.create(e)}static value(e){return e.getAttribute("data-read")??e.getAttribute("src")??""}remove(){Wb(this.domNode),super.remove()}}m0.blotName="image";m0.tagName="IMG";le.register(m0,!0);const H1="/api/read?path=",Gb=/src="([^"]*)"/g,Z8=/&nbsp;/g,J8=/<img src="[^"]*" data-read="([^"]*)"/g,e5=/<div class="ql-code-block-container"[^>]*>((?:<div class="ql-code-block"[^>]*>[\s\S]*?<\/div>)+)<\/div>/g,t5=/<div class="ql-code-block"[^>]*>([\s\S]*?)<\/div>/g,n5=/<pre><code>([\s\S]*?)<\/code><\/pre>/g;function r5(t){return t.replace(e5,(e,n)=>{const r=[];for(const s of n.matchAll(t5))r.push(s[1]==="<br>"?"":s[1]??"");return`<pre><code>${r.join(`
122
+ `,{[Cn.blotName]:n}),i.insert(o)),a)],new WeakMap)}}Mb.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const $o=class $o extends _n{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",h0()),n}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,n){e===$o.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(e,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};ye($o,"blotName","table"),ye($o,"tagName","TD");let Ir=$o;class Is extends si{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),n=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===n.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(n=>{if(n.next==null)return;const r=n.formats(),s=n.next.formats();if(r.table!==s.table){const a=this.splitAfter(n);a&&a.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}ye(Is,"blotName","table-row"),ye(Is,"tagName","TR");class ts extends si{}ye(ts,"blotName","table-body"),ye(ts,"tagName","TBODY");class Ji extends si{balanceCells(){const e=this.descendants(Is),n=e.reduce((r,s)=>Math.max(s.children.length,r),0);e.forEach(r=>{new Array(n-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=Ir.formats(r.children.head.domNode));const a=this.scroll.create(Ir.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(ts);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e);s!=null&&s.remove()})}insertColumn(e){const[n]=this.descendant(ts);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=Ir.formats(r.children.head.domNode),i=this.scroll.create(Ir.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(ts);if(n==null||n.children.head==null)return;const r=h0(),s=this.scroll.create(Is.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(Ir.blotName,r);s.appendChild(i)});const a=n.children.at(e);n.insertBefore(s,a)}rows(){const e=this.children.head;return e==null?[]:e.children.map(n=>n)}}ye(Ji,"blotName","table-container"),ye(Ji,"tagName","TABLE");Ji.allowedChildren=[ts];ts.requiredContainer=Ji;ts.allowedChildren=[Is];Is.requiredContainer=ts;Is.allowedChildren=[Ir];Ir.requiredContainer=Is;function h0(){return`row-${Math.random().toString(36).slice(2,6)}`}class n8 extends Ur{static register(){le.register(Ir),le.register(Is),le.register(ts),le.register(Ji)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ji).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(le.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(le.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(le.sources.USER),this.quill.setSelection(n,le.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[n,r]=this.quill.getLine(e.index);if(n==null||n.statics.blotName!==Ir.blotName)return[null,null,null,-1];const s=n.parent;return[s.parent.parent,s,n,r]}insertColumn(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=a.cellOffset();r.insertColumn(i+e),this.quill.update(le.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(n.index+o,n.length,le.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=s.rowOffset();r.insertRow(i+e),this.quill.update(le.sources.USER),e>0?this.quill.setSelection(n,le.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,le.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,n){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce(a=>{const i=new Array(n).fill(`
123
+ `).join("");return a.insert(i,{table:h0()})},new xe().retain(r.index));this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(r.index,le.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(le.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(le.events.TEXT_CHANGE,(r,s,a)=>{a===le.sources.USER&&this.balanceTables()}),!0):!1)})}}const P1=Ls("quill:toolbar");class p0 extends Ur{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),r8(a,this.options.container),(s=(r=e.container)==null?void 0:r.parentNode)==null||s.insertBefore(a,e.container),this.container=a}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){P1.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(a=>{var o;const i=(o=this.options.handlers)==null?void 0:o[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(le.events.EDITOR_CHANGE,()=>{const[a]=this.quill.selection.getRange();this.update(a)})}addHandler(e,n){this.handlers[e]=n}attach(e){let n=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){P1.warn("ignoring attaching to nonexistent format",n,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof Qn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new xe().retain(i.index).delete(i.length).insert({[n]:a}),le.sources.USER)}else this.quill.format(n,a,le.sources.USER);this.update(i)}),this.controls.push([n,e])}update(e){const n=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let i=null;if(e==null)i=null;else if(n[s]==null)i=a.querySelector("option[selected]");else if(!Array.isArray(n[s])){let o=n[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${o}"]`)}i==null?(a.value="",a.selectedIndex=-1):i.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const i=n[s],o=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}p0.DEFAULTS={};function M1(t,e,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),n!=null?(r.value=n,r.setAttribute("aria-label",`${e}: ${n}`)):r.setAttribute("aria-label",e),t.appendChild(r)}function r8(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(n=>{const r=document.createElement("span");r.classList.add("ql-formats"),n.forEach(s=>{if(typeof s=="string")M1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?s8(r,a,i):M1(r,a,i)}}),t.appendChild(r)})}function s8(t,e,n){const r=document.createElement("select");r.classList.add(`ql-${e}`),n.forEach(s=>{const a=document.createElement("option");s!==!1?a.setAttribute("value",String(s)):a.setAttribute("selected","selected"),r.appendChild(a)}),t.appendChild(r)}p0.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t!=null)if(t.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(n=>{this.quill.scroll.query(n,Re.INLINE)!=null&&this.quill.format(n,!1,le.sources.USER)})}else this.quill.removeFormat(t.index,t.length,le.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",le.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,le.sources.USER),this.quill.format("direction",t,le.sources.USER)},indent(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0,10);if(t==="+1"||t==="-1"){let s=t==="+1"?1:-1;n.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,le.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,le.sources.USER)},list(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e);t==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,le.sources.USER):this.quill.format("list","unchecked",le.sources.USER):this.quill.format("list",t,le.sources.USER)}}};const a8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',i8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',o8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',u8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',l8='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',c8='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',d8='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',f8='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',B1='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',h8='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',p8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',m8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',g8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',v8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',b8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',E8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',_8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',T8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',A8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',y8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',N8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',w8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',S8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',I8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',C8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',L8='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',O8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',x8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',R8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',D8='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',k8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',P8='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',M8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',su={align:{"":a8,center:i8,right:o8,justify:u8},background:l8,blockquote:c8,bold:d8,clean:f8,code:B1,"code-block":B1,color:h8,direction:{"":p8,rtl:m8},formula:g8,header:{1:v8,2:b8,3:E8,4:_8,5:T8,6:A8},italic:y8,image:N8,indent:{"+1":w8,"-1":S8},link:I8,list:{bullet:C8,check:L8,ordered:O8},script:{sub:x8,super:R8},strike:D8,table:k8,underline:P8,video:M8},B8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let F1=0;function U1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class Ec{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),U1(this.label,"aria-expanded"),U1(this.options,"aria-hidden")}buildItem(e){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&n.setAttribute("data-value",r),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(n,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),n}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=B8,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${F1}`,F1+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(n=>{const r=this.buildItem(n);e.appendChild(r),n.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const n=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class Bb extends Ec{constructor(e,n){super(e),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const n=super.buildItem(e);return n.style.backgroundColor=e.getAttribute("value")||"",n}selectItem(e,n){super.selectItem(e,n);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class Fb extends Ec{constructor(e,n){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=n[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,n){super.selectItem(e,n);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const F8=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class Ub{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,F8(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const n=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>s.right&&(i=s.right-a.right,this.root.style.left=`${n+i}px`),a.left<s.left&&(i=s.left-a.left,this.root.style.left=`${n+i}px`),a.bottom>s.bottom){const o=a.bottom-a.top,l=e.bottom-e.top+o;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const U8=[!1,"center","right","justify"],H8=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],q8=[!1,"serif","monospace"],j8=["1","2","3",!1],$8=["small",!1,"large","huge"];class Su extends Zi{constructor(e,n){super(e,n);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(a=>{a.container.contains(s.target)||a.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const n=super.addModule(e);return e==="toolbar"&&this.extendToolbar(n),n}buildButtons(e,n){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(a=>{if(a.startsWith("ql-")&&(a=a.slice(3),n[a]!=null))if(a==="direction")r.innerHTML=n[a][""]+n[a].rtl;else if(typeof n[a]=="string")r.innerHTML=n[a];else{const i=r.value||"";i!=null&&n[a][i]&&(r.innerHTML=n[a][i])}})})}buildPickers(e,n){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Eo(s,U8),typeof n.align=="object"))return new Fb(s,n.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const a=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Eo(s,H8,a==="background"?"#ffffff":"#000000"),new Bb(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Eo(s,q8):s.classList.contains("ql-header")?Eo(s,j8):s.classList.contains("ql-size")&&Eo(s,$8)),new Ec(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Oe.events.EDITOR_CHANGE,r)}}Su.DEFAULTS=ea({},Zi.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");t==null&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Hb extends Ub{constructor(e,n){super(e,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Oe.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Oe.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=Y8(e);case"formula":{if(!e)break;const n=this.quill.getSelection(!0);if(n!=null){const r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,Oe.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Oe.sources.USER),this.quill.setSelection(r+2,Oe.sources.USER)}break}}this.textbox.value="",this.hide()}}function Y8(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}function Eo(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===n?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),t.appendChild(s)})}const z8=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class qb extends Hb{constructor(e,n){super(e,n),this.quill.on(Oe.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Oe.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Oe.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const l=this.quill.getBounds(s);l!=null&&this.position(l)}else{const l=o[o.length-1],d=this.quill.getIndex(l),f=Math.min(l.length()-1,s.index+s.length-d),g=this.quill.getBounds(new Va(d,f));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Oe.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const n=this.quill.getBounds(e);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(e){const n=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",n!==0&&(r.style.marginLeft=`${-1*n-r.offsetWidth/2}px`),n}}ye(qb,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class jb extends Su{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=z8),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new qb(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),su),this.buildPickers(e.container.querySelectorAll("select"),su))}}jb.DEFAULTS=ea({},Su.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,le.sources.USER)}}}}});const W8=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class $b extends Hb{constructor(){super(...arguments);ye(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",n=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),n.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",n=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,Oe.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Oe.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Oe.sources.USER){const[a,i]=this.quill.scroll.descendant(Vs,n.index);if(a!=null){this.linkRange=new Va(n.index-i,a.length());const o=Vs.formats(a.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}ye($b,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class Yb extends Su{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=W8),super(e,n),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),su),this.buildPickers(e.container.querySelectorAll("select"),su),this.tooltip=new $b(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,r)=>{e.handlers.link.call(e,!r.format.link)}))}}Yb.DEFAULTS=ea({},Su.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const e=this.quill.getSelection();if(e==null||e.length===0)return;let n=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:r}=this.quill.theme;r.edit("link",n)}else this.quill.format("link",!1,le.sources.USER)}}}}});le.register({"attributors/attribute/direction":yb,"attributors/class/align":_b,"attributors/class/background":cO,"attributors/class/color":lO,"attributors/class/direction":Nb,"attributors/class/font":Ib,"attributors/class/size":Lb,"attributors/style/align":Tb,"attributors/style/background":u0,"attributors/style/color":o0,"attributors/style/direction":wb,"attributors/style/font":Cb,"attributors/style/size":Ob},!0);le.register({"formats/align":_b,"formats/direction":Nb,"formats/indent":e8,"formats/background":u0,"formats/color":o0,"formats/font":Ib,"formats/size":Lb,"formats/blockquote":Yf,"formats/code-block":Cn,"formats/header":zf,"formats/list":wu,"formats/bold":ru,"formats/code":l0,"formats/italic":Wf,"formats/link":Vs,"formats/script":Gf,"formats/strike":Kf,"formats/underline":Vf,"formats/formula":vl,"formats/image":Xf,"formats/video":bl,"modules/syntax":Mb,"modules/table":n8,"modules/toolbar":p0,"themes/bubble":jb,"themes/snow":Yb,"ui/icons":su,"ui/picker":Ec,"ui/icon-picker":Fb,"ui/color-picker":Bb,"ui/tooltip":Ub},!0);const G8="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",K8="/api/read?path=",jl=new WeakMap;function V8(t){return typeof t=="string"&&t.includes(K8)}async function X8(t,e){try{const n=await Ge(e);if(!n.ok)return;const r=URL.createObjectURL(await n.blob()),s=jl.get(t);s!==void 0&&URL.revokeObjectURL(s),jl.set(t,r),t.setAttribute("src",r)}catch{}}function zb(t){const e=jl.get(t);e!==void 0&&(URL.revokeObjectURL(e),jl.delete(t))}const Q8=le.import("formats/image");class m0 extends Q8{static create(e){if(V8(e)){const n=super.create(G8);return n.setAttribute("data-read",e),X8(n,e),n}return super.create(e)}static value(e){return e.getAttribute("data-read")??e.getAttribute("src")??""}remove(){zb(this.domNode),super.remove()}}m0.blotName="image";m0.tagName="IMG";le.register(m0,!0);const H1="/api/read?path=",Wb=/src="([^"]*)"/g,Z8=/&nbsp;/g,J8=/<img src="[^"]*" data-read="([^"]*)"/g,e5=/<div class="ql-code-block-container"[^>]*>((?:<div class="ql-code-block"[^>]*>[\s\S]*?<\/div>)+)<\/div>/g,t5=/<div class="ql-code-block"[^>]*>([\s\S]*?)<\/div>/g,n5=/<pre><code>([\s\S]*?)<\/code><\/pre>/g;function r5(t){return t.replace(e5,(e,n)=>{const r=[];for(const s of n.matchAll(t5))r.push(s[1]==="<br>"?"":s[1]??"");return`<pre><code>${r.join(`
124
124
  `)}</code></pre>`})}function s5(t){return t.replace(n5,(e,n)=>`<div class="ql-code-block-container">${n.split(`
125
- `).map(s=>`<div class="ql-code-block">${s}</div>`).join("")}</div>`)}function a5(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function q1(t,e){return s5(t.replace(Gb,(n,r)=>a5(r)?`src="${cc(e,r)}"`:n))}function j1(t,e){const n=`content/${e===""?"":`${e}/`}`;return r5(t).replace(J8,(r,s)=>`<img src="${s}"`).replace(Gb,(r,s)=>{const a=s.indexOf(H1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+H1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(Z8," ")}var i5=z('<div class="rte svelte-1afg4yo"><div></div></div>');function o5(t,e){at(e,!0);const n=le.import("formats/link");n.PROTOCOL_WHITELIST.includes("ref")||n.PROTOCOL_WHITELIST.push("ref");let r,s;const a=[[{header:[2,3,!1]}],["bold","italic","link","image"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],["clean"]];Za(()=>{const p=new le(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(p.root.setAttribute("aria-labelledby",e.labelledBy),p.root.setAttribute("aria-multiline","true"));const b=p.theme.tooltip;if(b!==void 0){const B=b.position.bind(b);b.position=M=>{const J=p.root.getBoundingClientRect();return B({...M,left:M.left+J.left,right:M.right+J.left,top:M.top+J.top-p.root.scrollTop,bottom:M.bottom+J.top-p.root.scrollTop})}}const E=p.getModule("toolbar");E.addHandler("image",()=>l(p)),E.addHandler("link",()=>o(p));const _=B=>{B.preventDefault(),setTimeout(()=>i(p),0)};p.root.addEventListener("contextmenu",_);const R=B=>{B.target instanceof HTMLImageElement&&h(p,B.target)};p.root.addEventListener("dblclick",R),e.value&&p.clipboard.dangerouslyPasteHTML(q1(e.value,e.itemDir),"silent");const O=()=>e.onchange(j1(p.root.innerHTML,e.itemDir));return p.on("text-change",O),s=p,()=>{p.off("text-change",O),p.root.removeEventListener("contextmenu",_),p.root.removeEventListener("dblclick",R);for(const B of p.root.querySelectorAll("img"))Wb(B)}});function i(p){var _;const v=p.getSelection(!0);if(v===null)return;const b=p.theme,E=p.getBounds(v.index,v.length);((_=b.tooltip)==null?void 0:_.show)!==void 0&&b.tooltip.position!==void 0&&E&&(b.tooltip.show(),b.tooltip.position(E))}function o(p){const v=p.getSelection(!0);if(v===null)return;const b=p.getFormat(v).link??"";Fv(b).then(E=>{if(E!==null)if(E==="")p.formatText(v.index,v.length,"link",!1,"user");else if(v.length>0)p.formatText(v.index,v.length,"link",E,"user");else{const _=Qo(E)?If(E):E;p.insertText(v.index,_,{link:E},"user")}})}function l(p){const v=document.createElement("input");v.type="file",v.accept="image/*",v.onchange=()=>{var E;const b=(E=v.files)==null?void 0:E[0];b&&d(p,b)},v.click()}async function d(p,v){try{const b=await Hh(e.itemDir,v),E=p.getSelection(!0),_=await hp("");if(_===null)return;p.insertEmbed(E.index,"image",cc(e.itemDir,b),"user"),_!==""&&p.formatText(E.index,1,"alt",_,"user"),p.setSelection(E.index+1,0)}catch(b){console.error("Inline image upload failed",b)}}function h(p,v){const b=le.find(v);if(b===null)return;const E=p.getIndex(b);hp(v.getAttribute("alt")??"").then(_=>{_!==null&&p.formatText(E,1,"alt",_===""?!1:_,"user")})}Rt(()=>{const p=e.value;s&&j1(s.root.innerHTML,e.itemDir)!==p&&s.clipboard.dangerouslyPasteHTML(q1(p,e.itemDir),"silent")});var g=i5(),f=y(g);mn(f,p=>r=p,()=>r),F(t,g),it()}var u5=z('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),l5=z('<textarea rows="3"></textarea>'),c5=z('<input type="date" class="svelte-1bn65uv"/>'),d5=z('<input type="time" class="svelte-1bn65uv"/>'),f5=z('<input type="email" class="svelte-1bn65uv"/>'),h5=z('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),p5=z('<input type="text" class="svelte-1bn65uv"/>'),m5=z('<p class="hint svelte-1bn65uv"> </p>'),g5=z("<p> </p>"),v5=z('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),b5=z('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),E5=z('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),_5=z('<p class="hint svelte-1bn65uv">Loading fields…</p>'),T5=z('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),A5=z(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta &amp; SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's &lt;head&gt;.</p> <!></details>`),y5=z("<!> <!>",1),N5=z('<div class="divider svelte-1bn65uv" role="separator" aria-orientation="vertical" aria-label="Resize preview" tabindex="0"><span class="grip svelte-1bn65uv"></span></div> <div class="preview-pane svelte-1bn65uv"><!></div>',1),w5=z('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles svelte-1bn65uv"><input class="title-input svelte-1bn65uv" type="text" aria-label="Title" placeholder="Untitled"/> <p class="meta svelte-1bn65uv"> </p></div> <div class="head-actions svelte-1bn65uv"><div class="action-buttons svelte-1bn65uv"><!> <!> <button type="button">Preview</button> <button type="button"> </button></div> <label class="pubdate svelte-1bn65uv"><span>Publish date</span> <input type="date" class="svelte-1bn65uv"/></label></div></header> <!></form></div> <!></div> <!>',1);function S5(t,e){at(e,!0);const n=Vn(e,"templates",19,()=>[]),r={name:"title",type:"shorttext",label:"Title",required:!0,multiline:!1,help:"Names the page in the tree and fills {title} where the template uses it, it doesn’t have to appear on the page."},s={name:"published",type:"date",label:"Publish date",required:!1,multiline:!1};let a=Q(!1);const i=()=>new Date().toISOString().slice(0,10);function o(){T(a,!u(a)),u(a)&&(u(_).published??"").trim()===""&&(u(_).published=i()),G()}let l=Q(!1),d=Q(ct([]));function h(){T(l,!0),e.onmove&&ff().then(Ne=>T(d,Ne,!0))}async function g(Ne){var ze;Ne!==e.templateName&&(await A(),(ze=e.onchangetemplate)==null||ze.call(e,Ne))}const f=_e(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),p=new Set(["richtext","image","file","authors"]);function v(Ne){return p.has(Ne.type)?void 0:`f-${Ne.name}`}let b=Q(ct([])),E=Q(!0),_=Q(ct({})),R=Q(null);const O=700;let B,M=!1,J=0;Za(()=>{H();const Ne=()=>void A();return window.addEventListener("beforeunload",Ne),()=>{window.removeEventListener("beforeunload",Ne),A()}});async function H(){T(E,!0);const[Ne,ze]=await Promise.all([GN(e.templateName),KN()]),Qe=Ne.filter(De=>De.name!=="title"&&De.name!=="published"),Je=new Set(Qe.map(De=>De.name)),L=ze.filter(De=>De.name!=="published"&&!Je.has(De.name)),ue=[r,s,...Qe,...L],Te={};for(const De of ue)Te[De.name]=y6(e.item,De.name);Te.published=(Te.published??"").slice(0,10),T(a,e.item.isPublished,!0),T(b,ue,!0),T(k,Qe,!0),T(W,L,!0),T(_,Te,!0),ow(localStorage,e.path,Te),T(R,uw(localStorage,e.path),!0),T(E,!1)}function G(){M=!0,J+=1,clearTimeout(B),B=setTimeout(()=>void A(),O)}function X(Ne,ze){const Qe=u(_)[Ne]??"";u(_)[Ne]=ze,G(),Qe!==""&&Qe!==ze&&ee(Qe)}async function ee(Ne){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Ne))return;Object.values(u(_)).some(Qe=>typeof Qe=="string"&&Qe.includes(Ne))||await r6(u(f),Ne)}async function A(){var Qe;if(clearTimeout(B),!M)return;const Ne=J,ze=Mp(e.item,u(b),u(_),u(a));Fs.saving();try{await _v(e.path,ze),J===Ne&&(M=!1),Fs.saved(),(Qe=e.onsaved)==null||Qe.call(e,e.path,u(_).title??e.item.title,u(a))}catch{Fs.failed(()=>void A())}}async function j(){u(R)===null||!await Bl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(T(_,{...u(R)},!0),G())}const w=new Set(["text","code"]);function S(Ne,ze){return Ne.maxLength!==void 0&&Ne.minLength!==void 0?`${ze} / ${Ne.maxLength} characters (min ${Ne.minLength})`:Ne.maxLength!==void 0?`${ze} / ${Ne.maxLength} characters`:`${ze} characters (min ${Ne.minLength})`}function x(Ne,ze){return Ne.minLength!==void 0&&ze>0&&ze<Ne.minLength?!0:Ne.maxLength!==void 0&&ze>Ne.maxLength}let k=Q(ct([])),W=Q(ct([]));const $=_e(()=>u(R)!==null&&JSON.stringify(u(_))!==JSON.stringify(u(R))),Y="nanoesis:preview-open";let U=Q(localStorage.getItem(Y)==="true");function K(Ne){T(U,Ne,!0),localStorage.setItem(Y,String(Ne))}const te=_e(()=>{if(u(E))return null;try{return{...tc(JSON.parse(Mp(e.item,u(b),u(_),u(a)))),template:e.templateName}}catch{return null}}),fe="nanoesis:preview-split",me=.2,ge=.8;function Le(Ne){return Math.min(ge,Math.max(me,Ne))}function de(){const Ne=Number(localStorage.getItem(fe));return Number.isFinite(Ne)&&Ne>0?Le(Ne):.5}let ve=Q(ct(de())),Ie=Q(!1),se;function he(Ne){Ne.preventDefault(),T(Ie,!0),Ne.currentTarget.setPointerCapture(Ne.pointerId)}function Ae(Ne){if(!u(Ie))return;const ze=se.getBoundingClientRect();T(ve,Le((Ne.clientX-ze.left)/ze.width),!0)}function Ce(Ne){var ze,Qe;u(Ie)&&(T(Ie,!1),(Qe=(ze=Ne.currentTarget).releasePointerCapture)==null||Qe.call(ze,Ne.pointerId),localStorage.setItem(fe,String(u(ve))))}function Me(Ne){const ze=Ne.key==="ArrowLeft"?-.02:Ne.key==="ArrowRight"?.02:0;ze!==0&&(Ne.preventDefault(),T(ve,Le(u(ve)+ze),!0),localStorage.setItem(fe,String(u(ve))))}var ke=w5(),dt=tt(ke);let Be;var It=y(dt),Dt=y(It);{const Ne=(Je,L=th)=>{var ue=v5(),Te=y(ue),De=y(Te),Xe=C(De);{var Ke=Se=>{var we=u5();F(Se,we)};ce(Xe,Se=>{L().required&&Se(Ke)})}var Et=C(Xe,2),cn=y(Et),Nt=C(Te,2);{var tr=Se=>{{let we=_e(()=>u(_)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);o5(Se,{get value(){return u(we)},get itemDir(){return u(f)},get labelledBy(){return u(qe)},placeholder:"Write…",onchange:gt=>{u(_)[L().name]=gt,G()}})}},Os=Se=>{var we=l5();let qe;re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength),qe=Ve(we,1,"svelte-1bn65uv",null,qe,{mono:L().type==="code"})}),ie("input",we,G),wt(we,()=>u(_)[L().name],gt=>u(_)[L().name]=gt),F(Se,we)},qr=_e(()=>w.has(L().type)),la=Se=>{{let we=_e(()=>u(_)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);kw(Se,{get value(){return u(we)},get itemDir(){return u(f)},get labelledBy(){return u(qe)},onchange:gt=>X(L().name,gt)})}},ca=Se=>{{let we=_e(()=>u(_)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);Lw(Se,{get value(){return u(we)},get itemDir(){return u(f)},get labelledBy(){return u(qe)},onchange:gt=>{u(_)[L().name]=gt,G()}})}},Xt=Se=>{{let we=_e(()=>u(_)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);_w(Se,{get value(){return u(we)},get labelledBy(){return u(qe)},onchange:gt=>{u(_)[L().name]=gt,G()}})}},da=Se=>{{let we=_e(()=>u(_)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);Zw(Se,{get value(){return u(we)},get labelledBy(){return u(qe)},onchange:gt=>{u(_)[L().name]=gt,G()}})}},fa=Se=>{var we=c5();re(()=>Ee(we,"id",`f-${L().name}`)),ie("input",we,G),wt(we,()=>u(_)[L().name],qe=>u(_)[L().name]=qe),F(Se,we)},xs=Se=>{var we=d5();re(()=>Ee(we,"id",`f-${L().name}`)),ie("input",we,G),wt(we,()=>u(_)[L().name],qe=>u(_)[L().name]=qe),F(Se,we)},ha=Se=>{var we=f5();re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength)}),ie("input",we,G),wt(we,()=>u(_)[L().name],qe=>u(_)[L().name]=qe),F(Se,we)},pa=Se=>{var we=h5();re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength)}),ie("input",we,G),wt(we,()=>u(_)[L().name],qe=>u(_)[L().name]=qe),F(Se,we)},dn=Se=>{var we=p5();re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength)}),ie("input",we,G),wt(we,()=>u(_)[L().name],qe=>u(_)[L().name]=qe),F(Se,we)};ce(Nt,Se=>{L().type==="richtext"?Se(tr):u(qr)?Se(Os,1):L().type==="image"?Se(la,2):L().type==="file"?Se(ca,3):L().type==="authors"?Se(Xt,4):L().type==="url"?Se(da,5):L().type==="date"?Se(fa,6):L().type==="time"?Se(xs,7):L().type==="email"?Se(ha,8):L().type==="phone"?Se(pa,9):Se(dn,-1)})}var Rs=C(Nt,2);{var ma=Se=>{var we=m5(),qe=y(we);re(()=>ae(qe,L().help)),F(Se,we)};ce(Rs,Se=>{L().help&&Se(ma)})}var ga=C(Rs,2);{var va=Se=>{const we=_e(()=>(u(_)[L().name]??"").length);var qe=g5();let gt;var $t=y(qe);re((Yt,tn)=>{gt=Ve(qe,1,"hint count svelte-1bn65uv",null,gt,Yt),ae($t,tn)},[()=>({over:x(L(),u(we))}),()=>S(L(),u(we))]),F(Se,qe)};ce(ga,Se=>{(L().minLength!==void 0||L().maxLength!==void 0)&&Se(va)})}re(Se=>{Ee(Te,"id",`lbl-${L().name}`),Ee(Te,"for",Se),ae(De,`${L().label??""} `),ae(cn,L().multiple?"references":L().type)},[()=>v(L())]),F(Je,ue)};var Lt=y(Dt),ft=y(Lt),Vt=y(ft),qt=C(Vt,2),Pt=y(qt),Gt=C(ft,2),Mt=y(Gt),mt=y(Mt);{var yt=Je=>{var L=b5();ie("click",L,j),F(Je,L)};ce(mt,Je=>{u($)&&Je(yt)})}var Bt=C(mt,2);{var ot=Je=>{var L=E5(),ue=y(L);zh(ue,{size:16,"aria-hidden":"true"}),ie("click",L,h),F(Je,L)};ce(Bt,Je=>{e.onchangetemplate&&Je(ot)})}var nt=C(Bt,2);let ze;var bt=C(nt,2);let Qe;var An=y(bt),yn=C(Mt,2),ln=C(y(yn),2),Zn=C(Lt,2);{var Jn=Je=>{var L=_5();F(Je,L)},jt=Je=>{var L=T5();F(Je,L)},en=Je=>{var L=y5(),ue=tt(L);St(ue,17,()=>u(k),Xe=>Xe.name,(Xe,Ke)=>{Ne(Xe,()=>u(Ke))});var Te=C(ue,2);{var De=Xe=>{var Ke=A5(),Et=C(y(Ke),4);St(Et,17,()=>u(W),cn=>cn.name,(cn,Nt)=>{Ne(cn,()=>u(Nt))}),F(Xe,Ke)};ce(Te,Xe=>{u(W).length>0&&Xe(De)})}F(Je,L)};ce(Zn,Je=>{u(E)?Je(Jn):u(k).length===0&&u(W).length===0?Je(jt,1):Je(en,-1)})}re(()=>{ae(Pt,e.templateName),ze=Ve(nt,1,"preview-toggle svelte-1bn65uv",null,ze,{active:u(U)}),Ee(nt,"aria-pressed",u(U)),Qe=Ve(bt,1,"publish-btn svelte-1bn65uv",null,Qe,{on:u(a)}),Ee(bt,"aria-pressed",u(a)),Ee(bt,"title",u(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),ae(An,u(a)?"Publish":"Don't Publish")}),ie("input",Vt,G),wt(Vt,()=>u(_).title,Je=>u(_).title=Je),ie("click",nt,()=>K(!u(U))),ie("click",bt,o),ie("input",ln,G),wt(ln,()=>u(_).published,Je=>u(_).published=Je)}var Hr=C(It,2);{var us=Ne=>{var ze=N5(),Qe=tt(ze),Je=C(Qe,2),L=y(Je);sS(L,{get path(){return e.path},get previewItem(){return u(te)},onclose:()=>K(!1)}),re((ue,Te,De)=>{Ee(Qe,"aria-valuemin",ue),Ee(Qe,"aria-valuemax",Te),Ee(Qe,"aria-valuenow",De)},[()=>Math.round(me*100),()=>Math.round(ge*100),()=>Math.round(u(ve)*100)]),ie("pointerdown",Qe,he),ie("pointermove",Qe,Ae),ie("pointerup",Qe,Ce),He("pointercancel",Qe,Ce),ie("keydown",Qe,Me),F(Ne,ze)};ce(Hr,Ne=>{u(U)&&Ne(us)})}mn(dt,Ne=>se=Ne,()=>se);var er=C(dt,2);{var ls=Ne=>{{let ze=_e(()=>e.onrename?()=>(T(l,!1),e.onrename()):void 0),Qe=_e(()=>e.ondelete?()=>(T(l,!1),e.ondelete()):void 0),Je=_e(()=>e.onmove?L=>(T(l,!1),e.onmove(L)):void 0);Yw(Ne,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return u(f)},get folders(){return u(d)},onchangetemplate:L=>{T(l,!1),g(L)},get onrename(){return u(ze)},get ondelete(){return u(Qe)},get onmove(){return u(Je)},onclose:()=>T(l,!1)})}};ce(er,Ne=>{u(l)&&e.onchangetemplate&&Ne(ls)})}re(()=>{Be=Ve(dt,1,"layout svelte-1bn65uv",null,Be,{split:u(U),dragging:u(Ie)}),Jl(It,u(U)?`flex-basis:${u(ve)*100}%`:void 0)}),He("submit",Dt,Ne=>Ne.preventDefault()),ie("focusout",Dt,()=>void A()),F(t,ke),it()}Tt(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const Kb=""+new URL("nanoesis-logo-T2zheChZ.png",import.meta.url).href,I5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAFS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgZXhpZjpQaXhlbFhEaW1lbnNpb249IjUwIgogICBleGlmOlBpeGVsWURpbWVuc2lvbj0iNTAiCiAgIGV4aWY6Q29sb3JTcGFjZT0iMSIKICAgdGlmZjpJbWFnZVdpZHRoPSI1MCIKICAgdGlmZjpJbWFnZUxlbmd0aD0iNTAiCiAgIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiCiAgIHRpZmY6WFJlc29sdXRpb249IjMwMC8xIgogICB0aWZmOllSZXNvbHV0aW9uPSIzMDAvMSIKICAgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIKICAgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIgogICB4bXA6TW9kaWZ5RGF0ZT0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiCiAgIHhtcDpNZXRhZGF0YURhdGU9IjIwMjYtMDItMjRUMTA6NTY6NTBaIj4KICAgPGRjOnRpdGxlPgogICAgPHJkZjpBbHQ+CiAgICAgPHJkZjpsaSB4bWw6bGFuZz0ieC1kZWZhdWx0Ij54dHJhYmxlLWFpLWxvZ288L3JkZjpsaT4KICAgIDwvcmRmOkFsdD4KICAgPC9kYzp0aXRsZT4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0icHJvZHVjZWQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFmZmluaXR5IERlc2lnbmVyIDEuMTAuNiIKICAgICAgc3RFdnQ6d2hlbj0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KPD94cGFja2V0IGVuZD0iciI/PtBEvDoAAAGBaUNDUHNSR0IgSUVDNjE5NjYtMi4xAAAokXWRv0tCURTHP2pRlGFQg0ODRDVplEHY0qD0C6pBDbJa9OWPwB+P95SQ1qA1KIha+jXUX1Br0BwERRFEczQWtZS8zlNBiTyXc8/nfu89h3vPBWs4rWT0piHIZPNacMrvWowsuVresOKkDR+2qKKrc6HJMA3t6wGLGe88Zq3G5/619tW4roClVXhcUbW88LTw7HpeNXlXuFtJRVeFz4XdmlxQ+N7UYxV+NTlZ4R+TtXAwANZOYVeyjmN1rKS0jLC8nL5MuqBU72O+xB7PLoQk9or3oBNkCj8uZpggwCjDjMk8igcvg7KiQf5QOX+enOQqMqsU0VgjSYo8blELUj0uMSF6XEaaotn/v33VEyPeSnW7H5pfDOOjH1p2oLRtGN/HhlE6AdszXGVr+bkj8H2Kvl3T+g7BsQkX1zUttgeXW+B8UqNatCzZxK2JBLyfQUcEum6hbbnSs+o+p48Q3pCvuoH9AxiQ846VX24uZ+lBa66dAAAACXBIWXMAAC4jAAAuIwF4pT92AAAIcElEQVRogeXZfXAU5R0H8O9ze3t73F1edrMJLyoDHSmoYxkHqrxZ0mpoaEEJiYBSBvriTAuVomBlChUpjDMqVq0F6QwWWrFFJC2UtkHiaDoooKaMQLG8TIWCRSHLbnJc9rKvv/6Ru3AJubvdS5h22u/MzXO57D35ffJ7nid3F+D/MaZNwf90DdkS8HqhaVOpYWOokqCia1lQofEESSFkw8ZA08ak0y008FoXlo7TTqJrk5DvuryQDES5aUM2LAw2bdx/5BwN65dKc8T4jEa5JoaTgYH5MDkhvSA6RxvXGTaWv3OKbu7f0q9EP0WTycAY10C5a0LOh8kKyYEoT92uN22sbzhKo/obEf8rzXINVLkmysmA7AXT6ynkASGbneMAw+59jkKjNdFiMjHZBZT0YwEAbuZ9my4EgszICfGJeHDGbexv9c00FYBaO5a91xeEspsecw3MB6BkFu8F0w1i2sT7RLxX30yzALwa70Dy2b00dekU9m6hENcABYDybgV7xHTbI6EgswwbmmmjzCciqOoo0nQ0LPoNTfQL+GSLs/jTHc74ijr2tGtgPZkod1N7g8zUHjEgZ9kz/FUQAJBj7JJh4Zhpo8wHAlrnrUhLoqH6Re+YUz9211oaXnASeOPTHc6Eijr2hA9MjIzOJvV6ag0vZ6cNG3uNToxXBLQkkO7MiFX5MYfnumutVqywVQZLQ5GTwB4fmJBr4B9clDlZIQDwhRvYYcPG5lRnvCKg6SlMEjNzIQ6Od9faGlZYKmC1Aj4xcE28JQy6stlZvt9aw1GaaNhon3Eb+9AjAloS2zUdD5SEQQBuUdexo5lzvl1Ba3gJK4MigReBoAjwEsCXAkGJwIu4zMVQPbiO239xBz0RELCIhdASEKAEBBxmIawoHsPimXPmhaRT30z3AKj3ifgluc4cR1dmxjcO+nN6rr08vcmLuIuXAJ+Y9wMC5omVTO1Zn+dXvwBYvAPMJ2K+oyuCoyu/E+qaqg5INAYAyMIMS8O7lgrYGoOlAbYG5Flm3yUT3+wN4QtSO5btUnXM1XQ4PhBwdAW2rrQ/vq+kSnWU5gMSPf5VsARZqPaBuaWijtXL09nFbPX56QiWTmGvaTrmakk4PhDqgrfVXxS3JR7VbAWqo6z2iVGcBFrz1eYLAgDrH2CvpTvjBeG0K3cVafF9qqMYmqPAJ+a0rbLK6xdw/8pXl+fN3jMjVtEsLYnJmo7FuRB2Q92HALAssGVqEVfye4mTBZGTIQZlSJy8arzKfvIGKMZ47OFFTMw4AE4HRVSOfjVw1ks9BUPSkZZRIB8iHR+Y00GRKscd8IYAClhaveQmcp3Z+RAAsM5d0HDZaavJs8w2WCp8IYB+6MjOufysPe59N73C/2i5rSt6NkRmcnWm0Dr6BDm+PDpHiTtblTbH3aN/Zc2mjgd350Ok0wvmgsTJo8arLO8J1Vu4Qp4EALRBupEx9hYIHBi4Ie7Hk6Y42/fuPEEnvDz/4Ga92ratk4NPlo1hwCUAX/56vPyTQuspGLL6T0n1qZnRDsZYFQgAA+cSaqs/hyP5MIEtU34A4GfnJ7WOMyP2c4MPiQ8v7rjz74XWAhSwtGj1wGok1IVwrHnsp2ijDdIPL8Wdp5RWG0rcgdLmWK0J574Fu9xdORDPc2UCuLIwgrJgcnJ4eJu06XxfIL5OLXppQjUi4k7EpOng+EZ6BCVsofp0WTH3mFwahFzMQS7h+NIY9/qWewP3ekDYnBye11eELwjVfyONEBARgZj0RT+YLIi5bdKm7aDaoaDak2Gas7RQiKelRftWVaNd24l2VUBCA3QNSKjp8QM4VlWOZVbzrZq7b8yJAJrC4IdLiEFEdNkx9sKzfiF5O0InfjURUWknoqKAqATERKQ6Ag+d6fjt7Tff7QMBEbF10+lJ353Jv7SEWALR0iSiEhAV4QNzeeOIERsarxuyxAcCIqKQEFu3hF72hcm6tBL7nrmdHIOKKld+QGfqx8JINKK9tRTtKtCuAe0q8iyzCi4ydihXJjRyZeFSH4jUGIWI2OyH2LTtXiC9dkQ/tHkcC0W2ME7YfblpbSUbVtsMIVaFaGmrh85sBQC2UL3oLtjbzJWFq4KyoBSA+KeI6PsFd6Tj+B9uJSu5mix9CFm6TKYeI8eYU1S5sslDZwzoWg1bdaEhc84S9TuRNmmT7hNRGUbgPICNDOxQLfvSz3NBun1kapzdPxyWfj+ANgB81zdMbLvctHYOG1bbRGfqqwA0AijtMZcBoIY9eryhx+Nokzbpqbsv+US8zsC+JoCvbqTmeBUb++tskK6lZSknKxgfuRN8pJXxkRbGD1A6x4jCQpEE44RtOZaZgZhYw763/ypEZsLgH5EQ+8wnokUAr4TAzz9IH03LCXF0NcL4yDDGRzTGR1rARxQfGANRsYbVbs2JAIAOtu2EiGilmML4QLQI4BUBfPUxOjO+t7kZALhWRxFZ+kCydJksvTw9ouvr5JXHu++Z0TASxWzk/H35EJmZTk+OlBBrEhEd5APREkqNAvg3b2AV3V6Ydm121+ooJkuv8IG5p6hypedTpWeW0MsjJUSbRMQMn4j010dKWazrn0Fdmz3Ah+Ou1XHVDyT0+sfGhNm3t8nPs2+feJH+eIeIqB1GQPGJUATwVuZ83U4tjxgLwMPROxYd7AsEAB5i084CwA76yxqfiHMh8G1ZIR4wNoDnBtw6+0hfEZlhYK8I4KcL4AMeERrHAj3myJJe9oxIlv6OMHTCx/2JSKeRmoeFwD8jgHf9InJCemAksvQzvPz5rJ+99kcO0kdDBPDfD4E3/SAAD+9HUkezw0UkPd+1/ZFjdEZOLTPdKwLoh8+1rkXO0cUiAfzoEPi4F8R/dVopISTJiDnk5r/4fyn/BmrDD+pUdvB8AAAAAElFTkSuQmCC";let qo=Q("idle"),El=Q(ct([])),_l=Q(ct([])),md=Q(!1),gd;async function $1(){T(qo,"checking");try{const t=await XN();T(El,[...t.errors],!0),T(_l,[...t.warnings],!0),T(qo,"done")}catch{T(qo,"error")}}const Sn={get status(){return u(qo)},get errors(){return u(El)},get warnings(){return u(_l)},get count(){return u(El).length+u(_l).length},get hasProblems(){return u(qo)==="done"&&u(El).length+u(_l).length>0},get panelOpen(){return u(md)},refresh(){return clearTimeout(gd),$1()},scheduleRefresh(t=1200){clearTimeout(gd),gd=setTimeout(()=>void $1(),t)},openPanel(){T(md,!0)},closePanel(){T(md,!1)}};var C5=z('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),L5=z('<button type="button" class="problems svelte-jz8lnl"> </button>'),O5=z('<footer><div class="credit svelte-jz8lnl"><img class="logo svelte-jz8lnl" alt="" width="20" height="20"/> <span>nanoesis by <a target="_blank" rel="noopener noreferrer" class="svelte-jz8lnl">xtrable ltd</a></span></div> <div aria-live="polite"><span> </span> <!></div> <!> <a class="xtrable svelte-jz8lnl" target="_blank" rel="noopener noreferrer" aria-label="xtrable ltd"><img alt="xtrable" width="24" height="24" class="svelte-jz8lnl"/></a></footer>');function x5(t,e){at(e,!0);const n=_e(()=>Fs.state==="saving"?"Saving…":Fs.state==="error"?"Save failed":"Saved");Rt(()=>{kh.value,Sn.scheduleRefresh()});const r=_e(()=>Sn.count),s="https://xtrable.com/";var a=O5();let i;var o=y(a),l=y(o),d=C(l,2),h=C(y(d));Ee(h,"href",s);var g=C(o,2);let f;var p=y(g),v=y(p),b=C(p,2);{var E=M=>{var J=C5();ie("click",J,()=>Fs.retry()),F(M,J)};ce(b,M=>{Fs.canRetry&&M(E)})}var _=C(g,2);{var R=M=>{var J=L5(),H=y(J);re(()=>ae(H,`${u(r)??""}
126
- ${u(r)===1?"problem":"problems"}`)),ie("click",J,()=>Sn.openPanel()),F(M,J)};ce(_,M=>{Sn.hasProblems&&M(R)})}var O=C(_,2);Ee(O,"href",s);var B=y(O);re(()=>{i=Ve(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":Sn.hasProblems}),Ee(l,"src",Kb),f=Ve(g,1,"save svelte-jz8lnl",null,f,{error:Fs.state==="error"}),ae(v,u(n)),Ee(B,"src",I5)}),F(t,a),it()}Tt(["click"]);var R5=z("<option> </option>"),D5=z("<option>Top level</option>"),k5=z("<option> </option>"),P5=z('<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Move</h3> <div class="manage svelte-1uvxo8j"><label class="grow svelte-1uvxo8j"><span class="visually-hidden svelte-1uvxo8j">Move to folder</span> <select class="svelte-1uvxo8j"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-1uvxo8j">Move</button></div></div>'),M5=z(`<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Manage folder</h3> <div class="manage svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">New subfolder…</button> <button type="button" class="ghost svelte-1uvxo8j">Change URL…</button> <button type="button" class="ghost danger svelte-1uvxo8j">Delete folder…</button></div> <p class="help svelte-1uvxo8j">“Change URL” renames this folder’s slug (its address). Its name in the tree is its section
127
- page’s title.</p></div>`),B5=z('<p class="error svelte-1uvxo8j" role="alert"> </p>'),F5=z('<dialog aria-label="Folder settings" class="svelte-1uvxo8j"><form><h2 class="svelte-1uvxo8j">Folder settings</h2> <p class="path svelte-1uvxo8j"> </p> <label class="svelte-1uvxo8j"><span class="svelte-1uvxo8j">Default template</span> <select class="svelte-1uvxo8j"><option>(none, items must set their own)</option><!></select> <span class="help svelte-1uvxo8j">New items here inherit this template unless they pick their own. Stored in the folder’s <code>_sort.json</code>.</span></label> <!> <!> <!> <div class="actions svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">Cancel</button> <button type="submit" class="primary svelte-1uvxo8j">Save</button></div></form></dialog>');function U5(t,e){at(e,!0);const n=Vn(e,"folders",19,()=>[]);let r=Q(""),s=Q(!0),a=Q(null),i;const o=_e(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),l=_e(()=>n().filter(w=>w!==e.folderPath&&w!==u(o)&&!w.startsWith(`${e.folderPath}/`))),d=" ";let h=Q(d);Za(()=>{i.showModal(),d6(e.folderPath).then(w=>{T(r,w,!0)}).finally(()=>{T(s,!1)})});async function g(w){w.preventDefault(),T(a,null);try{await f6(e.folderPath,u(r)),e.onsaved()}catch(S){T(a,S instanceof Error?S.message:String(S),!0)}}var f=F5(),p=y(f),v=C(y(p),2),b=y(v),E=C(v,2),_=C(y(E),2),R=y(_);R.value=R.__value="";var O=C(R);St(O,16,()=>e.templates,w=>w,(w,S)=>{var x=R5(),k=y(x),W={};re(()=>{ae(k,S),W!==(W=S)&&(x.value=(x.__value=S)??"")}),F(w,x)});var B=C(E,2);{var M=w=>{var S=P5(),x=C(y(S),2),k=y(x),W=C(y(k),2),$=y(W);$.value=$.__value=d;var Y=C($);{var U=fe=>{var me=D5();me.value=me.__value="",F(fe,me)};ce(Y,fe=>{u(o)!==""&&fe(U)})}var K=C(Y);St(K,16,()=>u(l),fe=>fe,(fe,me)=>{var ge=k5(),Le=y(ge),de={};re(()=>{ae(Le,`${me??""}/`),de!==(de=me)&&(ge.value=(ge.__value=me)??"")}),F(fe,ge)});var te=C(k,2);re(()=>te.disabled=u(h)===d),Ya(W,()=>u(h),fe=>T(h,fe)),ie("click",te,()=>e.onmove(u(h))),F(w,S)};ce(B,w=>{e.onmove&&w(M)})}var J=C(B,2);{var H=w=>{var S=M5(),x=C(y(S),2),k=y(x),W=C(k,2),$=C(W,2);ie("click",k,function(...Y){var U;(U=e.onnewsubfolder)==null||U.apply(this,Y)}),ie("click",W,function(...Y){var U;(U=e.onrenamefolder)==null||U.apply(this,Y)}),ie("click",$,function(...Y){var U;(U=e.ondeletefolder)==null||U.apply(this,Y)}),F(w,S)};ce(J,w=>{e.folderPath!==""&&w(H)})}var G=C(J,2);{var X=w=>{var S=B5(),x=y(S);re(()=>ae(x,u(a))),F(w,S)};ce(G,w=>{u(a)&&w(X)})}var ee=C(G,2),A=y(ee),j=C(A,2);mn(f,w=>i=w,()=>i),re(()=>{ae(b,e.folderPath===""?"/ (root)":`${e.folderPath}/`),_.disabled=u(s),j.disabled=u(s)}),He("cancel",f,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("close",f,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("submit",p,g),Ya(_,()=>u(r),w=>T(r,w)),ie("click",A,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),F(t,f),it()}Tt(["click"]);var H5=z("<option></option>"),q5=z("<option> </option>"),j5=z('<p class="error svelte-1t0ew8l" role="alert"> </p>'),$5=z('<dialog aria-label="New content item" class="svelte-1t0ew8l"><form><h2 class="svelte-1t0ew8l">New content item</h2> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Title</span> <input required="" class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Slug</span> <input class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Folder</span> <input list="folder-options" placeholder="/ (root), or type a new folder" class="svelte-1t0ew8l"/> <datalist id="folder-options"></datalist> <span class="help svelte-1t0ew8l">Pick an existing folder or type a new path to create it.</span></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Template</span> <select class="svelte-1t0ew8l"><option>Inherit the folder’s default</option><!></select> <span class="help svelte-1t0ew8l">A folder’s default is set in its folder settings (the gear button in the tree).</span></label> <!> <div class="actions svelte-1t0ew8l"><button type="button" class="ghost svelte-1t0ew8l">Cancel</button> <button type="submit" class="primary svelte-1t0ew8l">Create</button></div></form></dialog>');function Y5(t,e){at(e,!0);const n=Vn(e,"initialFolder",3,"");let r=Q(""),s=Q(""),a=Q(""),i=Q("");Rt(()=>{T(a,n())});let o=!1,l=Q(null),d;Za(()=>d.showModal());function h(){o||T(s,_s(u(r)),!0)}async function g(w){w.preventDefault(),T(l,null);const S=_s(u(s)||u(r));if(S===""){T(l,"A title or slug is required.");return}const x=u(a).split("/").map(W=>_s(W)).filter(W=>W!=="").join("/"),k=x===""?S:`${x}/${S}`;try{await yv(k,u(r).trim()||S,u(i)),e.oncreated(k)}catch(W){T(l,W instanceof Error?W.message:String(W),!0)}}var f=$5(),p=y(f),v=C(y(p),2),b=C(y(v),2);$a(b,!0);var E=C(v,2),_=C(y(E),2),R=C(E,2),O=C(y(R),2),B=C(O,2);St(B,20,()=>e.folders,w=>w,(w,S)=>{var x=H5(),k={};re(()=>{k!==(k=S)&&(x.value=(x.__value=S)??"")}),F(w,x)});var M=C(R,2),J=C(y(M),2),H=y(J);H.value=H.__value="";var G=C(H);St(G,16,()=>e.templates,w=>w,(w,S)=>{var x=q5(),k=y(x),W={};re(()=>{ae(k,S),W!==(W=S)&&(x.value=(x.__value=S)??"")}),F(w,x)});var X=C(M,2);{var ee=w=>{var S=j5(),x=y(S);re(()=>ae(x,u(l))),F(w,S)};ce(X,w=>{u(l)&&w(ee)})}var A=C(X,2),j=y(A);mn(f,w=>d=w,()=>d),re(w=>Ee(_,"placeholder",w),[()=>_s(u(r))||"my-item"]),He("cancel",f,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("close",f,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("submit",p,g),ie("input",b,h),wt(b,()=>u(r),w=>T(r,w)),ie("input",_,()=>o=!0),wt(_,()=>u(s),w=>T(s,w)),wt(O,()=>u(a),w=>T(a,w)),Ya(J,()=>u(i),w=>T(i,w)),ie("click",j,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),F(t,f),it()}Tt(["input","click"]);function Qf(t){let e=!1;return t.map(n=>n.status==="done"?n:e?{...n,status:"pending"}:(e=!0,{...n,status:"active"}))}function Vb(t){return t.map(e=>({...e,status:"pending"}))}function Y1(t){return t.map(e=>({...e,status:"done"}))}function rl(t){return{phase:"validating",resources:Qf(Vb((t==null?void 0:t.resources)??[])),done:0,total:(t==null?void 0:t.resources.length)??0,uploaded:0,uploadTotal:0}}function sl(t,e){switch(e.phase){case"validate":return{...t,phase:"validating"};case"plan":{const n=Qf(Vb(e.plan.resources));return{...t,phase:"building",resources:n,done:0,total:e.plan.resources.length}}case"resource":{const n=t.resources.map(r=>r.id===e.resource.id?{...r,status:"done"}:r);return{...t,phase:"building",resources:Qf(n),done:e.done,total:e.total}}case"upload":return{...t,phase:"uploading",resources:Y1(t.resources),done:t.total,uploaded:e.written,uploadTotal:e.total};case"purge":return{...t,phase:"purging"};case"done":return{...t,phase:"done",resources:Y1(t.resources),done:t.total,written:e.written,...e.summary!==void 0&&{summary:e.summary}};case"blocked":return{...t,phase:"blocked",errors:e.errors};case"error":return{...t,phase:"error",message:e.message}}}function z5(t){switch(t.phase){case"validating":return .02;case"building":return .05+.78*(t.total===0?1:t.done/t.total);case"uploading":return .83+.15*(t.uploadTotal===0?1:t.uploaded/t.uploadTotal);case"purging":return .99;case"done":return 1;case"blocked":case"error":return t.total===0?0:t.done/t.total}}const W5=t=>new Promise(e=>setTimeout(e,t)),G5=250;function K5(){let t=Q(!1),e=Q(!1),n=Q(ct(rl())),r=Q(0),s,a=0;const i=()=>u(n).phase==="done"||u(n).phase==="blocked"||u(n).phase==="error";function o(){const d=z5(u(n))*100,h=i(),g=(performance.now()-a)/1e3,f=8+62*(1-Math.exp(-g/5)),p=h?u(n).phase==="done"?100:d:Math.max(d,f);T(r,u(r)+(p-u(r))*.12),Math.abs(p-u(r))<.2&&T(r,p,!0);const v=h&&u(r)===p;s=u(t)&&!v?requestAnimationFrame(o):void 0}const l=83;return{get active(){return u(t)},get running(){return u(e)},get state(){return u(n)},get percent(){return Math.round(u(r))},get shownDone(){const d=u(n).total;if(d===0)return 0;if(u(n).phase==="done")return d;const h=Math.floor(u(r)/l*d);return Math.max(0,Math.min(d-1,Math.max(u(n).done,h)))},async start(){if(!u(e)){T(t,!0),T(e,!0),a=performance.now(),T(r,0),T(n,rl(),!0),s===void 0&&(s=requestAnimationFrame(o));try{T(n,rl(await QN()),!0);let d=0,h=!0;const g=async()=>{const b=await JN(d);for(const E of b.events)T(n,sl(u(n),E),!0);return d=b.total,b.running},p=(async()=>{for(;h;){try{if(!await g()&&d>0)break}catch{}await W5(G5)}})(),v=await ZN();h=!1,await p.catch(()=>{});try{await g()}catch{}i()||T(n,v.ok?sl(u(n),{phase:"done",written:v.written,...v.summary!==void 0&&{summary:v.summary}}):sl(u(n),{phase:"blocked",errors:v.errors}),!0)}catch(d){const h=d instanceof Error?d.message:String(d);T(n,sl(u(n),{phase:"error",message:h}),!0)}finally{T(e,!1),s===void 0&&(s=requestAnimationFrame(o))}}},close(){u(e)||(T(t,!1),s!==void 0&&(cancelAnimationFrame(s),s=void 0),T(n,rl(),!0),T(r,0))}}}const Es=K5();var V5=z('<div class="bar-row svelte-1o0yh0y"><div class="bar svelte-1o0yh0y" role="progressbar" aria-label="Publish progress"><div></div></div> <span class="pct svelte-1o0yh0y" aria-hidden="true"> </span></div> <p class="sr-only svelte-1o0yh0y" aria-live="polite"> </p>',1),X5=z('<li class="svelte-1o0yh0y"> </li>'),Q5=z('<div class="panel blocked-panel svelte-1o0yh0y"><p class="panel-lead svelte-1o0yh0y">Fix these, then publish again:</p> <ul class="errors svelte-1o0yh0y"></ul></div>'),Z5=z('<div class="panel error-panel svelte-1o0yh0y"><p class="svelte-1o0yh0y"> </p></div>'),J5=z('<span class="spinner svelte-1o0yh0y"></span>'),ex=z('<span class="pending-dot svelte-1o0yh0y"></span>'),tx=z('<li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span> <span class="sr-only svelte-1o0yh0y"> </span></li>'),nx=z('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y"> </span> <span class="group-count svelte-1o0yh0y"> </span></div> <ul class="rows svelte-1o0yh0y"></ul></div>'),rx=z('<span class="group-count svelte-1o0yh0y"> </span>'),sx=z('<span class="spinner svelte-1o0yh0y"></span>'),ax=z('<span class="pending-dot svelte-1o0yh0y"></span>'),ix=z('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y">Upload</span> <!></div> <ul class="rows svelte-1o0yh0y"><li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span></li></ul></div>'),ox=z('<div class="timeline svelte-1o0yh0y" aria-label="Resources"><!> <!></div>'),ux=z('<p class="note warn svelte-1o0yh0y"> </p>'),lx=z('<p class="note svelte-1o0yh0y"> </p>'),cx=z('<button type="button" class="ghost svelte-1o0yh0y" disabled="">Publishing…</button>'),dx=z('<button type="button" class="primary svelte-1o0yh0y"> </button>'),fx=z('<section class="publish svelte-1o0yh0y" aria-label="Publishing"><div class="card svelte-1o0yh0y"><header><div class="badge svelte-1o0yh0y" aria-hidden="true"><!></div> <div class="head-text svelte-1o0yh0y"><h1 class="svelte-1o0yh0y"> </h1> <p class="caption svelte-1o0yh0y" aria-live="polite"> </p></div></header> <!> <!> <!> <footer class="actions svelte-1o0yh0y"><!></footer></div></section>');function hx(t,e){at(e,!0);const n=_e(()=>Es.state),r=_e(()=>Es.percent),s=_e(()=>u(n).phase==="error"),a=_e(()=>u(n).phase==="blocked"),i=_e(()=>u(n).phase==="done"),o=_e(()=>{var se;return u(i)&&((se=u(n).summary)==null?void 0:se.published)===0}),l=_e(()=>Es.shownDone),d=_e(()=>u(n).resources.map((se,he)=>{const Ae=he<u(l)?"done":he===u(l)&&!u(i)?"active":"pending";return{...se,status:Ae}})),h={image:J6,file:Z6,page:ew},g={image:"Images",file:"Files",page:"Pages"},f=_e(()=>["image","file","page"].map(he=>{const Ae=u(d).filter(Me=>Me.kind===he),Ce=Ae.filter(Me=>Me.status==="done").length;return{kind:he,label:g[he],icon:h[he],items:Ae,done:Ce}}).filter(he=>he.items.length>0)),p=_e(()=>{var se;return(se=u(d).find(he=>he.status==="active"))==null?void 0:se.kind}),v=_e(()=>u(i)||u(a)||u(s)?u(n).phase:u(n).phase==="uploading"||u(r)>=83?"uploading":u(n).phase==="purging"?"purging":u(l)>0||u(r)>12?"building":"validating"),b=_e(()=>{switch(u(v)){case"validating":return"Checking your content…";case"building":return u(p)==="image"?"Optimising images…":u(p)==="file"?"Copying files…":"Rendering pages…";case"uploading":return"Uploading to your live site…";case"purging":return"Refreshing the CDN…";case"done":return u(o)?"No pages were published.":"Your changes are live.";case"blocked":case"error":return"Nothing was published, your live site is unchanged."}}),E=_e(()=>{var se,he;if(u(s))return"Publish failed";if(u(a)){const Ae=((se=u(n).errors)==null?void 0:se.length)??0;return`${Ae} ${Ae===1?"thing":"things"} would break`}if(u(o))return"Nothing went live";if(u(i)){const Ae=((he=u(n).summary)==null?void 0:he.published)??0;return Ae>0?`Published ${Ae} ${Ae===1?"page":"pages"}`:`Published ${u(n).written??0} ${u(n).written===1?"file":"files"}`}return"Publishing your site"}),_=_e(()=>`${u(E)}. ${u(b)}`);function R(se){return se.status==="done"?"done":se.status==="active"?"in progress":"waiting"}var O=fx(),B=y(O),M=y(B);let J;var H=y(M),G=y(H);{var X=se=>{rw(se,{size:22})},ee=se=>{nw(se,{size:22})},A=se=>{tw(se,{size:22})};ce(G,se=>{u(s)||u(a)?se(X):u(i)?se(ee,1):se(A,-1)})}var j=C(H,2),w=y(j),S=y(w),x=C(w,2),k=y(x),W=C(M,2);{var $=se=>{var he=V5(),Ae=tt(he),Ce=y(Ae);Ee(Ce,"aria-valuemin",0),Ee(Ce,"aria-valuemax",100);var Me=y(Ce);let ke;var dt=C(Ce,2),Be=y(dt),It=C(Ae,2),Dt=y(It);re(()=>{Ee(Ce,"aria-valuenow",u(r)),ke=Ve(Me,1,"fill svelte-1o0yh0y",null,ke,{done:u(i)}),Jl(Me,`width: ${u(r)}%`),ae(Be,`${u(r)??""}%`),ae(Dt,u(_))}),F(se,he)};ce(W,se=>{!u(a)&&!u(s)&&se($)})}var Y=C(W,2);{var U=se=>{var he=Q5(),Ae=C(y(he),2);St(Ae,20,()=>u(n).errors??[],Ce=>Ce,(Ce,Me)=>{var ke=X5(),dt=y(ke);re(()=>ae(dt,Me)),F(Ce,ke)}),F(se,he)},K=se=>{var he=Z5(),Ae=y(he),Ce=y(Ae);re(()=>ae(Ce,u(n).message)),F(se,he)},te=se=>{var he=ox(),Ae=y(he);St(Ae,17,()=>u(f),ke=>ke.kind,(ke,dt)=>{var Be=nx(),It=y(Be),Dt=y(It);kd(Dt,()=>u(dt).icon,(Gt,Mt)=>{Mt(Gt,{size:15,"aria-hidden":"true"})});var Lt=C(Dt,2),ft=y(Lt),Vt=C(Lt,2),qt=y(Vt),Pt=C(It,2);St(Pt,21,()=>u(dt).items,Gt=>Gt.id,(Gt,Mt)=>{var mt=tx();let yt;var Bt=y(mt),ot=y(Bt);{var nt=jt=>{kp(jt,{size:13})},bt=jt=>{var en=J5();F(jt,en)},An=jt=>{var en=ex();F(jt,en)};ce(ot,jt=>{u(Mt).status==="done"?jt(nt):u(Mt).status==="active"?jt(bt,1):jt(An,-1)})}var yn=C(Bt,2),ln=y(yn),Zn=C(yn,2),Jn=y(Zn);re(jt=>{yt=Ve(mt,1,"row svelte-1o0yh0y",null,yt,{active:u(Mt).status==="active",done:u(Mt).status==="done"}),Ee(yn,"title",u(Mt).id),ae(ln,u(Mt).label),ae(Jn,jt)},[()=>R(u(Mt))]),F(Gt,mt)}),re(()=>{ae(ft,u(dt).label),ae(qt,`${u(dt).done??""}/${u(dt).items.length??""}`)}),F(ke,Be)});var Ce=C(Ae,2);{var Me=ke=>{var dt=ix(),Be=y(dt),It=y(Be);Q6(It,{size:15,"aria-hidden":"true"});var Dt=C(It,4);{var Lt=nt=>{var bt=rx(),An=y(bt);re(()=>ae(An,`${u(n).uploaded??""}/${u(n).uploadTotal??""}`)),F(nt,bt)};ce(Dt,nt=>{u(n).uploadTotal>0&&nt(Lt)})}var ft=C(Be,2),Vt=y(ft);let qt;var Pt=y(Vt),Gt=y(Pt);{var Mt=nt=>{kp(nt,{size:13})},mt=nt=>{var bt=sx();F(nt,bt)},yt=nt=>{var bt=ax();F(nt,bt)};ce(Gt,nt=>{u(i)?nt(Mt):u(n).phase==="uploading"?nt(mt,1):nt(yt,-1)})}var Bt=C(Pt,2),ot=y(Bt);re(()=>{qt=Ve(Vt,1,"row svelte-1o0yh0y",null,qt,{active:u(n).phase==="uploading",done:u(i)}),ae(ot,u(i)?`Uploaded ${u(n).written??u(n).uploadTotal} files to the live site`:`Uploading ${u(n).uploadTotal} files…`)}),F(ke,dt)};ce(Ce,ke=>{(u(n).uploadTotal>0||u(n).phase==="uploading"||u(i))&&ke(Me)})}F(se,he)};ce(Y,se=>{u(a)?se(U):u(s)?se(K,1):se(te,-1)})}var fe=C(Y,2);{var me=se=>{var he=ux(),Ae=y(he);re(()=>{var Ce;return ae(Ae,((Ce=u(n).summary)==null?void 0:Ce.firstPublishWarning)??"Your site has no published pages. Toggle Publish on at least one page to go live.")}),F(se,he)},ge=se=>{var he=lx(),Ae=y(he);re(()=>{var Ce,Me;return ae(Ae,`${((Ce=u(n).summary)==null?void 0:Ce.drafts)??""}
128
- ${((Me=u(n).summary)==null?void 0:Me.drafts)===1?"draft was":"drafts were"} skipped.`)}),F(se,he)};ce(fe,se=>{var he;u(i)&&u(o)?se(me):u(i)&&(((he=u(n).summary)==null?void 0:he.drafts)??0)>0&&se(ge,1)})}var Le=C(fe,2),de=y(Le);{var ve=se=>{var he=cx();F(se,he)},Ie=se=>{var he=dx(),Ae=y(he);re(()=>ae(Ae,u(i)?"Done":"Back to editing")),ie("click",he,()=>Es.close()),F(se,he)};ce(de,se=>{Es.running?se(ve):se(Ie,-1)})}re(()=>{J=Ve(M,1,"head svelte-1o0yh0y",null,J,{error:u(s),blocked:u(a),done:u(i)&&!u(o)}),ae(S,u(E)),ae(k,u(b))}),F(t,O),it()}Tt(["click"]);var px=z("<option> </option>"),mx=z(`<div class="empty svelte-y9gf4p"><div class="card svelte-y9gf4p"><h1 class="svelte-y9gf4p"> </h1> <p class="svelte-y9gf4p">This section has no page yet, the page visitors see at <code class="svelte-y9gf4p"> </code>. Pick a template (a
129
- listing template loops over this section's items) and create it.</p> <label class="svelte-y9gf4p"><span class="svelte-y9gf4p">Template</span> <select class="svelte-y9gf4p"><option>Inherit the folder’s default</option><!></select></label> <button type="button" class="primary svelte-y9gf4p"> </button></div></div>`);function gx(t,e){at(e,!0);const n=_e(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=Q(""),s=Q(!1);function a(){T(s,!0),e.oncreate(u(r))}var i=mx(),o=y(i),l=y(o),d=y(l),h=C(l,2),g=C(y(h)),f=y(g),p=C(h,2),v=C(y(p),2),b=y(v);b.value=b.__value="";var E=C(b);St(E,16,()=>e.templates,O=>O,(O,B)=>{var M=px(),J=y(M),H={};re(()=>{ae(J,B),H!==(H=B)&&(M.value=(M.__value=B)??"")}),F(O,M)});var _=C(p,2),R=y(_);re(()=>{ae(d,e.name),ae(f,u(n)),v.disabled=u(s),_.disabled=u(s),ae(R,u(s)?"Creating…":"Create page")}),Ya(v,()=>u(r),O=>T(r,O)),ie("click",_,a),F(t,i),it()}Tt(["click"]);const Xb="nanoesis:sidebar-width",vx=180,bx=560,Ex=260;function Qb(t){return Math.min(bx,Math.max(vx,Math.round(t)))}function _x(){const t=Number(localStorage.getItem(Xb));return Number.isFinite(t)&&t>0?Qb(t):Ex}let $l=_x();function Zb(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${$l}px`)}Zb();function Tx(){return $l}function Ax(t){$l=Qb(t),Zb(),localStorage.setItem(Xb,String($l))}var yx=z('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function Nx(t,e){at(e,!0);let n=Q(null);function r(l){l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),T(n,{startX:l.clientX,startWidth:Tx()},!0)}function s(l){u(n)!==null&&Ax(u(n).startWidth+(l.clientX-u(n).startX))}function a(l){var d,h;u(n)!==null&&((h=(d=l.currentTarget).releasePointerCapture)==null||h.call(d,l.pointerId),T(n,null))}var i=yx();let o;re(()=>o=Ve(i,1,"resizer svelte-1jo2gqq",null,o,{dragging:u(n)!==null})),ie("pointerdown",i,r),ie("pointermove",i,s),ie("pointerup",i,a),He("pointercancel",i,a),F(t,i),it()}Tt(["pointerdown","pointermove","pointerup"]);const Jb={"content-type":"application/json"};async function wx(){const t=await Ge("/api/migrations");if(!t.ok)throw new Error(`Failed to load migrations (HTTP ${t.status}).`);return await t.json()}async function zk(t){const e=await Ge(`/api/migrations/preview?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load migration preview (HTTP ${e.status}).`);return await e.json()}async function Wk(t,e){const n=await Ge("/api/migrations/apply",{method:"POST",headers:Jb,body:JSON.stringify({path:t,resolution:e})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error??`Migration failed (HTTP ${n.status}).`)}return await n.json()}async function Gk(t,e){const n=await Ge("/api/templates/stamp",{method:"POST",headers:Jb,body:JSON.stringify({name:t,kind:e})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Stamp failed (HTTP ${n.status}).`)}return await n.json()}function Sx(){let t=Q(0),e=Q(null),n=Q(!1),r=Q(null),s=!1;async function a(){T(n,!0),T(r,null);try{const i=await wx();T(e,i,!0),T(t,i.items.length,!0),s=!0}catch(i){T(r,i instanceof Error?i.message:String(i),!0)}finally{T(n,!1)}}return{get count(){return u(t)},get list(){return u(e)},get loading(){return u(n)},get error(){return u(r)},async ensureLoaded(){s||u(n)||await a()},refresh:a}}const al=Sx();var Ix=z(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),Cx=z('<p class="error svelte-fna247" role="alert"> </p>'),Lx=z('<p class="success svelte-fna247" role="status">Password updated.</p>'),Ox=z('<dialog aria-label="Change password" class="svelte-fna247"><h2 class="svelte-fna247">Change password</h2> <p class="lede svelte-fna247">You stay signed in here. Other sessions of yours (other devices, other tabs) are signed out.</p> <form class="svelte-fna247"><label class="svelte-fna247"><span class="svelte-fna247">Current password</span> <input type="password" autocomplete="current-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">New password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">Confirm new password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/> <!></label> <!> <!> <div class="actions svelte-fna247"><button type="button" class="ghost svelte-fna247">Cancel</button> <button type="submit" class="primary svelte-fna247"> </button></div></form></dialog>');function xx(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q(""),a=Q(""),i=Q(""),o=Q(!1),l=Q(null),d=Q(!1);Rt(()=>{u(r)&&(n()&&!u(r).open?(T(s,""),T(a,""),T(i,""),T(l,null),T(d,!1),T(o,!1),u(r).showModal()):!n()&&u(r).open&&u(r).close())});let h=_e(()=>u(a)!==""&&u(i)!==""&&u(a)!==u(i)),g=_e(()=>!u(o)&&u(s)!==""&&u(a)!==""&&!u(h));async function f(k){if(k.preventDefault(),!u(g))return;T(o,!0),T(l,null);const W=await pt.changePassword(u(s),u(a));if(T(o,!1),!W.ok){const $=W.error??"Password change failed.";T(l,$.includes("credentials")?"Current password is incorrect.":$,!0);return}T(d,!0),setTimeout(()=>{n(!1)},900)}function p(k){k.preventDefault(),n(!1)}var v=Ox(),b=C(y(v),4),E=y(b),_=C(y(E),2),R=C(E,2),O=C(y(R),2),B=C(R,2),M=C(y(B),2),J=C(M,2);{var H=k=>{var W=Ix();F(k,W)};ce(J,k=>{u(h)&&k(H)})}var G=C(B,2);{var X=k=>{var W=Cx(),$=y(W);re(()=>ae($,u(l))),F(k,W)};ce(G,k=>{u(l)&&k(X)})}var ee=C(G,2);{var A=k=>{var W=Lx();F(k,W)};ce(ee,k=>{u(d)&&k(A)})}var j=C(ee,2),w=y(j),S=C(w,2),x=y(S);mn(v,k=>T(r,k),()=>u(r)),re(()=>{S.disabled=!u(g),ae(x,u(o)?"Updating…":"Update password")}),He("cancel",v,p),He("submit",b,f),wt(_,()=>u(s),k=>T(s,k)),wt(O,()=>u(a),k=>T(a,k)),wt(M,()=>u(i),k=>T(i,k)),ie("click",w,()=>n(!1)),F(t,v),it()}Tt(["click"]);var Rx=z(`<label class="svelte-szf2lz"><span class="svelte-szf2lz"> </span> <textarea readonly="" rows="3" class="svelte-szf2lz"></textarea></label> <p class="warn svelte-szf2lz" role="status">Copy it now, you won't be able to see it again.</p> <div class="actions svelte-szf2lz"><button type="button" class="ghost svelte-szf2lz">Done</button> <button type="button" class="primary svelte-szf2lz"> </button></div>`,1),Dx=z('<p class="error svelte-szf2lz" role="alert"> </p>'),kx=z('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),Px=z('<!> <!> <div class="actions svelte-szf2lz"><button type="button" class="danger svelte-szf2lz">Revoke all</button> <span class="spacer svelte-szf2lz"></span> <button type="button" class="ghost svelte-szf2lz">Cancel</button> <button type="button" class="primary svelte-szf2lz"> </button></div>',1),Mx=z(`<dialog aria-label="MCP access token" class="svelte-szf2lz"><h2 class="svelte-szf2lz">MCP access token</h2> <p class="lede svelte-szf2lz">A token lets an AI client (through the MCP server) read and edit this site as you, with your
125
+ `).map(s=>`<div class="ql-code-block">${s}</div>`).join("")}</div>`)}function a5(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function q1(t,e){return s5(t.replace(Wb,(n,r)=>a5(r)?`src="${cc(e,r)}"`:n))}function j1(t,e){const n=`content/${e===""?"":`${e}/`}`;return r5(t).replace(J8,(r,s)=>`<img src="${s}"`).replace(Wb,(r,s)=>{const a=s.indexOf(H1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+H1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(Z8," ")}var i5=z('<div class="rte svelte-1afg4yo"><div></div></div>');function o5(t,e){at(e,!0);const n=le.import("formats/link");n.PROTOCOL_WHITELIST.includes("ref")||n.PROTOCOL_WHITELIST.push("ref");let r,s;const a=[[{header:[2,3,!1]}],["bold","italic","link","image"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],["clean"]];Za(()=>{const p=new le(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(p.root.setAttribute("aria-labelledby",e.labelledBy),p.root.setAttribute("aria-multiline","true"));const _=p.theme.tooltip;if(_!==void 0){const M=_.position.bind(_);_.position=B=>{const J=p.root.getBoundingClientRect();return M({...B,left:B.left+J.left,right:B.right+J.left,top:B.top+J.top-p.root.scrollTop,bottom:B.bottom+J.top-p.root.scrollTop})}}const E=p.getModule("toolbar");E.addHandler("image",()=>l(p)),E.addHandler("link",()=>o(p));const b=M=>{M.preventDefault(),setTimeout(()=>i(p),0)};p.root.addEventListener("contextmenu",b);const x=M=>{M.target instanceof HTMLImageElement&&f(p,M.target)};p.root.addEventListener("dblclick",x),e.value&&p.clipboard.dangerouslyPasteHTML(q1(e.value,e.itemDir),"silent");const O=()=>e.onchange(j1(p.root.innerHTML,e.itemDir));return p.on("text-change",O),s=p,()=>{p.off("text-change",O),p.root.removeEventListener("contextmenu",b),p.root.removeEventListener("dblclick",x);for(const M of p.root.querySelectorAll("img"))zb(M)}});function i(p){var b;const v=p.getSelection(!0);if(v===null)return;const _=p.theme,E=p.getBounds(v.index,v.length);((b=_.tooltip)==null?void 0:b.show)!==void 0&&_.tooltip.position!==void 0&&E&&(_.tooltip.show(),_.tooltip.position(E))}function o(p){const v=p.getSelection(!0);if(v===null)return;const _=p.getFormat(v).link??"";Bv(_).then(E=>{if(E!==null)if(E==="")p.formatText(v.index,v.length,"link",!1,"user");else if(v.length>0)p.formatText(v.index,v.length,"link",E,"user");else{const b=Qo(E)?If(E):E;p.insertText(v.index,b,{link:E},"user")}})}function l(p){const v=document.createElement("input");v.type="file",v.accept="image/*",v.onchange=()=>{var E;const _=(E=v.files)==null?void 0:E[0];_&&d(p,_)},v.click()}async function d(p,v){try{const _=await Hh(e.itemDir,v),E=p.getSelection(!0),b=await hp("");if(b===null)return;p.insertEmbed(E.index,"image",cc(e.itemDir,_),"user"),b!==""&&p.formatText(E.index,1,"alt",b,"user"),p.setSelection(E.index+1,0)}catch(_){console.error("Inline image upload failed",_)}}function f(p,v){const _=le.find(v);if(_===null)return;const E=p.getIndex(_);hp(v.getAttribute("alt")??"").then(b=>{b!==null&&p.formatText(E,1,"alt",b===""?!1:b,"user")})}Rt(()=>{const p=e.value;s&&j1(s.root.innerHTML,e.itemDir)!==p&&s.clipboard.dangerouslyPasteHTML(q1(p,e.itemDir),"silent")});var g=i5(),h=y(g);mn(h,p=>r=p,()=>r),F(t,g),it()}var u5=z('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),l5=z('<textarea rows="3"></textarea>'),c5=z('<input type="date" class="svelte-1bn65uv"/>'),d5=z('<input type="time" class="svelte-1bn65uv"/>'),f5=z('<input type="email" class="svelte-1bn65uv"/>'),h5=z('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),p5=z('<input type="text" class="svelte-1bn65uv"/>'),m5=z('<p class="hint svelte-1bn65uv"> </p>'),g5=z("<p> </p>"),v5=z('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),b5=z('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),E5=z('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),_5=z('<p class="hint svelte-1bn65uv">Loading fields…</p>'),T5=z('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),A5=z(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta &amp; SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's &lt;head&gt;.</p> <!></details>`),y5=z("<!> <!>",1),N5=z('<div class="divider svelte-1bn65uv" role="separator" aria-orientation="vertical" aria-label="Resize preview" tabindex="0"><span class="grip svelte-1bn65uv"></span></div> <div class="preview-pane svelte-1bn65uv"><!></div>',1),w5=z('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles svelte-1bn65uv"><input class="title-input svelte-1bn65uv" type="text" aria-label="Title" placeholder="Untitled"/> <p class="meta svelte-1bn65uv"> </p></div> <div class="head-actions svelte-1bn65uv"><div class="action-buttons svelte-1bn65uv"><!> <!> <button type="button">Preview</button> <button type="button"> </button></div> <label class="pubdate svelte-1bn65uv"><span>Publish date</span> <input type="date" class="svelte-1bn65uv"/></label></div></header> <!></form></div> <!></div> <!>',1);function S5(t,e){at(e,!0);const n=Vn(e,"templates",19,()=>[]),r={name:"title",type:"shorttext",label:"Title",required:!0,multiline:!1,help:"Names the page in the tree and fills {title} where the template uses it, it doesn’t have to appear on the page."},s={name:"published",type:"date",label:"Publish date",required:!1,multiline:!1};let a=Q(!1);const i=()=>new Date().toISOString().slice(0,10);function o(){T(a,!u(a)),u(a)&&(u(b).published??"").trim()===""&&(u(b).published=i()),G()}let l=Q(!1),d=Q(ct([]));function f(){T(l,!0),e.onmove&&ff().then(Ne=>T(d,Ne,!0))}async function g(Ne){var ze;Ne!==e.templateName&&(await A(),(ze=e.onchangetemplate)==null||ze.call(e,Ne))}const h=_e(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),p=new Set(["richtext","image","file","authors"]);function v(Ne){return p.has(Ne.type)?void 0:`f-${Ne.name}`}let _=Q(ct([])),E=Q(!0),b=Q(ct({})),x=Q(null);const O=700;let M,B=!1,J=0;Za(()=>{H();const Ne=()=>void A();return window.addEventListener("beforeunload",Ne),()=>{window.removeEventListener("beforeunload",Ne),A()}});async function H(){T(E,!0);const[Ne,ze]=await Promise.all([GN(e.templateName),KN()]),Qe=Ne.filter(De=>De.name!=="title"&&De.name!=="published"),Je=new Set(Qe.map(De=>De.name)),L=ze.filter(De=>De.name!=="published"&&!Je.has(De.name)),ue=[r,s,...Qe,...L],Te={};for(const De of ue)Te[De.name]=y6(e.item,De.name);Te.published=(Te.published??"").slice(0,10),T(a,e.item.isPublished,!0),T(_,ue,!0),T(k,Qe,!0),T(W,L,!0),T(b,Te,!0),ow(localStorage,e.path,Te),T(x,uw(localStorage,e.path),!0),T(E,!1)}function G(){B=!0,J+=1,clearTimeout(M),M=setTimeout(()=>void A(),O)}function X(Ne,ze){const Qe=u(b)[Ne]??"";u(b)[Ne]=ze,G(),Qe!==""&&Qe!==ze&&ee(Qe)}async function ee(Ne){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Ne))return;Object.values(u(b)).some(Qe=>typeof Qe=="string"&&Qe.includes(Ne))||await r6(u(h),Ne)}async function A(){var Qe;if(clearTimeout(M),!B)return;const Ne=J,ze=Mp(e.item,u(_),u(b),u(a));Fs.saving();try{await Ev(e.path,ze),J===Ne&&(B=!1),Fs.saved(),(Qe=e.onsaved)==null||Qe.call(e,e.path,u(b).title??e.item.title,u(a))}catch{Fs.failed(()=>void A())}}async function j(){u(x)===null||!await Bl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(T(b,{...u(x)},!0),G())}const w=new Set(["text","code"]);function S(Ne,ze){return Ne.maxLength!==void 0&&Ne.minLength!==void 0?`${ze} / ${Ne.maxLength} characters (min ${Ne.minLength})`:Ne.maxLength!==void 0?`${ze} / ${Ne.maxLength} characters`:`${ze} characters (min ${Ne.minLength})`}function R(Ne,ze){return Ne.minLength!==void 0&&ze>0&&ze<Ne.minLength?!0:Ne.maxLength!==void 0&&ze>Ne.maxLength}let k=Q(ct([])),W=Q(ct([]));const $=_e(()=>u(x)!==null&&JSON.stringify(u(b))!==JSON.stringify(u(x))),Y="nanoesis:preview-open";let U=Q(localStorage.getItem(Y)==="true");function K(Ne){T(U,Ne,!0),localStorage.setItem(Y,String(Ne))}const te=_e(()=>{if(u(E))return null;try{return{...tc(JSON.parse(Mp(e.item,u(_),u(b),u(a)))),template:e.templateName}}catch{return null}}),fe="nanoesis:preview-split",me=.2,ge=.8;function Le(Ne){return Math.min(ge,Math.max(me,Ne))}function de(){const Ne=Number(localStorage.getItem(fe));return Number.isFinite(Ne)&&Ne>0?Le(Ne):.5}let ve=Q(ct(de())),Ie=Q(!1),se;function he(Ne){Ne.preventDefault(),T(Ie,!0),Ne.currentTarget.setPointerCapture(Ne.pointerId)}function Ae(Ne){if(!u(Ie))return;const ze=se.getBoundingClientRect();T(ve,Le((Ne.clientX-ze.left)/ze.width),!0)}function Ce(Ne){var ze,Qe;u(Ie)&&(T(Ie,!1),(Qe=(ze=Ne.currentTarget).releasePointerCapture)==null||Qe.call(ze,Ne.pointerId),localStorage.setItem(fe,String(u(ve))))}function Me(Ne){const ze=Ne.key==="ArrowLeft"?-.02:Ne.key==="ArrowRight"?.02:0;ze!==0&&(Ne.preventDefault(),T(ve,Le(u(ve)+ze),!0),localStorage.setItem(fe,String(u(ve))))}var ke=w5(),dt=tt(ke);let Be;var It=y(dt),Dt=y(It);{const Ne=(Je,L=th)=>{var ue=v5(),Te=y(ue),De=y(Te),Xe=C(De);{var Ke=Se=>{var we=u5();F(Se,we)};ce(Xe,Se=>{L().required&&Se(Ke)})}var Et=C(Xe,2),cn=y(Et),Nt=C(Te,2);{var tr=Se=>{{let we=_e(()=>u(b)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);o5(Se,{get value(){return u(we)},get itemDir(){return u(h)},get labelledBy(){return u(qe)},placeholder:"Write…",onchange:gt=>{u(b)[L().name]=gt,G()}})}},Os=Se=>{var we=l5();let qe;re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength),qe=Ve(we,1,"svelte-1bn65uv",null,qe,{mono:L().type==="code"})}),ie("input",we,G),wt(we,()=>u(b)[L().name],gt=>u(b)[L().name]=gt),F(Se,we)},qr=_e(()=>w.has(L().type)),la=Se=>{{let we=_e(()=>u(b)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);kw(Se,{get value(){return u(we)},get itemDir(){return u(h)},get labelledBy(){return u(qe)},onchange:gt=>X(L().name,gt)})}},ca=Se=>{{let we=_e(()=>u(b)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);Lw(Se,{get value(){return u(we)},get itemDir(){return u(h)},get labelledBy(){return u(qe)},onchange:gt=>{u(b)[L().name]=gt,G()}})}},Xt=Se=>{{let we=_e(()=>u(b)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);_w(Se,{get value(){return u(we)},get labelledBy(){return u(qe)},onchange:gt=>{u(b)[L().name]=gt,G()}})}},da=Se=>{{let we=_e(()=>u(b)[L().name]??""),qe=_e(()=>`lbl-${L().name}`);Zw(Se,{get value(){return u(we)},get labelledBy(){return u(qe)},onchange:gt=>{u(b)[L().name]=gt,G()}})}},fa=Se=>{var we=c5();re(()=>Ee(we,"id",`f-${L().name}`)),ie("input",we,G),wt(we,()=>u(b)[L().name],qe=>u(b)[L().name]=qe),F(Se,we)},xs=Se=>{var we=d5();re(()=>Ee(we,"id",`f-${L().name}`)),ie("input",we,G),wt(we,()=>u(b)[L().name],qe=>u(b)[L().name]=qe),F(Se,we)},ha=Se=>{var we=f5();re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength)}),ie("input",we,G),wt(we,()=>u(b)[L().name],qe=>u(b)[L().name]=qe),F(Se,we)},pa=Se=>{var we=h5();re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength)}),ie("input",we,G),wt(we,()=>u(b)[L().name],qe=>u(b)[L().name]=qe),F(Se,we)},dn=Se=>{var we=p5();re(()=>{Ee(we,"id",`f-${L().name}`),Ee(we,"maxlength",L().maxLength),Ee(we,"minlength",L().minLength)}),ie("input",we,G),wt(we,()=>u(b)[L().name],qe=>u(b)[L().name]=qe),F(Se,we)};ce(Nt,Se=>{L().type==="richtext"?Se(tr):u(qr)?Se(Os,1):L().type==="image"?Se(la,2):L().type==="file"?Se(ca,3):L().type==="authors"?Se(Xt,4):L().type==="url"?Se(da,5):L().type==="date"?Se(fa,6):L().type==="time"?Se(xs,7):L().type==="email"?Se(ha,8):L().type==="phone"?Se(pa,9):Se(dn,-1)})}var Rs=C(Nt,2);{var ma=Se=>{var we=m5(),qe=y(we);re(()=>ae(qe,L().help)),F(Se,we)};ce(Rs,Se=>{L().help&&Se(ma)})}var ga=C(Rs,2);{var va=Se=>{const we=_e(()=>(u(b)[L().name]??"").length);var qe=g5();let gt;var $t=y(qe);re((Yt,tn)=>{gt=Ve(qe,1,"hint count svelte-1bn65uv",null,gt,Yt),ae($t,tn)},[()=>({over:R(L(),u(we))}),()=>S(L(),u(we))]),F(Se,qe)};ce(ga,Se=>{(L().minLength!==void 0||L().maxLength!==void 0)&&Se(va)})}re(Se=>{Ee(Te,"id",`lbl-${L().name}`),Ee(Te,"for",Se),ae(De,`${L().label??""} `),ae(cn,L().multiple?"references":L().type)},[()=>v(L())]),F(Je,ue)};var Lt=y(Dt),ft=y(Lt),Vt=y(ft),qt=C(Vt,2),Pt=y(qt),Gt=C(ft,2),Mt=y(Gt),mt=y(Mt);{var yt=Je=>{var L=b5();ie("click",L,j),F(Je,L)};ce(mt,Je=>{u($)&&Je(yt)})}var Bt=C(mt,2);{var ot=Je=>{var L=E5(),ue=y(L);zh(ue,{size:16,"aria-hidden":"true"}),ie("click",L,f),F(Je,L)};ce(Bt,Je=>{e.onchangetemplate&&Je(ot)})}var nt=C(Bt,2);let ze;var bt=C(nt,2);let Qe;var An=y(bt),yn=C(Mt,2),ln=C(y(yn),2),Zn=C(Lt,2);{var Jn=Je=>{var L=_5();F(Je,L)},jt=Je=>{var L=T5();F(Je,L)},en=Je=>{var L=y5(),ue=tt(L);St(ue,17,()=>u(k),Xe=>Xe.name,(Xe,Ke)=>{Ne(Xe,()=>u(Ke))});var Te=C(ue,2);{var De=Xe=>{var Ke=A5(),Et=C(y(Ke),4);St(Et,17,()=>u(W),cn=>cn.name,(cn,Nt)=>{Ne(cn,()=>u(Nt))}),F(Xe,Ke)};ce(Te,Xe=>{u(W).length>0&&Xe(De)})}F(Je,L)};ce(Zn,Je=>{u(E)?Je(Jn):u(k).length===0&&u(W).length===0?Je(jt,1):Je(en,-1)})}re(()=>{ae(Pt,e.templateName),ze=Ve(nt,1,"preview-toggle svelte-1bn65uv",null,ze,{active:u(U)}),Ee(nt,"aria-pressed",u(U)),Qe=Ve(bt,1,"publish-btn svelte-1bn65uv",null,Qe,{on:u(a)}),Ee(bt,"aria-pressed",u(a)),Ee(bt,"title",u(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),ae(An,u(a)?"Publish":"Don't Publish")}),ie("input",Vt,G),wt(Vt,()=>u(b).title,Je=>u(b).title=Je),ie("click",nt,()=>K(!u(U))),ie("click",bt,o),ie("input",ln,G),wt(ln,()=>u(b).published,Je=>u(b).published=Je)}var Hr=C(It,2);{var us=Ne=>{var ze=N5(),Qe=tt(ze),Je=C(Qe,2),L=y(Je);sS(L,{get path(){return e.path},get previewItem(){return u(te)},onclose:()=>K(!1)}),re((ue,Te,De)=>{Ee(Qe,"aria-valuemin",ue),Ee(Qe,"aria-valuemax",Te),Ee(Qe,"aria-valuenow",De)},[()=>Math.round(me*100),()=>Math.round(ge*100),()=>Math.round(u(ve)*100)]),ie("pointerdown",Qe,he),ie("pointermove",Qe,Ae),ie("pointerup",Qe,Ce),He("pointercancel",Qe,Ce),ie("keydown",Qe,Me),F(Ne,ze)};ce(Hr,Ne=>{u(U)&&Ne(us)})}mn(dt,Ne=>se=Ne,()=>se);var er=C(dt,2);{var ls=Ne=>{{let ze=_e(()=>e.onrename?()=>(T(l,!1),e.onrename()):void 0),Qe=_e(()=>e.ondelete?()=>(T(l,!1),e.ondelete()):void 0),Je=_e(()=>e.onmove?L=>(T(l,!1),e.onmove(L)):void 0);Yw(Ne,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return u(h)},get folders(){return u(d)},onchangetemplate:L=>{T(l,!1),g(L)},get onrename(){return u(ze)},get ondelete(){return u(Qe)},get onmove(){return u(Je)},onclose:()=>T(l,!1)})}};ce(er,Ne=>{u(l)&&e.onchangetemplate&&Ne(ls)})}re(()=>{Be=Ve(dt,1,"layout svelte-1bn65uv",null,Be,{split:u(U),dragging:u(Ie)}),Jl(It,u(U)?`flex-basis:${u(ve)*100}%`:void 0)}),He("submit",Dt,Ne=>Ne.preventDefault()),ie("focusout",Dt,()=>void A()),F(t,ke),it()}Tt(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const Gb=""+new URL("nanoesis-logo-T2zheChZ.png",import.meta.url).href,I5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAFS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgZXhpZjpQaXhlbFhEaW1lbnNpb249IjUwIgogICBleGlmOlBpeGVsWURpbWVuc2lvbj0iNTAiCiAgIGV4aWY6Q29sb3JTcGFjZT0iMSIKICAgdGlmZjpJbWFnZVdpZHRoPSI1MCIKICAgdGlmZjpJbWFnZUxlbmd0aD0iNTAiCiAgIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiCiAgIHRpZmY6WFJlc29sdXRpb249IjMwMC8xIgogICB0aWZmOllSZXNvbHV0aW9uPSIzMDAvMSIKICAgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIKICAgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIgogICB4bXA6TW9kaWZ5RGF0ZT0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiCiAgIHhtcDpNZXRhZGF0YURhdGU9IjIwMjYtMDItMjRUMTA6NTY6NTBaIj4KICAgPGRjOnRpdGxlPgogICAgPHJkZjpBbHQ+CiAgICAgPHJkZjpsaSB4bWw6bGFuZz0ieC1kZWZhdWx0Ij54dHJhYmxlLWFpLWxvZ288L3JkZjpsaT4KICAgIDwvcmRmOkFsdD4KICAgPC9kYzp0aXRsZT4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0icHJvZHVjZWQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFmZmluaXR5IERlc2lnbmVyIDEuMTAuNiIKICAgICAgc3RFdnQ6d2hlbj0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KPD94cGFja2V0IGVuZD0iciI/PtBEvDoAAAGBaUNDUHNSR0IgSUVDNjE5NjYtMi4xAAAokXWRv0tCURTHP2pRlGFQg0ODRDVplEHY0qD0C6pBDbJa9OWPwB+P95SQ1qA1KIha+jXUX1Br0BwERRFEczQWtZS8zlNBiTyXc8/nfu89h3vPBWs4rWT0piHIZPNacMrvWowsuVresOKkDR+2qKKrc6HJMA3t6wGLGe88Zq3G5/619tW4roClVXhcUbW88LTw7HpeNXlXuFtJRVeFz4XdmlxQ+N7UYxV+NTlZ4R+TtXAwANZOYVeyjmN1rKS0jLC8nL5MuqBU72O+xB7PLoQk9or3oBNkCj8uZpggwCjDjMk8igcvg7KiQf5QOX+enOQqMqsU0VgjSYo8blELUj0uMSF6XEaaotn/v33VEyPeSnW7H5pfDOOjH1p2oLRtGN/HhlE6AdszXGVr+bkj8H2Kvl3T+g7BsQkX1zUttgeXW+B8UqNatCzZxK2JBLyfQUcEum6hbbnSs+o+p48Q3pCvuoH9AxiQ846VX24uZ+lBa66dAAAACXBIWXMAAC4jAAAuIwF4pT92AAAIcElEQVRogeXZfXAU5R0H8O9ze3t73F1edrMJLyoDHSmoYxkHqrxZ0mpoaEEJiYBSBvriTAuVomBlChUpjDMqVq0F6QwWWrFFJC2UtkHiaDoooKaMQLG8TIWCRSHLbnJc9rKvv/6Ru3AJubvdS5h22u/MzXO57D35ffJ7nid3F+D/MaZNwf90DdkS8HqhaVOpYWOokqCia1lQofEESSFkw8ZA08ak0y008FoXlo7TTqJrk5DvuryQDES5aUM2LAw2bdx/5BwN65dKc8T4jEa5JoaTgYH5MDkhvSA6RxvXGTaWv3OKbu7f0q9EP0WTycAY10C5a0LOh8kKyYEoT92uN22sbzhKo/obEf8rzXINVLkmysmA7AXT6ynkASGbneMAw+59jkKjNdFiMjHZBZT0YwEAbuZ9my4EgszICfGJeHDGbexv9c00FYBaO5a91xeEspsecw3MB6BkFu8F0w1i2sT7RLxX30yzALwa70Dy2b00dekU9m6hENcABYDybgV7xHTbI6EgswwbmmmjzCciqOoo0nQ0LPoNTfQL+GSLs/jTHc74ijr2tGtgPZkod1N7g8zUHjEgZ9kz/FUQAJBj7JJh4Zhpo8wHAlrnrUhLoqH6Re+YUz9211oaXnASeOPTHc6Eijr2hA9MjIzOJvV6ag0vZ6cNG3uNToxXBLQkkO7MiFX5MYfnumutVqywVQZLQ5GTwB4fmJBr4B9clDlZIQDwhRvYYcPG5lRnvCKg6SlMEjNzIQ6Od9faGlZYKmC1Aj4xcE28JQy6stlZvt9aw1GaaNhon3Eb+9AjAloS2zUdD5SEQQBuUdexo5lzvl1Ba3gJK4MigReBoAjwEsCXAkGJwIu4zMVQPbiO239xBz0RELCIhdASEKAEBBxmIawoHsPimXPmhaRT30z3AKj3ifgluc4cR1dmxjcO+nN6rr08vcmLuIuXAJ+Y9wMC5omVTO1Zn+dXvwBYvAPMJ2K+oyuCoyu/E+qaqg5INAYAyMIMS8O7lgrYGoOlAbYG5Flm3yUT3+wN4QtSO5btUnXM1XQ4PhBwdAW2rrQ/vq+kSnWU5gMSPf5VsARZqPaBuaWijtXL09nFbPX56QiWTmGvaTrmakk4PhDqgrfVXxS3JR7VbAWqo6z2iVGcBFrz1eYLAgDrH2CvpTvjBeG0K3cVafF9qqMYmqPAJ+a0rbLK6xdw/8pXl+fN3jMjVtEsLYnJmo7FuRB2Q92HALAssGVqEVfye4mTBZGTIQZlSJy8arzKfvIGKMZ47OFFTMw4AE4HRVSOfjVw1ks9BUPSkZZRIB8iHR+Y00GRKscd8IYAClhaveQmcp3Z+RAAsM5d0HDZaavJs8w2WCp8IYB+6MjOufysPe59N73C/2i5rSt6NkRmcnWm0Dr6BDm+PDpHiTtblTbH3aN/Zc2mjgd350Ok0wvmgsTJo8arLO8J1Vu4Qp4EALRBupEx9hYIHBi4Ie7Hk6Y42/fuPEEnvDz/4Ga92ratk4NPlo1hwCUAX/56vPyTQuspGLL6T0n1qZnRDsZYFQgAA+cSaqs/hyP5MIEtU34A4GfnJ7WOMyP2c4MPiQ8v7rjz74XWAhSwtGj1wGok1IVwrHnsp2ijDdIPL8Wdp5RWG0rcgdLmWK0J574Fu9xdORDPc2UCuLIwgrJgcnJ4eJu06XxfIL5OLXppQjUi4k7EpOng+EZ6BCVsofp0WTH3mFwahFzMQS7h+NIY9/qWewP3ekDYnBye11eELwjVfyONEBARgZj0RT+YLIi5bdKm7aDaoaDak2Gas7RQiKelRftWVaNd24l2VUBCA3QNSKjp8QM4VlWOZVbzrZq7b8yJAJrC4IdLiEFEdNkx9sKzfiF5O0InfjURUWknoqKAqATERKQ6Ag+d6fjt7Tff7QMBEbF10+lJ353Jv7SEWALR0iSiEhAV4QNzeeOIERsarxuyxAcCIqKQEFu3hF72hcm6tBL7nrmdHIOKKld+QGfqx8JINKK9tRTtKtCuAe0q8iyzCi4ydihXJjRyZeFSH4jUGIWI2OyH2LTtXiC9dkQ/tHkcC0W2ME7YfblpbSUbVtsMIVaFaGmrh85sBQC2UL3oLtjbzJWFq4KyoBSA+KeI6PsFd6Tj+B9uJSu5mix9CFm6TKYeI8eYU1S5sslDZwzoWg1bdaEhc84S9TuRNmmT7hNRGUbgPICNDOxQLfvSz3NBun1kapzdPxyWfj+ANgB81zdMbLvctHYOG1bbRGfqqwA0AijtMZcBoIY9eryhx+Nokzbpqbsv+US8zsC+JoCvbqTmeBUb++tskK6lZSknKxgfuRN8pJXxkRbGD1A6x4jCQpEE44RtOZaZgZhYw763/ypEZsLgH5EQ+8wnokUAr4TAzz9IH03LCXF0NcL4yDDGRzTGR1rARxQfGANRsYbVbs2JAIAOtu2EiGilmML4QLQI4BUBfPUxOjO+t7kZALhWRxFZ+kCydJksvTw9ouvr5JXHu++Z0TASxWzk/H35EJmZTk+OlBBrEhEd5APREkqNAvg3b2AV3V6Ydm121+ooJkuv8IG5p6hypedTpWeW0MsjJUSbRMQMn4j010dKWazrn0Fdmz3Ah+Ou1XHVDyT0+sfGhNm3t8nPs2+feJH+eIeIqB1GQPGJUATwVuZ83U4tjxgLwMPROxYd7AsEAB5i084CwA76yxqfiHMh8G1ZIR4wNoDnBtw6+0hfEZlhYK8I4KcL4AMeERrHAj3myJJe9oxIlv6OMHTCx/2JSKeRmoeFwD8jgHf9InJCemAksvQzvPz5rJ+99kcO0kdDBPDfD4E3/SAAD+9HUkezw0UkPd+1/ZFjdEZOLTPdKwLoh8+1rkXO0cUiAfzoEPi4F8R/dVopISTJiDnk5r/4fyn/BmrDD+pUdvB8AAAAAElFTkSuQmCC";let qo=Q("idle"),El=Q(ct([])),_l=Q(ct([])),md=Q(!1),gd;async function $1(){T(qo,"checking");try{const t=await XN();T(El,[...t.errors],!0),T(_l,[...t.warnings],!0),T(qo,"done")}catch{T(qo,"error")}}const Sn={get status(){return u(qo)},get errors(){return u(El)},get warnings(){return u(_l)},get count(){return u(El).length+u(_l).length},get hasProblems(){return u(qo)==="done"&&u(El).length+u(_l).length>0},get panelOpen(){return u(md)},refresh(){return clearTimeout(gd),$1()},scheduleRefresh(t=1200){clearTimeout(gd),gd=setTimeout(()=>void $1(),t)},openPanel(){T(md,!0)},closePanel(){T(md,!1)}};var C5=z('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),L5=z('<button type="button" class="problems svelte-jz8lnl"> </button>'),O5=z('<footer><div class="credit svelte-jz8lnl"><img class="logo svelte-jz8lnl" alt="" width="20" height="20"/> <span>nanoesis by <a target="_blank" rel="noopener noreferrer" class="svelte-jz8lnl">xtrable ltd</a></span></div> <div aria-live="polite"><span> </span> <!></div> <!> <a class="xtrable svelte-jz8lnl" target="_blank" rel="noopener noreferrer" aria-label="xtrable ltd"><img alt="xtrable" width="24" height="24" class="svelte-jz8lnl"/></a></footer>');function x5(t,e){at(e,!0);const n=_e(()=>Fs.state==="saving"?"Saving…":Fs.state==="error"?"Save failed":"Saved");Rt(()=>{kh.value,Sn.scheduleRefresh()});const r=_e(()=>Sn.count),s="https://xtrable.com/";var a=O5();let i;var o=y(a),l=y(o),d=C(l,2),f=C(y(d));Ee(f,"href",s);var g=C(o,2);let h;var p=y(g),v=y(p),_=C(p,2);{var E=B=>{var J=C5();ie("click",J,()=>Fs.retry()),F(B,J)};ce(_,B=>{Fs.canRetry&&B(E)})}var b=C(g,2);{var x=B=>{var J=L5(),H=y(J);re(()=>ae(H,`${u(r)??""}
126
+ ${u(r)===1?"problem":"problems"}`)),ie("click",J,()=>Sn.openPanel()),F(B,J)};ce(b,B=>{Sn.hasProblems&&B(x)})}var O=C(b,2);Ee(O,"href",s);var M=y(O);re(()=>{i=Ve(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":Sn.hasProblems}),Ee(l,"src",Gb),h=Ve(g,1,"save svelte-jz8lnl",null,h,{error:Fs.state==="error"}),ae(v,u(n)),Ee(M,"src",I5)}),F(t,a),it()}Tt(["click"]);var R5=z("<option> </option>"),D5=z("<option>Top level</option>"),k5=z("<option> </option>"),P5=z('<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Move</h3> <div class="manage svelte-1uvxo8j"><label class="grow svelte-1uvxo8j"><span class="visually-hidden svelte-1uvxo8j">Move to folder</span> <select class="svelte-1uvxo8j"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-1uvxo8j">Move</button></div></div>'),M5=z(`<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Manage folder</h3> <div class="manage svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">New subfolder…</button> <button type="button" class="ghost svelte-1uvxo8j">Change URL…</button> <button type="button" class="ghost danger svelte-1uvxo8j">Delete folder…</button></div> <p class="help svelte-1uvxo8j">“Change URL” renames this folder’s slug (its address). Its name in the tree is its section
127
+ page’s title.</p></div>`),B5=z('<p class="error svelte-1uvxo8j" role="alert"> </p>'),F5=z('<dialog aria-label="Folder settings" class="svelte-1uvxo8j"><form><h2 class="svelte-1uvxo8j">Folder settings</h2> <p class="path svelte-1uvxo8j"> </p> <label class="svelte-1uvxo8j"><span class="svelte-1uvxo8j">Default template</span> <select class="svelte-1uvxo8j"><option>(none, items must set their own)</option><!></select> <span class="help svelte-1uvxo8j">New items here inherit this template unless they pick their own. Stored in the folder’s <code>_sort.json</code>.</span></label> <!> <!> <!> <div class="actions svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">Cancel</button> <button type="submit" class="primary svelte-1uvxo8j">Save</button></div></form></dialog>');function U5(t,e){at(e,!0);const n=Vn(e,"folders",19,()=>[]);let r=Q(""),s=Q(!0),a=Q(null),i;const o=_e(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),l=_e(()=>n().filter(w=>w!==e.folderPath&&w!==u(o)&&!w.startsWith(`${e.folderPath}/`))),d=" ";let f=Q(d);Za(()=>{i.showModal(),d6(e.folderPath).then(w=>{T(r,w,!0)}).finally(()=>{T(s,!1)})});async function g(w){w.preventDefault(),T(a,null);try{await f6(e.folderPath,u(r)),e.onsaved()}catch(S){T(a,S instanceof Error?S.message:String(S),!0)}}var h=F5(),p=y(h),v=C(y(p),2),_=y(v),E=C(v,2),b=C(y(E),2),x=y(b);x.value=x.__value="";var O=C(x);St(O,16,()=>e.templates,w=>w,(w,S)=>{var R=R5(),k=y(R),W={};re(()=>{ae(k,S),W!==(W=S)&&(R.value=(R.__value=S)??"")}),F(w,R)});var M=C(E,2);{var B=w=>{var S=P5(),R=C(y(S),2),k=y(R),W=C(y(k),2),$=y(W);$.value=$.__value=d;var Y=C($);{var U=fe=>{var me=D5();me.value=me.__value="",F(fe,me)};ce(Y,fe=>{u(o)!==""&&fe(U)})}var K=C(Y);St(K,16,()=>u(l),fe=>fe,(fe,me)=>{var ge=k5(),Le=y(ge),de={};re(()=>{ae(Le,`${me??""}/`),de!==(de=me)&&(ge.value=(ge.__value=me)??"")}),F(fe,ge)});var te=C(k,2);re(()=>te.disabled=u(f)===d),Ya(W,()=>u(f),fe=>T(f,fe)),ie("click",te,()=>e.onmove(u(f))),F(w,S)};ce(M,w=>{e.onmove&&w(B)})}var J=C(M,2);{var H=w=>{var S=M5(),R=C(y(S),2),k=y(R),W=C(k,2),$=C(W,2);ie("click",k,function(...Y){var U;(U=e.onnewsubfolder)==null||U.apply(this,Y)}),ie("click",W,function(...Y){var U;(U=e.onrenamefolder)==null||U.apply(this,Y)}),ie("click",$,function(...Y){var U;(U=e.ondeletefolder)==null||U.apply(this,Y)}),F(w,S)};ce(J,w=>{e.folderPath!==""&&w(H)})}var G=C(J,2);{var X=w=>{var S=B5(),R=y(S);re(()=>ae(R,u(a))),F(w,S)};ce(G,w=>{u(a)&&w(X)})}var ee=C(G,2),A=y(ee),j=C(A,2);mn(h,w=>i=w,()=>i),re(()=>{ae(_,e.folderPath===""?"/ (root)":`${e.folderPath}/`),b.disabled=u(s),j.disabled=u(s)}),He("cancel",h,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("close",h,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("submit",p,g),Ya(b,()=>u(r),w=>T(r,w)),ie("click",A,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),F(t,h),it()}Tt(["click"]);var H5=z("<option></option>"),q5=z("<option> </option>"),j5=z('<p class="error svelte-1t0ew8l" role="alert"> </p>'),$5=z('<dialog aria-label="New content item" class="svelte-1t0ew8l"><form><h2 class="svelte-1t0ew8l">New content item</h2> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Title</span> <input required="" class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Slug</span> <input class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Folder</span> <input list="folder-options" placeholder="/ (root), or type a new folder" class="svelte-1t0ew8l"/> <datalist id="folder-options"></datalist> <span class="help svelte-1t0ew8l">Pick an existing folder or type a new path to create it.</span></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Template</span> <select class="svelte-1t0ew8l"><option>Inherit the folder’s default</option><!></select> <span class="help svelte-1t0ew8l">A folder’s default is set in its folder settings (the gear button in the tree).</span></label> <!> <div class="actions svelte-1t0ew8l"><button type="button" class="ghost svelte-1t0ew8l">Cancel</button> <button type="submit" class="primary svelte-1t0ew8l">Create</button></div></form></dialog>');function Y5(t,e){at(e,!0);const n=Vn(e,"initialFolder",3,"");let r=Q(""),s=Q(""),a=Q(""),i=Q("");Rt(()=>{T(a,n())});let o=!1,l=Q(null),d;Za(()=>d.showModal());function f(){o||T(s,_s(u(r)),!0)}async function g(w){w.preventDefault(),T(l,null);const S=_s(u(s)||u(r));if(S===""){T(l,"A title or slug is required.");return}const R=u(a).split("/").map(W=>_s(W)).filter(W=>W!=="").join("/"),k=R===""?S:`${R}/${S}`;try{await Av(k,u(r).trim()||S,u(i)),e.oncreated(k)}catch(W){T(l,W instanceof Error?W.message:String(W),!0)}}var h=$5(),p=y(h),v=C(y(p),2),_=C(y(v),2);$a(_,!0);var E=C(v,2),b=C(y(E),2),x=C(E,2),O=C(y(x),2),M=C(O,2);St(M,20,()=>e.folders,w=>w,(w,S)=>{var R=H5(),k={};re(()=>{k!==(k=S)&&(R.value=(R.__value=S)??"")}),F(w,R)});var B=C(x,2),J=C(y(B),2),H=y(J);H.value=H.__value="";var G=C(H);St(G,16,()=>e.templates,w=>w,(w,S)=>{var R=q5(),k=y(R),W={};re(()=>{ae(k,S),W!==(W=S)&&(R.value=(R.__value=S)??"")}),F(w,R)});var X=C(B,2);{var ee=w=>{var S=j5(),R=y(S);re(()=>ae(R,u(l))),F(w,S)};ce(X,w=>{u(l)&&w(ee)})}var A=C(X,2),j=y(A);mn(h,w=>d=w,()=>d),re(w=>Ee(b,"placeholder",w),[()=>_s(u(r))||"my-item"]),He("cancel",h,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("close",h,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),He("submit",p,g),ie("input",_,f),wt(_,()=>u(r),w=>T(r,w)),ie("input",b,()=>o=!0),wt(b,()=>u(s),w=>T(s,w)),wt(O,()=>u(a),w=>T(a,w)),Ya(J,()=>u(i),w=>T(i,w)),ie("click",j,function(...w){var S;(S=e.oncancel)==null||S.apply(this,w)}),F(t,h),it()}Tt(["input","click"]);function Qf(t){let e=!1;return t.map(n=>n.status==="done"?n:e?{...n,status:"pending"}:(e=!0,{...n,status:"active"}))}function Kb(t){return t.map(e=>({...e,status:"pending"}))}function Y1(t){return t.map(e=>({...e,status:"done"}))}function rl(t){return{phase:"validating",resources:Qf(Kb((t==null?void 0:t.resources)??[])),done:0,total:(t==null?void 0:t.resources.length)??0,uploaded:0,uploadTotal:0}}function sl(t,e){switch(e.phase){case"validate":return{...t,phase:"validating"};case"plan":{const n=Qf(Kb(e.plan.resources));return{...t,phase:"building",resources:n,done:0,total:e.plan.resources.length}}case"resource":{const n=t.resources.map(r=>r.id===e.resource.id?{...r,status:"done"}:r);return{...t,phase:"building",resources:Qf(n),done:e.done,total:e.total}}case"upload":return{...t,phase:"uploading",resources:Y1(t.resources),done:t.total,uploaded:e.written,uploadTotal:e.total};case"purge":return{...t,phase:"purging"};case"done":return{...t,phase:"done",resources:Y1(t.resources),done:t.total,written:e.written,...e.summary!==void 0&&{summary:e.summary}};case"blocked":return{...t,phase:"blocked",errors:e.errors};case"error":return{...t,phase:"error",message:e.message}}}function z5(t){switch(t.phase){case"validating":return .02;case"building":return .05+.78*(t.total===0?1:t.done/t.total);case"uploading":return .83+.15*(t.uploadTotal===0?1:t.uploaded/t.uploadTotal);case"purging":return .99;case"done":return 1;case"blocked":case"error":return t.total===0?0:t.done/t.total}}const W5=t=>new Promise(e=>setTimeout(e,t)),G5=250;function K5(){let t=Q(!1),e=Q(!1),n=Q(ct(rl())),r=Q(0),s,a=0;const i=()=>u(n).phase==="done"||u(n).phase==="blocked"||u(n).phase==="error";function o(){const d=z5(u(n))*100,f=i(),g=(performance.now()-a)/1e3,h=8+62*(1-Math.exp(-g/5)),p=f?u(n).phase==="done"?100:d:Math.max(d,h);T(r,u(r)+(p-u(r))*.12),Math.abs(p-u(r))<.2&&T(r,p,!0);const v=f&&u(r)===p;s=u(t)&&!v?requestAnimationFrame(o):void 0}const l=83;return{get active(){return u(t)},get running(){return u(e)},get state(){return u(n)},get percent(){return Math.round(u(r))},get shownDone(){const d=u(n).total;if(d===0)return 0;if(u(n).phase==="done")return d;const f=Math.floor(u(r)/l*d);return Math.max(0,Math.min(d-1,Math.max(u(n).done,f)))},async start(){if(!u(e)){T(t,!0),T(e,!0),a=performance.now(),T(r,0),T(n,rl(),!0),s===void 0&&(s=requestAnimationFrame(o));try{T(n,rl(await QN()),!0);let d=0,f=!0;const g=async()=>{const _=await JN(d);for(const E of _.events)T(n,sl(u(n),E),!0);return d=_.total,_.running},p=(async()=>{for(;f;){try{if(!await g()&&d>0)break}catch{}await W5(G5)}})(),v=await ZN();f=!1,await p.catch(()=>{});try{await g()}catch{}i()||T(n,v.ok?sl(u(n),{phase:"done",written:v.written,...v.summary!==void 0&&{summary:v.summary}}):sl(u(n),{phase:"blocked",errors:v.errors}),!0)}catch(d){const f=d instanceof Error?d.message:String(d);T(n,sl(u(n),{phase:"error",message:f}),!0)}finally{T(e,!1),s===void 0&&(s=requestAnimationFrame(o))}}},close(){u(e)||(T(t,!1),s!==void 0&&(cancelAnimationFrame(s),s=void 0),T(n,rl(),!0),T(r,0))}}}const Es=K5();var V5=z('<div class="bar-row svelte-1o0yh0y"><div class="bar svelte-1o0yh0y" role="progressbar" aria-label="Publish progress"><div></div></div> <span class="pct svelte-1o0yh0y" aria-hidden="true"> </span></div> <p class="sr-only svelte-1o0yh0y" aria-live="polite"> </p>',1),X5=z('<li class="svelte-1o0yh0y"> </li>'),Q5=z('<div class="panel blocked-panel svelte-1o0yh0y"><p class="panel-lead svelte-1o0yh0y">Fix these, then publish again:</p> <ul class="errors svelte-1o0yh0y"></ul></div>'),Z5=z('<div class="panel error-panel svelte-1o0yh0y"><p class="svelte-1o0yh0y"> </p></div>'),J5=z('<span class="spinner svelte-1o0yh0y"></span>'),ex=z('<span class="pending-dot svelte-1o0yh0y"></span>'),tx=z('<li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span> <span class="sr-only svelte-1o0yh0y"> </span></li>'),nx=z('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y"> </span> <span class="group-count svelte-1o0yh0y"> </span></div> <ul class="rows svelte-1o0yh0y"></ul></div>'),rx=z('<span class="group-count svelte-1o0yh0y"> </span>'),sx=z('<span class="spinner svelte-1o0yh0y"></span>'),ax=z('<span class="pending-dot svelte-1o0yh0y"></span>'),ix=z('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y">Upload</span> <!></div> <ul class="rows svelte-1o0yh0y"><li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span></li></ul></div>'),ox=z('<div class="timeline svelte-1o0yh0y" aria-label="Resources"><!> <!></div>'),ux=z('<p class="note warn svelte-1o0yh0y"> </p>'),lx=z('<p class="note svelte-1o0yh0y"> </p>'),cx=z('<button type="button" class="ghost svelte-1o0yh0y" disabled="">Publishing…</button>'),dx=z('<button type="button" class="primary svelte-1o0yh0y"> </button>'),fx=z('<section class="publish svelte-1o0yh0y" aria-label="Publishing"><div class="card svelte-1o0yh0y"><header><div class="badge svelte-1o0yh0y" aria-hidden="true"><!></div> <div class="head-text svelte-1o0yh0y"><h1 class="svelte-1o0yh0y"> </h1> <p class="caption svelte-1o0yh0y" aria-live="polite"> </p></div></header> <!> <!> <!> <footer class="actions svelte-1o0yh0y"><!></footer></div></section>');function hx(t,e){at(e,!0);const n=_e(()=>Es.state),r=_e(()=>Es.percent),s=_e(()=>u(n).phase==="error"),a=_e(()=>u(n).phase==="blocked"),i=_e(()=>u(n).phase==="done"),o=_e(()=>{var se;return u(i)&&((se=u(n).summary)==null?void 0:se.published)===0}),l=_e(()=>Es.shownDone),d=_e(()=>u(n).resources.map((se,he)=>{const Ae=he<u(l)?"done":he===u(l)&&!u(i)?"active":"pending";return{...se,status:Ae}})),f={image:J6,file:Z6,page:ew},g={image:"Images",file:"Files",page:"Pages"},h=_e(()=>["image","file","page"].map(he=>{const Ae=u(d).filter(Me=>Me.kind===he),Ce=Ae.filter(Me=>Me.status==="done").length;return{kind:he,label:g[he],icon:f[he],items:Ae,done:Ce}}).filter(he=>he.items.length>0)),p=_e(()=>{var se;return(se=u(d).find(he=>he.status==="active"))==null?void 0:se.kind}),v=_e(()=>u(i)||u(a)||u(s)?u(n).phase:u(n).phase==="uploading"||u(r)>=83?"uploading":u(n).phase==="purging"?"purging":u(l)>0||u(r)>12?"building":"validating"),_=_e(()=>{switch(u(v)){case"validating":return"Checking your content…";case"building":return u(p)==="image"?"Optimising images…":u(p)==="file"?"Copying files…":"Rendering pages…";case"uploading":return"Uploading to your live site…";case"purging":return"Refreshing the CDN…";case"done":return u(o)?"No pages were published.":"Your changes are live.";case"blocked":case"error":return"Nothing was published, your live site is unchanged."}}),E=_e(()=>{var se,he;if(u(s))return"Publish failed";if(u(a)){const Ae=((se=u(n).errors)==null?void 0:se.length)??0;return`${Ae} ${Ae===1?"thing":"things"} would break`}if(u(o))return"Nothing went live";if(u(i)){const Ae=((he=u(n).summary)==null?void 0:he.published)??0;return Ae>0?`Published ${Ae} ${Ae===1?"page":"pages"}`:`Published ${u(n).written??0} ${u(n).written===1?"file":"files"}`}return"Publishing your site"}),b=_e(()=>`${u(E)}. ${u(_)}`);function x(se){return se.status==="done"?"done":se.status==="active"?"in progress":"waiting"}var O=fx(),M=y(O),B=y(M);let J;var H=y(B),G=y(H);{var X=se=>{rw(se,{size:22})},ee=se=>{nw(se,{size:22})},A=se=>{tw(se,{size:22})};ce(G,se=>{u(s)||u(a)?se(X):u(i)?se(ee,1):se(A,-1)})}var j=C(H,2),w=y(j),S=y(w),R=C(w,2),k=y(R),W=C(B,2);{var $=se=>{var he=V5(),Ae=tt(he),Ce=y(Ae);Ee(Ce,"aria-valuemin",0),Ee(Ce,"aria-valuemax",100);var Me=y(Ce);let ke;var dt=C(Ce,2),Be=y(dt),It=C(Ae,2),Dt=y(It);re(()=>{Ee(Ce,"aria-valuenow",u(r)),ke=Ve(Me,1,"fill svelte-1o0yh0y",null,ke,{done:u(i)}),Jl(Me,`width: ${u(r)}%`),ae(Be,`${u(r)??""}%`),ae(Dt,u(b))}),F(se,he)};ce(W,se=>{!u(a)&&!u(s)&&se($)})}var Y=C(W,2);{var U=se=>{var he=Q5(),Ae=C(y(he),2);St(Ae,20,()=>u(n).errors??[],Ce=>Ce,(Ce,Me)=>{var ke=X5(),dt=y(ke);re(()=>ae(dt,Me)),F(Ce,ke)}),F(se,he)},K=se=>{var he=Z5(),Ae=y(he),Ce=y(Ae);re(()=>ae(Ce,u(n).message)),F(se,he)},te=se=>{var he=ox(),Ae=y(he);St(Ae,17,()=>u(h),ke=>ke.kind,(ke,dt)=>{var Be=nx(),It=y(Be),Dt=y(It);kd(Dt,()=>u(dt).icon,(Gt,Mt)=>{Mt(Gt,{size:15,"aria-hidden":"true"})});var Lt=C(Dt,2),ft=y(Lt),Vt=C(Lt,2),qt=y(Vt),Pt=C(It,2);St(Pt,21,()=>u(dt).items,Gt=>Gt.id,(Gt,Mt)=>{var mt=tx();let yt;var Bt=y(mt),ot=y(Bt);{var nt=jt=>{kp(jt,{size:13})},bt=jt=>{var en=J5();F(jt,en)},An=jt=>{var en=ex();F(jt,en)};ce(ot,jt=>{u(Mt).status==="done"?jt(nt):u(Mt).status==="active"?jt(bt,1):jt(An,-1)})}var yn=C(Bt,2),ln=y(yn),Zn=C(yn,2),Jn=y(Zn);re(jt=>{yt=Ve(mt,1,"row svelte-1o0yh0y",null,yt,{active:u(Mt).status==="active",done:u(Mt).status==="done"}),Ee(yn,"title",u(Mt).id),ae(ln,u(Mt).label),ae(Jn,jt)},[()=>x(u(Mt))]),F(Gt,mt)}),re(()=>{ae(ft,u(dt).label),ae(qt,`${u(dt).done??""}/${u(dt).items.length??""}`)}),F(ke,Be)});var Ce=C(Ae,2);{var Me=ke=>{var dt=ix(),Be=y(dt),It=y(Be);Q6(It,{size:15,"aria-hidden":"true"});var Dt=C(It,4);{var Lt=nt=>{var bt=rx(),An=y(bt);re(()=>ae(An,`${u(n).uploaded??""}/${u(n).uploadTotal??""}`)),F(nt,bt)};ce(Dt,nt=>{u(n).uploadTotal>0&&nt(Lt)})}var ft=C(Be,2),Vt=y(ft);let qt;var Pt=y(Vt),Gt=y(Pt);{var Mt=nt=>{kp(nt,{size:13})},mt=nt=>{var bt=sx();F(nt,bt)},yt=nt=>{var bt=ax();F(nt,bt)};ce(Gt,nt=>{u(i)?nt(Mt):u(n).phase==="uploading"?nt(mt,1):nt(yt,-1)})}var Bt=C(Pt,2),ot=y(Bt);re(()=>{qt=Ve(Vt,1,"row svelte-1o0yh0y",null,qt,{active:u(n).phase==="uploading",done:u(i)}),ae(ot,u(i)?`Uploaded ${u(n).written??u(n).uploadTotal} files to the live site`:`Uploading ${u(n).uploadTotal} files…`)}),F(ke,dt)};ce(Ce,ke=>{(u(n).uploadTotal>0||u(n).phase==="uploading"||u(i))&&ke(Me)})}F(se,he)};ce(Y,se=>{u(a)?se(U):u(s)?se(K,1):se(te,-1)})}var fe=C(Y,2);{var me=se=>{var he=ux(),Ae=y(he);re(()=>{var Ce;return ae(Ae,((Ce=u(n).summary)==null?void 0:Ce.firstPublishWarning)??"Your site has no published pages. Toggle Publish on at least one page to go live.")}),F(se,he)},ge=se=>{var he=lx(),Ae=y(he);re(()=>{var Ce,Me;return ae(Ae,`${((Ce=u(n).summary)==null?void 0:Ce.drafts)??""}
128
+ ${((Me=u(n).summary)==null?void 0:Me.drafts)===1?"draft was":"drafts were"} skipped.`)}),F(se,he)};ce(fe,se=>{var he;u(i)&&u(o)?se(me):u(i)&&(((he=u(n).summary)==null?void 0:he.drafts)??0)>0&&se(ge,1)})}var Le=C(fe,2),de=y(Le);{var ve=se=>{var he=cx();F(se,he)},Ie=se=>{var he=dx(),Ae=y(he);re(()=>ae(Ae,u(i)?"Done":"Back to editing")),ie("click",he,()=>Es.close()),F(se,he)};ce(de,se=>{Es.running?se(ve):se(Ie,-1)})}re(()=>{J=Ve(B,1,"head svelte-1o0yh0y",null,J,{error:u(s),blocked:u(a),done:u(i)&&!u(o)}),ae(S,u(E)),ae(k,u(_))}),F(t,O),it()}Tt(["click"]);var px=z("<option> </option>"),mx=z(`<div class="empty svelte-y9gf4p"><div class="card svelte-y9gf4p"><h1 class="svelte-y9gf4p"> </h1> <p class="svelte-y9gf4p">This section has no page yet, the page visitors see at <code class="svelte-y9gf4p"> </code>. Pick a template (a
129
+ listing template loops over this section's items) and create it.</p> <label class="svelte-y9gf4p"><span class="svelte-y9gf4p">Template</span> <select class="svelte-y9gf4p"><option>Inherit the folder’s default</option><!></select></label> <button type="button" class="primary svelte-y9gf4p"> </button></div></div>`);function gx(t,e){at(e,!0);const n=_e(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=Q(""),s=Q(!1);function a(){T(s,!0),e.oncreate(u(r))}var i=mx(),o=y(i),l=y(o),d=y(l),f=C(l,2),g=C(y(f)),h=y(g),p=C(f,2),v=C(y(p),2),_=y(v);_.value=_.__value="";var E=C(_);St(E,16,()=>e.templates,O=>O,(O,M)=>{var B=px(),J=y(B),H={};re(()=>{ae(J,M),H!==(H=M)&&(B.value=(B.__value=M)??"")}),F(O,B)});var b=C(p,2),x=y(b);re(()=>{ae(d,e.name),ae(h,u(n)),v.disabled=u(s),b.disabled=u(s),ae(x,u(s)?"Creating…":"Create page")}),Ya(v,()=>u(r),O=>T(r,O)),ie("click",b,a),F(t,i),it()}Tt(["click"]);const Vb="nanoesis:sidebar-width",vx=180,bx=560,Ex=260;function Xb(t){return Math.min(bx,Math.max(vx,Math.round(t)))}function _x(){const t=Number(localStorage.getItem(Vb));return Number.isFinite(t)&&t>0?Xb(t):Ex}let $l=_x();function Qb(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${$l}px`)}Qb();function Tx(){return $l}function Ax(t){$l=Xb(t),Qb(),localStorage.setItem(Vb,String($l))}var yx=z('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function Nx(t,e){at(e,!0);let n=Q(null);function r(l){l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),T(n,{startX:l.clientX,startWidth:Tx()},!0)}function s(l){u(n)!==null&&Ax(u(n).startWidth+(l.clientX-u(n).startX))}function a(l){var d,f;u(n)!==null&&((f=(d=l.currentTarget).releasePointerCapture)==null||f.call(d,l.pointerId),T(n,null))}var i=yx();let o;re(()=>o=Ve(i,1,"resizer svelte-1jo2gqq",null,o,{dragging:u(n)!==null})),ie("pointerdown",i,r),ie("pointermove",i,s),ie("pointerup",i,a),He("pointercancel",i,a),F(t,i),it()}Tt(["pointerdown","pointermove","pointerup"]);const Zb={"content-type":"application/json"};async function wx(){const t=await Ge("/api/migrations");if(!t.ok)throw new Error(`Failed to load migrations (HTTP ${t.status}).`);return await t.json()}async function zk(t){const e=await Ge(`/api/migrations/preview?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load migration preview (HTTP ${e.status}).`);return await e.json()}async function Wk(t,e){const n=await Ge("/api/migrations/apply",{method:"POST",headers:Zb,body:JSON.stringify({path:t,resolution:e})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error??`Migration failed (HTTP ${n.status}).`)}return await n.json()}async function Gk(t,e){const n=await Ge("/api/templates/stamp",{method:"POST",headers:Zb,body:JSON.stringify({name:t,kind:e})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Stamp failed (HTTP ${n.status}).`)}return await n.json()}function Sx(){let t=Q(0),e=Q(null),n=Q(!1),r=Q(null),s=!1;async function a(){T(n,!0),T(r,null);try{const i=await wx();T(e,i,!0),T(t,i.items.length,!0),s=!0}catch(i){T(r,i instanceof Error?i.message:String(i),!0)}finally{T(n,!1)}}return{get count(){return u(t)},get list(){return u(e)},get loading(){return u(n)},get error(){return u(r)},async ensureLoaded(){s||u(n)||await a()},refresh:a}}const al=Sx();var Ix=z(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),Cx=z('<p class="error svelte-fna247" role="alert"> </p>'),Lx=z('<p class="success svelte-fna247" role="status">Password updated.</p>'),Ox=z('<dialog aria-label="Change password" class="svelte-fna247"><h2 class="svelte-fna247">Change password</h2> <p class="lede svelte-fna247">You stay signed in here. Other sessions of yours (other devices, other tabs) are signed out.</p> <form class="svelte-fna247"><label class="svelte-fna247"><span class="svelte-fna247">Current password</span> <input type="password" autocomplete="current-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">New password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">Confirm new password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/> <!></label> <!> <!> <div class="actions svelte-fna247"><button type="button" class="ghost svelte-fna247">Cancel</button> <button type="submit" class="primary svelte-fna247"> </button></div></form></dialog>');function xx(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q(""),a=Q(""),i=Q(""),o=Q(!1),l=Q(null),d=Q(!1);Rt(()=>{u(r)&&(n()&&!u(r).open?(T(s,""),T(a,""),T(i,""),T(l,null),T(d,!1),T(o,!1),u(r).showModal()):!n()&&u(r).open&&u(r).close())});let f=_e(()=>u(a)!==""&&u(i)!==""&&u(a)!==u(i)),g=_e(()=>!u(o)&&u(s)!==""&&u(a)!==""&&!u(f));async function h(k){if(k.preventDefault(),!u(g))return;T(o,!0),T(l,null);const W=await pt.changePassword(u(s),u(a));if(T(o,!1),!W.ok){const $=W.error??"Password change failed.";T(l,$.includes("credentials")?"Current password is incorrect.":$,!0);return}T(d,!0),setTimeout(()=>{n(!1)},900)}function p(k){k.preventDefault(),n(!1)}var v=Ox(),_=C(y(v),4),E=y(_),b=C(y(E),2),x=C(E,2),O=C(y(x),2),M=C(x,2),B=C(y(M),2),J=C(B,2);{var H=k=>{var W=Ix();F(k,W)};ce(J,k=>{u(f)&&k(H)})}var G=C(M,2);{var X=k=>{var W=Cx(),$=y(W);re(()=>ae($,u(l))),F(k,W)};ce(G,k=>{u(l)&&k(X)})}var ee=C(G,2);{var A=k=>{var W=Lx();F(k,W)};ce(ee,k=>{u(d)&&k(A)})}var j=C(ee,2),w=y(j),S=C(w,2),R=y(S);mn(v,k=>T(r,k),()=>u(r)),re(()=>{S.disabled=!u(g),ae(R,u(o)?"Updating…":"Update password")}),He("cancel",v,p),He("submit",_,h),wt(b,()=>u(s),k=>T(s,k)),wt(O,()=>u(a),k=>T(a,k)),wt(B,()=>u(i),k=>T(i,k)),ie("click",w,()=>n(!1)),F(t,v),it()}Tt(["click"]);var Rx=z(`<label class="svelte-szf2lz"><span class="svelte-szf2lz"> </span> <textarea readonly="" rows="3" class="svelte-szf2lz"></textarea></label> <p class="warn svelte-szf2lz" role="status">Copy it now, you won't be able to see it again.</p> <div class="actions svelte-szf2lz"><button type="button" class="ghost svelte-szf2lz">Done</button> <button type="button" class="primary svelte-szf2lz"> </button></div>`,1),Dx=z('<p class="error svelte-szf2lz" role="alert"> </p>'),kx=z('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),Px=z('<!> <!> <div class="actions svelte-szf2lz"><button type="button" class="danger svelte-szf2lz">Revoke all</button> <span class="spacer svelte-szf2lz"></span> <button type="button" class="ghost svelte-szf2lz">Cancel</button> <button type="button" class="primary svelte-szf2lz"> </button></div>',1),Mx=z(`<dialog aria-label="MCP access token" class="svelte-szf2lz"><h2 class="svelte-szf2lz">MCP access token</h2> <p class="lede svelte-szf2lz">A token lets an AI client (through the MCP server) read and edit this site as you, with your
130
130
  role. Paste it into your client's config as a Bearer token. It keeps working after you sign out,
131
- so treat it like a password.</p> <!></dialog>`);function Bx(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q(!1),a=Q(null),i=Q(null),o=Q(null),l=Q(!1),d=Q(!1);Rt(()=>{u(r)&&(n()&&!u(r).open?(T(s,!1),T(a,null),T(i,null),T(o,null),T(l,!1),T(d,!1),u(r).showModal()):!n()&&u(r).open&&u(r).close())});let h=_e(()=>u(o)===null?"":new Date(u(o)).toLocaleDateString());async function g(){T(s,!0),T(a,null),T(d,!1),T(l,!1);const B=await pt.createMcpToken();if(T(s,!1),!B.ok||B.token===void 0){T(a,B.error??"Could not create a token.",!0);return}T(i,B.token,!0),T(o,B.expiresAt??null,!0)}async function f(){if(u(i)!==null)try{await navigator.clipboard.writeText(u(i)),T(l,!0)}catch{T(l,!1)}}async function p(){T(s,!0),T(a,null);const B=await pt.revokeMcpTokens();if(T(s,!1),!B.ok){T(a,B.error??"Could not revoke tokens.",!0);return}T(i,null),T(o,null),T(d,!0)}function v(B){var M;(M=B.currentTarget)==null||M.select()}function b(B){B.preventDefault(),n(!1)}var E=Mx(),_=C(y(E),4);{var R=B=>{var M=Rx(),J=tt(M),H=y(J),G=y(H),X=C(H,2),ee=C(J,4),A=y(ee),j=C(A,2),w=y(j);re(()=>{ae(G,`Your new token${u(h)?` · expires ${u(h)}`:""}`),Z_(X,u(i)),ae(w,u(l)?"Copied":"Copy token")}),ie("click",X,v),ie("click",A,()=>n(!1)),ie("click",j,f),F(B,M)},O=B=>{var M=Px(),J=tt(M);{var H=x=>{var k=Dx(),W=y(k);re(()=>ae(W,u(a))),F(x,k)};ce(J,x=>{u(a)&&x(H)})}var G=C(J,2);{var X=x=>{var k=kx();F(x,k)};ce(G,x=>{u(d)&&x(X)})}var ee=C(G,2),A=y(ee),j=C(A,4),w=C(j,2),S=y(w);re(()=>{A.disabled=u(s),w.disabled=u(s),ae(S,u(s)?"Working…":"Create token")}),ie("click",A,p),ie("click",j,()=>n(!1)),ie("click",w,g),F(B,M)};ce(_,B=>{u(i)!==null?B(R):B(O,-1)})}mn(E,B=>T(r,B),()=>u(r)),He("cancel",E,b),F(t,E),it()}Tt(["click"]);var Fx=z('<details class="menu svelte-1y2gtaj"><summary aria-label="Account menu" class="svelte-1y2gtaj"><span class="label svelte-1y2gtaj"> </span> <span class="caret svelte-1y2gtaj" aria-hidden="true">▾</span></summary> <ul role="menu" class="svelte-1y2gtaj"><li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Change password…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">MCP access token…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Log out</button></li></ul></details> <!> <!>',1);function Ux(t,e){at(e,!0);let n=Q(!1),r=Q(!1),s=_e(()=>{var p;return((p=pt.principal)==null?void 0:p.username)??""});function a(){u(d)&&(u(d).open=!1)}function i(){a(),T(n,!0)}function o(){a(),T(r,!0)}async function l(){a(),await pt.logout()}let d=Q(void 0);Rt(()=>{function p(v){u(d)&&u(d).open&&!u(d).contains(v.target)&&(u(d).open=!1)}return document.addEventListener("click",p),()=>document.removeEventListener("click",p)});var h=Kn(),g=tt(h);{var f=p=>{var v=Fx(),b=tt(v),E=y(b),_=y(E),R=y(_),O=C(E,2),B=y(O),M=y(B),J=C(B,2),H=y(J),G=C(J,2),X=y(G);mn(b,j=>T(d,j),()=>u(d));var ee=C(b,2);xx(ee,{get open(){return u(n)},set open(j){T(n,j,!0)}});var A=C(ee,2);Bx(A,{get open(){return u(r)},set open(j){T(r,j,!0)}}),re(()=>ae(R,u(s))),ie("click",M,i),ie("click",H,o),ie("click",X,l),F(p,v)};ce(g,p=>{pt.status==="authenticated"&&pt.principal!==null&&p(f)})}F(t,h),it()}Tt(["click"]);var Hx=z('<p class="error svelte-1e3birj" role="alert"> </p>'),qx=z('<p class="ok svelte-1e3birj" role="status"> </p>'),jx=z('<img alt="Current logo" class="svelte-1e3birj"/>'),$x=z('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),Yx=z('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),zx=z(`<div class="panel svelte-1e3birj"><p class="lede svelte-1e3birj">Replace the editor's top-left logo and name with your own. Leave the name blank to use the
132
- built-in brand. (The footer credit stays.)</p> <!> <!> <section class="field svelte-1e3birj"><label for="brand-name" class="svelte-1e3birj">Name</label> <div class="row svelte-1e3birj"><input id="brand-name" type="text" placeholder="nanoesis" class="svelte-1e3birj"/> <button type="button" class="primary svelte-1e3birj"> </button></div></section> <section class="field svelte-1e3birj"><span class="field-label svelte-1e3birj">Logo</span> <div class="logo-row svelte-1e3birj"><div class="preview svelte-1e3birj"><!></div> <div class="logo-actions svelte-1e3birj"><input type="file" accept="image/*" class="visually-hidden svelte-1e3birj"/> <button type="button" class="ghost svelte-1e3birj"> </button> <!></div></div> <small class="svelte-1e3birj">PNG, SVG, or any image, up to 1 MB.</small></section></div>`);function Wx(t,e){at(e,!0);let n=Q(ct(Dn.name??"")),r=Q(!1),s=Q(!1),a=Q(null),i=Q(null),o=Q(void 0);function l($){T(i,$,!0),setTimeout(()=>T(i,null),1500)}async function d(){T(r,!0),T(a,null);const $=u(n).trim(),Y=await f3($===""?null:$);if(T(r,!1),!Y.ok){T(a,Y.error,!0);return}await Dn.load(),l("Name saved.")}async function h($){var te;const Y=$.currentTarget,U=(te=Y.files)==null?void 0:te[0];if(U===void 0)return;T(s,!0),T(a,null);const K=await h3(U);if(T(s,!1),Y.value="",!K.ok){T(a,K.error,!0);return}await Dn.load(),l("Logo updated.")}async function g(){T(a,null);const $=await p3();if(!$.ok){T(a,$.error,!0);return}await Dn.load(),l("Logo removed.")}var f=zx(),p=C(y(f),2);{var v=$=>{var Y=Hx(),U=y(Y);re(()=>ae(U,u(a))),F($,Y)};ce(p,$=>{u(a)&&$(v)})}var b=C(p,2);{var E=$=>{var Y=qx(),U=y(Y);re(()=>ae(U,u(i))),F($,Y)};ce(b,$=>{u(i)&&$(E)})}var _=C(b,2),R=C(y(_),2),O=y(R),B=C(O,2),M=y(B),J=C(_,2),H=C(y(J),2),G=y(H),X=y(G);{var ee=$=>{var Y=jx();re(()=>Ee(Y,"src",Dn.logoUrl)),F($,Y)},A=$=>{var Y=$x();F($,Y)};ce(X,$=>{Dn.logoUrl?$(ee):$(A,-1)})}var j=C(G,2),w=y(j);mn(w,$=>T(o,$),()=>u(o));var S=C(w,2),x=y(S),k=C(S,2);{var W=$=>{var Y=Yx();ie("click",Y,g),F($,Y)};ce(k,$=>{Dn.logoUrl&&$(W)})}re(()=>{B.disabled=u(r),ae(M,u(r)?"Saving…":"Save"),Ee(G,"aria-hidden",Dn.logoUrl===null),S.disabled=u(s),ae(x,u(s)?"Uploading…":Dn.logoUrl?"Replace logo…":"Upload logo…")}),wt(O,()=>u(n),$=>T(n,$)),ie("click",B,d),ie("change",w,h),ie("click",S,()=>{var $;return($=u(o))==null?void 0:$.click()}),F(t,f),it()}Tt(["click","change"]);const Gx={"content-type":"application/json"};async function Kx(){const t=await Ge("/api/admin/diagnostics");if(t.status===404)throw new Error("Diagnostics are not available on this host.");if(!t.ok)throw new Error(`Couldn't load diagnostics (HTTP ${t.status}).`);return(await t.json()).findings}async function Vx(t){const e=await Ge("/api/admin/diagnostics/repair",{method:"POST",headers:Gx,body:JSON.stringify({id:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Repair failed (HTTP ${e.status}).`)}return(await e.json()).findings}var Xx=z('<p class="error svelte-1iylrs" role="alert"> </p>'),Qx=z('<p class="error svelte-1iylrs" role="alert"> </p>'),Zx=z('<span class="all-good svelte-1iylrs">All checks passed.</span>'),Jx=z('<span class="chip chip-error svelte-1iylrs"> </span>'),eR=z('<span class="chip chip-warning svelte-1iylrs"> </span>'),tR=z('<span class="chip chip-info svelte-1iylrs"> </span>'),nR=z("<!> <!> <!>",1),rR=z('<div class="finding-actions svelte-1iylrs"><button type="button" class="primary svelte-1iylrs"> </button></div>'),sR=z('<li><div class="finding-head svelte-1iylrs"><span> </span> <h3 class="svelte-1iylrs"> </h3></div> <p class="detail svelte-1iylrs"> </p> <!></li>'),aR=z('<ul class="findings svelte-1iylrs"></ul>'),iR=z(`<div class="panel svelte-1iylrs"><p class="lede svelte-1iylrs">A live check of your installation — what works, and what doesn't. Findings come from
133
- port-agnostic probes, so they catch problems regardless of how your storage and CDN are wired. <strong>Repair</strong> fixes that the engine can apply in place; advisory findings are everything else.</p> <!> <!> <div class="actions-bar svelte-1iylrs"><div class="summary svelte-1iylrs" aria-live="polite"><!></div> <button type="button" class="svelte-1iylrs"> </button></div> <!></div>`);function oR(t,e){at(e,!0);let n=Q(!0),r=Q(null),s=Q(ct([])),a=Q(null),i=Q(null);const o={error:"Error",warning:"Warning",info:"Info"},l={error:0,warning:1,info:2},d=_e(()=>[...u(s)].sort((j,w)=>l[j.severity]-l[w.severity])),h=_e(()=>({error:u(s).filter(j=>j.severity==="error").length,warning:u(s).filter(j=>j.severity==="warning").length,info:u(s).filter(j=>j.severity==="info").length}));async function g(){T(n,!0),T(r,null);try{T(s,await Kx(),!0)}catch(j){T(r,j instanceof Error?j.message:String(j),!0)}finally{T(n,!1)}}Rt(()=>{g()});async function f(j){if(j.repair){T(a,j.repair.id,!0),T(i,null);try{T(s,await Vx(j.repair.id),!0)}catch(w){T(i,w instanceof Error?w.message:String(w),!0)}finally{T(a,null)}}}var p=iR(),v=C(y(p),2);{var b=j=>{var w=Xx(),S=y(w);re(()=>ae(S,u(r))),F(j,w)};ce(v,j=>{u(r)&&j(b)})}var E=C(v,2);{var _=j=>{var w=Qx(),S=y(w);re(()=>ae(S,u(i))),F(j,w)};ce(E,j=>{u(i)&&j(_)})}var R=C(E,2),O=y(R),B=y(O);{var M=j=>{var w=Sl("Running checks…");F(j,w)},J=j=>{var w=Zx();F(j,w)},H=j=>{var w=nR(),S=tt(w);{var x=U=>{var K=Jx(),te=y(K);re(()=>ae(te,`${u(h).error??""} error${u(h).error===1?"":"s"}`)),F(U,K)};ce(S,U=>{u(h).error>0&&U(x)})}var k=C(S,2);{var W=U=>{var K=eR(),te=y(K);re(()=>ae(te,`${u(h).warning??""} warning${u(h).warning===1?"":"s"}`)),F(U,K)};ce(k,U=>{u(h).warning>0&&U(W)})}var $=C(k,2);{var Y=U=>{var K=tR(),te=y(K);re(()=>ae(te,`${u(h).info??""} info`)),F(U,K)};ce($,U=>{u(h).info>0&&U(Y)})}F(j,w)};ce(B,j=>{u(n)?j(M):u(s).length===0?j(J,1):j(H,-1)})}var G=C(O,2),X=y(G),ee=C(R,2);{var A=j=>{var w=aR();St(w,21,()=>u(d),S=>S.id,(S,x)=>{var k=sR(),W=y(k),$=y(W),Y=y($),U=C($,2),K=y(U),te=C(W,2),fe=y(te),me=C(te,2);{var ge=Le=>{var de=rR(),ve=y(de),Ie=y(ve);re(()=>{ve.disabled=u(a)!==null,ae(Ie,u(a)===u(x).repair.id?"Repairing…":u(x).repair.label)}),ie("click",ve,()=>f(u(x))),F(Le,de)};ce(me,Le=>{u(x).repair&&Le(ge)})}re(()=>{Ve(k,1,`finding finding-${u(x).severity??""}`,"svelte-1iylrs"),Ve($,1,`severity-tag severity-${u(x).severity??""}`,"svelte-1iylrs"),ae(Y,o[u(x).severity]),ae(K,u(x).title),ae(fe,u(x).detail)}),F(S,k)}),F(j,w)};ce(ee,j=>{!u(n)&&u(s).length>0&&j(A)})}re(()=>{G.disabled=u(n),ae(X,u(n)?"Checking…":"Re-run checks")}),ie("click",G,g),F(t,p),it()}Tt(["click"]);var uR=z('<p class="error svelte-8ydvuj" role="alert"> </p>'),lR=z('<p class="ok svelte-8ydvuj" role="status"> </p>'),cR=z(`<div class="panel svelte-8ydvuj"><p class="lede svelte-8ydvuj">The site's base URL, its public address, e.g. <code class="svelte-8ydvuj">https://example.com</code>. Setting it makes <code class="svelte-8ydvuj">publish</code> emit a <code class="svelte-8ydvuj">sitemap.xml</code> (and absolute links in the RSS feed). Leave it blank to skip the sitemap.</p> <!> <!> <section class="field svelte-8ydvuj"><label for="site-base-url" class="svelte-8ydvuj">Base URL</label> <div class="row svelte-8ydvuj"><input id="site-base-url" type="url" inputmode="url" placeholder="https://example.com" class="svelte-8ydvuj"/> <button type="button" class="primary svelte-8ydvuj"> </button></div> <small class="svelte-8ydvuj">No trailing slash needed. Used only to build absolute URLs in the sitemap and feed.</small></section></div>`);function dR(t,e){at(e,!0);let n=Q(""),r=Q(!0),s=Q(!1),a=Q(null),i=Q(null);E6().then(O=>{T(n,O.baseUrl,!0),T(r,!1)});function o(O){T(i,O,!0),setTimeout(()=>T(i,null),1500)}async function l(){T(s,!0),T(a,null);try{await _6({baseUrl:u(n)}),o("Saved.")}catch(O){T(a,O instanceof Error?O.message:String(O),!0)}finally{T(s,!1)}}var d=cR(),h=C(y(d),2);{var g=O=>{var B=uR(),M=y(B);re(()=>ae(M,u(a))),F(O,B)};ce(h,O=>{u(a)&&O(g)})}var f=C(h,2);{var p=O=>{var B=lR(),M=y(B);re(()=>ae(M,u(i))),F(O,B)};ce(f,O=>{u(i)&&O(p)})}var v=C(f,2),b=C(y(v),2),E=y(b),_=C(E,2),R=y(_);re(()=>{E.disabled=u(r),_.disabled=u(r)||u(s),ae(R,u(s)?"Saving…":"Save")}),wt(E,()=>u(n),O=>T(n,O)),ie("click",_,l),F(t,d),it()}Tt(["click"]);async function fR(){const t=await Ge("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const g0={"content-type":"application/json"};function hR(t){return ei("/api/users",{method:"POST",headers:g0,body:JSON.stringify(t)})}function z1(t,e){return ei(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:g0,body:JSON.stringify(e)})}function pR(t,e){return ei(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:g0,body:JSON.stringify(e)})}function mR(t){return ei(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var gR=z('<p class="error svelte-plhp3i" role="alert"> </p>'),vR=z('<p class="muted svelte-plhp3i">Loading users…</p>'),bR=z('<p class="error svelte-plhp3i"> </p>'),ER=z('<span class="you svelte-plhp3i">(you)</span>'),_R=z('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),TR=z('<span class="you svelte-plhp3i">(you)</span>'),AR=z('<span class="username svelte-plhp3i"> <!></span>'),yR=z('<span class="chip locked svelte-plhp3i">Locked</span>'),NR=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),wR=z('<tr><td class="svelte-plhp3i"><div class="who svelte-plhp3i"><!></div> <!></td><td class="svelte-plhp3i"><div class="roles svelte-plhp3i"></div></td><td class="row-actions svelte-plhp3i"><button type="button" class="link svelte-plhp3i">Edit name</button> <button type="button" class="link svelte-plhp3i">Reset password</button> <button type="button" class="link danger svelte-plhp3i">Delete</button></td></tr>'),SR=z('<table class="svelte-plhp3i"><thead><tr><th class="svelte-plhp3i">User</th><th class="svelte-plhp3i">Roles</th><th class="svelte-plhp3i"></th></tr></thead><tbody></tbody></table>'),IR=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),CR=z('<div class="panel svelte-plhp3i"><!> <section class="list"><!></section> <form class="create svelte-plhp3i"><h3 class="svelte-plhp3i">Add a user</h3> <div class="create-grid svelte-plhp3i"><label class="svelte-plhp3i"><span class="svelte-plhp3i">Username</span> <input type="text" autocomplete="off" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Display name <small class="optional svelte-plhp3i">(optional)</small></span> <input type="text" autocomplete="off" placeholder="Shown on bylines; defaults to the username" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Initial password</span> <input type="text" autocomplete="off" placeholder="Set a password" class="svelte-plhp3i"/></label> <fieldset class="roles-field svelte-plhp3i"><legend class="svelte-plhp3i">Roles</legend> <div class="roles svelte-plhp3i"></div></fieldset></div> <div class="create-actions svelte-plhp3i"><small class="svelte-plhp3i">Share the password with them; they can change it from their account menu.</small> <button type="submit" class="primary svelte-plhp3i"> </button></div></form></div>');function LR(t,e){at(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=Q(ct([])),i=Q(!0),o=Q(null),l=Q(null),d=Q(""),h=Q(""),g=Q(""),f=Q(ct(["author"])),p=Q(!1);const v=_e(()=>{var de;return((de=pt.principal)==null?void 0:de.userId)??null}),b=_e(()=>!u(p)&&u(d).trim()!==""&&u(g)!==""&&u(f).length>0);async function E(){T(i,!0),T(o,null);try{T(a,await fR(),!0)}catch(de){T(o,de instanceof Error?de.message:String(de),!0)}finally{T(i,!1)}}Rt(()=>{E()});async function _(de){if(de.preventDefault(),!u(b))return;T(p,!0),T(l,null);const ve=await hR({username:u(d).trim(),password:u(g),roles:[...u(f)],...u(h).trim()!==""&&{displayName:u(h).trim()}});if(T(p,!1),!ve.ok){T(l,ve.error,!0);return}T(d,""),T(h,""),T(g,""),T(f,["author"],!0),await E()}async function R(de){const ve=await Bo(`Display name for “${de.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:de.displayName??"",placeholder:de.username});if(ve===null)return;T(l,null);const Ie=await z1(de.id,{displayName:ve});Ie.ok||T(l,Ie.error,!0),await E()}async function O(de,ve){const se=de.roles.includes(ve)?de.roles.filter(Ae=>Ae!==ve):[...de.roles,ve];if(se.length===0){T(l,"A user must keep at least one role."),await E();return}T(l,null);const he=await z1(de.id,{roles:se});he.ok||T(l,he.error,!0),await E()}async function B(de){const ve=await Bo(`Set a new password for “${de.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(ve===null)return;T(l,null);const Ie=await pR(de.id,{newPassword:ve});Ie.ok||T(l,Ie.error,!0)}async function M(de){if(!await Bl(`Delete the user “${de.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;T(l,null);const Ie=await mR(de.id);if(!Ie.ok){T(l,Ie.error,!0);return}await E()}var J=CR(),H=y(J);{var G=de=>{var ve=gR(),Ie=y(ve);re(()=>ae(Ie,u(l))),F(de,ve)};ce(H,de=>{u(l)&&de(G)})}var X=C(H,2),ee=y(X);{var A=de=>{var ve=vR();F(de,ve)},j=de=>{var ve=bR(),Ie=y(ve);re(()=>ae(Ie,u(o))),F(de,ve)},w=de=>{var ve=SR(),Ie=C(y(ve));St(Ie,21,()=>u(a),se=>se.id,(se,he)=>{const Ae=_e(()=>u(he).id===u(v));var Ce=wR(),Me=y(Ce),ke=y(Me),dt=y(ke);{var Be=mt=>{var yt=_R(),Bt=tt(yt),ot=y(Bt),nt=C(ot);{var bt=ln=>{var Zn=ER();F(ln,Zn)};ce(nt,ln=>{u(Ae)&&ln(bt)})}var An=C(Bt,2),yn=y(An);re(()=>{ae(ot,u(he).displayName),ae(yn,u(he).username)}),F(mt,yt)},It=mt=>{var yt=AR(),Bt=y(yt),ot=C(Bt);{var nt=bt=>{var An=TR();F(bt,An)};ce(ot,bt=>{u(Ae)&&bt(nt)})}re(()=>ae(Bt,u(he).username)),F(mt,yt)};ce(dt,mt=>{u(he).displayName?mt(Be):mt(It,-1)})}var Dt=C(ke,2);{var Lt=mt=>{var yt=yR();F(mt,yt)};ce(Dt,mt=>{u(he).locked&&mt(Lt)})}var ft=C(Me),Vt=y(ft);St(Vt,21,()=>r,zo,(mt,yt)=>{var Bt=NR(),ot=y(Bt),nt=C(ot);re(bt=>{J_(ot,bt),ot.disabled=u(Ae),ae(nt,` ${s[u(yt)]??""}`)},[()=>u(he).roles.includes(u(yt))]),ie("change",ot,()=>O(u(he),u(yt))),F(mt,Bt)});var qt=C(ft),Pt=y(qt),Gt=C(Pt,2),Mt=C(Gt,2);re(()=>{Ee(Vt,"title",u(Ae)?"You can't change your own roles":void 0),Mt.disabled=u(Ae),Ee(Mt,"title",u(Ae)?"You can't delete your own account":void 0)}),ie("click",Pt,()=>R(u(he))),ie("click",Gt,()=>B(u(he))),ie("click",Mt,()=>M(u(he))),F(se,Ce)}),F(de,ve)};ce(ee,de=>{u(i)?de(A):u(o)?de(j,1):de(w,-1)})}var S=C(X,2),x=C(y(S),2),k=y(x),W=C(y(k),2),$=C(k,2),Y=C(y($),2),U=C($,2),K=C(y(U),2),te=C(U,2),fe=C(y(te),2);St(fe,21,()=>r,zo,(de,ve)=>{var Ie=IR(),se=y(Ie),he,Ae=C(se);re(()=>{he!==(he=u(ve))&&(se.value=(se.__value=u(ve))??""),ae(Ae,` ${s[u(ve)]??""}`)}),nT(n,[],se,()=>(u(ve),u(f)),Ce=>T(f,Ce)),F(de,Ie)});var me=C(x,2),ge=C(y(me),2),Le=y(ge);re(()=>{ge.disabled=!u(b),ae(Le,u(p)?"Adding…":"Add user")}),He("submit",S,_),wt(W,()=>u(d),de=>T(d,de)),wt(Y,()=>u(h),de=>T(h,de)),wt(K,()=>u(g),de=>T(g,de)),F(t,J),it()}Tt(["change","click"]);var OR=z('<dialog aria-label="Settings" class="svelte-1eaqpj"><header class="svelte-1eaqpj"><h2 class="svelte-1eaqpj">Settings</h2> <button type="button" class="close svelte-1eaqpj" aria-label="Close settings"><!></button></header> <div class="tabs svelte-1eaqpj" role="tablist" aria-label="Settings sections"><button type="button" role="tab">Users</button> <button type="button" role="tab">Branding</button> <button type="button" role="tab">Site</button> <button type="button" role="tab">Health</button></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function xR(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q("users");Rt(()=>{u(r)&&(n()&&!u(r).open?(T(s,"users"),u(r).showModal()):!n()&&u(r).open&&u(r).close())});function a(X){X.preventDefault(),n(!1)}var i=OR(),o=y(i),l=C(y(o),2),d=y(l);Wh(d,{size:18,"aria-hidden":"true"});var h=C(o,2),g=y(h);let f;var p=C(g,2);let v;var b=C(p,2);let E;var _=C(b,2);let R;var O=C(h,2),B=y(O);{var M=X=>{LR(X,{})},J=X=>{Wx(X,{})},H=X=>{dR(X,{})},G=X=>{oR(X,{})};ce(B,X=>{u(s)==="users"?X(M):u(s)==="branding"?X(J,1):u(s)==="site"?X(H,2):X(G,-1)})}mn(i,X=>T(r,X),()=>u(r)),re(()=>{Ee(g,"aria-selected",u(s)==="users"),f=Ve(g,1,"svelte-1eaqpj",null,f,{selected:u(s)==="users"}),Ee(p,"aria-selected",u(s)==="branding"),v=Ve(p,1,"svelte-1eaqpj",null,v,{selected:u(s)==="branding"}),Ee(b,"aria-selected",u(s)==="site"),E=Ve(b,1,"svelte-1eaqpj",null,E,{selected:u(s)==="site"}),Ee(_,"aria-selected",u(s)==="health"),R=Ve(_,1,"svelte-1eaqpj",null,R,{selected:u(s)==="health"})}),He("cancel",i,a),ie("click",l,()=>n(!1)),ie("click",g,()=>T(s,"users")),ie("click",p,()=>T(s,"branding")),ie("click",b,()=>T(s,"site")),ie("click",_,()=>T(s,"health")),F(t,i),it()}Tt(["click"]);const vd="nanoesis-theme";function RR(t){return t==="system"||t==="light"||t==="dark"}function W1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function DR(){let t=Q("system"),e=Q(!1);const n=()=>{document.documentElement.dataset.theme=W1(u(t),u(e))};return{get choice(){return u(t)},get resolved(){return W1(u(t),u(e))},init(){const r=localStorage.getItem(vd);RR(r)&&T(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");T(e,s.matches,!0),s.addEventListener("change",a=>{T(e,a.matches,!0),n()}),n()},setChoice(r){T(t,r,!0),r==="system"?localStorage.removeItem(vd):localStorage.setItem(vd,r),n()}}}const Tl=DR();var kR=z('<button type="button"> </button>'),PR=z('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function MR(t,e){at(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];Jm();var r=PR();St(r,5,()=>n,s=>s.value,(s,a)=>{var i=kR();let o;var l=y(i);re(()=>{o=Ve(i,1,"option svelte-1cmi4dh",null,o,{selected:Tl.choice===u(a).value}),Ee(i,"aria-pressed",Tl.choice===u(a).value),ae(l,u(a).label)}),ie("click",i,()=>Tl.setChoice(u(a).value)),F(s,i)}),F(t,r),it()}Tt(["click"]);var BR=z('<span class="badge svelte-yic9pk"> </span>'),FR=z('<button type="button"> <!></button>'),UR=z('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),HR=z('<span class="spacer"></span>'),qR=z('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),jR=z('<header class="topbar svelte-yic9pk"><div class="brand svelte-yic9pk"><img class="logo svelte-yic9pk" alt="" width="24" height="24"/> </div> <!> <div class="actions svelte-yic9pk"><!> <button class="publish svelte-yic9pk" type="button"> </button> <!> <!></div></header> <!>',1);function $R(t,e){at(e,!0);const n=_e(()=>Dn.logoUrl??Kb),r=_e(()=>Dn.name??"nanoesis"),s=_e(()=>pt.canAuthor&&pt.canDevelop);let a=Q(!1);Rt(()=>{pt.canDevelop&&!pt.canAuthor?wr.set("templates"):pt.canAuthor&&!pt.canDevelop&&wr.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"},{value:"migrations",label:"Migrations"}];async function o(ee){ee!==wr.mode&&await Rv("Switching workspaces will close this file.")&&wr.set(ee)}al.ensureLoaded();function l(){Es.start()}var d=jR(),h=tt(d),g=y(h),f=y(g),p=C(f,1,!0),v=C(g,2);{var b=ee=>{var A=UR();St(A,21,()=>i,j=>j.value,(j,w)=>{var S=FR();let x;var k=y(S),W=C(k);{var $=Y=>{var U=BR(),K=y(U);re(()=>{Ee(U,"aria-label",`${al.count} pending`),ae(K,al.count)}),F(Y,U)};ce(W,Y=>{u(w).value==="migrations"&&al.count>0&&Y($)})}re(()=>{x=Ve(S,1,"option svelte-yic9pk",null,x,{selected:wr.mode===u(w).value}),Ee(S,"aria-pressed",wr.mode===u(w).value),ae(k,`${u(w).label??""} `)}),ie("click",S,()=>void o(u(w).value)),F(j,S)}),F(ee,A)},E=ee=>{var A=HR();F(ee,A)};ce(v,ee=>{u(s)?ee(b):ee(E,-1)})}var _=C(v,2),R=y(_);MR(R,{});var O=C(R,2),B=y(O),M=C(O,2);{var J=ee=>{var A=qR(),j=y(A);zh(j,{size:18,"aria-hidden":"true"}),ie("click",A,()=>T(a,!0)),F(ee,A)};ce(M,ee=>{pt.isAdmin&&ee(J)})}var H=C(M,2);Ux(H,{});var G=C(h,2);{var X=ee=>{xR(ee,{get open(){return u(a)},set open(A){T(a,A,!0)}})};ce(G,ee=>{pt.isAdmin&&ee(X)})}re(()=>{Ee(f,"src",u(n)),ae(p,u(r)),O.disabled=Es.active,ae(B,Es.running?"Publishing…":"Publish")}),ie("click",O,l),F(t,d),it()}Tt(["click"]);var YR=z('<li class="hint svelte-2dodtm">Loading…</li>'),zR=z('<li class="hint svelte-2dodtm">Empty</li>'),WR=z('<p class="hint nested svelte-2dodtm">Loading…</p>'),GR=z("<div><!> <!></div>"),KR=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button" class="chevron svelte-2dodtm"><!></button> <button type="button"><span class="label svelte-2dodtm"> </span></button> <span class="actions svelte-2dodtm"><button type="button" title="Folder settings" class="svelte-2dodtm"><!></button></span></div> <!></li>'),VR=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),XR=z("<ul><!></ul>");function eE(t,e){at(e,!0),Rt(()=>{dc(e.treePath)});const n=_e(()=>_i(e.treePath)),r=_e(()=>{var H;return((H=u(n))==null?void 0:H.defaultTemplate)??e.inheritedTemplate}),s=_e(()=>{var H;return(((H=u(n))==null?void 0:H.entries)??[]).filter(G=>!(G.kind==="item"&&G.slug==="index"))});function a(H){return`tree-group-${H.replace(/\//g,"--")||"root"}`}function i(H){fi(H)||Op(H),e.onopenDir(H)}function o(H){return H.template??u(r)}function l(H){return H.isPublished?void 0:`${H.title}, not published`}function d(H){var ee;const G=[...H],X=(((ee=u(n))==null?void 0:ee.entries)??[]).map(A=>u(s).includes(A)?G.shift()??A.slug:A.slug);L6(e.treePath,X),e.onreorder(e.treePath,X)}function h(H,G){const X=u(s).map(A=>A.slug),ee=X.indexOf(H);ee<0||d(Sf(X,ee,ee+G))}function g(H,G){H.key==="ArrowUp"?(H.preventDefault(),h(G.slug,-1)):H.key==="ArrowDown"&&(H.preventDefault(),h(G.slug,1))}function f(H,G){sw(H,e.treePath),G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",H.slug))}function p(H,G){return G.kind==="dir"&&G.path!==H.entry.path&&H.parent!==G.path&&!G.path.startsWith(`${H.entry.path}/`)}function v(H,G){return H.parent===e.treePath&&G.path!==H.entry.path}function b(H,G){const X=Ti();X!==null&&(!p(X,H)&&!v(X,H)||(G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move"),Jc(H.path)))}function E(H,G){G.preventDefault();const X=Ti();if(Ms(),X===null)return;if(p(X,H)){e.onmove(X.entry.path,X.entry.kind,H.path);return}if(!v(X,H))return;const ee=u(s).map(w=>w.slug),A=ee.indexOf(X.entry.slug),j=ee.indexOf(H.slug);A<0||j<0||d(Sf(ee,A,j))}var _=XR();let R;var O=y(_);{var B=H=>{var G=YR();F(H,G)},M=H=>{var G=zR();F(H,G)},J=H=>{var G=Kn(),X=tt(G);St(X,17,()=>u(s),ee=>ee.path,(ee,A)=>{var j=Kn(),w=tt(j);{var S=k=>{var W=KR(),$=y(W);let Y;var U=y($),K=y(U);yf(K,{size:16,"aria-hidden":"true"});var te=C(U,2),fe=y(te);{var me=Be=>{W6(Be,{size:16,"aria-hidden":"true"})},ge=_e(()=>fi(u(A).path)),Le=Be=>{z6(Be,{size:16,"aria-hidden":"true"})};ce(fe,Be=>{u(ge)?Be(me):Be(Le,-1)})}var de=C(te,2);let ve;var Ie=y(de),se=y(Ie),he=C(de,2),Ae=y(he),Ce=y(Ae);zh(Ce,{size:16,"aria-hidden":"true"});var Me=C($,2);{var ke=Be=>{var It=GR(),Dt=y(It);{var Lt=qt=>{var Pt=WR();F(qt,Pt)},ft=_e(()=>w6(u(A).path)&&_i(u(A).path)===void 0);ce(Dt,qt=>{u(ft)&&qt(Lt)})}var Vt=C(Dt,2);{let qt=_e(()=>e.level+1);eE(Vt,{get treePath(){return u(A).path},get inheritedTemplate(){return u(r)},get level(){return u(qt)},get selectedPath(){return e.selectedPath},get activeDir(){return e.activeDir},get onselect(){return e.onselect},get onopenDir(){return e.onopenDir},get onsettingsDir(){return e.onsettingsDir},get onfoldermenu(){return e.onfoldermenu},get onreorder(){return e.onreorder},get onmove(){return e.onmove}})}re(qt=>Ee(It,"id",qt),[()=>a(u(A).path)]),F(Be,It)},dt=_e(()=>fi(u(A).path));ce(Me,Be=>{u(dt)&&Be(ke)})}re((Be,It,Dt,Lt)=>{Y=Ve($,1,"row svelte-2dodtm",null,Y,Be),Ee(U,"aria-label",`Reorder ${u(A).name}; arrow keys move it`),Ee(te,"aria-expanded",It),Ee(te,"aria-controls",Dt),Ee(te,"aria-label",Lt),ve=Ve(de,1,"dir svelte-2dodtm",null,ve,{active:u(A).path===e.activeDir}),Ee(de,"aria-current",u(A).path===e.activeDir),Ee(de,"title",`${u(A).name}, open this section's page`),ae(se,u(A).name),Ee(Ae,"aria-label",`Settings for ${u(A).name}`)},[()=>({active:u(A).path===e.activeDir,"drop-target":Pp()===u(A).path}),()=>fi(u(A).path),()=>a(u(A).path),()=>`${fi(u(A).path)?"Collapse":"Expand"} ${u(A).name}`]),He("dragstart",$,Be=>f(u(A),Be)),He("dragover",$,Be=>b(u(A),Be)),He("dragleave",$,()=>Jc(null)),He("drop",$,Be=>E(u(A),Be)),He("dragend",$,function(...Be){Ms==null||Ms.apply(this,Be)}),ie("contextmenu",$,Be=>{Be.preventDefault(),e.onfoldermenu(u(A).path,Be.clientX,Be.clientY)}),ie("keydown",U,Be=>g(Be,u(A))),ie("click",te,()=>Op(u(A).path)),ie("click",de,()=>i(u(A).path)),ie("click",Ae,()=>e.onsettingsDir(u(A).path)),F(k,W)},x=k=>{var W=VR(),$=y(W);let Y;var U=y($),K=y(U);yf(K,{size:16,"aria-hidden":"true"});var te=C(U,2);let fe;var me=y(te),ge=y(me);re((Le,de)=>{Y=Ve($,1,"row svelte-2dodtm",null,Y,Le),Ee(U,"aria-label",`Reorder ${u(A).title}; arrow keys move it`),fe=Ve(te,1,"item svelte-2dodtm",null,fe,{selected:u(A).path===e.selectedPath,unpublished:!u(A).isPublished}),Ee(te,"aria-current",u(A).path===e.selectedPath),Ee(te,"aria-label",de),Ee(te,"title",u(A).title),ae(ge,u(A).title)},[()=>({"drop-target":Pp()===u(A).path}),()=>l(u(A))]),He("dragstart",$,Le=>f(u(A),Le)),He("dragover",$,Le=>b(u(A),Le)),He("dragleave",$,()=>Jc(null)),He("drop",$,Le=>E(u(A),Le)),He("dragend",$,function(...Le){Ms==null||Ms.apply(this,Le)}),ie("keydown",U,Le=>g(Le,u(A))),ie("click",te,()=>e.onselect(u(A).path,o(u(A)))),F(k,W)};ce(w,k=>{u(A).kind==="dir"?k(S):k(x,-1)})}F(ee,j)}),F(H,G)};ce(O,H=>{u(n)===void 0?H(B):u(s).length===0?H(M,1):H(J,-1)})}re(()=>R=Ve(_,1,"level svelte-2dodtm",null,R,{root:e.level===1})),F(t,_),it()}Tt(["contextmenu","keydown","click"]);var QR=z('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),ZR=z('<p class="placeholder pad svelte-whg6dh">Loading migrations…</p>'),JR=z('<p class="placeholder svelte-whg6dh"> </p>'),eD=z('<p class="placeholder svelte-whg6dh"> </p>'),tD=z('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),nD=z('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),rD=z('<span class="home-hint svelte-whg6dh">needs template</span>'),sD=z('<span class="home-hint svelte-whg6dh">draft</span>'),aD=z("<div>Move to top level</div>"),iD=z('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),oD=z("<option> </option>"),uD=z('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),lD=z(`<div class="work-pad svelte-whg6dh"><div class="broken-item svelte-whg6dh"><h1 class="svelte-whg6dh">This page has no template</h1> <p class="svelte-whg6dh">Pick a template to set up the form, or delete the page. This usually happens when
131
+ so treat it like a password.</p> <!></dialog>`);function Bx(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q(!1),a=Q(null),i=Q(null),o=Q(null),l=Q(!1),d=Q(!1);Rt(()=>{u(r)&&(n()&&!u(r).open?(T(s,!1),T(a,null),T(i,null),T(o,null),T(l,!1),T(d,!1),u(r).showModal()):!n()&&u(r).open&&u(r).close())});let f=_e(()=>u(o)===null?"":new Date(u(o)).toLocaleDateString());async function g(){T(s,!0),T(a,null),T(d,!1),T(l,!1);const M=await pt.createMcpToken();if(T(s,!1),!M.ok||M.token===void 0){T(a,M.error??"Could not create a token.",!0);return}T(i,M.token,!0),T(o,M.expiresAt??null,!0)}async function h(){if(u(i)!==null)try{await navigator.clipboard.writeText(u(i)),T(l,!0)}catch{T(l,!1)}}async function p(){T(s,!0),T(a,null);const M=await pt.revokeMcpTokens();if(T(s,!1),!M.ok){T(a,M.error??"Could not revoke tokens.",!0);return}T(i,null),T(o,null),T(d,!0)}function v(M){var B;(B=M.currentTarget)==null||B.select()}function _(M){M.preventDefault(),n(!1)}var E=Mx(),b=C(y(E),4);{var x=M=>{var B=Rx(),J=tt(B),H=y(J),G=y(H),X=C(H,2),ee=C(J,4),A=y(ee),j=C(A,2),w=y(j);re(()=>{ae(G,`Your new token${u(f)?` · expires ${u(f)}`:""}`),Q_(X,u(i)),ae(w,u(l)?"Copied":"Copy token")}),ie("click",X,v),ie("click",A,()=>n(!1)),ie("click",j,h),F(M,B)},O=M=>{var B=Px(),J=tt(B);{var H=R=>{var k=Dx(),W=y(k);re(()=>ae(W,u(a))),F(R,k)};ce(J,R=>{u(a)&&R(H)})}var G=C(J,2);{var X=R=>{var k=kx();F(R,k)};ce(G,R=>{u(d)&&R(X)})}var ee=C(G,2),A=y(ee),j=C(A,4),w=C(j,2),S=y(w);re(()=>{A.disabled=u(s),w.disabled=u(s),ae(S,u(s)?"Working…":"Create token")}),ie("click",A,p),ie("click",j,()=>n(!1)),ie("click",w,g),F(M,B)};ce(b,M=>{u(i)!==null?M(x):M(O,-1)})}mn(E,M=>T(r,M),()=>u(r)),He("cancel",E,_),F(t,E),it()}Tt(["click"]);var Fx=z('<details class="menu svelte-1y2gtaj"><summary aria-label="Account menu" class="svelte-1y2gtaj"><span class="label svelte-1y2gtaj"> </span> <span class="caret svelte-1y2gtaj" aria-hidden="true">▾</span></summary> <ul role="menu" class="svelte-1y2gtaj"><li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Change password…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">MCP access token…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Log out</button></li></ul></details> <!> <!>',1);function Ux(t,e){at(e,!0);let n=Q(!1),r=Q(!1),s=_e(()=>{var p;return((p=pt.principal)==null?void 0:p.username)??""});function a(){u(d)&&(u(d).open=!1)}function i(){a(),T(n,!0)}function o(){a(),T(r,!0)}async function l(){a(),await pt.logout()}let d=Q(void 0);Rt(()=>{function p(v){u(d)&&u(d).open&&!u(d).contains(v.target)&&(u(d).open=!1)}return document.addEventListener("click",p),()=>document.removeEventListener("click",p)});var f=Kn(),g=tt(f);{var h=p=>{var v=Fx(),_=tt(v),E=y(_),b=y(E),x=y(b),O=C(E,2),M=y(O),B=y(M),J=C(M,2),H=y(J),G=C(J,2),X=y(G);mn(_,j=>T(d,j),()=>u(d));var ee=C(_,2);xx(ee,{get open(){return u(n)},set open(j){T(n,j,!0)}});var A=C(ee,2);Bx(A,{get open(){return u(r)},set open(j){T(r,j,!0)}}),re(()=>ae(x,u(s))),ie("click",B,i),ie("click",H,o),ie("click",X,l),F(p,v)};ce(g,p=>{pt.status==="authenticated"&&pt.principal!==null&&p(h)})}F(t,f),it()}Tt(["click"]);var Hx=z('<p class="error svelte-1e3birj" role="alert"> </p>'),qx=z('<p class="ok svelte-1e3birj" role="status"> </p>'),jx=z('<img alt="Current logo" class="svelte-1e3birj"/>'),$x=z('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),Yx=z('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),zx=z(`<div class="panel svelte-1e3birj"><p class="lede svelte-1e3birj">Replace the editor's top-left logo and name with your own. Leave the name blank to use the
132
+ built-in brand. (The footer credit stays.)</p> <!> <!> <section class="field svelte-1e3birj"><label for="brand-name" class="svelte-1e3birj">Name</label> <div class="row svelte-1e3birj"><input id="brand-name" type="text" placeholder="nanoesis" class="svelte-1e3birj"/> <button type="button" class="primary svelte-1e3birj"> </button></div></section> <section class="field svelte-1e3birj"><span class="field-label svelte-1e3birj">Logo</span> <div class="logo-row svelte-1e3birj"><div class="preview svelte-1e3birj"><!></div> <div class="logo-actions svelte-1e3birj"><input type="file" accept="image/*" class="visually-hidden svelte-1e3birj"/> <button type="button" class="ghost svelte-1e3birj"> </button> <!></div></div> <small class="svelte-1e3birj">PNG, SVG, or any image, up to 1 MB.</small></section></div>`);function Wx(t,e){at(e,!0);let n=Q(ct(Dn.name??"")),r=Q(!1),s=Q(!1),a=Q(null),i=Q(null),o=Q(void 0);function l($){T(i,$,!0),setTimeout(()=>T(i,null),1500)}async function d(){T(r,!0),T(a,null);const $=u(n).trim(),Y=await f3($===""?null:$);if(T(r,!1),!Y.ok){T(a,Y.error,!0);return}await Dn.load(),l("Name saved.")}async function f($){var te;const Y=$.currentTarget,U=(te=Y.files)==null?void 0:te[0];if(U===void 0)return;T(s,!0),T(a,null);const K=await h3(U);if(T(s,!1),Y.value="",!K.ok){T(a,K.error,!0);return}await Dn.load(),l("Logo updated.")}async function g(){T(a,null);const $=await p3();if(!$.ok){T(a,$.error,!0);return}await Dn.load(),l("Logo removed.")}var h=zx(),p=C(y(h),2);{var v=$=>{var Y=Hx(),U=y(Y);re(()=>ae(U,u(a))),F($,Y)};ce(p,$=>{u(a)&&$(v)})}var _=C(p,2);{var E=$=>{var Y=qx(),U=y(Y);re(()=>ae(U,u(i))),F($,Y)};ce(_,$=>{u(i)&&$(E)})}var b=C(_,2),x=C(y(b),2),O=y(x),M=C(O,2),B=y(M),J=C(b,2),H=C(y(J),2),G=y(H),X=y(G);{var ee=$=>{var Y=jx();re(()=>Ee(Y,"src",Dn.logoUrl)),F($,Y)},A=$=>{var Y=$x();F($,Y)};ce(X,$=>{Dn.logoUrl?$(ee):$(A,-1)})}var j=C(G,2),w=y(j);mn(w,$=>T(o,$),()=>u(o));var S=C(w,2),R=y(S),k=C(S,2);{var W=$=>{var Y=Yx();ie("click",Y,g),F($,Y)};ce(k,$=>{Dn.logoUrl&&$(W)})}re(()=>{M.disabled=u(r),ae(B,u(r)?"Saving…":"Save"),Ee(G,"aria-hidden",Dn.logoUrl===null),S.disabled=u(s),ae(R,u(s)?"Uploading…":Dn.logoUrl?"Replace logo…":"Upload logo…")}),wt(O,()=>u(n),$=>T(n,$)),ie("click",M,d),ie("change",w,f),ie("click",S,()=>{var $;return($=u(o))==null?void 0:$.click()}),F(t,h),it()}Tt(["click","change"]);const Gx={"content-type":"application/json"};async function Kx(){const t=await Ge("/api/admin/diagnostics");if(t.status===404)throw new Error("Diagnostics are not available on this host.");if(!t.ok)throw new Error(`Couldn't load diagnostics (HTTP ${t.status}).`);return(await t.json()).findings}async function Vx(t){const e=await Ge("/api/admin/diagnostics/repair",{method:"POST",headers:Gx,body:JSON.stringify({id:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Repair failed (HTTP ${e.status}).`)}return(await e.json()).findings}var Xx=z('<p class="error svelte-1iylrs" role="alert"> </p>'),Qx=z('<p class="error svelte-1iylrs" role="alert"> </p>'),Zx=z('<span class="all-good svelte-1iylrs">All checks passed.</span>'),Jx=z('<span class="chip chip-error svelte-1iylrs"> </span>'),eR=z('<span class="chip chip-warning svelte-1iylrs"> </span>'),tR=z('<span class="chip chip-info svelte-1iylrs"> </span>'),nR=z("<!> <!> <!>",1),rR=z('<div class="finding-actions svelte-1iylrs"><button type="button" class="primary svelte-1iylrs"> </button></div>'),sR=z('<li><div class="finding-head svelte-1iylrs"><span> </span> <h3 class="svelte-1iylrs"> </h3></div> <p class="detail svelte-1iylrs"> </p> <!></li>'),aR=z('<ul class="findings svelte-1iylrs"></ul>'),iR=z(`<div class="panel svelte-1iylrs"><p class="lede svelte-1iylrs">A live check of your installation — what works, and what doesn't. Findings come from
133
+ port-agnostic probes, so they catch problems regardless of how your storage and CDN are wired. <strong>Repair</strong> fixes that the engine can apply in place; advisory findings are everything else.</p> <!> <!> <div class="actions-bar svelte-1iylrs"><div class="summary svelte-1iylrs" aria-live="polite"><!></div> <button type="button" class="svelte-1iylrs"> </button></div> <!></div>`);function oR(t,e){at(e,!0);let n=Q(!0),r=Q(null),s=Q(ct([])),a=Q(null),i=Q(null);const o={error:"Error",warning:"Warning",info:"Info"},l={error:0,warning:1,info:2},d=_e(()=>[...u(s)].sort((j,w)=>l[j.severity]-l[w.severity])),f=_e(()=>({error:u(s).filter(j=>j.severity==="error").length,warning:u(s).filter(j=>j.severity==="warning").length,info:u(s).filter(j=>j.severity==="info").length}));async function g(){T(n,!0),T(r,null);try{T(s,await Kx(),!0)}catch(j){T(r,j instanceof Error?j.message:String(j),!0)}finally{T(n,!1)}}Rt(()=>{g()});async function h(j){if(j.repair){T(a,j.repair.id,!0),T(i,null);try{T(s,await Vx(j.repair.id),!0)}catch(w){T(i,w instanceof Error?w.message:String(w),!0)}finally{T(a,null)}}}var p=iR(),v=C(y(p),2);{var _=j=>{var w=Xx(),S=y(w);re(()=>ae(S,u(r))),F(j,w)};ce(v,j=>{u(r)&&j(_)})}var E=C(v,2);{var b=j=>{var w=Qx(),S=y(w);re(()=>ae(S,u(i))),F(j,w)};ce(E,j=>{u(i)&&j(b)})}var x=C(E,2),O=y(x),M=y(O);{var B=j=>{var w=Sl("Running checks…");F(j,w)},J=j=>{var w=Zx();F(j,w)},H=j=>{var w=nR(),S=tt(w);{var R=U=>{var K=Jx(),te=y(K);re(()=>ae(te,`${u(f).error??""} error${u(f).error===1?"":"s"}`)),F(U,K)};ce(S,U=>{u(f).error>0&&U(R)})}var k=C(S,2);{var W=U=>{var K=eR(),te=y(K);re(()=>ae(te,`${u(f).warning??""} warning${u(f).warning===1?"":"s"}`)),F(U,K)};ce(k,U=>{u(f).warning>0&&U(W)})}var $=C(k,2);{var Y=U=>{var K=tR(),te=y(K);re(()=>ae(te,`${u(f).info??""} info`)),F(U,K)};ce($,U=>{u(f).info>0&&U(Y)})}F(j,w)};ce(M,j=>{u(n)?j(B):u(s).length===0?j(J,1):j(H,-1)})}var G=C(O,2),X=y(G),ee=C(x,2);{var A=j=>{var w=aR();St(w,21,()=>u(d),S=>S.id,(S,R)=>{var k=sR(),W=y(k),$=y(W),Y=y($),U=C($,2),K=y(U),te=C(W,2),fe=y(te),me=C(te,2);{var ge=Le=>{var de=rR(),ve=y(de),Ie=y(ve);re(()=>{ve.disabled=u(a)!==null,ae(Ie,u(a)===u(R).repair.id?"Repairing…":u(R).repair.label)}),ie("click",ve,()=>h(u(R))),F(Le,de)};ce(me,Le=>{u(R).repair&&Le(ge)})}re(()=>{Ve(k,1,`finding finding-${u(R).severity??""}`,"svelte-1iylrs"),Ve($,1,`severity-tag severity-${u(R).severity??""}`,"svelte-1iylrs"),ae(Y,o[u(R).severity]),ae(K,u(R).title),ae(fe,u(R).detail)}),F(S,k)}),F(j,w)};ce(ee,j=>{!u(n)&&u(s).length>0&&j(A)})}re(()=>{G.disabled=u(n),ae(X,u(n)?"Checking…":"Re-run checks")}),ie("click",G,g),F(t,p),it()}Tt(["click"]);var uR=z('<p class="error svelte-8ydvuj" role="alert"> </p>'),lR=z('<p class="ok svelte-8ydvuj" role="status"> </p>'),cR=z(`<div class="panel svelte-8ydvuj"><p class="lede svelte-8ydvuj">The site's base URL, its public address, e.g. <code class="svelte-8ydvuj">https://example.com</code>. Setting it makes <code class="svelte-8ydvuj">publish</code> emit a <code class="svelte-8ydvuj">sitemap.xml</code> (and absolute links in the RSS feed). Leave it blank to skip the sitemap.</p> <!> <!> <section class="field svelte-8ydvuj"><label for="site-base-url" class="svelte-8ydvuj">Base URL</label> <div class="row svelte-8ydvuj"><input id="site-base-url" type="url" inputmode="url" placeholder="https://example.com" class="svelte-8ydvuj"/> <button type="button" class="primary svelte-8ydvuj"> </button></div> <small class="svelte-8ydvuj">No trailing slash needed. Used only to build absolute URLs in the sitemap and feed.</small></section></div>`);function dR(t,e){at(e,!0);let n=Q(""),r=Q(!0),s=Q(!1),a=Q(null),i=Q(null);E6().then(O=>{T(n,O.baseUrl,!0),T(r,!1)});function o(O){T(i,O,!0),setTimeout(()=>T(i,null),1500)}async function l(){T(s,!0),T(a,null);try{await _6({baseUrl:u(n)}),o("Saved.")}catch(O){T(a,O instanceof Error?O.message:String(O),!0)}finally{T(s,!1)}}var d=cR(),f=C(y(d),2);{var g=O=>{var M=uR(),B=y(M);re(()=>ae(B,u(a))),F(O,M)};ce(f,O=>{u(a)&&O(g)})}var h=C(f,2);{var p=O=>{var M=lR(),B=y(M);re(()=>ae(B,u(i))),F(O,M)};ce(h,O=>{u(i)&&O(p)})}var v=C(h,2),_=C(y(v),2),E=y(_),b=C(E,2),x=y(b);re(()=>{E.disabled=u(r),b.disabled=u(r)||u(s),ae(x,u(s)?"Saving…":"Save")}),wt(E,()=>u(n),O=>T(n,O)),ie("click",b,l),F(t,d),it()}Tt(["click"]);async function fR(){const t=await Ge("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const g0={"content-type":"application/json"};function hR(t){return ei("/api/users",{method:"POST",headers:g0,body:JSON.stringify(t)})}function z1(t,e){return ei(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:g0,body:JSON.stringify(e)})}function pR(t,e){return ei(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:g0,body:JSON.stringify(e)})}function mR(t){return ei(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var gR=z('<p class="error svelte-plhp3i" role="alert"> </p>'),vR=z('<p class="muted svelte-plhp3i">Loading users…</p>'),bR=z('<p class="error svelte-plhp3i"> </p>'),ER=z('<span class="you svelte-plhp3i">(you)</span>'),_R=z('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),TR=z('<span class="you svelte-plhp3i">(you)</span>'),AR=z('<span class="username svelte-plhp3i"> <!></span>'),yR=z('<span class="chip locked svelte-plhp3i">Locked</span>'),NR=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),wR=z('<tr><td class="svelte-plhp3i"><div class="who svelte-plhp3i"><!></div> <!></td><td class="svelte-plhp3i"><div class="roles svelte-plhp3i"></div></td><td class="row-actions svelte-plhp3i"><button type="button" class="link svelte-plhp3i">Edit name</button> <button type="button" class="link svelte-plhp3i">Reset password</button> <button type="button" class="link danger svelte-plhp3i">Delete</button></td></tr>'),SR=z('<table class="svelte-plhp3i"><thead><tr><th class="svelte-plhp3i">User</th><th class="svelte-plhp3i">Roles</th><th class="svelte-plhp3i"></th></tr></thead><tbody></tbody></table>'),IR=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),CR=z('<div class="panel svelte-plhp3i"><!> <section class="list"><!></section> <form class="create svelte-plhp3i"><h3 class="svelte-plhp3i">Add a user</h3> <div class="create-grid svelte-plhp3i"><label class="svelte-plhp3i"><span class="svelte-plhp3i">Username</span> <input type="text" autocomplete="off" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Display name <small class="optional svelte-plhp3i">(optional)</small></span> <input type="text" autocomplete="off" placeholder="Shown on bylines; defaults to the username" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Initial password</span> <input type="text" autocomplete="off" placeholder="Set a password" class="svelte-plhp3i"/></label> <fieldset class="roles-field svelte-plhp3i"><legend class="svelte-plhp3i">Roles</legend> <div class="roles svelte-plhp3i"></div></fieldset></div> <div class="create-actions svelte-plhp3i"><small class="svelte-plhp3i">Share the password with them; they can change it from their account menu.</small> <button type="submit" class="primary svelte-plhp3i"> </button></div></form></div>');function LR(t,e){at(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=Q(ct([])),i=Q(!0),o=Q(null),l=Q(null),d=Q(""),f=Q(""),g=Q(""),h=Q(ct(["author"])),p=Q(!1);const v=_e(()=>{var de;return((de=pt.principal)==null?void 0:de.userId)??null}),_=_e(()=>!u(p)&&u(d).trim()!==""&&u(g)!==""&&u(h).length>0);async function E(){T(i,!0),T(o,null);try{T(a,await fR(),!0)}catch(de){T(o,de instanceof Error?de.message:String(de),!0)}finally{T(i,!1)}}Rt(()=>{E()});async function b(de){if(de.preventDefault(),!u(_))return;T(p,!0),T(l,null);const ve=await hR({username:u(d).trim(),password:u(g),roles:[...u(h)],...u(f).trim()!==""&&{displayName:u(f).trim()}});if(T(p,!1),!ve.ok){T(l,ve.error,!0);return}T(d,""),T(f,""),T(g,""),T(h,["author"],!0),await E()}async function x(de){const ve=await Bo(`Display name for “${de.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:de.displayName??"",placeholder:de.username});if(ve===null)return;T(l,null);const Ie=await z1(de.id,{displayName:ve});Ie.ok||T(l,Ie.error,!0),await E()}async function O(de,ve){const se=de.roles.includes(ve)?de.roles.filter(Ae=>Ae!==ve):[...de.roles,ve];if(se.length===0){T(l,"A user must keep at least one role."),await E();return}T(l,null);const he=await z1(de.id,{roles:se});he.ok||T(l,he.error,!0),await E()}async function M(de){const ve=await Bo(`Set a new password for “${de.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(ve===null)return;T(l,null);const Ie=await pR(de.id,{newPassword:ve});Ie.ok||T(l,Ie.error,!0)}async function B(de){if(!await Bl(`Delete the user “${de.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;T(l,null);const Ie=await mR(de.id);if(!Ie.ok){T(l,Ie.error,!0);return}await E()}var J=CR(),H=y(J);{var G=de=>{var ve=gR(),Ie=y(ve);re(()=>ae(Ie,u(l))),F(de,ve)};ce(H,de=>{u(l)&&de(G)})}var X=C(H,2),ee=y(X);{var A=de=>{var ve=vR();F(de,ve)},j=de=>{var ve=bR(),Ie=y(ve);re(()=>ae(Ie,u(o))),F(de,ve)},w=de=>{var ve=SR(),Ie=C(y(ve));St(Ie,21,()=>u(a),se=>se.id,(se,he)=>{const Ae=_e(()=>u(he).id===u(v));var Ce=wR(),Me=y(Ce),ke=y(Me),dt=y(ke);{var Be=mt=>{var yt=_R(),Bt=tt(yt),ot=y(Bt),nt=C(ot);{var bt=ln=>{var Zn=ER();F(ln,Zn)};ce(nt,ln=>{u(Ae)&&ln(bt)})}var An=C(Bt,2),yn=y(An);re(()=>{ae(ot,u(he).displayName),ae(yn,u(he).username)}),F(mt,yt)},It=mt=>{var yt=AR(),Bt=y(yt),ot=C(Bt);{var nt=bt=>{var An=TR();F(bt,An)};ce(ot,bt=>{u(Ae)&&bt(nt)})}re(()=>ae(Bt,u(he).username)),F(mt,yt)};ce(dt,mt=>{u(he).displayName?mt(Be):mt(It,-1)})}var Dt=C(ke,2);{var Lt=mt=>{var yt=yR();F(mt,yt)};ce(Dt,mt=>{u(he).locked&&mt(Lt)})}var ft=C(Me),Vt=y(ft);St(Vt,21,()=>r,zo,(mt,yt)=>{var Bt=NR(),ot=y(Bt),nt=C(ot);re(bt=>{Z_(ot,bt),ot.disabled=u(Ae),ae(nt,` ${s[u(yt)]??""}`)},[()=>u(he).roles.includes(u(yt))]),ie("change",ot,()=>O(u(he),u(yt))),F(mt,Bt)});var qt=C(ft),Pt=y(qt),Gt=C(Pt,2),Mt=C(Gt,2);re(()=>{Ee(Vt,"title",u(Ae)?"You can't change your own roles":void 0),Mt.disabled=u(Ae),Ee(Mt,"title",u(Ae)?"You can't delete your own account":void 0)}),ie("click",Pt,()=>x(u(he))),ie("click",Gt,()=>M(u(he))),ie("click",Mt,()=>B(u(he))),F(se,Ce)}),F(de,ve)};ce(ee,de=>{u(i)?de(A):u(o)?de(j,1):de(w,-1)})}var S=C(X,2),R=C(y(S),2),k=y(R),W=C(y(k),2),$=C(k,2),Y=C(y($),2),U=C($,2),K=C(y(U),2),te=C(U,2),fe=C(y(te),2);St(fe,21,()=>r,zo,(de,ve)=>{var Ie=IR(),se=y(Ie),he,Ae=C(se);re(()=>{he!==(he=u(ve))&&(se.value=(se.__value=u(ve))??""),ae(Ae,` ${s[u(ve)]??""}`)}),tT(n,[],se,()=>(u(ve),u(h)),Ce=>T(h,Ce)),F(de,Ie)});var me=C(R,2),ge=C(y(me),2),Le=y(ge);re(()=>{ge.disabled=!u(_),ae(Le,u(p)?"Adding…":"Add user")}),He("submit",S,b),wt(W,()=>u(d),de=>T(d,de)),wt(Y,()=>u(f),de=>T(f,de)),wt(K,()=>u(g),de=>T(g,de)),F(t,J),it()}Tt(["change","click"]);var OR=z('<dialog aria-label="Settings" class="svelte-1eaqpj"><header class="svelte-1eaqpj"><h2 class="svelte-1eaqpj">Settings</h2> <button type="button" class="close svelte-1eaqpj" aria-label="Close settings"><!></button></header> <div class="tabs svelte-1eaqpj" role="tablist" aria-label="Settings sections"><button type="button" role="tab">Users</button> <button type="button" role="tab">Branding</button> <button type="button" role="tab">Site</button> <button type="button" role="tab">Health</button></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function xR(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q("users");Rt(()=>{u(r)&&(n()&&!u(r).open?(T(s,"users"),u(r).showModal()):!n()&&u(r).open&&u(r).close())});function a(X){X.preventDefault(),n(!1)}var i=OR(),o=y(i),l=C(y(o),2),d=y(l);Wh(d,{size:18,"aria-hidden":"true"});var f=C(o,2),g=y(f);let h;var p=C(g,2);let v;var _=C(p,2);let E;var b=C(_,2);let x;var O=C(f,2),M=y(O);{var B=X=>{LR(X,{})},J=X=>{Wx(X,{})},H=X=>{dR(X,{})},G=X=>{oR(X,{})};ce(M,X=>{u(s)==="users"?X(B):u(s)==="branding"?X(J,1):u(s)==="site"?X(H,2):X(G,-1)})}mn(i,X=>T(r,X),()=>u(r)),re(()=>{Ee(g,"aria-selected",u(s)==="users"),h=Ve(g,1,"svelte-1eaqpj",null,h,{selected:u(s)==="users"}),Ee(p,"aria-selected",u(s)==="branding"),v=Ve(p,1,"svelte-1eaqpj",null,v,{selected:u(s)==="branding"}),Ee(_,"aria-selected",u(s)==="site"),E=Ve(_,1,"svelte-1eaqpj",null,E,{selected:u(s)==="site"}),Ee(b,"aria-selected",u(s)==="health"),x=Ve(b,1,"svelte-1eaqpj",null,x,{selected:u(s)==="health"})}),He("cancel",i,a),ie("click",l,()=>n(!1)),ie("click",g,()=>T(s,"users")),ie("click",p,()=>T(s,"branding")),ie("click",_,()=>T(s,"site")),ie("click",b,()=>T(s,"health")),F(t,i),it()}Tt(["click"]);const vd="nanoesis-theme";function RR(t){return t==="system"||t==="light"||t==="dark"}function W1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function DR(){let t=Q("system"),e=Q(!1);const n=()=>{document.documentElement.dataset.theme=W1(u(t),u(e))};return{get choice(){return u(t)},get resolved(){return W1(u(t),u(e))},init(){const r=localStorage.getItem(vd);RR(r)&&T(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");T(e,s.matches,!0),s.addEventListener("change",a=>{T(e,a.matches,!0),n()}),n()},setChoice(r){T(t,r,!0),r==="system"?localStorage.removeItem(vd):localStorage.setItem(vd,r),n()}}}const Tl=DR();var kR=z('<button type="button"> </button>'),PR=z('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function MR(t,e){at(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];Jm();var r=PR();St(r,5,()=>n,s=>s.value,(s,a)=>{var i=kR();let o;var l=y(i);re(()=>{o=Ve(i,1,"option svelte-1cmi4dh",null,o,{selected:Tl.choice===u(a).value}),Ee(i,"aria-pressed",Tl.choice===u(a).value),ae(l,u(a).label)}),ie("click",i,()=>Tl.setChoice(u(a).value)),F(s,i)}),F(t,r),it()}Tt(["click"]);var BR=z('<span class="badge svelte-yic9pk"> </span>'),FR=z('<button type="button"> <!></button>'),UR=z('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),HR=z('<span class="spacer"></span>'),qR=z('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),jR=z('<header class="topbar svelte-yic9pk"><div class="brand svelte-yic9pk"><img class="logo svelte-yic9pk" alt="" width="24" height="24"/> </div> <!> <div class="actions svelte-yic9pk"><!> <button class="publish svelte-yic9pk" type="button"> </button> <!> <!></div></header> <!>',1);function $R(t,e){at(e,!0);const n=_e(()=>Dn.logoUrl??Gb),r=_e(()=>Dn.name??"nanoesis"),s=_e(()=>pt.canAuthor&&pt.canDevelop);let a=Q(!1);Rt(()=>{pt.canDevelop&&!pt.canAuthor?wr.set("templates"):pt.canAuthor&&!pt.canDevelop&&wr.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"},{value:"migrations",label:"Migrations"}];async function o(ee){ee!==wr.mode&&await xv("Switching workspaces will close this file.")&&wr.set(ee)}al.ensureLoaded();function l(){Es.start()}var d=jR(),f=tt(d),g=y(f),h=y(g),p=C(h,1,!0),v=C(g,2);{var _=ee=>{var A=UR();St(A,21,()=>i,j=>j.value,(j,w)=>{var S=FR();let R;var k=y(S),W=C(k);{var $=Y=>{var U=BR(),K=y(U);re(()=>{Ee(U,"aria-label",`${al.count} pending`),ae(K,al.count)}),F(Y,U)};ce(W,Y=>{u(w).value==="migrations"&&al.count>0&&Y($)})}re(()=>{R=Ve(S,1,"option svelte-yic9pk",null,R,{selected:wr.mode===u(w).value}),Ee(S,"aria-pressed",wr.mode===u(w).value),ae(k,`${u(w).label??""} `)}),ie("click",S,()=>void o(u(w).value)),F(j,S)}),F(ee,A)},E=ee=>{var A=HR();F(ee,A)};ce(v,ee=>{u(s)?ee(_):ee(E,-1)})}var b=C(v,2),x=y(b);MR(x,{});var O=C(x,2),M=y(O),B=C(O,2);{var J=ee=>{var A=qR(),j=y(A);zh(j,{size:18,"aria-hidden":"true"}),ie("click",A,()=>T(a,!0)),F(ee,A)};ce(B,ee=>{pt.isAdmin&&ee(J)})}var H=C(B,2);Ux(H,{});var G=C(f,2);{var X=ee=>{xR(ee,{get open(){return u(a)},set open(A){T(a,A,!0)}})};ce(G,ee=>{pt.isAdmin&&ee(X)})}re(()=>{Ee(h,"src",u(n)),ae(p,u(r)),O.disabled=Es.active,ae(M,Es.running?"Publishing…":"Publish")}),ie("click",O,l),F(t,d),it()}Tt(["click"]);var YR=z('<li class="hint svelte-2dodtm">Loading…</li>'),zR=z('<li class="hint svelte-2dodtm">Empty</li>'),WR=z('<p class="hint nested svelte-2dodtm">Loading…</p>'),GR=z("<div><!> <!></div>"),KR=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button" class="chevron svelte-2dodtm"><!></button> <button type="button"><span class="label svelte-2dodtm"> </span></button> <span class="actions svelte-2dodtm"><button type="button" title="Folder settings" class="svelte-2dodtm"><!></button></span></div> <!></li>'),VR=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),XR=z("<ul><!></ul>");function Jb(t,e){at(e,!0),Rt(()=>{dc(e.treePath)});const n=_e(()=>_i(e.treePath)),r=_e(()=>{var H;return((H=u(n))==null?void 0:H.defaultTemplate)??e.inheritedTemplate}),s=_e(()=>{var H;return(((H=u(n))==null?void 0:H.entries)??[]).filter(G=>!(G.kind==="item"&&G.slug==="index"))});function a(H){return`tree-group-${H.replace(/\//g,"--")||"root"}`}function i(H){fi(H)||Op(H),e.onopenDir(H)}function o(H){return H.template??u(r)}function l(H){return H.isPublished?void 0:`${H.title}, not published`}function d(H){var ee;const G=[...H],X=(((ee=u(n))==null?void 0:ee.entries)??[]).map(A=>u(s).includes(A)?G.shift()??A.slug:A.slug);L6(e.treePath,X),e.onreorder(e.treePath,X)}function f(H,G){const X=u(s).map(A=>A.slug),ee=X.indexOf(H);ee<0||d(Sf(X,ee,ee+G))}function g(H,G){H.key==="ArrowUp"?(H.preventDefault(),f(G.slug,-1)):H.key==="ArrowDown"&&(H.preventDefault(),f(G.slug,1))}function h(H,G){sw(H,e.treePath),G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",H.slug))}function p(H,G){return G.kind==="dir"&&G.path!==H.entry.path&&H.parent!==G.path&&!G.path.startsWith(`${H.entry.path}/`)}function v(H,G){return H.parent===e.treePath&&G.path!==H.entry.path}function _(H,G){const X=Ti();X!==null&&(!p(X,H)&&!v(X,H)||(G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move"),Jc(H.path)))}function E(H,G){G.preventDefault();const X=Ti();if(Ms(),X===null)return;if(p(X,H)){e.onmove(X.entry.path,X.entry.kind,H.path);return}if(!v(X,H))return;const ee=u(s).map(w=>w.slug),A=ee.indexOf(X.entry.slug),j=ee.indexOf(H.slug);A<0||j<0||d(Sf(ee,A,j))}var b=XR();let x;var O=y(b);{var M=H=>{var G=YR();F(H,G)},B=H=>{var G=zR();F(H,G)},J=H=>{var G=Kn(),X=tt(G);St(X,17,()=>u(s),ee=>ee.path,(ee,A)=>{var j=Kn(),w=tt(j);{var S=k=>{var W=KR(),$=y(W);let Y;var U=y($),K=y(U);yf(K,{size:16,"aria-hidden":"true"});var te=C(U,2),fe=y(te);{var me=Be=>{W6(Be,{size:16,"aria-hidden":"true"})},ge=_e(()=>fi(u(A).path)),Le=Be=>{z6(Be,{size:16,"aria-hidden":"true"})};ce(fe,Be=>{u(ge)?Be(me):Be(Le,-1)})}var de=C(te,2);let ve;var Ie=y(de),se=y(Ie),he=C(de,2),Ae=y(he),Ce=y(Ae);zh(Ce,{size:16,"aria-hidden":"true"});var Me=C($,2);{var ke=Be=>{var It=GR(),Dt=y(It);{var Lt=qt=>{var Pt=WR();F(qt,Pt)},ft=_e(()=>w6(u(A).path)&&_i(u(A).path)===void 0);ce(Dt,qt=>{u(ft)&&qt(Lt)})}var Vt=C(Dt,2);{let qt=_e(()=>e.level+1);Jb(Vt,{get treePath(){return u(A).path},get inheritedTemplate(){return u(r)},get level(){return u(qt)},get selectedPath(){return e.selectedPath},get activeDir(){return e.activeDir},get onselect(){return e.onselect},get onopenDir(){return e.onopenDir},get onsettingsDir(){return e.onsettingsDir},get onfoldermenu(){return e.onfoldermenu},get onreorder(){return e.onreorder},get onmove(){return e.onmove}})}re(qt=>Ee(It,"id",qt),[()=>a(u(A).path)]),F(Be,It)},dt=_e(()=>fi(u(A).path));ce(Me,Be=>{u(dt)&&Be(ke)})}re((Be,It,Dt,Lt)=>{Y=Ve($,1,"row svelte-2dodtm",null,Y,Be),Ee(U,"aria-label",`Reorder ${u(A).name}; arrow keys move it`),Ee(te,"aria-expanded",It),Ee(te,"aria-controls",Dt),Ee(te,"aria-label",Lt),ve=Ve(de,1,"dir svelte-2dodtm",null,ve,{active:u(A).path===e.activeDir}),Ee(de,"aria-current",u(A).path===e.activeDir),Ee(de,"title",`${u(A).name}, open this section's page`),ae(se,u(A).name),Ee(Ae,"aria-label",`Settings for ${u(A).name}`)},[()=>({active:u(A).path===e.activeDir,"drop-target":Pp()===u(A).path}),()=>fi(u(A).path),()=>a(u(A).path),()=>`${fi(u(A).path)?"Collapse":"Expand"} ${u(A).name}`]),He("dragstart",$,Be=>h(u(A),Be)),He("dragover",$,Be=>_(u(A),Be)),He("dragleave",$,()=>Jc(null)),He("drop",$,Be=>E(u(A),Be)),He("dragend",$,function(...Be){Ms==null||Ms.apply(this,Be)}),ie("contextmenu",$,Be=>{Be.preventDefault(),e.onfoldermenu(u(A).path,Be.clientX,Be.clientY)}),ie("keydown",U,Be=>g(Be,u(A))),ie("click",te,()=>Op(u(A).path)),ie("click",de,()=>i(u(A).path)),ie("click",Ae,()=>e.onsettingsDir(u(A).path)),F(k,W)},R=k=>{var W=VR(),$=y(W);let Y;var U=y($),K=y(U);yf(K,{size:16,"aria-hidden":"true"});var te=C(U,2);let fe;var me=y(te),ge=y(me);re((Le,de)=>{Y=Ve($,1,"row svelte-2dodtm",null,Y,Le),Ee(U,"aria-label",`Reorder ${u(A).title}; arrow keys move it`),fe=Ve(te,1,"item svelte-2dodtm",null,fe,{selected:u(A).path===e.selectedPath,unpublished:!u(A).isPublished}),Ee(te,"aria-current",u(A).path===e.selectedPath),Ee(te,"aria-label",de),Ee(te,"title",u(A).title),ae(ge,u(A).title)},[()=>({"drop-target":Pp()===u(A).path}),()=>l(u(A))]),He("dragstart",$,Le=>h(u(A),Le)),He("dragover",$,Le=>_(u(A),Le)),He("dragleave",$,()=>Jc(null)),He("drop",$,Le=>E(u(A),Le)),He("dragend",$,function(...Le){Ms==null||Ms.apply(this,Le)}),ie("keydown",U,Le=>g(Le,u(A))),ie("click",te,()=>e.onselect(u(A).path,o(u(A)))),F(k,W)};ce(w,k=>{u(A).kind==="dir"?k(S):k(R,-1)})}F(ee,j)}),F(H,G)};ce(O,H=>{u(n)===void 0?H(M):u(s).length===0?H(B,1):H(J,-1)})}re(()=>x=Ve(b,1,"level svelte-2dodtm",null,x,{root:e.level===1})),F(t,b),it()}Tt(["contextmenu","keydown","click"]);var QR=z('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),ZR=z('<p class="placeholder pad svelte-whg6dh">Loading migrations…</p>'),JR=z('<p class="placeholder svelte-whg6dh"> </p>'),eD=z('<p class="placeholder svelte-whg6dh"> </p>'),tD=z('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),nD=z('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),rD=z('<span class="home-hint svelte-whg6dh">needs template</span>'),sD=z('<span class="home-hint svelte-whg6dh">draft</span>'),aD=z("<div>Move to top level</div>"),iD=z('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),oD=z("<option> </option>"),uD=z('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),lD=z(`<div class="work-pad svelte-whg6dh"><div class="broken-item svelte-whg6dh"><h1 class="svelte-whg6dh">This page has no template</h1> <p class="svelte-whg6dh">Pick a template to set up the form, or delete the page. This usually happens when
134
134
  an item was created before its template existed (a common state after recovering a
135
135
  store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`),cD=z(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">Setting up your starter site…</h1> <p class="svelte-whg6dh">Adding a home page, a template, and a stylesheet so you can get straight to
136
136
  editing. This only happens once.</p></div></div>`),dD=z(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">nanoesis</h1> <p class="svelte-whg6dh">Pick an item from the tree to edit it. The form is generated from its template,
137
137
  the template is the schema. Switch to <strong>Templates</strong> to edit those templates
138
- and components directly.</p></div></div>`),fD=z('<div class="panes svelte-whg6dh"><aside class="tree svelte-whg6dh" aria-label="Content"><div class="tree-head svelte-whg6dh"><h2 class="tree-title svelte-whg6dh">Content</h2> <div class="tree-head-actions svelte-whg6dh"><button type="button" class="add svelte-whg6dh" title="New folder" aria-label="New folder"><!></button> <button type="button" class="add svelte-whg6dh" title="New content item" aria-label="New content item"><!></button></div></div> <div class="search svelte-whg6dh"><!> <input type="search" role="combobox" placeholder="Search titles…" aria-label="Search content by title" aria-controls="search-results" aria-autocomplete="list" class="svelte-whg6dh"/></div> <!></aside> <!> <main class="work svelte-whg6dh"><!></main></div>'),hD=z('<button type="button" class="menu-backdrop svelte-whg6dh" aria-label="Close menu"></button> <div class="context-menu svelte-whg6dh" role="menu" tabindex="-1"><button type="button" role="menuitem" class="svelte-whg6dh">Add content…</button> <button type="button" role="menuitem" class="svelte-whg6dh">Add folder…</button></div>',1),pD=z('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!> <!>',1);function mD(t,e){at(e,!0);let n=Q(null);Rt(()=>{const L=Nf.target;L!==null&&(Nf.clear(),(async()=>await Rv("Opening this item will close the open file.")&&(wr.set("content"),await M(L)))())});let r=Q(null),s=Q(""),a=Q(null),i=Q(!1);function o(L){return L==="index"?"":L.endsWith("/index")?L.slice(0,-6):null}const l=_e(()=>u(r)??(u(n)!==null?o(u(n).path):null)),d=_e(()=>u(n)!==null&&o(u(n).path)!==null),h=_e(()=>{var L;return((L=u(n))==null?void 0:L.path)==="index"});let g=Q(""),f=Q(ct([])),p=Q(-1),v=Q(void 0),b;Rt(()=>{const L=u(g);if(clearTimeout(b),L.trim()===""){T(f,[],!0),T(p,-1);return}return b=setTimeout(()=>{bv(L).then(ue=>{L===u(g)&&(T(f,ue,!0),T(p,ue.length>0?0:-1,!0))})},200),()=>clearTimeout(b)});function E(){Hm().then(()=>{var L,ue;return(ue=(L=u(v))==null?void 0:L.children[u(p)])==null?void 0:ue.scrollIntoView({block:"nearest"})})}function _(L){if(L.key==="Escape"){T(g,"");return}if(u(f).length!==0){if(L.key==="ArrowDown")L.preventDefault(),T(p,(u(p)+1)%u(f).length),E();else if(L.key==="ArrowUp")L.preventDefault(),T(p,(u(p)-1+u(f).length)%u(f).length),E();else if(L.key==="Enter"){L.preventDefault();const ue=u(f)[u(p)]??u(f)[0];ue!==void 0&&G(ue)}}}Za(()=>{dc("").catch(Te=>{T(a,Te instanceof Error?Te.message:String(Te),!0)}),Ie();const L=Te=>{Af.hasDirty&&(Te.preventDefault(),Te.returnValue="")};window.addEventListener("beforeunload",L);const ue=M6({reconcileOnce:async()=>{const Te=await Ge("/api/reconcile",{method:"POST"});return Te.ok?P6(await Te.json().catch(()=>null)):{changed:!1,added:0,removed:0}},onChanged:()=>{S6(),R6()},isVisible:()=>document.visibilityState==="visible"});return ue.start(),()=>{window.removeEventListener("beforeunload",L),ue.stop()}});function R(L){return L.includes("/")?L.slice(0,L.lastIndexOf("/")):""}function O(L){return u(n)!==null&&(u(n).path===L||u(n).path.startsWith(`${L}/`))}async function B(L,ue){try{const Te=await Ip(L);T(r,null),T(n,{item:Te,path:L,templateName:ue},!0)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te))}}async function M(L){try{const ue=await Ip(L);T(r,null),T(n,{item:ue,path:L,templateName:await $N(L,ue.template)},!0)}catch(ue){await Fn(ue instanceof Error?ue.message:String(ue))}}async function J(L){const ue=L===""?"index":`${L}/index`;await l6(ue)?await M(ue):(T(n,null),await Ie(),T(s,await pf(L),!0),T(r,L,!0))}async function H(L){const ue=u(r);if(ue===null)return;const Te=ue===""?"index":`${ue}/index`,De=await pf(ue);try{await yv(Te,De,L)}catch(Xe){await Fn(Xe instanceof Error?Xe.message:String(Xe));return}await xn(ue),await vo(Te),await M(Te)}async function G(L){T(g,""),await vo(L.path),await B(L.path,L.template)}async function X(L,ue){try{await h6(L,ue)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te)),await xn(L)}}async function ee(L,ue,Te){var Ke;const De=R(L);if(Te===De)return;let Xe;try{Xe=ue==="item"?await g6(L,Te):await v6(L,Te)}catch(Et){await Fn(Et instanceof Error?Et.message:String(Et));return}ue==="item"?await $u(cr(L),cr(Xe)):await $u(`${cr(L)}*`,`${cr(Xe)}:splat`),await xn(De),await xn(Te),await vo(Xe),ue==="item"&&((Ke=u(n))==null?void 0:Ke.path)===L?await M(Xe):ue==="dir"&&O(L)&&T(n,null)}async function A(L){L.preventDefault();const ue=Ti();Ms(),ue!==null&&ue.parent!==""&&await ee(ue.entry.path,ue.entry.kind,"")}async function j(L){u(n)!==null&&await ee(u(n).path,"item",L)}async function w(L){const ue=u(ft);T(ft,null),ue!==null&&await ee(ue,"dir",L)}async function S(L){if(u(n)===null)return;const{path:ue}=u(n);try{await Cp(ue,L)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te));return}await xn(R(ue)),await M(ue)}const x=_e(()=>_i("")!==void 0),k=_e(()=>{var L;return(((L=_i(""))==null?void 0:L.entries.length)??-1)===0}),W=_e(()=>{const L=_i(""),ue=L==null?void 0:L.entries.find(Te=>Te.kind==="item"&&Te.slug==="index");return(ue==null?void 0:ue.kind)==="item"?ue:void 0}),$=_e(()=>{var Te;const L=u(W);return L===void 0?"missing":(L.template??((Te=_i(""))==null?void 0:Te.defaultTemplate))===void 0?"broken":L.isPublished?"published":"draft"}),Y=_e(()=>{switch(u($)){case"missing":return"Home, the site’s front page (/). No page yet — click to create.";case"broken":return"Home page exists but its template is missing — click to fix.";case"draft":return"Home, the site’s front page (/). Draft, not yet published.";case"published":return"Home, the site’s front page (/)."}});let U=Q(!1);async function K(L){if(!(u(n)===null||L==="")){T(U,!0);try{await Cp(u(n).path,L),await xn(R(u(n).path)),await M(u(n).path)}catch(ue){await Fn(ue instanceof Error?ue.message:String(ue))}finally{T(U,!1)}}}let te=Q(!1),fe=Q(!1);Rt(()=>{!u(fe)&&!u(te)&&pt.isAdmin&&u(x)&&u(k)&&(T(fe,!0),me())});async function me(){T(te,!0);try{await e6(),F6(localStorage),await xn(""),await Ie(),await M("index")}catch(L){if(L instanceof Error&&/already has content/i.test(L.message))return;await Fn(L instanceof Error?L.message:String(L))}finally{T(te,!1)}}let ge=Q(!1),Le=Q(""),de=Q(ct([])),ve=Q(ct([]));async function Ie(){const L=await gf("templates");T(de,L.filter(ue=>ue!==bu&&!jd(ue.split("/").pop()??ue)),!0)}async function se(L){await Ie(),T(ve,await ff(),!0),T(Le,L,!0),T(ge,!0)}async function he(){await se("")}async function Ae(L){T(ge,!1),await xn(R(L)),await vo(L),await M(L)}async function Ce(L){const ue=await Bo("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ue===null||ue.trim()==="")return;let Te;try{Te=await c6(L,ue)}catch(De){await Fn(De instanceof Error?De.message:String(De));return}await xn(L),await vo(`${Te}/_`)}async function Me(){const L=u(ft);T(ft,null),L!==null&&await Ce(L)}let ke=Q(null);function dt(L,ue,Te){T(ke,{x:ue,y:Te,path:L},!0)}function Be(){T(ke,null)}async function It(){var ue;const L=((ue=u(ke))==null?void 0:ue.path)??"";Be(),await se(L)}async function Dt(){var ue;const L=(ue=u(ke))==null?void 0:ue.path;Be(),L!==void 0&&await Ce(L)}function Lt(L){var Te;const ue=L.getBoundingClientRect();ue.right>window.innerWidth&&(L.style.left=`${window.innerWidth-ue.width-8}px`),ue.bottom>window.innerHeight&&(L.style.top=`${window.innerHeight-ue.height-8}px`),(Te=L.querySelector("button"))==null||Te.focus()}let ft=Q(null);async function Vt(L){await Ie(),T(ve,await ff(),!0),T(ft,L,!0)}async function qt(){const L=u(ft);T(ft,null),L!==null&&await xn(L),u(n)!==null&&await M(u(n).path)}async function Pt(){const L=u(ft);T(ft,null),L!==null&&await mt(L)}async function Gt(){const L=u(ft);T(ft,null),L!==null&&await Mt(L)}async function Mt(L){const ue=ml(L);if(await Bl(`Delete the folder “${ue}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ml(yi(L))}catch(De){await Fn(De instanceof Error?De.message:String(De));return}O(L)&&T(n,null),await xn(R(L))}}async function mt(L){const ue=ml(L),Te=await Bo("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(Te===null)return;const De=_s(Te);if(De===""||De===ue)return;const Xe=yp(L,De);try{await Wa(yi(L),yi(Xe))}catch(Ke){await Fn(Ke instanceof Error?Ke.message:String(Ke));return}await $u(`${cr(L)}*`,`${cr(Xe)}:splat`),O(L)&&T(n,null),await xn(R(L))}async function yt(){if(u(n)===null)return;const{path:L,item:ue}=u(n);if(await Bl(`Delete “${ue.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ml(Ws(L))}catch(De){await Fn(De instanceof Error?De.message:String(De));return}Dp(localStorage,L),T(n,null),await xn(R(L))}}async function Bt(){if(u(n)===null)return;const L=u(n).path,ue=ml(L),Te=await Bo("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(Te===null)return;const De=_s(Te);if(De===""||De===ue)return;const Xe=yp(L,De);try{await Wa(Ws(L),Ws(Xe))}catch(Ke){await Fn(Ke instanceof Error?Ke.message:String(Ke));return}Dp(localStorage,L),await $u(cr(L),cr(Xe)),await xn(R(L)),await M(Xe)}let ot=Q(null),nt=Q(null);Rt(()=>{wr.mode==="templates"&&u(ot)===null&&mp(()=>import("./TemplatesPane-tI-X3c-0.js").then(L=>L.T),__vite__mapDeps([0,1]),import.meta.url).then(L=>{T(ot,L.default,!0)}),wr.mode==="migrations"&&u(nt)===null&&mp(()=>import("./MigrationsPane-DNIZD5v9.js"),__vite__mapDeps([2,3]),import.meta.url).then(L=>{T(nt,L.default,!0)})});var bt=pD(),An=tt(bt),yn=y(An);$R(yn,{});var ln=C(yn,2),Zn=y(ln);{var Jn=L=>{hx(L,{})},jt=L=>{var ue=Kn(),Te=tt(ue);{var De=Ke=>{var Et=Kn(),cn=tt(Et);kd(cn,()=>u(ot),(Nt,tr)=>{tr(Nt,{})}),F(Ke,Et)},Xe=Ke=>{var Et=QR();F(Ke,Et)};ce(Te,Ke=>{u(ot)?Ke(De):Ke(Xe,-1)})}F(L,ue)},en=L=>{var ue=Kn(),Te=tt(ue);{var De=Ke=>{var Et=Kn(),cn=tt(Et);kd(cn,()=>u(nt),(Nt,tr)=>{tr(Nt,{})}),F(Ke,Et)},Xe=Ke=>{var Et=ZR();F(Ke,Et)};ce(Te,Ke=>{u(nt)?Ke(De):Ke(Xe,-1)})}F(L,ue)},Hr=L=>{var ue=fD(),Te=y(ue),De=y(Te),Xe=C(y(De),2),Ke=y(Xe),Et=y(Ke);X6(Et,{size:18,"aria-hidden":"true"});var cn=C(Ke,2),Nt=y(cn);Y6(Nt,{size:18,"aria-hidden":"true"});var tr=C(De,2),Os=y(tr);Bv(Os,{class:"search-icon",size:16,"aria-hidden":"true"});var qr=C(Os,2),la=C(tr,2);{var ca=Se=>{var we=JR(),qe=y(we);re(()=>ae(qe,`Couldn’t load content: ${u(a)??""}`)),F(Se,we)},Xt=Se=>{var we=Kn(),qe=tt(we);{var gt=Yt=>{var tn=eD(),gn=y(tn);re(nn=>ae(gn,`No matches for “${nn??""}”.`),[()=>u(g).trim()]),F(Yt,tn)},$t=Yt=>{var tn=nD();St(tn,23,()=>u(f),gn=>gn.path,(gn,nn,nr)=>{var Ft=tD();let rn;var At=y(Ft),Ut=y(At),rr=C(At,2),sr=y(rr);re(()=>{Ee(Ft,"id",`search-option-${u(nr)}`),rn=Ve(Ft,1,"result svelte-whg6dh",null,rn,{active:u(nr)===u(p),unpublished:!u(nn).isPublished}),Ee(Ft,"aria-selected",u(nr)===u(p)),Ee(Ft,"aria-label",u(nn).isPublished?void 0:`${u(nn).title}, not published`),ae(Ut,u(nn).title),ae(sr,u(nn).path)}),ie("click",Ft,()=>G(u(nn))),He("mouseenter",Ft,()=>T(p,u(nr),!0)),F(gn,Ft)}),mn(tn,gn=>T(v,gn),()=>u(v)),F(Yt,tn)};ce(qe,Yt=>{u(f).length===0?Yt(gt):Yt($t,-1)})}F(Se,we)},da=_e(()=>u(g).trim()!==""),fa=Se=>{var we=iD(),qe=y(we);let gt;var $t=y(qe);G6($t,{size:16,"aria-hidden":"true"});var Yt=C($t,4);{var tn=At=>{var Ut=rD();F(At,Ut)},gn=At=>{var Ut=sD();F(At,Ut)};ce(Yt,At=>{u($)==="broken"?At(tn):u($)==="draft"&&At(gn,1)})}var nn=C(qe,2);{let At=_e(()=>{var Ut;return((Ut=u(n))==null?void 0:Ut.path)??null});eE(nn,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return u(At)},get activeDir(){return u(l)},onselect:B,onopenDir:J,onsettingsDir:Vt,onfoldermenu:dt,onreorder:X,onmove:ee})}var nr=C(nn,2);{var Ft=At=>{var Ut=aD();let rr;re(sr=>rr=Ve(Ut,1,"root-drop svelte-whg6dh",null,rr,sr),[()=>({over:Ti()!==null&&u(i)})]),He("dragover",Ut,sr=>{sr.preventDefault(),T(i,!0)}),He("dragleave",Ut,()=>T(i,!1)),He("drop",Ut,sr=>{T(i,!1),A(sr)}),F(At,Ut)},rn=_e(()=>{var At;return Ti()!==null&&((At=Ti())==null?void 0:At.parent)!==""});ce(nr,At=>{u(rn)&&At(Ft)})}re(()=>{gt=Ve(qe,1,"home-row svelte-whg6dh",null,gt,{active:u(l)==="",unpublished:u($)==="draft"||u($)==="broken",broken:u($)==="broken"}),Ee(qe,"aria-current",u(l)===""),Ee(qe,"title",u(Y))}),ie("click",qe,()=>J("")),F(Se,we)};ce(la,Se=>{u(a)?Se(ca):u(da)?Se(Xt,1):Se(fa,-1)})}var xs=C(Te,2);Nx(xs,{});var ha=C(xs,2),pa=y(ha);{var dn=Se=>{var we=Kn(),qe=tt(we);F_(qe,()=>`${u(n).path}\0${u(n).templateName}`,gt=>{{let $t=_e(()=>u(d)?void 0:Bt),Yt=_e(()=>u(h)?void 0:yt);S5(gt,{get item(){return u(n).item},get templateName(){return u(n).templateName},get path(){return u(n).path},get templates(){return u(de)},get onrename(){return u($t)},get ondelete(){return u(Yt)},onchangetemplate:S,onmove:j,onsaved:(tn,gn,nn)=>{I6(tn,gn),C6(tn,nn)}})}}),F(Se,we)},Rs=Se=>{var we=lD(),qe=y(we),gt=C(y(qe),4),$t=C(y(gt),2),Yt=y($t),tn=y(Yt);Yt.value=Yt.__value="";var gn=C(Yt);St(gn,16,()=>u(de),Ft=>Ft,(Ft,rn)=>{var At=oD(),Ut=y(At),rr={};re(()=>{ae(Ut,rn),rr!==(rr=rn)&&(At.value=(At.__value=rn)??"")}),F(Ft,At)});var nn=C(gt,2);{var nr=Ft=>{var rn=uD();re(()=>rn.disabled=u(U)),ie("click",rn,yt),F(Ft,rn)};ce(nn,Ft=>{u(h)||Ft(nr)})}re(()=>{$t.disabled=u(U)||u(de).length===0,ae(tn,u(de).length===0?"No templates exist yet":"Choose…")}),ie("change",$t,Ft=>K(Ft.currentTarget.value)),F(Se,we)},ma=Se=>{gx(Se,{get folderPath(){return u(r)},get name(){return u(s)},get templates(){return u(de)},oncreate:H})},ga=Se=>{var we=cD();F(Se,we)},va=Se=>{var we=dD();F(Se,we)};ce(pa,Se=>{u(n)&&u(n).templateName?Se(dn):u(n)?Se(Rs,1):u(r)!==null?Se(ma,2):pt.isAdmin&&u(x)&&u(k)?Se(ga,3):Se(va,-1)})}re(()=>{Ee(qr,"aria-expanded",u(f).length>0),Ee(qr,"aria-activedescendant",u(p)>=0?`search-option-${u(p)}`:void 0)}),ie("click",Ke,()=>Ce("")),ie("click",cn,he),ie("keydown",qr,_),wt(qr,()=>u(g),Se=>T(g,Se)),F(L,ue)};ce(Zn,L=>{Es.active?L(Jn):wr.mode==="templates"?L(jt,1):wr.mode==="migrations"?L(en,2):L(Hr,-1)})}var us=C(ln,2);x5(us,{});var er=C(An,2);{var ls=L=>{Y5(L,{get folders(){return u(ve)},get templates(){return u(de)},get initialFolder(){return u(Le)},oncreated:Ae,oncancel:()=>T(ge,!1)})};ce(er,L=>{u(ge)&&L(ls)})}var Ne=C(er,2);{var ze=L=>{var ue=hD(),Te=tt(ue),De=C(Te,2),Xe=y(De),Ke=C(Xe,2);Y_(De,Et=>Lt==null?void 0:Lt(Et)),re(()=>Jl(De,`left: ${u(ke).x}px; top: ${u(ke).y}px`)),ie("click",Te,Be),ie("contextmenu",Te,Et=>{Et.preventDefault(),Be()}),ie("keydown",De,Et=>{Et.key==="Escape"&&Be()}),ie("click",Xe,It),ie("click",Ke,Dt),F(L,ue)};ce(Ne,L=>{u(ke)!==null&&L(ze)})}var Qe=C(Ne,2);{var Je=L=>{U5(L,{get folderPath(){return u(ft)},get templates(){return u(de)},get folders(){return u(ve)},onsaved:qt,oncancel:()=>T(ft,null),onnewsubfolder:Me,onrenamefolder:Pt,ondeletefolder:Gt,onmove:w})};ce(Qe,L=>{u(ft)!==null&&L(Je)})}F(t,bt),it()}Tt(["click","keydown","change","contextmenu"]);var gD=z('<h2 class="svelte-z86ibt"> </h2>'),vD=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <input class="svelte-z86ibt"/></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),bD=z('<h2 class="svelte-z86ibt"> </h2>'),ED=z("<option> </option>"),_D=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <select class="svelte-z86ibt"><option disabled=""> </option><!></select></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),TD=z('<h2 class="svelte-z86ibt"> </h2>'),AD=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button></div>',1),yD=z('<h2 class="svelte-z86ibt"> </h2>'),ND=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions decide-actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button> <button type="button" class="primary svelte-z86ibt"> </button></div>',1),wD=z('<h2 class="svelte-z86ibt"> </h2>'),SD=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),ID=z('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function CD(t,e){at(e,!0);let n,r=Q(""),s=Q("");Rt(()=>{const p=Yu.pending;p?(p.kind==="prompt"&&T(r,p.options.value??"",!0),p.kind==="select"&&T(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const p=Yu.pending;(p==null?void 0:p.kind)==="confirm"?Xc(!1):(p==null?void 0:p.kind)==="prompt"?Qc(null):(p==null?void 0:p.kind)==="select"?Zc(null):(p==null?void 0:p.kind)==="decide"?zu("cancel"):xp()}function i(p){p.preventDefault(),a()}function o(p){p.target===n&&a()}function l(p){p.preventDefault(),Qc(u(r))}function d(p){p.preventDefault(),u(s)!==""&&Zc(u(s))}var h=ID(),g=y(h);{var f=p=>{const v=_e(()=>Yu.pending);var b=Kn(),E=tt(b);{var _=J=>{var H=vD(),G=y(H);{var X=$=>{var Y=gD(),U=y(Y);re(()=>ae(U,u(v).options.title)),F($,Y)};ce(G,$=>{u(v).options.title&&$(X)})}var ee=C(G,2),A=y(ee),j=y(A),w=C(A,2);$a(w,!0);var S=C(ee,2),x=y(S),k=C(x,2),W=y(k);re(()=>{ae(j,u(v).message),Ee(w,"placeholder",u(v).options.placeholder??""),ae(W,u(v).options.confirmLabel??"OK")}),He("submit",H,l),wt(w,()=>u(r),$=>T(r,$)),ie("click",x,()=>Qc(null)),F(J,H)},R=J=>{var H=_D(),G=y(H);{var X=K=>{var te=bD(),fe=y(te);re(()=>ae(fe,u(v).options.title)),F(K,te)};ce(G,K=>{u(v).options.title&&K(X)})}var ee=C(G,2),A=y(ee),j=y(A),w=C(A,2);$a(w,!0);var S=y(w),x=y(S);S.value=S.__value="";var k=C(S);St(k,17,()=>u(v).choices,K=>K.value,(K,te)=>{var fe=ED(),me=y(fe),ge={};re(()=>{ae(me,u(te).label),ge!==(ge=u(te).value)&&(fe.value=(fe.__value=u(te).value)??"")}),F(K,fe)});var W=C(ee,2),$=y(W),Y=C($,2),U=y(Y);re(()=>{ae(j,u(v).message),ae(x,u(v).options.placeholder??"Choose…"),Y.disabled=u(s)==="",ae(U,u(v).options.confirmLabel??"OK")}),He("submit",H,d),Ya(w,()=>u(s),K=>T(s,K)),ie("click",$,()=>Zc(null)),F(J,H)},O=J=>{var H=AD(),G=tt(H);{var X=$=>{var Y=TD(),U=y(Y);re(()=>ae(U,u(v).options.title)),F($,Y)};ce(G,$=>{u(v).options.title&&$(X)})}var ee=C(G,2),A=y(ee),j=C(ee,2),w=y(j),S=y(w),x=C(w,2);let k;var W=y(x);re(()=>{ae(A,u(v).message),ae(S,u(v).options.cancelLabel??"Cancel"),k=Ve(x,1,"primary svelte-z86ibt",null,k,{danger:u(v).options.danger}),ae(W,u(v).options.confirmLabel??"Confirm")}),ie("click",w,()=>Xc(!1)),ie("click",x,()=>Xc(!0)),F(J,H)},B=J=>{var H=ND(),G=tt(H);{var X=U=>{var K=yD(),te=y(K);re(()=>ae(te,u(v).options.title)),F(U,K)};ce(G,U=>{u(v).options.title&&U(X)})}var ee=C(G,2),A=y(ee),j=C(ee,2),w=y(j),S=y(w),x=C(w,2);let k;var W=y(x),$=C(x,2),Y=y($);re(()=>{ae(A,u(v).message),ae(S,u(v).options.cancelLabel),k=Ve(x,1,"ghost svelte-z86ibt",null,k,{"danger-ghost":u(v).options.secondaryDanger}),ae(W,u(v).options.secondaryLabel),ae(Y,u(v).options.primaryLabel)}),ie("click",w,()=>zu("cancel")),ie("click",x,()=>zu("secondary")),ie("click",$,()=>zu("primary")),F(J,H)},M=J=>{var H=SD(),G=tt(H);{var X=S=>{var x=wD(),k=y(x);re(()=>ae(k,u(v).options.title)),F(S,x)};ce(G,S=>{u(v).options.title&&S(X)})}var ee=C(G,2),A=y(ee),j=C(ee,2),w=y(j);re(()=>ae(A,u(v).message)),ie("click",w,()=>xp()),F(J,H)};ce(E,J=>{u(v).kind==="prompt"?J(_):u(v).kind==="select"?J(R,1):u(v).kind==="confirm"?J(O,2):u(v).kind==="decide"?J(B,3):J(M,-1)})}F(p,b)};ce(g,p=>{Yu.pending&&p(f)})}mn(h,p=>n=p,()=>n),He("cancel",h,i),ie("click",h,o),F(t,h),it()}Tt(["click"]);var LD=z('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),OD=z('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),xD=z('<p class="hint svelte-o6yxmi">No matching pages.</p>'),RD=z('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),DD=z('<div class="search svelte-o6yxmi"><!> <input type="search" role="combobox" placeholder="Search pages by title…" aria-label="Search pages by title" aria-controls="link-results" aria-autocomplete="list" class="svelte-o6yxmi"/></div> <div class="results-area svelte-o6yxmi"><!></div>',1),kD=z('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),PD=z('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),MD=z('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),BD=z('<h2 class="svelte-o6yxmi">Link</h2> <div class="tabs svelte-o6yxmi" role="tablist" aria-label="Link type"><button type="button" role="tab">Page</button> <button type="button" role="tab">External URL</button></div> <div class="body svelte-o6yxmi"><!></div> <div class="actions svelte-o6yxmi"><button type="button" class="ghost svelte-o6yxmi">Cancel</button> <!> <!></div>',1),FD=z('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function UD(t,e){at(e,!0);let n=Q(void 0),r=Q("page"),s=Q(""),a=Q(ct([])),i=Q(-1),o=Q(""),l=Q(void 0);const d=_e(()=>zw.pending);Rt(()=>{var O,B;if(u(d)===null){(O=u(n))==null||O.close();return}const R=u(d).current;T(r,R===""||Qo(R)?"page":"url",!0),T(s,""),T(a,[],!0),T(i,-1),T(o,Qo(R)?"":R,!0),(B=u(n))==null||B.showModal()});let h;Rt(()=>{const R=u(s);if(clearTimeout(h),u(r)!=="page"||R.trim()===""){T(a,[],!0),T(i,-1);return}return h=setTimeout(()=>{bv(R).then(O=>{R===u(s)&&(T(a,O,!0),T(i,O.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(R){ci(Ww(R.path))}function f(){const R=u(o).trim();R!==""&&ci(R)}function p(){var R,O;(O=(R=u(l))==null?void 0:R.children[u(i)])==null||O.scrollIntoView({block:"nearest"})}function v(R){if(u(a).length!==0){if(R.key==="ArrowDown")R.preventDefault(),T(i,(u(i)+1)%u(a).length),p();else if(R.key==="ArrowUp")R.preventDefault(),T(i,(u(i)-1+u(a).length)%u(a).length),p();else if(R.key==="Enter"){R.preventDefault();const O=u(a)[u(i)]??u(a)[0];O!==void 0&&g(O)}}}var b=FD(),E=y(b);{var _=R=>{var O=BD(),B=C(tt(O),2),M=y(B);let J;var H=C(M,2);let G;var X=C(B,2),ee=y(X);{var A=Y=>{var U=DD(),K=tt(U),te=y(K);Bv(te,{class:"search-icon",size:16,"aria-hidden":"true"});var fe=C(te,2);$a(fe,!0);var me=C(K,2),ge=y(me);{var Le=se=>{var he=OD();St(he,23,()=>u(a),Ae=>Ae.path,(Ae,Ce,Me)=>{var ke=LD();let dt;var Be=y(ke),It=y(Be),Dt=C(Be,2),Lt=y(Dt);re(()=>{Ee(ke,"id",`link-option-${u(Me)}`),dt=Ve(ke,1,"result svelte-o6yxmi",null,dt,{active:u(Me)===u(i)}),Ee(ke,"aria-selected",u(Me)===u(i)),ae(It,u(Ce).title),ae(Lt,u(Ce).path)}),ie("click",ke,()=>g(u(Ce))),He("mouseenter",ke,()=>T(i,u(Me),!0)),F(Ae,ke)}),mn(he,Ae=>T(l,Ae),()=>u(l)),F(se,he)},de=se=>{var he=xD();F(se,he)},ve=_e(()=>u(s).trim()!==""),Ie=se=>{var he=RD();F(se,he)};ce(ge,se=>{u(a).length>0?se(Le):u(ve)?se(de,1):se(Ie,-1)})}re(()=>{Ee(fe,"aria-expanded",u(a).length>0),Ee(fe,"aria-activedescendant",u(i)>=0?`link-option-${u(i)}`:void 0)}),ie("keydown",fe,v),wt(fe,()=>u(s),se=>T(s,se)),F(Y,U)},j=Y=>{var U=kD(),K=C(y(U),2);ie("keydown",K,te=>{te.key==="Enter"&&(te.preventDefault(),f())}),wt(K,()=>u(o),te=>T(o,te)),F(Y,U)};ce(ee,Y=>{u(r)==="page"?Y(A):Y(j,-1)})}var w=C(X,2),S=y(w),x=C(S,2);{var k=Y=>{var U=PD();ie("click",U,()=>ci("")),F(Y,U)};ce(x,Y=>{u(d).current!==""&&Y(k)})}var W=C(x,2);{var $=Y=>{var U=MD();re(K=>U.disabled=K,[()=>u(o).trim()===""]),ie("click",U,f),F(Y,U)};ce(W,Y=>{u(r)==="url"&&Y($)})}re(()=>{J=Ve(M,1,"tab svelte-o6yxmi",null,J,{active:u(r)==="page"}),Ee(M,"aria-selected",u(r)==="page"),G=Ve(H,1,"tab svelte-o6yxmi",null,G,{active:u(r)==="url"}),Ee(H,"aria-selected",u(r)==="url")}),ie("click",M,()=>T(r,"page")),ie("click",H,()=>T(r,"url")),ie("click",S,()=>ci(null)),F(R,O)};ce(E,R=>{u(d)!==null&&R(_)})}mn(b,R=>T(n,R),()=>u(n)),He("close",b,()=>ci(null)),He("cancel",b,()=>ci(null)),F(t,b),it()}Tt(["click","keydown"]);var HD=z('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),qD=z(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
139
- password.</p>`),jD=z('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),$D=z(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),YD=z('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),zD=z('<p class="error svelte-2jpsc9" role="alert"> </p>'),WD=z('<main class="screen svelte-2jpsc9"><section class="panel svelte-2jpsc9"><header class="svelte-2jpsc9"><!> <h1 class="svelte-2jpsc9"> </h1> <!></header> <form autocomplete="on" class="svelte-2jpsc9"><label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Username</span> <input type="text" name="username" autocomplete="username" required="" class="svelte-2jpsc9"/></label> <label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Password</span> <input type="password" name="password" required="" class="svelte-2jpsc9"/></label> <!> <!> <button type="submit" class="primary svelte-2jpsc9"><!></button></form></section></main>');function GD(t,e){at(e,!0);const n=_e(()=>Dn.name??"nanoesis");let r=Q(""),s=Q(""),a=Q(""),i=Q(!1),o=Q(null),l=_e(()=>pt.firstRun&&u(a)!==""&&u(s)!==u(a)),d=_e(()=>!u(i)&&u(r).trim()!==""&&u(s)!==""&&(!pt.firstRun||u(a)!==""&&!u(l)));async function h(Y){if(Y.preventDefault(),!u(d))return;T(i,!0),T(o,null);const U=await pt.login(u(r),u(s));if(T(i,!1),!U.ok){T(o,g(U.error??"Sign-in failed."),!0);return}}function g(Y){return Y.includes("locked")?"Account temporarily locked, try again shortly.":Y.includes("credentials")?"Invalid credentials. Check your username and password.":Y}var f=WD(),p=y(f),v=y(p),b=y(v);{var E=Y=>{var U=HD();re(()=>Ee(U,"src",Dn.logoUrl)),F(Y,U)};ce(b,Y=>{Dn.logoUrl&&Y(E)})}var _=C(b,2),R=y(_),O=C(_,2);{var B=Y=>{var U=qD();F(Y,U)},M=Y=>{var U=jD();F(Y,U)};ce(O,Y=>{pt.firstRun?Y(B):Y(M,-1)})}var J=C(v,2),H=y(J),G=C(y(H),2);$a(G,!0);var X=C(H,2),ee=C(y(X),2),A=C(X,2);{var j=Y=>{var U=YD(),K=C(y(U),2),te=C(K,2);{var fe=me=>{var ge=$D();F(me,ge)};ce(te,me=>{u(l)&&me(fe)})}wt(K,()=>u(a),me=>T(a,me)),F(Y,U)};ce(A,Y=>{pt.firstRun&&Y(j)})}var w=C(A,2);{var S=Y=>{var U=zD(),K=y(U);re(()=>ae(K,u(o))),F(Y,U)};ce(w,Y=>{u(o)&&Y(S)})}var x=C(w,2),k=y(x);{var W=Y=>{var U=Sl();re(()=>ae(U,pt.firstRun?"Creating…":"Signing in…")),F(Y,U)},$=Y=>{var U=Sl();re(()=>ae(U,pt.firstRun?"Create admin account":"Sign in")),F(Y,U)};ce(k,Y=>{u(i)?Y(W):Y($,-1)})}re(()=>{ae(R,u(n)),Ee(ee,"autocomplete",pt.firstRun?"new-password":"current-password"),x.disabled=!u(d)}),He("submit",J,h),wt(G,()=>u(r),Y=>T(r,Y)),wt(ee,()=>u(s),Y=>T(s,Y)),F(t,f),it()}var KD=z('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),VD=z('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),XD=z('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),QD=z('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),ZD=z('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),JD=z("<li><!></li>"),ek=z('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),tk=z('<dialog aria-label="Problems" class="svelte-7emrh2"><h2 class="svelte-7emrh2">Problems</h2> <!> <div class="actions svelte-7emrh2"><button type="button" class="ghost svelte-7emrh2">Re-check</button> <button type="button" class="primary svelte-7emrh2">Close</button></div></dialog>');function nk(t,e){at(e,!0);let n;const r=_e(()=>Sn.errors),s=_e(()=>Sn.warnings);Rt(()=>{Sn.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(_){Nf.request(_),Sn.closePanel()}function i(_){_.preventDefault(),Sn.closePanel()}function o(_){_.target===n&&Sn.closePanel()}var l=tk(),d=C(y(l),2);{var h=_=>{var R=KD();F(_,R)},g=_=>{var R=VD();F(_,R)},f=_=>{var R=XD();F(_,R)},p=_=>{var R=ek(),O=tt(R),B=y(O),M=C(B);{var J=G=>{var X=Sl();re(()=>ae(X,`,
138
+ and components directly.</p></div></div>`),fD=z('<div class="panes svelte-whg6dh"><aside class="tree svelte-whg6dh" aria-label="Content"><div class="tree-head svelte-whg6dh"><h2 class="tree-title svelte-whg6dh">Content</h2> <div class="tree-head-actions svelte-whg6dh"><button type="button" class="add svelte-whg6dh" title="New folder" aria-label="New folder"><!></button> <button type="button" class="add svelte-whg6dh" title="New content item" aria-label="New content item"><!></button></div></div> <div class="search svelte-whg6dh"><!> <input type="search" role="combobox" placeholder="Search titles…" aria-label="Search content by title" aria-controls="search-results" aria-autocomplete="list" class="svelte-whg6dh"/></div> <!></aside> <!> <main class="work svelte-whg6dh"><!></main></div>'),hD=z('<button type="button" class="menu-backdrop svelte-whg6dh" aria-label="Close menu"></button> <div class="context-menu svelte-whg6dh" role="menu" tabindex="-1"><button type="button" role="menuitem" class="svelte-whg6dh">Add content…</button> <button type="button" role="menuitem" class="svelte-whg6dh">Add folder…</button></div>',1),pD=z('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!> <!>',1);function mD(t,e){at(e,!0);let n=Q(null);Rt(()=>{const L=Nf.target;L!==null&&(Nf.clear(),(async()=>await xv("Opening this item will close the open file.")&&(wr.set("content"),await B(L)))())});let r=Q(null),s=Q(""),a=Q(null),i=Q(!1);function o(L){return L==="index"?"":L.endsWith("/index")?L.slice(0,-6):null}const l=_e(()=>u(r)??(u(n)!==null?o(u(n).path):null)),d=_e(()=>u(n)!==null&&o(u(n).path)!==null),f=_e(()=>{var L;return((L=u(n))==null?void 0:L.path)==="index"});let g=Q(""),h=Q(ct([])),p=Q(-1),v=Q(void 0),_;Rt(()=>{const L=u(g);if(clearTimeout(_),L.trim()===""){T(h,[],!0),T(p,-1);return}return _=setTimeout(()=>{vv(L).then(ue=>{L===u(g)&&(T(h,ue,!0),T(p,ue.length>0?0:-1,!0))})},200),()=>clearTimeout(_)});function E(){Hm().then(()=>{var L,ue;return(ue=(L=u(v))==null?void 0:L.children[u(p)])==null?void 0:ue.scrollIntoView({block:"nearest"})})}function b(L){if(L.key==="Escape"){T(g,"");return}if(u(h).length!==0){if(L.key==="ArrowDown")L.preventDefault(),T(p,(u(p)+1)%u(h).length),E();else if(L.key==="ArrowUp")L.preventDefault(),T(p,(u(p)-1+u(h).length)%u(h).length),E();else if(L.key==="Enter"){L.preventDefault();const ue=u(h)[u(p)]??u(h)[0];ue!==void 0&&G(ue)}}}Za(()=>{dc("").catch(Te=>{T(a,Te instanceof Error?Te.message:String(Te),!0)}),Ie();const L=Te=>{Af.hasDirty&&(Te.preventDefault(),Te.returnValue="")};window.addEventListener("beforeunload",L);const ue=M6({reconcileOnce:async()=>{const Te=await Ge("/api/reconcile",{method:"POST"});return Te.ok?P6(await Te.json().catch(()=>null)):{changed:!1,added:0,removed:0}},onChanged:()=>{S6(),R6()},isVisible:()=>document.visibilityState==="visible"});return ue.start(),()=>{window.removeEventListener("beforeunload",L),ue.stop()}});function x(L){return L.includes("/")?L.slice(0,L.lastIndexOf("/")):""}function O(L){return u(n)!==null&&(u(n).path===L||u(n).path.startsWith(`${L}/`))}async function M(L,ue){try{const Te=await Ip(L);T(r,null),T(n,{item:Te,path:L,templateName:ue},!0)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te))}}async function B(L){try{const ue=await Ip(L);T(r,null),T(n,{item:ue,path:L,templateName:await $N(L,ue.template)},!0)}catch(ue){await Fn(ue instanceof Error?ue.message:String(ue))}}async function J(L){const ue=L===""?"index":`${L}/index`;await l6(ue)?await B(ue):(T(n,null),await Ie(),T(s,await pf(L),!0),T(r,L,!0))}async function H(L){const ue=u(r);if(ue===null)return;const Te=ue===""?"index":`${ue}/index`,De=await pf(ue);try{await Av(Te,De,L)}catch(Xe){await Fn(Xe instanceof Error?Xe.message:String(Xe));return}await xn(ue),await vo(Te),await B(Te)}async function G(L){T(g,""),await vo(L.path),await M(L.path,L.template)}async function X(L,ue){try{await h6(L,ue)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te)),await xn(L)}}async function ee(L,ue,Te){var Ke;const De=x(L);if(Te===De)return;let Xe;try{Xe=ue==="item"?await g6(L,Te):await v6(L,Te)}catch(Et){await Fn(Et instanceof Error?Et.message:String(Et));return}ue==="item"?await $u(cr(L),cr(Xe)):await $u(`${cr(L)}*`,`${cr(Xe)}:splat`),await xn(De),await xn(Te),await vo(Xe),ue==="item"&&((Ke=u(n))==null?void 0:Ke.path)===L?await B(Xe):ue==="dir"&&O(L)&&T(n,null)}async function A(L){L.preventDefault();const ue=Ti();Ms(),ue!==null&&ue.parent!==""&&await ee(ue.entry.path,ue.entry.kind,"")}async function j(L){u(n)!==null&&await ee(u(n).path,"item",L)}async function w(L){const ue=u(ft);T(ft,null),ue!==null&&await ee(ue,"dir",L)}async function S(L){if(u(n)===null)return;const{path:ue}=u(n);try{await Cp(ue,L)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te));return}await xn(x(ue)),await B(ue)}const R=_e(()=>_i("")!==void 0),k=_e(()=>{var L;return(((L=_i(""))==null?void 0:L.entries.length)??-1)===0}),W=_e(()=>{const L=_i(""),ue=L==null?void 0:L.entries.find(Te=>Te.kind==="item"&&Te.slug==="index");return(ue==null?void 0:ue.kind)==="item"?ue:void 0}),$=_e(()=>{var Te;const L=u(W);return L===void 0?"missing":(L.template??((Te=_i(""))==null?void 0:Te.defaultTemplate))===void 0?"broken":L.isPublished?"published":"draft"}),Y=_e(()=>{switch(u($)){case"missing":return"Home, the site’s front page (/). No page yet — click to create.";case"broken":return"Home page exists but its template is missing — click to fix.";case"draft":return"Home, the site’s front page (/). Draft, not yet published.";case"published":return"Home, the site’s front page (/)."}});let U=Q(!1);async function K(L){if(!(u(n)===null||L==="")){T(U,!0);try{await Cp(u(n).path,L),await xn(x(u(n).path)),await B(u(n).path)}catch(ue){await Fn(ue instanceof Error?ue.message:String(ue))}finally{T(U,!1)}}}let te=Q(!1),fe=Q(!1);Rt(()=>{!u(fe)&&!u(te)&&pt.isAdmin&&u(R)&&u(k)&&(T(fe,!0),me())});async function me(){T(te,!0);try{await e6(),F6(localStorage),await xn(""),await Ie(),await B("index")}catch(L){if(L instanceof Error&&/already has content/i.test(L.message))return;await Fn(L instanceof Error?L.message:String(L))}finally{T(te,!1)}}let ge=Q(!1),Le=Q(""),de=Q(ct([])),ve=Q(ct([]));async function Ie(){const L=await gf("templates");T(de,L.filter(ue=>ue!==bu&&!jd(ue.split("/").pop()??ue)),!0)}async function se(L){await Ie(),T(ve,await ff(),!0),T(Le,L,!0),T(ge,!0)}async function he(){await se("")}async function Ae(L){T(ge,!1),await xn(x(L)),await vo(L),await B(L)}async function Ce(L){const ue=await Bo("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ue===null||ue.trim()==="")return;let Te;try{Te=await c6(L,ue)}catch(De){await Fn(De instanceof Error?De.message:String(De));return}await xn(L),await vo(`${Te}/_`)}async function Me(){const L=u(ft);T(ft,null),L!==null&&await Ce(L)}let ke=Q(null);function dt(L,ue,Te){T(ke,{x:ue,y:Te,path:L},!0)}function Be(){T(ke,null)}async function It(){var ue;const L=((ue=u(ke))==null?void 0:ue.path)??"";Be(),await se(L)}async function Dt(){var ue;const L=(ue=u(ke))==null?void 0:ue.path;Be(),L!==void 0&&await Ce(L)}function Lt(L){var Te;const ue=L.getBoundingClientRect();ue.right>window.innerWidth&&(L.style.left=`${window.innerWidth-ue.width-8}px`),ue.bottom>window.innerHeight&&(L.style.top=`${window.innerHeight-ue.height-8}px`),(Te=L.querySelector("button"))==null||Te.focus()}let ft=Q(null);async function Vt(L){await Ie(),T(ve,await ff(),!0),T(ft,L,!0)}async function qt(){const L=u(ft);T(ft,null),L!==null&&await xn(L),u(n)!==null&&await B(u(n).path)}async function Pt(){const L=u(ft);T(ft,null),L!==null&&await mt(L)}async function Gt(){const L=u(ft);T(ft,null),L!==null&&await Mt(L)}async function Mt(L){const ue=ml(L);if(await Bl(`Delete the folder “${ue}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ml(yi(L))}catch(De){await Fn(De instanceof Error?De.message:String(De));return}O(L)&&T(n,null),await xn(x(L))}}async function mt(L){const ue=ml(L),Te=await Bo("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(Te===null)return;const De=_s(Te);if(De===""||De===ue)return;const Xe=yp(L,De);try{await Wa(yi(L),yi(Xe))}catch(Ke){await Fn(Ke instanceof Error?Ke.message:String(Ke));return}await $u(`${cr(L)}*`,`${cr(Xe)}:splat`),O(L)&&T(n,null),await xn(x(L))}async function yt(){if(u(n)===null)return;const{path:L,item:ue}=u(n);if(await Bl(`Delete “${ue.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ml(Ws(L))}catch(De){await Fn(De instanceof Error?De.message:String(De));return}Dp(localStorage,L),T(n,null),await xn(x(L))}}async function Bt(){if(u(n)===null)return;const L=u(n).path,ue=ml(L),Te=await Bo("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(Te===null)return;const De=_s(Te);if(De===""||De===ue)return;const Xe=yp(L,De);try{await Wa(Ws(L),Ws(Xe))}catch(Ke){await Fn(Ke instanceof Error?Ke.message:String(Ke));return}Dp(localStorage,L),await $u(cr(L),cr(Xe)),await xn(x(L)),await B(Xe)}let ot=Q(null),nt=Q(null);Rt(()=>{wr.mode==="templates"&&u(ot)===null&&mp(()=>import("./TemplatesPane-B61rHJkg.js").then(L=>L.T),__vite__mapDeps([0,1]),import.meta.url).then(L=>{T(ot,L.default,!0)}),wr.mode==="migrations"&&u(nt)===null&&mp(()=>import("./MigrationsPane-Gl4TRput.js"),__vite__mapDeps([2,3]),import.meta.url).then(L=>{T(nt,L.default,!0)})});var bt=pD(),An=tt(bt),yn=y(An);$R(yn,{});var ln=C(yn,2),Zn=y(ln);{var Jn=L=>{hx(L,{})},jt=L=>{var ue=Kn(),Te=tt(ue);{var De=Ke=>{var Et=Kn(),cn=tt(Et);kd(cn,()=>u(ot),(Nt,tr)=>{tr(Nt,{})}),F(Ke,Et)},Xe=Ke=>{var Et=QR();F(Ke,Et)};ce(Te,Ke=>{u(ot)?Ke(De):Ke(Xe,-1)})}F(L,ue)},en=L=>{var ue=Kn(),Te=tt(ue);{var De=Ke=>{var Et=Kn(),cn=tt(Et);kd(cn,()=>u(nt),(Nt,tr)=>{tr(Nt,{})}),F(Ke,Et)},Xe=Ke=>{var Et=ZR();F(Ke,Et)};ce(Te,Ke=>{u(nt)?Ke(De):Ke(Xe,-1)})}F(L,ue)},Hr=L=>{var ue=fD(),Te=y(ue),De=y(Te),Xe=C(y(De),2),Ke=y(Xe),Et=y(Ke);X6(Et,{size:18,"aria-hidden":"true"});var cn=C(Ke,2),Nt=y(cn);Y6(Nt,{size:18,"aria-hidden":"true"});var tr=C(De,2),Os=y(tr);Mv(Os,{class:"search-icon",size:16,"aria-hidden":"true"});var qr=C(Os,2),la=C(tr,2);{var ca=Se=>{var we=JR(),qe=y(we);re(()=>ae(qe,`Couldn’t load content: ${u(a)??""}`)),F(Se,we)},Xt=Se=>{var we=Kn(),qe=tt(we);{var gt=Yt=>{var tn=eD(),gn=y(tn);re(nn=>ae(gn,`No matches for “${nn??""}”.`),[()=>u(g).trim()]),F(Yt,tn)},$t=Yt=>{var tn=nD();St(tn,23,()=>u(h),gn=>gn.path,(gn,nn,nr)=>{var Ft=tD();let rn;var At=y(Ft),Ut=y(At),rr=C(At,2),sr=y(rr);re(()=>{Ee(Ft,"id",`search-option-${u(nr)}`),rn=Ve(Ft,1,"result svelte-whg6dh",null,rn,{active:u(nr)===u(p),unpublished:!u(nn).isPublished}),Ee(Ft,"aria-selected",u(nr)===u(p)),Ee(Ft,"aria-label",u(nn).isPublished?void 0:`${u(nn).title}, not published`),ae(Ut,u(nn).title),ae(sr,u(nn).path)}),ie("click",Ft,()=>G(u(nn))),He("mouseenter",Ft,()=>T(p,u(nr),!0)),F(gn,Ft)}),mn(tn,gn=>T(v,gn),()=>u(v)),F(Yt,tn)};ce(qe,Yt=>{u(h).length===0?Yt(gt):Yt($t,-1)})}F(Se,we)},da=_e(()=>u(g).trim()!==""),fa=Se=>{var we=iD(),qe=y(we);let gt;var $t=y(qe);G6($t,{size:16,"aria-hidden":"true"});var Yt=C($t,4);{var tn=At=>{var Ut=rD();F(At,Ut)},gn=At=>{var Ut=sD();F(At,Ut)};ce(Yt,At=>{u($)==="broken"?At(tn):u($)==="draft"&&At(gn,1)})}var nn=C(qe,2);{let At=_e(()=>{var Ut;return((Ut=u(n))==null?void 0:Ut.path)??null});Jb(nn,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return u(At)},get activeDir(){return u(l)},onselect:M,onopenDir:J,onsettingsDir:Vt,onfoldermenu:dt,onreorder:X,onmove:ee})}var nr=C(nn,2);{var Ft=At=>{var Ut=aD();let rr;re(sr=>rr=Ve(Ut,1,"root-drop svelte-whg6dh",null,rr,sr),[()=>({over:Ti()!==null&&u(i)})]),He("dragover",Ut,sr=>{sr.preventDefault(),T(i,!0)}),He("dragleave",Ut,()=>T(i,!1)),He("drop",Ut,sr=>{T(i,!1),A(sr)}),F(At,Ut)},rn=_e(()=>{var At;return Ti()!==null&&((At=Ti())==null?void 0:At.parent)!==""});ce(nr,At=>{u(rn)&&At(Ft)})}re(()=>{gt=Ve(qe,1,"home-row svelte-whg6dh",null,gt,{active:u(l)==="",unpublished:u($)==="draft"||u($)==="broken",broken:u($)==="broken"}),Ee(qe,"aria-current",u(l)===""),Ee(qe,"title",u(Y))}),ie("click",qe,()=>J("")),F(Se,we)};ce(la,Se=>{u(a)?Se(ca):u(da)?Se(Xt,1):Se(fa,-1)})}var xs=C(Te,2);Nx(xs,{});var ha=C(xs,2),pa=y(ha);{var dn=Se=>{var we=Kn(),qe=tt(we);B_(qe,()=>`${u(n).path}\0${u(n).templateName}`,gt=>{{let $t=_e(()=>u(d)?void 0:Bt),Yt=_e(()=>u(f)?void 0:yt);S5(gt,{get item(){return u(n).item},get templateName(){return u(n).templateName},get path(){return u(n).path},get templates(){return u(de)},get onrename(){return u($t)},get ondelete(){return u(Yt)},onchangetemplate:S,onmove:j,onsaved:(tn,gn,nn)=>{I6(tn,gn),C6(tn,nn)}})}}),F(Se,we)},Rs=Se=>{var we=lD(),qe=y(we),gt=C(y(qe),4),$t=C(y(gt),2),Yt=y($t),tn=y(Yt);Yt.value=Yt.__value="";var gn=C(Yt);St(gn,16,()=>u(de),Ft=>Ft,(Ft,rn)=>{var At=oD(),Ut=y(At),rr={};re(()=>{ae(Ut,rn),rr!==(rr=rn)&&(At.value=(At.__value=rn)??"")}),F(Ft,At)});var nn=C(gt,2);{var nr=Ft=>{var rn=uD();re(()=>rn.disabled=u(U)),ie("click",rn,yt),F(Ft,rn)};ce(nn,Ft=>{u(f)||Ft(nr)})}re(()=>{$t.disabled=u(U)||u(de).length===0,ae(tn,u(de).length===0?"No templates exist yet":"Choose…")}),ie("change",$t,Ft=>K(Ft.currentTarget.value)),F(Se,we)},ma=Se=>{gx(Se,{get folderPath(){return u(r)},get name(){return u(s)},get templates(){return u(de)},oncreate:H})},ga=Se=>{var we=cD();F(Se,we)},va=Se=>{var we=dD();F(Se,we)};ce(pa,Se=>{u(n)&&u(n).templateName?Se(dn):u(n)?Se(Rs,1):u(r)!==null?Se(ma,2):pt.isAdmin&&u(R)&&u(k)?Se(ga,3):Se(va,-1)})}re(()=>{Ee(qr,"aria-expanded",u(h).length>0),Ee(qr,"aria-activedescendant",u(p)>=0?`search-option-${u(p)}`:void 0)}),ie("click",Ke,()=>Ce("")),ie("click",cn,he),ie("keydown",qr,b),wt(qr,()=>u(g),Se=>T(g,Se)),F(L,ue)};ce(Zn,L=>{Es.active?L(Jn):wr.mode==="templates"?L(jt,1):wr.mode==="migrations"?L(en,2):L(Hr,-1)})}var us=C(ln,2);x5(us,{});var er=C(An,2);{var ls=L=>{Y5(L,{get folders(){return u(ve)},get templates(){return u(de)},get initialFolder(){return u(Le)},oncreated:Ae,oncancel:()=>T(ge,!1)})};ce(er,L=>{u(ge)&&L(ls)})}var Ne=C(er,2);{var ze=L=>{var ue=hD(),Te=tt(ue),De=C(Te,2),Xe=y(De),Ke=C(Xe,2);$_(De,Et=>Lt==null?void 0:Lt(Et)),re(()=>Jl(De,`left: ${u(ke).x}px; top: ${u(ke).y}px`)),ie("click",Te,Be),ie("contextmenu",Te,Et=>{Et.preventDefault(),Be()}),ie("keydown",De,Et=>{Et.key==="Escape"&&Be()}),ie("click",Xe,It),ie("click",Ke,Dt),F(L,ue)};ce(Ne,L=>{u(ke)!==null&&L(ze)})}var Qe=C(Ne,2);{var Je=L=>{U5(L,{get folderPath(){return u(ft)},get templates(){return u(de)},get folders(){return u(ve)},onsaved:qt,oncancel:()=>T(ft,null),onnewsubfolder:Me,onrenamefolder:Pt,ondeletefolder:Gt,onmove:w})};ce(Qe,L=>{u(ft)!==null&&L(Je)})}F(t,bt),it()}Tt(["click","keydown","change","contextmenu"]);var gD=z('<h2 class="svelte-z86ibt"> </h2>'),vD=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <input class="svelte-z86ibt"/></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),bD=z('<h2 class="svelte-z86ibt"> </h2>'),ED=z("<option> </option>"),_D=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <select class="svelte-z86ibt"><option disabled=""> </option><!></select></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),TD=z('<h2 class="svelte-z86ibt"> </h2>'),AD=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button></div>',1),yD=z('<h2 class="svelte-z86ibt"> </h2>'),ND=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions decide-actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button> <button type="button" class="primary svelte-z86ibt"> </button></div>',1),wD=z('<h2 class="svelte-z86ibt"> </h2>'),SD=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),ID=z('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function CD(t,e){at(e,!0);let n,r=Q(""),s=Q("");Rt(()=>{const p=Yu.pending;p?(p.kind==="prompt"&&T(r,p.options.value??"",!0),p.kind==="select"&&T(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const p=Yu.pending;(p==null?void 0:p.kind)==="confirm"?Xc(!1):(p==null?void 0:p.kind)==="prompt"?Qc(null):(p==null?void 0:p.kind)==="select"?Zc(null):(p==null?void 0:p.kind)==="decide"?zu("cancel"):xp()}function i(p){p.preventDefault(),a()}function o(p){p.target===n&&a()}function l(p){p.preventDefault(),Qc(u(r))}function d(p){p.preventDefault(),u(s)!==""&&Zc(u(s))}var f=ID(),g=y(f);{var h=p=>{const v=_e(()=>Yu.pending);var _=Kn(),E=tt(_);{var b=J=>{var H=vD(),G=y(H);{var X=$=>{var Y=gD(),U=y(Y);re(()=>ae(U,u(v).options.title)),F($,Y)};ce(G,$=>{u(v).options.title&&$(X)})}var ee=C(G,2),A=y(ee),j=y(A),w=C(A,2);$a(w,!0);var S=C(ee,2),R=y(S),k=C(R,2),W=y(k);re(()=>{ae(j,u(v).message),Ee(w,"placeholder",u(v).options.placeholder??""),ae(W,u(v).options.confirmLabel??"OK")}),He("submit",H,l),wt(w,()=>u(r),$=>T(r,$)),ie("click",R,()=>Qc(null)),F(J,H)},x=J=>{var H=_D(),G=y(H);{var X=K=>{var te=bD(),fe=y(te);re(()=>ae(fe,u(v).options.title)),F(K,te)};ce(G,K=>{u(v).options.title&&K(X)})}var ee=C(G,2),A=y(ee),j=y(A),w=C(A,2);$a(w,!0);var S=y(w),R=y(S);S.value=S.__value="";var k=C(S);St(k,17,()=>u(v).choices,K=>K.value,(K,te)=>{var fe=ED(),me=y(fe),ge={};re(()=>{ae(me,u(te).label),ge!==(ge=u(te).value)&&(fe.value=(fe.__value=u(te).value)??"")}),F(K,fe)});var W=C(ee,2),$=y(W),Y=C($,2),U=y(Y);re(()=>{ae(j,u(v).message),ae(R,u(v).options.placeholder??"Choose…"),Y.disabled=u(s)==="",ae(U,u(v).options.confirmLabel??"OK")}),He("submit",H,d),Ya(w,()=>u(s),K=>T(s,K)),ie("click",$,()=>Zc(null)),F(J,H)},O=J=>{var H=AD(),G=tt(H);{var X=$=>{var Y=TD(),U=y(Y);re(()=>ae(U,u(v).options.title)),F($,Y)};ce(G,$=>{u(v).options.title&&$(X)})}var ee=C(G,2),A=y(ee),j=C(ee,2),w=y(j),S=y(w),R=C(w,2);let k;var W=y(R);re(()=>{ae(A,u(v).message),ae(S,u(v).options.cancelLabel??"Cancel"),k=Ve(R,1,"primary svelte-z86ibt",null,k,{danger:u(v).options.danger}),ae(W,u(v).options.confirmLabel??"Confirm")}),ie("click",w,()=>Xc(!1)),ie("click",R,()=>Xc(!0)),F(J,H)},M=J=>{var H=ND(),G=tt(H);{var X=U=>{var K=yD(),te=y(K);re(()=>ae(te,u(v).options.title)),F(U,K)};ce(G,U=>{u(v).options.title&&U(X)})}var ee=C(G,2),A=y(ee),j=C(ee,2),w=y(j),S=y(w),R=C(w,2);let k;var W=y(R),$=C(R,2),Y=y($);re(()=>{ae(A,u(v).message),ae(S,u(v).options.cancelLabel),k=Ve(R,1,"ghost svelte-z86ibt",null,k,{"danger-ghost":u(v).options.secondaryDanger}),ae(W,u(v).options.secondaryLabel),ae(Y,u(v).options.primaryLabel)}),ie("click",w,()=>zu("cancel")),ie("click",R,()=>zu("secondary")),ie("click",$,()=>zu("primary")),F(J,H)},B=J=>{var H=SD(),G=tt(H);{var X=S=>{var R=wD(),k=y(R);re(()=>ae(k,u(v).options.title)),F(S,R)};ce(G,S=>{u(v).options.title&&S(X)})}var ee=C(G,2),A=y(ee),j=C(ee,2),w=y(j);re(()=>ae(A,u(v).message)),ie("click",w,()=>xp()),F(J,H)};ce(E,J=>{u(v).kind==="prompt"?J(b):u(v).kind==="select"?J(x,1):u(v).kind==="confirm"?J(O,2):u(v).kind==="decide"?J(M,3):J(B,-1)})}F(p,_)};ce(g,p=>{Yu.pending&&p(h)})}mn(f,p=>n=p,()=>n),He("cancel",f,i),ie("click",f,o),F(t,f),it()}Tt(["click"]);var LD=z('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),OD=z('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),xD=z('<p class="hint svelte-o6yxmi">No matching pages.</p>'),RD=z('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),DD=z('<div class="search svelte-o6yxmi"><!> <input type="search" role="combobox" placeholder="Search pages by title…" aria-label="Search pages by title" aria-controls="link-results" aria-autocomplete="list" class="svelte-o6yxmi"/></div> <div class="results-area svelte-o6yxmi"><!></div>',1),kD=z('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),PD=z('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),MD=z('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),BD=z('<h2 class="svelte-o6yxmi">Link</h2> <div class="tabs svelte-o6yxmi" role="tablist" aria-label="Link type"><button type="button" role="tab">Page</button> <button type="button" role="tab">External URL</button></div> <div class="body svelte-o6yxmi"><!></div> <div class="actions svelte-o6yxmi"><button type="button" class="ghost svelte-o6yxmi">Cancel</button> <!> <!></div>',1),FD=z('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function UD(t,e){at(e,!0);let n=Q(void 0),r=Q("page"),s=Q(""),a=Q(ct([])),i=Q(-1),o=Q(""),l=Q(void 0);const d=_e(()=>zw.pending);Rt(()=>{var O,M;if(u(d)===null){(O=u(n))==null||O.close();return}const x=u(d).current;T(r,x===""||Qo(x)?"page":"url",!0),T(s,""),T(a,[],!0),T(i,-1),T(o,Qo(x)?"":x,!0),(M=u(n))==null||M.showModal()});let f;Rt(()=>{const x=u(s);if(clearTimeout(f),u(r)!=="page"||x.trim()===""){T(a,[],!0),T(i,-1);return}return f=setTimeout(()=>{vv(x).then(O=>{x===u(s)&&(T(a,O,!0),T(i,O.length>0?0:-1,!0))})},200),()=>clearTimeout(f)});function g(x){ci(Ww(x.path))}function h(){const x=u(o).trim();x!==""&&ci(x)}function p(){var x,O;(O=(x=u(l))==null?void 0:x.children[u(i)])==null||O.scrollIntoView({block:"nearest"})}function v(x){if(u(a).length!==0){if(x.key==="ArrowDown")x.preventDefault(),T(i,(u(i)+1)%u(a).length),p();else if(x.key==="ArrowUp")x.preventDefault(),T(i,(u(i)-1+u(a).length)%u(a).length),p();else if(x.key==="Enter"){x.preventDefault();const O=u(a)[u(i)]??u(a)[0];O!==void 0&&g(O)}}}var _=FD(),E=y(_);{var b=x=>{var O=BD(),M=C(tt(O),2),B=y(M);let J;var H=C(B,2);let G;var X=C(M,2),ee=y(X);{var A=Y=>{var U=DD(),K=tt(U),te=y(K);Mv(te,{class:"search-icon",size:16,"aria-hidden":"true"});var fe=C(te,2);$a(fe,!0);var me=C(K,2),ge=y(me);{var Le=se=>{var he=OD();St(he,23,()=>u(a),Ae=>Ae.path,(Ae,Ce,Me)=>{var ke=LD();let dt;var Be=y(ke),It=y(Be),Dt=C(Be,2),Lt=y(Dt);re(()=>{Ee(ke,"id",`link-option-${u(Me)}`),dt=Ve(ke,1,"result svelte-o6yxmi",null,dt,{active:u(Me)===u(i)}),Ee(ke,"aria-selected",u(Me)===u(i)),ae(It,u(Ce).title),ae(Lt,u(Ce).path)}),ie("click",ke,()=>g(u(Ce))),He("mouseenter",ke,()=>T(i,u(Me),!0)),F(Ae,ke)}),mn(he,Ae=>T(l,Ae),()=>u(l)),F(se,he)},de=se=>{var he=xD();F(se,he)},ve=_e(()=>u(s).trim()!==""),Ie=se=>{var he=RD();F(se,he)};ce(ge,se=>{u(a).length>0?se(Le):u(ve)?se(de,1):se(Ie,-1)})}re(()=>{Ee(fe,"aria-expanded",u(a).length>0),Ee(fe,"aria-activedescendant",u(i)>=0?`link-option-${u(i)}`:void 0)}),ie("keydown",fe,v),wt(fe,()=>u(s),se=>T(s,se)),F(Y,U)},j=Y=>{var U=kD(),K=C(y(U),2);ie("keydown",K,te=>{te.key==="Enter"&&(te.preventDefault(),h())}),wt(K,()=>u(o),te=>T(o,te)),F(Y,U)};ce(ee,Y=>{u(r)==="page"?Y(A):Y(j,-1)})}var w=C(X,2),S=y(w),R=C(S,2);{var k=Y=>{var U=PD();ie("click",U,()=>ci("")),F(Y,U)};ce(R,Y=>{u(d).current!==""&&Y(k)})}var W=C(R,2);{var $=Y=>{var U=MD();re(K=>U.disabled=K,[()=>u(o).trim()===""]),ie("click",U,h),F(Y,U)};ce(W,Y=>{u(r)==="url"&&Y($)})}re(()=>{J=Ve(B,1,"tab svelte-o6yxmi",null,J,{active:u(r)==="page"}),Ee(B,"aria-selected",u(r)==="page"),G=Ve(H,1,"tab svelte-o6yxmi",null,G,{active:u(r)==="url"}),Ee(H,"aria-selected",u(r)==="url")}),ie("click",B,()=>T(r,"page")),ie("click",H,()=>T(r,"url")),ie("click",S,()=>ci(null)),F(x,O)};ce(E,x=>{u(d)!==null&&x(b)})}mn(_,x=>T(n,x),()=>u(n)),He("close",_,()=>ci(null)),He("cancel",_,()=>ci(null)),F(t,_),it()}Tt(["click","keydown"]);var HD=z('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),qD=z(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
139
+ password.</p>`),jD=z('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),$D=z(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),YD=z('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),zD=z('<p class="error svelte-2jpsc9" role="alert"> </p>'),WD=z('<main class="screen svelte-2jpsc9"><section class="panel svelte-2jpsc9"><header class="svelte-2jpsc9"><!> <h1 class="svelte-2jpsc9"> </h1> <!></header> <form autocomplete="on" class="svelte-2jpsc9"><label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Username</span> <input type="text" name="username" autocomplete="username" required="" class="svelte-2jpsc9"/></label> <label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Password</span> <input type="password" name="password" required="" class="svelte-2jpsc9"/></label> <!> <!> <button type="submit" class="primary svelte-2jpsc9"><!></button></form></section></main>');function GD(t,e){at(e,!0);const n=_e(()=>Dn.name??"nanoesis");let r=Q(""),s=Q(""),a=Q(""),i=Q(!1),o=Q(null),l=_e(()=>pt.firstRun&&u(a)!==""&&u(s)!==u(a)),d=_e(()=>!u(i)&&u(r).trim()!==""&&u(s)!==""&&(!pt.firstRun||u(a)!==""&&!u(l)));async function f(Y){if(Y.preventDefault(),!u(d))return;T(i,!0),T(o,null);const U=await pt.login(u(r),u(s));if(T(i,!1),!U.ok){T(o,g(U.error??"Sign-in failed."),!0);return}}function g(Y){return Y.includes("locked")?"Account temporarily locked, try again shortly.":Y.includes("credentials")?"Invalid credentials. Check your username and password.":Y}var h=WD(),p=y(h),v=y(p),_=y(v);{var E=Y=>{var U=HD();re(()=>Ee(U,"src",Dn.logoUrl)),F(Y,U)};ce(_,Y=>{Dn.logoUrl&&Y(E)})}var b=C(_,2),x=y(b),O=C(b,2);{var M=Y=>{var U=qD();F(Y,U)},B=Y=>{var U=jD();F(Y,U)};ce(O,Y=>{pt.firstRun?Y(M):Y(B,-1)})}var J=C(v,2),H=y(J),G=C(y(H),2);$a(G,!0);var X=C(H,2),ee=C(y(X),2),A=C(X,2);{var j=Y=>{var U=YD(),K=C(y(U),2),te=C(K,2);{var fe=me=>{var ge=$D();F(me,ge)};ce(te,me=>{u(l)&&me(fe)})}wt(K,()=>u(a),me=>T(a,me)),F(Y,U)};ce(A,Y=>{pt.firstRun&&Y(j)})}var w=C(A,2);{var S=Y=>{var U=zD(),K=y(U);re(()=>ae(K,u(o))),F(Y,U)};ce(w,Y=>{u(o)&&Y(S)})}var R=C(w,2),k=y(R);{var W=Y=>{var U=Sl();re(()=>ae(U,pt.firstRun?"Creating…":"Signing in…")),F(Y,U)},$=Y=>{var U=Sl();re(()=>ae(U,pt.firstRun?"Create admin account":"Sign in")),F(Y,U)};ce(k,Y=>{u(i)?Y(W):Y($,-1)})}re(()=>{ae(x,u(n)),Ee(ee,"autocomplete",pt.firstRun?"new-password":"current-password"),R.disabled=!u(d)}),He("submit",J,f),wt(G,()=>u(r),Y=>T(r,Y)),wt(ee,()=>u(s),Y=>T(s,Y)),F(t,h),it()}var KD=z('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),VD=z('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),XD=z('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),QD=z('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),ZD=z('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),JD=z("<li><!></li>"),ek=z('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),tk=z('<dialog aria-label="Problems" class="svelte-7emrh2"><h2 class="svelte-7emrh2">Problems</h2> <!> <div class="actions svelte-7emrh2"><button type="button" class="ghost svelte-7emrh2">Re-check</button> <button type="button" class="primary svelte-7emrh2">Close</button></div></dialog>');function nk(t,e){at(e,!0);let n;const r=_e(()=>Sn.errors),s=_e(()=>Sn.warnings);Rt(()=>{Sn.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(b){Nf.request(b),Sn.closePanel()}function i(b){b.preventDefault(),Sn.closePanel()}function o(b){b.target===n&&Sn.closePanel()}var l=tk(),d=C(y(l),2);{var f=b=>{var x=KD();F(b,x)},g=b=>{var x=VD();F(b,x)},h=b=>{var x=XD();F(b,x)},p=b=>{var x=ek(),O=tt(x),M=y(O),B=C(M);{var J=G=>{var X=Sl();re(()=>ae(X,`,
140
140
  ${u(s).length??""}
141
- ${u(s).length===1?"warning":"warnings"}`)),F(G,X)};ce(M,G=>{u(s).length>0&&G(J)})}var H=C(O,2);St(H,21,()=>[...u(r),...u(s)],zo,(G,X)=>{var ee=JD(),A=y(ee);{var j=S=>{var x=QD(),k=y(x),W=y(k),$=C(k,2),Y=y($);re(()=>{ae(W,u(X).severity),ae(Y,u(X).message)}),ie("click",x,()=>a(u(X).path??"")),F(S,x)},w=S=>{var x=ZD(),k=y(x),W=y(k),$=C(k,2),Y=y($);re(()=>{ae(W,u(X).severity),ae(Y,u(X).message)}),F(S,x)};ce(A,S=>{u(X).path?S(j):S(w,-1)})}re(()=>Ve(ee,1,Gm(u(X).severity),"svelte-7emrh2")),F(G,ee)}),re(()=>ae(B,`${u(r).length??""}
142
- ${u(r).length===1?"error":"errors"}`)),F(_,R)};ce(d,_=>{Sn.status==="checking"?_(h):Sn.status==="error"?_(g,1):u(r).length===0&&u(s).length===0?_(f,2):_(p,-1)})}var v=C(d,2),b=y(v),E=C(b,2);mn(l,_=>n=_,()=>n),re(()=>b.disabled=Sn.status==="checking"),He("cancel",l,i),ie("click",l,o),ie("click",b,()=>void Sn.refresh()),ie("click",E,()=>Sn.closePanel()),F(t,l),it()}Tt(["click"]);var rk=z('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),sk=z("<!> <!> <!> <!> <!>",1);function ak(t,e){at(e,!1),Za(()=>{Tl.init(),pt.init(),Dn.load()}),Jm();var n=Kn(),r=tt(n);{var s=o=>{var l=rk();F(o,l)},a=o=>{GD(o,{})},i=o=>{var l=sk(),d=tt(l);mD(d,{});var h=C(d,2);CD(h,{});var g=C(h,2);UD(g,{});var f=C(g,2);E3(f,{});var p=C(f,2);nk(p,{}),F(o,l)};ce(r,o=>{pt.status==="loading"?o(s):pt.status==="unauthenticated"?o(a,1):o(i,-1)})}F(t,n),it()}const ik=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],ok=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function tE(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&ok.has(t.type)))for(const[e,n]of ik)t.setAttribute(e,n)}function G1(t){for(const e of t.querySelectorAll("input, textarea"))tE(e)}function uk(){G1(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(tE(r),G1(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const nE=document.getElementById("app");if(nE===null)throw new Error("Missing #app mount point");u3().then(()=>{k_(ak,{target:nE}),uk()});export{pN as $,Nk as A,Rk as B,kp as C,a6 as D,Af as E,Sh as F,fk as G,xk as H,un as I,St as J,Pk as K,Ov as L,He as M,Fk as N,wk as O,Y6 as P,tt as Q,z as R,Bv as S,u as T,Q6 as U,Rv as V,ce as W,Wh as X,Km as Y,Lk as Z,mp as _,W6 as a,Ck as a0,xv as a1,jd as a2,F_ as a3,Ik as a4,ff as a5,mk as a6,bk as a7,vk as a8,Za as a9,ae as aA,Z_ as aB,C as aC,_s as aD,on as aE,Gk as aF,Q as aG,re as aH,Sl as aI,Tl as aJ,Hm as aK,Ok as aL,Ak as aM,_e as aN,Rt as aO,al as aa,it as ab,zk as ac,Sk as ad,Bo as ae,Vn as af,ct as ag,Dp as ah,at as ai,o6 as aj,_k as ak,x6 as al,Wa as am,T6 as an,Jt as ao,yk as ap,Fs as aq,Ek as ar,Uk as as,Il as at,T as au,kk as av,Ee as aw,J_ as ax,Ve as ay,Jl as az,z6 as b,mf as c,Z6 as d,X6 as e,Nx as f,Fn as g,F as h,Wk as i,dk as j,Dk as k,aT as l,mn as m,wt as n,Mk as o,Bk as p,y as q,Kn as r,pk as s,Bl as t,gk as u,hk as v,Tk as w,Tt as x,ie as y,Ml as z};
141
+ ${u(s).length===1?"warning":"warnings"}`)),F(G,X)};ce(B,G=>{u(s).length>0&&G(J)})}var H=C(O,2);St(H,21,()=>[...u(r),...u(s)],zo,(G,X)=>{var ee=JD(),A=y(ee);{var j=S=>{var R=QD(),k=y(R),W=y(k),$=C(k,2),Y=y($);re(()=>{ae(W,u(X).severity),ae(Y,u(X).message)}),ie("click",R,()=>a(u(X).path??"")),F(S,R)},w=S=>{var R=ZD(),k=y(R),W=y(k),$=C(k,2),Y=y($);re(()=>{ae(W,u(X).severity),ae(Y,u(X).message)}),F(S,R)};ce(A,S=>{u(X).path?S(j):S(w,-1)})}re(()=>Ve(ee,1,Gm(u(X).severity),"svelte-7emrh2")),F(G,ee)}),re(()=>ae(M,`${u(r).length??""}
142
+ ${u(r).length===1?"error":"errors"}`)),F(b,x)};ce(d,b=>{Sn.status==="checking"?b(f):Sn.status==="error"?b(g,1):u(r).length===0&&u(s).length===0?b(h,2):b(p,-1)})}var v=C(d,2),_=y(v),E=C(_,2);mn(l,b=>n=b,()=>n),re(()=>_.disabled=Sn.status==="checking"),He("cancel",l,i),ie("click",l,o),ie("click",_,()=>void Sn.refresh()),ie("click",E,()=>Sn.closePanel()),F(t,l),it()}Tt(["click"]);var rk=z('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),sk=z("<!> <!> <!> <!> <!>",1);function ak(t,e){at(e,!1),Za(()=>{Tl.init(),pt.init(),Dn.load()}),Jm();var n=Kn(),r=tt(n);{var s=o=>{var l=rk();F(o,l)},a=o=>{GD(o,{})},i=o=>{var l=sk(),d=tt(l);mD(d,{});var f=C(d,2);CD(f,{});var g=C(f,2);UD(g,{});var h=C(g,2);E3(h,{});var p=C(h,2);nk(p,{}),F(o,l)};ce(r,o=>{pt.status==="loading"?o(s):pt.status==="unauthenticated"?o(a,1):o(i,-1)})}F(t,n),it()}const ik=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],ok=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function eE(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&ok.has(t.type)))for(const[e,n]of ik)t.setAttribute(e,n)}function G1(t){for(const e of t.querySelectorAll("input, textarea"))eE(e)}function uk(){G1(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(eE(r),G1(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const tE=document.getElementById("app");if(tE===null)throw new Error("Missing #app mount point");u3().then(()=>{D_(ak,{target:tE}),uk()});export{pN as $,Nk as A,Rk as B,kp as C,a6 as D,Af as E,Sh as F,fk as G,xk as H,un as I,St as J,Pk as K,Lv as L,He as M,Fk as N,wk as O,Y6 as P,tt as Q,z as R,Mv as S,u as T,Q6 as U,xv as V,ce as W,Wh as X,Km as Y,Lk as Z,mp as _,W6 as a,Ck as a0,Ov as a1,jd as a2,B_ as a3,Ik as a4,ff as a5,mk as a6,bk as a7,vk as a8,Za as a9,ae as aA,Q_ as aB,C as aC,_s as aD,on as aE,Gk as aF,Q as aG,re as aH,Sl as aI,Tl as aJ,Hm as aK,Ok as aL,Ak as aM,_e as aN,Rt as aO,al as aa,it as ab,zk as ac,Sk as ad,Bo as ae,Vn as af,ct as ag,Dp as ah,at as ai,o6 as aj,_k as ak,x6 as al,Wa as am,T6 as an,Jt as ao,yk as ap,Fs as aq,Ek as ar,Uk as as,Il as at,T as au,kk as av,Ee as aw,Z_ as ax,Ve as ay,Jl as az,z6 as b,mf as c,Z6 as d,X6 as e,Nx as f,Fn as g,F as h,Wk as i,dk as j,Dk as k,sT as l,mn as m,wt as n,Mk as o,Bk as p,y as q,Kn as r,pk as s,Bl as t,gk as u,hk as v,Tk as w,Tt as x,ie as y,Ml as z};