@xtrable-ltd/nanoesis 0.1.5 → 0.1.7

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 (24) hide show
  1. package/dist/adapter-azure-blob.js +1 -1
  2. package/dist/{chunk-S23S4ZAK.js → chunk-Y7PUOM5I.js} +86 -49
  3. package/dist/editor-api.js +1 -1
  4. package/dist/index.d.ts +15 -0
  5. package/dist/index.js +1 -1
  6. package/editor/assets/{TemplatesPane-CEKbBX1Y.js → TemplatesPane-CtH_G1zX.js} +176 -176
  7. package/editor/assets/{cssMode-q1Nw_pOI.js → cssMode-Bp_d9uU6.js} +1 -1
  8. package/editor/assets/{freemarker2-D4uWo9kP.js → freemarker2-Bjkifjqk.js} +1 -1
  9. package/editor/assets/{handlebars-DIXKS_PM.js → handlebars-BRat5rme.js} +1 -1
  10. package/editor/assets/{html-WMfbPtFq.js → html-BABGfo5F.js} +1 -1
  11. package/editor/assets/{htmlMode-D1MWdaop.js → htmlMode-iA96VUY3.js} +1 -1
  12. package/editor/assets/{index-erqFXslE.js → index-B11qMUOV.js} +60 -60
  13. package/editor/assets/{javascript-C0daj-se.js → javascript-Py4Moqda.js} +1 -1
  14. package/editor/assets/{jsonMode-F4j8hmn2.js → jsonMode-ChrNU-Y4.js} +1 -1
  15. package/editor/assets/{liquid-BmXUpyt6.js → liquid-CB6iNJlZ.js} +1 -1
  16. package/editor/assets/{mdx-wzY123NO.js → mdx-DOQaWGy9.js} +1 -1
  17. package/editor/assets/{python-WOKQ0Svl.js → python-QNihkXeJ.js} +1 -1
  18. package/editor/assets/{razor-B9Yg1Ydt.js → razor-bRuM_KbJ.js} +1 -1
  19. package/editor/assets/{tsMode-966q_lbW.js → tsMode-CuAeEMPg.js} +1 -1
  20. package/editor/assets/{typescript-dxbYO44F.js → typescript-Dw4AxvYT.js} +1 -1
  21. package/editor/assets/{xml-BHa7-pyl.js → xml-mN7rLnTp.js} +1 -1
  22. package/editor/assets/{yaml-CcgAVYu7.js → yaml-tN2lKdvN.js} +1 -1
  23. package/editor/index.html +1 -1
  24. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-CEKbBX1Y.js","./TemplatesPane-B4_sg2u5.css"])))=>i.map(i=>d[i]);
2
- var zb=Object.defineProperty;var Bh=t=>{throw TypeError(t)};var Wb=(t,e,n)=>e in t?zb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ee=(t,e,n)=>Wb(t,typeof e!="symbol"?e+"":e,n),fc=(t,e,n)=>e.has(t)||Bh("Cannot "+n);var G=(t,e,n)=>(fc(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?Bh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),He=(t,e,n,r)=>(fc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ze=(t,e,n)=>(fc(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 sp=!1;var Td=Array.isArray,Gb=Array.prototype.indexOf,ba=Array.prototype.includes,Nl=Array.from,Kb=Object.defineProperty,Us=Object.getOwnPropertyDescriptor,ap=Object.getOwnPropertyDescriptors,Vb=Object.prototype,Xb=Array.prototype,_d=Object.getPrototypeOf,Fh=Object.isExtensible;function Gi(t){return typeof t=="function"}const Ad=()=>{};function Qb(t){return t()}function Kc(t){for(var e=0;e<t.length;e++)t[e]()}function ip(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function Zb(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 fn=2,vi=4,Wu=8,yd=1<<24,Nr=16,Lr=32,Ys=64,Vc=128,cr=512,Vt=1024,nn=2048,Qr=4096,On=8192,fr=16384,xa=32768,Xc=1<<25,ps=65536,el=1<<17,Jb=1<<18,Bi=1<<19,up=1<<20,zr=1<<25,ya=65536,tl=1<<21,ai=1<<22,Hs=1<<23,Wr=Symbol("$state"),op=Symbol("legacy props"),ev=Symbol(""),Fo=Symbol("attributes"),Qc=Symbol("class"),Zc=Symbol("style"),nu=Symbol("text"),Uo=Symbol("form reset"),Sl=new class extends Error{constructor(){super(...arguments);Ee(this,"name","StaleReactionError");Ee(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var tp;const Nd=!!((tp=globalThis.document)!=null&&tp.contentType)&&globalThis.document.contentType.includes("xml");function lp(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function tv(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function nv(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function rv(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function sv(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function av(t){throw new Error("https://svelte.dev/e/effect_orphan")}function iv(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function uv(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ov(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function lv(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function cv(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function fv(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const dv=1,hv=2,cp=4,pv=8,mv=16,gv=1,bv=2,vv=4,Ev=8,Tv=16,_v=1,Av=2,jt=Symbol("uninitialized"),fp="http://www.w3.org/1999/xhtml",yv="http://www.w3.org/2000/svg",Nv="@attach";function Sv(){console.warn("https://svelte.dev/e/derived_inert")}function Iv(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Cv(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function dp(t){return t===this.v}function wv(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function hp(t){return!wv(t,this.v)}let Fi=!1,Lv=!1;function Ov(){Fi=!0}let _t=null;function Ei(t){_t=t}function xv(t){return Rv().get(t)}function ct(t,e=!1,n){_t={p:_t,i:!1,c:null,e:null,s:t,x:null,r:Ke,l:Fi&&!e?{s:null,u:null,$:[]}:null}}function ft(t){var e=_t,n=e.e;if(n!==null){e.e=null;for(var r of n)Mp(r)}return e.i=!0,_t=e.p,{}}function Ui(){return!Fi||_t!==null&&_t.l===null}function Rv(t){return _t===null&&lp(),_t.c??(_t.c=new Map(Dv(_t)||void 0))}function Dv(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let ua=[];function pp(){var t=ua;ua=[],Kc(t)}function Cr(t){if(ua.length===0&&!cu){var e=ua;queueMicrotask(()=>{e===ua&&pp()})}ua.push(t)}function kv(){for(;ua.length>0;)pp()}function mp(t){var e=Ke;if(e===null)return Xe.f|=Hs,t;if((e.f&xa)===0&&(e.f&vi)===0)throw t;Ds(t,e)}function Ds(t,e){for(;e!==null;){if((e.f&Vc)!==0){if((e.f&xa)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Pv=-7169;function Dt(t,e){t.f=t.f&Pv|e}function Sd(t){(t.f&cr)!==0||t.deps===null?Dt(t,Vt):Dt(t,Qr)}function gp(t){if(t!==null)for(const e of t)(e.f&fn)===0||(e.f&ya)===0||(e.f^=ya,gp(e.deps))}function bp(t,e,n){(t.f&nn)!==0?e.add(t):(t.f&Qr)!==0&&n.add(t),gp(t.deps),Dt(t,Vt)}let Eo=!1;function Mv(t){var e=Eo;try{return Eo=!1,[t(),Eo]}finally{Eo=e}}let dc=null,Wa=null,Pe=null,lu=null,un=null,Jc=null,cu=!1,hc=!1,ni=null,Ho=null;var Uh=0;let Bv=1;var fi,Ls,fa,di,hi,da,pi,ls,Uu,Yn,Hu,Os,qr,jr,mi,ha,lt,ef,ru,tf,vp,Ep,qo,Fv,nf,Ka;const El=class El{constructor(){Ue(this,lt);Ee(this,"id",Bv++);Ue(this,fi,!1);Ee(this,"linked",!0);Ue(this,Ls,null);Ue(this,fa,null);Ee(this,"async_deriveds",new Map);Ee(this,"current",new Map);Ee(this,"previous",new Map);Ee(this,"unblocked",new Set);Ue(this,di,new Set);Ue(this,hi,new Set);Ue(this,da,new Set);Ue(this,pi,0);Ue(this,ls,new Map);Ue(this,Uu,null);Ue(this,Yn,[]);Ue(this,Hu,[]);Ue(this,Os,new Set);Ue(this,qr,new Set);Ue(this,jr,new Map);Ue(this,mi,new Set);Ee(this,"is_fork",!1);Ue(this,ha,!1)}skip_effect(e){G(this,jr).has(e)||G(this,jr).set(e,{d:[],m:[]}),G(this,mi).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=G(this,jr).get(e);if(r){G(this,jr).delete(e);for(var s of r.d)Dt(s,nn),n(s);for(s of r.m)Dt(s,Qr),n(s)}G(this,mi).add(e)}capture(e,n,r=!1){e.v!==jt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Hs)===0&&(this.current.set(e,[n,r]),un==null||un.set(e,n)),this.is_fork||(e.v=n)}activate(){Pe=this}deactivate(){Pe=null,un=null}flush(){try{hc=!0,Pe=this,Ze(this,lt,ru).call(this)}finally{Uh=0,Jc=null,ni=null,Ho=null,hc=!1,Pe=null,un=null,va.clear()}}discard(){for(const e of G(this,hi))e(this);G(this,hi).clear(),G(this,da).clear(),Ze(this,lt,Ka).call(this)}register_created_effect(e){G(this,Hu).push(e)}increment(e,n){if(He(this,pi,G(this,pi)+1),e){let r=G(this,ls).get(n)??0;G(this,ls).set(n,r+1)}}decrement(e,n){if(He(this,pi,G(this,pi)-1),e){let r=G(this,ls).get(n)??0;r===1?G(this,ls).delete(n):G(this,ls).set(n,r-1)}G(this,ha)||(He(this,ha,!0),Cr(()=>{He(this,ha,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)G(this,Os).add(r);for(const r of n)G(this,qr).add(r);e.clear(),n.clear()}oncommit(e){G(this,di).add(e)}ondiscard(e){G(this,hi).add(e)}on_fork_commit(e){G(this,da).add(e)}run_fork_commit_callbacks(){for(const e of G(this,da))e(this);G(this,da).clear()}settled(){return(G(this,Uu)??He(this,Uu,ip())).promise}static ensure(){var e;if(Pe===null){const n=Pe=new El;Ze(e=n,lt,nf).call(e),!hc&&!cu&&Cr(()=>{G(n,fi)||n.flush()})}return Pe}apply(){{un=null;return}}schedule(e){var s;if(Jc=e,(s=e.b)!=null&&s.is_pending&&(e.f&(vi|Wu|yd))!==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(ni!==null&&n===Ke&&(Xe===null||(Xe.f&fn)===0))return;if((r&(Ys|Lr))!==0){if((r&Vt)===0)return;n.f^=Vt}}G(this,Yn).push(n)}};fi=new WeakMap,Ls=new WeakMap,fa=new WeakMap,di=new WeakMap,hi=new WeakMap,da=new WeakMap,pi=new WeakMap,ls=new WeakMap,Uu=new WeakMap,Yn=new WeakMap,Hu=new WeakMap,Os=new WeakMap,qr=new WeakMap,jr=new WeakMap,mi=new WeakMap,ha=new WeakMap,lt=new WeakSet,ef=function(){if(this.is_fork)return!0;for(const r of G(this,ls).keys()){for(var e=r,n=!1;e.parent!==null;){if(G(this,jr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},ru=function(){var o,f,h,g;if(He(this,fi,!0),Uh++>1e3&&(Ze(this,lt,Ka).call(this),Hv()),!Ze(this,lt,ef).call(this)){for(const d of G(this,Os))G(this,qr).delete(d),Dt(d,nn),this.schedule(d);for(const d of G(this,qr))Dt(d,Qr),this.schedule(d)}const e=G(this,Yn);He(this,Yn,[]),this.apply();var n=ni=[],r=[],s=Ho=[];for(const d of e)try{Ze(this,lt,tf).call(this,d,n,r)}catch(m){throw Ap(d),m}if(Pe=null,s.length>0){var a=El.ensure();for(const d of s)a.schedule(d)}if(ni=null,Ho=null,Ze(this,lt,ef).call(this)){Ze(this,lt,qo).call(this,r),Ze(this,lt,qo).call(this,n);for(const[d,m]of G(this,jr))_p(d,m);s.length>0&&Ze(o=Pe,lt,ru).call(o);return}const i=Ze(this,lt,vp).call(this);if(i){Ze(f=i,lt,Ep).call(f,this);return}G(this,Os).clear(),G(this,qr).clear();for(const d of G(this,di))d(this);G(this,di).clear(),lu=this,Hh(r),Hh(n),lu=null,(h=G(this,Uu))==null||h.resolve();var u=Pe;if(this.linked&&G(this,pi)===0&&Ze(this,lt,Ka).call(this),G(this,Yn).length>0){u===null&&(u=this,Ze(this,lt,nf).call(this));const d=u;G(d,Yn).push(...G(this,Yn).filter(m=>!G(d,Yn).includes(m)))}u!==null&&Ze(g=u,lt,ru).call(g)},tf=function(e,n,r){e.f^=Vt;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Lr|Ys))!==0,u=i&&(a&Vt)!==0,o=u||(a&On)!==0||G(this,jr).has(s);if(!o&&s.fn!==null){i?s.f^=Vt:(a&vi)!==0?n.push(s):Xu(s)&&((a&Nr)!==0&&G(this,qr).add(s),Ni(s));var f=s.first;if(f!==null){s=f;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},vp=function(){for(var e=G(this,Ls);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=G(e,Ls)}return null},Ep=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 o of a){var i=o.f;if((i&fn)!==0)n(o);else{var u=o;i&(ai|Nr)&&!this.async_deriveds.has(u)&&(G(this,qr).delete(u),Dt(u,nn),this.schedule(u))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),Ze(r=e,lt,Ka).call(r),Pe=this,Ze(this,lt,ru).call(this)},qo=function(e){for(var n=0;n<e.length;n+=1)bp(e[n],G(this,Os),G(this,qr))},Fv=function(){var h;Ze(this,lt,Ka).call(this);for(let g=dc;g!==null;g=G(g,fa)){var e=g.id<this.id,n=[];for(const[d,[m,b]]of this.current){if(g.current.has(d)){var r=g.current.get(d)[0];if(e&&m!==r)g.current.set(d,[m,b]);else continue}n.push(d)}if(e)for(const[d,m]of this.async_deriveds){const b=g.async_deriveds.get(d);b&&m.promise.then(b.resolve)}if(G(g,fi)){var s=[...g.current.keys()].filter(d=>!this.current.has(d));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const d of G(this,mi))g.unskip_effect(d,m=>{var b;(m.f&(Nr|ai))!==0?g.schedule(m):Ze(b=g,lt,qo).call(b,[m])});g.activate();var a=new Set,i=new Map;for(var u of n)Tp(u,s,a,i);i=new Map;var o=[...g.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(o.length>0)for(const d of G(this,Hu))(d.f&(fr|On|el))===0&&Id(d,o,i)&&((d.f&(ai|Nr))!==0?(Dt(d,nn),g.schedule(d)):G(g,Os).add(d));if(G(g,Yn).length>0&&!G(g,ha)){g.apply();for(var f of G(g,Yn))Ze(h=g,lt,tf).call(h,f,[],[]);He(g,Yn,[])}g.deactivate()}}}},nf=function(){Wa===null?dc=Wa=this:(He(Wa,fa,this),He(this,Ls,Wa)),Wa=this},Ka=function(){var e=G(this,Ls),n=G(this,fa);e===null?dc=n:He(e,fa,n),n===null?Wa=e:He(n,Ls,e),this.linked=!1};let Na=El;function Uv(t){var e=cu;cu=!0;try{for(var n;;){if(kv(),Pe===null)return n;Pe.flush()}}finally{cu=e}}function Hv(){try{iv()}catch(t){Ds(t,Jc)}}let vr=null;function Hh(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(fr|On))===0&&Xu(r)&&(vr=new Set,Ni(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Up(r),(vr==null?void 0:vr.size)>0)){va.clear();for(const s of vr){if((s.f&(fr|On))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)vr.has(i)&&(vr.delete(i),a.push(i)),i=i.parent;for(let u=a.length-1;u>=0;u--){const o=a[u];(o.f&(fr|On))===0&&Ni(o)}}vr.clear()}}vr=null}}function Tp(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&fn)!==0?Tp(s,e,n,r):(a&(ai|Nr))!==0&&(a&nn)===0&&Id(s,e,r)&&(Dt(s,nn),Cd(s))}}function Id(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(ba.call(e,s))return!0;if((s.f&fn)!==0&&Id(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function Cd(t){Pe.schedule(t)}function _p(t,e){if(!((t.f&Lr)!==0&&(t.f&Vt)!==0)){(t.f&nn)!==0?e.d.push(t):(t.f&Qr)!==0&&e.m.push(t),Dt(t,Vt);for(var n=t.first;n!==null;)_p(n,e),n=n.next}}function Ap(t){Dt(t,Vt);for(var e=t.first;e!==null;)Ap(e),e=e.next}function qv(t){let e=0,n=Sa(0),r;return()=>{xd()&&(c(n),Cl(()=>(e===0&&(r=Da(()=>t(()=>fu(n)))),e+=1,()=>{Cr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,fu(n))})})))}}var jv=ps|Bi;function $v(t,e,n,r){new Yv(t,e,n,r)}var tr,Ed,nr,pa,Mn,rr,Cn,zn,cs,ma,xs,gi,qu,ju,fs,Tl,Pt,zv,Wv,Gv,rf,jo,$o,sf,af;class Yv{constructor(e,n,r,s){Ue(this,Pt);Ee(this,"parent");Ee(this,"is_pending",!1);Ee(this,"transform_error");Ue(this,tr);Ue(this,Ed,null);Ue(this,nr);Ue(this,pa);Ue(this,Mn);Ue(this,rr,null);Ue(this,Cn,null);Ue(this,zn,null);Ue(this,cs,null);Ue(this,ma,0);Ue(this,xs,0);Ue(this,gi,!1);Ue(this,qu,new Set);Ue(this,ju,new Set);Ue(this,fs,null);Ue(this,Tl,qv(()=>(He(this,fs,Sa(G(this,ma))),()=>{He(this,fs,null)})));var a;He(this,tr,e),He(this,nr,n),He(this,pa,i=>{var u=Ke;u.b=this,u.f|=Vc,r(i)}),this.parent=Ke.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),He(this,Mn,Ra(()=>{Ze(this,Pt,rf).call(this)},jv))}defer_effect(e){bp(e,G(this,qu),G(this,ju))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!G(this,nr).pending}update_pending_count(e,n){Ze(this,Pt,sf).call(this,e,n),He(this,ma,G(this,ma)+e),!(!G(this,fs)||G(this,gi))&&(He(this,gi,!0),Cr(()=>{He(this,gi,!1),G(this,fs)&&_i(G(this,fs),G(this,ma))}))}get_effect_pending(){return G(this,Tl).call(this),c(G(this,fs))}error(e){if(!G(this,nr).onerror&&!G(this,nr).failed)throw e;Pe!=null&&Pe.is_fork?(G(this,rr)&&Pe.skip_effect(G(this,rr)),G(this,Cn)&&Pe.skip_effect(G(this,Cn)),G(this,zn)&&Pe.skip_effect(G(this,zn)),Pe.on_fork_commit(()=>{Ze(this,Pt,af).call(this,e)})):Ze(this,Pt,af).call(this,e)}}tr=new WeakMap,Ed=new WeakMap,nr=new WeakMap,pa=new WeakMap,Mn=new WeakMap,rr=new WeakMap,Cn=new WeakMap,zn=new WeakMap,cs=new WeakMap,ma=new WeakMap,xs=new WeakMap,gi=new WeakMap,qu=new WeakMap,ju=new WeakMap,fs=new WeakMap,Tl=new WeakMap,Pt=new WeakSet,zv=function(){try{He(this,rr,Fn(()=>G(this,pa).call(this,G(this,tr))))}catch(e){this.error(e)}},Wv=function(e){const n=G(this,nr).failed;n&&He(this,zn,Fn(()=>{n(G(this,tr),()=>e,()=>()=>{})}))},Gv=function(){const e=G(this,nr).pending;e&&(this.is_pending=!0,He(this,Cn,Fn(()=>e(G(this,tr)))),Cr(()=>{var n=He(this,cs,document.createDocumentFragment()),r=Gr();n.append(r),He(this,rr,Ze(this,Pt,$o).call(this,()=>Fn(()=>G(this,pa).call(this,r)))),G(this,xs)===0&&(G(this,tr).before(n),He(this,cs,null),Ea(G(this,Cn),()=>{He(this,Cn,null)}),Ze(this,Pt,jo).call(this,Pe))}))},rf=function(){try{if(this.is_pending=this.has_pending_snippet(),He(this,xs,0),He(this,ma,0),He(this,rr,Fn(()=>{G(this,pa).call(this,G(this,tr))})),G(this,xs)>0){var e=He(this,cs,document.createDocumentFragment());kd(G(this,rr),e);const n=G(this,nr).pending;He(this,Cn,Fn(()=>n(G(this,tr))))}else Ze(this,Pt,jo).call(this,Pe)}catch(n){this.error(n)}},jo=function(e){this.is_pending=!1,e.transfer_effects(G(this,qu),G(this,ju))},$o=function(e){var n=Ke,r=Xe,s=_t;Zr(G(this,Mn)),hr(G(this,Mn)),Ei(G(this,Mn).ctx);try{return Na.ensure(),e()}catch(a){return mp(a),null}finally{Zr(n),hr(r),Ei(s)}},sf=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&Ze(r=this.parent,Pt,sf).call(r,e,n);return}He(this,xs,G(this,xs)+e),G(this,xs)===0&&(Ze(this,Pt,jo).call(this,n),G(this,Cn)&&Ea(G(this,Cn),()=>{He(this,Cn,null)}),G(this,cs)&&(G(this,tr).before(G(this,cs)),He(this,cs,null)))},af=function(e){G(this,rr)&&(on(G(this,rr)),He(this,rr,null)),G(this,Cn)&&(on(G(this,Cn)),He(this,Cn,null)),G(this,zn)&&(on(G(this,zn)),He(this,zn,null));var n=G(this,nr).onerror;let r=G(this,nr).failed;var s=!1,a=!1;const i=()=>{if(s){Cv();return}s=!0,a&&fv(),G(this,zn)!==null&&Ea(G(this,zn),()=>{He(this,zn,null)}),Ze(this,Pt,$o).call(this,()=>{Ze(this,Pt,rf).call(this)})},u=o=>{try{a=!0,n==null||n(o,i),a=!1}catch(f){Ds(f,G(this,Mn)&&G(this,Mn).parent)}r&&He(this,zn,Ze(this,Pt,$o).call(this,()=>{try{return Fn(()=>{var f=Ke;f.b=this,f.f|=Vc,r(G(this,tr),()=>o,()=>i)})}catch(f){return Ds(f,G(this,Mn).parent),null}}))};Cr(()=>{var o;try{o=this.transform_error(e)}catch(f){Ds(f,G(this,Mn)&&G(this,Mn).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(u,f=>Ds(f,G(this,Mn)&&G(this,Mn).parent)):u(o)})};function yp(t,e,n,r){const s=Ui()?Ti:wd;var a=t.filter(d=>!d.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Ke,u=Kv(),o=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(d=>d.promise)):null;function f(d){if((i.f&fr)===0){u();try{r(d)}catch(m){Ds(m,i)}nl()}}var h=Np();if(n.length===0){o.then(()=>f(e.map(s))).finally(h);return}function g(){Promise.all(n.map(d=>Vv(d))).then(d=>f([...e.map(s),...d])).catch(d=>Ds(d,i)).finally(h)}o?o.then(()=>{u(),g(),nl()}):g()}function Kv(){var t=Ke,e=Xe,n=_t,r=Pe;return function(a=!0){Zr(t),hr(e),Ei(n),a&&(t.f&fr)===0&&(r==null||r.activate(),r==null||r.apply())}}function nl(t=!0){Zr(null),hr(null),Ei(null),t&&(Pe==null||Pe.deactivate())}function Np(){var t=Ke,e=t.b,n=Pe,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 Ti(t){var e=fn|nn;return Ke!==null&&(Ke.f|=Bi),{ctx:_t,deps:null,effects:null,equals:dp,f:e,fn:t,reactions:null,rv:0,v:jt,wv:0,parent:Ke,ac:null}}const To=Symbol("obsolete");function Vv(t,e,n){let r=Ke;r===null&&tv();var s=void 0,a=Sa(jt),i=!Xe,u=new Set;return iE(()=>{var m;var o=Ke,f=ip();s=f.promise;try{Promise.resolve(t()).then(f.resolve,b=>{b!==Sl&&f.reject(b)}).finally(nl)}catch(b){f.reject(b),nl()}var h=Pe;if(i){if((o.f&xa)!==0)var g=Np();if(r.b.is_rendered())(m=h.async_deriveds.get(o))==null||m.reject(To);else for(const b of u.values())b.reject(To);u.add(f),h.async_deriveds.set(o,f)}const d=(b,_=void 0)=>{g==null||g(),u.delete(f),_!==To&&(h.activate(),_?(a.f|=Hs,_i(a,_)):((a.f&Hs)!==0&&(a.f^=Hs),_i(a,b)),h.deactivate())};f.promise.then(d,b=>d(null,b||"unknown"))}),Ku(()=>{for(const o of u)o.reject(To)}),new Promise(o=>{function f(h){function g(){h===s?o(a):f(s)}h.then(g,g)}f(s)})}function Ae(t){const e=Ti(t);return jp(e),e}function wd(t){const e=Ti(t);return e.equals=hp,e}function Xv(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)on(e[n])}}function Ld(t){var e,n=Ke,r=t.parent;if(!ms&&r!==null&&t.v!==jt&&(r.f&(fr|On))!==0)return Sv(),t.v;Zr(r);try{t.f&=~ya,Xv(t),e=Wp(t)}finally{Zr(n)}return e}function Sp(t){var e=Ld(t);if(!t.equals(e)&&(t.wv=Yp(),(!(Pe!=null&&Pe.is_fork)||t.deps===null)&&(Pe!==null?(Pe.capture(t,e,!0),lu==null||lu.capture(t,e,!0)):t.v=e,t.deps===null))){Dt(t,Vt);return}ms||(un!==null?(xd()||Pe!=null&&Pe.is_fork)&&un.set(t,e):Sd(t))}function Qv(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(Sl),r.fn!==null&&(r.teardown=Ad),r.ac=null,Su(r,0),Rd(r))}function Ip(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Ni(e)}let rl=new Set;const va=new Map;let Cp=!1;function Sa(t,e){var n={f:0,v:t,reactions:null,equals:dp,rv:0,wv:0};return n}function ee(t,e){const n=Sa(t);return jp(n),n}function Zv(t,e=!1,n=!0){var s;const r=Sa(t);return e||(r.equals=hp),Fi&&n&&_t!==null&&_t.l!==null&&((s=_t.l).s??(s.s=[])).push(r),r}function y(t,e,n=!1){Xe!==null&&(!Sr||(Xe.f&el)!==0)&&Ui()&&(Xe.f&(fn|Nr|ai|el))!==0&&(dr===null||!ba.call(dr,t))&&cv();let r=n?Tt(e):e;return _i(t,r,Ho)}function _i(t,e,n=null){if(!t.equals(e)){va.set(t,ms?e:t.v);var r=Na.ensure();if(r.capture(t,e),(t.f&fn)!==0){const s=t;(t.f&nn)!==0&&Ld(s),un===null&&Sd(s)}t.wv=Yp(),wp(t,nn,n),Ui()&&Ke!==null&&(Ke.f&Vt)!==0&&(Ke.f&(Lr|Ys))===0&&(er===null?lE([t]):er.push(t)),!r.is_fork&&rl.size>0&&!Cp&&Jv()}return e}function Jv(){Cp=!1;for(const t of rl){(t.f&Vt)!==0&&Dt(t,Qr);let e;try{e=Xu(t)}catch{e=!0}e&&Ni(t)}rl.clear()}function fu(t){y(t,t.v+1)}function wp(t,e,n){var r=t.reactions;if(r!==null)for(var s=Ui(),a=r.length,i=0;i<a;i++){var u=r[i],o=u.f;if(!(!s&&u===Ke)){var f=(o&nn)===0;if(f&&Dt(u,e),(o&el)!==0)rl.add(u);else if((o&fn)!==0){var h=u;un==null||un.delete(h),(o&ya)===0&&(o&cr&&(Ke===null||(Ke.f&tl)===0)&&(u.f|=ya),wp(h,Qr,n))}else if(f){var g=u;(o&Nr)!==0&&vr!==null&&vr.add(g),n!==null?n.push(g):Cd(g)}}}}function Tt(t){if(typeof t!="object"||t===null||Wr in t)return t;const e=_d(t);if(e!==Vb&&e!==Xb)return t;var n=new Map,r=Td(t),s=ee(0),a=Ta,i=u=>{if(Ta===a)return u();var o=Xe,f=Ta;hr(null),zh(a);var h=u();return hr(o),zh(f),h};return r&&n.set("length",ee(t.length)),new Proxy(t,{defineProperty(u,o,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&ov();var h=n.get(o);return h===void 0?i(()=>{var g=ee(f.value);return n.set(o,g),g}):y(h,f.value,!0),!0},deleteProperty(u,o){var f=n.get(o);if(f===void 0){if(o in u){const h=i(()=>ee(jt));n.set(o,h),fu(s)}}else y(f,jt),fu(s);return!0},get(u,o,f){var m;if(o===Wr)return t;var h=n.get(o),g=o in u;if(h===void 0&&(!g||(m=Us(u,o))!=null&&m.writable)&&(h=i(()=>{var b=Tt(g?u[o]:jt),_=ee(b);return _}),n.set(o,h)),h!==void 0){var d=c(h);return d===jt?void 0:d}return Reflect.get(u,o,f)},getOwnPropertyDescriptor(u,o){var f=Reflect.getOwnPropertyDescriptor(u,o);if(f&&"value"in f){var h=n.get(o);h&&(f.value=c(h))}else if(f===void 0){var g=n.get(o),d=g==null?void 0:g.v;if(g!==void 0&&d!==jt)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return f},has(u,o){var d;if(o===Wr)return!0;var f=n.get(o),h=f!==void 0&&f.v!==jt||Reflect.has(u,o);if(f!==void 0||Ke!==null&&(!h||(d=Us(u,o))!=null&&d.writable)){f===void 0&&(f=i(()=>{var m=h?Tt(u[o]):jt,b=ee(m);return b}),n.set(o,f));var g=c(f);if(g===jt)return!1}return h},set(u,o,f,h){var L;var g=n.get(o),d=o in u;if(r&&o==="length")for(var m=f;m<g.v;m+=1){var b=n.get(m+"");b!==void 0?y(b,jt):m in u&&(b=i(()=>ee(jt)),n.set(m+"",b))}if(g===void 0)(!d||(L=Us(u,o))!=null&&L.writable)&&(g=i(()=>ee(void 0)),y(g,Tt(f)),n.set(o,g));else{d=g.v!==jt;var _=i(()=>Tt(f));y(g,_)}var T=Reflect.getOwnPropertyDescriptor(u,o);if(T!=null&&T.set&&T.set.call(h,f),!d){if(r&&typeof o=="string"){var v=n.get("length"),O=Number(o);Number.isInteger(O)&&O>=v.v&&y(v,O+1)}fu(s)}return!0},ownKeys(u){c(s);var o=Reflect.ownKeys(u).filter(g=>{var d=n.get(g);return d===void 0||d.v!==jt});for(var[f,h]of n)h.v!==jt&&!(f in u)&&o.push(f);return o},setPrototypeOf(){lv()}})}function qh(t){try{if(t!==null&&typeof t=="object"&&Wr in t)return t[Wr]}catch{}return t}function Lp(t,e){return Object.is(qh(t),qh(e))}var jh,Op,xp,Rp;function eE(){if(jh===void 0){jh=window,Op=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;xp=Us(e,"firstChild").get,Rp=Us(e,"nextSibling").get,Fh(t)&&(t[Qc]=void 0,t[Fo]=null,t[Zc]=void 0,t.__e=void 0),Fh(n)&&(n[nu]=void 0)}}function Gr(t=""){return document.createTextNode(t)}function Ai(t){return xp.call(t)}function Gu(t){return Rp.call(t)}function I(t,e){return Ai(t)}function pt(t,e=!1){{var n=Ai(t);return n instanceof Comment&&n.data===""?Gu(n):n}}function R(t,e=1,n=!1){let r=t;for(;e--;)r=Gu(r);return r}function tE(t){t.textContent=""}function Dp(){return!1}function kp(t,e,n){return document.createElementNS(e??fp,t,void 0)}function yi(t,e){if(e){const n=document.body;t.autofocus=!0,Cr(()=>{document.activeElement===n&&t.focus()})}}let $h=!1;function nE(){$h||($h=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[Uo])==null||e.call(n)})},{capture:!0}))}function Il(t){var e=Xe,n=Ke;hr(null),Zr(null);try{return t()}finally{hr(e),Zr(n)}}function Od(t,e,n,r=n){t.addEventListener(e,()=>Il(n));const s=t[Uo];s?t[Uo]=()=>{s(),r(!0)}:t[Uo]=()=>r(!0),nE()}function Pp(t){Ke===null&&(Xe===null&&av(),sv()),ms&&rv()}function rE(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function xr(t,e){var n=Ke;n!==null&&(n.f&On)!==0&&(t|=On);var r={ctx:_t,deps:null,nodes:null,f:t|nn|cr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Pe==null||Pe.register_created_effect(r);var s=r;if((t&vi)!==0)ni!==null?ni.push(r):Na.ensure().schedule(r);else if(e!==null){try{Ni(r)}catch(i){throw on(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Bi)===0&&(s=s.first,(t&Nr)!==0&&(t&ps)!==0&&s!==null&&(s.f|=ps))}if(s!==null&&(s.parent=n,n!==null&&rE(s,n),Xe!==null&&(Xe.f&fn)!==0&&(t&Ys)===0)){var a=Xe;(a.effects??(a.effects=[])).push(s)}return r}function xd(){return Xe!==null&&!Sr}function Ku(t){const e=xr(Wu,null);return Dt(e,Vt),e.teardown=t,e}function kt(t){Pp();var e=Ke.f,n=!Xe&&(e&Lr)!==0&&(e&xa)===0;if(n){var r=_t;(r.e??(r.e=[])).push(t)}else return Mp(t)}function Mp(t){return xr(vi|up,t)}function sE(t){return Pp(),xr(Wu|up,t)}function aE(t){Na.ensure();const e=xr(Ys|Bi,t);return(n={})=>new Promise(r=>{n.outro?Ea(e,()=>{on(e),r(void 0)}):(on(e),r(void 0))})}function Vu(t){return xr(vi,t)}function iE(t){return xr(ai|Bi,t)}function Cl(t,e=0){return xr(Wu|e,t)}function ue(t,e=[],n=[],r=[]){yp(r,e,n,s=>{xr(Wu,()=>t(...s.map(c)))})}function Ra(t,e=0){var n=xr(Nr|e,t);return n}function Bp(t,e=0){var n=xr(yd|e,t);return n}function Fn(t){return xr(Lr|Bi,t)}function Fp(t){var e=t.teardown;if(e!==null){const n=ms,r=Xe;Yh(!0),hr(null);try{e.call(null)}finally{Yh(n),hr(r)}}}function Rd(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Il(()=>{s.abort(Sl)});var r=n.next;(n.f&Ys)!==0?n.parent=null:on(n,e),n=r}}function uE(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Lr)===0&&on(e),e=n}}function on(t,e=!0){var n=!1;(e||(t.f&Jb)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(oE(t.nodes.start,t.nodes.end),n=!0),Dt(t,Xc),Rd(t,e&&!n),Su(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();Fp(t),t.f^=Xc,t.f|=fr;var s=t.parent;s!==null&&s.first!==null&&Up(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function oE(t,e){for(;t!==null;){var n=t===e?null:Gu(t);t.remove(),t=n}}function Up(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 Ea(t,e,n=!0){var r=[];Hp(t,r,!0);var s=()=>{n&&on(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var u of r)u.out(i)}else s()}function Hp(t,e,n){if((t.f&On)===0){t.f^=On;var r=t.nodes&&t.nodes.t;if(r!==null)for(const u of r)(u.is_global||n)&&e.push(u);for(var s=t.first;s!==null;){var a=s.next;if((s.f&Ys)===0){var i=(s.f&ps)!==0||(s.f&Lr)!==0&&(t.f&Nr)!==0;Hp(s,e,i?n:!1)}s=a}}}function Dd(t){qp(t,!0)}function qp(t,e){if((t.f&On)!==0){t.f^=On,(t.f&Vt)===0&&(Dt(t,nn),Na.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&ps)!==0||(n.f&Lr)!==0;qp(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 kd(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:Gu(n);e.append(n),n=s}}let Yo=!1,ms=!1;function Yh(t){ms=t}let Xe=null,Sr=!1;function hr(t){Xe=t}let Ke=null;function Zr(t){Ke=t}let dr=null;function jp(t){Xe!==null&&(dr===null?dr=[t]:dr.push(t))}let Bn=null,$n=0,er=null;function lE(t){er=t}let $p=1,oa=0,Ta=oa;function zh(t){Ta=t}function Yp(){return++$p}function Xu(t){var e=t.f;if((e&nn)!==0)return!0;if(e&fn&&(t.f&=~ya),(e&Qr)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(Xu(a)&&Sp(a),a.wv>t.wv)return!0}(e&cr)!==0&&un===null&&Dt(t,Vt)}return!1}function zp(t,e,n=!0){var r=t.reactions;if(r!==null&&!(dr!==null&&ba.call(dr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&fn)!==0?zp(a,e,!1):e===a&&(n?Dt(a,nn):(a.f&Vt)!==0&&Dt(a,Qr),Cd(a))}}function Wp(t){var _;var e=Bn,n=$n,r=er,s=Xe,a=dr,i=_t,u=Sr,o=Ta,f=t.f;Bn=null,$n=0,er=null,Xe=(f&(Lr|Ys))===0?t:null,dr=null,Ei(t.ctx),Sr=!1,Ta=++oa,t.ac!==null&&(Il(()=>{t.ac.abort(Sl)}),t.ac=null);try{t.f|=tl;var h=t.fn,g=h();t.f|=xa;var d=t.deps,m=Pe==null?void 0:Pe.is_fork;if(Bn!==null){var b;if(m||Su(t,$n),d!==null&&$n>0)for(d.length=$n+Bn.length,b=0;b<Bn.length;b++)d[$n+b]=Bn[b];else t.deps=d=Bn;if(xd()&&(t.f&cr)!==0)for(b=$n;b<d.length;b++)((_=d[b]).reactions??(_.reactions=[])).push(t)}else!m&&d!==null&&$n<d.length&&(Su(t,$n),d.length=$n);if(Ui()&&er!==null&&!Sr&&d!==null&&(t.f&(fn|Qr|nn))===0)for(b=0;b<er.length;b++)zp(er[b],t);if(s!==null&&s!==t){if(oa++,s.deps!==null)for(let T=0;T<n;T+=1)s.deps[T].rv=oa;if(e!==null)for(const T of e)T.rv=oa;er!==null&&(r===null?r=er:r.push(...er))}return(t.f&Hs)!==0&&(t.f^=Hs),g}catch(T){return mp(T)}finally{t.f^=tl,Bn=e,$n=n,er=r,Xe=s,dr=a,Ei(i),Sr=u,Ta=o}}function cE(t,e){let n=e.reactions;if(n!==null){var r=Gb.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&fn)!==0&&(Bn===null||!ba.call(Bn,e))){var a=e;(a.f&cr)!==0&&(a.f^=cr,a.f&=~ya),a.v!==jt&&Sd(a),Qv(a),Su(a,0)}}function Su(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)cE(t,n[r])}function Ni(t){var e=t.f;if((e&fr)===0){Dt(t,Vt);var n=Ke,r=Yo;Ke=t,Yo=!0;try{(e&(Nr|yd))!==0?uE(t):Rd(t),Fp(t);var s=Wp(t);t.teardown=typeof s=="function"?s:null,t.wv=$p;var a;sp&&Lv&&(t.f&nn)!==0&&t.deps}finally{Yo=r,Ke=n}}}async function Gp(){await Promise.resolve(),Uv()}function c(t){var e=t.f,n=(e&fn)!==0;if(Xe!==null&&!Sr){var r=Ke!==null&&(Ke.f&fr)!==0;if(!r&&(dr===null||!ba.call(dr,t))){var s=Xe.deps;if((Xe.f&tl)!==0)t.rv<oa&&(t.rv=oa,Bn===null&&s!==null&&s[$n]===t?$n++:Bn===null?Bn=[t]:Bn.push(t));else{Xe.deps??(Xe.deps=[]),ba.call(Xe.deps,t)||Xe.deps.push(t);var a=t.reactions;a===null?t.reactions=[Xe]:ba.call(a,Xe)||a.push(Xe)}}}if(ms&&va.has(t))return va.get(t);if(n){var i=t;if(ms){var u=i.v;return((i.f&Vt)===0&&i.reactions!==null||Vp(i))&&(u=Ld(i)),va.set(i,u),u}var o=(i.f&cr)===0&&!Sr&&Xe!==null&&(Yo||(Xe.f&cr)!==0),f=(i.f&xa)===0;Xu(i)&&(o&&(i.f|=cr),Sp(i)),o&&!f&&(Ip(i),Kp(i))}if(un!=null&&un.has(t))return un.get(t);if((t.f&Hs)!==0)throw t.v;return t.v}function Kp(t){if(t.f|=cr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&fn)!==0&&(e.f&cr)===0&&(Ip(e),Kp(e))}function Vp(t){if(t.v===jt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(va.has(e)||(e.f&fn)!==0&&Vp(e))return!0;return!1}function Da(t){var e=Sr;try{return Sr=!0,t()}finally{Sr=e}}function fE(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Wr in t)uf(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Wr in n&&uf(n)}}}function uf(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{uf(t[r],e)}catch{}const n=_d(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=ap(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function dE(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const hE=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function pE(t){return hE.includes(t)}const mE={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 gE(t){return t=t.toLowerCase(),mE[t]??t}const bE=["touchstart","touchmove"];function vE(t){return bE.includes(t)}const la=Symbol("events"),Xp=new Set,of=new Set;function Qp(t,e,n,r={}){function s(a){if(r.capture||lf.call(e,a),!a.cancelBubble)return Il(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Cr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function Be(t,e,n,r,s){var a={capture:r,passive:s},i=Qp(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ku(()=>{e.removeEventListener(t,i,a)})}function ae(t,e,n){(e[la]??(e[la]={}))[t]=n}function At(t){for(var e=0;e<t.length;e++)Xp.add(t[e]);for(var n of of)n(t)}let Wh=null;function lf(t){var T,v;var e=this,n=e.ownerDocument,r=t.type,s=((T=t.composedPath)==null?void 0:T.call(t))||[],a=s[0]||t.target;Wh=t;var i=0,u=Wh===t&&t[la];if(u){var o=s.indexOf(u);if(o!==-1&&(e===document||e===window)){t[la]=e;return}var f=s.indexOf(e);if(f===-1)return;o<=f&&(i=o)}if(a=s[i]||t.target,a!==e){Kb(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=Xe,g=Ke;hr(null),Zr(null);try{for(var d,m=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var _=(v=a[la])==null?void 0:v[r];_!=null&&(!a.disabled||t.target===a)&&_.call(a,t)}catch(O){d?m.push(O):d=O}if(t.cancelBubble||b===e||b===null)break;a=b}if(d){for(let O of m)queueMicrotask(()=>{throw O});throw d}}finally{t[la]=e,delete t.currentTarget,hr(h),Zr(g)}}}var np;const pc=((np=globalThis==null?void 0:globalThis.window)==null?void 0:np.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function EE(t){return(pc==null?void 0:pc.createHTML(t))??t}function Zp(t){var e=kp("template");return e.innerHTML=EE(t.replaceAll("<!>","<!---->")),e.content}function Si(t,e){var n=Ke;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function W(t,e){var n=(e&_v)!==0,r=(e&Av)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=Zp(a?t:"<!>"+t),n||(s=Ai(s)));var i=r||Op?document.importNode(s,!0):s.cloneNode(!0);if(n){var u=Ai(i),o=i.lastChild;Si(u,o)}else Si(i,i);return i}}function TE(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=Zp(s),u=Ai(i);a=Ai(u)}var o=a.cloneNode(!0);return Si(o,o),o}}function _E(t,e){return TE(t,e,"svg")}function cf(t=""){{var e=Gr(t+"");return Si(e,e),e}}function Ir(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Gr();return t.append(e,n),Si(e,n),t}function H(t,e){t!==null&&t.before(e)}function fe(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[nu]??(t[nu]=t.nodeValue))&&(t[nu]=n,t.nodeValue=`${n}`)}function AE(t,e){return yE(t,e)}const _o=new Map;function yE(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:u}){eE();var o=void 0,f=aE(()=>{var h=n??e.appendChild(Gr());$v(h,{pending:()=>{}},m=>{ct({});var b=_t;a&&(b.c=a),s&&(r.$$events=s),o=t(m,r)||{},ft()},u);var g=new Set,d=m=>{for(var b=0;b<m.length;b++){var _=m[b];if(!g.has(_)){g.add(_);var T=vE(_);for(const L of[e,document]){var v=_o.get(L);v===void 0&&(v=new Map,_o.set(L,v));var O=v.get(_);O===void 0?(L.addEventListener(_,lf,{passive:T}),v.set(_,1)):v.set(_,O+1)}}}};return d(Nl(Xp)),of.add(d),()=>{var T;for(var m of g)for(const v of[e,document]){var b=_o.get(v),_=b.get(m);--_==0?(v.removeEventListener(m,lf),b.delete(m),b.size===0&&_o.delete(v)):b.set(m,_)}of.delete(d),h!==n&&((T=h.parentNode)==null||T.removeChild(h))}});return NE.set(o,f),o}let NE=new WeakMap;var _r,$r,Wn,ga,$u,Yu,_l;class Qu{constructor(e,n=!0){Ee(this,"anchor");Ue(this,_r,new Map);Ue(this,$r,new Map);Ue(this,Wn,new Map);Ue(this,ga,new Set);Ue(this,$u,!0);Ue(this,Yu,e=>{if(G(this,_r).has(e)){var n=G(this,_r).get(e),r=G(this,$r).get(n);if(r)Dd(r),G(this,ga).delete(n);else{var s=G(this,Wn).get(n);s&&(G(this,$r).set(n,s.effect),G(this,Wn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of G(this,_r)){if(G(this,_r).delete(a),a===e)break;const u=G(this,Wn).get(i);u&&(on(u.effect),G(this,Wn).delete(i))}for(const[a,i]of G(this,$r)){if(a===n||G(this,ga).has(a))continue;const u=()=>{if(Array.from(G(this,_r).values()).includes(a)){var f=document.createDocumentFragment();kd(i,f),f.append(Gr()),G(this,Wn).set(a,{effect:i,fragment:f})}else on(i);G(this,ga).delete(a),G(this,$r).delete(a)};G(this,$u)||!r?(G(this,ga).add(a),Ea(i,u,!1)):u()}}});Ue(this,_l,e=>{G(this,_r).delete(e);const n=Array.from(G(this,_r).values());for(const[r,s]of G(this,Wn))n.includes(r)||(on(s.effect),G(this,Wn).delete(r))});this.anchor=e,He(this,$u,n)}ensure(e,n){var r=Pe,s=Dp();if(n&&!G(this,$r).has(e)&&!G(this,Wn).has(e))if(s){var a=document.createDocumentFragment(),i=Gr();a.append(i),G(this,Wn).set(e,{effect:Fn(()=>n(i)),fragment:a})}else G(this,$r).set(e,Fn(()=>n(this.anchor)));if(G(this,_r).set(r,e),s){for(const[u,o]of G(this,$r))u===e?r.unskip_effect(o):r.skip_effect(o);for(const[u,o]of G(this,Wn))u===e?r.unskip_effect(o.effect):r.skip_effect(o.effect);r.oncommit(G(this,Yu)),r.ondiscard(G(this,_l))}else G(this,Yu).call(this,r)}}_r=new WeakMap,$r=new WeakMap,Wn=new WeakMap,ga=new WeakMap,$u=new WeakMap,Yu=new WeakMap,_l=new WeakMap;function de(t,e,n=!1){var r=new Qu(t),s=n?ps:0;function a(i,u){r.ensure(i,u)}Ra(()=>{var i=!1;e((u,o=0)=>{i=!0,a(o,u)}),i||a(-1,null)},s)}const SE=Symbol("NaN");function IE(t,e,n){var r=new Qu(t),s=!Ui();Ra(()=>{var a=e();a!==a&&(a=SE),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function Iu(t,e){return e}function CE(t,e,n){for(var r=[],s=e.length,a,i=e.length,u=0;u<s;u++){let g=e[u];Ea(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var d=t.outrogroups;ff(t,Nl(a.done)),d.delete(a),d.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var o=r.length===0&&n!==null;if(o){var f=n,h=f.parentNode;tE(h),h.append(f),t.items.clear()}ff(t,e,!o)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function ff(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const u of i)r.add(t.items.get(u).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=zr;const i=document.createDocumentFragment();kd(a,i)}else on(e[s],n)}}var Gh;function Ot(t,e,n,r,s,a=null){var i=t,u=new Map,o=(e&cp)!==0;if(o){var f=t;i=f.appendChild(Gr())}var h=null,g=wd(()=>{var L=n();return Td(L)?L:L==null?[]:Nl(L)}),d,m=new Map,b=!0;function _(L){(O.effect.f&fr)===0&&(O.pending.delete(L),O.fallback=h,wE(O,d,i,e,r),h!==null&&(d.length===0?(h.f&zr)===0?Dd(h):(h.f^=zr,su(h,null,i)):Ea(h,()=>{h=null})))}function T(L){O.pending.delete(L)}var v=Ra(()=>{d=c(g);for(var L=d.length,B=new Set,C=Pe,q=Dp(),x=0;x<L;x+=1){var j=d[x],Z=r(j,x),Y=b?null:u.get(Z);Y?(Y.v&&_i(Y.v,j),Y.i&&_i(Y.i,x),q&&C.unskip_effect(Y.e)):(Y=LE(u,b?i:Gh??(Gh=Gr()),j,Z,x,s,e,n),b||(Y.e.f|=zr),u.set(Z,Y)),B.add(Z)}if(L===0&&a&&!h&&(b?h=Fn(()=>a(i)):(h=Fn(()=>a(Gh??(Gh=Gr()))),h.f|=zr)),L>B.size&&nv(),!b)if(m.set(C,B),q){for(const[E,k]of u)B.has(E)||C.skip_effect(k.e);C.oncommit(_),C.ondiscard(T)}else _(C);c(g)}),O={effect:v,items:u,pending:m,outrogroups:null,fallback:h};b=!1}function Ki(t){for(;t!==null&&(t.f&Lr)===0;)t=t.next;return t}function wE(t,e,n,r,s){var Y,E,k,S,U,F,M,Q,z;var a=(r&pv)!==0,i=e.length,u=t.items,o=Ki(t.effect.first),f,h=null,g,d=[],m=[],b,_,T,v;if(a)for(v=0;v<i;v+=1)b=e[v],_=s(b,v),T=u.get(_).e,(T.f&zr)===0&&((E=(Y=T.nodes)==null?void 0:Y.a)==null||E.measure(),(g??(g=new Set)).add(T));for(v=0;v<i;v+=1){if(b=e[v],_=s(b,v),T=u.get(_).e,t.outrogroups!==null)for(const $ of t.outrogroups)$.pending.delete(T),$.done.delete(T);if((T.f&On)!==0&&(Dd(T),a&&((S=(k=T.nodes)==null?void 0:k.a)==null||S.unfix(),(g??(g=new Set)).delete(T))),(T.f&zr)!==0)if(T.f^=zr,T===o)su(T,null,n);else{var O=h?h.next:o;T===t.effect.last&&(t.effect.last=T.prev),T.prev&&(T.prev.next=T.next),T.next&&(T.next.prev=T.prev),ys(t,h,T),ys(t,T,O),su(T,O,n),h=T,d=[],m=[],o=Ki(h.next);continue}if(T!==o){if(f!==void 0&&f.has(T)){if(d.length<m.length){var L=m[0],B;h=L.prev;var C=d[0],q=d[d.length-1];for(B=0;B<d.length;B+=1)su(d[B],L,n);for(B=0;B<m.length;B+=1)f.delete(m[B]);ys(t,C.prev,q.next),ys(t,h,C),ys(t,q,L),o=L,h=q,v-=1,d=[],m=[]}else f.delete(T),su(T,o,n),ys(t,T.prev,T.next),ys(t,T,h===null?t.effect.first:h.next),ys(t,h,T),h=T;continue}for(d=[],m=[];o!==null&&o!==T;)(f??(f=new Set)).add(o),m.push(o),o=Ki(o.next);if(o===null)continue}(T.f&zr)===0&&d.push(T),h=T,o=Ki(T.next)}if(t.outrogroups!==null){for(const $ of t.outrogroups)$.pending.size===0&&(ff(t,Nl($.done)),(U=t.outrogroups)==null||U.delete($));t.outrogroups.size===0&&(t.outrogroups=null)}if(o!==null||f!==void 0){var x=[];if(f!==void 0)for(T of f)(T.f&On)===0&&x.push(T);for(;o!==null;)(o.f&On)===0&&o!==t.fallback&&x.push(o),o=Ki(o.next);var j=x.length;if(j>0){var Z=(r&cp)!==0&&i===0?n:null;if(a){for(v=0;v<j;v+=1)(M=(F=x[v].nodes)==null?void 0:F.a)==null||M.measure();for(v=0;v<j;v+=1)(z=(Q=x[v].nodes)==null?void 0:Q.a)==null||z.fix()}CE(t,x,Z)}}a&&Cr(()=>{var $,X;if(g!==void 0)for(T of g)(X=($=T.nodes)==null?void 0:$.a)==null||X.apply()})}function LE(t,e,n,r,s,a,i,u){var o=(i&dv)!==0?(i&mv)===0?Zv(n,!1,!1):Sa(n):null,f=(i&hv)!==0?Sa(s):null;return{v:o,i:f,e:Fn(()=>(a(e,o??n,f??s,u),()=>{t.delete(r)}))}}function su(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&zr)===0?e.nodes.start:n;r!==null;){var i=Gu(r);if(a.before(r),r===s)return;r=i}}function ys(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function OE(t,e,...n){var r=new Qu(t);Ra(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},ps)}function xE(t,e,n){var r=new Qu(t);Ra(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},ps)}function RE(t,e,n,r,s,a){var i=null,u=t,o=new Qu(u,!1);Ra(()=>{const f=e()||null;var h=yv;if(f===null){o.ensure(null,null);return}return o.ensure(f,g=>{if(f){if(i=kp(f,h),Si(i,i),r){var d=i.appendChild(Gr());r(i,d)}Ke.nodes.end=i,g.before(i)}}),()=>{}},ps),Ku(()=>{})}function DE(t,e){var n=void 0,r;Bp(()=>{n!==(n=e())&&(r&&(on(r),r=null),n&&(r=Fn(()=>{Vu(()=>n(t))})))})}function Jp(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=Jp(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function kE(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Jp(t))&&(r&&(r+=" "),r+=e);return r}function em(t){return typeof t=="object"?kE(t):t??""}const Kh=[...`
3
- \r\f \v\uFEFF`];function PE(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 u=i+a;(i===0||Kh.includes(r[i-1]))&&(u===r.length||Kh.includes(r[u]))?r=(i===0?"":r.substring(0,i))+r.substring(u+1):i=u}}return r===""?null:r}function Vh(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 mc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ME(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,u=!1,o=[];r&&o.push(...Object.keys(r).map(mc)),s&&o.push(...Object.keys(s).map(mc));var f=0,h=-1;const _=t.length;for(var g=0;g<_;g++){var d=t[g];if(u?d==="/"&&t[g-1]==="*"&&(u=!1):a?a===d&&(a=!1):d==="/"&&t[g+1]==="*"?u=!0:d==='"'||d==="'"?a=d:d==="("?i++:d===")"&&i--,!u&&a===!1&&i===0){if(d===":"&&h===-1)h=g;else if(d===";"||g===_-1){if(h!==-1){var m=mc(t.substring(f,h).trim());if(!o.includes(m)){d!==";"&&g++;var b=t.substring(f,g).trim();n+=" "+b+";"}}f=g+1,h=-1}}}}return r&&(n+=Vh(r)),s&&(n+=Vh(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function it(t,e,n,r,s,a){var i=t[Qc];if(i!==n||i===void 0){var u=PE(n,r,a);u==null?t.removeAttribute("class"):e?t.className=u:t.setAttribute("class",u),t[Qc]=n}else if(a&&s!==a)for(var o in a){var f=!!a[o];(s==null||f!==!!s[o])&&t.classList.toggle(o,f)}return a}function gc(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 tm(t,e,n,r){var s=t[Zc];if(s!==e){var a=ME(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[Zc]=e}else r&&(Array.isArray(r)?(gc(t,n==null?void 0:n[0],r[0]),gc(t,n==null?void 0:n[1],r[1],"important")):gc(t,n,r));return r}function sl(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Td(e))return Iv();for(var r of t.options)r.selected=e.includes(du(r));return}for(r of t.options){var s=du(r);if(Lp(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function nm(t){var e=new MutationObserver(()=>{sl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ku(()=>{e.disconnect()})}function Ia(t,e,n=e){var r=new WeakSet,s=!0;Od(t,"change",a=>{var i=a?"[selected]":":checked",u;if(t.multiple)u=[].map.call(t.querySelectorAll(i),du);else{var o=t.querySelector(i)??t.querySelector("option:not([disabled])");u=o&&du(o)}n(u),t.__value=u,Pe!==null&&r.add(Pe)}),Vu(()=>{var a=e();if(t===document.activeElement){var i=Pe;if(r.has(i))return}if(sl(t,a,s),s&&a===void 0){var u=t.querySelector(":checked");u!==null&&(a=du(u),n(a))}t.__value=a,s=!1}),nm(t)}function du(t){return"__value"in t?t.__value:t.value}const Vi=Symbol("class"),Xi=Symbol("style"),rm=Symbol("is custom element"),sm=Symbol("is html"),BE=Nd?"option":"OPTION",FE=Nd?"select":"SELECT",UE=Nd?"progress":"PROGRESS";function HE(t,e){var n=wl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==UE)||(t.value=e??"")}function qE(t,e){var n=wl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function jE(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function me(t,e,n,r){var s=wl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[ev]=n),n==null?t.removeAttribute(e):typeof n!="string"&&am(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function $E(t,e,n,r,s=!1,a=!1){var i=wl(t),u=i[rm],o=!i[sm],f=e||{},h=t.nodeName===BE;for(var g in e)g in n||(n[g]=null);n.class?n.class=em(n.class):n[Vi]&&(n.class=null),n[Xi]&&(n.style??(n.style=null));var d=am(t);for(const L in n){let B=n[L];if(h&&L==="value"&&B==null){t.value=t.__value="",f[L]=B;continue}if(L==="class"){var m=t.namespaceURI==="http://www.w3.org/1999/xhtml";it(t,m,B,r,e==null?void 0:e[Vi],n[Vi]),f[L]=B,f[Vi]=n[Vi];continue}if(L==="style"){tm(t,B,e==null?void 0:e[Xi],n[Xi]),f[L]=B,f[Xi]=n[Xi];continue}var b=f[L];if(!(B===b&&!(B===void 0&&t.hasAttribute(L)))){f[L]=B;var _=L[0]+L[1];if(_!=="$$")if(_==="on"){const C={},q="$$"+L;let x=L.slice(2);var T=pE(x);if(dE(x)&&(x=x.slice(0,-7),C.capture=!0),!T&&b){if(B!=null)continue;t.removeEventListener(x,f[q],C),f[q]=null}if(T)ae(x,t,B),At([x]);else if(B!=null){let j=function(Z){f[L].call(this,Z)};f[q]=Qp(x,t,j,C)}}else if(L==="style")me(t,L,B);else if(L==="autofocus")yi(t,!!B);else if(!u&&(L==="__value"||L==="value"&&B!=null))t.value=t.__value=B;else if(L==="selected"&&h)jE(t,B);else{var v=L;o||(v=gE(v));var O=v==="defaultValue"||v==="defaultChecked";if(B==null&&!u&&!O)if(i[L]=null,v==="value"||v==="checked"){let C=t;const q=e===void 0;if(v==="value"){let x=C.defaultValue;C.removeAttribute(v),C.defaultValue=x,C.value=C.__value=q?x:null}else{let x=C.defaultChecked;C.removeAttribute(v),C.defaultChecked=x,C.checked=q?x:!1}}else t.removeAttribute(L);else O||d.includes(v)&&(u||typeof B!="string")?(t[v]=B,v in i&&(i[v]=jt)):typeof B!="function"&&me(t,v,B)}}}return f}function Xh(t,e,n=[],r=[],s=[],a,i=!1,u=!1){yp(s,n,r,o=>{var f=void 0,h={},g=t.nodeName===FE,d=!1;if(Bp(()=>{var b=e(...o.map(c)),_=$E(t,f,b,a,i,u);d&&g&&"value"in b&&sl(t,b.value);for(let v of Object.getOwnPropertySymbols(h))b[v]||on(h[v]);for(let v of Object.getOwnPropertySymbols(b)){var T=b[v];v.description===Nv&&(!f||T!==f[v])&&(h[v]&&on(h[v]),h[v]=Fn(()=>DE(t,()=>T))),_[v]=T}f=_}),g){var m=t;Vu(()=>{sl(m,f.value,!0),nm(m)})}d=!0})}function wl(t){return t[Fo]??(t[Fo]={[rm]:t.nodeName.includes("-"),[sm]:t.namespaceURI===fp})}var Qh=new Map;function am(t){var e=t.getAttribute("is")||t.nodeName,n=Qh.get(e);if(n)return n;Qh.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=ap(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=_d(s)}return n}function Et(t,e,n=e){var r=new WeakSet;Od(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=vc(t)?Ec(a):a,n(a),Pe!==null&&r.add(Pe),await Gp(),a!==(a=e())){var i=t.selectionStart,u=t.selectionEnd,o=t.value.length;if(t.value=a??"",u!==null){var f=t.value.length;i===u&&u===o&&f>o?(t.selectionStart=f,t.selectionEnd=f):(t.selectionStart=i,t.selectionEnd=Math.min(u,f))}}}),Da(e)==null&&t.value&&(n(vc(t)?Ec(t.value):t.value),Pe!==null&&r.add(Pe)),Cl(()=>{var s=e();if(t===document.activeElement){var a=Pe;if(r.has(a))return}vc(t)&&s===Ec(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const bc=new Set;function YE(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var u of e)i=i[u]??(i[u]=[]);i.push(n),Od(n,"change",()=>{var o=n.__value;a&&(o=zE(i,o,n.checked)),s(o)},()=>s(a?[]:null)),Cl(()=>{var o=r();a?(o=o||[],n.checked=o.includes(n.__value)):n.checked=Lp(n.__value,o)}),Ku(()=>{var o=i.indexOf(n);o!==-1&&i.splice(o,1)}),bc.has(i)||(bc.add(i),Cr(()=>{i.sort((o,f)=>o.compareDocumentPosition(f)===4?-1:1),bc.delete(i)})),Cr(()=>{})}function zE(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 vc(t){var e=t.type;return e==="number"||e==="range"}function Ec(t){return t===""?null:+t}var Rs,bi,zu,Al,im;const yl=class yl{constructor(e){Ue(this,Al);Ue(this,Rs,new WeakMap);Ue(this,bi);Ue(this,zu);He(this,zu,e)}observe(e,n){var r=G(this,Rs).get(e)||new Set;return r.add(n),G(this,Rs).set(e,r),Ze(this,Al,im).call(this).observe(e,G(this,zu)),()=>{var s=G(this,Rs).get(e);s.delete(n),s.size===0&&(G(this,Rs).delete(e),G(this,bi).unobserve(e))}}};Rs=new WeakMap,bi=new WeakMap,zu=new WeakMap,Al=new WeakSet,im=function(){return G(this,bi)??He(this,bi,new ResizeObserver(e=>{for(var n of e){yl.entries.set(n.target,n);for(var r of G(this,Rs).get(n.target)||[])r(n)}}))},Ee(yl,"entries",new WeakMap);let df=yl;var WE=new df({box:"border-box"});function GE(t,e,n){var r=WE.observe(t,()=>n(t[e]));Vu(()=>(Da(()=>n(t[e])),r))}function Tc(t,e){return t===e||(t==null?void 0:t[Wr])===e}function dn(t={},e,n,r){var s=_t.r,a=Ke;return Vu(()=>{var i,u;return Cl(()=>{i=u,u=[],Da(()=>{Tc(n(...u),t)||(e(t,...u),i&&Tc(n(...i),t)&&e(null,...i))})}),()=>{let o=a;for(;o!==s&&o.parent!==null&&o.parent.f&Xc;)o=o.parent;const f=()=>{u&&Tc(n(...u),t)&&e(null,...u)},h=o.teardown;o.teardown=()=>{f(),h==null||h()}}}),t}function um(t=!1){const e=_t,n=e.l.u;if(!n)return;let r=()=>fE(e.s);if(t){let s=0,a={};const i=Ti(()=>{let u=!1;const o=e.s;for(const f in o)o[f]!==a[f]&&(a[f]=o[f],u=!0);return u&&s++,s});r=()=>c(i)}n.b.length&&sE(()=>{Zh(e,r),Kc(n.b)}),kt(()=>{const s=Da(()=>n.m.map(Qb));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&kt(()=>{Zh(e,r),Kc(n.a)})}function Zh(t,e){if(t.l.s)for(const n of t.l.s)c(n);e()}const KE={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 pr(t,e,n){return new Proxy({props:t,exclude:e},KE)}const VE={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(Gi(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];Gi(s)&&(s=s());const a=Us(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(Gi(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=Us(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Wr||e===op)return!1;for(let n of t.props)if(Gi(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(Gi(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 Rr(...t){return new Proxy({props:t},VE)}function ur(t,e,n,r){var B;var s=!Fi||(n&bv)!==0,a=(n&Ev)!==0,i=(n&Tv)!==0,u=r,o=!0,f=void 0,h=()=>i&&s?(f??(f=Ti(r)),c(f)):(o&&(o=!1,u=i?Da(r):r),u);let g;if(a){var d=Wr in t||op in t;g=((B=Us(t,e))==null?void 0:B.set)??(d&&e in t?C=>t[e]=C:void 0)}var m,b=!1;a?[m,b]=Mv(()=>t[e]):m=t[e],m===void 0&&r!==void 0&&(m=h(),g&&(s&&uv(),g(m)));var _;if(s?_=()=>{var C=t[e];return C===void 0?h():(o=!0,C)}:_=()=>{var C=t[e];return C!==void 0&&(u=void 0),C===void 0?u:C},s&&(n&vv)===0)return _;if(g){var T=t.$$legacy;return(function(C,q){return arguments.length>0?((!s||!q||T||b)&&g(q?_():C),C):_()})}var v=!1,O=((n&gv)!==0?Ti:wd)(()=>(v=!1,_()));a&&c(O);var L=Ke;return(function(C,q){if(arguments.length>0){const x=q?c(O):s&&a?Tt(C):C;return y(O,x),v=!0,u!==void 0&&(u=x),C}return ms&&v||(L.f&fr)!==0?O.v:c(O)})}function ka(t){_t===null&&lp(),Fi&&_t.l!==null?XE(_t).m.push(t):kt(()=>{const e=Da(t);if(typeof e=="function")return e})}function XE(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const QE="5";var rp;typeof window<"u"&&((rp=window.__svelte??(window.__svelte={})).v??(rp.v=new Set)).add(QE);Ov();function hs(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Pd(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)}class ca extends Error{constructor(e){super(e),this.name="ContentParseError"}}function hf(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function pf(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function ZE(t){return hf(t)&&Object.values(t).every(pf)}function JE(t,e){if(pf(e))return e;if(Array.isArray(e)){if(e.every(pf)||e.every(ZE))return e;throw new ca(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new ca(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Ao(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new ca(`"${e}" must be a string when present.`);return n}}function Zu(t){if(!hf(t))throw new ca("A content item must be a JSON object.");if(typeof t.title!="string")throw new ca('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new ca(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!hf(t.fields))throw new ca('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([u,o])=>[u,JE(u,o)]))}const r=Ao(t,"template"),s=Ao(t,"created"),a=Ao(t,"published"),i=Ao(t,"updated");return{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}}}function Jh(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function om(t){if(!Jh(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=Jh(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}}}const lm="_sort.json",eT="_redirects.json",tT="_site.json",nT="assets",e0=".json",Je={content:"content",templates:"templates",components:"components",public:"public"};function Kr(...t){return t.filter(e=>e!=="").join("/")}async function Md(t,e=Je.content){return cm(t,e,"","")}async function cm(t,e,n,r){const[s,a]=await Promise.all([t.list(e),sT(t,e)]),i=new Map;for(const o of s)if(o.kind==="file"){if(o.name===lm||o.name===eT||o.name===tT||!o.name.endsWith(e0))continue;const f=o.name.slice(0,-e0.length);i.set(f,await rT(t,Kr(e,o.name),f,r))}else{if(o.name===nT)continue;const f=Kr(r,o.name);i.set(o.name,await cm(t,Kr(e,o.name),o.name,f))}const u=a.name??(n===""?"":Pd(n));return{kind:"dir",slug:n,name:u,path:r,children:aT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function rT(t,e,n,r){const s=await t.readText(e);try{const a=Zu(JSON.parse(s));return{kind:"item",slug:n,path:Kr(r,n),item:a}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function sT(t,e){const n=Kr(e,lm);if(!await t.exists(n))return{order:[]};try{return om(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function aT(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 Bd(t,e=Je.components){return Fd(t,e,"html")}function fm(t,e=Je.components){return Fd(t,e,"css")}function dm(t,e=Je.components){return Fd(t,e,"js")}async function Fd(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const u of await t.list(i)){const o=Kr(i,u.name);if(u.kind==="dir")await a(o);else if(u.name.endsWith(r)){const f=u.name.slice(0,-r.length).toLowerCase();s.set(f,await t.readText(o))}}};return await a(e),s}async function Ud(t,e,n=Je.templates){return t.readText(Kr(n,`${e}.html`))}function iT(t,e,n=Je.templates){return qd(t,Kr(n,`${e}.css`))}function uT(t,e,n=Je.templates){return qd(t,Kr(n,`${e}.js`))}const Ju="document";function Hd(t,e=Je.templates){return qd(t,Kr(e,`${Ju}.html`))}async function qd(t,e){try{return await t.readText(e)}catch{return}}const jd={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 oT(t){return Object.prototype.hasOwnProperty.call(jd,t)}function $d(t){return jd[t].valueKind}const lT=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),cT=new Set(["code","pre","kbd","samp"]),fT=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Ii(t){if(t.annotation!==void 0&&oT(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 cT.has(t.tag)?"code":lT.has(t.tag)?"shorttext":fT.has(t.tag)?"text":"shorttext"}const dT=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function zs(t){const e=[];for(const n of t.matchAll(dT)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Ci(t){var r;const e=t.trim(),n=zs(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function Ll(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 Yd(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function hT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function _c(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function pT(t){return JSON.stringify(t).slice(1,-1)}function al(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 mT(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 gT(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 bT(t,e){const n=mT(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return hT((s==null?void 0:s.displayName)??r.name)});return gT(n)}const vT=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]),Lt="�";var N;(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"})(N||(N={}));const kn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function hm(t){return t>=55296&&t<=57343}function ET(t){return t>=56320&&t<=57343}function TT(t,e){return(t-55296)*1024+9216+e}function pm(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function mm(t){return t>=64976&&t<=65007||vT.has(t)}var te;(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"})(te||(te={}));const _T=65536;class AT{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=_T,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,u=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:u,endOffset:u}}_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(ET(n))return this.pos++,this._addGap(),TT(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(te.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,N.EOF;const r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.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,N.EOF;let e=this.html.charCodeAt(this.pos);return e===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):e===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,hm(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===N.LINE_FEED||e===N.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){pm(e)?this._err(te.controlCharacterInInputStream):mm(e)&&this._err(te.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(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"})(at||(at={}));function gm(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 yT=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))),NT=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 ST(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=NT.get(t))!==null&&e!==void 0?e:t}var tn;(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"})(tn||(tn={}));const IT=32;var ks;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ks||(ks={}));function mf(t){return t>=tn.ZERO&&t<=tn.NINE}function CT(t){return t>=tn.UPPER_A&&t<=tn.UPPER_F||t>=tn.LOWER_A&&t<=tn.LOWER_F}function wT(t){return t>=tn.UPPER_A&&t<=tn.UPPER_Z||t>=tn.LOWER_A&&t<=tn.LOWER_Z||mf(t)}function LT(t){return t===tn.EQUALS||wT(t)}var Jt;(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"})(Jt||(Jt={}));var ds;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(ds||(ds={}));class OT{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Jt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ds.Strict}startEntity(e){this.decodeMode=e,this.state=Jt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Jt.EntityStart:return e.charCodeAt(n)===tn.NUM?(this.state=Jt.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Jt.NamedEntity,this.stateNamedEntity(e,n));case Jt.NumericStart:return this.stateNumericStart(e,n);case Jt.NumericDecimal:return this.stateNumericDecimal(e,n);case Jt.NumericHex:return this.stateNumericHex(e,n);case Jt.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|IT)===tn.LOWER_X?(this.state=Jt.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Jt.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(mf(s)||CT(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(mf(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===tn.SEMI)this.consumed+=1;else if(this.decodeMode===ds.Strict)return 0;return this.emitCodePoint(ST(this.result),this.consumed),this.errors&&(e!==tn.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&ks.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=xT(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===ds.Attribute&&(a===0||LT(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ks.VALUE_LENGTH)>>14,a!==0){if(i===tn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==ds.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]&ks.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]&~ks.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case Jt.NamedEntity:return this.result!==0&&(this.decodeMode!==ds.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Jt.NumericDecimal:return this.emitNumericEntity(0,2);case Jt.NumericHex:return this.emitNumericEntity(0,3);case Jt.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Jt.EntityStart:return 0}}}function xT(t,e,n,r){const s=(e&ks.BRANCH_LENGTH)>>7,a=e&ks.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=s?-1:t[n+o]-1}let i=n,u=i+s-1;for(;i<=u;){const o=i+u>>>1,f=t[o];if(f<r)i=o+1;else if(f>r)u=o-1;else return t[o+s]}return-1}var oe;(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/"})(oe||(oe={}));var _a;(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"})(_a||(_a={}));var sr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(sr||(sr={}));var V;(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"})(V||(V={}));var l;(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"})(l||(l={}));const RT=new Map([[V.A,l.A],[V.ADDRESS,l.ADDRESS],[V.ANNOTATION_XML,l.ANNOTATION_XML],[V.APPLET,l.APPLET],[V.AREA,l.AREA],[V.ARTICLE,l.ARTICLE],[V.ASIDE,l.ASIDE],[V.B,l.B],[V.BASE,l.BASE],[V.BASEFONT,l.BASEFONT],[V.BGSOUND,l.BGSOUND],[V.BIG,l.BIG],[V.BLOCKQUOTE,l.BLOCKQUOTE],[V.BODY,l.BODY],[V.BR,l.BR],[V.BUTTON,l.BUTTON],[V.CAPTION,l.CAPTION],[V.CENTER,l.CENTER],[V.CODE,l.CODE],[V.COL,l.COL],[V.COLGROUP,l.COLGROUP],[V.DD,l.DD],[V.DESC,l.DESC],[V.DETAILS,l.DETAILS],[V.DIALOG,l.DIALOG],[V.DIR,l.DIR],[V.DIV,l.DIV],[V.DL,l.DL],[V.DT,l.DT],[V.EM,l.EM],[V.EMBED,l.EMBED],[V.FIELDSET,l.FIELDSET],[V.FIGCAPTION,l.FIGCAPTION],[V.FIGURE,l.FIGURE],[V.FONT,l.FONT],[V.FOOTER,l.FOOTER],[V.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[V.FORM,l.FORM],[V.FRAME,l.FRAME],[V.FRAMESET,l.FRAMESET],[V.H1,l.H1],[V.H2,l.H2],[V.H3,l.H3],[V.H4,l.H4],[V.H5,l.H5],[V.H6,l.H6],[V.HEAD,l.HEAD],[V.HEADER,l.HEADER],[V.HGROUP,l.HGROUP],[V.HR,l.HR],[V.HTML,l.HTML],[V.I,l.I],[V.IMG,l.IMG],[V.IMAGE,l.IMAGE],[V.INPUT,l.INPUT],[V.IFRAME,l.IFRAME],[V.KEYGEN,l.KEYGEN],[V.LABEL,l.LABEL],[V.LI,l.LI],[V.LINK,l.LINK],[V.LISTING,l.LISTING],[V.MAIN,l.MAIN],[V.MALIGNMARK,l.MALIGNMARK],[V.MARQUEE,l.MARQUEE],[V.MATH,l.MATH],[V.MENU,l.MENU],[V.META,l.META],[V.MGLYPH,l.MGLYPH],[V.MI,l.MI],[V.MO,l.MO],[V.MN,l.MN],[V.MS,l.MS],[V.MTEXT,l.MTEXT],[V.NAV,l.NAV],[V.NOBR,l.NOBR],[V.NOFRAMES,l.NOFRAMES],[V.NOEMBED,l.NOEMBED],[V.NOSCRIPT,l.NOSCRIPT],[V.OBJECT,l.OBJECT],[V.OL,l.OL],[V.OPTGROUP,l.OPTGROUP],[V.OPTION,l.OPTION],[V.P,l.P],[V.PARAM,l.PARAM],[V.PLAINTEXT,l.PLAINTEXT],[V.PRE,l.PRE],[V.RB,l.RB],[V.RP,l.RP],[V.RT,l.RT],[V.RTC,l.RTC],[V.RUBY,l.RUBY],[V.S,l.S],[V.SCRIPT,l.SCRIPT],[V.SEARCH,l.SEARCH],[V.SECTION,l.SECTION],[V.SELECT,l.SELECT],[V.SOURCE,l.SOURCE],[V.SMALL,l.SMALL],[V.SPAN,l.SPAN],[V.STRIKE,l.STRIKE],[V.STRONG,l.STRONG],[V.STYLE,l.STYLE],[V.SUB,l.SUB],[V.SUMMARY,l.SUMMARY],[V.SUP,l.SUP],[V.TABLE,l.TABLE],[V.TBODY,l.TBODY],[V.TEMPLATE,l.TEMPLATE],[V.TEXTAREA,l.TEXTAREA],[V.TFOOT,l.TFOOT],[V.TD,l.TD],[V.TH,l.TH],[V.THEAD,l.THEAD],[V.TITLE,l.TITLE],[V.TR,l.TR],[V.TRACK,l.TRACK],[V.TT,l.TT],[V.U,l.U],[V.UL,l.UL],[V.SVG,l.SVG],[V.VAR,l.VAR],[V.WBR,l.WBR],[V.XMP,l.XMP]]);function Ol(t){var e;return(e=RT.get(t))!==null&&e!==void 0?e:l.UNKNOWN}const ce=l,DT={[oe.HTML]:new Set([ce.ADDRESS,ce.APPLET,ce.AREA,ce.ARTICLE,ce.ASIDE,ce.BASE,ce.BASEFONT,ce.BGSOUND,ce.BLOCKQUOTE,ce.BODY,ce.BR,ce.BUTTON,ce.CAPTION,ce.CENTER,ce.COL,ce.COLGROUP,ce.DD,ce.DETAILS,ce.DIR,ce.DIV,ce.DL,ce.DT,ce.EMBED,ce.FIELDSET,ce.FIGCAPTION,ce.FIGURE,ce.FOOTER,ce.FORM,ce.FRAME,ce.FRAMESET,ce.H1,ce.H2,ce.H3,ce.H4,ce.H5,ce.H6,ce.HEAD,ce.HEADER,ce.HGROUP,ce.HR,ce.HTML,ce.IFRAME,ce.IMG,ce.INPUT,ce.LI,ce.LINK,ce.LISTING,ce.MAIN,ce.MARQUEE,ce.MENU,ce.META,ce.NAV,ce.NOEMBED,ce.NOFRAMES,ce.NOSCRIPT,ce.OBJECT,ce.OL,ce.P,ce.PARAM,ce.PLAINTEXT,ce.PRE,ce.SCRIPT,ce.SECTION,ce.SELECT,ce.SOURCE,ce.STYLE,ce.SUMMARY,ce.TABLE,ce.TBODY,ce.TD,ce.TEMPLATE,ce.TEXTAREA,ce.TFOOT,ce.TH,ce.THEAD,ce.TITLE,ce.TR,ce.TRACK,ce.UL,ce.WBR,ce.XMP]),[oe.MATHML]:new Set([ce.MI,ce.MO,ce.MN,ce.MS,ce.MTEXT,ce.ANNOTATION_XML]),[oe.SVG]:new Set([ce.TITLE,ce.FOREIGN_OBJECT,ce.DESC]),[oe.XLINK]:new Set,[oe.XML]:new Set,[oe.XMLNS]:new Set},gf=new Set([ce.H1,ce.H2,ce.H3,ce.H4,ce.H5,ce.H6]),kT=new Set([V.STYLE,V.SCRIPT,V.XMP,V.IFRAME,V.NOEMBED,V.NOFRAMES,V.PLAINTEXT]);function PT(t,e){return kT.has(t)||e&&t===V.NOSCRIPT}var w;(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"})(w||(w={}));const Hn={DATA:w.DATA,RCDATA:w.RCDATA,RAWTEXT:w.RAWTEXT,SCRIPT_DATA:w.SCRIPT_DATA,PLAINTEXT:w.PLAINTEXT,CDATA_SECTION:w.CDATA_SECTION};function MT(t){return t>=N.DIGIT_0&&t<=N.DIGIT_9}function au(t){return t>=N.LATIN_CAPITAL_A&&t<=N.LATIN_CAPITAL_Z}function BT(t){return t>=N.LATIN_SMALL_A&&t<=N.LATIN_SMALL_Z}function Ns(t){return BT(t)||au(t)}function t0(t){return Ns(t)||MT(t)}function yo(t){return t+32}function bm(t){return t===N.SPACE||t===N.LINE_FEED||t===N.TABULATION||t===N.FORM_FEED}function n0(t){return bm(t)||t===N.SOLIDUS||t===N.GREATER_THAN_SIGN}function FT(t){return t===N.NULL?te.nullCharacterReference:t>1114111?te.characterReferenceOutsideUnicodeRange:hm(t)?te.surrogateCharacterReference:mm(t)?te.noncharacterCharacterReference:pm(t)||t===N.CARRIAGE_RETURN?te.controlCharacterReference:null}class UT{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=w.DATA,this.returnState=w.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new AT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new OT(yT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=FT(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:at.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:at.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(gm(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(te.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=Ol(e.tagName),e.type===at.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(te.endTagWithAttributes),e.selfClosing&&this._err(te.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 at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.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:at.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=bm(e)?at.WHITESPACE_CHARACTER:e===N.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(at.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=w.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ds.Attribute:ds.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===w.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===w.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===w.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case w.DATA:{this._stateData(e);break}case w.RCDATA:{this._stateRcdata(e);break}case w.RAWTEXT:{this._stateRawtext(e);break}case w.SCRIPT_DATA:{this._stateScriptData(e);break}case w.PLAINTEXT:{this._statePlaintext(e);break}case w.TAG_OPEN:{this._stateTagOpen(e);break}case w.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case w.TAG_NAME:{this._stateTagName(e);break}case w.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case w.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case w.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case w.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case w.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case w.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case w.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case w.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case w.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case w.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case w.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case w.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case w.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case w.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case w.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case w.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case w.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case w.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case w.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case w.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case w.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case w.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case w.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case w.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case w.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case w.BOGUS_COMMENT:{this._stateBogusComment(e);break}case w.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case w.COMMENT_START:{this._stateCommentStart(e);break}case w.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case w.COMMENT:{this._stateComment(e);break}case w.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case w.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case w.COMMENT_END:{this._stateCommentEnd(e);break}case w.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case w.DOCTYPE:{this._stateDoctype(e);break}case w.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case w.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case w.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case w.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case w.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case w.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case w.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case w.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case w.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case w.CDATA_SECTION:{this._stateCdataSection(e);break}case w.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case w.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case w.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case w.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(e);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=w.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ns(e))this._createStartTagToken(),this.state=w.TAG_NAME,this._stateTagName(e);else switch(e){case N.EXCLAMATION_MARK:{this.state=w.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=w.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e);break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=w.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ns(e))this._createEndTagToken(),this.state=w.TAG_NAME,this._stateTagName(e);else switch(e){case N.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=w.DATA;break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this.state=w.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.tagName+=Lt;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(au(e)?yo(e):e)}}_stateRcdataLessThanSign(e){e===N.SOLIDUS?this.state=w.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=w.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ns(e)?(this.state=w.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=w.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=w.BEFORE_ATTRIBUTE_NAME,!1;case N.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=w.SELF_CLOSING_START_TAG,!1;case N.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=w.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===N.SOLIDUS?this.state=w.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ns(e)?(this.state=w.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case N.SOLIDUS:{this.state=w.SCRIPT_DATA_END_TAG_OPEN;break}case N.EXCLAMATION_MARK:{this.state=w.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=w.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ns(e)?(this.state=w.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===N.HYPHEN_MINUS?(this.state=w.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===N.HYPHEN_MINUS?(this.state=w.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.GREATER_THAN_SIGN:{this.state=w.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===N.SOLIDUS?this.state=w.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ns(e)?(this._emitChars("<"),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ns(e)?(this.state=w.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(kn.SCRIPT,!1)&&n0(this.preprocessor.peek(kn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<kn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.GREATER_THAN_SIGN:{this.state=w.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===N.SOLIDUS?(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(kn.SCRIPT,!1)&&n0(this.preprocessor.peek(kn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<kn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=w.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this.state=w.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case N.EQUALS_SIGN:{this._err(te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=w.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=w.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this._leaveAttrName(),this.state=w.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case N.EQUALS_SIGN:{this._leaveAttrName(),this.state=w.BEFORE_ATTRIBUTE_VALUE;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:{this._err(te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.name+=Lt;break}default:this.currentAttr.name+=String.fromCodePoint(au(e)?yo(e):e)}}_stateAfterAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:{this.state=w.SELF_CLOSING_START_TAG;break}case N.EQUALS_SIGN:{this.state=w.BEFORE_ATTRIBUTE_VALUE;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=w.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{this.state=w.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this.state=w.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingAttributeValue),this.state=w.DATA,this.emitCurrentTagToken();break}default:this.state=w.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case N.APOSTROPHE:{this.state=w.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=w.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:case N.EQUALS_SIGN:case N.GRAVE_ACCENT:{this._err(te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this._leaveAttrValue(),this.state=w.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBetweenAttributes),this.state=w.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case N.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.unexpectedSolidusInTag),this.state=w.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=Lt;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(kn.DASH_DASH,!0)?(this._createCommentToken(kn.DASH_DASH.length+1),this.state=w.COMMENT_START):this._consumeSequenceIfMatch(kn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(kn.DOCTYPE.length+1),this.state=w.DOCTYPE):this._consumeSequenceIfMatch(kn.CDATA_START,!0)?this.inForeignNode?this.state=w.CDATA_SECTION:(this._err(te.cdataInHtmlContent),this._createCommentToken(kn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=w.BOGUS_COMMENT):this._ensureHibernation()||(this._err(te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_START_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=w.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=w.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=w.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END_DASH;break}case N.LESS_THAN_SIGN:{n.data+="<",this.state=w.COMMENT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=Lt;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case N.EXCLAMATION_MARK:{n.data+="!",this.state=w.COMMENT_LESS_THAN_SIGN_BANG;break}case N.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=w.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===N.HYPHEN_MINUS?this.state=w.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=w.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===N.HYPHEN_MINUS?this.state=w.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=w.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==N.GREATER_THAN_SIGN&&e!==N.EOF&&this._err(te.nestedComment),this.state=w.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=w.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentComment(n);break}case N.EXCLAMATION_MARK:{this.state=w.COMMENT_END_BANG;break}case N.HYPHEN_MINUS:{n.data+="-";break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=w.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{n.data+="--!",this.state=w.COMMENT_END_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.incorrectlyClosedComment),this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=w.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=w.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case N.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBeforeDoctypeName),this.state=w.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(au(e))this._createDoctypeToken(String.fromCharCode(yo(e))),this.state=w.DOCTYPE_NAME;else switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.NULL:{this._err(te.unexpectedNullCharacter),this._createDoctypeToken(Lt),this.state=w.DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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=w.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.AFTER_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.name+=Lt;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(au(e)?yo(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(kn.PUBLIC,!1)?this.state=w.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(kn.SYSTEM,!1)?this.state=w.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.QUOTATION_MARK:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.NULL:{this._err(te.unexpectedNullCharacter);break}case N.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case N.RIGHT_SQUARE_BRACKET:{this.state=w.CDATA_SECTION_BRACKET;break}case N.EOF:{this._err(te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===N.RIGHT_SQUARE_BRACKET?this.state=w.CDATA_SECTION_END:(this._emitChars("]"),this.state=w.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA;break}case N.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=w.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(N.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&t0(this.preprocessor.peek(1))?w.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){t0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===N.SEMICOLON&&this._err(te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const vm=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),r0=new Set([...vm,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),il=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),HT=new Set([...il,l.OL,l.UL]),qT=new Set([...il,l.BUTTON]),s0=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),a0=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),jT=new Set([l.TR,l.TEMPLATE,l.HTML]),$T=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),YT=new Set([l.TABLE,l.TEMPLATE,l.HTML]),zT=new Set([l.TD,l.TH]);class WT{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=l.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===oe.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])!==oe.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(gf,oe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(zT,oe.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(YT,oe.HTML)}clearBackToTableBodyContext(){this.clearBackTo($T,oe.HTML)}clearBackToTableRowContext(){this.clearBackTo(jT,oe.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]===l.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]===l.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 oe.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case oe.SVG:{if(a0.has(s))return!1;break}case oe.MATHML:{if(s0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,il)}hasInListItemScope(e){return this.hasInDynamicScope(e,HT)}hasInButtonScope(e){return this.hasInDynamicScope(e,qT)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case oe.HTML:{if(gf.has(n))return!0;if(il.has(n))return!1;break}case oe.SVG:{if(a0.has(n))return!1;break}case oe.MATHML:{if(s0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===oe.HTML)switch(this.tagIDs[n]){case e:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===oe.HTML)switch(this.tagIDs[e]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===oe.HTML)switch(this.tagIDs[n]){case e:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&vm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&r0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&r0.has(this.currentTagId);)this.pop()}}const Ac=3;var Yr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Yr||(Yr={}));const i0={type:Yr.Marker};class GT{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 u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===Yr.Marker)break;const{element:f}=o;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===i){const h=this.treeAdapter.getAttrList(f);h.length===s&&r.push({idx:u,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Ac)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Ac)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const u=r[i];u.attrs.every(o=>s.get(o.name)===o.value)&&(a+=1,a>=Ac&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(i0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Yr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Yr.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(i0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Yr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Yr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Yr.Element&&n.element===e)}}const os={createDocument(){return{nodeName:"#document",mode:sr.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};os.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(os.isTextNode(n)){n.value+=e;return}}os.appendChild(t,os.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&os.isTextNode(r)?r.value+=e:os.insertBefore(t,os.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}}},Em="html",KT="about:legacy-compat",VT="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Tm=["+//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//"],XT=[...Tm,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],QT=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),_m=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],ZT=[..._m,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function u0(t,e){return e.some(n=>t.startsWith(n))}function JT(t){return t.name===Em&&t.publicId===null&&(t.systemId===null||t.systemId===KT)}function e_(t){if(t.name!==Em)return sr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===VT)return sr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),QT.has(n))return sr.QUIRKS;let r=e===null?XT:Tm;if(u0(n,r))return sr.QUIRKS;if(r=e===null?_m:ZT,u0(n,r))return sr.LIMITED_QUIRKS}return sr.NO_QUIRKS}const o0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},t_="definitionurl",n_="definitionURL",r_=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])),s_=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:oe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:oe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:oe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:oe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:oe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:oe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:oe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:oe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:oe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:oe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:oe.XMLNS}]]),a_=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])),i_=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function u_(t){const e=t.tagID;return e===l.FONT&&t.attrs.some(({name:r})=>r===_a.COLOR||r===_a.SIZE||r===_a.FACE)||i_.has(e)}function Am(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===t_){t.attrs[e].name=n_;break}}function ym(t){for(let e=0;e<t.attrs.length;e++){const n=r_.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function zd(t){for(let e=0;e<t.attrs.length;e++){const n=s_.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 o_(t){const e=a_.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Ol(t.tagName))}function l_(t,e){return e===oe.MATHML&&(t===l.MI||t===l.MO||t===l.MN||t===l.MS||t===l.MTEXT)}function c_(t,e,n){if(e===oe.MATHML&&t===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===_a.ENCODING){const s=n[r].value.toLowerCase();return s===o0.TEXT_HTML||s===o0.APPLICATION_XML}}return e===oe.SVG&&(t===l.FOREIGN_OBJECT||t===l.DESC||t===l.TITLE)}function f_(t,e,n,r){return(!r||r===oe.HTML)&&c_(t,e,n)||(!r||r===oe.MATHML)&&l_(t,e)}const d_="hidden",h_=8,p_=3;var D;(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"})(D||(D={}));const m_={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Nm=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),l0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:os,onParseError:null};class Sm{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=D.INITIAL,this.originalInsertionMode=D.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={...l0,...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 UT(this.options,this),this.activeFormattingElements=new GT(this.treeAdapter),this.fragmentContextID=r?Ol(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new WT(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={...l0,...n};e??(e=r.treeAdapter.createElement(V.TEMPLATE,oe.HTML,[]));const s=r.treeAdapter.createElement("documentmock",oe.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(D.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:m_,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)===oe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,oe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=D.TEXT}switchToPlaintextParsing(){this.insertionMode=D.TEXT,this.originalInsertionMode=D.IN_BODY,this.tokenizer.state=Hn.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)===V.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==oe.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=Hn.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=Hn.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=Hn.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=Hn.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(u=>this.treeAdapter.isDocumentTypeNode(u));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,oe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,oe.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(V.HTML,oe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,l.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:o,endCol:f,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:o,endCol:f,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===at.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===l.SVG&&this.treeAdapter.getTagName(n)===V.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===oe.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===l.MGLYPH||e.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,oe.HTML)}_processToken(e){switch(e.type){case at.CHARACTER:{this.onCharacter(e);break}case at.NULL_CHARACTER:{this.onNullCharacter(e);break}case at.COMMENT:{this.onComment(e);break}case at.DOCTYPE:{this.onDoctype(e);break}case at.START_TAG:{this._processStartTag(e);break}case at.END_TAG:{this.onEndTag(e);break}case at.EOF:{this.onEof(e);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return f_(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Yr.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=D.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case l.TR:{this.insertionMode=D.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=D.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=D.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=D.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=D.IN_TABLE;return}case l.BODY:{this.insertionMode=D.IN_BODY;return}case l.FRAMESET:{this.insertionMode=D.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(e);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?D.AFTER_HEAD:D.BEFORE_HEAD;return}case l.TD:case l.TH:{if(e>0){this.insertionMode=D.IN_CELL;return}break}case l.HEAD:{if(e>0){this.insertionMode=D.IN_HEAD;return}break}}this.insertionMode=D.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=D.IN_SELECT_IN_TABLE;return}}this.insertionMode=D.IN_SELECT}_isElementCausesFosterParenting(e){return Nm.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 l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===oe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.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 DT[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){z2(this,e);return}switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{hu(this,e);break}case D.BEFORE_HEAD:{pu(this,e);break}case D.IN_HEAD:{mu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{gu(this,e);break}case D.AFTER_HEAD:{bu(this,e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:{Cm(this,e);break}case D.TEXT:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{yc(this,e);break}case D.IN_TABLE_TEXT:{Dm(this,e);break}case D.IN_COLUMN_GROUP:{ul(this,e);break}case D.AFTER_BODY:{ol(this,e);break}case D.AFTER_AFTER_BODY:{zo(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Y2(this,e);return}switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{hu(this,e);break}case D.BEFORE_HEAD:{pu(this,e);break}case D.IN_HEAD:{mu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{gu(this,e);break}case D.AFTER_HEAD:{bu(this,e);break}case D.TEXT:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{yc(this,e);break}case D.IN_COLUMN_GROUP:{ul(this,e);break}case D.AFTER_BODY:{ol(this,e);break}case D.AFTER_AFTER_BODY:{zo(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){bf(this,e);return}switch(this.insertionMode){case D.INITIAL:case D.BEFORE_HTML:case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_TEMPLATE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{bf(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.AFTER_BODY:{A_(this,e);break}case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{y_(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case D.INITIAL:{N_(this,e);break}case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:{this._err(e,te.misplacedDoctype);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?W2(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{S_(this,e);break}case D.BEFORE_HEAD:{C_(this,e);break}case D.IN_HEAD:{Dr(this,e);break}case D.IN_HEAD_NO_SCRIPT:{O_(this,e);break}case D.AFTER_HEAD:{R_(this,e);break}case D.IN_BODY:{yn(this,e);break}case D.IN_TABLE:{wi(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.IN_CAPTION:{w2(this,e);break}case D.IN_COLUMN_GROUP:{Kd(this,e);break}case D.IN_TABLE_BODY:{Dl(this,e);break}case D.IN_ROW:{kl(this,e);break}case D.IN_CELL:{x2(this,e);break}case D.IN_SELECT:{Mm(this,e);break}case D.IN_SELECT_IN_TABLE:{D2(this,e);break}case D.IN_TEMPLATE:{P2(this,e);break}case D.AFTER_BODY:{B2(this,e);break}case D.IN_FRAMESET:{F2(this,e);break}case D.AFTER_FRAMESET:{H2(this,e);break}case D.AFTER_AFTER_BODY:{j2(this,e);break}case D.AFTER_AFTER_FRAMESET:{$2(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?G2(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{I_(this,e);break}case D.BEFORE_HEAD:{w_(this,e);break}case D.IN_HEAD:{L_(this,e);break}case D.IN_HEAD_NO_SCRIPT:{x_(this,e);break}case D.AFTER_HEAD:{D_(this,e);break}case D.IN_BODY:{Rl(this,e);break}case D.TEXT:{v2(this,e);break}case D.IN_TABLE:{Cu(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.IN_CAPTION:{L2(this,e);break}case D.IN_COLUMN_GROUP:{O2(this,e);break}case D.IN_TABLE_BODY:{vf(this,e);break}case D.IN_ROW:{Pm(this,e);break}case D.IN_CELL:{R2(this,e);break}case D.IN_SELECT:{Bm(this,e);break}case D.IN_SELECT_IN_TABLE:{k2(this,e);break}case D.IN_TEMPLATE:{M2(this,e);break}case D.AFTER_BODY:{Um(this,e);break}case D.IN_FRAMESET:{U2(this,e);break}case D.AFTER_FRAMESET:{q2(this,e);break}case D.AFTER_AFTER_BODY:{zo(this,e);break}}}onEof(e){switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{hu(this,e);break}case D.BEFORE_HEAD:{pu(this,e);break}case D.IN_HEAD:{mu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{gu(this,e);break}case D.AFTER_HEAD:{bu(this,e);break}case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{xm(this,e);break}case D.TEXT:{E2(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.IN_TEMPLATE:{Fm(this,e);break}case D.AFTER_BODY:case D.IN_FRAMESET:case D.AFTER_FRAMESET:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Gd(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===N.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 D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.TEXT:case D.IN_COLUMN_GROUP:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{this._insertCharacters(e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:case D.AFTER_BODY:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Im(this,e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{yc(this,e);break}case D.IN_TABLE_TEXT:{Rm(this,e);break}}}}function g_(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):Om(t,e),n}function b_(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 v_(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 u=t.activeFormattingElements.getElementEntry(i),o=u&&a>=p_;!u||o?(o&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(i)):(i=E_(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function E_(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 T_(t,e,n){const r=t.treeAdapter.getTagName(e),s=Ol(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===l.TEMPLATE&&a===oe.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function __(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 Wd(t,e){for(let n=0;n<h_;n++){const r=g_(t,e);if(!r)break;const s=b_(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=v_(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&T_(t,i,a),__(t,s,r)}}function bf(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function A_(t,e){t._appendCommentNode(e,t.openElements.items[0])}function y_(t,e){t._appendCommentNode(e,t.document)}function Gd(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 N_(t,e){t._setDocumentType(e);const n=e.forceQuirks?sr.QUIRKS:e_(e);JT(e)||t._err(e,te.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=D.BEFORE_HTML}function Qi(t,e){t._err(e,te.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,sr.QUIRKS),t.insertionMode=D.BEFORE_HTML,t._processToken(e)}function S_(t,e){e.tagID===l.HTML?(t._insertElement(e,oe.HTML),t.insertionMode=D.BEFORE_HEAD):hu(t,e)}function I_(t,e){const n=e.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&hu(t,e)}function hu(t,e){t._insertFakeRootElement(),t.insertionMode=D.BEFORE_HEAD,t._processToken(e)}function C_(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.HEAD:{t._insertElement(e,oe.HTML),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD;break}default:pu(t,e)}}function w_(t,e){const n=e.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?pu(t,e):t._err(e,te.endTagWithoutMatchingOpenElement)}function pu(t,e){t._insertFakeElement(V.HEAD,l.HEAD),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD,t._processToken(e)}function Dr(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.TITLE:{t._switchToTextParsing(e,Hn.RCDATA);break}case l.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Hn.RAWTEXT):(t._insertElement(e,oe.HTML),t.insertionMode=D.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{t._switchToTextParsing(e,Hn.RAWTEXT);break}case l.SCRIPT:{t._switchToTextParsing(e,Hn.SCRIPT_DATA);break}case l.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=D.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(D.IN_TEMPLATE);break}case l.HEAD:{t._err(e,te.misplacedStartTagForHeadElement);break}default:mu(t,e)}}function L_(t,e){switch(e.tagID){case l.HEAD:{t.openElements.pop(),t.insertionMode=D.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{mu(t,e);break}case l.TEMPLATE:{Pa(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function Pa(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==l.TEMPLATE&&t._err(e,te.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(l.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,te.endTagWithoutMatchingOpenElement)}function mu(t,e){t.openElements.pop(),t.insertionMode=D.AFTER_HEAD,t._processToken(e)}function O_(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{Dr(t,e);break}case l.NOSCRIPT:{t._err(e,te.nestedNoscriptInHead);break}default:gu(t,e)}}function x_(t,e){switch(e.tagID){case l.NOSCRIPT:{t.openElements.pop(),t.insertionMode=D.IN_HEAD;break}case l.BR:{gu(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function gu(t,e){const n=e.type===at.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=D.IN_HEAD,t._processToken(e)}function R_(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.BODY:{t._insertElement(e,oe.HTML),t.framesetOk=!1,t.insertionMode=D.IN_BODY;break}case l.FRAMESET:{t._insertElement(e,oe.HTML),t.insertionMode=D.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{t._err(e,te.abandonedHeadElementChild),t.openElements.push(t.headElement,l.HEAD),Dr(t,e),t.openElements.remove(t.headElement);break}case l.HEAD:{t._err(e,te.misplacedStartTagForHeadElement);break}default:bu(t,e)}}function D_(t,e){switch(e.tagID){case l.BODY:case l.HTML:case l.BR:{bu(t,e);break}case l.TEMPLATE:{Pa(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function bu(t,e){t._insertFakeElement(V.BODY,l.BODY),t.insertionMode=D.IN_BODY,xl(t,e)}function xl(t,e){switch(e.type){case at.CHARACTER:{Cm(t,e);break}case at.WHITESPACE_CHARACTER:{Im(t,e);break}case at.COMMENT:{bf(t,e);break}case at.START_TAG:{yn(t,e);break}case at.END_TAG:{Rl(t,e);break}case at.EOF:{xm(t,e);break}}}function Im(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Cm(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function k_(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function P_(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function M_(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_FRAMESET)}function B_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML)}function F_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&gf.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,oe.HTML)}function U_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function H_(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),n||(t.formElement=t.openElements.current))}function q_(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===l.LI&&s===l.LI||(n===l.DD||n===l.DT)&&(s===l.DD||s===l.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==l.ADDRESS&&s!==l.DIV&&s!==l.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML)}function j_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),t.tokenizer.state=Hn.PLAINTEXT}function $_(t,e){t.openElements.hasInScope(l.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.framesetOk=!1}function Y_(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(V.A);n&&(Wd(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function z_(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function W_(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(l.NOBR)&&(Wd(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,oe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function G_(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function K_(t,e){t.treeAdapter.getDocumentMode(t.document)!==sr.QUIRKS&&t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),t.framesetOk=!1,t.insertionMode=D.IN_TABLE}function wm(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,oe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Lm(t){const e=gm(t,_a.TYPE);return e!=null&&e.toLowerCase()===d_}function V_(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,oe.HTML),Lm(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function X_(t,e){t._appendElement(e,oe.HTML),e.ackSelfClosing=!0}function Q_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._appendElement(e,oe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Z_(t,e){e.tagName=V.IMG,e.tagID=l.IMG,wm(t,e)}function J_(t,e){t._insertElement(e,oe.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Hn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=D.TEXT}function e2(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Hn.RAWTEXT)}function t2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Hn.RAWTEXT)}function c0(t,e){t._switchToTextParsing(e,Hn.RAWTEXT)}function n2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===D.IN_TABLE||t.insertionMode===D.IN_CAPTION||t.insertionMode===D.IN_TABLE_BODY||t.insertionMode===D.IN_ROW||t.insertionMode===D.IN_CELL?D.IN_SELECT_IN_TABLE:D.IN_SELECT}function r2(t,e){t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML)}function s2(t,e){t.openElements.hasInScope(l.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,oe.HTML)}function a2(t,e){t.openElements.hasInScope(l.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(l.RTC),t._insertElement(e,oe.HTML)}function i2(t,e){t._reconstructActiveFormattingElements(),Am(e),zd(e),e.selfClosing?t._appendElement(e,oe.MATHML):t._insertElement(e,oe.MATHML),e.ackSelfClosing=!0}function u2(t,e){t._reconstructActiveFormattingElements(),ym(e),zd(e),e.selfClosing?t._appendElement(e,oe.SVG):t._insertElement(e,oe.SVG),e.ackSelfClosing=!0}function f0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML)}function yn(t,e){switch(e.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{z_(t,e);break}case l.A:{Y_(t,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{F_(t,e);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{B_(t,e);break}case l.LI:case l.DD:case l.DT:{q_(t,e);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{wm(t,e);break}case l.HR:{Q_(t,e);break}case l.RB:case l.RTC:{s2(t,e);break}case l.RT:case l.RP:{a2(t,e);break}case l.PRE:case l.LISTING:{U_(t,e);break}case l.XMP:{e2(t,e);break}case l.SVG:{u2(t,e);break}case l.HTML:{k_(t,e);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{Dr(t,e);break}case l.BODY:{P_(t,e);break}case l.FORM:{H_(t,e);break}case l.NOBR:{W_(t,e);break}case l.MATH:{i2(t,e);break}case l.TABLE:{K_(t,e);break}case l.INPUT:{V_(t,e);break}case l.PARAM:case l.TRACK:case l.SOURCE:{X_(t,e);break}case l.IMAGE:{Z_(t,e);break}case l.BUTTON:{$_(t,e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{G_(t,e);break}case l.IFRAME:{t2(t,e);break}case l.SELECT:{n2(t,e);break}case l.OPTION:case l.OPTGROUP:{r2(t,e);break}case l.NOEMBED:case l.NOFRAMES:{c0(t,e);break}case l.FRAMESET:{M_(t,e);break}case l.TEXTAREA:{J_(t,e);break}case l.NOSCRIPT:{t.options.scriptingEnabled?c0(t,e):f0(t,e);break}case l.PLAINTEXT:{j_(t,e);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:f0(t,e)}}function o2(t,e){if(t.openElements.hasInScope(l.BODY)&&(t.insertionMode=D.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function l2(t,e){t.openElements.hasInScope(l.BODY)&&(t.insertionMode=D.AFTER_BODY,Um(t,e))}function c2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function f2(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(l.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(l.FORM):n&&t.openElements.remove(n))}function d2(t){t.openElements.hasInButtonScope(l.P)||t._insertFakeElement(V.P,l.P),t._closePElement()}function h2(t){t.openElements.hasInListItemScope(l.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(l.LI),t.openElements.popUntilTagNamePopped(l.LI))}function p2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function m2(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function g2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function b2(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(V.BR,l.BR),t.openElements.pop(),t.framesetOk=!1}function Om(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!==l.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 Rl(t,e){switch(e.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{Wd(t,e);break}case l.P:{d2(t);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{c2(t,e);break}case l.LI:{h2(t);break}case l.DD:case l.DT:{p2(t,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{m2(t);break}case l.BR:{b2(t);break}case l.BODY:{o2(t,e);break}case l.HTML:{l2(t,e);break}case l.FORM:{f2(t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{g2(t,e);break}case l.TEMPLATE:{Pa(t,e);break}default:Om(t,e)}}function xm(t,e){t.tmplInsertionModeStack.length>0?Fm(t,e):Gd(t,e)}function v2(t,e){var n;e.tagID===l.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function E2(t,e){t._err(e,te.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function yc(t,e){if(t.openElements.currentTagId!==void 0&&Nm.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=D.IN_TABLE_TEXT,e.type){case at.CHARACTER:{Dm(t,e);break}case at.WHITESPACE_CHARACTER:{Rm(t,e);break}}else eo(t,e)}function T2(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_CAPTION}function _2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_COLUMN_GROUP}function A2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(V.COLGROUP,l.COLGROUP),t.insertionMode=D.IN_COLUMN_GROUP,Kd(t,e)}function y2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_TABLE_BODY}function N2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(V.TBODY,l.TBODY),t.insertionMode=D.IN_TABLE_BODY,Dl(t,e)}function S2(t,e){t.openElements.hasInTableScope(l.TABLE)&&(t.openElements.popUntilTagNamePopped(l.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function I2(t,e){Lm(e)?t._appendElement(e,oe.HTML):eo(t,e),e.ackSelfClosing=!0}function C2(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,oe.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function wi(t,e){switch(e.tagID){case l.TD:case l.TH:case l.TR:{N2(t,e);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{Dr(t,e);break}case l.COL:{A2(t,e);break}case l.FORM:{C2(t,e);break}case l.TABLE:{S2(t,e);break}case l.TBODY:case l.TFOOT:case l.THEAD:{y2(t,e);break}case l.INPUT:{I2(t,e);break}case l.CAPTION:{T2(t,e);break}case l.COLGROUP:{_2(t,e);break}default:eo(t,e)}}function Cu(t,e){switch(e.tagID){case l.TABLE:{t.openElements.hasInTableScope(l.TABLE)&&(t.openElements.popUntilTagNamePopped(l.TABLE),t._resetInsertionMode());break}case l.TEMPLATE:{Pa(t,e);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:eo(t,e)}}function eo(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,xl(t,e),t.fosterParentingEnabled=n}function Rm(t,e){t.pendingCharacterTokens.push(e)}function Dm(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Zi(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)eo(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const km=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function w2(t,e){const n=e.tagID;km.has(n)?t.openElements.hasInTableScope(l.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_TABLE,wi(t,e)):yn(t,e)}function L2(t,e){const n=e.tagID;switch(n){case l.CAPTION:case l.TABLE:{t.openElements.hasInTableScope(l.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_TABLE,n===l.TABLE&&Cu(t,e));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Rl(t,e)}}function Kd(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.COL:{t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.TEMPLATE:{Dr(t,e);break}default:ul(t,e)}}function O2(t,e){switch(e.tagID){case l.COLGROUP:{t.openElements.currentTagId===l.COLGROUP&&(t.openElements.pop(),t.insertionMode=D.IN_TABLE);break}case l.TEMPLATE:{Pa(t,e);break}case l.COL:break;default:ul(t,e)}}function ul(t,e){t.openElements.currentTagId===l.COLGROUP&&(t.openElements.pop(),t.insertionMode=D.IN_TABLE,t._processToken(e))}function Dl(t,e){switch(e.tagID){case l.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_ROW;break}case l.TH:case l.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(V.TR,l.TR),t.insertionMode=D.IN_ROW,kl(t,e);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE,wi(t,e));break}default:wi(t,e)}}function vf(t,e){const n=e.tagID;switch(e.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE);break}case l.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE,Cu(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:Cu(t,e)}}function kl(t,e){switch(e.tagID){case l.TH:case l.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_CELL,t.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,Dl(t,e));break}default:wi(t,e)}}function Pm(t,e){switch(e.tagID){case l.TR:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY);break}case l.TABLE:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,vf(t,e));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(l.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,vf(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:Cu(t,e)}}function x2(t,e){const n=e.tagID;km.has(n)?(t.openElements.hasInTableScope(l.TD)||t.openElements.hasInTableScope(l.TH))&&(t._closeTableCell(),kl(t,e)):yn(t,e)}function R2(t,e){const n=e.tagID;switch(n){case l.TD:case l.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Pm(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:Rl(t,e)}}function Mm(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.OPTION:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t._insertElement(e,oe.HTML);break}case l.OPTGROUP:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop(),t._insertElement(e,oe.HTML);break}case l.HR:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop(),t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{t.openElements.hasInSelectScope(l.SELECT)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),e.tagID!==l.SELECT&&t._processStartTag(e));break}case l.SCRIPT:case l.TEMPLATE:{Dr(t,e);break}}}function Bm(t,e){switch(e.tagID){case l.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===l.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===l.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop();break}case l.OPTION:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop();break}case l.SELECT:{t.openElements.hasInSelectScope(l.SELECT)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode());break}case l.TEMPLATE:{Pa(t,e);break}}}function D2(t,e){const n=e.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Mm(t,e)}function k2(t,e){const n=e.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Bm(t,e)}function P2(t,e){switch(e.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{Dr(t,e);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{t.tmplInsertionModeStack[0]=D.IN_TABLE,t.insertionMode=D.IN_TABLE,wi(t,e);break}case l.COL:{t.tmplInsertionModeStack[0]=D.IN_COLUMN_GROUP,t.insertionMode=D.IN_COLUMN_GROUP,Kd(t,e);break}case l.TR:{t.tmplInsertionModeStack[0]=D.IN_TABLE_BODY,t.insertionMode=D.IN_TABLE_BODY,Dl(t,e);break}case l.TD:case l.TH:{t.tmplInsertionModeStack[0]=D.IN_ROW,t.insertionMode=D.IN_ROW,kl(t,e);break}default:t.tmplInsertionModeStack[0]=D.IN_BODY,t.insertionMode=D.IN_BODY,yn(t,e)}}function M2(t,e){e.tagID===l.TEMPLATE&&Pa(t,e)}function Fm(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(l.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Gd(t,e)}function B2(t,e){e.tagID===l.HTML?yn(t,e):ol(t,e)}function Um(t,e){var n;if(e.tagID===l.HTML){if(t.fragmentContext||(t.insertionMode=D.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===l.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 ol(t,e)}function ol(t,e){t.insertionMode=D.IN_BODY,xl(t,e)}function F2(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.FRAMESET:{t._insertElement(e,oe.HTML);break}case l.FRAME:{t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.NOFRAMES:{Dr(t,e);break}}}function U2(t,e){e.tagID===l.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==l.FRAMESET&&(t.insertionMode=D.AFTER_FRAMESET))}function H2(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.NOFRAMES:{Dr(t,e);break}}}function q2(t,e){e.tagID===l.HTML&&(t.insertionMode=D.AFTER_AFTER_FRAMESET)}function j2(t,e){e.tagID===l.HTML?yn(t,e):zo(t,e)}function zo(t,e){t.insertionMode=D.IN_BODY,xl(t,e)}function $2(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.NOFRAMES:{Dr(t,e);break}}}function Y2(t,e){e.chars=Lt,t._insertCharacters(e)}function z2(t,e){t._insertCharacters(e),t.framesetOk=!1}function Hm(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==oe.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function W2(t,e){if(u_(e))Hm(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===oe.MATHML?Am(e):r===oe.SVG&&(o_(e),ym(e)),zd(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function G2(t,e){if(e.tagID===l.P||e.tagID===l.BR){Hm(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)===oe.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 qm(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 K2=qm(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),V2=qm(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),X2=new Set([V.AREA,V.BASE,V.BASEFONT,V.BGSOUND,V.BR,V.COL,V.EMBED,V.FRAME,V.HR,V.IMG,V.INPUT,V.KEYGEN,V.LINK,V.META,V.PARAM,V.SOURCE,V.TRACK,V.WBR]);function jm(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===oe.HTML&&X2.has(e.treeAdapter.getTagName(t))}const Q2={treeAdapter:os,scriptingEnabled:!0};function Z2(t,e){const n={...Q2,...e};return jm(t,n)?"":$m(t,n)}function $m(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===V.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===oe.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=J2(a,e);return n}function J2(t,e){return e.treeAdapter.isElementNode(t)?eA(t,e):e.treeAdapter.isTextNode(t)?nA(t,e):e.treeAdapter.isCommentNode(t)?rA(t,e):e.treeAdapter.isDocumentTypeNode(t)?sA(t,e):""}function eA(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${tA(t,e)}>${jm(t,e)?"":`${$m(t,e)}</${n}>`}`}function tA(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case oe.XML:{n+=`xml:${r.name}`;break}case oe.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case oe.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${K2(r.value)}"`}return n}function nA(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)===oe.HTML&&PT(a,e.scriptingEnabled)?r:V2(r)}function rA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function sA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function aA(t,e){return Sm.parse(t,e)}function Vd(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Sm.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Gn(t){return"tagName"in t}function Jr(t){return t.nodeName==="#text"}function St(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function qs(t,e){return t.attrs.some(n=>n.name===e)}function d0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function Xd(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function js(t){return Vd(t).childNodes}function iA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function Li(t){return iA(t)?aA(t).childNodes:Vd(t).childNodes}function uA(t){const e=Vd("");return e.childNodes=t,Z2(e)}const oA=[400,800,1200,1600],lA={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function cA(t){return t==="jpeg"?"jpg":t}function fA(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function dA(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)}async function hA(t,e,n){var T;const r=fA(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:oA,formats:s}),i=dA(t),u=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),o=[],f=v=>{const O=`${u}.${i}-${v.width}.${cA(v.format)}`;return o.push({path:O,contents:v.bytes}),`/${O}`},h=new Map;for(const v of[...a.variants].sort((O,L)=>O.width-L.width)){const O=f(v),L=h.get(v.format)??[];L.push({url:O,width:v.width}),h.set(v.format,L)}const g=v=>(h.get(v)??[]).map(O=>`${O.url} ${O.width}w`).join(", "),d=["avif","webp"].filter(v=>h.has(v)).map(v=>({format:v,mime:lA[v],srcset:g(v)})),m=h.get(r)??[],b=((T=m[m.length-1])==null?void 0:T.url)??`/${e}`,_={width:a.sourceWidth,height:a.sourceHeight,sources:d,fallbackSrc:b,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:o,info:_}}function Ym(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${_c(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${_c(i)}"`).join(""),s=`<img src="${_c(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const h0="ref:";function Pl(t){return t.startsWith(h0)?t.slice(h0.length):void 0}function p0(t){const e=new Set,n=r=>{for(const s of r)if(Gn(s)){for(const a of s.attrs){const i=Pl(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(Li(t)),[...e].sort()}const pA=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],mA=["data-type","data-field","data-required","data-help","data-label"];function Ef(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=wu(Li(t.template),t.scope,e),r=t.document===void 0?n:Km(wu(Li(t.document),t.scope,e),n);return gA(r,t,e),uA(r)}function gA(t,e,n){var i,u,o,f;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-CtH_G1zX.js","./TemplatesPane-B4_sg2u5.css"])))=>i.map(i=>d[i]);
2
+ var Xb=Object.defineProperty;var Bh=t=>{throw TypeError(t)};var Qb=(t,e,n)=>e in t?Xb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ee=(t,e,n)=>Qb(t,typeof e!="symbol"?e+"":e,n),fc=(t,e,n)=>e.has(t)||Bh("Cannot "+n);var K=(t,e,n)=>(fc(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?Bh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),He=(t,e,n,r)=>(fc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Ze=(t,e,n)=>(fc(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 ap=!1;var Td=Array.isArray,Zb=Array.prototype.indexOf,ba=Array.prototype.includes,Nl=Array.from,Jb=Object.defineProperty,Us=Object.getOwnPropertyDescriptor,ip=Object.getOwnPropertyDescriptors,ev=Object.prototype,tv=Array.prototype,_d=Object.getPrototypeOf,Fh=Object.isExtensible;function Gi(t){return typeof t=="function"}const Ad=()=>{};function nv(t){return t()}function Kc(t){for(var e=0;e<t.length;e++)t[e]()}function up(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function rv(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 fn=2,vi=4,Wu=8,yd=1<<24,Nr=16,Lr=32,Ys=64,Vc=128,cr=512,Vt=1024,nn=2048,Qr=4096,On=8192,fr=16384,xa=32768,Xc=1<<25,ps=65536,el=1<<17,sv=1<<18,Bi=1<<19,op=1<<20,zr=1<<25,ya=65536,tl=1<<21,ai=1<<22,Hs=1<<23,Wr=Symbol("$state"),lp=Symbol("legacy props"),av=Symbol(""),Fo=Symbol("attributes"),Qc=Symbol("class"),Zc=Symbol("style"),nu=Symbol("text"),Uo=Symbol("form reset"),Sl=new class extends Error{constructor(){super(...arguments);Ee(this,"name","StaleReactionError");Ee(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var np;const Nd=!!((np=globalThis.document)!=null&&np.contentType)&&globalThis.document.contentType.includes("xml");function cp(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function iv(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function uv(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function ov(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function lv(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function cv(t){throw new Error("https://svelte.dev/e/effect_orphan")}function fv(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function dv(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function hv(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function pv(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function mv(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function gv(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const bv=1,vv=2,fp=4,Ev=8,Tv=16,_v=1,Av=2,yv=4,Nv=8,Sv=16,Iv=1,Cv=2,jt=Symbol("uninitialized"),dp="http://www.w3.org/1999/xhtml",wv="http://www.w3.org/2000/svg",Lv="@attach";function Ov(){console.warn("https://svelte.dev/e/derived_inert")}function xv(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Rv(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function hp(t){return t===this.v}function Dv(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function pp(t){return!Dv(t,this.v)}let Fi=!1,kv=!1;function Pv(){Fi=!0}let _t=null;function Ei(t){_t=t}function Mv(t){return Bv().get(t)}function ct(t,e=!1,n){_t={p:_t,i:!1,c:null,e:null,s:t,x:null,r:Ke,l:Fi&&!e?{s:null,u:null,$:[]}:null}}function ft(t){var e=_t,n=e.e;if(n!==null){e.e=null;for(var r of n)Bp(r)}return e.i=!0,_t=e.p,{}}function Ui(){return!Fi||_t!==null&&_t.l===null}function Bv(t){return _t===null&&cp(),_t.c??(_t.c=new Map(Fv(_t)||void 0))}function Fv(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let ua=[];function mp(){var t=ua;ua=[],Kc(t)}function Cr(t){if(ua.length===0&&!cu){var e=ua;queueMicrotask(()=>{e===ua&&mp()})}ua.push(t)}function Uv(){for(;ua.length>0;)mp()}function gp(t){var e=Ke;if(e===null)return Xe.f|=Hs,t;if((e.f&xa)===0&&(e.f&vi)===0)throw t;Ds(t,e)}function Ds(t,e){for(;e!==null;){if((e.f&Vc)!==0){if((e.f&xa)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const Hv=-7169;function Dt(t,e){t.f=t.f&Hv|e}function Sd(t){(t.f&cr)!==0||t.deps===null?Dt(t,Vt):Dt(t,Qr)}function bp(t){if(t!==null)for(const e of t)(e.f&fn)===0||(e.f&ya)===0||(e.f^=ya,bp(e.deps))}function vp(t,e,n){(t.f&nn)!==0?e.add(t):(t.f&Qr)!==0&&n.add(t),bp(t.deps),Dt(t,Vt)}let Eo=!1;function qv(t){var e=Eo;try{return Eo=!1,[t(),Eo]}finally{Eo=e}}let dc=null,Wa=null,Pe=null,lu=null,un=null,Jc=null,cu=!1,hc=!1,ni=null,Ho=null;var Uh=0;let jv=1;var fi,Ls,fa,di,hi,da,pi,ls,Uu,Yn,Hu,Os,qr,jr,mi,ha,lt,ef,ru,tf,Ep,Tp,qo,$v,nf,Ka;const El=class El{constructor(){Ue(this,lt);Ee(this,"id",jv++);Ue(this,fi,!1);Ee(this,"linked",!0);Ue(this,Ls,null);Ue(this,fa,null);Ee(this,"async_deriveds",new Map);Ee(this,"current",new Map);Ee(this,"previous",new Map);Ee(this,"unblocked",new Set);Ue(this,di,new Set);Ue(this,hi,new Set);Ue(this,da,new Set);Ue(this,pi,0);Ue(this,ls,new Map);Ue(this,Uu,null);Ue(this,Yn,[]);Ue(this,Hu,[]);Ue(this,Os,new Set);Ue(this,qr,new Set);Ue(this,jr,new Map);Ue(this,mi,new Set);Ee(this,"is_fork",!1);Ue(this,ha,!1)}skip_effect(e){K(this,jr).has(e)||K(this,jr).set(e,{d:[],m:[]}),K(this,mi).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=K(this,jr).get(e);if(r){K(this,jr).delete(e);for(var s of r.d)Dt(s,nn),n(s);for(s of r.m)Dt(s,Qr),n(s)}K(this,mi).add(e)}capture(e,n,r=!1){e.v!==jt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Hs)===0&&(this.current.set(e,[n,r]),un==null||un.set(e,n)),this.is_fork||(e.v=n)}activate(){Pe=this}deactivate(){Pe=null,un=null}flush(){try{hc=!0,Pe=this,Ze(this,lt,ru).call(this)}finally{Uh=0,Jc=null,ni=null,Ho=null,hc=!1,Pe=null,un=null,va.clear()}}discard(){for(const e of K(this,hi))e(this);K(this,hi).clear(),K(this,da).clear(),Ze(this,lt,Ka).call(this)}register_created_effect(e){K(this,Hu).push(e)}increment(e,n){if(He(this,pi,K(this,pi)+1),e){let r=K(this,ls).get(n)??0;K(this,ls).set(n,r+1)}}decrement(e,n){if(He(this,pi,K(this,pi)-1),e){let r=K(this,ls).get(n)??0;r===1?K(this,ls).delete(n):K(this,ls).set(n,r-1)}K(this,ha)||(He(this,ha,!0),Cr(()=>{He(this,ha,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)K(this,Os).add(r);for(const r of n)K(this,qr).add(r);e.clear(),n.clear()}oncommit(e){K(this,di).add(e)}ondiscard(e){K(this,hi).add(e)}on_fork_commit(e){K(this,da).add(e)}run_fork_commit_callbacks(){for(const e of K(this,da))e(this);K(this,da).clear()}settled(){return(K(this,Uu)??He(this,Uu,up())).promise}static ensure(){var e;if(Pe===null){const n=Pe=new El;Ze(e=n,lt,nf).call(e),!hc&&!cu&&Cr(()=>{K(n,fi)||n.flush()})}return Pe}apply(){{un=null;return}}schedule(e){var s;if(Jc=e,(s=e.b)!=null&&s.is_pending&&(e.f&(vi|Wu|yd))!==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(ni!==null&&n===Ke&&(Xe===null||(Xe.f&fn)===0))return;if((r&(Ys|Lr))!==0){if((r&Vt)===0)return;n.f^=Vt}}K(this,Yn).push(n)}};fi=new WeakMap,Ls=new WeakMap,fa=new WeakMap,di=new WeakMap,hi=new WeakMap,da=new WeakMap,pi=new WeakMap,ls=new WeakMap,Uu=new WeakMap,Yn=new WeakMap,Hu=new WeakMap,Os=new WeakMap,qr=new WeakMap,jr=new WeakMap,mi=new WeakMap,ha=new WeakMap,lt=new WeakSet,ef=function(){if(this.is_fork)return!0;for(const r of K(this,ls).keys()){for(var e=r,n=!1;e.parent!==null;){if(K(this,jr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},ru=function(){var o,f,h,g;if(He(this,fi,!0),Uh++>1e3&&(Ze(this,lt,Ka).call(this),zv()),!Ze(this,lt,ef).call(this)){for(const d of K(this,Os))K(this,qr).delete(d),Dt(d,nn),this.schedule(d);for(const d of K(this,qr))Dt(d,Qr),this.schedule(d)}const e=K(this,Yn);He(this,Yn,[]),this.apply();var n=ni=[],r=[],s=Ho=[];for(const d of e)try{Ze(this,lt,tf).call(this,d,n,r)}catch(m){throw yp(d),m}if(Pe=null,s.length>0){var a=El.ensure();for(const d of s)a.schedule(d)}if(ni=null,Ho=null,Ze(this,lt,ef).call(this)){Ze(this,lt,qo).call(this,r),Ze(this,lt,qo).call(this,n);for(const[d,m]of K(this,jr))Ap(d,m);s.length>0&&Ze(o=Pe,lt,ru).call(o);return}const i=Ze(this,lt,Ep).call(this);if(i){Ze(f=i,lt,Tp).call(f,this);return}K(this,Os).clear(),K(this,qr).clear();for(const d of K(this,di))d(this);K(this,di).clear(),lu=this,Hh(r),Hh(n),lu=null,(h=K(this,Uu))==null||h.resolve();var u=Pe;if(this.linked&&K(this,pi)===0&&Ze(this,lt,Ka).call(this),K(this,Yn).length>0){u===null&&(u=this,Ze(this,lt,nf).call(this));const d=u;K(d,Yn).push(...K(this,Yn).filter(m=>!K(d,Yn).includes(m)))}u!==null&&Ze(g=u,lt,ru).call(g)},tf=function(e,n,r){e.f^=Vt;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Lr|Ys))!==0,u=i&&(a&Vt)!==0,o=u||(a&On)!==0||K(this,jr).has(s);if(!o&&s.fn!==null){i?s.f^=Vt:(a&vi)!==0?n.push(s):Xu(s)&&((a&Nr)!==0&&K(this,qr).add(s),Ni(s));var f=s.first;if(f!==null){s=f;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},Ep=function(){for(var e=K(this,Ls);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=K(e,Ls)}return null},Tp=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 o of a){var i=o.f;if((i&fn)!==0)n(o);else{var u=o;i&(ai|Nr)&&!this.async_deriveds.has(u)&&(K(this,qr).delete(u),Dt(u,nn),this.schedule(u))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),Ze(r=e,lt,Ka).call(r),Pe=this,Ze(this,lt,ru).call(this)},qo=function(e){for(var n=0;n<e.length;n+=1)vp(e[n],K(this,Os),K(this,qr))},$v=function(){var h;Ze(this,lt,Ka).call(this);for(let g=dc;g!==null;g=K(g,fa)){var e=g.id<this.id,n=[];for(const[d,[m,b]]of this.current){if(g.current.has(d)){var r=g.current.get(d)[0];if(e&&m!==r)g.current.set(d,[m,b]);else continue}n.push(d)}if(e)for(const[d,m]of this.async_deriveds){const b=g.async_deriveds.get(d);b&&m.promise.then(b.resolve)}if(K(g,fi)){var s=[...g.current.keys()].filter(d=>!this.current.has(d));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const d of K(this,mi))g.unskip_effect(d,m=>{var b;(m.f&(Nr|ai))!==0?g.schedule(m):Ze(b=g,lt,qo).call(b,[m])});g.activate();var a=new Set,i=new Map;for(var u of n)_p(u,s,a,i);i=new Map;var o=[...g.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(o.length>0)for(const d of K(this,Hu))(d.f&(fr|On|el))===0&&Id(d,o,i)&&((d.f&(ai|Nr))!==0?(Dt(d,nn),g.schedule(d)):K(g,Os).add(d));if(K(g,Yn).length>0&&!K(g,ha)){g.apply();for(var f of K(g,Yn))Ze(h=g,lt,tf).call(h,f,[],[]);He(g,Yn,[])}g.deactivate()}}}},nf=function(){Wa===null?dc=Wa=this:(He(Wa,fa,this),He(this,Ls,Wa)),Wa=this},Ka=function(){var e=K(this,Ls),n=K(this,fa);e===null?dc=n:He(e,fa,n),n===null?Wa=e:He(n,Ls,e),this.linked=!1};let Na=El;function Yv(t){var e=cu;cu=!0;try{for(var n;;){if(Uv(),Pe===null)return n;Pe.flush()}}finally{cu=e}}function zv(){try{fv()}catch(t){Ds(t,Jc)}}let vr=null;function Hh(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(fr|On))===0&&Xu(r)&&(vr=new Set,Ni(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Hp(r),(vr==null?void 0:vr.size)>0)){va.clear();for(const s of vr){if((s.f&(fr|On))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)vr.has(i)&&(vr.delete(i),a.push(i)),i=i.parent;for(let u=a.length-1;u>=0;u--){const o=a[u];(o.f&(fr|On))===0&&Ni(o)}}vr.clear()}}vr=null}}function _p(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&fn)!==0?_p(s,e,n,r):(a&(ai|Nr))!==0&&(a&nn)===0&&Id(s,e,r)&&(Dt(s,nn),Cd(s))}}function Id(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(ba.call(e,s))return!0;if((s.f&fn)!==0&&Id(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function Cd(t){Pe.schedule(t)}function Ap(t,e){if(!((t.f&Lr)!==0&&(t.f&Vt)!==0)){(t.f&nn)!==0?e.d.push(t):(t.f&Qr)!==0&&e.m.push(t),Dt(t,Vt);for(var n=t.first;n!==null;)Ap(n,e),n=n.next}}function yp(t){Dt(t,Vt);for(var e=t.first;e!==null;)yp(e),e=e.next}function Wv(t){let e=0,n=Sa(0),r;return()=>{xd()&&(c(n),Cl(()=>(e===0&&(r=Da(()=>t(()=>fu(n)))),e+=1,()=>{Cr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,fu(n))})})))}}var Gv=ps|Bi;function Kv(t,e,n,r){new Vv(t,e,n,r)}var tr,Ed,nr,pa,Mn,rr,Cn,zn,cs,ma,xs,gi,qu,ju,fs,Tl,Pt,Xv,Qv,Zv,rf,jo,$o,sf,af;class Vv{constructor(e,n,r,s){Ue(this,Pt);Ee(this,"parent");Ee(this,"is_pending",!1);Ee(this,"transform_error");Ue(this,tr);Ue(this,Ed,null);Ue(this,nr);Ue(this,pa);Ue(this,Mn);Ue(this,rr,null);Ue(this,Cn,null);Ue(this,zn,null);Ue(this,cs,null);Ue(this,ma,0);Ue(this,xs,0);Ue(this,gi,!1);Ue(this,qu,new Set);Ue(this,ju,new Set);Ue(this,fs,null);Ue(this,Tl,Wv(()=>(He(this,fs,Sa(K(this,ma))),()=>{He(this,fs,null)})));var a;He(this,tr,e),He(this,nr,n),He(this,pa,i=>{var u=Ke;u.b=this,u.f|=Vc,r(i)}),this.parent=Ke.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),He(this,Mn,Ra(()=>{Ze(this,Pt,rf).call(this)},Gv))}defer_effect(e){vp(e,K(this,qu),K(this,ju))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!K(this,nr).pending}update_pending_count(e,n){Ze(this,Pt,sf).call(this,e,n),He(this,ma,K(this,ma)+e),!(!K(this,fs)||K(this,gi))&&(He(this,gi,!0),Cr(()=>{He(this,gi,!1),K(this,fs)&&_i(K(this,fs),K(this,ma))}))}get_effect_pending(){return K(this,Tl).call(this),c(K(this,fs))}error(e){if(!K(this,nr).onerror&&!K(this,nr).failed)throw e;Pe!=null&&Pe.is_fork?(K(this,rr)&&Pe.skip_effect(K(this,rr)),K(this,Cn)&&Pe.skip_effect(K(this,Cn)),K(this,zn)&&Pe.skip_effect(K(this,zn)),Pe.on_fork_commit(()=>{Ze(this,Pt,af).call(this,e)})):Ze(this,Pt,af).call(this,e)}}tr=new WeakMap,Ed=new WeakMap,nr=new WeakMap,pa=new WeakMap,Mn=new WeakMap,rr=new WeakMap,Cn=new WeakMap,zn=new WeakMap,cs=new WeakMap,ma=new WeakMap,xs=new WeakMap,gi=new WeakMap,qu=new WeakMap,ju=new WeakMap,fs=new WeakMap,Tl=new WeakMap,Pt=new WeakSet,Xv=function(){try{He(this,rr,Fn(()=>K(this,pa).call(this,K(this,tr))))}catch(e){this.error(e)}},Qv=function(e){const n=K(this,nr).failed;n&&He(this,zn,Fn(()=>{n(K(this,tr),()=>e,()=>()=>{})}))},Zv=function(){const e=K(this,nr).pending;e&&(this.is_pending=!0,He(this,Cn,Fn(()=>e(K(this,tr)))),Cr(()=>{var n=He(this,cs,document.createDocumentFragment()),r=Gr();n.append(r),He(this,rr,Ze(this,Pt,$o).call(this,()=>Fn(()=>K(this,pa).call(this,r)))),K(this,xs)===0&&(K(this,tr).before(n),He(this,cs,null),Ea(K(this,Cn),()=>{He(this,Cn,null)}),Ze(this,Pt,jo).call(this,Pe))}))},rf=function(){try{if(this.is_pending=this.has_pending_snippet(),He(this,xs,0),He(this,ma,0),He(this,rr,Fn(()=>{K(this,pa).call(this,K(this,tr))})),K(this,xs)>0){var e=He(this,cs,document.createDocumentFragment());kd(K(this,rr),e);const n=K(this,nr).pending;He(this,Cn,Fn(()=>n(K(this,tr))))}else Ze(this,Pt,jo).call(this,Pe)}catch(n){this.error(n)}},jo=function(e){this.is_pending=!1,e.transfer_effects(K(this,qu),K(this,ju))},$o=function(e){var n=Ke,r=Xe,s=_t;Zr(K(this,Mn)),hr(K(this,Mn)),Ei(K(this,Mn).ctx);try{return Na.ensure(),e()}catch(a){return gp(a),null}finally{Zr(n),hr(r),Ei(s)}},sf=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&Ze(r=this.parent,Pt,sf).call(r,e,n);return}He(this,xs,K(this,xs)+e),K(this,xs)===0&&(Ze(this,Pt,jo).call(this,n),K(this,Cn)&&Ea(K(this,Cn),()=>{He(this,Cn,null)}),K(this,cs)&&(K(this,tr).before(K(this,cs)),He(this,cs,null)))},af=function(e){K(this,rr)&&(on(K(this,rr)),He(this,rr,null)),K(this,Cn)&&(on(K(this,Cn)),He(this,Cn,null)),K(this,zn)&&(on(K(this,zn)),He(this,zn,null));var n=K(this,nr).onerror;let r=K(this,nr).failed;var s=!1,a=!1;const i=()=>{if(s){Rv();return}s=!0,a&&gv(),K(this,zn)!==null&&Ea(K(this,zn),()=>{He(this,zn,null)}),Ze(this,Pt,$o).call(this,()=>{Ze(this,Pt,rf).call(this)})},u=o=>{try{a=!0,n==null||n(o,i),a=!1}catch(f){Ds(f,K(this,Mn)&&K(this,Mn).parent)}r&&He(this,zn,Ze(this,Pt,$o).call(this,()=>{try{return Fn(()=>{var f=Ke;f.b=this,f.f|=Vc,r(K(this,tr),()=>o,()=>i)})}catch(f){return Ds(f,K(this,Mn).parent),null}}))};Cr(()=>{var o;try{o=this.transform_error(e)}catch(f){Ds(f,K(this,Mn)&&K(this,Mn).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(u,f=>Ds(f,K(this,Mn)&&K(this,Mn).parent)):u(o)})};function Np(t,e,n,r){const s=Ui()?Ti:wd;var a=t.filter(d=>!d.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Ke,u=Jv(),o=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(d=>d.promise)):null;function f(d){if((i.f&fr)===0){u();try{r(d)}catch(m){Ds(m,i)}nl()}}var h=Sp();if(n.length===0){o.then(()=>f(e.map(s))).finally(h);return}function g(){Promise.all(n.map(d=>eE(d))).then(d=>f([...e.map(s),...d])).catch(d=>Ds(d,i)).finally(h)}o?o.then(()=>{u(),g(),nl()}):g()}function Jv(){var t=Ke,e=Xe,n=_t,r=Pe;return function(a=!0){Zr(t),hr(e),Ei(n),a&&(t.f&fr)===0&&(r==null||r.activate(),r==null||r.apply())}}function nl(t=!0){Zr(null),hr(null),Ei(null),t&&(Pe==null||Pe.deactivate())}function Sp(){var t=Ke,e=t.b,n=Pe,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 Ti(t){var e=fn|nn;return Ke!==null&&(Ke.f|=Bi),{ctx:_t,deps:null,effects:null,equals:hp,f:e,fn:t,reactions:null,rv:0,v:jt,wv:0,parent:Ke,ac:null}}const To=Symbol("obsolete");function eE(t,e,n){let r=Ke;r===null&&iv();var s=void 0,a=Sa(jt),i=!Xe,u=new Set;return fE(()=>{var m;var o=Ke,f=up();s=f.promise;try{Promise.resolve(t()).then(f.resolve,b=>{b!==Sl&&f.reject(b)}).finally(nl)}catch(b){f.reject(b),nl()}var h=Pe;if(i){if((o.f&xa)!==0)var g=Sp();if(r.b.is_rendered())(m=h.async_deriveds.get(o))==null||m.reject(To);else for(const b of u.values())b.reject(To);u.add(f),h.async_deriveds.set(o,f)}const d=(b,_=void 0)=>{g==null||g(),u.delete(f),_!==To&&(h.activate(),_?(a.f|=Hs,_i(a,_)):((a.f&Hs)!==0&&(a.f^=Hs),_i(a,b)),h.deactivate())};f.promise.then(d,b=>d(null,b||"unknown"))}),Ku(()=>{for(const o of u)o.reject(To)}),new Promise(o=>{function f(h){function g(){h===s?o(a):f(s)}h.then(g,g)}f(s)})}function Ae(t){const e=Ti(t);return $p(e),e}function wd(t){const e=Ti(t);return e.equals=pp,e}function tE(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)on(e[n])}}function Ld(t){var e,n=Ke,r=t.parent;if(!ms&&r!==null&&t.v!==jt&&(r.f&(fr|On))!==0)return Ov(),t.v;Zr(r);try{t.f&=~ya,tE(t),e=Gp(t)}finally{Zr(n)}return e}function Ip(t){var e=Ld(t);if(!t.equals(e)&&(t.wv=zp(),(!(Pe!=null&&Pe.is_fork)||t.deps===null)&&(Pe!==null?(Pe.capture(t,e,!0),lu==null||lu.capture(t,e,!0)):t.v=e,t.deps===null))){Dt(t,Vt);return}ms||(un!==null?(xd()||Pe!=null&&Pe.is_fork)&&un.set(t,e):Sd(t))}function nE(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(Sl),r.fn!==null&&(r.teardown=Ad),r.ac=null,Su(r,0),Rd(r))}function Cp(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Ni(e)}let rl=new Set;const va=new Map;let wp=!1;function Sa(t,e){var n={f:0,v:t,reactions:null,equals:hp,rv:0,wv:0};return n}function ee(t,e){const n=Sa(t);return $p(n),n}function rE(t,e=!1,n=!0){var s;const r=Sa(t);return e||(r.equals=pp),Fi&&n&&_t!==null&&_t.l!==null&&((s=_t.l).s??(s.s=[])).push(r),r}function y(t,e,n=!1){Xe!==null&&(!Sr||(Xe.f&el)!==0)&&Ui()&&(Xe.f&(fn|Nr|ai|el))!==0&&(dr===null||!ba.call(dr,t))&&mv();let r=n?Tt(e):e;return _i(t,r,Ho)}function _i(t,e,n=null){if(!t.equals(e)){va.set(t,ms?e:t.v);var r=Na.ensure();if(r.capture(t,e),(t.f&fn)!==0){const s=t;(t.f&nn)!==0&&Ld(s),un===null&&Sd(s)}t.wv=zp(),Lp(t,nn,n),Ui()&&Ke!==null&&(Ke.f&Vt)!==0&&(Ke.f&(Lr|Ys))===0&&(er===null?pE([t]):er.push(t)),!r.is_fork&&rl.size>0&&!wp&&sE()}return e}function sE(){wp=!1;for(const t of rl){(t.f&Vt)!==0&&Dt(t,Qr);let e;try{e=Xu(t)}catch{e=!0}e&&Ni(t)}rl.clear()}function fu(t){y(t,t.v+1)}function Lp(t,e,n){var r=t.reactions;if(r!==null)for(var s=Ui(),a=r.length,i=0;i<a;i++){var u=r[i],o=u.f;if(!(!s&&u===Ke)){var f=(o&nn)===0;if(f&&Dt(u,e),(o&el)!==0)rl.add(u);else if((o&fn)!==0){var h=u;un==null||un.delete(h),(o&ya)===0&&(o&cr&&(Ke===null||(Ke.f&tl)===0)&&(u.f|=ya),Lp(h,Qr,n))}else if(f){var g=u;(o&Nr)!==0&&vr!==null&&vr.add(g),n!==null?n.push(g):Cd(g)}}}}function Tt(t){if(typeof t!="object"||t===null||Wr in t)return t;const e=_d(t);if(e!==ev&&e!==tv)return t;var n=new Map,r=Td(t),s=ee(0),a=Ta,i=u=>{if(Ta===a)return u();var o=Xe,f=Ta;hr(null),zh(a);var h=u();return hr(o),zh(f),h};return r&&n.set("length",ee(t.length)),new Proxy(t,{defineProperty(u,o,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&hv();var h=n.get(o);return h===void 0?i(()=>{var g=ee(f.value);return n.set(o,g),g}):y(h,f.value,!0),!0},deleteProperty(u,o){var f=n.get(o);if(f===void 0){if(o in u){const h=i(()=>ee(jt));n.set(o,h),fu(s)}}else y(f,jt),fu(s);return!0},get(u,o,f){var m;if(o===Wr)return t;var h=n.get(o),g=o in u;if(h===void 0&&(!g||(m=Us(u,o))!=null&&m.writable)&&(h=i(()=>{var b=Tt(g?u[o]:jt),_=ee(b);return _}),n.set(o,h)),h!==void 0){var d=c(h);return d===jt?void 0:d}return Reflect.get(u,o,f)},getOwnPropertyDescriptor(u,o){var f=Reflect.getOwnPropertyDescriptor(u,o);if(f&&"value"in f){var h=n.get(o);h&&(f.value=c(h))}else if(f===void 0){var g=n.get(o),d=g==null?void 0:g.v;if(g!==void 0&&d!==jt)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return f},has(u,o){var d;if(o===Wr)return!0;var f=n.get(o),h=f!==void 0&&f.v!==jt||Reflect.has(u,o);if(f!==void 0||Ke!==null&&(!h||(d=Us(u,o))!=null&&d.writable)){f===void 0&&(f=i(()=>{var m=h?Tt(u[o]):jt,b=ee(m);return b}),n.set(o,f));var g=c(f);if(g===jt)return!1}return h},set(u,o,f,h){var L;var g=n.get(o),d=o in u;if(r&&o==="length")for(var m=f;m<g.v;m+=1){var b=n.get(m+"");b!==void 0?y(b,jt):m in u&&(b=i(()=>ee(jt)),n.set(m+"",b))}if(g===void 0)(!d||(L=Us(u,o))!=null&&L.writable)&&(g=i(()=>ee(void 0)),y(g,Tt(f)),n.set(o,g));else{d=g.v!==jt;var _=i(()=>Tt(f));y(g,_)}var T=Reflect.getOwnPropertyDescriptor(u,o);if(T!=null&&T.set&&T.set.call(h,f),!d){if(r&&typeof o=="string"){var v=n.get("length"),O=Number(o);Number.isInteger(O)&&O>=v.v&&y(v,O+1)}fu(s)}return!0},ownKeys(u){c(s);var o=Reflect.ownKeys(u).filter(g=>{var d=n.get(g);return d===void 0||d.v!==jt});for(var[f,h]of n)h.v!==jt&&!(f in u)&&o.push(f);return o},setPrototypeOf(){pv()}})}function qh(t){try{if(t!==null&&typeof t=="object"&&Wr in t)return t[Wr]}catch{}return t}function Op(t,e){return Object.is(qh(t),qh(e))}var jh,xp,Rp,Dp;function aE(){if(jh===void 0){jh=window,xp=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Rp=Us(e,"firstChild").get,Dp=Us(e,"nextSibling").get,Fh(t)&&(t[Qc]=void 0,t[Fo]=null,t[Zc]=void 0,t.__e=void 0),Fh(n)&&(n[nu]=void 0)}}function Gr(t=""){return document.createTextNode(t)}function Ai(t){return Rp.call(t)}function Gu(t){return Dp.call(t)}function I(t,e){return Ai(t)}function pt(t,e=!1){{var n=Ai(t);return n instanceof Comment&&n.data===""?Gu(n):n}}function R(t,e=1,n=!1){let r=t;for(;e--;)r=Gu(r);return r}function iE(t){t.textContent=""}function kp(){return!1}function Pp(t,e,n){return document.createElementNS(e??dp,t,void 0)}function yi(t,e){if(e){const n=document.body;t.autofocus=!0,Cr(()=>{document.activeElement===n&&t.focus()})}}let $h=!1;function uE(){$h||($h=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[Uo])==null||e.call(n)})},{capture:!0}))}function Il(t){var e=Xe,n=Ke;hr(null),Zr(null);try{return t()}finally{hr(e),Zr(n)}}function Od(t,e,n,r=n){t.addEventListener(e,()=>Il(n));const s=t[Uo];s?t[Uo]=()=>{s(),r(!0)}:t[Uo]=()=>r(!0),uE()}function Mp(t){Ke===null&&(Xe===null&&cv(),lv()),ms&&ov()}function oE(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function xr(t,e){var n=Ke;n!==null&&(n.f&On)!==0&&(t|=On);var r={ctx:_t,deps:null,nodes:null,f:t|nn|cr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Pe==null||Pe.register_created_effect(r);var s=r;if((t&vi)!==0)ni!==null?ni.push(r):Na.ensure().schedule(r);else if(e!==null){try{Ni(r)}catch(i){throw on(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Bi)===0&&(s=s.first,(t&Nr)!==0&&(t&ps)!==0&&s!==null&&(s.f|=ps))}if(s!==null&&(s.parent=n,n!==null&&oE(s,n),Xe!==null&&(Xe.f&fn)!==0&&(t&Ys)===0)){var a=Xe;(a.effects??(a.effects=[])).push(s)}return r}function xd(){return Xe!==null&&!Sr}function Ku(t){const e=xr(Wu,null);return Dt(e,Vt),e.teardown=t,e}function kt(t){Mp();var e=Ke.f,n=!Xe&&(e&Lr)!==0&&(e&xa)===0;if(n){var r=_t;(r.e??(r.e=[])).push(t)}else return Bp(t)}function Bp(t){return xr(vi|op,t)}function lE(t){return Mp(),xr(Wu|op,t)}function cE(t){Na.ensure();const e=xr(Ys|Bi,t);return(n={})=>new Promise(r=>{n.outro?Ea(e,()=>{on(e),r(void 0)}):(on(e),r(void 0))})}function Vu(t){return xr(vi,t)}function fE(t){return xr(ai|Bi,t)}function Cl(t,e=0){return xr(Wu|e,t)}function ue(t,e=[],n=[],r=[]){Np(r,e,n,s=>{xr(Wu,()=>t(...s.map(c)))})}function Ra(t,e=0){var n=xr(Nr|e,t);return n}function Fp(t,e=0){var n=xr(yd|e,t);return n}function Fn(t){return xr(Lr|Bi,t)}function Up(t){var e=t.teardown;if(e!==null){const n=ms,r=Xe;Yh(!0),hr(null);try{e.call(null)}finally{Yh(n),hr(r)}}}function Rd(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Il(()=>{s.abort(Sl)});var r=n.next;(n.f&Ys)!==0?n.parent=null:on(n,e),n=r}}function dE(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Lr)===0&&on(e),e=n}}function on(t,e=!0){var n=!1;(e||(t.f&sv)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(hE(t.nodes.start,t.nodes.end),n=!0),Dt(t,Xc),Rd(t,e&&!n),Su(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();Up(t),t.f^=Xc,t.f|=fr;var s=t.parent;s!==null&&s.first!==null&&Hp(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function hE(t,e){for(;t!==null;){var n=t===e?null:Gu(t);t.remove(),t=n}}function Hp(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 Ea(t,e,n=!0){var r=[];qp(t,r,!0);var s=()=>{n&&on(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var u of r)u.out(i)}else s()}function qp(t,e,n){if((t.f&On)===0){t.f^=On;var r=t.nodes&&t.nodes.t;if(r!==null)for(const u of r)(u.is_global||n)&&e.push(u);for(var s=t.first;s!==null;){var a=s.next;if((s.f&Ys)===0){var i=(s.f&ps)!==0||(s.f&Lr)!==0&&(t.f&Nr)!==0;qp(s,e,i?n:!1)}s=a}}}function Dd(t){jp(t,!0)}function jp(t,e){if((t.f&On)!==0){t.f^=On,(t.f&Vt)===0&&(Dt(t,nn),Na.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&ps)!==0||(n.f&Lr)!==0;jp(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 kd(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:Gu(n);e.append(n),n=s}}let Yo=!1,ms=!1;function Yh(t){ms=t}let Xe=null,Sr=!1;function hr(t){Xe=t}let Ke=null;function Zr(t){Ke=t}let dr=null;function $p(t){Xe!==null&&(dr===null?dr=[t]:dr.push(t))}let Bn=null,$n=0,er=null;function pE(t){er=t}let Yp=1,oa=0,Ta=oa;function zh(t){Ta=t}function zp(){return++Yp}function Xu(t){var e=t.f;if((e&nn)!==0)return!0;if(e&fn&&(t.f&=~ya),(e&Qr)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(Xu(a)&&Ip(a),a.wv>t.wv)return!0}(e&cr)!==0&&un===null&&Dt(t,Vt)}return!1}function Wp(t,e,n=!0){var r=t.reactions;if(r!==null&&!(dr!==null&&ba.call(dr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&fn)!==0?Wp(a,e,!1):e===a&&(n?Dt(a,nn):(a.f&Vt)!==0&&Dt(a,Qr),Cd(a))}}function Gp(t){var _;var e=Bn,n=$n,r=er,s=Xe,a=dr,i=_t,u=Sr,o=Ta,f=t.f;Bn=null,$n=0,er=null,Xe=(f&(Lr|Ys))===0?t:null,dr=null,Ei(t.ctx),Sr=!1,Ta=++oa,t.ac!==null&&(Il(()=>{t.ac.abort(Sl)}),t.ac=null);try{t.f|=tl;var h=t.fn,g=h();t.f|=xa;var d=t.deps,m=Pe==null?void 0:Pe.is_fork;if(Bn!==null){var b;if(m||Su(t,$n),d!==null&&$n>0)for(d.length=$n+Bn.length,b=0;b<Bn.length;b++)d[$n+b]=Bn[b];else t.deps=d=Bn;if(xd()&&(t.f&cr)!==0)for(b=$n;b<d.length;b++)((_=d[b]).reactions??(_.reactions=[])).push(t)}else!m&&d!==null&&$n<d.length&&(Su(t,$n),d.length=$n);if(Ui()&&er!==null&&!Sr&&d!==null&&(t.f&(fn|Qr|nn))===0)for(b=0;b<er.length;b++)Wp(er[b],t);if(s!==null&&s!==t){if(oa++,s.deps!==null)for(let T=0;T<n;T+=1)s.deps[T].rv=oa;if(e!==null)for(const T of e)T.rv=oa;er!==null&&(r===null?r=er:r.push(...er))}return(t.f&Hs)!==0&&(t.f^=Hs),g}catch(T){return gp(T)}finally{t.f^=tl,Bn=e,$n=n,er=r,Xe=s,dr=a,Ei(i),Sr=u,Ta=o}}function mE(t,e){let n=e.reactions;if(n!==null){var r=Zb.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&fn)!==0&&(Bn===null||!ba.call(Bn,e))){var a=e;(a.f&cr)!==0&&(a.f^=cr,a.f&=~ya),a.v!==jt&&Sd(a),nE(a),Su(a,0)}}function Su(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)mE(t,n[r])}function Ni(t){var e=t.f;if((e&fr)===0){Dt(t,Vt);var n=Ke,r=Yo;Ke=t,Yo=!0;try{(e&(Nr|yd))!==0?dE(t):Rd(t),Up(t);var s=Gp(t);t.teardown=typeof s=="function"?s:null,t.wv=Yp;var a;ap&&kv&&(t.f&nn)!==0&&t.deps}finally{Yo=r,Ke=n}}}async function Kp(){await Promise.resolve(),Yv()}function c(t){var e=t.f,n=(e&fn)!==0;if(Xe!==null&&!Sr){var r=Ke!==null&&(Ke.f&fr)!==0;if(!r&&(dr===null||!ba.call(dr,t))){var s=Xe.deps;if((Xe.f&tl)!==0)t.rv<oa&&(t.rv=oa,Bn===null&&s!==null&&s[$n]===t?$n++:Bn===null?Bn=[t]:Bn.push(t));else{Xe.deps??(Xe.deps=[]),ba.call(Xe.deps,t)||Xe.deps.push(t);var a=t.reactions;a===null?t.reactions=[Xe]:ba.call(a,Xe)||a.push(Xe)}}}if(ms&&va.has(t))return va.get(t);if(n){var i=t;if(ms){var u=i.v;return((i.f&Vt)===0&&i.reactions!==null||Xp(i))&&(u=Ld(i)),va.set(i,u),u}var o=(i.f&cr)===0&&!Sr&&Xe!==null&&(Yo||(Xe.f&cr)!==0),f=(i.f&xa)===0;Xu(i)&&(o&&(i.f|=cr),Ip(i)),o&&!f&&(Cp(i),Vp(i))}if(un!=null&&un.has(t))return un.get(t);if((t.f&Hs)!==0)throw t.v;return t.v}function Vp(t){if(t.f|=cr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&fn)!==0&&(e.f&cr)===0&&(Cp(e),Vp(e))}function Xp(t){if(t.v===jt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(va.has(e)||(e.f&fn)!==0&&Xp(e))return!0;return!1}function Da(t){var e=Sr;try{return Sr=!0,t()}finally{Sr=e}}function gE(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Wr in t)uf(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Wr in n&&uf(n)}}}function uf(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{uf(t[r],e)}catch{}const n=_d(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=ip(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function bE(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const vE=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function EE(t){return vE.includes(t)}const TE={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 _E(t){return t=t.toLowerCase(),TE[t]??t}const AE=["touchstart","touchmove"];function yE(t){return AE.includes(t)}const la=Symbol("events"),Qp=new Set,of=new Set;function Zp(t,e,n,r={}){function s(a){if(r.capture||lf.call(e,a),!a.cancelBubble)return Il(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Cr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function Be(t,e,n,r,s){var a={capture:r,passive:s},i=Zp(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ku(()=>{e.removeEventListener(t,i,a)})}function ae(t,e,n){(e[la]??(e[la]={}))[t]=n}function At(t){for(var e=0;e<t.length;e++)Qp.add(t[e]);for(var n of of)n(t)}let Wh=null;function lf(t){var T,v;var e=this,n=e.ownerDocument,r=t.type,s=((T=t.composedPath)==null?void 0:T.call(t))||[],a=s[0]||t.target;Wh=t;var i=0,u=Wh===t&&t[la];if(u){var o=s.indexOf(u);if(o!==-1&&(e===document||e===window)){t[la]=e;return}var f=s.indexOf(e);if(f===-1)return;o<=f&&(i=o)}if(a=s[i]||t.target,a!==e){Jb(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=Xe,g=Ke;hr(null),Zr(null);try{for(var d,m=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var _=(v=a[la])==null?void 0:v[r];_!=null&&(!a.disabled||t.target===a)&&_.call(a,t)}catch(O){d?m.push(O):d=O}if(t.cancelBubble||b===e||b===null)break;a=b}if(d){for(let O of m)queueMicrotask(()=>{throw O});throw d}}finally{t[la]=e,delete t.currentTarget,hr(h),Zr(g)}}}var rp;const pc=((rp=globalThis==null?void 0:globalThis.window)==null?void 0:rp.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function NE(t){return(pc==null?void 0:pc.createHTML(t))??t}function Jp(t){var e=Pp("template");return e.innerHTML=NE(t.replaceAll("<!>","<!---->")),e.content}function Si(t,e){var n=Ke;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function W(t,e){var n=(e&Iv)!==0,r=(e&Cv)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=Jp(a?t:"<!>"+t),n||(s=Ai(s)));var i=r||xp?document.importNode(s,!0):s.cloneNode(!0);if(n){var u=Ai(i),o=i.lastChild;Si(u,o)}else Si(i,i);return i}}function SE(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=Jp(s),u=Ai(i);a=Ai(u)}var o=a.cloneNode(!0);return Si(o,o),o}}function IE(t,e){return SE(t,e,"svg")}function cf(t=""){{var e=Gr(t+"");return Si(e,e),e}}function Ir(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Gr();return t.append(e,n),Si(e,n),t}function H(t,e){t!==null&&t.before(e)}function fe(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[nu]??(t[nu]=t.nodeValue))&&(t[nu]=n,t.nodeValue=`${n}`)}function CE(t,e){return wE(t,e)}const _o=new Map;function wE(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:u}){aE();var o=void 0,f=cE(()=>{var h=n??e.appendChild(Gr());Kv(h,{pending:()=>{}},m=>{ct({});var b=_t;a&&(b.c=a),s&&(r.$$events=s),o=t(m,r)||{},ft()},u);var g=new Set,d=m=>{for(var b=0;b<m.length;b++){var _=m[b];if(!g.has(_)){g.add(_);var T=yE(_);for(const L of[e,document]){var v=_o.get(L);v===void 0&&(v=new Map,_o.set(L,v));var O=v.get(_);O===void 0?(L.addEventListener(_,lf,{passive:T}),v.set(_,1)):v.set(_,O+1)}}}};return d(Nl(Qp)),of.add(d),()=>{var T;for(var m of g)for(const v of[e,document]){var b=_o.get(v),_=b.get(m);--_==0?(v.removeEventListener(m,lf),b.delete(m),b.size===0&&_o.delete(v)):b.set(m,_)}of.delete(d),h!==n&&((T=h.parentNode)==null||T.removeChild(h))}});return LE.set(o,f),o}let LE=new WeakMap;var _r,$r,Wn,ga,$u,Yu,_l;class Qu{constructor(e,n=!0){Ee(this,"anchor");Ue(this,_r,new Map);Ue(this,$r,new Map);Ue(this,Wn,new Map);Ue(this,ga,new Set);Ue(this,$u,!0);Ue(this,Yu,e=>{if(K(this,_r).has(e)){var n=K(this,_r).get(e),r=K(this,$r).get(n);if(r)Dd(r),K(this,ga).delete(n);else{var s=K(this,Wn).get(n);s&&(K(this,$r).set(n,s.effect),K(this,Wn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of K(this,_r)){if(K(this,_r).delete(a),a===e)break;const u=K(this,Wn).get(i);u&&(on(u.effect),K(this,Wn).delete(i))}for(const[a,i]of K(this,$r)){if(a===n||K(this,ga).has(a))continue;const u=()=>{if(Array.from(K(this,_r).values()).includes(a)){var f=document.createDocumentFragment();kd(i,f),f.append(Gr()),K(this,Wn).set(a,{effect:i,fragment:f})}else on(i);K(this,ga).delete(a),K(this,$r).delete(a)};K(this,$u)||!r?(K(this,ga).add(a),Ea(i,u,!1)):u()}}});Ue(this,_l,e=>{K(this,_r).delete(e);const n=Array.from(K(this,_r).values());for(const[r,s]of K(this,Wn))n.includes(r)||(on(s.effect),K(this,Wn).delete(r))});this.anchor=e,He(this,$u,n)}ensure(e,n){var r=Pe,s=kp();if(n&&!K(this,$r).has(e)&&!K(this,Wn).has(e))if(s){var a=document.createDocumentFragment(),i=Gr();a.append(i),K(this,Wn).set(e,{effect:Fn(()=>n(i)),fragment:a})}else K(this,$r).set(e,Fn(()=>n(this.anchor)));if(K(this,_r).set(r,e),s){for(const[u,o]of K(this,$r))u===e?r.unskip_effect(o):r.skip_effect(o);for(const[u,o]of K(this,Wn))u===e?r.unskip_effect(o.effect):r.skip_effect(o.effect);r.oncommit(K(this,Yu)),r.ondiscard(K(this,_l))}else K(this,Yu).call(this,r)}}_r=new WeakMap,$r=new WeakMap,Wn=new WeakMap,ga=new WeakMap,$u=new WeakMap,Yu=new WeakMap,_l=new WeakMap;function de(t,e,n=!1){var r=new Qu(t),s=n?ps:0;function a(i,u){r.ensure(i,u)}Ra(()=>{var i=!1;e((u,o=0)=>{i=!0,a(o,u)}),i||a(-1,null)},s)}const OE=Symbol("NaN");function xE(t,e,n){var r=new Qu(t),s=!Ui();Ra(()=>{var a=e();a!==a&&(a=OE),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function Iu(t,e){return e}function RE(t,e,n){for(var r=[],s=e.length,a,i=e.length,u=0;u<s;u++){let g=e[u];Ea(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var d=t.outrogroups;ff(t,Nl(a.done)),d.delete(a),d.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var o=r.length===0&&n!==null;if(o){var f=n,h=f.parentNode;iE(h),h.append(f),t.items.clear()}ff(t,e,!o)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function ff(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const u of i)r.add(t.items.get(u).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=zr;const i=document.createDocumentFragment();kd(a,i)}else on(e[s],n)}}var Gh;function Ot(t,e,n,r,s,a=null){var i=t,u=new Map,o=(e&fp)!==0;if(o){var f=t;i=f.appendChild(Gr())}var h=null,g=wd(()=>{var L=n();return Td(L)?L:L==null?[]:Nl(L)}),d,m=new Map,b=!0;function _(L){(O.effect.f&fr)===0&&(O.pending.delete(L),O.fallback=h,DE(O,d,i,e,r),h!==null&&(d.length===0?(h.f&zr)===0?Dd(h):(h.f^=zr,su(h,null,i)):Ea(h,()=>{h=null})))}function T(L){O.pending.delete(L)}var v=Ra(()=>{d=c(g);for(var L=d.length,B=new Set,C=Pe,q=kp(),x=0;x<L;x+=1){var j=d[x],Z=r(j,x),Y=b?null:u.get(Z);Y?(Y.v&&_i(Y.v,j),Y.i&&_i(Y.i,x),q&&C.unskip_effect(Y.e)):(Y=kE(u,b?i:Gh??(Gh=Gr()),j,Z,x,s,e,n),b||(Y.e.f|=zr),u.set(Z,Y)),B.add(Z)}if(L===0&&a&&!h&&(b?h=Fn(()=>a(i)):(h=Fn(()=>a(Gh??(Gh=Gr()))),h.f|=zr)),L>B.size&&uv(),!b)if(m.set(C,B),q){for(const[E,k]of u)B.has(E)||C.skip_effect(k.e);C.oncommit(_),C.ondiscard(T)}else _(C);c(g)}),O={effect:v,items:u,pending:m,outrogroups:null,fallback:h};b=!1}function Ki(t){for(;t!==null&&(t.f&Lr)===0;)t=t.next;return t}function DE(t,e,n,r,s){var Y,E,k,S,U,F,M,Q,z;var a=(r&Ev)!==0,i=e.length,u=t.items,o=Ki(t.effect.first),f,h=null,g,d=[],m=[],b,_,T,v;if(a)for(v=0;v<i;v+=1)b=e[v],_=s(b,v),T=u.get(_).e,(T.f&zr)===0&&((E=(Y=T.nodes)==null?void 0:Y.a)==null||E.measure(),(g??(g=new Set)).add(T));for(v=0;v<i;v+=1){if(b=e[v],_=s(b,v),T=u.get(_).e,t.outrogroups!==null)for(const $ of t.outrogroups)$.pending.delete(T),$.done.delete(T);if((T.f&On)!==0&&(Dd(T),a&&((S=(k=T.nodes)==null?void 0:k.a)==null||S.unfix(),(g??(g=new Set)).delete(T))),(T.f&zr)!==0)if(T.f^=zr,T===o)su(T,null,n);else{var O=h?h.next:o;T===t.effect.last&&(t.effect.last=T.prev),T.prev&&(T.prev.next=T.next),T.next&&(T.next.prev=T.prev),ys(t,h,T),ys(t,T,O),su(T,O,n),h=T,d=[],m=[],o=Ki(h.next);continue}if(T!==o){if(f!==void 0&&f.has(T)){if(d.length<m.length){var L=m[0],B;h=L.prev;var C=d[0],q=d[d.length-1];for(B=0;B<d.length;B+=1)su(d[B],L,n);for(B=0;B<m.length;B+=1)f.delete(m[B]);ys(t,C.prev,q.next),ys(t,h,C),ys(t,q,L),o=L,h=q,v-=1,d=[],m=[]}else f.delete(T),su(T,o,n),ys(t,T.prev,T.next),ys(t,T,h===null?t.effect.first:h.next),ys(t,h,T),h=T;continue}for(d=[],m=[];o!==null&&o!==T;)(f??(f=new Set)).add(o),m.push(o),o=Ki(o.next);if(o===null)continue}(T.f&zr)===0&&d.push(T),h=T,o=Ki(T.next)}if(t.outrogroups!==null){for(const $ of t.outrogroups)$.pending.size===0&&(ff(t,Nl($.done)),(U=t.outrogroups)==null||U.delete($));t.outrogroups.size===0&&(t.outrogroups=null)}if(o!==null||f!==void 0){var x=[];if(f!==void 0)for(T of f)(T.f&On)===0&&x.push(T);for(;o!==null;)(o.f&On)===0&&o!==t.fallback&&x.push(o),o=Ki(o.next);var j=x.length;if(j>0){var Z=(r&fp)!==0&&i===0?n:null;if(a){for(v=0;v<j;v+=1)(M=(F=x[v].nodes)==null?void 0:F.a)==null||M.measure();for(v=0;v<j;v+=1)(z=(Q=x[v].nodes)==null?void 0:Q.a)==null||z.fix()}RE(t,x,Z)}}a&&Cr(()=>{var $,X;if(g!==void 0)for(T of g)(X=($=T.nodes)==null?void 0:$.a)==null||X.apply()})}function kE(t,e,n,r,s,a,i,u){var o=(i&bv)!==0?(i&Tv)===0?rE(n,!1,!1):Sa(n):null,f=(i&vv)!==0?Sa(s):null;return{v:o,i:f,e:Fn(()=>(a(e,o??n,f??s,u),()=>{t.delete(r)}))}}function su(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&zr)===0?e.nodes.start:n;r!==null;){var i=Gu(r);if(a.before(r),r===s)return;r=i}}function ys(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function PE(t,e,...n){var r=new Qu(t);Ra(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},ps)}function ME(t,e,n){var r=new Qu(t);Ra(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},ps)}function BE(t,e,n,r,s,a){var i=null,u=t,o=new Qu(u,!1);Ra(()=>{const f=e()||null;var h=wv;if(f===null){o.ensure(null,null);return}return o.ensure(f,g=>{if(f){if(i=Pp(f,h),Si(i,i),r){var d=i.appendChild(Gr());r(i,d)}Ke.nodes.end=i,g.before(i)}}),()=>{}},ps),Ku(()=>{})}function FE(t,e){var n=void 0,r;Fp(()=>{n!==(n=e())&&(r&&(on(r),r=null),n&&(r=Fn(()=>{Vu(()=>n(t))})))})}function em(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=em(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function UE(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=em(t))&&(r&&(r+=" "),r+=e);return r}function tm(t){return typeof t=="object"?UE(t):t??""}const Kh=[...`
3
+ \r\f \v\uFEFF`];function HE(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 u=i+a;(i===0||Kh.includes(r[i-1]))&&(u===r.length||Kh.includes(r[u]))?r=(i===0?"":r.substring(0,i))+r.substring(u+1):i=u}}return r===""?null:r}function Vh(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 mc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function qE(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,u=!1,o=[];r&&o.push(...Object.keys(r).map(mc)),s&&o.push(...Object.keys(s).map(mc));var f=0,h=-1;const _=t.length;for(var g=0;g<_;g++){var d=t[g];if(u?d==="/"&&t[g-1]==="*"&&(u=!1):a?a===d&&(a=!1):d==="/"&&t[g+1]==="*"?u=!0:d==='"'||d==="'"?a=d:d==="("?i++:d===")"&&i--,!u&&a===!1&&i===0){if(d===":"&&h===-1)h=g;else if(d===";"||g===_-1){if(h!==-1){var m=mc(t.substring(f,h).trim());if(!o.includes(m)){d!==";"&&g++;var b=t.substring(f,g).trim();n+=" "+b+";"}}f=g+1,h=-1}}}}return r&&(n+=Vh(r)),s&&(n+=Vh(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function it(t,e,n,r,s,a){var i=t[Qc];if(i!==n||i===void 0){var u=HE(n,r,a);u==null?t.removeAttribute("class"):e?t.className=u:t.setAttribute("class",u),t[Qc]=n}else if(a&&s!==a)for(var o in a){var f=!!a[o];(s==null||f!==!!s[o])&&t.classList.toggle(o,f)}return a}function gc(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 nm(t,e,n,r){var s=t[Zc];if(s!==e){var a=qE(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[Zc]=e}else r&&(Array.isArray(r)?(gc(t,n==null?void 0:n[0],r[0]),gc(t,n==null?void 0:n[1],r[1],"important")):gc(t,n,r));return r}function sl(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Td(e))return xv();for(var r of t.options)r.selected=e.includes(du(r));return}for(r of t.options){var s=du(r);if(Op(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function rm(t){var e=new MutationObserver(()=>{sl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ku(()=>{e.disconnect()})}function Ia(t,e,n=e){var r=new WeakSet,s=!0;Od(t,"change",a=>{var i=a?"[selected]":":checked",u;if(t.multiple)u=[].map.call(t.querySelectorAll(i),du);else{var o=t.querySelector(i)??t.querySelector("option:not([disabled])");u=o&&du(o)}n(u),t.__value=u,Pe!==null&&r.add(Pe)}),Vu(()=>{var a=e();if(t===document.activeElement){var i=Pe;if(r.has(i))return}if(sl(t,a,s),s&&a===void 0){var u=t.querySelector(":checked");u!==null&&(a=du(u),n(a))}t.__value=a,s=!1}),rm(t)}function du(t){return"__value"in t?t.__value:t.value}const Vi=Symbol("class"),Xi=Symbol("style"),sm=Symbol("is custom element"),am=Symbol("is html"),jE=Nd?"option":"OPTION",$E=Nd?"select":"SELECT",YE=Nd?"progress":"PROGRESS";function zE(t,e){var n=wl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==YE)||(t.value=e??"")}function WE(t,e){var n=wl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function GE(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function me(t,e,n,r){var s=wl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[av]=n),n==null?t.removeAttribute(e):typeof n!="string"&&im(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function KE(t,e,n,r,s=!1,a=!1){var i=wl(t),u=i[sm],o=!i[am],f=e||{},h=t.nodeName===jE;for(var g in e)g in n||(n[g]=null);n.class?n.class=tm(n.class):n[Vi]&&(n.class=null),n[Xi]&&(n.style??(n.style=null));var d=im(t);for(const L in n){let B=n[L];if(h&&L==="value"&&B==null){t.value=t.__value="",f[L]=B;continue}if(L==="class"){var m=t.namespaceURI==="http://www.w3.org/1999/xhtml";it(t,m,B,r,e==null?void 0:e[Vi],n[Vi]),f[L]=B,f[Vi]=n[Vi];continue}if(L==="style"){nm(t,B,e==null?void 0:e[Xi],n[Xi]),f[L]=B,f[Xi]=n[Xi];continue}var b=f[L];if(!(B===b&&!(B===void 0&&t.hasAttribute(L)))){f[L]=B;var _=L[0]+L[1];if(_!=="$$")if(_==="on"){const C={},q="$$"+L;let x=L.slice(2);var T=EE(x);if(bE(x)&&(x=x.slice(0,-7),C.capture=!0),!T&&b){if(B!=null)continue;t.removeEventListener(x,f[q],C),f[q]=null}if(T)ae(x,t,B),At([x]);else if(B!=null){let j=function(Z){f[L].call(this,Z)};f[q]=Zp(x,t,j,C)}}else if(L==="style")me(t,L,B);else if(L==="autofocus")yi(t,!!B);else if(!u&&(L==="__value"||L==="value"&&B!=null))t.value=t.__value=B;else if(L==="selected"&&h)GE(t,B);else{var v=L;o||(v=_E(v));var O=v==="defaultValue"||v==="defaultChecked";if(B==null&&!u&&!O)if(i[L]=null,v==="value"||v==="checked"){let C=t;const q=e===void 0;if(v==="value"){let x=C.defaultValue;C.removeAttribute(v),C.defaultValue=x,C.value=C.__value=q?x:null}else{let x=C.defaultChecked;C.removeAttribute(v),C.defaultChecked=x,C.checked=q?x:!1}}else t.removeAttribute(L);else O||d.includes(v)&&(u||typeof B!="string")?(t[v]=B,v in i&&(i[v]=jt)):typeof B!="function"&&me(t,v,B)}}}return f}function Xh(t,e,n=[],r=[],s=[],a,i=!1,u=!1){Np(s,n,r,o=>{var f=void 0,h={},g=t.nodeName===$E,d=!1;if(Fp(()=>{var b=e(...o.map(c)),_=KE(t,f,b,a,i,u);d&&g&&"value"in b&&sl(t,b.value);for(let v of Object.getOwnPropertySymbols(h))b[v]||on(h[v]);for(let v of Object.getOwnPropertySymbols(b)){var T=b[v];v.description===Lv&&(!f||T!==f[v])&&(h[v]&&on(h[v]),h[v]=Fn(()=>FE(t,()=>T))),_[v]=T}f=_}),g){var m=t;Vu(()=>{sl(m,f.value,!0),rm(m)})}d=!0})}function wl(t){return t[Fo]??(t[Fo]={[sm]:t.nodeName.includes("-"),[am]:t.namespaceURI===dp})}var Qh=new Map;function im(t){var e=t.getAttribute("is")||t.nodeName,n=Qh.get(e);if(n)return n;Qh.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=ip(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=_d(s)}return n}function Et(t,e,n=e){var r=new WeakSet;Od(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=vc(t)?Ec(a):a,n(a),Pe!==null&&r.add(Pe),await Kp(),a!==(a=e())){var i=t.selectionStart,u=t.selectionEnd,o=t.value.length;if(t.value=a??"",u!==null){var f=t.value.length;i===u&&u===o&&f>o?(t.selectionStart=f,t.selectionEnd=f):(t.selectionStart=i,t.selectionEnd=Math.min(u,f))}}}),Da(e)==null&&t.value&&(n(vc(t)?Ec(t.value):t.value),Pe!==null&&r.add(Pe)),Cl(()=>{var s=e();if(t===document.activeElement){var a=Pe;if(r.has(a))return}vc(t)&&s===Ec(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const bc=new Set;function VE(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var u of e)i=i[u]??(i[u]=[]);i.push(n),Od(n,"change",()=>{var o=n.__value;a&&(o=XE(i,o,n.checked)),s(o)},()=>s(a?[]:null)),Cl(()=>{var o=r();a?(o=o||[],n.checked=o.includes(n.__value)):n.checked=Op(n.__value,o)}),Ku(()=>{var o=i.indexOf(n);o!==-1&&i.splice(o,1)}),bc.has(i)||(bc.add(i),Cr(()=>{i.sort((o,f)=>o.compareDocumentPosition(f)===4?-1:1),bc.delete(i)})),Cr(()=>{})}function XE(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 vc(t){var e=t.type;return e==="number"||e==="range"}function Ec(t){return t===""?null:+t}var Rs,bi,zu,Al,um;const yl=class yl{constructor(e){Ue(this,Al);Ue(this,Rs,new WeakMap);Ue(this,bi);Ue(this,zu);He(this,zu,e)}observe(e,n){var r=K(this,Rs).get(e)||new Set;return r.add(n),K(this,Rs).set(e,r),Ze(this,Al,um).call(this).observe(e,K(this,zu)),()=>{var s=K(this,Rs).get(e);s.delete(n),s.size===0&&(K(this,Rs).delete(e),K(this,bi).unobserve(e))}}};Rs=new WeakMap,bi=new WeakMap,zu=new WeakMap,Al=new WeakSet,um=function(){return K(this,bi)??He(this,bi,new ResizeObserver(e=>{for(var n of e){yl.entries.set(n.target,n);for(var r of K(this,Rs).get(n.target)||[])r(n)}}))},Ee(yl,"entries",new WeakMap);let df=yl;var QE=new df({box:"border-box"});function ZE(t,e,n){var r=QE.observe(t,()=>n(t[e]));Vu(()=>(Da(()=>n(t[e])),r))}function Tc(t,e){return t===e||(t==null?void 0:t[Wr])===e}function dn(t={},e,n,r){var s=_t.r,a=Ke;return Vu(()=>{var i,u;return Cl(()=>{i=u,u=[],Da(()=>{Tc(n(...u),t)||(e(t,...u),i&&Tc(n(...i),t)&&e(null,...i))})}),()=>{let o=a;for(;o!==s&&o.parent!==null&&o.parent.f&Xc;)o=o.parent;const f=()=>{u&&Tc(n(...u),t)&&e(null,...u)},h=o.teardown;o.teardown=()=>{f(),h==null||h()}}}),t}function om(t=!1){const e=_t,n=e.l.u;if(!n)return;let r=()=>gE(e.s);if(t){let s=0,a={};const i=Ti(()=>{let u=!1;const o=e.s;for(const f in o)o[f]!==a[f]&&(a[f]=o[f],u=!0);return u&&s++,s});r=()=>c(i)}n.b.length&&lE(()=>{Zh(e,r),Kc(n.b)}),kt(()=>{const s=Da(()=>n.m.map(nv));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&kt(()=>{Zh(e,r),Kc(n.a)})}function Zh(t,e){if(t.l.s)for(const n of t.l.s)c(n);e()}const JE={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 pr(t,e,n){return new Proxy({props:t,exclude:e},JE)}const eT={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(Gi(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];Gi(s)&&(s=s());const a=Us(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(Gi(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=Us(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Wr||e===lp)return!1;for(let n of t.props)if(Gi(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(Gi(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 Rr(...t){return new Proxy({props:t},eT)}function ur(t,e,n,r){var B;var s=!Fi||(n&Av)!==0,a=(n&Nv)!==0,i=(n&Sv)!==0,u=r,o=!0,f=void 0,h=()=>i&&s?(f??(f=Ti(r)),c(f)):(o&&(o=!1,u=i?Da(r):r),u);let g;if(a){var d=Wr in t||lp in t;g=((B=Us(t,e))==null?void 0:B.set)??(d&&e in t?C=>t[e]=C:void 0)}var m,b=!1;a?[m,b]=qv(()=>t[e]):m=t[e],m===void 0&&r!==void 0&&(m=h(),g&&(s&&dv(),g(m)));var _;if(s?_=()=>{var C=t[e];return C===void 0?h():(o=!0,C)}:_=()=>{var C=t[e];return C!==void 0&&(u=void 0),C===void 0?u:C},s&&(n&yv)===0)return _;if(g){var T=t.$$legacy;return(function(C,q){return arguments.length>0?((!s||!q||T||b)&&g(q?_():C),C):_()})}var v=!1,O=((n&_v)!==0?Ti:wd)(()=>(v=!1,_()));a&&c(O);var L=Ke;return(function(C,q){if(arguments.length>0){const x=q?c(O):s&&a?Tt(C):C;return y(O,x),v=!0,u!==void 0&&(u=x),C}return ms&&v||(L.f&fr)!==0?O.v:c(O)})}function ka(t){_t===null&&cp(),Fi&&_t.l!==null?tT(_t).m.push(t):kt(()=>{const e=Da(t);if(typeof e=="function")return e})}function tT(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const nT="5";var sp;typeof window<"u"&&((sp=window.__svelte??(window.__svelte={})).v??(sp.v=new Set)).add(nT);Pv();function hs(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Pd(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)}class ca extends Error{constructor(e){super(e),this.name="ContentParseError"}}function hf(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function pf(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function rT(t){return hf(t)&&Object.values(t).every(pf)}function sT(t,e){if(pf(e))return e;if(Array.isArray(e)){if(e.every(pf)||e.every(rT))return e;throw new ca(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new ca(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Ao(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new ca(`"${e}" must be a string when present.`);return n}}function Zu(t){if(!hf(t))throw new ca("A content item must be a JSON object.");if(typeof t.title!="string")throw new ca('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new ca(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!hf(t.fields))throw new ca('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([u,o])=>[u,sT(u,o)]))}const r=Ao(t,"template"),s=Ao(t,"created"),a=Ao(t,"published"),i=Ao(t,"updated");return{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}}}function Jh(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function lm(t){if(!Jh(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=Jh(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}}}const cm="_sort.json",aT="_redirects.json",iT="_site.json",uT="assets",e0=".json",Je={content:"content",templates:"templates",components:"components",public:"public"};function Kr(...t){return t.filter(e=>e!=="").join("/")}async function Md(t,e=Je.content){return fm(t,e,"","")}async function fm(t,e,n,r){const[s,a]=await Promise.all([t.list(e),lT(t,e)]),i=new Map;for(const o of s)if(o.kind==="file"){if(o.name===cm||o.name===aT||o.name===iT||!o.name.endsWith(e0))continue;const f=o.name.slice(0,-e0.length);i.set(f,await oT(t,Kr(e,o.name),f,r))}else{if(o.name===uT)continue;const f=Kr(r,o.name);i.set(o.name,await fm(t,Kr(e,o.name),o.name,f))}const u=a.name??(n===""?"":Pd(n));return{kind:"dir",slug:n,name:u,path:r,children:cT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function oT(t,e,n,r){const s=await t.readText(e);try{const a=Zu(JSON.parse(s));return{kind:"item",slug:n,path:Kr(r,n),item:a}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function lT(t,e){const n=Kr(e,cm);if(!await t.exists(n))return{order:[]};try{return lm(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function cT(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 Bd(t,e=Je.components){return Fd(t,e,"html")}function dm(t,e=Je.components){return Fd(t,e,"css")}function hm(t,e=Je.components){return Fd(t,e,"js")}async function Fd(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const u of await t.list(i)){const o=Kr(i,u.name);if(u.kind==="dir")await a(o);else if(u.name.endsWith(r)){const f=u.name.slice(0,-r.length).toLowerCase();s.set(f,await t.readText(o))}}};return await a(e),s}async function Ud(t,e,n=Je.templates){return t.readText(Kr(n,`${e}.html`))}function fT(t,e,n=Je.templates){return qd(t,Kr(n,`${e}.css`))}function dT(t,e,n=Je.templates){return qd(t,Kr(n,`${e}.js`))}const Ju="document";function Hd(t,e=Je.templates){return qd(t,Kr(e,`${Ju}.html`))}async function qd(t,e){try{return await t.readText(e)}catch{return}}const jd={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 hT(t){return Object.prototype.hasOwnProperty.call(jd,t)}function $d(t){return jd[t].valueKind}const pT=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),mT=new Set(["code","pre","kbd","samp"]),gT=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Ii(t){if(t.annotation!==void 0&&hT(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 mT.has(t.tag)?"code":pT.has(t.tag)?"shorttext":gT.has(t.tag)?"text":"shorttext"}const bT=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function zs(t){const e=[];for(const n of t.matchAll(bT)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Ci(t){var r;const e=t.trim(),n=zs(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function Ll(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 Yd(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function vT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function _c(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ET(t){return JSON.stringify(t).slice(1,-1)}function al(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 TT(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 _T(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 AT(t,e){const n=TT(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return vT((s==null?void 0:s.displayName)??r.name)});return _T(n)}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]),Lt="�";var N;(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"})(N||(N={}));const kn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function pm(t){return t>=55296&&t<=57343}function NT(t){return t>=56320&&t<=57343}function ST(t,e){return(t-55296)*1024+9216+e}function mm(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function gm(t){return t>=64976&&t<=65007||yT.has(t)}var te;(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"})(te||(te={}));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,u=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:u,endOffset:u}}_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(),ST(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(te.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,N.EOF;const r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.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,N.EOF;let e=this.html.charCodeAt(this.pos);return e===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):e===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,pm(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===N.LINE_FEED||e===N.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){mm(e)?this._err(te.controlCharacterInInputStream):gm(e)&&this._err(te.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(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"})(at||(at={}));function bm(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 wT=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 tn;(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"})(tn||(tn={}));const xT=32;var ks;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ks||(ks={}));function mf(t){return t>=tn.ZERO&&t<=tn.NINE}function RT(t){return t>=tn.UPPER_A&&t<=tn.UPPER_F||t>=tn.LOWER_A&&t<=tn.LOWER_F}function DT(t){return t>=tn.UPPER_A&&t<=tn.UPPER_Z||t>=tn.LOWER_A&&t<=tn.LOWER_Z||mf(t)}function kT(t){return t===tn.EQUALS||DT(t)}var Jt;(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"})(Jt||(Jt={}));var ds;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(ds||(ds={}));class PT{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Jt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ds.Strict}startEntity(e){this.decodeMode=e,this.state=Jt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Jt.EntityStart:return e.charCodeAt(n)===tn.NUM?(this.state=Jt.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Jt.NamedEntity,this.stateNamedEntity(e,n));case Jt.NumericStart:return this.stateNumericStart(e,n);case Jt.NumericDecimal:return this.stateNumericDecimal(e,n);case Jt.NumericHex:return this.stateNumericHex(e,n);case Jt.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|xT)===tn.LOWER_X?(this.state=Jt.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Jt.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(mf(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(mf(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===tn.SEMI)this.consumed+=1;else if(this.decodeMode===ds.Strict)return 0;return this.emitCodePoint(OT(this.result),this.consumed),this.errors&&(e!==tn.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&ks.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===ds.Attribute&&(a===0||kT(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&ks.VALUE_LENGTH)>>14,a!==0){if(i===tn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==ds.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]&ks.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]&~ks.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case Jt.NamedEntity:return this.result!==0&&(this.decodeMode!==ds.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Jt.NumericDecimal:return this.emitNumericEntity(0,2);case Jt.NumericHex:return this.emitNumericEntity(0,3);case Jt.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Jt.EntityStart:return 0}}}function MT(t,e,n,r){const s=(e&ks.BRANCH_LENGTH)>>7,a=e&ks.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=s?-1:t[n+o]-1}let i=n,u=i+s-1;for(;i<=u;){const o=i+u>>>1,f=t[o];if(f<r)i=o+1;else if(f>r)u=o-1;else return t[o+s]}return-1}var oe;(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/"})(oe||(oe={}));var _a;(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"})(_a||(_a={}));var sr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(sr||(sr={}));var V;(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"})(V||(V={}));var l;(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"})(l||(l={}));const BT=new Map([[V.A,l.A],[V.ADDRESS,l.ADDRESS],[V.ANNOTATION_XML,l.ANNOTATION_XML],[V.APPLET,l.APPLET],[V.AREA,l.AREA],[V.ARTICLE,l.ARTICLE],[V.ASIDE,l.ASIDE],[V.B,l.B],[V.BASE,l.BASE],[V.BASEFONT,l.BASEFONT],[V.BGSOUND,l.BGSOUND],[V.BIG,l.BIG],[V.BLOCKQUOTE,l.BLOCKQUOTE],[V.BODY,l.BODY],[V.BR,l.BR],[V.BUTTON,l.BUTTON],[V.CAPTION,l.CAPTION],[V.CENTER,l.CENTER],[V.CODE,l.CODE],[V.COL,l.COL],[V.COLGROUP,l.COLGROUP],[V.DD,l.DD],[V.DESC,l.DESC],[V.DETAILS,l.DETAILS],[V.DIALOG,l.DIALOG],[V.DIR,l.DIR],[V.DIV,l.DIV],[V.DL,l.DL],[V.DT,l.DT],[V.EM,l.EM],[V.EMBED,l.EMBED],[V.FIELDSET,l.FIELDSET],[V.FIGCAPTION,l.FIGCAPTION],[V.FIGURE,l.FIGURE],[V.FONT,l.FONT],[V.FOOTER,l.FOOTER],[V.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[V.FORM,l.FORM],[V.FRAME,l.FRAME],[V.FRAMESET,l.FRAMESET],[V.H1,l.H1],[V.H2,l.H2],[V.H3,l.H3],[V.H4,l.H4],[V.H5,l.H5],[V.H6,l.H6],[V.HEAD,l.HEAD],[V.HEADER,l.HEADER],[V.HGROUP,l.HGROUP],[V.HR,l.HR],[V.HTML,l.HTML],[V.I,l.I],[V.IMG,l.IMG],[V.IMAGE,l.IMAGE],[V.INPUT,l.INPUT],[V.IFRAME,l.IFRAME],[V.KEYGEN,l.KEYGEN],[V.LABEL,l.LABEL],[V.LI,l.LI],[V.LINK,l.LINK],[V.LISTING,l.LISTING],[V.MAIN,l.MAIN],[V.MALIGNMARK,l.MALIGNMARK],[V.MARQUEE,l.MARQUEE],[V.MATH,l.MATH],[V.MENU,l.MENU],[V.META,l.META],[V.MGLYPH,l.MGLYPH],[V.MI,l.MI],[V.MO,l.MO],[V.MN,l.MN],[V.MS,l.MS],[V.MTEXT,l.MTEXT],[V.NAV,l.NAV],[V.NOBR,l.NOBR],[V.NOFRAMES,l.NOFRAMES],[V.NOEMBED,l.NOEMBED],[V.NOSCRIPT,l.NOSCRIPT],[V.OBJECT,l.OBJECT],[V.OL,l.OL],[V.OPTGROUP,l.OPTGROUP],[V.OPTION,l.OPTION],[V.P,l.P],[V.PARAM,l.PARAM],[V.PLAINTEXT,l.PLAINTEXT],[V.PRE,l.PRE],[V.RB,l.RB],[V.RP,l.RP],[V.RT,l.RT],[V.RTC,l.RTC],[V.RUBY,l.RUBY],[V.S,l.S],[V.SCRIPT,l.SCRIPT],[V.SEARCH,l.SEARCH],[V.SECTION,l.SECTION],[V.SELECT,l.SELECT],[V.SOURCE,l.SOURCE],[V.SMALL,l.SMALL],[V.SPAN,l.SPAN],[V.STRIKE,l.STRIKE],[V.STRONG,l.STRONG],[V.STYLE,l.STYLE],[V.SUB,l.SUB],[V.SUMMARY,l.SUMMARY],[V.SUP,l.SUP],[V.TABLE,l.TABLE],[V.TBODY,l.TBODY],[V.TEMPLATE,l.TEMPLATE],[V.TEXTAREA,l.TEXTAREA],[V.TFOOT,l.TFOOT],[V.TD,l.TD],[V.TH,l.TH],[V.THEAD,l.THEAD],[V.TITLE,l.TITLE],[V.TR,l.TR],[V.TRACK,l.TRACK],[V.TT,l.TT],[V.U,l.U],[V.UL,l.UL],[V.SVG,l.SVG],[V.VAR,l.VAR],[V.WBR,l.WBR],[V.XMP,l.XMP]]);function Ol(t){var e;return(e=BT.get(t))!==null&&e!==void 0?e:l.UNKNOWN}const ce=l,FT={[oe.HTML]:new Set([ce.ADDRESS,ce.APPLET,ce.AREA,ce.ARTICLE,ce.ASIDE,ce.BASE,ce.BASEFONT,ce.BGSOUND,ce.BLOCKQUOTE,ce.BODY,ce.BR,ce.BUTTON,ce.CAPTION,ce.CENTER,ce.COL,ce.COLGROUP,ce.DD,ce.DETAILS,ce.DIR,ce.DIV,ce.DL,ce.DT,ce.EMBED,ce.FIELDSET,ce.FIGCAPTION,ce.FIGURE,ce.FOOTER,ce.FORM,ce.FRAME,ce.FRAMESET,ce.H1,ce.H2,ce.H3,ce.H4,ce.H5,ce.H6,ce.HEAD,ce.HEADER,ce.HGROUP,ce.HR,ce.HTML,ce.IFRAME,ce.IMG,ce.INPUT,ce.LI,ce.LINK,ce.LISTING,ce.MAIN,ce.MARQUEE,ce.MENU,ce.META,ce.NAV,ce.NOEMBED,ce.NOFRAMES,ce.NOSCRIPT,ce.OBJECT,ce.OL,ce.P,ce.PARAM,ce.PLAINTEXT,ce.PRE,ce.SCRIPT,ce.SECTION,ce.SELECT,ce.SOURCE,ce.STYLE,ce.SUMMARY,ce.TABLE,ce.TBODY,ce.TD,ce.TEMPLATE,ce.TEXTAREA,ce.TFOOT,ce.TH,ce.THEAD,ce.TITLE,ce.TR,ce.TRACK,ce.UL,ce.WBR,ce.XMP]),[oe.MATHML]:new Set([ce.MI,ce.MO,ce.MN,ce.MS,ce.MTEXT,ce.ANNOTATION_XML]),[oe.SVG]:new Set([ce.TITLE,ce.FOREIGN_OBJECT,ce.DESC]),[oe.XLINK]:new Set,[oe.XML]:new Set,[oe.XMLNS]:new Set},gf=new Set([ce.H1,ce.H2,ce.H3,ce.H4,ce.H5,ce.H6]),UT=new Set([V.STYLE,V.SCRIPT,V.XMP,V.IFRAME,V.NOEMBED,V.NOFRAMES,V.PLAINTEXT]);function HT(t,e){return UT.has(t)||e&&t===V.NOSCRIPT}var w;(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"})(w||(w={}));const Hn={DATA:w.DATA,RCDATA:w.RCDATA,RAWTEXT:w.RAWTEXT,SCRIPT_DATA:w.SCRIPT_DATA,PLAINTEXT:w.PLAINTEXT,CDATA_SECTION:w.CDATA_SECTION};function qT(t){return t>=N.DIGIT_0&&t<=N.DIGIT_9}function au(t){return t>=N.LATIN_CAPITAL_A&&t<=N.LATIN_CAPITAL_Z}function jT(t){return t>=N.LATIN_SMALL_A&&t<=N.LATIN_SMALL_Z}function Ns(t){return jT(t)||au(t)}function t0(t){return Ns(t)||qT(t)}function yo(t){return t+32}function vm(t){return t===N.SPACE||t===N.LINE_FEED||t===N.TABULATION||t===N.FORM_FEED}function n0(t){return vm(t)||t===N.SOLIDUS||t===N.GREATER_THAN_SIGN}function $T(t){return t===N.NULL?te.nullCharacterReference:t>1114111?te.characterReferenceOutsideUnicodeRange:pm(t)?te.surrogateCharacterReference:gm(t)?te.noncharacterCharacterReference:mm(t)||t===N.CARRIAGE_RETURN?te.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=w.DATA,this.returnState=w.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 PT(wT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.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:at.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:at.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(bm(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(te.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=Ol(e.tagName),e.type===at.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(te.endTagWithAttributes),e.selfClosing&&this._err(te.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 at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.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:at.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=vm(e)?at.WHITESPACE_CHARACTER:e===N.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(at.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=w.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ds.Attribute:ds.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===w.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===w.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===w.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case w.DATA:{this._stateData(e);break}case w.RCDATA:{this._stateRcdata(e);break}case w.RAWTEXT:{this._stateRawtext(e);break}case w.SCRIPT_DATA:{this._stateScriptData(e);break}case w.PLAINTEXT:{this._statePlaintext(e);break}case w.TAG_OPEN:{this._stateTagOpen(e);break}case w.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case w.TAG_NAME:{this._stateTagName(e);break}case w.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case w.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case w.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case w.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case w.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case w.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case w.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case w.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case w.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case w.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case w.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case w.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case w.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case w.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case w.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case w.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case w.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case w.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case w.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case w.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case w.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case w.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case w.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case w.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case w.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case w.BOGUS_COMMENT:{this._stateBogusComment(e);break}case w.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case w.COMMENT_START:{this._stateCommentStart(e);break}case w.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case w.COMMENT:{this._stateComment(e);break}case w.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case w.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case w.COMMENT_END:{this._stateCommentEnd(e);break}case w.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case w.DOCTYPE:{this._stateDoctype(e);break}case w.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case w.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case w.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case w.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case w.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case w.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case w.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case w.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case w.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case w.CDATA_SECTION:{this._stateCdataSection(e);break}case w.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case w.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case w.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case w.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(e);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=w.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ns(e))this._createStartTagToken(),this.state=w.TAG_NAME,this._stateTagName(e);else switch(e){case N.EXCLAMATION_MARK:{this.state=w.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=w.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e);break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=w.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ns(e))this._createEndTagToken(),this.state=w.TAG_NAME,this._stateTagName(e);else switch(e){case N.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=w.DATA;break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this.state=w.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.tagName+=Lt;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(au(e)?yo(e):e)}}_stateRcdataLessThanSign(e){e===N.SOLIDUS?this.state=w.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=w.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ns(e)?(this.state=w.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=w.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=w.BEFORE_ATTRIBUTE_NAME,!1;case N.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=w.SELF_CLOSING_START_TAG,!1;case N.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=w.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===N.SOLIDUS?this.state=w.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ns(e)?(this.state=w.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case N.SOLIDUS:{this.state=w.SCRIPT_DATA_END_TAG_OPEN;break}case N.EXCLAMATION_MARK:{this.state=w.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=w.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ns(e)?(this.state=w.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===N.HYPHEN_MINUS?(this.state=w.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===N.HYPHEN_MINUS?(this.state=w.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.GREATER_THAN_SIGN:{this.state=w.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===N.SOLIDUS?this.state=w.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ns(e)?(this._emitChars("<"),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ns(e)?(this.state=w.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(kn.SCRIPT,!1)&&n0(this.preprocessor.peek(kn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<kn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.GREATER_THAN_SIGN:{this.state=w.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Lt);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===N.SOLIDUS?(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(kn.SCRIPT,!1)&&n0(this.preprocessor.peek(kn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<kn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=w.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this.state=w.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case N.EQUALS_SIGN:{this._err(te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=w.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=w.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this._leaveAttrName(),this.state=w.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case N.EQUALS_SIGN:{this._leaveAttrName(),this.state=w.BEFORE_ATTRIBUTE_VALUE;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:{this._err(te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.name+=Lt;break}default:this.currentAttr.name+=String.fromCodePoint(au(e)?yo(e):e)}}_stateAfterAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:{this.state=w.SELF_CLOSING_START_TAG;break}case N.EQUALS_SIGN:{this.state=w.BEFORE_ATTRIBUTE_VALUE;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=w.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{this.state=w.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this.state=w.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingAttributeValue),this.state=w.DATA,this.emitCurrentTagToken();break}default:this.state=w.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case N.APOSTROPHE:{this.state=w.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=w.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=Lt;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:case N.EQUALS_SIGN:case N.GRAVE_ACCENT:{this._err(te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this._leaveAttrValue(),this.state=w.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBetweenAttributes),this.state=w.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case N.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.unexpectedSolidusInTag),this.state=w.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=Lt;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(kn.DASH_DASH,!0)?(this._createCommentToken(kn.DASH_DASH.length+1),this.state=w.COMMENT_START):this._consumeSequenceIfMatch(kn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(kn.DOCTYPE.length+1),this.state=w.DOCTYPE):this._consumeSequenceIfMatch(kn.CDATA_START,!0)?this.inForeignNode?this.state=w.CDATA_SECTION:(this._err(te.cdataInHtmlContent),this._createCommentToken(kn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=w.BOGUS_COMMENT):this._ensureHibernation()||(this._err(te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_START_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=w.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=w.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=w.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END_DASH;break}case N.LESS_THAN_SIGN:{n.data+="<",this.state=w.COMMENT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=Lt;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case N.EXCLAMATION_MARK:{n.data+="!",this.state=w.COMMENT_LESS_THAN_SIGN_BANG;break}case N.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=w.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===N.HYPHEN_MINUS?this.state=w.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=w.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===N.HYPHEN_MINUS?this.state=w.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=w.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==N.GREATER_THAN_SIGN&&e!==N.EOF&&this._err(te.nestedComment),this.state=w.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=w.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentComment(n);break}case N.EXCLAMATION_MARK:{this.state=w.COMMENT_END_BANG;break}case N.HYPHEN_MINUS:{n.data+="-";break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=w.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{n.data+="--!",this.state=w.COMMENT_END_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.incorrectlyClosedComment),this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=w.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=w.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case N.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBeforeDoctypeName),this.state=w.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(au(e))this._createDoctypeToken(String.fromCharCode(yo(e))),this.state=w.DOCTYPE_NAME;else switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.NULL:{this._err(te.unexpectedNullCharacter),this._createDoctypeToken(Lt),this.state=w.DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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=w.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.AFTER_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.name+=Lt;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(au(e)?yo(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(kn.PUBLIC,!1)?this.state=w.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(kn.SYSTEM,!1)?this.state=w.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.QUOTATION_MARK:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=Lt;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.NULL:{this._err(te.unexpectedNullCharacter);break}case N.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case N.RIGHT_SQUARE_BRACKET:{this.state=w.CDATA_SECTION_BRACKET;break}case N.EOF:{this._err(te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===N.RIGHT_SQUARE_BRACKET?this.state=w.CDATA_SECTION_END:(this._emitChars("]"),this.state=w.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA;break}case N.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=w.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(N.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&t0(this.preprocessor.peek(1))?w.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){t0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===N.SEMICOLON&&this._err(te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Em=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),r0=new Set([...Em,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),il=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),zT=new Set([...il,l.OL,l.UL]),WT=new Set([...il,l.BUTTON]),s0=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),a0=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),GT=new Set([l.TR,l.TEMPLATE,l.HTML]),KT=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),VT=new Set([l.TABLE,l.TEMPLATE,l.HTML]),XT=new Set([l.TD,l.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=l.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===oe.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])!==oe.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(gf,oe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(XT,oe.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,oe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(KT,oe.HTML)}clearBackToTableRowContext(){this.clearBackTo(GT,oe.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]===l.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]===l.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 oe.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case oe.SVG:{if(a0.has(s))return!1;break}case oe.MATHML:{if(s0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,il)}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 oe.HTML:{if(gf.has(n))return!0;if(il.has(n))return!1;break}case oe.SVG:{if(a0.has(n))return!1;break}case oe.MATHML:{if(s0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===oe.HTML)switch(this.tagIDs[n]){case e:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===oe.HTML)switch(this.tagIDs[e]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===oe.HTML)switch(this.tagIDs[n]){case e:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Em.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&r0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&r0.has(this.currentTagId);)this.pop()}}const Ac=3;var Yr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Yr||(Yr={}));const i0={type:Yr.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 u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===Yr.Marker)break;const{element:f}=o;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===i){const h=this.treeAdapter.getAttrList(f);h.length===s&&r.push({idx:u,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Ac)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Ac)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const u=r[i];u.attrs.every(o=>s.get(o.name)===o.value)&&(a+=1,a>=Ac&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(i0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Yr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Yr.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(i0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Yr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Yr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Yr.Element&&n.element===e)}}const os={createDocument(){return{nodeName:"#document",mode:sr.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};os.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(os.isTextNode(n)){n.value+=e;return}}os.appendChild(t,os.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&os.isTextNode(r)?r.value+=e:os.insertBefore(t,os.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}}},Tm="html",JT="about:legacy-compat",e_="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",_m=["+//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//"],t_=[..._m,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],n_=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Am=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],r_=[...Am,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function u0(t,e){return e.some(n=>t.startsWith(n))}function s_(t){return t.name===Tm&&t.publicId===null&&(t.systemId===null||t.systemId===JT)}function a_(t){if(t.name!==Tm)return sr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===e_)return sr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),n_.has(n))return sr.QUIRKS;let r=e===null?t_:_m;if(u0(n,r))return sr.QUIRKS;if(r=e===null?Am:r_,u0(n,r))return sr.LIMITED_QUIRKS}return sr.NO_QUIRKS}const o0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},i_="definitionurl",u_="definitionURL",o_=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])),l_=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:oe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:oe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:oe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:oe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:oe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:oe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:oe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:oe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:oe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:oe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:oe.XMLNS}]]),c_=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])),f_=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function d_(t){const e=t.tagID;return e===l.FONT&&t.attrs.some(({name:r})=>r===_a.COLOR||r===_a.SIZE||r===_a.FACE)||f_.has(e)}function ym(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===i_){t.attrs[e].name=u_;break}}function Nm(t){for(let e=0;e<t.attrs.length;e++){const n=o_.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function zd(t){for(let e=0;e<t.attrs.length;e++){const n=l_.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 h_(t){const e=c_.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Ol(t.tagName))}function p_(t,e){return e===oe.MATHML&&(t===l.MI||t===l.MO||t===l.MN||t===l.MS||t===l.MTEXT)}function m_(t,e,n){if(e===oe.MATHML&&t===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===_a.ENCODING){const s=n[r].value.toLowerCase();return s===o0.TEXT_HTML||s===o0.APPLICATION_XML}}return e===oe.SVG&&(t===l.FOREIGN_OBJECT||t===l.DESC||t===l.TITLE)}function g_(t,e,n,r){return(!r||r===oe.HTML)&&m_(t,e,n)||(!r||r===oe.MATHML)&&p_(t,e)}const b_="hidden",v_=8,E_=3;var D;(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"})(D||(D={}));const T_={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Sm=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),l0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:os,onParseError:null};class Im{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=D.INITIAL,this.originalInsertionMode=D.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={...l0,...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?Ol(this.treeAdapter.getTagName(r)):l.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={...l0,...n};e??(e=r.treeAdapter.createElement(V.TEMPLATE,oe.HTML,[]));const s=r.treeAdapter.createElement("documentmock",oe.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(D.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:T_,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)===oe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,oe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=D.TEXT}switchToPlaintextParsing(){this.insertionMode=D.TEXT,this.originalInsertionMode=D.IN_BODY,this.tokenizer.state=Hn.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)===V.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==oe.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=Hn.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=Hn.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=Hn.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=Hn.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(u=>this.treeAdapter.isDocumentTypeNode(u));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,oe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,oe.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(V.HTML,oe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,l.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:o,endCol:f,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:o,endCol:f,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===at.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===l.SVG&&this.treeAdapter.getTagName(n)===V.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===oe.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===l.MGLYPH||e.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,oe.HTML)}_processToken(e){switch(e.type){case at.CHARACTER:{this.onCharacter(e);break}case at.NULL_CHARACTER:{this.onNullCharacter(e);break}case at.COMMENT:{this.onComment(e);break}case at.DOCTYPE:{this.onDoctype(e);break}case at.START_TAG:{this._processStartTag(e);break}case at.END_TAG:{this.onEndTag(e);break}case at.EOF:{this.onEof(e);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return g_(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Yr.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=D.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case l.TR:{this.insertionMode=D.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=D.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=D.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=D.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=D.IN_TABLE;return}case l.BODY:{this.insertionMode=D.IN_BODY;return}case l.FRAMESET:{this.insertionMode=D.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(e);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?D.AFTER_HEAD:D.BEFORE_HEAD;return}case l.TD:case l.TH:{if(e>0){this.insertionMode=D.IN_CELL;return}break}case l.HEAD:{if(e>0){this.insertionMode=D.IN_HEAD;return}break}}this.insertionMode=D.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=D.IN_SELECT_IN_TABLE;return}}this.insertionMode=D.IN_SELECT}_isElementCausesFosterParenting(e){return Sm.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 l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===oe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.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){X2(this,e);return}switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{hu(this,e);break}case D.BEFORE_HEAD:{pu(this,e);break}case D.IN_HEAD:{mu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{gu(this,e);break}case D.AFTER_HEAD:{bu(this,e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:{wm(this,e);break}case D.TEXT:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{yc(this,e);break}case D.IN_TABLE_TEXT:{km(this,e);break}case D.IN_COLUMN_GROUP:{ul(this,e);break}case D.AFTER_BODY:{ol(this,e);break}case D.AFTER_AFTER_BODY:{zo(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){V2(this,e);return}switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{hu(this,e);break}case D.BEFORE_HEAD:{pu(this,e);break}case D.IN_HEAD:{mu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{gu(this,e);break}case D.AFTER_HEAD:{bu(this,e);break}case D.TEXT:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{yc(this,e);break}case D.IN_COLUMN_GROUP:{ul(this,e);break}case D.AFTER_BODY:{ol(this,e);break}case D.AFTER_AFTER_BODY:{zo(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){bf(this,e);return}switch(this.insertionMode){case D.INITIAL:case D.BEFORE_HTML:case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_TEMPLATE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{bf(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.AFTER_BODY:{C_(this,e);break}case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{w_(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case D.INITIAL:{L_(this,e);break}case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:{this._err(e,te.misplacedDoctype);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Q2(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{O_(this,e);break}case D.BEFORE_HEAD:{R_(this,e);break}case D.IN_HEAD:{Dr(this,e);break}case D.IN_HEAD_NO_SCRIPT:{P_(this,e);break}case D.AFTER_HEAD:{B_(this,e);break}case D.IN_BODY:{yn(this,e);break}case D.IN_TABLE:{wi(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.IN_CAPTION:{D2(this,e);break}case D.IN_COLUMN_GROUP:{Kd(this,e);break}case D.IN_TABLE_BODY:{Dl(this,e);break}case D.IN_ROW:{kl(this,e);break}case D.IN_CELL:{M2(this,e);break}case D.IN_SELECT:{Bm(this,e);break}case D.IN_SELECT_IN_TABLE:{F2(this,e);break}case D.IN_TEMPLATE:{H2(this,e);break}case D.AFTER_BODY:{j2(this,e);break}case D.IN_FRAMESET:{$2(this,e);break}case D.AFTER_FRAMESET:{z2(this,e);break}case D.AFTER_AFTER_BODY:{G2(this,e);break}case D.AFTER_AFTER_FRAMESET:{K2(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Z2(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{x_(this,e);break}case D.BEFORE_HEAD:{D_(this,e);break}case D.IN_HEAD:{k_(this,e);break}case D.IN_HEAD_NO_SCRIPT:{M_(this,e);break}case D.AFTER_HEAD:{F_(this,e);break}case D.IN_BODY:{Rl(this,e);break}case D.TEXT:{y2(this,e);break}case D.IN_TABLE:{Cu(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.IN_CAPTION:{k2(this,e);break}case D.IN_COLUMN_GROUP:{P2(this,e);break}case D.IN_TABLE_BODY:{vf(this,e);break}case D.IN_ROW:{Mm(this,e);break}case D.IN_CELL:{B2(this,e);break}case D.IN_SELECT:{Fm(this,e);break}case D.IN_SELECT_IN_TABLE:{U2(this,e);break}case D.IN_TEMPLATE:{q2(this,e);break}case D.AFTER_BODY:{Hm(this,e);break}case D.IN_FRAMESET:{Y2(this,e);break}case D.AFTER_FRAMESET:{W2(this,e);break}case D.AFTER_AFTER_BODY:{zo(this,e);break}}}onEof(e){switch(this.insertionMode){case D.INITIAL:{Qi(this,e);break}case D.BEFORE_HTML:{hu(this,e);break}case D.BEFORE_HEAD:{pu(this,e);break}case D.IN_HEAD:{mu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{gu(this,e);break}case D.AFTER_HEAD:{bu(this,e);break}case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{Rm(this,e);break}case D.TEXT:{N2(this,e);break}case D.IN_TABLE_TEXT:{Zi(this,e);break}case D.IN_TEMPLATE:{Um(this,e);break}case D.AFTER_BODY:case D.IN_FRAMESET:case D.AFTER_FRAMESET:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Gd(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===N.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 D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.TEXT:case D.IN_COLUMN_GROUP:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{this._insertCharacters(e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:case D.AFTER_BODY:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Cm(this,e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{yc(this,e);break}case D.IN_TABLE_TEXT:{Dm(this,e);break}}}}function __(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):xm(t,e),n}function A_(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 y_(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 u=t.activeFormattingElements.getElementEntry(i),o=u&&a>=E_;!u||o?(o&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(i)):(i=N_(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function N_(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 S_(t,e,n){const r=t.treeAdapter.getTagName(e),s=Ol(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===l.TEMPLATE&&a===oe.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function I_(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 Wd(t,e){for(let n=0;n<v_;n++){const r=__(t,e);if(!r)break;const s=A_(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=y_(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&S_(t,i,a),I_(t,s,r)}}function bf(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function C_(t,e){t._appendCommentNode(e,t.openElements.items[0])}function w_(t,e){t._appendCommentNode(e,t.document)}function Gd(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 L_(t,e){t._setDocumentType(e);const n=e.forceQuirks?sr.QUIRKS:a_(e);s_(e)||t._err(e,te.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=D.BEFORE_HTML}function Qi(t,e){t._err(e,te.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,sr.QUIRKS),t.insertionMode=D.BEFORE_HTML,t._processToken(e)}function O_(t,e){e.tagID===l.HTML?(t._insertElement(e,oe.HTML),t.insertionMode=D.BEFORE_HEAD):hu(t,e)}function x_(t,e){const n=e.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&hu(t,e)}function hu(t,e){t._insertFakeRootElement(),t.insertionMode=D.BEFORE_HEAD,t._processToken(e)}function R_(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.HEAD:{t._insertElement(e,oe.HTML),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD;break}default:pu(t,e)}}function D_(t,e){const n=e.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?pu(t,e):t._err(e,te.endTagWithoutMatchingOpenElement)}function pu(t,e){t._insertFakeElement(V.HEAD,l.HEAD),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD,t._processToken(e)}function Dr(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.TITLE:{t._switchToTextParsing(e,Hn.RCDATA);break}case l.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Hn.RAWTEXT):(t._insertElement(e,oe.HTML),t.insertionMode=D.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{t._switchToTextParsing(e,Hn.RAWTEXT);break}case l.SCRIPT:{t._switchToTextParsing(e,Hn.SCRIPT_DATA);break}case l.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=D.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(D.IN_TEMPLATE);break}case l.HEAD:{t._err(e,te.misplacedStartTagForHeadElement);break}default:mu(t,e)}}function k_(t,e){switch(e.tagID){case l.HEAD:{t.openElements.pop(),t.insertionMode=D.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{mu(t,e);break}case l.TEMPLATE:{Pa(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function Pa(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==l.TEMPLATE&&t._err(e,te.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(l.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,te.endTagWithoutMatchingOpenElement)}function mu(t,e){t.openElements.pop(),t.insertionMode=D.AFTER_HEAD,t._processToken(e)}function P_(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{Dr(t,e);break}case l.NOSCRIPT:{t._err(e,te.nestedNoscriptInHead);break}default:gu(t,e)}}function M_(t,e){switch(e.tagID){case l.NOSCRIPT:{t.openElements.pop(),t.insertionMode=D.IN_HEAD;break}case l.BR:{gu(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function gu(t,e){const n=e.type===at.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=D.IN_HEAD,t._processToken(e)}function B_(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.BODY:{t._insertElement(e,oe.HTML),t.framesetOk=!1,t.insertionMode=D.IN_BODY;break}case l.FRAMESET:{t._insertElement(e,oe.HTML),t.insertionMode=D.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{t._err(e,te.abandonedHeadElementChild),t.openElements.push(t.headElement,l.HEAD),Dr(t,e),t.openElements.remove(t.headElement);break}case l.HEAD:{t._err(e,te.misplacedStartTagForHeadElement);break}default:bu(t,e)}}function F_(t,e){switch(e.tagID){case l.BODY:case l.HTML:case l.BR:{bu(t,e);break}case l.TEMPLATE:{Pa(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function bu(t,e){t._insertFakeElement(V.BODY,l.BODY),t.insertionMode=D.IN_BODY,xl(t,e)}function xl(t,e){switch(e.type){case at.CHARACTER:{wm(t,e);break}case at.WHITESPACE_CHARACTER:{Cm(t,e);break}case at.COMMENT:{bf(t,e);break}case at.START_TAG:{yn(t,e);break}case at.END_TAG:{Rl(t,e);break}case at.EOF:{Rm(t,e);break}}}function Cm(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function wm(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function U_(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function H_(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function q_(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_FRAMESET)}function j_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML)}function $_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&gf.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,oe.HTML)}function Y_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function z_(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),n||(t.formElement=t.openElements.current))}function W_(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===l.LI&&s===l.LI||(n===l.DD||n===l.DT)&&(s===l.DD||s===l.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==l.ADDRESS&&s!==l.DIV&&s!==l.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML)}function G_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),t.tokenizer.state=Hn.PLAINTEXT}function K_(t,e){t.openElements.hasInScope(l.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.framesetOk=!1}function V_(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(V.A);n&&(Wd(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function X_(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Q_(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(l.NOBR)&&(Wd(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,oe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Z_(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function J_(t,e){t.treeAdapter.getDocumentMode(t.document)!==sr.QUIRKS&&t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,oe.HTML),t.framesetOk=!1,t.insertionMode=D.IN_TABLE}function Lm(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,oe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Om(t){const e=bm(t,_a.TYPE);return e!=null&&e.toLowerCase()===b_}function e2(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,oe.HTML),Om(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function t2(t,e){t._appendElement(e,oe.HTML),e.ackSelfClosing=!0}function n2(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._appendElement(e,oe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function r2(t,e){e.tagName=V.IMG,e.tagID=l.IMG,Lm(t,e)}function s2(t,e){t._insertElement(e,oe.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Hn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=D.TEXT}function a2(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Hn.RAWTEXT)}function i2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Hn.RAWTEXT)}function c0(t,e){t._switchToTextParsing(e,Hn.RAWTEXT)}function u2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===D.IN_TABLE||t.insertionMode===D.IN_CAPTION||t.insertionMode===D.IN_TABLE_BODY||t.insertionMode===D.IN_ROW||t.insertionMode===D.IN_CELL?D.IN_SELECT_IN_TABLE:D.IN_SELECT}function o2(t,e){t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML)}function l2(t,e){t.openElements.hasInScope(l.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,oe.HTML)}function c2(t,e){t.openElements.hasInScope(l.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(l.RTC),t._insertElement(e,oe.HTML)}function f2(t,e){t._reconstructActiveFormattingElements(),ym(e),zd(e),e.selfClosing?t._appendElement(e,oe.MATHML):t._insertElement(e,oe.MATHML),e.ackSelfClosing=!0}function d2(t,e){t._reconstructActiveFormattingElements(),Nm(e),zd(e),e.selfClosing?t._appendElement(e,oe.SVG):t._insertElement(e,oe.SVG),e.ackSelfClosing=!0}function f0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,oe.HTML)}function yn(t,e){switch(e.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{X_(t,e);break}case l.A:{V_(t,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{$_(t,e);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{j_(t,e);break}case l.LI:case l.DD:case l.DT:{W_(t,e);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{Lm(t,e);break}case l.HR:{n2(t,e);break}case l.RB:case l.RTC:{l2(t,e);break}case l.RT:case l.RP:{c2(t,e);break}case l.PRE:case l.LISTING:{Y_(t,e);break}case l.XMP:{a2(t,e);break}case l.SVG:{d2(t,e);break}case l.HTML:{U_(t,e);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{Dr(t,e);break}case l.BODY:{H_(t,e);break}case l.FORM:{z_(t,e);break}case l.NOBR:{Q_(t,e);break}case l.MATH:{f2(t,e);break}case l.TABLE:{J_(t,e);break}case l.INPUT:{e2(t,e);break}case l.PARAM:case l.TRACK:case l.SOURCE:{t2(t,e);break}case l.IMAGE:{r2(t,e);break}case l.BUTTON:{K_(t,e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{Z_(t,e);break}case l.IFRAME:{i2(t,e);break}case l.SELECT:{u2(t,e);break}case l.OPTION:case l.OPTGROUP:{o2(t,e);break}case l.NOEMBED:case l.NOFRAMES:{c0(t,e);break}case l.FRAMESET:{q_(t,e);break}case l.TEXTAREA:{s2(t,e);break}case l.NOSCRIPT:{t.options.scriptingEnabled?c0(t,e):f0(t,e);break}case l.PLAINTEXT:{G_(t,e);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:f0(t,e)}}function h2(t,e){if(t.openElements.hasInScope(l.BODY)&&(t.insertionMode=D.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function p2(t,e){t.openElements.hasInScope(l.BODY)&&(t.insertionMode=D.AFTER_BODY,Hm(t,e))}function m2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function g2(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(l.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(l.FORM):n&&t.openElements.remove(n))}function b2(t){t.openElements.hasInButtonScope(l.P)||t._insertFakeElement(V.P,l.P),t._closePElement()}function v2(t){t.openElements.hasInListItemScope(l.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(l.LI),t.openElements.popUntilTagNamePopped(l.LI))}function E2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function T2(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function _2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function A2(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(V.BR,l.BR),t.openElements.pop(),t.framesetOk=!1}function xm(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!==l.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 Rl(t,e){switch(e.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{Wd(t,e);break}case l.P:{b2(t);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{m2(t,e);break}case l.LI:{v2(t);break}case l.DD:case l.DT:{E2(t,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{T2(t);break}case l.BR:{A2(t);break}case l.BODY:{h2(t,e);break}case l.HTML:{p2(t,e);break}case l.FORM:{g2(t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{_2(t,e);break}case l.TEMPLATE:{Pa(t,e);break}default:xm(t,e)}}function Rm(t,e){t.tmplInsertionModeStack.length>0?Um(t,e):Gd(t,e)}function y2(t,e){var n;e.tagID===l.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function N2(t,e){t._err(e,te.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function yc(t,e){if(t.openElements.currentTagId!==void 0&&Sm.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=D.IN_TABLE_TEXT,e.type){case at.CHARACTER:{km(t,e);break}case at.WHITESPACE_CHARACTER:{Dm(t,e);break}}else eo(t,e)}function S2(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_CAPTION}function I2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_COLUMN_GROUP}function C2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(V.COLGROUP,l.COLGROUP),t.insertionMode=D.IN_COLUMN_GROUP,Kd(t,e)}function w2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_TABLE_BODY}function L2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(V.TBODY,l.TBODY),t.insertionMode=D.IN_TABLE_BODY,Dl(t,e)}function O2(t,e){t.openElements.hasInTableScope(l.TABLE)&&(t.openElements.popUntilTagNamePopped(l.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function x2(t,e){Om(e)?t._appendElement(e,oe.HTML):eo(t,e),e.ackSelfClosing=!0}function R2(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,oe.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function wi(t,e){switch(e.tagID){case l.TD:case l.TH:case l.TR:{L2(t,e);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{Dr(t,e);break}case l.COL:{C2(t,e);break}case l.FORM:{R2(t,e);break}case l.TABLE:{O2(t,e);break}case l.TBODY:case l.TFOOT:case l.THEAD:{w2(t,e);break}case l.INPUT:{x2(t,e);break}case l.CAPTION:{S2(t,e);break}case l.COLGROUP:{I2(t,e);break}default:eo(t,e)}}function Cu(t,e){switch(e.tagID){case l.TABLE:{t.openElements.hasInTableScope(l.TABLE)&&(t.openElements.popUntilTagNamePopped(l.TABLE),t._resetInsertionMode());break}case l.TEMPLATE:{Pa(t,e);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:eo(t,e)}}function eo(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,xl(t,e),t.fosterParentingEnabled=n}function Dm(t,e){t.pendingCharacterTokens.push(e)}function km(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Zi(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)eo(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Pm=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function D2(t,e){const n=e.tagID;Pm.has(n)?t.openElements.hasInTableScope(l.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_TABLE,wi(t,e)):yn(t,e)}function k2(t,e){const n=e.tagID;switch(n){case l.CAPTION:case l.TABLE:{t.openElements.hasInTableScope(l.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_TABLE,n===l.TABLE&&Cu(t,e));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Rl(t,e)}}function Kd(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.COL:{t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.TEMPLATE:{Dr(t,e);break}default:ul(t,e)}}function P2(t,e){switch(e.tagID){case l.COLGROUP:{t.openElements.currentTagId===l.COLGROUP&&(t.openElements.pop(),t.insertionMode=D.IN_TABLE);break}case l.TEMPLATE:{Pa(t,e);break}case l.COL:break;default:ul(t,e)}}function ul(t,e){t.openElements.currentTagId===l.COLGROUP&&(t.openElements.pop(),t.insertionMode=D.IN_TABLE,t._processToken(e))}function Dl(t,e){switch(e.tagID){case l.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_ROW;break}case l.TH:case l.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(V.TR,l.TR),t.insertionMode=D.IN_ROW,kl(t,e);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE,wi(t,e));break}default:wi(t,e)}}function vf(t,e){const n=e.tagID;switch(e.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE);break}case l.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE,Cu(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:Cu(t,e)}}function kl(t,e){switch(e.tagID){case l.TH:case l.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,oe.HTML),t.insertionMode=D.IN_CELL,t.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,Dl(t,e));break}default:wi(t,e)}}function Mm(t,e){switch(e.tagID){case l.TR:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY);break}case l.TABLE:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,vf(t,e));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(l.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,vf(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:Cu(t,e)}}function M2(t,e){const n=e.tagID;Pm.has(n)?(t.openElements.hasInTableScope(l.TD)||t.openElements.hasInTableScope(l.TH))&&(t._closeTableCell(),kl(t,e)):yn(t,e)}function B2(t,e){const n=e.tagID;switch(n){case l.TD:case l.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Mm(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:Rl(t,e)}}function Bm(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.OPTION:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t._insertElement(e,oe.HTML);break}case l.OPTGROUP:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop(),t._insertElement(e,oe.HTML);break}case l.HR:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop(),t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{t.openElements.hasInSelectScope(l.SELECT)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),e.tagID!==l.SELECT&&t._processStartTag(e));break}case l.SCRIPT:case l.TEMPLATE:{Dr(t,e);break}}}function Fm(t,e){switch(e.tagID){case l.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===l.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===l.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop();break}case l.OPTION:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop();break}case l.SELECT:{t.openElements.hasInSelectScope(l.SELECT)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode());break}case l.TEMPLATE:{Pa(t,e);break}}}function F2(t,e){const n=e.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Bm(t,e)}function U2(t,e){const n=e.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Fm(t,e)}function H2(t,e){switch(e.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{Dr(t,e);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{t.tmplInsertionModeStack[0]=D.IN_TABLE,t.insertionMode=D.IN_TABLE,wi(t,e);break}case l.COL:{t.tmplInsertionModeStack[0]=D.IN_COLUMN_GROUP,t.insertionMode=D.IN_COLUMN_GROUP,Kd(t,e);break}case l.TR:{t.tmplInsertionModeStack[0]=D.IN_TABLE_BODY,t.insertionMode=D.IN_TABLE_BODY,Dl(t,e);break}case l.TD:case l.TH:{t.tmplInsertionModeStack[0]=D.IN_ROW,t.insertionMode=D.IN_ROW,kl(t,e);break}default:t.tmplInsertionModeStack[0]=D.IN_BODY,t.insertionMode=D.IN_BODY,yn(t,e)}}function q2(t,e){e.tagID===l.TEMPLATE&&Pa(t,e)}function Um(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(l.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Gd(t,e)}function j2(t,e){e.tagID===l.HTML?yn(t,e):ol(t,e)}function Hm(t,e){var n;if(e.tagID===l.HTML){if(t.fragmentContext||(t.insertionMode=D.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===l.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 ol(t,e)}function ol(t,e){t.insertionMode=D.IN_BODY,xl(t,e)}function $2(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.FRAMESET:{t._insertElement(e,oe.HTML);break}case l.FRAME:{t._appendElement(e,oe.HTML),e.ackSelfClosing=!0;break}case l.NOFRAMES:{Dr(t,e);break}}}function Y2(t,e){e.tagID===l.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==l.FRAMESET&&(t.insertionMode=D.AFTER_FRAMESET))}function z2(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.NOFRAMES:{Dr(t,e);break}}}function W2(t,e){e.tagID===l.HTML&&(t.insertionMode=D.AFTER_AFTER_FRAMESET)}function G2(t,e){e.tagID===l.HTML?yn(t,e):zo(t,e)}function zo(t,e){t.insertionMode=D.IN_BODY,xl(t,e)}function K2(t,e){switch(e.tagID){case l.HTML:{yn(t,e);break}case l.NOFRAMES:{Dr(t,e);break}}}function V2(t,e){e.chars=Lt,t._insertCharacters(e)}function X2(t,e){t._insertCharacters(e),t.framesetOk=!1}function qm(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==oe.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function Q2(t,e){if(d_(e))qm(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===oe.MATHML?ym(e):r===oe.SVG&&(h_(e),Nm(e)),zd(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function Z2(t,e){if(e.tagID===l.P||e.tagID===l.BR){qm(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)===oe.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 jm(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 J2=jm(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),eA=jm(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),tA=new Set([V.AREA,V.BASE,V.BASEFONT,V.BGSOUND,V.BR,V.COL,V.EMBED,V.FRAME,V.HR,V.IMG,V.INPUT,V.KEYGEN,V.LINK,V.META,V.PARAM,V.SOURCE,V.TRACK,V.WBR]);function $m(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===oe.HTML&&tA.has(e.treeAdapter.getTagName(t))}const nA={treeAdapter:os,scriptingEnabled:!0};function rA(t,e){const n={...nA,...e};return $m(t,n)?"":Ym(t,n)}function Ym(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===V.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===oe.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=sA(a,e);return n}function sA(t,e){return e.treeAdapter.isElementNode(t)?aA(t,e):e.treeAdapter.isTextNode(t)?uA(t,e):e.treeAdapter.isCommentNode(t)?oA(t,e):e.treeAdapter.isDocumentTypeNode(t)?lA(t,e):""}function aA(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${iA(t,e)}>${$m(t,e)?"":`${Ym(t,e)}</${n}>`}`}function iA(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case oe.XML:{n+=`xml:${r.name}`;break}case oe.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case oe.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${J2(r.value)}"`}return n}function uA(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)===oe.HTML&&HT(a,e.scriptingEnabled)?r:eA(r)}function oA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function lA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function cA(t,e){return Im.parse(t,e)}function Vd(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Im.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Gn(t){return"tagName"in t}function Jr(t){return t.nodeName==="#text"}function St(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function qs(t,e){return t.attrs.some(n=>n.name===e)}function d0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function Xd(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function js(t){return Vd(t).childNodes}function fA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function Li(t){return fA(t)?cA(t).childNodes:Vd(t).childNodes}function dA(t){const e=Vd("");return e.childNodes=t,rA(e)}const hA=[400,800,1200,1600],pA={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function mA(t){return t==="jpeg"?"jpg":t}function gA(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function bA(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)}async function vA(t,e,n){var T;const r=gA(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:hA,formats:s}),i=bA(t),u=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),o=[],f=v=>{const O=`${u}.${i}-${v.width}.${mA(v.format)}`;return o.push({path:O,contents:v.bytes}),`/${O}`},h=new Map;for(const v of[...a.variants].sort((O,L)=>O.width-L.width)){const O=f(v),L=h.get(v.format)??[];L.push({url:O,width:v.width}),h.set(v.format,L)}const g=v=>(h.get(v)??[]).map(O=>`${O.url} ${O.width}w`).join(", "),d=["avif","webp"].filter(v=>h.has(v)).map(v=>({format:v,mime:pA[v],srcset:g(v)})),m=h.get(r)??[],b=((T=m[m.length-1])==null?void 0:T.url)??`/${e}`,_={width:a.sourceWidth,height:a.sourceHeight,sources:d,fallbackSrc:b,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:o,info:_}}function zm(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${_c(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${_c(i)}"`).join(""),s=`<img src="${_c(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const h0="ref:";function Pl(t){return t.startsWith(h0)?t.slice(h0.length):void 0}function p0(t){const e=new Set,n=r=>{for(const s of r)if(Gn(s)){for(const a of s.attrs){const i=Pl(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(Li(t)),[...e].sort()}const EA=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],TA=["data-type","data-field","data-required","data-help","data-label"];function Ef(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=wu(Li(t.template),t.scope,e),r=t.document===void 0?n:Vm(wu(Li(t.document),t.scope,e),n);return _A(r,t,e),dA(r)}function _A(t,e,n){var i,u,o,f;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const h=js(`<style>
4
4
  ${r}
5
5
  </style>`),g=Tf(t,"head");g?g.childNodes.push(...h):t.unshift(...h)}const s=[],a=(u=e.templateScript)==null?void 0:u.trim();a&&s.push(a);for(const h of[...n.usedComponents].sort()){const g=(f=(o=e.componentScripts)==null?void 0:o.get(h))==null?void 0:f.trim();g&&s.push(g)}if(s.length>0){const h=s.flatMap(d=>js(`<script>
6
6
  ${d}
7
- <\/script>`)),g=Tf(t,"body");g?g.childNodes.push(...h):t.push(...h)}}function Tf(t,e){for(const n of t){if(!Gn(n))continue;if(n.tagName===e)return n;const r=Tf(n.childNodes,e);if(r!==void 0)return r}}function m0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function _f(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function Ml(t){return e=>{const n=t[e.name];if(m0(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return m0(r)?r.url:_f(r)}return e.dotted?"":_f(n)}}function wu(t,e,n){const r=[];for(const s of t)Gn(s)?r.push(...zm(s,e,n)):(Jr(s)&&(s.value=Ll(s.value,Ml(e))),r.push(s));return r}function zm(t,e,n){if(qs(t,"data-each-in")||qs(t,"data-each"))return bA(t,e,n);if(n.components.has(t.tagName))return _A(t,e,n);vA(t,e,n);const r=St(t,"data-type");for(const a of mA)Xd(t,a);if(t.tagName==="img"&&n.media!==void 0){const a=n.media.image(St(t,"src")??"");if(a!==void 0){const i=t.attrs.map(u=>[u.name,u.value]);return js(Ym(a,i))}}if(TA(t))return b0(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return b0(t,e,"raw"),[t];const s=EA(t,r);if((s==null?void 0:s.kind)==="html"){const a=js(_f(e[s.token.name]));return t.childNodes=Wm(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=js(bT(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=wu(t.childNodes,e,n),[t])}function Wm(t,e){var r;const n=[];for(const s of t){if(!Gn(s)){n.push(s);continue}if(s.childNodes=Wm(s.childNodes,e),s.tagName==="img"){const i=St(s,"src"),u=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(u!==void 0){const o=s.attrs.map(f=>[f.name,f.value]);n.push(...js(Ym(u,o)));continue}i!==void 0&&d0(s,"src",g0(i,e))}const a=St(s,"href");a!==void 0&&d0(s,"href",g0(a,e)),n.push(s)}return n}function g0(t,e){var r;const n=Af(t,e);return al(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Af(t,e){var r,s;const n=Pl(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function bA(t,e,n){if(n.context===void 0)return[];const r=St(t,"data-each-in");let s;if(r!==void 0){const i=St(t,"data-limit"),u=i!==void 0?Number.parseInt(i,10):void 0,o=St(t,"data-sort");s=n.context.collection(r,{...o!==void 0&&{sort:o},...u!==void 0&&!Number.isNaN(u)&&{limit:u}})}else{const i=St(t,"data-each")??"",u=e[i];s=(Array.isArray(u)?u.filter(f=>typeof f=="string"):typeof u=="string"?[u]:[]).map(f=>{var h;return(h=n.context)==null?void 0:h.reference(f)}).filter(f=>f!==void 0)}const a=[];for(const i of s){const u=Gm(t);for(const o of pA)Xd(u,o);a.push(...zm(u,{...e,item:i},n))}return a}function Gm(t){if(Gn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(Gm),e}return{...t}}function vA(t,e,n){var r;for(const s of t.attrs){if(zs(s.value).length===0){const g=Af(s.value,n);g!==void 0&&(s.value=al(g));continue}const a=St(t,"data-type"),i=Ci(s.value)!==null,u=Ii({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:Yd(s.value),download:qs(t,"download"),...a!==void 0&&{annotation:a}});let o=Ll(s.value,Ml(e));const f=Af(o,n);f!==void 0&&(o=f);const h=(r=n.media)==null?void 0:r.file(o);h!==void 0&&(o=h),i&&$d(u)==="url"&&(o=al(o)),s.value=o}}function b0(t,e,n){const r=Ml(e);for(const s of t.childNodes)Jr(s)&&(s.value=Ll(s.value,a=>{const i=r(a);return n==="json"?pT(i):i}))}function EA(t,e){const n=t.childNodes.filter(i=>!(Jr(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!Jr(r))return null;const s=Ci(r.value);if(s===null||s.dotted)return null;const a=Ii({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:$d(a)}}function TA(t){var e;return t.tagName==="script"&&((e=St(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function _A(t,e,n){var h,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=Ml(e),a={};for(const d of t.attrs)a[d.name]=Ll(d.value,s);const i=wu(t.childNodes,e,n),u=wu(Li(r),a,n),o=Km(u,i);n.usedComponents.add(t.tagName);const f=(g=(h=n.componentStyles)==null?void 0:h.get(t.tagName))==null?void 0:g.trim();if(f){const d=o.find(Gn);if(d!==void 0){const m=js(`<style>@scope {
7
+ <\/script>`)),g=Tf(t,"body");g?g.childNodes.push(...h):t.push(...h)}}function Tf(t,e){for(const n of t){if(!Gn(n))continue;if(n.tagName===e)return n;const r=Tf(n.childNodes,e);if(r!==void 0)return r}}function m0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function _f(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function Ml(t){return e=>{const n=t[e.name];if(m0(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return m0(r)?r.url:_f(r)}return e.dotted?"":_f(n)}}function wu(t,e,n){const r=[];for(const s of t)Gn(s)?r.push(...Wm(s,e,n)):(Jr(s)&&(s.value=Ll(s.value,Ml(e))),r.push(s));return r}function Wm(t,e,n){if(qs(t,"data-each-in")||qs(t,"data-each"))return AA(t,e,n);if(n.components.has(t.tagName))return IA(t,e,n);yA(t,e,n);const r=St(t,"data-type");for(const a of TA)Xd(t,a);if(t.tagName==="img"&&n.media!==void 0){const a=n.media.image(St(t,"src")??"");if(a!==void 0){const i=t.attrs.map(u=>[u.name,u.value]);return js(zm(a,i))}}if(SA(t))return b0(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return b0(t,e,"raw"),[t];const s=NA(t,r);if((s==null?void 0:s.kind)==="html"){const a=js(_f(e[s.token.name]));return t.childNodes=Gm(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=js(AT(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=wu(t.childNodes,e,n),[t])}function Gm(t,e){var r;const n=[];for(const s of t){if(!Gn(s)){n.push(s);continue}if(s.childNodes=Gm(s.childNodes,e),s.tagName==="img"){const i=St(s,"src"),u=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(u!==void 0){const o=s.attrs.map(f=>[f.name,f.value]);n.push(...js(zm(u,o)));continue}i!==void 0&&d0(s,"src",g0(i,e))}const a=St(s,"href");a!==void 0&&d0(s,"href",g0(a,e)),n.push(s)}return n}function g0(t,e){var r;const n=Af(t,e);return al(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Af(t,e){var r,s;const n=Pl(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function AA(t,e,n){if(n.context===void 0)return[];const r=St(t,"data-each-in");let s;if(r!==void 0){const i=St(t,"data-limit"),u=i!==void 0?Number.parseInt(i,10):void 0,o=St(t,"data-sort");s=n.context.collection(r,{...o!==void 0&&{sort:o},...u!==void 0&&!Number.isNaN(u)&&{limit:u}})}else{const i=St(t,"data-each")??"",u=e[i];s=(Array.isArray(u)?u.filter(f=>typeof f=="string"):typeof u=="string"?[u]:[]).map(f=>{var h;return(h=n.context)==null?void 0:h.reference(f)}).filter(f=>f!==void 0)}const a=[];for(const i of s){const u=Km(t);for(const o of EA)Xd(u,o);a.push(...Wm(u,{...e,item:i},n))}return a}function Km(t){if(Gn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(Km),e}return{...t}}function yA(t,e,n){var r;for(const s of t.attrs){if(zs(s.value).length===0){const g=Af(s.value,n);g!==void 0&&(s.value=al(g));continue}const a=St(t,"data-type"),i=Ci(s.value)!==null,u=Ii({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:Yd(s.value),download:qs(t,"download"),...a!==void 0&&{annotation:a}});let o=Ll(s.value,Ml(e));const f=Af(o,n);f!==void 0&&(o=f);const h=(r=n.media)==null?void 0:r.file(o);h!==void 0&&(o=h),i&&$d(u)==="url"&&(o=al(o)),s.value=o}}function b0(t,e,n){const r=Ml(e);for(const s of t.childNodes)Jr(s)&&(s.value=Ll(s.value,a=>{const i=r(a);return n==="json"?ET(i):i}))}function NA(t,e){const n=t.childNodes.filter(i=>!(Jr(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!Jr(r))return null;const s=Ci(r.value);if(s===null||s.dotted)return null;const a=Ii({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:$d(a)}}function SA(t){var e;return t.tagName==="script"&&((e=St(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function IA(t,e,n){var h,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=Ml(e),a={};for(const d of t.attrs)a[d.name]=Ll(d.value,s);const i=wu(t.childNodes,e,n),u=wu(Li(r),a,n),o=Vm(u,i);n.usedComponents.add(t.tagName);const f=(g=(h=n.componentStyles)==null?void 0:h.get(t.tagName))==null?void 0:g.trim();if(f){const d=o.find(Gn);if(d!==void 0){const m=js(`<style>@scope {
8
8
  ${f}
9
- }</style>`);d.childNodes=[...m,...d.childNodes]}}return o}function Km(t,e){const n=new Map,r=[];for(const s of e){const a=Gn(s)?St(s,"slot"):void 0;if(a!==void 0){Gn(s)&&Xd(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return yf(t,n,r)}function yf(t,e,n){const r=[];for(const s of t)if(Gn(s)&&s.tagName==="slot"){const a=St(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...yf(s.childNodes,e,n))}else Gn(s)&&(s.childNodes=yf(s.childNodes,e,n)),r.push(s);return r}async function AA(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 u=a++;r[u]=await n(t[u],u)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Vm(t){const e=v0(St(t,"data-minlength")),n=v0(St(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function v0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function Oi(t,e=new Map){return Qm(t,e,new Set)}function Xm(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=Qm(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function Qm(t,e,n){const r=[],s=new Map,a=f=>{const h=s.get(f);if(h!==void 0)return h;const g={name:f,type:"shorttext",label:Pd(f),required:!1,multiline:!1};return s.set(f,g),r.push(f),g},i=(f,h)=>{if(s.has(f))return;const g=a(f);g.type=h,g.multiline=jd[h].multiline},u=f=>{const h=St(f,"data-field")??yA(f);if(h===void 0)return;const g=a(h);qs(f,"data-required")&&(g.required=!0);const d=St(f,"data-help");d!==void 0&&(g.help=d);const m=St(f,"data-label");m!==void 0&&(g.label=m);const{minLength:b,maxLength:_}=Vm(f);b!==void 0&&(g.minLength=b),_!==void 0&&(g.maxLength=_)},o=f=>{for(const h of f){if(!Gn(h)){if(Jr(h))continue;continue}const g=St(h,"data-each");if(g!==void 0){const b=a(g);b.type="url",b.multiple=!0;const _=St(h,"data-pick-from");_!==void 0&&(b.pickFrom=_),u(h);continue}if(qs(h,"data-each-in"))continue;const d=St(h,"data-type"),m=e.has(h.tagName)?Xm(h.tagName,e,n):void 0;for(const b of h.attrs){const _=Ci(b.value);for(const T of zs(b.value)){if(T.dotted)continue;const v=(_==null?void 0:_.name)===T.name,O=v?m==null?void 0:m.get(b.name):void 0;i(T.name,O??Ii({tag:h.tagName,attribute:b.name,wholeValue:v,valuePrefix:Yd(b.value),download:qs(h,"download"),...d!==void 0&&{annotation:d}}))}}for(const b of h.childNodes){if(!Jr(b))continue;const _=Ci(b.value);for(const T of zs(b.value))T.dotted||i(T.name,Ii({tag:h.tagName,wholeValue:(_==null?void 0:_.name)===T.name,...d!==void 0&&{annotation:d}}))}u(h),o(h.childNodes)}};return o(Li(t)),r.map(f=>NA(s.get(f)))}function yA(t){for(const e of t.attrs){const n=zs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(Jr(e)){const n=zs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function NA(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 Nf(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,u=new Set,o=new Map,f=new Set,h=g=>{for(const d of g){if(!Gn(d))continue;const m=SA(d);m!==void 0&&u.add(m);const b=St(d,"data-each-in");b!==void 0&&r.push(b);const _=St(d,"data-each");if(_!==void 0&&s.push(_),qs(d,"data-required")){const L=E0(d);L!==void 0&&n.add(L)}const T=Vm(d);if(T.minLength!==void 0||T.maxLength!==void 0){const L=E0(d);L!==void 0&&o.set(L,T)}const v=St(d,"data-type"),O=e.has(d.tagName)?Xm(d.tagName,e,new Set):void 0;for(const L of d.attrs){const B=Pl(L.value);B!==void 0&&f.add(B);const C=Ci(L.value);if(C===null||C.dotted)continue;const q=(O==null?void 0:O.get(L.name))??Ii({tag:d.tagName,attribute:L.name,wholeValue:!0,valuePrefix:Yd(L.value),download:qs(d,"download"),...v!==void 0&&{annotation:v}});q==="image"?a.add(C.name):q==="file"?i.add(C.name):q==="richtext"&&u.add(C.name)}h(d.childNodes)}};return h(Li(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...u],constraints:o,references:[...f].sort()}}function SA(t){const e=t.childNodes.filter(i=>!(Jr(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!Jr(n))return;const r=Ci(n.value);if(r===null||r.dotted)return;const s=St(t,"data-type"),a=Ii({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return $d(a)==="html"?r.name:void 0}function E0(t){const e=St(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=zs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(Jr(n)){const r=zs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function IA(t){return t.split("/").filter(e=>e!=="")}function Tr(t){const e=IA(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const CA=4;async function wA(t,e,n={}){const[r,s,a,i]=await Promise.all([Md(t),Bd(t),fm(t),dm(t)]),u=Zm(r,e,void 0);if(u===void 0)return;const o=n.draft??u.node.item,f=o.template??u.dirTemplate;if(f===void 0)return;const[h,g,d,m]=await Promise.all([Ud(t,f),iT(t,f),uT(t,f),Hd(t)]),b=Nf(h,s),_={...u.node,item:o};let T,v=[];if(n.media!==void 0)T=n.media;else{const L=await LA(t,_,b,n.imageEncoder,CA);T=L.media,v=L.mediaArtifacts}return{html:Ef({template:h,scope:Qd(o),components:s,context:Jm(r),media:T,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...m!==void 0&&{document:m},...g!==void 0&&{templateStyle:g},...d!==void 0&&{templateScript:d}}),mediaArtifacts:v}}function Zm(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=Zm(s,e,r);if(a!==void 0)return a}}async function LA(t,e,n,r,s){const a=OA(e.path),i=e.item.fields,u=new Map,o=new Map,f=[];for(const h of n.fileFields)for(const g of A0(i[h])){const d=_0(a,g),m=await T0(t,`content/${d}`);m!==void 0&&(f.push({path:d,contents:m}),o.set(g,`/${d}`))}if(r!==void 0){const h=new Set;for(const d of n.imageFields)for(const m of A0(i[d]))h.add(m);for(const d of n.richTextFields){const m=i[d];if(typeof m=="string")for(const b of xA(m))h.add(b)}const g=await AA([...h],s,async d=>{const m=_0(a,d),b=await T0(t,`content/${m}`);if(b!==void 0)return{ref:d,...await hA(b,m,r)}});for(const d of g)d!==void 0&&(f.push(...d.artifacts),u.set(d.ref,d.info))}return{media:{image:h=>u.get(h),file:h=>o.get(h)},mediaArtifacts:f}}async function T0(t,e){try{return await t.readBytes(e)}catch{return}}function OA(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function _0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function xA(t){const e=[],n=r=>{for(const s of r)if(Gn(s)){if(s.tagName==="img"){const a=St(s,"src");a!==void 0&&RA(a)&&e.push(a)}n(s.childNodes)}};return n(js(t)),e}function RA(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function A0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Qd(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 DA(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 y0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function Jm(t){const{items:e,dirs:n}=DA(t),r=s=>({url:Tr(s.path),fields:Qd(s.item)});return{collection(s,a){var d;const i=n.get(y0(s));if(i===void 0)return[];const u=((d=i.collection)==null?void 0:d.recursive)??!1,o=[],f=m=>{for(const b of m.children)b.kind==="item"?b.slug!=="index"&&b.item.isPublished&&o.push(b):u&&f(b)};f(i);const h=kA(o,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(y0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function kA(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const u=Qd(i.item)[n];return u==null?"":String(u)},a=[...t].sort((i,u)=>s(i).localeCompare(s(u)));return r==="desc"?a.reverse():a}async function PA(t){const[e,n,r]=await Promise.all([Md(t),Bd(t),Hd(t)]),{items:s,dirs:a,published:i}=MA(e);let u=null;if(r!==void 0)try{u=Nf(r,n)}catch{u=null}const o=(u==null?void 0:u.requiredFields)??[],f=(u==null?void 0:u.constraints)??new Map,h=[],g=(C,q,x,j)=>{h.push({severity:C,code:q,message:x,...j!==void 0&&{path:j}})},d=(C,q,x)=>{const j=s.get(S0(C));j===void 0?g("error","reference-missing",`"${q}" references "${C}" (${x}), which does not exist.`,q):j.item.isPublished||g("error","reference-unpublished",`"${q}" references "${C}" (${x}), which is not published.`,q)},m=(C,q,x)=>{for(const[j,{minLength:Z,maxLength:Y}]of C){const E=q[j];if(typeof E!="string"||E==="")continue;const{length:k}=E;Z!==void 0&&k<Z&&g("warning","value-too-short",`"${x}" field "${j}" is ${k} characters; the minimum is ${Z}.`,x),Y!==void 0&&k>Y&&g("warning","value-too-long",`"${x}" field "${j}" is ${k} characters; the maximum is ${Y}.`,x)}},b=new Map,_=async C=>{const q=b.get(C);if(q!==void 0||b.has(C))return q??null;let x;try{x=Nf(await Ud(t,C),n)}catch{x=null}return b.set(C,x),x},T=new Map;for(const{node:C,templateName:q}of i){const x=T.get(Tr(C.path))??[];if(x.push(C.path),T.set(Tr(C.path),x),q===void 0){g("error","no-template",`"${C.path}" has no template (no per-item or folder default).`,C.path);continue}const j=await _(q);if(j===null){g("error","template-missing",`"${C.path}" uses template "${q}", which does not exist.`,C.path);continue}const Z=BA(C.item);for(const Y of j.requiredFields)N0(Z[Y])&&g("error","required-empty",`"${C.path}" is missing required field "${Y}".`,C.path);for(const Y of o)N0(Z[Y])&&g("error","required-empty",`"${C.path}" is missing required meta field "${Y}" (document shell).`,C.path);m(j.constraints,Z,C.path),m(f,Z,C.path);for(const Y of j.queryLoopPaths)a.has(S0(Y))||g("error","loop-target-missing",`"${C.path}" loops over "${Y}", which is not a directory.`,C.path);for(const Y of j.curatedLoopFields)for(const E of FA(C.item.fields[Y]))d(E,C.path,`field "${Y}"`);for(const[Y,E]of Object.entries(Z)){if(typeof E!="string")continue;const k=Pl(E);if(k!==void 0&&d(k,C.path,`field "${Y}"`),j.richTextFields.includes(Y))for(const S of p0(E))d(S,C.path,`field "${Y}"`)}}const v=Je.templates;if(u!==null)for(const C of u.references)d(C,`${v}/${Ju}.html`,"link");for(const[C,q]of b)if(q!==null)for(const x of q.references)d(x,`${v}/${C}.html`,"link");for(const[C,q]of n)for(const x of p0(q))d(x,`${Je.components}/${C}.html`,"link");for(const[C,q]of T)q.length>1&&g("error","url-collision",`URL ${C} is produced by multiple items: ${q.join(", ")}.`);const O=new Map;for(const C of await UA(t)){const x=C.slice(C.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),j=O.get(x)??[];j.push(`${Je.components}/${C}`),O.set(x,j)}for(const[C,q]of[...O].sort(([x],[j])=>x.localeCompare(j)))q.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${C}>: ${q.join(", ")}.`);const L=h.filter(C=>C.severity==="error"),B=h.filter(C=>C.severity==="warning");return{diagnostics:h,errors:L,warnings:B,ok:L.length===0}}function MA(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const u=a.defaultTemplate??i;for(const o of a.children){if(o.kind==="dir"){s(o,u);continue}e.set(o.path,o),o.item.isPublished&&r.push({node:o,templateName:o.item.template??u})}};return s(t,void 0),{items:e,dirs:n,published:r}}function BA(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 N0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function FA(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function S0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function UA(t){const e=Je.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const u=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,u):i.name.endsWith(".html")&&n.push(u)}};return await r(e,""),n.sort()}function Nc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let eg="";function Aa(t){return`${eg}${t}`}function HA(t){eg=t.replace(/\/+$/,"")}async function qA(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&HA(e.apiUrl)}catch{}}async function mt(t,e={}){const n=typeof t=="string"?Aa(t):t,r=await I0(n,e,ot.token);if(r.status!==401||ot.token===null)return r;const s=await ot.refresh();return s===null?r:I0(n,e,s)}async function I0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function Ma(t,e){const n=await mt(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const No="nanoesis.jwt",jA=540*1e3;function $A(){let t=ee("loading"),e=ee(null),n=ee(null),r=ee(!1),s=null;function a(v,O){y(e,v,!0),y(n,O,!0),y(t,"authenticated"),localStorage.setItem(No,v),u()}function i(){y(e,null),y(n,null),y(t,"unauthenticated"),localStorage.removeItem(No),o()}function u(){o(),s=setInterval(()=>{f()},jA)}function o(){s!==null&&(clearInterval(s),s=null)}async function f(){if(c(e)===null)return null;const v=c(e),O=await fetch(Aa("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${v}`}});if(!O.ok)return i(),null;const L=await O.json().catch(()=>({}));return!L.ok||L.token===void 0||L.principal===void 0?(i(),null):(a(L.token,L.principal),L.token)}async function h(){y(t,"loading");let v;try{v=await fetch(Aa("/api/auth/state"))}catch{y(t,"no-auth");return}if(v.status===404){y(t,"no-auth");return}if(!v.ok){y(t,"unauthenticated");return}const O=await v.json();y(r,O.firstRun,!0);const L=localStorage.getItem(No);L!==null&&L!==""&&(y(e,L,!0),await f()!==null)||y(t,"unauthenticated")}async function g(v,O){const L=await fetch(Aa("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:v,password:O})}),B=await L.json().catch(()=>({}));return!L.ok||!B.ok||B.token===void 0||B.principal===void 0?{ok:!1,error:B.error??`HTTP ${L.status}`}:(y(r,!1),a(B.token,B.principal),{ok:!0})}async function d(){if(c(e)!==null)try{await mt("/api/logout",{method:"POST"})}catch{}i()}async function m(v,O){const L=await mt("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:v,newPassword:O})}),B=await L.json().catch(()=>({}));return!L.ok||!B.ok||B.token===void 0?{ok:!1,error:B.error??`HTTP ${L.status}`}:(y(e,B.token,!0),localStorage.setItem(No,B.token),{ok:!0})}async function b(){const v=await mt("/api/me/token",{method:"POST"}),O=await v.json().catch(()=>({}));return!v.ok||O.ok!==!0||O.token===void 0?{ok:!1,error:O.error??`HTTP ${v.status}`}:{ok:!0,token:O.token,...O.expiresAt!==void 0&&{expiresAt:O.expiresAt}}}async function _(){const v=await mt("/api/me/token",{method:"DELETE"});return v.ok?{ok:!0}:{ok:!1,error:(await v.json().catch(()=>({}))).error??`HTTP ${v.status}`}}function T(){return c(t)==="no-auth"}return{get status(){return c(t)},get token(){return c(e)},get principal(){return c(n)},get firstRun(){return c(r)},get canAuthor(){return T()||Nc(c(n),"author")},get canDevelop(){return T()||Nc(c(n),"developer")},get isAdmin(){return T()||Nc(c(n),"admin")},init:h,login:g,logout:d,refresh:f,changePassword:m,createMcpToken:b,revokeMcpTokens:_}}const ot=$A(),C0={name:null,logoUrl:null};async function YA(){try{const t=await fetch(Aa("/api/branding"));if(!t.ok)return C0;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:Aa(e.logoUrl)}}catch{return C0}}function zA(t){return Ma("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function WA(t){return Ma("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function GA(){return Ma("/api/branding/logo",{method:"DELETE"})}function KA(){let t=ee(null),e=ee(null);async function n(){const r=await YA();y(t,r.name,!0),y(e,r.logoUrl,!0)}return{get name(){return c(t)},get logoUrl(){return c(e)},load:n}}const wn=KA(),VA="modulepreload",XA=function(t,e){return new URL(t,e).href},w0={},QA=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(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const u=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),f=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=i(n.map(h=>{if(h=XA(h,r),h in w0)return;w0[h]=!0;const g=h.endsWith(".css"),d=g?'[rel="stylesheet"]':"";if(!!r)for(let _=u.length-1;_>=0;_--){const T=u[_];if(T.href===h&&(!g||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${d}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":VA,g||(b.as="script"),b.crossOrigin="",b.href=h,f&&b.setAttribute("nonce",f),document.head.appendChild(b),g)return new Promise((_,T)=>{b.addEventListener("load",_),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=i,window.dispatchEvent(u),!u.defaultPrevented)throw i}return s.then(i=>{for(const u of i||[])u.status==="rejected"&&a(u.reason);return e().catch(a)})};function Ks(t){return Array.isArray?Array.isArray(t):ng(t)==="[object Array]"}function ZA(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 Sf(t){return t==null?"":ZA(t)}function Ln(t){return typeof t=="string"}function Wo(t){return typeof t=="number"}function JA(t){return t===!0||t===!1||e3(t)&&ng(t)=="[object Boolean]"}function tg(t){return typeof t=="object"}function e3(t){return tg(t)&&t!==null}function Un(t){return t!=null}function So(t){return!t.trim().length}function ng(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const t3="Incorrect 'index' type",n3=t=>`Invalid value for key ${t}`,r3=t=>`Pattern length exceeds max of ${t}.`,s3=t=>`Missing ${t} property in key`,a3=t=>`Property 'weight' in key '${t}' must be a positive integer`,L0=Object.prototype.hasOwnProperty;class i3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=rg(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 rg(t){let e=null,n=null,r=null,s=1,a=null;if(Ln(t)||Ks(t))r=t,e=O0(t),n=If(t);else{if(!L0.call(t,"name"))throw new Error(s3("name"));const i=t.name;if(r=i,L0.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(a3(i));e=O0(i),n=If(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function O0(t){return Ks(t)?t:t.split(".")}function If(t){return Ks(t)?t.join("."):t}function u3(t,e){const n=[];let r=!1;const s=(a,i,u,o)=>{if(Un(a))if(!i[u])n.push(o!==void 0?{v:a,i:o}:a);else{const f=i[u],h=a[f];if(!Un(h))return;if(u===i.length-1&&(Ln(h)||Wo(h)||JA(h)||typeof h=="bigint"))n.push(o!==void 0?{v:Sf(h),i:o}:Sf(h));else if(Ks(h)){r=!0;for(let g=0,d=h.length;g<d;g+=1)s(h[g],i,u+1,g)}else i.length&&s(h,i,u+1,o)}};return s(t,Ln(e)?e.split("."):e,0),r?n:n[0]}const o3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},l3={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},c3={location:0,threshold:.6,distance:100},f3={useExtendedSearch:!1,useTokenSearch:!1,getFn:u3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Fe=Object.freeze({...l3,...o3,...c3,...f3}),d3=/[^ ]+/g;function h3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(d3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),u=parseFloat(Math.round(i*r)/r);return n.set(a,u),u},clear(){n.clear()}}}class Zd{constructor({getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){this.norm=h3(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,Ln(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();Ln(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(!Un(e)||So(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(Un(i)){if(Ks(i)){const u=[];for(let o=0,f=i.length;o<f;o+=1){const h=i[o];if(Un(h)){if(Ln(h)){if(!So(h)){const g={v:h,i:o,n:this.norm.get(h)};u.push(g)}}else if(Un(h.v)){const g=Ln(h.v)?h.v:Sf(h.v);if(!So(g)){const d={v:g,i:h.i,n:this.norm.get(g)};u.push(d)}}}}r.$[a]=u}else if(Ln(i)&&!So(i)){const u={v:i,n:this.norm.get(i)};r.$[a]=u}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function sg(t,e,{getFn:n=Fe.getFn,fieldNormWeight:r=Fe.fieldNormWeight}={}){const s=new Zd({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(rg)),s.setSources(e),s.create(),s}function p3(t,{getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new Zd({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function m3(t=[],e=Fe.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const u=t[a];u&&r===-1?r=a:!u&&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 ia=32;function g3(t,e,n,{location:r=Fe.location,distance:s=Fe.distance,threshold:a=Fe.threshold,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,includeMatches:o=Fe.includeMatches,ignoreLocation:f=Fe.ignoreLocation}={}){if(e.length>ia)throw new Error(r3(ia));const h=e.length,g=t.length,d=Math.max(0,Math.min(r,g));let m=a,b=d;const _=(j,Z)=>{const Y=j/h;if(f)return Y;const E=Math.abs(d-Z);return s?Y+E/s:E?1:Y},T=u>1||o,v=T?Array(g):[];let O;for(;(O=t.indexOf(e,b))>-1;){const j=_(0,O);if(m=Math.min(j,m),b=O+h,T){let Z=0;for(;Z<h;)v[O+Z]=1,Z+=1}}b=-1;let L=[],B=1,C=h+g;const q=1<<h-1;for(let j=0;j<h;j+=1){let Z=0,Y=C;for(;Z<Y;)_(j,d+Y)<=m?Z=Y:C=Y,Y=Math.floor((C-Z)/2+Z);C=Y;let E=Math.max(1,d-Y+1);const k=i?g:Math.min(d+Y,g)+h,S=Array(k+2);S[k+1]=(1<<j)-1;for(let F=k;F>=E;F-=1){const M=F-1,Q=n[t[M]];if(T&&(v[M]=+!!Q),S[F]=(S[F+1]<<1|1)&Q,j&&(S[F]|=(L[F+1]|L[F])<<1|1|L[F+1]),S[F]&q&&(B=_(j,M),B<=m)){if(m=B,b=M,b<=d)break;E=Math.max(1,2*d-b)}}if(_(j+1,d)>m)break;L=S}const x={isMatch:b>=0,score:Math.max(.001,B)};if(T){const j=m3(v,u);j.length?o&&(x.indices=j):x.isMatch=!1}return x}function b3(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 Jd(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 ag={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},v3=new RegExp("["+Object.keys(ag).join("")+"]","g"),Lu=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(v3,e=>ag[e]):t=>t;class eh{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,isCaseSensitive:o=Fe.isCaseSensitive,ignoreDiacritics:f=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:u,isCaseSensitive:o,ignoreDiacritics:f,ignoreLocation:h},e=o?e:e.toLowerCase(),e=f?Lu(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(m,b)=>{this.chunks.push({pattern:m,alphabet:b3(m),startIndex:b})},d=this.pattern.length;if(d>ia){let m=0;const b=d%ia,_=d-b;for(;m<_;)g(this.pattern.substr(m,ia),m),m+=ia;if(b){const T=d-ia;g(this.pattern.substr(T),T)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?Lu(e):e,this.pattern===e){const _={isMatch:!0,score:0};return s&&(_.indices=[[0,e.length-1]]),_}const{location:a,distance:i,threshold:u,findAllMatches:o,minMatchCharLength:f,ignoreLocation:h}=this.options,g=[];let d=0,m=!1;this.chunks.forEach(({pattern:_,alphabet:T,startIndex:v})=>{const{isMatch:O,score:L,indices:B}=g3(e,_,T,{location:a+v,distance:i,threshold:u,findAllMatches:o,minMatchCharLength:f,includeMatches:s,ignoreLocation:h});O&&(m=!0),d+=L,O&&B&&g.push(...B)});const b={isMatch:m,score:m?d/this.chunks.length:1};return m&&s&&(b.indices=Jd(g)),b}}class Vs{constructor(e){this.pattern=e}static isMultiMatch(e){return x0(e,this.multiRegex)}static isSingleMatch(e){return x0(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function x0(t,e){const n=t.match(e);return n?n[1]:null}class E3 extends Vs{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 T3 extends Vs{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 _3 extends Vs{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 A3 extends Vs{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 y3 extends Vs{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 N3 extends Vs{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 ig extends Vs{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,isCaseSensitive:o=Fe.isCaseSensitive,ignoreDiacritics:f=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){super(e),this._bitapSearch=new eh(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:u,isCaseSensitive:o,ignoreDiacritics:f,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ug extends Vs{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 Cf=[E3,ug,_3,A3,N3,y3,T3,ig],R0=Cf.length,S3="\0",I3="|";function C3(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 w3(t,e={}){return t.replace(/\\\|/g,S3).split(I3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=C3(s.trim()).filter(u=>u&&!!u.trim()),i=[];for(let u=0,o=a.length;u<o;u+=1){const f=a[u];let h=!1,g=-1;for(;!h&&++g<R0;){const d=Cf[g],m=d.isMultiMatch(f);m&&(i.push(new d(m,e)),h=!0)}if(!h)for(g=-1;++g<R0;){const d=Cf[g],m=d.isSingleMatch(f);if(m){i.push(new d(m,e));break}}}return i})}const L3=new Set([ig.type,ug.type]);class O3{constructor(e,{isCaseSensitive:n=Fe.isCaseSensitive,ignoreDiacritics:r=Fe.ignoreDiacritics,includeMatches:s=Fe.includeMatches,minMatchCharLength:a=Fe.minMatchCharLength,ignoreLocation:i=Fe.ignoreLocation,findAllMatches:u=Fe.findAllMatches,location:o=Fe.location,threshold:f=Fe.threshold,distance:h=Fe.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:u,ignoreLocation:i,location:o,threshold:f,distance:h},e=n?e:e.toLowerCase(),e=r?Lu(e):e,this.pattern=e,this.query=w3(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?Lu(e):e;let i=0;const u=[];let o=0,f=!1;for(let h=0,g=n.length;h<g;h+=1){const d=n[h];u.length=0,i=0,f=!1;for(let m=0,b=d.length;m<b;m+=1){const _=d[m],{isMatch:T,indices:v,score:O}=_.search(e);if(T){i+=1,o+=O;const L=_.constructor.type;L.startsWith("inverse")&&(f=!0),r&&(L3.has(L)?u.push(...v):u.push(v))}else{o=0,i=0,u.length=0,f=!1;break}}if(i){const m={isMatch:!0,score:o/i};return f&&(m.hasInverse=!0),r&&(m.indices=Jd(u)),m}}return{isMatch:!1,score:1}}}const wf=[];function th(...t){wf.push(...t)}function ll(t,e){for(let n=0,r=wf.length;n<r;n+=1){const s=wf[n];if(s.condition(t,e))return new s(t,e)}return new eh(t,e)}const cl={AND:"$and",OR:"$or"},Lf={PATH:"$path",PATTERN:"$val"},Of=t=>!!(t[cl.AND]||t[cl.OR]),x3=t=>!!t[Lf.PATH],R3=t=>!Ks(t)&&tg(t)&&!Of(t),D0=t=>({[cl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function og(t,e,{auto:n=!0}={}){const r=s=>{if(Ln(s)){const o={keyId:null,pattern:s};return n&&(o.searcher=ll(s,e)),o}const a=Object.keys(s),i=x3(s);if(!i&&a.length>1&&!Of(s))return r(D0(s));if(R3(s)){const o=i?s[Lf.PATH]:a[0],f=i?s[Lf.PATTERN]:s[o];if(!Ln(f))throw new Error(n3(o));const h={keyId:If(o),pattern:f};return n&&(h.searcher=ll(f,e)),h}const u={children:[],operator:a[0]};return a.forEach(o=>{const f=s[o];Ks(f)&&f.forEach(h=>{u.children.push(r(h))})}),u};return Of(t)||(t=D0(t)),r(t)}function xf(t,{ignoreFieldNorm:e=Fe.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 D3(t,{ignoreFieldNorm:e=Fe.ignoreFieldNorm}){t.forEach(n=>{n.score=xf(n.matches,{ignoreFieldNorm:e})})}class k3{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 u=n[e];n[e]=n[s],n[s]=u}}while(s!==e)}}function P3(t,e){const n=t.matches;e.matches=[],Un(n)&&n.forEach(r=>{if(!Un(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 M3(t,e){e.score=t.score}function B3(t,e,{includeMatches:n=Fe.includeMatches,includeScore:r=Fe.includeScore}={}){const s=[];return n&&s.push(P3),r&&s.push(M3),t.map(a=>{const{idx:i}=a,u={item:e[i],refIndex:i};return s.length&&s.forEach(o=>{o(a,u)}),u})}const F3=/\b\w+\b/g;function Rf({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=Lu(n)),n.match(F3)||[]}}}function U3(t,e,n){const r=new Map,s=new Map;let a=0;function i(u,o,f,h){const g=n.tokenize(u);if(!g.length)return;a++;const d=new Map;for(const m of g)d.set(m,(d.get(m)||0)+1);for(const[m,b]of d){const _={docIdx:o,keyIdx:f,subIdx:h,tf:b};let T=r.get(m);T||(T=[],r.set(m,T)),T.push(_),s.set(m,(s.get(m)||0)+1)}}for(const u of t){const{i:o,v:f,$:h}=u;if(f!==void 0){i(f,o,-1,-1);continue}if(h)for(let g=0;g<e;g++){const d=h[g];if(d)if(Array.isArray(d))for(const m of d)i(m.v,o,g,m.i??-1);else i(d.v,o,g,-1)}}return{terms:r,fieldCount:a,df:s}}function H3(t,e,n,r){const{i:s,v:a,$:i}=e;function u(o,f,h){const g=r.tokenize(o);if(!g.length)return;t.fieldCount++;const d=new Map;for(const m of g)d.set(m,(d.get(m)||0)+1);for(const[m,b]of d){const _={docIdx:s,keyIdx:f,subIdx:h,tf:b};let T=t.terms.get(m);T||(T=[],t.terms.set(m,T)),T.push(_),t.df.set(m,(t.df.get(m)||0)+1)}}if(a!==void 0){u(a,-1,-1);return}if(i)for(let o=0;o<n;o++){const f=i[o];if(f)if(Array.isArray(f))for(const h of f)u(h.v,o,h.i??-1);else u(f.v,o,-1)}}function k0(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 Xs{constructor(e,n,r){this.options={...Fe,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new i3(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=ll(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Zd))throw new Error(t3);if(this._myIndex=n||sg(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=U3(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(Un(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});H3(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)k0(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&&k0(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:u,ignoreFieldNorm:o}=this.options;if(Ln(e)&&!e.trim()){let g=this._docs.map((d,m)=>({item:d,refIndex:m}));return Wo(r)&&r>-1&&(g=g.slice(0,r)),g}const f=Wo(r)&&r>0&&Ln(e);let h;if(f){const g=new k3(r);Ln(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:o}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:o}),h=g.extractSorted(u)}else h=Ln(e)?Ln(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),D3(h,{ignoreFieldNorm:o}),i&&h.sort(u),Wo(r)&&r>-1&&(h=h.slice(0,r));return B3(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:u,i:o,n:f})=>{if(!Un(u))return;const{isMatch:h,score:g,indices:d}=s.searchIn(u);if(h){const m={item:u,idx:o,matches:[{score:g,value:u,norm:f,indices:d}]};n?(m.score=xf(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):i.push(m)}}),i}_searchLogical(e){const n=og(e,this.options),r=(u,o,f)=>{if(!("children"in u)){const{keyId:m,searcher:b}=u;let _;return m===null?(_=[],this._myIndex.keys.forEach((T,v)=>{_.push(...this._findMatches({key:T,value:o[v],searcher:b}))})):_=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(o,m),searcher:b}),_&&_.length?[{idx:f,item:o,matches:_}]:[]}const{children:h,operator:g}=u,d=[];for(let m=0,b=h.length;m<b;m+=1){const _=h[m],T=r(_,o,f);if(T.length)d.push(...T);else if(g===cl.AND)return[]}return d},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:u,i:o})=>{if(Un(u)){const f=r(n,u,o);f.length&&(a.has(o)||(a.set(o,{idx:o,item:u,matches:[]}),i.push(a.get(o))),f.forEach(({matches:h})=>{a.get(o).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,u=n?null:[];return i.forEach(({$:o,i:f})=>{if(!Un(o))return;const h=[];let g=!1,d=!1;if(a.forEach((m,b)=>{const _=this._findMatches({key:m,value:o[b],searcher:s});_.length?(h.push(..._),_[0].hasInverse&&(d=!0)):g=!0}),!(d&&g)&&h.length){const m={idx:f,item:o,matches:h};n?(m.score=xf(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):u.push(m)}}),u}_findMatches({key:e,value:n,searcher:r}){if(!Un(n))return[];const s=[];if(Ks(n))n.forEach(({v:a,i,n:u})=>{if(!Un(a))return;const{isMatch:o,score:f,indices:h,hasInverse:g}=r.searchIn(a);o&&s.push({score:f,key:e,value:a,idx:i,norm:u,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:u,score:o,indices:f,hasInverse:h}=r.searchIn(a);u&&s.push({score:o,key:e,value:a,norm:i,indices:f,hasInverse:h})}return s}}class q3{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 u of r){this.termSearchers.push(new eh(u,{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 o=a.get(u)||0,f=Math.log(1+(i-o+.5)/(o+.5));this.idfWeights.push(f)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let o=0;o<this.termSearchers.length;o++){const f=this.termSearchers[o].searchIn(e),h=this.idfWeights[o];s+=h,f.isMatch&&(a++,r+=h*(1-f.score),f.indices&&n.push(...f.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,u={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(u.indices=Jd(n)),u}}Xs.version="7.3.0";Xs.createIndex=sg;Xs.parseIndex=p3;Xs.config=Fe;Xs.match=function(t,e,n){return ll(t,{...Fe,...n}).searchIn(e)};Xs.parseQuery=og;th(O3);th(q3);Xs.use=function(...t){t.forEach(e=>th(e))};function j3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=o=>{a.has(o.path)||(a.add(o.path),s.push(o))};for(const o of t)o.title.toLowerCase()===r&&i(o);for(const o of t)o.title.toLowerCase().startsWith(r)&&i(o);for(const o of t)o.title.toLowerCase().includes(r)&&i(o);const u=new Xs(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const o of u.search(e))i(o.item);return s.slice(0,n)}const $3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function lg(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function cg(...t){return t.filter(e=>e!=="").join("/")}function Y3(t){return $3.has(lg(t))}function z3(t){return cg(Je.content,t,"assets")}function Ou(t,e){return cg(Je.content,t,e)}function to(t,e){return Aa(`/api/read?path=${encodeURIComponent(Ou(t,e))}`)}function fg(t){return`assets/${t}`}function dg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=lg(t),s=hs(n)||"image";return r===""?s:`${s}.${r}`}class W3{async list(e){return await(await mt(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await mt(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await mt(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return new Uint8Array(await n.arrayBuffer())}async exists(e){return(await(await mt(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function Go(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function P0(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Sc=ee(0);const nh={get value(){return c(Sc)},bump(){y(Sc,c(Sc)+1)}};function G3(t){return{image:()=>{},file:e=>K3(e)?to(t,e):void 0}}function K3(t){return t.startsWith("assets/")}const V3=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
9
+ }</style>`);d.childNodes=[...m,...d.childNodes]}}return o}function Vm(t,e){const n=new Map,r=[];for(const s of e){const a=Gn(s)?St(s,"slot"):void 0;if(a!==void 0){Gn(s)&&Xd(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return yf(t,n,r)}function yf(t,e,n){const r=[];for(const s of t)if(Gn(s)&&s.tagName==="slot"){const a=St(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...yf(s.childNodes,e,n))}else Gn(s)&&(s.childNodes=yf(s.childNodes,e,n)),r.push(s);return r}async function CA(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 u=a++;r[u]=await n(t[u],u)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Xm(t){const e=v0(St(t,"data-minlength")),n=v0(St(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function v0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function Oi(t,e=new Map){return Zm(t,e,new Set)}function Qm(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=Zm(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function Zm(t,e,n){const r=[],s=new Map,a=f=>{const h=s.get(f);if(h!==void 0)return h;const g={name:f,type:"shorttext",label:Pd(f),required:!1,multiline:!1};return s.set(f,g),r.push(f),g},i=(f,h)=>{if(s.has(f))return;const g=a(f);g.type=h,g.multiline=jd[h].multiline},u=f=>{const h=St(f,"data-field")??wA(f);if(h===void 0)return;const g=a(h);qs(f,"data-required")&&(g.required=!0);const d=St(f,"data-help");d!==void 0&&(g.help=d);const m=St(f,"data-label");m!==void 0&&(g.label=m);const{minLength:b,maxLength:_}=Xm(f);b!==void 0&&(g.minLength=b),_!==void 0&&(g.maxLength=_)},o=f=>{for(const h of f){if(!Gn(h)){if(Jr(h))continue;continue}const g=St(h,"data-each");if(g!==void 0){const b=a(g);b.type="url",b.multiple=!0;const _=St(h,"data-pick-from");_!==void 0&&(b.pickFrom=_),u(h);continue}if(qs(h,"data-each-in"))continue;const d=St(h,"data-type"),m=e.has(h.tagName)?Qm(h.tagName,e,n):void 0;for(const b of h.attrs){const _=Ci(b.value);for(const T of zs(b.value)){if(T.dotted)continue;const v=(_==null?void 0:_.name)===T.name,O=v?m==null?void 0:m.get(b.name):void 0;i(T.name,O??Ii({tag:h.tagName,attribute:b.name,wholeValue:v,valuePrefix:Yd(b.value),download:qs(h,"download"),...d!==void 0&&{annotation:d}}))}}for(const b of h.childNodes){if(!Jr(b))continue;const _=Ci(b.value);for(const T of zs(b.value))T.dotted||i(T.name,Ii({tag:h.tagName,wholeValue:(_==null?void 0:_.name)===T.name,...d!==void 0&&{annotation:d}}))}u(h),o(h.childNodes)}};return o(Li(t)),r.map(f=>LA(s.get(f)))}function wA(t){for(const e of t.attrs){const n=zs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(Jr(e)){const n=zs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function LA(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 Nf(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,u=new Set,o=new Map,f=new Set,h=g=>{for(const d of g){if(!Gn(d))continue;const m=OA(d);m!==void 0&&u.add(m);const b=St(d,"data-each-in");b!==void 0&&r.push(b);const _=St(d,"data-each");if(_!==void 0&&s.push(_),qs(d,"data-required")){const L=E0(d);L!==void 0&&n.add(L)}const T=Xm(d);if(T.minLength!==void 0||T.maxLength!==void 0){const L=E0(d);L!==void 0&&o.set(L,T)}const v=St(d,"data-type"),O=e.has(d.tagName)?Qm(d.tagName,e,new Set):void 0;for(const L of d.attrs){const B=Pl(L.value);B!==void 0&&f.add(B);const C=Ci(L.value);if(C===null||C.dotted)continue;const q=(O==null?void 0:O.get(L.name))??Ii({tag:d.tagName,attribute:L.name,wholeValue:!0,valuePrefix:Yd(L.value),download:qs(d,"download"),...v!==void 0&&{annotation:v}});q==="image"?a.add(C.name):q==="file"?i.add(C.name):q==="richtext"&&u.add(C.name)}h(d.childNodes)}};return h(Li(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...u],constraints:o,references:[...f].sort()}}function OA(t){const e=t.childNodes.filter(i=>!(Jr(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!Jr(n))return;const r=Ci(n.value);if(r===null||r.dotted)return;const s=St(t,"data-type"),a=Ii({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return $d(a)==="html"?r.name:void 0}function E0(t){const e=St(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=zs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(Jr(n)){const r=zs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function xA(t){return t.split("/").filter(e=>e!=="")}function Tr(t){const e=xA(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const RA=4;async function DA(t,e,n={}){const[r,s,a,i]=await Promise.all([Md(t),Bd(t),dm(t),hm(t)]),u=Jm(r,e,void 0);if(u===void 0)return;const o=n.draft??u.node.item,f=o.template??u.dirTemplate;if(f===void 0)return;const[h,g,d,m]=await Promise.all([Ud(t,f),fT(t,f),dT(t,f),Hd(t)]),b=Nf(h,s),_={...u.node,item:o};let T,v=[];if(n.media!==void 0)T=n.media;else{const L=await kA(t,_,b,n.imageEncoder,RA);T=L.media,v=L.mediaArtifacts}return{html:Ef({template:h,scope:Qd(o),components:s,context:eg(r),media:T,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...m!==void 0&&{document:m},...g!==void 0&&{templateStyle:g},...d!==void 0&&{templateScript:d}}),mediaArtifacts:v}}function Jm(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=Jm(s,e,r);if(a!==void 0)return a}}async function kA(t,e,n,r,s){const a=PA(e.path),i=e.item.fields,u=new Map,o=new Map,f=[];for(const h of n.fileFields)for(const g of A0(i[h])){const d=_0(a,g),m=await T0(t,`content/${d}`);m!==void 0&&(f.push({path:d,contents:m}),o.set(g,`/${d}`))}if(r!==void 0){const h=new Set;for(const d of n.imageFields)for(const m of A0(i[d]))h.add(m);for(const d of n.richTextFields){const m=i[d];if(typeof m=="string")for(const b of MA(m))h.add(b)}const g=await CA([...h],s,async d=>{const m=_0(a,d),b=await T0(t,`content/${m}`);if(b!==void 0)return{ref:d,...await vA(b,m,r)}});for(const d of g)d!==void 0&&(f.push(...d.artifacts),u.set(d.ref,d.info))}return{media:{image:h=>u.get(h),file:h=>o.get(h)},mediaArtifacts:f}}async function T0(t,e){try{return await t.readBytes(e)}catch{return}}function PA(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function _0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function MA(t){const e=[],n=r=>{for(const s of r)if(Gn(s)){if(s.tagName==="img"){const a=St(s,"src");a!==void 0&&BA(a)&&e.push(a)}n(s.childNodes)}};return n(js(t)),e}function BA(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function A0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Qd(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 FA(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 y0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function eg(t){const{items:e,dirs:n}=FA(t),r=s=>({url:Tr(s.path),fields:Qd(s.item)});return{collection(s,a){var d;const i=n.get(y0(s));if(i===void 0)return[];const u=((d=i.collection)==null?void 0:d.recursive)??!1,o=[],f=m=>{for(const b of m.children)b.kind==="item"?b.slug!=="index"&&b.item.isPublished&&o.push(b):u&&f(b)};f(i);const h=UA(o,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(y0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function UA(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const u=Qd(i.item)[n];return u==null?"":String(u)},a=[...t].sort((i,u)=>s(i).localeCompare(s(u)));return r==="desc"?a.reverse():a}async function HA(t){const[e,n,r]=await Promise.all([Md(t),Bd(t),Hd(t)]),{items:s,dirs:a,published:i}=qA(e);let u=null;if(r!==void 0)try{u=Nf(r,n)}catch{u=null}const o=(u==null?void 0:u.requiredFields)??[],f=(u==null?void 0:u.constraints)??new Map,h=[],g=(C,q,x,j)=>{h.push({severity:C,code:q,message:x,...j!==void 0&&{path:j}})},d=(C,q,x)=>{const j=s.get(S0(C));j===void 0?g("error","reference-missing",`"${q}" references "${C}" (${x}), which does not exist.`,q):j.item.isPublished||g("error","reference-unpublished",`"${q}" references "${C}" (${x}), which is not published.`,q)},m=(C,q,x)=>{for(const[j,{minLength:Z,maxLength:Y}]of C){const E=q[j];if(typeof E!="string"||E==="")continue;const{length:k}=E;Z!==void 0&&k<Z&&g("warning","value-too-short",`"${x}" field "${j}" is ${k} characters; the minimum is ${Z}.`,x),Y!==void 0&&k>Y&&g("warning","value-too-long",`"${x}" field "${j}" is ${k} characters; the maximum is ${Y}.`,x)}},b=new Map,_=async C=>{const q=b.get(C);if(q!==void 0||b.has(C))return q??null;let x;try{x=Nf(await Ud(t,C),n)}catch{x=null}return b.set(C,x),x},T=new Map;for(const{node:C,templateName:q}of i){const x=T.get(Tr(C.path))??[];if(x.push(C.path),T.set(Tr(C.path),x),q===void 0){g("error","no-template",`"${C.path}" has no template (no per-item or folder default).`,C.path);continue}const j=await _(q);if(j===null){g("error","template-missing",`"${C.path}" uses template "${q}", which does not exist.`,C.path);continue}const Z=jA(C.item);for(const Y of j.requiredFields)N0(Z[Y])&&g("error","required-empty",`"${C.path}" is missing required field "${Y}".`,C.path);for(const Y of o)N0(Z[Y])&&g("error","required-empty",`"${C.path}" is missing required meta field "${Y}" (document shell).`,C.path);m(j.constraints,Z,C.path),m(f,Z,C.path);for(const Y of j.queryLoopPaths)a.has(S0(Y))||g("error","loop-target-missing",`"${C.path}" loops over "${Y}", which is not a directory.`,C.path);for(const Y of j.curatedLoopFields)for(const E of $A(C.item.fields[Y]))d(E,C.path,`field "${Y}"`);for(const[Y,E]of Object.entries(Z)){if(typeof E!="string")continue;const k=Pl(E);if(k!==void 0&&d(k,C.path,`field "${Y}"`),j.richTextFields.includes(Y))for(const S of p0(E))d(S,C.path,`field "${Y}"`)}}const v=Je.templates;if(u!==null)for(const C of u.references)d(C,`${v}/${Ju}.html`,"link");for(const[C,q]of b)if(q!==null)for(const x of q.references)d(x,`${v}/${C}.html`,"link");for(const[C,q]of n)for(const x of p0(q))d(x,`${Je.components}/${C}.html`,"link");for(const[C,q]of T)q.length>1&&g("error","url-collision",`URL ${C} is produced by multiple items: ${q.join(", ")}.`);const O=new Map;for(const C of await YA(t)){const x=C.slice(C.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),j=O.get(x)??[];j.push(`${Je.components}/${C}`),O.set(x,j)}for(const[C,q]of[...O].sort(([x],[j])=>x.localeCompare(j)))q.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${C}>: ${q.join(", ")}.`);const L=h.filter(C=>C.severity==="error"),B=h.filter(C=>C.severity==="warning");return{diagnostics:h,errors:L,warnings:B,ok:L.length===0}}function qA(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const u=a.defaultTemplate??i;for(const o of a.children){if(o.kind==="dir"){s(o,u);continue}e.set(o.path,o),o.item.isPublished&&r.push({node:o,templateName:o.item.template??u})}};return s(t,void 0),{items:e,dirs:n,published:r}}function jA(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 N0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function $A(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function S0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function YA(t){const e=Je.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const u=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,u):i.name.endsWith(".html")&&n.push(u)}};return await r(e,""),n.sort()}function Nc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let tg="";function Aa(t){return`${tg}${t}`}function zA(t){tg=t.replace(/\/+$/,"")}async function WA(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&zA(e.apiUrl)}catch{}}async function mt(t,e={}){const n=typeof t=="string"?Aa(t):t,r=await I0(n,e,ot.token);if(r.status!==401||ot.token===null)return r;const s=await ot.refresh();return s===null?r:I0(n,e,s)}async function I0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function Ma(t,e){const n=await mt(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const No="nanoesis.jwt",GA=540*1e3;function KA(){let t=ee("loading"),e=ee(null),n=ee(null),r=ee(!1),s=null;function a(v,O){y(e,v,!0),y(n,O,!0),y(t,"authenticated"),localStorage.setItem(No,v),u()}function i(){y(e,null),y(n,null),y(t,"unauthenticated"),localStorage.removeItem(No),o()}function u(){o(),s=setInterval(()=>{f()},GA)}function o(){s!==null&&(clearInterval(s),s=null)}async function f(){if(c(e)===null)return null;const v=c(e),O=await fetch(Aa("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${v}`}});if(!O.ok)return i(),null;const L=await O.json().catch(()=>({}));return!L.ok||L.token===void 0||L.principal===void 0?(i(),null):(a(L.token,L.principal),L.token)}async function h(){y(t,"loading");let v;try{v=await fetch(Aa("/api/auth/state"))}catch{y(t,"no-auth");return}if(v.status===404){y(t,"no-auth");return}if(!v.ok){y(t,"unauthenticated");return}const O=await v.json();y(r,O.firstRun,!0);const L=localStorage.getItem(No);L!==null&&L!==""&&(y(e,L,!0),await f()!==null)||y(t,"unauthenticated")}async function g(v,O){const L=await fetch(Aa("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:v,password:O})}),B=await L.json().catch(()=>({}));return!L.ok||!B.ok||B.token===void 0||B.principal===void 0?{ok:!1,error:B.error??`HTTP ${L.status}`}:(y(r,!1),a(B.token,B.principal),{ok:!0})}async function d(){if(c(e)!==null)try{await mt("/api/logout",{method:"POST"})}catch{}i()}async function m(v,O){const L=await mt("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:v,newPassword:O})}),B=await L.json().catch(()=>({}));return!L.ok||!B.ok||B.token===void 0?{ok:!1,error:B.error??`HTTP ${L.status}`}:(y(e,B.token,!0),localStorage.setItem(No,B.token),{ok:!0})}async function b(){const v=await mt("/api/me/token",{method:"POST"}),O=await v.json().catch(()=>({}));return!v.ok||O.ok!==!0||O.token===void 0?{ok:!1,error:O.error??`HTTP ${v.status}`}:{ok:!0,token:O.token,...O.expiresAt!==void 0&&{expiresAt:O.expiresAt}}}async function _(){const v=await mt("/api/me/token",{method:"DELETE"});return v.ok?{ok:!0}:{ok:!1,error:(await v.json().catch(()=>({}))).error??`HTTP ${v.status}`}}function T(){return c(t)==="no-auth"}return{get status(){return c(t)},get token(){return c(e)},get principal(){return c(n)},get firstRun(){return c(r)},get canAuthor(){return T()||Nc(c(n),"author")},get canDevelop(){return T()||Nc(c(n),"developer")},get isAdmin(){return T()||Nc(c(n),"admin")},init:h,login:g,logout:d,refresh:f,changePassword:m,createMcpToken:b,revokeMcpTokens:_}}const ot=KA(),C0={name:null,logoUrl:null};async function VA(){try{const t=await fetch(Aa("/api/branding"));if(!t.ok)return C0;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:Aa(e.logoUrl)}}catch{return C0}}function XA(t){return Ma("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function QA(t){return Ma("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function ZA(){return Ma("/api/branding/logo",{method:"DELETE"})}function JA(){let t=ee(null),e=ee(null);async function n(){const r=await VA();y(t,r.name,!0),y(e,r.logoUrl,!0)}return{get name(){return c(t)},get logoUrl(){return c(e)},load:n}}const wn=JA(),e3="modulepreload",t3=function(t,e){return new URL(t,e).href},w0={},n3=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(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const u=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),f=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=i(n.map(h=>{if(h=t3(h,r),h in w0)return;w0[h]=!0;const g=h.endsWith(".css"),d=g?'[rel="stylesheet"]':"";if(!!r)for(let _=u.length-1;_>=0;_--){const T=u[_];if(T.href===h&&(!g||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${d}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":e3,g||(b.as="script"),b.crossOrigin="",b.href=h,f&&b.setAttribute("nonce",f),document.head.appendChild(b),g)return new Promise((_,T)=>{b.addEventListener("load",_),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=i,window.dispatchEvent(u),!u.defaultPrevented)throw i}return s.then(i=>{for(const u of i||[])u.status==="rejected"&&a(u.reason);return e().catch(a)})};function Ks(t){return Array.isArray?Array.isArray(t):rg(t)==="[object Array]"}function r3(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 Sf(t){return t==null?"":r3(t)}function Ln(t){return typeof t=="string"}function Wo(t){return typeof t=="number"}function s3(t){return t===!0||t===!1||a3(t)&&rg(t)=="[object Boolean]"}function ng(t){return typeof t=="object"}function a3(t){return ng(t)&&t!==null}function Un(t){return t!=null}function So(t){return!t.trim().length}function rg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const i3="Incorrect 'index' type",u3=t=>`Invalid value for key ${t}`,o3=t=>`Pattern length exceeds max of ${t}.`,l3=t=>`Missing ${t} property in key`,c3=t=>`Property 'weight' in key '${t}' must be a positive integer`,L0=Object.prototype.hasOwnProperty;class f3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=sg(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 sg(t){let e=null,n=null,r=null,s=1,a=null;if(Ln(t)||Ks(t))r=t,e=O0(t),n=If(t);else{if(!L0.call(t,"name"))throw new Error(l3("name"));const i=t.name;if(r=i,L0.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(c3(i));e=O0(i),n=If(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function O0(t){return Ks(t)?t:t.split(".")}function If(t){return Ks(t)?t.join("."):t}function d3(t,e){const n=[];let r=!1;const s=(a,i,u,o)=>{if(Un(a))if(!i[u])n.push(o!==void 0?{v:a,i:o}:a);else{const f=i[u],h=a[f];if(!Un(h))return;if(u===i.length-1&&(Ln(h)||Wo(h)||s3(h)||typeof h=="bigint"))n.push(o!==void 0?{v:Sf(h),i:o}:Sf(h));else if(Ks(h)){r=!0;for(let g=0,d=h.length;g<d;g+=1)s(h[g],i,u+1,g)}else i.length&&s(h,i,u+1,o)}};return s(t,Ln(e)?e.split("."):e,0),r?n:n[0]}const h3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},p3={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},m3={location:0,threshold:.6,distance:100},g3={useExtendedSearch:!1,useTokenSearch:!1,getFn:d3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Fe=Object.freeze({...p3,...h3,...m3,...g3}),b3=/[^ ]+/g;function v3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(b3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),u=parseFloat(Math.round(i*r)/r);return n.set(a,u),u},clear(){n.clear()}}}class Zd{constructor({getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){this.norm=v3(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,Ln(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();Ln(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(!Un(e)||So(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(Un(i)){if(Ks(i)){const u=[];for(let o=0,f=i.length;o<f;o+=1){const h=i[o];if(Un(h)){if(Ln(h)){if(!So(h)){const g={v:h,i:o,n:this.norm.get(h)};u.push(g)}}else if(Un(h.v)){const g=Ln(h.v)?h.v:Sf(h.v);if(!So(g)){const d={v:g,i:h.i,n:this.norm.get(g)};u.push(d)}}}}r.$[a]=u}else if(Ln(i)&&!So(i)){const u={v:i,n:this.norm.get(i)};r.$[a]=u}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function ag(t,e,{getFn:n=Fe.getFn,fieldNormWeight:r=Fe.fieldNormWeight}={}){const s=new Zd({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(sg)),s.setSources(e),s.create(),s}function E3(t,{getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new Zd({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function T3(t=[],e=Fe.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const u=t[a];u&&r===-1?r=a:!u&&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 ia=32;function _3(t,e,n,{location:r=Fe.location,distance:s=Fe.distance,threshold:a=Fe.threshold,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,includeMatches:o=Fe.includeMatches,ignoreLocation:f=Fe.ignoreLocation}={}){if(e.length>ia)throw new Error(o3(ia));const h=e.length,g=t.length,d=Math.max(0,Math.min(r,g));let m=a,b=d;const _=(j,Z)=>{const Y=j/h;if(f)return Y;const E=Math.abs(d-Z);return s?Y+E/s:E?1:Y},T=u>1||o,v=T?Array(g):[];let O;for(;(O=t.indexOf(e,b))>-1;){const j=_(0,O);if(m=Math.min(j,m),b=O+h,T){let Z=0;for(;Z<h;)v[O+Z]=1,Z+=1}}b=-1;let L=[],B=1,C=h+g;const q=1<<h-1;for(let j=0;j<h;j+=1){let Z=0,Y=C;for(;Z<Y;)_(j,d+Y)<=m?Z=Y:C=Y,Y=Math.floor((C-Z)/2+Z);C=Y;let E=Math.max(1,d-Y+1);const k=i?g:Math.min(d+Y,g)+h,S=Array(k+2);S[k+1]=(1<<j)-1;for(let F=k;F>=E;F-=1){const M=F-1,Q=n[t[M]];if(T&&(v[M]=+!!Q),S[F]=(S[F+1]<<1|1)&Q,j&&(S[F]|=(L[F+1]|L[F])<<1|1|L[F+1]),S[F]&q&&(B=_(j,M),B<=m)){if(m=B,b=M,b<=d)break;E=Math.max(1,2*d-b)}}if(_(j+1,d)>m)break;L=S}const x={isMatch:b>=0,score:Math.max(.001,B)};if(T){const j=T3(v,u);j.length?o&&(x.indices=j):x.isMatch=!1}return x}function A3(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 Jd(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 ig={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},y3=new RegExp("["+Object.keys(ig).join("")+"]","g"),Lu=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(y3,e=>ig[e]):t=>t;class eh{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,isCaseSensitive:o=Fe.isCaseSensitive,ignoreDiacritics:f=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:u,isCaseSensitive:o,ignoreDiacritics:f,ignoreLocation:h},e=o?e:e.toLowerCase(),e=f?Lu(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(m,b)=>{this.chunks.push({pattern:m,alphabet:A3(m),startIndex:b})},d=this.pattern.length;if(d>ia){let m=0;const b=d%ia,_=d-b;for(;m<_;)g(this.pattern.substr(m,ia),m),m+=ia;if(b){const T=d-ia;g(this.pattern.substr(T),T)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?Lu(e):e,this.pattern===e){const _={isMatch:!0,score:0};return s&&(_.indices=[[0,e.length-1]]),_}const{location:a,distance:i,threshold:u,findAllMatches:o,minMatchCharLength:f,ignoreLocation:h}=this.options,g=[];let d=0,m=!1;this.chunks.forEach(({pattern:_,alphabet:T,startIndex:v})=>{const{isMatch:O,score:L,indices:B}=_3(e,_,T,{location:a+v,distance:i,threshold:u,findAllMatches:o,minMatchCharLength:f,includeMatches:s,ignoreLocation:h});O&&(m=!0),d+=L,O&&B&&g.push(...B)});const b={isMatch:m,score:m?d/this.chunks.length:1};return m&&s&&(b.indices=Jd(g)),b}}class Vs{constructor(e){this.pattern=e}static isMultiMatch(e){return x0(e,this.multiRegex)}static isSingleMatch(e){return x0(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function x0(t,e){const n=t.match(e);return n?n[1]:null}class N3 extends Vs{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 S3 extends Vs{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 I3 extends Vs{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 C3 extends Vs{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 w3 extends Vs{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 L3 extends Vs{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 ug extends Vs{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,isCaseSensitive:o=Fe.isCaseSensitive,ignoreDiacritics:f=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){super(e),this._bitapSearch=new eh(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:u,isCaseSensitive:o,ignoreDiacritics:f,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class og extends Vs{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 Cf=[N3,og,I3,C3,L3,w3,S3,ug],R0=Cf.length,O3="\0",x3="|";function R3(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 D3(t,e={}){return t.replace(/\\\|/g,O3).split(x3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=R3(s.trim()).filter(u=>u&&!!u.trim()),i=[];for(let u=0,o=a.length;u<o;u+=1){const f=a[u];let h=!1,g=-1;for(;!h&&++g<R0;){const d=Cf[g],m=d.isMultiMatch(f);m&&(i.push(new d(m,e)),h=!0)}if(!h)for(g=-1;++g<R0;){const d=Cf[g],m=d.isSingleMatch(f);if(m){i.push(new d(m,e));break}}}return i})}const k3=new Set([ug.type,og.type]);class P3{constructor(e,{isCaseSensitive:n=Fe.isCaseSensitive,ignoreDiacritics:r=Fe.ignoreDiacritics,includeMatches:s=Fe.includeMatches,minMatchCharLength:a=Fe.minMatchCharLength,ignoreLocation:i=Fe.ignoreLocation,findAllMatches:u=Fe.findAllMatches,location:o=Fe.location,threshold:f=Fe.threshold,distance:h=Fe.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:u,ignoreLocation:i,location:o,threshold:f,distance:h},e=n?e:e.toLowerCase(),e=r?Lu(e):e,this.pattern=e,this.query=D3(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?Lu(e):e;let i=0;const u=[];let o=0,f=!1;for(let h=0,g=n.length;h<g;h+=1){const d=n[h];u.length=0,i=0,f=!1;for(let m=0,b=d.length;m<b;m+=1){const _=d[m],{isMatch:T,indices:v,score:O}=_.search(e);if(T){i+=1,o+=O;const L=_.constructor.type;L.startsWith("inverse")&&(f=!0),r&&(k3.has(L)?u.push(...v):u.push(v))}else{o=0,i=0,u.length=0,f=!1;break}}if(i){const m={isMatch:!0,score:o/i};return f&&(m.hasInverse=!0),r&&(m.indices=Jd(u)),m}}return{isMatch:!1,score:1}}}const wf=[];function th(...t){wf.push(...t)}function ll(t,e){for(let n=0,r=wf.length;n<r;n+=1){const s=wf[n];if(s.condition(t,e))return new s(t,e)}return new eh(t,e)}const cl={AND:"$and",OR:"$or"},Lf={PATH:"$path",PATTERN:"$val"},Of=t=>!!(t[cl.AND]||t[cl.OR]),M3=t=>!!t[Lf.PATH],B3=t=>!Ks(t)&&ng(t)&&!Of(t),D0=t=>({[cl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function lg(t,e,{auto:n=!0}={}){const r=s=>{if(Ln(s)){const o={keyId:null,pattern:s};return n&&(o.searcher=ll(s,e)),o}const a=Object.keys(s),i=M3(s);if(!i&&a.length>1&&!Of(s))return r(D0(s));if(B3(s)){const o=i?s[Lf.PATH]:a[0],f=i?s[Lf.PATTERN]:s[o];if(!Ln(f))throw new Error(u3(o));const h={keyId:If(o),pattern:f};return n&&(h.searcher=ll(f,e)),h}const u={children:[],operator:a[0]};return a.forEach(o=>{const f=s[o];Ks(f)&&f.forEach(h=>{u.children.push(r(h))})}),u};return Of(t)||(t=D0(t)),r(t)}function xf(t,{ignoreFieldNorm:e=Fe.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 F3(t,{ignoreFieldNorm:e=Fe.ignoreFieldNorm}){t.forEach(n=>{n.score=xf(n.matches,{ignoreFieldNorm:e})})}class U3{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 u=n[e];n[e]=n[s],n[s]=u}}while(s!==e)}}function H3(t,e){const n=t.matches;e.matches=[],Un(n)&&n.forEach(r=>{if(!Un(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 q3(t,e){e.score=t.score}function j3(t,e,{includeMatches:n=Fe.includeMatches,includeScore:r=Fe.includeScore}={}){const s=[];return n&&s.push(H3),r&&s.push(q3),t.map(a=>{const{idx:i}=a,u={item:e[i],refIndex:i};return s.length&&s.forEach(o=>{o(a,u)}),u})}const $3=/\b\w+\b/g;function Rf({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=Lu(n)),n.match($3)||[]}}}function Y3(t,e,n){const r=new Map,s=new Map;let a=0;function i(u,o,f,h){const g=n.tokenize(u);if(!g.length)return;a++;const d=new Map;for(const m of g)d.set(m,(d.get(m)||0)+1);for(const[m,b]of d){const _={docIdx:o,keyIdx:f,subIdx:h,tf:b};let T=r.get(m);T||(T=[],r.set(m,T)),T.push(_),s.set(m,(s.get(m)||0)+1)}}for(const u of t){const{i:o,v:f,$:h}=u;if(f!==void 0){i(f,o,-1,-1);continue}if(h)for(let g=0;g<e;g++){const d=h[g];if(d)if(Array.isArray(d))for(const m of d)i(m.v,o,g,m.i??-1);else i(d.v,o,g,-1)}}return{terms:r,fieldCount:a,df:s}}function z3(t,e,n,r){const{i:s,v:a,$:i}=e;function u(o,f,h){const g=r.tokenize(o);if(!g.length)return;t.fieldCount++;const d=new Map;for(const m of g)d.set(m,(d.get(m)||0)+1);for(const[m,b]of d){const _={docIdx:s,keyIdx:f,subIdx:h,tf:b};let T=t.terms.get(m);T||(T=[],t.terms.set(m,T)),T.push(_),t.df.set(m,(t.df.get(m)||0)+1)}}if(a!==void 0){u(a,-1,-1);return}if(i)for(let o=0;o<n;o++){const f=i[o];if(f)if(Array.isArray(f))for(const h of f)u(h.v,o,h.i??-1);else u(f.v,o,-1)}}function k0(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 Xs{constructor(e,n,r){this.options={...Fe,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new f3(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=ll(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Zd))throw new Error(i3);if(this._myIndex=n||ag(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=Y3(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(Un(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});z3(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)k0(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&&k0(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:u,ignoreFieldNorm:o}=this.options;if(Ln(e)&&!e.trim()){let g=this._docs.map((d,m)=>({item:d,refIndex:m}));return Wo(r)&&r>-1&&(g=g.slice(0,r)),g}const f=Wo(r)&&r>0&&Ln(e);let h;if(f){const g=new U3(r);Ln(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:o}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:o}),h=g.extractSorted(u)}else h=Ln(e)?Ln(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),F3(h,{ignoreFieldNorm:o}),i&&h.sort(u),Wo(r)&&r>-1&&(h=h.slice(0,r));return j3(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:u,i:o,n:f})=>{if(!Un(u))return;const{isMatch:h,score:g,indices:d}=s.searchIn(u);if(h){const m={item:u,idx:o,matches:[{score:g,value:u,norm:f,indices:d}]};n?(m.score=xf(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):i.push(m)}}),i}_searchLogical(e){const n=lg(e,this.options),r=(u,o,f)=>{if(!("children"in u)){const{keyId:m,searcher:b}=u;let _;return m===null?(_=[],this._myIndex.keys.forEach((T,v)=>{_.push(...this._findMatches({key:T,value:o[v],searcher:b}))})):_=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(o,m),searcher:b}),_&&_.length?[{idx:f,item:o,matches:_}]:[]}const{children:h,operator:g}=u,d=[];for(let m=0,b=h.length;m<b;m+=1){const _=h[m],T=r(_,o,f);if(T.length)d.push(...T);else if(g===cl.AND)return[]}return d},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:u,i:o})=>{if(Un(u)){const f=r(n,u,o);f.length&&(a.has(o)||(a.set(o,{idx:o,item:u,matches:[]}),i.push(a.get(o))),f.forEach(({matches:h})=>{a.get(o).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,u=n?null:[];return i.forEach(({$:o,i:f})=>{if(!Un(o))return;const h=[];let g=!1,d=!1;if(a.forEach((m,b)=>{const _=this._findMatches({key:m,value:o[b],searcher:s});_.length?(h.push(..._),_[0].hasInverse&&(d=!0)):g=!0}),!(d&&g)&&h.length){const m={idx:f,item:o,matches:h};n?(m.score=xf(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):u.push(m)}}),u}_findMatches({key:e,value:n,searcher:r}){if(!Un(n))return[];const s=[];if(Ks(n))n.forEach(({v:a,i,n:u})=>{if(!Un(a))return;const{isMatch:o,score:f,indices:h,hasInverse:g}=r.searchIn(a);o&&s.push({score:f,key:e,value:a,idx:i,norm:u,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:u,score:o,indices:f,hasInverse:h}=r.searchIn(a);u&&s.push({score:o,key:e,value:a,norm:i,indices:f,hasInverse:h})}return s}}class W3{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 u of r){this.termSearchers.push(new eh(u,{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 o=a.get(u)||0,f=Math.log(1+(i-o+.5)/(o+.5));this.idfWeights.push(f)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let o=0;o<this.termSearchers.length;o++){const f=this.termSearchers[o].searchIn(e),h=this.idfWeights[o];s+=h,f.isMatch&&(a++,r+=h*(1-f.score),f.indices&&n.push(...f.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,u={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(u.indices=Jd(n)),u}}Xs.version="7.3.0";Xs.createIndex=ag;Xs.parseIndex=E3;Xs.config=Fe;Xs.match=function(t,e,n){return ll(t,{...Fe,...n}).searchIn(e)};Xs.parseQuery=lg;th(P3);th(W3);Xs.use=function(...t){t.forEach(e=>th(e))};function G3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=o=>{a.has(o.path)||(a.add(o.path),s.push(o))};for(const o of t)o.title.toLowerCase()===r&&i(o);for(const o of t)o.title.toLowerCase().startsWith(r)&&i(o);for(const o of t)o.title.toLowerCase().includes(r)&&i(o);const u=new Xs(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const o of u.search(e))i(o.item);return s.slice(0,n)}const K3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function cg(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function fg(...t){return t.filter(e=>e!=="").join("/")}function V3(t){return K3.has(cg(t))}function X3(t){return fg(Je.content,t,"assets")}function Ou(t,e){return fg(Je.content,t,e)}function to(t,e){return Aa(`/api/read?path=${encodeURIComponent(Ou(t,e))}`)}function dg(t){return`assets/${t}`}function hg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=cg(t),s=hs(n)||"image";return r===""?s:`${s}.${r}`}class Q3{async list(e){return await(await mt(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await mt(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await mt(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return new Uint8Array(await n.arrayBuffer())}async exists(e){return(await(await mt(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function Go(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function P0(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Sc=ee(0);const nh={get value(){return c(Sc)},bump(){y(Sc,c(Sc)+1)}};function Z3(t){return{image:()=>{},file:e=>J3(e)?to(t,e):void 0}}function J3(t){return t.startsWith("assets/")}const ey=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
10
10
  <rect width='800' height='450' fill='#e2e8f0'/>
11
11
  <path d='M0 0 800 450 M800 0 0 450' stroke='#cbd5e1' stroke-width='2'/>
12
12
  <rect x='300' y='150' width='200' height='130' rx='10' fill='#cbd5e1'/>
13
13
  <circle cx='350' cy='195' r='18' fill='#94a3b8'/>
14
14
  <path d='M308 280 380 210 432 258 470 228 492 280Z' fill='#94a3b8'/>
15
15
  <text x='400' y='330' font-family='system-ui, sans-serif' font-size='24' fill='#64748b' text-anchor='middle'>image</text>
16
- </svg>`,hg=`data:image/svg+xml,${encodeURIComponent(V3)}`;function X3(t){switch(t.type){case"image":return hg;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 Q3(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=X3(n));return e}function Z3(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 J3(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 ey(t){return t.startsWith(`${Je.components}/`)}function ty(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}function ny(t,e){const n=e.filter(s=>s.multiple!==!0).map(s=>`${s.name}="{${s.name}}"`).join(" "),r=n===""?`<${t}>`:`<${t} ${n}>`;return`<!doctype html>
16
+ </svg>`,pg=`data:image/svg+xml,${encodeURIComponent(ey)}`;function ty(t){switch(t.type){case"image":return pg;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 ny(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=ty(n));return e}function ry(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 sy(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 ay(t){return t.startsWith(`${Je.components}/`)}function iy(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}function uy(t,e){const n=e.filter(s=>s.multiple!==!0).map(s=>`${s.name}="{${s.name}}"`).join(" "),r=n===""?`<${t}>`:`<${t} ${n}>`;return`<!doctype html>
17
17
  <html lang="en">
18
18
  <head>
19
19
  <meta charset="utf-8" />
@@ -24,7 +24,7 @@ ${f}
24
24
  <body>
25
25
  ${r}Sample slot content</${t}>
26
26
  </body>
27
- </html>`}function M0(){return{image:()=>{},file:t=>sy(t)?hg:void 0}}const ry=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function sy(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:ry.test(t)}const et=new W3,Df=new Map;let kf,Pf,Mf,fl,Bf;function rh(){return Bf??(Bf=Md(et)),Bf}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 rh()),t.sort()}async function ay(){const t=await mt("/api/authors");return t.ok?await t.json():[]}function Hi(){Bf=void 0,nh.bump()}const B0=".json",sh="_sort.json",iy="assets",uy=new Set([sh,"_redirects.json","_site.json"]);function Uf(t,e){return t===""?e:`${t}/${e}`}function ah(t){return t===""?Je.content:`${Je.content}/${t}`}async function ih(t){try{return om(JSON.parse(await et.readText(`${t}/${sh}`)))}catch{return{order:[]}}}function oy(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 ly(t){try{const{title:e}=Zu(JSON.parse(await et.readText(t)));return e===""?void 0:e}catch{return}}async function Hf(t){return t===""?"Home":(await ih(ah(t))).name??Pd(Go(t))}async function cy(t){return await ly(Ps(Uf(t,"index")))??await Hf(t)}async function pg(t){const e=ah(t),[n,r]=await Promise.all([et.list(e),ih(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(uy.has(a.name)||!a.name.endsWith(B0))continue;const i=a.name.slice(0,-B0.length);try{const u=Zu(JSON.parse(await et.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:Uf(t,i),title:u.title,isPublished:u.isPublished,template:u.template})}catch{}}else if(a.name!==iy){const i=Uf(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await cy(i)})}return{entries:oy(s,r.order),defaultTemplate:r.defaultTemplate}}function fy(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 mg(t,e=30){return t.trim()===""?[]:j3(fy(await rh()),t,e)}async function dy(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await ih(ah(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function hy(t){const e=Df.get(t);if(e!==void 0)return e;const n=await Ud(et,t);return Df.set(t,n),n}function no(){return kf??(kf=Bd(et)),kf}function py(){return Pf??(Pf=fm(et)),Pf}function my(){return Mf??(Mf=dm(et)),Mf}async function gy(t){const[e,n]=await Promise.all([hy(t),no()]);return Oi(e,n)}function by(){return fl??(fl=Hd(et)),fl}async function vy(){const[t,e]=await Promise.all([by(),no()]);return t===void 0?[]:Oi(t,e).filter(n=>n.name!=="title")}const qf=`${Je.templates}/${Ju}.html`;function dx(){return et.exists(qf)}const Ey=`<!doctype html>
27
+ </html>`}function M0(){return{image:()=>{},file:t=>ly(t)?pg:void 0}}const oy=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function ly(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:oy.test(t)}const et=new Q3,Df=new Map;let kf,Pf,Mf,fl,Bf;function rh(){return Bf??(Bf=Md(et)),Bf}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 rh()),t.sort()}async function cy(){const t=await mt("/api/authors");return t.ok?await t.json():[]}function Hi(){Bf=void 0,nh.bump()}const B0=".json",sh="_sort.json",fy="assets",dy=new Set([sh,"_redirects.json","_site.json"]);function Uf(t,e){return t===""?e:`${t}/${e}`}function ah(t){return t===""?Je.content:`${Je.content}/${t}`}async function ih(t){try{return lm(JSON.parse(await et.readText(`${t}/${sh}`)))}catch{return{order:[]}}}function hy(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 py(t){try{const{title:e}=Zu(JSON.parse(await et.readText(t)));return e===""?void 0:e}catch{return}}async function Hf(t){return t===""?"Home":(await ih(ah(t))).name??Pd(Go(t))}async function my(t){return await py(Ps(Uf(t,"index")))??await Hf(t)}async function mg(t){const e=ah(t),[n,r]=await Promise.all([et.list(e),ih(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(dy.has(a.name)||!a.name.endsWith(B0))continue;const i=a.name.slice(0,-B0.length);try{const u=Zu(JSON.parse(await et.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:Uf(t,i),title:u.title,isPublished:u.isPublished,template:u.template})}catch{}}else if(a.name!==fy){const i=Uf(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await my(i)})}return{entries:hy(s,r.order),defaultTemplate:r.defaultTemplate}}function gy(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 gg(t,e=30){return t.trim()===""?[]:G3(gy(await rh()),t,e)}async function by(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await ih(ah(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function vy(t){const e=Df.get(t);if(e!==void 0)return e;const n=await Ud(et,t);return Df.set(t,n),n}function no(){return kf??(kf=Bd(et)),kf}function Ey(){return Pf??(Pf=dm(et)),Pf}function Ty(){return Mf??(Mf=hm(et)),Mf}async function _y(t){const[e,n]=await Promise.all([vy(t),no()]);return Oi(e,n)}function Ay(){return fl??(fl=Hd(et)),fl}async function yy(){const[t,e]=await Promise.all([Ay(),no()]);return t===void 0?[]:Oi(t,e).filter(n=>n.name!=="title")}const qf=`${Je.templates}/${Ju}.html`;function vx(){return et.exists(qf)}const Ny=`<!doctype html>
28
28
  <html lang="en">
29
29
  <head>
30
30
  <meta charset="utf-8" />
@@ -36,98 +36,98 @@ ${f}
36
36
  <slot></slot>
37
37
  </body>
38
38
  </html>
39
- `;async function hx(){if(await et.exists(qf))return;const t=await mt(`/api/write?path=${encodeURIComponent(qf)}`,{method:"POST",body:Ey});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);fl=void 0}async function px(){const t=await no();return[...t.entries()].map(([e,n])=>({tag:e,props:Oi(n,t).map(r=>r.name)}))}async function F0(t){const e=await et.readText(`${Je.content}/${t}.json`);return Zu(JSON.parse(e))}async function gg(t,e){const n=`${Je.content}/${t}.json`,r=await mt(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);Hi()}function Ty(){return PA(et)}async function _y(){const t=await mt("/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 Ay(){const t=await mt("/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 U0(t,e){const n=await et.readText(`${Je.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await gg(t,`${JSON.stringify(r,null,2)}
40
- `)}async function yy(t,e){return(await et.list(z3(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function Ny(t){return yy(t,e=>!Y3(e))}async function uh(t,e){const n=dg(e.name),r=fg(n),s=await mt(`/api/write?path=${encodeURIComponent(Ou(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return r}async function Sy(t,e){try{await dl(Ou(t,e))}catch{}}async function jf(t){const e=[],n=async(r,s)=>{for(const a of await et.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()}const bg=new Set(["css","js","mjs","cjs","json","webmanifest","svg","xml","txt","md","html","htm"]);function vg(t){const e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1).toLowerCase()}async function Iy(){const t=[],e=async(n,r)=>{for(const s of await et.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):bg.has(vg(s.name))&&t.push(a)}};return await e(Je.public,""),t.sort()}const mx=["templates","components","public"],Eg=".gitkeep";function Tg(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function Cy(t){const e=Tg(t),n=[],r=[];for(const s of await et.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===Eg)continue;if(e){if(t===Je.templates&&s.name===`${Ju}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else bg.has(vg(s.name))&&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 gx(t){const e=[t],n=async r=>{for(const s of await Cy(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function bx(t,e){const n=e.split("/").map(i=>hs(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${Eg}`;if(await et.exists(s))throw new Error(`"${r}" already exists.`);const a=await mt(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return r}async function vx(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(Tg(t)?qy(t,r):Ca(t,r)),r)}async function Ex(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 Ca(t,r),r)}function wy(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 Tx(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([jf("templates"),jf("components"),Iy()]);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:wy(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,u)=>u.score-i.score||i.hit.label.localeCompare(u.hit.label)).slice(0,30).map(i=>i.hit)}function _x(t){return et.readText(t)}async function Ax(t){if(await et.exists(t))throw new Error(`"${t}" already exists.`);const e=await mt(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`)}async function yx(t,e){const n=`${t}/${dg(e.name)}`;if(await et.exists(n))throw new Error(`"${n}" already exists.`);const r=await mt(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",body:await e.arrayBuffer()});if(!r.ok)throw new Error(`Upload failed (${r.status})`);return n}async function _g(t,e,n){const r=`${Je.content}/${t}.json`;if(await et.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 mt(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
41
- `});if(!a.ok)throw new Error(`Create failed (${a.status})`);Hi()}function Ly(t){return et.exists(`${Je.content}/${t}.json`)}async function Oy(t,e){const n=e.split("/").map(o=>({raw:o.trim(),slug:hs(o)})).filter(o=>o.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(o=>o.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${Je.content}/${a}/${sh}`;if(await et.exists(i))throw new Error(`"${a}" already exists.`);const u=await mt(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
42
- `});if(!u.ok)throw new Error(`Create folder failed (${u.status})`);return Hi(),a}function oh(t){return t===""?`${Je.content}/_sort.json`:`${Je.content}/${t}/_sort.json`}async function lh(t){try{const e=JSON.parse(await et.readText(oh(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function xy(t){const e=await lh(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function Ry(t,e){const n=await lh(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await mt(`/api/write?path=${encodeURIComponent(oh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
43
- `});if(!r.ok)throw new Error(`Save failed (${r.status})`)}async function Dy(t,e){const n=await lh(t);n.order=[...e];const r=await mt(`/api/write?path=${encodeURIComponent(oh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
44
- `});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function Nx(t,e){const n=await mt(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);ch(t)}function ch(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&(Df.clear(),kf=void 0,fl=void 0,nh.bump()),t.some(n=>n.startsWith(`${Je.components}/`))&&(Pf=void 0,Mf=void 0),t.some(n=>n.startsWith(`${Je.content}/`))&&Hi()}function Ps(t){return`${Je.content}/${t}.json`}function ii(t){return`${Je.content}/${t}`}async function dl(t){const e=await mt(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);ch(t)}async function Ca(t,e){const n=await mt(`/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}.`)}ch(t,e)}const ky=/assets\/[A-Za-z0-9._-]+/g;async function Py(t,e,n){const r=Ou(t,n),s=Ou(e,n);if(r===s)return;const a=await mt(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await mt(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function My(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 et.exists(Ps(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await et.readText(Ps(t));for(const u of new Set(i.match(ky)??[]))await Py(s,e,u);return await Ca(Ps(t),Ps(a)),Hi(),a}async function By(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 et.exists(ii(a)))throw new Error(`A folder named "${r}" already exists there.`);return await Ca(ii(t),ii(a)),Hi(),a}const Ag=`${Je.content}/_redirects.json`;async function Fy(){try{const t=JSON.parse(await et.readText(Ag));return Array.isArray(t)?t:[]}catch{return[]}}async function Io(t,e){if(t!==e)try{const n=await Fy();n.push({from:t,to:e});const r=await mt(`/api/write?path=${encodeURIComponent(Ag)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
45
- `});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const yg=`${Je.content}/_site.json`;async function Uy(){try{const t=JSON.parse(await et.readText(yg));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function Hy(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
46
- `,r=await mt(`/api/write?path=${encodeURIComponent(yg)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const Ng=["html","css","js"];async function Sx(t){const e=t.replace(/\.html$/,"");await Promise.all(Ng.map(n=>dl(`${e}.${n}`)))}async function qy(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of Ng){const a=`${n}.${s}`;await et.exists(a)&&await Ca(a,`${r}.${s}`)}}async function jy(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await wA(et,t,{draft:e,media:G3(n)});return r==null?void 0:r.html}async function Ix(t){return Oi(t,await no())}async function Cx(t,e,n){const[r,s,a,i]=await Promise.all([no(),py(),my(),rh()]),u=Jm(i),o=h=>({...Z3(Q3(h),n),...J3(h,n)});if(ey(t)){const h=ty(t),g=new Map(r).set(h,e.html),d=H0(new Map(s),h,e.css),m=H0(new Map(a),h,e.js),b=Oi(e.html,g);return Ef({template:ny(h,b),scope:o(b),components:g,componentStyles:d,componentScripts:m,context:u,media:M0()})}const f=Oi(e.html,r);return Ef({template:e.html,scope:o(f),components:r,componentStyles:s,componentScripts:a,context:u,media:M0(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}})}function H0(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function $y(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 Sg="nanoesis:tree-expanded";function Yy(){try{const t=JSON.parse(localStorage.getItem(Sg)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const Ws=Tt({}),ui=Tt({}),xi=Tt(Yy());function Ig(){const t=Object.keys(xi).filter(e=>xi[e]);localStorage.setItem(Sg,JSON.stringify(t))}function ri(t){return Ws[t]}function zy(t){return ui[t]===!0}function Va(t){return t===""||xi[t]===!0}async function Bl(t){if(!(Ws[t]!==void 0||ui[t])){ui[t]=!0;try{Ws[t]=await pg(t)}finally{ui[t]=!1}}}async function Pn(t){ui[t]=!0;try{Ws[t]=await pg(t)}finally{ui[t]=!1}}function $f(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function Cg(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function Yf(t,e,n){const r=Ws[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(Ws[t]={...r,entries:a})}function Wy(t,e){const n=Cg(t);if(n!==null){n!==""&&Yf($f(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}Yf($f(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function Gy(t,e){Cg(t)===null&&Yf($f(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function Ky(t,e){const n=Ws[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);Ws[t]={...n,entries:s}}async function q0(t){Va(t)?xi[t]=!1:(xi[t]=!0,await Bl(t)),Ig()}async function Ji(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,xi[n]=!0,await Bl(n);Ig()}let ln=ee(null);const Co={get pending(){return c(ln)}};function hl(t,e={}){return new Promise(n=>{y(ln,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function vu(t,e={}){return new Promise(n=>{y(ln,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function wx(t,e,n={}){return new Promise(r=>{y(ln,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function en(t,e={}){return new Promise(n=>{y(ln,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Ic(t){var e;((e=c(ln))==null?void 0:e.kind)==="confirm"&&(c(ln).resolve(t),y(ln,null))}function Cc(t){var e;((e=c(ln))==null?void 0:e.kind)==="prompt"&&(c(ln).resolve(t),y(ln,null))}function wc(t){var e;((e=c(ln))==null?void 0:e.kind)==="select"&&(c(ln).resolve(t),y(ln,null))}function j0(){var t;((t=c(ln))==null?void 0:t.kind)==="alert"&&(c(ln).resolve(),y(ln,null))}/**
39
+ `;async function Ex(){if(await et.exists(qf))return;const t=await mt(`/api/write?path=${encodeURIComponent(qf)}`,{method:"POST",body:Ny});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);fl=void 0}async function Tx(){const t=await no();return[...t.entries()].map(([e,n])=>({tag:e,props:Oi(n,t).map(r=>r.name)}))}async function F0(t){const e=await et.readText(`${Je.content}/${t}.json`);return Zu(JSON.parse(e))}async function bg(t,e){const n=`${Je.content}/${t}.json`,r=await mt(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);Hi()}function Sy(){return HA(et)}async function Iy(){const t=await mt("/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 Cy(){const t=await mt("/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 U0(t,e){const n=await et.readText(`${Je.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await bg(t,`${JSON.stringify(r,null,2)}
40
+ `)}async function wy(t,e){return(await et.list(X3(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function Ly(t){return wy(t,e=>!V3(e))}async function uh(t,e){const n=hg(e.name),r=dg(n),s=await mt(`/api/write?path=${encodeURIComponent(Ou(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return r}async function Oy(t,e){try{await dl(Ou(t,e))}catch{}}async function jf(t){const e=[],n=async(r,s)=>{for(const a of await et.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()}const vg=new Set(["css","js","mjs","cjs","json","webmanifest","svg","xml","txt","md","html","htm"]);function Eg(t){const e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1).toLowerCase()}async function xy(){const t=[],e=async(n,r)=>{for(const s of await et.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):vg.has(Eg(s.name))&&t.push(a)}};return await e(Je.public,""),t.sort()}const _x=["templates","components","public"],Tg=".gitkeep";function _g(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function Ry(t){const e=_g(t),n=[],r=[];for(const s of await et.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===Tg)continue;if(e){if(t===Je.templates&&s.name===`${Ju}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else vg.has(Eg(s.name))&&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 Ax(t){const e=[t],n=async r=>{for(const s of await Ry(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function yx(t,e){const n=e.split("/").map(i=>hs(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${Tg}`;if(await et.exists(s))throw new Error(`"${r}" already exists.`);const a=await mt(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return r}async function Nx(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(_g(t)?Wy(t,r):Ca(t,r)),r)}async function Sx(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 Ca(t,r),r)}function Dy(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 Ix(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([jf("templates"),jf("components"),xy()]);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:Dy(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,u)=>u.score-i.score||i.hit.label.localeCompare(u.hit.label)).slice(0,30).map(i=>i.hit)}function Cx(t){return et.readText(t)}async function wx(t){if(await et.exists(t))throw new Error(`"${t}" already exists.`);const e=await mt(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`)}async function Lx(t,e){const n=`${t}/${hg(e.name)}`;if(await et.exists(n))throw new Error(`"${n}" already exists.`);const r=await mt(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",body:await e.arrayBuffer()});if(!r.ok)throw new Error(`Upload failed (${r.status})`);return n}async function Ag(t,e,n){const r=`${Je.content}/${t}.json`;if(await et.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 mt(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
41
+ `});if(!a.ok)throw new Error(`Create failed (${a.status})`);Hi()}function ky(t){return et.exists(`${Je.content}/${t}.json`)}async function Py(t,e){const n=e.split("/").map(o=>({raw:o.trim(),slug:hs(o)})).filter(o=>o.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(o=>o.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${Je.content}/${a}/${sh}`;if(await et.exists(i))throw new Error(`"${a}" already exists.`);const u=await mt(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
42
+ `});if(!u.ok)throw new Error(`Create folder failed (${u.status})`);return Hi(),a}function oh(t){return t===""?`${Je.content}/_sort.json`:`${Je.content}/${t}/_sort.json`}async function lh(t){try{const e=JSON.parse(await et.readText(oh(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function My(t){const e=await lh(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function By(t,e){const n=await lh(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await mt(`/api/write?path=${encodeURIComponent(oh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
43
+ `});if(!r.ok)throw new Error(`Save failed (${r.status})`)}async function Fy(t,e){const n=await lh(t);n.order=[...e];const r=await mt(`/api/write?path=${encodeURIComponent(oh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
44
+ `});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function Ox(t,e){const n=await mt(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);ch(t)}function ch(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&(Df.clear(),kf=void 0,fl=void 0,nh.bump()),t.some(n=>n.startsWith(`${Je.components}/`))&&(Pf=void 0,Mf=void 0),t.some(n=>n.startsWith(`${Je.content}/`))&&Hi()}function Ps(t){return`${Je.content}/${t}.json`}function ii(t){return`${Je.content}/${t}`}async function dl(t){const e=await mt(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);ch(t)}async function Ca(t,e){const n=await mt(`/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}.`)}ch(t,e)}const Uy=/assets\/[A-Za-z0-9._-]+/g;async function Hy(t,e,n){const r=Ou(t,n),s=Ou(e,n);if(r===s)return;const a=await mt(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await mt(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function qy(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 et.exists(Ps(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await et.readText(Ps(t));for(const u of new Set(i.match(Uy)??[]))await Hy(s,e,u);return await Ca(Ps(t),Ps(a)),Hi(),a}async function jy(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 et.exists(ii(a)))throw new Error(`A folder named "${r}" already exists there.`);return await Ca(ii(t),ii(a)),Hi(),a}const yg=`${Je.content}/_redirects.json`;async function $y(){try{const t=JSON.parse(await et.readText(yg));return Array.isArray(t)?t:[]}catch{return[]}}async function Io(t,e){if(t!==e)try{const n=await $y();n.push({from:t,to:e});const r=await mt(`/api/write?path=${encodeURIComponent(yg)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
45
+ `});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const Ng=`${Je.content}/_site.json`;async function Yy(){try{const t=JSON.parse(await et.readText(Ng));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function zy(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
46
+ `,r=await mt(`/api/write?path=${encodeURIComponent(Ng)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const Sg=["html","css","js"];async function xx(t){const e=t.replace(/\.html$/,"");await Promise.all(Sg.map(n=>dl(`${e}.${n}`)))}async function Wy(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of Sg){const a=`${n}.${s}`;await et.exists(a)&&await Ca(a,`${r}.${s}`)}}async function Gy(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await DA(et,t,{draft:e,media:Z3(n)});return r==null?void 0:r.html}async function Rx(t){return Oi(t,await no())}async function Dx(t,e,n){const[r,s,a,i]=await Promise.all([no(),Ey(),Ty(),rh()]),u=eg(i),o=h=>({...ry(ny(h),n),...sy(h,n)});if(ay(t)){const h=iy(t),g=new Map(r).set(h,e.html),d=H0(new Map(s),h,e.css),m=H0(new Map(a),h,e.js),b=Oi(e.html,g);return Ef({template:uy(h,b),scope:o(b),components:g,componentStyles:d,componentScripts:m,context:u,media:M0()})}const f=Oi(e.html,r);return Ef({template:e.html,scope:o(f),components:r,componentStyles:s,componentScripts:a,context:u,media:M0(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}})}function H0(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function Ky(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 Ig="nanoesis:tree-expanded";function Vy(){try{const t=JSON.parse(localStorage.getItem(Ig)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const Ws=Tt({}),ui=Tt({}),xi=Tt(Vy());function Cg(){const t=Object.keys(xi).filter(e=>xi[e]);localStorage.setItem(Ig,JSON.stringify(t))}function ri(t){return Ws[t]}function Xy(t){return ui[t]===!0}function Va(t){return t===""||xi[t]===!0}async function Bl(t){if(!(Ws[t]!==void 0||ui[t])){ui[t]=!0;try{Ws[t]=await mg(t)}finally{ui[t]=!1}}}async function Pn(t){ui[t]=!0;try{Ws[t]=await mg(t)}finally{ui[t]=!1}}function $f(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function wg(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function Yf(t,e,n){const r=Ws[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(Ws[t]={...r,entries:a})}function Qy(t,e){const n=wg(t);if(n!==null){n!==""&&Yf($f(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}Yf($f(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function Zy(t,e){wg(t)===null&&Yf($f(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function Jy(t,e){const n=Ws[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);Ws[t]={...n,entries:s}}async function q0(t){Va(t)?xi[t]=!1:(xi[t]=!0,await Bl(t)),Cg()}async function Ji(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,xi[n]=!0,await Bl(n);Cg()}let ln=ee(null);const Co={get pending(){return c(ln)}};function hl(t,e={}){return new Promise(n=>{y(ln,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function vu(t,e={}){return new Promise(n=>{y(ln,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function kx(t,e,n={}){return new Promise(r=>{y(ln,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function en(t,e={}){return new Promise(n=>{y(ln,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Ic(t){var e;((e=c(ln))==null?void 0:e.kind)==="confirm"&&(c(ln).resolve(t),y(ln,null))}function Cc(t){var e;((e=c(ln))==null?void 0:e.kind)==="prompt"&&(c(ln).resolve(t),y(ln,null))}function wc(t){var e;((e=c(ln))==null?void 0:e.kind)==="select"&&(c(ln).resolve(t),y(ln,null))}function j0(){var t;((t=c(ln))==null?void 0:t.kind)==="alert"&&(c(ln).resolve(),y(ln,null))}const Lg="nanoesis-restore:",Og="nanoesis:unit-values:",xg="nanoesis:tree-expanded",Rg="nanoesis:dev-tree-expanded";function eN(t){t.removeItem(xg),t.removeItem(Rg);for(let e=t.length-1;e>=0;e--){const n=t.key(e);n!==null&&(n.startsWith(Lg)||n.startsWith(Og))&&t.removeItem(n)}}function $0(t,e){t.removeItem(`${Lg}${e}`),t.removeItem(`${Og}${e}`);for(const n of[xg,Rg]){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{}}}/**
47
47
  * @file
48
48
  * @license @lucide/svelte v1.16.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const Vy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
52
+ */const tN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
53
53
  * @file
54
54
  * @license @lucide/svelte v1.16.0 - ISC
55
55
  *
56
56
  * This source code is licensed under the ISC license.
57
57
  * See the LICENSE file in the root directory of this source tree.
58
- */const Xy=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
58
+ */const nN=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
59
59
  * @file
60
60
  * @license @lucide/svelte v1.16.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */const Qy=Symbol("lucide-context"),Zy=()=>xv(Qy);var Jy=_E("<svg><!><!></svg>");function kr(t,e){ct(e,!0);const n=Zy()??{},r=ur(e,"color",19,()=>n.color??"currentColor"),s=ur(e,"size",19,()=>n.size??24),a=ur(e,"strokeWidth",19,()=>n.strokeWidth??2),i=ur(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),u=ur(e,"iconNode",19,()=>[]),o=pr(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),f=Ae(()=>i()?Number(a())*24/Number(s()):a());var h=Jy();Xh(h,m=>({...Vy,...m,...o,width:s(),height:s(),stroke:r(),"stroke-width":c(f),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!Xy(o)&&{"aria-hidden":"true"}]);var g=I(h);Ot(g,17,u,Iu,(m,b)=>{var _=Ae(()=>Zb(c(b),2));let T=()=>c(_)[0],v=()=>c(_)[1];var O=Ir(),L=pt(O);RE(L,T,!0,(B,C)=>{Xh(B,()=>({...v()}))}),H(m,O)});var d=R(g);OE(d,()=>e.children??Ad),H(t,h),ft()}function fh(t,e){let n=pr(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"}]];kr(t,Rr({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function eN(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];kr(t,Rr({name:"plus"},()=>n,{get iconNode(){return r}}))}function dh(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];kr(t,Rr({name:"x"},()=>n,{get iconNode(){return r}}))}function tN(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];kr(t,Rr({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function nN(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];kr(t,Rr({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function wg(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];kr(t,Rr({name:"search"},()=>n,{get iconNode(){return r}}))}function rN(t,e){let n=pr(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"}]];kr(t,Rr({name:"house"},()=>n,{get iconNode(){return r}}))}function sN(t,e){let n=pr(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"}]];kr(t,Rr({name:"link"},()=>n,{get iconNode(){return r}}))}function aN(t,e){let n=pr(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"}]];kr(t,Rr({name:"external-link"},()=>n,{get iconNode(){return r}}))}function zf(t,e){let n=pr(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"}]];kr(t,Rr({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function iN(t,e){let n=pr(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"}]];kr(t,Rr({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}let hh=ee(null),ph=ee(null);function si(){return c(hh)}function $0(){return c(ph)}function uN(t,e){y(hh,{entry:t,parent:e},!0)}function Lc(t){y(ph,t,!0)}function Ss(){y(hh,null),y(ph,null)}let Oc=ee(null);const Wf={get target(){return c(Oc)},request(t){y(Oc,t,!0)},clear(){y(Oc,null)}};function oN(){let t=ee("content");return{get mode(){return c(t)},set(e){y(t,e,!0)}}}const Cs=oN(),lN="nanoesis-restore:";function Gf(t){return`${lN}${t}`}function cN(t,e,n){t.getItem(Gf(e))===null&&t.setItem(Gf(e),JSON.stringify(n))}function fN(t,e){const n=t.getItem(Gf(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function dN(){let t=ee("saved"),e=null;return{get state(){return c(t)},get canRetry(){return c(t)==="error"&&e!==null},saving(){y(t,"saving")},saved(){y(t,"saved"),e=null},failed(n){y(t,"error"),e=n},retry(){e==null||e()},reset(){y(t,"saved"),e=null}}}const ws=dN(),hN=new Set(["title","created","published","updated"]);function pN(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 mN(t,e,n){if(t.type==="authors")return pN(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 gN(t){return t===""||Array.isArray(t)&&t.length===0}function Y0(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 u of e){const o=n[u.name]??"";if(hN.has(u.name)){a[u.name]=u.name==="title"?o:o||void 0;continue}const f=mN(u,t.fields[u.name],o);gN(f)?delete s[u.name]:s[u.name]=f}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)}
65
- `}function Kf(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 bN=0;var vN=W('<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>'),EN=W('<ul class="pills svelte-5hnbr8"></ul>'),TN=W('<li role="option"> </li>'),_N=W('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),AN=W('<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 yN(t,e){ct(e,!0);function n(J){if(J.trim()==="")return[];try{const ne=JSON.parse(J);return Array.isArray(ne)?ne.flatMap(ge=>{if(ge===null||typeof ge!="object")return[];const be=ge,pe=typeof be.name=="string"?be.name:"";return pe.trim()===""?[]:[{name:pe,...typeof be.user=="string"&&be.user!==""?{user:be.user}:{}}]}):[]}catch{return[]}}const r=Ae(()=>n(e.value)),s=`authors-${++bN}`;let a=ee(Tt([])),i=ee(""),u=ee(!1),o=ee(0),f=ee(void 0),h=ee(null),g=ee(null);kt(()=>{ay().then(J=>y(a,J,!0))});const d=Ae(()=>new Map(c(a).map(J=>[J.user,J.name]))),m=Ae(()=>new Set(c(r).map(J=>J.user).filter(J=>J!==void 0)));function b(J){return J.user!==void 0?c(d).get(J.user)??J.name:J.name}const _=Ae(()=>{const J=c(i).trim().toLowerCase();return J===""?[]:c(a).filter(ne=>!c(m).has(ne.user)&&ne.name.toLowerCase().includes(J)).slice(0,6)}),T=Ae(()=>c(u)&&c(i).trim()!==""),v=Ae(()=>c(_).length),O=Ae(()=>c(T)?c(o)<c(_).length?`${s}-opt-${c(o)}`:`${s}-guest`:void 0);function L(J){e.onchange(J.length===0?"":JSON.stringify(J))}function B(J){c(m).has(J.user)||(L([...c(r),{name:J.name,user:J.user}]),y(i,""))}function C(J){const ne=J.trim();ne!==""&&(L([...c(r),{name:ne}]),y(i,""))}function q(){const J=c(_)[c(o)];J!==void 0?B(J):C(c(i))}function x(){var J,ne;(ne=(J=c(f))==null?void 0:J.children[c(o)])==null||ne.scrollIntoView({block:"nearest"})}function j(J){if(!c(T)){J.key==="Enter"&&(J.preventDefault(),C(c(i)));return}const ne=c(_).length+1;J.key==="ArrowDown"?(J.preventDefault(),y(o,(c(o)+1)%ne),x()):J.key==="ArrowUp"?(J.preventDefault(),y(o,(c(o)-1+ne)%ne),x()):J.key==="Enter"?(J.preventDefault(),q()):J.key==="Escape"&&(J.preventDefault(),y(i,""))}function Z(J){L(c(r).filter((ne,ge)=>ge!==J))}function Y(J,ne){var ge;y(h,J,!0),(ge=ne.dataTransfer)==null||ge.setData("text/plain",String(J)),ne.dataTransfer&&(ne.dataTransfer.effectAllowed="move")}function E(J,ne){c(h)!==null&&(ne.preventDefault(),y(g,J,!0))}function k(J){c(h)!==null&&c(h)!==J&&L(Kf(c(r),c(h),J)),y(h,null),y(g,null)}function S(){y(h,null),y(g,null)}var U=AN(),F=I(U);{var M=J=>{var ne=EN();Ot(ne,21,()=>c(r),Iu,(ge,be,pe)=>{var Se=vN();let ie;var he=I(Se),Ce=I(he);zf(Ce,{size:14});var Ne=R(he,2),Ie=I(Ne),Le=R(Ne,2),Re=I(Le);dh(Re,{size:14,"aria-hidden":"true"}),ue(($e,We)=>{ie=it(Se,1,"pill svelte-5hnbr8",null,ie,{guest:c(be).user===void 0,dragging:c(h)===pe,over:c(g)===pe&&c(h)!==pe}),me(Ne,"title",c(be).user??"Guest"),fe(Ie,$e),me(Le,"aria-label",We)},[()=>b(c(be)),()=>`Remove ${b(c(be))}`]),Be("dragstart",Se,$e=>Y(pe,$e)),Be("dragover",Se,$e=>E(pe,$e)),Be("drop",Se,()=>k(pe)),Be("dragend",Se,S),ae("click",Le,()=>Z(pe)),H(ge,Se)}),H(J,ne)};de(F,J=>{c(r).length>0&&J(M)})}var Q=R(F,2),z=I(Q),$=R(z,2);{var X=J=>{var ne=_N(),ge=I(ne);Ot(ge,19,()=>c(_),ie=>ie.user,(ie,he,Ce)=>{var Ne=TN();let Ie;var Le=I(Ne);ue(()=>{me(Ne,"id",`${s}-opt-${c(Ce)}`),Ie=it(Ne,1,"option svelte-5hnbr8",null,Ie,{active:c(Ce)===c(o)}),me(Ne,"aria-selected",c(Ce)===c(o)),fe(Le,c(he).name)}),ae("click",Ne,()=>B(c(he))),Be("mouseenter",Ne,()=>y(o,c(Ce),!0)),H(ie,Ne)});var be=R(ge,2);let pe;var Se=I(be);dn(ne,ie=>y(f,ie),()=>c(f)),ue(ie=>{me(ne,"id",`${s}-listbox`),me(be,"id",`${s}-guest`),pe=it(be,1,"option guest-option svelte-5hnbr8",null,pe,{active:c(o)===c(v)}),me(be,"aria-selected",c(o)===c(v)),fe(Se,`Add “${ie??""}” as a guest`)},[()=>c(i).trim()]),ae("click",be,()=>C(c(i))),Be("mouseenter",be,()=>y(o,c(v),!0)),H(J,ne)};de($,J=>{c(T)&&J(X)})}ue(()=>{me(U,"aria-labelledby",e.labelledBy),me(z,"aria-expanded",c(T)),me(z,"aria-controls",`${s}-listbox`),me(z,"aria-activedescendant",c(O))}),ae("input",z,()=>y(o,0)),ae("keydown",z,j),Be("focus",z,()=>{y(u,!0),y(o,0)}),Be("blur",z,()=>setTimeout(()=>y(u,!1),120)),Et(z,()=>c(i),J=>y(i,J)),H(t,U),ft()}At(["click","input","keydown"]);var NN=W('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),SN=W('<p class="empty svelte-1nm0yno">No file selected.</p>'),IN=W('<li class="hint svelte-1nm0yno">Loading…</li>'),CN=W('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),wN=W('<li><button type="button"> </button></li>'),LN=W('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),ON=W('<p class="error svelte-1nm0yno" role="alert"> </p>'),xN=W('<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 RN(t,e){ct(e,!0);let n=ee(Tt([])),r=ee(!1),s=ee(!1),a=!1,i=ee(null);const u=Ae(()=>e.value.split("/").pop()??e.value);async function o(){y(s,!0);try{y(n,await Ny(e.itemDir),!0),a=!0}finally{y(s,!1)}}function f(){y(r,!c(r)),c(r)&&!a&&o()}function h(Z){var k;const Y=Z.currentTarget,E=(k=Y.files)==null?void 0:k[0];Y.value="",E&&g(E)}async function g(Z){y(i,null);try{e.onchange(await uh(e.itemDir,Z)),a=!1,c(r)&&await o()}catch(Y){y(i,Y instanceof Error?Y.message:String(Y),!0)}}var d=xN(),m=I(d);{var b=Z=>{var Y=NN(),E=I(Y),k=I(E),S=R(E,2);ue(U=>{me(E,"href",U),fe(k,c(u))},[()=>to(e.itemDir,e.value)]),ae("click",S,()=>e.onchange("")),H(Z,Y)},_=Z=>{var Y=SN();H(Z,Y)};de(m,Z=>{e.value?Z(b):Z(_,-1)})}var T=R(m,2),v=I(T),O=I(v),L=R(v,2),B=R(I(L)),C=R(T,2);{var q=Z=>{var Y=LN(),E=I(Y);{var k=F=>{var M=IN();H(F,M)},S=F=>{var M=CN();H(F,M)},U=F=>{var M=Ir(),Q=pt(M);Ot(Q,16,()=>c(n),z=>z,(z,$)=>{const X=Ae(()=>fg($));var J=wN(),ne=I(J);let ge;var be=I(ne);ue(()=>{ge=it(ne,1,"file svelte-1nm0yno",null,ge,{selected:e.value===c(X)}),me(ne,"aria-pressed",e.value===c(X)),fe(be,$)}),ae("click",ne,()=>e.onchange(c(X))),H(z,J)}),H(F,M)};de(E,F=>{c(s)?F(k):c(n).length===0?F(S,1):F(U,-1)})}H(Z,Y)};de(C,Z=>{c(r)&&Z(q)})}var x=R(C,2);{var j=Z=>{var Y=ON(),E=I(Y);ue(()=>fe(E,c(i))),H(Z,Y)};de(x,Z=>{c(i)&&Z(j)})}ue(()=>{me(d,"aria-labelledby",e.labelledBy),me(v,"aria-expanded",c(r)),fe(O,c(r)?"Hide files":"Choose from files")}),ae("click",v,f),ae("change",B,h),H(t,d),ft()}At(["click","change"]);var DN=W('<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>'),kN=W('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),PN=W('<p class="error svelte-s6anrr" role="alert"> </p>'),MN=W('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function BN(t,e){ct(e,!0);let n=ee(!1),r=ee(null);const s=Ae(()=>e.value===""?"":/^(\/|[a-z][a-z0-9+.-]*:)/i.test(e.value)?e.value:to(e.itemDir,e.value));function a(m){var T;const b=m.currentTarget,_=(T=b.files)==null?void 0:T[0];b.value="",_&&i(_)}async function i(m){y(r,null),y(n,!0);try{e.onchange(await uh(e.itemDir,m))}catch(b){y(r,b instanceof Error?b.message:String(b),!0)}finally{y(n,!1)}}var u=MN(),o=I(u);{var f=m=>{var b=DN(),_=I(b),T=R(_,2),v=I(T),O=I(v),L=R(v,2),B=I(L);let C;var q=I(B),x=R(q),j=R(B,2);ue(()=>{me(_,"src",c(s)),fe(O,e.value),C=it(B,1,"action svelte-s6anrr",null,C,{busy:c(n)}),fe(q,`${c(n)?"Uploading…":"Replace…"} `),x.disabled=c(n)}),ae("change",x,a),ae("click",j,()=>e.onchange("")),H(m,b)},h=m=>{var b=kN();let _;var T=I(b),v=R(T);ue(()=>{_=it(b,1,"action svelte-s6anrr",null,_,{busy:c(n)}),fe(T,`${c(n)?"Uploading…":"Upload image…"} `),v.disabled=c(n)}),ae("change",v,a),H(m,b)};de(o,m=>{e.value?m(f):m(h,-1)})}var g=R(o,2);{var d=m=>{var b=PN(),_=I(b);ue(()=>fe(_,c(r))),H(m,b)};de(g,m=>{c(r)&&m(d)})}ue(()=>me(u,"aria-labelledby",e.labelledBy)),H(t,u),ft()}At(["change","click"]);var FN=W("<option> </option>"),UN=W("<option>Top level</option>"),HN=W("<option> </option>"),qN=W('<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>'),jN=W('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),$N=W('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),YN=W(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
66
- heading at the top of the form.</p>`),zN=W('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),WN=W('<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 GN(t,e){ct(e,!0);const n=ur(e,"currentFolder",3,""),r=ur(e,"folders",19,()=>[]);let s,a=ee(Tt(e.templateName));const i="\0";let u=ee(i);const o=Ae(()=>r().filter(C=>C!==n())),f=Ae(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);ka(()=>s.showModal());function h(C){C.preventDefault(),c(a)!==e.templateName?e.onchangetemplate(c(a)):e.onclose()}var g=WN(),d=I(g),m=R(I(d),2),b=R(I(m),2);Ot(b,20,()=>c(f),C=>C,(C,q)=>{var x=FN(),j=I(x),Z={};ue(()=>{fe(j,q),Z!==(Z=q)&&(x.value=(x.__value=q)??"")}),H(C,x)});var _=R(m,2);{var T=C=>{var q=qN(),x=R(I(q),2),j=I(x),Z=R(I(j),2),Y=I(Z);Y.value=Y.__value=i;var E=R(Y);{var k=F=>{var M=UN();M.value=M.__value="",H(F,M)};de(E,F=>{n()!==""&&F(k)})}var S=R(E);Ot(S,16,()=>c(o),F=>F,(F,M)=>{var Q=HN(),z=I(Q),$={};ue(()=>{fe(z,`${M??""}/`),$!==($=M)&&(Q.value=(Q.__value=M)??"")}),H(F,Q)});var U=R(j,2);ue(()=>U.disabled=c(u)===i),Ia(Z,()=>c(u),F=>y(u,F)),ae("click",U,()=>e.onmove(c(u))),H(C,q)};de(_,C=>{e.onmove&&C(T)})}var v=R(_,2);{var O=C=>{var q=zN(),x=R(I(q),2),j=I(x);{var Z=U=>{var F=jN();ae("click",F,function(...M){var Q;(Q=e.onrename)==null||Q.apply(this,M)}),H(U,F)};de(j,U=>{e.onrename&&U(Z)})}var Y=R(j,2);{var E=U=>{var F=$N();ae("click",F,function(...M){var Q;(Q=e.ondelete)==null||Q.apply(this,M)}),H(U,F)};de(Y,U=>{e.ondelete&&U(E)})}var k=R(x,2);{var S=U=>{var F=YN();H(U,F)};de(k,U=>{e.onrename&&U(S)})}H(C,q)};de(v,C=>{(e.onrename||e.ondelete)&&C(O)})}var L=R(v,2),B=I(L);dn(g,C=>s=C,()=>s),Be("close",g,function(...C){var q;(q=e.onclose)==null||q.apply(this,C)}),Be("cancel",g,function(...C){var q;(q=e.onclose)==null||q.apply(this,C)}),Be("submit",d,h),Ia(b,()=>c(a),C=>y(a,C)),ae("click",B,function(...C){var q;(q=e.onclose)==null||q.apply(this,C)}),H(t,g),ft()}At(["click"]);let Eu=ee(null);const KN={get pending(){return c(Eu)}};function Lg(t=""){return new Promise(e=>{y(Eu,{current:t,resolve:e},!0)})}function Ga(t){c(Eu)!==null&&(c(Eu).resolve(t),y(Eu,null))}const mh="ref:";function xu(t){return t.startsWith(mh)}function Vf(t){return xu(t)?t.slice(mh.length):t}function VN(t){return`${mh}${t}`}var XN=W('<!> <span class="target svelte-147ryxk"> </span>',1),QN=W('<!> <span class="target svelte-147ryxk"> </span>',1),ZN=W('<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),JN=W('<button type="button" class="action svelte-147ryxk">Set link…</button>'),e6=W('<div class="link-field svelte-147ryxk" role="group"><!></div>');function t6(t,e){ct(e,!0);async function n(){const u=await Lg(e.value);u!==null&&e.onchange(u)}var r=e6(),s=I(r);{var a=u=>{var o=ZN(),f=pt(o),h=I(f);{var g=T=>{var v=XN(),O=pt(v);sN(O,{size:14,"aria-hidden":"true"});var L=R(O,2),B=I(L);ue((C,q)=>{me(L,"title",C),fe(B,q)},[()=>`Page: ${Vf(e.value)}`,()=>Vf(e.value)]),H(T,v)},d=Ae(()=>xu(e.value)),m=T=>{var v=QN(),O=pt(v);aN(O,{size:14,"aria-hidden":"true"});var L=R(O,2),B=I(L);ue(()=>{me(L,"title",e.value),fe(B,e.value)}),H(T,v)};de(h,T=>{c(d)?T(g):T(m,-1)})}var b=R(f,2),_=R(b,2);ae("click",b,n),ae("click",_,()=>e.onchange("")),H(u,o)},i=u=>{var o=JN();ae("click",o,n),H(u,o)};de(s,u=>{e.value?u(a):u(i,-1)})}ue(()=>me(r,"aria-labelledby",e.labelledBy)),H(t,r),ft()}At(["click"]);var n6=W('<p class="note error svelte-1v8pkea"> </p>'),r6=W('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),s6=W('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),a6=W('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),i6=W('<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 u6(t,e){ct(e,!0);let n=ee(""),r=ee("loading"),s=ee(""),a=ee(0),i=ee(void 0),u={x:0,y:0};function o(){var x;try{const j=(x=c(i))==null?void 0:x.contentWindow;j&&(u={x:j.scrollX,y:j.scrollY})}catch{}}function f(){var x,j;try{(j=(x=c(i))==null?void 0:x.contentWindow)==null||j.scrollTo(u.x,u.y)}catch{}}let h;kt(()=>{const x=e.previewItem,j=e.path;if(clearTimeout(h),x===null){y(r,"loading");return}return h=setTimeout(()=>void g(j,x),350),()=>clearTimeout(h)});async function g(x,j){try{const Z=await jy(x,j);if(Z===void 0){y(r,"empty");return}o(),y(n,Z,!0),y(r,"ready")}catch(Z){y(s,Z instanceof Error?Z.message:String(Z),!0),y(r,"error")}}var d=i6(),m=I(d),b=R(I(m),2),_=I(b),T=R(b,2),v=I(T);dh(v,{size:18,"aria-hidden":"true"});var O=R(m,2),L=I(O);{var B=x=>{var j=n6(),Z=I(j);ue(()=>fe(Z,`Couldn’t render preview: ${c(s)??""}`)),H(x,j)},C=x=>{var j=r6();H(x,j)},q=x=>{var j=a6(),Z=pt(j);dn(Z,k=>y(i,k),()=>c(i));var Y=R(Z,2);{var E=k=>{var S=s6();H(k,S)};de(Y,k=>{c(r)==="loading"&&k(E)})}ue(()=>me(Z,"srcdoc",c(n))),Be("load",Z,f),H(x,j)};de(L,x=>{c(r)==="error"?x(B):c(r)==="empty"?x(C,1):x(q,-1)})}ue(x=>fe(_,`${x??""}px`),[()=>Math.round(c(a))]),ae("click",T,function(...x){var j;(j=e.onclose)==null||j.apply(this,x)}),GE(O,"clientWidth",x=>y(a,x)),H(t,d),ft()}At(["click"]);var Og=typeof global=="object"&&global&&global.Object===Object&&global,o6=typeof self=="object"&&self&&self.Object===Object&&self,ns=Og||o6||Function("return this")(),Gs=ns.Symbol,xg=Object.prototype,l6=xg.hasOwnProperty,c6=xg.toString,eu=Gs?Gs.toStringTag:void 0;function f6(t){var e=l6.call(t,eu),n=t[eu];try{t[eu]=void 0;var r=!0}catch{}var s=c6.call(t);return r&&(e?t[eu]=n:delete t[eu]),s}var d6=Object.prototype,h6=d6.toString;function p6(t){return h6.call(t)}var m6="[object Null]",g6="[object Undefined]",z0=Gs?Gs.toStringTag:void 0;function qi(t){return t==null?t===void 0?g6:m6:z0&&z0 in Object(t)?f6(t):p6(t)}function gs(t){return t!=null&&typeof t=="object"}var wa=Array.isArray;function Qs(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Rg(t){return t}var b6="[object AsyncFunction]",v6="[object Function]",E6="[object GeneratorFunction]",T6="[object Proxy]";function gh(t){if(!Qs(t))return!1;var e=qi(t);return e==v6||e==E6||e==b6||e==T6}var xc=ns["__core-js_shared__"],W0=(function(){var t=/[^.]+$/.exec(xc&&xc.keys&&xc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function _6(t){return!!W0&&W0 in t}var A6=Function.prototype,y6=A6.toString;function Ba(t){if(t!=null){try{return y6.call(t)}catch{}try{return t+""}catch{}}return""}var N6=/[\\^$.*+?()[\]{}|]/g,S6=/^\[object .+?Constructor\]$/,I6=Function.prototype,C6=Object.prototype,w6=I6.toString,L6=C6.hasOwnProperty,O6=RegExp("^"+w6.call(L6).replace(N6,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x6(t){if(!Qs(t)||_6(t))return!1;var e=gh(t)?O6:S6;return e.test(Ba(t))}function R6(t,e){return t==null?void 0:t[e]}function Fa(t,e){var n=R6(t,e);return x6(n)?n:void 0}var Xf=Fa(ns,"WeakMap"),G0=Object.create,D6=(function(){function t(){}return function(e){if(!Qs(e))return{};if(G0)return G0(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function k6(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 P6(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var M6=800,B6=16,F6=Date.now;function U6(t){var e=0,n=0;return function(){var r=F6(),s=B6-(r-n);if(n=r,s>0){if(++e>=M6)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function H6(t){return function(){return t}}var pl=(function(){try{var t=Fa(Object,"defineProperty");return t({},"",{}),t}catch{}})(),q6=pl?function(t,e){return pl(t,"toString",{configurable:!0,enumerable:!1,value:H6(e),writable:!0})}:Rg,j6=U6(q6);function $6(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var Y6=9007199254740991,z6=/^(?:0|[1-9]\d*)$/;function Dg(t,e){var n=typeof t;return e=e??Y6,!!e&&(n=="number"||n!="symbol"&&z6.test(t))&&t>-1&&t%1==0&&t<e}function bh(t,e,n){e=="__proto__"&&pl?pl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ro(t,e){return t===e||t!==t&&e!==e}var W6=Object.prototype,G6=W6.hasOwnProperty;function kg(t,e,n){var r=t[e];(!(G6.call(t,e)&&ro(r,n))||n===void 0&&!(e in t))&&bh(t,e,n)}function K6(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var u=e[a],o=void 0;o===void 0&&(o=t[u]),s?bh(n,u,o):kg(n,u,o)}return n}var K0=Math.max;function V6(t,e,n){return e=K0(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=K0(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var u=Array(e+1);++s<e;)u[s]=r[s];return u[e]=n(i),k6(t,this,u)}}function X6(t,e){return j6(V6(t,e,Rg),t+"")}var Q6=9007199254740991;function Pg(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Q6}function Fl(t){return t!=null&&Pg(t.length)&&!gh(t)}function Z6(t,e,n){if(!Qs(n))return!1;var r=typeof e;return(r=="number"?Fl(n)&&Dg(e,n.length):r=="string"&&e in n)?ro(n[e],t):!1}function J6(t){return X6(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&&Z6(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var u=n[r];u&&t(e,u,r,a)}return e})}var eS=Object.prototype;function vh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||eS;return t===n}function tS(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var nS="[object Arguments]";function V0(t){return gs(t)&&qi(t)==nS}var Mg=Object.prototype,rS=Mg.hasOwnProperty,sS=Mg.propertyIsEnumerable,Qf=V0((function(){return arguments})())?V0:function(t){return gs(t)&&rS.call(t,"callee")&&!sS.call(t,"callee")};function aS(){return!1}var Bg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,X0=Bg&&typeof module=="object"&&module&&!module.nodeType&&module,iS=X0&&X0.exports===Bg,Q0=iS?ns.Buffer:void 0,uS=Q0?Q0.isBuffer:void 0,Ru=uS||aS,oS="[object Arguments]",lS="[object Array]",cS="[object Boolean]",fS="[object Date]",dS="[object Error]",hS="[object Function]",pS="[object Map]",mS="[object Number]",gS="[object Object]",bS="[object RegExp]",vS="[object Set]",ES="[object String]",TS="[object WeakMap]",_S="[object ArrayBuffer]",AS="[object DataView]",yS="[object Float32Array]",NS="[object Float64Array]",SS="[object Int8Array]",IS="[object Int16Array]",CS="[object Int32Array]",wS="[object Uint8Array]",LS="[object Uint8ClampedArray]",OS="[object Uint16Array]",xS="[object Uint32Array]",It={};It[yS]=It[NS]=It[SS]=It[IS]=It[CS]=It[wS]=It[LS]=It[OS]=It[xS]=!0;It[oS]=It[lS]=It[_S]=It[cS]=It[AS]=It[fS]=It[dS]=It[hS]=It[pS]=It[mS]=It[gS]=It[bS]=It[vS]=It[ES]=It[TS]=!1;function RS(t){return gs(t)&&Pg(t.length)&&!!It[qi(t)]}function Eh(t){return function(e){return t(e)}}var Fg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tu=Fg&&typeof module=="object"&&module&&!module.nodeType&&module,DS=Tu&&Tu.exports===Fg,Rc=DS&&Og.process,Ri=(function(){try{var t=Tu&&Tu.require&&Tu.require("util").types;return t||Rc&&Rc.binding&&Rc.binding("util")}catch{}})(),Z0=Ri&&Ri.isTypedArray,Th=Z0?Eh(Z0):RS,kS=Object.prototype,PS=kS.hasOwnProperty;function Ug(t,e){var n=wa(t),r=!n&&Qf(t),s=!n&&!r&&Ru(t),a=!n&&!r&&!s&&Th(t),i=n||r||s||a,u=i?tS(t.length,String):[],o=u.length;for(var f in t)(e||PS.call(t,f))&&!(i&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Dg(f,o)))&&u.push(f);return u}function Hg(t,e){return function(n){return t(e(n))}}var MS=Hg(Object.keys,Object),BS=Object.prototype,FS=BS.hasOwnProperty;function US(t){if(!vh(t))return MS(t);var e=[];for(var n in Object(t))FS.call(t,n)&&n!="constructor"&&e.push(n);return e}function HS(t){return Fl(t)?Ug(t):US(t)}function qS(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var jS=Object.prototype,$S=jS.hasOwnProperty;function YS(t){if(!Qs(t))return qS(t);var e=vh(t),n=[];for(var r in t)r=="constructor"&&(e||!$S.call(t,r))||n.push(r);return n}function qg(t){return Fl(t)?Ug(t,!0):YS(t)}var Du=Fa(Object,"create");function zS(){this.__data__=Du?Du(null):{},this.size=0}function WS(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var GS="__lodash_hash_undefined__",KS=Object.prototype,VS=KS.hasOwnProperty;function XS(t){var e=this.__data__;if(Du){var n=e[t];return n===GS?void 0:n}return VS.call(e,t)?e[t]:void 0}var QS=Object.prototype,ZS=QS.hasOwnProperty;function JS(t){var e=this.__data__;return Du?e[t]!==void 0:ZS.call(e,t)}var eI="__lodash_hash_undefined__";function tI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Du&&e===void 0?eI:e,this}function La(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])}}La.prototype.clear=zS;La.prototype.delete=WS;La.prototype.get=XS;La.prototype.has=JS;La.prototype.set=tI;function nI(){this.__data__=[],this.size=0}function Ul(t,e){for(var n=t.length;n--;)if(ro(t[n][0],e))return n;return-1}var rI=Array.prototype,sI=rI.splice;function aI(t){var e=this.__data__,n=Ul(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():sI.call(e,n,1),--this.size,!0}function iI(t){var e=this.__data__,n=Ul(e,t);return n<0?void 0:e[n][1]}function uI(t){return Ul(this.__data__,t)>-1}function oI(t,e){var n=this.__data__,r=Ul(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Es(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])}}Es.prototype.clear=nI;Es.prototype.delete=aI;Es.prototype.get=iI;Es.prototype.has=uI;Es.prototype.set=oI;var ku=Fa(ns,"Map");function lI(){this.size=0,this.__data__={hash:new La,map:new(ku||Es),string:new La}}function cI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Hl(t,e){var n=t.__data__;return cI(e)?n[typeof e=="string"?"string":"hash"]:n.map}function fI(t){var e=Hl(this,t).delete(t);return this.size-=e?1:0,e}function dI(t){return Hl(this,t).get(t)}function hI(t){return Hl(this,t).has(t)}function pI(t,e){var n=Hl(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Ua(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])}}Ua.prototype.clear=lI;Ua.prototype.delete=fI;Ua.prototype.get=dI;Ua.prototype.has=hI;Ua.prototype.set=pI;function mI(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var jg=Hg(Object.getPrototypeOf,Object),gI="[object Object]",bI=Function.prototype,vI=Object.prototype,$g=bI.toString,EI=vI.hasOwnProperty,TI=$g.call(Object);function _I(t){if(!gs(t)||qi(t)!=gI)return!1;var e=jg(t);if(e===null)return!0;var n=EI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&$g.call(n)==TI}function AI(){this.__data__=new Es,this.size=0}function yI(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function NI(t){return this.__data__.get(t)}function SI(t){return this.__data__.has(t)}var II=200;function CI(t,e){var n=this.__data__;if(n instanceof Es){var r=n.__data__;if(!ku||r.length<II-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ua(r)}return n.set(t,e),this.size=n.size,this}function Vr(t){var e=this.__data__=new Es(t);this.size=e.size}Vr.prototype.clear=AI;Vr.prototype.delete=yI;Vr.prototype.get=NI;Vr.prototype.has=SI;Vr.prototype.set=CI;var Yg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,J0=Yg&&typeof module=="object"&&module&&!module.nodeType&&module,wI=J0&&J0.exports===Yg,e1=wI?ns.Buffer:void 0,t1=e1?e1.allocUnsafe:void 0;function zg(t,e){if(e)return t.slice();var n=t.length,r=t1?t1(n):new t.constructor(n);return t.copy(r),r}function LI(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 OI(){return[]}var xI=Object.prototype,RI=xI.propertyIsEnumerable,n1=Object.getOwnPropertySymbols,DI=n1?function(t){return t==null?[]:(t=Object(t),LI(n1(t),function(e){return RI.call(t,e)}))}:OI;function kI(t,e,n){var r=e(t);return wa(t)?r:mI(r,n(t))}function Zf(t){return kI(t,HS,DI)}var Jf=Fa(ns,"DataView"),ed=Fa(ns,"Promise"),td=Fa(ns,"Set"),r1="[object Map]",PI="[object Object]",s1="[object Promise]",a1="[object Set]",i1="[object WeakMap]",u1="[object DataView]",MI=Ba(Jf),BI=Ba(ku),FI=Ba(ed),UI=Ba(td),HI=Ba(Xf),Ar=qi;(Jf&&Ar(new Jf(new ArrayBuffer(1)))!=u1||ku&&Ar(new ku)!=r1||ed&&Ar(ed.resolve())!=s1||td&&Ar(new td)!=a1||Xf&&Ar(new Xf)!=i1)&&(Ar=function(t){var e=qi(t),n=e==PI?t.constructor:void 0,r=n?Ba(n):"";if(r)switch(r){case MI:return u1;case BI:return r1;case FI:return s1;case UI:return a1;case HI:return i1}return e});var qI=Object.prototype,jI=qI.hasOwnProperty;function $I(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&jI.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var ml=ns.Uint8Array;function _h(t){var e=new t.constructor(t.byteLength);return new ml(e).set(new ml(t)),e}function YI(t,e){var n=_h(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var zI=/\w*$/;function WI(t){var e=new t.constructor(t.source,zI.exec(t));return e.lastIndex=t.lastIndex,e}var o1=Gs?Gs.prototype:void 0,l1=o1?o1.valueOf:void 0;function GI(t){return l1?Object(l1.call(t)):{}}function Wg(t,e){var n=e?_h(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var KI="[object Boolean]",VI="[object Date]",XI="[object Map]",QI="[object Number]",ZI="[object RegExp]",JI="[object Set]",eC="[object String]",tC="[object Symbol]",nC="[object ArrayBuffer]",rC="[object DataView]",sC="[object Float32Array]",aC="[object Float64Array]",iC="[object Int8Array]",uC="[object Int16Array]",oC="[object Int32Array]",lC="[object Uint8Array]",cC="[object Uint8ClampedArray]",fC="[object Uint16Array]",dC="[object Uint32Array]";function hC(t,e,n){var r=t.constructor;switch(e){case nC:return _h(t);case KI:case VI:return new r(+t);case rC:return YI(t);case sC:case aC:case iC:case uC:case oC:case lC:case cC:case fC:case dC:return Wg(t,n);case XI:return new r;case QI:case eC:return new r(t);case ZI:return WI(t);case JI:return new r;case tC:return GI(t)}}function Gg(t){return typeof t.constructor=="function"&&!vh(t)?D6(jg(t)):{}}var pC="[object Map]";function mC(t){return gs(t)&&Ar(t)==pC}var c1=Ri&&Ri.isMap,gC=c1?Eh(c1):mC,bC="[object Set]";function vC(t){return gs(t)&&Ar(t)==bC}var f1=Ri&&Ri.isSet,EC=f1?Eh(f1):vC,TC=1,Kg="[object Arguments]",_C="[object Array]",AC="[object Boolean]",yC="[object Date]",NC="[object Error]",Vg="[object Function]",SC="[object GeneratorFunction]",IC="[object Map]",CC="[object Number]",Xg="[object Object]",wC="[object RegExp]",LC="[object Set]",OC="[object String]",xC="[object Symbol]",RC="[object WeakMap]",DC="[object ArrayBuffer]",kC="[object DataView]",PC="[object Float32Array]",MC="[object Float64Array]",BC="[object Int8Array]",FC="[object Int16Array]",UC="[object Int32Array]",HC="[object Uint8Array]",qC="[object Uint8ClampedArray]",jC="[object Uint16Array]",$C="[object Uint32Array]",Nt={};Nt[Kg]=Nt[_C]=Nt[DC]=Nt[kC]=Nt[AC]=Nt[yC]=Nt[PC]=Nt[MC]=Nt[BC]=Nt[FC]=Nt[UC]=Nt[IC]=Nt[CC]=Nt[Xg]=Nt[wC]=Nt[LC]=Nt[OC]=Nt[xC]=Nt[HC]=Nt[qC]=Nt[jC]=Nt[$C]=!0;Nt[NC]=Nt[Vg]=Nt[RC]=!1;function Ko(t,e,n,r,s,a){var i,u=e&TC;if(i!==void 0)return i;if(!Qs(t))return t;var o=wa(t);if(o)i=$I(t);else{var f=Ar(t),h=f==Vg||f==SC;if(Ru(t))return zg(t,u);if(f==Xg||f==Kg||h&&!s)i=h?{}:Gg(t);else{if(!Nt[f])return s?t:{};i=hC(t,f,u)}}a||(a=new Vr);var g=a.get(t);if(g)return g;a.set(t,i),EC(t)?t.forEach(function(b){i.add(Ko(b,e,n,b,t,a))}):gC(t)&&t.forEach(function(b,_){i.set(_,Ko(b,e,n,_,t,a))});var d=Zf,m=o?void 0:d(t);return $6(m||t,function(b,_){m&&(_=b,b=t[_]),kg(i,_,Ko(b,e,n,_,t,a))}),i}var YC=1,zC=4;function oi(t){return Ko(t,YC|zC)}var WC="__lodash_hash_undefined__";function GC(t){return this.__data__.set(t,WC),this}function KC(t){return this.__data__.has(t)}function gl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Ua;++e<n;)this.add(t[e])}gl.prototype.add=gl.prototype.push=GC;gl.prototype.has=KC;function VC(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 XC(t,e){return t.has(e)}var QC=1,ZC=2;function Qg(t,e,n,r,s,a){var i=n&QC,u=t.length,o=e.length;if(u!=o&&!(i&&o>u))return!1;var f=a.get(t),h=a.get(e);if(f&&h)return f==e&&h==t;var g=-1,d=!0,m=n&ZC?new gl:void 0;for(a.set(t,e),a.set(e,t);++g<u;){var b=t[g],_=e[g];if(r)var T=i?r(_,b,g,e,t,a):r(b,_,g,t,e,a);if(T!==void 0){if(T)continue;d=!1;break}if(m){if(!VC(e,function(v,O){if(!XC(m,O)&&(b===v||s(b,v,n,r,a)))return m.push(O)})){d=!1;break}}else if(!(b===_||s(b,_,n,r,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function JC(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function ew(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var tw=1,nw=2,rw="[object Boolean]",sw="[object Date]",aw="[object Error]",iw="[object Map]",uw="[object Number]",ow="[object RegExp]",lw="[object Set]",cw="[object String]",fw="[object Symbol]",dw="[object ArrayBuffer]",hw="[object DataView]",d1=Gs?Gs.prototype:void 0,Dc=d1?d1.valueOf:void 0;function pw(t,e,n,r,s,a,i){switch(n){case hw:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dw:return!(t.byteLength!=e.byteLength||!a(new ml(t),new ml(e)));case rw:case sw:case uw:return ro(+t,+e);case aw:return t.name==e.name&&t.message==e.message;case ow:case cw:return t==e+"";case iw:var u=JC;case lw:var o=r&tw;if(u||(u=ew),t.size!=e.size&&!o)return!1;var f=i.get(t);if(f)return f==e;r|=nw,i.set(t,e);var h=Qg(u(t),u(e),r,s,a,i);return i.delete(t),h;case fw:if(Dc)return Dc.call(t)==Dc.call(e)}return!1}var mw=1,gw=Object.prototype,bw=gw.hasOwnProperty;function vw(t,e,n,r,s,a){var i=n&mw,u=Zf(t),o=u.length,f=Zf(e),h=f.length;if(o!=h&&!i)return!1;for(var g=o;g--;){var d=u[g];if(!(i?d in e:bw.call(e,d)))return!1}var m=a.get(t),b=a.get(e);if(m&&b)return m==e&&b==t;var _=!0;a.set(t,e),a.set(e,t);for(var T=i;++g<o;){d=u[g];var v=t[d],O=e[d];if(r)var L=i?r(O,v,d,e,t,a):r(v,O,d,t,e,a);if(!(L===void 0?v===O||s(v,O,n,r,a):L)){_=!1;break}T||(T=d=="constructor")}if(_&&!T){var B=t.constructor,C=e.constructor;B!=C&&"constructor"in t&&"constructor"in e&&!(typeof B=="function"&&B instanceof B&&typeof C=="function"&&C instanceof C)&&(_=!1)}return a.delete(t),a.delete(e),_}var Ew=1,h1="[object Arguments]",p1="[object Array]",wo="[object Object]",Tw=Object.prototype,m1=Tw.hasOwnProperty;function _w(t,e,n,r,s,a){var i=wa(t),u=wa(e),o=i?p1:Ar(t),f=u?p1:Ar(e);o=o==h1?wo:o,f=f==h1?wo:f;var h=o==wo,g=f==wo,d=o==f;if(d&&Ru(t)){if(!Ru(e))return!1;i=!0,h=!1}if(d&&!h)return a||(a=new Vr),i||Th(t)?Qg(t,e,n,r,s,a):pw(t,e,o,n,r,s,a);if(!(n&Ew)){var m=h&&m1.call(t,"__wrapped__"),b=g&&m1.call(e,"__wrapped__");if(m||b){var _=m?t.value():t,T=b?e.value():e;return a||(a=new Vr),s(_,T,n,r,a)}}return d?(a||(a=new Vr),vw(t,e,n,r,s,a)):!1}function Zg(t,e,n,r,s){return t===e?!0:t==null||e==null||!gs(t)&&!gs(e)?t!==t&&e!==e:_w(t,e,n,r,Zg,s)}function Aw(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),u=i.length;u--;){var o=i[++s];if(n(a[o],o,a)===!1)break}return e}}var yw=Aw();function nd(t,e,n){(n!==void 0&&!ro(t[e],n)||n===void 0&&!(e in t))&&bh(t,e,n)}function Nw(t){return gs(t)&&Fl(t)}function rd(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Sw(t){return K6(t,qg(t))}function Iw(t,e,n,r,s,a,i){var u=rd(t,n),o=rd(e,n),f=i.get(o);if(f){nd(t,n,f);return}var h=a?a(u,o,n+"",t,e,i):void 0,g=h===void 0;if(g){var d=wa(o),m=!d&&Ru(o),b=!d&&!m&&Th(o);h=o,d||m||b?wa(u)?h=u:Nw(u)?h=P6(u):m?(g=!1,h=zg(o,!0)):b?(g=!1,h=Wg(o,!0)):h=[]:_I(o)||Qf(o)?(h=u,Qf(u)?h=Sw(u):(!Qs(u)||gh(u))&&(h=Gg(o))):g=!1}g&&(i.set(o,h),s(h,o,r,a,i),i.delete(o)),nd(t,n,h)}function Jg(t,e,n,r,s){t!==e&&yw(e,function(a,i){if(s||(s=new Vr),Qs(a))Iw(t,e,i,n,Jg,r,s);else{var u=r?r(rd(t,i),a,i+"",t,e,s):void 0;u===void 0&&(u=a),nd(t,i,u)}},qg)}function Ah(t,e){return Zg(t,e)}var $s=J6(function(t,e,n){Jg(t,e,n)}),xe=(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))(xe||{});class es{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=xe.TYPE&xe.ATTRIBUTE;this.scope=r.scope!=null?r.scope&xe.LEVEL|s:xe.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 li extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const eb=class sd{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 li(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),u=new a(e,i,r);return sd.blots.set(u.domNode,u),u}find(e,n=!1){return sd.find(e,n)}query(e,n=xe.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&xe.LEVEL&xe.BLOCK?r=this.types.block:e&xe.LEVEL&xe.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&xe.LEVEL&r.scope&&n&xe.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 li("Invalid definition");if(r&&n.blotName==="abstract")throw new li("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})}};eb.blots=new WeakMap;let Di=eb;function g1(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class Cw extends es{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){g1(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(g1(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Pr=Cw;function kc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class ww extends es{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[kc(this.keyName)]=n,!0):!1}remove(e){e.style[kc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[kc(this.keyName)];return this.canAdd(e,n)?n:""}}const Zs=ww;class Lw{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=Di.find(this.domNode);if(e==null)return;const n=es.keys(this.domNode),r=Pr.keys(this.domNode),s=Zs.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,xe.ATTRIBUTE);i instanceof es&&(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 ql=Lw,tb=class{constructor(e,n){this.scroll=e,this.domNode=n,Di.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new li("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),Di.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,xe.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,xe.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 li(`Cannot wrap ${e}`);return r.appendChild(this),r}};tb.blotName="abstract";let nb=tb;const rb=class extends nb{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}}};rb.scope=xe.INLINE_BLOT;let Ow=rb;const _n=Ow;class xw{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 u=this.iterator(s);let o=u();for(;o&&i<e+n;){const f=o.length();e>i?r(o,e-i,Math.min(n,i+f-e)):r(o,0,Math.min(f,e+n-i)),i+=f,o=u()}}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 b1(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(xe.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const sb=class Is extends nb{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,Is.uiClass&&this.uiNode.classList.add(Is.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new xw,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=b1(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof li)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 Is?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,u,o)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Is&&(s=s.concat(i.descendants(e,u,a))),a-=o}),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===xe.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Is?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,u)=>{a.formatAt(i,u,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 Is?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 Is&&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 u=s.split(a,n);u!=null&&r.appendChild(u)}),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 u=b1(a,this.scroll);(u.next!==i||u.next==null)&&(u.parent!=null&&u.parent.removeChild(this),this.insertBefore(u,i||void 0))}),this.enforceAllowedChildren()}};sb.uiClass="";let Rw=sb;const wr=Rw;function Dw(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 Xa=class Qa extends wr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Qa.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 ql(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof Qa||(r=r.wrap(Qa.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,xe.INLINE);if(r==null)return;r instanceof es?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,xe.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 Qa&&r.prev===this&&Dw(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 Qa&&this.attributes.move(r),r}};Xa.allowedChildren=[Xa,_n],Xa.blotName="inline",Xa.scope=xe.INLINE_BLOT,Xa.tagName="SPAN";let kw=Xa;const yh=kw,Za=class ad extends wr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(ad.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 ql(this.domNode)}format(e,n){const r=this.scroll.query(e,xe.BLOCK);r!=null&&(r instanceof es?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(ad.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,xe.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,xe.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()}};Za.blotName="block",Za.scope=xe.BLOCK_BLOT,Za.tagName="P",Za.allowedChildren=[yh,Za,_n];let Pw=Za;const Pu=Pw,id=class extends wr{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())}};id.blotName="container",id.scope=xe.BLOCK_BLOT;let Mw=id;const jl=Mw;class Bw extends _n{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 Kn=Bw,Fw={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Uw=100,Ja=class extends wr{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,Fw),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=xe.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=(o,f=!0)=>{o==null||o===this||o.domNode.parentNode!=null&&(r.has(o.domNode)||r.set(o.domNode,[]),f&&a(o.parent))},i=o=>{r.has(o.domNode)&&(o instanceof wr&&o.children.forEach(i),r.delete(o.domNode),o.optimize(n))};let u=e;for(let o=0;u.length>0;o+=1){if(o>=Uw)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(f=>{const h=this.find(f.target,!0);h!=null&&(h.domNode===f.target&&(f.type==="childList"?(a(this.find(f.previousSibling,!1)),Array.from(f.addedNodes).forEach(g=>{const d=this.find(g,!1);a(d,!1),d instanceof wr&&d.children.forEach(m=>{a(m,!1)})})):f.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),u=Array.from(this.observer.takeRecords()),s=u.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)}};Ja.blotName="scroll",Ja.defaultChild=Pu,Ja.allowedChildren=[Pu,jl],Ja.scope=xe.BLOCK_BLOT,Ja.tagName="DIV";let Hw=Ja;const Nh=Hw,ud=class ab extends _n{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 ab&&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}};ud.blotName="text",ud.scope=xe.INLINE_BLOT;let qw=ud;const bl=qw,jw=Object.freeze(Object.defineProperty({__proto__:null,Attributor:es,AttributorStore:ql,BlockBlot:Pu,ClassAttributor:Pr,ContainerBlot:jl,EmbedBlot:Kn,InlineBlot:yh,LeafBlot:_n,ParentBlot:wr,Registry:Di,Scope:xe,ScrollBlot:Nh,StyleAttributor:Zs,TextBlot:bl},Symbol.toStringTag,{value:"Module"}));var Ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ib(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lo={exports:{}},Pc,v1;function $w(){if(v1)return Pc;v1=1;var t=-1,e=1,n=0;function r(E,k,S,U,F){if(E===k)return E?[[n,E]]:[];if(S!=null){var M=Z(E,k,S);if(M)return M}var Q=u(E,k),z=E.substring(0,Q);E=E.substring(Q),k=k.substring(Q),Q=f(E,k);var $=E.substring(E.length-Q);E=E.substring(0,E.length-Q),k=k.substring(0,k.length-Q);var X=s(E,k);return z&&X.unshift([n,z]),$&&X.push([n,$]),O(X,F),U&&g(X),X}function s(E,k){var S;if(!E)return[[e,k]];if(!k)return[[t,E]];var U=E.length>k.length?E:k,F=E.length>k.length?k:E,M=U.indexOf(F);if(M!==-1)return S=[[e,U.substring(0,M)],[n,F],[e,U.substring(M+F.length)]],E.length>k.length&&(S[0][0]=S[2][0]=t),S;if(F.length===1)return[[t,E],[e,k]];var Q=h(E,k);if(Q){var z=Q[0],$=Q[1],X=Q[2],J=Q[3],ne=Q[4],ge=r(z,X),be=r($,J);return ge.concat([[n,ne]],be)}return a(E,k)}function a(E,k){for(var S=E.length,U=k.length,F=Math.ceil((S+U)/2),M=F,Q=2*F,z=new Array(Q),$=new Array(Q),X=0;X<Q;X++)z[X]=-1,$[X]=-1;z[M+1]=0,$[M+1]=0;for(var J=S-U,ne=J%2!==0,ge=0,be=0,pe=0,Se=0,ie=0;ie<F;ie++){for(var he=-ie+ge;he<=ie-be;he+=2){var Ce=M+he,Ne;he===-ie||he!==ie&&z[Ce-1]<z[Ce+1]?Ne=z[Ce+1]:Ne=z[Ce-1]+1;for(var Ie=Ne-he;Ne<S&&Ie<U&&E.charAt(Ne)===k.charAt(Ie);)Ne++,Ie++;if(z[Ce]=Ne,Ne>S)be+=2;else if(Ie>U)ge+=2;else if(ne){var Le=M+J-he;if(Le>=0&&Le<Q&&$[Le]!==-1){var Re=S-$[Le];if(Ne>=Re)return i(E,k,Ne,Ie)}}}for(var $e=-ie+pe;$e<=ie-Se;$e+=2){var Le=M+$e,Re;$e===-ie||$e!==ie&&$[Le-1]<$[Le+1]?Re=$[Le+1]:Re=$[Le-1]+1;for(var We=Re-$e;Re<S&&We<U&&E.charAt(S-Re-1)===k.charAt(U-We-1);)Re++,We++;if($[Le]=Re,Re>S)Se+=2;else if(We>U)pe+=2;else if(!ne){var Ce=M+J-$e;if(Ce>=0&&Ce<Q&&z[Ce]!==-1){var Ne=z[Ce],Ie=M+Ne-Ce;if(Re=S-Re,Ne>=Re)return i(E,k,Ne,Ie)}}}}return[[t,E],[e,k]]}function i(E,k,S,U){var F=E.substring(0,S),M=k.substring(0,U),Q=E.substring(S),z=k.substring(U),$=r(F,M),X=r(Q,z);return $.concat(X)}function u(E,k){if(!E||!k||E.charAt(0)!==k.charAt(0))return 0;for(var S=0,U=Math.min(E.length,k.length),F=U,M=0;S<F;)E.substring(M,F)==k.substring(M,F)?(S=F,M=S):U=F,F=Math.floor((U-S)/2+S);return L(E.charCodeAt(F-1))&&F--,F}function o(E,k){var S=E.length,U=k.length;if(S==0||U==0)return 0;S>U?E=E.substring(S-U):S<U&&(k=k.substring(0,S));var F=Math.min(S,U);if(E==k)return F;for(var M=0,Q=1;;){var z=E.substring(F-Q),$=k.indexOf(z);if($==-1)return M;Q+=$,($==0||E.substring(F-Q)==k.substring(0,Q))&&(M=Q,Q++)}}function f(E,k){if(!E||!k||E.slice(-1)!==k.slice(-1))return 0;for(var S=0,U=Math.min(E.length,k.length),F=U,M=0;S<F;)E.substring(E.length-F,E.length-M)==k.substring(k.length-F,k.length-M)?(S=F,M=S):U=F,F=Math.floor((U-S)/2+S);return B(E.charCodeAt(E.length-F))&&F--,F}function h(E,k){var S=E.length>k.length?E:k,U=E.length>k.length?k:E;if(S.length<4||U.length*2<S.length)return null;function F(be,pe,Se){for(var ie=be.substring(Se,Se+Math.floor(be.length/4)),he=-1,Ce="",Ne,Ie,Le,Re;(he=pe.indexOf(ie,he+1))!==-1;){var $e=u(be.substring(Se),pe.substring(he)),We=f(be.substring(0,Se),pe.substring(0,he));Ce.length<We+$e&&(Ce=pe.substring(he-We,he)+pe.substring(he,he+$e),Ne=be.substring(0,Se-We),Ie=be.substring(Se+$e),Le=pe.substring(0,he-We),Re=pe.substring(he+$e))}return Ce.length*2>=be.length?[Ne,Ie,Le,Re,Ce]:null}var M=F(S,U,Math.ceil(S.length/4)),Q=F(S,U,Math.ceil(S.length/2)),z;if(!M&&!Q)return null;Q?M?z=M[4].length>Q[4].length?M:Q:z=Q:z=M;var $,X,J,ne;E.length>k.length?($=z[0],X=z[1],J=z[2],ne=z[3]):(J=z[0],ne=z[1],$=z[2],X=z[3]);var ge=z[4];return[$,X,J,ne,ge]}function g(E){for(var k=!1,S=[],U=0,F=null,M=0,Q=0,z=0,$=0,X=0;M<E.length;)E[M][0]==n?(S[U++]=M,Q=$,z=X,$=0,X=0,F=E[M][1]):(E[M][0]==e?$+=E[M][1].length:X+=E[M][1].length,F&&F.length<=Math.max(Q,z)&&F.length<=Math.max($,X)&&(E.splice(S[U-1],0,[t,F]),E[S[U-1]+1][0]=e,U--,U--,M=U>0?S[U-1]:-1,Q=0,z=0,$=0,X=0,F=null,k=!0)),M++;for(k&&O(E),v(E),M=1;M<E.length;){if(E[M-1][0]==t&&E[M][0]==e){var J=E[M-1][1],ne=E[M][1],ge=o(J,ne),be=o(ne,J);ge>=be?(ge>=J.length/2||ge>=ne.length/2)&&(E.splice(M,0,[n,ne.substring(0,ge)]),E[M-1][1]=J.substring(0,J.length-ge),E[M+1][1]=ne.substring(ge),M++):(be>=J.length/2||be>=ne.length/2)&&(E.splice(M,0,[n,J.substring(0,be)]),E[M-1][0]=e,E[M-1][1]=ne.substring(0,ne.length-be),E[M+1][0]=t,E[M+1][1]=J.substring(be),M++),M++}M++}}var d=/[^a-zA-Z0-9]/,m=/\s/,b=/[\r\n]/,_=/\n\r?\n$/,T=/^\r?\n\r?\n/;function v(E){function k(be,pe){if(!be||!pe)return 6;var Se=be.charAt(be.length-1),ie=pe.charAt(0),he=Se.match(d),Ce=ie.match(d),Ne=he&&Se.match(m),Ie=Ce&&ie.match(m),Le=Ne&&Se.match(b),Re=Ie&&ie.match(b),$e=Le&&be.match(_),We=Re&&pe.match(T);return $e||We?5:Le||Re?4:he&&!Ne&&Ie?3:Ne||Ie?2:he||Ce?1:0}for(var S=1;S<E.length-1;){if(E[S-1][0]==n&&E[S+1][0]==n){var U=E[S-1][1],F=E[S][1],M=E[S+1][1],Q=f(U,F);if(Q){var z=F.substring(F.length-Q);U=U.substring(0,U.length-Q),F=z+F.substring(0,F.length-Q),M=z+M}for(var $=U,X=F,J=M,ne=k(U,F)+k(F,M);F.charAt(0)===M.charAt(0);){U+=F.charAt(0),F=F.substring(1)+M.charAt(0),M=M.substring(1);var ge=k(U,F)+k(F,M);ge>=ne&&(ne=ge,$=U,X=F,J=M)}E[S-1][1]!=$&&($?E[S-1][1]=$:(E.splice(S-1,1),S--),E[S][1]=X,J?E[S+1][1]=J:(E.splice(S+1,1),S--))}S++}}function O(E,k){E.push([n,""]);for(var S=0,U=0,F=0,M="",Q="",z;S<E.length;){if(S<E.length-1&&!E[S][1]){E.splice(S,1);continue}switch(E[S][0]){case e:F++,Q+=E[S][1],S++;break;case t:U++,M+=E[S][1],S++;break;case n:var $=S-F-U-1;if(k){if($>=0&&q(E[$][1])){var X=E[$][1].slice(-1);if(E[$][1]=E[$][1].slice(0,-1),M=X+M,Q=X+Q,!E[$][1]){E.splice($,1),S--;var J=$-1;E[J]&&E[J][0]===e&&(F++,Q=E[J][1]+Q,J--),E[J]&&E[J][0]===t&&(U++,M=E[J][1]+M,J--),$=J}}if(C(E[S][1])){var X=E[S][1].charAt(0);E[S][1]=E[S][1].slice(1),M+=X,Q+=X}}if(S<E.length-1&&!E[S][1]){E.splice(S,1);break}if(M.length>0||Q.length>0){M.length>0&&Q.length>0&&(z=u(Q,M),z!==0&&($>=0?E[$][1]+=Q.substring(0,z):(E.splice(0,0,[n,Q.substring(0,z)]),S++),Q=Q.substring(z),M=M.substring(z)),z=f(Q,M),z!==0&&(E[S][1]=Q.substring(Q.length-z)+E[S][1],Q=Q.substring(0,Q.length-z),M=M.substring(0,M.length-z)));var ne=F+U;M.length===0&&Q.length===0?(E.splice(S-ne,ne),S=S-ne):M.length===0?(E.splice(S-ne,ne,[e,Q]),S=S-ne+1):Q.length===0?(E.splice(S-ne,ne,[t,M]),S=S-ne+1):(E.splice(S-ne,ne,[t,M],[e,Q]),S=S-ne+2)}S!==0&&E[S-1][0]===n?(E[S-1][1]+=E[S][1],E.splice(S,1)):S++,F=0,U=0,M="",Q="";break}}E[E.length-1][1]===""&&E.pop();var ge=!1;for(S=1;S<E.length-1;)E[S-1][0]===n&&E[S+1][0]===n&&(E[S][1].substring(E[S][1].length-E[S-1][1].length)===E[S-1][1]?(E[S][1]=E[S-1][1]+E[S][1].substring(0,E[S][1].length-E[S-1][1].length),E[S+1][1]=E[S-1][1]+E[S+1][1],E.splice(S-1,1),ge=!0):E[S][1].substring(0,E[S+1][1].length)==E[S+1][1]&&(E[S-1][1]+=E[S+1][1],E[S][1]=E[S][1].substring(E[S+1][1].length)+E[S+1][1],E.splice(S+1,1),ge=!0)),S++;ge&&O(E,k)}function L(E){return E>=55296&&E<=56319}function B(E){return E>=56320&&E<=57343}function C(E){return B(E.charCodeAt(0))}function q(E){return L(E.charCodeAt(E.length-1))}function x(E){for(var k=[],S=0;S<E.length;S++)E[S][1].length>0&&k.push(E[S]);return k}function j(E,k,S,U){return q(E)||C(U)?null:x([[n,E],[t,k],[e,S],[n,U]])}function Z(E,k,S){var U=typeof S=="number"?{index:S,length:0}:S.oldRange,F=typeof S=="number"?null:S.newRange,M=E.length,Q=k.length;if(U.length===0&&(F===null||F.length===0)){var z=U.index,$=E.slice(0,z),X=E.slice(z),J=F?F.index:null;e:{var ne=z+Q-M;if(J!==null&&J!==ne||ne<0||ne>Q)break e;var ge=k.slice(0,ne),be=k.slice(ne);if(be!==X)break e;var pe=Math.min(z,ne),Se=$.slice(0,pe),ie=ge.slice(0,pe);if(Se!==ie)break e;var he=$.slice(pe),Ce=ge.slice(pe);return j(Se,he,Ce,X)}e:{if(J!==null&&J!==z)break e;var Ne=z,ge=k.slice(0,Ne),be=k.slice(Ne);if(ge!==$)break e;var Ie=Math.min(M-Ne,Q-Ne),Le=X.slice(X.length-Ie),Re=be.slice(be.length-Ie);if(Le!==Re)break e;var he=X.slice(0,X.length-Ie),Ce=be.slice(0,be.length-Ie);return j($,he,Ce,Le)}}if(U.length>0&&F&&F.length===0)e:{var Se=E.slice(0,U.index),Le=E.slice(U.index+U.length),pe=Se.length,Ie=Le.length;if(Q<pe+Ie)break e;var ie=k.slice(0,pe),Re=k.slice(Q-Ie);if(Se!==ie||Le!==Re)break e;var he=E.slice(pe,M-Ie),Ce=k.slice(pe,Q-Ie);return j(Se,he,Ce,Le)}return null}function Y(E,k,S,U){return r(E,k,S,U,!0)}return Y.INSERT=e,Y.DELETE=t,Y.EQUAL=n,Pc=Y,Pc}var iu={exports:{}};iu.exports;var E1;function ub(){return E1||(E1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",u="[object Boolean]",o="[object Date]",f="[object Error]",h="[object Function]",g="[object GeneratorFunction]",d="[object Map]",m="[object Number]",b="[object Object]",_="[object Promise]",T="[object RegExp]",v="[object Set]",O="[object String]",L="[object Symbol]",B="[object WeakMap]",C="[object ArrayBuffer]",q="[object DataView]",x="[object Float32Array]",j="[object Float64Array]",Z="[object Int8Array]",Y="[object Int16Array]",E="[object Int32Array]",k="[object Uint8Array]",S="[object Uint8ClampedArray]",U="[object Uint16Array]",F="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,z=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,X={};X[a]=X[i]=X[C]=X[q]=X[u]=X[o]=X[x]=X[j]=X[Z]=X[Y]=X[E]=X[d]=X[m]=X[b]=X[T]=X[v]=X[O]=X[L]=X[k]=X[S]=X[U]=X[F]=!0,X[f]=X[h]=X[B]=!1;var J=typeof Ms=="object"&&Ms&&Ms.Object===Object&&Ms,ne=typeof self=="object"&&self&&self.Object===Object&&self,ge=J||ne||Function("return this")(),be=e&&!e.nodeType&&e,pe=be&&!0&&t&&!t.nodeType&&t,Se=pe&&pe.exports===be;function ie(p,A){return p.set(A[0],A[1]),p}function he(p,A){return p.add(A),p}function Ce(p,A){for(var P=-1,re=p?p.length:0;++P<re&&A(p[P],P,p)!==!1;);return p}function Ne(p,A){for(var P=-1,re=A.length,je=p.length;++P<re;)p[je+P]=A[P];return p}function Ie(p,A,P,re){for(var je=-1,De=p?p.length:0;++je<De;)P=A(P,p[je],je,p);return P}function Le(p,A){for(var P=-1,re=Array(p);++P<p;)re[P]=A(P);return re}function Re(p,A){return p==null?void 0:p[A]}function $e(p){var A=!1;if(p!=null&&typeof p.toString!="function")try{A=!!(p+"")}catch{}return A}function We(p){var A=-1,P=Array(p.size);return p.forEach(function(re,je){P[++A]=[je,re]}),P}function rn(p,A){return function(P){return p(A(P))}}function Ge(p){var A=-1,P=Array(p.size);return p.forEach(function(re){P[++A]=re}),P}var $t=Array.prototype,sn=Function.prototype,Ut=Object.prototype,hn=ge["__core-js_shared__"],pn=(function(){var p=/[^.]+$/.exec(hn&&hn.keys&&hn.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),Yt=sn.toString,Ht=Ut.hasOwnProperty,Nn=Ut.toString,qn=RegExp("^"+Yt.call(Ht).replace(M,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ct=Se?ge.Buffer:void 0,xt=ge.Symbol,Xt=ge.Uint8Array,gt=rn(Object.getPrototypeOf,Object),zt=Object.create,mn=Ut.propertyIsEnumerable,mr=$t.splice,Vn=Object.getOwnPropertySymbols,K=Ct?Ct.isBuffer:void 0,ve=rn(Object.keys,Object),ke=gr(ge,"DataView"),ze=gr(ge,"Map"),Qe=gr(ge,"Promise"),dt=gr(ge,"Set"),Qt=gr(ge,"WeakMap"),xn=gr(Object,"create"),Te=In(ke),Me=In(ze),Ve=In(Qe),Ye=In(dt),le=In(Qt),Rt=xt?xt.prototype:void 0,Mt=Rt?Rt.valueOf:void 0;function bt(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function gn(){this.__data__=xn?xn(null):{}}function jn(p){return this.has(p)&&delete this.__data__[p]}function rs(p){var A=this.__data__;if(xn){var P=A[p];return P===r?void 0:P}return Ht.call(A,p)?A[p]:void 0}function Xn(p){var A=this.__data__;return xn?A[p]!==void 0:Ht.call(A,p)}function Qn(p,A){var P=this.__data__;return P[p]=xn&&A===void 0?r:A,this}bt.prototype.clear=gn,bt.prototype.delete=jn,bt.prototype.get=rs,bt.prototype.has=Xn,bt.prototype.set=Qn;function Bt(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Js(){this.__data__=[]}function ea(p){var A=this.__data__,P=_s(A,p);if(P<0)return!1;var re=A.length-1;return P==re?A.pop():mr.call(A,P,1),!0}function ta(p){var A=this.__data__,P=_s(A,p);return P<0?void 0:A[P][1]}function tt(p){return _s(this.__data__,p)>-1}function wt(p,A){var P=this.__data__,re=_s(P,p);return re<0?P.push([p,A]):P[re][1]=A,this}Bt.prototype.clear=Js,Bt.prototype.delete=ea,Bt.prototype.get=ta,Bt.prototype.has=tt,Bt.prototype.set=wt;function nt(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Sn(){this.__data__={hash:new bt,map:new(ze||Bt),string:new bt}}function bn(p){return sa(this,p).delete(p)}function Ft(p){return sa(this,p).get(p)}function Wt(p){return sa(this,p).has(p)}function Gt(p,A){return sa(this,p).set(p,A),this}nt.prototype.clear=Sn,nt.prototype.delete=bn,nt.prototype.get=Ft,nt.prototype.has=Wt,nt.prototype.set=Gt;function rt(p){this.__data__=new Bt(p)}function Rn(){this.__data__=new Bt}function yt(p){return this.__data__.delete(p)}function Zt(p){return this.__data__.get(p)}function ye(p){return this.__data__.has(p)}function _e(p,A){var P=this.__data__;if(P instanceof Bt){var re=P.__data__;if(!ze||re.length<n-1)return re.push([p,A]),this;P=this.__data__=new nt(re)}return P.set(p,A),this}rt.prototype.clear=Rn,rt.prototype.delete=yt,rt.prototype.get=Zt,rt.prototype.has=ye,rt.prototype.set=_e;function qe(p,A){var P=Yi(p)||Ya(p)?Le(p.length,String):[],re=P.length,je=!!re;for(var De in p)Ht.call(p,De)&&!(je&&(De=="length"||ac(De,re)))&&P.push(De);return P}function vt(p,A,P){var re=p[A];(!(Ht.call(p,A)&&ho(re,P))||P===void 0&&!(A in p))&&(p[A]=P)}function _s(p,A){for(var P=p.length;P--;)if(ho(p[P][0],A))return P;return-1}function Zn(p,A){return p&&$i(A,Wi(A),p)}function na(p,A,P,re,je,De,ut){var st;if(re&&(st=De?re(p,je,De,ut):re(p)),st!==void 0)return st;if(!Ur(p))return p;var qt=Yi(p);if(qt){if(st=rc(p),!A)return ec(p,st)}else{var ht=as(p),vn=ht==h||ht==g;if(po(p))return $a(p,A);if(ht==b||ht==a||vn&&!De){if($e(p))return De?p:{};if(st=Fr(vn?{}:p),!A)return tc(p,Zn(st,p))}else{if(!X[ht])return De?p:{};st=sc(p,ht,na,A)}}ut||(ut=new rt);var Dn=ut.get(p);if(Dn)return Dn;if(ut.set(p,st),!qt)var Kt=P?nc(p):Wi(p);return Ce(Kt||p,function(En,an){Kt&&(an=En,En=p[an]),vt(st,an,na(En,A,P,re,an,p,ut))}),st}function Wl(p){return Ur(p)?zt(p):{}}function Gl(p,A,P){var re=A(p);return Yi(p)?re:Ne(re,P(p))}function Kl(p){return Nn.call(p)}function Vl(p){if(!Ur(p)||uc(p))return!1;var A=zi(p)||$e(p)?qn:z;return A.test(In(p))}function Xl(p){if(!co(p))return ve(p);var A=[];for(var P in Object(p))Ht.call(p,P)&&P!="constructor"&&A.push(P);return A}function $a(p,A){if(A)return p.slice();var P=new p.constructor(p.length);return p.copy(P),P}function ji(p){var A=new p.constructor(p.byteLength);return new Xt(A).set(new Xt(p)),A}function ra(p,A){var P=A?ji(p.buffer):p.buffer;return new p.constructor(P,p.byteOffset,p.byteLength)}function oo(p,A,P){var re=A?P(We(p),!0):We(p);return Ie(re,ie,new p.constructor)}function lo(p){var A=new p.constructor(p.source,Q.exec(p));return A.lastIndex=p.lastIndex,A}function Ql(p,A,P){var re=A?P(Ge(p),!0):Ge(p);return Ie(re,he,new p.constructor)}function Zl(p){return Mt?Object(Mt.call(p)):{}}function Jl(p,A){var P=A?ji(p.buffer):p.buffer;return new p.constructor(P,p.byteOffset,p.length)}function ec(p,A){var P=-1,re=p.length;for(A||(A=Array(re));++P<re;)A[P]=p[P];return A}function $i(p,A,P,re){P||(P={});for(var je=-1,De=A.length;++je<De;){var ut=A[je],st=void 0;vt(P,ut,st===void 0?p[ut]:st)}return P}function tc(p,A){return $i(p,ss(p),A)}function nc(p){return Gl(p,Wi,ss)}function sa(p,A){var P=p.__data__;return ic(A)?P[typeof A=="string"?"string":"hash"]:P.map}function gr(p,A){var P=Re(p,A);return Vl(P)?P:void 0}var ss=Vn?rn(Vn,Object):lc,as=Kl;(ke&&as(new ke(new ArrayBuffer(1)))!=q||ze&&as(new ze)!=d||Qe&&as(Qe.resolve())!=_||dt&&as(new dt)!=v||Qt&&as(new Qt)!=B)&&(as=function(p){var A=Nn.call(p),P=A==b?p.constructor:void 0,re=P?In(P):void 0;if(re)switch(re){case Te:return q;case Me:return d;case Ve:return _;case Ye:return v;case le:return B}return A});function rc(p){var A=p.length,P=p.constructor(A);return A&&typeof p[0]=="string"&&Ht.call(p,"index")&&(P.index=p.index,P.input=p.input),P}function Fr(p){return typeof p.constructor=="function"&&!co(p)?Wl(gt(p)):{}}function sc(p,A,P,re){var je=p.constructor;switch(A){case C:return ji(p);case u:case o:return new je(+p);case q:return ra(p,re);case x:case j:case Z:case Y:case E:case k:case S:case U:case F:return Jl(p,re);case d:return oo(p,re,P);case m:case O:return new je(p);case T:return lo(p);case v:return Ql(p,re,P);case L:return Zl(p)}}function ac(p,A){return A=A??s,!!A&&(typeof p=="number"||$.test(p))&&p>-1&&p%1==0&&p<A}function ic(p){var A=typeof p;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?p!=="__proto__":p===null}function uc(p){return!!pn&&pn in p}function co(p){var A=p&&p.constructor,P=typeof A=="function"&&A.prototype||Ut;return p===P}function In(p){if(p!=null){try{return Yt.call(p)}catch{}try{return p+""}catch{}}return""}function fo(p){return na(p,!0,!0)}function ho(p,A){return p===A||p!==p&&A!==A}function Ya(p){return oc(p)&&Ht.call(p,"callee")&&(!mn.call(p,"callee")||Nn.call(p)==a)}var Yi=Array.isArray;function za(p){return p!=null&&mo(p.length)&&!zi(p)}function oc(p){return go(p)&&za(p)}var po=K||cc;function zi(p){var A=Ur(p)?Nn.call(p):"";return A==h||A==g}function mo(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=s}function Ur(p){var A=typeof p;return!!p&&(A=="object"||A=="function")}function go(p){return!!p&&typeof p=="object"}function Wi(p){return za(p)?qe(p):Xl(p)}function lc(){return[]}function cc(){return!1}t.exports=fo})(iu,iu.exports)),iu.exports}var uu={exports:{}};uu.exports;var T1;function ob(){return T1||(T1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,u="[object Arguments]",o="[object Array]",f="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",d="[object Error]",m="[object Function]",b="[object GeneratorFunction]",_="[object Map]",T="[object Number]",v="[object Null]",O="[object Object]",L="[object Promise]",B="[object Proxy]",C="[object RegExp]",q="[object Set]",x="[object String]",j="[object Symbol]",Z="[object Undefined]",Y="[object WeakMap]",E="[object ArrayBuffer]",k="[object DataView]",S="[object Float32Array]",U="[object Float64Array]",F="[object Int8Array]",M="[object Int16Array]",Q="[object Int32Array]",z="[object Uint8Array]",$="[object Uint8ClampedArray]",X="[object Uint16Array]",J="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,pe={};pe[S]=pe[U]=pe[F]=pe[M]=pe[Q]=pe[z]=pe[$]=pe[X]=pe[J]=!0,pe[u]=pe[o]=pe[E]=pe[h]=pe[k]=pe[g]=pe[d]=pe[m]=pe[_]=pe[T]=pe[O]=pe[C]=pe[q]=pe[x]=pe[Y]=!1;var Se=typeof Ms=="object"&&Ms&&Ms.Object===Object&&Ms,ie=typeof self=="object"&&self&&self.Object===Object&&self,he=Se||ie||Function("return this")(),Ce=e&&!e.nodeType&&e,Ne=Ce&&!0&&t&&!t.nodeType&&t,Ie=Ne&&Ne.exports===Ce,Le=Ie&&Se.process,Re=(function(){try{return Le&&Le.binding&&Le.binding("util")}catch{}})(),$e=Re&&Re.isTypedArray;function We(p,A){for(var P=-1,re=p==null?0:p.length,je=0,De=[];++P<re;){var ut=p[P];A(ut,P,p)&&(De[je++]=ut)}return De}function rn(p,A){for(var P=-1,re=A.length,je=p.length;++P<re;)p[je+P]=A[P];return p}function Ge(p,A){for(var P=-1,re=p==null?0:p.length;++P<re;)if(A(p[P],P,p))return!0;return!1}function $t(p,A){for(var P=-1,re=Array(p);++P<p;)re[P]=A(P);return re}function sn(p){return function(A){return p(A)}}function Ut(p,A){return p.has(A)}function hn(p,A){return p==null?void 0:p[A]}function pn(p){var A=-1,P=Array(p.size);return p.forEach(function(re,je){P[++A]=[je,re]}),P}function Yt(p,A){return function(P){return p(A(P))}}function Ht(p){var A=-1,P=Array(p.size);return p.forEach(function(re){P[++A]=re}),P}var Nn=Array.prototype,qn=Function.prototype,Ct=Object.prototype,xt=he["__core-js_shared__"],Xt=qn.toString,gt=Ct.hasOwnProperty,zt=(function(){var p=/[^.]+$/.exec(xt&&xt.keys&&xt.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),mn=Ct.toString,mr=RegExp("^"+Xt.call(gt).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vn=Ie?he.Buffer:void 0,K=he.Symbol,ve=he.Uint8Array,ke=Ct.propertyIsEnumerable,ze=Nn.splice,Qe=K?K.toStringTag:void 0,dt=Object.getOwnPropertySymbols,Qt=Vn?Vn.isBuffer:void 0,xn=Yt(Object.keys,Object),Te=ss(he,"DataView"),Me=ss(he,"Map"),Ve=ss(he,"Promise"),Ye=ss(he,"Set"),le=ss(he,"WeakMap"),Rt=ss(Object,"create"),Mt=In(Te),bt=In(Me),gn=In(Ve),jn=In(Ye),rs=In(le),Xn=K?K.prototype:void 0,Qn=Xn?Xn.valueOf:void 0;function Bt(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Js(){this.__data__=Rt?Rt(null):{},this.size=0}function ea(p){var A=this.has(p)&&delete this.__data__[p];return this.size-=A?1:0,A}function ta(p){var A=this.__data__;if(Rt){var P=A[p];return P===r?void 0:P}return gt.call(A,p)?A[p]:void 0}function tt(p){var A=this.__data__;return Rt?A[p]!==void 0:gt.call(A,p)}function wt(p,A){var P=this.__data__;return this.size+=this.has(p)?0:1,P[p]=Rt&&A===void 0?r:A,this}Bt.prototype.clear=Js,Bt.prototype.delete=ea,Bt.prototype.get=ta,Bt.prototype.has=tt,Bt.prototype.set=wt;function nt(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Sn(){this.__data__=[],this.size=0}function bn(p){var A=this.__data__,P=$a(A,p);if(P<0)return!1;var re=A.length-1;return P==re?A.pop():ze.call(A,P,1),--this.size,!0}function Ft(p){var A=this.__data__,P=$a(A,p);return P<0?void 0:A[P][1]}function Wt(p){return $a(this.__data__,p)>-1}function Gt(p,A){var P=this.__data__,re=$a(P,p);return re<0?(++this.size,P.push([p,A])):P[re][1]=A,this}nt.prototype.clear=Sn,nt.prototype.delete=bn,nt.prototype.get=Ft,nt.prototype.has=Wt,nt.prototype.set=Gt;function rt(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Rn(){this.size=0,this.__data__={hash:new Bt,map:new(Me||nt),string:new Bt}}function yt(p){var A=gr(this,p).delete(p);return this.size-=A?1:0,A}function Zt(p){return gr(this,p).get(p)}function ye(p){return gr(this,p).has(p)}function _e(p,A){var P=gr(this,p),re=P.size;return P.set(p,A),this.size+=P.size==re?0:1,this}rt.prototype.clear=Rn,rt.prototype.delete=yt,rt.prototype.get=Zt,rt.prototype.has=ye,rt.prototype.set=_e;function qe(p){var A=-1,P=p==null?0:p.length;for(this.__data__=new rt;++A<P;)this.add(p[A])}function vt(p){return this.__data__.set(p,r),this}function _s(p){return this.__data__.has(p)}qe.prototype.add=qe.prototype.push=vt,qe.prototype.has=_s;function Zn(p){var A=this.__data__=new nt(p);this.size=A.size}function na(){this.__data__=new nt,this.size=0}function Wl(p){var A=this.__data__,P=A.delete(p);return this.size=A.size,P}function Gl(p){return this.__data__.get(p)}function Kl(p){return this.__data__.has(p)}function Vl(p,A){var P=this.__data__;if(P instanceof nt){var re=P.__data__;if(!Me||re.length<n-1)return re.push([p,A]),this.size=++P.size,this;P=this.__data__=new rt(re)}return P.set(p,A),this.size=P.size,this}Zn.prototype.clear=na,Zn.prototype.delete=Wl,Zn.prototype.get=Gl,Zn.prototype.has=Kl,Zn.prototype.set=Vl;function Xl(p,A){var P=Ya(p),re=!P&&ho(p),je=!P&&!re&&za(p),De=!P&&!re&&!je&&go(p),ut=P||re||je||De,st=ut?$t(p.length,String):[],qt=st.length;for(var ht in p)gt.call(p,ht)&&!(ut&&(ht=="length"||je&&(ht=="offset"||ht=="parent")||De&&(ht=="buffer"||ht=="byteLength"||ht=="byteOffset")||sc(ht,qt)))&&st.push(ht);return st}function $a(p,A){for(var P=p.length;P--;)if(fo(p[P][0],A))return P;return-1}function ji(p,A,P){var re=A(p);return Ya(p)?re:rn(re,P(p))}function ra(p){return p==null?p===void 0?Z:v:Qe&&Qe in Object(p)?as(p):co(p)}function oo(p){return Ur(p)&&ra(p)==u}function lo(p,A,P,re,je){return p===A?!0:p==null||A==null||!Ur(p)&&!Ur(A)?p!==p&&A!==A:Ql(p,A,P,re,lo,je)}function Ql(p,A,P,re,je,De){var ut=Ya(p),st=Ya(A),qt=ut?o:Fr(p),ht=st?o:Fr(A);qt=qt==u?O:qt,ht=ht==u?O:ht;var vn=qt==O,Dn=ht==O,Kt=qt==ht;if(Kt&&za(p)){if(!za(A))return!1;ut=!0,vn=!1}if(Kt&&!vn)return De||(De=new Zn),ut||go(p)?$i(p,A,P,re,je,De):tc(p,A,qt,P,re,je,De);if(!(P&s)){var En=vn&&gt.call(p,"__wrapped__"),an=Dn&&gt.call(A,"__wrapped__");if(En||an){var As=En?p.value():p,is=an?A.value():A;return De||(De=new Zn),je(As,is,P,re,De)}}return Kt?(De||(De=new Zn),nc(p,A,P,re,je,De)):!1}function Zl(p){if(!mo(p)||ic(p))return!1;var A=po(p)?mr:ge;return A.test(In(p))}function Jl(p){return Ur(p)&&zi(p.length)&&!!pe[ra(p)]}function ec(p){if(!uc(p))return xn(p);var A=[];for(var P in Object(p))gt.call(p,P)&&P!="constructor"&&A.push(P);return A}function $i(p,A,P,re,je,De){var ut=P&s,st=p.length,qt=A.length;if(st!=qt&&!(ut&&qt>st))return!1;var ht=De.get(p);if(ht&&De.get(A))return ht==A;var vn=-1,Dn=!0,Kt=P&a?new qe:void 0;for(De.set(p,A),De.set(A,p);++vn<st;){var En=p[vn],an=A[vn];if(re)var As=ut?re(an,En,vn,A,p,De):re(En,an,vn,p,A,De);if(As!==void 0){if(As)continue;Dn=!1;break}if(Kt){if(!Ge(A,function(is,aa){if(!Ut(Kt,aa)&&(En===is||je(En,is,P,re,De)))return Kt.push(aa)})){Dn=!1;break}}else if(!(En===an||je(En,an,P,re,De))){Dn=!1;break}}return De.delete(p),De.delete(A),Dn}function tc(p,A,P,re,je,De,ut){switch(P){case k:if(p.byteLength!=A.byteLength||p.byteOffset!=A.byteOffset)return!1;p=p.buffer,A=A.buffer;case E:return!(p.byteLength!=A.byteLength||!De(new ve(p),new ve(A)));case h:case g:case T:return fo(+p,+A);case d:return p.name==A.name&&p.message==A.message;case C:case x:return p==A+"";case _:var st=pn;case q:var qt=re&s;if(st||(st=Ht),p.size!=A.size&&!qt)return!1;var ht=ut.get(p);if(ht)return ht==A;re|=a,ut.set(p,A);var vn=$i(st(p),st(A),re,je,De,ut);return ut.delete(p),vn;case j:if(Qn)return Qn.call(p)==Qn.call(A)}return!1}function nc(p,A,P,re,je,De){var ut=P&s,st=sa(p),qt=st.length,ht=sa(A),vn=ht.length;if(qt!=vn&&!ut)return!1;for(var Dn=qt;Dn--;){var Kt=st[Dn];if(!(ut?Kt in A:gt.call(A,Kt)))return!1}var En=De.get(p);if(En&&De.get(A))return En==A;var an=!0;De.set(p,A),De.set(A,p);for(var As=ut;++Dn<qt;){Kt=st[Dn];var is=p[Kt],aa=A[Kt];if(re)var Mh=ut?re(aa,is,Kt,A,p,De):re(is,aa,Kt,p,A,De);if(!(Mh===void 0?is===aa||je(is,aa,P,re,De):Mh)){an=!1;break}As||(As=Kt=="constructor")}if(an&&!As){var bo=p.constructor,vo=A.constructor;bo!=vo&&"constructor"in p&&"constructor"in A&&!(typeof bo=="function"&&bo instanceof bo&&typeof vo=="function"&&vo instanceof vo)&&(an=!1)}return De.delete(p),De.delete(A),an}function sa(p){return ji(p,Wi,rc)}function gr(p,A){var P=p.__data__;return ac(A)?P[typeof A=="string"?"string":"hash"]:P.map}function ss(p,A){var P=hn(p,A);return Zl(P)?P:void 0}function as(p){var A=gt.call(p,Qe),P=p[Qe];try{p[Qe]=void 0;var re=!0}catch{}var je=mn.call(p);return re&&(A?p[Qe]=P:delete p[Qe]),je}var rc=dt?function(p){return p==null?[]:(p=Object(p),We(dt(p),function(A){return ke.call(p,A)}))}:lc,Fr=ra;(Te&&Fr(new Te(new ArrayBuffer(1)))!=k||Me&&Fr(new Me)!=_||Ve&&Fr(Ve.resolve())!=L||Ye&&Fr(new Ye)!=q||le&&Fr(new le)!=Y)&&(Fr=function(p){var A=ra(p),P=A==O?p.constructor:void 0,re=P?In(P):"";if(re)switch(re){case Mt:return k;case bt:return _;case gn:return L;case jn:return q;case rs:return Y}return A});function sc(p,A){return A=A??i,!!A&&(typeof p=="number"||be.test(p))&&p>-1&&p%1==0&&p<A}function ac(p){var A=typeof p;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?p!=="__proto__":p===null}function ic(p){return!!zt&&zt in p}function uc(p){var A=p&&p.constructor,P=typeof A=="function"&&A.prototype||Ct;return p===P}function co(p){return mn.call(p)}function In(p){if(p!=null){try{return Xt.call(p)}catch{}try{return p+""}catch{}}return""}function fo(p,A){return p===A||p!==p&&A!==A}var ho=oo((function(){return arguments})())?oo:function(p){return Ur(p)&&gt.call(p,"callee")&&!ke.call(p,"callee")},Ya=Array.isArray;function Yi(p){return p!=null&&zi(p.length)&&!po(p)}var za=Qt||cc;function oc(p,A){return lo(p,A)}function po(p){if(!mo(p))return!1;var A=ra(p);return A==m||A==b||A==f||A==B}function zi(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=i}function mo(p){var A=typeof p;return p!=null&&(A=="object"||A=="function")}function Ur(p){return p!=null&&typeof p=="object"}var go=$e?sn($e):Jl;function Wi(p){return Yi(p)?Xl(p):ec(p)}function lc(){return[]}function cc(){return!1}t.exports=oc})(uu,uu.exports)),uu.exports}var Oo={},_1;function Yw(){if(_1)return Oo;_1=1,Object.defineProperty(Oo,"__esModule",{value:!0});const t=ub(),e=ob();var n;return(function(r){function s(o={},f={},h=!1){typeof o!="object"&&(o={}),typeof f!="object"&&(f={});let g=t(f);h||(g=Object.keys(g).reduce((d,m)=>(g[m]!=null&&(d[m]=g[m]),d),{}));for(const d in o)o[d]!==void 0&&f[d]===void 0&&(g[d]=o[d]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(o={},f={}){typeof o!="object"&&(o={}),typeof f!="object"&&(f={});const h=Object.keys(o).concat(Object.keys(f)).reduce((g,d)=>(e(o[d],f[d])||(g[d]=f[d]===void 0?null:f[d]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(o={},f={}){o=o||{};const h=Object.keys(f).reduce((g,d)=>(f[d]!==o[d]&&o[d]!==void 0&&(g[d]=f[d]),g),{});return Object.keys(o).reduce((g,d)=>(o[d]!==f[d]&&f[d]===void 0&&(g[d]=null),g),h)}r.invert=i;function u(o,f,h=!1){if(typeof o!="object")return f;if(typeof f!="object")return;if(!h)return f;const g=Object.keys(f).reduce((d,m)=>(o[m]===void 0&&(d[m]=f[m]),d),{});return Object.keys(g).length>0?g:void 0}r.transform=u})(n||(n={})),Oo.default=n,Oo}var xo={},A1;function lb(){if(A1)return xo;A1=1,Object.defineProperty(xo,"__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={})),xo.default=t,xo}var Ro={},y1;function zw(){if(y1)return Ro;y1=1,Object.defineProperty(Ro,"__esModule",{value:!0});const t=lb();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 u={};return s.attributes&&(u.attributes=s.attributes),typeof s.retain=="number"?u.retain=r:typeof s.retain=="object"&&s.retain!==null?u.retain=s.retain:typeof s.insert=="string"?u.insert=s.insert.substr(a,r):u.insert=s.insert,u}}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 Ro.default=e,Ro}var N1;function Ww(){return N1||(N1=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=$w(),r=ub(),s=ob(),a=Yw();e.AttributeMap=a.default;const i=lb();e.Op=i.default;const u=zw();e.OpIterator=u.default;const o="\0",f=(g,d)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof d!="object"||d===null)throw new Error(`cannot retain a ${typeof d}`);const m=Object.keys(g)[0];if(!m||m!==Object.keys(d)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(d)[0]}`);return[m,g[m],d[m]]};class h{constructor(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]}static registerEmbed(d,m){this.handlers[d]=m}static unregisterEmbed(d){delete this.handlers[d]}static getHandler(d){const m=this.handlers[d];if(!m)throw new Error(`no handlers for embed type "${d}"`);return m}insert(d,m){const b={};return typeof d=="string"&&d.length===0?this:(b.insert=d,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b))}delete(d){return d<=0?this:this.push({delete:d})}retain(d,m){if(typeof d=="number"&&d<=0)return this;const b={retain:d};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b)}push(d){let m=this.ops.length,b=this.ops[m-1];if(d=r(d),typeof b=="object"){if(typeof d.delete=="number"&&typeof b.delete=="number")return this.ops[m-1]={delete:b.delete+d.delete},this;if(typeof b.delete=="number"&&d.insert!=null&&(m-=1,b=this.ops[m-1],typeof b!="object"))return this.ops.unshift(d),this;if(s(d.attributes,b.attributes)){if(typeof d.insert=="string"&&typeof b.insert=="string")return this.ops[m-1]={insert:b.insert+d.insert},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof b.retain=="number")return this.ops[m-1]={retain:b.retain+d.retain},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this}}return m===this.ops.length?this.ops.push(d):this.ops.splice(m,0,d),this}chop(){const d=this.ops[this.ops.length-1];return d&&typeof d.retain=="number"&&!d.attributes&&this.ops.pop(),this}filter(d){return this.ops.filter(d)}forEach(d){this.ops.forEach(d)}map(d){return this.ops.map(d)}partition(d){const m=[],b=[];return this.forEach(_=>{(d(_)?m:b).push(_)}),[m,b]}reduce(d,m){return this.ops.reduce(d,m)}changeLength(){return this.reduce((d,m)=>m.insert?d+i.default.length(m):m.delete?d-m.delete:d,0)}length(){return this.reduce((d,m)=>d+i.default.length(m),0)}slice(d=0,m=1/0){const b=[],_=new u.default(this.ops);let T=0;for(;T<m&&_.hasNext();){let v;T<d?v=_.next(d-T):(v=_.next(m-T),b.push(v)),T+=i.default.length(v)}return new h(b)}compose(d){const m=new u.default(this.ops),b=new u.default(d.ops),_=[],T=b.peek();if(T!=null&&typeof T.retain=="number"&&T.attributes==null){let O=T.retain;for(;m.peekType()==="insert"&&m.peekLength()<=O;)O-=m.peekLength(),_.push(m.next());T.retain-O>0&&b.next(T.retain-O)}const v=new h(_);for(;m.hasNext()||b.hasNext();)if(b.peekType()==="insert")v.push(b.next());else if(m.peekType()==="delete")v.push(m.next());else{const O=Math.min(m.peekLength(),b.peekLength()),L=m.next(O),B=b.next(O);if(B.retain){const C={};if(typeof L.retain=="number")C.retain=typeof B.retain=="number"?O:B.retain;else if(typeof B.retain=="number")L.retain==null?C.insert=L.insert:C.retain=L.retain;else{const x=L.retain==null?"insert":"retain",[j,Z,Y]=f(L[x],B.retain),E=h.getHandler(j);C[x]={[j]:E.compose(Z,Y,x==="retain")}}const q=a.default.compose(L.attributes,B.attributes,typeof L.retain=="number");if(q&&(C.attributes=q),v.push(C),!b.hasNext()&&s(v.ops[v.ops.length-1],C)){const x=new h(m.rest());return v.concat(x).chop()}}else typeof B.delete=="number"&&(typeof L.retain=="number"||typeof L.retain=="object"&&L.retain!==null)&&v.push(B)}return v.chop()}concat(d){const m=new h(this.ops.slice());return d.ops.length>0&&(m.push(d.ops[0]),m.ops=m.ops.concat(d.ops.slice(1))),m}diff(d,m){if(this.ops===d.ops)return new h;const b=[this,d].map(L=>L.map(B=>{if(B.insert!=null)return typeof B.insert=="string"?B.insert:o;const C=L===d?"on":"with";throw new Error("diff() called "+C+" non-document")}).join("")),_=new h,T=n(b[0],b[1],m,!0),v=new u.default(this.ops),O=new u.default(d.ops);return T.forEach(L=>{let B=L[1].length;for(;B>0;){let C=0;switch(L[0]){case n.INSERT:C=Math.min(O.peekLength(),B),_.push(O.next(C));break;case n.DELETE:C=Math.min(B,v.peekLength()),v.next(C),_.delete(C);break;case n.EQUAL:C=Math.min(v.peekLength(),O.peekLength(),B);const q=v.next(C),x=O.next(C);s(q.insert,x.insert)?_.retain(C,a.default.diff(q.attributes,x.attributes)):_.push(x).delete(C);break}B-=C}}),_.chop()}eachLine(d,m=`
67
- `){const b=new u.default(this.ops);let _=new h,T=0;for(;b.hasNext();){if(b.peekType()!=="insert")return;const v=b.peek(),O=i.default.length(v)-b.peekLength(),L=typeof v.insert=="string"?v.insert.indexOf(m,O)-O:-1;if(L<0)_.push(b.next());else if(L>0)_.push(b.next(L));else{if(d(_,b.next(1).attributes||{},T)===!1)return;T+=1,_=new h}}_.length()>0&&d(_,{},T)}invert(d){const m=new h;return this.reduce((b,_)=>{if(_.insert)m.delete(i.default.length(_));else{if(typeof _.retain=="number"&&_.attributes==null)return m.retain(_.retain),b+_.retain;if(_.delete||typeof _.retain=="number"){const T=_.delete||_.retain;return d.slice(b,b+T).forEach(O=>{_.delete?m.push(O):_.retain&&_.attributes&&m.retain(i.default.length(O),a.default.invert(_.attributes,O.attributes))}),b+T}else if(typeof _.retain=="object"&&_.retain!==null){const T=d.slice(b,b+1),v=new u.default(T.ops).next(),[O,L,B]=f(_.retain,v.insert),C=h.getHandler(O);return m.retain({[O]:C.invert(L,B)},a.default.invert(_.attributes,v.attributes)),b+1}}return b},0),m.chop()}transform(d,m=!1){if(m=!!m,typeof d=="number")return this.transformPosition(d,m);const b=d,_=new u.default(this.ops),T=new u.default(b.ops),v=new h;for(;_.hasNext()||T.hasNext();)if(_.peekType()==="insert"&&(m||T.peekType()!=="insert"))v.retain(i.default.length(_.next()));else if(T.peekType()==="insert")v.push(T.next());else{const O=Math.min(_.peekLength(),T.peekLength()),L=_.next(O),B=T.next(O);if(L.delete)continue;if(B.delete)v.push(B);else{const C=L.retain,q=B.retain;let x=typeof q=="object"&&q!==null?q:O;if(typeof C=="object"&&C!==null&&typeof q=="object"&&q!==null){const j=Object.keys(C)[0];if(j===Object.keys(q)[0]){const Z=h.getHandler(j);Z&&(x={[j]:Z.transform(C[j],q[j],m)})}}v.retain(x,a.default.transform(L.attributes,B.attributes,m))}}return v.chop()}transformPosition(d,m=!1){m=!!m;const b=new u.default(this.ops);let _=0;for(;b.hasNext()&&_<=d;){const T=b.peekLength(),v=b.peekType();if(b.next(),v==="delete"){d-=Math.min(T,d-_);continue}else v==="insert"&&(_<d||!m)&&(d+=T);_+=T}return d}}h.Op=i.default,h.OpIterator=u.default,h.AttributeMap=a.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h})(Lo,Lo.exports)),Lo.exports}var lr=Ww();const Oe=ib(lr);class Mr extends Kn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Mr.blotName="break";Mr.tagName="BR";let Or=class extends bl{};const Gw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function $l(t){return t.replace(/[&<>"']/g,e=>Gw[e])}const Hr=class Hr extends yh{static compare(e,n){const r=Hr.order.indexOf(e),s=Hr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(Hr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,xe.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 Hr&&Hr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};Ee(Hr,"allowedChildren",[Hr,Mr,Kn,Or]),Ee(Hr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let ts=Hr;const S1=1;class cn extends Pu{constructor(){super(...arguments);Ee(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=cb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,xe.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(`
68
- `),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 u=this;a.reduce((o,f)=>(u=u.split(o,!0),u.insertAt(0,f),f.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Mr&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+S1),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()-S1)){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}}cn.blotName="block";cn.tagName="P";cn.defaultChild=Mr;cn.allowedChildren=[Mr,ts,Kn,Or];class or extends Kn{attach(){super.attach(),this.attributes=new ql(this.domNode)}delta(){return new Oe().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,xe.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(`
69
- `),a=s.pop(),i=s.map(o=>{const f=this.scroll.create(cn.blotName);return f.insertAt(0,o),f}),u=this.split(e);i.forEach(o=>{this.parent.insertBefore(o,u)}),a&&this.parent.insertBefore(this.scroll.create("text",a),u)}}or.scope=xe.BLOCK_BLOT;function cb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(_n).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),ar(r,{},e)),new Oe).insert(`
70
- `,ar(t))}function ar(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:ar(t.parent,e,n)}const Jn=class Jn extends Kn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(Jn.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!==xe.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Jn.CONTENTS.length,r.optimize(),r.formatAt(s,Jn.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 Or?this.prev:null,r=n?n.length():0,s=this.next instanceof Or?this.next:null,a=s?s.text:"",{textNode:i}=this,u=i.data.split(Jn.CONTENTS).join("");i.data=Jn.CONTENTS;let o;if(n)o=n,(u||s)&&(n.insertAt(n.length(),u+a),s&&s.remove());else if(s)o=s,s.insertAt(0,u);else{const f=document.createTextNode(u);o=this.scroll.create(f),this.parent.insertBefore(o,this)}if(this.remove(),e){const f=(d,m)=>n&&d===n.domNode?m:d===i?r+m-1:s&&d===s.domNode?r+u.length+m:null,h=f(e.start.node,e.start.offset),g=f(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:o.domNode,startOffset:h,endNode:o.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=Jn.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};Ee(Jn,"blotName","cursor"),Ee(Jn,"className","ql-cursor"),Ee(Jn,"tagName","span"),Ee(Jn,"CONTENTS","\uFEFF");let ki=Jn;var Mc={exports:{}},I1;function Kw(){return I1||(I1=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(o,f,h){this.fn=o,this.context=f,this.once=h||!1}function a(o,f,h,g,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var m=new s(h,g||o,d),b=n?n+f:f;return o._events[b]?o._events[b].fn?o._events[b]=[o._events[b],m]:o._events[b].push(m):(o._events[b]=m,o._eventsCount++),o}function i(o,f){--o._eventsCount===0?o._events=new r:delete o._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],h,g;if(this._eventsCount===0)return f;for(g in h=this._events)e.call(h,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},u.prototype.listeners=function(f){var h=n?n+f:f,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var d=0,m=g.length,b=new Array(m);d<m;d++)b[d]=g[d].fn;return b},u.prototype.listenerCount=function(f){var h=n?n+f:f,g=this._events[h];return g?g.fn?1:g.length:0},u.prototype.emit=function(f,h,g,d,m,b){var _=n?n+f:f;if(!this._events[_])return!1;var T=this._events[_],v=arguments.length,O,L;if(T.fn){switch(T.once&&this.removeListener(f,T.fn,void 0,!0),v){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,h),!0;case 3:return T.fn.call(T.context,h,g),!0;case 4:return T.fn.call(T.context,h,g,d),!0;case 5:return T.fn.call(T.context,h,g,d,m),!0;case 6:return T.fn.call(T.context,h,g,d,m,b),!0}for(L=1,O=new Array(v-1);L<v;L++)O[L-1]=arguments[L];T.fn.apply(T.context,O)}else{var B=T.length,C;for(L=0;L<B;L++)switch(T[L].once&&this.removeListener(f,T[L].fn,void 0,!0),v){case 1:T[L].fn.call(T[L].context);break;case 2:T[L].fn.call(T[L].context,h);break;case 3:T[L].fn.call(T[L].context,h,g);break;case 4:T[L].fn.call(T[L].context,h,g,d);break;default:if(!O)for(C=1,O=new Array(v-1);C<v;C++)O[C-1]=arguments[C];T[L].fn.apply(T[L].context,O)}}return!0},u.prototype.on=function(f,h,g){return a(this,f,h,g,!1)},u.prototype.once=function(f,h,g){return a(this,f,h,g,!0)},u.prototype.removeListener=function(f,h,g,d){var m=n?n+f:f;if(!this._events[m])return this;if(!h)return i(this,m),this;var b=this._events[m];if(b.fn)b.fn===h&&(!d||b.once)&&(!g||b.context===g)&&i(this,m);else{for(var _=0,T=[],v=b.length;_<v;_++)(b[_].fn!==h||d&&!b[_].once||g&&b[_].context!==g)&&T.push(b[_]);T.length?this._events[m]=T.length===1?T[0]:T:i(this,m)}return this},u.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u})(Mc)),Mc.exports}var Vw=Kw();const Xw=ib(Vw),od=new WeakMap,ld=["error","warn","log","info"];let cd="warn";function fb(t){if(cd&&ld.indexOf(t)<=ld.indexOf(cd)){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 Ts(t){return ld.reduce((e,n)=>(e[n]=fb.bind(console,n,t),e),{})}Ts.level=t=>{cd=t};fb.level=Ts.level;const Bc=Ts("quill:events"),Qw=["selectionchange","mousedown","mouseup","click"];Qw.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=od.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class we extends Xw{constructor(){super(),this.domListeners={},this.on("error",Bc.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Bc.log.call(Bc,...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:u}=a;(e.target===i||i.contains(e.target))&&u(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}Ee(we,"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"}),Ee(we,"sources",{API:"api",SILENT:"silent",USER:"user"});const Fc=Ts("quill:selection");class Oa{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class Zw{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 Oa(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,we.sources.USER),1)}),this.emitter.on(we.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(we.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(u=>u.type==="characterData"||u.type==="childList"||u.type==="attributes"&&u.target===this.root);this.update(i?we.sources.SILENT:s)}catch{}})}),this.emitter.on(we.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:u,endOffset:o}=s.range;this.setNativeRange(a,i,u,o),this.update(we.sources.SILENT)}}),this.update(we.sources.SILENT)}handleComposition(){this.emitter.on(we.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(we.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(we.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,xe.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof _n){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),[d]=this.scroll.line(e+1);g===d&&(a=h,i=0)}}[s,i]=a.position(i,!0);const u=document.createRange();if(n>0)return u.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),u.setEnd(s,i),u.getBoundingClientRect());let o="left",f;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(u.setStart(s,i),u.setEnd(s,i+1)):(u.setStart(s,i-1),u.setEnd(s,i),o="right"),f=u.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;f=a.domNode.getBoundingClientRect(),i>0&&(o="right")}return{bottom:f.top+f.height,height:f.height,left:f[o],right:f[o],top:f.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 Fc.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&&Uc(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[u,o]=i,f=this.scroll.find(u,!0),h=f.offset(this.scroll);return o===0?h:f instanceof _n?h+f.index(u,o):h+f.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Oa(a,s-a)}normalizeNative(e){if(!Uc(this.root,e.startContainer)||!e.collapsed&&!Uc(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,u]=this.scroll.leaf(s);return i?i.position(u,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(Fc.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:u}=this.getNativeRange()||{};if(u==null||a||e!==u.startContainer||n!==u.startOffset||r!==u.endContainer||s!==u.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 o=document.createRange();o.setStart(e,n),o.setEnd(r,s),i.removeAllRanges(),i.addRange(o)}}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]:we.sources.API;if(typeof n=="string"&&(r=n,n=!1),Fc.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]:we.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ah(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=[we.events.SELECTION_CHANGE,oi(this.lastRange),oi(n),e];this.emitter.emit(we.events.EDITOR_CHANGE,...a),e!==we.sources.SILENT&&this.emitter.emit(...a)}}}function Uc(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const Jw=/^[ -~]*$/;class e4{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=C1(e),s=new Oe;return n4(r.ops.slice()).reduce((i,u)=>{const o=lr.Op.length(u);let f=u.attributes||{},h=!1,g=!1;if(u.insert!=null){if(s.retain(o),typeof u.insert=="string"){const b=u.insert;g=!b.endsWith(`
64
+ */const rN=Symbol("lucide-context"),sN=()=>Mv(rN);var aN=IE("<svg><!><!></svg>");function kr(t,e){ct(e,!0);const n=sN()??{},r=ur(e,"color",19,()=>n.color??"currentColor"),s=ur(e,"size",19,()=>n.size??24),a=ur(e,"strokeWidth",19,()=>n.strokeWidth??2),i=ur(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),u=ur(e,"iconNode",19,()=>[]),o=pr(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),f=Ae(()=>i()?Number(a())*24/Number(s()):a());var h=aN();Xh(h,m=>({...tN,...m,...o,width:s(),height:s(),stroke:r(),"stroke-width":c(f),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!nN(o)&&{"aria-hidden":"true"}]);var g=I(h);Ot(g,17,u,Iu,(m,b)=>{var _=Ae(()=>rv(c(b),2));let T=()=>c(_)[0],v=()=>c(_)[1];var O=Ir(),L=pt(O);BE(L,T,!0,(B,C)=>{Xh(B,()=>({...v()}))}),H(m,O)});var d=R(g);PE(d,()=>e.children??Ad),H(t,h),ft()}function fh(t,e){let n=pr(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"}]];kr(t,Rr({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function iN(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];kr(t,Rr({name:"plus"},()=>n,{get iconNode(){return r}}))}function dh(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];kr(t,Rr({name:"x"},()=>n,{get iconNode(){return r}}))}function uN(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];kr(t,Rr({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function oN(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];kr(t,Rr({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function Dg(t,e){let n=pr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];kr(t,Rr({name:"search"},()=>n,{get iconNode(){return r}}))}function lN(t,e){let n=pr(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"}]];kr(t,Rr({name:"house"},()=>n,{get iconNode(){return r}}))}function cN(t,e){let n=pr(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"}]];kr(t,Rr({name:"link"},()=>n,{get iconNode(){return r}}))}function fN(t,e){let n=pr(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"}]];kr(t,Rr({name:"external-link"},()=>n,{get iconNode(){return r}}))}function zf(t,e){let n=pr(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"}]];kr(t,Rr({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function dN(t,e){let n=pr(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"}]];kr(t,Rr({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}let hh=ee(null),ph=ee(null);function si(){return c(hh)}function Y0(){return c(ph)}function hN(t,e){y(hh,{entry:t,parent:e},!0)}function Lc(t){y(ph,t,!0)}function Ss(){y(hh,null),y(ph,null)}let Oc=ee(null);const Wf={get target(){return c(Oc)},request(t){y(Oc,t,!0)},clear(){y(Oc,null)}};function pN(){let t=ee("content");return{get mode(){return c(t)},set(e){y(t,e,!0)}}}const Cs=pN(),mN="nanoesis-restore:";function Gf(t){return`${mN}${t}`}function gN(t,e,n){t.getItem(Gf(e))===null&&t.setItem(Gf(e),JSON.stringify(n))}function bN(t,e){const n=t.getItem(Gf(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function vN(){let t=ee("saved"),e=null;return{get state(){return c(t)},get canRetry(){return c(t)==="error"&&e!==null},saving(){y(t,"saving")},saved(){y(t,"saved"),e=null},failed(n){y(t,"error"),e=n},retry(){e==null||e()},reset(){y(t,"saved"),e=null}}}const ws=vN(),EN=new Set(["title","created","published","updated"]);function TN(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 _N(t,e,n){if(t.type==="authors")return TN(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 AN(t){return t===""||Array.isArray(t)&&t.length===0}function z0(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 u of e){const o=n[u.name]??"";if(EN.has(u.name)){a[u.name]=u.name==="title"?o:o||void 0;continue}const f=_N(u,t.fields[u.name],o);AN(f)?delete s[u.name]:s[u.name]=f}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)}
65
+ `}function Kf(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 yN=0;var NN=W('<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>'),SN=W('<ul class="pills svelte-5hnbr8"></ul>'),IN=W('<li role="option"> </li>'),CN=W('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),wN=W('<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 LN(t,e){ct(e,!0);function n(J){if(J.trim()==="")return[];try{const ne=JSON.parse(J);return Array.isArray(ne)?ne.flatMap(ge=>{if(ge===null||typeof ge!="object")return[];const be=ge,pe=typeof be.name=="string"?be.name:"";return pe.trim()===""?[]:[{name:pe,...typeof be.user=="string"&&be.user!==""?{user:be.user}:{}}]}):[]}catch{return[]}}const r=Ae(()=>n(e.value)),s=`authors-${++yN}`;let a=ee(Tt([])),i=ee(""),u=ee(!1),o=ee(0),f=ee(void 0),h=ee(null),g=ee(null);kt(()=>{cy().then(J=>y(a,J,!0))});const d=Ae(()=>new Map(c(a).map(J=>[J.user,J.name]))),m=Ae(()=>new Set(c(r).map(J=>J.user).filter(J=>J!==void 0)));function b(J){return J.user!==void 0?c(d).get(J.user)??J.name:J.name}const _=Ae(()=>{const J=c(i).trim().toLowerCase();return J===""?[]:c(a).filter(ne=>!c(m).has(ne.user)&&ne.name.toLowerCase().includes(J)).slice(0,6)}),T=Ae(()=>c(u)&&c(i).trim()!==""),v=Ae(()=>c(_).length),O=Ae(()=>c(T)?c(o)<c(_).length?`${s}-opt-${c(o)}`:`${s}-guest`:void 0);function L(J){e.onchange(J.length===0?"":JSON.stringify(J))}function B(J){c(m).has(J.user)||(L([...c(r),{name:J.name,user:J.user}]),y(i,""))}function C(J){const ne=J.trim();ne!==""&&(L([...c(r),{name:ne}]),y(i,""))}function q(){const J=c(_)[c(o)];J!==void 0?B(J):C(c(i))}function x(){var J,ne;(ne=(J=c(f))==null?void 0:J.children[c(o)])==null||ne.scrollIntoView({block:"nearest"})}function j(J){if(!c(T)){J.key==="Enter"&&(J.preventDefault(),C(c(i)));return}const ne=c(_).length+1;J.key==="ArrowDown"?(J.preventDefault(),y(o,(c(o)+1)%ne),x()):J.key==="ArrowUp"?(J.preventDefault(),y(o,(c(o)-1+ne)%ne),x()):J.key==="Enter"?(J.preventDefault(),q()):J.key==="Escape"&&(J.preventDefault(),y(i,""))}function Z(J){L(c(r).filter((ne,ge)=>ge!==J))}function Y(J,ne){var ge;y(h,J,!0),(ge=ne.dataTransfer)==null||ge.setData("text/plain",String(J)),ne.dataTransfer&&(ne.dataTransfer.effectAllowed="move")}function E(J,ne){c(h)!==null&&(ne.preventDefault(),y(g,J,!0))}function k(J){c(h)!==null&&c(h)!==J&&L(Kf(c(r),c(h),J)),y(h,null),y(g,null)}function S(){y(h,null),y(g,null)}var U=wN(),F=I(U);{var M=J=>{var ne=SN();Ot(ne,21,()=>c(r),Iu,(ge,be,pe)=>{var Se=NN();let ie;var he=I(Se),Ce=I(he);zf(Ce,{size:14});var Ne=R(he,2),Ie=I(Ne),Le=R(Ne,2),Re=I(Le);dh(Re,{size:14,"aria-hidden":"true"}),ue(($e,We)=>{ie=it(Se,1,"pill svelte-5hnbr8",null,ie,{guest:c(be).user===void 0,dragging:c(h)===pe,over:c(g)===pe&&c(h)!==pe}),me(Ne,"title",c(be).user??"Guest"),fe(Ie,$e),me(Le,"aria-label",We)},[()=>b(c(be)),()=>`Remove ${b(c(be))}`]),Be("dragstart",Se,$e=>Y(pe,$e)),Be("dragover",Se,$e=>E(pe,$e)),Be("drop",Se,()=>k(pe)),Be("dragend",Se,S),ae("click",Le,()=>Z(pe)),H(ge,Se)}),H(J,ne)};de(F,J=>{c(r).length>0&&J(M)})}var Q=R(F,2),z=I(Q),$=R(z,2);{var X=J=>{var ne=CN(),ge=I(ne);Ot(ge,19,()=>c(_),ie=>ie.user,(ie,he,Ce)=>{var Ne=IN();let Ie;var Le=I(Ne);ue(()=>{me(Ne,"id",`${s}-opt-${c(Ce)}`),Ie=it(Ne,1,"option svelte-5hnbr8",null,Ie,{active:c(Ce)===c(o)}),me(Ne,"aria-selected",c(Ce)===c(o)),fe(Le,c(he).name)}),ae("click",Ne,()=>B(c(he))),Be("mouseenter",Ne,()=>y(o,c(Ce),!0)),H(ie,Ne)});var be=R(ge,2);let pe;var Se=I(be);dn(ne,ie=>y(f,ie),()=>c(f)),ue(ie=>{me(ne,"id",`${s}-listbox`),me(be,"id",`${s}-guest`),pe=it(be,1,"option guest-option svelte-5hnbr8",null,pe,{active:c(o)===c(v)}),me(be,"aria-selected",c(o)===c(v)),fe(Se,`Add “${ie??""}” as a guest`)},[()=>c(i).trim()]),ae("click",be,()=>C(c(i))),Be("mouseenter",be,()=>y(o,c(v),!0)),H(J,ne)};de($,J=>{c(T)&&J(X)})}ue(()=>{me(U,"aria-labelledby",e.labelledBy),me(z,"aria-expanded",c(T)),me(z,"aria-controls",`${s}-listbox`),me(z,"aria-activedescendant",c(O))}),ae("input",z,()=>y(o,0)),ae("keydown",z,j),Be("focus",z,()=>{y(u,!0),y(o,0)}),Be("blur",z,()=>setTimeout(()=>y(u,!1),120)),Et(z,()=>c(i),J=>y(i,J)),H(t,U),ft()}At(["click","input","keydown"]);var ON=W('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),xN=W('<p class="empty svelte-1nm0yno">No file selected.</p>'),RN=W('<li class="hint svelte-1nm0yno">Loading…</li>'),DN=W('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),kN=W('<li><button type="button"> </button></li>'),PN=W('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),MN=W('<p class="error svelte-1nm0yno" role="alert"> </p>'),BN=W('<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 FN(t,e){ct(e,!0);let n=ee(Tt([])),r=ee(!1),s=ee(!1),a=!1,i=ee(null);const u=Ae(()=>e.value.split("/").pop()??e.value);async function o(){y(s,!0);try{y(n,await Ly(e.itemDir),!0),a=!0}finally{y(s,!1)}}function f(){y(r,!c(r)),c(r)&&!a&&o()}function h(Z){var k;const Y=Z.currentTarget,E=(k=Y.files)==null?void 0:k[0];Y.value="",E&&g(E)}async function g(Z){y(i,null);try{e.onchange(await uh(e.itemDir,Z)),a=!1,c(r)&&await o()}catch(Y){y(i,Y instanceof Error?Y.message:String(Y),!0)}}var d=BN(),m=I(d);{var b=Z=>{var Y=ON(),E=I(Y),k=I(E),S=R(E,2);ue(U=>{me(E,"href",U),fe(k,c(u))},[()=>to(e.itemDir,e.value)]),ae("click",S,()=>e.onchange("")),H(Z,Y)},_=Z=>{var Y=xN();H(Z,Y)};de(m,Z=>{e.value?Z(b):Z(_,-1)})}var T=R(m,2),v=I(T),O=I(v),L=R(v,2),B=R(I(L)),C=R(T,2);{var q=Z=>{var Y=PN(),E=I(Y);{var k=F=>{var M=RN();H(F,M)},S=F=>{var M=DN();H(F,M)},U=F=>{var M=Ir(),Q=pt(M);Ot(Q,16,()=>c(n),z=>z,(z,$)=>{const X=Ae(()=>dg($));var J=kN(),ne=I(J);let ge;var be=I(ne);ue(()=>{ge=it(ne,1,"file svelte-1nm0yno",null,ge,{selected:e.value===c(X)}),me(ne,"aria-pressed",e.value===c(X)),fe(be,$)}),ae("click",ne,()=>e.onchange(c(X))),H(z,J)}),H(F,M)};de(E,F=>{c(s)?F(k):c(n).length===0?F(S,1):F(U,-1)})}H(Z,Y)};de(C,Z=>{c(r)&&Z(q)})}var x=R(C,2);{var j=Z=>{var Y=MN(),E=I(Y);ue(()=>fe(E,c(i))),H(Z,Y)};de(x,Z=>{c(i)&&Z(j)})}ue(()=>{me(d,"aria-labelledby",e.labelledBy),me(v,"aria-expanded",c(r)),fe(O,c(r)?"Hide files":"Choose from files")}),ae("click",v,f),ae("change",B,h),H(t,d),ft()}At(["click","change"]);var UN=W('<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>'),HN=W('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),qN=W('<p class="error svelte-s6anrr" role="alert"> </p>'),jN=W('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function $N(t,e){ct(e,!0);let n=ee(!1),r=ee(null);const s=Ae(()=>e.value===""?"":/^(\/|[a-z][a-z0-9+.-]*:)/i.test(e.value)?e.value:to(e.itemDir,e.value));function a(m){var T;const b=m.currentTarget,_=(T=b.files)==null?void 0:T[0];b.value="",_&&i(_)}async function i(m){y(r,null),y(n,!0);try{e.onchange(await uh(e.itemDir,m))}catch(b){y(r,b instanceof Error?b.message:String(b),!0)}finally{y(n,!1)}}var u=jN(),o=I(u);{var f=m=>{var b=UN(),_=I(b),T=R(_,2),v=I(T),O=I(v),L=R(v,2),B=I(L);let C;var q=I(B),x=R(q),j=R(B,2);ue(()=>{me(_,"src",c(s)),fe(O,e.value),C=it(B,1,"action svelte-s6anrr",null,C,{busy:c(n)}),fe(q,`${c(n)?"Uploading…":"Replace…"} `),x.disabled=c(n)}),ae("change",x,a),ae("click",j,()=>e.onchange("")),H(m,b)},h=m=>{var b=HN();let _;var T=I(b),v=R(T);ue(()=>{_=it(b,1,"action svelte-s6anrr",null,_,{busy:c(n)}),fe(T,`${c(n)?"Uploading…":"Upload image…"} `),v.disabled=c(n)}),ae("change",v,a),H(m,b)};de(o,m=>{e.value?m(f):m(h,-1)})}var g=R(o,2);{var d=m=>{var b=qN(),_=I(b);ue(()=>fe(_,c(r))),H(m,b)};de(g,m=>{c(r)&&m(d)})}ue(()=>me(u,"aria-labelledby",e.labelledBy)),H(t,u),ft()}At(["change","click"]);var YN=W("<option> </option>"),zN=W("<option>Top level</option>"),WN=W("<option> </option>"),GN=W('<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>'),KN=W('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),VN=W('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),XN=W(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
66
+ heading at the top of the form.</p>`),QN=W('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),ZN=W('<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 JN(t,e){ct(e,!0);const n=ur(e,"currentFolder",3,""),r=ur(e,"folders",19,()=>[]);let s,a=ee(Tt(e.templateName));const i="\0";let u=ee(i);const o=Ae(()=>r().filter(C=>C!==n())),f=Ae(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);ka(()=>s.showModal());function h(C){C.preventDefault(),c(a)!==e.templateName?e.onchangetemplate(c(a)):e.onclose()}var g=ZN(),d=I(g),m=R(I(d),2),b=R(I(m),2);Ot(b,20,()=>c(f),C=>C,(C,q)=>{var x=YN(),j=I(x),Z={};ue(()=>{fe(j,q),Z!==(Z=q)&&(x.value=(x.__value=q)??"")}),H(C,x)});var _=R(m,2);{var T=C=>{var q=GN(),x=R(I(q),2),j=I(x),Z=R(I(j),2),Y=I(Z);Y.value=Y.__value=i;var E=R(Y);{var k=F=>{var M=zN();M.value=M.__value="",H(F,M)};de(E,F=>{n()!==""&&F(k)})}var S=R(E);Ot(S,16,()=>c(o),F=>F,(F,M)=>{var Q=WN(),z=I(Q),$={};ue(()=>{fe(z,`${M??""}/`),$!==($=M)&&(Q.value=(Q.__value=M)??"")}),H(F,Q)});var U=R(j,2);ue(()=>U.disabled=c(u)===i),Ia(Z,()=>c(u),F=>y(u,F)),ae("click",U,()=>e.onmove(c(u))),H(C,q)};de(_,C=>{e.onmove&&C(T)})}var v=R(_,2);{var O=C=>{var q=QN(),x=R(I(q),2),j=I(x);{var Z=U=>{var F=KN();ae("click",F,function(...M){var Q;(Q=e.onrename)==null||Q.apply(this,M)}),H(U,F)};de(j,U=>{e.onrename&&U(Z)})}var Y=R(j,2);{var E=U=>{var F=VN();ae("click",F,function(...M){var Q;(Q=e.ondelete)==null||Q.apply(this,M)}),H(U,F)};de(Y,U=>{e.ondelete&&U(E)})}var k=R(x,2);{var S=U=>{var F=XN();H(U,F)};de(k,U=>{e.onrename&&U(S)})}H(C,q)};de(v,C=>{(e.onrename||e.ondelete)&&C(O)})}var L=R(v,2),B=I(L);dn(g,C=>s=C,()=>s),Be("close",g,function(...C){var q;(q=e.onclose)==null||q.apply(this,C)}),Be("cancel",g,function(...C){var q;(q=e.onclose)==null||q.apply(this,C)}),Be("submit",d,h),Ia(b,()=>c(a),C=>y(a,C)),ae("click",B,function(...C){var q;(q=e.onclose)==null||q.apply(this,C)}),H(t,g),ft()}At(["click"]);let Eu=ee(null);const e6={get pending(){return c(Eu)}};function kg(t=""){return new Promise(e=>{y(Eu,{current:t,resolve:e},!0)})}function Ga(t){c(Eu)!==null&&(c(Eu).resolve(t),y(Eu,null))}const mh="ref:";function xu(t){return t.startsWith(mh)}function Vf(t){return xu(t)?t.slice(mh.length):t}function t6(t){return`${mh}${t}`}var n6=W('<!> <span class="target svelte-147ryxk"> </span>',1),r6=W('<!> <span class="target svelte-147ryxk"> </span>',1),s6=W('<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),a6=W('<button type="button" class="action svelte-147ryxk">Set link…</button>'),i6=W('<div class="link-field svelte-147ryxk" role="group"><!></div>');function u6(t,e){ct(e,!0);async function n(){const u=await kg(e.value);u!==null&&e.onchange(u)}var r=i6(),s=I(r);{var a=u=>{var o=s6(),f=pt(o),h=I(f);{var g=T=>{var v=n6(),O=pt(v);cN(O,{size:14,"aria-hidden":"true"});var L=R(O,2),B=I(L);ue((C,q)=>{me(L,"title",C),fe(B,q)},[()=>`Page: ${Vf(e.value)}`,()=>Vf(e.value)]),H(T,v)},d=Ae(()=>xu(e.value)),m=T=>{var v=r6(),O=pt(v);fN(O,{size:14,"aria-hidden":"true"});var L=R(O,2),B=I(L);ue(()=>{me(L,"title",e.value),fe(B,e.value)}),H(T,v)};de(h,T=>{c(d)?T(g):T(m,-1)})}var b=R(f,2),_=R(b,2);ae("click",b,n),ae("click",_,()=>e.onchange("")),H(u,o)},i=u=>{var o=a6();ae("click",o,n),H(u,o)};de(s,u=>{e.value?u(a):u(i,-1)})}ue(()=>me(r,"aria-labelledby",e.labelledBy)),H(t,r),ft()}At(["click"]);var o6=W('<p class="note error svelte-1v8pkea"> </p>'),l6=W('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),c6=W('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),f6=W('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),d6=W('<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 h6(t,e){ct(e,!0);let n=ee(""),r=ee("loading"),s=ee(""),a=ee(0),i=ee(void 0),u={x:0,y:0};function o(){var x;try{const j=(x=c(i))==null?void 0:x.contentWindow;j&&(u={x:j.scrollX,y:j.scrollY})}catch{}}function f(){var x,j;try{(j=(x=c(i))==null?void 0:x.contentWindow)==null||j.scrollTo(u.x,u.y)}catch{}}let h;kt(()=>{const x=e.previewItem,j=e.path;if(clearTimeout(h),x===null){y(r,"loading");return}return h=setTimeout(()=>void g(j,x),350),()=>clearTimeout(h)});async function g(x,j){try{const Z=await Gy(x,j);if(Z===void 0){y(r,"empty");return}o(),y(n,Z,!0),y(r,"ready")}catch(Z){y(s,Z instanceof Error?Z.message:String(Z),!0),y(r,"error")}}var d=d6(),m=I(d),b=R(I(m),2),_=I(b),T=R(b,2),v=I(T);dh(v,{size:18,"aria-hidden":"true"});var O=R(m,2),L=I(O);{var B=x=>{var j=o6(),Z=I(j);ue(()=>fe(Z,`Couldn’t render preview: ${c(s)??""}`)),H(x,j)},C=x=>{var j=l6();H(x,j)},q=x=>{var j=f6(),Z=pt(j);dn(Z,k=>y(i,k),()=>c(i));var Y=R(Z,2);{var E=k=>{var S=c6();H(k,S)};de(Y,k=>{c(r)==="loading"&&k(E)})}ue(()=>me(Z,"srcdoc",c(n))),Be("load",Z,f),H(x,j)};de(L,x=>{c(r)==="error"?x(B):c(r)==="empty"?x(C,1):x(q,-1)})}ue(x=>fe(_,`${x??""}px`),[()=>Math.round(c(a))]),ae("click",T,function(...x){var j;(j=e.onclose)==null||j.apply(this,x)}),ZE(O,"clientWidth",x=>y(a,x)),H(t,d),ft()}At(["click"]);var Pg=typeof global=="object"&&global&&global.Object===Object&&global,p6=typeof self=="object"&&self&&self.Object===Object&&self,ns=Pg||p6||Function("return this")(),Gs=ns.Symbol,Mg=Object.prototype,m6=Mg.hasOwnProperty,g6=Mg.toString,eu=Gs?Gs.toStringTag:void 0;function b6(t){var e=m6.call(t,eu),n=t[eu];try{t[eu]=void 0;var r=!0}catch{}var s=g6.call(t);return r&&(e?t[eu]=n:delete t[eu]),s}var v6=Object.prototype,E6=v6.toString;function T6(t){return E6.call(t)}var _6="[object Null]",A6="[object Undefined]",W0=Gs?Gs.toStringTag:void 0;function qi(t){return t==null?t===void 0?A6:_6:W0&&W0 in Object(t)?b6(t):T6(t)}function gs(t){return t!=null&&typeof t=="object"}var wa=Array.isArray;function Qs(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Bg(t){return t}var y6="[object AsyncFunction]",N6="[object Function]",S6="[object GeneratorFunction]",I6="[object Proxy]";function gh(t){if(!Qs(t))return!1;var e=qi(t);return e==N6||e==S6||e==y6||e==I6}var xc=ns["__core-js_shared__"],G0=(function(){var t=/[^.]+$/.exec(xc&&xc.keys&&xc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function C6(t){return!!G0&&G0 in t}var w6=Function.prototype,L6=w6.toString;function Ba(t){if(t!=null){try{return L6.call(t)}catch{}try{return t+""}catch{}}return""}var O6=/[\\^$.*+?()[\]{}|]/g,x6=/^\[object .+?Constructor\]$/,R6=Function.prototype,D6=Object.prototype,k6=R6.toString,P6=D6.hasOwnProperty,M6=RegExp("^"+k6.call(P6).replace(O6,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function B6(t){if(!Qs(t)||C6(t))return!1;var e=gh(t)?M6:x6;return e.test(Ba(t))}function F6(t,e){return t==null?void 0:t[e]}function Fa(t,e){var n=F6(t,e);return B6(n)?n:void 0}var Xf=Fa(ns,"WeakMap"),K0=Object.create,U6=(function(){function t(){}return function(e){if(!Qs(e))return{};if(K0)return K0(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function H6(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 q6(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var j6=800,$6=16,Y6=Date.now;function z6(t){var e=0,n=0;return function(){var r=Y6(),s=$6-(r-n);if(n=r,s>0){if(++e>=j6)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function W6(t){return function(){return t}}var pl=(function(){try{var t=Fa(Object,"defineProperty");return t({},"",{}),t}catch{}})(),G6=pl?function(t,e){return pl(t,"toString",{configurable:!0,enumerable:!1,value:W6(e),writable:!0})}:Bg,K6=z6(G6);function V6(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var X6=9007199254740991,Q6=/^(?:0|[1-9]\d*)$/;function Fg(t,e){var n=typeof t;return e=e??X6,!!e&&(n=="number"||n!="symbol"&&Q6.test(t))&&t>-1&&t%1==0&&t<e}function bh(t,e,n){e=="__proto__"&&pl?pl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ro(t,e){return t===e||t!==t&&e!==e}var Z6=Object.prototype,J6=Z6.hasOwnProperty;function Ug(t,e,n){var r=t[e];(!(J6.call(t,e)&&ro(r,n))||n===void 0&&!(e in t))&&bh(t,e,n)}function eS(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var u=e[a],o=void 0;o===void 0&&(o=t[u]),s?bh(n,u,o):Ug(n,u,o)}return n}var V0=Math.max;function tS(t,e,n){return e=V0(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=V0(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var u=Array(e+1);++s<e;)u[s]=r[s];return u[e]=n(i),H6(t,this,u)}}function nS(t,e){return K6(tS(t,e,Bg),t+"")}var rS=9007199254740991;function Hg(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=rS}function Fl(t){return t!=null&&Hg(t.length)&&!gh(t)}function sS(t,e,n){if(!Qs(n))return!1;var r=typeof e;return(r=="number"?Fl(n)&&Fg(e,n.length):r=="string"&&e in n)?ro(n[e],t):!1}function aS(t){return nS(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&&sS(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var u=n[r];u&&t(e,u,r,a)}return e})}var iS=Object.prototype;function vh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||iS;return t===n}function uS(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var oS="[object Arguments]";function X0(t){return gs(t)&&qi(t)==oS}var qg=Object.prototype,lS=qg.hasOwnProperty,cS=qg.propertyIsEnumerable,Qf=X0((function(){return arguments})())?X0:function(t){return gs(t)&&lS.call(t,"callee")&&!cS.call(t,"callee")};function fS(){return!1}var jg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Q0=jg&&typeof module=="object"&&module&&!module.nodeType&&module,dS=Q0&&Q0.exports===jg,Z0=dS?ns.Buffer:void 0,hS=Z0?Z0.isBuffer:void 0,Ru=hS||fS,pS="[object Arguments]",mS="[object Array]",gS="[object Boolean]",bS="[object Date]",vS="[object Error]",ES="[object Function]",TS="[object Map]",_S="[object Number]",AS="[object Object]",yS="[object RegExp]",NS="[object Set]",SS="[object String]",IS="[object WeakMap]",CS="[object ArrayBuffer]",wS="[object DataView]",LS="[object Float32Array]",OS="[object Float64Array]",xS="[object Int8Array]",RS="[object Int16Array]",DS="[object Int32Array]",kS="[object Uint8Array]",PS="[object Uint8ClampedArray]",MS="[object Uint16Array]",BS="[object Uint32Array]",It={};It[LS]=It[OS]=It[xS]=It[RS]=It[DS]=It[kS]=It[PS]=It[MS]=It[BS]=!0;It[pS]=It[mS]=It[CS]=It[gS]=It[wS]=It[bS]=It[vS]=It[ES]=It[TS]=It[_S]=It[AS]=It[yS]=It[NS]=It[SS]=It[IS]=!1;function FS(t){return gs(t)&&Hg(t.length)&&!!It[qi(t)]}function Eh(t){return function(e){return t(e)}}var $g=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tu=$g&&typeof module=="object"&&module&&!module.nodeType&&module,US=Tu&&Tu.exports===$g,Rc=US&&Pg.process,Ri=(function(){try{var t=Tu&&Tu.require&&Tu.require("util").types;return t||Rc&&Rc.binding&&Rc.binding("util")}catch{}})(),J0=Ri&&Ri.isTypedArray,Th=J0?Eh(J0):FS,HS=Object.prototype,qS=HS.hasOwnProperty;function Yg(t,e){var n=wa(t),r=!n&&Qf(t),s=!n&&!r&&Ru(t),a=!n&&!r&&!s&&Th(t),i=n||r||s||a,u=i?uS(t.length,String):[],o=u.length;for(var f in t)(e||qS.call(t,f))&&!(i&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Fg(f,o)))&&u.push(f);return u}function zg(t,e){return function(n){return t(e(n))}}var jS=zg(Object.keys,Object),$S=Object.prototype,YS=$S.hasOwnProperty;function zS(t){if(!vh(t))return jS(t);var e=[];for(var n in Object(t))YS.call(t,n)&&n!="constructor"&&e.push(n);return e}function WS(t){return Fl(t)?Yg(t):zS(t)}function GS(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var KS=Object.prototype,VS=KS.hasOwnProperty;function XS(t){if(!Qs(t))return GS(t);var e=vh(t),n=[];for(var r in t)r=="constructor"&&(e||!VS.call(t,r))||n.push(r);return n}function Wg(t){return Fl(t)?Yg(t,!0):XS(t)}var Du=Fa(Object,"create");function QS(){this.__data__=Du?Du(null):{},this.size=0}function ZS(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var JS="__lodash_hash_undefined__",eI=Object.prototype,tI=eI.hasOwnProperty;function nI(t){var e=this.__data__;if(Du){var n=e[t];return n===JS?void 0:n}return tI.call(e,t)?e[t]:void 0}var rI=Object.prototype,sI=rI.hasOwnProperty;function aI(t){var e=this.__data__;return Du?e[t]!==void 0:sI.call(e,t)}var iI="__lodash_hash_undefined__";function uI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Du&&e===void 0?iI:e,this}function La(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])}}La.prototype.clear=QS;La.prototype.delete=ZS;La.prototype.get=nI;La.prototype.has=aI;La.prototype.set=uI;function oI(){this.__data__=[],this.size=0}function Ul(t,e){for(var n=t.length;n--;)if(ro(t[n][0],e))return n;return-1}var lI=Array.prototype,cI=lI.splice;function fI(t){var e=this.__data__,n=Ul(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():cI.call(e,n,1),--this.size,!0}function dI(t){var e=this.__data__,n=Ul(e,t);return n<0?void 0:e[n][1]}function hI(t){return Ul(this.__data__,t)>-1}function pI(t,e){var n=this.__data__,r=Ul(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Es(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])}}Es.prototype.clear=oI;Es.prototype.delete=fI;Es.prototype.get=dI;Es.prototype.has=hI;Es.prototype.set=pI;var ku=Fa(ns,"Map");function mI(){this.size=0,this.__data__={hash:new La,map:new(ku||Es),string:new La}}function gI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Hl(t,e){var n=t.__data__;return gI(e)?n[typeof e=="string"?"string":"hash"]:n.map}function bI(t){var e=Hl(this,t).delete(t);return this.size-=e?1:0,e}function vI(t){return Hl(this,t).get(t)}function EI(t){return Hl(this,t).has(t)}function TI(t,e){var n=Hl(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Ua(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])}}Ua.prototype.clear=mI;Ua.prototype.delete=bI;Ua.prototype.get=vI;Ua.prototype.has=EI;Ua.prototype.set=TI;function _I(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var Gg=zg(Object.getPrototypeOf,Object),AI="[object Object]",yI=Function.prototype,NI=Object.prototype,Kg=yI.toString,SI=NI.hasOwnProperty,II=Kg.call(Object);function CI(t){if(!gs(t)||qi(t)!=AI)return!1;var e=Gg(t);if(e===null)return!0;var n=SI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Kg.call(n)==II}function wI(){this.__data__=new Es,this.size=0}function LI(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function OI(t){return this.__data__.get(t)}function xI(t){return this.__data__.has(t)}var RI=200;function DI(t,e){var n=this.__data__;if(n instanceof Es){var r=n.__data__;if(!ku||r.length<RI-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ua(r)}return n.set(t,e),this.size=n.size,this}function Vr(t){var e=this.__data__=new Es(t);this.size=e.size}Vr.prototype.clear=wI;Vr.prototype.delete=LI;Vr.prototype.get=OI;Vr.prototype.has=xI;Vr.prototype.set=DI;var Vg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,e1=Vg&&typeof module=="object"&&module&&!module.nodeType&&module,kI=e1&&e1.exports===Vg,t1=kI?ns.Buffer:void 0,n1=t1?t1.allocUnsafe:void 0;function Xg(t,e){if(e)return t.slice();var n=t.length,r=n1?n1(n):new t.constructor(n);return t.copy(r),r}function PI(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 MI(){return[]}var BI=Object.prototype,FI=BI.propertyIsEnumerable,r1=Object.getOwnPropertySymbols,UI=r1?function(t){return t==null?[]:(t=Object(t),PI(r1(t),function(e){return FI.call(t,e)}))}:MI;function HI(t,e,n){var r=e(t);return wa(t)?r:_I(r,n(t))}function Zf(t){return HI(t,WS,UI)}var Jf=Fa(ns,"DataView"),ed=Fa(ns,"Promise"),td=Fa(ns,"Set"),s1="[object Map]",qI="[object Object]",a1="[object Promise]",i1="[object Set]",u1="[object WeakMap]",o1="[object DataView]",jI=Ba(Jf),$I=Ba(ku),YI=Ba(ed),zI=Ba(td),WI=Ba(Xf),Ar=qi;(Jf&&Ar(new Jf(new ArrayBuffer(1)))!=o1||ku&&Ar(new ku)!=s1||ed&&Ar(ed.resolve())!=a1||td&&Ar(new td)!=i1||Xf&&Ar(new Xf)!=u1)&&(Ar=function(t){var e=qi(t),n=e==qI?t.constructor:void 0,r=n?Ba(n):"";if(r)switch(r){case jI:return o1;case $I:return s1;case YI:return a1;case zI:return i1;case WI:return u1}return e});var GI=Object.prototype,KI=GI.hasOwnProperty;function VI(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&KI.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var ml=ns.Uint8Array;function _h(t){var e=new t.constructor(t.byteLength);return new ml(e).set(new ml(t)),e}function XI(t,e){var n=_h(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var QI=/\w*$/;function ZI(t){var e=new t.constructor(t.source,QI.exec(t));return e.lastIndex=t.lastIndex,e}var l1=Gs?Gs.prototype:void 0,c1=l1?l1.valueOf:void 0;function JI(t){return c1?Object(c1.call(t)):{}}function Qg(t,e){var n=e?_h(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var eC="[object Boolean]",tC="[object Date]",nC="[object Map]",rC="[object Number]",sC="[object RegExp]",aC="[object Set]",iC="[object String]",uC="[object Symbol]",oC="[object ArrayBuffer]",lC="[object DataView]",cC="[object Float32Array]",fC="[object Float64Array]",dC="[object Int8Array]",hC="[object Int16Array]",pC="[object Int32Array]",mC="[object Uint8Array]",gC="[object Uint8ClampedArray]",bC="[object Uint16Array]",vC="[object Uint32Array]";function EC(t,e,n){var r=t.constructor;switch(e){case oC:return _h(t);case eC:case tC:return new r(+t);case lC:return XI(t);case cC:case fC:case dC:case hC:case pC:case mC:case gC:case bC:case vC:return Qg(t,n);case nC:return new r;case rC:case iC:return new r(t);case sC:return ZI(t);case aC:return new r;case uC:return JI(t)}}function Zg(t){return typeof t.constructor=="function"&&!vh(t)?U6(Gg(t)):{}}var TC="[object Map]";function _C(t){return gs(t)&&Ar(t)==TC}var f1=Ri&&Ri.isMap,AC=f1?Eh(f1):_C,yC="[object Set]";function NC(t){return gs(t)&&Ar(t)==yC}var d1=Ri&&Ri.isSet,SC=d1?Eh(d1):NC,IC=1,Jg="[object Arguments]",CC="[object Array]",wC="[object Boolean]",LC="[object Date]",OC="[object Error]",eb="[object Function]",xC="[object GeneratorFunction]",RC="[object Map]",DC="[object Number]",tb="[object Object]",kC="[object RegExp]",PC="[object Set]",MC="[object String]",BC="[object Symbol]",FC="[object WeakMap]",UC="[object ArrayBuffer]",HC="[object DataView]",qC="[object Float32Array]",jC="[object Float64Array]",$C="[object Int8Array]",YC="[object Int16Array]",zC="[object Int32Array]",WC="[object Uint8Array]",GC="[object Uint8ClampedArray]",KC="[object Uint16Array]",VC="[object Uint32Array]",Nt={};Nt[Jg]=Nt[CC]=Nt[UC]=Nt[HC]=Nt[wC]=Nt[LC]=Nt[qC]=Nt[jC]=Nt[$C]=Nt[YC]=Nt[zC]=Nt[RC]=Nt[DC]=Nt[tb]=Nt[kC]=Nt[PC]=Nt[MC]=Nt[BC]=Nt[WC]=Nt[GC]=Nt[KC]=Nt[VC]=!0;Nt[OC]=Nt[eb]=Nt[FC]=!1;function Ko(t,e,n,r,s,a){var i,u=e&IC;if(i!==void 0)return i;if(!Qs(t))return t;var o=wa(t);if(o)i=VI(t);else{var f=Ar(t),h=f==eb||f==xC;if(Ru(t))return Xg(t,u);if(f==tb||f==Jg||h&&!s)i=h?{}:Zg(t);else{if(!Nt[f])return s?t:{};i=EC(t,f,u)}}a||(a=new Vr);var g=a.get(t);if(g)return g;a.set(t,i),SC(t)?t.forEach(function(b){i.add(Ko(b,e,n,b,t,a))}):AC(t)&&t.forEach(function(b,_){i.set(_,Ko(b,e,n,_,t,a))});var d=Zf,m=o?void 0:d(t);return V6(m||t,function(b,_){m&&(_=b,b=t[_]),Ug(i,_,Ko(b,e,n,_,t,a))}),i}var XC=1,QC=4;function oi(t){return Ko(t,XC|QC)}var ZC="__lodash_hash_undefined__";function JC(t){return this.__data__.set(t,ZC),this}function ew(t){return this.__data__.has(t)}function gl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Ua;++e<n;)this.add(t[e])}gl.prototype.add=gl.prototype.push=JC;gl.prototype.has=ew;function tw(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 nw(t,e){return t.has(e)}var rw=1,sw=2;function nb(t,e,n,r,s,a){var i=n&rw,u=t.length,o=e.length;if(u!=o&&!(i&&o>u))return!1;var f=a.get(t),h=a.get(e);if(f&&h)return f==e&&h==t;var g=-1,d=!0,m=n&sw?new gl:void 0;for(a.set(t,e),a.set(e,t);++g<u;){var b=t[g],_=e[g];if(r)var T=i?r(_,b,g,e,t,a):r(b,_,g,t,e,a);if(T!==void 0){if(T)continue;d=!1;break}if(m){if(!tw(e,function(v,O){if(!nw(m,O)&&(b===v||s(b,v,n,r,a)))return m.push(O)})){d=!1;break}}else if(!(b===_||s(b,_,n,r,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function aw(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function iw(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var uw=1,ow=2,lw="[object Boolean]",cw="[object Date]",fw="[object Error]",dw="[object Map]",hw="[object Number]",pw="[object RegExp]",mw="[object Set]",gw="[object String]",bw="[object Symbol]",vw="[object ArrayBuffer]",Ew="[object DataView]",h1=Gs?Gs.prototype:void 0,Dc=h1?h1.valueOf:void 0;function Tw(t,e,n,r,s,a,i){switch(n){case Ew:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case vw:return!(t.byteLength!=e.byteLength||!a(new ml(t),new ml(e)));case lw:case cw:case hw:return ro(+t,+e);case fw:return t.name==e.name&&t.message==e.message;case pw:case gw:return t==e+"";case dw:var u=aw;case mw:var o=r&uw;if(u||(u=iw),t.size!=e.size&&!o)return!1;var f=i.get(t);if(f)return f==e;r|=ow,i.set(t,e);var h=nb(u(t),u(e),r,s,a,i);return i.delete(t),h;case bw:if(Dc)return Dc.call(t)==Dc.call(e)}return!1}var _w=1,Aw=Object.prototype,yw=Aw.hasOwnProperty;function Nw(t,e,n,r,s,a){var i=n&_w,u=Zf(t),o=u.length,f=Zf(e),h=f.length;if(o!=h&&!i)return!1;for(var g=o;g--;){var d=u[g];if(!(i?d in e:yw.call(e,d)))return!1}var m=a.get(t),b=a.get(e);if(m&&b)return m==e&&b==t;var _=!0;a.set(t,e),a.set(e,t);for(var T=i;++g<o;){d=u[g];var v=t[d],O=e[d];if(r)var L=i?r(O,v,d,e,t,a):r(v,O,d,t,e,a);if(!(L===void 0?v===O||s(v,O,n,r,a):L)){_=!1;break}T||(T=d=="constructor")}if(_&&!T){var B=t.constructor,C=e.constructor;B!=C&&"constructor"in t&&"constructor"in e&&!(typeof B=="function"&&B instanceof B&&typeof C=="function"&&C instanceof C)&&(_=!1)}return a.delete(t),a.delete(e),_}var Sw=1,p1="[object Arguments]",m1="[object Array]",wo="[object Object]",Iw=Object.prototype,g1=Iw.hasOwnProperty;function Cw(t,e,n,r,s,a){var i=wa(t),u=wa(e),o=i?m1:Ar(t),f=u?m1:Ar(e);o=o==p1?wo:o,f=f==p1?wo:f;var h=o==wo,g=f==wo,d=o==f;if(d&&Ru(t)){if(!Ru(e))return!1;i=!0,h=!1}if(d&&!h)return a||(a=new Vr),i||Th(t)?nb(t,e,n,r,s,a):Tw(t,e,o,n,r,s,a);if(!(n&Sw)){var m=h&&g1.call(t,"__wrapped__"),b=g&&g1.call(e,"__wrapped__");if(m||b){var _=m?t.value():t,T=b?e.value():e;return a||(a=new Vr),s(_,T,n,r,a)}}return d?(a||(a=new Vr),Nw(t,e,n,r,s,a)):!1}function rb(t,e,n,r,s){return t===e?!0:t==null||e==null||!gs(t)&&!gs(e)?t!==t&&e!==e:Cw(t,e,n,r,rb,s)}function ww(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),u=i.length;u--;){var o=i[++s];if(n(a[o],o,a)===!1)break}return e}}var Lw=ww();function nd(t,e,n){(n!==void 0&&!ro(t[e],n)||n===void 0&&!(e in t))&&bh(t,e,n)}function Ow(t){return gs(t)&&Fl(t)}function rd(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function xw(t){return eS(t,Wg(t))}function Rw(t,e,n,r,s,a,i){var u=rd(t,n),o=rd(e,n),f=i.get(o);if(f){nd(t,n,f);return}var h=a?a(u,o,n+"",t,e,i):void 0,g=h===void 0;if(g){var d=wa(o),m=!d&&Ru(o),b=!d&&!m&&Th(o);h=o,d||m||b?wa(u)?h=u:Ow(u)?h=q6(u):m?(g=!1,h=Xg(o,!0)):b?(g=!1,h=Qg(o,!0)):h=[]:CI(o)||Qf(o)?(h=u,Qf(u)?h=xw(u):(!Qs(u)||gh(u))&&(h=Zg(o))):g=!1}g&&(i.set(o,h),s(h,o,r,a,i),i.delete(o)),nd(t,n,h)}function sb(t,e,n,r,s){t!==e&&Lw(e,function(a,i){if(s||(s=new Vr),Qs(a))Rw(t,e,i,n,sb,r,s);else{var u=r?r(rd(t,i),a,i+"",t,e,s):void 0;u===void 0&&(u=a),nd(t,i,u)}},Wg)}function Ah(t,e){return rb(t,e)}var $s=aS(function(t,e,n){sb(t,e,n)}),xe=(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))(xe||{});class es{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=xe.TYPE&xe.ATTRIBUTE;this.scope=r.scope!=null?r.scope&xe.LEVEL|s:xe.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 li extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const ab=class sd{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 li(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),u=new a(e,i,r);return sd.blots.set(u.domNode,u),u}find(e,n=!1){return sd.find(e,n)}query(e,n=xe.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&xe.LEVEL&xe.BLOCK?r=this.types.block:e&xe.LEVEL&xe.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&xe.LEVEL&r.scope&&n&xe.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 li("Invalid definition");if(r&&n.blotName==="abstract")throw new li("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})}};ab.blots=new WeakMap;let Di=ab;function b1(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class Dw extends es{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){b1(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(b1(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Pr=Dw;function kc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class kw extends es{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[kc(this.keyName)]=n,!0):!1}remove(e){e.style[kc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[kc(this.keyName)];return this.canAdd(e,n)?n:""}}const Zs=kw;class Pw{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=Di.find(this.domNode);if(e==null)return;const n=es.keys(this.domNode),r=Pr.keys(this.domNode),s=Zs.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,xe.ATTRIBUTE);i instanceof es&&(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 ql=Pw,ib=class{constructor(e,n){this.scroll=e,this.domNode=n,Di.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new li("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),Di.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,xe.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,xe.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 li(`Cannot wrap ${e}`);return r.appendChild(this),r}};ib.blotName="abstract";let ub=ib;const ob=class extends ub{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}}};ob.scope=xe.INLINE_BLOT;let Mw=ob;const _n=Mw;class Bw{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 u=this.iterator(s);let o=u();for(;o&&i<e+n;){const f=o.length();e>i?r(o,e-i,Math.min(n,i+f-e)):r(o,0,Math.min(f,e+n-i)),i+=f,o=u()}}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 v1(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(xe.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const lb=class Is extends ub{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,Is.uiClass&&this.uiNode.classList.add(Is.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Bw,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=v1(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof li)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 Is?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,u,o)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Is&&(s=s.concat(i.descendants(e,u,a))),a-=o}),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===xe.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Is?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,u)=>{a.formatAt(i,u,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 Is?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 Is&&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 u=s.split(a,n);u!=null&&r.appendChild(u)}),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 u=v1(a,this.scroll);(u.next!==i||u.next==null)&&(u.parent!=null&&u.parent.removeChild(this),this.insertBefore(u,i||void 0))}),this.enforceAllowedChildren()}};lb.uiClass="";let Fw=lb;const wr=Fw;function Uw(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 Xa=class Qa extends wr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Qa.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 ql(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof Qa||(r=r.wrap(Qa.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,xe.INLINE);if(r==null)return;r instanceof es?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,xe.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 Qa&&r.prev===this&&Uw(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 Qa&&this.attributes.move(r),r}};Xa.allowedChildren=[Xa,_n],Xa.blotName="inline",Xa.scope=xe.INLINE_BLOT,Xa.tagName="SPAN";let Hw=Xa;const yh=Hw,Za=class ad extends wr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(ad.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 ql(this.domNode)}format(e,n){const r=this.scroll.query(e,xe.BLOCK);r!=null&&(r instanceof es?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(ad.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,xe.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,xe.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()}};Za.blotName="block",Za.scope=xe.BLOCK_BLOT,Za.tagName="P",Za.allowedChildren=[yh,Za,_n];let qw=Za;const Pu=qw,id=class extends wr{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())}};id.blotName="container",id.scope=xe.BLOCK_BLOT;let jw=id;const jl=jw;class $w extends _n{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 Kn=$w,Yw={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},zw=100,Ja=class extends wr{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,Yw),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=xe.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=(o,f=!0)=>{o==null||o===this||o.domNode.parentNode!=null&&(r.has(o.domNode)||r.set(o.domNode,[]),f&&a(o.parent))},i=o=>{r.has(o.domNode)&&(o instanceof wr&&o.children.forEach(i),r.delete(o.domNode),o.optimize(n))};let u=e;for(let o=0;u.length>0;o+=1){if(o>=zw)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(f=>{const h=this.find(f.target,!0);h!=null&&(h.domNode===f.target&&(f.type==="childList"?(a(this.find(f.previousSibling,!1)),Array.from(f.addedNodes).forEach(g=>{const d=this.find(g,!1);a(d,!1),d instanceof wr&&d.children.forEach(m=>{a(m,!1)})})):f.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),u=Array.from(this.observer.takeRecords()),s=u.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)}};Ja.blotName="scroll",Ja.defaultChild=Pu,Ja.allowedChildren=[Pu,jl],Ja.scope=xe.BLOCK_BLOT,Ja.tagName="DIV";let Ww=Ja;const Nh=Ww,ud=class cb extends _n{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 cb&&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}};ud.blotName="text",ud.scope=xe.INLINE_BLOT;let Gw=ud;const bl=Gw,Kw=Object.freeze(Object.defineProperty({__proto__:null,Attributor:es,AttributorStore:ql,BlockBlot:Pu,ClassAttributor:Pr,ContainerBlot:jl,EmbedBlot:Kn,InlineBlot:yh,LeafBlot:_n,ParentBlot:wr,Registry:Di,Scope:xe,ScrollBlot:Nh,StyleAttributor:Zs,TextBlot:bl},Symbol.toStringTag,{value:"Module"}));var Ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lo={exports:{}},Pc,E1;function Vw(){if(E1)return Pc;E1=1;var t=-1,e=1,n=0;function r(E,k,S,U,F){if(E===k)return E?[[n,E]]:[];if(S!=null){var M=Z(E,k,S);if(M)return M}var Q=u(E,k),z=E.substring(0,Q);E=E.substring(Q),k=k.substring(Q),Q=f(E,k);var $=E.substring(E.length-Q);E=E.substring(0,E.length-Q),k=k.substring(0,k.length-Q);var X=s(E,k);return z&&X.unshift([n,z]),$&&X.push([n,$]),O(X,F),U&&g(X),X}function s(E,k){var S;if(!E)return[[e,k]];if(!k)return[[t,E]];var U=E.length>k.length?E:k,F=E.length>k.length?k:E,M=U.indexOf(F);if(M!==-1)return S=[[e,U.substring(0,M)],[n,F],[e,U.substring(M+F.length)]],E.length>k.length&&(S[0][0]=S[2][0]=t),S;if(F.length===1)return[[t,E],[e,k]];var Q=h(E,k);if(Q){var z=Q[0],$=Q[1],X=Q[2],J=Q[3],ne=Q[4],ge=r(z,X),be=r($,J);return ge.concat([[n,ne]],be)}return a(E,k)}function a(E,k){for(var S=E.length,U=k.length,F=Math.ceil((S+U)/2),M=F,Q=2*F,z=new Array(Q),$=new Array(Q),X=0;X<Q;X++)z[X]=-1,$[X]=-1;z[M+1]=0,$[M+1]=0;for(var J=S-U,ne=J%2!==0,ge=0,be=0,pe=0,Se=0,ie=0;ie<F;ie++){for(var he=-ie+ge;he<=ie-be;he+=2){var Ce=M+he,Ne;he===-ie||he!==ie&&z[Ce-1]<z[Ce+1]?Ne=z[Ce+1]:Ne=z[Ce-1]+1;for(var Ie=Ne-he;Ne<S&&Ie<U&&E.charAt(Ne)===k.charAt(Ie);)Ne++,Ie++;if(z[Ce]=Ne,Ne>S)be+=2;else if(Ie>U)ge+=2;else if(ne){var Le=M+J-he;if(Le>=0&&Le<Q&&$[Le]!==-1){var Re=S-$[Le];if(Ne>=Re)return i(E,k,Ne,Ie)}}}for(var $e=-ie+pe;$e<=ie-Se;$e+=2){var Le=M+$e,Re;$e===-ie||$e!==ie&&$[Le-1]<$[Le+1]?Re=$[Le+1]:Re=$[Le-1]+1;for(var We=Re-$e;Re<S&&We<U&&E.charAt(S-Re-1)===k.charAt(U-We-1);)Re++,We++;if($[Le]=Re,Re>S)Se+=2;else if(We>U)pe+=2;else if(!ne){var Ce=M+J-$e;if(Ce>=0&&Ce<Q&&z[Ce]!==-1){var Ne=z[Ce],Ie=M+Ne-Ce;if(Re=S-Re,Ne>=Re)return i(E,k,Ne,Ie)}}}}return[[t,E],[e,k]]}function i(E,k,S,U){var F=E.substring(0,S),M=k.substring(0,U),Q=E.substring(S),z=k.substring(U),$=r(F,M),X=r(Q,z);return $.concat(X)}function u(E,k){if(!E||!k||E.charAt(0)!==k.charAt(0))return 0;for(var S=0,U=Math.min(E.length,k.length),F=U,M=0;S<F;)E.substring(M,F)==k.substring(M,F)?(S=F,M=S):U=F,F=Math.floor((U-S)/2+S);return L(E.charCodeAt(F-1))&&F--,F}function o(E,k){var S=E.length,U=k.length;if(S==0||U==0)return 0;S>U?E=E.substring(S-U):S<U&&(k=k.substring(0,S));var F=Math.min(S,U);if(E==k)return F;for(var M=0,Q=1;;){var z=E.substring(F-Q),$=k.indexOf(z);if($==-1)return M;Q+=$,($==0||E.substring(F-Q)==k.substring(0,Q))&&(M=Q,Q++)}}function f(E,k){if(!E||!k||E.slice(-1)!==k.slice(-1))return 0;for(var S=0,U=Math.min(E.length,k.length),F=U,M=0;S<F;)E.substring(E.length-F,E.length-M)==k.substring(k.length-F,k.length-M)?(S=F,M=S):U=F,F=Math.floor((U-S)/2+S);return B(E.charCodeAt(E.length-F))&&F--,F}function h(E,k){var S=E.length>k.length?E:k,U=E.length>k.length?k:E;if(S.length<4||U.length*2<S.length)return null;function F(be,pe,Se){for(var ie=be.substring(Se,Se+Math.floor(be.length/4)),he=-1,Ce="",Ne,Ie,Le,Re;(he=pe.indexOf(ie,he+1))!==-1;){var $e=u(be.substring(Se),pe.substring(he)),We=f(be.substring(0,Se),pe.substring(0,he));Ce.length<We+$e&&(Ce=pe.substring(he-We,he)+pe.substring(he,he+$e),Ne=be.substring(0,Se-We),Ie=be.substring(Se+$e),Le=pe.substring(0,he-We),Re=pe.substring(he+$e))}return Ce.length*2>=be.length?[Ne,Ie,Le,Re,Ce]:null}var M=F(S,U,Math.ceil(S.length/4)),Q=F(S,U,Math.ceil(S.length/2)),z;if(!M&&!Q)return null;Q?M?z=M[4].length>Q[4].length?M:Q:z=Q:z=M;var $,X,J,ne;E.length>k.length?($=z[0],X=z[1],J=z[2],ne=z[3]):(J=z[0],ne=z[1],$=z[2],X=z[3]);var ge=z[4];return[$,X,J,ne,ge]}function g(E){for(var k=!1,S=[],U=0,F=null,M=0,Q=0,z=0,$=0,X=0;M<E.length;)E[M][0]==n?(S[U++]=M,Q=$,z=X,$=0,X=0,F=E[M][1]):(E[M][0]==e?$+=E[M][1].length:X+=E[M][1].length,F&&F.length<=Math.max(Q,z)&&F.length<=Math.max($,X)&&(E.splice(S[U-1],0,[t,F]),E[S[U-1]+1][0]=e,U--,U--,M=U>0?S[U-1]:-1,Q=0,z=0,$=0,X=0,F=null,k=!0)),M++;for(k&&O(E),v(E),M=1;M<E.length;){if(E[M-1][0]==t&&E[M][0]==e){var J=E[M-1][1],ne=E[M][1],ge=o(J,ne),be=o(ne,J);ge>=be?(ge>=J.length/2||ge>=ne.length/2)&&(E.splice(M,0,[n,ne.substring(0,ge)]),E[M-1][1]=J.substring(0,J.length-ge),E[M+1][1]=ne.substring(ge),M++):(be>=J.length/2||be>=ne.length/2)&&(E.splice(M,0,[n,J.substring(0,be)]),E[M-1][0]=e,E[M-1][1]=ne.substring(0,ne.length-be),E[M+1][0]=t,E[M+1][1]=J.substring(be),M++),M++}M++}}var d=/[^a-zA-Z0-9]/,m=/\s/,b=/[\r\n]/,_=/\n\r?\n$/,T=/^\r?\n\r?\n/;function v(E){function k(be,pe){if(!be||!pe)return 6;var Se=be.charAt(be.length-1),ie=pe.charAt(0),he=Se.match(d),Ce=ie.match(d),Ne=he&&Se.match(m),Ie=Ce&&ie.match(m),Le=Ne&&Se.match(b),Re=Ie&&ie.match(b),$e=Le&&be.match(_),We=Re&&pe.match(T);return $e||We?5:Le||Re?4:he&&!Ne&&Ie?3:Ne||Ie?2:he||Ce?1:0}for(var S=1;S<E.length-1;){if(E[S-1][0]==n&&E[S+1][0]==n){var U=E[S-1][1],F=E[S][1],M=E[S+1][1],Q=f(U,F);if(Q){var z=F.substring(F.length-Q);U=U.substring(0,U.length-Q),F=z+F.substring(0,F.length-Q),M=z+M}for(var $=U,X=F,J=M,ne=k(U,F)+k(F,M);F.charAt(0)===M.charAt(0);){U+=F.charAt(0),F=F.substring(1)+M.charAt(0),M=M.substring(1);var ge=k(U,F)+k(F,M);ge>=ne&&(ne=ge,$=U,X=F,J=M)}E[S-1][1]!=$&&($?E[S-1][1]=$:(E.splice(S-1,1),S--),E[S][1]=X,J?E[S+1][1]=J:(E.splice(S+1,1),S--))}S++}}function O(E,k){E.push([n,""]);for(var S=0,U=0,F=0,M="",Q="",z;S<E.length;){if(S<E.length-1&&!E[S][1]){E.splice(S,1);continue}switch(E[S][0]){case e:F++,Q+=E[S][1],S++;break;case t:U++,M+=E[S][1],S++;break;case n:var $=S-F-U-1;if(k){if($>=0&&q(E[$][1])){var X=E[$][1].slice(-1);if(E[$][1]=E[$][1].slice(0,-1),M=X+M,Q=X+Q,!E[$][1]){E.splice($,1),S--;var J=$-1;E[J]&&E[J][0]===e&&(F++,Q=E[J][1]+Q,J--),E[J]&&E[J][0]===t&&(U++,M=E[J][1]+M,J--),$=J}}if(C(E[S][1])){var X=E[S][1].charAt(0);E[S][1]=E[S][1].slice(1),M+=X,Q+=X}}if(S<E.length-1&&!E[S][1]){E.splice(S,1);break}if(M.length>0||Q.length>0){M.length>0&&Q.length>0&&(z=u(Q,M),z!==0&&($>=0?E[$][1]+=Q.substring(0,z):(E.splice(0,0,[n,Q.substring(0,z)]),S++),Q=Q.substring(z),M=M.substring(z)),z=f(Q,M),z!==0&&(E[S][1]=Q.substring(Q.length-z)+E[S][1],Q=Q.substring(0,Q.length-z),M=M.substring(0,M.length-z)));var ne=F+U;M.length===0&&Q.length===0?(E.splice(S-ne,ne),S=S-ne):M.length===0?(E.splice(S-ne,ne,[e,Q]),S=S-ne+1):Q.length===0?(E.splice(S-ne,ne,[t,M]),S=S-ne+1):(E.splice(S-ne,ne,[t,M],[e,Q]),S=S-ne+2)}S!==0&&E[S-1][0]===n?(E[S-1][1]+=E[S][1],E.splice(S,1)):S++,F=0,U=0,M="",Q="";break}}E[E.length-1][1]===""&&E.pop();var ge=!1;for(S=1;S<E.length-1;)E[S-1][0]===n&&E[S+1][0]===n&&(E[S][1].substring(E[S][1].length-E[S-1][1].length)===E[S-1][1]?(E[S][1]=E[S-1][1]+E[S][1].substring(0,E[S][1].length-E[S-1][1].length),E[S+1][1]=E[S-1][1]+E[S+1][1],E.splice(S-1,1),ge=!0):E[S][1].substring(0,E[S+1][1].length)==E[S+1][1]&&(E[S-1][1]+=E[S+1][1],E[S][1]=E[S][1].substring(E[S+1][1].length)+E[S+1][1],E.splice(S+1,1),ge=!0)),S++;ge&&O(E,k)}function L(E){return E>=55296&&E<=56319}function B(E){return E>=56320&&E<=57343}function C(E){return B(E.charCodeAt(0))}function q(E){return L(E.charCodeAt(E.length-1))}function x(E){for(var k=[],S=0;S<E.length;S++)E[S][1].length>0&&k.push(E[S]);return k}function j(E,k,S,U){return q(E)||C(U)?null:x([[n,E],[t,k],[e,S],[n,U]])}function Z(E,k,S){var U=typeof S=="number"?{index:S,length:0}:S.oldRange,F=typeof S=="number"?null:S.newRange,M=E.length,Q=k.length;if(U.length===0&&(F===null||F.length===0)){var z=U.index,$=E.slice(0,z),X=E.slice(z),J=F?F.index:null;e:{var ne=z+Q-M;if(J!==null&&J!==ne||ne<0||ne>Q)break e;var ge=k.slice(0,ne),be=k.slice(ne);if(be!==X)break e;var pe=Math.min(z,ne),Se=$.slice(0,pe),ie=ge.slice(0,pe);if(Se!==ie)break e;var he=$.slice(pe),Ce=ge.slice(pe);return j(Se,he,Ce,X)}e:{if(J!==null&&J!==z)break e;var Ne=z,ge=k.slice(0,Ne),be=k.slice(Ne);if(ge!==$)break e;var Ie=Math.min(M-Ne,Q-Ne),Le=X.slice(X.length-Ie),Re=be.slice(be.length-Ie);if(Le!==Re)break e;var he=X.slice(0,X.length-Ie),Ce=be.slice(0,be.length-Ie);return j($,he,Ce,Le)}}if(U.length>0&&F&&F.length===0)e:{var Se=E.slice(0,U.index),Le=E.slice(U.index+U.length),pe=Se.length,Ie=Le.length;if(Q<pe+Ie)break e;var ie=k.slice(0,pe),Re=k.slice(Q-Ie);if(Se!==ie||Le!==Re)break e;var he=E.slice(pe,M-Ie),Ce=k.slice(pe,Q-Ie);return j(Se,he,Ce,Le)}return null}function Y(E,k,S,U){return r(E,k,S,U,!0)}return Y.INSERT=e,Y.DELETE=t,Y.EQUAL=n,Pc=Y,Pc}var iu={exports:{}};iu.exports;var T1;function db(){return T1||(T1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",u="[object Boolean]",o="[object Date]",f="[object Error]",h="[object Function]",g="[object GeneratorFunction]",d="[object Map]",m="[object Number]",b="[object Object]",_="[object Promise]",T="[object RegExp]",v="[object Set]",O="[object String]",L="[object Symbol]",B="[object WeakMap]",C="[object ArrayBuffer]",q="[object DataView]",x="[object Float32Array]",j="[object Float64Array]",Z="[object Int8Array]",Y="[object Int16Array]",E="[object Int32Array]",k="[object Uint8Array]",S="[object Uint8ClampedArray]",U="[object Uint16Array]",F="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,z=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,X={};X[a]=X[i]=X[C]=X[q]=X[u]=X[o]=X[x]=X[j]=X[Z]=X[Y]=X[E]=X[d]=X[m]=X[b]=X[T]=X[v]=X[O]=X[L]=X[k]=X[S]=X[U]=X[F]=!0,X[f]=X[h]=X[B]=!1;var J=typeof Ms=="object"&&Ms&&Ms.Object===Object&&Ms,ne=typeof self=="object"&&self&&self.Object===Object&&self,ge=J||ne||Function("return this")(),be=e&&!e.nodeType&&e,pe=be&&!0&&t&&!t.nodeType&&t,Se=pe&&pe.exports===be;function ie(p,A){return p.set(A[0],A[1]),p}function he(p,A){return p.add(A),p}function Ce(p,A){for(var P=-1,re=p?p.length:0;++P<re&&A(p[P],P,p)!==!1;);return p}function Ne(p,A){for(var P=-1,re=A.length,je=p.length;++P<re;)p[je+P]=A[P];return p}function Ie(p,A,P,re){for(var je=-1,De=p?p.length:0;++je<De;)P=A(P,p[je],je,p);return P}function Le(p,A){for(var P=-1,re=Array(p);++P<p;)re[P]=A(P);return re}function Re(p,A){return p==null?void 0:p[A]}function $e(p){var A=!1;if(p!=null&&typeof p.toString!="function")try{A=!!(p+"")}catch{}return A}function We(p){var A=-1,P=Array(p.size);return p.forEach(function(re,je){P[++A]=[je,re]}),P}function rn(p,A){return function(P){return p(A(P))}}function Ge(p){var A=-1,P=Array(p.size);return p.forEach(function(re){P[++A]=re}),P}var $t=Array.prototype,sn=Function.prototype,Ut=Object.prototype,hn=ge["__core-js_shared__"],pn=(function(){var p=/[^.]+$/.exec(hn&&hn.keys&&hn.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),Yt=sn.toString,Ht=Ut.hasOwnProperty,Nn=Ut.toString,qn=RegExp("^"+Yt.call(Ht).replace(M,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ct=Se?ge.Buffer:void 0,xt=ge.Symbol,Xt=ge.Uint8Array,gt=rn(Object.getPrototypeOf,Object),zt=Object.create,mn=Ut.propertyIsEnumerable,mr=$t.splice,Vn=Object.getOwnPropertySymbols,G=Ct?Ct.isBuffer:void 0,ve=rn(Object.keys,Object),ke=gr(ge,"DataView"),ze=gr(ge,"Map"),Qe=gr(ge,"Promise"),dt=gr(ge,"Set"),Qt=gr(ge,"WeakMap"),xn=gr(Object,"create"),Te=In(ke),Me=In(ze),Ve=In(Qe),Ye=In(dt),le=In(Qt),Rt=xt?xt.prototype:void 0,Mt=Rt?Rt.valueOf:void 0;function bt(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function gn(){this.__data__=xn?xn(null):{}}function jn(p){return this.has(p)&&delete this.__data__[p]}function rs(p){var A=this.__data__;if(xn){var P=A[p];return P===r?void 0:P}return Ht.call(A,p)?A[p]:void 0}function Xn(p){var A=this.__data__;return xn?A[p]!==void 0:Ht.call(A,p)}function Qn(p,A){var P=this.__data__;return P[p]=xn&&A===void 0?r:A,this}bt.prototype.clear=gn,bt.prototype.delete=jn,bt.prototype.get=rs,bt.prototype.has=Xn,bt.prototype.set=Qn;function Bt(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Js(){this.__data__=[]}function ea(p){var A=this.__data__,P=_s(A,p);if(P<0)return!1;var re=A.length-1;return P==re?A.pop():mr.call(A,P,1),!0}function ta(p){var A=this.__data__,P=_s(A,p);return P<0?void 0:A[P][1]}function tt(p){return _s(this.__data__,p)>-1}function wt(p,A){var P=this.__data__,re=_s(P,p);return re<0?P.push([p,A]):P[re][1]=A,this}Bt.prototype.clear=Js,Bt.prototype.delete=ea,Bt.prototype.get=ta,Bt.prototype.has=tt,Bt.prototype.set=wt;function nt(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Sn(){this.__data__={hash:new bt,map:new(ze||Bt),string:new bt}}function bn(p){return sa(this,p).delete(p)}function Ft(p){return sa(this,p).get(p)}function Wt(p){return sa(this,p).has(p)}function Gt(p,A){return sa(this,p).set(p,A),this}nt.prototype.clear=Sn,nt.prototype.delete=bn,nt.prototype.get=Ft,nt.prototype.has=Wt,nt.prototype.set=Gt;function rt(p){this.__data__=new Bt(p)}function Rn(){this.__data__=new Bt}function yt(p){return this.__data__.delete(p)}function Zt(p){return this.__data__.get(p)}function ye(p){return this.__data__.has(p)}function _e(p,A){var P=this.__data__;if(P instanceof Bt){var re=P.__data__;if(!ze||re.length<n-1)return re.push([p,A]),this;P=this.__data__=new nt(re)}return P.set(p,A),this}rt.prototype.clear=Rn,rt.prototype.delete=yt,rt.prototype.get=Zt,rt.prototype.has=ye,rt.prototype.set=_e;function qe(p,A){var P=Yi(p)||Ya(p)?Le(p.length,String):[],re=P.length,je=!!re;for(var De in p)Ht.call(p,De)&&!(je&&(De=="length"||ac(De,re)))&&P.push(De);return P}function vt(p,A,P){var re=p[A];(!(Ht.call(p,A)&&ho(re,P))||P===void 0&&!(A in p))&&(p[A]=P)}function _s(p,A){for(var P=p.length;P--;)if(ho(p[P][0],A))return P;return-1}function Zn(p,A){return p&&$i(A,Wi(A),p)}function na(p,A,P,re,je,De,ut){var st;if(re&&(st=De?re(p,je,De,ut):re(p)),st!==void 0)return st;if(!Ur(p))return p;var qt=Yi(p);if(qt){if(st=rc(p),!A)return ec(p,st)}else{var ht=as(p),vn=ht==h||ht==g;if(po(p))return $a(p,A);if(ht==b||ht==a||vn&&!De){if($e(p))return De?p:{};if(st=Fr(vn?{}:p),!A)return tc(p,Zn(st,p))}else{if(!X[ht])return De?p:{};st=sc(p,ht,na,A)}}ut||(ut=new rt);var Dn=ut.get(p);if(Dn)return Dn;if(ut.set(p,st),!qt)var Kt=P?nc(p):Wi(p);return Ce(Kt||p,function(En,an){Kt&&(an=En,En=p[an]),vt(st,an,na(En,A,P,re,an,p,ut))}),st}function Wl(p){return Ur(p)?zt(p):{}}function Gl(p,A,P){var re=A(p);return Yi(p)?re:Ne(re,P(p))}function Kl(p){return Nn.call(p)}function Vl(p){if(!Ur(p)||uc(p))return!1;var A=zi(p)||$e(p)?qn:z;return A.test(In(p))}function Xl(p){if(!co(p))return ve(p);var A=[];for(var P in Object(p))Ht.call(p,P)&&P!="constructor"&&A.push(P);return A}function $a(p,A){if(A)return p.slice();var P=new p.constructor(p.length);return p.copy(P),P}function ji(p){var A=new p.constructor(p.byteLength);return new Xt(A).set(new Xt(p)),A}function ra(p,A){var P=A?ji(p.buffer):p.buffer;return new p.constructor(P,p.byteOffset,p.byteLength)}function oo(p,A,P){var re=A?P(We(p),!0):We(p);return Ie(re,ie,new p.constructor)}function lo(p){var A=new p.constructor(p.source,Q.exec(p));return A.lastIndex=p.lastIndex,A}function Ql(p,A,P){var re=A?P(Ge(p),!0):Ge(p);return Ie(re,he,new p.constructor)}function Zl(p){return Mt?Object(Mt.call(p)):{}}function Jl(p,A){var P=A?ji(p.buffer):p.buffer;return new p.constructor(P,p.byteOffset,p.length)}function ec(p,A){var P=-1,re=p.length;for(A||(A=Array(re));++P<re;)A[P]=p[P];return A}function $i(p,A,P,re){P||(P={});for(var je=-1,De=A.length;++je<De;){var ut=A[je],st=void 0;vt(P,ut,st===void 0?p[ut]:st)}return P}function tc(p,A){return $i(p,ss(p),A)}function nc(p){return Gl(p,Wi,ss)}function sa(p,A){var P=p.__data__;return ic(A)?P[typeof A=="string"?"string":"hash"]:P.map}function gr(p,A){var P=Re(p,A);return Vl(P)?P:void 0}var ss=Vn?rn(Vn,Object):lc,as=Kl;(ke&&as(new ke(new ArrayBuffer(1)))!=q||ze&&as(new ze)!=d||Qe&&as(Qe.resolve())!=_||dt&&as(new dt)!=v||Qt&&as(new Qt)!=B)&&(as=function(p){var A=Nn.call(p),P=A==b?p.constructor:void 0,re=P?In(P):void 0;if(re)switch(re){case Te:return q;case Me:return d;case Ve:return _;case Ye:return v;case le:return B}return A});function rc(p){var A=p.length,P=p.constructor(A);return A&&typeof p[0]=="string"&&Ht.call(p,"index")&&(P.index=p.index,P.input=p.input),P}function Fr(p){return typeof p.constructor=="function"&&!co(p)?Wl(gt(p)):{}}function sc(p,A,P,re){var je=p.constructor;switch(A){case C:return ji(p);case u:case o:return new je(+p);case q:return ra(p,re);case x:case j:case Z:case Y:case E:case k:case S:case U:case F:return Jl(p,re);case d:return oo(p,re,P);case m:case O:return new je(p);case T:return lo(p);case v:return Ql(p,re,P);case L:return Zl(p)}}function ac(p,A){return A=A??s,!!A&&(typeof p=="number"||$.test(p))&&p>-1&&p%1==0&&p<A}function ic(p){var A=typeof p;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?p!=="__proto__":p===null}function uc(p){return!!pn&&pn in p}function co(p){var A=p&&p.constructor,P=typeof A=="function"&&A.prototype||Ut;return p===P}function In(p){if(p!=null){try{return Yt.call(p)}catch{}try{return p+""}catch{}}return""}function fo(p){return na(p,!0,!0)}function ho(p,A){return p===A||p!==p&&A!==A}function Ya(p){return oc(p)&&Ht.call(p,"callee")&&(!mn.call(p,"callee")||Nn.call(p)==a)}var Yi=Array.isArray;function za(p){return p!=null&&mo(p.length)&&!zi(p)}function oc(p){return go(p)&&za(p)}var po=G||cc;function zi(p){var A=Ur(p)?Nn.call(p):"";return A==h||A==g}function mo(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=s}function Ur(p){var A=typeof p;return!!p&&(A=="object"||A=="function")}function go(p){return!!p&&typeof p=="object"}function Wi(p){return za(p)?qe(p):Xl(p)}function lc(){return[]}function cc(){return!1}t.exports=fo})(iu,iu.exports)),iu.exports}var uu={exports:{}};uu.exports;var _1;function hb(){return _1||(_1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,u="[object Arguments]",o="[object Array]",f="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",d="[object Error]",m="[object Function]",b="[object GeneratorFunction]",_="[object Map]",T="[object Number]",v="[object Null]",O="[object Object]",L="[object Promise]",B="[object Proxy]",C="[object RegExp]",q="[object Set]",x="[object String]",j="[object Symbol]",Z="[object Undefined]",Y="[object WeakMap]",E="[object ArrayBuffer]",k="[object DataView]",S="[object Float32Array]",U="[object Float64Array]",F="[object Int8Array]",M="[object Int16Array]",Q="[object Int32Array]",z="[object Uint8Array]",$="[object Uint8ClampedArray]",X="[object Uint16Array]",J="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,ge=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,pe={};pe[S]=pe[U]=pe[F]=pe[M]=pe[Q]=pe[z]=pe[$]=pe[X]=pe[J]=!0,pe[u]=pe[o]=pe[E]=pe[h]=pe[k]=pe[g]=pe[d]=pe[m]=pe[_]=pe[T]=pe[O]=pe[C]=pe[q]=pe[x]=pe[Y]=!1;var Se=typeof Ms=="object"&&Ms&&Ms.Object===Object&&Ms,ie=typeof self=="object"&&self&&self.Object===Object&&self,he=Se||ie||Function("return this")(),Ce=e&&!e.nodeType&&e,Ne=Ce&&!0&&t&&!t.nodeType&&t,Ie=Ne&&Ne.exports===Ce,Le=Ie&&Se.process,Re=(function(){try{return Le&&Le.binding&&Le.binding("util")}catch{}})(),$e=Re&&Re.isTypedArray;function We(p,A){for(var P=-1,re=p==null?0:p.length,je=0,De=[];++P<re;){var ut=p[P];A(ut,P,p)&&(De[je++]=ut)}return De}function rn(p,A){for(var P=-1,re=A.length,je=p.length;++P<re;)p[je+P]=A[P];return p}function Ge(p,A){for(var P=-1,re=p==null?0:p.length;++P<re;)if(A(p[P],P,p))return!0;return!1}function $t(p,A){for(var P=-1,re=Array(p);++P<p;)re[P]=A(P);return re}function sn(p){return function(A){return p(A)}}function Ut(p,A){return p.has(A)}function hn(p,A){return p==null?void 0:p[A]}function pn(p){var A=-1,P=Array(p.size);return p.forEach(function(re,je){P[++A]=[je,re]}),P}function Yt(p,A){return function(P){return p(A(P))}}function Ht(p){var A=-1,P=Array(p.size);return p.forEach(function(re){P[++A]=re}),P}var Nn=Array.prototype,qn=Function.prototype,Ct=Object.prototype,xt=he["__core-js_shared__"],Xt=qn.toString,gt=Ct.hasOwnProperty,zt=(function(){var p=/[^.]+$/.exec(xt&&xt.keys&&xt.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),mn=Ct.toString,mr=RegExp("^"+Xt.call(gt).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vn=Ie?he.Buffer:void 0,G=he.Symbol,ve=he.Uint8Array,ke=Ct.propertyIsEnumerable,ze=Nn.splice,Qe=G?G.toStringTag:void 0,dt=Object.getOwnPropertySymbols,Qt=Vn?Vn.isBuffer:void 0,xn=Yt(Object.keys,Object),Te=ss(he,"DataView"),Me=ss(he,"Map"),Ve=ss(he,"Promise"),Ye=ss(he,"Set"),le=ss(he,"WeakMap"),Rt=ss(Object,"create"),Mt=In(Te),bt=In(Me),gn=In(Ve),jn=In(Ye),rs=In(le),Xn=G?G.prototype:void 0,Qn=Xn?Xn.valueOf:void 0;function Bt(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Js(){this.__data__=Rt?Rt(null):{},this.size=0}function ea(p){var A=this.has(p)&&delete this.__data__[p];return this.size-=A?1:0,A}function ta(p){var A=this.__data__;if(Rt){var P=A[p];return P===r?void 0:P}return gt.call(A,p)?A[p]:void 0}function tt(p){var A=this.__data__;return Rt?A[p]!==void 0:gt.call(A,p)}function wt(p,A){var P=this.__data__;return this.size+=this.has(p)?0:1,P[p]=Rt&&A===void 0?r:A,this}Bt.prototype.clear=Js,Bt.prototype.delete=ea,Bt.prototype.get=ta,Bt.prototype.has=tt,Bt.prototype.set=wt;function nt(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Sn(){this.__data__=[],this.size=0}function bn(p){var A=this.__data__,P=$a(A,p);if(P<0)return!1;var re=A.length-1;return P==re?A.pop():ze.call(A,P,1),--this.size,!0}function Ft(p){var A=this.__data__,P=$a(A,p);return P<0?void 0:A[P][1]}function Wt(p){return $a(this.__data__,p)>-1}function Gt(p,A){var P=this.__data__,re=$a(P,p);return re<0?(++this.size,P.push([p,A])):P[re][1]=A,this}nt.prototype.clear=Sn,nt.prototype.delete=bn,nt.prototype.get=Ft,nt.prototype.has=Wt,nt.prototype.set=Gt;function rt(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Rn(){this.size=0,this.__data__={hash:new Bt,map:new(Me||nt),string:new Bt}}function yt(p){var A=gr(this,p).delete(p);return this.size-=A?1:0,A}function Zt(p){return gr(this,p).get(p)}function ye(p){return gr(this,p).has(p)}function _e(p,A){var P=gr(this,p),re=P.size;return P.set(p,A),this.size+=P.size==re?0:1,this}rt.prototype.clear=Rn,rt.prototype.delete=yt,rt.prototype.get=Zt,rt.prototype.has=ye,rt.prototype.set=_e;function qe(p){var A=-1,P=p==null?0:p.length;for(this.__data__=new rt;++A<P;)this.add(p[A])}function vt(p){return this.__data__.set(p,r),this}function _s(p){return this.__data__.has(p)}qe.prototype.add=qe.prototype.push=vt,qe.prototype.has=_s;function Zn(p){var A=this.__data__=new nt(p);this.size=A.size}function na(){this.__data__=new nt,this.size=0}function Wl(p){var A=this.__data__,P=A.delete(p);return this.size=A.size,P}function Gl(p){return this.__data__.get(p)}function Kl(p){return this.__data__.has(p)}function Vl(p,A){var P=this.__data__;if(P instanceof nt){var re=P.__data__;if(!Me||re.length<n-1)return re.push([p,A]),this.size=++P.size,this;P=this.__data__=new rt(re)}return P.set(p,A),this.size=P.size,this}Zn.prototype.clear=na,Zn.prototype.delete=Wl,Zn.prototype.get=Gl,Zn.prototype.has=Kl,Zn.prototype.set=Vl;function Xl(p,A){var P=Ya(p),re=!P&&ho(p),je=!P&&!re&&za(p),De=!P&&!re&&!je&&go(p),ut=P||re||je||De,st=ut?$t(p.length,String):[],qt=st.length;for(var ht in p)gt.call(p,ht)&&!(ut&&(ht=="length"||je&&(ht=="offset"||ht=="parent")||De&&(ht=="buffer"||ht=="byteLength"||ht=="byteOffset")||sc(ht,qt)))&&st.push(ht);return st}function $a(p,A){for(var P=p.length;P--;)if(fo(p[P][0],A))return P;return-1}function ji(p,A,P){var re=A(p);return Ya(p)?re:rn(re,P(p))}function ra(p){return p==null?p===void 0?Z:v:Qe&&Qe in Object(p)?as(p):co(p)}function oo(p){return Ur(p)&&ra(p)==u}function lo(p,A,P,re,je){return p===A?!0:p==null||A==null||!Ur(p)&&!Ur(A)?p!==p&&A!==A:Ql(p,A,P,re,lo,je)}function Ql(p,A,P,re,je,De){var ut=Ya(p),st=Ya(A),qt=ut?o:Fr(p),ht=st?o:Fr(A);qt=qt==u?O:qt,ht=ht==u?O:ht;var vn=qt==O,Dn=ht==O,Kt=qt==ht;if(Kt&&za(p)){if(!za(A))return!1;ut=!0,vn=!1}if(Kt&&!vn)return De||(De=new Zn),ut||go(p)?$i(p,A,P,re,je,De):tc(p,A,qt,P,re,je,De);if(!(P&s)){var En=vn&&gt.call(p,"__wrapped__"),an=Dn&&gt.call(A,"__wrapped__");if(En||an){var As=En?p.value():p,is=an?A.value():A;return De||(De=new Zn),je(As,is,P,re,De)}}return Kt?(De||(De=new Zn),nc(p,A,P,re,je,De)):!1}function Zl(p){if(!mo(p)||ic(p))return!1;var A=po(p)?mr:ge;return A.test(In(p))}function Jl(p){return Ur(p)&&zi(p.length)&&!!pe[ra(p)]}function ec(p){if(!uc(p))return xn(p);var A=[];for(var P in Object(p))gt.call(p,P)&&P!="constructor"&&A.push(P);return A}function $i(p,A,P,re,je,De){var ut=P&s,st=p.length,qt=A.length;if(st!=qt&&!(ut&&qt>st))return!1;var ht=De.get(p);if(ht&&De.get(A))return ht==A;var vn=-1,Dn=!0,Kt=P&a?new qe:void 0;for(De.set(p,A),De.set(A,p);++vn<st;){var En=p[vn],an=A[vn];if(re)var As=ut?re(an,En,vn,A,p,De):re(En,an,vn,p,A,De);if(As!==void 0){if(As)continue;Dn=!1;break}if(Kt){if(!Ge(A,function(is,aa){if(!Ut(Kt,aa)&&(En===is||je(En,is,P,re,De)))return Kt.push(aa)})){Dn=!1;break}}else if(!(En===an||je(En,an,P,re,De))){Dn=!1;break}}return De.delete(p),De.delete(A),Dn}function tc(p,A,P,re,je,De,ut){switch(P){case k:if(p.byteLength!=A.byteLength||p.byteOffset!=A.byteOffset)return!1;p=p.buffer,A=A.buffer;case E:return!(p.byteLength!=A.byteLength||!De(new ve(p),new ve(A)));case h:case g:case T:return fo(+p,+A);case d:return p.name==A.name&&p.message==A.message;case C:case x:return p==A+"";case _:var st=pn;case q:var qt=re&s;if(st||(st=Ht),p.size!=A.size&&!qt)return!1;var ht=ut.get(p);if(ht)return ht==A;re|=a,ut.set(p,A);var vn=$i(st(p),st(A),re,je,De,ut);return ut.delete(p),vn;case j:if(Qn)return Qn.call(p)==Qn.call(A)}return!1}function nc(p,A,P,re,je,De){var ut=P&s,st=sa(p),qt=st.length,ht=sa(A),vn=ht.length;if(qt!=vn&&!ut)return!1;for(var Dn=qt;Dn--;){var Kt=st[Dn];if(!(ut?Kt in A:gt.call(A,Kt)))return!1}var En=De.get(p);if(En&&De.get(A))return En==A;var an=!0;De.set(p,A),De.set(A,p);for(var As=ut;++Dn<qt;){Kt=st[Dn];var is=p[Kt],aa=A[Kt];if(re)var Mh=ut?re(aa,is,Kt,A,p,De):re(is,aa,Kt,p,A,De);if(!(Mh===void 0?is===aa||je(is,aa,P,re,De):Mh)){an=!1;break}As||(As=Kt=="constructor")}if(an&&!As){var bo=p.constructor,vo=A.constructor;bo!=vo&&"constructor"in p&&"constructor"in A&&!(typeof bo=="function"&&bo instanceof bo&&typeof vo=="function"&&vo instanceof vo)&&(an=!1)}return De.delete(p),De.delete(A),an}function sa(p){return ji(p,Wi,rc)}function gr(p,A){var P=p.__data__;return ac(A)?P[typeof A=="string"?"string":"hash"]:P.map}function ss(p,A){var P=hn(p,A);return Zl(P)?P:void 0}function as(p){var A=gt.call(p,Qe),P=p[Qe];try{p[Qe]=void 0;var re=!0}catch{}var je=mn.call(p);return re&&(A?p[Qe]=P:delete p[Qe]),je}var rc=dt?function(p){return p==null?[]:(p=Object(p),We(dt(p),function(A){return ke.call(p,A)}))}:lc,Fr=ra;(Te&&Fr(new Te(new ArrayBuffer(1)))!=k||Me&&Fr(new Me)!=_||Ve&&Fr(Ve.resolve())!=L||Ye&&Fr(new Ye)!=q||le&&Fr(new le)!=Y)&&(Fr=function(p){var A=ra(p),P=A==O?p.constructor:void 0,re=P?In(P):"";if(re)switch(re){case Mt:return k;case bt:return _;case gn:return L;case jn:return q;case rs:return Y}return A});function sc(p,A){return A=A??i,!!A&&(typeof p=="number"||be.test(p))&&p>-1&&p%1==0&&p<A}function ac(p){var A=typeof p;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?p!=="__proto__":p===null}function ic(p){return!!zt&&zt in p}function uc(p){var A=p&&p.constructor,P=typeof A=="function"&&A.prototype||Ct;return p===P}function co(p){return mn.call(p)}function In(p){if(p!=null){try{return Xt.call(p)}catch{}try{return p+""}catch{}}return""}function fo(p,A){return p===A||p!==p&&A!==A}var ho=oo((function(){return arguments})())?oo:function(p){return Ur(p)&&gt.call(p,"callee")&&!ke.call(p,"callee")},Ya=Array.isArray;function Yi(p){return p!=null&&zi(p.length)&&!po(p)}var za=Qt||cc;function oc(p,A){return lo(p,A)}function po(p){if(!mo(p))return!1;var A=ra(p);return A==m||A==b||A==f||A==B}function zi(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=i}function mo(p){var A=typeof p;return p!=null&&(A=="object"||A=="function")}function Ur(p){return p!=null&&typeof p=="object"}var go=$e?sn($e):Jl;function Wi(p){return Yi(p)?Xl(p):ec(p)}function lc(){return[]}function cc(){return!1}t.exports=oc})(uu,uu.exports)),uu.exports}var Oo={},A1;function Xw(){if(A1)return Oo;A1=1,Object.defineProperty(Oo,"__esModule",{value:!0});const t=db(),e=hb();var n;return(function(r){function s(o={},f={},h=!1){typeof o!="object"&&(o={}),typeof f!="object"&&(f={});let g=t(f);h||(g=Object.keys(g).reduce((d,m)=>(g[m]!=null&&(d[m]=g[m]),d),{}));for(const d in o)o[d]!==void 0&&f[d]===void 0&&(g[d]=o[d]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(o={},f={}){typeof o!="object"&&(o={}),typeof f!="object"&&(f={});const h=Object.keys(o).concat(Object.keys(f)).reduce((g,d)=>(e(o[d],f[d])||(g[d]=f[d]===void 0?null:f[d]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(o={},f={}){o=o||{};const h=Object.keys(f).reduce((g,d)=>(f[d]!==o[d]&&o[d]!==void 0&&(g[d]=f[d]),g),{});return Object.keys(o).reduce((g,d)=>(o[d]!==f[d]&&f[d]===void 0&&(g[d]=null),g),h)}r.invert=i;function u(o,f,h=!1){if(typeof o!="object")return f;if(typeof f!="object")return;if(!h)return f;const g=Object.keys(f).reduce((d,m)=>(o[m]===void 0&&(d[m]=f[m]),d),{});return Object.keys(g).length>0?g:void 0}r.transform=u})(n||(n={})),Oo.default=n,Oo}var xo={},y1;function pb(){if(y1)return xo;y1=1,Object.defineProperty(xo,"__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={})),xo.default=t,xo}var Ro={},N1;function Qw(){if(N1)return Ro;N1=1,Object.defineProperty(Ro,"__esModule",{value:!0});const t=pb();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 u={};return s.attributes&&(u.attributes=s.attributes),typeof s.retain=="number"?u.retain=r:typeof s.retain=="object"&&s.retain!==null?u.retain=s.retain:typeof s.insert=="string"?u.insert=s.insert.substr(a,r):u.insert=s.insert,u}}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 Ro.default=e,Ro}var S1;function Zw(){return S1||(S1=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=Vw(),r=db(),s=hb(),a=Xw();e.AttributeMap=a.default;const i=pb();e.Op=i.default;const u=Qw();e.OpIterator=u.default;const o="\0",f=(g,d)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof d!="object"||d===null)throw new Error(`cannot retain a ${typeof d}`);const m=Object.keys(g)[0];if(!m||m!==Object.keys(d)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(d)[0]}`);return[m,g[m],d[m]]};class h{constructor(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]}static registerEmbed(d,m){this.handlers[d]=m}static unregisterEmbed(d){delete this.handlers[d]}static getHandler(d){const m=this.handlers[d];if(!m)throw new Error(`no handlers for embed type "${d}"`);return m}insert(d,m){const b={};return typeof d=="string"&&d.length===0?this:(b.insert=d,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b))}delete(d){return d<=0?this:this.push({delete:d})}retain(d,m){if(typeof d=="number"&&d<=0)return this;const b={retain:d};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b)}push(d){let m=this.ops.length,b=this.ops[m-1];if(d=r(d),typeof b=="object"){if(typeof d.delete=="number"&&typeof b.delete=="number")return this.ops[m-1]={delete:b.delete+d.delete},this;if(typeof b.delete=="number"&&d.insert!=null&&(m-=1,b=this.ops[m-1],typeof b!="object"))return this.ops.unshift(d),this;if(s(d.attributes,b.attributes)){if(typeof d.insert=="string"&&typeof b.insert=="string")return this.ops[m-1]={insert:b.insert+d.insert},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof b.retain=="number")return this.ops[m-1]={retain:b.retain+d.retain},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this}}return m===this.ops.length?this.ops.push(d):this.ops.splice(m,0,d),this}chop(){const d=this.ops[this.ops.length-1];return d&&typeof d.retain=="number"&&!d.attributes&&this.ops.pop(),this}filter(d){return this.ops.filter(d)}forEach(d){this.ops.forEach(d)}map(d){return this.ops.map(d)}partition(d){const m=[],b=[];return this.forEach(_=>{(d(_)?m:b).push(_)}),[m,b]}reduce(d,m){return this.ops.reduce(d,m)}changeLength(){return this.reduce((d,m)=>m.insert?d+i.default.length(m):m.delete?d-m.delete:d,0)}length(){return this.reduce((d,m)=>d+i.default.length(m),0)}slice(d=0,m=1/0){const b=[],_=new u.default(this.ops);let T=0;for(;T<m&&_.hasNext();){let v;T<d?v=_.next(d-T):(v=_.next(m-T),b.push(v)),T+=i.default.length(v)}return new h(b)}compose(d){const m=new u.default(this.ops),b=new u.default(d.ops),_=[],T=b.peek();if(T!=null&&typeof T.retain=="number"&&T.attributes==null){let O=T.retain;for(;m.peekType()==="insert"&&m.peekLength()<=O;)O-=m.peekLength(),_.push(m.next());T.retain-O>0&&b.next(T.retain-O)}const v=new h(_);for(;m.hasNext()||b.hasNext();)if(b.peekType()==="insert")v.push(b.next());else if(m.peekType()==="delete")v.push(m.next());else{const O=Math.min(m.peekLength(),b.peekLength()),L=m.next(O),B=b.next(O);if(B.retain){const C={};if(typeof L.retain=="number")C.retain=typeof B.retain=="number"?O:B.retain;else if(typeof B.retain=="number")L.retain==null?C.insert=L.insert:C.retain=L.retain;else{const x=L.retain==null?"insert":"retain",[j,Z,Y]=f(L[x],B.retain),E=h.getHandler(j);C[x]={[j]:E.compose(Z,Y,x==="retain")}}const q=a.default.compose(L.attributes,B.attributes,typeof L.retain=="number");if(q&&(C.attributes=q),v.push(C),!b.hasNext()&&s(v.ops[v.ops.length-1],C)){const x=new h(m.rest());return v.concat(x).chop()}}else typeof B.delete=="number"&&(typeof L.retain=="number"||typeof L.retain=="object"&&L.retain!==null)&&v.push(B)}return v.chop()}concat(d){const m=new h(this.ops.slice());return d.ops.length>0&&(m.push(d.ops[0]),m.ops=m.ops.concat(d.ops.slice(1))),m}diff(d,m){if(this.ops===d.ops)return new h;const b=[this,d].map(L=>L.map(B=>{if(B.insert!=null)return typeof B.insert=="string"?B.insert:o;const C=L===d?"on":"with";throw new Error("diff() called "+C+" non-document")}).join("")),_=new h,T=n(b[0],b[1],m,!0),v=new u.default(this.ops),O=new u.default(d.ops);return T.forEach(L=>{let B=L[1].length;for(;B>0;){let C=0;switch(L[0]){case n.INSERT:C=Math.min(O.peekLength(),B),_.push(O.next(C));break;case n.DELETE:C=Math.min(B,v.peekLength()),v.next(C),_.delete(C);break;case n.EQUAL:C=Math.min(v.peekLength(),O.peekLength(),B);const q=v.next(C),x=O.next(C);s(q.insert,x.insert)?_.retain(C,a.default.diff(q.attributes,x.attributes)):_.push(x).delete(C);break}B-=C}}),_.chop()}eachLine(d,m=`
67
+ `){const b=new u.default(this.ops);let _=new h,T=0;for(;b.hasNext();){if(b.peekType()!=="insert")return;const v=b.peek(),O=i.default.length(v)-b.peekLength(),L=typeof v.insert=="string"?v.insert.indexOf(m,O)-O:-1;if(L<0)_.push(b.next());else if(L>0)_.push(b.next(L));else{if(d(_,b.next(1).attributes||{},T)===!1)return;T+=1,_=new h}}_.length()>0&&d(_,{},T)}invert(d){const m=new h;return this.reduce((b,_)=>{if(_.insert)m.delete(i.default.length(_));else{if(typeof _.retain=="number"&&_.attributes==null)return m.retain(_.retain),b+_.retain;if(_.delete||typeof _.retain=="number"){const T=_.delete||_.retain;return d.slice(b,b+T).forEach(O=>{_.delete?m.push(O):_.retain&&_.attributes&&m.retain(i.default.length(O),a.default.invert(_.attributes,O.attributes))}),b+T}else if(typeof _.retain=="object"&&_.retain!==null){const T=d.slice(b,b+1),v=new u.default(T.ops).next(),[O,L,B]=f(_.retain,v.insert),C=h.getHandler(O);return m.retain({[O]:C.invert(L,B)},a.default.invert(_.attributes,v.attributes)),b+1}}return b},0),m.chop()}transform(d,m=!1){if(m=!!m,typeof d=="number")return this.transformPosition(d,m);const b=d,_=new u.default(this.ops),T=new u.default(b.ops),v=new h;for(;_.hasNext()||T.hasNext();)if(_.peekType()==="insert"&&(m||T.peekType()!=="insert"))v.retain(i.default.length(_.next()));else if(T.peekType()==="insert")v.push(T.next());else{const O=Math.min(_.peekLength(),T.peekLength()),L=_.next(O),B=T.next(O);if(L.delete)continue;if(B.delete)v.push(B);else{const C=L.retain,q=B.retain;let x=typeof q=="object"&&q!==null?q:O;if(typeof C=="object"&&C!==null&&typeof q=="object"&&q!==null){const j=Object.keys(C)[0];if(j===Object.keys(q)[0]){const Z=h.getHandler(j);Z&&(x={[j]:Z.transform(C[j],q[j],m)})}}v.retain(x,a.default.transform(L.attributes,B.attributes,m))}}return v.chop()}transformPosition(d,m=!1){m=!!m;const b=new u.default(this.ops);let _=0;for(;b.hasNext()&&_<=d;){const T=b.peekLength(),v=b.peekType();if(b.next(),v==="delete"){d-=Math.min(T,d-_);continue}else v==="insert"&&(_<d||!m)&&(d+=T);_+=T}return d}}h.Op=i.default,h.OpIterator=u.default,h.AttributeMap=a.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h})(Lo,Lo.exports)),Lo.exports}var lr=Zw();const Oe=fb(lr);class Mr extends Kn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Mr.blotName="break";Mr.tagName="BR";let Or=class extends bl{};const Jw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function $l(t){return t.replace(/[&<>"']/g,e=>Jw[e])}const Hr=class Hr extends yh{static compare(e,n){const r=Hr.order.indexOf(e),s=Hr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(Hr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,xe.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 Hr&&Hr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};Ee(Hr,"allowedChildren",[Hr,Mr,Kn,Or]),Ee(Hr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let ts=Hr;const I1=1;class cn extends Pu{constructor(){super(...arguments);Ee(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=mb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,xe.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(`
68
+ `),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 u=this;a.reduce((o,f)=>(u=u.split(o,!0),u.insertAt(0,f),f.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Mr&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+I1),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()-I1)){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}}cn.blotName="block";cn.tagName="P";cn.defaultChild=Mr;cn.allowedChildren=[Mr,ts,Kn,Or];class or extends Kn{attach(){super.attach(),this.attributes=new ql(this.domNode)}delta(){return new Oe().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,xe.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(`
69
+ `),a=s.pop(),i=s.map(o=>{const f=this.scroll.create(cn.blotName);return f.insertAt(0,o),f}),u=this.split(e);i.forEach(o=>{this.parent.insertBefore(o,u)}),a&&this.parent.insertBefore(this.scroll.create("text",a),u)}}or.scope=xe.BLOCK_BLOT;function mb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(_n).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),ar(r,{},e)),new Oe).insert(`
70
+ `,ar(t))}function ar(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:ar(t.parent,e,n)}const Jn=class Jn extends Kn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(Jn.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!==xe.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Jn.CONTENTS.length,r.optimize(),r.formatAt(s,Jn.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 Or?this.prev:null,r=n?n.length():0,s=this.next instanceof Or?this.next:null,a=s?s.text:"",{textNode:i}=this,u=i.data.split(Jn.CONTENTS).join("");i.data=Jn.CONTENTS;let o;if(n)o=n,(u||s)&&(n.insertAt(n.length(),u+a),s&&s.remove());else if(s)o=s,s.insertAt(0,u);else{const f=document.createTextNode(u);o=this.scroll.create(f),this.parent.insertBefore(o,this)}if(this.remove(),e){const f=(d,m)=>n&&d===n.domNode?m:d===i?r+m-1:s&&d===s.domNode?r+u.length+m:null,h=f(e.start.node,e.start.offset),g=f(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:o.domNode,startOffset:h,endNode:o.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=Jn.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};Ee(Jn,"blotName","cursor"),Ee(Jn,"className","ql-cursor"),Ee(Jn,"tagName","span"),Ee(Jn,"CONTENTS","\uFEFF");let ki=Jn;var Mc={exports:{}},C1;function e4(){return C1||(C1=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(o,f,h){this.fn=o,this.context=f,this.once=h||!1}function a(o,f,h,g,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var m=new s(h,g||o,d),b=n?n+f:f;return o._events[b]?o._events[b].fn?o._events[b]=[o._events[b],m]:o._events[b].push(m):(o._events[b]=m,o._eventsCount++),o}function i(o,f){--o._eventsCount===0?o._events=new r:delete o._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],h,g;if(this._eventsCount===0)return f;for(g in h=this._events)e.call(h,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},u.prototype.listeners=function(f){var h=n?n+f:f,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var d=0,m=g.length,b=new Array(m);d<m;d++)b[d]=g[d].fn;return b},u.prototype.listenerCount=function(f){var h=n?n+f:f,g=this._events[h];return g?g.fn?1:g.length:0},u.prototype.emit=function(f,h,g,d,m,b){var _=n?n+f:f;if(!this._events[_])return!1;var T=this._events[_],v=arguments.length,O,L;if(T.fn){switch(T.once&&this.removeListener(f,T.fn,void 0,!0),v){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,h),!0;case 3:return T.fn.call(T.context,h,g),!0;case 4:return T.fn.call(T.context,h,g,d),!0;case 5:return T.fn.call(T.context,h,g,d,m),!0;case 6:return T.fn.call(T.context,h,g,d,m,b),!0}for(L=1,O=new Array(v-1);L<v;L++)O[L-1]=arguments[L];T.fn.apply(T.context,O)}else{var B=T.length,C;for(L=0;L<B;L++)switch(T[L].once&&this.removeListener(f,T[L].fn,void 0,!0),v){case 1:T[L].fn.call(T[L].context);break;case 2:T[L].fn.call(T[L].context,h);break;case 3:T[L].fn.call(T[L].context,h,g);break;case 4:T[L].fn.call(T[L].context,h,g,d);break;default:if(!O)for(C=1,O=new Array(v-1);C<v;C++)O[C-1]=arguments[C];T[L].fn.apply(T[L].context,O)}}return!0},u.prototype.on=function(f,h,g){return a(this,f,h,g,!1)},u.prototype.once=function(f,h,g){return a(this,f,h,g,!0)},u.prototype.removeListener=function(f,h,g,d){var m=n?n+f:f;if(!this._events[m])return this;if(!h)return i(this,m),this;var b=this._events[m];if(b.fn)b.fn===h&&(!d||b.once)&&(!g||b.context===g)&&i(this,m);else{for(var _=0,T=[],v=b.length;_<v;_++)(b[_].fn!==h||d&&!b[_].once||g&&b[_].context!==g)&&T.push(b[_]);T.length?this._events[m]=T.length===1?T[0]:T:i(this,m)}return this},u.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u})(Mc)),Mc.exports}var t4=e4();const n4=fb(t4),od=new WeakMap,ld=["error","warn","log","info"];let cd="warn";function gb(t){if(cd&&ld.indexOf(t)<=ld.indexOf(cd)){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 Ts(t){return ld.reduce((e,n)=>(e[n]=gb.bind(console,n,t),e),{})}Ts.level=t=>{cd=t};gb.level=Ts.level;const Bc=Ts("quill:events"),r4=["selectionchange","mousedown","mouseup","click"];r4.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=od.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class we extends n4{constructor(){super(),this.domListeners={},this.on("error",Bc.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Bc.log.call(Bc,...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:u}=a;(e.target===i||i.contains(e.target))&&u(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}Ee(we,"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"}),Ee(we,"sources",{API:"api",SILENT:"silent",USER:"user"});const Fc=Ts("quill:selection");class Oa{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class s4{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 Oa(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,we.sources.USER),1)}),this.emitter.on(we.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(we.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(u=>u.type==="characterData"||u.type==="childList"||u.type==="attributes"&&u.target===this.root);this.update(i?we.sources.SILENT:s)}catch{}})}),this.emitter.on(we.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:u,endOffset:o}=s.range;this.setNativeRange(a,i,u,o),this.update(we.sources.SILENT)}}),this.update(we.sources.SILENT)}handleComposition(){this.emitter.on(we.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(we.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(we.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,xe.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof _n){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),[d]=this.scroll.line(e+1);g===d&&(a=h,i=0)}}[s,i]=a.position(i,!0);const u=document.createRange();if(n>0)return u.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),u.setEnd(s,i),u.getBoundingClientRect());let o="left",f;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(u.setStart(s,i),u.setEnd(s,i+1)):(u.setStart(s,i-1),u.setEnd(s,i),o="right"),f=u.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;f=a.domNode.getBoundingClientRect(),i>0&&(o="right")}return{bottom:f.top+f.height,height:f.height,left:f[o],right:f[o],top:f.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 Fc.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&&Uc(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[u,o]=i,f=this.scroll.find(u,!0),h=f.offset(this.scroll);return o===0?h:f instanceof _n?h+f.index(u,o):h+f.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Oa(a,s-a)}normalizeNative(e){if(!Uc(this.root,e.startContainer)||!e.collapsed&&!Uc(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,u]=this.scroll.leaf(s);return i?i.position(u,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(Fc.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:u}=this.getNativeRange()||{};if(u==null||a||e!==u.startContainer||n!==u.startOffset||r!==u.endContainer||s!==u.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 o=document.createRange();o.setStart(e,n),o.setEnd(r,s),i.removeAllRanges(),i.addRange(o)}}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]:we.sources.API;if(typeof n=="string"&&(r=n,n=!1),Fc.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]:we.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ah(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=[we.events.SELECTION_CHANGE,oi(this.lastRange),oi(n),e];this.emitter.emit(we.events.EDITOR_CHANGE,...a),e!==we.sources.SILENT&&this.emitter.emit(...a)}}}function Uc(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const a4=/^[ -~]*$/;class i4{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=w1(e),s=new Oe;return o4(r.ops.slice()).reduce((i,u)=>{const o=lr.Op.length(u);let f=u.attributes||{},h=!1,g=!1;if(u.insert!=null){if(s.retain(o),typeof u.insert=="string"){const b=u.insert;g=!b.endsWith(`
71
71
  `)&&(n<=i||!!this.scroll.descendant(or,i)[0]),this.scroll.insertAt(i,b);const[_,T]=this.scroll.line(i);let v=$s({},ar(_));if(_ instanceof cn){const[O]=_.descendant(_n,T);O&&(v=$s(v,ar(O)))}f=lr.AttributeMap.diff(v,f)||{}}else if(typeof u.insert=="object"){const b=Object.keys(u.insert)[0];if(b==null)return i;const _=this.scroll.query(b,xe.INLINE)!=null;if(_)(n<=i||this.scroll.descendant(or,i)[0])&&(g=!0);else if(i>0){const[T,v]=this.scroll.descendant(_n,i-1);T instanceof Or?T.value()[v]!==`
72
- `&&(h=!0):T instanceof Kn&&T.statics.scope===xe.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(i,b,u.insert[b]),_){const[T]=this.scroll.descendant(_n,i);if(T){const v=$s({},ar(T));f=lr.AttributeMap.diff(v,f)||{}}}}n+=o}else if(s.push(u),u.retain!==null&&typeof u.retain=="object"){const b=Object.keys(u.retain)[0];if(b==null)return i;this.scroll.updateEmbedAt(i,b,u.retain[b])}Object.keys(f).forEach(b=>{this.scroll.formatAt(i,o,b,f[b])});const d=h?1:0,m=g?1:0;return n+=d+m,s.retain(d),s.delete(m),i+o+d+m},0),s.reduce((i,u)=>typeof u.delete=="number"?(this.scroll.deleteAt(i,u.delete),i):i+lr.Op.length(u),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new Oe().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 Oe().retain(e).retain(n,oi(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 Oe().retain(e).retain(n,oi(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 Oe)}getFormat(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];n===0?this.scroll.path(e).forEach(u=>{const[o]=u;o instanceof cn?r.push(o):o instanceof _n&&s.push(o)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(_n,e,n));const[a,i]=[r,s].map(u=>{const o=u.shift();if(o==null)return{};let f=ar(o);for(;Object.keys(f).length>0;){const h=u.shift();if(h==null)return f;f=t4(ar(h),f)}return f});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)?Mu(r,s,n,!0):Mu(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=C1(n),s=new Oe().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 Oe().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,`
72
+ `&&(h=!0):T instanceof Kn&&T.statics.scope===xe.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(i,b,u.insert[b]),_){const[T]=this.scroll.descendant(_n,i);if(T){const v=$s({},ar(T));f=lr.AttributeMap.diff(v,f)||{}}}}n+=o}else if(s.push(u),u.retain!==null&&typeof u.retain=="object"){const b=Object.keys(u.retain)[0];if(b==null)return i;this.scroll.updateEmbedAt(i,b,u.retain[b])}Object.keys(f).forEach(b=>{this.scroll.formatAt(i,o,b,f[b])});const d=h?1:0,m=g?1:0;return n+=d+m,s.retain(d),s.delete(m),i+o+d+m},0),s.reduce((i,u)=>typeof u.delete=="number"?(this.scroll.deleteAt(i,u.delete),i):i+lr.Op.length(u),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new Oe().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 Oe().retain(e).retain(n,oi(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 Oe().retain(e).retain(n,oi(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 Oe)}getFormat(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];n===0?this.scroll.path(e).forEach(u=>{const[o]=u;o instanceof cn?r.push(o):o instanceof _n&&s.push(o)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(_n,e,n));const[a,i]=[r,s].map(u=>{const o=u.shift();if(o==null)return{};let f=ar(o);for(;Object.keys(f).length>0;){const h=u.shift();if(h==null)return f;f=u4(ar(h),f)}return f});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)?Mu(r,s,n,!0):Mu(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=w1(n),s=new Oe().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 Oe().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,`
73
73
  `).replace(/\r/g,`
74
74
  `),this.scroll.insertAt(e,n),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,n.length,s,r[s])}),this.update(new Oe().retain(e).insert(n,oi(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)!==cn.blotName)return!1;const n=e;return n.children.length>1?!1:n.children.head instanceof Mr}removeFormat(e,n){const r=this.getText(e,n),[s,a]=this.scroll.line(e+n);let i=0,u=new Oe;s!=null&&(i=s.length()-a,u=s.delta().slice(a,a+i-1).insert(`
75
- `));const f=this.getContents(e,n+i).diff(new Oe().insert(r).concat(u)),h=new Oe().retain(e).concat(f);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(Jw)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=ar(a),u=a.offset(this.scroll),o=n[0].oldValue.replace(ki.CONTENTS,""),f=new Oe().insert(o),h=new Oe().insert(a.value()),g=r&&{oldRange:w1(r.oldRange,-u),newRange:w1(r.newRange,-u)};e=new Oe().retain(u).concat(f.diff(h,g)).reduce((m,b)=>b.insert?m.insert(b.insert,i):m.push(b),new Oe),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Ah(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function ei(t,e,n){if(t.length===0){const[m]=Hc(n.pop());return e<=0?`</li></${m}>`:`</li></${m}>${ei([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:u},...o]=t,[f,h]=Hc(u);if(i>e)return n.push(u),i===e+1?`<${f}><li${h}>${Mu(r,s,a)}${ei(o,i,n)}`:`<${f}><li>${ei(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&u===g)return`</li><li${h}>${Mu(r,s,a)}${ei(o,i,n)}`;const[d]=Hc(n.pop());return`</li></${d}>${ei(t,e-1,n)}`}function Mu(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 Or)return $l(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof wr){if(t.statics.blotName==="list-container"){const f=[];return t.children.forEachAt(e,n,(h,g,d)=>{const m="formats"in h&&typeof h.formats=="function"?h.formats():{};f.push({child:h,offset:g,length:d,indent:m.indent||0,type:m.list})}),ei(f,-1,[])}const s=[];if(t.children.forEachAt(e,n,(f,h,g)=>{s.push(Mu(f,h,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[u,o]=a.split(`>${i}<`);return u==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${o}`:`${u}>${s.join("")}<${o}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function t4(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 Hc(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 C1(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
75
+ `));const f=this.getContents(e,n+i).diff(new Oe().insert(r).concat(u)),h=new Oe().retain(e).concat(f);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(a4)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=ar(a),u=a.offset(this.scroll),o=n[0].oldValue.replace(ki.CONTENTS,""),f=new Oe().insert(o),h=new Oe().insert(a.value()),g=r&&{oldRange:L1(r.oldRange,-u),newRange:L1(r.newRange,-u)};e=new Oe().retain(u).concat(f.diff(h,g)).reduce((m,b)=>b.insert?m.insert(b.insert,i):m.push(b),new Oe),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Ah(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function ei(t,e,n){if(t.length===0){const[m]=Hc(n.pop());return e<=0?`</li></${m}>`:`</li></${m}>${ei([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:u},...o]=t,[f,h]=Hc(u);if(i>e)return n.push(u),i===e+1?`<${f}><li${h}>${Mu(r,s,a)}${ei(o,i,n)}`:`<${f}><li>${ei(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&u===g)return`</li><li${h}>${Mu(r,s,a)}${ei(o,i,n)}`;const[d]=Hc(n.pop());return`</li></${d}>${ei(t,e-1,n)}`}function Mu(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 Or)return $l(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof wr){if(t.statics.blotName==="list-container"){const f=[];return t.children.forEachAt(e,n,(h,g,d)=>{const m="formats"in h&&typeof h.formats=="function"?h.formats():{};f.push({child:h,offset:g,length:d,indent:m.indent||0,type:m.list})}),ei(f,-1,[])}const s=[];if(t.children.forEachAt(e,n,(f,h,g)=>{s.push(Mu(f,h,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[u,o]=a.split(`>${i}<`);return u==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${o}`:`${u}>${s.join("")}<${o}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function u4(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 Hc(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 w1(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
76
76
  `).replace(/\r/g,`
77
- `);return e.insert(r,n.attributes)}return e.push(n)},new Oe)}function w1(t,e){let{index:n,length:r}=t;return new Oa(n+e,r)}function n4(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
77
+ `);return e.insert(r,n.attributes)}return e.push(n)},new Oe)}function L1(t,e){let{index:n,length:r}=t;return new Oa(n+e,r)}function o4(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
78
78
  `).forEach((s,a)=>{a&&e.push({insert:`
79
- `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Br{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}Ee(Br,"DEFAULTS",{});const Do="\uFEFF";class Sh extends Kn{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(Do),this.rightGuard=document.createTextNode(Do),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(Do).join("");if(e===this.leftGuard)if(this.prev instanceof Or){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 Or?(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=Do,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 r4{constructor(e,n){Ee(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 Sh)&&(this.emitter.emit(we.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(we.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(we.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(we.events.COMPOSITION_END,e),this.isComposing=!1}}const yu=class yu{constructor(e,n){Ee(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]}};Ee(yu,"DEFAULTS",{modules:{}}),Ee(yu,"themes",{default:yu});let Pi=yu;const s4=t=>t.parentElement||t.getRootNode().host||null,a4=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}},ko=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},L1=(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,i4=(t,e)=>{var a,i,u;const n=t.ownerDocument;let r=e,s=t;for(;s;){const o=s===n.body,f=o?{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}:a4(s),h=getComputedStyle(s),g=L1(r.left,r.right,f.left,f.right,ko(h.scrollPaddingLeft),ko(h.scrollPaddingRight)),d=L1(r.top,r.bottom,f.top,f.bottom,ko(h.scrollPaddingTop),ko(h.scrollPaddingBottom));if(g||d)if(o)(u=n.defaultView)==null||u.scrollBy(g,d);else{const{scrollLeft:m,scrollTop:b}=s;d&&(s.scrollTop+=d),g&&(s.scrollLeft+=g);const _=s.scrollLeft-m,T=s.scrollTop-b;r={left:r.left-_,top:r.top-T,right:r.right-_,bottom:r.bottom-T}}s=o||h.position==="fixed"?null:s4(s)}},u4=100,o4=["block","break","cursor","inline","scroll","text"],l4=(t,e,n)=>{const r=new Di;return o4.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>u4){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},ci=Ts("quill"),Po=new Di;wr.uiClass="ql-ui";const Er=class Er{static debug(e){e===!0&&(e="log"),Ts.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return od.get(e)||Po.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"&&Po.register(n),typeof n.register=="function"&&n.register(Po)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=c4(e,n),this.container=this.options.container,this.container==null){ci.error("Invalid Quill container",e);return}this.options.debug&&Er.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",od.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new we;const s=Nh.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 e4(this.scroll),this.selection=new Zw(this.scroll,this.emitter),this.composition=new r4(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(we.events.EDITOR_CHANGE,i=>{i===we.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(we.events.SCROLL_UPDATE,(i,u)=>{const o=this.selection.lastRange,[f]=this.selection.getRange(),h=o&&f?{oldRange:o,newRange:f}:void 0;br.call(this,()=>this.editor.update(null,u,h),i)}),this.emitter.on(we.events.SCROLL_EMBED_UPDATE,(i,u)=>{const o=this.selection.lastRange,[f]=this.selection.getRange(),h=o&&f?{oldRange:o,newRange:f}:void 0;br.call(this,()=>{const g=new Oe().retain(i.offset(this)).retain({[i.statics.blotName]:u});return this.editor.update(g,[],h)},Er.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
80
- `});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]=us(e,n,r),br.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]:we.sources.API;return br.call(this,()=>{const s=this.getSelection(!0);let a=new Oe;if(s==null)return a;if(this.scroll.query(e,xe.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,we.sources.SILENT),a},r)}formatLine(e,n,r,s,a){let i;return[e,n,i,a]=us(e,n,r,s,a),br.call(this,()=>this.editor.formatLine(e,n,i),a,e,0)}formatText(e,n,r,s,a){let i;return[e,n,i,a]=us(e,n,r,s,a),br.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]=us(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]=us(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]=us(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]:Er.sources.API;return br.call(this,()=>this.editor.insertEmbed(e,n,r),s,e)}insertText(e,n,r,s,a){let i;return[e,,i,a]=us(e,0,r,s,a),br.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]=us(e,n,r),br.call(this,()=>this.editor.removeFormat(e,n),r,e)}scrollRectIntoView(e){i4(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]:we.sources.API;return br.call(this,()=>{e=new Oe(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||Er.sources.API):([e,n,,r]=us(e,n,r),this.selection.setRange(new Oa(Math.max(0,e),n),r),r!==we.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:we.sources.API;const r=new Oe().insert(e);return this.setContents(r,n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:we.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]:we.sources.API;return br.call(this,()=>(e=new Oe(e),this.editor.applyDelta(e)),n,!0)}};Ee(Er,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Po,theme:"default"}),Ee(Er,"events",we.events),Ee(Er,"sources",we.sources),Ee(Er,"version","2.0.3"),Ee(Er,"imports",{delta:Oe,parchment:jw,"core/module":Br,"core/theme":Pi});let se=Er;function O1(t){return typeof t=="string"?document.querySelector(t):t}function qc(t){return Object.entries(t??{}).reduce((e,n)=>{let[r,s]=n;return{...e,[r]:s===!0?{}:s}},{})}function x1(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function c4(t,e){const n=O1(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===se.DEFAULTS.theme?Pi:se.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=se.DEFAULTS,{modules:u,...o}=s.DEFAULTS;let f=qc(e.modules);f!=null&&f.toolbar&&f.toolbar.constructor!==Object&&(f={...f,toolbar:{container:f.toolbar}});const h=$s({},qc(a),qc(u),f),g={...i,...x1(o),...x1(e)};let d=e.registry;return d?e.formats&&ci.warn('Ignoring "formats" option because "registry" is specified'):d=e.formats?l4(e.formats,g.registry,ci):g.registry,{...g,registry:d,container:n,theme:s,modules:Object.entries(h).reduce((m,b)=>{let[_,T]=b;if(!T)return m;const v=se.import(`modules/${_}`);return v==null?(ci.error(`Cannot load ${_} module. Are you sure you registered it?`),m):{...m,[_]:$s({},v.DEFAULTS||{},T)}},{}),bounds:O1(g.bounds)}}function br(t,e,n,r){if(!this.isEnabled()&&e===we.sources.USER&&!this.allowReadOnlyEdits)return new Oe;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=R1(s,i,e):r!==0&&(s=R1(s,n,r,e)),this.setSelection(s,we.sources.SILENT)),i.length()>0){const u=[we.events.TEXT_CHANGE,i,a,e];this.emitter.emit(we.events.EDITOR_CHANGE,...u),e!==we.sources.SILENT&&this.emitter.emit(...u)}return i}function us(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||we.sources.API,[t,e,a,s]}function R1(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(u=>e.transformPosition(u,r!==we.sources.USER)):[a,i]=[t.index,t.index+t.length].map(u=>u<e||u===e&&r===we.sources.USER?u:s>=0?u+s:Math.max(e,u+s)),new Oa(a,i-a)}class Ha extends jl{}function D1(t){return t instanceof cn||t instanceof or}function k1(t){return typeof t.updateContent=="function"}class ti extends Nh{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(we.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(we.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(we.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 or||a instanceof or){this.optimize();return}const i=a.children.head instanceof Mr?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,xe.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
79
+ `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Br{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}Ee(Br,"DEFAULTS",{});const Do="\uFEFF";class Sh extends Kn{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(Do),this.rightGuard=document.createTextNode(Do),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(Do).join("");if(e===this.leftGuard)if(this.prev instanceof Or){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 Or?(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=Do,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 l4{constructor(e,n){Ee(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 Sh)&&(this.emitter.emit(we.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(we.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(we.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(we.events.COMPOSITION_END,e),this.isComposing=!1}}const yu=class yu{constructor(e,n){Ee(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]}};Ee(yu,"DEFAULTS",{modules:{}}),Ee(yu,"themes",{default:yu});let Pi=yu;const c4=t=>t.parentElement||t.getRootNode().host||null,f4=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}},ko=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},O1=(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,d4=(t,e)=>{var a,i,u;const n=t.ownerDocument;let r=e,s=t;for(;s;){const o=s===n.body,f=o?{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}:f4(s),h=getComputedStyle(s),g=O1(r.left,r.right,f.left,f.right,ko(h.scrollPaddingLeft),ko(h.scrollPaddingRight)),d=O1(r.top,r.bottom,f.top,f.bottom,ko(h.scrollPaddingTop),ko(h.scrollPaddingBottom));if(g||d)if(o)(u=n.defaultView)==null||u.scrollBy(g,d);else{const{scrollLeft:m,scrollTop:b}=s;d&&(s.scrollTop+=d),g&&(s.scrollLeft+=g);const _=s.scrollLeft-m,T=s.scrollTop-b;r={left:r.left-_,top:r.top-T,right:r.right-_,bottom:r.bottom-T}}s=o||h.position==="fixed"?null:c4(s)}},h4=100,p4=["block","break","cursor","inline","scroll","text"],m4=(t,e,n)=>{const r=new Di;return p4.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>h4){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},ci=Ts("quill"),Po=new Di;wr.uiClass="ql-ui";const Er=class Er{static debug(e){e===!0&&(e="log"),Ts.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return od.get(e)||Po.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"&&Po.register(n),typeof n.register=="function"&&n.register(Po)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=g4(e,n),this.container=this.options.container,this.container==null){ci.error("Invalid Quill container",e);return}this.options.debug&&Er.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",od.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new we;const s=Nh.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 i4(this.scroll),this.selection=new s4(this.scroll,this.emitter),this.composition=new l4(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(we.events.EDITOR_CHANGE,i=>{i===we.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(we.events.SCROLL_UPDATE,(i,u)=>{const o=this.selection.lastRange,[f]=this.selection.getRange(),h=o&&f?{oldRange:o,newRange:f}:void 0;br.call(this,()=>this.editor.update(null,u,h),i)}),this.emitter.on(we.events.SCROLL_EMBED_UPDATE,(i,u)=>{const o=this.selection.lastRange,[f]=this.selection.getRange(),h=o&&f?{oldRange:o,newRange:f}:void 0;br.call(this,()=>{const g=new Oe().retain(i.offset(this)).retain({[i.statics.blotName]:u});return this.editor.update(g,[],h)},Er.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
80
+ `});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]=us(e,n,r),br.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]:we.sources.API;return br.call(this,()=>{const s=this.getSelection(!0);let a=new Oe;if(s==null)return a;if(this.scroll.query(e,xe.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,we.sources.SILENT),a},r)}formatLine(e,n,r,s,a){let i;return[e,n,i,a]=us(e,n,r,s,a),br.call(this,()=>this.editor.formatLine(e,n,i),a,e,0)}formatText(e,n,r,s,a){let i;return[e,n,i,a]=us(e,n,r,s,a),br.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]=us(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]=us(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]=us(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]:Er.sources.API;return br.call(this,()=>this.editor.insertEmbed(e,n,r),s,e)}insertText(e,n,r,s,a){let i;return[e,,i,a]=us(e,0,r,s,a),br.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]=us(e,n,r),br.call(this,()=>this.editor.removeFormat(e,n),r,e)}scrollRectIntoView(e){d4(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]:we.sources.API;return br.call(this,()=>{e=new Oe(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||Er.sources.API):([e,n,,r]=us(e,n,r),this.selection.setRange(new Oa(Math.max(0,e),n),r),r!==we.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:we.sources.API;const r=new Oe().insert(e);return this.setContents(r,n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:we.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]:we.sources.API;return br.call(this,()=>(e=new Oe(e),this.editor.applyDelta(e)),n,!0)}};Ee(Er,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Po,theme:"default"}),Ee(Er,"events",we.events),Ee(Er,"sources",we.sources),Ee(Er,"version","2.0.3"),Ee(Er,"imports",{delta:Oe,parchment:Kw,"core/module":Br,"core/theme":Pi});let se=Er;function x1(t){return typeof t=="string"?document.querySelector(t):t}function qc(t){return Object.entries(t??{}).reduce((e,n)=>{let[r,s]=n;return{...e,[r]:s===!0?{}:s}},{})}function R1(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function g4(t,e){const n=x1(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===se.DEFAULTS.theme?Pi:se.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=se.DEFAULTS,{modules:u,...o}=s.DEFAULTS;let f=qc(e.modules);f!=null&&f.toolbar&&f.toolbar.constructor!==Object&&(f={...f,toolbar:{container:f.toolbar}});const h=$s({},qc(a),qc(u),f),g={...i,...R1(o),...R1(e)};let d=e.registry;return d?e.formats&&ci.warn('Ignoring "formats" option because "registry" is specified'):d=e.formats?m4(e.formats,g.registry,ci):g.registry,{...g,registry:d,container:n,theme:s,modules:Object.entries(h).reduce((m,b)=>{let[_,T]=b;if(!T)return m;const v=se.import(`modules/${_}`);return v==null?(ci.error(`Cannot load ${_} module. Are you sure you registered it?`),m):{...m,[_]:$s({},v.DEFAULTS||{},T)}},{}),bounds:x1(g.bounds)}}function br(t,e,n,r){if(!this.isEnabled()&&e===we.sources.USER&&!this.allowReadOnlyEdits)return new Oe;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=D1(s,i,e):r!==0&&(s=D1(s,n,r,e)),this.setSelection(s,we.sources.SILENT)),i.length()>0){const u=[we.events.TEXT_CHANGE,i,a,e];this.emitter.emit(we.events.EDITOR_CHANGE,...u),e!==we.sources.SILENT&&this.emitter.emit(...u)}return i}function us(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||we.sources.API,[t,e,a,s]}function D1(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(u=>e.transformPosition(u,r!==we.sources.USER)):[a,i]=[t.index,t.index+t.length].map(u=>u<e||u===e&&r===we.sources.USER?u:s>=0?u+s:Math.max(e,u+s)),new Oa(a,i-a)}class Ha extends jl{}function k1(t){return t instanceof cn||t instanceof or}function P1(t){return typeof t.updateContent=="function"}class ti extends Nh{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(we.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(we.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(we.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 or||a instanceof or){this.optimize();return}const i=a.children.head instanceof Mr?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,xe.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
81
81
  `)?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===xe.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 Oe().insert(`
82
82
  `))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const o=a.type==="block"&&(a.delta.length()===0||!this.descendant(or,e)[0]&&e<this.length()),f=a.type==="block"?a.delta:new Oe().insert({[a.key]:a.value});jc(this,e,f);const h=a.type==="block"?1:0,g=e+f.length()+h;o&&this.insertAt(g-1,`
83
- `);const d=ar(this.line(e)[0]),m=lr.AttributeMap.diff(d,a.attributes)||{};Object.keys(m).forEach(b=>{this.formatAt(g-1,1,b,m[b])}),e=g}let[i,u]=this.children.find(e);if(r.length&&(i&&(i=i.split(u),u=0),r.forEach(o=>{if(o.type==="block"){const f=this.createBlock(o.attributes,i||void 0);jc(f,0,o.delta)}else{const f=this.create(o.key,o.value);this.insertBefore(f,i||void 0),Object.keys(o.attributes).forEach(h=>{f.format(h,o.attributes[h])})}})),s.type==="block"&&s.delta.length()){const o=i?i.offset(i.scroll)+u:this.length();jc(this,o,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 _n?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(D1,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 u=[],o=i;return s.children.forEachAt(a,i,(f,h,g)=>{D1(f)?u.push(f):f instanceof jl&&(u=u.concat(r(f,h,o))),o-=g}),u};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(we.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=we.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&&!k1(a)}),e.length>0&&this.emitter.emit(we.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(we.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof or,e);s&&s.statics.blotName===n&&k1(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const n=[];let r=new Oe;return e.forEach(s=>{const a=s==null?void 0:s.insert;if(a)if(typeof a=="string"){const i=a.split(`
84
- `);i.slice(0,-1).forEach(o=>{r.insert(o,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new Oe});const u=i[i.length-1];u&&r.insert(u,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,xe.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new Oe,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(u=>{let[o,f]=u;this.query(o,xe.BLOCK&xe.BLOT)!=null?r=o:s[o]=f});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(u=>{let[o,f]=u;a.formatAt(0,i,o,f)}),a}}Ee(ti,"blotName","scroll"),Ee(ti,"className","ql-editor"),Ee(ti,"tagName","DIV"),Ee(ti,"defaultChild",cn),Ee(ti,"allowedChildren",[cn,or,Ha]);function jc(t,e,n){n.reduce((r,s)=>{const a=lr.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const u=s.insert;t.insertAt(r,u);const[o]=t.descendant(_n,r),f=ar(o);i=lr.AttributeMap.diff(f,i)||{}}else if(typeof s.insert=="object"){const u=Object.keys(s.insert)[0];if(u==null)return r;if(t.insertAt(r,u,s.insert[u]),t.scroll.query(u,xe.INLINE)!=null){const[f]=t.descendant(_n,r),h=ar(f);i=lr.AttributeMap.diff(h,i)||{}}}}return Object.keys(i).forEach(u=>{t.formatAt(r,a,u,i[u])}),r+a},e)}const Ih={scope:xe.BLOCK,whitelist:["right","center","justify"]},f4=new es("align","align",Ih),db=new Pr("align","ql-align",Ih),hb=new Zs("align","text-align",Ih);class pb extends Zs{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 d4=new Pr("color","ql-color",{scope:xe.INLINE}),Ch=new pb("color","color",{scope:xe.INLINE}),h4=new Pr("background","ql-bg",{scope:xe.INLINE}),wh=new pb("background","background-color",{scope:xe.INLINE});class qa extends Ha{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(`
83
+ `);const d=ar(this.line(e)[0]),m=lr.AttributeMap.diff(d,a.attributes)||{};Object.keys(m).forEach(b=>{this.formatAt(g-1,1,b,m[b])}),e=g}let[i,u]=this.children.find(e);if(r.length&&(i&&(i=i.split(u),u=0),r.forEach(o=>{if(o.type==="block"){const f=this.createBlock(o.attributes,i||void 0);jc(f,0,o.delta)}else{const f=this.create(o.key,o.value);this.insertBefore(f,i||void 0),Object.keys(o.attributes).forEach(h=>{f.format(h,o.attributes[h])})}})),s.type==="block"&&s.delta.length()){const o=i?i.offset(i.scroll)+u:this.length();jc(this,o,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 _n?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(k1,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 u=[],o=i;return s.children.forEachAt(a,i,(f,h,g)=>{k1(f)?u.push(f):f instanceof jl&&(u=u.concat(r(f,h,o))),o-=g}),u};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(we.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=we.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&&!P1(a)}),e.length>0&&this.emitter.emit(we.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(we.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof or,e);s&&s.statics.blotName===n&&P1(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const n=[];let r=new Oe;return e.forEach(s=>{const a=s==null?void 0:s.insert;if(a)if(typeof a=="string"){const i=a.split(`
84
+ `);i.slice(0,-1).forEach(o=>{r.insert(o,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new Oe});const u=i[i.length-1];u&&r.insert(u,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,xe.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new Oe,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(u=>{let[o,f]=u;this.query(o,xe.BLOCK&xe.BLOT)!=null?r=o:s[o]=f});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(u=>{let[o,f]=u;a.formatAt(0,i,o,f)}),a}}Ee(ti,"blotName","scroll"),Ee(ti,"className","ql-editor"),Ee(ti,"tagName","DIV"),Ee(ti,"defaultChild",cn),Ee(ti,"allowedChildren",[cn,or,Ha]);function jc(t,e,n){n.reduce((r,s)=>{const a=lr.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const u=s.insert;t.insertAt(r,u);const[o]=t.descendant(_n,r),f=ar(o);i=lr.AttributeMap.diff(f,i)||{}}else if(typeof s.insert=="object"){const u=Object.keys(s.insert)[0];if(u==null)return r;if(t.insertAt(r,u,s.insert[u]),t.scroll.query(u,xe.INLINE)!=null){const[f]=t.descendant(_n,r),h=ar(f);i=lr.AttributeMap.diff(h,i)||{}}}}return Object.keys(i).forEach(u=>{t.formatAt(r,a,u,i[u])}),r+a},e)}const Ih={scope:xe.BLOCK,whitelist:["right","center","justify"]},b4=new es("align","align",Ih),bb=new Pr("align","ql-align",Ih),vb=new Zs("align","text-align",Ih);class Eb extends Zs{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 v4=new Pr("color","ql-color",{scope:xe.INLINE}),Ch=new Eb("color","color",{scope:xe.INLINE}),E4=new Pr("background","ql-bg",{scope:xe.INLINE}),wh=new Eb("background","background-color",{scope:xe.INLINE});class qa extends Ha{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(`
85
85
  `).slice(e,e+n)}html(e,n){return`<pre>
86
86
  ${$l(this.code(e,n))}
87
- </pre>`}}class An extends cn{static register(){se.register(qa)}}Ee(An,"TAB"," ");class Lh extends ts{}Lh.blotName="code";Lh.tagName="CODE";An.blotName="code-block";An.className="ql-code-block";An.tagName="DIV";qa.blotName="code-block-container";qa.className="ql-code-block-container";qa.tagName="DIV";qa.allowedChildren=[An];An.allowedChildren=[Or,Mr,ki];An.requiredContainer=qa;const Oh={scope:xe.BLOCK,whitelist:["rtl"]},mb=new es("direction","dir",Oh),gb=new Pr("direction","ql-direction",Oh),bb=new Zs("direction","direction",Oh),vb={scope:xe.INLINE,whitelist:["serif","monospace"]},Eb=new Pr("font","ql-font",vb);class p4 extends Zs{value(e){return super.value(e).replace(/["']/g,"")}}const Tb=new p4("font","font-family",vb),_b=new Pr("size","ql-size",{scope:xe.INLINE,whitelist:["small","large","huge"]}),Ab=new Zs("size","font-size",{scope:xe.INLINE,whitelist:["10px","18px","32px"]}),m4=Ts("quill:keyboard"),g4=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Yl extends Br{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=v4(e);if(s==null){m4.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 u={...s,key:i,...n,...r};this.bindings[u.key]=this.bindings[u.key]||[],this.bindings[u.key].push(u)})}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(v=>Yl.match(e,v));if(s.length===0)return;const a=se.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[u,o]=this.quill.getLine(i.index),[f,h]=this.quill.getLeaf(i.index),[g,d]=i.length===0?[f,h]:this.quill.getLeaf(i.index+i.length),m=f instanceof bl?f.value().slice(0,h):"",b=g instanceof bl?g.value().slice(d):"",_={collapsed:i.length===0,empty:i.length===0&&u.length()<=1,format:this.quill.getFormat(i),line:u,offset:o,prefix:m,suffix:b,event:e};s.some(v=>{if(v.collapsed!=null&&v.collapsed!==_.collapsed||v.empty!=null&&v.empty!==_.empty||v.offset!=null&&v.offset!==_.offset)return!1;if(Array.isArray(v.format)){if(v.format.every(O=>_.format[O]==null))return!1}else if(typeof v.format=="object"&&!Object.keys(v.format).every(O=>v.format[O]===!0?_.format[O]!=null:v.format[O]===!1?_.format[O]==null:Ah(v.format[O],_.format[O])))return!1;return v.prefix!=null&&!v.prefix.test(_.prefix)||v.suffix!=null&&!v.suffix.test(_.suffix)?!1:v.handler.call(this,i,_,v)!==!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 Oe().retain(e.index-r).delete(r);if(n.offset===0){const[u]=this.quill.getLine(e.index-1);if(u&&!(u.statics.blotName==="block"&&u.length()<=1)){const f=a.formats(),h=this.quill.getFormat(e.index-1,1);if(s=lr.AttributeMap.diff(f,h)||{},Object.keys(s).length>0){const g=new Oe().retain(e.index+a.length()-2).retain(1,s);i=i.compose(g)}}}this.quill.updateContents(i,se.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 Oe().retain(e.index).delete(r);if(n.offset>=a.length()-1){const[u]=this.quill.getLine(e.index+1);if(u){const o=a.formats(),f=this.quill.getFormat(e.index,1);s=lr.AttributeMap.diff(o,f)||{},Object.keys(s).length>0&&(i=i.retain(u.length()-1).retain(1,s))}}this.quill.updateContents(i,se.sources.USER),this.quill.focus()}handleDeleteRange(e){xh({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,xe.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new Oe().retain(e.index).delete(e.length).insert(`
88
- `,r);this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(e.index+1,se.sources.SILENT),this.quill.focus()}}const b4={bindings:{bold:$c("bold"),italic:$c("italic"),underline:$c("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",se.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",se.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",se.sources.USER):e.format.list!=null&&this.quill.format("list",!1,se.sources.USER)}},"indent code-block":P1(!0),"outdent code-block":P1(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,se.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=new Oe().retain(t.index).delete(t.length).insert(" ");return this.quill.updateContents(n,se.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,se.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,se.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,se.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 Oe().retain(t.index).insert(`
87
+ </pre>`}}class An extends cn{static register(){se.register(qa)}}Ee(An,"TAB"," ");class Lh extends ts{}Lh.blotName="code";Lh.tagName="CODE";An.blotName="code-block";An.className="ql-code-block";An.tagName="DIV";qa.blotName="code-block-container";qa.className="ql-code-block-container";qa.tagName="DIV";qa.allowedChildren=[An];An.allowedChildren=[Or,Mr,ki];An.requiredContainer=qa;const Oh={scope:xe.BLOCK,whitelist:["rtl"]},Tb=new es("direction","dir",Oh),_b=new Pr("direction","ql-direction",Oh),Ab=new Zs("direction","direction",Oh),yb={scope:xe.INLINE,whitelist:["serif","monospace"]},Nb=new Pr("font","ql-font",yb);class T4 extends Zs{value(e){return super.value(e).replace(/["']/g,"")}}const Sb=new T4("font","font-family",yb),Ib=new Pr("size","ql-size",{scope:xe.INLINE,whitelist:["small","large","huge"]}),Cb=new Zs("size","font-size",{scope:xe.INLINE,whitelist:["10px","18px","32px"]}),_4=Ts("quill:keyboard"),A4=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Yl extends Br{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=N4(e);if(s==null){_4.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 u={...s,key:i,...n,...r};this.bindings[u.key]=this.bindings[u.key]||[],this.bindings[u.key].push(u)})}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(v=>Yl.match(e,v));if(s.length===0)return;const a=se.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[u,o]=this.quill.getLine(i.index),[f,h]=this.quill.getLeaf(i.index),[g,d]=i.length===0?[f,h]:this.quill.getLeaf(i.index+i.length),m=f instanceof bl?f.value().slice(0,h):"",b=g instanceof bl?g.value().slice(d):"",_={collapsed:i.length===0,empty:i.length===0&&u.length()<=1,format:this.quill.getFormat(i),line:u,offset:o,prefix:m,suffix:b,event:e};s.some(v=>{if(v.collapsed!=null&&v.collapsed!==_.collapsed||v.empty!=null&&v.empty!==_.empty||v.offset!=null&&v.offset!==_.offset)return!1;if(Array.isArray(v.format)){if(v.format.every(O=>_.format[O]==null))return!1}else if(typeof v.format=="object"&&!Object.keys(v.format).every(O=>v.format[O]===!0?_.format[O]!=null:v.format[O]===!1?_.format[O]==null:Ah(v.format[O],_.format[O])))return!1;return v.prefix!=null&&!v.prefix.test(_.prefix)||v.suffix!=null&&!v.suffix.test(_.suffix)?!1:v.handler.call(this,i,_,v)!==!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 Oe().retain(e.index-r).delete(r);if(n.offset===0){const[u]=this.quill.getLine(e.index-1);if(u&&!(u.statics.blotName==="block"&&u.length()<=1)){const f=a.formats(),h=this.quill.getFormat(e.index-1,1);if(s=lr.AttributeMap.diff(f,h)||{},Object.keys(s).length>0){const g=new Oe().retain(e.index+a.length()-2).retain(1,s);i=i.compose(g)}}}this.quill.updateContents(i,se.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 Oe().retain(e.index).delete(r);if(n.offset>=a.length()-1){const[u]=this.quill.getLine(e.index+1);if(u){const o=a.formats(),f=this.quill.getFormat(e.index,1);s=lr.AttributeMap.diff(o,f)||{},Object.keys(s).length>0&&(i=i.retain(u.length()-1).retain(1,s))}}this.quill.updateContents(i,se.sources.USER),this.quill.focus()}handleDeleteRange(e){xh({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,xe.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new Oe().retain(e.index).delete(e.length).insert(`
88
+ `,r);this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(e.index+1,se.sources.SILENT),this.quill.focus()}}const y4={bindings:{bold:$c("bold"),italic:$c("italic"),underline:$c("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",se.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",se.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",se.sources.USER):e.format.list!=null&&this.quill.format("list",!1,se.sources.USER)}},"indent code-block":M1(!0),"outdent code-block":M1(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,se.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=new Oe().retain(t.index).delete(t.length).insert(" ");return this.quill.updateContents(n,se.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,se.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,se.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,se.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 Oe().retain(t.index).insert(`
89
89
  `,r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(t.index+1,se.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 Oe().retain(t.index).insert(`
90
- `,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(t.index+1,se.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=E4(n,r,s,a);if(i==null)return;let u=n.offset();if(i<0){const o=new Oe().retain(u).insert(`
90
+ `,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(t.index+1,se.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=S4(n,r,s,a);if(i==null)return;let u=n.offset();if(i<0){const o=new Oe().retain(u).insert(`
91
91
  `);this.quill.updateContents(o,se.sources.USER),this.quill.setSelection(t.index+1,t.length,se.sources.SILENT)}else if(i>0){u+=n.length();const o=new Oe().retain(u).insert(`
92
- `);this.quill.updateContents(o,se.sources.USER),this.quill.setSelection(u,se.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,se.sources.USER):this.quill.setSelection(s+r.length(),se.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," ",se.sources.USER),this.quill.history.cutoff();const i=new Oe().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,se.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,se.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 Oe().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,se.sources.USER),this.quill.setSelection(t.index-1,se.sources.SILENT),!1}return!0}},"embed left":Mo("ArrowLeft",!1),"embed left shift":Mo("ArrowLeft",!0),"embed right":Mo("ArrowRight",!1),"embed right shift":Mo("ArrowRight",!0),"table down":M1(!1),"table up":M1(!0)}};Yl.DEFAULTS=b4;function P1(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,se.sources.USER),this.quill.setSelection(e.index+a.length,se.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:u,length:o}=e;i.forEach((f,h)=>{t?(f.insertAt(0,a),h===0?u+=a.length:o+=a.length):f.domNode.textContent.startsWith(a)&&(f.deleteAt(0,a.length),h===0?u-=a.length:o-=a.length)}),this.quill.update(se.sources.USER),this.quill.setSelection(u,o,se.sources.SILENT)}}}function Mo(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 Kn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,se.sources.USER):this.quill.setSelection(r.index-1,se.sources.USER):e?this.quill.setSelection(r.index,r.length+1,se.sources.USER):this.quill.setSelection(r.index+r.length+1,se.sources.USER),!1):!0}}}function $c(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],se.sources.USER)}}}function M1(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,u=s;for(;u.prev!=null;)u=u.prev,i=i.next;const o=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(o,0,se.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,se.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,se.sources.USER))}return!1}}}function v4(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=oi(t);else return null;return t.shortKey&&(t[g4]=t.shortKey,delete t.shortKey),t}function xh(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=lr.AttributeMap.diff(i,a)||{}}e.deleteText(n,se.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,se.sources.USER),e.setSelection(n.index,se.sources.SILENT)}function E4(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 T4=/font-weight:\s*normal/,_4=["P","OL","UL"],B1=t=>t&&_4.includes(t.tagName),A4=t=>{Array.from(t.querySelectorAll("br")).filter(e=>B1(e.previousElementSibling)&&B1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},y4=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(T4)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function N4(t){t.querySelector('[id^="docs-internal-guid-"]')&&(y4(t),A4(t))}const S4=/\bmso-list:[^;]*ignore/i,I4=/\bmso-list:[^;]*\bl(\d+)/i,C4=/\bmso-list:[^;]*\blevel(\d+)/i,w4=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(I4);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(C4),i=a?Number(a[1]):1,u=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),o=e.match(u),f=o&&o[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:f,element:t}},L4=t=>{var i,u;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(o=>{(o.getAttribute("style")||"").match(S4)?n.push(o):r.push(o)}),n.forEach(o=>{var f;return(f=o.parentNode)==null?void 0:f.removeChild(o)});const s=t.documentElement.innerHTML,a=r.map(o=>w4(o,s)).filter(o=>o);for(;a.length;){const o=[];let f=a.shift();for(;f;)o.push(f),f=a.length&&((i=a[0])==null?void 0:i.element)===f.element.nextElementSibling&&a[0].id===f.id?a.shift():null;const h=document.createElement("ul");o.forEach(m=>{const b=document.createElement("li");b.setAttribute("data-list",m.type),m.indent>1&&b.setAttribute("class",`ql-indent-${m.indent-1}`),b.innerHTML=m.element.innerHTML,h.appendChild(b)});const g=(u=o[0])==null?void 0:u.element,{parentNode:d}=g??{};g&&(d==null||d.replaceChild(h,g)),o.slice(1).forEach(m=>{let{element:b}=m;d==null||d.removeChild(b)})}};function O4(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&L4(t)}const x4=[O4,N4],R4=t=>{t.documentElement&&x4.forEach(e=>{e(t)})},D4=Ts("quill:clipboard"),k4=[[Node.TEXT_NODE,W4],[Node.TEXT_NODE,U1],["br",U4],[Node.ELEMENT_NODE,U1],[Node.ELEMENT_NODE,F4],[Node.ELEMENT_NODE,B4],[Node.ELEMENT_NODE,Y4],["li",j4],["ol, ul",$4],["pre",H4],["tr",z4],["b",Yc("bold")],["i",Yc("italic")],["strike",Yc("strike")],["style",q4]],P4=[f4,mb].reduce((t,e)=>(t[e.keyName]=e,t),{}),F1=[hb,wh,Ch,bb,Tb,Ab].reduce((t,e)=>(t[e.keyName]=e,t),{});class yb extends Br{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=[],k4.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[An.blotName])return new Oe().insert(r||"",{[An.blotName]:s[An.blotName]});if(!n)return new Oe().insert(r||"",s);const a=this.convertHTML(n);return so(a,`
93
- `)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new Oe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){R4(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 Rh(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:se.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,se.sources.SILENT)}else{const s=this.convert({html:n,text:""});this.quill.updateContents(new Oe().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),se.sources.SILENT)}}onCaptureCopy(e){var i,u;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),(u=e.clipboardData)==null||u.setData("text/html",s),n&&xh({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
94
- `)}onCapturePaste(e){var i,u,o,f,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=(u=e.clipboardData)==null?void 0:u.getData("text/plain");if(!r&&!s){const g=(o=e.clipboardData)==null?void 0:o.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((f=e.clipboardData)==null?void 0:f.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);D4.log("onPaste",i,{text:r,html:s});const u=new Oe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(u,se.sources.USER),this.quill.setSelection(u.length()-e.length,se.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,u]=a;switch(i){case Node.TEXT_NODE:s.push(u);break;case Node.ELEMENT_NODE:r.push(u);break;default:Array.from(e.querySelectorAll(i)).forEach(o=>{if(n.has(o)){const f=n.get(o);f==null||f.push(u)}else n.set(o,[u])});break}}),[r,s]}}Ee(yb,"DEFAULTS",{matchers:[]});function ja(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 Oe):t}function so(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 Bs(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof Kn?!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 M4(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Bs(t.previousElementSibling,e)&&!Bs(t.nextElementSibling,e)}const Bo=new WeakMap;function Nb(t){return t==null?!1:(Bo.has(t)||(t.tagName==="PRE"?Bo.set(t,!0):Bo.set(t,Nb(t.parentNode))),Bo.get(t))}function Rh(t,e,n,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,i)=>i(e,a,t),new Oe):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,i)=>{let u=Rh(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(u=n.reduce((o,f)=>f(i,o,t),u),u=(s.get(i)||[]).reduce((o,f)=>f(i,o,t),u)),a.concat(u)},new Oe):new Oe}function Yc(t){return(e,n,r)=>ja(n,t,!0,r)}function B4(t,e,n){const r=es.keys(t),s=Pr.keys(t),a=Zs.keys(t),i={};return r.concat(s).concat(a).forEach(u=>{let o=n.query(u,xe.ATTRIBUTE);o!=null&&(i[o.attrName]=o.value(t),i[o.attrName])||(o=P4[u],o!=null&&(o.attrName===u||o.keyName===u)&&(i[o.attrName]=o.value(t)||void 0),o=F1[u],o!=null&&(o.attrName===u||o.keyName===u)&&(o=F1[u],i[o.attrName]=o.value(t)||void 0))}),Object.entries(i).reduce((u,o)=>{let[f,h]=o;return ja(u,f,h,n)},e)}function F4(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Kn){const s={},a=r.value(t);if(a!=null)return s[r.blotName]=a,new Oe().insert(s,r.formats(t,n))}else if(r.prototype instanceof Pu&&!so(e,`
92
+ `);this.quill.updateContents(o,se.sources.USER),this.quill.setSelection(u,se.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,se.sources.USER):this.quill.setSelection(s+r.length(),se.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," ",se.sources.USER),this.quill.history.cutoff();const i=new Oe().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,se.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,se.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 Oe().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,se.sources.USER),this.quill.setSelection(t.index-1,se.sources.SILENT),!1}return!0}},"embed left":Mo("ArrowLeft",!1),"embed left shift":Mo("ArrowLeft",!0),"embed right":Mo("ArrowRight",!1),"embed right shift":Mo("ArrowRight",!0),"table down":B1(!1),"table up":B1(!0)}};Yl.DEFAULTS=y4;function M1(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,se.sources.USER),this.quill.setSelection(e.index+a.length,se.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:u,length:o}=e;i.forEach((f,h)=>{t?(f.insertAt(0,a),h===0?u+=a.length:o+=a.length):f.domNode.textContent.startsWith(a)&&(f.deleteAt(0,a.length),h===0?u-=a.length:o-=a.length)}),this.quill.update(se.sources.USER),this.quill.setSelection(u,o,se.sources.SILENT)}}}function Mo(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 Kn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,se.sources.USER):this.quill.setSelection(r.index-1,se.sources.USER):e?this.quill.setSelection(r.index,r.length+1,se.sources.USER):this.quill.setSelection(r.index+r.length+1,se.sources.USER),!1):!0}}}function $c(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],se.sources.USER)}}}function B1(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,u=s;for(;u.prev!=null;)u=u.prev,i=i.next;const o=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(o,0,se.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,se.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,se.sources.USER))}return!1}}}function N4(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=oi(t);else return null;return t.shortKey&&(t[A4]=t.shortKey,delete t.shortKey),t}function xh(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=lr.AttributeMap.diff(i,a)||{}}e.deleteText(n,se.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,se.sources.USER),e.setSelection(n.index,se.sources.SILENT)}function S4(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 I4=/font-weight:\s*normal/,C4=["P","OL","UL"],F1=t=>t&&C4.includes(t.tagName),w4=t=>{Array.from(t.querySelectorAll("br")).filter(e=>F1(e.previousElementSibling)&&F1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},L4=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(I4)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function O4(t){t.querySelector('[id^="docs-internal-guid-"]')&&(L4(t),w4(t))}const x4=/\bmso-list:[^;]*ignore/i,R4=/\bmso-list:[^;]*\bl(\d+)/i,D4=/\bmso-list:[^;]*\blevel(\d+)/i,k4=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(R4);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(D4),i=a?Number(a[1]):1,u=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),o=e.match(u),f=o&&o[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:f,element:t}},P4=t=>{var i,u;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(o=>{(o.getAttribute("style")||"").match(x4)?n.push(o):r.push(o)}),n.forEach(o=>{var f;return(f=o.parentNode)==null?void 0:f.removeChild(o)});const s=t.documentElement.innerHTML,a=r.map(o=>k4(o,s)).filter(o=>o);for(;a.length;){const o=[];let f=a.shift();for(;f;)o.push(f),f=a.length&&((i=a[0])==null?void 0:i.element)===f.element.nextElementSibling&&a[0].id===f.id?a.shift():null;const h=document.createElement("ul");o.forEach(m=>{const b=document.createElement("li");b.setAttribute("data-list",m.type),m.indent>1&&b.setAttribute("class",`ql-indent-${m.indent-1}`),b.innerHTML=m.element.innerHTML,h.appendChild(b)});const g=(u=o[0])==null?void 0:u.element,{parentNode:d}=g??{};g&&(d==null||d.replaceChild(h,g)),o.slice(1).forEach(m=>{let{element:b}=m;d==null||d.removeChild(b)})}};function M4(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&P4(t)}const B4=[M4,O4],F4=t=>{t.documentElement&&B4.forEach(e=>{e(t)})},U4=Ts("quill:clipboard"),H4=[[Node.TEXT_NODE,Z4],[Node.TEXT_NODE,H1],["br",z4],[Node.ELEMENT_NODE,H1],[Node.ELEMENT_NODE,Y4],[Node.ELEMENT_NODE,$4],[Node.ELEMENT_NODE,X4],["li",K4],["ol, ul",V4],["pre",W4],["tr",Q4],["b",Yc("bold")],["i",Yc("italic")],["strike",Yc("strike")],["style",G4]],q4=[b4,Tb].reduce((t,e)=>(t[e.keyName]=e,t),{}),U1=[vb,wh,Ch,Ab,Sb,Cb].reduce((t,e)=>(t[e.keyName]=e,t),{});class wb extends Br{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=[],H4.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[An.blotName])return new Oe().insert(r||"",{[An.blotName]:s[An.blotName]});if(!n)return new Oe().insert(r||"",s);const a=this.convertHTML(n);return so(a,`
93
+ `)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new Oe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){F4(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 Rh(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:se.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,se.sources.SILENT)}else{const s=this.convert({html:n,text:""});this.quill.updateContents(new Oe().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),se.sources.SILENT)}}onCaptureCopy(e){var i,u;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),(u=e.clipboardData)==null||u.setData("text/html",s),n&&xh({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
94
+ `)}onCapturePaste(e){var i,u,o,f,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=(u=e.clipboardData)==null?void 0:u.getData("text/plain");if(!r&&!s){const g=(o=e.clipboardData)==null?void 0:o.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((f=e.clipboardData)==null?void 0:f.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);U4.log("onPaste",i,{text:r,html:s});const u=new Oe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(u,se.sources.USER),this.quill.setSelection(u.length()-e.length,se.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,u]=a;switch(i){case Node.TEXT_NODE:s.push(u);break;case Node.ELEMENT_NODE:r.push(u);break;default:Array.from(e.querySelectorAll(i)).forEach(o=>{if(n.has(o)){const f=n.get(o);f==null||f.push(u)}else n.set(o,[u])});break}}),[r,s]}}Ee(wb,"DEFAULTS",{matchers:[]});function ja(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 Oe):t}function so(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 Bs(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof Kn?!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 j4(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Bs(t.previousElementSibling,e)&&!Bs(t.nextElementSibling,e)}const Bo=new WeakMap;function Lb(t){return t==null?!1:(Bo.has(t)||(t.tagName==="PRE"?Bo.set(t,!0):Bo.set(t,Lb(t.parentNode))),Bo.get(t))}function Rh(t,e,n,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,i)=>i(e,a,t),new Oe):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,i)=>{let u=Rh(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(u=n.reduce((o,f)=>f(i,o,t),u),u=(s.get(i)||[]).reduce((o,f)=>f(i,o,t),u)),a.concat(u)},new Oe):new Oe}function Yc(t){return(e,n,r)=>ja(n,t,!0,r)}function $4(t,e,n){const r=es.keys(t),s=Pr.keys(t),a=Zs.keys(t),i={};return r.concat(s).concat(a).forEach(u=>{let o=n.query(u,xe.ATTRIBUTE);o!=null&&(i[o.attrName]=o.value(t),i[o.attrName])||(o=q4[u],o!=null&&(o.attrName===u||o.keyName===u)&&(i[o.attrName]=o.value(t)||void 0),o=U1[u],o!=null&&(o.attrName===u||o.keyName===u)&&(o=U1[u],i[o.attrName]=o.value(t)||void 0))}),Object.entries(i).reduce((u,o)=>{let[f,h]=o;return ja(u,f,h,n)},e)}function Y4(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Kn){const s={},a=r.value(t);if(a!=null)return s[r.blotName]=a,new Oe().insert(s,r.formats(t,n))}else if(r.prototype instanceof Pu&&!so(e,`
95
95
  `)&&e.insert(`
96
- `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return ja(e,r.blotName,r.formats(t,n),n);return e}function U4(t,e){return so(e,`
96
+ `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return ja(e,r.blotName,r.formats(t,n),n);return e}function z4(t,e){return so(e,`
97
97
  `)||e.insert(`
98
- `),e}function H4(t,e,n){const r=n.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(t,n):!0;return ja(e,"code-block",s,n)}function q4(){return new Oe}function j4(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!so(e,`
99
- `))return e;let s=-1,a=t.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(s+=1),a=a.parentNode;return s<=0?e:e.reduce((i,u)=>u.insert?u.attributes&&typeof u.attributes.indent=="number"?i.push(u):i.insert(u.insert,{indent:s,...u.attributes||{}}):i,new Oe)}function $4(t,e,n){const r=t;let s=r.tagName==="OL"?"ordered":"bullet";const a=r.getAttribute("data-checked");return a&&(s=a==="true"?"checked":"unchecked"),ja(e,"list",s,n)}function U1(t,e,n){if(!so(e,`
98
+ `),e}function W4(t,e,n){const r=n.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(t,n):!0;return ja(e,"code-block",s,n)}function G4(){return new Oe}function K4(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!so(e,`
99
+ `))return e;let s=-1,a=t.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(s+=1),a=a.parentNode;return s<=0?e:e.reduce((i,u)=>u.insert?u.attributes&&typeof u.attributes.indent=="number"?i.push(u):i.insert(u.insert,{indent:s,...u.attributes||{}}):i,new Oe)}function V4(t,e,n){const r=t;let s=r.tagName==="OL"?"ordered":"bullet";const a=r.getAttribute("data-checked");return a&&(s=a==="true"?"checked":"unchecked"),ja(e,"list",s,n)}function H1(t,e,n){if(!so(e,`
100
100
  `)){if(Bs(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert(`
101
101
  `);if(e.length()>0&&t.nextSibling){let r=t.nextSibling;for(;r!=null;){if(Bs(r,n))return e.insert(`
102
102
  `);const s=n.query(r);if(s&&s.prototype instanceof or)return e.insert(`
103
- `);r=r.firstChild}}}return e}function Y4(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,u)=>{let[o,f]=u;return ja(i,o,f,n)},e),parseFloat(s.textIndent||0)>0?new Oe().insert(" ").concat(e):e}function z4(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 u=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return ja(e,"table",u,n)}return e}function W4(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(!Nb(t)){if(r.trim().length===0&&r.includes(`
104
- `)&&!M4(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&Bs(t.parentElement,n)||t.previousSibling instanceof Element&&Bs(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&Bs(t.parentElement,n)||t.nextSibling instanceof Element&&Bs(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class Sb extends Br{constructor(n,r){super(n,r);Ee(this,"lastRecorded",0);Ee(this,"ignoreChange",!1);Ee(this,"stack",{undo:[],redo:[]});Ee(this,"currentRange",null);this.quill.on(se.events.EDITOR_CHANGE,(s,a,i,u)=>{s===se.events.SELECTION_CHANGE?a&&u!==se.sources.SILENT&&(this.currentRange=a):s===se.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||u===se.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=fd(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:fd(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,se.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 u=this.stack.undo.pop();u&&(s=s.compose(u.delta),a=u.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){H1(this.stack.undo,n),H1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,se.sources.USER);else{const r=K4(this.quill.scroll,n.delta);this.quill.setSelection(r,se.sources.USER)}}}Ee(Sb,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function H1(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&&fd(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function G4(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
105
- `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,xe.BLOCK)!=null):!1}function K4(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return G4(t,e)&&(r-=1),r}function fd(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 Ib extends Br{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 u=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(u.offsetNode,u.offset),s.setEnd(u.offsetNode,u.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const u=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(u,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)}}Ib.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 Oe().retain(t.index).delete(t.length));this.quill.updateContents(s,we.sources.USER),this.quill.setSelection(t.index+r.length,we.sources.SILENT)})}};const V4=["insertText","insertReplacementText"];class X4 extends Br{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(se.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){xh({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 Oe().retain(e.index).insert(n,r),se.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,se.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!V4.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=Q4(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 Q4(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 Z4=/Mac/i.test(navigator.platform),J4=100,eL=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||Z4&&t.key==="a"&&t.ctrlKey===!0);class tL extends Br{constructor(n,r){super(n,r);Ee(this,"isListening",!1);Ee(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 wr)||!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),se.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&eL(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+J4,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 wr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}se.register({"blots/block":cn,"blots/block/embed":or,"blots/break":Mr,"blots/container":Ha,"blots/cursor":ki,"blots/embed":Sh,"blots/inline":ts,"blots/scroll":ti,"blots/text":Or,"modules/clipboard":yb,"modules/history":Sb,"modules/keyboard":Yl,"modules/uploader":Ib,"modules/input":X4,"modules/uiNode":tL});class nL extends Pr{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 rL=new nL("indent","ql-indent",{scope:xe.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class dd extends cn{}Ee(dd,"blotName","blockquote"),Ee(dd,"tagName","blockquote");class hd extends cn{static formats(e){return this.tagName.indexOf(e.tagName)+1}}Ee(hd,"blotName","header"),Ee(hd,"tagName",["H1","H2","H3","H4","H5","H6"]);class ao extends Ha{}ao.blotName="list-container";ao.tagName="OL";class io extends cn{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(){se.register(ao)}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)}}io.blotName="list";io.tagName="LI";ao.allowedChildren=[io];io.requiredContainer=ao;class Bu extends ts{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)}}Ee(Bu,"blotName","bold"),Ee(Bu,"tagName",["STRONG","B"]);class pd extends Bu{}Ee(pd,"blotName","italic"),Ee(pd,"tagName",["EM","I"]);class Fs extends ts{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 Cb(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))}}Ee(Fs,"blotName","link"),Ee(Fs,"tagName","A"),Ee(Fs,"SANITIZED_URL","about:blank"),Ee(Fs,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Cb(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 md extends ts{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"}}Ee(md,"blotName","script"),Ee(md,"tagName",["SUB","SUP"]);class gd extends Bu{}Ee(gd,"blotName","strike"),Ee(gd,"tagName",["S","STRIKE"]);class bd extends ts{}Ee(bd,"blotName","underline"),Ee(bd,"tagName","U");class Vo extends Sh{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>`}}Ee(Vo,"blotName","formula"),Ee(Vo,"className","ql-formula"),Ee(Vo,"tagName","SPAN");const q1=["alt","height","width"];class vd extends Kn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return q1.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 Cb(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){q1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}Ee(vd,"blotName","image"),Ee(vd,"tagName","IMG");const j1=["height","width"];class Xo extends or{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 j1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Fs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){j1.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>`}}Ee(Xo,"blotName","video"),Ee(Xo,"className","ql-video"),Ee(Xo,"tagName","IFRAME");const ou=new Pr("code-token","hljs",{scope:xe.INLINE});class bs extends ts{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(An.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),ou.add(this.domNode,r)}format(e,n){e!==bs.blotName?super.format(e,n):n?ou.add(this.domNode,n):(ou.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),ou.value(this.domNode)||this.unwrap()}}bs.blotName="code-token";bs.className="ql-token";class ir extends An{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(),bs.blotName,!1),super.replaceWith(e,n)}}class _u extends qa{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===ir.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===ir.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(`
103
+ `);r=r.firstChild}}}return e}function X4(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,u)=>{let[o,f]=u;return ja(i,o,f,n)},e),parseFloat(s.textIndent||0)>0?new Oe().insert(" ").concat(e):e}function Q4(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 u=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return ja(e,"table",u,n)}return e}function Z4(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(!Lb(t)){if(r.trim().length===0&&r.includes(`
104
+ `)&&!j4(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&Bs(t.parentElement,n)||t.previousSibling instanceof Element&&Bs(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&Bs(t.parentElement,n)||t.nextSibling instanceof Element&&Bs(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class Ob extends Br{constructor(n,r){super(n,r);Ee(this,"lastRecorded",0);Ee(this,"ignoreChange",!1);Ee(this,"stack",{undo:[],redo:[]});Ee(this,"currentRange",null);this.quill.on(se.events.EDITOR_CHANGE,(s,a,i,u)=>{s===se.events.SELECTION_CHANGE?a&&u!==se.sources.SILENT&&(this.currentRange=a):s===se.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||u===se.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=fd(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:fd(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,se.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 u=this.stack.undo.pop();u&&(s=s.compose(u.delta),a=u.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){q1(this.stack.undo,n),q1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,se.sources.USER);else{const r=eL(this.quill.scroll,n.delta);this.quill.setSelection(r,se.sources.USER)}}}Ee(Ob,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function q1(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&&fd(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function J4(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
105
+ `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,xe.BLOCK)!=null):!1}function eL(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return J4(t,e)&&(r-=1),r}function fd(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 xb extends Br{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 u=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(u.offsetNode,u.offset),s.setEnd(u.offsetNode,u.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const u=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(u,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)}}xb.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 Oe().retain(t.index).delete(t.length));this.quill.updateContents(s,we.sources.USER),this.quill.setSelection(t.index+r.length,we.sources.SILENT)})}};const tL=["insertText","insertReplacementText"];class nL extends Br{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(se.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){xh({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 Oe().retain(e.index).insert(n,r),se.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,se.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!tL.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=rL(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 rL(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 sL=/Mac/i.test(navigator.platform),aL=100,iL=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||sL&&t.key==="a"&&t.ctrlKey===!0);class uL extends Br{constructor(n,r){super(n,r);Ee(this,"isListening",!1);Ee(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 wr)||!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),se.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&iL(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+aL,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 wr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}se.register({"blots/block":cn,"blots/block/embed":or,"blots/break":Mr,"blots/container":Ha,"blots/cursor":ki,"blots/embed":Sh,"blots/inline":ts,"blots/scroll":ti,"blots/text":Or,"modules/clipboard":wb,"modules/history":Ob,"modules/keyboard":Yl,"modules/uploader":xb,"modules/input":nL,"modules/uiNode":uL});class oL extends Pr{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 lL=new oL("indent","ql-indent",{scope:xe.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class dd extends cn{}Ee(dd,"blotName","blockquote"),Ee(dd,"tagName","blockquote");class hd extends cn{static formats(e){return this.tagName.indexOf(e.tagName)+1}}Ee(hd,"blotName","header"),Ee(hd,"tagName",["H1","H2","H3","H4","H5","H6"]);class ao extends Ha{}ao.blotName="list-container";ao.tagName="OL";class io extends cn{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(){se.register(ao)}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)}}io.blotName="list";io.tagName="LI";ao.allowedChildren=[io];io.requiredContainer=ao;class Bu extends ts{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)}}Ee(Bu,"blotName","bold"),Ee(Bu,"tagName",["STRONG","B"]);class pd extends Bu{}Ee(pd,"blotName","italic"),Ee(pd,"tagName",["EM","I"]);class Fs extends ts{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 Rb(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))}}Ee(Fs,"blotName","link"),Ee(Fs,"tagName","A"),Ee(Fs,"SANITIZED_URL","about:blank"),Ee(Fs,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Rb(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 md extends ts{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"}}Ee(md,"blotName","script"),Ee(md,"tagName",["SUB","SUP"]);class gd extends Bu{}Ee(gd,"blotName","strike"),Ee(gd,"tagName",["S","STRIKE"]);class bd extends ts{}Ee(bd,"blotName","underline"),Ee(bd,"tagName","U");class Vo extends Sh{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>`}}Ee(Vo,"blotName","formula"),Ee(Vo,"className","ql-formula"),Ee(Vo,"tagName","SPAN");const j1=["alt","height","width"];class vd extends Kn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return j1.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 Rb(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){j1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}Ee(vd,"blotName","image"),Ee(vd,"tagName","IMG");const $1=["height","width"];class Xo extends or{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 $1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Fs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){$1.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>`}}Ee(Xo,"blotName","video"),Ee(Xo,"className","ql-video"),Ee(Xo,"tagName","IFRAME");const ou=new Pr("code-token","hljs",{scope:xe.INLINE});class bs extends ts{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(An.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),ou.add(this.domNode,r)}format(e,n){e!==bs.blotName?super.format(e,n):n?ou.add(this.domNode,n):(ou.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),ou.value(this.domNode)||this.unwrap()}}bs.blotName="code-token";bs.className="ql-token";class ir extends An{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(),bs.blotName,!1),super.replaceWith(e,n)}}class _u extends qa{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===ir.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===ir.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(`
106
106
  `)}
107
- `,a=ir.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((o,f)=>o.concat(cb(f,!1)),new Oe),u=e(s,a);i.diff(u).reduce((o,f)=>{let{retain:h,attributes:g}=f;return h?(g&&Object.keys(g).forEach(d=>{[ir.blotName,bs.blotName].includes(d)&&this.formatAt(o,h,d,g[d])}),o+h):o},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?ir.formats(r.domNode):"plain"}">
107
+ `,a=ir.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((o,f)=>o.concat(mb(f,!1)),new Oe),u=e(s,a);i.diff(u).reduce((o,f)=>{let{retain:h,attributes:g}=f;return h?(g&&Object.keys(g).forEach(d=>{[ir.blotName,bs.blotName].includes(d)&&this.formatAt(o,h,d,g[d])}),o+h):o},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?ir.formats(r.domNode):"plain"}">
108
108
  ${$l(this.code(e,n))}
109
- </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=ir.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}_u.allowedChildren=[ir];ir.requiredContainer=_u;ir.allowedChildren=[bs,ki,Or,Mr];const sL=(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 wb extends Br{static register(){se.register(bs,!0),se.register(ir,!0),se.register(_u,!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(se.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof _u))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(ir.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=ir.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(se.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(se.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(_u):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(se.sources.SILENT),r!=null&&this.quill.setSelection(r,se.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 $l(e).split(`
109
+ </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=ir.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}_u.allowedChildren=[ir];ir.requiredContainer=_u;ir.allowedChildren=[bs,ki,Or,Mr];const cL=(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 Db extends Br{static register(){se.register(bs,!0),se.register(ir,!0),se.register(_u,!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(se.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof _u))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(ir.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=ir.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(se.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(se.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(_u):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(se.sources.SILENT),r!=null&&this.quill.setSelection(r,se.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 $l(e).split(`
110
110
  `).reduce((s,a,i)=>(i!==0&&s.insert(`
111
- `,{[An.blotName]:n}),s.insert(a)),new Oe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(An.className),r.innerHTML=sL(this.options.hljs,n,e),Rh(this.quill.scroll,r,[(s,a)=>{const i=ou.value(s);return i?a.compose(new Oe().retain(a.length(),{[bs.blotName]:i})):a}],[(s,a)=>s.data.split(`
111
+ `,{[An.blotName]:n}),s.insert(a)),new Oe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(An.className),r.innerHTML=cL(this.options.hljs,n,e),Rh(this.quill.scroll,r,[(s,a)=>{const i=ou.value(s);return i?a.compose(new Oe().retain(a.length(),{[bs.blotName]:i})):a}],[(s,a)=>s.data.split(`
112
112
  `).reduce((i,u,o)=>(o!==0&&i.insert(`
113
- `,{[An.blotName]:n}),i.insert(u)),a)],new WeakMap)}}wb.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 Nu=class Nu extends cn{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",Dh()),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===Nu.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()}};Ee(Nu,"blotName","table"),Ee(Nu,"tagName","TD");let yr=Nu;class vs extends Ha{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}}Ee(vs,"blotName","table-row"),Ee(vs,"tagName","TR");class Xr extends Ha{}Ee(Xr,"blotName","table-body"),Ee(Xr,"tagName","TBODY");class Mi extends Ha{balanceCells(){const e=this.descendants(vs),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=yr.formats(r.children.head.domNode));const a=this.scroll.create(yr.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(Xr);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(Xr);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=yr.formats(r.children.head.domNode),i=this.scroll.create(yr.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(Xr);if(n==null||n.children.head==null)return;const r=Dh(),s=this.scroll.create(vs.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(yr.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)}}Ee(Mi,"blotName","table-container"),Ee(Mi,"tagName","TABLE");Mi.allowedChildren=[Xr];Xr.requiredContainer=Mi;Xr.allowedChildren=[vs];vs.requiredContainer=Xr;vs.allowedChildren=[yr];yr.requiredContainer=vs;function Dh(){return`row-${Math.random().toString(36).slice(2,6)}`}class aL extends Br{static register(){se.register(yr),se.register(vs),se.register(Xr),se.register(Mi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Mi).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(se.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(se.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(se.sources.USER),this.quill.setSelection(n,se.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!==yr.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(se.sources.USER);let u=s.rowOffset();e===0&&(u+=1),this.quill.setSelection(n.index+u,n.length,se.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(se.sources.USER),e>0?this.quill.setSelection(n,se.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,se.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(`
114
- `).join("");return a.insert(i,{table:Dh()})},new Oe().retain(r.index));this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(r.index,se.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(se.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(se.events.TEXT_CHANGE,(r,s,a)=>{a===se.sources.USER&&this.balanceTables()}),!0):!1)})}}const $1=Ts("quill:toolbar");class kh extends Br{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),iL(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)){$1.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 u;const i=(u=this.options.handlers)==null?void 0:u[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(se.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){$1.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 u=e.options[e.selectedIndex];u.hasAttribute("selected")?a=!1:a=u.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 Kn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new Oe().retain(i.index).delete(i.length).insert({[n]:a}),se.sources.USER)}else this.quill.format(n,a,se.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 u=n[s];typeof u=="string"&&(u=u.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${u}"]`)}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],u=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",u),a.setAttribute("aria-pressed",u.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}kh.DEFAULTS={};function Y1(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 iL(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")Y1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?uL(r,a,i):Y1(r,a,i)}}),t.appendChild(r)})}function uL(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)}kh.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,xe.INLINE)!=null&&this.quill.format(n,!1,se.sources.USER)})}else this.quill.removeFormat(t.index,t.length,se.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",se.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,se.sources.USER),this.quill.format("direction",t,se.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,se.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,se.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,se.sources.USER):this.quill.format("list","unchecked",se.sources.USER):this.quill.format("list",t,se.sources.USER)}}};const oL='<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>',lL='<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>',cL='<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>',fL='<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>',dL='<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>',hL='<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>',pL='<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>',mL='<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>',z1='<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>',gL='<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>',bL='<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>',vL='<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>',EL='<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>',TL='<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>',_L='<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>',AL='<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>',yL='<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>',NL='<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>',SL='<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>',IL='<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>',CL='<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>',wL='<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>',LL='<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>',OL='<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>',xL='<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>',RL='<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>',DL='<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>',kL='<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>',PL='<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>',ML='<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>',BL='<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>',FL='<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>',UL='<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>',Fu={align:{"":oL,center:lL,right:cL,justify:fL},background:dL,blockquote:hL,bold:pL,clean:mL,code:z1,"code-block":z1,color:gL,direction:{"":bL,rtl:vL},formula:EL,header:{1:TL,2:_L,3:AL,4:yL,5:NL,6:SL},italic:IL,image:CL,indent:{"+1":wL,"-1":LL},link:OL,list:{bullet:xL,check:RL,ordered:DL},script:{sub:kL,super:PL},strike:ML,table:BL,underline:FL,video:UL},HL='<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 W1=0;function G1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class zl{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"),G1(this.label,"aria-expanded"),G1(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=HL,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-${W1}`,W1+=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 Lb extends zl{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 Ob extends zl{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 qL=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class xb{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,qL(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 u=a.bottom-a.top,o=e.bottom-e.top+u;this.root.style.top=`${r-o}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const jL=[!1,"center","right","justify"],$L=["#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"],YL=[!1,"serif","monospace"],zL=["1","2","3",!1],WL=["small",!1,"large","huge"];class uo extends Pi{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&&tu(s,jL),typeof n.align=="object"))return new Ob(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&&tu(s,$L,a==="background"?"#ffffff":"#000000"),new Lb(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?tu(s,YL):s.classList.contains("ql-header")?tu(s,zL):s.classList.contains("ql-size")&&tu(s,WL)),new zl(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(we.events.EDITOR_CHANGE,r)}}uo.DEFAULTS=$s({},Pi.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 Rb extends xb{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,we.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,we.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=GL(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,we.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",we.sources.USER),this.quill.setSelection(r+2,we.sources.USER)}break}}this.textbox.value="",this.hide()}}function GL(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 tu(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 KL=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Db extends Rb{constructor(e,n){super(e,n),this.quill.on(we.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===we.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===we.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const u=this.quill.getLines(s.index,s.length);if(u.length===1){const o=this.quill.getBounds(s);o!=null&&this.position(o)}else{const o=u[u.length-1],f=this.quill.getIndex(o),h=Math.min(o.length()-1,s.index+s.length-f),g=this.quill.getBounds(new Oa(f,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(we.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}}Ee(Db,"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 kb extends uo{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=KL),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Db(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Fu),this.buildPickers(e.container.querySelectorAll("select"),Fu))}}kb.DEFAULTS=$s({},uo.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,se.sources.USER)}}}}});const VL=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Pb extends Rb{constructor(){super(...arguments);Ee(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,we.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(we.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===we.sources.USER){const[a,i]=this.quill.scroll.descendant(Fs,n.index);if(a!=null){this.linkRange=new Oa(n.index-i,a.length());const u=Fs.formats(a.domNode);this.preview.textContent=u,this.preview.setAttribute("href",u),this.show();const o=this.quill.getBounds(this.linkRange);o!=null&&this.position(o);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}Ee(Pb,"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 Mb extends uo{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=VL),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"),Fu),this.buildPickers(e.container.querySelectorAll("select"),Fu),this.tooltip=new Pb(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)}))}}Mb.DEFAULTS=$s({},uo.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,se.sources.USER)}}}}});se.register({"attributors/attribute/direction":mb,"attributors/class/align":db,"attributors/class/background":h4,"attributors/class/color":d4,"attributors/class/direction":gb,"attributors/class/font":Eb,"attributors/class/size":_b,"attributors/style/align":hb,"attributors/style/background":wh,"attributors/style/color":Ch,"attributors/style/direction":bb,"attributors/style/font":Tb,"attributors/style/size":Ab},!0);se.register({"formats/align":db,"formats/direction":gb,"formats/indent":rL,"formats/background":wh,"formats/color":Ch,"formats/font":Eb,"formats/size":_b,"formats/blockquote":dd,"formats/code-block":An,"formats/header":hd,"formats/list":io,"formats/bold":Bu,"formats/code":Lh,"formats/italic":pd,"formats/link":Fs,"formats/script":md,"formats/strike":gd,"formats/underline":bd,"formats/formula":Vo,"formats/image":vd,"formats/video":Xo,"modules/syntax":wb,"modules/table":aL,"modules/toolbar":kh,"themes/bubble":kb,"themes/snow":Mb,"ui/icons":Fu,"ui/picker":zl,"ui/icon-picker":Ob,"ui/color-picker":Lb,"ui/tooltip":xb},!0);const K1="/api/read?path=",Bb=/src="([^"]*)"/g,XL=/&nbsp;/g;function QL(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function V1(t,e){return t.replace(Bb,(n,r)=>QL(r)?`src="${to(e,r)}"`:n)}function X1(t,e){const n=`content/${e===""?"":`${e}/`}`;return t.replace(Bb,(r,s)=>{const a=s.indexOf(K1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+K1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(XL," ")}var ZL=W('<div class="rte svelte-1afg4yo"><div></div></div>');function JL(t,e){ct(e,!0);const n=se.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"]];ka(()=>{const d=new se(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(d.root.setAttribute("aria-labelledby",e.labelledBy),d.root.setAttribute("aria-multiline","true"));const m=d.getModule("toolbar");m.addHandler("image",()=>o(d)),m.addHandler("link",()=>u(d));const b=T=>{T.preventDefault(),setTimeout(()=>i(d),0)};d.root.addEventListener("contextmenu",b),e.value&&d.clipboard.dangerouslyPasteHTML(V1(e.value,e.itemDir),"silent");const _=()=>e.onchange(X1(d.root.innerHTML,e.itemDir));return d.on("text-change",_),s=d,()=>{d.off("text-change",_),d.root.removeEventListener("contextmenu",b)}});function i(d){var T;const m=d.getSelection(!0);if(m===null)return;const b=d.theme,_=d.getBounds(m.index,m.length);((T=b.tooltip)==null?void 0:T.show)!==void 0&&b.tooltip.position!==void 0&&_&&(b.tooltip.show(),b.tooltip.position(_))}function u(d){const m=d.getSelection(!0);if(m===null)return;const b=d.getFormat(m).link??"";Lg(b).then(_=>{if(_!==null)if(_==="")d.formatText(m.index,m.length,"link",!1,"user");else if(m.length>0)d.formatText(m.index,m.length,"link",_,"user");else{const T=xu(_)?Vf(_):_;d.insertText(m.index,T,{link:_},"user")}})}function o(d){const m=document.createElement("input");m.type="file",m.accept="image/*",m.onchange=()=>{var _;const b=(_=m.files)==null?void 0:_[0];b&&f(d,b)},m.click()}async function f(d,m){try{const b=await uh(e.itemDir,m),_=d.getSelection(!0);d.insertEmbed(_.index,"image",to(e.itemDir,b),"user"),d.setSelection(_.index+1,0)}catch(b){console.error("Inline image upload failed",b)}}kt(()=>{const d=e.value;s&&X1(s.root.innerHTML,e.itemDir)!==d&&s.clipboard.dangerouslyPasteHTML(V1(d,e.itemDir),"silent")});var h=ZL(),g=I(h);dn(g,d=>r=d,()=>r),H(t,h),ft()}var eO=W('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),tO=W('<textarea rows="3"></textarea>'),nO=W('<input type="date" class="svelte-1bn65uv"/>'),rO=W('<input type="time" class="svelte-1bn65uv"/>'),sO=W('<input type="email" class="svelte-1bn65uv"/>'),aO=W('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),iO=W('<input type="text" class="svelte-1bn65uv"/>'),uO=W('<p class="hint svelte-1bn65uv"> </p>'),oO=W("<p> </p>"),lO=W('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),cO=W('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),fO=W('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),dO=W('<p class="hint svelte-1bn65uv">Loading fields…</p>'),hO=W('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),pO=W(`<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>`),mO=W("<!> <!>",1),gO=W('<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),bO=W('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles"><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 vO(t,e){ct(e,!0);const n=ur(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=ee(!1);const i=()=>new Date().toISOString().slice(0,10);function u(){y(a,!c(a)),c(a)&&(c(v).published??"").trim()===""&&(c(v).published=i()),x()}let o=ee(!1),f=ee(Tt([]));function h(){y(o,!0),e.onmove&&Ff().then(Te=>y(f,Te,!0))}async function g(Te){var Me;Te!==e.templateName&&(await Y(),(Me=e.onchangetemplate)==null||Me.call(e,Te))}const d=Ae(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),m=new Set(["richtext","image","file","authors"]);function b(Te){return m.has(Te.type)?void 0:`f-${Te.name}`}let _=ee(Tt([])),T=ee(!0),v=ee(Tt({})),O=ee(null);const L=700;let B,C=!1;ka(()=>{q();const Te=()=>void Y();return window.addEventListener("beforeunload",Te),()=>{window.removeEventListener("beforeunload",Te),Y()}});async function q(){y(T,!0);const[Te,Me]=await Promise.all([gy(e.templateName),vy()]),Ve=Te.filter(bt=>bt.name!=="title"&&bt.name!=="published"),Ye=new Set(Ve.map(bt=>bt.name)),le=Me.filter(bt=>bt.name!=="published"&&!Ye.has(bt.name)),Rt=[r,s,...Ve,...le],Mt={};for(const bt of Rt)Mt[bt.name]=$y(e.item,bt.name);Mt.published=(Mt.published??"").slice(0,10),y(a,e.item.isPublished,!0),y(_,Rt,!0),y(F,Ve,!0),y(M,le,!0),y(v,Mt,!0),cN(localStorage,e.path,Mt),y(O,fN(localStorage,e.path),!0),y(T,!1)}function x(){C=!0,clearTimeout(B),B=setTimeout(()=>void Y(),L)}function j(Te,Me){const Ve=c(v)[Te]??"";c(v)[Te]=Me,x(),Ve!==""&&Ve!==Me&&Z(Ve)}async function Z(Te){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Te))return;Object.values(c(v)).some(Ve=>typeof Ve=="string"&&Ve.includes(Te))||await Sy(c(d),Te)}async function Y(){var Me;if(clearTimeout(B),!C)return;const Te=Y0(e.item,c(_),c(v),c(a));ws.saving();try{await gg(e.path,Te),C=!1,ws.saved(),(Me=e.onsaved)==null||Me.call(e,e.path,c(v).title??e.item.title,c(a))}catch{ws.failed(()=>void Y())}}async function E(){c(O)===null||!await hl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(y(v,{...c(O)},!0),x())}const k=new Set(["text","code"]);function S(Te,Me){return Te.maxLength!==void 0&&Te.minLength!==void 0?`${Me} / ${Te.maxLength} characters (min ${Te.minLength})`:Te.maxLength!==void 0?`${Me} / ${Te.maxLength} characters`:`${Me} characters (min ${Te.minLength})`}function U(Te,Me){return Te.minLength!==void 0&&Me>0&&Me<Te.minLength?!0:Te.maxLength!==void 0&&Me>Te.maxLength}let F=ee(Tt([])),M=ee(Tt([]));const Q=Ae(()=>c(O)!==null&&JSON.stringify(c(v))!==JSON.stringify(c(O))),z="nanoesis:preview-open";let $=ee(localStorage.getItem(z)==="true");function X(Te){y($,Te,!0),localStorage.setItem(z,String(Te))}const J=Ae(()=>{if(c(T))return null;try{return{...Zu(JSON.parse(Y0(e.item,c(_),c(v),c(a)))),template:e.templateName}}catch{return null}}),ne="nanoesis:preview-split",ge=.2,be=.8;function pe(Te){return Math.min(be,Math.max(ge,Te))}function Se(){const Te=Number(localStorage.getItem(ne));return Number.isFinite(Te)&&Te>0?pe(Te):.5}let ie=ee(Tt(Se())),he=ee(!1),Ce;function Ne(Te){Te.preventDefault(),y(he,!0),Te.currentTarget.setPointerCapture(Te.pointerId)}function Ie(Te){if(!c(he))return;const Me=Ce.getBoundingClientRect();y(ie,pe((Te.clientX-Me.left)/Me.width),!0)}function Le(Te){var Me,Ve;c(he)&&(y(he,!1),(Ve=(Me=Te.currentTarget).releasePointerCapture)==null||Ve.call(Me,Te.pointerId),localStorage.setItem(ne,String(c(ie))))}function Re(Te){const Me=Te.key==="ArrowLeft"?-.02:Te.key==="ArrowRight"?.02:0;Me!==0&&(Te.preventDefault(),y(ie,pe(c(ie)+Me),!0),localStorage.setItem(ne,String(c(ie))))}var $e=bO(),We=pt($e);let rn;var Ge=I(We),$t=I(Ge);{const Te=(Ye,le=Ad)=>{var Rt=lO(),Mt=I(Rt),bt=I(Mt),gn=R(bt);{var jn=ye=>{var _e=eO();H(ye,_e)};de(gn,ye=>{le().required&&ye(jn)})}var rs=R(gn,2),Xn=I(rs),Qn=R(Mt,2);{var Bt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);JL(ye,{get value(){return c(_e)},get itemDir(){return c(d)},get labelledBy(){return c(qe)},placeholder:"Write…",onchange:vt=>{c(v)[le().name]=vt,x()}})}},Js=ye=>{var _e=tO();let qe;ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength),qe=it(_e,1,"svelte-1bn65uv",null,qe,{mono:le().type==="code"})}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],vt=>c(v)[le().name]=vt),H(ye,_e)},ea=Ae(()=>k.has(le().type)),ta=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);BN(ye,{get value(){return c(_e)},get itemDir(){return c(d)},get labelledBy(){return c(qe)},onchange:vt=>j(le().name,vt)})}},tt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);RN(ye,{get value(){return c(_e)},get itemDir(){return c(d)},get labelledBy(){return c(qe)},onchange:vt=>{c(v)[le().name]=vt,x()}})}},wt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);yN(ye,{get value(){return c(_e)},get labelledBy(){return c(qe)},onchange:vt=>{c(v)[le().name]=vt,x()}})}},nt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);t6(ye,{get value(){return c(_e)},get labelledBy(){return c(qe)},onchange:vt=>{c(v)[le().name]=vt,x()}})}},Sn=ye=>{var _e=nO();ue(()=>me(_e,"id",`f-${le().name}`)),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},bn=ye=>{var _e=rO();ue(()=>me(_e,"id",`f-${le().name}`)),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},Ft=ye=>{var _e=sO();ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength)}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},Wt=ye=>{var _e=aO();ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength)}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},Gt=ye=>{var _e=iO();ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength)}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)};de(Qn,ye=>{le().type==="richtext"?ye(Bt):c(ea)?ye(Js,1):le().type==="image"?ye(ta,2):le().type==="file"?ye(tt,3):le().type==="authors"?ye(wt,4):le().type==="url"?ye(nt,5):le().type==="date"?ye(Sn,6):le().type==="time"?ye(bn,7):le().type==="email"?ye(Ft,8):le().type==="phone"?ye(Wt,9):ye(Gt,-1)})}var rt=R(Qn,2);{var Rn=ye=>{var _e=uO(),qe=I(_e);ue(()=>fe(qe,le().help)),H(ye,_e)};de(rt,ye=>{le().help&&ye(Rn)})}var yt=R(rt,2);{var Zt=ye=>{const _e=Ae(()=>(c(v)[le().name]??"").length);var qe=oO();let vt;var _s=I(qe);ue((Zn,na)=>{vt=it(qe,1,"hint count svelte-1bn65uv",null,vt,Zn),fe(_s,na)},[()=>({over:U(le(),c(_e))}),()=>S(le(),c(_e))]),H(ye,qe)};de(yt,ye=>{(le().minLength!==void 0||le().maxLength!==void 0)&&ye(Zt)})}ue(ye=>{me(Mt,"id",`lbl-${le().name}`),me(Mt,"for",ye),fe(bt,`${le().label??""} `),fe(Xn,le().multiple?"references":le().type)},[()=>b(le())]),H(Ye,Rt)};var sn=I($t),Ut=I(sn),hn=I(Ut),pn=R(hn,2),Yt=I(pn),Ht=R(Ut,2),Nn=I(Ht),qn=I(Nn);{var Ct=Ye=>{var le=cO();ae("click",le,E),H(Ye,le)};de(qn,Ye=>{c(Q)&&Ye(Ct)})}var xt=R(qn,2);{var Xt=Ye=>{var le=fO(),Rt=I(le);fh(Rt,{size:16,"aria-hidden":"true"}),ae("click",le,h),H(Ye,le)};de(xt,Ye=>{e.onchangetemplate&&Ye(Xt)})}var gt=R(xt,2);let Me;var zt=R(gt,2);let Ve;var mn=I(zt),mr=R(Nn,2),Vn=R(I(mr),2),K=R(sn,2);{var ve=Ye=>{var le=dO();H(Ye,le)},ke=Ye=>{var le=hO();H(Ye,le)},ze=Ye=>{var le=mO(),Rt=pt(le);Ot(Rt,17,()=>c(F),gn=>gn.name,(gn,jn)=>{Te(gn,()=>c(jn))});var Mt=R(Rt,2);{var bt=gn=>{var jn=pO(),rs=R(I(jn),4);Ot(rs,17,()=>c(M),Xn=>Xn.name,(Xn,Qn)=>{Te(Xn,()=>c(Qn))}),H(gn,jn)};de(Mt,gn=>{c(M).length>0&&gn(bt)})}H(Ye,le)};de(K,Ye=>{c(T)?Ye(ve):c(F).length===0&&c(M).length===0?Ye(ke,1):Ye(ze,-1)})}ue(()=>{fe(Yt,e.templateName),Me=it(gt,1,"preview-toggle svelte-1bn65uv",null,Me,{active:c($)}),me(gt,"aria-pressed",c($)),Ve=it(zt,1,"publish-btn svelte-1bn65uv",null,Ve,{on:c(a)}),me(zt,"aria-pressed",c(a)),me(zt,"title",c(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),fe(mn,c(a)?"Publish":"Don't Publish")}),ae("input",hn,x),Et(hn,()=>c(v).title,Ye=>c(v).title=Ye),ae("click",gt,()=>X(!c($))),ae("click",zt,u),ae("input",Vn,x),Et(Vn,()=>c(v).published,Ye=>c(v).published=Ye)}var Qe=R(Ge,2);{var dt=Te=>{var Me=gO(),Ve=pt(Me),Ye=R(Ve,2),le=I(Ye);u6(le,{get path(){return e.path},get previewItem(){return c(J)},onclose:()=>X(!1)}),ue((Rt,Mt,bt)=>{me(Ve,"aria-valuemin",Rt),me(Ve,"aria-valuemax",Mt),me(Ve,"aria-valuenow",bt)},[()=>Math.round(ge*100),()=>Math.round(be*100),()=>Math.round(c(ie)*100)]),ae("pointerdown",Ve,Ne),ae("pointermove",Ve,Ie),ae("pointerup",Ve,Le),Be("pointercancel",Ve,Le),ae("keydown",Ve,Re),H(Te,Me)};de(Qe,Te=>{c($)&&Te(dt)})}dn(We,Te=>Ce=Te,()=>Ce);var Qt=R(We,2);{var xn=Te=>{{let Me=Ae(()=>e.onrename?()=>(y(o,!1),e.onrename()):void 0),Ve=Ae(()=>e.ondelete?()=>(y(o,!1),e.ondelete()):void 0),Ye=Ae(()=>e.onmove?le=>(y(o,!1),e.onmove(le)):void 0);GN(Te,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return c(d)},get folders(){return c(f)},onchangetemplate:le=>{y(o,!1),g(le)},get onrename(){return c(Me)},get ondelete(){return c(Ve)},get onmove(){return c(Ye)},onclose:()=>y(o,!1)})}};de(Qt,Te=>{c(o)&&e.onchangetemplate&&Te(xn)})}ue(()=>{rn=it(We,1,"layout svelte-1bn65uv",null,rn,{split:c($),dragging:c(he)}),tm(Ge,c($)?`flex-basis:${c(ie)*100}%`:void 0)}),Be("submit",$t,Te=>Te.preventDefault()),ae("focusout",$t,()=>void Y()),H(t,$e),ft()}At(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const Fb=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,EO="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 Au=ee("idle"),Qo=ee(Tt([])),Zo=ee(Tt([])),zc=ee(!1),Wc;async function Q1(){y(Au,"checking");try{const t=await Ty();y(Qo,[...t.errors],!0),y(Zo,[...t.warnings],!0),y(Au,"done")}catch{y(Au,"error")}}const Tn={get status(){return c(Au)},get errors(){return c(Qo)},get warnings(){return c(Zo)},get count(){return c(Qo).length+c(Zo).length},get hasProblems(){return c(Au)==="done"&&c(Qo).length+c(Zo).length>0},get panelOpen(){return c(zc)},refresh(){return clearTimeout(Wc),Q1()},scheduleRefresh(t=1200){clearTimeout(Wc),Wc=setTimeout(()=>void Q1(),t)},openPanel(){y(zc,!0)},closePanel(){y(zc,!1)}};var TO=W('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),_O=W('<button type="button" class="problems svelte-jz8lnl"> </button>'),AO=W('<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 yO(t,e){ct(e,!0);const n=Ae(()=>ws.state==="saving"?"Saving…":ws.state==="error"?"Save failed":"Saved");kt(()=>{nh.value,Tn.scheduleRefresh()});const r=Ae(()=>Tn.count),s="https://xtrable.com/";var a=AO();let i;var u=I(a),o=I(u),f=R(o,2),h=R(I(f));me(h,"href",s);var g=R(u,2);let d;var m=I(g),b=I(m),_=R(m,2);{var T=C=>{var q=TO();ae("click",q,()=>ws.retry()),H(C,q)};de(_,C=>{ws.canRetry&&C(T)})}var v=R(g,2);{var O=C=>{var q=_O(),x=I(q);ue(()=>fe(x,`${c(r)??""}
115
- ${c(r)===1?"problem":"problems"}`)),ae("click",q,()=>Tn.openPanel()),H(C,q)};de(v,C=>{Tn.hasProblems&&C(O)})}var L=R(v,2);me(L,"href",s);var B=I(L);ue(()=>{i=it(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":Tn.hasProblems}),me(o,"src",Fb),d=it(g,1,"save svelte-jz8lnl",null,d,{error:ws.state==="error"}),fe(b,c(n)),me(B,"src",EO)}),H(t,a),ft()}At(["click"]);var NO=W("<option> </option>"),SO=W("<option>Top level</option>"),IO=W("<option> </option>"),CO=W('<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>'),wO=W(`<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
116
- page’s title.</p></div>`),LO=W('<p class="error svelte-1uvxo8j" role="alert"> </p>'),OO=W('<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 xO(t,e){ct(e,!0);const n=ur(e,"folders",19,()=>[]);let r=ee(""),s=ee(!0),a=ee(null),i;const u=Ae(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),o=Ae(()=>n().filter(S=>S!==e.folderPath&&S!==c(u)&&!S.startsWith(`${e.folderPath}/`))),f=" ";let h=ee(f);ka(()=>{i.showModal(),xy(e.folderPath).then(S=>{y(r,S,!0)}).finally(()=>{y(s,!1)})});async function g(S){S.preventDefault(),y(a,null);try{await Ry(e.folderPath,c(r)),e.onsaved()}catch(U){y(a,U instanceof Error?U.message:String(U),!0)}}var d=OO(),m=I(d),b=R(I(m),2),_=I(b),T=R(b,2),v=R(I(T),2),O=I(v);O.value=O.__value="";var L=R(O);Ot(L,16,()=>e.templates,S=>S,(S,U)=>{var F=NO(),M=I(F),Q={};ue(()=>{fe(M,U),Q!==(Q=U)&&(F.value=(F.__value=U)??"")}),H(S,F)});var B=R(T,2);{var C=S=>{var U=CO(),F=R(I(U),2),M=I(F),Q=R(I(M),2),z=I(Q);z.value=z.__value=f;var $=R(z);{var X=ge=>{var be=SO();be.value=be.__value="",H(ge,be)};de($,ge=>{c(u)!==""&&ge(X)})}var J=R($);Ot(J,16,()=>c(o),ge=>ge,(ge,be)=>{var pe=IO(),Se=I(pe),ie={};ue(()=>{fe(Se,`${be??""}/`),ie!==(ie=be)&&(pe.value=(pe.__value=be)??"")}),H(ge,pe)});var ne=R(M,2);ue(()=>ne.disabled=c(h)===f),Ia(Q,()=>c(h),ge=>y(h,ge)),ae("click",ne,()=>e.onmove(c(h))),H(S,U)};de(B,S=>{e.onmove&&S(C)})}var q=R(B,2);{var x=S=>{var U=wO(),F=R(I(U),2),M=I(F),Q=R(M,2),z=R(Q,2);ae("click",M,function(...$){var X;(X=e.onnewsubfolder)==null||X.apply(this,$)}),ae("click",Q,function(...$){var X;(X=e.onrenamefolder)==null||X.apply(this,$)}),ae("click",z,function(...$){var X;(X=e.ondeletefolder)==null||X.apply(this,$)}),H(S,U)};de(q,S=>{e.folderPath!==""&&S(x)})}var j=R(q,2);{var Z=S=>{var U=LO(),F=I(U);ue(()=>fe(F,c(a))),H(S,U)};de(j,S=>{c(a)&&S(Z)})}var Y=R(j,2),E=I(Y),k=R(E,2);dn(d,S=>i=S,()=>i),ue(()=>{fe(_,e.folderPath===""?"/ (root)":`${e.folderPath}/`),v.disabled=c(s),k.disabled=c(s)}),Be("cancel",d,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),Be("close",d,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),Be("submit",m,g),Ia(v,()=>c(r),S=>y(r,S)),ae("click",E,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),H(t,d),ft()}At(["click"]);var RO=W("<option></option>"),DO=W("<option> </option>"),kO=W('<p class="error svelte-1t0ew8l" role="alert"> </p>'),PO=W('<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 MO(t,e){ct(e,!0);let n=ee(""),r=ee(""),s=ee(""),a=ee(""),i=!1,u=ee(null),o;ka(()=>o.showModal());function f(){i||y(r,hs(c(n)),!0)}async function h(k){k.preventDefault(),y(u,null);const S=hs(c(r)||c(n));if(S===""){y(u,"A title or slug is required.");return}const U=c(s).split("/").map(M=>hs(M)).filter(M=>M!=="").join("/"),F=U===""?S:`${U}/${S}`;try{await _g(F,c(n).trim()||S,c(a)),e.oncreated(F)}catch(M){y(u,M instanceof Error?M.message:String(M),!0)}}var g=PO(),d=I(g),m=R(I(d),2),b=R(I(m),2);yi(b,!0);var _=R(m,2),T=R(I(_),2),v=R(_,2),O=R(I(v),2),L=R(O,2);Ot(L,20,()=>e.folders,k=>k,(k,S)=>{var U=RO(),F={};ue(()=>{F!==(F=S)&&(U.value=(U.__value=S)??"")}),H(k,U)});var B=R(v,2),C=R(I(B),2),q=I(C);q.value=q.__value="";var x=R(q);Ot(x,16,()=>e.templates,k=>k,(k,S)=>{var U=DO(),F=I(U),M={};ue(()=>{fe(F,S),M!==(M=S)&&(U.value=(U.__value=S)??"")}),H(k,U)});var j=R(B,2);{var Z=k=>{var S=kO(),U=I(S);ue(()=>fe(U,c(u))),H(k,S)};de(j,k=>{c(u)&&k(Z)})}var Y=R(j,2),E=I(Y);dn(g,k=>o=k,()=>o),ue(k=>me(T,"placeholder",k),[()=>hs(c(n))||"my-item"]),Be("cancel",g,function(...k){var S;(S=e.oncancel)==null||S.apply(this,k)}),Be("close",g,function(...k){var S;(S=e.oncancel)==null||S.apply(this,k)}),Be("submit",d,h),ae("input",b,f),Et(b,()=>c(n),k=>y(n,k)),ae("input",T,()=>i=!0),Et(T,()=>c(r),k=>y(r,k)),Et(O,()=>c(s),k=>y(s,k)),Ia(C,()=>c(a),k=>y(a,k)),ae("click",E,function(...k){var S;(S=e.oncancel)==null||S.apply(this,k)}),H(t,g),ft()}At(["input","click"]);var BO=W("<option> </option>"),FO=W(`<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
117
- 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 UO(t,e){ct(e,!0);const n=Ae(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=ee(""),s=ee(!1);function a(){y(s,!0),e.oncreate(c(r))}var i=FO(),u=I(i),o=I(u),f=I(o),h=R(o,2),g=R(I(h)),d=I(g),m=R(h,2),b=R(I(m),2),_=I(b);_.value=_.__value="";var T=R(_);Ot(T,16,()=>e.templates,L=>L,(L,B)=>{var C=BO(),q=I(C),x={};ue(()=>{fe(q,B),x!==(x=B)&&(C.value=(C.__value=B)??"")}),H(L,C)});var v=R(m,2),O=I(v);ue(()=>{fe(f,e.name),fe(d,c(n)),b.disabled=c(s),v.disabled=c(s),fe(O,c(s)?"Creating…":"Create page")}),Ia(b,()=>c(r),L=>y(r,L)),ae("click",v,a),H(t,i),ft()}At(["click"]);const Ub="nanoesis:sidebar-width",HO=180,qO=560,jO=260;function Hb(t){return Math.min(qO,Math.max(HO,Math.round(t)))}function $O(){const t=Number(localStorage.getItem(Ub));return Number.isFinite(t)&&t>0?Hb(t):jO}let vl=$O();function qb(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${vl}px`)}qb();function YO(){return vl}function zO(t){vl=Hb(t),qb(),localStorage.setItem(Ub,String(vl))}var WO=W('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function GO(t,e){ct(e,!0);let n=ee(null);function r(o){o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId),y(n,{startX:o.clientX,startWidth:YO()},!0)}function s(o){c(n)!==null&&zO(c(n).startWidth+(o.clientX-c(n).startX))}function a(o){var f,h;c(n)!==null&&((h=(f=o.currentTarget).releasePointerCapture)==null||h.call(f,o.pointerId),y(n,null))}var i=WO();let u;ue(()=>u=it(i,1,"resizer svelte-1jo2gqq",null,u,{dragging:c(n)!==null})),ae("pointerdown",i,r),ae("pointermove",i,s),ae("pointerup",i,a),Be("pointercancel",i,a),H(t,i),ft()}At(["pointerdown","pointermove","pointerup"]);var KO=W(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),VO=W('<p class="error svelte-fna247" role="alert"> </p>'),XO=W('<p class="success svelte-fna247" role="status">Password updated.</p>'),QO=W('<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 ZO(t,e){ct(e,!0);let n=ur(e,"open",15),r=ee(void 0),s=ee(""),a=ee(""),i=ee(""),u=ee(!1),o=ee(null),f=ee(!1);kt(()=>{c(r)&&(n()&&!c(r).open?(y(s,""),y(a,""),y(i,""),y(o,null),y(f,!1),y(u,!1),c(r).showModal()):!n()&&c(r).open&&c(r).close())});let h=Ae(()=>c(a)!==""&&c(i)!==""&&c(a)!==c(i)),g=Ae(()=>!c(u)&&c(s)!==""&&c(a)!==""&&!c(h));async function d(M){if(M.preventDefault(),!c(g))return;y(u,!0),y(o,null);const Q=await ot.changePassword(c(s),c(a));if(y(u,!1),!Q.ok){const z=Q.error??"Password change failed.";y(o,z.includes("credentials")?"Current password is incorrect.":z,!0);return}y(f,!0),setTimeout(()=>{n(!1)},900)}function m(M){M.preventDefault(),n(!1)}var b=QO(),_=R(I(b),4),T=I(_),v=R(I(T),2),O=R(T,2),L=R(I(O),2),B=R(O,2),C=R(I(B),2),q=R(C,2);{var x=M=>{var Q=KO();H(M,Q)};de(q,M=>{c(h)&&M(x)})}var j=R(B,2);{var Z=M=>{var Q=VO(),z=I(Q);ue(()=>fe(z,c(o))),H(M,Q)};de(j,M=>{c(o)&&M(Z)})}var Y=R(j,2);{var E=M=>{var Q=XO();H(M,Q)};de(Y,M=>{c(f)&&M(E)})}var k=R(Y,2),S=I(k),U=R(S,2),F=I(U);dn(b,M=>y(r,M),()=>c(r)),ue(()=>{U.disabled=!c(g),fe(F,c(u)?"Updating…":"Update password")}),Be("cancel",b,m),Be("submit",_,d),Et(v,()=>c(s),M=>y(s,M)),Et(L,()=>c(a),M=>y(a,M)),Et(C,()=>c(i),M=>y(i,M)),ae("click",S,()=>n(!1)),H(t,b),ft()}At(["click"]);var JO=W(`<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),e8=W('<p class="error svelte-szf2lz" role="alert"> </p>'),t8=W('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),n8=W('<!> <!> <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),r8=W(`<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
113
+ `,{[An.blotName]:n}),i.insert(u)),a)],new WeakMap)}}Db.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 Nu=class Nu extends cn{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",Dh()),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===Nu.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()}};Ee(Nu,"blotName","table"),Ee(Nu,"tagName","TD");let yr=Nu;class vs extends Ha{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}}Ee(vs,"blotName","table-row"),Ee(vs,"tagName","TR");class Xr extends Ha{}Ee(Xr,"blotName","table-body"),Ee(Xr,"tagName","TBODY");class Mi extends Ha{balanceCells(){const e=this.descendants(vs),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=yr.formats(r.children.head.domNode));const a=this.scroll.create(yr.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(Xr);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(Xr);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=yr.formats(r.children.head.domNode),i=this.scroll.create(yr.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(Xr);if(n==null||n.children.head==null)return;const r=Dh(),s=this.scroll.create(vs.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(yr.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)}}Ee(Mi,"blotName","table-container"),Ee(Mi,"tagName","TABLE");Mi.allowedChildren=[Xr];Xr.requiredContainer=Mi;Xr.allowedChildren=[vs];vs.requiredContainer=Xr;vs.allowedChildren=[yr];yr.requiredContainer=vs;function Dh(){return`row-${Math.random().toString(36).slice(2,6)}`}class fL extends Br{static register(){se.register(yr),se.register(vs),se.register(Xr),se.register(Mi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Mi).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(se.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(se.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(se.sources.USER),this.quill.setSelection(n,se.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!==yr.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(se.sources.USER);let u=s.rowOffset();e===0&&(u+=1),this.quill.setSelection(n.index+u,n.length,se.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(se.sources.USER),e>0?this.quill.setSelection(n,se.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,se.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(`
114
+ `).join("");return a.insert(i,{table:Dh()})},new Oe().retain(r.index));this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(r.index,se.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(se.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(se.events.TEXT_CHANGE,(r,s,a)=>{a===se.sources.USER&&this.balanceTables()}),!0):!1)})}}const Y1=Ts("quill:toolbar");class kh extends Br{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),dL(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)){Y1.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 u;const i=(u=this.options.handlers)==null?void 0:u[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(se.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){Y1.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 u=e.options[e.selectedIndex];u.hasAttribute("selected")?a=!1:a=u.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 Kn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new Oe().retain(i.index).delete(i.length).insert({[n]:a}),se.sources.USER)}else this.quill.format(n,a,se.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 u=n[s];typeof u=="string"&&(u=u.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${u}"]`)}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],u=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",u),a.setAttribute("aria-pressed",u.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}kh.DEFAULTS={};function z1(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 dL(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")z1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?hL(r,a,i):z1(r,a,i)}}),t.appendChild(r)})}function hL(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)}kh.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,xe.INLINE)!=null&&this.quill.format(n,!1,se.sources.USER)})}else this.quill.removeFormat(t.index,t.length,se.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",se.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,se.sources.USER),this.quill.format("direction",t,se.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,se.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,se.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,se.sources.USER):this.quill.format("list","unchecked",se.sources.USER):this.quill.format("list",t,se.sources.USER)}}};const pL='<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>',mL='<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>',gL='<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>',bL='<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>',vL='<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>',EL='<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>',TL='<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>',_L='<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>',W1='<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>',AL='<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>',yL='<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>',NL='<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>',SL='<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>',IL='<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>',CL='<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>',wL='<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>',LL='<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>',OL='<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>',xL='<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>',RL='<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>',DL='<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>',kL='<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>',PL='<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>',ML='<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>',BL='<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>',FL='<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>',UL='<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>',HL='<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>',qL='<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>',jL='<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>',$L='<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>',YL='<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>',zL='<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>',Fu={align:{"":pL,center:mL,right:gL,justify:bL},background:vL,blockquote:EL,bold:TL,clean:_L,code:W1,"code-block":W1,color:AL,direction:{"":yL,rtl:NL},formula:SL,header:{1:IL,2:CL,3:wL,4:LL,5:OL,6:xL},italic:RL,image:DL,indent:{"+1":kL,"-1":PL},link:ML,list:{bullet:BL,check:FL,ordered:UL},script:{sub:HL,super:qL},strike:jL,table:$L,underline:YL,video:zL},WL='<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 G1=0;function K1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class zl{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"),K1(this.label,"aria-expanded"),K1(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=WL,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-${G1}`,G1+=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 kb extends zl{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 Pb extends zl{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 GL=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class Mb{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,GL(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 u=a.bottom-a.top,o=e.bottom-e.top+u;this.root.style.top=`${r-o}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const KL=[!1,"center","right","justify"],VL=["#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"],XL=[!1,"serif","monospace"],QL=["1","2","3",!1],ZL=["small",!1,"large","huge"];class uo extends Pi{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&&tu(s,KL),typeof n.align=="object"))return new Pb(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&&tu(s,VL,a==="background"?"#ffffff":"#000000"),new kb(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?tu(s,XL):s.classList.contains("ql-header")?tu(s,QL):s.classList.contains("ql-size")&&tu(s,ZL)),new zl(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(we.events.EDITOR_CHANGE,r)}}uo.DEFAULTS=$s({},Pi.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 Bb extends Mb{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,we.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,we.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=JL(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,we.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",we.sources.USER),this.quill.setSelection(r+2,we.sources.USER)}break}}this.textbox.value="",this.hide()}}function JL(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 tu(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 eO=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Fb extends Bb{constructor(e,n){super(e,n),this.quill.on(we.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===we.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===we.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const u=this.quill.getLines(s.index,s.length);if(u.length===1){const o=this.quill.getBounds(s);o!=null&&this.position(o)}else{const o=u[u.length-1],f=this.quill.getIndex(o),h=Math.min(o.length()-1,s.index+s.length-f),g=this.quill.getBounds(new Oa(f,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(we.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}}Ee(Fb,"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 Ub extends uo{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=eO),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Fb(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Fu),this.buildPickers(e.container.querySelectorAll("select"),Fu))}}Ub.DEFAULTS=$s({},uo.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,se.sources.USER)}}}}});const tO=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Hb extends Bb{constructor(){super(...arguments);Ee(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,we.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(we.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===we.sources.USER){const[a,i]=this.quill.scroll.descendant(Fs,n.index);if(a!=null){this.linkRange=new Oa(n.index-i,a.length());const u=Fs.formats(a.domNode);this.preview.textContent=u,this.preview.setAttribute("href",u),this.show();const o=this.quill.getBounds(this.linkRange);o!=null&&this.position(o);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}Ee(Hb,"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 qb extends uo{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=tO),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"),Fu),this.buildPickers(e.container.querySelectorAll("select"),Fu),this.tooltip=new Hb(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)}))}}qb.DEFAULTS=$s({},uo.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,se.sources.USER)}}}}});se.register({"attributors/attribute/direction":Tb,"attributors/class/align":bb,"attributors/class/background":E4,"attributors/class/color":v4,"attributors/class/direction":_b,"attributors/class/font":Nb,"attributors/class/size":Ib,"attributors/style/align":vb,"attributors/style/background":wh,"attributors/style/color":Ch,"attributors/style/direction":Ab,"attributors/style/font":Sb,"attributors/style/size":Cb},!0);se.register({"formats/align":bb,"formats/direction":_b,"formats/indent":lL,"formats/background":wh,"formats/color":Ch,"formats/font":Nb,"formats/size":Ib,"formats/blockquote":dd,"formats/code-block":An,"formats/header":hd,"formats/list":io,"formats/bold":Bu,"formats/code":Lh,"formats/italic":pd,"formats/link":Fs,"formats/script":md,"formats/strike":gd,"formats/underline":bd,"formats/formula":Vo,"formats/image":vd,"formats/video":Xo,"modules/syntax":Db,"modules/table":fL,"modules/toolbar":kh,"themes/bubble":Ub,"themes/snow":qb,"ui/icons":Fu,"ui/picker":zl,"ui/icon-picker":Pb,"ui/color-picker":kb,"ui/tooltip":Mb},!0);const V1="/api/read?path=",jb=/src="([^"]*)"/g,nO=/&nbsp;/g;function rO(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function X1(t,e){return t.replace(jb,(n,r)=>rO(r)?`src="${to(e,r)}"`:n)}function Q1(t,e){const n=`content/${e===""?"":`${e}/`}`;return t.replace(jb,(r,s)=>{const a=s.indexOf(V1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+V1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(nO," ")}var sO=W('<div class="rte svelte-1afg4yo"><div></div></div>');function aO(t,e){ct(e,!0);const n=se.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"]];ka(()=>{const d=new se(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(d.root.setAttribute("aria-labelledby",e.labelledBy),d.root.setAttribute("aria-multiline","true"));const m=d.getModule("toolbar");m.addHandler("image",()=>o(d)),m.addHandler("link",()=>u(d));const b=T=>{T.preventDefault(),setTimeout(()=>i(d),0)};d.root.addEventListener("contextmenu",b),e.value&&d.clipboard.dangerouslyPasteHTML(X1(e.value,e.itemDir),"silent");const _=()=>e.onchange(Q1(d.root.innerHTML,e.itemDir));return d.on("text-change",_),s=d,()=>{d.off("text-change",_),d.root.removeEventListener("contextmenu",b)}});function i(d){var T;const m=d.getSelection(!0);if(m===null)return;const b=d.theme,_=d.getBounds(m.index,m.length);((T=b.tooltip)==null?void 0:T.show)!==void 0&&b.tooltip.position!==void 0&&_&&(b.tooltip.show(),b.tooltip.position(_))}function u(d){const m=d.getSelection(!0);if(m===null)return;const b=d.getFormat(m).link??"";kg(b).then(_=>{if(_!==null)if(_==="")d.formatText(m.index,m.length,"link",!1,"user");else if(m.length>0)d.formatText(m.index,m.length,"link",_,"user");else{const T=xu(_)?Vf(_):_;d.insertText(m.index,T,{link:_},"user")}})}function o(d){const m=document.createElement("input");m.type="file",m.accept="image/*",m.onchange=()=>{var _;const b=(_=m.files)==null?void 0:_[0];b&&f(d,b)},m.click()}async function f(d,m){try{const b=await uh(e.itemDir,m),_=d.getSelection(!0);d.insertEmbed(_.index,"image",to(e.itemDir,b),"user"),d.setSelection(_.index+1,0)}catch(b){console.error("Inline image upload failed",b)}}kt(()=>{const d=e.value;s&&Q1(s.root.innerHTML,e.itemDir)!==d&&s.clipboard.dangerouslyPasteHTML(X1(d,e.itemDir),"silent")});var h=sO(),g=I(h);dn(g,d=>r=d,()=>r),H(t,h),ft()}var iO=W('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),uO=W('<textarea rows="3"></textarea>'),oO=W('<input type="date" class="svelte-1bn65uv"/>'),lO=W('<input type="time" class="svelte-1bn65uv"/>'),cO=W('<input type="email" class="svelte-1bn65uv"/>'),fO=W('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),dO=W('<input type="text" class="svelte-1bn65uv"/>'),hO=W('<p class="hint svelte-1bn65uv"> </p>'),pO=W("<p> </p>"),mO=W('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),gO=W('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),bO=W('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),vO=W('<p class="hint svelte-1bn65uv">Loading fields…</p>'),EO=W('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),TO=W(`<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>`),_O=W("<!> <!>",1),AO=W('<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),yO=W('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles"><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 NO(t,e){ct(e,!0);const n=ur(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=ee(!1);const i=()=>new Date().toISOString().slice(0,10);function u(){y(a,!c(a)),c(a)&&(c(v).published??"").trim()===""&&(c(v).published=i()),x()}let o=ee(!1),f=ee(Tt([]));function h(){y(o,!0),e.onmove&&Ff().then(Te=>y(f,Te,!0))}async function g(Te){var Me;Te!==e.templateName&&(await Y(),(Me=e.onchangetemplate)==null||Me.call(e,Te))}const d=Ae(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),m=new Set(["richtext","image","file","authors"]);function b(Te){return m.has(Te.type)?void 0:`f-${Te.name}`}let _=ee(Tt([])),T=ee(!0),v=ee(Tt({})),O=ee(null);const L=700;let B,C=!1;ka(()=>{q();const Te=()=>void Y();return window.addEventListener("beforeunload",Te),()=>{window.removeEventListener("beforeunload",Te),Y()}});async function q(){y(T,!0);const[Te,Me]=await Promise.all([_y(e.templateName),yy()]),Ve=Te.filter(bt=>bt.name!=="title"&&bt.name!=="published"),Ye=new Set(Ve.map(bt=>bt.name)),le=Me.filter(bt=>bt.name!=="published"&&!Ye.has(bt.name)),Rt=[r,s,...Ve,...le],Mt={};for(const bt of Rt)Mt[bt.name]=Ky(e.item,bt.name);Mt.published=(Mt.published??"").slice(0,10),y(a,e.item.isPublished,!0),y(_,Rt,!0),y(F,Ve,!0),y(M,le,!0),y(v,Mt,!0),gN(localStorage,e.path,Mt),y(O,bN(localStorage,e.path),!0),y(T,!1)}function x(){C=!0,clearTimeout(B),B=setTimeout(()=>void Y(),L)}function j(Te,Me){const Ve=c(v)[Te]??"";c(v)[Te]=Me,x(),Ve!==""&&Ve!==Me&&Z(Ve)}async function Z(Te){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Te))return;Object.values(c(v)).some(Ve=>typeof Ve=="string"&&Ve.includes(Te))||await Oy(c(d),Te)}async function Y(){var Me;if(clearTimeout(B),!C)return;const Te=z0(e.item,c(_),c(v),c(a));ws.saving();try{await bg(e.path,Te),C=!1,ws.saved(),(Me=e.onsaved)==null||Me.call(e,e.path,c(v).title??e.item.title,c(a))}catch{ws.failed(()=>void Y())}}async function E(){c(O)===null||!await hl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(y(v,{...c(O)},!0),x())}const k=new Set(["text","code"]);function S(Te,Me){return Te.maxLength!==void 0&&Te.minLength!==void 0?`${Me} / ${Te.maxLength} characters (min ${Te.minLength})`:Te.maxLength!==void 0?`${Me} / ${Te.maxLength} characters`:`${Me} characters (min ${Te.minLength})`}function U(Te,Me){return Te.minLength!==void 0&&Me>0&&Me<Te.minLength?!0:Te.maxLength!==void 0&&Me>Te.maxLength}let F=ee(Tt([])),M=ee(Tt([]));const Q=Ae(()=>c(O)!==null&&JSON.stringify(c(v))!==JSON.stringify(c(O))),z="nanoesis:preview-open";let $=ee(localStorage.getItem(z)==="true");function X(Te){y($,Te,!0),localStorage.setItem(z,String(Te))}const J=Ae(()=>{if(c(T))return null;try{return{...Zu(JSON.parse(z0(e.item,c(_),c(v),c(a)))),template:e.templateName}}catch{return null}}),ne="nanoesis:preview-split",ge=.2,be=.8;function pe(Te){return Math.min(be,Math.max(ge,Te))}function Se(){const Te=Number(localStorage.getItem(ne));return Number.isFinite(Te)&&Te>0?pe(Te):.5}let ie=ee(Tt(Se())),he=ee(!1),Ce;function Ne(Te){Te.preventDefault(),y(he,!0),Te.currentTarget.setPointerCapture(Te.pointerId)}function Ie(Te){if(!c(he))return;const Me=Ce.getBoundingClientRect();y(ie,pe((Te.clientX-Me.left)/Me.width),!0)}function Le(Te){var Me,Ve;c(he)&&(y(he,!1),(Ve=(Me=Te.currentTarget).releasePointerCapture)==null||Ve.call(Me,Te.pointerId),localStorage.setItem(ne,String(c(ie))))}function Re(Te){const Me=Te.key==="ArrowLeft"?-.02:Te.key==="ArrowRight"?.02:0;Me!==0&&(Te.preventDefault(),y(ie,pe(c(ie)+Me),!0),localStorage.setItem(ne,String(c(ie))))}var $e=yO(),We=pt($e);let rn;var Ge=I(We),$t=I(Ge);{const Te=(Ye,le=Ad)=>{var Rt=mO(),Mt=I(Rt),bt=I(Mt),gn=R(bt);{var jn=ye=>{var _e=iO();H(ye,_e)};de(gn,ye=>{le().required&&ye(jn)})}var rs=R(gn,2),Xn=I(rs),Qn=R(Mt,2);{var Bt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);aO(ye,{get value(){return c(_e)},get itemDir(){return c(d)},get labelledBy(){return c(qe)},placeholder:"Write…",onchange:vt=>{c(v)[le().name]=vt,x()}})}},Js=ye=>{var _e=uO();let qe;ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength),qe=it(_e,1,"svelte-1bn65uv",null,qe,{mono:le().type==="code"})}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],vt=>c(v)[le().name]=vt),H(ye,_e)},ea=Ae(()=>k.has(le().type)),ta=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);$N(ye,{get value(){return c(_e)},get itemDir(){return c(d)},get labelledBy(){return c(qe)},onchange:vt=>j(le().name,vt)})}},tt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);FN(ye,{get value(){return c(_e)},get itemDir(){return c(d)},get labelledBy(){return c(qe)},onchange:vt=>{c(v)[le().name]=vt,x()}})}},wt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);LN(ye,{get value(){return c(_e)},get labelledBy(){return c(qe)},onchange:vt=>{c(v)[le().name]=vt,x()}})}},nt=ye=>{{let _e=Ae(()=>c(v)[le().name]??""),qe=Ae(()=>`lbl-${le().name}`);u6(ye,{get value(){return c(_e)},get labelledBy(){return c(qe)},onchange:vt=>{c(v)[le().name]=vt,x()}})}},Sn=ye=>{var _e=oO();ue(()=>me(_e,"id",`f-${le().name}`)),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},bn=ye=>{var _e=lO();ue(()=>me(_e,"id",`f-${le().name}`)),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},Ft=ye=>{var _e=cO();ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength)}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},Wt=ye=>{var _e=fO();ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength)}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)},Gt=ye=>{var _e=dO();ue(()=>{me(_e,"id",`f-${le().name}`),me(_e,"maxlength",le().maxLength),me(_e,"minlength",le().minLength)}),ae("input",_e,x),Et(_e,()=>c(v)[le().name],qe=>c(v)[le().name]=qe),H(ye,_e)};de(Qn,ye=>{le().type==="richtext"?ye(Bt):c(ea)?ye(Js,1):le().type==="image"?ye(ta,2):le().type==="file"?ye(tt,3):le().type==="authors"?ye(wt,4):le().type==="url"?ye(nt,5):le().type==="date"?ye(Sn,6):le().type==="time"?ye(bn,7):le().type==="email"?ye(Ft,8):le().type==="phone"?ye(Wt,9):ye(Gt,-1)})}var rt=R(Qn,2);{var Rn=ye=>{var _e=hO(),qe=I(_e);ue(()=>fe(qe,le().help)),H(ye,_e)};de(rt,ye=>{le().help&&ye(Rn)})}var yt=R(rt,2);{var Zt=ye=>{const _e=Ae(()=>(c(v)[le().name]??"").length);var qe=pO();let vt;var _s=I(qe);ue((Zn,na)=>{vt=it(qe,1,"hint count svelte-1bn65uv",null,vt,Zn),fe(_s,na)},[()=>({over:U(le(),c(_e))}),()=>S(le(),c(_e))]),H(ye,qe)};de(yt,ye=>{(le().minLength!==void 0||le().maxLength!==void 0)&&ye(Zt)})}ue(ye=>{me(Mt,"id",`lbl-${le().name}`),me(Mt,"for",ye),fe(bt,`${le().label??""} `),fe(Xn,le().multiple?"references":le().type)},[()=>b(le())]),H(Ye,Rt)};var sn=I($t),Ut=I(sn),hn=I(Ut),pn=R(hn,2),Yt=I(pn),Ht=R(Ut,2),Nn=I(Ht),qn=I(Nn);{var Ct=Ye=>{var le=gO();ae("click",le,E),H(Ye,le)};de(qn,Ye=>{c(Q)&&Ye(Ct)})}var xt=R(qn,2);{var Xt=Ye=>{var le=bO(),Rt=I(le);fh(Rt,{size:16,"aria-hidden":"true"}),ae("click",le,h),H(Ye,le)};de(xt,Ye=>{e.onchangetemplate&&Ye(Xt)})}var gt=R(xt,2);let Me;var zt=R(gt,2);let Ve;var mn=I(zt),mr=R(Nn,2),Vn=R(I(mr),2),G=R(sn,2);{var ve=Ye=>{var le=vO();H(Ye,le)},ke=Ye=>{var le=EO();H(Ye,le)},ze=Ye=>{var le=_O(),Rt=pt(le);Ot(Rt,17,()=>c(F),gn=>gn.name,(gn,jn)=>{Te(gn,()=>c(jn))});var Mt=R(Rt,2);{var bt=gn=>{var jn=TO(),rs=R(I(jn),4);Ot(rs,17,()=>c(M),Xn=>Xn.name,(Xn,Qn)=>{Te(Xn,()=>c(Qn))}),H(gn,jn)};de(Mt,gn=>{c(M).length>0&&gn(bt)})}H(Ye,le)};de(G,Ye=>{c(T)?Ye(ve):c(F).length===0&&c(M).length===0?Ye(ke,1):Ye(ze,-1)})}ue(()=>{fe(Yt,e.templateName),Me=it(gt,1,"preview-toggle svelte-1bn65uv",null,Me,{active:c($)}),me(gt,"aria-pressed",c($)),Ve=it(zt,1,"publish-btn svelte-1bn65uv",null,Ve,{on:c(a)}),me(zt,"aria-pressed",c(a)),me(zt,"title",c(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),fe(mn,c(a)?"Publish":"Don't Publish")}),ae("input",hn,x),Et(hn,()=>c(v).title,Ye=>c(v).title=Ye),ae("click",gt,()=>X(!c($))),ae("click",zt,u),ae("input",Vn,x),Et(Vn,()=>c(v).published,Ye=>c(v).published=Ye)}var Qe=R(Ge,2);{var dt=Te=>{var Me=AO(),Ve=pt(Me),Ye=R(Ve,2),le=I(Ye);h6(le,{get path(){return e.path},get previewItem(){return c(J)},onclose:()=>X(!1)}),ue((Rt,Mt,bt)=>{me(Ve,"aria-valuemin",Rt),me(Ve,"aria-valuemax",Mt),me(Ve,"aria-valuenow",bt)},[()=>Math.round(ge*100),()=>Math.round(be*100),()=>Math.round(c(ie)*100)]),ae("pointerdown",Ve,Ne),ae("pointermove",Ve,Ie),ae("pointerup",Ve,Le),Be("pointercancel",Ve,Le),ae("keydown",Ve,Re),H(Te,Me)};de(Qe,Te=>{c($)&&Te(dt)})}dn(We,Te=>Ce=Te,()=>Ce);var Qt=R(We,2);{var xn=Te=>{{let Me=Ae(()=>e.onrename?()=>(y(o,!1),e.onrename()):void 0),Ve=Ae(()=>e.ondelete?()=>(y(o,!1),e.ondelete()):void 0),Ye=Ae(()=>e.onmove?le=>(y(o,!1),e.onmove(le)):void 0);JN(Te,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return c(d)},get folders(){return c(f)},onchangetemplate:le=>{y(o,!1),g(le)},get onrename(){return c(Me)},get ondelete(){return c(Ve)},get onmove(){return c(Ye)},onclose:()=>y(o,!1)})}};de(Qt,Te=>{c(o)&&e.onchangetemplate&&Te(xn)})}ue(()=>{rn=it(We,1,"layout svelte-1bn65uv",null,rn,{split:c($),dragging:c(he)}),nm(Ge,c($)?`flex-basis:${c(ie)*100}%`:void 0)}),Be("submit",$t,Te=>Te.preventDefault()),ae("focusout",$t,()=>void Y()),H(t,$e),ft()}At(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const $b=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,SO="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 Au=ee("idle"),Qo=ee(Tt([])),Zo=ee(Tt([])),zc=ee(!1),Wc;async function Z1(){y(Au,"checking");try{const t=await Sy();y(Qo,[...t.errors],!0),y(Zo,[...t.warnings],!0),y(Au,"done")}catch{y(Au,"error")}}const Tn={get status(){return c(Au)},get errors(){return c(Qo)},get warnings(){return c(Zo)},get count(){return c(Qo).length+c(Zo).length},get hasProblems(){return c(Au)==="done"&&c(Qo).length+c(Zo).length>0},get panelOpen(){return c(zc)},refresh(){return clearTimeout(Wc),Z1()},scheduleRefresh(t=1200){clearTimeout(Wc),Wc=setTimeout(()=>void Z1(),t)},openPanel(){y(zc,!0)},closePanel(){y(zc,!1)}};var IO=W('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),CO=W('<button type="button" class="problems svelte-jz8lnl"> </button>'),wO=W('<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 LO(t,e){ct(e,!0);const n=Ae(()=>ws.state==="saving"?"Saving…":ws.state==="error"?"Save failed":"Saved");kt(()=>{nh.value,Tn.scheduleRefresh()});const r=Ae(()=>Tn.count),s="https://xtrable.com/";var a=wO();let i;var u=I(a),o=I(u),f=R(o,2),h=R(I(f));me(h,"href",s);var g=R(u,2);let d;var m=I(g),b=I(m),_=R(m,2);{var T=C=>{var q=IO();ae("click",q,()=>ws.retry()),H(C,q)};de(_,C=>{ws.canRetry&&C(T)})}var v=R(g,2);{var O=C=>{var q=CO(),x=I(q);ue(()=>fe(x,`${c(r)??""}
115
+ ${c(r)===1?"problem":"problems"}`)),ae("click",q,()=>Tn.openPanel()),H(C,q)};de(v,C=>{Tn.hasProblems&&C(O)})}var L=R(v,2);me(L,"href",s);var B=I(L);ue(()=>{i=it(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":Tn.hasProblems}),me(o,"src",$b),d=it(g,1,"save svelte-jz8lnl",null,d,{error:ws.state==="error"}),fe(b,c(n)),me(B,"src",SO)}),H(t,a),ft()}At(["click"]);var OO=W("<option> </option>"),xO=W("<option>Top level</option>"),RO=W("<option> </option>"),DO=W('<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>'),kO=W(`<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
116
+ page’s title.</p></div>`),PO=W('<p class="error svelte-1uvxo8j" role="alert"> </p>'),MO=W('<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 BO(t,e){ct(e,!0);const n=ur(e,"folders",19,()=>[]);let r=ee(""),s=ee(!0),a=ee(null),i;const u=Ae(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),o=Ae(()=>n().filter(S=>S!==e.folderPath&&S!==c(u)&&!S.startsWith(`${e.folderPath}/`))),f=" ";let h=ee(f);ka(()=>{i.showModal(),My(e.folderPath).then(S=>{y(r,S,!0)}).finally(()=>{y(s,!1)})});async function g(S){S.preventDefault(),y(a,null);try{await By(e.folderPath,c(r)),e.onsaved()}catch(U){y(a,U instanceof Error?U.message:String(U),!0)}}var d=MO(),m=I(d),b=R(I(m),2),_=I(b),T=R(b,2),v=R(I(T),2),O=I(v);O.value=O.__value="";var L=R(O);Ot(L,16,()=>e.templates,S=>S,(S,U)=>{var F=OO(),M=I(F),Q={};ue(()=>{fe(M,U),Q!==(Q=U)&&(F.value=(F.__value=U)??"")}),H(S,F)});var B=R(T,2);{var C=S=>{var U=DO(),F=R(I(U),2),M=I(F),Q=R(I(M),2),z=I(Q);z.value=z.__value=f;var $=R(z);{var X=ge=>{var be=xO();be.value=be.__value="",H(ge,be)};de($,ge=>{c(u)!==""&&ge(X)})}var J=R($);Ot(J,16,()=>c(o),ge=>ge,(ge,be)=>{var pe=RO(),Se=I(pe),ie={};ue(()=>{fe(Se,`${be??""}/`),ie!==(ie=be)&&(pe.value=(pe.__value=be)??"")}),H(ge,pe)});var ne=R(M,2);ue(()=>ne.disabled=c(h)===f),Ia(Q,()=>c(h),ge=>y(h,ge)),ae("click",ne,()=>e.onmove(c(h))),H(S,U)};de(B,S=>{e.onmove&&S(C)})}var q=R(B,2);{var x=S=>{var U=kO(),F=R(I(U),2),M=I(F),Q=R(M,2),z=R(Q,2);ae("click",M,function(...$){var X;(X=e.onnewsubfolder)==null||X.apply(this,$)}),ae("click",Q,function(...$){var X;(X=e.onrenamefolder)==null||X.apply(this,$)}),ae("click",z,function(...$){var X;(X=e.ondeletefolder)==null||X.apply(this,$)}),H(S,U)};de(q,S=>{e.folderPath!==""&&S(x)})}var j=R(q,2);{var Z=S=>{var U=PO(),F=I(U);ue(()=>fe(F,c(a))),H(S,U)};de(j,S=>{c(a)&&S(Z)})}var Y=R(j,2),E=I(Y),k=R(E,2);dn(d,S=>i=S,()=>i),ue(()=>{fe(_,e.folderPath===""?"/ (root)":`${e.folderPath}/`),v.disabled=c(s),k.disabled=c(s)}),Be("cancel",d,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),Be("close",d,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),Be("submit",m,g),Ia(v,()=>c(r),S=>y(r,S)),ae("click",E,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),H(t,d),ft()}At(["click"]);var FO=W("<option></option>"),UO=W("<option> </option>"),HO=W('<p class="error svelte-1t0ew8l" role="alert"> </p>'),qO=W('<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 jO(t,e){ct(e,!0);let n=ee(""),r=ee(""),s=ee(""),a=ee(""),i=!1,u=ee(null),o;ka(()=>o.showModal());function f(){i||y(r,hs(c(n)),!0)}async function h(k){k.preventDefault(),y(u,null);const S=hs(c(r)||c(n));if(S===""){y(u,"A title or slug is required.");return}const U=c(s).split("/").map(M=>hs(M)).filter(M=>M!=="").join("/"),F=U===""?S:`${U}/${S}`;try{await Ag(F,c(n).trim()||S,c(a)),e.oncreated(F)}catch(M){y(u,M instanceof Error?M.message:String(M),!0)}}var g=qO(),d=I(g),m=R(I(d),2),b=R(I(m),2);yi(b,!0);var _=R(m,2),T=R(I(_),2),v=R(_,2),O=R(I(v),2),L=R(O,2);Ot(L,20,()=>e.folders,k=>k,(k,S)=>{var U=FO(),F={};ue(()=>{F!==(F=S)&&(U.value=(U.__value=S)??"")}),H(k,U)});var B=R(v,2),C=R(I(B),2),q=I(C);q.value=q.__value="";var x=R(q);Ot(x,16,()=>e.templates,k=>k,(k,S)=>{var U=UO(),F=I(U),M={};ue(()=>{fe(F,S),M!==(M=S)&&(U.value=(U.__value=S)??"")}),H(k,U)});var j=R(B,2);{var Z=k=>{var S=HO(),U=I(S);ue(()=>fe(U,c(u))),H(k,S)};de(j,k=>{c(u)&&k(Z)})}var Y=R(j,2),E=I(Y);dn(g,k=>o=k,()=>o),ue(k=>me(T,"placeholder",k),[()=>hs(c(n))||"my-item"]),Be("cancel",g,function(...k){var S;(S=e.oncancel)==null||S.apply(this,k)}),Be("close",g,function(...k){var S;(S=e.oncancel)==null||S.apply(this,k)}),Be("submit",d,h),ae("input",b,f),Et(b,()=>c(n),k=>y(n,k)),ae("input",T,()=>i=!0),Et(T,()=>c(r),k=>y(r,k)),Et(O,()=>c(s),k=>y(s,k)),Ia(C,()=>c(a),k=>y(a,k)),ae("click",E,function(...k){var S;(S=e.oncancel)==null||S.apply(this,k)}),H(t,g),ft()}At(["input","click"]);var $O=W("<option> </option>"),YO=W(`<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
117
+ 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 zO(t,e){ct(e,!0);const n=Ae(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=ee(""),s=ee(!1);function a(){y(s,!0),e.oncreate(c(r))}var i=YO(),u=I(i),o=I(u),f=I(o),h=R(o,2),g=R(I(h)),d=I(g),m=R(h,2),b=R(I(m),2),_=I(b);_.value=_.__value="";var T=R(_);Ot(T,16,()=>e.templates,L=>L,(L,B)=>{var C=$O(),q=I(C),x={};ue(()=>{fe(q,B),x!==(x=B)&&(C.value=(C.__value=B)??"")}),H(L,C)});var v=R(m,2),O=I(v);ue(()=>{fe(f,e.name),fe(d,c(n)),b.disabled=c(s),v.disabled=c(s),fe(O,c(s)?"Creating…":"Create page")}),Ia(b,()=>c(r),L=>y(r,L)),ae("click",v,a),H(t,i),ft()}At(["click"]);const Yb="nanoesis:sidebar-width",WO=180,GO=560,KO=260;function zb(t){return Math.min(GO,Math.max(WO,Math.round(t)))}function VO(){const t=Number(localStorage.getItem(Yb));return Number.isFinite(t)&&t>0?zb(t):KO}let vl=VO();function Wb(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${vl}px`)}Wb();function XO(){return vl}function QO(t){vl=zb(t),Wb(),localStorage.setItem(Yb,String(vl))}var ZO=W('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function JO(t,e){ct(e,!0);let n=ee(null);function r(o){o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId),y(n,{startX:o.clientX,startWidth:XO()},!0)}function s(o){c(n)!==null&&QO(c(n).startWidth+(o.clientX-c(n).startX))}function a(o){var f,h;c(n)!==null&&((h=(f=o.currentTarget).releasePointerCapture)==null||h.call(f,o.pointerId),y(n,null))}var i=ZO();let u;ue(()=>u=it(i,1,"resizer svelte-1jo2gqq",null,u,{dragging:c(n)!==null})),ae("pointerdown",i,r),ae("pointermove",i,s),ae("pointerup",i,a),Be("pointercancel",i,a),H(t,i),ft()}At(["pointerdown","pointermove","pointerup"]);var e8=W(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),t8=W('<p class="error svelte-fna247" role="alert"> </p>'),n8=W('<p class="success svelte-fna247" role="status">Password updated.</p>'),r8=W('<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 s8(t,e){ct(e,!0);let n=ur(e,"open",15),r=ee(void 0),s=ee(""),a=ee(""),i=ee(""),u=ee(!1),o=ee(null),f=ee(!1);kt(()=>{c(r)&&(n()&&!c(r).open?(y(s,""),y(a,""),y(i,""),y(o,null),y(f,!1),y(u,!1),c(r).showModal()):!n()&&c(r).open&&c(r).close())});let h=Ae(()=>c(a)!==""&&c(i)!==""&&c(a)!==c(i)),g=Ae(()=>!c(u)&&c(s)!==""&&c(a)!==""&&!c(h));async function d(M){if(M.preventDefault(),!c(g))return;y(u,!0),y(o,null);const Q=await ot.changePassword(c(s),c(a));if(y(u,!1),!Q.ok){const z=Q.error??"Password change failed.";y(o,z.includes("credentials")?"Current password is incorrect.":z,!0);return}y(f,!0),setTimeout(()=>{n(!1)},900)}function m(M){M.preventDefault(),n(!1)}var b=r8(),_=R(I(b),4),T=I(_),v=R(I(T),2),O=R(T,2),L=R(I(O),2),B=R(O,2),C=R(I(B),2),q=R(C,2);{var x=M=>{var Q=e8();H(M,Q)};de(q,M=>{c(h)&&M(x)})}var j=R(B,2);{var Z=M=>{var Q=t8(),z=I(Q);ue(()=>fe(z,c(o))),H(M,Q)};de(j,M=>{c(o)&&M(Z)})}var Y=R(j,2);{var E=M=>{var Q=n8();H(M,Q)};de(Y,M=>{c(f)&&M(E)})}var k=R(Y,2),S=I(k),U=R(S,2),F=I(U);dn(b,M=>y(r,M),()=>c(r)),ue(()=>{U.disabled=!c(g),fe(F,c(u)?"Updating…":"Update password")}),Be("cancel",b,m),Be("submit",_,d),Et(v,()=>c(s),M=>y(s,M)),Et(L,()=>c(a),M=>y(a,M)),Et(C,()=>c(i),M=>y(i,M)),ae("click",S,()=>n(!1)),H(t,b),ft()}At(["click"]);var a8=W(`<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),i8=W('<p class="error svelte-szf2lz" role="alert"> </p>'),u8=W('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),o8=W('<!> <!> <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),l8=W(`<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
118
118
  role. Paste it into your client's config as a Bearer token. It keeps working after you sign out,
119
- so treat it like a password.</p> <!></dialog>`);function s8(t,e){ct(e,!0);let n=ur(e,"open",15),r=ee(void 0),s=ee(!1),a=ee(null),i=ee(null),u=ee(null),o=ee(!1),f=ee(!1);kt(()=>{c(r)&&(n()&&!c(r).open?(y(s,!1),y(a,null),y(i,null),y(u,null),y(o,!1),y(f,!1),c(r).showModal()):!n()&&c(r).open&&c(r).close())});let h=Ae(()=>c(u)===null?"":new Date(c(u)).toLocaleDateString());async function g(){y(s,!0),y(a,null),y(f,!1),y(o,!1);const B=await ot.createMcpToken();if(y(s,!1),!B.ok||B.token===void 0){y(a,B.error??"Could not create a token.",!0);return}y(i,B.token,!0),y(u,B.expiresAt??null,!0)}async function d(){if(c(i)!==null)try{await navigator.clipboard.writeText(c(i)),y(o,!0)}catch{y(o,!1)}}async function m(){y(s,!0),y(a,null);const B=await ot.revokeMcpTokens();if(y(s,!1),!B.ok){y(a,B.error??"Could not revoke tokens.",!0);return}y(i,null),y(u,null),y(f,!0)}function b(B){var C;(C=B.currentTarget)==null||C.select()}function _(B){B.preventDefault(),n(!1)}var T=r8(),v=R(I(T),4);{var O=B=>{var C=JO(),q=pt(C),x=I(q),j=I(x),Z=R(x,2),Y=R(q,4),E=I(Y),k=R(E,2),S=I(k);ue(()=>{fe(j,`Your new token${c(h)?` · expires ${c(h)}`:""}`),HE(Z,c(i)),fe(S,c(o)?"Copied":"Copy token")}),ae("click",Z,b),ae("click",E,()=>n(!1)),ae("click",k,d),H(B,C)},L=B=>{var C=n8(),q=pt(C);{var x=F=>{var M=e8(),Q=I(M);ue(()=>fe(Q,c(a))),H(F,M)};de(q,F=>{c(a)&&F(x)})}var j=R(q,2);{var Z=F=>{var M=t8();H(F,M)};de(j,F=>{c(f)&&F(Z)})}var Y=R(j,2),E=I(Y),k=R(E,4),S=R(k,2),U=I(S);ue(()=>{E.disabled=c(s),S.disabled=c(s),fe(U,c(s)?"Working…":"Create token")}),ae("click",E,m),ae("click",k,()=>n(!1)),ae("click",S,g),H(B,C)};de(v,B=>{c(i)!==null?B(O):B(L,-1)})}dn(T,B=>y(r,B),()=>c(r)),Be("cancel",T,_),H(t,T),ft()}At(["click"]);var a8=W('<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 i8(t,e){ct(e,!0);let n=ee(!1),r=ee(!1),s=Ae(()=>{var m;return((m=ot.principal)==null?void 0:m.username)??""});function a(){c(f)&&(c(f).open=!1)}function i(){a(),y(n,!0)}function u(){a(),y(r,!0)}async function o(){a(),await ot.logout()}let f=ee(void 0);kt(()=>{function m(b){c(f)&&c(f).open&&!c(f).contains(b.target)&&(c(f).open=!1)}return document.addEventListener("click",m),()=>document.removeEventListener("click",m)});var h=Ir(),g=pt(h);{var d=m=>{var b=a8(),_=pt(b),T=I(_),v=I(T),O=I(v),L=R(T,2),B=I(L),C=I(B),q=R(B,2),x=I(q),j=R(q,2),Z=I(j);dn(_,k=>y(f,k),()=>c(f));var Y=R(_,2);ZO(Y,{get open(){return c(n)},set open(k){y(n,k,!0)}});var E=R(Y,2);s8(E,{get open(){return c(r)},set open(k){y(r,k,!0)}}),ue(()=>fe(O,c(s))),ae("click",C,i),ae("click",x,u),ae("click",Z,o),H(m,b)};de(g,m=>{ot.status==="authenticated"&&ot.principal!==null&&m(d)})}H(t,h),ft()}At(["click"]);var u8=W('<p class="error svelte-1e3birj" role="alert"> </p>'),o8=W('<p class="ok svelte-1e3birj" role="status"> </p>'),l8=W('<img alt="Current logo" class="svelte-1e3birj"/>'),c8=W('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),f8=W('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),d8=W(`<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
120
- 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 h8(t,e){ct(e,!0);let n=ee(Tt(wn.name??"")),r=ee(!1),s=ee(!1),a=ee(null),i=ee(null),u=ee(void 0);function o(z){y(i,z,!0),setTimeout(()=>y(i,null),1500)}async function f(){y(r,!0),y(a,null);const z=c(n).trim(),$=await zA(z===""?null:z);if(y(r,!1),!$.ok){y(a,$.error,!0);return}await wn.load(),o("Name saved.")}async function h(z){var ne;const $=z.currentTarget,X=(ne=$.files)==null?void 0:ne[0];if(X===void 0)return;y(s,!0),y(a,null);const J=await WA(X);if(y(s,!1),$.value="",!J.ok){y(a,J.error,!0);return}await wn.load(),o("Logo updated.")}async function g(){y(a,null);const z=await GA();if(!z.ok){y(a,z.error,!0);return}await wn.load(),o("Logo removed.")}var d=d8(),m=R(I(d),2);{var b=z=>{var $=u8(),X=I($);ue(()=>fe(X,c(a))),H(z,$)};de(m,z=>{c(a)&&z(b)})}var _=R(m,2);{var T=z=>{var $=o8(),X=I($);ue(()=>fe(X,c(i))),H(z,$)};de(_,z=>{c(i)&&z(T)})}var v=R(_,2),O=R(I(v),2),L=I(O),B=R(L,2),C=I(B),q=R(v,2),x=R(I(q),2),j=I(x),Z=I(j);{var Y=z=>{var $=l8();ue(()=>me($,"src",wn.logoUrl)),H(z,$)},E=z=>{var $=c8();H(z,$)};de(Z,z=>{wn.logoUrl?z(Y):z(E,-1)})}var k=R(j,2),S=I(k);dn(S,z=>y(u,z),()=>c(u));var U=R(S,2),F=I(U),M=R(U,2);{var Q=z=>{var $=f8();ae("click",$,g),H(z,$)};de(M,z=>{wn.logoUrl&&z(Q)})}ue(()=>{B.disabled=c(r),fe(C,c(r)?"Saving…":"Save"),me(j,"aria-hidden",wn.logoUrl===null),U.disabled=c(s),fe(F,c(s)?"Uploading…":wn.logoUrl?"Replace logo…":"Upload logo…")}),Et(L,()=>c(n),z=>y(n,z)),ae("click",B,f),ae("change",S,h),ae("click",U,()=>{var z;return(z=c(u))==null?void 0:z.click()}),H(t,d),ft()}At(["click","change"]);var p8=W('<p class="error svelte-8ydvuj" role="alert"> </p>'),m8=W('<p class="ok svelte-8ydvuj" role="status"> </p>'),g8=W(`<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 b8(t,e){ct(e,!0);let n=ee(""),r=ee(!0),s=ee(!1),a=ee(null),i=ee(null);Uy().then(L=>{y(n,L.baseUrl,!0),y(r,!1)});function u(L){y(i,L,!0),setTimeout(()=>y(i,null),1500)}async function o(){y(s,!0),y(a,null);try{await Hy({baseUrl:c(n)}),u("Saved.")}catch(L){y(a,L instanceof Error?L.message:String(L),!0)}finally{y(s,!1)}}var f=g8(),h=R(I(f),2);{var g=L=>{var B=p8(),C=I(B);ue(()=>fe(C,c(a))),H(L,B)};de(h,L=>{c(a)&&L(g)})}var d=R(h,2);{var m=L=>{var B=m8(),C=I(B);ue(()=>fe(C,c(i))),H(L,B)};de(d,L=>{c(i)&&L(m)})}var b=R(d,2),_=R(I(b),2),T=I(_),v=R(T,2),O=I(v);ue(()=>{T.disabled=c(r),v.disabled=c(r)||c(s),fe(O,c(s)?"Saving…":"Save")}),Et(T,()=>c(n),L=>y(n,L)),ae("click",v,o),H(t,f),ft()}At(["click"]);async function v8(){const t=await mt("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const Ph={"content-type":"application/json"};function E8(t){return Ma("/api/users",{method:"POST",headers:Ph,body:JSON.stringify(t)})}function Z1(t,e){return Ma(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:Ph,body:JSON.stringify(e)})}function T8(t,e){return Ma(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:Ph,body:JSON.stringify(e)})}function _8(t){return Ma(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var A8=W('<p class="error svelte-plhp3i" role="alert"> </p>'),y8=W('<p class="muted svelte-plhp3i">Loading users…</p>'),N8=W('<p class="error svelte-plhp3i"> </p>'),S8=W('<span class="you svelte-plhp3i">(you)</span>'),I8=W('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),C8=W('<span class="you svelte-plhp3i">(you)</span>'),w8=W('<span class="username svelte-plhp3i"> <!></span>'),L8=W('<span class="chip locked svelte-plhp3i">Locked</span>'),O8=W('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),x8=W('<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>'),R8=W('<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>'),D8=W('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),k8=W('<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 P8(t,e){ct(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=ee(Tt([])),i=ee(!0),u=ee(null),o=ee(null),f=ee(""),h=ee(""),g=ee(""),d=ee(Tt(["author"])),m=ee(!1);const b=Ae(()=>{var ie;return((ie=ot.principal)==null?void 0:ie.userId)??null}),_=Ae(()=>!c(m)&&c(f).trim()!==""&&c(g)!==""&&c(d).length>0);async function T(){y(i,!0),y(u,null);try{y(a,await v8(),!0)}catch(ie){y(u,ie instanceof Error?ie.message:String(ie),!0)}finally{y(i,!1)}}kt(()=>{T()});async function v(ie){if(ie.preventDefault(),!c(_))return;y(m,!0),y(o,null);const he=await E8({username:c(f).trim(),password:c(g),roles:[...c(d)],...c(h).trim()!==""&&{displayName:c(h).trim()}});if(y(m,!1),!he.ok){y(o,he.error,!0);return}y(f,""),y(h,""),y(g,""),y(d,["author"],!0),await T()}async function O(ie){const he=await vu(`Display name for “${ie.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:ie.displayName??"",placeholder:ie.username});if(he===null)return;y(o,null);const Ce=await Z1(ie.id,{displayName:he});Ce.ok||y(o,Ce.error,!0),await T()}async function L(ie,he){const Ne=ie.roles.includes(he)?ie.roles.filter(Le=>Le!==he):[...ie.roles,he];if(Ne.length===0){y(o,"A user must keep at least one role."),await T();return}y(o,null);const Ie=await Z1(ie.id,{roles:Ne});Ie.ok||y(o,Ie.error,!0),await T()}async function B(ie){const he=await vu(`Set a new password for “${ie.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(he===null)return;y(o,null);const Ce=await T8(ie.id,{newPassword:he});Ce.ok||y(o,Ce.error,!0)}async function C(ie){if(!await hl(`Delete the user “${ie.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;y(o,null);const Ce=await _8(ie.id);if(!Ce.ok){y(o,Ce.error,!0);return}await T()}var q=k8(),x=I(q);{var j=ie=>{var he=A8(),Ce=I(he);ue(()=>fe(Ce,c(o))),H(ie,he)};de(x,ie=>{c(o)&&ie(j)})}var Z=R(x,2),Y=I(Z);{var E=ie=>{var he=y8();H(ie,he)},k=ie=>{var he=N8(),Ce=I(he);ue(()=>fe(Ce,c(u))),H(ie,he)},S=ie=>{var he=R8(),Ce=R(I(he));Ot(Ce,21,()=>c(a),Ne=>Ne.id,(Ne,Ie)=>{const Le=Ae(()=>c(Ie).id===c(b));var Re=x8(),$e=I(Re),We=I($e),rn=I(We);{var Ge=Ct=>{var xt=I8(),Xt=pt(xt),gt=I(Xt),zt=R(gt);{var mn=K=>{var ve=S8();H(K,ve)};de(zt,K=>{c(Le)&&K(mn)})}var mr=R(Xt,2),Vn=I(mr);ue(()=>{fe(gt,c(Ie).displayName),fe(Vn,c(Ie).username)}),H(Ct,xt)},$t=Ct=>{var xt=w8(),Xt=I(xt),gt=R(Xt);{var zt=mn=>{var mr=C8();H(mn,mr)};de(gt,mn=>{c(Le)&&mn(zt)})}ue(()=>fe(Xt,c(Ie).username)),H(Ct,xt)};de(rn,Ct=>{c(Ie).displayName?Ct(Ge):Ct($t,-1)})}var sn=R(We,2);{var Ut=Ct=>{var xt=L8();H(Ct,xt)};de(sn,Ct=>{c(Ie).locked&&Ct(Ut)})}var hn=R($e),pn=I(hn);Ot(pn,21,()=>r,Iu,(Ct,xt)=>{var Xt=O8(),gt=I(Xt),zt=R(gt);ue(mn=>{qE(gt,mn),gt.disabled=c(Le),fe(zt,` ${s[c(xt)]??""}`)},[()=>c(Ie).roles.includes(c(xt))]),ae("change",gt,()=>L(c(Ie),c(xt))),H(Ct,Xt)});var Yt=R(hn),Ht=I(Yt),Nn=R(Ht,2),qn=R(Nn,2);ue(()=>{me(pn,"title",c(Le)?"You can't change your own roles":void 0),qn.disabled=c(Le),me(qn,"title",c(Le)?"You can't delete your own account":void 0)}),ae("click",Ht,()=>O(c(Ie))),ae("click",Nn,()=>B(c(Ie))),ae("click",qn,()=>C(c(Ie))),H(Ne,Re)}),H(ie,he)};de(Y,ie=>{c(i)?ie(E):c(u)?ie(k,1):ie(S,-1)})}var U=R(Z,2),F=R(I(U),2),M=I(F),Q=R(I(M),2),z=R(M,2),$=R(I(z),2),X=R(z,2),J=R(I(X),2),ne=R(X,2),ge=R(I(ne),2);Ot(ge,21,()=>r,Iu,(ie,he)=>{var Ce=D8(),Ne=I(Ce),Ie,Le=R(Ne);ue(()=>{Ie!==(Ie=c(he))&&(Ne.value=(Ne.__value=c(he))??""),fe(Le,` ${s[c(he)]??""}`)}),YE(n,[],Ne,()=>(c(he),c(d)),Re=>y(d,Re)),H(ie,Ce)});var be=R(F,2),pe=R(I(be),2),Se=I(pe);ue(()=>{pe.disabled=!c(_),fe(Se,c(m)?"Adding…":"Add user")}),Be("submit",U,v),Et(Q,()=>c(f),ie=>y(f,ie)),Et($,()=>c(h),ie=>y(h,ie)),Et(J,()=>c(g),ie=>y(g,ie)),H(t,q),ft()}At(["change","click"]);var M8=W('<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></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function B8(t,e){ct(e,!0);let n=ur(e,"open",15),r=ee(void 0),s=ee("users");kt(()=>{c(r)&&(n()&&!c(r).open?(y(s,"users"),c(r).showModal()):!n()&&c(r).open&&c(r).close())});function a(q){q.preventDefault(),n(!1)}var i=M8(),u=I(i),o=R(I(u),2),f=I(o);dh(f,{size:18,"aria-hidden":"true"});var h=R(u,2),g=I(h);let d;var m=R(g,2);let b;var _=R(m,2);let T;var v=R(h,2),O=I(v);{var L=q=>{P8(q,{})},B=q=>{h8(q,{})},C=q=>{b8(q,{})};de(O,q=>{c(s)==="users"?q(L):c(s)==="branding"?q(B,1):q(C,-1)})}dn(i,q=>y(r,q),()=>c(r)),ue(()=>{me(g,"aria-selected",c(s)==="users"),d=it(g,1,"svelte-1eaqpj",null,d,{selected:c(s)==="users"}),me(m,"aria-selected",c(s)==="branding"),b=it(m,1,"svelte-1eaqpj",null,b,{selected:c(s)==="branding"}),me(_,"aria-selected",c(s)==="site"),T=it(_,1,"svelte-1eaqpj",null,T,{selected:c(s)==="site"})}),Be("cancel",i,a),ae("click",o,()=>n(!1)),ae("click",g,()=>y(s,"users")),ae("click",m,()=>y(s,"branding")),ae("click",_,()=>y(s,"site")),H(t,i),ft()}At(["click"]);const Gc="nanoesis-theme";function F8(t){return t==="system"||t==="light"||t==="dark"}function J1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function U8(){let t=ee("system"),e=ee(!1);const n=()=>{document.documentElement.dataset.theme=J1(c(t),c(e))};return{get choice(){return c(t)},get resolved(){return J1(c(t),c(e))},init(){const r=localStorage.getItem(Gc);F8(r)&&y(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");y(e,s.matches,!0),s.addEventListener("change",a=>{y(e,a.matches,!0),n()}),n()},setChoice(r){y(t,r,!0),r==="system"?localStorage.removeItem(Gc):localStorage.setItem(Gc,r),n()}}}const Jo=U8();var H8=W('<button type="button"> </button>'),q8=W('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function j8(t,e){ct(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];um();var r=q8();Ot(r,5,()=>n,s=>s.value,(s,a)=>{var i=H8();let u;var o=I(i);ue(()=>{u=it(i,1,"option svelte-1cmi4dh",null,u,{selected:Jo.choice===c(a).value}),me(i,"aria-pressed",Jo.choice===c(a).value),fe(o,c(a).label)}),ae("click",i,()=>Jo.setChoice(c(a).value)),H(s,i)}),H(t,r),ft()}At(["click"]);var $8=W('<button type="button"> </button>'),Y8=W('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),z8=W('<span class="spacer"></span>'),W8=W('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),G8=W('<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 K8(t,e){ct(e,!0);const n=Ae(()=>wn.logoUrl??Fb),r=Ae(()=>wn.name??"nanoesis"),s=Ae(()=>ot.canAuthor&&ot.canDevelop);let a=ee(!1);kt(()=>{ot.canDevelop&&!ot.canAuthor?Cs.set("templates"):ot.canAuthor&&!ot.canDevelop&&Cs.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"}];let u=ee(!1);async function o(){if(!c(u)){y(u,!0);try{const Y=await _y();if(Y.ok){const E=Y.summary;if(E===void 0){const k=Y.written;await en(`Published ${k} file${k===1?"":"s"} to the live site.`,{title:"Published"})}else if(E.published===0)await en(E.firstPublishWarning??"Your site has no published pages. Toggle Publish on at least one page to go live.",{title:"Nothing went live"});else{const k=E.published,S=E.drafts,U=[`Published ${k} page${k===1?"":"s"} to the live site.`];S>0&&U.push("",`${S} draft${S===1?" was":"s were"} skipped.`),await en(U.join(`
119
+ so treat it like a password.</p> <!></dialog>`);function c8(t,e){ct(e,!0);let n=ur(e,"open",15),r=ee(void 0),s=ee(!1),a=ee(null),i=ee(null),u=ee(null),o=ee(!1),f=ee(!1);kt(()=>{c(r)&&(n()&&!c(r).open?(y(s,!1),y(a,null),y(i,null),y(u,null),y(o,!1),y(f,!1),c(r).showModal()):!n()&&c(r).open&&c(r).close())});let h=Ae(()=>c(u)===null?"":new Date(c(u)).toLocaleDateString());async function g(){y(s,!0),y(a,null),y(f,!1),y(o,!1);const B=await ot.createMcpToken();if(y(s,!1),!B.ok||B.token===void 0){y(a,B.error??"Could not create a token.",!0);return}y(i,B.token,!0),y(u,B.expiresAt??null,!0)}async function d(){if(c(i)!==null)try{await navigator.clipboard.writeText(c(i)),y(o,!0)}catch{y(o,!1)}}async function m(){y(s,!0),y(a,null);const B=await ot.revokeMcpTokens();if(y(s,!1),!B.ok){y(a,B.error??"Could not revoke tokens.",!0);return}y(i,null),y(u,null),y(f,!0)}function b(B){var C;(C=B.currentTarget)==null||C.select()}function _(B){B.preventDefault(),n(!1)}var T=l8(),v=R(I(T),4);{var O=B=>{var C=a8(),q=pt(C),x=I(q),j=I(x),Z=R(x,2),Y=R(q,4),E=I(Y),k=R(E,2),S=I(k);ue(()=>{fe(j,`Your new token${c(h)?` · expires ${c(h)}`:""}`),zE(Z,c(i)),fe(S,c(o)?"Copied":"Copy token")}),ae("click",Z,b),ae("click",E,()=>n(!1)),ae("click",k,d),H(B,C)},L=B=>{var C=o8(),q=pt(C);{var x=F=>{var M=i8(),Q=I(M);ue(()=>fe(Q,c(a))),H(F,M)};de(q,F=>{c(a)&&F(x)})}var j=R(q,2);{var Z=F=>{var M=u8();H(F,M)};de(j,F=>{c(f)&&F(Z)})}var Y=R(j,2),E=I(Y),k=R(E,4),S=R(k,2),U=I(S);ue(()=>{E.disabled=c(s),S.disabled=c(s),fe(U,c(s)?"Working…":"Create token")}),ae("click",E,m),ae("click",k,()=>n(!1)),ae("click",S,g),H(B,C)};de(v,B=>{c(i)!==null?B(O):B(L,-1)})}dn(T,B=>y(r,B),()=>c(r)),Be("cancel",T,_),H(t,T),ft()}At(["click"]);var f8=W('<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 d8(t,e){ct(e,!0);let n=ee(!1),r=ee(!1),s=Ae(()=>{var m;return((m=ot.principal)==null?void 0:m.username)??""});function a(){c(f)&&(c(f).open=!1)}function i(){a(),y(n,!0)}function u(){a(),y(r,!0)}async function o(){a(),await ot.logout()}let f=ee(void 0);kt(()=>{function m(b){c(f)&&c(f).open&&!c(f).contains(b.target)&&(c(f).open=!1)}return document.addEventListener("click",m),()=>document.removeEventListener("click",m)});var h=Ir(),g=pt(h);{var d=m=>{var b=f8(),_=pt(b),T=I(_),v=I(T),O=I(v),L=R(T,2),B=I(L),C=I(B),q=R(B,2),x=I(q),j=R(q,2),Z=I(j);dn(_,k=>y(f,k),()=>c(f));var Y=R(_,2);s8(Y,{get open(){return c(n)},set open(k){y(n,k,!0)}});var E=R(Y,2);c8(E,{get open(){return c(r)},set open(k){y(r,k,!0)}}),ue(()=>fe(O,c(s))),ae("click",C,i),ae("click",x,u),ae("click",Z,o),H(m,b)};de(g,m=>{ot.status==="authenticated"&&ot.principal!==null&&m(d)})}H(t,h),ft()}At(["click"]);var h8=W('<p class="error svelte-1e3birj" role="alert"> </p>'),p8=W('<p class="ok svelte-1e3birj" role="status"> </p>'),m8=W('<img alt="Current logo" class="svelte-1e3birj"/>'),g8=W('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),b8=W('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),v8=W(`<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
120
+ 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 E8(t,e){ct(e,!0);let n=ee(Tt(wn.name??"")),r=ee(!1),s=ee(!1),a=ee(null),i=ee(null),u=ee(void 0);function o(z){y(i,z,!0),setTimeout(()=>y(i,null),1500)}async function f(){y(r,!0),y(a,null);const z=c(n).trim(),$=await XA(z===""?null:z);if(y(r,!1),!$.ok){y(a,$.error,!0);return}await wn.load(),o("Name saved.")}async function h(z){var ne;const $=z.currentTarget,X=(ne=$.files)==null?void 0:ne[0];if(X===void 0)return;y(s,!0),y(a,null);const J=await QA(X);if(y(s,!1),$.value="",!J.ok){y(a,J.error,!0);return}await wn.load(),o("Logo updated.")}async function g(){y(a,null);const z=await ZA();if(!z.ok){y(a,z.error,!0);return}await wn.load(),o("Logo removed.")}var d=v8(),m=R(I(d),2);{var b=z=>{var $=h8(),X=I($);ue(()=>fe(X,c(a))),H(z,$)};de(m,z=>{c(a)&&z(b)})}var _=R(m,2);{var T=z=>{var $=p8(),X=I($);ue(()=>fe(X,c(i))),H(z,$)};de(_,z=>{c(i)&&z(T)})}var v=R(_,2),O=R(I(v),2),L=I(O),B=R(L,2),C=I(B),q=R(v,2),x=R(I(q),2),j=I(x),Z=I(j);{var Y=z=>{var $=m8();ue(()=>me($,"src",wn.logoUrl)),H(z,$)},E=z=>{var $=g8();H(z,$)};de(Z,z=>{wn.logoUrl?z(Y):z(E,-1)})}var k=R(j,2),S=I(k);dn(S,z=>y(u,z),()=>c(u));var U=R(S,2),F=I(U),M=R(U,2);{var Q=z=>{var $=b8();ae("click",$,g),H(z,$)};de(M,z=>{wn.logoUrl&&z(Q)})}ue(()=>{B.disabled=c(r),fe(C,c(r)?"Saving…":"Save"),me(j,"aria-hidden",wn.logoUrl===null),U.disabled=c(s),fe(F,c(s)?"Uploading…":wn.logoUrl?"Replace logo…":"Upload logo…")}),Et(L,()=>c(n),z=>y(n,z)),ae("click",B,f),ae("change",S,h),ae("click",U,()=>{var z;return(z=c(u))==null?void 0:z.click()}),H(t,d),ft()}At(["click","change"]);var T8=W('<p class="error svelte-8ydvuj" role="alert"> </p>'),_8=W('<p class="ok svelte-8ydvuj" role="status"> </p>'),A8=W(`<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 y8(t,e){ct(e,!0);let n=ee(""),r=ee(!0),s=ee(!1),a=ee(null),i=ee(null);Yy().then(L=>{y(n,L.baseUrl,!0),y(r,!1)});function u(L){y(i,L,!0),setTimeout(()=>y(i,null),1500)}async function o(){y(s,!0),y(a,null);try{await zy({baseUrl:c(n)}),u("Saved.")}catch(L){y(a,L instanceof Error?L.message:String(L),!0)}finally{y(s,!1)}}var f=A8(),h=R(I(f),2);{var g=L=>{var B=T8(),C=I(B);ue(()=>fe(C,c(a))),H(L,B)};de(h,L=>{c(a)&&L(g)})}var d=R(h,2);{var m=L=>{var B=_8(),C=I(B);ue(()=>fe(C,c(i))),H(L,B)};de(d,L=>{c(i)&&L(m)})}var b=R(d,2),_=R(I(b),2),T=I(_),v=R(T,2),O=I(v);ue(()=>{T.disabled=c(r),v.disabled=c(r)||c(s),fe(O,c(s)?"Saving…":"Save")}),Et(T,()=>c(n),L=>y(n,L)),ae("click",v,o),H(t,f),ft()}At(["click"]);async function N8(){const t=await mt("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const Ph={"content-type":"application/json"};function S8(t){return Ma("/api/users",{method:"POST",headers:Ph,body:JSON.stringify(t)})}function J1(t,e){return Ma(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:Ph,body:JSON.stringify(e)})}function I8(t,e){return Ma(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:Ph,body:JSON.stringify(e)})}function C8(t){return Ma(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var w8=W('<p class="error svelte-plhp3i" role="alert"> </p>'),L8=W('<p class="muted svelte-plhp3i">Loading users…</p>'),O8=W('<p class="error svelte-plhp3i"> </p>'),x8=W('<span class="you svelte-plhp3i">(you)</span>'),R8=W('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),D8=W('<span class="you svelte-plhp3i">(you)</span>'),k8=W('<span class="username svelte-plhp3i"> <!></span>'),P8=W('<span class="chip locked svelte-plhp3i">Locked</span>'),M8=W('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),B8=W('<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>'),F8=W('<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>'),U8=W('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),H8=W('<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 q8(t,e){ct(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=ee(Tt([])),i=ee(!0),u=ee(null),o=ee(null),f=ee(""),h=ee(""),g=ee(""),d=ee(Tt(["author"])),m=ee(!1);const b=Ae(()=>{var ie;return((ie=ot.principal)==null?void 0:ie.userId)??null}),_=Ae(()=>!c(m)&&c(f).trim()!==""&&c(g)!==""&&c(d).length>0);async function T(){y(i,!0),y(u,null);try{y(a,await N8(),!0)}catch(ie){y(u,ie instanceof Error?ie.message:String(ie),!0)}finally{y(i,!1)}}kt(()=>{T()});async function v(ie){if(ie.preventDefault(),!c(_))return;y(m,!0),y(o,null);const he=await S8({username:c(f).trim(),password:c(g),roles:[...c(d)],...c(h).trim()!==""&&{displayName:c(h).trim()}});if(y(m,!1),!he.ok){y(o,he.error,!0);return}y(f,""),y(h,""),y(g,""),y(d,["author"],!0),await T()}async function O(ie){const he=await vu(`Display name for “${ie.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:ie.displayName??"",placeholder:ie.username});if(he===null)return;y(o,null);const Ce=await J1(ie.id,{displayName:he});Ce.ok||y(o,Ce.error,!0),await T()}async function L(ie,he){const Ne=ie.roles.includes(he)?ie.roles.filter(Le=>Le!==he):[...ie.roles,he];if(Ne.length===0){y(o,"A user must keep at least one role."),await T();return}y(o,null);const Ie=await J1(ie.id,{roles:Ne});Ie.ok||y(o,Ie.error,!0),await T()}async function B(ie){const he=await vu(`Set a new password for “${ie.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(he===null)return;y(o,null);const Ce=await I8(ie.id,{newPassword:he});Ce.ok||y(o,Ce.error,!0)}async function C(ie){if(!await hl(`Delete the user “${ie.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;y(o,null);const Ce=await C8(ie.id);if(!Ce.ok){y(o,Ce.error,!0);return}await T()}var q=H8(),x=I(q);{var j=ie=>{var he=w8(),Ce=I(he);ue(()=>fe(Ce,c(o))),H(ie,he)};de(x,ie=>{c(o)&&ie(j)})}var Z=R(x,2),Y=I(Z);{var E=ie=>{var he=L8();H(ie,he)},k=ie=>{var he=O8(),Ce=I(he);ue(()=>fe(Ce,c(u))),H(ie,he)},S=ie=>{var he=F8(),Ce=R(I(he));Ot(Ce,21,()=>c(a),Ne=>Ne.id,(Ne,Ie)=>{const Le=Ae(()=>c(Ie).id===c(b));var Re=B8(),$e=I(Re),We=I($e),rn=I(We);{var Ge=Ct=>{var xt=R8(),Xt=pt(xt),gt=I(Xt),zt=R(gt);{var mn=G=>{var ve=x8();H(G,ve)};de(zt,G=>{c(Le)&&G(mn)})}var mr=R(Xt,2),Vn=I(mr);ue(()=>{fe(gt,c(Ie).displayName),fe(Vn,c(Ie).username)}),H(Ct,xt)},$t=Ct=>{var xt=k8(),Xt=I(xt),gt=R(Xt);{var zt=mn=>{var mr=D8();H(mn,mr)};de(gt,mn=>{c(Le)&&mn(zt)})}ue(()=>fe(Xt,c(Ie).username)),H(Ct,xt)};de(rn,Ct=>{c(Ie).displayName?Ct(Ge):Ct($t,-1)})}var sn=R(We,2);{var Ut=Ct=>{var xt=P8();H(Ct,xt)};de(sn,Ct=>{c(Ie).locked&&Ct(Ut)})}var hn=R($e),pn=I(hn);Ot(pn,21,()=>r,Iu,(Ct,xt)=>{var Xt=M8(),gt=I(Xt),zt=R(gt);ue(mn=>{WE(gt,mn),gt.disabled=c(Le),fe(zt,` ${s[c(xt)]??""}`)},[()=>c(Ie).roles.includes(c(xt))]),ae("change",gt,()=>L(c(Ie),c(xt))),H(Ct,Xt)});var Yt=R(hn),Ht=I(Yt),Nn=R(Ht,2),qn=R(Nn,2);ue(()=>{me(pn,"title",c(Le)?"You can't change your own roles":void 0),qn.disabled=c(Le),me(qn,"title",c(Le)?"You can't delete your own account":void 0)}),ae("click",Ht,()=>O(c(Ie))),ae("click",Nn,()=>B(c(Ie))),ae("click",qn,()=>C(c(Ie))),H(Ne,Re)}),H(ie,he)};de(Y,ie=>{c(i)?ie(E):c(u)?ie(k,1):ie(S,-1)})}var U=R(Z,2),F=R(I(U),2),M=I(F),Q=R(I(M),2),z=R(M,2),$=R(I(z),2),X=R(z,2),J=R(I(X),2),ne=R(X,2),ge=R(I(ne),2);Ot(ge,21,()=>r,Iu,(ie,he)=>{var Ce=U8(),Ne=I(Ce),Ie,Le=R(Ne);ue(()=>{Ie!==(Ie=c(he))&&(Ne.value=(Ne.__value=c(he))??""),fe(Le,` ${s[c(he)]??""}`)}),VE(n,[],Ne,()=>(c(he),c(d)),Re=>y(d,Re)),H(ie,Ce)});var be=R(F,2),pe=R(I(be),2),Se=I(pe);ue(()=>{pe.disabled=!c(_),fe(Se,c(m)?"Adding…":"Add user")}),Be("submit",U,v),Et(Q,()=>c(f),ie=>y(f,ie)),Et($,()=>c(h),ie=>y(h,ie)),Et(J,()=>c(g),ie=>y(g,ie)),H(t,q),ft()}At(["change","click"]);var j8=W('<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></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function $8(t,e){ct(e,!0);let n=ur(e,"open",15),r=ee(void 0),s=ee("users");kt(()=>{c(r)&&(n()&&!c(r).open?(y(s,"users"),c(r).showModal()):!n()&&c(r).open&&c(r).close())});function a(q){q.preventDefault(),n(!1)}var i=j8(),u=I(i),o=R(I(u),2),f=I(o);dh(f,{size:18,"aria-hidden":"true"});var h=R(u,2),g=I(h);let d;var m=R(g,2);let b;var _=R(m,2);let T;var v=R(h,2),O=I(v);{var L=q=>{q8(q,{})},B=q=>{E8(q,{})},C=q=>{y8(q,{})};de(O,q=>{c(s)==="users"?q(L):c(s)==="branding"?q(B,1):q(C,-1)})}dn(i,q=>y(r,q),()=>c(r)),ue(()=>{me(g,"aria-selected",c(s)==="users"),d=it(g,1,"svelte-1eaqpj",null,d,{selected:c(s)==="users"}),me(m,"aria-selected",c(s)==="branding"),b=it(m,1,"svelte-1eaqpj",null,b,{selected:c(s)==="branding"}),me(_,"aria-selected",c(s)==="site"),T=it(_,1,"svelte-1eaqpj",null,T,{selected:c(s)==="site"})}),Be("cancel",i,a),ae("click",o,()=>n(!1)),ae("click",g,()=>y(s,"users")),ae("click",m,()=>y(s,"branding")),ae("click",_,()=>y(s,"site")),H(t,i),ft()}At(["click"]);const Gc="nanoesis-theme";function Y8(t){return t==="system"||t==="light"||t==="dark"}function ep(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function z8(){let t=ee("system"),e=ee(!1);const n=()=>{document.documentElement.dataset.theme=ep(c(t),c(e))};return{get choice(){return c(t)},get resolved(){return ep(c(t),c(e))},init(){const r=localStorage.getItem(Gc);Y8(r)&&y(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");y(e,s.matches,!0),s.addEventListener("change",a=>{y(e,a.matches,!0),n()}),n()},setChoice(r){y(t,r,!0),r==="system"?localStorage.removeItem(Gc):localStorage.setItem(Gc,r),n()}}}const Jo=z8();var W8=W('<button type="button"> </button>'),G8=W('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function K8(t,e){ct(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];om();var r=G8();Ot(r,5,()=>n,s=>s.value,(s,a)=>{var i=W8();let u;var o=I(i);ue(()=>{u=it(i,1,"option svelte-1cmi4dh",null,u,{selected:Jo.choice===c(a).value}),me(i,"aria-pressed",Jo.choice===c(a).value),fe(o,c(a).label)}),ae("click",i,()=>Jo.setChoice(c(a).value)),H(s,i)}),H(t,r),ft()}At(["click"]);var V8=W('<button type="button"> </button>'),X8=W('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),Q8=W('<span class="spacer"></span>'),Z8=W('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),J8=W('<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 e5(t,e){ct(e,!0);const n=Ae(()=>wn.logoUrl??$b),r=Ae(()=>wn.name??"nanoesis"),s=Ae(()=>ot.canAuthor&&ot.canDevelop);let a=ee(!1);kt(()=>{ot.canDevelop&&!ot.canAuthor?Cs.set("templates"):ot.canAuthor&&!ot.canDevelop&&Cs.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"}];let u=ee(!1);async function o(){if(!c(u)){y(u,!0);try{const Y=await Iy();if(Y.ok){const E=Y.summary;if(E===void 0){const k=Y.written;await en(`Published ${k} file${k===1?"":"s"} to the live site.`,{title:"Published"})}else if(E.published===0)await en(E.firstPublishWarning??"Your site has no published pages. Toggle Publish on at least one page to go live.",{title:"Nothing went live"});else{const k=E.published,S=E.drafts,U=[`Published ${k} page${k===1?"":"s"} to the live site.`];S>0&&U.push("",`${S} draft${S===1?" was":"s were"} skipped.`),await en(U.join(`
121
121
  `),{title:"Published"})}}else await en(`Fix these, then publish again:
122
122
 
123
123
  • ${Y.errors.join(`
124
- • `)}`,{title:`Publish blocked, ${Y.errors.length} ${Y.errors.length===1?"thing":"things"} would break`})}catch(Y){await en(Y instanceof Error?Y.message:String(Y),{title:"Publish failed"})}finally{y(u,!1)}}}var f=G8(),h=pt(f),g=I(h),d=I(g),m=R(d,1,!0),b=R(g,2);{var _=Y=>{var E=Y8();Ot(E,21,()=>i,k=>k.value,(k,S)=>{var U=$8();let F;var M=I(U);ue(()=>{F=it(U,1,"option svelte-yic9pk",null,F,{selected:Cs.mode===c(S).value}),me(U,"aria-pressed",Cs.mode===c(S).value),fe(M,c(S).label)}),ae("click",U,()=>Cs.set(c(S).value)),H(k,U)}),H(Y,E)},T=Y=>{var E=z8();H(Y,E)};de(b,Y=>{c(s)?Y(_):Y(T,-1)})}var v=R(b,2),O=I(v);j8(O,{});var L=R(O,2),B=I(L),C=R(L,2);{var q=Y=>{var E=W8(),k=I(E);fh(k,{size:18,"aria-hidden":"true"}),ae("click",E,()=>y(a,!0)),H(Y,E)};de(C,Y=>{ot.isAdmin&&Y(q)})}var x=R(C,2);i8(x,{});var j=R(h,2);{var Z=Y=>{B8(Y,{get open(){return c(a)},set open(E){y(a,E,!0)}})};de(j,Y=>{ot.isAdmin&&Y(Z)})}ue(()=>{me(d,"src",c(n)),fe(m,c(r)),L.disabled=c(u),fe(B,c(u)?"Publishing…":"Publish")}),ae("click",L,o),H(t,f),ft()}At(["click"]);var V8=W('<li class="hint svelte-2dodtm">Loading…</li>'),X8=W('<li class="hint svelte-2dodtm">Empty</li>'),Q8=W('<p class="hint nested svelte-2dodtm">Loading…</p>'),Z8=W("<div><!> <!></div>"),J8=W('<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>'),e5=W('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),t5=W("<ul><!></ul>");function jb(t,e){ct(e,!0),kt(()=>{Bl(e.treePath)});const n=Ae(()=>ri(e.treePath)),r=Ae(()=>{var x;return((x=c(n))==null?void 0:x.defaultTemplate)??e.inheritedTemplate}),s=Ae(()=>{var x;return(((x=c(n))==null?void 0:x.entries)??[]).filter(j=>!(j.kind==="item"&&j.slug==="index"))});function a(x){return`tree-group-${x.replace(/\//g,"--")||"root"}`}function i(x){Va(x)||q0(x),e.onopenDir(x)}function u(x){return x.template??c(r)}function o(x){return x.isPublished?void 0:`${x.title}, not published`}function f(x){var Y;const j=[...x],Z=(((Y=c(n))==null?void 0:Y.entries)??[]).map(E=>c(s).includes(E)?j.shift()??E.slug:E.slug);Ky(e.treePath,Z),e.onreorder(e.treePath,Z)}function h(x,j){const Z=c(s).map(E=>E.slug),Y=Z.indexOf(x);Y<0||f(Kf(Z,Y,Y+j))}function g(x,j){x.key==="ArrowUp"?(x.preventDefault(),h(j.slug,-1)):x.key==="ArrowDown"&&(x.preventDefault(),h(j.slug,1))}function d(x,j){uN(x,e.treePath),j.dataTransfer&&(j.dataTransfer.effectAllowed="move",j.dataTransfer.setData("text/plain",x.slug))}function m(x,j){return j.kind==="dir"&&j.path!==x.entry.path&&x.parent!==j.path&&!j.path.startsWith(`${x.entry.path}/`)}function b(x,j){return x.parent===e.treePath&&j.path!==x.entry.path}function _(x,j){const Z=si();Z!==null&&(!m(Z,x)&&!b(Z,x)||(j.preventDefault(),j.dataTransfer&&(j.dataTransfer.dropEffect="move"),Lc(x.path)))}function T(x,j){j.preventDefault();const Z=si();if(Ss(),Z===null)return;if(m(Z,x)){e.onmove(Z.entry.path,Z.entry.kind,x.path);return}if(!b(Z,x))return;const Y=c(s).map(S=>S.slug),E=Y.indexOf(Z.entry.slug),k=Y.indexOf(x.slug);E<0||k<0||f(Kf(Y,E,k))}var v=t5();let O;var L=I(v);{var B=x=>{var j=V8();H(x,j)},C=x=>{var j=X8();H(x,j)},q=x=>{var j=Ir(),Z=pt(j);Ot(Z,17,()=>c(s),Y=>Y.path,(Y,E)=>{var k=Ir(),S=pt(k);{var U=M=>{var Q=J8(),z=I(Q);let $;var X=I(z),J=I(X);zf(J,{size:16,"aria-hidden":"true"});var ne=R(X,2),ge=I(ne);{var be=Ge=>{nN(Ge,{size:16,"aria-hidden":"true"})},pe=Ae(()=>Va(c(E).path)),Se=Ge=>{tN(Ge,{size:16,"aria-hidden":"true"})};de(ge,Ge=>{c(pe)?Ge(be):Ge(Se,-1)})}var ie=R(ne,2);let he;var Ce=I(ie),Ne=I(Ce),Ie=R(ie,2),Le=I(Ie),Re=I(Le);fh(Re,{size:16,"aria-hidden":"true"});var $e=R(z,2);{var We=Ge=>{var $t=Z8(),sn=I($t);{var Ut=Yt=>{var Ht=Q8();H(Yt,Ht)},hn=Ae(()=>zy(c(E).path)&&ri(c(E).path)===void 0);de(sn,Yt=>{c(hn)&&Yt(Ut)})}var pn=R(sn,2);{let Yt=Ae(()=>e.level+1);jb(pn,{get treePath(){return c(E).path},get inheritedTemplate(){return c(r)},get level(){return c(Yt)},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 onreorder(){return e.onreorder},get onmove(){return e.onmove}})}ue(Yt=>me($t,"id",Yt),[()=>a(c(E).path)]),H(Ge,$t)},rn=Ae(()=>Va(c(E).path));de($e,Ge=>{c(rn)&&Ge(We)})}ue((Ge,$t,sn,Ut)=>{$=it(z,1,"row svelte-2dodtm",null,$,Ge),me(X,"aria-label",`Reorder ${c(E).name}; arrow keys move it`),me(ne,"aria-expanded",$t),me(ne,"aria-controls",sn),me(ne,"aria-label",Ut),he=it(ie,1,"dir svelte-2dodtm",null,he,{active:c(E).path===e.activeDir}),me(ie,"aria-current",c(E).path===e.activeDir),me(ie,"title",`${c(E).name}, open this section's page`),fe(Ne,c(E).name),me(Le,"aria-label",`Settings for ${c(E).name}`)},[()=>({active:c(E).path===e.activeDir,"drop-target":$0()===c(E).path}),()=>Va(c(E).path),()=>a(c(E).path),()=>`${Va(c(E).path)?"Collapse":"Expand"} ${c(E).name}`]),Be("dragstart",z,Ge=>d(c(E),Ge)),Be("dragover",z,Ge=>_(c(E),Ge)),Be("dragleave",z,()=>Lc(null)),Be("drop",z,Ge=>T(c(E),Ge)),Be("dragend",z,function(...Ge){Ss==null||Ss.apply(this,Ge)}),ae("keydown",X,Ge=>g(Ge,c(E))),ae("click",ne,()=>q0(c(E).path)),ae("click",ie,()=>i(c(E).path)),ae("click",Le,()=>e.onsettingsDir(c(E).path)),H(M,Q)},F=M=>{var Q=e5(),z=I(Q);let $;var X=I(z),J=I(X);zf(J,{size:16,"aria-hidden":"true"});var ne=R(X,2);let ge;var be=I(ne),pe=I(be);ue((Se,ie)=>{$=it(z,1,"row svelte-2dodtm",null,$,Se),me(X,"aria-label",`Reorder ${c(E).title}; arrow keys move it`),ge=it(ne,1,"item svelte-2dodtm",null,ge,{selected:c(E).path===e.selectedPath,unpublished:!c(E).isPublished}),me(ne,"aria-current",c(E).path===e.selectedPath),me(ne,"aria-label",ie),me(ne,"title",c(E).title),fe(pe,c(E).title)},[()=>({"drop-target":$0()===c(E).path}),()=>o(c(E))]),Be("dragstart",z,Se=>d(c(E),Se)),Be("dragover",z,Se=>_(c(E),Se)),Be("dragleave",z,()=>Lc(null)),Be("drop",z,Se=>T(c(E),Se)),Be("dragend",z,function(...Se){Ss==null||Ss.apply(this,Se)}),ae("keydown",X,Se=>g(Se,c(E))),ae("click",ne,()=>e.onselect(c(E).path,u(c(E)))),H(M,Q)};de(S,M=>{c(E).kind==="dir"?M(U):M(F,-1)})}H(Y,k)}),H(x,j)};de(L,x=>{c(n)===void 0?x(B):c(s).length===0?x(C,1):x(q,-1)})}ue(()=>O=it(v,1,"level svelte-2dodtm",null,O,{root:e.level===1})),H(t,v),ft()}At(["keydown","click"]);var n5=W('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),r5=W('<p class="placeholder svelte-whg6dh"> </p>'),s5=W('<p class="placeholder svelte-whg6dh"> </p>'),a5=W('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),i5=W('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),u5=W('<span class="home-hint svelte-whg6dh">needs template</span>'),o5=W('<span class="home-hint svelte-whg6dh">draft</span>'),l5=W("<div>Move to top level</div>"),c5=W('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),f5=W("<option> </option>"),d5=W('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),h5=W(`<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
124
+ • `)}`,{title:`Publish blocked, ${Y.errors.length} ${Y.errors.length===1?"thing":"things"} would break`})}catch(Y){await en(Y instanceof Error?Y.message:String(Y),{title:"Publish failed"})}finally{y(u,!1)}}}var f=J8(),h=pt(f),g=I(h),d=I(g),m=R(d,1,!0),b=R(g,2);{var _=Y=>{var E=X8();Ot(E,21,()=>i,k=>k.value,(k,S)=>{var U=V8();let F;var M=I(U);ue(()=>{F=it(U,1,"option svelte-yic9pk",null,F,{selected:Cs.mode===c(S).value}),me(U,"aria-pressed",Cs.mode===c(S).value),fe(M,c(S).label)}),ae("click",U,()=>Cs.set(c(S).value)),H(k,U)}),H(Y,E)},T=Y=>{var E=Q8();H(Y,E)};de(b,Y=>{c(s)?Y(_):Y(T,-1)})}var v=R(b,2),O=I(v);K8(O,{});var L=R(O,2),B=I(L),C=R(L,2);{var q=Y=>{var E=Z8(),k=I(E);fh(k,{size:18,"aria-hidden":"true"}),ae("click",E,()=>y(a,!0)),H(Y,E)};de(C,Y=>{ot.isAdmin&&Y(q)})}var x=R(C,2);d8(x,{});var j=R(h,2);{var Z=Y=>{$8(Y,{get open(){return c(a)},set open(E){y(a,E,!0)}})};de(j,Y=>{ot.isAdmin&&Y(Z)})}ue(()=>{me(d,"src",c(n)),fe(m,c(r)),L.disabled=c(u),fe(B,c(u)?"Publishing…":"Publish")}),ae("click",L,o),H(t,f),ft()}At(["click"]);var t5=W('<li class="hint svelte-2dodtm">Loading…</li>'),n5=W('<li class="hint svelte-2dodtm">Empty</li>'),r5=W('<p class="hint nested svelte-2dodtm">Loading…</p>'),s5=W("<div><!> <!></div>"),a5=W('<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>'),i5=W('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),u5=W("<ul><!></ul>");function Gb(t,e){ct(e,!0),kt(()=>{Bl(e.treePath)});const n=Ae(()=>ri(e.treePath)),r=Ae(()=>{var x;return((x=c(n))==null?void 0:x.defaultTemplate)??e.inheritedTemplate}),s=Ae(()=>{var x;return(((x=c(n))==null?void 0:x.entries)??[]).filter(j=>!(j.kind==="item"&&j.slug==="index"))});function a(x){return`tree-group-${x.replace(/\//g,"--")||"root"}`}function i(x){Va(x)||q0(x),e.onopenDir(x)}function u(x){return x.template??c(r)}function o(x){return x.isPublished?void 0:`${x.title}, not published`}function f(x){var Y;const j=[...x],Z=(((Y=c(n))==null?void 0:Y.entries)??[]).map(E=>c(s).includes(E)?j.shift()??E.slug:E.slug);Jy(e.treePath,Z),e.onreorder(e.treePath,Z)}function h(x,j){const Z=c(s).map(E=>E.slug),Y=Z.indexOf(x);Y<0||f(Kf(Z,Y,Y+j))}function g(x,j){x.key==="ArrowUp"?(x.preventDefault(),h(j.slug,-1)):x.key==="ArrowDown"&&(x.preventDefault(),h(j.slug,1))}function d(x,j){hN(x,e.treePath),j.dataTransfer&&(j.dataTransfer.effectAllowed="move",j.dataTransfer.setData("text/plain",x.slug))}function m(x,j){return j.kind==="dir"&&j.path!==x.entry.path&&x.parent!==j.path&&!j.path.startsWith(`${x.entry.path}/`)}function b(x,j){return x.parent===e.treePath&&j.path!==x.entry.path}function _(x,j){const Z=si();Z!==null&&(!m(Z,x)&&!b(Z,x)||(j.preventDefault(),j.dataTransfer&&(j.dataTransfer.dropEffect="move"),Lc(x.path)))}function T(x,j){j.preventDefault();const Z=si();if(Ss(),Z===null)return;if(m(Z,x)){e.onmove(Z.entry.path,Z.entry.kind,x.path);return}if(!b(Z,x))return;const Y=c(s).map(S=>S.slug),E=Y.indexOf(Z.entry.slug),k=Y.indexOf(x.slug);E<0||k<0||f(Kf(Y,E,k))}var v=u5();let O;var L=I(v);{var B=x=>{var j=t5();H(x,j)},C=x=>{var j=n5();H(x,j)},q=x=>{var j=Ir(),Z=pt(j);Ot(Z,17,()=>c(s),Y=>Y.path,(Y,E)=>{var k=Ir(),S=pt(k);{var U=M=>{var Q=a5(),z=I(Q);let $;var X=I(z),J=I(X);zf(J,{size:16,"aria-hidden":"true"});var ne=R(X,2),ge=I(ne);{var be=Ge=>{oN(Ge,{size:16,"aria-hidden":"true"})},pe=Ae(()=>Va(c(E).path)),Se=Ge=>{uN(Ge,{size:16,"aria-hidden":"true"})};de(ge,Ge=>{c(pe)?Ge(be):Ge(Se,-1)})}var ie=R(ne,2);let he;var Ce=I(ie),Ne=I(Ce),Ie=R(ie,2),Le=I(Ie),Re=I(Le);fh(Re,{size:16,"aria-hidden":"true"});var $e=R(z,2);{var We=Ge=>{var $t=s5(),sn=I($t);{var Ut=Yt=>{var Ht=r5();H(Yt,Ht)},hn=Ae(()=>Xy(c(E).path)&&ri(c(E).path)===void 0);de(sn,Yt=>{c(hn)&&Yt(Ut)})}var pn=R(sn,2);{let Yt=Ae(()=>e.level+1);Gb(pn,{get treePath(){return c(E).path},get inheritedTemplate(){return c(r)},get level(){return c(Yt)},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 onreorder(){return e.onreorder},get onmove(){return e.onmove}})}ue(Yt=>me($t,"id",Yt),[()=>a(c(E).path)]),H(Ge,$t)},rn=Ae(()=>Va(c(E).path));de($e,Ge=>{c(rn)&&Ge(We)})}ue((Ge,$t,sn,Ut)=>{$=it(z,1,"row svelte-2dodtm",null,$,Ge),me(X,"aria-label",`Reorder ${c(E).name}; arrow keys move it`),me(ne,"aria-expanded",$t),me(ne,"aria-controls",sn),me(ne,"aria-label",Ut),he=it(ie,1,"dir svelte-2dodtm",null,he,{active:c(E).path===e.activeDir}),me(ie,"aria-current",c(E).path===e.activeDir),me(ie,"title",`${c(E).name}, open this section's page`),fe(Ne,c(E).name),me(Le,"aria-label",`Settings for ${c(E).name}`)},[()=>({active:c(E).path===e.activeDir,"drop-target":Y0()===c(E).path}),()=>Va(c(E).path),()=>a(c(E).path),()=>`${Va(c(E).path)?"Collapse":"Expand"} ${c(E).name}`]),Be("dragstart",z,Ge=>d(c(E),Ge)),Be("dragover",z,Ge=>_(c(E),Ge)),Be("dragleave",z,()=>Lc(null)),Be("drop",z,Ge=>T(c(E),Ge)),Be("dragend",z,function(...Ge){Ss==null||Ss.apply(this,Ge)}),ae("keydown",X,Ge=>g(Ge,c(E))),ae("click",ne,()=>q0(c(E).path)),ae("click",ie,()=>i(c(E).path)),ae("click",Le,()=>e.onsettingsDir(c(E).path)),H(M,Q)},F=M=>{var Q=i5(),z=I(Q);let $;var X=I(z),J=I(X);zf(J,{size:16,"aria-hidden":"true"});var ne=R(X,2);let ge;var be=I(ne),pe=I(be);ue((Se,ie)=>{$=it(z,1,"row svelte-2dodtm",null,$,Se),me(X,"aria-label",`Reorder ${c(E).title}; arrow keys move it`),ge=it(ne,1,"item svelte-2dodtm",null,ge,{selected:c(E).path===e.selectedPath,unpublished:!c(E).isPublished}),me(ne,"aria-current",c(E).path===e.selectedPath),me(ne,"aria-label",ie),me(ne,"title",c(E).title),fe(pe,c(E).title)},[()=>({"drop-target":Y0()===c(E).path}),()=>o(c(E))]),Be("dragstart",z,Se=>d(c(E),Se)),Be("dragover",z,Se=>_(c(E),Se)),Be("dragleave",z,()=>Lc(null)),Be("drop",z,Se=>T(c(E),Se)),Be("dragend",z,function(...Se){Ss==null||Ss.apply(this,Se)}),ae("keydown",X,Se=>g(Se,c(E))),ae("click",ne,()=>e.onselect(c(E).path,u(c(E)))),H(M,Q)};de(S,M=>{c(E).kind==="dir"?M(U):M(F,-1)})}H(Y,k)}),H(x,j)};de(L,x=>{c(n)===void 0?x(B):c(s).length===0?x(C,1):x(q,-1)})}ue(()=>O=it(v,1,"level svelte-2dodtm",null,O,{root:e.level===1})),H(t,v),ft()}At(["keydown","click"]);var o5=W('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),l5=W('<p class="placeholder svelte-whg6dh"> </p>'),c5=W('<p class="placeholder svelte-whg6dh"> </p>'),f5=W('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),d5=W('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),h5=W('<span class="home-hint svelte-whg6dh">needs template</span>'),p5=W('<span class="home-hint svelte-whg6dh">draft</span>'),m5=W("<div>Move to top level</div>"),g5=W('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),b5=W("<option> </option>"),v5=W('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),E5=W(`<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
125
125
  an item was created before its template existed (a common state after recovering a
126
- store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`),p5=W(`<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
127
- editing. This only happens once.</p></div></div>`),m5=W(`<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,
126
+ store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`),T5=W(`<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
127
+ editing. This only happens once.</p></div></div>`),_5=W(`<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,
128
128
  the template is the schema. Switch to <strong>Templates</strong> to edit those templates
129
- and components directly.</p></div></div>`),g5=W('<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>'),b5=W('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!>',1);function v5(t,e){ct(e,!0);let n=ee(null);kt(()=>{const K=Wf.target;K!==null&&(Wf.clear(),Cs.set("content"),C(K))});let r=ee(null),s=ee(""),a=ee(null),i=ee(!1);function u(K){return K==="index"?"":K.endsWith("/index")?K.slice(0,-6):null}const o=Ae(()=>c(r)??(c(n)!==null?u(c(n).path):null)),f=Ae(()=>c(n)!==null&&u(c(n).path)!==null),h=Ae(()=>{var K;return((K=c(n))==null?void 0:K.path)==="index"});let g=ee(""),d=ee(Tt([])),m=ee(-1),b=ee(void 0),_;kt(()=>{const K=c(g);if(clearTimeout(_),K.trim()===""){y(d,[],!0),y(m,-1);return}return _=setTimeout(()=>{mg(K).then(ve=>{K===c(g)&&(y(d,ve,!0),y(m,ve.length>0?0:-1,!0))})},200),()=>clearTimeout(_)});function T(){Gp().then(()=>{var K,ve;return(ve=(K=c(b))==null?void 0:K.children[c(m)])==null?void 0:ve.scrollIntoView({block:"nearest"})})}function v(K){if(K.key==="Escape"){y(g,"");return}if(c(d).length!==0){if(K.key==="ArrowDown")K.preventDefault(),y(m,(c(m)+1)%c(d).length),T();else if(K.key==="ArrowUp")K.preventDefault(),y(m,(c(m)-1+c(d).length)%c(d).length),T();else if(K.key==="Enter"){K.preventDefault();const ve=c(d)[c(m)]??c(d)[0];ve!==void 0&&j(ve)}}}ka(()=>{Bl("").catch(K=>{y(a,K instanceof Error?K.message:String(K),!0)}),he()});function O(K){return K.includes("/")?K.slice(0,K.lastIndexOf("/")):""}function L(K){return c(n)!==null&&(c(n).path===K||c(n).path.startsWith(`${K}/`))}async function B(K,ve){try{const ke=await F0(K);y(r,null),y(n,{item:ke,path:K,templateName:ve},!0)}catch(ke){await en(ke instanceof Error?ke.message:String(ke))}}async function C(K){try{const ve=await F0(K);y(r,null),y(n,{item:ve,path:K,templateName:await dy(K,ve.template)},!0)}catch(ve){await en(ve instanceof Error?ve.message:String(ve))}}async function q(K){const ve=K===""?"index":`${K}/index`;await Ly(ve)?await C(ve):(y(n,null),await he(),y(s,await Hf(K),!0),y(r,K,!0))}async function x(K){const ve=c(r);if(ve===null)return;const ke=ve===""?"index":`${ve}/index`,ze=await Hf(ve);try{await _g(ke,ze,K)}catch(Qe){await en(Qe instanceof Error?Qe.message:String(Qe));return}await Pn(ve),await Ji(ke),await C(ke)}async function j(K){y(g,""),await Ji(K.path),await B(K.path,K.template)}async function Z(K,ve){try{await Dy(K,ve)}catch(ke){await en(ke instanceof Error?ke.message:String(ke)),await Pn(K)}}async function Y(K,ve,ke){var dt;const ze=O(K);if(ke===ze)return;let Qe;try{Qe=ve==="item"?await My(K,ke):await By(K,ke)}catch(Qt){await en(Qt instanceof Error?Qt.message:String(Qt));return}ve==="item"?await Io(Tr(K),Tr(Qe)):await Io(`${Tr(K)}*`,`${Tr(Qe)}:splat`),await Pn(ze),await Pn(ke),await Ji(Qe),ve==="item"&&((dt=c(n))==null?void 0:dt.path)===K?await C(Qe):ve==="dir"&&L(K)&&y(n,null)}async function E(K){K.preventDefault();const ve=si();Ss(),ve!==null&&ve.parent!==""&&await Y(ve.entry.path,ve.entry.kind,"")}async function k(K){c(n)!==null&&await Y(c(n).path,"item",K)}async function S(K){const ve=c(Re);y(Re,null),ve!==null&&await Y(ve,"dir",K)}async function U(K){if(c(n)===null)return;const{path:ve}=c(n);try{await U0(ve,K)}catch(ke){await en(ke instanceof Error?ke.message:String(ke));return}await Pn(O(ve)),await C(ve)}const F=Ae(()=>ri("")!==void 0),M=Ae(()=>{var K;return(((K=ri(""))==null?void 0:K.entries.length)??-1)===0}),Q=Ae(()=>{const K=ri(""),ve=K==null?void 0:K.entries.find(ke=>ke.kind==="item"&&ke.slug==="index");return(ve==null?void 0:ve.kind)==="item"?ve:void 0}),z=Ae(()=>{var ke;const K=c(Q);return K===void 0?"missing":(K.template??((ke=ri(""))==null?void 0:ke.defaultTemplate))===void 0?"broken":K.isPublished?"published":"draft"}),$=Ae(()=>{switch(c(z)){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 X=ee(!1);async function J(K){if(!(c(n)===null||K==="")){y(X,!0);try{await U0(c(n).path,K),await Pn(O(c(n).path)),await C(c(n).path)}catch(ve){await en(ve instanceof Error?ve.message:String(ve))}finally{y(X,!1)}}}let ne=ee(!1),ge=ee(!1);kt(()=>{!c(ge)&&!c(ne)&&ot.isAdmin&&c(F)&&c(M)&&(y(ge,!0),be())});async function be(){y(ne,!0);try{await Ay(),await Pn(""),y(Se,[],!0),await he(),await C("index")}catch(K){if(K instanceof Error&&/already has content/i.test(K.message))return;await en(K instanceof Error?K.message:String(K))}finally{y(ne,!1)}}let pe=ee(!1),Se=ee(Tt([])),ie=ee(Tt([]));async function he(){if(c(Se).length===0){const K=await jf("templates");y(Se,K.filter(ve=>ve!==Ju),!0)}}async function Ce(){await he(),y(ie,await Ff(),!0),y(pe,!0)}async function Ne(K){y(pe,!1),await Pn(O(K)),await Ji(K),await C(K)}async function Ie(K){const ve=await vu("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ve===null||ve.trim()==="")return;let ke;try{ke=await Oy(K,ve)}catch(ze){await en(ze instanceof Error?ze.message:String(ze));return}await Pn(K),await Ji(`${ke}/_`)}async function Le(){const K=c(Re);y(Re,null),K!==null&&await Ie(K)}let Re=ee(null);async function $e(K){await he(),y(ie,await Ff(),!0),y(Re,K,!0)}async function We(){const K=c(Re);y(Re,null),K!==null&&await Pn(K),c(n)!==null&&await C(c(n).path)}async function rn(){const K=c(Re);y(Re,null),K!==null&&await sn(K)}async function Ge(){const K=c(Re);y(Re,null),K!==null&&await $t(K)}async function $t(K){const ve=Go(K);if(await hl(`Delete the folder “${ve}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await dl(ii(K))}catch(ze){await en(ze instanceof Error?ze.message:String(ze));return}L(K)&&y(n,null),await Pn(O(K))}}async function sn(K){const ve=Go(K),ke=await vu("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ve,confirmLabel:"Change URL"});if(ke===null)return;const ze=hs(ke);if(ze===""||ze===ve)return;const Qe=P0(K,ze);try{await Ca(ii(K),ii(Qe))}catch(dt){await en(dt instanceof Error?dt.message:String(dt));return}await Io(`${Tr(K)}*`,`${Tr(Qe)}:splat`),L(K)&&y(n,null),await Pn(O(K))}async function Ut(){if(c(n)===null)return;const{path:K,item:ve}=c(n);if(await hl(`Delete “${ve.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await dl(Ps(K))}catch(ze){await en(ze instanceof Error?ze.message:String(ze));return}y(n,null),await Pn(O(K))}}async function hn(){if(c(n)===null)return;const K=c(n).path,ve=Go(K),ke=await vu("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ve,confirmLabel:"Change URL"});if(ke===null)return;const ze=hs(ke);if(ze===""||ze===ve)return;const Qe=P0(K,ze);try{await Ca(Ps(K),Ps(Qe))}catch(dt){await en(dt instanceof Error?dt.message:String(dt));return}await Io(Tr(K),Tr(Qe)),await Pn(O(K)),await C(Qe)}let pn=ee(null);kt(()=>{Cs.mode==="templates"&&c(pn)===null&&QA(()=>import("./TemplatesPane-CEKbBX1Y.js").then(K=>K.T),__vite__mapDeps([0,1]),import.meta.url).then(K=>{y(pn,K.default,!0)})});var Yt=b5(),Ht=pt(Yt),Nn=I(Ht);K8(Nn,{});var qn=R(Nn,2),Ct=I(qn);{var xt=K=>{var ve=Ir(),ke=pt(ve);{var ze=dt=>{var Qt=Ir(),xn=pt(Qt);xE(xn,()=>c(pn),(Te,Me)=>{Me(Te,{})}),H(dt,Qt)},Qe=dt=>{var Qt=n5();H(dt,Qt)};de(ke,dt=>{c(pn)?dt(ze):dt(Qe,-1)})}H(K,ve)},Xt=K=>{var ve=g5(),ke=I(ve),ze=I(ke),Qe=R(I(ze),2),dt=I(Qe),Qt=I(dt);iN(Qt,{size:18,"aria-hidden":"true"});var xn=R(dt,2),Te=I(xn);eN(Te,{size:18,"aria-hidden":"true"});var Me=R(ze,2),Ve=I(Me);wg(Ve,{class:"search-icon",size:16,"aria-hidden":"true"});var Ye=R(Ve,2),le=R(Me,2);{var Rt=tt=>{var wt=r5(),nt=I(wt);ue(()=>fe(nt,`Couldn’t load content: ${c(a)??""}`)),H(tt,wt)},Mt=tt=>{var wt=Ir(),nt=pt(wt);{var Sn=Ft=>{var Wt=s5(),Gt=I(Wt);ue(rt=>fe(Gt,`No matches for “${rt??""}”.`),[()=>c(g).trim()]),H(Ft,Wt)},bn=Ft=>{var Wt=i5();Ot(Wt,23,()=>c(d),Gt=>Gt.path,(Gt,rt,Rn)=>{var yt=a5();let Zt;var ye=I(yt),_e=I(ye),qe=R(ye,2),vt=I(qe);ue(()=>{me(yt,"id",`search-option-${c(Rn)}`),Zt=it(yt,1,"result svelte-whg6dh",null,Zt,{active:c(Rn)===c(m),unpublished:!c(rt).isPublished}),me(yt,"aria-selected",c(Rn)===c(m)),me(yt,"aria-label",c(rt).isPublished?void 0:`${c(rt).title}, not published`),fe(_e,c(rt).title),fe(vt,c(rt).path)}),ae("click",yt,()=>j(c(rt))),Be("mouseenter",yt,()=>y(m,c(Rn),!0)),H(Gt,yt)}),dn(Wt,Gt=>y(b,Gt),()=>c(b)),H(Ft,Wt)};de(nt,Ft=>{c(d).length===0?Ft(Sn):Ft(bn,-1)})}H(tt,wt)},bt=Ae(()=>c(g).trim()!==""),gn=tt=>{var wt=c5(),nt=I(wt);let Sn;var bn=I(nt);rN(bn,{size:16,"aria-hidden":"true"});var Ft=R(bn,4);{var Wt=ye=>{var _e=u5();H(ye,_e)},Gt=ye=>{var _e=o5();H(ye,_e)};de(Ft,ye=>{c(z)==="broken"?ye(Wt):c(z)==="draft"&&ye(Gt,1)})}var rt=R(nt,2);{let ye=Ae(()=>{var _e;return((_e=c(n))==null?void 0:_e.path)??null});jb(rt,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return c(ye)},get activeDir(){return c(o)},onselect:B,onopenDir:q,onsettingsDir:$e,onreorder:Z,onmove:Y})}var Rn=R(rt,2);{var yt=ye=>{var _e=l5();let qe;ue(vt=>qe=it(_e,1,"root-drop svelte-whg6dh",null,qe,vt),[()=>({over:si()!==null&&c(i)})]),Be("dragover",_e,vt=>{vt.preventDefault(),y(i,!0)}),Be("dragleave",_e,()=>y(i,!1)),Be("drop",_e,vt=>{y(i,!1),E(vt)}),H(ye,_e)},Zt=Ae(()=>{var ye;return si()!==null&&((ye=si())==null?void 0:ye.parent)!==""});de(Rn,ye=>{c(Zt)&&ye(yt)})}ue(()=>{Sn=it(nt,1,"home-row svelte-whg6dh",null,Sn,{active:c(o)==="",unpublished:c(z)==="draft"||c(z)==="broken",broken:c(z)==="broken"}),me(nt,"aria-current",c(o)===""),me(nt,"title",c($))}),ae("click",nt,()=>q("")),H(tt,wt)};de(le,tt=>{c(a)?tt(Rt):c(bt)?tt(Mt,1):tt(gn,-1)})}var jn=R(ke,2);GO(jn,{});var rs=R(jn,2),Xn=I(rs);{var Qn=tt=>{var wt=Ir(),nt=pt(wt);IE(nt,()=>`${c(n).path}\0${c(n).templateName}`,Sn=>{{let bn=Ae(()=>c(f)?void 0:hn),Ft=Ae(()=>c(h)?void 0:Ut);vO(Sn,{get item(){return c(n).item},get templateName(){return c(n).templateName},get path(){return c(n).path},get templates(){return c(Se)},get onrename(){return c(bn)},get ondelete(){return c(Ft)},onchangetemplate:U,onmove:k,onsaved:(Wt,Gt,rt)=>{Wy(Wt,Gt),Gy(Wt,rt)}})}}),H(tt,wt)},Bt=tt=>{var wt=h5(),nt=I(wt),Sn=R(I(nt),4),bn=R(I(Sn),2),Ft=I(bn),Wt=I(Ft);Ft.value=Ft.__value="";var Gt=R(Ft);Ot(Gt,16,()=>c(Se),yt=>yt,(yt,Zt)=>{var ye=f5(),_e=I(ye),qe={};ue(()=>{fe(_e,Zt),qe!==(qe=Zt)&&(ye.value=(ye.__value=Zt)??"")}),H(yt,ye)});var rt=R(Sn,2);{var Rn=yt=>{var Zt=d5();ue(()=>Zt.disabled=c(X)),ae("click",Zt,Ut),H(yt,Zt)};de(rt,yt=>{c(h)||yt(Rn)})}ue(()=>{bn.disabled=c(X)||c(Se).length===0,fe(Wt,c(Se).length===0?"No templates exist yet":"Choose…")}),ae("change",bn,yt=>J(yt.currentTarget.value)),H(tt,wt)},Js=tt=>{UO(tt,{get folderPath(){return c(r)},get name(){return c(s)},get templates(){return c(Se)},oncreate:x})},ea=tt=>{var wt=p5();H(tt,wt)},ta=tt=>{var wt=m5();H(tt,wt)};de(Xn,tt=>{c(n)&&c(n).templateName?tt(Qn):c(n)?tt(Bt,1):c(r)!==null?tt(Js,2):ot.isAdmin&&c(F)&&c(M)?tt(ea,3):tt(ta,-1)})}ue(()=>{me(Ye,"aria-expanded",c(d).length>0),me(Ye,"aria-activedescendant",c(m)>=0?`search-option-${c(m)}`:void 0)}),ae("click",dt,()=>Ie("")),ae("click",xn,Ce),ae("keydown",Ye,v),Et(Ye,()=>c(g),tt=>y(g,tt)),H(K,ve)};de(Ct,K=>{Cs.mode==="templates"?K(xt):K(Xt,-1)})}var gt=R(qn,2);yO(gt,{});var zt=R(Ht,2);{var mn=K=>{MO(K,{get folders(){return c(ie)},get templates(){return c(Se)},oncreated:Ne,oncancel:()=>y(pe,!1)})};de(zt,K=>{c(pe)&&K(mn)})}var mr=R(zt,2);{var Vn=K=>{xO(K,{get folderPath(){return c(Re)},get templates(){return c(Se)},get folders(){return c(ie)},onsaved:We,oncancel:()=>y(Re,null),onnewsubfolder:Le,onrenamefolder:rn,ondeletefolder:Ge,onmove:S})};de(mr,K=>{c(Re)!==null&&K(Vn)})}H(t,Yt),ft()}At(["click","keydown","change"]);var E5=W('<h2 class="svelte-z86ibt"> </h2>'),T5=W('<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>'),_5=W('<h2 class="svelte-z86ibt"> </h2>'),A5=W("<option> </option>"),y5=W('<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>'),N5=W('<h2 class="svelte-z86ibt"> </h2>'),S5=W('<!> <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),I5=W('<h2 class="svelte-z86ibt"> </h2>'),C5=W('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),w5=W('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function L5(t,e){ct(e,!0);let n,r=ee(""),s=ee("");kt(()=>{const m=Co.pending;m?(m.kind==="prompt"&&y(r,m.options.value??"",!0),m.kind==="select"&&y(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const m=Co.pending;(m==null?void 0:m.kind)==="confirm"?Ic(!1):(m==null?void 0:m.kind)==="prompt"?Cc(null):(m==null?void 0:m.kind)==="select"?wc(null):j0()}function i(m){m.preventDefault(),a()}function u(m){m.target===n&&a()}function o(m){m.preventDefault(),Cc(c(r))}function f(m){m.preventDefault(),c(s)!==""&&wc(c(s))}var h=w5(),g=I(h);{var d=m=>{const b=Ae(()=>Co.pending);var _=Ir(),T=pt(_);{var v=C=>{var q=T5(),x=I(q);{var j=Q=>{var z=E5(),$=I(z);ue(()=>fe($,c(b).options.title)),H(Q,z)};de(x,Q=>{c(b).options.title&&Q(j)})}var Z=R(x,2),Y=I(Z),E=I(Y),k=R(Y,2);yi(k,!0);var S=R(Z,2),U=I(S),F=R(U,2),M=I(F);ue(()=>{fe(E,c(b).message),me(k,"placeholder",c(b).options.placeholder??""),fe(M,c(b).options.confirmLabel??"OK")}),Be("submit",q,o),Et(k,()=>c(r),Q=>y(r,Q)),ae("click",U,()=>Cc(null)),H(C,q)},O=C=>{var q=y5(),x=I(q);{var j=X=>{var J=_5(),ne=I(J);ue(()=>fe(ne,c(b).options.title)),H(X,J)};de(x,X=>{c(b).options.title&&X(j)})}var Z=R(x,2),Y=I(Z),E=I(Y),k=R(Y,2);yi(k,!0);var S=I(k),U=I(S);S.value=S.__value="";var F=R(S);Ot(F,17,()=>c(b).choices,X=>X.value,(X,J)=>{var ne=A5(),ge=I(ne),be={};ue(()=>{fe(ge,c(J).label),be!==(be=c(J).value)&&(ne.value=(ne.__value=c(J).value)??"")}),H(X,ne)});var M=R(Z,2),Q=I(M),z=R(Q,2),$=I(z);ue(()=>{fe(E,c(b).message),fe(U,c(b).options.placeholder??"Choose…"),z.disabled=c(s)==="",fe($,c(b).options.confirmLabel??"OK")}),Be("submit",q,f),Ia(k,()=>c(s),X=>y(s,X)),ae("click",Q,()=>wc(null)),H(C,q)},L=C=>{var q=S5(),x=pt(q);{var j=Q=>{var z=N5(),$=I(z);ue(()=>fe($,c(b).options.title)),H(Q,z)};de(x,Q=>{c(b).options.title&&Q(j)})}var Z=R(x,2),Y=I(Z),E=R(Z,2),k=I(E),S=I(k),U=R(k,2);let F;var M=I(U);ue(()=>{fe(Y,c(b).message),fe(S,c(b).options.cancelLabel??"Cancel"),F=it(U,1,"primary svelte-z86ibt",null,F,{danger:c(b).options.danger}),fe(M,c(b).options.confirmLabel??"Confirm")}),ae("click",k,()=>Ic(!1)),ae("click",U,()=>Ic(!0)),H(C,q)},B=C=>{var q=C5(),x=pt(q);{var j=S=>{var U=I5(),F=I(U);ue(()=>fe(F,c(b).options.title)),H(S,U)};de(x,S=>{c(b).options.title&&S(j)})}var Z=R(x,2),Y=I(Z),E=R(Z,2),k=I(E);ue(()=>fe(Y,c(b).message)),ae("click",k,()=>j0()),H(C,q)};de(T,C=>{c(b).kind==="prompt"?C(v):c(b).kind==="select"?C(O,1):c(b).kind==="confirm"?C(L,2):C(B,-1)})}H(m,_)};de(g,m=>{Co.pending&&m(d)})}dn(h,m=>n=m,()=>n),Be("cancel",h,i),ae("click",h,u),H(t,h),ft()}At(["click"]);var O5=W('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),x5=W('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),R5=W('<p class="hint svelte-o6yxmi">No matching pages.</p>'),D5=W('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),k5=W('<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),P5=W('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),M5=W('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),B5=W('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),F5=W('<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),U5=W('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function H5(t,e){ct(e,!0);let n=ee(void 0),r=ee("page"),s=ee(""),a=ee(Tt([])),i=ee(-1),u=ee(""),o=ee(void 0);const f=Ae(()=>KN.pending);kt(()=>{var L,B;if(c(f)===null){(L=c(n))==null||L.close();return}const O=c(f).current;y(r,O===""||xu(O)?"page":"url",!0),y(s,""),y(a,[],!0),y(i,-1),y(u,xu(O)?"":O,!0),(B=c(n))==null||B.showModal()});let h;kt(()=>{const O=c(s);if(clearTimeout(h),c(r)!=="page"||O.trim()===""){y(a,[],!0),y(i,-1);return}return h=setTimeout(()=>{mg(O).then(L=>{O===c(s)&&(y(a,L,!0),y(i,L.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(O){Ga(VN(O.path))}function d(){const O=c(u).trim();O!==""&&Ga(O)}function m(){var O,L;(L=(O=c(o))==null?void 0:O.children[c(i)])==null||L.scrollIntoView({block:"nearest"})}function b(O){if(c(a).length!==0){if(O.key==="ArrowDown")O.preventDefault(),y(i,(c(i)+1)%c(a).length),m();else if(O.key==="ArrowUp")O.preventDefault(),y(i,(c(i)-1+c(a).length)%c(a).length),m();else if(O.key==="Enter"){O.preventDefault();const L=c(a)[c(i)]??c(a)[0];L!==void 0&&g(L)}}}var _=U5(),T=I(_);{var v=O=>{var L=F5(),B=R(pt(L),2),C=I(B);let q;var x=R(C,2);let j;var Z=R(B,2),Y=I(Z);{var E=$=>{var X=k5(),J=pt(X),ne=I(J);wg(ne,{class:"search-icon",size:16,"aria-hidden":"true"});var ge=R(ne,2);yi(ge,!0);var be=R(J,2),pe=I(be);{var Se=Ne=>{var Ie=x5();Ot(Ie,23,()=>c(a),Le=>Le.path,(Le,Re,$e)=>{var We=O5();let rn;var Ge=I(We),$t=I(Ge),sn=R(Ge,2),Ut=I(sn);ue(()=>{me(We,"id",`link-option-${c($e)}`),rn=it(We,1,"result svelte-o6yxmi",null,rn,{active:c($e)===c(i)}),me(We,"aria-selected",c($e)===c(i)),fe($t,c(Re).title),fe(Ut,c(Re).path)}),ae("click",We,()=>g(c(Re))),Be("mouseenter",We,()=>y(i,c($e),!0)),H(Le,We)}),dn(Ie,Le=>y(o,Le),()=>c(o)),H(Ne,Ie)},ie=Ne=>{var Ie=R5();H(Ne,Ie)},he=Ae(()=>c(s).trim()!==""),Ce=Ne=>{var Ie=D5();H(Ne,Ie)};de(pe,Ne=>{c(a).length>0?Ne(Se):c(he)?Ne(ie,1):Ne(Ce,-1)})}ue(()=>{me(ge,"aria-expanded",c(a).length>0),me(ge,"aria-activedescendant",c(i)>=0?`link-option-${c(i)}`:void 0)}),ae("keydown",ge,b),Et(ge,()=>c(s),Ne=>y(s,Ne)),H($,X)},k=$=>{var X=P5(),J=R(I(X),2);ae("keydown",J,ne=>{ne.key==="Enter"&&(ne.preventDefault(),d())}),Et(J,()=>c(u),ne=>y(u,ne)),H($,X)};de(Y,$=>{c(r)==="page"?$(E):$(k,-1)})}var S=R(Z,2),U=I(S),F=R(U,2);{var M=$=>{var X=M5();ae("click",X,()=>Ga("")),H($,X)};de(F,$=>{c(f).current!==""&&$(M)})}var Q=R(F,2);{var z=$=>{var X=B5();ue(J=>X.disabled=J,[()=>c(u).trim()===""]),ae("click",X,d),H($,X)};de(Q,$=>{c(r)==="url"&&$(z)})}ue(()=>{q=it(C,1,"tab svelte-o6yxmi",null,q,{active:c(r)==="page"}),me(C,"aria-selected",c(r)==="page"),j=it(x,1,"tab svelte-o6yxmi",null,j,{active:c(r)==="url"}),me(x,"aria-selected",c(r)==="url")}),ae("click",C,()=>y(r,"page")),ae("click",x,()=>y(r,"url")),ae("click",U,()=>Ga(null)),H(O,L)};de(T,O=>{c(f)!==null&&O(v)})}dn(_,O=>y(n,O),()=>c(n)),Be("close",_,()=>Ga(null)),Be("cancel",_,()=>Ga(null)),H(t,_),ft()}At(["click","keydown"]);var q5=W('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),j5=W(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
130
- password.</p>`),$5=W('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),Y5=W(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),z5=W('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),W5=W('<p class="error svelte-2jpsc9" role="alert"> </p>'),G5=W('<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 K5(t,e){ct(e,!0);const n=Ae(()=>wn.name??"nanoesis");let r=ee(""),s=ee(""),a=ee(""),i=ee(!1),u=ee(null),o=Ae(()=>ot.firstRun&&c(a)!==""&&c(s)!==c(a)),f=Ae(()=>!c(i)&&c(r).trim()!==""&&c(s)!==""&&(!ot.firstRun||c(a)!==""&&!c(o)));async function h($){if($.preventDefault(),!c(f))return;y(i,!0),y(u,null);const X=await ot.login(c(r),c(s));if(y(i,!1),!X.ok){y(u,g(X.error??"Sign-in failed."),!0);return}}function g($){return $.includes("locked")?"Account temporarily locked, try again shortly.":$.includes("credentials")?"Invalid credentials. Check your username and password.":$}var d=G5(),m=I(d),b=I(m),_=I(b);{var T=$=>{var X=q5();ue(()=>me(X,"src",wn.logoUrl)),H($,X)};de(_,$=>{wn.logoUrl&&$(T)})}var v=R(_,2),O=I(v),L=R(v,2);{var B=$=>{var X=j5();H($,X)},C=$=>{var X=$5();H($,X)};de(L,$=>{ot.firstRun?$(B):$(C,-1)})}var q=R(b,2),x=I(q),j=R(I(x),2);yi(j,!0);var Z=R(x,2),Y=R(I(Z),2),E=R(Z,2);{var k=$=>{var X=z5(),J=R(I(X),2),ne=R(J,2);{var ge=be=>{var pe=Y5();H(be,pe)};de(ne,be=>{c(o)&&be(ge)})}Et(J,()=>c(a),be=>y(a,be)),H($,X)};de(E,$=>{ot.firstRun&&$(k)})}var S=R(E,2);{var U=$=>{var X=W5(),J=I(X);ue(()=>fe(J,c(u))),H($,X)};de(S,$=>{c(u)&&$(U)})}var F=R(S,2),M=I(F);{var Q=$=>{var X=cf();ue(()=>fe(X,ot.firstRun?"Creating…":"Signing in…")),H($,X)},z=$=>{var X=cf();ue(()=>fe(X,ot.firstRun?"Create admin account":"Sign in")),H($,X)};de(M,$=>{c(i)?$(Q):$(z,-1)})}ue(()=>{fe(O,c(n)),me(Y,"autocomplete",ot.firstRun?"new-password":"current-password"),F.disabled=!c(f)}),Be("submit",q,h),Et(j,()=>c(r),$=>y(r,$)),Et(Y,()=>c(s),$=>y(s,$)),H(t,d),ft()}var V5=W('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),X5=W('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),Q5=W('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),Z5=W('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),J5=W('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),ex=W("<li><!></li>"),tx=W('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),nx=W('<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 rx(t,e){ct(e,!0);let n;const r=Ae(()=>Tn.errors),s=Ae(()=>Tn.warnings);kt(()=>{Tn.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(v){Wf.request(v),Tn.closePanel()}function i(v){v.preventDefault(),Tn.closePanel()}function u(v){v.target===n&&Tn.closePanel()}var o=nx(),f=R(I(o),2);{var h=v=>{var O=V5();H(v,O)},g=v=>{var O=X5();H(v,O)},d=v=>{var O=Q5();H(v,O)},m=v=>{var O=tx(),L=pt(O),B=I(L),C=R(B);{var q=j=>{var Z=cf();ue(()=>fe(Z,`,
129
+ and components directly.</p></div></div>`),A5=W('<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>'),y5=W('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!>',1);function N5(t,e){ct(e,!0);let n=ee(null);kt(()=>{const G=Wf.target;G!==null&&(Wf.clear(),Cs.set("content"),C(G))});let r=ee(null),s=ee(""),a=ee(null),i=ee(!1);function u(G){return G==="index"?"":G.endsWith("/index")?G.slice(0,-6):null}const o=Ae(()=>c(r)??(c(n)!==null?u(c(n).path):null)),f=Ae(()=>c(n)!==null&&u(c(n).path)!==null),h=Ae(()=>{var G;return((G=c(n))==null?void 0:G.path)==="index"});let g=ee(""),d=ee(Tt([])),m=ee(-1),b=ee(void 0),_;kt(()=>{const G=c(g);if(clearTimeout(_),G.trim()===""){y(d,[],!0),y(m,-1);return}return _=setTimeout(()=>{gg(G).then(ve=>{G===c(g)&&(y(d,ve,!0),y(m,ve.length>0?0:-1,!0))})},200),()=>clearTimeout(_)});function T(){Kp().then(()=>{var G,ve;return(ve=(G=c(b))==null?void 0:G.children[c(m)])==null?void 0:ve.scrollIntoView({block:"nearest"})})}function v(G){if(G.key==="Escape"){y(g,"");return}if(c(d).length!==0){if(G.key==="ArrowDown")G.preventDefault(),y(m,(c(m)+1)%c(d).length),T();else if(G.key==="ArrowUp")G.preventDefault(),y(m,(c(m)-1+c(d).length)%c(d).length),T();else if(G.key==="Enter"){G.preventDefault();const ve=c(d)[c(m)]??c(d)[0];ve!==void 0&&j(ve)}}}ka(()=>{Bl("").catch(G=>{y(a,G instanceof Error?G.message:String(G),!0)}),he()});function O(G){return G.includes("/")?G.slice(0,G.lastIndexOf("/")):""}function L(G){return c(n)!==null&&(c(n).path===G||c(n).path.startsWith(`${G}/`))}async function B(G,ve){try{const ke=await F0(G);y(r,null),y(n,{item:ke,path:G,templateName:ve},!0)}catch(ke){await en(ke instanceof Error?ke.message:String(ke))}}async function C(G){try{const ve=await F0(G);y(r,null),y(n,{item:ve,path:G,templateName:await by(G,ve.template)},!0)}catch(ve){await en(ve instanceof Error?ve.message:String(ve))}}async function q(G){const ve=G===""?"index":`${G}/index`;await ky(ve)?await C(ve):(y(n,null),await he(),y(s,await Hf(G),!0),y(r,G,!0))}async function x(G){const ve=c(r);if(ve===null)return;const ke=ve===""?"index":`${ve}/index`,ze=await Hf(ve);try{await Ag(ke,ze,G)}catch(Qe){await en(Qe instanceof Error?Qe.message:String(Qe));return}await Pn(ve),await Ji(ke),await C(ke)}async function j(G){y(g,""),await Ji(G.path),await B(G.path,G.template)}async function Z(G,ve){try{await Fy(G,ve)}catch(ke){await en(ke instanceof Error?ke.message:String(ke)),await Pn(G)}}async function Y(G,ve,ke){var dt;const ze=O(G);if(ke===ze)return;let Qe;try{Qe=ve==="item"?await qy(G,ke):await jy(G,ke)}catch(Qt){await en(Qt instanceof Error?Qt.message:String(Qt));return}ve==="item"?await Io(Tr(G),Tr(Qe)):await Io(`${Tr(G)}*`,`${Tr(Qe)}:splat`),await Pn(ze),await Pn(ke),await Ji(Qe),ve==="item"&&((dt=c(n))==null?void 0:dt.path)===G?await C(Qe):ve==="dir"&&L(G)&&y(n,null)}async function E(G){G.preventDefault();const ve=si();Ss(),ve!==null&&ve.parent!==""&&await Y(ve.entry.path,ve.entry.kind,"")}async function k(G){c(n)!==null&&await Y(c(n).path,"item",G)}async function S(G){const ve=c(Re);y(Re,null),ve!==null&&await Y(ve,"dir",G)}async function U(G){if(c(n)===null)return;const{path:ve}=c(n);try{await U0(ve,G)}catch(ke){await en(ke instanceof Error?ke.message:String(ke));return}await Pn(O(ve)),await C(ve)}const F=Ae(()=>ri("")!==void 0),M=Ae(()=>{var G;return(((G=ri(""))==null?void 0:G.entries.length)??-1)===0}),Q=Ae(()=>{const G=ri(""),ve=G==null?void 0:G.entries.find(ke=>ke.kind==="item"&&ke.slug==="index");return(ve==null?void 0:ve.kind)==="item"?ve:void 0}),z=Ae(()=>{var ke;const G=c(Q);return G===void 0?"missing":(G.template??((ke=ri(""))==null?void 0:ke.defaultTemplate))===void 0?"broken":G.isPublished?"published":"draft"}),$=Ae(()=>{switch(c(z)){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 X=ee(!1);async function J(G){if(!(c(n)===null||G==="")){y(X,!0);try{await U0(c(n).path,G),await Pn(O(c(n).path)),await C(c(n).path)}catch(ve){await en(ve instanceof Error?ve.message:String(ve))}finally{y(X,!1)}}}let ne=ee(!1),ge=ee(!1);kt(()=>{!c(ge)&&!c(ne)&&ot.isAdmin&&c(F)&&c(M)&&(y(ge,!0),be())});async function be(){y(ne,!0);try{await Cy(),eN(localStorage),await Pn(""),y(Se,[],!0),await he(),await C("index")}catch(G){if(G instanceof Error&&/already has content/i.test(G.message))return;await en(G instanceof Error?G.message:String(G))}finally{y(ne,!1)}}let pe=ee(!1),Se=ee(Tt([])),ie=ee(Tt([]));async function he(){if(c(Se).length===0){const G=await jf("templates");y(Se,G.filter(ve=>ve!==Ju),!0)}}async function Ce(){await he(),y(ie,await Ff(),!0),y(pe,!0)}async function Ne(G){y(pe,!1),await Pn(O(G)),await Ji(G),await C(G)}async function Ie(G){const ve=await vu("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ve===null||ve.trim()==="")return;let ke;try{ke=await Py(G,ve)}catch(ze){await en(ze instanceof Error?ze.message:String(ze));return}await Pn(G),await Ji(`${ke}/_`)}async function Le(){const G=c(Re);y(Re,null),G!==null&&await Ie(G)}let Re=ee(null);async function $e(G){await he(),y(ie,await Ff(),!0),y(Re,G,!0)}async function We(){const G=c(Re);y(Re,null),G!==null&&await Pn(G),c(n)!==null&&await C(c(n).path)}async function rn(){const G=c(Re);y(Re,null),G!==null&&await sn(G)}async function Ge(){const G=c(Re);y(Re,null),G!==null&&await $t(G)}async function $t(G){const ve=Go(G);if(await hl(`Delete the folder “${ve}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await dl(ii(G))}catch(ze){await en(ze instanceof Error?ze.message:String(ze));return}L(G)&&y(n,null),await Pn(O(G))}}async function sn(G){const ve=Go(G),ke=await vu("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ve,confirmLabel:"Change URL"});if(ke===null)return;const ze=hs(ke);if(ze===""||ze===ve)return;const Qe=P0(G,ze);try{await Ca(ii(G),ii(Qe))}catch(dt){await en(dt instanceof Error?dt.message:String(dt));return}await Io(`${Tr(G)}*`,`${Tr(Qe)}:splat`),L(G)&&y(n,null),await Pn(O(G))}async function Ut(){if(c(n)===null)return;const{path:G,item:ve}=c(n);if(await hl(`Delete “${ve.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await dl(Ps(G))}catch(ze){await en(ze instanceof Error?ze.message:String(ze));return}$0(localStorage,G),y(n,null),await Pn(O(G))}}async function hn(){if(c(n)===null)return;const G=c(n).path,ve=Go(G),ke=await vu("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ve,confirmLabel:"Change URL"});if(ke===null)return;const ze=hs(ke);if(ze===""||ze===ve)return;const Qe=P0(G,ze);try{await Ca(Ps(G),Ps(Qe))}catch(dt){await en(dt instanceof Error?dt.message:String(dt));return}$0(localStorage,G),await Io(Tr(G),Tr(Qe)),await Pn(O(G)),await C(Qe)}let pn=ee(null);kt(()=>{Cs.mode==="templates"&&c(pn)===null&&n3(()=>import("./TemplatesPane-CtH_G1zX.js").then(G=>G.T),__vite__mapDeps([0,1]),import.meta.url).then(G=>{y(pn,G.default,!0)})});var Yt=y5(),Ht=pt(Yt),Nn=I(Ht);e5(Nn,{});var qn=R(Nn,2),Ct=I(qn);{var xt=G=>{var ve=Ir(),ke=pt(ve);{var ze=dt=>{var Qt=Ir(),xn=pt(Qt);ME(xn,()=>c(pn),(Te,Me)=>{Me(Te,{})}),H(dt,Qt)},Qe=dt=>{var Qt=o5();H(dt,Qt)};de(ke,dt=>{c(pn)?dt(ze):dt(Qe,-1)})}H(G,ve)},Xt=G=>{var ve=A5(),ke=I(ve),ze=I(ke),Qe=R(I(ze),2),dt=I(Qe),Qt=I(dt);dN(Qt,{size:18,"aria-hidden":"true"});var xn=R(dt,2),Te=I(xn);iN(Te,{size:18,"aria-hidden":"true"});var Me=R(ze,2),Ve=I(Me);Dg(Ve,{class:"search-icon",size:16,"aria-hidden":"true"});var Ye=R(Ve,2),le=R(Me,2);{var Rt=tt=>{var wt=l5(),nt=I(wt);ue(()=>fe(nt,`Couldn’t load content: ${c(a)??""}`)),H(tt,wt)},Mt=tt=>{var wt=Ir(),nt=pt(wt);{var Sn=Ft=>{var Wt=c5(),Gt=I(Wt);ue(rt=>fe(Gt,`No matches for “${rt??""}”.`),[()=>c(g).trim()]),H(Ft,Wt)},bn=Ft=>{var Wt=d5();Ot(Wt,23,()=>c(d),Gt=>Gt.path,(Gt,rt,Rn)=>{var yt=f5();let Zt;var ye=I(yt),_e=I(ye),qe=R(ye,2),vt=I(qe);ue(()=>{me(yt,"id",`search-option-${c(Rn)}`),Zt=it(yt,1,"result svelte-whg6dh",null,Zt,{active:c(Rn)===c(m),unpublished:!c(rt).isPublished}),me(yt,"aria-selected",c(Rn)===c(m)),me(yt,"aria-label",c(rt).isPublished?void 0:`${c(rt).title}, not published`),fe(_e,c(rt).title),fe(vt,c(rt).path)}),ae("click",yt,()=>j(c(rt))),Be("mouseenter",yt,()=>y(m,c(Rn),!0)),H(Gt,yt)}),dn(Wt,Gt=>y(b,Gt),()=>c(b)),H(Ft,Wt)};de(nt,Ft=>{c(d).length===0?Ft(Sn):Ft(bn,-1)})}H(tt,wt)},bt=Ae(()=>c(g).trim()!==""),gn=tt=>{var wt=g5(),nt=I(wt);let Sn;var bn=I(nt);lN(bn,{size:16,"aria-hidden":"true"});var Ft=R(bn,4);{var Wt=ye=>{var _e=h5();H(ye,_e)},Gt=ye=>{var _e=p5();H(ye,_e)};de(Ft,ye=>{c(z)==="broken"?ye(Wt):c(z)==="draft"&&ye(Gt,1)})}var rt=R(nt,2);{let ye=Ae(()=>{var _e;return((_e=c(n))==null?void 0:_e.path)??null});Gb(rt,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return c(ye)},get activeDir(){return c(o)},onselect:B,onopenDir:q,onsettingsDir:$e,onreorder:Z,onmove:Y})}var Rn=R(rt,2);{var yt=ye=>{var _e=m5();let qe;ue(vt=>qe=it(_e,1,"root-drop svelte-whg6dh",null,qe,vt),[()=>({over:si()!==null&&c(i)})]),Be("dragover",_e,vt=>{vt.preventDefault(),y(i,!0)}),Be("dragleave",_e,()=>y(i,!1)),Be("drop",_e,vt=>{y(i,!1),E(vt)}),H(ye,_e)},Zt=Ae(()=>{var ye;return si()!==null&&((ye=si())==null?void 0:ye.parent)!==""});de(Rn,ye=>{c(Zt)&&ye(yt)})}ue(()=>{Sn=it(nt,1,"home-row svelte-whg6dh",null,Sn,{active:c(o)==="",unpublished:c(z)==="draft"||c(z)==="broken",broken:c(z)==="broken"}),me(nt,"aria-current",c(o)===""),me(nt,"title",c($))}),ae("click",nt,()=>q("")),H(tt,wt)};de(le,tt=>{c(a)?tt(Rt):c(bt)?tt(Mt,1):tt(gn,-1)})}var jn=R(ke,2);JO(jn,{});var rs=R(jn,2),Xn=I(rs);{var Qn=tt=>{var wt=Ir(),nt=pt(wt);xE(nt,()=>`${c(n).path}\0${c(n).templateName}`,Sn=>{{let bn=Ae(()=>c(f)?void 0:hn),Ft=Ae(()=>c(h)?void 0:Ut);NO(Sn,{get item(){return c(n).item},get templateName(){return c(n).templateName},get path(){return c(n).path},get templates(){return c(Se)},get onrename(){return c(bn)},get ondelete(){return c(Ft)},onchangetemplate:U,onmove:k,onsaved:(Wt,Gt,rt)=>{Qy(Wt,Gt),Zy(Wt,rt)}})}}),H(tt,wt)},Bt=tt=>{var wt=E5(),nt=I(wt),Sn=R(I(nt),4),bn=R(I(Sn),2),Ft=I(bn),Wt=I(Ft);Ft.value=Ft.__value="";var Gt=R(Ft);Ot(Gt,16,()=>c(Se),yt=>yt,(yt,Zt)=>{var ye=b5(),_e=I(ye),qe={};ue(()=>{fe(_e,Zt),qe!==(qe=Zt)&&(ye.value=(ye.__value=Zt)??"")}),H(yt,ye)});var rt=R(Sn,2);{var Rn=yt=>{var Zt=v5();ue(()=>Zt.disabled=c(X)),ae("click",Zt,Ut),H(yt,Zt)};de(rt,yt=>{c(h)||yt(Rn)})}ue(()=>{bn.disabled=c(X)||c(Se).length===0,fe(Wt,c(Se).length===0?"No templates exist yet":"Choose…")}),ae("change",bn,yt=>J(yt.currentTarget.value)),H(tt,wt)},Js=tt=>{zO(tt,{get folderPath(){return c(r)},get name(){return c(s)},get templates(){return c(Se)},oncreate:x})},ea=tt=>{var wt=T5();H(tt,wt)},ta=tt=>{var wt=_5();H(tt,wt)};de(Xn,tt=>{c(n)&&c(n).templateName?tt(Qn):c(n)?tt(Bt,1):c(r)!==null?tt(Js,2):ot.isAdmin&&c(F)&&c(M)?tt(ea,3):tt(ta,-1)})}ue(()=>{me(Ye,"aria-expanded",c(d).length>0),me(Ye,"aria-activedescendant",c(m)>=0?`search-option-${c(m)}`:void 0)}),ae("click",dt,()=>Ie("")),ae("click",xn,Ce),ae("keydown",Ye,v),Et(Ye,()=>c(g),tt=>y(g,tt)),H(G,ve)};de(Ct,G=>{Cs.mode==="templates"?G(xt):G(Xt,-1)})}var gt=R(qn,2);LO(gt,{});var zt=R(Ht,2);{var mn=G=>{jO(G,{get folders(){return c(ie)},get templates(){return c(Se)},oncreated:Ne,oncancel:()=>y(pe,!1)})};de(zt,G=>{c(pe)&&G(mn)})}var mr=R(zt,2);{var Vn=G=>{BO(G,{get folderPath(){return c(Re)},get templates(){return c(Se)},get folders(){return c(ie)},onsaved:We,oncancel:()=>y(Re,null),onnewsubfolder:Le,onrenamefolder:rn,ondeletefolder:Ge,onmove:S})};de(mr,G=>{c(Re)!==null&&G(Vn)})}H(t,Yt),ft()}At(["click","keydown","change"]);var S5=W('<h2 class="svelte-z86ibt"> </h2>'),I5=W('<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>'),C5=W('<h2 class="svelte-z86ibt"> </h2>'),w5=W("<option> </option>"),L5=W('<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>'),O5=W('<h2 class="svelte-z86ibt"> </h2>'),x5=W('<!> <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),R5=W('<h2 class="svelte-z86ibt"> </h2>'),D5=W('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),k5=W('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function P5(t,e){ct(e,!0);let n,r=ee(""),s=ee("");kt(()=>{const m=Co.pending;m?(m.kind==="prompt"&&y(r,m.options.value??"",!0),m.kind==="select"&&y(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const m=Co.pending;(m==null?void 0:m.kind)==="confirm"?Ic(!1):(m==null?void 0:m.kind)==="prompt"?Cc(null):(m==null?void 0:m.kind)==="select"?wc(null):j0()}function i(m){m.preventDefault(),a()}function u(m){m.target===n&&a()}function o(m){m.preventDefault(),Cc(c(r))}function f(m){m.preventDefault(),c(s)!==""&&wc(c(s))}var h=k5(),g=I(h);{var d=m=>{const b=Ae(()=>Co.pending);var _=Ir(),T=pt(_);{var v=C=>{var q=I5(),x=I(q);{var j=Q=>{var z=S5(),$=I(z);ue(()=>fe($,c(b).options.title)),H(Q,z)};de(x,Q=>{c(b).options.title&&Q(j)})}var Z=R(x,2),Y=I(Z),E=I(Y),k=R(Y,2);yi(k,!0);var S=R(Z,2),U=I(S),F=R(U,2),M=I(F);ue(()=>{fe(E,c(b).message),me(k,"placeholder",c(b).options.placeholder??""),fe(M,c(b).options.confirmLabel??"OK")}),Be("submit",q,o),Et(k,()=>c(r),Q=>y(r,Q)),ae("click",U,()=>Cc(null)),H(C,q)},O=C=>{var q=L5(),x=I(q);{var j=X=>{var J=C5(),ne=I(J);ue(()=>fe(ne,c(b).options.title)),H(X,J)};de(x,X=>{c(b).options.title&&X(j)})}var Z=R(x,2),Y=I(Z),E=I(Y),k=R(Y,2);yi(k,!0);var S=I(k),U=I(S);S.value=S.__value="";var F=R(S);Ot(F,17,()=>c(b).choices,X=>X.value,(X,J)=>{var ne=w5(),ge=I(ne),be={};ue(()=>{fe(ge,c(J).label),be!==(be=c(J).value)&&(ne.value=(ne.__value=c(J).value)??"")}),H(X,ne)});var M=R(Z,2),Q=I(M),z=R(Q,2),$=I(z);ue(()=>{fe(E,c(b).message),fe(U,c(b).options.placeholder??"Choose…"),z.disabled=c(s)==="",fe($,c(b).options.confirmLabel??"OK")}),Be("submit",q,f),Ia(k,()=>c(s),X=>y(s,X)),ae("click",Q,()=>wc(null)),H(C,q)},L=C=>{var q=x5(),x=pt(q);{var j=Q=>{var z=O5(),$=I(z);ue(()=>fe($,c(b).options.title)),H(Q,z)};de(x,Q=>{c(b).options.title&&Q(j)})}var Z=R(x,2),Y=I(Z),E=R(Z,2),k=I(E),S=I(k),U=R(k,2);let F;var M=I(U);ue(()=>{fe(Y,c(b).message),fe(S,c(b).options.cancelLabel??"Cancel"),F=it(U,1,"primary svelte-z86ibt",null,F,{danger:c(b).options.danger}),fe(M,c(b).options.confirmLabel??"Confirm")}),ae("click",k,()=>Ic(!1)),ae("click",U,()=>Ic(!0)),H(C,q)},B=C=>{var q=D5(),x=pt(q);{var j=S=>{var U=R5(),F=I(U);ue(()=>fe(F,c(b).options.title)),H(S,U)};de(x,S=>{c(b).options.title&&S(j)})}var Z=R(x,2),Y=I(Z),E=R(Z,2),k=I(E);ue(()=>fe(Y,c(b).message)),ae("click",k,()=>j0()),H(C,q)};de(T,C=>{c(b).kind==="prompt"?C(v):c(b).kind==="select"?C(O,1):c(b).kind==="confirm"?C(L,2):C(B,-1)})}H(m,_)};de(g,m=>{Co.pending&&m(d)})}dn(h,m=>n=m,()=>n),Be("cancel",h,i),ae("click",h,u),H(t,h),ft()}At(["click"]);var M5=W('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),B5=W('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),F5=W('<p class="hint svelte-o6yxmi">No matching pages.</p>'),U5=W('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),H5=W('<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),q5=W('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),j5=W('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),$5=W('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),Y5=W('<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),z5=W('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function W5(t,e){ct(e,!0);let n=ee(void 0),r=ee("page"),s=ee(""),a=ee(Tt([])),i=ee(-1),u=ee(""),o=ee(void 0);const f=Ae(()=>e6.pending);kt(()=>{var L,B;if(c(f)===null){(L=c(n))==null||L.close();return}const O=c(f).current;y(r,O===""||xu(O)?"page":"url",!0),y(s,""),y(a,[],!0),y(i,-1),y(u,xu(O)?"":O,!0),(B=c(n))==null||B.showModal()});let h;kt(()=>{const O=c(s);if(clearTimeout(h),c(r)!=="page"||O.trim()===""){y(a,[],!0),y(i,-1);return}return h=setTimeout(()=>{gg(O).then(L=>{O===c(s)&&(y(a,L,!0),y(i,L.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(O){Ga(t6(O.path))}function d(){const O=c(u).trim();O!==""&&Ga(O)}function m(){var O,L;(L=(O=c(o))==null?void 0:O.children[c(i)])==null||L.scrollIntoView({block:"nearest"})}function b(O){if(c(a).length!==0){if(O.key==="ArrowDown")O.preventDefault(),y(i,(c(i)+1)%c(a).length),m();else if(O.key==="ArrowUp")O.preventDefault(),y(i,(c(i)-1+c(a).length)%c(a).length),m();else if(O.key==="Enter"){O.preventDefault();const L=c(a)[c(i)]??c(a)[0];L!==void 0&&g(L)}}}var _=z5(),T=I(_);{var v=O=>{var L=Y5(),B=R(pt(L),2),C=I(B);let q;var x=R(C,2);let j;var Z=R(B,2),Y=I(Z);{var E=$=>{var X=H5(),J=pt(X),ne=I(J);Dg(ne,{class:"search-icon",size:16,"aria-hidden":"true"});var ge=R(ne,2);yi(ge,!0);var be=R(J,2),pe=I(be);{var Se=Ne=>{var Ie=B5();Ot(Ie,23,()=>c(a),Le=>Le.path,(Le,Re,$e)=>{var We=M5();let rn;var Ge=I(We),$t=I(Ge),sn=R(Ge,2),Ut=I(sn);ue(()=>{me(We,"id",`link-option-${c($e)}`),rn=it(We,1,"result svelte-o6yxmi",null,rn,{active:c($e)===c(i)}),me(We,"aria-selected",c($e)===c(i)),fe($t,c(Re).title),fe(Ut,c(Re).path)}),ae("click",We,()=>g(c(Re))),Be("mouseenter",We,()=>y(i,c($e),!0)),H(Le,We)}),dn(Ie,Le=>y(o,Le),()=>c(o)),H(Ne,Ie)},ie=Ne=>{var Ie=F5();H(Ne,Ie)},he=Ae(()=>c(s).trim()!==""),Ce=Ne=>{var Ie=U5();H(Ne,Ie)};de(pe,Ne=>{c(a).length>0?Ne(Se):c(he)?Ne(ie,1):Ne(Ce,-1)})}ue(()=>{me(ge,"aria-expanded",c(a).length>0),me(ge,"aria-activedescendant",c(i)>=0?`link-option-${c(i)}`:void 0)}),ae("keydown",ge,b),Et(ge,()=>c(s),Ne=>y(s,Ne)),H($,X)},k=$=>{var X=q5(),J=R(I(X),2);ae("keydown",J,ne=>{ne.key==="Enter"&&(ne.preventDefault(),d())}),Et(J,()=>c(u),ne=>y(u,ne)),H($,X)};de(Y,$=>{c(r)==="page"?$(E):$(k,-1)})}var S=R(Z,2),U=I(S),F=R(U,2);{var M=$=>{var X=j5();ae("click",X,()=>Ga("")),H($,X)};de(F,$=>{c(f).current!==""&&$(M)})}var Q=R(F,2);{var z=$=>{var X=$5();ue(J=>X.disabled=J,[()=>c(u).trim()===""]),ae("click",X,d),H($,X)};de(Q,$=>{c(r)==="url"&&$(z)})}ue(()=>{q=it(C,1,"tab svelte-o6yxmi",null,q,{active:c(r)==="page"}),me(C,"aria-selected",c(r)==="page"),j=it(x,1,"tab svelte-o6yxmi",null,j,{active:c(r)==="url"}),me(x,"aria-selected",c(r)==="url")}),ae("click",C,()=>y(r,"page")),ae("click",x,()=>y(r,"url")),ae("click",U,()=>Ga(null)),H(O,L)};de(T,O=>{c(f)!==null&&O(v)})}dn(_,O=>y(n,O),()=>c(n)),Be("close",_,()=>Ga(null)),Be("cancel",_,()=>Ga(null)),H(t,_),ft()}At(["click","keydown"]);var G5=W('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),K5=W(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
130
+ password.</p>`),V5=W('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),X5=W(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),Q5=W('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),Z5=W('<p class="error svelte-2jpsc9" role="alert"> </p>'),J5=W('<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 ex(t,e){ct(e,!0);const n=Ae(()=>wn.name??"nanoesis");let r=ee(""),s=ee(""),a=ee(""),i=ee(!1),u=ee(null),o=Ae(()=>ot.firstRun&&c(a)!==""&&c(s)!==c(a)),f=Ae(()=>!c(i)&&c(r).trim()!==""&&c(s)!==""&&(!ot.firstRun||c(a)!==""&&!c(o)));async function h($){if($.preventDefault(),!c(f))return;y(i,!0),y(u,null);const X=await ot.login(c(r),c(s));if(y(i,!1),!X.ok){y(u,g(X.error??"Sign-in failed."),!0);return}}function g($){return $.includes("locked")?"Account temporarily locked, try again shortly.":$.includes("credentials")?"Invalid credentials. Check your username and password.":$}var d=J5(),m=I(d),b=I(m),_=I(b);{var T=$=>{var X=G5();ue(()=>me(X,"src",wn.logoUrl)),H($,X)};de(_,$=>{wn.logoUrl&&$(T)})}var v=R(_,2),O=I(v),L=R(v,2);{var B=$=>{var X=K5();H($,X)},C=$=>{var X=V5();H($,X)};de(L,$=>{ot.firstRun?$(B):$(C,-1)})}var q=R(b,2),x=I(q),j=R(I(x),2);yi(j,!0);var Z=R(x,2),Y=R(I(Z),2),E=R(Z,2);{var k=$=>{var X=Q5(),J=R(I(X),2),ne=R(J,2);{var ge=be=>{var pe=X5();H(be,pe)};de(ne,be=>{c(o)&&be(ge)})}Et(J,()=>c(a),be=>y(a,be)),H($,X)};de(E,$=>{ot.firstRun&&$(k)})}var S=R(E,2);{var U=$=>{var X=Z5(),J=I(X);ue(()=>fe(J,c(u))),H($,X)};de(S,$=>{c(u)&&$(U)})}var F=R(S,2),M=I(F);{var Q=$=>{var X=cf();ue(()=>fe(X,ot.firstRun?"Creating…":"Signing in…")),H($,X)},z=$=>{var X=cf();ue(()=>fe(X,ot.firstRun?"Create admin account":"Sign in")),H($,X)};de(M,$=>{c(i)?$(Q):$(z,-1)})}ue(()=>{fe(O,c(n)),me(Y,"autocomplete",ot.firstRun?"new-password":"current-password"),F.disabled=!c(f)}),Be("submit",q,h),Et(j,()=>c(r),$=>y(r,$)),Et(Y,()=>c(s),$=>y(s,$)),H(t,d),ft()}var tx=W('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),nx=W('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),rx=W('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),sx=W('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),ax=W('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),ix=W("<li><!></li>"),ux=W('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),ox=W('<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 lx(t,e){ct(e,!0);let n;const r=Ae(()=>Tn.errors),s=Ae(()=>Tn.warnings);kt(()=>{Tn.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(v){Wf.request(v),Tn.closePanel()}function i(v){v.preventDefault(),Tn.closePanel()}function u(v){v.target===n&&Tn.closePanel()}var o=ox(),f=R(I(o),2);{var h=v=>{var O=tx();H(v,O)},g=v=>{var O=nx();H(v,O)},d=v=>{var O=rx();H(v,O)},m=v=>{var O=ux(),L=pt(O),B=I(L),C=R(B);{var q=j=>{var Z=cf();ue(()=>fe(Z,`,
131
131
  ${c(s).length??""}
132
- ${c(s).length===1?"warning":"warnings"}`)),H(j,Z)};de(C,j=>{c(s).length>0&&j(q)})}var x=R(L,2);Ot(x,21,()=>[...c(r),...c(s)],Iu,(j,Z)=>{var Y=ex(),E=I(Y);{var k=U=>{var F=Z5(),M=I(F),Q=I(M),z=R(M,2),$=I(z);ue(()=>{fe(Q,c(Z).severity),fe($,c(Z).message)}),ae("click",F,()=>a(c(Z).path??"")),H(U,F)},S=U=>{var F=J5(),M=I(F),Q=I(M),z=R(M,2),$=I(z);ue(()=>{fe(Q,c(Z).severity),fe($,c(Z).message)}),H(U,F)};de(E,U=>{c(Z).path?U(k):U(S,-1)})}ue(()=>it(Y,1,em(c(Z).severity),"svelte-7emrh2")),H(j,Y)}),ue(()=>fe(B,`${c(r).length??""}
133
- ${c(r).length===1?"error":"errors"}`)),H(v,O)};de(f,v=>{Tn.status==="checking"?v(h):Tn.status==="error"?v(g,1):c(r).length===0&&c(s).length===0?v(d,2):v(m,-1)})}var b=R(f,2),_=I(b),T=R(_,2);dn(o,v=>n=v,()=>n),ue(()=>_.disabled=Tn.status==="checking"),Be("cancel",o,i),ae("click",o,u),ae("click",_,()=>void Tn.refresh()),ae("click",T,()=>Tn.closePanel()),H(t,o),ft()}At(["click"]);var sx=W('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),ax=W("<!> <!> <!> <!>",1);function ix(t,e){ct(e,!1),ka(()=>{Jo.init(),ot.init(),wn.load()}),um();var n=Ir(),r=pt(n);{var s=u=>{var o=sx();H(u,o)},a=u=>{K5(u,{})},i=u=>{var o=ax(),f=pt(o);v5(f,{});var h=R(f,2);L5(h,{});var g=R(h,2);H5(g,{});var d=R(g,2);rx(d,{}),H(u,o)};de(r,u=>{ot.status==="loading"?u(s):ot.status==="unauthenticated"?u(a,1):u(i,-1)})}H(t,n),ft()}const ux=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],ox=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function $b(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&ox.has(t.type)))for(const[e,n]of ux)t.setAttribute(e,n)}function ep(t){for(const e of t.querySelectorAll("input, textarea"))$b(e)}function lx(){ep(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&($b(r),ep(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const Yb=document.getElementById("app");if(Yb===null)throw new Error("Missing #app mount point");qA().then(()=>{AE(ix,{target:Yb}),lx()});export{Nx as $,c as A,de as B,nN as C,mx as D,IE as E,jd as F,Ff as G,gx as H,kr as I,Cy as J,Ex as K,vx as L,ka as M,ft as N,Cx as O,eN as P,vu as Q,ur as R,wg as S,Tt as T,ct as U,_x as V,Ca as W,dh as X,qy as Y,pr as Z,QA as _,tN as a,ws as a0,Tx as a1,wx as a2,y as a3,me as a4,it as a5,tm as a6,fe as a7,HE as a8,R as a9,hs as aa,Rr as ab,ee as ac,ue as ad,Jo as ae,Gp as af,yx as ag,Ae as ah,kt as ai,qf as b,iN as c,GO as d,en as e,H as f,GE as g,dn as h,Et as i,I as j,Ir as k,px as l,hl as m,bx as n,hx as o,Ax as p,At as q,ae as r,dl as s,Sx as t,dx as u,Ot as v,Be as w,Ix as x,pt as y,W as z};
132
+ ${c(s).length===1?"warning":"warnings"}`)),H(j,Z)};de(C,j=>{c(s).length>0&&j(q)})}var x=R(L,2);Ot(x,21,()=>[...c(r),...c(s)],Iu,(j,Z)=>{var Y=ix(),E=I(Y);{var k=U=>{var F=sx(),M=I(F),Q=I(M),z=R(M,2),$=I(z);ue(()=>{fe(Q,c(Z).severity),fe($,c(Z).message)}),ae("click",F,()=>a(c(Z).path??"")),H(U,F)},S=U=>{var F=ax(),M=I(F),Q=I(M),z=R(M,2),$=I(z);ue(()=>{fe(Q,c(Z).severity),fe($,c(Z).message)}),H(U,F)};de(E,U=>{c(Z).path?U(k):U(S,-1)})}ue(()=>it(Y,1,tm(c(Z).severity),"svelte-7emrh2")),H(j,Y)}),ue(()=>fe(B,`${c(r).length??""}
133
+ ${c(r).length===1?"error":"errors"}`)),H(v,O)};de(f,v=>{Tn.status==="checking"?v(h):Tn.status==="error"?v(g,1):c(r).length===0&&c(s).length===0?v(d,2):v(m,-1)})}var b=R(f,2),_=I(b),T=R(_,2);dn(o,v=>n=v,()=>n),ue(()=>_.disabled=Tn.status==="checking"),Be("cancel",o,i),ae("click",o,u),ae("click",_,()=>void Tn.refresh()),ae("click",T,()=>Tn.closePanel()),H(t,o),ft()}At(["click"]);var cx=W('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),fx=W("<!> <!> <!> <!>",1);function dx(t,e){ct(e,!1),ka(()=>{Jo.init(),ot.init(),wn.load()}),om();var n=Ir(),r=pt(n);{var s=u=>{var o=cx();H(u,o)},a=u=>{ex(u,{})},i=u=>{var o=fx(),f=pt(o);N5(f,{});var h=R(f,2);P5(h,{});var g=R(h,2);W5(g,{});var d=R(g,2);lx(d,{}),H(u,o)};de(r,u=>{ot.status==="loading"?u(s):ot.status==="unauthenticated"?u(a,1):u(i,-1)})}H(t,n),ft()}const hx=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],px=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function Kb(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&px.has(t.type)))for(const[e,n]of hx)t.setAttribute(e,n)}function tp(t){for(const e of t.querySelectorAll("input, textarea"))Kb(e)}function mx(){tp(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(Kb(r),tp(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const Vb=document.getElementById("app");if(Vb===null)throw new Error("Missing #app mount point");WA().then(()=>{CE(dx,{target:Vb}),mx()});export{pr as $,c as A,de as B,oN as C,_x as D,xE as E,jd as F,Ff as G,Ax as H,kr as I,Ry as J,Sx as K,Nx as L,ka as M,ft as N,Dx as O,iN as P,vu as Q,ur as R,Dg as S,Tt as T,$0 as U,ct as V,Cx as W,dh as X,Ca as Y,Wy as Z,n3 as _,uN as a,Ox as a0,ws as a1,Ix as a2,kx as a3,y as a4,me as a5,it as a6,nm as a7,fe as a8,zE as a9,R as aa,hs as ab,Rr as ac,ee as ad,ue as ae,Jo as af,Kp as ag,Lx as ah,Ae as ai,kt as aj,qf as b,dN as c,JO as d,en as e,H as f,ZE as g,dn as h,Et as i,I as j,Ir as k,Tx as l,hl as m,yx as n,Ex as o,wx as p,At as q,ae as r,dl as s,xx as t,vx as u,Ot as v,Be as w,Rx as x,pt as y,W as z};