@xtrable-ltd/nanoesis 0.1.15 → 0.1.17

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 (22) hide show
  1. package/dist/mcp.js +1 -1
  2. package/editor/assets/{MigrationsPane-WSjr6ra4.js → MigrationsPane-i0wjSyoQ.js} +3 -3
  3. package/editor/assets/{TemplatesPane-D0gGehUt.css → TemplatesPane-C-T4XiLp.css} +1 -1
  4. package/editor/assets/{TemplatesPane-s8Bmn-Xp.js → TemplatesPane-DsexK0er.js} +186 -186
  5. package/editor/assets/{cssMode-BBPWNzxT.js → cssMode-fc0wHMGr.js} +1 -1
  6. package/editor/assets/{freemarker2-Z9XRy2Q0.js → freemarker2-Dw44kalV.js} +1 -1
  7. package/editor/assets/{handlebars-BzWpuhqq.js → handlebars-CEMFICxK.js} +1 -1
  8. package/editor/assets/{html-CArHTeaS.js → html-skzxzrW2.js} +1 -1
  9. package/editor/assets/{htmlMode-DUSjuQrw.js → htmlMode-C-4dSBn8.js} +1 -1
  10. package/editor/assets/{index-DiDFsNpN.js → index-B_gM0Yjd.js} +69 -67
  11. package/editor/assets/{javascript-BPz_4ccl.js → javascript-BgHXwKkG.js} +1 -1
  12. package/editor/assets/{jsonMode-CBaTqjg8.js → jsonMode-Lc8WrRU9.js} +1 -1
  13. package/editor/assets/{liquid-CUZnZe5w.js → liquid-BQolAtSr.js} +1 -1
  14. package/editor/assets/{mdx-C-tiu7oI.js → mdx-CwISUfHN.js} +1 -1
  15. package/editor/assets/{python-qa8HmQ5p.js → python-DhucvE8q.js} +1 -1
  16. package/editor/assets/{razor-DjpYAyIn.js → razor-C6Qr3L5e.js} +1 -1
  17. package/editor/assets/{tsMode-DWyfouTX.js → tsMode-C2Xy3bvH.js} +1 -1
  18. package/editor/assets/{typescript-D41dm4J9.js → typescript-D3bsPWHt.js} +1 -1
  19. package/editor/assets/{xml-CVyULz07.js → xml-Dc0lsYpw.js} +1 -1
  20. package/editor/assets/{yaml-CHlKERaQ.js → yaml-BOMEMGOG.js} +1 -1
  21. package/editor/index.html +1 -1
  22. package/package.json +1 -1
@@ -1,32 +1,34 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-s8Bmn-Xp.js","./TemplatesPane-D0gGehUt.css","./MigrationsPane-WSjr6ra4.js","./MigrationsPane-BAHPPSXP.css"])))=>i.map(i=>d[i]);
2
- var Sv=Object.defineProperty;var Zh=t=>{throw TypeError(t)};var wv=(t,e,n)=>e in t?Sv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _e=(t,e,n)=>wv(t,typeof e!="symbol"?e+"":e,n),_c=(t,e,n)=>e.has(t)||Zh("Cannot "+n);var V=(t,e,n)=>(_c(t,e,"read from private field"),n?n.call(t):e.get(t)),qe=(t,e,n)=>e.has(t)?Zh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),je=(t,e,n,r)=>(_c(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),tt=(t,e,n)=>(_c(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 S1=!1;var Df=Array.isArray,Iv=Array.prototype.indexOf,Ea=Array.prototype.includes,kl=Array.from,Cv=Object.defineProperty,qs=Object.getOwnPropertyDescriptor,w1=Object.getOwnPropertyDescriptors,Lv=Object.prototype,Ov=Array.prototype,kf=Object.getPrototypeOf,Jh=Object.isExtensible;function Qi(t){return typeof t=="function"}const Pf=()=>{};function xv(t){return t()}function sd(t){for(var e=0;e<t.length;e++)t[e]()}function I1(){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 hn=2,Ni=4,Jo=8,Mf=1<<24,Sr=16,Or=32,Ws=64,ad=128,lr=512,tn=1024,on=2048,Jr=4096,xn=8192,cr=16384,Ma=32768,id=1<<25,bs=65536,ul=1<<17,Dv=1<<18,Hi=1<<19,C1=1<<20,Gr=1<<25,Ca=65536,ll=1<<21,ci=1<<22,js=1<<23,Kr=Symbol("$state"),L1=Symbol("legacy props"),kv=Symbol(""),Wu=Symbol("attributes"),od=Symbol("class"),ud=Symbol("style"),io=Symbol("text"),Gu=Symbol("form reset"),Pl=new class extends Error{constructor(){super(...arguments);_e(this,"name","StaleReactionError");_e(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var A1;const Bf=!!((A1=globalThis.document)!=null&&A1.contentType)&&globalThis.document.contentType.includes("xml");function O1(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Pv(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Mv(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Bv(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Fv(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Uv(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Hv(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function qv(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function jv(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function $v(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Yv(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zv(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Wv=1,Gv=2,x1=4,Kv=8,Vv=16,Xv=1,Qv=2,Zv=4,Jv=8,eE=16,tE=1,nE=2,Kt=Symbol("uninitialized"),R1="http://www.w3.org/1999/xhtml",rE="http://www.w3.org/2000/svg",sE="@attach";function aE(){console.warn("https://svelte.dev/e/derived_inert")}function iE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function oE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function D1(t){return t===this.v}function uE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function k1(t){return!uE(t,this.v)}let qi=!1,lE=!1;function cE(){qi=!0}let Et=null;function Si(t){Et=t}function dE(t){return fE().get(t)}function ct(t,e=!1,n){Et={p:Et,i:!1,c:null,e:null,s:t,x:null,r:Ve,l:qi&&!e?{s:null,u:null,$:[]}:null}}function dt(t){var e=Et,n=e.e;if(n!==null){e.e=null;for(var r of n)rm(r)}return e.i=!0,Et=e.p,{}}function ji(){return!qi||Et!==null&&Et.l===null}function fE(t){return Et===null&&O1(),Et.c??(Et.c=new Map(hE(Et)||void 0))}function hE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let la=[];function P1(){var t=la;la=[],sd(t)}function Cr(t){if(la.length===0&&!mo){var e=la;queueMicrotask(()=>{e===la&&P1()})}la.push(t)}function pE(){for(;la.length>0;)P1()}function M1(t){var e=Ve;if(e===null)return Ze.f|=js,t;if((e.f&Ma)===0&&(e.f&Ni)===0)throw t;Ps(t,e)}function Ps(t,e){for(;e!==null;){if((e.f&ad)!==0){if((e.f&Ma)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const mE=-7169;function Pt(t,e){t.f=t.f&mE|e}function Ff(t){(t.f&lr)!==0||t.deps===null?Pt(t,tn):Pt(t,Jr)}function B1(t){if(t!==null)for(const e of t)(e.f&hn)===0||(e.f&Ca)===0||(e.f^=Ca,B1(e.deps))}function F1(t,e,n){(t.f&on)!==0?e.add(t):(t.f&Jr)!==0&&n.add(t),B1(t.deps),Pt(t,tn)}let Nu=!1;function gE(t){var e=Nu;try{return Nu=!1,[t(),Nu]}finally{Nu=e}}let Ac=null,Qa=null,Pe=null,po=null,cn=null,ld=null,mo=!1,yc=!1,oi=null,Ku=null;var e0=0;let bE=1;var bi,xs,ha,vi,Ei,pa,Ti,cs,Wo,Yn,Go,Rs,$r,Yr,_i,ma,ft,cd,oo,dd,U1,H1,Vu,vE,fd,Ja;const Ll=class Ll{constructor(){qe(this,ft);_e(this,"id",bE++);qe(this,bi,!1);_e(this,"linked",!0);qe(this,xs,null);qe(this,ha,null);_e(this,"async_deriveds",new Map);_e(this,"current",new Map);_e(this,"previous",new Map);_e(this,"unblocked",new Set);qe(this,vi,new Set);qe(this,Ei,new Set);qe(this,pa,new Set);qe(this,Ti,0);qe(this,cs,new Map);qe(this,Wo,null);qe(this,Yn,[]);qe(this,Go,[]);qe(this,Rs,new Set);qe(this,$r,new Set);qe(this,Yr,new Map);qe(this,_i,new Set);_e(this,"is_fork",!1);qe(this,ma,!1)}skip_effect(e){V(this,Yr).has(e)||V(this,Yr).set(e,{d:[],m:[]}),V(this,_i).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=V(this,Yr).get(e);if(r){V(this,Yr).delete(e);for(var s of r.d)Pt(s,on),n(s);for(s of r.m)Pt(s,Jr),n(s)}V(this,_i).add(e)}capture(e,n,r=!1){e.v!==Kt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&js)===0&&(this.current.set(e,[n,r]),cn==null||cn.set(e,n)),this.is_fork||(e.v=n)}activate(){Pe=this}deactivate(){Pe=null,cn=null}flush(){try{yc=!0,Pe=this,tt(this,ft,oo).call(this)}finally{e0=0,ld=null,oi=null,Ku=null,yc=!1,Pe=null,cn=null,Ta.clear()}}discard(){for(const e of V(this,Ei))e(this);V(this,Ei).clear(),V(this,pa).clear(),tt(this,ft,Ja).call(this)}register_created_effect(e){V(this,Go).push(e)}increment(e,n){if(je(this,Ti,V(this,Ti)+1),e){let r=V(this,cs).get(n)??0;V(this,cs).set(n,r+1)}}decrement(e,n){if(je(this,Ti,V(this,Ti)-1),e){let r=V(this,cs).get(n)??0;r===1?V(this,cs).delete(n):V(this,cs).set(n,r-1)}V(this,ma)||(je(this,ma,!0),Cr(()=>{je(this,ma,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)V(this,Rs).add(r);for(const r of n)V(this,$r).add(r);e.clear(),n.clear()}oncommit(e){V(this,vi).add(e)}ondiscard(e){V(this,Ei).add(e)}on_fork_commit(e){V(this,pa).add(e)}run_fork_commit_callbacks(){for(const e of V(this,pa))e(this);V(this,pa).clear()}settled(){return(V(this,Wo)??je(this,Wo,I1())).promise}static ensure(){var e;if(Pe===null){const n=Pe=new Ll;tt(e=n,ft,fd).call(e),!yc&&!mo&&Cr(()=>{V(n,bi)||n.flush()})}return Pe}apply(){{cn=null;return}}schedule(e){var s;if(ld=e,(s=e.b)!=null&&s.is_pending&&(e.f&(Ni|Jo|Mf))!==0&&(e.f&Ma)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(oi!==null&&n===Ve&&(Ze===null||(Ze.f&hn)===0))return;if((r&(Ws|Or))!==0){if((r&tn)===0)return;n.f^=tn}}V(this,Yn).push(n)}};bi=new WeakMap,xs=new WeakMap,ha=new WeakMap,vi=new WeakMap,Ei=new WeakMap,pa=new WeakMap,Ti=new WeakMap,cs=new WeakMap,Wo=new WeakMap,Yn=new WeakMap,Go=new WeakMap,Rs=new WeakMap,$r=new WeakMap,Yr=new WeakMap,_i=new WeakMap,ma=new WeakMap,ft=new WeakSet,cd=function(){if(this.is_fork)return!0;for(const r of V(this,cs).keys()){for(var e=r,n=!1;e.parent!==null;){if(V(this,Yr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},oo=function(){var u,d,h,g;if(je(this,bi,!0),e0++>1e3&&(tt(this,ft,Ja).call(this),TE()),!tt(this,ft,cd).call(this)){for(const f of V(this,Rs))V(this,$r).delete(f),Pt(f,on),this.schedule(f);for(const f of V(this,$r))Pt(f,Jr),this.schedule(f)}const e=V(this,Yn);je(this,Yn,[]),this.apply();var n=oi=[],r=[],s=Ku=[];for(const f of e)try{tt(this,ft,dd).call(this,f,n,r)}catch(m){throw $1(f),m}if(Pe=null,s.length>0){var a=Ll.ensure();for(const f of s)a.schedule(f)}if(oi=null,Ku=null,tt(this,ft,cd).call(this)){tt(this,ft,Vu).call(this,r),tt(this,ft,Vu).call(this,n);for(const[f,m]of V(this,Yr))j1(f,m);s.length>0&&tt(u=Pe,ft,oo).call(u);return}const i=tt(this,ft,U1).call(this);if(i){tt(d=i,ft,H1).call(d,this);return}V(this,Rs).clear(),V(this,$r).clear();for(const f of V(this,vi))f(this);V(this,vi).clear(),po=this,t0(r),t0(n),po=null,(h=V(this,Wo))==null||h.resolve();var o=Pe;if(this.linked&&V(this,Ti)===0&&tt(this,ft,Ja).call(this),V(this,Yn).length>0){o===null&&(o=this,tt(this,ft,fd).call(this));const f=o;V(f,Yn).push(...V(this,Yn).filter(m=>!V(f,Yn).includes(m)))}o!==null&&tt(g=o,ft,oo).call(g)},dd=function(e,n,r){e.f^=tn;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Or|Ws))!==0,o=i&&(a&tn)!==0,u=o||(a&xn)!==0||V(this,Yr).has(s);if(!u&&s.fn!==null){i?s.f^=tn:(a&Ni)!==0?n.push(s):ru(s)&&((a&Sr)!==0&&V(this,$r).add(s),Oi(s));var d=s.first;if(d!==null){s=d;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},U1=function(){for(var e=V(this,xs);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=V(e,xs)}return null},H1=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 u of a){var i=u.f;if((i&hn)!==0)n(u);else{var o=u;i&(ci|Sr)&&!this.async_deriveds.has(o)&&(V(this,$r).delete(o),Pt(o,on),this.schedule(o))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),tt(r=e,ft,Ja).call(r),Pe=this,tt(this,ft,oo).call(this)},Vu=function(e){for(var n=0;n<e.length;n+=1)F1(e[n],V(this,Rs),V(this,$r))},vE=function(){var h;tt(this,ft,Ja).call(this);for(let g=Ac;g!==null;g=V(g,ha)){var e=g.id<this.id,n=[];for(const[f,[m,b]]of this.current){if(g.current.has(f)){var r=g.current.get(f)[0];if(e&&m!==r)g.current.set(f,[m,b]);else continue}n.push(f)}if(e)for(const[f,m]of this.async_deriveds){const b=g.async_deriveds.get(f);b&&m.promise.then(b.resolve)}if(V(g,bi)){var s=[...g.current.keys()].filter(f=>!this.current.has(f));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const f of V(this,_i))g.unskip_effect(f,m=>{var b;(m.f&(Sr|ci))!==0?g.schedule(m):tt(b=g,ft,Vu).call(b,[m])});g.activate();var a=new Set,i=new Map;for(var o of n)q1(o,s,a,i);i=new Map;var u=[...g.current.keys()].filter(f=>this.current.has(f)?this.current.get(f)[0]!==f.v:!0);if(u.length>0)for(const f of V(this,Go))(f.f&(cr|xn|ul))===0&&Uf(f,u,i)&&((f.f&(ci|Sr))!==0?(Pt(f,on),g.schedule(f)):V(g,Rs).add(f));if(V(g,Yn).length>0&&!V(g,ma)){g.apply();for(var d of V(g,Yn))tt(h=g,ft,dd).call(h,d,[],[]);je(g,Yn,[])}g.deactivate()}}}},fd=function(){Qa===null?Ac=Qa=this:(je(Qa,ha,this),je(this,xs,Qa)),Qa=this},Ja=function(){var e=V(this,xs),n=V(this,ha);e===null?Ac=n:je(e,ha,n),n===null?Qa=e:je(n,xs,e),this.linked=!1};let La=Ll;function EE(t){var e=mo;mo=!0;try{for(var n;;){if(pE(),Pe===null)return n;Pe.flush()}}finally{mo=e}}function TE(){try{Hv()}catch(t){Ps(t,ld)}}let vr=null;function t0(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(cr|xn))===0&&ru(r)&&(vr=new Set,Oi(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&im(r),(vr==null?void 0:vr.size)>0)){Ta.clear();for(const s of vr){if((s.f&(cr|xn))!==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 o=a.length-1;o>=0;o--){const u=a[o];(u.f&(cr|xn))===0&&Oi(u)}}vr.clear()}}vr=null}}function q1(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&hn)!==0?q1(s,e,n,r):(a&(ci|Sr))!==0&&(a&on)===0&&Uf(s,e,r)&&(Pt(s,on),Hf(s))}}function Uf(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(Ea.call(e,s))return!0;if((s.f&hn)!==0&&Uf(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function Hf(t){Pe.schedule(t)}function j1(t,e){if(!((t.f&Or)!==0&&(t.f&tn)!==0)){(t.f&on)!==0?e.d.push(t):(t.f&Jr)!==0&&e.m.push(t),Pt(t,tn);for(var n=t.first;n!==null;)j1(n,e),n=n.next}}function $1(t){Pt(t,tn);for(var e=t.first;e!==null;)$1(e),e=e.next}function _E(t){let e=0,n=Oa(0),r;return()=>{Yf()&&(l(n),Bl(()=>(e===0&&(r=Fa(()=>t(()=>go(n)))),e+=1,()=>{Cr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,go(n))})})))}}var AE=bs|Hi;function yE(t,e,n,r){new NE(t,e,n,r)}var er,Rf,tr,ga,Mn,nr,Cn,zn,ds,ba,Ds,Ai,Ko,Vo,fs,Ol,Mt,SE,wE,IE,hd,Xu,Qu,pd,md;class NE{constructor(e,n,r,s){qe(this,Mt);_e(this,"parent");_e(this,"is_pending",!1);_e(this,"transform_error");qe(this,er);qe(this,Rf,null);qe(this,tr);qe(this,ga);qe(this,Mn);qe(this,nr,null);qe(this,Cn,null);qe(this,zn,null);qe(this,ds,null);qe(this,ba,0);qe(this,Ds,0);qe(this,Ai,!1);qe(this,Ko,new Set);qe(this,Vo,new Set);qe(this,fs,null);qe(this,Ol,_E(()=>(je(this,fs,Oa(V(this,ba))),()=>{je(this,fs,null)})));var a;je(this,er,e),je(this,tr,n),je(this,ga,i=>{var o=Ve;o.b=this,o.f|=ad,r(i)}),this.parent=Ve.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),je(this,Mn,Ba(()=>{tt(this,Mt,hd).call(this)},AE))}defer_effect(e){F1(e,V(this,Ko),V(this,Vo))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!V(this,tr).pending}update_pending_count(e,n){tt(this,Mt,pd).call(this,e,n),je(this,ba,V(this,ba)+e),!(!V(this,fs)||V(this,Ai))&&(je(this,Ai,!0),Cr(()=>{je(this,Ai,!1),V(this,fs)&&Ii(V(this,fs),V(this,ba))}))}get_effect_pending(){return V(this,Ol).call(this),l(V(this,fs))}error(e){if(!V(this,tr).onerror&&!V(this,tr).failed)throw e;Pe!=null&&Pe.is_fork?(V(this,nr)&&Pe.skip_effect(V(this,nr)),V(this,Cn)&&Pe.skip_effect(V(this,Cn)),V(this,zn)&&Pe.skip_effect(V(this,zn)),Pe.on_fork_commit(()=>{tt(this,Mt,md).call(this,e)})):tt(this,Mt,md).call(this,e)}}er=new WeakMap,Rf=new WeakMap,tr=new WeakMap,ga=new WeakMap,Mn=new WeakMap,nr=new WeakMap,Cn=new WeakMap,zn=new WeakMap,ds=new WeakMap,ba=new WeakMap,Ds=new WeakMap,Ai=new WeakMap,Ko=new WeakMap,Vo=new WeakMap,fs=new WeakMap,Ol=new WeakMap,Mt=new WeakSet,SE=function(){try{je(this,nr,Fn(()=>V(this,ga).call(this,V(this,er))))}catch(e){this.error(e)}},wE=function(e){const n=V(this,tr).failed;n&&je(this,zn,Fn(()=>{n(V(this,er),()=>e,()=>()=>{})}))},IE=function(){const e=V(this,tr).pending;e&&(this.is_pending=!0,je(this,Cn,Fn(()=>e(V(this,er)))),Cr(()=>{var n=je(this,ds,document.createDocumentFragment()),r=Vr();n.append(r),je(this,nr,tt(this,Mt,Qu).call(this,()=>Fn(()=>V(this,ga).call(this,r)))),V(this,Ds)===0&&(V(this,er).before(n),je(this,ds,null),_a(V(this,Cn),()=>{je(this,Cn,null)}),tt(this,Mt,Xu).call(this,Pe))}))},hd=function(){try{if(this.is_pending=this.has_pending_snippet(),je(this,Ds,0),je(this,ba,0),je(this,nr,Fn(()=>{V(this,ga).call(this,V(this,er))})),V(this,Ds)>0){var e=je(this,ds,document.createDocumentFragment());Gf(V(this,nr),e);const n=V(this,tr).pending;je(this,Cn,Fn(()=>n(V(this,er))))}else tt(this,Mt,Xu).call(this,Pe)}catch(n){this.error(n)}},Xu=function(e){this.is_pending=!1,e.transfer_effects(V(this,Ko),V(this,Vo))},Qu=function(e){var n=Ve,r=Ze,s=Et;es(V(this,Mn)),fr(V(this,Mn)),Si(V(this,Mn).ctx);try{return La.ensure(),e()}catch(a){return M1(a),null}finally{es(n),fr(r),Si(s)}},pd=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&tt(r=this.parent,Mt,pd).call(r,e,n);return}je(this,Ds,V(this,Ds)+e),V(this,Ds)===0&&(tt(this,Mt,Xu).call(this,n),V(this,Cn)&&_a(V(this,Cn),()=>{je(this,Cn,null)}),V(this,ds)&&(V(this,er).before(V(this,ds)),je(this,ds,null)))},md=function(e){V(this,nr)&&(dn(V(this,nr)),je(this,nr,null)),V(this,Cn)&&(dn(V(this,Cn)),je(this,Cn,null)),V(this,zn)&&(dn(V(this,zn)),je(this,zn,null));var n=V(this,tr).onerror;let r=V(this,tr).failed;var s=!1,a=!1;const i=()=>{if(s){oE();return}s=!0,a&&zv(),V(this,zn)!==null&&_a(V(this,zn),()=>{je(this,zn,null)}),tt(this,Mt,Qu).call(this,()=>{tt(this,Mt,hd).call(this)})},o=u=>{try{a=!0,n==null||n(u,i),a=!1}catch(d){Ps(d,V(this,Mn)&&V(this,Mn).parent)}r&&je(this,zn,tt(this,Mt,Qu).call(this,()=>{try{return Fn(()=>{var d=Ve;d.b=this,d.f|=ad,r(V(this,er),()=>u,()=>i)})}catch(d){return Ps(d,V(this,Mn).parent),null}}))};Cr(()=>{var u;try{u=this.transform_error(e)}catch(d){Ps(d,V(this,Mn)&&V(this,Mn).parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(o,d=>Ps(d,V(this,Mn)&&V(this,Mn).parent)):o(u)})};function Y1(t,e,n,r){const s=ji()?wi:qf;var a=t.filter(f=>!f.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Ve,o=CE(),u=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(f=>f.promise)):null;function d(f){if((i.f&cr)===0){o();try{r(f)}catch(m){Ps(m,i)}cl()}}var h=z1();if(n.length===0){u.then(()=>d(e.map(s))).finally(h);return}function g(){Promise.all(n.map(f=>LE(f))).then(f=>d([...e.map(s),...f])).catch(f=>Ps(f,i)).finally(h)}u?u.then(()=>{o(),g(),cl()}):g()}function CE(){var t=Ve,e=Ze,n=Et,r=Pe;return function(a=!0){es(t),fr(e),Si(n),a&&(t.f&cr)===0&&(r==null||r.activate(),r==null||r.apply())}}function cl(t=!0){es(null),fr(null),Si(null),t&&(Pe==null||Pe.deactivate())}function z1(){var t=Ve,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 wi(t){var e=hn|on;return Ve!==null&&(Ve.f|=Hi),{ctx:Et,deps:null,effects:null,equals:D1,f:e,fn:t,reactions:null,rv:0,v:Kt,wv:0,parent:Ve,ac:null}}const Su=Symbol("obsolete");function LE(t,e,n){let r=Ve;r===null&&Pv();var s=void 0,a=Oa(Kt),i=!Ze,o=new Set;return HE(()=>{var m;var u=Ve,d=I1();s=d.promise;try{Promise.resolve(t()).then(d.resolve,b=>{b!==Pl&&d.reject(b)}).finally(cl)}catch(b){d.reject(b),cl()}var h=Pe;if(i){if((u.f&Ma)!==0)var g=z1();if(r.b.is_rendered())(m=h.async_deriveds.get(u))==null||m.reject(Su);else for(const b of o.values())b.reject(Su);o.add(d),h.async_deriveds.set(u,d)}const f=(b,_=void 0)=>{g==null||g(),o.delete(d),_!==Su&&(h.activate(),_?(a.f|=js,Ii(a,_)):((a.f&js)!==0&&(a.f^=js),Ii(a,b)),h.deactivate())};d.promise.then(f,b=>f(null,b||"unknown"))}),tu(()=>{for(const u of o)u.reject(Su)}),new Promise(u=>{function d(h){function g(){h===s?u(a):d(s)}h.then(g,g)}d(s)})}function Ae(t){const e=wi(t);return lm(e),e}function qf(t){const e=wi(t);return e.equals=k1,e}function OE(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)dn(e[n])}}function jf(t){var e,n=Ve,r=t.parent;if(!vs&&r!==null&&t.v!==Kt&&(r.f&(cr|xn))!==0)return aE(),t.v;es(r);try{t.f&=~Ca,OE(t),e=hm(t)}finally{es(n)}return e}function W1(t){var e=jf(t);if(!t.equals(e)&&(t.wv=dm(),(!(Pe!=null&&Pe.is_fork)||t.deps===null)&&(Pe!==null?(Pe.capture(t,e,!0),po==null||po.capture(t,e,!0)):t.v=e,t.deps===null))){Pt(t,tn);return}vs||(cn!==null?(Yf()||Pe!=null&&Pe.is_fork)&&cn.set(t,e):Ff(t))}function xE(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(Pl),r.fn!==null&&(r.teardown=Pf),r.ac=null,Oo(r,0),zf(r))}function G1(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Oi(e)}let dl=new Set;const Ta=new Map;let K1=!1;function Oa(t,e){var n={f:0,v:t,reactions:null,equals:D1,rv:0,wv:0};return n}function Z(t,e){const n=Oa(t);return lm(n),n}function RE(t,e=!1,n=!0){var s;const r=Oa(t);return e||(r.equals=k1),qi&&n&&Et!==null&&Et.l!==null&&((s=Et.l).s??(s.s=[])).push(r),r}function y(t,e,n=!1){Ze!==null&&(!wr||(Ze.f&ul)!==0)&&ji()&&(Ze.f&(hn|Sr|ci|ul))!==0&&(dr===null||!Ea.call(dr,t))&&Yv();let r=n?lt(e):e;return Ii(t,r,Ku)}function Ii(t,e,n=null){if(!t.equals(e)){Ta.set(t,vs?e:t.v);var r=La.ensure();if(r.capture(t,e),(t.f&hn)!==0){const s=t;(t.f&on)!==0&&jf(s),cn===null&&Ff(s)}t.wv=dm(),V1(t,on,n),ji()&&Ve!==null&&(Ve.f&tn)!==0&&(Ve.f&(Or|Ws))===0&&(Jn===null?$E([t]):Jn.push(t)),!r.is_fork&&dl.size>0&&!K1&&DE()}return e}function DE(){K1=!1;for(const t of dl){(t.f&tn)!==0&&Pt(t,Jr);let e;try{e=ru(t)}catch{e=!0}e&&Oi(t)}dl.clear()}function go(t){y(t,t.v+1)}function V1(t,e,n){var r=t.reactions;if(r!==null)for(var s=ji(),a=r.length,i=0;i<a;i++){var o=r[i],u=o.f;if(!(!s&&o===Ve)){var d=(u&on)===0;if(d&&Pt(o,e),(u&ul)!==0)dl.add(o);else if((u&hn)!==0){var h=o;cn==null||cn.delete(h),(u&Ca)===0&&(u&lr&&(Ve===null||(Ve.f&ll)===0)&&(o.f|=Ca),V1(h,Jr,n))}else if(d){var g=o;(u&Sr)!==0&&vr!==null&&vr.add(g),n!==null?n.push(g):Hf(g)}}}}function lt(t){if(typeof t!="object"||t===null||Kr in t)return t;const e=kf(t);if(e!==Lv&&e!==Ov)return t;var n=new Map,r=Df(t),s=Z(0),a=Aa,i=o=>{if(Aa===a)return o();var u=Ze,d=Aa;fr(null),i0(a);var h=o();return fr(u),i0(d),h};return r&&n.set("length",Z(t.length)),new Proxy(t,{defineProperty(o,u,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&jv();var h=n.get(u);return h===void 0?i(()=>{var g=Z(d.value);return n.set(u,g),g}):y(h,d.value,!0),!0},deleteProperty(o,u){var d=n.get(u);if(d===void 0){if(u in o){const h=i(()=>Z(Kt));n.set(u,h),go(s)}}else y(d,Kt),go(s);return!0},get(o,u,d){var m;if(u===Kr)return t;var h=n.get(u),g=u in o;if(h===void 0&&(!g||(m=qs(o,u))!=null&&m.writable)&&(h=i(()=>{var b=lt(g?o[u]:Kt),_=Z(b);return _}),n.set(u,h)),h!==void 0){var f=l(h);return f===Kt?void 0:f}return Reflect.get(o,u,d)},getOwnPropertyDescriptor(o,u){var d=Reflect.getOwnPropertyDescriptor(o,u);if(d&&"value"in d){var h=n.get(u);h&&(d.value=l(h))}else if(d===void 0){var g=n.get(u),f=g==null?void 0:g.v;if(g!==void 0&&f!==Kt)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return d},has(o,u){var f;if(u===Kr)return!0;var d=n.get(u),h=d!==void 0&&d.v!==Kt||Reflect.has(o,u);if(d!==void 0||Ve!==null&&(!h||(f=qs(o,u))!=null&&f.writable)){d===void 0&&(d=i(()=>{var m=h?lt(o[u]):Kt,b=Z(m);return b}),n.set(u,d));var g=l(d);if(g===Kt)return!1}return h},set(o,u,d,h){var I;var g=n.get(u),f=u in o;if(r&&u==="length")for(var m=d;m<g.v;m+=1){var b=n.get(m+"");b!==void 0?y(b,Kt):m in o&&(b=i(()=>Z(Kt)),n.set(m+"",b))}if(g===void 0)(!f||(I=qs(o,u))!=null&&I.writable)&&(g=i(()=>Z(void 0)),y(g,lt(d)),n.set(u,g));else{f=g.v!==Kt;var _=i(()=>lt(d));y(g,_)}var A=Reflect.getOwnPropertyDescriptor(o,u);if(A!=null&&A.set&&A.set.call(h,d),!f){if(r&&typeof u=="string"){var E=n.get("length"),C=Number(u);Number.isInteger(C)&&C>=E.v&&y(E,C+1)}go(s)}return!0},ownKeys(o){l(s);var u=Reflect.ownKeys(o).filter(g=>{var f=n.get(g);return f===void 0||f.v!==Kt});for(var[d,h]of n)h.v!==Kt&&!(d in o)&&u.push(d);return u},setPrototypeOf(){$v()}})}function n0(t){try{if(t!==null&&typeof t=="object"&&Kr in t)return t[Kr]}catch{}return t}function X1(t,e){return Object.is(n0(t),n0(e))}var r0,Q1,Z1,J1;function kE(){if(r0===void 0){r0=window,Q1=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Z1=qs(e,"firstChild").get,J1=qs(e,"nextSibling").get,Jh(t)&&(t[od]=void 0,t[Wu]=null,t[ud]=void 0,t.__e=void 0),Jh(n)&&(n[io]=void 0)}}function Vr(t=""){return document.createTextNode(t)}function Ci(t){return Z1.call(t)}function eu(t){return J1.call(t)}function S(t,e){return Ci(t)}function nt(t,e=!1){{var n=Ci(t);return n instanceof Comment&&n.data===""?eu(n):n}}function x(t,e=1,n=!1){let r=t;for(;e--;)r=eu(r);return r}function PE(t){t.textContent=""}function em(){return!1}function tm(t,e,n){return document.createElementNS(e??R1,t,void 0)}function Li(t,e){if(e){const n=document.body;t.autofocus=!0,Cr(()=>{document.activeElement===n&&t.focus()})}}let s0=!1;function ME(){s0||(s0=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[Gu])==null||e.call(n)})},{capture:!0}))}function Ml(t){var e=Ze,n=Ve;fr(null),es(null);try{return t()}finally{fr(e),es(n)}}function $f(t,e,n,r=n){t.addEventListener(e,()=>Ml(n));const s=t[Gu];s?t[Gu]=()=>{s(),r(!0)}:t[Gu]=()=>r(!0),ME()}function nm(t){Ve===null&&(Ze===null&&Uv(),Fv()),vs&&Bv()}function BE(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Rr(t,e){var n=Ve;n!==null&&(n.f&xn)!==0&&(t|=xn);var r={ctx:Et,deps:null,nodes:null,f:t|on|lr,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&Ni)!==0)oi!==null?oi.push(r):La.ensure().schedule(r);else if(e!==null){try{Oi(r)}catch(i){throw dn(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Hi)===0&&(s=s.first,(t&Sr)!==0&&(t&bs)!==0&&s!==null&&(s.f|=bs))}if(s!==null&&(s.parent=n,n!==null&&BE(s,n),Ze!==null&&(Ze.f&hn)!==0&&(t&Ws)===0)){var a=Ze;(a.effects??(a.effects=[])).push(s)}return r}function Yf(){return Ze!==null&&!wr}function tu(t){const e=Rr(Jo,null);return Pt(e,tn),e.teardown=t,e}function Dt(t){nm();var e=Ve.f,n=!Ze&&(e&Or)!==0&&(e&Ma)===0;if(n){var r=Et;(r.e??(r.e=[])).push(t)}else return rm(t)}function rm(t){return Rr(Ni|C1,t)}function FE(t){return nm(),Rr(Jo|C1,t)}function UE(t){La.ensure();const e=Rr(Ws|Hi,t);return(n={})=>new Promise(r=>{n.outro?_a(e,()=>{dn(e),r(void 0)}):(dn(e),r(void 0))})}function nu(t){return Rr(Ni,t)}function HE(t){return Rr(ci|Hi,t)}function Bl(t,e=0){return Rr(Jo|e,t)}function se(t,e=[],n=[],r=[]){Y1(r,e,n,s=>{Rr(Jo,()=>t(...s.map(l)))})}function Ba(t,e=0){var n=Rr(Sr|e,t);return n}function sm(t,e=0){var n=Rr(Mf|e,t);return n}function Fn(t){return Rr(Or|Hi,t)}function am(t){var e=t.teardown;if(e!==null){const n=vs,r=Ze;a0(!0),fr(null);try{e.call(null)}finally{a0(n),fr(r)}}}function zf(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Ml(()=>{s.abort(Pl)});var r=n.next;(n.f&Ws)!==0?n.parent=null:dn(n,e),n=r}}function qE(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Or)===0&&dn(e),e=n}}function dn(t,e=!0){var n=!1;(e||(t.f&Dv)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(jE(t.nodes.start,t.nodes.end),n=!0),Pt(t,id),zf(t,e&&!n),Oo(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();am(t),t.f^=id,t.f|=cr;var s=t.parent;s!==null&&s.first!==null&&im(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function jE(t,e){for(;t!==null;){var n=t===e?null:eu(t);t.remove(),t=n}}function im(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 _a(t,e,n=!0){var r=[];om(t,r,!0);var s=()=>{n&&dn(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var o of r)o.out(i)}else s()}function om(t,e,n){if((t.f&xn)===0){t.f^=xn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var a=s.next;if((s.f&Ws)===0){var i=(s.f&bs)!==0||(s.f&Or)!==0&&(t.f&Sr)!==0;om(s,e,i?n:!1)}s=a}}}function Wf(t){um(t,!0)}function um(t,e){if((t.f&xn)!==0){t.f^=xn,(t.f&tn)===0&&(Pt(t,on),La.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&bs)!==0||(n.f&Or)!==0;um(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 Gf(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:eu(n);e.append(n),n=s}}let Zu=!1,vs=!1;function a0(t){vs=t}let Ze=null,wr=!1;function fr(t){Ze=t}let Ve=null;function es(t){Ve=t}let dr=null;function lm(t){Ze!==null&&(dr===null?dr=[t]:dr.push(t))}let Bn=null,$n=0,Jn=null;function $E(t){Jn=t}let cm=1,ca=0,Aa=ca;function i0(t){Aa=t}function dm(){return++cm}function ru(t){var e=t.f;if((e&on)!==0)return!0;if(e&hn&&(t.f&=~Ca),(e&Jr)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(ru(a)&&W1(a),a.wv>t.wv)return!0}(e&lr)!==0&&cn===null&&Pt(t,tn)}return!1}function fm(t,e,n=!0){var r=t.reactions;if(r!==null&&!(dr!==null&&Ea.call(dr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&hn)!==0?fm(a,e,!1):e===a&&(n?Pt(a,on):(a.f&tn)!==0&&Pt(a,Jr),Hf(a))}}function hm(t){var _;var e=Bn,n=$n,r=Jn,s=Ze,a=dr,i=Et,o=wr,u=Aa,d=t.f;Bn=null,$n=0,Jn=null,Ze=(d&(Or|Ws))===0?t:null,dr=null,Si(t.ctx),wr=!1,Aa=++ca,t.ac!==null&&(Ml(()=>{t.ac.abort(Pl)}),t.ac=null);try{t.f|=ll;var h=t.fn,g=h();t.f|=Ma;var f=t.deps,m=Pe==null?void 0:Pe.is_fork;if(Bn!==null){var b;if(m||Oo(t,$n),f!==null&&$n>0)for(f.length=$n+Bn.length,b=0;b<Bn.length;b++)f[$n+b]=Bn[b];else t.deps=f=Bn;if(Yf()&&(t.f&lr)!==0)for(b=$n;b<f.length;b++)((_=f[b]).reactions??(_.reactions=[])).push(t)}else!m&&f!==null&&$n<f.length&&(Oo(t,$n),f.length=$n);if(ji()&&Jn!==null&&!wr&&f!==null&&(t.f&(hn|Jr|on))===0)for(b=0;b<Jn.length;b++)fm(Jn[b],t);if(s!==null&&s!==t){if(ca++,s.deps!==null)for(let A=0;A<n;A+=1)s.deps[A].rv=ca;if(e!==null)for(const A of e)A.rv=ca;Jn!==null&&(r===null?r=Jn:r.push(...Jn))}return(t.f&js)!==0&&(t.f^=js),g}catch(A){return M1(A)}finally{t.f^=ll,Bn=e,$n=n,Jn=r,Ze=s,dr=a,Si(i),wr=o,Aa=u}}function YE(t,e){let n=e.reactions;if(n!==null){var r=Iv.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&hn)!==0&&(Bn===null||!Ea.call(Bn,e))){var a=e;(a.f&lr)!==0&&(a.f^=lr,a.f&=~Ca),a.v!==Kt&&Ff(a),xE(a),Oo(a,0)}}function Oo(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)YE(t,n[r])}function Oi(t){var e=t.f;if((e&cr)===0){Pt(t,tn);var n=Ve,r=Zu;Ve=t,Zu=!0;try{(e&(Sr|Mf))!==0?qE(t):zf(t),am(t);var s=hm(t);t.teardown=typeof s=="function"?s:null,t.wv=cm;var a;S1&&lE&&(t.f&on)!==0&&t.deps}finally{Zu=r,Ve=n}}}async function pm(){await Promise.resolve(),EE()}function l(t){var e=t.f,n=(e&hn)!==0;if(Ze!==null&&!wr){var r=Ve!==null&&(Ve.f&cr)!==0;if(!r&&(dr===null||!Ea.call(dr,t))){var s=Ze.deps;if((Ze.f&ll)!==0)t.rv<ca&&(t.rv=ca,Bn===null&&s!==null&&s[$n]===t?$n++:Bn===null?Bn=[t]:Bn.push(t));else{Ze.deps??(Ze.deps=[]),Ea.call(Ze.deps,t)||Ze.deps.push(t);var a=t.reactions;a===null?t.reactions=[Ze]:Ea.call(a,Ze)||a.push(Ze)}}}if(vs&&Ta.has(t))return Ta.get(t);if(n){var i=t;if(vs){var o=i.v;return((i.f&tn)===0&&i.reactions!==null||gm(i))&&(o=jf(i)),Ta.set(i,o),o}var u=(i.f&lr)===0&&!wr&&Ze!==null&&(Zu||(Ze.f&lr)!==0),d=(i.f&Ma)===0;ru(i)&&(u&&(i.f|=lr),W1(i)),u&&!d&&(G1(i),mm(i))}if(cn!=null&&cn.has(t))return cn.get(t);if((t.f&js)!==0)throw t.v;return t.v}function mm(t){if(t.f|=lr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&hn)!==0&&(e.f&lr)===0&&(G1(e),mm(e))}function gm(t){if(t.v===Kt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Ta.has(e)||(e.f&hn)!==0&&gm(e))return!0;return!1}function Fa(t){var e=wr;try{return wr=!0,t()}finally{wr=e}}function zE(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Kr in t)gd(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Kr in n&&gd(n)}}}function gd(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{gd(t[r],e)}catch{}const n=kf(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=w1(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function WE(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const GE=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function KE(t){return GE.includes(t)}const VE={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 XE(t){return t=t.toLowerCase(),VE[t]??t}const QE=["touchstart","touchmove"];function ZE(t){return QE.includes(t)}const da=Symbol("events"),bm=new Set,bd=new Set;function vm(t,e,n,r={}){function s(a){if(r.capture||vd.call(e,a),!a.cancelBubble)return Ml(()=>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=vm(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&tu(()=>{e.removeEventListener(t,i,a)})}function ae(t,e,n){(e[da]??(e[da]={}))[t]=n}function bt(t){for(var e=0;e<t.length;e++)bm.add(t[e]);for(var n of bd)n(t)}let o0=null;function vd(t){var A,E;var e=this,n=e.ownerDocument,r=t.type,s=((A=t.composedPath)==null?void 0:A.call(t))||[],a=s[0]||t.target;o0=t;var i=0,o=o0===t&&t[da];if(o){var u=s.indexOf(o);if(u!==-1&&(e===document||e===window)){t[da]=e;return}var d=s.indexOf(e);if(d===-1)return;u<=d&&(i=u)}if(a=s[i]||t.target,a!==e){Cv(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=Ze,g=Ve;fr(null),es(null);try{for(var f,m=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var _=(E=a[da])==null?void 0:E[r];_!=null&&(!a.disabled||t.target===a)&&_.call(a,t)}catch(C){f?m.push(C):f=C}if(t.cancelBubble||b===e||b===null)break;a=b}if(f){for(let C of m)queueMicrotask(()=>{throw C});throw f}}finally{t[da]=e,delete t.currentTarget,fr(h),es(g)}}}var y1;const Nc=((y1=globalThis==null?void 0:globalThis.window)==null?void 0:y1.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function JE(t){return(Nc==null?void 0:Nc.createHTML(t))??t}function Em(t){var e=tm("template");return e.innerHTML=JE(t.replaceAll("<!>","<!---->")),e.content}function xi(t,e){var n=Ve;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function z(t,e){var n=(e&tE)!==0,r=(e&nE)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=Em(a?t:"<!>"+t),n||(s=Ci(s)));var i=r||Q1?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=Ci(i),u=i.lastChild;xi(o,u)}else xi(i,i);return i}}function eT(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=Em(s),o=Ci(i);a=Ci(o)}var u=a.cloneNode(!0);return xi(u,u),u}}function tT(t,e){return eT(t,e,"svg")}function fl(t=""){{var e=Vr(t+"");return xi(e,e),e}}function Gn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Vr();return t.append(e,n),xi(e,n),t}function q(t,e){t!==null&&t.before(e)}function oe(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[io]??(t[io]=t.nodeValue))&&(t[io]=n,t.nodeValue=`${n}`)}function nT(t,e){return rT(t,e)}const wu=new Map;function rT(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:o}){kE();var u=void 0,d=UE(()=>{var h=n??e.appendChild(Vr());yE(h,{pending:()=>{}},m=>{ct({});var b=Et;a&&(b.c=a),s&&(r.$$events=s),u=t(m,r)||{},dt()},o);var g=new Set,f=m=>{for(var b=0;b<m.length;b++){var _=m[b];if(!g.has(_)){g.add(_);var A=ZE(_);for(const I of[e,document]){var E=wu.get(I);E===void 0&&(E=new Map,wu.set(I,E));var C=E.get(_);C===void 0?(I.addEventListener(_,vd,{passive:A}),E.set(_,1)):E.set(_,C+1)}}}};return f(kl(bm)),bd.add(f),()=>{var A;for(var m of g)for(const E of[e,document]){var b=wu.get(E),_=b.get(m);--_==0?(E.removeEventListener(m,vd),b.delete(m),b.size===0&&wu.delete(E)):b.set(m,_)}bd.delete(f),h!==n&&((A=h.parentNode)==null||A.removeChild(h))}});return sT.set(u,d),u}let sT=new WeakMap;var _r,zr,Wn,va,Xo,Qo,xl;class su{constructor(e,n=!0){_e(this,"anchor");qe(this,_r,new Map);qe(this,zr,new Map);qe(this,Wn,new Map);qe(this,va,new Set);qe(this,Xo,!0);qe(this,Qo,e=>{if(V(this,_r).has(e)){var n=V(this,_r).get(e),r=V(this,zr).get(n);if(r)Wf(r),V(this,va).delete(n);else{var s=V(this,Wn).get(n);s&&(V(this,zr).set(n,s.effect),V(this,Wn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of V(this,_r)){if(V(this,_r).delete(a),a===e)break;const o=V(this,Wn).get(i);o&&(dn(o.effect),V(this,Wn).delete(i))}for(const[a,i]of V(this,zr)){if(a===n||V(this,va).has(a))continue;const o=()=>{if(Array.from(V(this,_r).values()).includes(a)){var d=document.createDocumentFragment();Gf(i,d),d.append(Vr()),V(this,Wn).set(a,{effect:i,fragment:d})}else dn(i);V(this,va).delete(a),V(this,zr).delete(a)};V(this,Xo)||!r?(V(this,va).add(a),_a(i,o,!1)):o()}}});qe(this,xl,e=>{V(this,_r).delete(e);const n=Array.from(V(this,_r).values());for(const[r,s]of V(this,Wn))n.includes(r)||(dn(s.effect),V(this,Wn).delete(r))});this.anchor=e,je(this,Xo,n)}ensure(e,n){var r=Pe,s=em();if(n&&!V(this,zr).has(e)&&!V(this,Wn).has(e))if(s){var a=document.createDocumentFragment(),i=Vr();a.append(i),V(this,Wn).set(e,{effect:Fn(()=>n(i)),fragment:a})}else V(this,zr).set(e,Fn(()=>n(this.anchor)));if(V(this,_r).set(r,e),s){for(const[o,u]of V(this,zr))o===e?r.unskip_effect(u):r.skip_effect(u);for(const[o,u]of V(this,Wn))o===e?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(V(this,Qo)),r.ondiscard(V(this,xl))}else V(this,Qo).call(this,r)}}_r=new WeakMap,zr=new WeakMap,Wn=new WeakMap,va=new WeakMap,Xo=new WeakMap,Qo=new WeakMap,xl=new WeakMap;function de(t,e,n=!1){var r=new su(t),s=n?bs:0;function a(i,o){r.ensure(i,o)}Ba(()=>{var i=!1;e((o,u=0)=>{i=!0,a(u,o)}),i||a(-1,null)},s)}const aT=Symbol("NaN");function iT(t,e,n){var r=new su(t),s=!ji();Ba(()=>{var a=e();a!==a&&(a=aT),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function xo(t,e){return e}function oT(t,e,n){for(var r=[],s=e.length,a,i=e.length,o=0;o<s;o++){let g=e[o];_a(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var f=t.outrogroups;Ed(t,kl(a.done)),f.delete(a),f.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var u=r.length===0&&n!==null;if(u){var d=n,h=d.parentNode;PE(h),h.append(d),t.items.clear()}Ed(t,e,!u)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function Ed(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const o of i)r.add(t.items.get(o).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Gr;const i=document.createDocumentFragment();Gf(a,i)}else dn(e[s],n)}}var u0;function It(t,e,n,r,s,a=null){var i=t,o=new Map,u=(e&x1)!==0;if(u){var d=t;i=d.appendChild(Vr())}var h=null,g=qf(()=>{var I=n();return Df(I)?I:I==null?[]:kl(I)}),f,m=new Map,b=!0;function _(I){(C.effect.f&cr)===0&&(C.pending.delete(I),C.fallback=h,uT(C,f,i,e,r),h!==null&&(f.length===0?(h.f&Gr)===0?Wf(h):(h.f^=Gr,uo(h,null,i)):_a(h,()=>{h=null})))}function A(I){C.pending.delete(I)}var E=Ba(()=>{f=l(g);for(var I=f.length,H=new Set,B=Pe,J=em(),F=0;F<I;F+=1){var Y=f[F],X=r(Y,F),te=b?null:o.get(X);te?(te.v&&Ii(te.v,Y),te.i&&Ii(te.i,F),J&&B.unskip_effect(te.e)):(te=lT(o,b?i:u0??(u0=Vr()),Y,X,F,s,e,n),b||(te.e.f|=Gr),o.set(X,te)),H.add(X)}if(I===0&&a&&!h&&(b?h=Fn(()=>a(i)):(h=Fn(()=>a(u0??(u0=Vr()))),h.f|=Gr)),I>H.size&&Mv(),!b)if(m.set(B,H),J){for(const[T,D]of o)H.has(T)||B.skip_effect(D.e);B.oncommit(_),B.ondiscard(A)}else _(B);l(g)}),C={effect:E,items:o,pending:m,outrogroups:null,fallback:h};b=!1}function Zi(t){for(;t!==null&&(t.f&Or)===0;)t=t.next;return t}function uT(t,e,n,r,s){var te,T,D,v,R,k,O,W,j;var a=(r&Kv)!==0,i=e.length,o=t.items,u=Zi(t.effect.first),d,h=null,g,f=[],m=[],b,_,A,E;if(a)for(E=0;E<i;E+=1)b=e[E],_=s(b,E),A=o.get(_).e,(A.f&Gr)===0&&((T=(te=A.nodes)==null?void 0:te.a)==null||T.measure(),(g??(g=new Set)).add(A));for(E=0;E<i;E+=1){if(b=e[E],_=s(b,E),A=o.get(_).e,t.outrogroups!==null)for(const M of t.outrogroups)M.pending.delete(A),M.done.delete(A);if((A.f&xn)!==0&&(Wf(A),a&&((v=(D=A.nodes)==null?void 0:D.a)==null||v.unfix(),(g??(g=new Set)).delete(A))),(A.f&Gr)!==0)if(A.f^=Gr,A===u)uo(A,null,n);else{var C=h?h.next:u;A===t.effect.last&&(t.effect.last=A.prev),A.prev&&(A.prev.next=A.next),A.next&&(A.next.prev=A.prev),ws(t,h,A),ws(t,A,C),uo(A,C,n),h=A,f=[],m=[],u=Zi(h.next);continue}if(A!==u){if(d!==void 0&&d.has(A)){if(f.length<m.length){var I=m[0],H;h=I.prev;var B=f[0],J=f[f.length-1];for(H=0;H<f.length;H+=1)uo(f[H],I,n);for(H=0;H<m.length;H+=1)d.delete(m[H]);ws(t,B.prev,J.next),ws(t,h,B),ws(t,J,I),u=I,h=J,E-=1,f=[],m=[]}else d.delete(A),uo(A,u,n),ws(t,A.prev,A.next),ws(t,A,h===null?t.effect.first:h.next),ws(t,h,A),h=A;continue}for(f=[],m=[];u!==null&&u!==A;)(d??(d=new Set)).add(u),m.push(u),u=Zi(u.next);if(u===null)continue}(A.f&Gr)===0&&f.push(A),h=A,u=Zi(A.next)}if(t.outrogroups!==null){for(const M of t.outrogroups)M.pending.size===0&&(Ed(t,kl(M.done)),(R=t.outrogroups)==null||R.delete(M));t.outrogroups.size===0&&(t.outrogroups=null)}if(u!==null||d!==void 0){var F=[];if(d!==void 0)for(A of d)(A.f&xn)===0&&F.push(A);for(;u!==null;)(u.f&xn)===0&&u!==t.fallback&&F.push(u),u=Zi(u.next);var Y=F.length;if(Y>0){var X=(r&x1)!==0&&i===0?n:null;if(a){for(E=0;E<Y;E+=1)(O=(k=F[E].nodes)==null?void 0:k.a)==null||O.measure();for(E=0;E<Y;E+=1)(j=(W=F[E].nodes)==null?void 0:W.a)==null||j.fix()}oT(t,F,X)}}a&&Cr(()=>{var M,$;if(g!==void 0)for(A of g)($=(M=A.nodes)==null?void 0:M.a)==null||$.apply()})}function lT(t,e,n,r,s,a,i,o){var u=(i&Wv)!==0?(i&Vv)===0?RE(n,!1,!1):Oa(n):null,d=(i&Gv)!==0?Oa(s):null;return{v:u,i:d,e:Fn(()=>(a(e,u??n,d??s,o),()=>{t.delete(r)}))}}function uo(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Gr)===0?e.nodes.start:n;r!==null;){var i=eu(r);if(a.before(r),r===s)return;r=i}}function ws(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function cT(t,e,...n){var r=new su(t);Ba(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},bs)}function l0(t,e,n){var r=new su(t);Ba(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},bs)}function dT(t,e,n,r,s,a){var i=null,o=t,u=new su(o,!1);Ba(()=>{const d=e()||null;var h=rE;if(d===null){u.ensure(null,null);return}return u.ensure(d,g=>{if(d){if(i=tm(d,h),xi(i,i),r){var f=i.appendChild(Vr());r(i,f)}Ve.nodes.end=i,g.before(i)}}),()=>{}},bs),tu(()=>{})}function fT(t,e){var n=void 0,r;sm(()=>{n!==(n=e())&&(r&&(dn(r),r=null),n&&(r=Fn(()=>{nu(()=>n(t))})))})}function Tm(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=Tm(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function hT(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Tm(t))&&(r&&(r+=" "),r+=e);return r}function _m(t){return typeof t=="object"?hT(t):t??""}const c0=[...`
3
- \r\f \v\uFEFF`];function pT(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,i=0;(i=r.indexOf(s,i))>=0;){var o=i+a;(i===0||c0.includes(r[i-1]))&&(o===r.length||c0.includes(r[o]))?r=(i===0?"":r.substring(0,i))+r.substring(o+1):i=o}}return r===""?null:r}function d0(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 Sc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function mT(t,e){if(e){var n="",r,s;if(Array.isArray(e)?(r=e[0],s=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,u=[];r&&u.push(...Object.keys(r).map(Sc)),s&&u.push(...Object.keys(s).map(Sc));var d=0,h=-1;const _=t.length;for(var g=0;g<_;g++){var f=t[g];if(o?f==="/"&&t[g-1]==="*"&&(o=!1):a?a===f&&(a=!1):f==="/"&&t[g+1]==="*"?o=!0:f==='"'||f==="'"?a=f:f==="("?i++:f===")"&&i--,!o&&a===!1&&i===0){if(f===":"&&h===-1)h=g;else if(f===";"||g===_-1){if(h!==-1){var m=Sc(t.substring(d,h).trim());if(!u.includes(m)){f!==";"&&g++;var b=t.substring(d,g).trim();n+=" "+b+";"}}d=g+1,h=-1}}}}return r&&(n+=d0(r)),s&&(n+=d0(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Je(t,e,n,r,s,a){var i=t[od];if(i!==n||i===void 0){var o=pT(n,r,a);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t[od]=n}else if(a&&s!==a)for(var u in a){var d=!!a[u];(s==null||d!==!!s[u])&&t.classList.toggle(u,d)}return a}function wc(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 Am(t,e,n,r){var s=t[ud];if(s!==e){var a=mT(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[ud]=e}else r&&(Array.isArray(r)?(wc(t,n==null?void 0:n[0],r[0]),wc(t,n==null?void 0:n[1],r[1],"important")):wc(t,n,r));return r}function hl(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Df(e))return iE();for(var r of t.options)r.selected=e.includes(bo(r));return}for(r of t.options){var s=bo(r);if(X1(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function ym(t){var e=new MutationObserver(()=>{hl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),tu(()=>{e.disconnect()})}function xa(t,e,n=e){var r=new WeakSet,s=!0;$f(t,"change",a=>{var i=a?"[selected]":":checked",o;if(t.multiple)o=[].map.call(t.querySelectorAll(i),bo);else{var u=t.querySelector(i)??t.querySelector("option:not([disabled])");o=u&&bo(u)}n(o),t.__value=o,Pe!==null&&r.add(Pe)}),nu(()=>{var a=e();if(t===document.activeElement){var i=Pe;if(r.has(i))return}if(hl(t,a,s),s&&a===void 0){var o=t.querySelector(":checked");o!==null&&(a=bo(o),n(a))}t.__value=a,s=!1}),ym(t)}function bo(t){return"__value"in t?t.__value:t.value}const Ji=Symbol("class"),eo=Symbol("style"),Nm=Symbol("is custom element"),Sm=Symbol("is html"),gT=Bf?"option":"OPTION",bT=Bf?"select":"SELECT",vT=Bf?"progress":"PROGRESS";function ET(t,e){var n=Fl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==vT)||(t.value=e??"")}function TT(t,e){var n=Fl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function _T(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ve(t,e,n,r){var s=Fl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[kv]=n),n==null?t.removeAttribute(e):typeof n!="string"&&wm(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function AT(t,e,n,r,s=!1,a=!1){var i=Fl(t),o=i[Nm],u=!i[Sm],d=e||{},h=t.nodeName===gT;for(var g in e)g in n||(n[g]=null);n.class?n.class=_m(n.class):n[Ji]&&(n.class=null),n[eo]&&(n.style??(n.style=null));var f=wm(t);for(const I in n){let H=n[I];if(h&&I==="value"&&H==null){t.value=t.__value="",d[I]=H;continue}if(I==="class"){var m=t.namespaceURI==="http://www.w3.org/1999/xhtml";Je(t,m,H,r,e==null?void 0:e[Ji],n[Ji]),d[I]=H,d[Ji]=n[Ji];continue}if(I==="style"){Am(t,H,e==null?void 0:e[eo],n[eo]),d[I]=H,d[eo]=n[eo];continue}var b=d[I];if(!(H===b&&!(H===void 0&&t.hasAttribute(I)))){d[I]=H;var _=I[0]+I[1];if(_!=="$$")if(_==="on"){const B={},J="$$"+I;let F=I.slice(2);var A=KE(F);if(WE(F)&&(F=F.slice(0,-7),B.capture=!0),!A&&b){if(H!=null)continue;t.removeEventListener(F,d[J],B),d[J]=null}if(A)ae(F,t,H),bt([F]);else if(H!=null){let Y=function(X){d[I].call(this,X)};d[J]=vm(F,t,Y,B)}}else if(I==="style")ve(t,I,H);else if(I==="autofocus")Li(t,!!H);else if(!o&&(I==="__value"||I==="value"&&H!=null))t.value=t.__value=H;else if(I==="selected"&&h)_T(t,H);else{var E=I;u||(E=XE(E));var C=E==="defaultValue"||E==="defaultChecked";if(H==null&&!o&&!C)if(i[I]=null,E==="value"||E==="checked"){let B=t;const J=e===void 0;if(E==="value"){let F=B.defaultValue;B.removeAttribute(E),B.defaultValue=F,B.value=B.__value=J?F:null}else{let F=B.defaultChecked;B.removeAttribute(E),B.defaultChecked=F,B.checked=J?F:!1}}else t.removeAttribute(I);else C||f.includes(E)&&(o||typeof H!="string")?(t[E]=H,E in i&&(i[E]=Kt)):typeof H!="function"&&ve(t,E,H)}}}return d}function f0(t,e,n=[],r=[],s=[],a,i=!1,o=!1){Y1(s,n,r,u=>{var d=void 0,h={},g=t.nodeName===bT,f=!1;if(sm(()=>{var b=e(...u.map(l)),_=AT(t,d,b,a,i,o);f&&g&&"value"in b&&hl(t,b.value);for(let E of Object.getOwnPropertySymbols(h))b[E]||dn(h[E]);for(let E of Object.getOwnPropertySymbols(b)){var A=b[E];E.description===sE&&(!d||A!==d[E])&&(h[E]&&dn(h[E]),h[E]=Fn(()=>fT(t,()=>A))),_[E]=A}d=_}),g){var m=t;nu(()=>{hl(m,d.value,!0),ym(m)})}f=!0})}function Fl(t){return t[Wu]??(t[Wu]={[Nm]:t.nodeName.includes("-"),[Sm]:t.namespaceURI===R1})}var h0=new Map;function wm(t){var e=t.getAttribute("is")||t.nodeName,n=h0.get(e);if(n)return n;h0.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=w1(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=kf(s)}return n}function vt(t,e,n=e){var r=new WeakSet;$f(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=Cc(t)?Lc(a):a,n(a),Pe!==null&&r.add(Pe),await pm(),a!==(a=e())){var i=t.selectionStart,o=t.selectionEnd,u=t.value.length;if(t.value=a??"",o!==null){var d=t.value.length;i===o&&o===u&&d>u?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=i,t.selectionEnd=Math.min(o,d))}}}),Fa(e)==null&&t.value&&(n(Cc(t)?Lc(t.value):t.value),Pe!==null&&r.add(Pe)),Bl(()=>{var s=e();if(t===document.activeElement){var a=Pe;if(r.has(a))return}Cc(t)&&s===Lc(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const Ic=new Set;function yT(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var o of e)i=i[o]??(i[o]=[]);i.push(n),$f(n,"change",()=>{var u=n.__value;a&&(u=NT(i,u,n.checked)),s(u)},()=>s(a?[]:null)),Bl(()=>{var u=r();a?(u=u||[],n.checked=u.includes(n.__value)):n.checked=X1(n.__value,u)}),tu(()=>{var u=i.indexOf(n);u!==-1&&i.splice(u,1)}),Ic.has(i)||(Ic.add(i),Cr(()=>{i.sort((u,d)=>u.compareDocumentPosition(d)===4?-1:1),Ic.delete(i)})),Cr(()=>{})}function NT(t,e,n){for(var r=new Set,s=0;s<t.length;s+=1)t[s].checked&&r.add(t[s].__value);return n||r.delete(e),Array.from(r)}function Cc(t){var e=t.type;return e==="number"||e==="range"}function Lc(t){return t===""?null:+t}var ks,yi,Zo,Rl,Im;const Dl=class Dl{constructor(e){qe(this,Rl);qe(this,ks,new WeakMap);qe(this,yi);qe(this,Zo);je(this,Zo,e)}observe(e,n){var r=V(this,ks).get(e)||new Set;return r.add(n),V(this,ks).set(e,r),tt(this,Rl,Im).call(this).observe(e,V(this,Zo)),()=>{var s=V(this,ks).get(e);s.delete(n),s.size===0&&(V(this,ks).delete(e),V(this,yi).unobserve(e))}}};ks=new WeakMap,yi=new WeakMap,Zo=new WeakMap,Rl=new WeakSet,Im=function(){return V(this,yi)??je(this,yi,new ResizeObserver(e=>{for(var n of e){Dl.entries.set(n.target,n);for(var r of V(this,ks).get(n.target)||[])r(n)}}))},_e(Dl,"entries",new WeakMap);let Td=Dl;var ST=new Td({box:"border-box"});function wT(t,e,n){var r=ST.observe(t,()=>n(t[e]));nu(()=>(Fa(()=>n(t[e])),r))}function Oc(t,e){return t===e||(t==null?void 0:t[Kr])===e}function pn(t={},e,n,r){var s=Et.r,a=Ve;return nu(()=>{var i,o;return Bl(()=>{i=o,o=[],Fa(()=>{Oc(n(...o),t)||(e(t,...o),i&&Oc(n(...i),t)&&e(null,...i))})}),()=>{let u=a;for(;u!==s&&u.parent!==null&&u.parent.f&id;)u=u.parent;const d=()=>{o&&Oc(n(...o),t)&&e(null,...o)},h=u.teardown;u.teardown=()=>{d(),h==null||h()}}}),t}function Cm(t=!1){const e=Et,n=e.l.u;if(!n)return;let r=()=>zE(e.s);if(t){let s=0,a={};const i=wi(()=>{let o=!1;const u=e.s;for(const d in u)u[d]!==a[d]&&(a[d]=u[d],o=!0);return o&&s++,s});r=()=>l(i)}n.b.length&&FE(()=>{p0(e,r),sd(n.b)}),Dt(()=>{const s=Fa(()=>n.m.map(xv));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&Dt(()=>{p0(e,r),sd(n.a)})}function p0(t,e){if(t.l.s)for(const n of t.l.s)l(n);e()}const IT={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function hr(t,e,n){return new Proxy({props:t,exclude:e},IT)}const CT={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(Qi(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];Qi(s)&&(s=s());const a=qs(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(Qi(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=qs(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Kr||e===L1)return!1;for(let n of t.props)if(Qi(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(Qi(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 Dr(...t){return new Proxy({props:t},CT)}function ir(t,e,n,r){var H;var s=!qi||(n&Qv)!==0,a=(n&Jv)!==0,i=(n&eE)!==0,o=r,u=!0,d=void 0,h=()=>i&&s?(d??(d=wi(r)),l(d)):(u&&(u=!1,o=i?Fa(r):r),o);let g;if(a){var f=Kr in t||L1 in t;g=((H=qs(t,e))==null?void 0:H.set)??(f&&e in t?B=>t[e]=B:void 0)}var m,b=!1;a?[m,b]=gE(()=>t[e]):m=t[e],m===void 0&&r!==void 0&&(m=h(),g&&(s&&qv(),g(m)));var _;if(s?_=()=>{var B=t[e];return B===void 0?h():(u=!0,B)}:_=()=>{var B=t[e];return B!==void 0&&(o=void 0),B===void 0?o:B},s&&(n&Zv)===0)return _;if(g){var A=t.$$legacy;return(function(B,J){return arguments.length>0?((!s||!J||A||b)&&g(J?_():B),B):_()})}var E=!1,C=((n&Xv)!==0?wi:qf)(()=>(E=!1,_()));a&&l(C);var I=Ve;return(function(B,J){if(arguments.length>0){const F=J?l(C):s&&a?lt(B):B;return y(C,F),E=!0,o!==void 0&&(o=F),B}return vs&&E||(I.f&cr)!==0?C.v:l(C)})}function Ua(t){Et===null&&O1(),qi&&Et.l!==null?LT(Et).m.push(t):Dt(()=>{const e=Fa(t);if(typeof e=="function")return e})}function LT(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const OT="5";var N1;typeof window<"u"&&((N1=window.__svelte??(window.__svelte={})).v??(N1.v=new Set)).add(OT);cE();function ps(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Kf(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ");return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}const xT={html:"text/html; charset=utf-8",json:"application/json; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",css:"text/css; charset=utf-8",txt:"text/plain; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",avif:"image/avif",gif:"image/gif",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",map:"application/json; charset=utf-8"};function RT(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return xT[e]??"application/octet-stream"}class fa extends Error{constructor(e){super(e),this.name="ContentParseError"}}const DT=new Set(["template","title","isPublished","fields","created","published","updated"]);function _d(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ad(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function kT(t){return _d(t)&&Object.values(t).every(Ad)}function PT(t,e){if(Ad(e))return e;if(Array.isArray(e)){if(e.every(Ad)||e.every(kT))return e;throw new fa(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new fa(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Iu(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new fa(`"${e}" must be a string when present.`);return n}}function Ul(t){return Lm(t).item}function Lm(t){if(!_d(t))throw new fa("A content item must be a JSON object.");if(typeof t.title!="string")throw new fa('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new fa(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!_d(t.fields))throw new fa('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([d,h])=>[d,PT(d,h)]))}const r=Iu(t,"template"),s=Iu(t,"created"),a=Iu(t,"published"),i=Iu(t,"updated"),o=Object.keys(t).filter(d=>!DT.has(d)).sort();return{item:{title:t.title,isPublished:e,fields:n,...r!==void 0&&{template:r},...s!==void 0&&{created:s},...a!==void 0&&{published:a},...i!==void 0&&{updated:i}},diagnostics:{unknownTopLevelKeys:o}}}function m0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Om(t){if(!m0(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=m0(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 xm="_sort.json",MT="_redirects.json",BT="_site.json",FT="assets",g0=".json",rt={content:"content",templates:"templates",components:"components",public:"public"};function Xr(...t){return t.filter(e=>e!=="").join("/")}async function Vf(t,e=rt.content){return Rm(t,e,"","")}async function Rm(t,e,n,r){const[s,a]=await Promise.all([t.list(e),HT(t,e)]),i=new Map;for(const u of s)if(u.kind==="file"){if(u.name===xm||u.name===MT||u.name===BT||!u.name.endsWith(g0))continue;const d=u.name.slice(0,-g0.length);i.set(d,await UT(t,Xr(e,u.name),d,r))}else{if(u.name===FT)continue;const d=Xr(r,u.name);i.set(u.name,await Rm(t,Xr(e,u.name),u.name,d))}const o=a.name??(n===""?"":Kf(n));return{kind:"dir",slug:n,name:o,path:r,children:qT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function UT(t,e,n,r){const s=await t.readText(e);try{const{item:a,diagnostics:i}=Lm(JSON.parse(s));return{kind:"item",slug:n,path:Xr(r,n),item:a,...i.unknownTopLevelKeys.length>0&&{parseDiagnostics:i}}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function HT(t,e){const n=Xr(e,xm);if(!await t.exists(n))return{order:[]};try{return Om(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function qT(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 Xf(t,e=rt.components){return Qf(t,e,"html")}function Dm(t,e=rt.components){return Qf(t,e,"css")}function km(t,e=rt.components){return Qf(t,e,"js")}async function Qf(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const o of await t.list(i)){const u=Xr(i,o.name);if(o.kind==="dir")await a(u);else if(o.name.endsWith(r)){const d=o.name.slice(0,-r.length).toLowerCase();s.set(d,await t.readText(u))}}};return await a(e),s}async function pl(t,e,n=rt.templates){return t.readText(Xr(n,`${e}.html`))}function jT(t,e,n=rt.templates){return Jf(t,Xr(n,`${e}.css`))}function $T(t,e,n=rt.templates){return Jf(t,Xr(n,`${e}.js`))}const au="document";function Zf(t,e=rt.templates){return Jf(t,Xr(e,`${au}.html`))}async function Jf(t,e){try{return await t.readText(e)}catch{return}}const YT=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ot="�";var w;(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"})(w||(w={}));const Pn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Pm(t){return t>=55296&&t<=57343}function zT(t){return t>=56320&&t<=57343}function WT(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 Bm(t){return t>=64976&&t<=65007||YT.has(t)}var ne;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ne||(ne={}));const GT=65536;class KT{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=GT,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:a}=this,i=s+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(zT(n))return this.pos++,this._addGap(),WT(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,w.EOF;return this._err(ne.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;const r=this.html.charCodeAt(n);return r===w.CARRIAGE_RETURN?w.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,w.EOF;let e=this.html.charCodeAt(this.pos);return e===w.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,w.LINE_FEED):e===w.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===w.LINE_FEED||e===w.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Mm(e)?this._err(ne.controlCharacterInInputStream):Bm(e)&&this._err(ne.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var it;(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"})(it||(it={}));function Fm(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 VT=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))),XT=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 QT(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=XT.get(t))!==null&&e!==void 0?e:t}var an;(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"})(an||(an={}));const ZT=32;var Ms;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ms||(Ms={}));function yd(t){return t>=an.ZERO&&t<=an.NINE}function JT(t){return t>=an.UPPER_A&&t<=an.UPPER_F||t>=an.LOWER_A&&t<=an.LOWER_F}function e_(t){return t>=an.UPPER_A&&t<=an.UPPER_Z||t>=an.LOWER_A&&t<=an.LOWER_Z||yd(t)}function t_(t){return t===an.EQUALS||e_(t)}var sn;(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"})(sn||(sn={}));var hs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(hs||(hs={}));class n_{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=sn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=hs.Strict}startEntity(e){this.decodeMode=e,this.state=sn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case sn.EntityStart:return e.charCodeAt(n)===an.NUM?(this.state=sn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=sn.NamedEntity,this.stateNamedEntity(e,n));case sn.NumericStart:return this.stateNumericStart(e,n);case sn.NumericDecimal:return this.stateNumericDecimal(e,n);case sn.NumericHex:return this.stateNumericHex(e,n);case sn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|ZT)===an.LOWER_X?(this.state=sn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=sn.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(yd(s)||JT(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(yd(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===an.SEMI)this.consumed+=1;else if(this.decodeMode===hs.Strict)return 0;return this.emitCodePoint(QT(this.result),this.consumed),this.errors&&(e!==an.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&Ms.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=r_(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===hs.Attribute&&(a===0||t_(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&Ms.VALUE_LENGTH)>>14,a!==0){if(i===an.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==hs.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]&Ms.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]&~Ms.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case sn.NamedEntity:return this.result!==0&&(this.decodeMode!==hs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sn.NumericDecimal:return this.emitNumericEntity(0,2);case sn.NumericHex:return this.emitNumericEntity(0,3);case sn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sn.EntityStart:return 0}}}function r_(t,e,n,r){const s=(e&Ms.BRANCH_LENGTH)>>7,a=e&Ms.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const u=r-a;return u<0||u>=s?-1:t[n+u]-1}let i=n,o=i+s-1;for(;i<=o;){const u=i+o>>>1,d=t[u];if(d<r)i=u+1;else if(d>r)o=u-1;else return t[u+s]}return-1}var ue;(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/"})(ue||(ue={}));var ya;(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"})(ya||(ya={}));var rr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(rr||(rr={}));var Q;(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"})(Q||(Q={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const s_=new Map([[Q.A,c.A],[Q.ADDRESS,c.ADDRESS],[Q.ANNOTATION_XML,c.ANNOTATION_XML],[Q.APPLET,c.APPLET],[Q.AREA,c.AREA],[Q.ARTICLE,c.ARTICLE],[Q.ASIDE,c.ASIDE],[Q.B,c.B],[Q.BASE,c.BASE],[Q.BASEFONT,c.BASEFONT],[Q.BGSOUND,c.BGSOUND],[Q.BIG,c.BIG],[Q.BLOCKQUOTE,c.BLOCKQUOTE],[Q.BODY,c.BODY],[Q.BR,c.BR],[Q.BUTTON,c.BUTTON],[Q.CAPTION,c.CAPTION],[Q.CENTER,c.CENTER],[Q.CODE,c.CODE],[Q.COL,c.COL],[Q.COLGROUP,c.COLGROUP],[Q.DD,c.DD],[Q.DESC,c.DESC],[Q.DETAILS,c.DETAILS],[Q.DIALOG,c.DIALOG],[Q.DIR,c.DIR],[Q.DIV,c.DIV],[Q.DL,c.DL],[Q.DT,c.DT],[Q.EM,c.EM],[Q.EMBED,c.EMBED],[Q.FIELDSET,c.FIELDSET],[Q.FIGCAPTION,c.FIGCAPTION],[Q.FIGURE,c.FIGURE],[Q.FONT,c.FONT],[Q.FOOTER,c.FOOTER],[Q.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[Q.FORM,c.FORM],[Q.FRAME,c.FRAME],[Q.FRAMESET,c.FRAMESET],[Q.H1,c.H1],[Q.H2,c.H2],[Q.H3,c.H3],[Q.H4,c.H4],[Q.H5,c.H5],[Q.H6,c.H6],[Q.HEAD,c.HEAD],[Q.HEADER,c.HEADER],[Q.HGROUP,c.HGROUP],[Q.HR,c.HR],[Q.HTML,c.HTML],[Q.I,c.I],[Q.IMG,c.IMG],[Q.IMAGE,c.IMAGE],[Q.INPUT,c.INPUT],[Q.IFRAME,c.IFRAME],[Q.KEYGEN,c.KEYGEN],[Q.LABEL,c.LABEL],[Q.LI,c.LI],[Q.LINK,c.LINK],[Q.LISTING,c.LISTING],[Q.MAIN,c.MAIN],[Q.MALIGNMARK,c.MALIGNMARK],[Q.MARQUEE,c.MARQUEE],[Q.MATH,c.MATH],[Q.MENU,c.MENU],[Q.META,c.META],[Q.MGLYPH,c.MGLYPH],[Q.MI,c.MI],[Q.MO,c.MO],[Q.MN,c.MN],[Q.MS,c.MS],[Q.MTEXT,c.MTEXT],[Q.NAV,c.NAV],[Q.NOBR,c.NOBR],[Q.NOFRAMES,c.NOFRAMES],[Q.NOEMBED,c.NOEMBED],[Q.NOSCRIPT,c.NOSCRIPT],[Q.OBJECT,c.OBJECT],[Q.OL,c.OL],[Q.OPTGROUP,c.OPTGROUP],[Q.OPTION,c.OPTION],[Q.P,c.P],[Q.PARAM,c.PARAM],[Q.PLAINTEXT,c.PLAINTEXT],[Q.PRE,c.PRE],[Q.RB,c.RB],[Q.RP,c.RP],[Q.RT,c.RT],[Q.RTC,c.RTC],[Q.RUBY,c.RUBY],[Q.S,c.S],[Q.SCRIPT,c.SCRIPT],[Q.SEARCH,c.SEARCH],[Q.SECTION,c.SECTION],[Q.SELECT,c.SELECT],[Q.SOURCE,c.SOURCE],[Q.SMALL,c.SMALL],[Q.SPAN,c.SPAN],[Q.STRIKE,c.STRIKE],[Q.STRONG,c.STRONG],[Q.STYLE,c.STYLE],[Q.SUB,c.SUB],[Q.SUMMARY,c.SUMMARY],[Q.SUP,c.SUP],[Q.TABLE,c.TABLE],[Q.TBODY,c.TBODY],[Q.TEMPLATE,c.TEMPLATE],[Q.TEXTAREA,c.TEXTAREA],[Q.TFOOT,c.TFOOT],[Q.TD,c.TD],[Q.TH,c.TH],[Q.THEAD,c.THEAD],[Q.TITLE,c.TITLE],[Q.TR,c.TR],[Q.TRACK,c.TRACK],[Q.TT,c.TT],[Q.U,c.U],[Q.UL,c.UL],[Q.SVG,c.SVG],[Q.VAR,c.VAR],[Q.WBR,c.WBR],[Q.XMP,c.XMP]]);function Hl(t){var e;return(e=s_.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const me=c,a_={[ue.HTML]:new Set([me.ADDRESS,me.APPLET,me.AREA,me.ARTICLE,me.ASIDE,me.BASE,me.BASEFONT,me.BGSOUND,me.BLOCKQUOTE,me.BODY,me.BR,me.BUTTON,me.CAPTION,me.CENTER,me.COL,me.COLGROUP,me.DD,me.DETAILS,me.DIR,me.DIV,me.DL,me.DT,me.EMBED,me.FIELDSET,me.FIGCAPTION,me.FIGURE,me.FOOTER,me.FORM,me.FRAME,me.FRAMESET,me.H1,me.H2,me.H3,me.H4,me.H5,me.H6,me.HEAD,me.HEADER,me.HGROUP,me.HR,me.HTML,me.IFRAME,me.IMG,me.INPUT,me.LI,me.LINK,me.LISTING,me.MAIN,me.MARQUEE,me.MENU,me.META,me.NAV,me.NOEMBED,me.NOFRAMES,me.NOSCRIPT,me.OBJECT,me.OL,me.P,me.PARAM,me.PLAINTEXT,me.PRE,me.SCRIPT,me.SECTION,me.SELECT,me.SOURCE,me.STYLE,me.SUMMARY,me.TABLE,me.TBODY,me.TD,me.TEMPLATE,me.TEXTAREA,me.TFOOT,me.TH,me.THEAD,me.TITLE,me.TR,me.TRACK,me.UL,me.WBR,me.XMP]),[ue.MATHML]:new Set([me.MI,me.MO,me.MN,me.MS,me.MTEXT,me.ANNOTATION_XML]),[ue.SVG]:new Set([me.TITLE,me.FOREIGN_OBJECT,me.DESC]),[ue.XLINK]:new Set,[ue.XML]:new Set,[ue.XMLNS]:new Set},Nd=new Set([me.H1,me.H2,me.H3,me.H4,me.H5,me.H6]),i_=new Set([Q.STYLE,Q.SCRIPT,Q.XMP,Q.IFRAME,Q.NOEMBED,Q.NOFRAMES,Q.PLAINTEXT]);function o_(t,e){return i_.has(t)||e&&t===Q.NOSCRIPT}var L;(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"})(L||(L={}));const Hn={DATA:L.DATA,RCDATA:L.RCDATA,RAWTEXT:L.RAWTEXT,SCRIPT_DATA:L.SCRIPT_DATA,PLAINTEXT:L.PLAINTEXT,CDATA_SECTION:L.CDATA_SECTION};function u_(t){return t>=w.DIGIT_0&&t<=w.DIGIT_9}function lo(t){return t>=w.LATIN_CAPITAL_A&&t<=w.LATIN_CAPITAL_Z}function l_(t){return t>=w.LATIN_SMALL_A&&t<=w.LATIN_SMALL_Z}function Is(t){return l_(t)||lo(t)}function b0(t){return Is(t)||u_(t)}function Cu(t){return t+32}function Um(t){return t===w.SPACE||t===w.LINE_FEED||t===w.TABULATION||t===w.FORM_FEED}function v0(t){return Um(t)||t===w.SOLIDUS||t===w.GREATER_THAN_SIGN}function c_(t){return t===w.NULL?ne.nullCharacterReference:t>1114111?ne.characterReferenceOutsideUnicodeRange:Pm(t)?ne.surrogateCharacterReference:Bm(t)?ne.noncharacterCharacterReference:Mm(t)||t===w.CARRIAGE_RETURN?ne.controlCharacterReference:null}class d_{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=L.DATA,this.returnState=L.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new KT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new n_(VT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=c_(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:it.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:it.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:it.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:it.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(Fm(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ne.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Hl(e.tagName),e.type===it.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(ne.endTagWithAttributes),e.selfClosing&&this._err(ne.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case it.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case it.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case it.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:it.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=Um(e)?it.WHITESPACE_CHARACTER:e===w.NULL?it.NULL_CHARACTER:it.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(it.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=L.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?hs.Attribute:hs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===L.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case L.DATA:{this._stateData(e);break}case L.RCDATA:{this._stateRcdata(e);break}case L.RAWTEXT:{this._stateRawtext(e);break}case L.SCRIPT_DATA:{this._stateScriptData(e);break}case L.PLAINTEXT:{this._statePlaintext(e);break}case L.TAG_OPEN:{this._stateTagOpen(e);break}case L.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case L.TAG_NAME:{this._stateTagName(e);break}case L.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case L.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case L.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case L.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case L.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case L.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case L.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case L.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case L.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case L.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case L.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case L.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case L.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case L.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case L.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case L.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case L.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case L.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case L.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case L.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case L.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case L.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case L.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case L.BOGUS_COMMENT:{this._stateBogusComment(e);break}case L.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case L.COMMENT_START:{this._stateCommentStart(e);break}case L.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case L.COMMENT:{this._stateComment(e);break}case L.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case L.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case L.COMMENT_END:{this._stateCommentEnd(e);break}case L.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case L.DOCTYPE:{this._stateDoctype(e);break}case L.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case L.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case L.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case L.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case L.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case L.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case L.CDATA_SECTION:{this._stateCdataSection(e);break}case L.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case L.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case L.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case L.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.TAG_OPEN;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(e);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case w.AMPERSAND:{this._startCharacterReference();break}case w.LESS_THAN_SIGN:{this.state=L.RCDATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.RAWTEXT_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Is(e))this._createStartTagToken(),this.state=L.TAG_NAME,this._stateTagName(e);else switch(e){case w.EXCLAMATION_MARK:{this.state=L.MARKUP_DECLARATION_OPEN;break}case w.SOLIDUS:{this.state=L.END_TAG_OPEN;break}case w.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e);break}case w.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=L.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Is(e))this._createEndTagToken(),this.state=L.TAG_NAME,this._stateTagName(e);else switch(e){case w.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.tagName+=Ot;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(lo(e)?Cu(e):e)}}_stateRcdataLessThanSign(e){e===w.SOLIDUS?this.state=L.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Is(e)?(this.state=L.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=L.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 w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=L.BEFORE_ATTRIBUTE_NAME,!1;case w.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=L.SELF_CLOSING_START_TAG,!1;case w.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=L.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===w.SOLIDUS?this.state=L.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Is(e)?(this.state=L.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case w.SOLIDUS:{this.state=L.SCRIPT_DATA_END_TAG_OPEN;break}case w.EXCLAMATION_MARK:{this.state=L.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=L.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Is(e)?(this.state=L.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===w.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===w.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===w.SOLIDUS?this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Is(e)?(this._emitChars("<"),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Is(e)?(this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Pn.SCRIPT,!1)&&v0(this.preprocessor.peek(Pn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Pn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===w.SOLIDUS?(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Pn.SCRIPT,!1)&&v0(this.preprocessor.peek(Pn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Pn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._err(ne.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=L.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this._leaveAttrName(),this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._leaveAttrName(),this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:{this._err(ne.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.name+=Ot;break}default:this.currentAttr.name+=String.fromCodePoint(lo(e)?Cu(e):e)}}_stateAfterAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case w.EQUALS_SIGN:{this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{this.state=L.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this.state=L.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingAttributeValue),this.state=L.DATA,this.emitCurrentTagToken();break}default:this.state=L.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case w.APOSTROPHE:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:case w.EQUALS_SIGN:case w.GRAVE_ACCENT:{this._err(ne.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this._leaveAttrValue(),this.state=L.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBetweenAttributes),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case w.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.unexpectedSolidusInTag),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ot;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Pn.DASH_DASH,!0)?(this._createCommentToken(Pn.DASH_DASH.length+1),this.state=L.COMMENT_START):this._consumeSequenceIfMatch(Pn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Pn.DOCTYPE.length+1),this.state=L.DOCTYPE):this._consumeSequenceIfMatch(Pn.CDATA_START,!0)?this.inForeignNode?this.state=L.CDATA_SECTION:(this._err(ne.cdataInHtmlContent),this._createCommentToken(Pn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=L.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ne.incorrectlyOpenedComment),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_START_DASH;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=L.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END_DASH;break}case w.LESS_THAN_SIGN:{n.data+="<",this.state=L.COMMENT_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ot;break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case w.EXCLAMATION_MARK:{n.data+="!",this.state=L.COMMENT_LESS_THAN_SIGN_BANG;break}case w.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=L.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===w.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=L.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===w.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=L.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==w.GREATER_THAN_SIGN&&e!==w.EOF&&this._err(ne.nestedComment),this.state=L.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case w.EXCLAMATION_MARK:{this.state=L.COMMENT_END_BANG;break}case w.HYPHEN_MINUS:{n.data+="-";break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=L.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{n.data+="--!",this.state=L.COMMENT_END_DASH;break}case w.GREATER_THAN_SIGN:{this._err(ne.incorrectlyClosedComment),this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=L.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case w.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBeforeDoctypeName),this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(lo(e))this._createDoctypeToken(String.fromCharCode(Cu(e))),this.state=L.DOCTYPE_NAME;else switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.NULL:{this._err(ne.unexpectedNullCharacter),this._createDoctypeToken(Ot),this.state=L.DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=L.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.AFTER_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.name+=Ot;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(lo(e)?Cu(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Pn.PUBLIC,!1)?this.state=L.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Pn.SYSTEM,!1)?this.state=L.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ne.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.NULL:{this._err(ne.unexpectedNullCharacter);break}case w.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case w.RIGHT_SQUARE_BRACKET:{this.state=L.CDATA_SECTION_BRACKET;break}case w.EOF:{this._err(ne.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===w.RIGHT_SQUARE_BRACKET?this.state=L.CDATA_SECTION_END:(this._emitChars("]"),this.state=L.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA;break}case w.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=L.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(w.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&b0(this.preprocessor.peek(1))?L.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){b0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===w.SEMICOLON&&this._err(ne.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Hm=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),E0=new Set([...Hm,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),ml=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),f_=new Set([...ml,c.OL,c.UL]),h_=new Set([...ml,c.BUTTON]),T0=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),_0=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),p_=new Set([c.TR,c.TEMPLATE,c.HTML]),m_=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),g_=new Set([c.TABLE,c.TEMPLATE,c.HTML]),b_=new Set([c.TD,c.TH]);class v_{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ue.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])!==ue.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(Nd,ue.HTML)}popUntilTableCellPopped(){this.popUntilPopped(b_,ue.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(g_,ue.HTML)}clearBackToTableBodyContext(){this.clearBackTo(m_,ue.HTML)}clearBackToTableRowContext(){this.clearBackTo(p_,ue.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ue.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case ue.SVG:{if(_0.has(s))return!1;break}case ue.MATHML:{if(T0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,ml)}hasInListItemScope(e){return this.hasInDynamicScope(e,f_)}hasInButtonScope(e){return this.hasInDynamicScope(e,h_)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case ue.HTML:{if(Nd.has(n))return!0;if(ml.has(n))return!1;break}case ue.SVG:{if(_0.has(n))return!1;break}case ue.MATHML:{if(T0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===ue.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Hm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&E0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&E0.has(this.currentTagId);)this.pop()}}const xc=3;var Wr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Wr||(Wr={}));const A0={type:Wr.Marker};class E_{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===Wr.Marker)break;const{element:d}=u;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===i){const h=this.treeAdapter.getAttrList(d);h.length===s&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<xc)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<xc)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(u=>s.get(u.name)===u.value)&&(a+=1,a>=xc&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(A0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Wr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Wr.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(A0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Wr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Wr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Wr.Element&&n.element===e)}}const ls={createDocument(){return{nodeName:"#document",mode:rr.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};ls.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(ls.isTextNode(n)){n.value+=e;return}}ls.appendChild(t,ls.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&ls.isTextNode(r)?r.value+=e:ls.insertBefore(t,ls.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}}},qm="html",T_="about:legacy-compat",__="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",jm=["+//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//"],A_=[...jm,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],y_=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//"],N_=[...$m,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function y0(t,e){return e.some(n=>t.startsWith(n))}function S_(t){return t.name===qm&&t.publicId===null&&(t.systemId===null||t.systemId===T_)}function w_(t){if(t.name!==qm)return rr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===__)return rr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),y_.has(n))return rr.QUIRKS;let r=e===null?A_:jm;if(y0(n,r))return rr.QUIRKS;if(r=e===null?$m:N_,y0(n,r))return rr.LIMITED_QUIRKS}return rr.NO_QUIRKS}const N0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},I_="definitionurl",C_="definitionURL",L_=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])),O_=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ue.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ue.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ue.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ue.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ue.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ue.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ue.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ue.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ue.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ue.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ue.XMLNS}]]),x_=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])),R_=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function D_(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===ya.COLOR||r===ya.SIZE||r===ya.FACE)||R_.has(e)}function Ym(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===I_){t.attrs[e].name=C_;break}}function zm(t){for(let e=0;e<t.attrs.length;e++){const n=L_.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function eh(t){for(let e=0;e<t.attrs.length;e++){const n=O_.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 k_(t){const e=x_.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Hl(t.tagName))}function P_(t,e){return e===ue.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function M_(t,e,n){if(e===ue.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ya.ENCODING){const s=n[r].value.toLowerCase();return s===N0.TEXT_HTML||s===N0.APPLICATION_XML}}return e===ue.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function B_(t,e,n,r){return(!r||r===ue.HTML)&&M_(t,e,n)||(!r||r===ue.MATHML)&&P_(t,e)}const F_="hidden",U_=8,H_=3;var P;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(P||(P={}));const q_={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Wm=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),S0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ls,onParseError:null};class Gm{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=P.INITIAL,this.originalInsertionMode=P.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...S0,...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 d_(this.options,this),this.activeFormattingElements=new E_(this.treeAdapter),this.fragmentContextID=r?Hl(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new v_(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={...S0,...n};e??(e=r.treeAdapter.createElement(Q.TEMPLATE,ue.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ue.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(P.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const a=(s=e.location)!==null&&s!==void 0?s:q_,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)===ue.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,ue.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=P.TEXT}switchToPlaintextParsing(){this.insertionMode=P.TEXT,this.originalInsertionMode=P.IN_BODY,this.tokenizer.state=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)===Q.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ue.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=Hn.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=Hn.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=Hn.SCRIPT_DATA;break}case c.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(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,ue.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,ue.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(Q.HTML,ue.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,i=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:u,endCol:d,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:u,endCol:d,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),a=n.type===it.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===Q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ue.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ue.HTML)}_processToken(e){switch(e.type){case it.CHARACTER:{this.onCharacter(e);break}case it.NULL_CHARACTER:{this.onNullCharacter(e);break}case it.COMMENT:{this.onComment(e);break}case it.DOCTYPE:{this.onDoctype(e);break}case it.START_TAG:{this._processStartTag(e);break}case it.END_TAG:{this.onEndTag(e);break}case it.EOF:{this.onEof(e);break}case it.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return B_(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Wr.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=P.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=P.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=P.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=P.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=P.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=P.IN_TABLE;return}case c.BODY:{this.insertionMode=P.IN_BODY;return}case c.FRAMESET:{this.insertionMode=P.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?P.AFTER_HEAD:P.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=P.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=P.IN_HEAD;return}break}}this.insertionMode=P.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=P.IN_SELECT_IN_TABLE;return}}this.insertionMode=P.IN_SELECT}_isElementCausesFosterParenting(e){return Wm.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ue.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return a_[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){bA(this,e);return}switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{vo(this,e);break}case P.BEFORE_HEAD:{Eo(this,e);break}case P.IN_HEAD:{To(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_o(this,e);break}case P.AFTER_HEAD:{Ao(this,e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:{Vm(this,e);break}case P.TEXT:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Rc(this,e);break}case P.IN_TABLE_TEXT:{tg(this,e);break}case P.IN_COLUMN_GROUP:{gl(this,e);break}case P.AFTER_BODY:{bl(this,e);break}case P.AFTER_AFTER_BODY:{Ju(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){gA(this,e);return}switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{vo(this,e);break}case P.BEFORE_HEAD:{Eo(this,e);break}case P.IN_HEAD:{To(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_o(this,e);break}case P.AFTER_HEAD:{Ao(this,e);break}case P.TEXT:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Rc(this,e);break}case P.IN_COLUMN_GROUP:{gl(this,e);break}case P.AFTER_BODY:{bl(this,e);break}case P.AFTER_AFTER_BODY:{Ju(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Sd(this,e);return}switch(this.insertionMode){case P.INITIAL:case P.BEFORE_HTML:case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_TEMPLATE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{Sd(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.AFTER_BODY:{K_(this,e);break}case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{V_(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case P.INITIAL:{X_(this,e);break}case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:{this._err(e,ne.misplacedDoctype);break}case P.IN_TABLE_TEXT:{no(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?vA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{Q_(this,e);break}case P.BEFORE_HEAD:{J_(this,e);break}case P.IN_HEAD:{kr(this,e);break}case P.IN_HEAD_NO_SCRIPT:{n2(this,e);break}case P.AFTER_HEAD:{s2(this,e);break}case P.IN_BODY:{An(this,e);break}case P.IN_TABLE:{Ri(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.IN_CAPTION:{eA(this,e);break}case P.IN_COLUMN_GROUP:{rh(this,e);break}case P.IN_TABLE_BODY:{$l(this,e);break}case P.IN_ROW:{Yl(this,e);break}case P.IN_CELL:{rA(this,e);break}case P.IN_SELECT:{sg(this,e);break}case P.IN_SELECT_IN_TABLE:{aA(this,e);break}case P.IN_TEMPLATE:{oA(this,e);break}case P.AFTER_BODY:{lA(this,e);break}case P.IN_FRAMESET:{cA(this,e);break}case P.AFTER_FRAMESET:{fA(this,e);break}case P.AFTER_AFTER_BODY:{pA(this,e);break}case P.AFTER_AFTER_FRAMESET:{mA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?EA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{Z_(this,e);break}case P.BEFORE_HEAD:{e2(this,e);break}case P.IN_HEAD:{t2(this,e);break}case P.IN_HEAD_NO_SCRIPT:{r2(this,e);break}case P.AFTER_HEAD:{a2(this,e);break}case P.IN_BODY:{jl(this,e);break}case P.TEXT:{Y2(this,e);break}case P.IN_TABLE:{Ro(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.IN_CAPTION:{tA(this,e);break}case P.IN_COLUMN_GROUP:{nA(this,e);break}case P.IN_TABLE_BODY:{wd(this,e);break}case P.IN_ROW:{rg(this,e);break}case P.IN_CELL:{sA(this,e);break}case P.IN_SELECT:{ag(this,e);break}case P.IN_SELECT_IN_TABLE:{iA(this,e);break}case P.IN_TEMPLATE:{uA(this,e);break}case P.AFTER_BODY:{og(this,e);break}case P.IN_FRAMESET:{dA(this,e);break}case P.AFTER_FRAMESET:{hA(this,e);break}case P.AFTER_AFTER_BODY:{Ju(this,e);break}}}onEof(e){switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{vo(this,e);break}case P.BEFORE_HEAD:{Eo(this,e);break}case P.IN_HEAD:{To(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_o(this,e);break}case P.AFTER_HEAD:{Ao(this,e);break}case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{Jm(this,e);break}case P.TEXT:{z2(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.IN_TEMPLATE:{ig(this,e);break}case P.AFTER_BODY:case P.IN_FRAMESET:case P.AFTER_FRAMESET:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{nh(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===w.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.TEXT:case P.IN_COLUMN_GROUP:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{this._insertCharacters(e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:case P.AFTER_BODY:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{Km(this,e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Rc(this,e);break}case P.IN_TABLE_TEXT:{eg(this,e);break}}}}function j_(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):Zm(t,e),n}function $_(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 o=t.activeFormattingElements.getElementEntry(i),u=o&&a>=H_;!o||u?(u&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(i)):(i=z_(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function z_(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 W_(t,e,n){const r=t.treeAdapter.getTagName(e),s=Hl(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&a===ue.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function G_(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,s.tagID)}function th(t,e){for(let n=0;n<U_;n++){const r=j_(t,e);if(!r)break;const s=$_(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&&W_(t,i,a),G_(t,s,r)}}function Sd(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function K_(t,e){t._appendCommentNode(e,t.openElements.items[0])}function V_(t,e){t._appendCommentNode(e,t.document)}function nh(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 X_(t,e){t._setDocumentType(e);const n=e.forceQuirks?rr.QUIRKS:w_(e);S_(e)||t._err(e,ne.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=P.BEFORE_HTML}function to(t,e){t._err(e,ne.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,rr.QUIRKS),t.insertionMode=P.BEFORE_HTML,t._processToken(e)}function Q_(t,e){e.tagID===c.HTML?(t._insertElement(e,ue.HTML),t.insertionMode=P.BEFORE_HEAD):vo(t,e)}function Z_(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&vo(t,e)}function vo(t,e){t._insertFakeRootElement(),t.insertionMode=P.BEFORE_HEAD,t._processToken(e)}function J_(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.HEAD:{t._insertElement(e,ue.HTML),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD;break}default:Eo(t,e)}}function e2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Eo(t,e):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Eo(t,e){t._insertFakeElement(Q.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD,t._processToken(e)}function kr(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,Hn.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Hn.RAWTEXT):(t._insertElement(e,ue.HTML),t.insertionMode=P.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,Hn.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,Hn.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=P.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(P.IN_TEMPLATE);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:To(t,e)}}function t2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=P.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{To(t,e);break}case c.TEMPLATE:{Ha(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Ha(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,ne.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,ne.endTagWithoutMatchingOpenElement)}function To(t,e){t.openElements.pop(),t.insertionMode=P.AFTER_HEAD,t._processToken(e)}function n2(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{kr(t,e);break}case c.NOSCRIPT:{t._err(e,ne.nestedNoscriptInHead);break}default:_o(t,e)}}function r2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=P.IN_HEAD;break}case c.BR:{_o(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function _o(t,e){const n=e.type===it.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=P.IN_HEAD,t._processToken(e)}function s2(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.BODY:{t._insertElement(e,ue.HTML),t.framesetOk=!1,t.insertionMode=P.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,ue.HTML),t.insertionMode=P.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,ne.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),kr(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Ao(t,e)}}function a2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Ao(t,e);break}case c.TEMPLATE:{Ha(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Ao(t,e){t._insertFakeElement(Q.BODY,c.BODY),t.insertionMode=P.IN_BODY,ql(t,e)}function ql(t,e){switch(e.type){case it.CHARACTER:{Vm(t,e);break}case it.WHITESPACE_CHARACTER:{Km(t,e);break}case it.COMMENT:{Sd(t,e);break}case it.START_TAG:{An(t,e);break}case it.END_TAG:{jl(t,e);break}case it.EOF:{Jm(t,e);break}}}function Km(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Vm(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function i2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function o2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function u2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_FRAMESET)}function l2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML)}function c2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Nd.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,ue.HTML)}function d2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function f2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),n||(t.formElement=t.openElements.current))}function h2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML)}function p2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),t.tokenizer.state=Hn.PLAINTEXT}function m2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.framesetOk=!1}function g2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Q.A);n&&(th(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function b2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function v2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(th(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,ue.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function E2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function T2(t,e){t.treeAdapter.getDocumentMode(t.document)!==rr.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),t.framesetOk=!1,t.insertionMode=P.IN_TABLE}function Xm(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ue.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Qm(t){const e=Fm(t,ya.TYPE);return e!=null&&e.toLowerCase()===F_}function _2(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ue.HTML),Qm(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function A2(t,e){t._appendElement(e,ue.HTML),e.ackSelfClosing=!0}function y2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,ue.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function N2(t,e){e.tagName=Q.IMG,e.tagID=c.IMG,Xm(t,e)}function S2(t,e){t._insertElement(e,ue.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Hn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=P.TEXT}function w2(t,e){t.openElements.hasInButtonScope(c.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 w0(t,e){t._switchToTextParsing(e,Hn.RAWTEXT)}function C2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===P.IN_TABLE||t.insertionMode===P.IN_CAPTION||t.insertionMode===P.IN_TABLE_BODY||t.insertionMode===P.IN_ROW||t.insertionMode===P.IN_CELL?P.IN_SELECT_IN_TABLE:P.IN_SELECT}function L2(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML)}function O2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,ue.HTML)}function x2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,ue.HTML)}function R2(t,e){t._reconstructActiveFormattingElements(),Ym(e),eh(e),e.selfClosing?t._appendElement(e,ue.MATHML):t._insertElement(e,ue.MATHML),e.ackSelfClosing=!0}function D2(t,e){t._reconstructActiveFormattingElements(),zm(e),eh(e),e.selfClosing?t._appendElement(e,ue.SVG):t._insertElement(e,ue.SVG),e.ackSelfClosing=!0}function I0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML)}function An(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{b2(t,e);break}case c.A:{g2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{c2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{l2(t,e);break}case c.LI:case c.DD:case c.DT:{h2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{Xm(t,e);break}case c.HR:{y2(t,e);break}case c.RB:case c.RTC:{O2(t,e);break}case c.RT:case c.RP:{x2(t,e);break}case c.PRE:case c.LISTING:{d2(t,e);break}case c.XMP:{w2(t,e);break}case c.SVG:{D2(t,e);break}case c.HTML:{i2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{kr(t,e);break}case c.BODY:{o2(t,e);break}case c.FORM:{f2(t,e);break}case c.NOBR:{v2(t,e);break}case c.MATH:{R2(t,e);break}case c.TABLE:{T2(t,e);break}case c.INPUT:{_2(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{A2(t,e);break}case c.IMAGE:{N2(t,e);break}case c.BUTTON:{m2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{E2(t,e);break}case c.IFRAME:{I2(t,e);break}case c.SELECT:{C2(t,e);break}case c.OPTION:case c.OPTGROUP:{L2(t,e);break}case c.NOEMBED:case c.NOFRAMES:{w0(t,e);break}case c.FRAMESET:{u2(t,e);break}case c.TEXTAREA:{S2(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?w0(t,e):I0(t,e);break}case c.PLAINTEXT:{p2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:I0(t,e)}}function k2(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function P2(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,og(t,e))}function M2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function B2(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function F2(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(Q.P,c.P),t._closePElement()}function U2(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function H2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function q2(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function j2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function $2(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Q.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function Zm(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const a=t.openElements.items[s],i=t.openElements.tagIDs[s];if(r===i&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(a,i))break}}function jl(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{th(t,e);break}case c.P:{F2(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{M2(t,e);break}case c.LI:{U2(t);break}case c.DD:case c.DT:{H2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{q2(t);break}case c.BR:{$2(t);break}case c.BODY:{k2(t,e);break}case c.HTML:{P2(t,e);break}case c.FORM:{B2(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{j2(t,e);break}case c.TEMPLATE:{Ha(t,e);break}default:Zm(t,e)}}function Jm(t,e){t.tmplInsertionModeStack.length>0?ig(t,e):nh(t,e)}function Y2(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function z2(t,e){t._err(e,ne.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Rc(t,e){if(t.openElements.currentTagId!==void 0&&Wm.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=P.IN_TABLE_TEXT,e.type){case it.CHARACTER:{tg(t,e);break}case it.WHITESPACE_CHARACTER:{eg(t,e);break}}else iu(t,e)}function W2(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_CAPTION}function G2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_COLUMN_GROUP}function K2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Q.COLGROUP,c.COLGROUP),t.insertionMode=P.IN_COLUMN_GROUP,rh(t,e)}function V2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_TABLE_BODY}function X2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Q.TBODY,c.TBODY),t.insertionMode=P.IN_TABLE_BODY,$l(t,e)}function Q2(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function Z2(t,e){Qm(e)?t._appendElement(e,ue.HTML):iu(t,e),e.ackSelfClosing=!0}function J2(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,ue.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Ri(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{X2(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{kr(t,e);break}case c.COL:{K2(t,e);break}case c.FORM:{J2(t,e);break}case c.TABLE:{Q2(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{V2(t,e);break}case c.INPUT:{Z2(t,e);break}case c.CAPTION:{W2(t,e);break}case c.COLGROUP:{G2(t,e);break}default:iu(t,e)}}function Ro(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Ha(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:iu(t,e)}}function iu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,ql(t,e),t.fosterParentingEnabled=n}function eg(t,e){t.pendingCharacterTokens.push(e)}function tg(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function no(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)iu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const ng=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function eA(t,e){const n=e.tagID;ng.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,Ri(t,e)):An(t,e)}function tA(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,n===c.TABLE&&Ro(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:jl(t,e)}}function rh(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.COL:{t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{kr(t,e);break}default:gl(t,e)}}function nA(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TEMPLATE:{Ha(t,e);break}case c.COL:break;default:gl(t,e)}}function gl(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE,t._processToken(e))}function $l(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(Q.TR,c.TR),t.insertionMode=P.IN_ROW,Yl(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,Ri(t,e));break}default:Ri(t,e)}}function wd(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,Ro(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:Ro(t,e)}}function Yl(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,$l(t,e));break}default:Ri(t,e)}}function rg(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,wd(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,wd(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:Ro(t,e)}}function rA(t,e){const n=e.tagID;ng.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),Yl(t,e)):An(t,e)}function sA(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),rg(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:jl(t,e)}}function sg(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,ue.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,ue.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{kr(t,e);break}}}function ag(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Ha(t,e);break}}}function aA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):sg(t,e)}function iA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):ag(t,e)}function oA(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{kr(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=P.IN_TABLE,t.insertionMode=P.IN_TABLE,Ri(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=P.IN_COLUMN_GROUP,t.insertionMode=P.IN_COLUMN_GROUP,rh(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=P.IN_TABLE_BODY,t.insertionMode=P.IN_TABLE_BODY,$l(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=P.IN_ROW,t.insertionMode=P.IN_ROW,Yl(t,e);break}default:t.tmplInsertionModeStack[0]=P.IN_BODY,t.insertionMode=P.IN_BODY,An(t,e)}}function uA(t,e){e.tagID===c.TEMPLATE&&Ha(t,e)}function ig(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):nh(t,e)}function lA(t,e){e.tagID===c.HTML?An(t,e):bl(t,e)}function og(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=P.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else bl(t,e)}function bl(t,e){t.insertionMode=P.IN_BODY,ql(t,e)}function cA(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.FRAMESET:{t._insertElement(e,ue.HTML);break}case c.FRAME:{t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{kr(t,e);break}}}function dA(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=P.AFTER_FRAMESET))}function fA(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.NOFRAMES:{kr(t,e);break}}}function hA(t,e){e.tagID===c.HTML&&(t.insertionMode=P.AFTER_AFTER_FRAMESET)}function pA(t,e){e.tagID===c.HTML?An(t,e):Ju(t,e)}function Ju(t,e){t.insertionMode=P.IN_BODY,ql(t,e)}function mA(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.NOFRAMES:{kr(t,e);break}}}function gA(t,e){e.chars=Ot,t._insertCharacters(e)}function bA(t,e){t._insertCharacters(e),t.framesetOk=!1}function ug(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==ue.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function vA(t,e){if(D_(e))ug(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===ue.MATHML?Ym(e):r===ue.SVG&&(k_(e),zm(e)),eh(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function EA(t,e){if(e.tagID===c.P||e.tagID===c.BR){ug(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)===ue.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 lg(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 TA=lg(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),_A=lg(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),AA=new Set([Q.AREA,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BR,Q.COL,Q.EMBED,Q.FRAME,Q.HR,Q.IMG,Q.INPUT,Q.KEYGEN,Q.LINK,Q.META,Q.PARAM,Q.SOURCE,Q.TRACK,Q.WBR]);function cg(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===ue.HTML&&AA.has(e.treeAdapter.getTagName(t))}const yA={treeAdapter:ls,scriptingEnabled:!0};function NA(t,e){const n={...yA,...e};return cg(t,n)?"":dg(t,n)}function dg(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===Q.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===ue.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)?wA(t,e):e.treeAdapter.isTextNode(t)?CA(t,e):e.treeAdapter.isCommentNode(t)?LA(t,e):e.treeAdapter.isDocumentTypeNode(t)?OA(t,e):""}function wA(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${IA(t,e)}>${cg(t,e)?"":`${dg(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 ue.XML:{n+=`xml:${r.name}`;break}case ue.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case ue.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${TA(r.value)}"`}return n}function CA(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)===ue.HTML&&o_(a,e.scriptingEnabled)?r:_A(r)}function LA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function OA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function xA(t,e){return Gm.parse(t,e)}function sh(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Gm.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Kn(t){return"tagName"in t}function ts(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 $s(t,e){return t.attrs.some(n=>n.name===e)}function C0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function ah(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Ys(t){return sh(t).childNodes}function RA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function Di(t){return RA(t)?xA(t).childNodes:sh(t).childNodes}function DA(t){const e=sh("");return e.childNodes=t,NA(e)}const ih={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 kA(t){return Object.prototype.hasOwnProperty.call(ih,t)}function Do(t){return ih[t].valueKind}const PA=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),MA=new Set(["code","pre","kbd","samp"]),BA=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Na(t){if(t.annotation!==void 0&&kA(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 MA.has(t.tag)?"code":PA.has(t.tag)?"shorttext":BA.has(t.tag)?"text":"shorttext"}const FA=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function ms(t){const e=[];for(const n of t.matchAll(FA)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Sa(t){var r;const e=t.trim(),n=ms(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function zl(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 oh(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function fg(t){const e=L0(St(t,"data-minlength")),n=L0(St(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function L0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function gs(t,e=new Map){return pg(t,e,new Set)}function hg(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=pg(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function pg(t,e,n){const r=[],s=new Map,a=h=>{const g=s.get(h);if(g!==void 0)return g;const f={name:h,type:"shorttext",label:Kf(h),required:!1,multiline:!1};return s.set(h,f),r.push(h),f},i=(h,g)=>{if(s.has(h))return;const f=a(h);f.type=g,f.multiline=ih[g].multiline},o=h=>{const g=St(h,"data-field")??UA(h);if(g===void 0)return;const f=a(g);$s(h,"data-required")&&(f.required=!0);const m=St(h,"data-help");m!==void 0&&(f.help=m);const b=St(h,"data-label");b!==void 0&&(f.label=b);const{minLength:_,maxLength:A}=fg(h);_!==void 0&&(f.minLength=_),A!==void 0&&(f.maxLength=A)},u=h=>{const g=Sa(h);for(const f of ms(h))f.dotted||i(f.name,Na({tag:"",wholeValue:(g==null?void 0:g.name)===f.name}))},d=h=>{for(const g of h){if(!Kn(g)){ts(g)&&u(g.value);continue}const f=St(g,"data-each");if(f!==void 0){const _=a(f);_.type="url",_.multiple=!0;const A=St(g,"data-pick-from");A!==void 0&&(_.pickFrom=A),o(g);continue}if($s(g,"data-each-in"))continue;const m=St(g,"data-type"),b=e.has(g.tagName)?hg(g.tagName,e,n):void 0;for(const _ of g.attrs){const A=Sa(_.value);for(const E of ms(_.value)){if(E.dotted)continue;const C=(A==null?void 0:A.name)===E.name,I=C?b==null?void 0:b.get(_.name):void 0;i(E.name,I??Na({tag:g.tagName,attribute:_.name,wholeValue:C,valuePrefix:oh(_.value),download:$s(g,"download"),...m!==void 0&&{annotation:m}}))}}for(const _ of g.childNodes){if(!ts(_))continue;const A=Sa(_.value);for(const E of ms(_.value))E.dotted||i(E.name,Na({tag:g.tagName,wholeValue:(A==null?void 0:A.name)===E.name,...m!==void 0&&{annotation:m}}))}o(g),d(g.childNodes)}};return d(Di(t)),r.map(h=>HA(s.get(h)))}function UA(t){for(const e of t.attrs){const n=ms(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(ts(e)){const n=ms(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function HA(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 qA(t,e){if(t===e)return!1;const n=Do(t),r=Do(e);return r==="html"?!1:n==="html"||t==="date"&&e==="time"||t==="time"&&e==="date"||(a=>a==="shorttext"||a==="text"||a==="code"||a==="email"||a==="phone")(t)&&(e==="date"||e==="time")?!0:!(n===r||r==="text")}function jA(t,e){const n=new Map(t.map(o=>[o.name,o])),r=new Map(e.map(o=>[o.name,o])),s=[],a=[],i=[];for(const[o,u]of n){const d=r.get(o);d===void 0?a.push({name:o,type:u.type}):d.type!==u.type&&i.push({name:o,from:u.type,to:d.type,destructive:qA(u.type,d.type)})}for(const[o,u]of r)n.has(o)||s.push({name:o,type:u.type});return{added:s.sort((o,u)=>o.name.localeCompare(u.name)),removed:a.sort((o,u)=>o.name.localeCompare(u.name)),typeChanged:i.sort((o,u)=>o.name.localeCompare(u.name))}}const O0=/^(.+)@v([1-9]\d*)$/;function uh(t){const e=O0.exec(t);if(!e)return null;const n=e[1];return O0.test(n)?null:{base:n,version:Number.parseInt(e[2],10)}}function Id(t){return uh(t)!==null}function xR(t){const e=uh(t);return e?e.base:t}function $A(t){const e=uh(t);return e?e.version:null}const x0="ref:";function Wl(t){return t.startsWith(x0)?t.slice(x0.length):void 0}function R0(t){const e=new Set,n=r=>{for(const s of r)if(Kn(s)){for(const a of s.attrs){const i=Wl(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(Di(t)),[...e].sort()}function Cd(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,o=new Set,u=new Map,d=new Set,h=g=>{for(const f of g){if(!Kn(f))continue;const m=YA(f);m!==void 0&&o.add(m);const b=St(f,"data-each-in");if(b!==void 0){r.push(b);continue}const _=St(f,"data-each");if(_!==void 0&&s.push(_),$s(f,"data-required")){const I=D0(f);I!==void 0&&n.add(I)}const A=fg(f);if(A.minLength!==void 0||A.maxLength!==void 0){const I=D0(f);I!==void 0&&u.set(I,A)}const E=St(f,"data-type"),C=e.has(f.tagName)?hg(f.tagName,e,new Set):void 0;for(const I of f.attrs){const H=Wl(I.value);H!==void 0&&d.add(H);const B=Sa(I.value);if(B===null||B.dotted)continue;const J=(C==null?void 0:C.get(I.name))??Na({tag:f.tagName,attribute:I.name,wholeValue:!0,valuePrefix:oh(I.value),download:$s(f,"download"),...E!==void 0&&{annotation:E}});J==="image"?a.add(B.name):J==="file"?i.add(B.name):J==="richtext"&&o.add(B.name)}h(f.childNodes)}};return h(Di(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...o],constraints:u,references:[...d].sort()}}function YA(t){const e=t.childNodes.filter(i=>!(ts(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!ts(n))return;const r=Sa(n.value);if(r===null||r.dotted)return;const s=St(t,"data-type"),a=Na({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return Do(a)==="html"?r.name:void 0}function D0(t){const e=St(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=ms(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(ts(n)){const r=ms(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function zA(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Dc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function WA(t){return JSON.stringify(t).slice(1,-1)}function vl(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 GA(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 KA(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 VA(t,e){const n=GA(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return zA((s==null?void 0:s.displayName)??r.name)});return KA(n)}const XA=[400,800,1200,1600],QA={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function ZA(t){return t==="jpeg"?"jpg":t}function JA(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function ey(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 ty(t,e,n){var A;const r=JA(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:XA,formats:s}),i=ey(t),o=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),u=[],d=E=>{const C=`${o}.${i}-${E.width}.${ZA(E.format)}`;return u.push({path:C,contents:E.bytes}),`/${C}`},h=new Map;for(const E of[...a.variants].sort((C,I)=>C.width-I.width)){const C=d(E),I=h.get(E.format)??[];I.push({url:C,width:E.width}),h.set(E.format,I)}const g=E=>(h.get(E)??[]).map(C=>`${C.url} ${C.width}w`).join(", "),f=["avif","webp"].filter(E=>h.has(E)).map(E=>({format:E,mime:QA[E],srcset:g(E)})),m=h.get(r)??[],b=((A=m[m.length-1])==null?void 0:A.url)??`/${e}`,_={width:a.sourceWidth,height:a.sourceHeight,sources:f,fallbackSrc:b,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:u,info:_}}function mg(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${Dc(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Dc(i)}"`).join(""),s=`<img src="${Dc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const ny=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],ry=["data-type","data-field","data-required","data-help","data-label"];function Ld(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=ko(Di(t.template),t.scope,e),r=t.document===void 0?n:Eg(ko(Di(t.document),t.scope,e),n);return sy(r,t,e),DA(r)}function sy(t,e,n){var i,o,u,d;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const h=Ys(`<style>
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-DsexK0er.js","./TemplatesPane-C-T4XiLp.css","./MigrationsPane-i0wjSyoQ.js","./MigrationsPane-BAHPPSXP.css"])))=>i.map(i=>d[i]);
2
+ var Cv=Object.defineProperty;var Zh=t=>{throw TypeError(t)};var Lv=(t,e,n)=>e in t?Cv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _e=(t,e,n)=>Lv(t,typeof e!="symbol"?e+"":e,n),_c=(t,e,n)=>e.has(t)||Zh("Cannot "+n);var V=(t,e,n)=>(_c(t,e,"read from private field"),n?n.call(t):e.get(t)),qe=(t,e,n)=>e.has(t)?Zh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),je=(t,e,n,r)=>(_c(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),tt=(t,e,n)=>(_c(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 S1=!1;var Df=Array.isArray,Ov=Array.prototype.indexOf,Ea=Array.prototype.includes,kl=Array.from,xv=Object.defineProperty,qs=Object.getOwnPropertyDescriptor,w1=Object.getOwnPropertyDescriptors,Rv=Object.prototype,Dv=Array.prototype,kf=Object.getPrototypeOf,Jh=Object.isExtensible;function Qi(t){return typeof t=="function"}const Pf=()=>{};function kv(t){return t()}function sd(t){for(var e=0;e<t.length;e++)t[e]()}function I1(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function Pv(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 hn=2,Ni=4,Jo=8,Mf=1<<24,Sr=16,Or=32,Ws=64,ad=128,lr=512,tn=1024,on=2048,Jr=4096,xn=8192,cr=16384,Ma=32768,id=1<<25,bs=65536,ul=1<<17,Mv=1<<18,Hi=1<<19,C1=1<<20,Gr=1<<25,Ca=65536,ll=1<<21,ci=1<<22,js=1<<23,Kr=Symbol("$state"),L1=Symbol("legacy props"),Bv=Symbol(""),Wu=Symbol("attributes"),od=Symbol("class"),ud=Symbol("style"),io=Symbol("text"),Gu=Symbol("form reset"),Pl=new class extends Error{constructor(){super(...arguments);_e(this,"name","StaleReactionError");_e(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var A1;const Bf=!!((A1=globalThis.document)!=null&&A1.contentType)&&globalThis.document.contentType.includes("xml");function O1(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Fv(){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 Hv(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function qv(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function jv(t){throw new Error("https://svelte.dev/e/effect_orphan")}function $v(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Yv(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function zv(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Wv(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Gv(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Kv(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Vv=1,Xv=2,x1=4,Qv=8,Zv=16,Jv=1,eE=2,tE=4,nE=8,rE=16,sE=1,aE=2,Kt=Symbol("uninitialized"),R1="http://www.w3.org/1999/xhtml",iE="http://www.w3.org/2000/svg",oE="@attach";function uE(){console.warn("https://svelte.dev/e/derived_inert")}function lE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function cE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function D1(t){return t===this.v}function dE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function k1(t){return!dE(t,this.v)}let qi=!1,fE=!1;function hE(){qi=!0}let Et=null;function Si(t){Et=t}function pE(t){return mE().get(t)}function ct(t,e=!1,n){Et={p:Et,i:!1,c:null,e:null,s:t,x:null,r:Xe,l:qi&&!e?{s:null,u:null,$:[]}:null}}function dt(t){var e=Et,n=e.e;if(n!==null){e.e=null;for(var r of n)rm(r)}return e.i=!0,Et=e.p,{}}function ji(){return!qi||Et!==null&&Et.l===null}function mE(t){return Et===null&&O1(),Et.c??(Et.c=new Map(gE(Et)||void 0))}function gE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let la=[];function P1(){var t=la;la=[],sd(t)}function Cr(t){if(la.length===0&&!mo){var e=la;queueMicrotask(()=>{e===la&&P1()})}la.push(t)}function bE(){for(;la.length>0;)P1()}function M1(t){var e=Xe;if(e===null)return Ze.f|=js,t;if((e.f&Ma)===0&&(e.f&Ni)===0)throw t;Ps(t,e)}function Ps(t,e){for(;e!==null;){if((e.f&ad)!==0){if((e.f&Ma)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const vE=-7169;function Pt(t,e){t.f=t.f&vE|e}function Ff(t){(t.f&lr)!==0||t.deps===null?Pt(t,tn):Pt(t,Jr)}function B1(t){if(t!==null)for(const e of t)(e.f&hn)===0||(e.f&Ca)===0||(e.f^=Ca,B1(e.deps))}function F1(t,e,n){(t.f&on)!==0?e.add(t):(t.f&Jr)!==0&&n.add(t),B1(t.deps),Pt(t,tn)}let Nu=!1;function EE(t){var e=Nu;try{return Nu=!1,[t(),Nu]}finally{Nu=e}}let Ac=null,Qa=null,Pe=null,po=null,cn=null,ld=null,mo=!1,yc=!1,oi=null,Ku=null;var e0=0;let TE=1;var bi,xs,ha,vi,Ei,pa,Ti,cs,Wo,Yn,Go,Rs,$r,Yr,_i,ma,ft,cd,oo,dd,U1,H1,Vu,_E,fd,Ja;const Ll=class Ll{constructor(){qe(this,ft);_e(this,"id",TE++);qe(this,bi,!1);_e(this,"linked",!0);qe(this,xs,null);qe(this,ha,null);_e(this,"async_deriveds",new Map);_e(this,"current",new Map);_e(this,"previous",new Map);_e(this,"unblocked",new Set);qe(this,vi,new Set);qe(this,Ei,new Set);qe(this,pa,new Set);qe(this,Ti,0);qe(this,cs,new Map);qe(this,Wo,null);qe(this,Yn,[]);qe(this,Go,[]);qe(this,Rs,new Set);qe(this,$r,new Set);qe(this,Yr,new Map);qe(this,_i,new Set);_e(this,"is_fork",!1);qe(this,ma,!1)}skip_effect(e){V(this,Yr).has(e)||V(this,Yr).set(e,{d:[],m:[]}),V(this,_i).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=V(this,Yr).get(e);if(r){V(this,Yr).delete(e);for(var s of r.d)Pt(s,on),n(s);for(s of r.m)Pt(s,Jr),n(s)}V(this,_i).add(e)}capture(e,n,r=!1){e.v!==Kt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&js)===0&&(this.current.set(e,[n,r]),cn==null||cn.set(e,n)),this.is_fork||(e.v=n)}activate(){Pe=this}deactivate(){Pe=null,cn=null}flush(){try{yc=!0,Pe=this,tt(this,ft,oo).call(this)}finally{e0=0,ld=null,oi=null,Ku=null,yc=!1,Pe=null,cn=null,Ta.clear()}}discard(){for(const e of V(this,Ei))e(this);V(this,Ei).clear(),V(this,pa).clear(),tt(this,ft,Ja).call(this)}register_created_effect(e){V(this,Go).push(e)}increment(e,n){if(je(this,Ti,V(this,Ti)+1),e){let r=V(this,cs).get(n)??0;V(this,cs).set(n,r+1)}}decrement(e,n){if(je(this,Ti,V(this,Ti)-1),e){let r=V(this,cs).get(n)??0;r===1?V(this,cs).delete(n):V(this,cs).set(n,r-1)}V(this,ma)||(je(this,ma,!0),Cr(()=>{je(this,ma,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)V(this,Rs).add(r);for(const r of n)V(this,$r).add(r);e.clear(),n.clear()}oncommit(e){V(this,vi).add(e)}ondiscard(e){V(this,Ei).add(e)}on_fork_commit(e){V(this,pa).add(e)}run_fork_commit_callbacks(){for(const e of V(this,pa))e(this);V(this,pa).clear()}settled(){return(V(this,Wo)??je(this,Wo,I1())).promise}static ensure(){var e;if(Pe===null){const n=Pe=new Ll;tt(e=n,ft,fd).call(e),!yc&&!mo&&Cr(()=>{V(n,bi)||n.flush()})}return Pe}apply(){{cn=null;return}}schedule(e){var s;if(ld=e,(s=e.b)!=null&&s.is_pending&&(e.f&(Ni|Jo|Mf))!==0&&(e.f&Ma)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(oi!==null&&n===Xe&&(Ze===null||(Ze.f&hn)===0))return;if((r&(Ws|Or))!==0){if((r&tn)===0)return;n.f^=tn}}V(this,Yn).push(n)}};bi=new WeakMap,xs=new WeakMap,ha=new WeakMap,vi=new WeakMap,Ei=new WeakMap,pa=new WeakMap,Ti=new WeakMap,cs=new WeakMap,Wo=new WeakMap,Yn=new WeakMap,Go=new WeakMap,Rs=new WeakMap,$r=new WeakMap,Yr=new WeakMap,_i=new WeakMap,ma=new WeakMap,ft=new WeakSet,cd=function(){if(this.is_fork)return!0;for(const r of V(this,cs).keys()){for(var e=r,n=!1;e.parent!==null;){if(V(this,Yr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},oo=function(){var u,d,h,g;if(je(this,bi,!0),e0++>1e3&&(tt(this,ft,Ja).call(this),yE()),!tt(this,ft,cd).call(this)){for(const f of V(this,Rs))V(this,$r).delete(f),Pt(f,on),this.schedule(f);for(const f of V(this,$r))Pt(f,Jr),this.schedule(f)}const e=V(this,Yn);je(this,Yn,[]),this.apply();var n=oi=[],r=[],s=Ku=[];for(const f of e)try{tt(this,ft,dd).call(this,f,n,r)}catch(m){throw $1(f),m}if(Pe=null,s.length>0){var a=Ll.ensure();for(const f of s)a.schedule(f)}if(oi=null,Ku=null,tt(this,ft,cd).call(this)){tt(this,ft,Vu).call(this,r),tt(this,ft,Vu).call(this,n);for(const[f,m]of V(this,Yr))j1(f,m);s.length>0&&tt(u=Pe,ft,oo).call(u);return}const i=tt(this,ft,U1).call(this);if(i){tt(d=i,ft,H1).call(d,this);return}V(this,Rs).clear(),V(this,$r).clear();for(const f of V(this,vi))f(this);V(this,vi).clear(),po=this,t0(r),t0(n),po=null,(h=V(this,Wo))==null||h.resolve();var o=Pe;if(this.linked&&V(this,Ti)===0&&tt(this,ft,Ja).call(this),V(this,Yn).length>0){o===null&&(o=this,tt(this,ft,fd).call(this));const f=o;V(f,Yn).push(...V(this,Yn).filter(m=>!V(f,Yn).includes(m)))}o!==null&&tt(g=o,ft,oo).call(g)},dd=function(e,n,r){e.f^=tn;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Or|Ws))!==0,o=i&&(a&tn)!==0,u=o||(a&xn)!==0||V(this,Yr).has(s);if(!u&&s.fn!==null){i?s.f^=tn:(a&Ni)!==0?n.push(s):ru(s)&&((a&Sr)!==0&&V(this,$r).add(s),Oi(s));var d=s.first;if(d!==null){s=d;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},U1=function(){for(var e=V(this,xs);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=V(e,xs)}return null},H1=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 u of a){var i=u.f;if((i&hn)!==0)n(u);else{var o=u;i&(ci|Sr)&&!this.async_deriveds.has(o)&&(V(this,$r).delete(o),Pt(o,on),this.schedule(o))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),tt(r=e,ft,Ja).call(r),Pe=this,tt(this,ft,oo).call(this)},Vu=function(e){for(var n=0;n<e.length;n+=1)F1(e[n],V(this,Rs),V(this,$r))},_E=function(){var h;tt(this,ft,Ja).call(this);for(let g=Ac;g!==null;g=V(g,ha)){var e=g.id<this.id,n=[];for(const[f,[m,b]]of this.current){if(g.current.has(f)){var r=g.current.get(f)[0];if(e&&m!==r)g.current.set(f,[m,b]);else continue}n.push(f)}if(e)for(const[f,m]of this.async_deriveds){const b=g.async_deriveds.get(f);b&&m.promise.then(b.resolve)}if(V(g,bi)){var s=[...g.current.keys()].filter(f=>!this.current.has(f));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const f of V(this,_i))g.unskip_effect(f,m=>{var b;(m.f&(Sr|ci))!==0?g.schedule(m):tt(b=g,ft,Vu).call(b,[m])});g.activate();var a=new Set,i=new Map;for(var o of n)q1(o,s,a,i);i=new Map;var u=[...g.current.keys()].filter(f=>this.current.has(f)?this.current.get(f)[0]!==f.v:!0);if(u.length>0)for(const f of V(this,Go))(f.f&(cr|xn|ul))===0&&Uf(f,u,i)&&((f.f&(ci|Sr))!==0?(Pt(f,on),g.schedule(f)):V(g,Rs).add(f));if(V(g,Yn).length>0&&!V(g,ma)){g.apply();for(var d of V(g,Yn))tt(h=g,ft,dd).call(h,d,[],[]);je(g,Yn,[])}g.deactivate()}}}},fd=function(){Qa===null?Ac=Qa=this:(je(Qa,ha,this),je(this,xs,Qa)),Qa=this},Ja=function(){var e=V(this,xs),n=V(this,ha);e===null?Ac=n:je(e,ha,n),n===null?Qa=e:je(n,xs,e),this.linked=!1};let La=Ll;function AE(t){var e=mo;mo=!0;try{for(var n;;){if(bE(),Pe===null)return n;Pe.flush()}}finally{mo=e}}function yE(){try{$v()}catch(t){Ps(t,ld)}}let vr=null;function t0(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(cr|xn))===0&&ru(r)&&(vr=new Set,Oi(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&im(r),(vr==null?void 0:vr.size)>0)){Ta.clear();for(const s of vr){if((s.f&(cr|xn))!==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 o=a.length-1;o>=0;o--){const u=a[o];(u.f&(cr|xn))===0&&Oi(u)}}vr.clear()}}vr=null}}function q1(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&hn)!==0?q1(s,e,n,r):(a&(ci|Sr))!==0&&(a&on)===0&&Uf(s,e,r)&&(Pt(s,on),Hf(s))}}function Uf(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(Ea.call(e,s))return!0;if((s.f&hn)!==0&&Uf(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function Hf(t){Pe.schedule(t)}function j1(t,e){if(!((t.f&Or)!==0&&(t.f&tn)!==0)){(t.f&on)!==0?e.d.push(t):(t.f&Jr)!==0&&e.m.push(t),Pt(t,tn);for(var n=t.first;n!==null;)j1(n,e),n=n.next}}function $1(t){Pt(t,tn);for(var e=t.first;e!==null;)$1(e),e=e.next}function NE(t){let e=0,n=Oa(0),r;return()=>{Yf()&&(l(n),Bl(()=>(e===0&&(r=Fa(()=>t(()=>go(n)))),e+=1,()=>{Cr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,go(n))})})))}}var SE=bs|Hi;function wE(t,e,n,r){new IE(t,e,n,r)}var er,Rf,tr,ga,Mn,nr,Cn,zn,ds,ba,Ds,Ai,Ko,Vo,fs,Ol,Mt,CE,LE,OE,hd,Xu,Qu,pd,md;class IE{constructor(e,n,r,s){qe(this,Mt);_e(this,"parent");_e(this,"is_pending",!1);_e(this,"transform_error");qe(this,er);qe(this,Rf,null);qe(this,tr);qe(this,ga);qe(this,Mn);qe(this,nr,null);qe(this,Cn,null);qe(this,zn,null);qe(this,ds,null);qe(this,ba,0);qe(this,Ds,0);qe(this,Ai,!1);qe(this,Ko,new Set);qe(this,Vo,new Set);qe(this,fs,null);qe(this,Ol,NE(()=>(je(this,fs,Oa(V(this,ba))),()=>{je(this,fs,null)})));var a;je(this,er,e),je(this,tr,n),je(this,ga,i=>{var o=Xe;o.b=this,o.f|=ad,r(i)}),this.parent=Xe.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),je(this,Mn,Ba(()=>{tt(this,Mt,hd).call(this)},SE))}defer_effect(e){F1(e,V(this,Ko),V(this,Vo))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!V(this,tr).pending}update_pending_count(e,n){tt(this,Mt,pd).call(this,e,n),je(this,ba,V(this,ba)+e),!(!V(this,fs)||V(this,Ai))&&(je(this,Ai,!0),Cr(()=>{je(this,Ai,!1),V(this,fs)&&Ii(V(this,fs),V(this,ba))}))}get_effect_pending(){return V(this,Ol).call(this),l(V(this,fs))}error(e){if(!V(this,tr).onerror&&!V(this,tr).failed)throw e;Pe!=null&&Pe.is_fork?(V(this,nr)&&Pe.skip_effect(V(this,nr)),V(this,Cn)&&Pe.skip_effect(V(this,Cn)),V(this,zn)&&Pe.skip_effect(V(this,zn)),Pe.on_fork_commit(()=>{tt(this,Mt,md).call(this,e)})):tt(this,Mt,md).call(this,e)}}er=new WeakMap,Rf=new WeakMap,tr=new WeakMap,ga=new WeakMap,Mn=new WeakMap,nr=new WeakMap,Cn=new WeakMap,zn=new WeakMap,ds=new WeakMap,ba=new WeakMap,Ds=new WeakMap,Ai=new WeakMap,Ko=new WeakMap,Vo=new WeakMap,fs=new WeakMap,Ol=new WeakMap,Mt=new WeakSet,CE=function(){try{je(this,nr,Fn(()=>V(this,ga).call(this,V(this,er))))}catch(e){this.error(e)}},LE=function(e){const n=V(this,tr).failed;n&&je(this,zn,Fn(()=>{n(V(this,er),()=>e,()=>()=>{})}))},OE=function(){const e=V(this,tr).pending;e&&(this.is_pending=!0,je(this,Cn,Fn(()=>e(V(this,er)))),Cr(()=>{var n=je(this,ds,document.createDocumentFragment()),r=Vr();n.append(r),je(this,nr,tt(this,Mt,Qu).call(this,()=>Fn(()=>V(this,ga).call(this,r)))),V(this,Ds)===0&&(V(this,er).before(n),je(this,ds,null),_a(V(this,Cn),()=>{je(this,Cn,null)}),tt(this,Mt,Xu).call(this,Pe))}))},hd=function(){try{if(this.is_pending=this.has_pending_snippet(),je(this,Ds,0),je(this,ba,0),je(this,nr,Fn(()=>{V(this,ga).call(this,V(this,er))})),V(this,Ds)>0){var e=je(this,ds,document.createDocumentFragment());Gf(V(this,nr),e);const n=V(this,tr).pending;je(this,Cn,Fn(()=>n(V(this,er))))}else tt(this,Mt,Xu).call(this,Pe)}catch(n){this.error(n)}},Xu=function(e){this.is_pending=!1,e.transfer_effects(V(this,Ko),V(this,Vo))},Qu=function(e){var n=Xe,r=Ze,s=Et;es(V(this,Mn)),fr(V(this,Mn)),Si(V(this,Mn).ctx);try{return La.ensure(),e()}catch(a){return M1(a),null}finally{es(n),fr(r),Si(s)}},pd=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&tt(r=this.parent,Mt,pd).call(r,e,n);return}je(this,Ds,V(this,Ds)+e),V(this,Ds)===0&&(tt(this,Mt,Xu).call(this,n),V(this,Cn)&&_a(V(this,Cn),()=>{je(this,Cn,null)}),V(this,ds)&&(V(this,er).before(V(this,ds)),je(this,ds,null)))},md=function(e){V(this,nr)&&(dn(V(this,nr)),je(this,nr,null)),V(this,Cn)&&(dn(V(this,Cn)),je(this,Cn,null)),V(this,zn)&&(dn(V(this,zn)),je(this,zn,null));var n=V(this,tr).onerror;let r=V(this,tr).failed;var s=!1,a=!1;const i=()=>{if(s){cE();return}s=!0,a&&Kv(),V(this,zn)!==null&&_a(V(this,zn),()=>{je(this,zn,null)}),tt(this,Mt,Qu).call(this,()=>{tt(this,Mt,hd).call(this)})},o=u=>{try{a=!0,n==null||n(u,i),a=!1}catch(d){Ps(d,V(this,Mn)&&V(this,Mn).parent)}r&&je(this,zn,tt(this,Mt,Qu).call(this,()=>{try{return Fn(()=>{var d=Xe;d.b=this,d.f|=ad,r(V(this,er),()=>u,()=>i)})}catch(d){return Ps(d,V(this,Mn).parent),null}}))};Cr(()=>{var u;try{u=this.transform_error(e)}catch(d){Ps(d,V(this,Mn)&&V(this,Mn).parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(o,d=>Ps(d,V(this,Mn)&&V(this,Mn).parent)):o(u)})};function Y1(t,e,n,r){const s=ji()?wi:qf;var a=t.filter(f=>!f.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Xe,o=xE(),u=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(f=>f.promise)):null;function d(f){if((i.f&cr)===0){o();try{r(f)}catch(m){Ps(m,i)}cl()}}var h=z1();if(n.length===0){u.then(()=>d(e.map(s))).finally(h);return}function g(){Promise.all(n.map(f=>RE(f))).then(f=>d([...e.map(s),...f])).catch(f=>Ps(f,i)).finally(h)}u?u.then(()=>{o(),g(),cl()}):g()}function xE(){var t=Xe,e=Ze,n=Et,r=Pe;return function(a=!0){es(t),fr(e),Si(n),a&&(t.f&cr)===0&&(r==null||r.activate(),r==null||r.apply())}}function cl(t=!0){es(null),fr(null),Si(null),t&&(Pe==null||Pe.deactivate())}function z1(){var t=Xe,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 wi(t){var e=hn|on;return Xe!==null&&(Xe.f|=Hi),{ctx:Et,deps:null,effects:null,equals:D1,f:e,fn:t,reactions:null,rv:0,v:Kt,wv:0,parent:Xe,ac:null}}const Su=Symbol("obsolete");function RE(t,e,n){let r=Xe;r===null&&Fv();var s=void 0,a=Oa(Kt),i=!Ze,o=new Set;return $E(()=>{var m;var u=Xe,d=I1();s=d.promise;try{Promise.resolve(t()).then(d.resolve,b=>{b!==Pl&&d.reject(b)}).finally(cl)}catch(b){d.reject(b),cl()}var h=Pe;if(i){if((u.f&Ma)!==0)var g=z1();if(r.b.is_rendered())(m=h.async_deriveds.get(u))==null||m.reject(Su);else for(const b of o.values())b.reject(Su);o.add(d),h.async_deriveds.set(u,d)}const f=(b,_=void 0)=>{g==null||g(),o.delete(d),_!==Su&&(h.activate(),_?(a.f|=js,Ii(a,_)):((a.f&js)!==0&&(a.f^=js),Ii(a,b)),h.deactivate())};d.promise.then(f,b=>f(null,b||"unknown"))}),tu(()=>{for(const u of o)u.reject(Su)}),new Promise(u=>{function d(h){function g(){h===s?u(a):d(s)}h.then(g,g)}d(s)})}function Ae(t){const e=wi(t);return lm(e),e}function qf(t){const e=wi(t);return e.equals=k1,e}function DE(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)dn(e[n])}}function jf(t){var e,n=Xe,r=t.parent;if(!vs&&r!==null&&t.v!==Kt&&(r.f&(cr|xn))!==0)return uE(),t.v;es(r);try{t.f&=~Ca,DE(t),e=hm(t)}finally{es(n)}return e}function W1(t){var e=jf(t);if(!t.equals(e)&&(t.wv=dm(),(!(Pe!=null&&Pe.is_fork)||t.deps===null)&&(Pe!==null?(Pe.capture(t,e,!0),po==null||po.capture(t,e,!0)):t.v=e,t.deps===null))){Pt(t,tn);return}vs||(cn!==null?(Yf()||Pe!=null&&Pe.is_fork)&&cn.set(t,e):Ff(t))}function kE(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(Pl),r.fn!==null&&(r.teardown=Pf),r.ac=null,Oo(r,0),zf(r))}function G1(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Oi(e)}let dl=new Set;const Ta=new Map;let K1=!1;function Oa(t,e){var n={f:0,v:t,reactions:null,equals:D1,rv:0,wv:0};return n}function Z(t,e){const n=Oa(t);return lm(n),n}function PE(t,e=!1,n=!0){var s;const r=Oa(t);return e||(r.equals=k1),qi&&n&&Et!==null&&Et.l!==null&&((s=Et.l).s??(s.s=[])).push(r),r}function y(t,e,n=!1){Ze!==null&&(!wr||(Ze.f&ul)!==0)&&ji()&&(Ze.f&(hn|Sr|ci|ul))!==0&&(dr===null||!Ea.call(dr,t))&&Gv();let r=n?lt(e):e;return Ii(t,r,Ku)}function Ii(t,e,n=null){if(!t.equals(e)){Ta.set(t,vs?e:t.v);var r=La.ensure();if(r.capture(t,e),(t.f&hn)!==0){const s=t;(t.f&on)!==0&&jf(s),cn===null&&Ff(s)}t.wv=dm(),V1(t,on,n),ji()&&Xe!==null&&(Xe.f&tn)!==0&&(Xe.f&(Or|Ws))===0&&(Jn===null?WE([t]):Jn.push(t)),!r.is_fork&&dl.size>0&&!K1&&ME()}return e}function ME(){K1=!1;for(const t of dl){(t.f&tn)!==0&&Pt(t,Jr);let e;try{e=ru(t)}catch{e=!0}e&&Oi(t)}dl.clear()}function go(t){y(t,t.v+1)}function V1(t,e,n){var r=t.reactions;if(r!==null)for(var s=ji(),a=r.length,i=0;i<a;i++){var o=r[i],u=o.f;if(!(!s&&o===Xe)){var d=(u&on)===0;if(d&&Pt(o,e),(u&ul)!==0)dl.add(o);else if((u&hn)!==0){var h=o;cn==null||cn.delete(h),(u&Ca)===0&&(u&lr&&(Xe===null||(Xe.f&ll)===0)&&(o.f|=Ca),V1(h,Jr,n))}else if(d){var g=o;(u&Sr)!==0&&vr!==null&&vr.add(g),n!==null?n.push(g):Hf(g)}}}}function lt(t){if(typeof t!="object"||t===null||Kr in t)return t;const e=kf(t);if(e!==Rv&&e!==Dv)return t;var n=new Map,r=Df(t),s=Z(0),a=Aa,i=o=>{if(Aa===a)return o();var u=Ze,d=Aa;fr(null),i0(a);var h=o();return fr(u),i0(d),h};return r&&n.set("length",Z(t.length)),new Proxy(t,{defineProperty(o,u,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&zv();var h=n.get(u);return h===void 0?i(()=>{var g=Z(d.value);return n.set(u,g),g}):y(h,d.value,!0),!0},deleteProperty(o,u){var d=n.get(u);if(d===void 0){if(u in o){const h=i(()=>Z(Kt));n.set(u,h),go(s)}}else y(d,Kt),go(s);return!0},get(o,u,d){var m;if(u===Kr)return t;var h=n.get(u),g=u in o;if(h===void 0&&(!g||(m=qs(o,u))!=null&&m.writable)&&(h=i(()=>{var b=lt(g?o[u]:Kt),_=Z(b);return _}),n.set(u,h)),h!==void 0){var f=l(h);return f===Kt?void 0:f}return Reflect.get(o,u,d)},getOwnPropertyDescriptor(o,u){var d=Reflect.getOwnPropertyDescriptor(o,u);if(d&&"value"in d){var h=n.get(u);h&&(d.value=l(h))}else if(d===void 0){var g=n.get(u),f=g==null?void 0:g.v;if(g!==void 0&&f!==Kt)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return d},has(o,u){var f;if(u===Kr)return!0;var d=n.get(u),h=d!==void 0&&d.v!==Kt||Reflect.has(o,u);if(d!==void 0||Xe!==null&&(!h||(f=qs(o,u))!=null&&f.writable)){d===void 0&&(d=i(()=>{var m=h?lt(o[u]):Kt,b=Z(m);return b}),n.set(u,d));var g=l(d);if(g===Kt)return!1}return h},set(o,u,d,h){var I;var g=n.get(u),f=u in o;if(r&&u==="length")for(var m=d;m<g.v;m+=1){var b=n.get(m+"");b!==void 0?y(b,Kt):m in o&&(b=i(()=>Z(Kt)),n.set(m+"",b))}if(g===void 0)(!f||(I=qs(o,u))!=null&&I.writable)&&(g=i(()=>Z(void 0)),y(g,lt(d)),n.set(u,g));else{f=g.v!==Kt;var _=i(()=>lt(d));y(g,_)}var A=Reflect.getOwnPropertyDescriptor(o,u);if(A!=null&&A.set&&A.set.call(h,d),!f){if(r&&typeof u=="string"){var E=n.get("length"),C=Number(u);Number.isInteger(C)&&C>=E.v&&y(E,C+1)}go(s)}return!0},ownKeys(o){l(s);var u=Reflect.ownKeys(o).filter(g=>{var f=n.get(g);return f===void 0||f.v!==Kt});for(var[d,h]of n)h.v!==Kt&&!(d in o)&&u.push(d);return u},setPrototypeOf(){Wv()}})}function n0(t){try{if(t!==null&&typeof t=="object"&&Kr in t)return t[Kr]}catch{}return t}function X1(t,e){return Object.is(n0(t),n0(e))}var r0,Q1,Z1,J1;function BE(){if(r0===void 0){r0=window,Q1=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Z1=qs(e,"firstChild").get,J1=qs(e,"nextSibling").get,Jh(t)&&(t[od]=void 0,t[Wu]=null,t[ud]=void 0,t.__e=void 0),Jh(n)&&(n[io]=void 0)}}function Vr(t=""){return document.createTextNode(t)}function Ci(t){return Z1.call(t)}function eu(t){return J1.call(t)}function S(t,e){return Ci(t)}function nt(t,e=!1){{var n=Ci(t);return n instanceof Comment&&n.data===""?eu(n):n}}function x(t,e=1,n=!1){let r=t;for(;e--;)r=eu(r);return r}function FE(t){t.textContent=""}function em(){return!1}function tm(t,e,n){return document.createElementNS(e??R1,t,void 0)}function Li(t,e){if(e){const n=document.body;t.autofocus=!0,Cr(()=>{document.activeElement===n&&t.focus()})}}let s0=!1;function UE(){s0||(s0=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[Gu])==null||e.call(n)})},{capture:!0}))}function Ml(t){var e=Ze,n=Xe;fr(null),es(null);try{return t()}finally{fr(e),es(n)}}function $f(t,e,n,r=n){t.addEventListener(e,()=>Ml(n));const s=t[Gu];s?t[Gu]=()=>{s(),r(!0)}:t[Gu]=()=>r(!0),UE()}function nm(t){Xe===null&&(Ze===null&&jv(),qv()),vs&&Hv()}function HE(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Rr(t,e){var n=Xe;n!==null&&(n.f&xn)!==0&&(t|=xn);var r={ctx:Et,deps:null,nodes:null,f:t|on|lr,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&Ni)!==0)oi!==null?oi.push(r):La.ensure().schedule(r);else if(e!==null){try{Oi(r)}catch(i){throw dn(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Hi)===0&&(s=s.first,(t&Sr)!==0&&(t&bs)!==0&&s!==null&&(s.f|=bs))}if(s!==null&&(s.parent=n,n!==null&&HE(s,n),Ze!==null&&(Ze.f&hn)!==0&&(t&Ws)===0)){var a=Ze;(a.effects??(a.effects=[])).push(s)}return r}function Yf(){return Ze!==null&&!wr}function tu(t){const e=Rr(Jo,null);return Pt(e,tn),e.teardown=t,e}function Dt(t){nm();var e=Xe.f,n=!Ze&&(e&Or)!==0&&(e&Ma)===0;if(n){var r=Et;(r.e??(r.e=[])).push(t)}else return rm(t)}function rm(t){return Rr(Ni|C1,t)}function qE(t){return nm(),Rr(Jo|C1,t)}function jE(t){La.ensure();const e=Rr(Ws|Hi,t);return(n={})=>new Promise(r=>{n.outro?_a(e,()=>{dn(e),r(void 0)}):(dn(e),r(void 0))})}function nu(t){return Rr(Ni,t)}function $E(t){return Rr(ci|Hi,t)}function Bl(t,e=0){return Rr(Jo|e,t)}function se(t,e=[],n=[],r=[]){Y1(r,e,n,s=>{Rr(Jo,()=>t(...s.map(l)))})}function Ba(t,e=0){var n=Rr(Sr|e,t);return n}function sm(t,e=0){var n=Rr(Mf|e,t);return n}function Fn(t){return Rr(Or|Hi,t)}function am(t){var e=t.teardown;if(e!==null){const n=vs,r=Ze;a0(!0),fr(null);try{e.call(null)}finally{a0(n),fr(r)}}}function zf(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Ml(()=>{s.abort(Pl)});var r=n.next;(n.f&Ws)!==0?n.parent=null:dn(n,e),n=r}}function YE(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Or)===0&&dn(e),e=n}}function dn(t,e=!0){var n=!1;(e||(t.f&Mv)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(zE(t.nodes.start,t.nodes.end),n=!0),Pt(t,id),zf(t,e&&!n),Oo(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();am(t),t.f^=id,t.f|=cr;var s=t.parent;s!==null&&s.first!==null&&im(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function zE(t,e){for(;t!==null;){var n=t===e?null:eu(t);t.remove(),t=n}}function im(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 _a(t,e,n=!0){var r=[];om(t,r,!0);var s=()=>{n&&dn(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var o of r)o.out(i)}else s()}function om(t,e,n){if((t.f&xn)===0){t.f^=xn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var a=s.next;if((s.f&Ws)===0){var i=(s.f&bs)!==0||(s.f&Or)!==0&&(t.f&Sr)!==0;om(s,e,i?n:!1)}s=a}}}function Wf(t){um(t,!0)}function um(t,e){if((t.f&xn)!==0){t.f^=xn,(t.f&tn)===0&&(Pt(t,on),La.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&bs)!==0||(n.f&Or)!==0;um(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 Gf(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:eu(n);e.append(n),n=s}}let Zu=!1,vs=!1;function a0(t){vs=t}let Ze=null,wr=!1;function fr(t){Ze=t}let Xe=null;function es(t){Xe=t}let dr=null;function lm(t){Ze!==null&&(dr===null?dr=[t]:dr.push(t))}let Bn=null,$n=0,Jn=null;function WE(t){Jn=t}let cm=1,ca=0,Aa=ca;function i0(t){Aa=t}function dm(){return++cm}function ru(t){var e=t.f;if((e&on)!==0)return!0;if(e&hn&&(t.f&=~Ca),(e&Jr)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(ru(a)&&W1(a),a.wv>t.wv)return!0}(e&lr)!==0&&cn===null&&Pt(t,tn)}return!1}function fm(t,e,n=!0){var r=t.reactions;if(r!==null&&!(dr!==null&&Ea.call(dr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&hn)!==0?fm(a,e,!1):e===a&&(n?Pt(a,on):(a.f&tn)!==0&&Pt(a,Jr),Hf(a))}}function hm(t){var _;var e=Bn,n=$n,r=Jn,s=Ze,a=dr,i=Et,o=wr,u=Aa,d=t.f;Bn=null,$n=0,Jn=null,Ze=(d&(Or|Ws))===0?t:null,dr=null,Si(t.ctx),wr=!1,Aa=++ca,t.ac!==null&&(Ml(()=>{t.ac.abort(Pl)}),t.ac=null);try{t.f|=ll;var h=t.fn,g=h();t.f|=Ma;var f=t.deps,m=Pe==null?void 0:Pe.is_fork;if(Bn!==null){var b;if(m||Oo(t,$n),f!==null&&$n>0)for(f.length=$n+Bn.length,b=0;b<Bn.length;b++)f[$n+b]=Bn[b];else t.deps=f=Bn;if(Yf()&&(t.f&lr)!==0)for(b=$n;b<f.length;b++)((_=f[b]).reactions??(_.reactions=[])).push(t)}else!m&&f!==null&&$n<f.length&&(Oo(t,$n),f.length=$n);if(ji()&&Jn!==null&&!wr&&f!==null&&(t.f&(hn|Jr|on))===0)for(b=0;b<Jn.length;b++)fm(Jn[b],t);if(s!==null&&s!==t){if(ca++,s.deps!==null)for(let A=0;A<n;A+=1)s.deps[A].rv=ca;if(e!==null)for(const A of e)A.rv=ca;Jn!==null&&(r===null?r=Jn:r.push(...Jn))}return(t.f&js)!==0&&(t.f^=js),g}catch(A){return M1(A)}finally{t.f^=ll,Bn=e,$n=n,Jn=r,Ze=s,dr=a,Si(i),wr=o,Aa=u}}function GE(t,e){let n=e.reactions;if(n!==null){var r=Ov.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&hn)!==0&&(Bn===null||!Ea.call(Bn,e))){var a=e;(a.f&lr)!==0&&(a.f^=lr,a.f&=~Ca),a.v!==Kt&&Ff(a),kE(a),Oo(a,0)}}function Oo(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)GE(t,n[r])}function Oi(t){var e=t.f;if((e&cr)===0){Pt(t,tn);var n=Xe,r=Zu;Xe=t,Zu=!0;try{(e&(Sr|Mf))!==0?YE(t):zf(t),am(t);var s=hm(t);t.teardown=typeof s=="function"?s:null,t.wv=cm;var a;S1&&fE&&(t.f&on)!==0&&t.deps}finally{Zu=r,Xe=n}}}async function pm(){await Promise.resolve(),AE()}function l(t){var e=t.f,n=(e&hn)!==0;if(Ze!==null&&!wr){var r=Xe!==null&&(Xe.f&cr)!==0;if(!r&&(dr===null||!Ea.call(dr,t))){var s=Ze.deps;if((Ze.f&ll)!==0)t.rv<ca&&(t.rv=ca,Bn===null&&s!==null&&s[$n]===t?$n++:Bn===null?Bn=[t]:Bn.push(t));else{Ze.deps??(Ze.deps=[]),Ea.call(Ze.deps,t)||Ze.deps.push(t);var a=t.reactions;a===null?t.reactions=[Ze]:Ea.call(a,Ze)||a.push(Ze)}}}if(vs&&Ta.has(t))return Ta.get(t);if(n){var i=t;if(vs){var o=i.v;return((i.f&tn)===0&&i.reactions!==null||gm(i))&&(o=jf(i)),Ta.set(i,o),o}var u=(i.f&lr)===0&&!wr&&Ze!==null&&(Zu||(Ze.f&lr)!==0),d=(i.f&Ma)===0;ru(i)&&(u&&(i.f|=lr),W1(i)),u&&!d&&(G1(i),mm(i))}if(cn!=null&&cn.has(t))return cn.get(t);if((t.f&js)!==0)throw t.v;return t.v}function mm(t){if(t.f|=lr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&hn)!==0&&(e.f&lr)===0&&(G1(e),mm(e))}function gm(t){if(t.v===Kt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Ta.has(e)||(e.f&hn)!==0&&gm(e))return!0;return!1}function Fa(t){var e=wr;try{return wr=!0,t()}finally{wr=e}}function KE(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Kr in t)gd(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Kr in n&&gd(n)}}}function gd(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{gd(t[r],e)}catch{}const n=kf(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=w1(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function VE(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const XE=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function QE(t){return XE.includes(t)}const ZE={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 JE(t){return t=t.toLowerCase(),ZE[t]??t}const eT=["touchstart","touchmove"];function tT(t){return eT.includes(t)}const da=Symbol("events"),bm=new Set,bd=new Set;function vm(t,e,n,r={}){function s(a){if(r.capture||vd.call(e,a),!a.cancelBubble)return Ml(()=>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=vm(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&tu(()=>{e.removeEventListener(t,i,a)})}function ae(t,e,n){(e[da]??(e[da]={}))[t]=n}function bt(t){for(var e=0;e<t.length;e++)bm.add(t[e]);for(var n of bd)n(t)}let o0=null;function vd(t){var A,E;var e=this,n=e.ownerDocument,r=t.type,s=((A=t.composedPath)==null?void 0:A.call(t))||[],a=s[0]||t.target;o0=t;var i=0,o=o0===t&&t[da];if(o){var u=s.indexOf(o);if(u!==-1&&(e===document||e===window)){t[da]=e;return}var d=s.indexOf(e);if(d===-1)return;u<=d&&(i=u)}if(a=s[i]||t.target,a!==e){xv(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=Ze,g=Xe;fr(null),es(null);try{for(var f,m=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var _=(E=a[da])==null?void 0:E[r];_!=null&&(!a.disabled||t.target===a)&&_.call(a,t)}catch(C){f?m.push(C):f=C}if(t.cancelBubble||b===e||b===null)break;a=b}if(f){for(let C of m)queueMicrotask(()=>{throw C});throw f}}finally{t[da]=e,delete t.currentTarget,fr(h),es(g)}}}var y1;const Nc=((y1=globalThis==null?void 0:globalThis.window)==null?void 0:y1.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function nT(t){return(Nc==null?void 0:Nc.createHTML(t))??t}function Em(t){var e=tm("template");return e.innerHTML=nT(t.replaceAll("<!>","<!---->")),e.content}function xi(t,e){var n=Xe;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function z(t,e){var n=(e&sE)!==0,r=(e&aE)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=Em(a?t:"<!>"+t),n||(s=Ci(s)));var i=r||Q1?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=Ci(i),u=i.lastChild;xi(o,u)}else xi(i,i);return i}}function rT(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=Em(s),o=Ci(i);a=Ci(o)}var u=a.cloneNode(!0);return xi(u,u),u}}function sT(t,e){return rT(t,e,"svg")}function fl(t=""){{var e=Vr(t+"");return xi(e,e),e}}function Gn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Vr();return t.append(e,n),xi(e,n),t}function q(t,e){t!==null&&t.before(e)}function oe(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[io]??(t[io]=t.nodeValue))&&(t[io]=n,t.nodeValue=`${n}`)}function aT(t,e){return iT(t,e)}const wu=new Map;function iT(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:o}){BE();var u=void 0,d=jE(()=>{var h=n??e.appendChild(Vr());wE(h,{pending:()=>{}},m=>{ct({});var b=Et;a&&(b.c=a),s&&(r.$$events=s),u=t(m,r)||{},dt()},o);var g=new Set,f=m=>{for(var b=0;b<m.length;b++){var _=m[b];if(!g.has(_)){g.add(_);var A=tT(_);for(const I of[e,document]){var E=wu.get(I);E===void 0&&(E=new Map,wu.set(I,E));var C=E.get(_);C===void 0?(I.addEventListener(_,vd,{passive:A}),E.set(_,1)):E.set(_,C+1)}}}};return f(kl(bm)),bd.add(f),()=>{var A;for(var m of g)for(const E of[e,document]){var b=wu.get(E),_=b.get(m);--_==0?(E.removeEventListener(m,vd),b.delete(m),b.size===0&&wu.delete(E)):b.set(m,_)}bd.delete(f),h!==n&&((A=h.parentNode)==null||A.removeChild(h))}});return oT.set(u,d),u}let oT=new WeakMap;var _r,zr,Wn,va,Xo,Qo,xl;class su{constructor(e,n=!0){_e(this,"anchor");qe(this,_r,new Map);qe(this,zr,new Map);qe(this,Wn,new Map);qe(this,va,new Set);qe(this,Xo,!0);qe(this,Qo,e=>{if(V(this,_r).has(e)){var n=V(this,_r).get(e),r=V(this,zr).get(n);if(r)Wf(r),V(this,va).delete(n);else{var s=V(this,Wn).get(n);s&&(V(this,zr).set(n,s.effect),V(this,Wn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of V(this,_r)){if(V(this,_r).delete(a),a===e)break;const o=V(this,Wn).get(i);o&&(dn(o.effect),V(this,Wn).delete(i))}for(const[a,i]of V(this,zr)){if(a===n||V(this,va).has(a))continue;const o=()=>{if(Array.from(V(this,_r).values()).includes(a)){var d=document.createDocumentFragment();Gf(i,d),d.append(Vr()),V(this,Wn).set(a,{effect:i,fragment:d})}else dn(i);V(this,va).delete(a),V(this,zr).delete(a)};V(this,Xo)||!r?(V(this,va).add(a),_a(i,o,!1)):o()}}});qe(this,xl,e=>{V(this,_r).delete(e);const n=Array.from(V(this,_r).values());for(const[r,s]of V(this,Wn))n.includes(r)||(dn(s.effect),V(this,Wn).delete(r))});this.anchor=e,je(this,Xo,n)}ensure(e,n){var r=Pe,s=em();if(n&&!V(this,zr).has(e)&&!V(this,Wn).has(e))if(s){var a=document.createDocumentFragment(),i=Vr();a.append(i),V(this,Wn).set(e,{effect:Fn(()=>n(i)),fragment:a})}else V(this,zr).set(e,Fn(()=>n(this.anchor)));if(V(this,_r).set(r,e),s){for(const[o,u]of V(this,zr))o===e?r.unskip_effect(u):r.skip_effect(u);for(const[o,u]of V(this,Wn))o===e?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(V(this,Qo)),r.ondiscard(V(this,xl))}else V(this,Qo).call(this,r)}}_r=new WeakMap,zr=new WeakMap,Wn=new WeakMap,va=new WeakMap,Xo=new WeakMap,Qo=new WeakMap,xl=new WeakMap;function de(t,e,n=!1){var r=new su(t),s=n?bs:0;function a(i,o){r.ensure(i,o)}Ba(()=>{var i=!1;e((o,u=0)=>{i=!0,a(u,o)}),i||a(-1,null)},s)}const uT=Symbol("NaN");function lT(t,e,n){var r=new su(t),s=!ji();Ba(()=>{var a=e();a!==a&&(a=uT),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function xo(t,e){return e}function cT(t,e,n){for(var r=[],s=e.length,a,i=e.length,o=0;o<s;o++){let g=e[o];_a(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var f=t.outrogroups;Ed(t,kl(a.done)),f.delete(a),f.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var u=r.length===0&&n!==null;if(u){var d=n,h=d.parentNode;FE(h),h.append(d),t.items.clear()}Ed(t,e,!u)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function Ed(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const o of i)r.add(t.items.get(o).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Gr;const i=document.createDocumentFragment();Gf(a,i)}else dn(e[s],n)}}var u0;function It(t,e,n,r,s,a=null){var i=t,o=new Map,u=(e&x1)!==0;if(u){var d=t;i=d.appendChild(Vr())}var h=null,g=qf(()=>{var I=n();return Df(I)?I:I==null?[]:kl(I)}),f,m=new Map,b=!0;function _(I){(C.effect.f&cr)===0&&(C.pending.delete(I),C.fallback=h,dT(C,f,i,e,r),h!==null&&(f.length===0?(h.f&Gr)===0?Wf(h):(h.f^=Gr,uo(h,null,i)):_a(h,()=>{h=null})))}function A(I){C.pending.delete(I)}var E=Ba(()=>{f=l(g);for(var I=f.length,H=new Set,B=Pe,J=em(),F=0;F<I;F+=1){var Y=f[F],X=r(Y,F),te=b?null:o.get(X);te?(te.v&&Ii(te.v,Y),te.i&&Ii(te.i,F),J&&B.unskip_effect(te.e)):(te=fT(o,b?i:u0??(u0=Vr()),Y,X,F,s,e,n),b||(te.e.f|=Gr),o.set(X,te)),H.add(X)}if(I===0&&a&&!h&&(b?h=Fn(()=>a(i)):(h=Fn(()=>a(u0??(u0=Vr()))),h.f|=Gr)),I>H.size&&Uv(),!b)if(m.set(B,H),J){for(const[T,D]of o)H.has(T)||B.skip_effect(D.e);B.oncommit(_),B.ondiscard(A)}else _(B);l(g)}),C={effect:E,items:o,pending:m,outrogroups:null,fallback:h};b=!1}function Zi(t){for(;t!==null&&(t.f&Or)===0;)t=t.next;return t}function dT(t,e,n,r,s){var te,T,D,v,R,k,O,W,j;var a=(r&Qv)!==0,i=e.length,o=t.items,u=Zi(t.effect.first),d,h=null,g,f=[],m=[],b,_,A,E;if(a)for(E=0;E<i;E+=1)b=e[E],_=s(b,E),A=o.get(_).e,(A.f&Gr)===0&&((T=(te=A.nodes)==null?void 0:te.a)==null||T.measure(),(g??(g=new Set)).add(A));for(E=0;E<i;E+=1){if(b=e[E],_=s(b,E),A=o.get(_).e,t.outrogroups!==null)for(const M of t.outrogroups)M.pending.delete(A),M.done.delete(A);if((A.f&xn)!==0&&(Wf(A),a&&((v=(D=A.nodes)==null?void 0:D.a)==null||v.unfix(),(g??(g=new Set)).delete(A))),(A.f&Gr)!==0)if(A.f^=Gr,A===u)uo(A,null,n);else{var C=h?h.next:u;A===t.effect.last&&(t.effect.last=A.prev),A.prev&&(A.prev.next=A.next),A.next&&(A.next.prev=A.prev),ws(t,h,A),ws(t,A,C),uo(A,C,n),h=A,f=[],m=[],u=Zi(h.next);continue}if(A!==u){if(d!==void 0&&d.has(A)){if(f.length<m.length){var I=m[0],H;h=I.prev;var B=f[0],J=f[f.length-1];for(H=0;H<f.length;H+=1)uo(f[H],I,n);for(H=0;H<m.length;H+=1)d.delete(m[H]);ws(t,B.prev,J.next),ws(t,h,B),ws(t,J,I),u=I,h=J,E-=1,f=[],m=[]}else d.delete(A),uo(A,u,n),ws(t,A.prev,A.next),ws(t,A,h===null?t.effect.first:h.next),ws(t,h,A),h=A;continue}for(f=[],m=[];u!==null&&u!==A;)(d??(d=new Set)).add(u),m.push(u),u=Zi(u.next);if(u===null)continue}(A.f&Gr)===0&&f.push(A),h=A,u=Zi(A.next)}if(t.outrogroups!==null){for(const M of t.outrogroups)M.pending.size===0&&(Ed(t,kl(M.done)),(R=t.outrogroups)==null||R.delete(M));t.outrogroups.size===0&&(t.outrogroups=null)}if(u!==null||d!==void 0){var F=[];if(d!==void 0)for(A of d)(A.f&xn)===0&&F.push(A);for(;u!==null;)(u.f&xn)===0&&u!==t.fallback&&F.push(u),u=Zi(u.next);var Y=F.length;if(Y>0){var X=(r&x1)!==0&&i===0?n:null;if(a){for(E=0;E<Y;E+=1)(O=(k=F[E].nodes)==null?void 0:k.a)==null||O.measure();for(E=0;E<Y;E+=1)(j=(W=F[E].nodes)==null?void 0:W.a)==null||j.fix()}cT(t,F,X)}}a&&Cr(()=>{var M,$;if(g!==void 0)for(A of g)($=(M=A.nodes)==null?void 0:M.a)==null||$.apply()})}function fT(t,e,n,r,s,a,i,o){var u=(i&Vv)!==0?(i&Zv)===0?PE(n,!1,!1):Oa(n):null,d=(i&Xv)!==0?Oa(s):null;return{v:u,i:d,e:Fn(()=>(a(e,u??n,d??s,o),()=>{t.delete(r)}))}}function uo(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Gr)===0?e.nodes.start:n;r!==null;){var i=eu(r);if(a.before(r),r===s)return;r=i}}function ws(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function hT(t,e,...n){var r=new su(t);Ba(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},bs)}function l0(t,e,n){var r=new su(t);Ba(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},bs)}function pT(t,e,n,r,s,a){var i=null,o=t,u=new su(o,!1);Ba(()=>{const d=e()||null;var h=iE;if(d===null){u.ensure(null,null);return}return u.ensure(d,g=>{if(d){if(i=tm(d,h),xi(i,i),r){var f=i.appendChild(Vr());r(i,f)}Xe.nodes.end=i,g.before(i)}}),()=>{}},bs),tu(()=>{})}function mT(t,e){var n=void 0,r;sm(()=>{n!==(n=e())&&(r&&(dn(r),r=null),n&&(r=Fn(()=>{nu(()=>n(t))})))})}function Tm(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=Tm(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function gT(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Tm(t))&&(r&&(r+=" "),r+=e);return r}function _m(t){return typeof t=="object"?gT(t):t??""}const c0=[...`
3
+ \r\f \v\uFEFF`];function bT(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,i=0;(i=r.indexOf(s,i))>=0;){var o=i+a;(i===0||c0.includes(r[i-1]))&&(o===r.length||c0.includes(r[o]))?r=(i===0?"":r.substring(0,i))+r.substring(o+1):i=o}}return r===""?null:r}function d0(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 Sc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function vT(t,e){if(e){var n="",r,s;if(Array.isArray(e)?(r=e[0],s=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,u=[];r&&u.push(...Object.keys(r).map(Sc)),s&&u.push(...Object.keys(s).map(Sc));var d=0,h=-1;const _=t.length;for(var g=0;g<_;g++){var f=t[g];if(o?f==="/"&&t[g-1]==="*"&&(o=!1):a?a===f&&(a=!1):f==="/"&&t[g+1]==="*"?o=!0:f==='"'||f==="'"?a=f:f==="("?i++:f===")"&&i--,!o&&a===!1&&i===0){if(f===":"&&h===-1)h=g;else if(f===";"||g===_-1){if(h!==-1){var m=Sc(t.substring(d,h).trim());if(!u.includes(m)){f!==";"&&g++;var b=t.substring(d,g).trim();n+=" "+b+";"}}d=g+1,h=-1}}}}return r&&(n+=d0(r)),s&&(n+=d0(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Je(t,e,n,r,s,a){var i=t[od];if(i!==n||i===void 0){var o=bT(n,r,a);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t[od]=n}else if(a&&s!==a)for(var u in a){var d=!!a[u];(s==null||d!==!!s[u])&&t.classList.toggle(u,d)}return a}function wc(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 Am(t,e,n,r){var s=t[ud];if(s!==e){var a=vT(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[ud]=e}else r&&(Array.isArray(r)?(wc(t,n==null?void 0:n[0],r[0]),wc(t,n==null?void 0:n[1],r[1],"important")):wc(t,n,r));return r}function hl(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Df(e))return lE();for(var r of t.options)r.selected=e.includes(bo(r));return}for(r of t.options){var s=bo(r);if(X1(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function ym(t){var e=new MutationObserver(()=>{hl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),tu(()=>{e.disconnect()})}function xa(t,e,n=e){var r=new WeakSet,s=!0;$f(t,"change",a=>{var i=a?"[selected]":":checked",o;if(t.multiple)o=[].map.call(t.querySelectorAll(i),bo);else{var u=t.querySelector(i)??t.querySelector("option:not([disabled])");o=u&&bo(u)}n(o),t.__value=o,Pe!==null&&r.add(Pe)}),nu(()=>{var a=e();if(t===document.activeElement){var i=Pe;if(r.has(i))return}if(hl(t,a,s),s&&a===void 0){var o=t.querySelector(":checked");o!==null&&(a=bo(o),n(a))}t.__value=a,s=!1}),ym(t)}function bo(t){return"__value"in t?t.__value:t.value}const Ji=Symbol("class"),eo=Symbol("style"),Nm=Symbol("is custom element"),Sm=Symbol("is html"),ET=Bf?"option":"OPTION",TT=Bf?"select":"SELECT",_T=Bf?"progress":"PROGRESS";function AT(t,e){var n=Fl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==_T)||(t.value=e??"")}function yT(t,e){var n=Fl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function NT(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ve(t,e,n,r){var s=Fl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[Bv]=n),n==null?t.removeAttribute(e):typeof n!="string"&&wm(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function ST(t,e,n,r,s=!1,a=!1){var i=Fl(t),o=i[Nm],u=!i[Sm],d=e||{},h=t.nodeName===ET;for(var g in e)g in n||(n[g]=null);n.class?n.class=_m(n.class):n[Ji]&&(n.class=null),n[eo]&&(n.style??(n.style=null));var f=wm(t);for(const I in n){let H=n[I];if(h&&I==="value"&&H==null){t.value=t.__value="",d[I]=H;continue}if(I==="class"){var m=t.namespaceURI==="http://www.w3.org/1999/xhtml";Je(t,m,H,r,e==null?void 0:e[Ji],n[Ji]),d[I]=H,d[Ji]=n[Ji];continue}if(I==="style"){Am(t,H,e==null?void 0:e[eo],n[eo]),d[I]=H,d[eo]=n[eo];continue}var b=d[I];if(!(H===b&&!(H===void 0&&t.hasAttribute(I)))){d[I]=H;var _=I[0]+I[1];if(_!=="$$")if(_==="on"){const B={},J="$$"+I;let F=I.slice(2);var A=QE(F);if(VE(F)&&(F=F.slice(0,-7),B.capture=!0),!A&&b){if(H!=null)continue;t.removeEventListener(F,d[J],B),d[J]=null}if(A)ae(F,t,H),bt([F]);else if(H!=null){let Y=function(X){d[I].call(this,X)};d[J]=vm(F,t,Y,B)}}else if(I==="style")ve(t,I,H);else if(I==="autofocus")Li(t,!!H);else if(!o&&(I==="__value"||I==="value"&&H!=null))t.value=t.__value=H;else if(I==="selected"&&h)NT(t,H);else{var E=I;u||(E=JE(E));var C=E==="defaultValue"||E==="defaultChecked";if(H==null&&!o&&!C)if(i[I]=null,E==="value"||E==="checked"){let B=t;const J=e===void 0;if(E==="value"){let F=B.defaultValue;B.removeAttribute(E),B.defaultValue=F,B.value=B.__value=J?F:null}else{let F=B.defaultChecked;B.removeAttribute(E),B.defaultChecked=F,B.checked=J?F:!1}}else t.removeAttribute(I);else C||f.includes(E)&&(o||typeof H!="string")?(t[E]=H,E in i&&(i[E]=Kt)):typeof H!="function"&&ve(t,E,H)}}}return d}function f0(t,e,n=[],r=[],s=[],a,i=!1,o=!1){Y1(s,n,r,u=>{var d=void 0,h={},g=t.nodeName===TT,f=!1;if(sm(()=>{var b=e(...u.map(l)),_=ST(t,d,b,a,i,o);f&&g&&"value"in b&&hl(t,b.value);for(let E of Object.getOwnPropertySymbols(h))b[E]||dn(h[E]);for(let E of Object.getOwnPropertySymbols(b)){var A=b[E];E.description===oE&&(!d||A!==d[E])&&(h[E]&&dn(h[E]),h[E]=Fn(()=>mT(t,()=>A))),_[E]=A}d=_}),g){var m=t;nu(()=>{hl(m,d.value,!0),ym(m)})}f=!0})}function Fl(t){return t[Wu]??(t[Wu]={[Nm]:t.nodeName.includes("-"),[Sm]:t.namespaceURI===R1})}var h0=new Map;function wm(t){var e=t.getAttribute("is")||t.nodeName,n=h0.get(e);if(n)return n;h0.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=w1(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=kf(s)}return n}function vt(t,e,n=e){var r=new WeakSet;$f(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=Cc(t)?Lc(a):a,n(a),Pe!==null&&r.add(Pe),await pm(),a!==(a=e())){var i=t.selectionStart,o=t.selectionEnd,u=t.value.length;if(t.value=a??"",o!==null){var d=t.value.length;i===o&&o===u&&d>u?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=i,t.selectionEnd=Math.min(o,d))}}}),Fa(e)==null&&t.value&&(n(Cc(t)?Lc(t.value):t.value),Pe!==null&&r.add(Pe)),Bl(()=>{var s=e();if(t===document.activeElement){var a=Pe;if(r.has(a))return}Cc(t)&&s===Lc(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const Ic=new Set;function wT(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var o of e)i=i[o]??(i[o]=[]);i.push(n),$f(n,"change",()=>{var u=n.__value;a&&(u=IT(i,u,n.checked)),s(u)},()=>s(a?[]:null)),Bl(()=>{var u=r();a?(u=u||[],n.checked=u.includes(n.__value)):n.checked=X1(n.__value,u)}),tu(()=>{var u=i.indexOf(n);u!==-1&&i.splice(u,1)}),Ic.has(i)||(Ic.add(i),Cr(()=>{i.sort((u,d)=>u.compareDocumentPosition(d)===4?-1:1),Ic.delete(i)})),Cr(()=>{})}function IT(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 Cc(t){var e=t.type;return e==="number"||e==="range"}function Lc(t){return t===""?null:+t}var ks,yi,Zo,Rl,Im;const Dl=class Dl{constructor(e){qe(this,Rl);qe(this,ks,new WeakMap);qe(this,yi);qe(this,Zo);je(this,Zo,e)}observe(e,n){var r=V(this,ks).get(e)||new Set;return r.add(n),V(this,ks).set(e,r),tt(this,Rl,Im).call(this).observe(e,V(this,Zo)),()=>{var s=V(this,ks).get(e);s.delete(n),s.size===0&&(V(this,ks).delete(e),V(this,yi).unobserve(e))}}};ks=new WeakMap,yi=new WeakMap,Zo=new WeakMap,Rl=new WeakSet,Im=function(){return V(this,yi)??je(this,yi,new ResizeObserver(e=>{for(var n of e){Dl.entries.set(n.target,n);for(var r of V(this,ks).get(n.target)||[])r(n)}}))},_e(Dl,"entries",new WeakMap);let Td=Dl;var CT=new Td({box:"border-box"});function LT(t,e,n){var r=CT.observe(t,()=>n(t[e]));nu(()=>(Fa(()=>n(t[e])),r))}function Oc(t,e){return t===e||(t==null?void 0:t[Kr])===e}function pn(t={},e,n,r){var s=Et.r,a=Xe;return nu(()=>{var i,o;return Bl(()=>{i=o,o=[],Fa(()=>{Oc(n(...o),t)||(e(t,...o),i&&Oc(n(...i),t)&&e(null,...i))})}),()=>{let u=a;for(;u!==s&&u.parent!==null&&u.parent.f&id;)u=u.parent;const d=()=>{o&&Oc(n(...o),t)&&e(null,...o)},h=u.teardown;u.teardown=()=>{d(),h==null||h()}}}),t}function Cm(t=!1){const e=Et,n=e.l.u;if(!n)return;let r=()=>KE(e.s);if(t){let s=0,a={};const i=wi(()=>{let o=!1;const u=e.s;for(const d in u)u[d]!==a[d]&&(a[d]=u[d],o=!0);return o&&s++,s});r=()=>l(i)}n.b.length&&qE(()=>{p0(e,r),sd(n.b)}),Dt(()=>{const s=Fa(()=>n.m.map(kv));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&Dt(()=>{p0(e,r),sd(n.a)})}function p0(t,e){if(t.l.s)for(const n of t.l.s)l(n);e()}const OT={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 hr(t,e,n){return new Proxy({props:t,exclude:e},OT)}const xT={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(Qi(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];Qi(s)&&(s=s());const a=qs(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(Qi(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=qs(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Kr||e===L1)return!1;for(let n of t.props)if(Qi(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(Qi(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 Dr(...t){return new Proxy({props:t},xT)}function ir(t,e,n,r){var H;var s=!qi||(n&eE)!==0,a=(n&nE)!==0,i=(n&rE)!==0,o=r,u=!0,d=void 0,h=()=>i&&s?(d??(d=wi(r)),l(d)):(u&&(u=!1,o=i?Fa(r):r),o);let g;if(a){var f=Kr in t||L1 in t;g=((H=qs(t,e))==null?void 0:H.set)??(f&&e in t?B=>t[e]=B:void 0)}var m,b=!1;a?[m,b]=EE(()=>t[e]):m=t[e],m===void 0&&r!==void 0&&(m=h(),g&&(s&&Yv(),g(m)));var _;if(s?_=()=>{var B=t[e];return B===void 0?h():(u=!0,B)}:_=()=>{var B=t[e];return B!==void 0&&(o=void 0),B===void 0?o:B},s&&(n&tE)===0)return _;if(g){var A=t.$$legacy;return(function(B,J){return arguments.length>0?((!s||!J||A||b)&&g(J?_():B),B):_()})}var E=!1,C=((n&Jv)!==0?wi:qf)(()=>(E=!1,_()));a&&l(C);var I=Xe;return(function(B,J){if(arguments.length>0){const F=J?l(C):s&&a?lt(B):B;return y(C,F),E=!0,o!==void 0&&(o=F),B}return vs&&E||(I.f&cr)!==0?C.v:l(C)})}function Ua(t){Et===null&&O1(),qi&&Et.l!==null?RT(Et).m.push(t):Dt(()=>{const e=Fa(t);if(typeof e=="function")return e})}function RT(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const DT="5";var N1;typeof window<"u"&&((N1=window.__svelte??(window.__svelte={})).v??(N1.v=new Set)).add(DT);hE();function ps(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Kf(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ");return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}const kT={html:"text/html; charset=utf-8",json:"application/json; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",css:"text/css; charset=utf-8",txt:"text/plain; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",avif:"image/avif",gif:"image/gif",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",map:"application/json; charset=utf-8"};function PT(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return kT[e]??"application/octet-stream"}class fa extends Error{constructor(e){super(e),this.name="ContentParseError"}}const MT=new Set(["template","title","isPublished","fields","created","published","updated"]);function _d(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ad(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function BT(t){return _d(t)&&Object.values(t).every(Ad)}function FT(t,e){if(Ad(e))return e;if(Array.isArray(e)){if(e.every(Ad)||e.every(BT))return e;throw new fa(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new fa(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Iu(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new fa(`"${e}" must be a string when present.`);return n}}function Ul(t){return Lm(t).item}function Lm(t){if(!_d(t))throw new fa("A content item must be a JSON object.");if(typeof t.title!="string")throw new fa('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new fa(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!_d(t.fields))throw new fa('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([d,h])=>[d,FT(d,h)]))}const r=Iu(t,"template"),s=Iu(t,"created"),a=Iu(t,"published"),i=Iu(t,"updated"),o=Object.keys(t).filter(d=>!MT.has(d)).sort();return{item:{title:t.title,isPublished:e,fields:n,...r!==void 0&&{template:r},...s!==void 0&&{created:s},...a!==void 0&&{published:a},...i!==void 0&&{updated:i}},diagnostics:{unknownTopLevelKeys:o}}}function m0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Om(t){if(!m0(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=m0(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 xm="_sort.json",UT="_redirects.json",HT="_site.json",qT="assets",g0=".json",rt={content:"content",templates:"templates",components:"components",public:"public"};function Xr(...t){return t.filter(e=>e!=="").join("/")}async function Vf(t,e=rt.content){return Rm(t,e,"","")}async function Rm(t,e,n,r){const[s,a]=await Promise.all([t.list(e),$T(t,e)]),i=new Map;for(const u of s)if(u.kind==="file"){if(u.name===xm||u.name===UT||u.name===HT||!u.name.endsWith(g0))continue;const d=u.name.slice(0,-g0.length);i.set(d,await jT(t,Xr(e,u.name),d,r))}else{if(u.name===qT)continue;const d=Xr(r,u.name);i.set(u.name,await Rm(t,Xr(e,u.name),u.name,d))}const o=a.name??(n===""?"":Kf(n));return{kind:"dir",slug:n,name:o,path:r,children:YT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function jT(t,e,n,r){const s=await t.readText(e);try{const{item:a,diagnostics:i}=Lm(JSON.parse(s));return{kind:"item",slug:n,path:Xr(r,n),item:a,...i.unknownTopLevelKeys.length>0&&{parseDiagnostics:i}}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function $T(t,e){const n=Xr(e,xm);if(!await t.exists(n))return{order:[]};try{return Om(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function YT(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 Xf(t,e=rt.components){return Qf(t,e,"html")}function Dm(t,e=rt.components){return Qf(t,e,"css")}function km(t,e=rt.components){return Qf(t,e,"js")}async function Qf(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const o of await t.list(i)){const u=Xr(i,o.name);if(o.kind==="dir")await a(u);else if(o.name.endsWith(r)){const d=o.name.slice(0,-r.length).toLowerCase();s.set(d,await t.readText(u))}}};return await a(e),s}async function pl(t,e,n=rt.templates){return t.readText(Xr(n,`${e}.html`))}function zT(t,e,n=rt.templates){return Jf(t,Xr(n,`${e}.css`))}function WT(t,e,n=rt.templates){return Jf(t,Xr(n,`${e}.js`))}const au="document";function Zf(t,e=rt.templates){return Jf(t,Xr(e,`${au}.html`))}async function Jf(t,e){try{return await t.readText(e)}catch{return}}const GT=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]),Ot="�";var w;(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"})(w||(w={}));const Pn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Pm(t){return t>=55296&&t<=57343}function KT(t){return t>=56320&&t<=57343}function VT(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 Bm(t){return t>=64976&&t<=65007||GT.has(t)}var ne;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ne||(ne={}));const XT=65536;class QT{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=XT,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:a}=this,i=s+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(KT(n))return this.pos++,this._addGap(),VT(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,w.EOF;return this._err(ne.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;const r=this.html.charCodeAt(n);return r===w.CARRIAGE_RETURN?w.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,w.EOF;let e=this.html.charCodeAt(this.pos);return e===w.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,w.LINE_FEED):e===w.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===w.LINE_FEED||e===w.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Mm(e)?this._err(ne.controlCharacterInInputStream):Bm(e)&&this._err(ne.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var it;(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"})(it||(it={}));function Fm(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 ZT=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))),JT=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 e_(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=JT.get(t))!==null&&e!==void 0?e:t}var an;(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"})(an||(an={}));const t_=32;var Ms;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ms||(Ms={}));function yd(t){return t>=an.ZERO&&t<=an.NINE}function n_(t){return t>=an.UPPER_A&&t<=an.UPPER_F||t>=an.LOWER_A&&t<=an.LOWER_F}function r_(t){return t>=an.UPPER_A&&t<=an.UPPER_Z||t>=an.LOWER_A&&t<=an.LOWER_Z||yd(t)}function s_(t){return t===an.EQUALS||r_(t)}var sn;(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"})(sn||(sn={}));var hs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(hs||(hs={}));class a_{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=sn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=hs.Strict}startEntity(e){this.decodeMode=e,this.state=sn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case sn.EntityStart:return e.charCodeAt(n)===an.NUM?(this.state=sn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=sn.NamedEntity,this.stateNamedEntity(e,n));case sn.NumericStart:return this.stateNumericStart(e,n);case sn.NumericDecimal:return this.stateNumericDecimal(e,n);case sn.NumericHex:return this.stateNumericHex(e,n);case sn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|t_)===an.LOWER_X?(this.state=sn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=sn.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(yd(s)||n_(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(yd(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===an.SEMI)this.consumed+=1;else if(this.decodeMode===hs.Strict)return 0;return this.emitCodePoint(e_(this.result),this.consumed),this.errors&&(e!==an.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&Ms.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=i_(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===hs.Attribute&&(a===0||s_(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&Ms.VALUE_LENGTH)>>14,a!==0){if(i===an.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==hs.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]&Ms.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]&~Ms.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case sn.NamedEntity:return this.result!==0&&(this.decodeMode!==hs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sn.NumericDecimal:return this.emitNumericEntity(0,2);case sn.NumericHex:return this.emitNumericEntity(0,3);case sn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sn.EntityStart:return 0}}}function i_(t,e,n,r){const s=(e&Ms.BRANCH_LENGTH)>>7,a=e&Ms.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const u=r-a;return u<0||u>=s?-1:t[n+u]-1}let i=n,o=i+s-1;for(;i<=o;){const u=i+o>>>1,d=t[u];if(d<r)i=u+1;else if(d>r)o=u-1;else return t[u+s]}return-1}var ue;(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/"})(ue||(ue={}));var ya;(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"})(ya||(ya={}));var rr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(rr||(rr={}));var Q;(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"})(Q||(Q={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const o_=new Map([[Q.A,c.A],[Q.ADDRESS,c.ADDRESS],[Q.ANNOTATION_XML,c.ANNOTATION_XML],[Q.APPLET,c.APPLET],[Q.AREA,c.AREA],[Q.ARTICLE,c.ARTICLE],[Q.ASIDE,c.ASIDE],[Q.B,c.B],[Q.BASE,c.BASE],[Q.BASEFONT,c.BASEFONT],[Q.BGSOUND,c.BGSOUND],[Q.BIG,c.BIG],[Q.BLOCKQUOTE,c.BLOCKQUOTE],[Q.BODY,c.BODY],[Q.BR,c.BR],[Q.BUTTON,c.BUTTON],[Q.CAPTION,c.CAPTION],[Q.CENTER,c.CENTER],[Q.CODE,c.CODE],[Q.COL,c.COL],[Q.COLGROUP,c.COLGROUP],[Q.DD,c.DD],[Q.DESC,c.DESC],[Q.DETAILS,c.DETAILS],[Q.DIALOG,c.DIALOG],[Q.DIR,c.DIR],[Q.DIV,c.DIV],[Q.DL,c.DL],[Q.DT,c.DT],[Q.EM,c.EM],[Q.EMBED,c.EMBED],[Q.FIELDSET,c.FIELDSET],[Q.FIGCAPTION,c.FIGCAPTION],[Q.FIGURE,c.FIGURE],[Q.FONT,c.FONT],[Q.FOOTER,c.FOOTER],[Q.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[Q.FORM,c.FORM],[Q.FRAME,c.FRAME],[Q.FRAMESET,c.FRAMESET],[Q.H1,c.H1],[Q.H2,c.H2],[Q.H3,c.H3],[Q.H4,c.H4],[Q.H5,c.H5],[Q.H6,c.H6],[Q.HEAD,c.HEAD],[Q.HEADER,c.HEADER],[Q.HGROUP,c.HGROUP],[Q.HR,c.HR],[Q.HTML,c.HTML],[Q.I,c.I],[Q.IMG,c.IMG],[Q.IMAGE,c.IMAGE],[Q.INPUT,c.INPUT],[Q.IFRAME,c.IFRAME],[Q.KEYGEN,c.KEYGEN],[Q.LABEL,c.LABEL],[Q.LI,c.LI],[Q.LINK,c.LINK],[Q.LISTING,c.LISTING],[Q.MAIN,c.MAIN],[Q.MALIGNMARK,c.MALIGNMARK],[Q.MARQUEE,c.MARQUEE],[Q.MATH,c.MATH],[Q.MENU,c.MENU],[Q.META,c.META],[Q.MGLYPH,c.MGLYPH],[Q.MI,c.MI],[Q.MO,c.MO],[Q.MN,c.MN],[Q.MS,c.MS],[Q.MTEXT,c.MTEXT],[Q.NAV,c.NAV],[Q.NOBR,c.NOBR],[Q.NOFRAMES,c.NOFRAMES],[Q.NOEMBED,c.NOEMBED],[Q.NOSCRIPT,c.NOSCRIPT],[Q.OBJECT,c.OBJECT],[Q.OL,c.OL],[Q.OPTGROUP,c.OPTGROUP],[Q.OPTION,c.OPTION],[Q.P,c.P],[Q.PARAM,c.PARAM],[Q.PLAINTEXT,c.PLAINTEXT],[Q.PRE,c.PRE],[Q.RB,c.RB],[Q.RP,c.RP],[Q.RT,c.RT],[Q.RTC,c.RTC],[Q.RUBY,c.RUBY],[Q.S,c.S],[Q.SCRIPT,c.SCRIPT],[Q.SEARCH,c.SEARCH],[Q.SECTION,c.SECTION],[Q.SELECT,c.SELECT],[Q.SOURCE,c.SOURCE],[Q.SMALL,c.SMALL],[Q.SPAN,c.SPAN],[Q.STRIKE,c.STRIKE],[Q.STRONG,c.STRONG],[Q.STYLE,c.STYLE],[Q.SUB,c.SUB],[Q.SUMMARY,c.SUMMARY],[Q.SUP,c.SUP],[Q.TABLE,c.TABLE],[Q.TBODY,c.TBODY],[Q.TEMPLATE,c.TEMPLATE],[Q.TEXTAREA,c.TEXTAREA],[Q.TFOOT,c.TFOOT],[Q.TD,c.TD],[Q.TH,c.TH],[Q.THEAD,c.THEAD],[Q.TITLE,c.TITLE],[Q.TR,c.TR],[Q.TRACK,c.TRACK],[Q.TT,c.TT],[Q.U,c.U],[Q.UL,c.UL],[Q.SVG,c.SVG],[Q.VAR,c.VAR],[Q.WBR,c.WBR],[Q.XMP,c.XMP]]);function Hl(t){var e;return(e=o_.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const me=c,u_={[ue.HTML]:new Set([me.ADDRESS,me.APPLET,me.AREA,me.ARTICLE,me.ASIDE,me.BASE,me.BASEFONT,me.BGSOUND,me.BLOCKQUOTE,me.BODY,me.BR,me.BUTTON,me.CAPTION,me.CENTER,me.COL,me.COLGROUP,me.DD,me.DETAILS,me.DIR,me.DIV,me.DL,me.DT,me.EMBED,me.FIELDSET,me.FIGCAPTION,me.FIGURE,me.FOOTER,me.FORM,me.FRAME,me.FRAMESET,me.H1,me.H2,me.H3,me.H4,me.H5,me.H6,me.HEAD,me.HEADER,me.HGROUP,me.HR,me.HTML,me.IFRAME,me.IMG,me.INPUT,me.LI,me.LINK,me.LISTING,me.MAIN,me.MARQUEE,me.MENU,me.META,me.NAV,me.NOEMBED,me.NOFRAMES,me.NOSCRIPT,me.OBJECT,me.OL,me.P,me.PARAM,me.PLAINTEXT,me.PRE,me.SCRIPT,me.SECTION,me.SELECT,me.SOURCE,me.STYLE,me.SUMMARY,me.TABLE,me.TBODY,me.TD,me.TEMPLATE,me.TEXTAREA,me.TFOOT,me.TH,me.THEAD,me.TITLE,me.TR,me.TRACK,me.UL,me.WBR,me.XMP]),[ue.MATHML]:new Set([me.MI,me.MO,me.MN,me.MS,me.MTEXT,me.ANNOTATION_XML]),[ue.SVG]:new Set([me.TITLE,me.FOREIGN_OBJECT,me.DESC]),[ue.XLINK]:new Set,[ue.XML]:new Set,[ue.XMLNS]:new Set},Nd=new Set([me.H1,me.H2,me.H3,me.H4,me.H5,me.H6]),l_=new Set([Q.STYLE,Q.SCRIPT,Q.XMP,Q.IFRAME,Q.NOEMBED,Q.NOFRAMES,Q.PLAINTEXT]);function c_(t,e){return l_.has(t)||e&&t===Q.NOSCRIPT}var L;(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"})(L||(L={}));const Hn={DATA:L.DATA,RCDATA:L.RCDATA,RAWTEXT:L.RAWTEXT,SCRIPT_DATA:L.SCRIPT_DATA,PLAINTEXT:L.PLAINTEXT,CDATA_SECTION:L.CDATA_SECTION};function d_(t){return t>=w.DIGIT_0&&t<=w.DIGIT_9}function lo(t){return t>=w.LATIN_CAPITAL_A&&t<=w.LATIN_CAPITAL_Z}function f_(t){return t>=w.LATIN_SMALL_A&&t<=w.LATIN_SMALL_Z}function Is(t){return f_(t)||lo(t)}function b0(t){return Is(t)||d_(t)}function Cu(t){return t+32}function Um(t){return t===w.SPACE||t===w.LINE_FEED||t===w.TABULATION||t===w.FORM_FEED}function v0(t){return Um(t)||t===w.SOLIDUS||t===w.GREATER_THAN_SIGN}function h_(t){return t===w.NULL?ne.nullCharacterReference:t>1114111?ne.characterReferenceOutsideUnicodeRange:Pm(t)?ne.surrogateCharacterReference:Bm(t)?ne.noncharacterCharacterReference:Mm(t)||t===w.CARRIAGE_RETURN?ne.controlCharacterReference:null}class p_{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=L.DATA,this.returnState=L.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new QT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new a_(ZT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=h_(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:it.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:it.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:it.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:it.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(Fm(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ne.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Hl(e.tagName),e.type===it.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(ne.endTagWithAttributes),e.selfClosing&&this._err(ne.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case it.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case it.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case it.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:it.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=Um(e)?it.WHITESPACE_CHARACTER:e===w.NULL?it.NULL_CHARACTER:it.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(it.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=L.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?hs.Attribute:hs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===L.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case L.DATA:{this._stateData(e);break}case L.RCDATA:{this._stateRcdata(e);break}case L.RAWTEXT:{this._stateRawtext(e);break}case L.SCRIPT_DATA:{this._stateScriptData(e);break}case L.PLAINTEXT:{this._statePlaintext(e);break}case L.TAG_OPEN:{this._stateTagOpen(e);break}case L.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case L.TAG_NAME:{this._stateTagName(e);break}case L.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case L.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case L.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case L.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case L.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case L.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case L.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case L.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case L.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case L.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case L.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case L.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case L.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case L.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case L.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case L.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case L.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case L.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case L.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case L.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case L.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case L.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case L.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case L.BOGUS_COMMENT:{this._stateBogusComment(e);break}case L.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case L.COMMENT_START:{this._stateCommentStart(e);break}case L.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case L.COMMENT:{this._stateComment(e);break}case L.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case L.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case L.COMMENT_END:{this._stateCommentEnd(e);break}case L.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case L.DOCTYPE:{this._stateDoctype(e);break}case L.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case L.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case L.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case L.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case L.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case L.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case L.CDATA_SECTION:{this._stateCdataSection(e);break}case L.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case L.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case L.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case L.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.TAG_OPEN;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(e);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case w.AMPERSAND:{this._startCharacterReference();break}case w.LESS_THAN_SIGN:{this.state=L.RCDATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.RAWTEXT_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Is(e))this._createStartTagToken(),this.state=L.TAG_NAME,this._stateTagName(e);else switch(e){case w.EXCLAMATION_MARK:{this.state=L.MARKUP_DECLARATION_OPEN;break}case w.SOLIDUS:{this.state=L.END_TAG_OPEN;break}case w.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e);break}case w.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=L.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Is(e))this._createEndTagToken(),this.state=L.TAG_NAME,this._stateTagName(e);else switch(e){case w.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.tagName+=Ot;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(lo(e)?Cu(e):e)}}_stateRcdataLessThanSign(e){e===w.SOLIDUS?this.state=L.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Is(e)?(this.state=L.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=L.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 w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=L.BEFORE_ATTRIBUTE_NAME,!1;case w.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=L.SELF_CLOSING_START_TAG,!1;case w.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=L.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===w.SOLIDUS?this.state=L.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Is(e)?(this.state=L.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case w.SOLIDUS:{this.state=L.SCRIPT_DATA_END_TAG_OPEN;break}case w.EXCLAMATION_MARK:{this.state=L.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=L.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Is(e)?(this.state=L.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===w.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===w.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===w.SOLIDUS?this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Is(e)?(this._emitChars("<"),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Is(e)?(this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Pn.SCRIPT,!1)&&v0(this.preprocessor.peek(Pn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Pn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===w.SOLIDUS?(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Pn.SCRIPT,!1)&&v0(this.preprocessor.peek(Pn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Pn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._err(ne.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=L.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this._leaveAttrName(),this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._leaveAttrName(),this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:{this._err(ne.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.name+=Ot;break}default:this.currentAttr.name+=String.fromCodePoint(lo(e)?Cu(e):e)}}_stateAfterAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case w.EQUALS_SIGN:{this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{this.state=L.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this.state=L.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingAttributeValue),this.state=L.DATA,this.emitCurrentTagToken();break}default:this.state=L.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case w.APOSTROPHE:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:case w.EQUALS_SIGN:case w.GRAVE_ACCENT:{this._err(ne.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this._leaveAttrValue(),this.state=L.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBetweenAttributes),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case w.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.unexpectedSolidusInTag),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ot;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Pn.DASH_DASH,!0)?(this._createCommentToken(Pn.DASH_DASH.length+1),this.state=L.COMMENT_START):this._consumeSequenceIfMatch(Pn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Pn.DOCTYPE.length+1),this.state=L.DOCTYPE):this._consumeSequenceIfMatch(Pn.CDATA_START,!0)?this.inForeignNode?this.state=L.CDATA_SECTION:(this._err(ne.cdataInHtmlContent),this._createCommentToken(Pn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=L.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ne.incorrectlyOpenedComment),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_START_DASH;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=L.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END_DASH;break}case w.LESS_THAN_SIGN:{n.data+="<",this.state=L.COMMENT_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ot;break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case w.EXCLAMATION_MARK:{n.data+="!",this.state=L.COMMENT_LESS_THAN_SIGN_BANG;break}case w.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=L.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===w.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=L.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===w.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=L.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==w.GREATER_THAN_SIGN&&e!==w.EOF&&this._err(ne.nestedComment),this.state=L.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case w.EXCLAMATION_MARK:{this.state=L.COMMENT_END_BANG;break}case w.HYPHEN_MINUS:{n.data+="-";break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=L.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{n.data+="--!",this.state=L.COMMENT_END_DASH;break}case w.GREATER_THAN_SIGN:{this._err(ne.incorrectlyClosedComment),this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=L.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case w.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBeforeDoctypeName),this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(lo(e))this._createDoctypeToken(String.fromCharCode(Cu(e))),this.state=L.DOCTYPE_NAME;else switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.NULL:{this._err(ne.unexpectedNullCharacter),this._createDoctypeToken(Ot),this.state=L.DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=L.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.AFTER_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.name+=Ot;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(lo(e)?Cu(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Pn.PUBLIC,!1)?this.state=L.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Pn.SYSTEM,!1)?this.state=L.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ne.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.NULL:{this._err(ne.unexpectedNullCharacter);break}case w.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case w.RIGHT_SQUARE_BRACKET:{this.state=L.CDATA_SECTION_BRACKET;break}case w.EOF:{this._err(ne.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===w.RIGHT_SQUARE_BRACKET?this.state=L.CDATA_SECTION_END:(this._emitChars("]"),this.state=L.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA;break}case w.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=L.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(w.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&b0(this.preprocessor.peek(1))?L.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){b0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===w.SEMICOLON&&this._err(ne.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Hm=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),E0=new Set([...Hm,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),ml=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),m_=new Set([...ml,c.OL,c.UL]),g_=new Set([...ml,c.BUTTON]),T0=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),_0=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),b_=new Set([c.TR,c.TEMPLATE,c.HTML]),v_=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),E_=new Set([c.TABLE,c.TEMPLATE,c.HTML]),T_=new Set([c.TD,c.TH]);class __{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ue.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])!==ue.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(Nd,ue.HTML)}popUntilTableCellPopped(){this.popUntilPopped(T_,ue.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(E_,ue.HTML)}clearBackToTableBodyContext(){this.clearBackTo(v_,ue.HTML)}clearBackToTableRowContext(){this.clearBackTo(b_,ue.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ue.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case ue.SVG:{if(_0.has(s))return!1;break}case ue.MATHML:{if(T0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,ml)}hasInListItemScope(e){return this.hasInDynamicScope(e,m_)}hasInButtonScope(e){return this.hasInDynamicScope(e,g_)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case ue.HTML:{if(Nd.has(n))return!0;if(ml.has(n))return!1;break}case ue.SVG:{if(_0.has(n))return!1;break}case ue.MATHML:{if(T0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===ue.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Hm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&E0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&E0.has(this.currentTagId);)this.pop()}}const xc=3;var Wr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Wr||(Wr={}));const A0={type:Wr.Marker};class A_{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===Wr.Marker)break;const{element:d}=u;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===i){const h=this.treeAdapter.getAttrList(d);h.length===s&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<xc)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<xc)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(u=>s.get(u.name)===u.value)&&(a+=1,a>=xc&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(A0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Wr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Wr.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(A0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Wr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Wr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Wr.Element&&n.element===e)}}const ls={createDocument(){return{nodeName:"#document",mode:rr.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};ls.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(ls.isTextNode(n)){n.value+=e;return}}ls.appendChild(t,ls.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&ls.isTextNode(r)?r.value+=e:ls.insertBefore(t,ls.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}}},qm="html",y_="about:legacy-compat",N_="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",jm=["+//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//"],S_=[...jm,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],w_=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//"],I_=[...$m,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function y0(t,e){return e.some(n=>t.startsWith(n))}function C_(t){return t.name===qm&&t.publicId===null&&(t.systemId===null||t.systemId===y_)}function L_(t){if(t.name!==qm)return rr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===N_)return rr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),w_.has(n))return rr.QUIRKS;let r=e===null?S_:jm;if(y0(n,r))return rr.QUIRKS;if(r=e===null?$m:I_,y0(n,r))return rr.LIMITED_QUIRKS}return rr.NO_QUIRKS}const N0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},O_="definitionurl",x_="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])),D_=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ue.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ue.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ue.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ue.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ue.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ue.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ue.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ue.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ue.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ue.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ue.XMLNS}]]),k_=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])),P_=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function M_(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===ya.COLOR||r===ya.SIZE||r===ya.FACE)||P_.has(e)}function Ym(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===O_){t.attrs[e].name=x_;break}}function zm(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 eh(t){for(let e=0;e<t.attrs.length;e++){const n=D_.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 B_(t){const e=k_.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Hl(t.tagName))}function F_(t,e){return e===ue.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function U_(t,e,n){if(e===ue.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ya.ENCODING){const s=n[r].value.toLowerCase();return s===N0.TEXT_HTML||s===N0.APPLICATION_XML}}return e===ue.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function H_(t,e,n,r){return(!r||r===ue.HTML)&&U_(t,e,n)||(!r||r===ue.MATHML)&&F_(t,e)}const q_="hidden",j_=8,$_=3;var P;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(P||(P={}));const Y_={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Wm=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),S0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ls,onParseError:null};class Gm{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=P.INITIAL,this.originalInsertionMode=P.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...S0,...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 p_(this.options,this),this.activeFormattingElements=new A_(this.treeAdapter),this.fragmentContextID=r?Hl(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new __(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={...S0,...n};e??(e=r.treeAdapter.createElement(Q.TEMPLATE,ue.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ue.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(P.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const a=(s=e.location)!==null&&s!==void 0?s:Y_,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)===ue.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,ue.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=P.TEXT}switchToPlaintextParsing(){this.insertionMode=P.TEXT,this.originalInsertionMode=P.IN_BODY,this.tokenizer.state=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)===Q.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ue.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=Hn.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=Hn.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=Hn.SCRIPT_DATA;break}case c.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(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,ue.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,ue.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(Q.HTML,ue.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,i=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:u,endCol:d,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:u,endCol:d,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),a=n.type===it.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===Q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ue.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ue.HTML)}_processToken(e){switch(e.type){case it.CHARACTER:{this.onCharacter(e);break}case it.NULL_CHARACTER:{this.onNullCharacter(e);break}case it.COMMENT:{this.onComment(e);break}case it.DOCTYPE:{this.onDoctype(e);break}case it.START_TAG:{this._processStartTag(e);break}case it.END_TAG:{this.onEndTag(e);break}case it.EOF:{this.onEof(e);break}case it.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return H_(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Wr.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=P.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=P.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=P.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=P.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=P.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=P.IN_TABLE;return}case c.BODY:{this.insertionMode=P.IN_BODY;return}case c.FRAMESET:{this.insertionMode=P.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?P.AFTER_HEAD:P.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=P.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=P.IN_HEAD;return}break}}this.insertionMode=P.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=P.IN_SELECT_IN_TABLE;return}}this.insertionMode=P.IN_SELECT}_isElementCausesFosterParenting(e){return Wm.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ue.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return u_[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){TA(this,e);return}switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{vo(this,e);break}case P.BEFORE_HEAD:{Eo(this,e);break}case P.IN_HEAD:{To(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_o(this,e);break}case P.AFTER_HEAD:{Ao(this,e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:{Vm(this,e);break}case P.TEXT:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Rc(this,e);break}case P.IN_TABLE_TEXT:{tg(this,e);break}case P.IN_COLUMN_GROUP:{gl(this,e);break}case P.AFTER_BODY:{bl(this,e);break}case P.AFTER_AFTER_BODY:{Ju(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){EA(this,e);return}switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{vo(this,e);break}case P.BEFORE_HEAD:{Eo(this,e);break}case P.IN_HEAD:{To(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_o(this,e);break}case P.AFTER_HEAD:{Ao(this,e);break}case P.TEXT:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Rc(this,e);break}case P.IN_COLUMN_GROUP:{gl(this,e);break}case P.AFTER_BODY:{bl(this,e);break}case P.AFTER_AFTER_BODY:{Ju(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Sd(this,e);return}switch(this.insertionMode){case P.INITIAL:case P.BEFORE_HTML:case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_TEMPLATE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{Sd(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.AFTER_BODY:{Q_(this,e);break}case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{Z_(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case P.INITIAL:{J_(this,e);break}case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:{this._err(e,ne.misplacedDoctype);break}case P.IN_TABLE_TEXT:{no(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?_A(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{e2(this,e);break}case P.BEFORE_HEAD:{n2(this,e);break}case P.IN_HEAD:{kr(this,e);break}case P.IN_HEAD_NO_SCRIPT:{a2(this,e);break}case P.AFTER_HEAD:{o2(this,e);break}case P.IN_BODY:{An(this,e);break}case P.IN_TABLE:{Ri(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.IN_CAPTION:{rA(this,e);break}case P.IN_COLUMN_GROUP:{rh(this,e);break}case P.IN_TABLE_BODY:{$l(this,e);break}case P.IN_ROW:{Yl(this,e);break}case P.IN_CELL:{iA(this,e);break}case P.IN_SELECT:{sg(this,e);break}case P.IN_SELECT_IN_TABLE:{uA(this,e);break}case P.IN_TEMPLATE:{cA(this,e);break}case P.AFTER_BODY:{fA(this,e);break}case P.IN_FRAMESET:{hA(this,e);break}case P.AFTER_FRAMESET:{mA(this,e);break}case P.AFTER_AFTER_BODY:{bA(this,e);break}case P.AFTER_AFTER_FRAMESET:{vA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?AA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{t2(this,e);break}case P.BEFORE_HEAD:{r2(this,e);break}case P.IN_HEAD:{s2(this,e);break}case P.IN_HEAD_NO_SCRIPT:{i2(this,e);break}case P.AFTER_HEAD:{u2(this,e);break}case P.IN_BODY:{jl(this,e);break}case P.TEXT:{G2(this,e);break}case P.IN_TABLE:{Ro(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.IN_CAPTION:{sA(this,e);break}case P.IN_COLUMN_GROUP:{aA(this,e);break}case P.IN_TABLE_BODY:{wd(this,e);break}case P.IN_ROW:{rg(this,e);break}case P.IN_CELL:{oA(this,e);break}case P.IN_SELECT:{ag(this,e);break}case P.IN_SELECT_IN_TABLE:{lA(this,e);break}case P.IN_TEMPLATE:{dA(this,e);break}case P.AFTER_BODY:{og(this,e);break}case P.IN_FRAMESET:{pA(this,e);break}case P.AFTER_FRAMESET:{gA(this,e);break}case P.AFTER_AFTER_BODY:{Ju(this,e);break}}}onEof(e){switch(this.insertionMode){case P.INITIAL:{to(this,e);break}case P.BEFORE_HTML:{vo(this,e);break}case P.BEFORE_HEAD:{Eo(this,e);break}case P.IN_HEAD:{To(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_o(this,e);break}case P.AFTER_HEAD:{Ao(this,e);break}case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{Jm(this,e);break}case P.TEXT:{K2(this,e);break}case P.IN_TABLE_TEXT:{no(this,e);break}case P.IN_TEMPLATE:{ig(this,e);break}case P.AFTER_BODY:case P.IN_FRAMESET:case P.AFTER_FRAMESET:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{nh(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===w.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.TEXT:case P.IN_COLUMN_GROUP:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{this._insertCharacters(e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:case P.AFTER_BODY:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{Km(this,e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Rc(this,e);break}case P.IN_TABLE_TEXT:{eg(this,e);break}}}}function z_(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):Zm(t,e),n}function W_(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 G_(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let a=0,i=s;i!==n;a++,i=s){s=t.openElements.getCommonAncestor(i);const o=t.activeFormattingElements.getElementEntry(i),u=o&&a>=$_;!o||u?(u&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(i)):(i=K_(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function K_(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 V_(t,e,n){const r=t.treeAdapter.getTagName(e),s=Hl(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&a===ue.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function X_(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,s.tagID)}function th(t,e){for(let n=0;n<j_;n++){const r=z_(t,e);if(!r)break;const s=W_(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=G_(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&V_(t,i,a),X_(t,s,r)}}function Sd(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function Q_(t,e){t._appendCommentNode(e,t.openElements.items[0])}function Z_(t,e){t._appendCommentNode(e,t.document)}function nh(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 J_(t,e){t._setDocumentType(e);const n=e.forceQuirks?rr.QUIRKS:L_(e);C_(e)||t._err(e,ne.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=P.BEFORE_HTML}function to(t,e){t._err(e,ne.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,rr.QUIRKS),t.insertionMode=P.BEFORE_HTML,t._processToken(e)}function e2(t,e){e.tagID===c.HTML?(t._insertElement(e,ue.HTML),t.insertionMode=P.BEFORE_HEAD):vo(t,e)}function t2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&vo(t,e)}function vo(t,e){t._insertFakeRootElement(),t.insertionMode=P.BEFORE_HEAD,t._processToken(e)}function n2(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.HEAD:{t._insertElement(e,ue.HTML),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD;break}default:Eo(t,e)}}function r2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Eo(t,e):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Eo(t,e){t._insertFakeElement(Q.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD,t._processToken(e)}function kr(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,Hn.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Hn.RAWTEXT):(t._insertElement(e,ue.HTML),t.insertionMode=P.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,Hn.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,Hn.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=P.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(P.IN_TEMPLATE);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:To(t,e)}}function s2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=P.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{To(t,e);break}case c.TEMPLATE:{Ha(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Ha(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,ne.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,ne.endTagWithoutMatchingOpenElement)}function To(t,e){t.openElements.pop(),t.insertionMode=P.AFTER_HEAD,t._processToken(e)}function a2(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{kr(t,e);break}case c.NOSCRIPT:{t._err(e,ne.nestedNoscriptInHead);break}default:_o(t,e)}}function i2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=P.IN_HEAD;break}case c.BR:{_o(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function _o(t,e){const n=e.type===it.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=P.IN_HEAD,t._processToken(e)}function o2(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.BODY:{t._insertElement(e,ue.HTML),t.framesetOk=!1,t.insertionMode=P.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,ue.HTML),t.insertionMode=P.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,ne.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),kr(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Ao(t,e)}}function u2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Ao(t,e);break}case c.TEMPLATE:{Ha(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Ao(t,e){t._insertFakeElement(Q.BODY,c.BODY),t.insertionMode=P.IN_BODY,ql(t,e)}function ql(t,e){switch(e.type){case it.CHARACTER:{Vm(t,e);break}case it.WHITESPACE_CHARACTER:{Km(t,e);break}case it.COMMENT:{Sd(t,e);break}case it.START_TAG:{An(t,e);break}case it.END_TAG:{jl(t,e);break}case it.EOF:{Jm(t,e);break}}}function Km(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Vm(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function l2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function c2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function d2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_FRAMESET)}function f2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML)}function h2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Nd.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,ue.HTML)}function p2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function m2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),n||(t.formElement=t.openElements.current))}function g2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML)}function b2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),t.tokenizer.state=Hn.PLAINTEXT}function v2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.framesetOk=!1}function E2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Q.A);n&&(th(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function T2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function _2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(th(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,ue.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function A2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function y2(t,e){t.treeAdapter.getDocumentMode(t.document)!==rr.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ue.HTML),t.framesetOk=!1,t.insertionMode=P.IN_TABLE}function Xm(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ue.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Qm(t){const e=Fm(t,ya.TYPE);return e!=null&&e.toLowerCase()===q_}function N2(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ue.HTML),Qm(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function S2(t,e){t._appendElement(e,ue.HTML),e.ackSelfClosing=!0}function w2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,ue.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function I2(t,e){e.tagName=Q.IMG,e.tagID=c.IMG,Xm(t,e)}function C2(t,e){t._insertElement(e,ue.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Hn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=P.TEXT}function L2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Hn.RAWTEXT)}function O2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Hn.RAWTEXT)}function w0(t,e){t._switchToTextParsing(e,Hn.RAWTEXT)}function x2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===P.IN_TABLE||t.insertionMode===P.IN_CAPTION||t.insertionMode===P.IN_TABLE_BODY||t.insertionMode===P.IN_ROW||t.insertionMode===P.IN_CELL?P.IN_SELECT_IN_TABLE:P.IN_SELECT}function R2(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML)}function D2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,ue.HTML)}function k2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,ue.HTML)}function P2(t,e){t._reconstructActiveFormattingElements(),Ym(e),eh(e),e.selfClosing?t._appendElement(e,ue.MATHML):t._insertElement(e,ue.MATHML),e.ackSelfClosing=!0}function M2(t,e){t._reconstructActiveFormattingElements(),zm(e),eh(e),e.selfClosing?t._appendElement(e,ue.SVG):t._insertElement(e,ue.SVG),e.ackSelfClosing=!0}function I0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ue.HTML)}function An(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{T2(t,e);break}case c.A:{E2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{h2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{f2(t,e);break}case c.LI:case c.DD:case c.DT:{g2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{Xm(t,e);break}case c.HR:{w2(t,e);break}case c.RB:case c.RTC:{D2(t,e);break}case c.RT:case c.RP:{k2(t,e);break}case c.PRE:case c.LISTING:{p2(t,e);break}case c.XMP:{L2(t,e);break}case c.SVG:{M2(t,e);break}case c.HTML:{l2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{kr(t,e);break}case c.BODY:{c2(t,e);break}case c.FORM:{m2(t,e);break}case c.NOBR:{_2(t,e);break}case c.MATH:{P2(t,e);break}case c.TABLE:{y2(t,e);break}case c.INPUT:{N2(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{S2(t,e);break}case c.IMAGE:{I2(t,e);break}case c.BUTTON:{v2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{A2(t,e);break}case c.IFRAME:{O2(t,e);break}case c.SELECT:{x2(t,e);break}case c.OPTION:case c.OPTGROUP:{R2(t,e);break}case c.NOEMBED:case c.NOFRAMES:{w0(t,e);break}case c.FRAMESET:{d2(t,e);break}case c.TEXTAREA:{C2(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?w0(t,e):I0(t,e);break}case c.PLAINTEXT:{b2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:I0(t,e)}}function B2(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function F2(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,og(t,e))}function U2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function H2(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function q2(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(Q.P,c.P),t._closePElement()}function j2(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function $2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function Y2(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function z2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function W2(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Q.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function Zm(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const a=t.openElements.items[s],i=t.openElements.tagIDs[s];if(r===i&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(a,i))break}}function jl(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{th(t,e);break}case c.P:{q2(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{U2(t,e);break}case c.LI:{j2(t);break}case c.DD:case c.DT:{$2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{Y2(t);break}case c.BR:{W2(t);break}case c.BODY:{B2(t,e);break}case c.HTML:{F2(t,e);break}case c.FORM:{H2(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{z2(t,e);break}case c.TEMPLATE:{Ha(t,e);break}default:Zm(t,e)}}function Jm(t,e){t.tmplInsertionModeStack.length>0?ig(t,e):nh(t,e)}function G2(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function K2(t,e){t._err(e,ne.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Rc(t,e){if(t.openElements.currentTagId!==void 0&&Wm.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=P.IN_TABLE_TEXT,e.type){case it.CHARACTER:{tg(t,e);break}case it.WHITESPACE_CHARACTER:{eg(t,e);break}}else iu(t,e)}function V2(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_CAPTION}function X2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_COLUMN_GROUP}function Q2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Q.COLGROUP,c.COLGROUP),t.insertionMode=P.IN_COLUMN_GROUP,rh(t,e)}function Z2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_TABLE_BODY}function J2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Q.TBODY,c.TBODY),t.insertionMode=P.IN_TABLE_BODY,$l(t,e)}function eA(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function tA(t,e){Qm(e)?t._appendElement(e,ue.HTML):iu(t,e),e.ackSelfClosing=!0}function nA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,ue.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Ri(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{J2(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{kr(t,e);break}case c.COL:{Q2(t,e);break}case c.FORM:{nA(t,e);break}case c.TABLE:{eA(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{Z2(t,e);break}case c.INPUT:{tA(t,e);break}case c.CAPTION:{V2(t,e);break}case c.COLGROUP:{X2(t,e);break}default:iu(t,e)}}function Ro(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Ha(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:iu(t,e)}}function iu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,ql(t,e),t.fosterParentingEnabled=n}function eg(t,e){t.pendingCharacterTokens.push(e)}function tg(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function no(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)iu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const ng=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function rA(t,e){const n=e.tagID;ng.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,Ri(t,e)):An(t,e)}function sA(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,n===c.TABLE&&Ro(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:jl(t,e)}}function rh(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.COL:{t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{kr(t,e);break}default:gl(t,e)}}function aA(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TEMPLATE:{Ha(t,e);break}case c.COL:break;default:gl(t,e)}}function gl(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE,t._processToken(e))}function $l(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(Q.TR,c.TR),t.insertionMode=P.IN_ROW,Yl(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,Ri(t,e));break}default:Ri(t,e)}}function wd(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,Ro(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:Ro(t,e)}}function Yl(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,ue.HTML),t.insertionMode=P.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,$l(t,e));break}default:Ri(t,e)}}function rg(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,wd(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,wd(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:Ro(t,e)}}function iA(t,e){const n=e.tagID;ng.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),Yl(t,e)):An(t,e)}function oA(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),rg(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:jl(t,e)}}function sg(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,ue.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,ue.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{kr(t,e);break}}}function ag(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Ha(t,e);break}}}function uA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):sg(t,e)}function lA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):ag(t,e)}function cA(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{kr(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=P.IN_TABLE,t.insertionMode=P.IN_TABLE,Ri(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=P.IN_COLUMN_GROUP,t.insertionMode=P.IN_COLUMN_GROUP,rh(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=P.IN_TABLE_BODY,t.insertionMode=P.IN_TABLE_BODY,$l(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=P.IN_ROW,t.insertionMode=P.IN_ROW,Yl(t,e);break}default:t.tmplInsertionModeStack[0]=P.IN_BODY,t.insertionMode=P.IN_BODY,An(t,e)}}function dA(t,e){e.tagID===c.TEMPLATE&&Ha(t,e)}function ig(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):nh(t,e)}function fA(t,e){e.tagID===c.HTML?An(t,e):bl(t,e)}function og(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=P.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else bl(t,e)}function bl(t,e){t.insertionMode=P.IN_BODY,ql(t,e)}function hA(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.FRAMESET:{t._insertElement(e,ue.HTML);break}case c.FRAME:{t._appendElement(e,ue.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{kr(t,e);break}}}function pA(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=P.AFTER_FRAMESET))}function mA(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.NOFRAMES:{kr(t,e);break}}}function gA(t,e){e.tagID===c.HTML&&(t.insertionMode=P.AFTER_AFTER_FRAMESET)}function bA(t,e){e.tagID===c.HTML?An(t,e):Ju(t,e)}function Ju(t,e){t.insertionMode=P.IN_BODY,ql(t,e)}function vA(t,e){switch(e.tagID){case c.HTML:{An(t,e);break}case c.NOFRAMES:{kr(t,e);break}}}function EA(t,e){e.chars=Ot,t._insertCharacters(e)}function TA(t,e){t._insertCharacters(e),t.framesetOk=!1}function ug(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==ue.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function _A(t,e){if(M_(e))ug(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===ue.MATHML?Ym(e):r===ue.SVG&&(B_(e),zm(e)),eh(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function AA(t,e){if(e.tagID===c.P||e.tagID===c.BR){ug(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)===ue.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 lg(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 yA=lg(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),NA=lg(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),SA=new Set([Q.AREA,Q.BASE,Q.BASEFONT,Q.BGSOUND,Q.BR,Q.COL,Q.EMBED,Q.FRAME,Q.HR,Q.IMG,Q.INPUT,Q.KEYGEN,Q.LINK,Q.META,Q.PARAM,Q.SOURCE,Q.TRACK,Q.WBR]);function cg(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===ue.HTML&&SA.has(e.treeAdapter.getTagName(t))}const wA={treeAdapter:ls,scriptingEnabled:!0};function IA(t,e){const n={...wA,...e};return cg(t,n)?"":dg(t,n)}function dg(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===Q.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===ue.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=CA(a,e);return n}function CA(t,e){return e.treeAdapter.isElementNode(t)?LA(t,e):e.treeAdapter.isTextNode(t)?xA(t,e):e.treeAdapter.isCommentNode(t)?RA(t,e):e.treeAdapter.isDocumentTypeNode(t)?DA(t,e):""}function LA(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${OA(t,e)}>${cg(t,e)?"":`${dg(t,e)}</${n}>`}`}function OA(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case ue.XML:{n+=`xml:${r.name}`;break}case ue.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case ue.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${yA(r.value)}"`}return n}function xA(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)===ue.HTML&&c_(a,e.scriptingEnabled)?r:NA(r)}function RA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function DA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function kA(t,e){return Gm.parse(t,e)}function sh(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Gm.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Kn(t){return"tagName"in t}function ts(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 $s(t,e){return t.attrs.some(n=>n.name===e)}function C0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function ah(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Ys(t){return sh(t).childNodes}function PA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function Di(t){return PA(t)?kA(t).childNodes:sh(t).childNodes}function MA(t){const e=sh("");return e.childNodes=t,IA(e)}const ih={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 BA(t){return Object.prototype.hasOwnProperty.call(ih,t)}function Do(t){return ih[t].valueKind}const FA=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),UA=new Set(["code","pre","kbd","samp"]),HA=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Na(t){if(t.annotation!==void 0&&BA(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 UA.has(t.tag)?"code":FA.has(t.tag)?"shorttext":HA.has(t.tag)?"text":"shorttext"}const qA=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function ms(t){const e=[];for(const n of t.matchAll(qA)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Sa(t){var r;const e=t.trim(),n=ms(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function zl(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 oh(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function fg(t){const e=L0(St(t,"data-minlength")),n=L0(St(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function L0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function gs(t,e=new Map){return pg(t,e,new Set)}function hg(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=pg(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function pg(t,e,n){const r=[],s=new Map,a=h=>{const g=s.get(h);if(g!==void 0)return g;const f={name:h,type:"shorttext",label:Kf(h),required:!1,multiline:!1};return s.set(h,f),r.push(h),f},i=(h,g)=>{if(s.has(h))return;const f=a(h);f.type=g,f.multiline=ih[g].multiline},o=h=>{const g=St(h,"data-field")??jA(h);if(g===void 0)return;const f=a(g);$s(h,"data-required")&&(f.required=!0);const m=St(h,"data-help");m!==void 0&&(f.help=m);const b=St(h,"data-label");b!==void 0&&(f.label=b);const{minLength:_,maxLength:A}=fg(h);_!==void 0&&(f.minLength=_),A!==void 0&&(f.maxLength=A)},u=h=>{const g=Sa(h);for(const f of ms(h))f.dotted||i(f.name,Na({tag:"",wholeValue:(g==null?void 0:g.name)===f.name}))},d=h=>{for(const g of h){if(!Kn(g)){ts(g)&&u(g.value);continue}const f=St(g,"data-each");if(f!==void 0){const _=a(f);_.type="url",_.multiple=!0;const A=St(g,"data-pick-from");A!==void 0&&(_.pickFrom=A),o(g);continue}if($s(g,"data-each-in"))continue;const m=St(g,"data-type"),b=e.has(g.tagName)?hg(g.tagName,e,n):void 0;for(const _ of g.attrs){const A=Sa(_.value);for(const E of ms(_.value)){if(E.dotted)continue;const C=(A==null?void 0:A.name)===E.name,I=C?b==null?void 0:b.get(_.name):void 0;i(E.name,I??Na({tag:g.tagName,attribute:_.name,wholeValue:C,valuePrefix:oh(_.value),download:$s(g,"download"),...m!==void 0&&{annotation:m}}))}}for(const _ of g.childNodes){if(!ts(_))continue;const A=Sa(_.value);for(const E of ms(_.value))E.dotted||i(E.name,Na({tag:g.tagName,wholeValue:(A==null?void 0:A.name)===E.name,...m!==void 0&&{annotation:m}}))}o(g),d(g.childNodes)}};return d(Di(t)),r.map(h=>$A(s.get(h)))}function jA(t){for(const e of t.attrs){const n=ms(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(ts(e)){const n=ms(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function $A(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 YA(t,e){if(t===e)return!1;const n=Do(t),r=Do(e);return r==="html"?!1:n==="html"||t==="date"&&e==="time"||t==="time"&&e==="date"||(a=>a==="shorttext"||a==="text"||a==="code"||a==="email"||a==="phone")(t)&&(e==="date"||e==="time")?!0:!(n===r||r==="text")}function zA(t,e){const n=new Map(t.map(o=>[o.name,o])),r=new Map(e.map(o=>[o.name,o])),s=[],a=[],i=[];for(const[o,u]of n){const d=r.get(o);d===void 0?a.push({name:o,type:u.type}):d.type!==u.type&&i.push({name:o,from:u.type,to:d.type,destructive:YA(u.type,d.type)})}for(const[o,u]of r)n.has(o)||s.push({name:o,type:u.type});return{added:s.sort((o,u)=>o.name.localeCompare(u.name)),removed:a.sort((o,u)=>o.name.localeCompare(u.name)),typeChanged:i.sort((o,u)=>o.name.localeCompare(u.name))}}const O0=/^(.+)@v([1-9]\d*)$/;function uh(t){const e=O0.exec(t);if(!e)return null;const n=e[1];return O0.test(n)?null:{base:n,version:Number.parseInt(e[2],10)}}function Id(t){return uh(t)!==null}function kR(t){const e=uh(t);return e?e.base:t}function WA(t){const e=uh(t);return e?e.version:null}const x0="ref:";function Wl(t){return t.startsWith(x0)?t.slice(x0.length):void 0}function R0(t){const e=new Set,n=r=>{for(const s of r)if(Kn(s)){for(const a of s.attrs){const i=Wl(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(Di(t)),[...e].sort()}function Cd(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,o=new Set,u=new Map,d=new Set,h=g=>{for(const f of g){if(!Kn(f))continue;const m=GA(f);m!==void 0&&o.add(m);const b=St(f,"data-each-in");if(b!==void 0){r.push(b);continue}const _=St(f,"data-each");if(_!==void 0&&s.push(_),$s(f,"data-required")){const I=D0(f);I!==void 0&&n.add(I)}const A=fg(f);if(A.minLength!==void 0||A.maxLength!==void 0){const I=D0(f);I!==void 0&&u.set(I,A)}const E=St(f,"data-type"),C=e.has(f.tagName)?hg(f.tagName,e,new Set):void 0;for(const I of f.attrs){const H=Wl(I.value);H!==void 0&&d.add(H);const B=Sa(I.value);if(B===null||B.dotted)continue;const J=(C==null?void 0:C.get(I.name))??Na({tag:f.tagName,attribute:I.name,wholeValue:!0,valuePrefix:oh(I.value),download:$s(f,"download"),...E!==void 0&&{annotation:E}});J==="image"?a.add(B.name):J==="file"?i.add(B.name):J==="richtext"&&o.add(B.name)}h(f.childNodes)}};return h(Di(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...o],constraints:u,references:[...d].sort()}}function GA(t){const e=t.childNodes.filter(i=>!(ts(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!ts(n))return;const r=Sa(n.value);if(r===null||r.dotted)return;const s=St(t,"data-type"),a=Na({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return Do(a)==="html"?r.name:void 0}function D0(t){const e=St(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=ms(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(ts(n)){const r=ms(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function KA(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Dc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function VA(t){return JSON.stringify(t).slice(1,-1)}function vl(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 XA(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 QA(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 ZA(t,e){const n=XA(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return KA((s==null?void 0:s.displayName)??r.name)});return QA(n)}const JA=[400,800,1200,1600],ey={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function ty(t){return t==="jpeg"?"jpg":t}function ny(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function ry(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 sy(t,e,n){var A;const r=ny(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:JA,formats:s}),i=ry(t),o=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),u=[],d=E=>{const C=`${o}.${i}-${E.width}.${ty(E.format)}`;return u.push({path:C,contents:E.bytes}),`/${C}`},h=new Map;for(const E of[...a.variants].sort((C,I)=>C.width-I.width)){const C=d(E),I=h.get(E.format)??[];I.push({url:C,width:E.width}),h.set(E.format,I)}const g=E=>(h.get(E)??[]).map(C=>`${C.url} ${C.width}w`).join(", "),f=["avif","webp"].filter(E=>h.has(E)).map(E=>({format:E,mime:ey[E],srcset:g(E)})),m=h.get(r)??[],b=((A=m[m.length-1])==null?void 0:A.url)??`/${e}`,_={width:a.sourceWidth,height:a.sourceHeight,sources:f,fallbackSrc:b,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:u,info:_}}function mg(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${Dc(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Dc(i)}"`).join(""),s=`<img src="${Dc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const ay=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],iy=["data-type","data-field","data-required","data-help","data-label"];function Ld(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=ko(Di(t.template),t.scope,e),r=t.document===void 0?n:Eg(ko(Di(t.document),t.scope,e),n);return oy(r,t,e),MA(r)}function oy(t,e,n){var i,o,u,d;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const h=Ys(`<style>
4
4
  ${r}
5
5
  </style>`),g=Od(t,"head");g?g.childNodes.push(...h):t.unshift(...h)}const s=[],a=(o=e.templateScript)==null?void 0:o.trim();a&&s.push(a);for(const h of[...n.usedComponents].sort()){const g=(d=(u=e.componentScripts)==null?void 0:u.get(h))==null?void 0:d.trim();g&&s.push(g)}if(s.length>0){const h=s.flatMap(f=>Ys(`<script>
6
6
  ${f}
7
- <\/script>`)),g=Od(t,"body");g?g.childNodes.push(...h):t.push(...h)}}function Od(t,e){for(const n of t){if(!Kn(n))continue;if(n.tagName===e)return n;const r=Od(n.childNodes,e);if(r!==void 0)return r}}function k0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function xd(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function Gl(t){return e=>{const n=t[e.name];if(k0(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return k0(r)?r.url:xd(r)}return e.dotted?"":xd(n)}}function ko(t,e,n){const r=[];for(const s of t)Kn(s)?r.push(...gg(s,e,n)):(ts(s)&&(s.value=zl(s.value,Gl(e))),r.push(s));return r}function gg(t,e,n){if($s(t,"data-each-in")||$s(t,"data-each"))return ay(t,e,n);if(n.components.has(t.tagName))return ly(t,e,n);iy(t,e,n);const r=St(t,"data-type");for(const a of ry)ah(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(o=>[o.name,o.value]);return Ys(mg(a,i))}}if(uy(t))return M0(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return M0(t,e,"raw"),[t];const s=oy(t,r);if((s==null?void 0:s.kind)==="html"){const a=Ys(xd(e[s.token.name]));return t.childNodes=bg(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=Ys(VA(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=ko(t.childNodes,e,n),[t])}function bg(t,e){var r;const n=[];for(const s of t){if(!Kn(s)){n.push(s);continue}if(s.childNodes=bg(s.childNodes,e),s.tagName==="img"){const i=St(s,"src"),o=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(o!==void 0){const u=s.attrs.map(d=>[d.name,d.value]);n.push(...Ys(mg(o,u)));continue}i!==void 0&&C0(s,"src",P0(i,e))}const a=St(s,"href");a!==void 0&&C0(s,"href",P0(a,e)),n.push(s)}return n}function P0(t,e){var r;const n=Rd(t,e);return vl(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Rd(t,e){var r,s;const n=Wl(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function ay(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"),o=i!==void 0?Number.parseInt(i,10):void 0,u=St(t,"data-sort");s=n.context.collection(r,{...u!==void 0&&{sort:u},...o!==void 0&&!Number.isNaN(o)&&{limit:o}})}else{const i=St(t,"data-each")??"",o=e[i];s=(Array.isArray(o)?o.filter(d=>typeof d=="string"):typeof o=="string"?[o]:[]).map(d=>{var h;return(h=n.context)==null?void 0:h.reference(d)}).filter(d=>d!==void 0)}const a=[];for(const i of s){const o=vg(t);for(const u of ny)ah(o,u);a.push(...gg(o,{...e,item:i},n))}return a}function vg(t){if(Kn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(vg),e}return{...t}}function iy(t,e,n){var r;for(const s of t.attrs){if(ms(s.value).length===0){const g=Rd(s.value,n);g!==void 0&&(s.value=vl(g));continue}const a=St(t,"data-type"),i=Sa(s.value)!==null,o=Na({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:oh(s.value),download:$s(t,"download"),...a!==void 0&&{annotation:a}});let u=zl(s.value,Gl(e));const d=Rd(u,n);d!==void 0&&(u=d);const h=(r=n.media)==null?void 0:r.file(u);h!==void 0&&(u=h),i&&Do(o)==="url"&&(u=vl(u)),s.value=u}}function M0(t,e,n){const r=Gl(e);for(const s of t.childNodes)ts(s)&&(s.value=zl(s.value,a=>{const i=r(a);return n==="json"?WA(i):i}))}function oy(t,e){const n=t.childNodes.filter(i=>!(ts(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!ts(r))return null;const s=Sa(r.value);if(s===null||s.dotted)return null;const a=Na({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:Do(a)}}function uy(t){var e;return t.tagName==="script"&&((e=St(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function ly(t,e,n){var h,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=Gl(e),a={};for(const f of t.attrs)a[f.name]=zl(f.value,s);const i=ko(t.childNodes,e,n),o=ko(Di(r),a,n),u=Eg(o,i);n.usedComponents.add(t.tagName);const d=(g=(h=n.componentStyles)==null?void 0:h.get(t.tagName))==null?void 0:g.trim();if(d){const f=u.find(Kn);if(f!==void 0){const m=Ys(`<style>@scope {
7
+ <\/script>`)),g=Od(t,"body");g?g.childNodes.push(...h):t.push(...h)}}function Od(t,e){for(const n of t){if(!Kn(n))continue;if(n.tagName===e)return n;const r=Od(n.childNodes,e);if(r!==void 0)return r}}function k0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function xd(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function Gl(t){return e=>{const n=t[e.name];if(k0(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return k0(r)?r.url:xd(r)}return e.dotted?"":xd(n)}}function ko(t,e,n){const r=[];for(const s of t)Kn(s)?r.push(...gg(s,e,n)):(ts(s)&&(s.value=zl(s.value,Gl(e))),r.push(s));return r}function gg(t,e,n){if($s(t,"data-each-in")||$s(t,"data-each"))return uy(t,e,n);if(n.components.has(t.tagName))return fy(t,e,n);ly(t,e,n);const r=St(t,"data-type");for(const a of iy)ah(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(o=>[o.name,o.value]);return Ys(mg(a,i))}}if(dy(t))return M0(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return M0(t,e,"raw"),[t];const s=cy(t,r);if((s==null?void 0:s.kind)==="html"){const a=Ys(xd(e[s.token.name]));return t.childNodes=bg(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=Ys(ZA(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=ko(t.childNodes,e,n),[t])}function bg(t,e){var r;const n=[];for(const s of t){if(!Kn(s)){n.push(s);continue}if(s.childNodes=bg(s.childNodes,e),s.tagName==="img"){const i=St(s,"src"),o=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(o!==void 0){const u=s.attrs.map(d=>[d.name,d.value]);n.push(...Ys(mg(o,u)));continue}i!==void 0&&C0(s,"src",P0(i,e))}const a=St(s,"href");a!==void 0&&C0(s,"href",P0(a,e)),n.push(s)}return n}function P0(t,e){var r;const n=Rd(t,e);return vl(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Rd(t,e){var r,s;const n=Wl(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function uy(t,e,n){if(n.context===void 0)return[];const r=St(t,"data-each-in");let s;if(r!==void 0){const i=St(t,"data-limit"),o=i!==void 0?Number.parseInt(i,10):void 0,u=St(t,"data-sort");s=n.context.collection(r,{...u!==void 0&&{sort:u},...o!==void 0&&!Number.isNaN(o)&&{limit:o}})}else{const i=St(t,"data-each")??"",o=e[i];s=(Array.isArray(o)?o.filter(d=>typeof d=="string"):typeof o=="string"?[o]:[]).map(d=>{var h;return(h=n.context)==null?void 0:h.reference(d)}).filter(d=>d!==void 0)}const a=[];for(const i of s){const o=vg(t);for(const u of ay)ah(o,u);a.push(...gg(o,{...e,item:i},n))}return a}function vg(t){if(Kn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(vg),e}return{...t}}function ly(t,e,n){var r;for(const s of t.attrs){if(ms(s.value).length===0){const g=Rd(s.value,n);g!==void 0&&(s.value=vl(g));continue}const a=St(t,"data-type"),i=Sa(s.value)!==null,o=Na({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:oh(s.value),download:$s(t,"download"),...a!==void 0&&{annotation:a}});let u=zl(s.value,Gl(e));const d=Rd(u,n);d!==void 0&&(u=d);const h=(r=n.media)==null?void 0:r.file(u);h!==void 0&&(u=h),i&&Do(o)==="url"&&(u=vl(u)),s.value=u}}function M0(t,e,n){const r=Gl(e);for(const s of t.childNodes)ts(s)&&(s.value=zl(s.value,a=>{const i=r(a);return n==="json"?VA(i):i}))}function cy(t,e){const n=t.childNodes.filter(i=>!(ts(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!ts(r))return null;const s=Sa(r.value);if(s===null||s.dotted)return null;const a=Na({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:Do(a)}}function dy(t){var e;return t.tagName==="script"&&((e=St(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function fy(t,e,n){var h,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=Gl(e),a={};for(const f of t.attrs)a[f.name]=zl(f.value,s);const i=ko(t.childNodes,e,n),o=ko(Di(r),a,n),u=Eg(o,i);n.usedComponents.add(t.tagName);const d=(g=(h=n.componentStyles)==null?void 0:h.get(t.tagName))==null?void 0:g.trim();if(d){const f=u.find(Kn);if(f!==void 0){const m=Ys(`<style>@scope {
8
8
  ${d}
9
- }</style>`);f.childNodes=[...m,...f.childNodes]}}return u}function Eg(t,e){const n=new Map,r=[];for(const s of e){const a=Kn(s)?St(s,"slot"):void 0;if(a!==void 0){Kn(s)&&ah(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return Dd(t,n,r)}function Dd(t,e,n){const r=[];for(const s of t)if(Kn(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(...Dd(s.childNodes,e,n))}else Kn(s)&&(s.childNodes=Dd(s.childNodes,e,n)),r.push(s);return r}async function cy(t,e,n){const r=new Array(t.length),s=Math.max(1,Math.min(Math.floor(e),t.length));let a=0;const i=async()=>{for(;a<t.length;){const o=a++;r[o]=await n(t[o],o)}};return await Promise.all(Array.from({length:s},()=>i())),r}function dy(t){return t.split("/").filter(e=>e!=="")}function Tr(t){const e=dy(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const fy=4;async function hy(t,e,n={}){const[r,s,a,i]=await Promise.all([Vf(t),Xf(t),Dm(t),km(t)]),o=Tg(r,e,void 0);if(o===void 0)return;const u=n.draft??o.node.item,d=u.template??o.dirTemplate;if(d===void 0)return;const[h,g,f,m]=await Promise.all([pl(t,d),jT(t,d),$T(t,d),Zf(t)]),b=Cd(h,s),_={...o.node,item:u};let A,E=[];if(n.media!==void 0)A=n.media;else{const I=await py(t,_,b,n.imageEncoder,fy);A=I.media,E=I.mediaArtifacts}return{html:Ld({template:h,scope:lh(u),components:s,context:_g(r),media:A,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...m!==void 0&&{document:m},...g!==void 0&&{templateStyle:g},...f!==void 0&&{templateScript:f}}),mediaArtifacts:E}}function Tg(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=Tg(s,e,r);if(a!==void 0)return a}}async function py(t,e,n,r,s){const a=my(e.path),i=e.item.fields,o=new Map,u=new Map,d=[];for(const h of n.fileFields)for(const g of U0(i[h])){const f=F0(a,g),m=await B0(t,`content/${f}`);m!==void 0&&(d.push({path:f,contents:m}),u.set(g,`/${f}`))}if(r!==void 0){const h=new Set;for(const f of n.imageFields)for(const m of U0(i[f]))h.add(m);for(const f of n.richTextFields){const m=i[f];if(typeof m=="string")for(const b of gy(m))h.add(b)}const g=await cy([...h],s,async f=>{const m=F0(a,f),b=await B0(t,`content/${m}`);if(b!==void 0)return{ref:f,...await ty(b,m,r)}});for(const f of g)f!==void 0&&(d.push(...f.artifacts),o.set(f.ref,f.info))}return{media:{image:h=>o.get(h),file:h=>u.get(h)},mediaArtifacts:d}}async function B0(t,e){try{return await t.readBytes(e)}catch{return}}function my(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function F0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function gy(t){const e=[],n=r=>{for(const s of r)if(Kn(s)){if(s.tagName==="img"){const a=St(s,"src");a!==void 0&&by(a)&&e.push(a)}n(s.childNodes)}};return n(Ys(t)),e}function by(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function U0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function lh(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 vy(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 H0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function _g(t){const{items:e,dirs:n}=vy(t),r=s=>({url:Tr(s.path),fields:lh(s.item)});return{collection(s,a){var f;const i=n.get(H0(s));if(i===void 0)return[];const o=((f=i.collection)==null?void 0:f.recursive)??!1,u=[],d=m=>{for(const b of m.children)b.kind==="item"?b.slug!=="index"&&b.item.isPublished&&u.push(b):o&&d(b)};d(i);const h=Ey(u,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(H0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function Ey(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const o=lh(i.item)[n];return o==null?"":String(o)},a=[...t].sort((i,o)=>s(i).localeCompare(s(o)));return r==="desc"?a.reverse():a}async function Ty(t){var D;const[e,n,r]=await Promise.all([Vf(t),Xf(t),Zf(t)]),{items:s,dirs:a,published:i}=_y(e);let o=null;if(r!==void 0)try{o=Cd(r,n)}catch{o=null}const u=(o==null?void 0:o.requiredFields)??[],d=(o==null?void 0:o.constraints)??new Map,h=[],g=(v,R,k,O)=>{h.push({severity:v,code:R,message:k,...O!==void 0&&{path:O}})},f=(v,R,k)=>{const O=s.get(j0(v));O===void 0?g("error","reference-missing",`"${R}" references "${v}" (${k}), which does not exist.`,R):O.item.isPublished||g("error","reference-unpublished",`"${R}" references "${v}" (${k}), which is not published.`,R)},m=(v,R,k)=>{for(const[O,{minLength:W,maxLength:j}]of v){const M=R[O];if(typeof M!="string"||M==="")continue;const{length:$}=M;W!==void 0&&$<W&&g("warning","value-too-short",`"${k}" field "${O}" is ${$} characters; the minimum is ${W}.`,k),j!==void 0&&$>j&&g("warning","value-too-long",`"${k}" field "${O}" is ${$} characters; the maximum is ${j}.`,k)}},b=new Map,_=new Map,A=async v=>{const R=b.get(v);if(R!==void 0||b.has(v))return R??null;let k;try{const O=await pl(t,v);_.set(v,O),k=Cd(O,n)}catch{k=null}return b.set(v,k),k},E=new Map,C=v=>{const R=E.get(v);if(R!==void 0)return R;const k=_.get(v),O=new Set(k!==void 0?gs(k,n).map(W=>W.name):[]);return E.set(v,O),O},I=new Map,H=async v=>{if(I.has(v))return I.get(v)??null;const R=await J(v);if(R===null)return I.set(v,null),null;let k;try{k=await pl(t,R)}catch{return I.set(v,null),null}const O=_.get(v);if(O===void 0)return I.set(v,null),null;const W=jA(gs(k,n),gs(O,n)),j=new Set(W.typeChanged.filter(M=>M.destructive).map(M=>M.name));return I.set(v,j),j},B=new Map,J=async v=>{if(B.has(v))return B.get(v)??null;const R=v.lastIndexOf("/"),k=R===-1?"templates":`templates/${v.slice(0,R)}`,O=R===-1?v:v.slice(R+1);let W;try{W=await t.list(k)}catch{return B.set(v,null),null}let j=0,M=null;const $=`${O}@v`;for(const G of W){if(G.kind!=="file"||!G.name.endsWith(".html"))continue;const ee=G.name.slice(0,-5);if(!ee.startsWith($))continue;const le=$A(ee);le!==null&&le>j&&(j=le,M=R===-1?ee:`${v.slice(0,R)}/${ee}`)}return B.set(v,M),M},F=new Map;for(const{node:v,templateName:R}of i){const k=F.get(Tr(v.path))??[];k.push(v.path),F.set(Tr(v.path),k);const O=((D=v.parseDiagnostics)==null?void 0:D.unknownTopLevelKeys)??[];if(O.length>0&&g("warning","content.unknown-top-level-key",`"${v.path}" has top-level key${O.length===1?"":"s"} the parser does not recognise: ${O.map(M=>`"${M}"`).join(", ")}. They were dropped — content values belong under "fields" (and system keys are case-sensitive: "isPublished", not "IsPublished").`,v.path),R===void 0){g("error","no-template",`"${v.path}" has no template (no per-item or folder default).`,v.path);continue}const W=await A(R);if(W===null){const M=Id(R)?" (the snapshot may have been deleted while this item still pins to it — restore it, rebind the item to current via the Migrations workspace, or delete this item).":"";g("error","template-missing",`"${v.path}" uses template "${R}", which does not exist.${M}`,v.path);continue}if(!Id(R)){const M=C(R),$=Object.keys(v.item.fields),G=$.filter(le=>!M.has(le));G.length>0&&g("warning","content.schema-drift",`"${v.path}" has field${G.length===1?"":"s"} not rendered by template "${R}": ${G.map(le=>`"${le}"`).join(", ")}. Open the Migrations workspace to drop, rename, or keep them.`,v.path);const ee=await H(R);if(ee!==null&&ee.size>0){const le=$.filter(be=>ee.has(be));le.length>0&&g("warning","content.type-drift",`"${v.path}" has field${le.length===1?"":"s"} whose type changed destructively in template "${R}": ${le.map(be=>`"${be}"`).join(", ")}. The value will render under the new type (commonly HTML escaped as text). Open the Migrations workspace to migrate.`,v.path)}}const j=Ay(v.item);for(const M of W.requiredFields)q0(j[M])&&g("error","required-empty",`"${v.path}" is missing required field "${M}".`,v.path);for(const M of u)q0(j[M])&&g("error","required-empty",`"${v.path}" is missing required meta field "${M}" (document shell).`,v.path);m(W.constraints,j,v.path),m(d,j,v.path);for(const M of W.queryLoopPaths)a.has(j0(M))||g("error","loop-target-missing",`"${v.path}" loops over "${M}", which is not a directory.`,v.path);for(const M of W.curatedLoopFields)for(const $ of yy(v.item.fields[M]))f($,v.path,`field "${M}"`);for(const[M,$]of Object.entries(j)){if(typeof $!="string")continue;const G=Wl($);if(G!==void 0&&f(G,v.path,`field "${M}"`),W.richTextFields.includes(M))for(const ee of R0($))f(ee,v.path,`field "${M}"`)}}const Y=rt.templates;if(o!==null)for(const v of o.references)f(v,`${Y}/${au}.html`,"link");for(const[v,R]of b)if(R!==null)for(const k of R.references)f(k,`${Y}/${v}.html`,"link");for(const[v,R]of n)for(const k of R0(R))f(k,`${rt.components}/${v}.html`,"link");for(const[v,R]of F)R.length>1&&g("error","url-collision",`URL ${v} is produced by multiple items: ${R.join(", ")}.`);const X=new Map;for(const v of await Ny(t)){const k=v.slice(v.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),O=X.get(k)??[];O.push(`${rt.components}/${v}`),X.set(k,O)}for(const[v,R]of[...X].sort(([k],[O])=>k.localeCompare(O)))R.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${v}>: ${R.join(", ")}.`);const te=h.filter(v=>v.severity==="error"),T=h.filter(v=>v.severity==="warning");return{diagnostics:h,errors:te,warnings:T,ok:te.length===0}}function _y(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const o=a.defaultTemplate??i;for(const u of a.children){if(u.kind==="dir"){s(u,o);continue}e.set(u.path,u),u.item.isPublished&&r.push({node:u,templateName:u.item.template??o})}};return s(t,void 0),{items:e,dirs:n,published:r}}function Ay(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 q0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function yy(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function j0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function Ny(t){const e=rt.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const o=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,o):i.name.endsWith(".html")&&n.push(o)}};return await r(e,""),n.sort()}function kc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let Ag="";function wa(t){return`${Ag}${t}`}function Sy(t){Ag=t.replace(/\/+$/,"")}async function wy(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&Sy(e.apiUrl)}catch{}}async function Xe(t,e={}){const n=typeof t=="string"?wa(t):t,r=await $0(n,e,ut.token);if(r.status!==401||ut.token===null)return r;const s=await ut.refresh();return s===null?r:$0(n,e,s)}async function $0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function qa(t,e){const n=await Xe(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const Lu="nanoesis.jwt",Iy=540*1e3;function Cy(){let t=Z("loading"),e=Z(null),n=Z(null),r=Z(!1),s=null;function a(E,C){y(e,E,!0),y(n,C,!0),y(t,"authenticated"),localStorage.setItem(Lu,E),o()}function i(){y(e,null),y(n,null),y(t,"unauthenticated"),localStorage.removeItem(Lu),u()}function o(){u(),s=setInterval(()=>{d()},Iy)}function u(){s!==null&&(clearInterval(s),s=null)}async function d(){if(l(e)===null)return null;const E=l(e),C=await fetch(wa("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${E}`}});if(!C.ok)return i(),null;const I=await C.json().catch(()=>({}));return!I.ok||I.token===void 0||I.principal===void 0?(i(),null):(a(I.token,I.principal),I.token)}async function h(){y(t,"loading");let E;try{E=await fetch(wa("/api/auth/state"))}catch{y(t,"no-auth");return}if(E.status===404){y(t,"no-auth");return}if(!E.ok){y(t,"unauthenticated");return}const C=await E.json();y(r,C.firstRun,!0);const I=localStorage.getItem(Lu);I!==null&&I!==""&&(y(e,I,!0),await d()!==null)||y(t,"unauthenticated")}async function g(E,C){const I=await fetch(wa("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:E,password:C})}),H=await I.json().catch(()=>({}));return!I.ok||!H.ok||H.token===void 0||H.principal===void 0?{ok:!1,error:H.error??`HTTP ${I.status}`}:(y(r,!1),a(H.token,H.principal),{ok:!0})}async function f(){if(l(e)!==null)try{await Xe("/api/logout",{method:"POST"})}catch{}i()}async function m(E,C){const I=await Xe("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:E,newPassword:C})}),H=await I.json().catch(()=>({}));return!I.ok||!H.ok||H.token===void 0?{ok:!1,error:H.error??`HTTP ${I.status}`}:(y(e,H.token,!0),localStorage.setItem(Lu,H.token),{ok:!0})}async function b(){const E=await Xe("/api/me/token",{method:"POST"}),C=await E.json().catch(()=>({}));return!E.ok||C.ok!==!0||C.token===void 0?{ok:!1,error:C.error??`HTTP ${E.status}`}:{ok:!0,token:C.token,...C.expiresAt!==void 0&&{expiresAt:C.expiresAt}}}async function _(){const E=await Xe("/api/me/token",{method:"DELETE"});return E.ok?{ok:!0}:{ok:!1,error:(await E.json().catch(()=>({}))).error??`HTTP ${E.status}`}}function A(){return l(t)==="no-auth"}return{get status(){return l(t)},get token(){return l(e)},get principal(){return l(n)},get firstRun(){return l(r)},get canAuthor(){return A()||kc(l(n),"author")},get canDevelop(){return A()||kc(l(n),"developer")},get isAdmin(){return A()||kc(l(n),"admin")},init:h,login:g,logout:f,refresh:d,changePassword:m,createMcpToken:b,revokeMcpTokens:_}}const ut=Cy(),Y0={name:null,logoUrl:null};async function Ly(){try{const t=await fetch(wa("/api/branding"));if(!t.ok)return Y0;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:wa(e.logoUrl)}}catch{return Y0}}function Oy(t){return qa("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function xy(t){return qa("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function Ry(){return qa("/api/branding/logo",{method:"DELETE"})}function Dy(){let t=Z(null),e=Z(null);async function n(){const r=await Ly();y(t,r.name,!0),y(e,r.logoUrl,!0)}return{get name(){return l(t)},get logoUrl(){return l(e)},load:n}}const Ln=Dy(),ky="modulepreload",Py=function(t,e){return new URL(t,e).href},z0={},W0=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=i(n.map(h=>{if(h=Py(h,r),h in z0)return;z0[h]=!0;const g=h.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(!!r)for(let _=o.length-1;_>=0;_--){const A=o[_];if(A.href===h&&(!g||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":ky,g||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),g)return new Promise((_,A)=>{b.addEventListener("load",_),b.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function Ks(t){return Array.isArray?Array.isArray(t):Ng(t)==="[object Array]"}function My(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 kd(t){return t==null?"":My(t)}function On(t){return typeof t=="string"}function el(t){return typeof t=="number"}function By(t){return t===!0||t===!1||Fy(t)&&Ng(t)=="[object Boolean]"}function yg(t){return typeof t=="object"}function Fy(t){return yg(t)&&t!==null}function Un(t){return t!=null}function Ou(t){return!t.trim().length}function Ng(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Uy="Incorrect 'index' type",Hy=t=>`Invalid value for key ${t}`,qy=t=>`Pattern length exceeds max of ${t}.`,jy=t=>`Missing ${t} property in key`,$y=t=>`Property 'weight' in key '${t}' must be a positive integer`,G0=Object.prototype.hasOwnProperty;class Yy{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(On(t)||Ks(t))r=t,e=K0(t),n=Pd(t);else{if(!G0.call(t,"name"))throw new Error(jy("name"));const i=t.name;if(r=i,G0.call(t,"weight")&&(s=t.weight,s<=0))throw new Error($y(i));e=K0(i),n=Pd(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function K0(t){return Ks(t)?t:t.split(".")}function Pd(t){return Ks(t)?t.join("."):t}function zy(t,e){const n=[];let r=!1;const s=(a,i,o,u)=>{if(Un(a))if(!i[o])n.push(u!==void 0?{v:a,i:u}:a);else{const d=i[o],h=a[d];if(!Un(h))return;if(o===i.length-1&&(On(h)||el(h)||By(h)||typeof h=="bigint"))n.push(u!==void 0?{v:kd(h),i:u}:kd(h));else if(Ks(h)){r=!0;for(let g=0,f=h.length;g<f;g+=1)s(h[g],i,o+1,g)}else i.length&&s(h,i,o+1,u)}};return s(t,On(e)?e.split("."):e,0),r?n:n[0]}const Wy={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Gy={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},Ky={location:0,threshold:.6,distance:100},Vy={useExtendedSearch:!1,useTokenSearch:!1,getFn:zy,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Fe=Object.freeze({...Gy,...Wy,...Ky,...Vy}),Xy=/[^ ]+/g;function Qy(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(Xy).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),o=parseFloat(Math.round(i*r)/r);return n.set(a,o),o},clear(){n.clear()}}}class ch{constructor({getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){this.norm=Qy(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,On(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();On(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)||Ou(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 o=[];for(let u=0,d=i.length;u<d;u+=1){const h=i[u];if(Un(h)){if(On(h)){if(!Ou(h)){const g={v:h,i:u,n:this.norm.get(h)};o.push(g)}}else if(Un(h.v)){const g=On(h.v)?h.v:kd(h.v);if(!Ou(g)){const f={v:g,i:h.i,n:this.norm.get(g)};o.push(f)}}}}r.$[a]=o}else if(On(i)&&!Ou(i)){const o={v:i,n:this.norm.get(i)};r.$[a]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function wg(t,e,{getFn:n=Fe.getFn,fieldNormWeight:r=Fe.fieldNormWeight}={}){const s=new ch({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(Sg)),s.setSources(e),s.create(),s}function Zy(t,{getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new ch({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function Jy(t=[],e=Fe.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const o=t[a];o&&r===-1?r=a:!o&&r!==-1&&(s=a-1,s-r+1>=e&&n.push([r,s]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const ua=32;function e3(t,e,n,{location:r=Fe.location,distance:s=Fe.distance,threshold:a=Fe.threshold,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:o=Fe.minMatchCharLength,includeMatches:u=Fe.includeMatches,ignoreLocation:d=Fe.ignoreLocation}={}){if(e.length>ua)throw new Error(qy(ua));const h=e.length,g=t.length,f=Math.max(0,Math.min(r,g));let m=a,b=f;const _=(Y,X)=>{const te=Y/h;if(d)return te;const T=Math.abs(f-X);return s?te+T/s:T?1:te},A=o>1||u,E=A?Array(g):[];let C;for(;(C=t.indexOf(e,b))>-1;){const Y=_(0,C);if(m=Math.min(Y,m),b=C+h,A){let X=0;for(;X<h;)E[C+X]=1,X+=1}}b=-1;let I=[],H=1,B=h+g;const J=1<<h-1;for(let Y=0;Y<h;Y+=1){let X=0,te=B;for(;X<te;)_(Y,f+te)<=m?X=te:B=te,te=Math.floor((B-X)/2+X);B=te;let T=Math.max(1,f-te+1);const D=i?g:Math.min(f+te,g)+h,v=Array(D+2);v[D+1]=(1<<Y)-1;for(let k=D;k>=T;k-=1){const O=k-1,W=n[t[O]];if(A&&(E[O]=+!!W),v[k]=(v[k+1]<<1|1)&W,Y&&(v[k]|=(I[k+1]|I[k])<<1|1|I[k+1]),v[k]&J&&(H=_(Y,O),H<=m)){if(m=H,b=O,b<=f)break;T=Math.max(1,2*f-b)}}if(_(Y+1,f)>m)break;I=v}const F={isMatch:b>=0,score:Math.max(.001,H)};if(A){const Y=Jy(E,o);Y.length?u&&(F.indices=Y):F.isMatch=!1}return F}function t3(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 dh(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"},n3=new RegExp("["+Object.keys(Ig).join("")+"]","g"),Po=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(n3,e=>Ig[e]):t=>t;class fh{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:o=Fe.minMatchCharLength,isCaseSensitive:u=Fe.isCaseSensitive,ignoreDiacritics:d=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:h},e=u?e:e.toLowerCase(),e=d?Po(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(m,b)=>{this.chunks.push({pattern:m,alphabet:t3(m),startIndex:b})},f=this.pattern.length;if(f>ua){let m=0;const b=f%ua,_=f-b;for(;m<_;)g(this.pattern.substr(m,ua),m),m+=ua;if(b){const A=f-ua;g(this.pattern.substr(A),A)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?Po(e):e,this.pattern===e){const _={isMatch:!0,score:0};return s&&(_.indices=[[0,e.length-1]]),_}const{location:a,distance:i,threshold:o,findAllMatches:u,minMatchCharLength:d,ignoreLocation:h}=this.options,g=[];let f=0,m=!1;this.chunks.forEach(({pattern:_,alphabet:A,startIndex:E})=>{const{isMatch:C,score:I,indices:H}=e3(e,_,A,{location:a+E,distance:i,threshold:o,findAllMatches:u,minMatchCharLength:d,includeMatches:s,ignoreLocation:h});C&&(m=!0),f+=I,C&&H&&g.push(...H)});const b={isMatch:m,score:m?f/this.chunks.length:1};return m&&s&&(b.indices=dh(g)),b}}class Vs{constructor(e){this.pattern=e}static isMultiMatch(e){return V0(e,this.multiRegex)}static isSingleMatch(e){return V0(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function V0(t,e){const n=t.match(e);return n?n[1]:null}class r3 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 a3 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 i3 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 o3 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 u3 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 Cg 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:o=Fe.minMatchCharLength,isCaseSensitive:u=Fe.isCaseSensitive,ignoreDiacritics:d=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){super(e),this._bitapSearch=new fh(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Lg 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 Md=[r3,Lg,a3,i3,u3,o3,s3,Cg],X0=Md.length,l3="\0",c3="|";function d3(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 f3(t,e={}){return t.replace(/\\\|/g,l3).split(c3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=d3(s.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,u=a.length;o<u;o+=1){const d=a[o];let h=!1,g=-1;for(;!h&&++g<X0;){const f=Md[g],m=f.isMultiMatch(d);m&&(i.push(new f(m,e)),h=!0)}if(!h)for(g=-1;++g<X0;){const f=Md[g],m=f.isSingleMatch(d);if(m){i.push(new f(m,e));break}}}return i})}const h3=new Set([Cg.type,Lg.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:o=Fe.findAllMatches,location:u=Fe.location,threshold:d=Fe.threshold,distance:h=Fe.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:o,ignoreLocation:i,location:u,threshold:d,distance:h},e=n?e:e.toLowerCase(),e=r?Po(e):e,this.pattern=e,this.query=f3(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?Po(e):e;let i=0;const o=[];let u=0,d=!1;for(let h=0,g=n.length;h<g;h+=1){const f=n[h];o.length=0,i=0,d=!1;for(let m=0,b=f.length;m<b;m+=1){const _=f[m],{isMatch:A,indices:E,score:C}=_.search(e);if(A){i+=1,u+=C;const I=_.constructor.type;I.startsWith("inverse")&&(d=!0),r&&(h3.has(I)?o.push(...E):o.push(E))}else{u=0,i=0,o.length=0,d=!1;break}}if(i){const m={isMatch:!0,score:u/i};return d&&(m.hasInverse=!0),r&&(m.indices=dh(o)),m}}return{isMatch:!1,score:1}}}const Bd=[];function hh(...t){Bd.push(...t)}function El(t,e){for(let n=0,r=Bd.length;n<r;n+=1){const s=Bd[n];if(s.condition(t,e))return new s(t,e)}return new fh(t,e)}const Tl={AND:"$and",OR:"$or"},Fd={PATH:"$path",PATTERN:"$val"},Ud=t=>!!(t[Tl.AND]||t[Tl.OR]),m3=t=>!!t[Fd.PATH],g3=t=>!Ks(t)&&yg(t)&&!Ud(t),Q0=t=>({[Tl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Og(t,e,{auto:n=!0}={}){const r=s=>{if(On(s)){const u={keyId:null,pattern:s};return n&&(u.searcher=El(s,e)),u}const a=Object.keys(s),i=m3(s);if(!i&&a.length>1&&!Ud(s))return r(Q0(s));if(g3(s)){const u=i?s[Fd.PATH]:a[0],d=i?s[Fd.PATTERN]:s[u];if(!On(d))throw new Error(Hy(u));const h={keyId:Pd(u),pattern:d};return n&&(h.searcher=El(d,e)),h}const o={children:[],operator:a[0]};return a.forEach(u=>{const d=s[u];Ks(d)&&d.forEach(h=>{o.children.push(r(h))})}),o};return Ud(t)||(t=Q0(t)),r(t)}function Hd(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 b3(t,{ignoreFieldNorm:e=Fe.ignoreFieldNorm}){t.forEach(n=>{n.score=Hd(n.matches,{ignoreFieldNorm:e})})}class v3{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const n=this.heap;for(;e>0;){const r=e-1>>1;if(n[e].score<=n[r].score)break;const s=n[e];n[e]=n[r],n[r]=s,e=r}}_sinkDown(e){const n=this.heap,r=n.length;let s=e;do{e=s;const a=2*e+1,i=2*e+2;if(a<r&&n[a].score>n[s].score&&(s=a),i<r&&n[i].score>n[s].score&&(s=i),s!==e){const o=n[e];n[e]=n[s],n[s]=o}}while(s!==e)}}function E3(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 T3(t,e){e.score=t.score}function _3(t,e,{includeMatches:n=Fe.includeMatches,includeScore:r=Fe.includeScore}={}){const s=[];return n&&s.push(E3),r&&s.push(T3),t.map(a=>{const{idx:i}=a,o={item:e[i],refIndex:i};return s.length&&s.forEach(u=>{u(a,o)}),o})}const A3=/\b\w+\b/g;function qd({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=Po(n)),n.match(A3)||[]}}}function y3(t,e,n){const r=new Map,s=new Map;let a=0;function i(o,u,d,h){const g=n.tokenize(o);if(!g.length)return;a++;const f=new Map;for(const m of g)f.set(m,(f.get(m)||0)+1);for(const[m,b]of f){const _={docIdx:u,keyIdx:d,subIdx:h,tf:b};let A=r.get(m);A||(A=[],r.set(m,A)),A.push(_),s.set(m,(s.get(m)||0)+1)}}for(const o of t){const{i:u,v:d,$:h}=o;if(d!==void 0){i(d,u,-1,-1);continue}if(h)for(let g=0;g<e;g++){const f=h[g];if(f)if(Array.isArray(f))for(const m of f)i(m.v,u,g,m.i??-1);else i(f.v,u,g,-1)}}return{terms:r,fieldCount:a,df:s}}function N3(t,e,n,r){const{i:s,v:a,$:i}=e;function o(u,d,h){const g=r.tokenize(u);if(!g.length)return;t.fieldCount++;const f=new Map;for(const m of g)f.set(m,(f.get(m)||0)+1);for(const[m,b]of f){const _={docIdx:s,keyIdx:d,subIdx:h,tf:b};let A=t.terms.get(m);A||(A=[],t.terms.set(m,A)),A.push(_),t.df.set(m,(t.df.get(m)||0)+1)}}if(a!==void 0){o(a,-1,-1);return}if(i)for(let u=0;u<n;u++){const d=i[u];if(d)if(Array.isArray(d))for(const h of d)o(h.v,u,h.i??-1);else o(d.v,u,-1)}}function Z0(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 Yy(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=El(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof ch))throw new Error(Uy);if(this._myIndex=n||wg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=qd({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=qd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});N3(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)Z0(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&&Z0(this._invertedIndex,e);const n=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),n}getIndex(){return this._myIndex}search(e,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:i,sortFn:o,ignoreFieldNorm:u}=this.options;if(On(e)&&!e.trim()){let g=this._docs.map((f,m)=>({item:f,refIndex:m}));return el(r)&&r>-1&&(g=g.slice(0,r)),g}const d=el(r)&&r>0&&On(e);let h;if(d){const g=new v3(r);On(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:u}),h=g.extractSorted(o)}else h=On(e)?On(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),b3(h,{ignoreFieldNorm:u}),i&&h.sort(o),el(r)&&r>-1&&(h=h.slice(0,r));return _3(h,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{records:a}=this._myIndex,i=n?null:[];return a.forEach(({v:o,i:u,n:d})=>{if(!Un(o))return;const{isMatch:h,score:g,indices:f}=s.searchIn(o);if(h){const m={item:o,idx:u,matches:[{score:g,value:o,norm:d,indices:f}]};n?(m.score=Hd(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):i.push(m)}}),i}_searchLogical(e){const n=Og(e,this.options),r=(o,u,d)=>{if(!("children"in o)){const{keyId:m,searcher:b}=o;let _;return m===null?(_=[],this._myIndex.keys.forEach((A,E)=>{_.push(...this._findMatches({key:A,value:u[E],searcher:b}))})):_=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(u,m),searcher:b}),_&&_.length?[{idx:d,item:u,matches:_}]:[]}const{children:h,operator:g}=o,f=[];for(let m=0,b=h.length;m<b;m+=1){const _=h[m],A=r(_,u,d);if(A.length)f.push(...A);else if(g===Tl.AND)return[]}return f},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:o,i:u})=>{if(Un(o)){const d=r(n,o,u);d.length&&(a.has(u)||(a.set(u,{idx:u,item:o,matches:[]}),i.push(a.get(u))),d.forEach(({matches:h})=>{a.get(u).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,o=n?null:[];return i.forEach(({$:u,i:d})=>{if(!Un(u))return;const h=[];let g=!1,f=!1;if(a.forEach((m,b)=>{const _=this._findMatches({key:m,value:u[b],searcher:s});_.length?(h.push(..._),_[0].hasInverse&&(f=!0)):g=!0}),!(f&&g)&&h.length){const m={idx:d,item:u,matches:h};n?(m.score=Hd(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):o.push(m)}}),o}_findMatches({key:e,value:n,searcher:r}){if(!Un(n))return[];const s=[];if(Ks(n))n.forEach(({v:a,i,n:o})=>{if(!Un(a))return;const{isMatch:u,score:d,indices:h,hasInverse:g}=r.searchIn(a);u&&s.push({score:d,key:e,value:a,idx:i,norm:o,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:o,score:u,indices:d,hasInverse:h}=r.searchIn(a);o&&s.push({score:u,key:e,value:a,norm:i,indices:d,hasInverse:h})}return s}}class S3{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=qd({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(e),s=n._invertedIndex,{df:a,fieldCount:i}=s;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new fh(o,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const u=a.get(o)||0,d=Math.log(1+(i-u+.5)/(u+.5));this.idfWeights.push(d)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),h=this.idfWeights[u];s+=h,d.isMatch&&(a++,r+=h*(1-d.score),d.indices&&n.push(...d.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(o.indices=dh(n)),o}}Xs.version="7.3.0";Xs.createIndex=wg;Xs.parseIndex=Zy;Xs.config=Fe;Xs.match=function(t,e,n){return El(t,{...Fe,...n}).searchIn(e)};Xs.parseQuery=Og;hh(p3);hh(S3);Xs.use=function(...t){t.forEach(e=>hh(e))};function w3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=u=>{a.has(u.path)||(a.add(u.path),s.push(u))};for(const u of t)u.title.toLowerCase()===r&&i(u);for(const u of t)u.title.toLowerCase().startsWith(r)&&i(u);for(const u of t)u.title.toLowerCase().includes(r)&&i(u);const o=new Xs(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const u of o.search(e))i(u.item);return s.slice(0,n)}const I3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function xg(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function Rg(...t){return t.filter(e=>e!=="").join("/")}function C3(t){return I3.has(xg(t))}function L3(t){return Rg(rt.content,t,"assets")}function Mo(t,e){return Rg(rt.content,t,e)}function ou(t,e){return Dg(Mo(t,e))}function Dg(t){return wa(`/api/read?path=${encodeURIComponent(t)}`)}function kg(t){return`assets/${t}`}function Pg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=xg(t),s=ps(n)||"image";return r===""?s:`${s}.${r}`}class O3{async list(e){return await(await Xe(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await Xe(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await Xe(`/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 Xe(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function tl(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function J0(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Pc=Z(0);const ph={get value(){return l(Pc)},bump(){y(Pc,l(Pc)+1)}};function x3(t){return{image:()=>{},file:e=>R3(e)?ou(t,e):void 0}}function R3(t){return t.startsWith("assets/")}async function jd(t,e){const n=new Map,r=async a=>(n.has(a)||n.set(a,await e(a)),n.get(a)),s=await k3(t,r);return M3(s,r)}function mh(t){return t.startsWith("/")&&!t.startsWith("//")}function Mg(t){return`data:${t.contentType};base64,${D3(t.bytes)}`}function D3(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}async function k3(t,e){var a;const n=new Set([...t.matchAll(/<link\b[^>]*>/gi)].map(i=>i[0])),r=new Map;for(const i of n){const o=(a=i.match(/\bhref="([^"]*)"/i))==null?void 0:a[1];if(o===void 0||!mh(o))continue;const u=await e(o);if(u!==void 0)if(/\brel="[^"]*stylesheet[^"]*"/i.test(i)){const d=new TextDecoder().decode(u.bytes);r.set(i,`<style>
10
- ${await P3(d,e)}
11
- </style>`)}else r.set(i,i.replace(/(\bhref=")[^"]*"/i,`$1${Mg(u)}"`))}let s=t;for(const[i,o]of r)s=s.split(i).join(o);return s}async function P3(t,e){const n=new Set;for(const s of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))mh(s[1])&&n.add(s[1]);const r=await Fg(n,e);return Bg(t,r)}async function M3(t,e){const n=new Set,r=o=>{o!==void 0&&mh(o)&&n.add(o)};for(const o of t.matchAll(/\s(?:src|poster)="([^"]*)"/g))r(o[1]);for(const o of t.matchAll(/\ssrcset="([^"]*)"/g))for(const u of ep(o[1]))r(u.url);for(const o of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))r(o[1]);const s=await Fg(n,e),a=o=>s.get(o)??o,i=t.replace(/(\s(?:src|poster)=")([^"]*)"/g,(o,u,d)=>s.has(d)?`${u}${a(d)}"`:o).replace(/(\ssrcset=")([^"]*)"/g,(o,u,d)=>{const h=ep(d).map(({url:g,descriptor:f})=>[a(g),f].filter(m=>m!=="").join(" ")).join(", ");return`${u}${h}"`});return Bg(i,s)}function Bg(t,e){return t.replace(/url\(\s*(['"]?)([^)'"]*)\1\s*\)/gi,(n,r,s)=>e.has(s)?`url(${r}${e.get(s)}${r})`:n)}async function Fg(t,e){const n=new Map;return await Promise.all([...t].map(async r=>{const s=await e(r);s!==void 0&&n.set(r,Mg(s))})),n}function ep(t){return t.split(",").map(e=>e.trim()).filter(e=>e!=="").map(e=>{const[n,...r]=e.split(/\s+/);return{url:n??"",descriptor:r.join(" ")}})}const B3=`<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>`);f.childNodes=[...m,...f.childNodes]}}return u}function Eg(t,e){const n=new Map,r=[];for(const s of e){const a=Kn(s)?St(s,"slot"):void 0;if(a!==void 0){Kn(s)&&ah(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return Dd(t,n,r)}function Dd(t,e,n){const r=[];for(const s of t)if(Kn(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(...Dd(s.childNodes,e,n))}else Kn(s)&&(s.childNodes=Dd(s.childNodes,e,n)),r.push(s);return r}async function hy(t,e,n){const r=new Array(t.length),s=Math.max(1,Math.min(Math.floor(e),t.length));let a=0;const i=async()=>{for(;a<t.length;){const o=a++;r[o]=await n(t[o],o)}};return await Promise.all(Array.from({length:s},()=>i())),r}function py(t){return t.split("/").filter(e=>e!=="")}function Tr(t){const e=py(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const my=4;async function gy(t,e,n={}){const[r,s,a,i]=await Promise.all([Vf(t),Xf(t),Dm(t),km(t)]),o=Tg(r,e,void 0);if(o===void 0)return;const u=n.draft??o.node.item,d=u.template??o.dirTemplate;if(d===void 0)return;const[h,g,f,m]=await Promise.all([pl(t,d),zT(t,d),WT(t,d),Zf(t)]),b=Cd(h,s),_={...o.node,item:u};let A,E=[];if(n.media!==void 0)A=n.media;else{const I=await by(t,_,b,n.imageEncoder,my);A=I.media,E=I.mediaArtifacts}return{html:Ld({template:h,scope:lh(u),components:s,context:_g(r),media:A,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...m!==void 0&&{document:m},...g!==void 0&&{templateStyle:g},...f!==void 0&&{templateScript:f}}),mediaArtifacts:E}}function Tg(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=Tg(s,e,r);if(a!==void 0)return a}}async function by(t,e,n,r,s){const a=vy(e.path),i=e.item.fields,o=new Map,u=new Map,d=[];for(const h of n.fileFields)for(const g of U0(i[h])){const f=F0(a,g),m=await B0(t,`content/${f}`);m!==void 0&&(d.push({path:f,contents:m}),u.set(g,`/${f}`))}if(r!==void 0){const h=new Set;for(const f of n.imageFields)for(const m of U0(i[f]))h.add(m);for(const f of n.richTextFields){const m=i[f];if(typeof m=="string")for(const b of Ey(m))h.add(b)}const g=await hy([...h],s,async f=>{const m=F0(a,f),b=await B0(t,`content/${m}`);if(b!==void 0)return{ref:f,...await sy(b,m,r)}});for(const f of g)f!==void 0&&(d.push(...f.artifacts),o.set(f.ref,f.info))}return{media:{image:h=>o.get(h),file:h=>u.get(h)},mediaArtifacts:d}}async function B0(t,e){try{return await t.readBytes(e)}catch{return}}function vy(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function F0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function Ey(t){const e=[],n=r=>{for(const s of r)if(Kn(s)){if(s.tagName==="img"){const a=St(s,"src");a!==void 0&&Ty(a)&&e.push(a)}n(s.childNodes)}};return n(Ys(t)),e}function Ty(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function U0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function lh(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 _y(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 H0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function _g(t){const{items:e,dirs:n}=_y(t),r=s=>({url:Tr(s.path),fields:lh(s.item)});return{collection(s,a){var f;const i=n.get(H0(s));if(i===void 0)return[];const o=((f=i.collection)==null?void 0:f.recursive)??!1,u=[],d=m=>{for(const b of m.children)b.kind==="item"?b.slug!=="index"&&b.item.isPublished&&u.push(b):o&&d(b)};d(i);const h=Ay(u,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(H0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function Ay(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const o=lh(i.item)[n];return o==null?"":String(o)},a=[...t].sort((i,o)=>s(i).localeCompare(s(o)));return r==="desc"?a.reverse():a}async function yy(t){var D;const[e,n,r]=await Promise.all([Vf(t),Xf(t),Zf(t)]),{items:s,dirs:a,published:i}=Ny(e);let o=null;if(r!==void 0)try{o=Cd(r,n)}catch{o=null}const u=(o==null?void 0:o.requiredFields)??[],d=(o==null?void 0:o.constraints)??new Map,h=[],g=(v,R,k,O)=>{h.push({severity:v,code:R,message:k,...O!==void 0&&{path:O}})},f=(v,R,k)=>{const O=s.get(j0(v));O===void 0?g("error","reference-missing",`"${R}" references "${v}" (${k}), which does not exist.`,R):O.item.isPublished||g("error","reference-unpublished",`"${R}" references "${v}" (${k}), which is not published.`,R)},m=(v,R,k)=>{for(const[O,{minLength:W,maxLength:j}]of v){const M=R[O];if(typeof M!="string"||M==="")continue;const{length:$}=M;W!==void 0&&$<W&&g("warning","value-too-short",`"${k}" field "${O}" is ${$} characters; the minimum is ${W}.`,k),j!==void 0&&$>j&&g("warning","value-too-long",`"${k}" field "${O}" is ${$} characters; the maximum is ${j}.`,k)}},b=new Map,_=new Map,A=async v=>{const R=b.get(v);if(R!==void 0||b.has(v))return R??null;let k;try{const O=await pl(t,v);_.set(v,O),k=Cd(O,n)}catch{k=null}return b.set(v,k),k},E=new Map,C=v=>{const R=E.get(v);if(R!==void 0)return R;const k=_.get(v),O=new Set(k!==void 0?gs(k,n).map(W=>W.name):[]);return E.set(v,O),O},I=new Map,H=async v=>{if(I.has(v))return I.get(v)??null;const R=await J(v);if(R===null)return I.set(v,null),null;let k;try{k=await pl(t,R)}catch{return I.set(v,null),null}const O=_.get(v);if(O===void 0)return I.set(v,null),null;const W=zA(gs(k,n),gs(O,n)),j=new Set(W.typeChanged.filter(M=>M.destructive).map(M=>M.name));return I.set(v,j),j},B=new Map,J=async v=>{if(B.has(v))return B.get(v)??null;const R=v.lastIndexOf("/"),k=R===-1?"templates":`templates/${v.slice(0,R)}`,O=R===-1?v:v.slice(R+1);let W;try{W=await t.list(k)}catch{return B.set(v,null),null}let j=0,M=null;const $=`${O}@v`;for(const G of W){if(G.kind!=="file"||!G.name.endsWith(".html"))continue;const ee=G.name.slice(0,-5);if(!ee.startsWith($))continue;const le=WA(ee);le!==null&&le>j&&(j=le,M=R===-1?ee:`${v.slice(0,R)}/${ee}`)}return B.set(v,M),M},F=new Map;for(const{node:v,templateName:R}of i){const k=F.get(Tr(v.path))??[];k.push(v.path),F.set(Tr(v.path),k);const O=((D=v.parseDiagnostics)==null?void 0:D.unknownTopLevelKeys)??[];if(O.length>0&&g("warning","content.unknown-top-level-key",`"${v.path}" has top-level key${O.length===1?"":"s"} the parser does not recognise: ${O.map(M=>`"${M}"`).join(", ")}. They were dropped — content values belong under "fields" (and system keys are case-sensitive: "isPublished", not "IsPublished").`,v.path),R===void 0){g("error","no-template",`"${v.path}" has no template (no per-item or folder default).`,v.path);continue}const W=await A(R);if(W===null){const M=Id(R)?" (the snapshot may have been deleted while this item still pins to it — restore it, rebind the item to current via the Migrations workspace, or delete this item).":"";g("error","template-missing",`"${v.path}" uses template "${R}", which does not exist.${M}`,v.path);continue}if(!Id(R)){const M=C(R),$=Object.keys(v.item.fields),G=$.filter(le=>!M.has(le));G.length>0&&g("warning","content.schema-drift",`"${v.path}" has field${G.length===1?"":"s"} not rendered by template "${R}": ${G.map(le=>`"${le}"`).join(", ")}. Open the Migrations workspace to drop, rename, or keep them.`,v.path);const ee=await H(R);if(ee!==null&&ee.size>0){const le=$.filter(be=>ee.has(be));le.length>0&&g("warning","content.type-drift",`"${v.path}" has field${le.length===1?"":"s"} whose type changed destructively in template "${R}": ${le.map(be=>`"${be}"`).join(", ")}. The value will render under the new type (commonly HTML escaped as text). Open the Migrations workspace to migrate.`,v.path)}}const j=Sy(v.item);for(const M of W.requiredFields)q0(j[M])&&g("error","required-empty",`"${v.path}" is missing required field "${M}".`,v.path);for(const M of u)q0(j[M])&&g("error","required-empty",`"${v.path}" is missing required meta field "${M}" (document shell).`,v.path);m(W.constraints,j,v.path),m(d,j,v.path);for(const M of W.queryLoopPaths)a.has(j0(M))||g("error","loop-target-missing",`"${v.path}" loops over "${M}", which is not a directory.`,v.path);for(const M of W.curatedLoopFields)for(const $ of wy(v.item.fields[M]))f($,v.path,`field "${M}"`);for(const[M,$]of Object.entries(j)){if(typeof $!="string")continue;const G=Wl($);if(G!==void 0&&f(G,v.path,`field "${M}"`),W.richTextFields.includes(M))for(const ee of R0($))f(ee,v.path,`field "${M}"`)}}const Y=rt.templates;if(o!==null)for(const v of o.references)f(v,`${Y}/${au}.html`,"link");for(const[v,R]of b)if(R!==null)for(const k of R.references)f(k,`${Y}/${v}.html`,"link");for(const[v,R]of n)for(const k of R0(R))f(k,`${rt.components}/${v}.html`,"link");for(const[v,R]of F)R.length>1&&g("error","url-collision",`URL ${v} is produced by multiple items: ${R.join(", ")}.`);const X=new Map;for(const v of await Iy(t)){const k=v.slice(v.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),O=X.get(k)??[];O.push(`${rt.components}/${v}`),X.set(k,O)}for(const[v,R]of[...X].sort(([k],[O])=>k.localeCompare(O)))R.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${v}>: ${R.join(", ")}.`);const te=h.filter(v=>v.severity==="error"),T=h.filter(v=>v.severity==="warning");return{diagnostics:h,errors:te,warnings:T,ok:te.length===0}}function Ny(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const o=a.defaultTemplate??i;for(const u of a.children){if(u.kind==="dir"){s(u,o);continue}e.set(u.path,u),u.item.isPublished&&r.push({node:u,templateName:u.item.template??o})}};return s(t,void 0),{items:e,dirs:n,published:r}}function Sy(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 q0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function wy(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function j0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function Iy(t){const e=rt.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const o=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,o):i.name.endsWith(".html")&&n.push(o)}};return await r(e,""),n.sort()}function kc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let Ag="";function wa(t){return`${Ag}${t}`}function Cy(t){Ag=t.replace(/\/+$/,"")}async function Ly(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&Cy(e.apiUrl)}catch{}}async function Ge(t,e={}){const n=typeof t=="string"?wa(t):t,r=await $0(n,e,ut.token);if(r.status!==401||ut.token===null)return r;const s=await ut.refresh();return s===null?r:$0(n,e,s)}async function $0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function qa(t,e){const n=await Ge(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const Lu="nanoesis.jwt",Oy=540*1e3;function xy(){let t=Z("loading"),e=Z(null),n=Z(null),r=Z(!1),s=null;function a(E,C){y(e,E,!0),y(n,C,!0),y(t,"authenticated"),localStorage.setItem(Lu,E),o()}function i(){y(e,null),y(n,null),y(t,"unauthenticated"),localStorage.removeItem(Lu),u()}function o(){u(),s=setInterval(()=>{d()},Oy)}function u(){s!==null&&(clearInterval(s),s=null)}async function d(){if(l(e)===null)return null;const E=l(e),C=await fetch(wa("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${E}`}});if(!C.ok)return i(),null;const I=await C.json().catch(()=>({}));return!I.ok||I.token===void 0||I.principal===void 0?(i(),null):(a(I.token,I.principal),I.token)}async function h(){y(t,"loading");let E;try{E=await fetch(wa("/api/auth/state"))}catch{y(t,"no-auth");return}if(E.status===404){y(t,"no-auth");return}if(!E.ok){y(t,"unauthenticated");return}const C=await E.json();y(r,C.firstRun,!0);const I=localStorage.getItem(Lu);I!==null&&I!==""&&(y(e,I,!0),await d()!==null)||y(t,"unauthenticated")}async function g(E,C){const I=await fetch(wa("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:E,password:C})}),H=await I.json().catch(()=>({}));return!I.ok||!H.ok||H.token===void 0||H.principal===void 0?{ok:!1,error:H.error??`HTTP ${I.status}`}:(y(r,!1),a(H.token,H.principal),{ok:!0})}async function f(){if(l(e)!==null)try{await Ge("/api/logout",{method:"POST"})}catch{}i()}async function m(E,C){const I=await Ge("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:E,newPassword:C})}),H=await I.json().catch(()=>({}));return!I.ok||!H.ok||H.token===void 0?{ok:!1,error:H.error??`HTTP ${I.status}`}:(y(e,H.token,!0),localStorage.setItem(Lu,H.token),{ok:!0})}async function b(){const E=await Ge("/api/me/token",{method:"POST"}),C=await E.json().catch(()=>({}));return!E.ok||C.ok!==!0||C.token===void 0?{ok:!1,error:C.error??`HTTP ${E.status}`}:{ok:!0,token:C.token,...C.expiresAt!==void 0&&{expiresAt:C.expiresAt}}}async function _(){const E=await Ge("/api/me/token",{method:"DELETE"});return E.ok?{ok:!0}:{ok:!1,error:(await E.json().catch(()=>({}))).error??`HTTP ${E.status}`}}function A(){return l(t)==="no-auth"}return{get status(){return l(t)},get token(){return l(e)},get principal(){return l(n)},get firstRun(){return l(r)},get canAuthor(){return A()||kc(l(n),"author")},get canDevelop(){return A()||kc(l(n),"developer")},get isAdmin(){return A()||kc(l(n),"admin")},init:h,login:g,logout:f,refresh:d,changePassword:m,createMcpToken:b,revokeMcpTokens:_}}const ut=xy(),Y0={name:null,logoUrl:null};async function Ry(){try{const t=await fetch(wa("/api/branding"));if(!t.ok)return Y0;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:wa(e.logoUrl)}}catch{return Y0}}function Dy(t){return qa("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function ky(t){return qa("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function Py(){return qa("/api/branding/logo",{method:"DELETE"})}function My(){let t=Z(null),e=Z(null);async function n(){const r=await Ry();y(t,r.name,!0),y(e,r.logoUrl,!0)}return{get name(){return l(t)},get logoUrl(){return l(e)},load:n}}const Ln=My(),By="modulepreload",Fy=function(t,e){return new URL(t,e).href},z0={},W0=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=i(n.map(h=>{if(h=Fy(h,r),h in z0)return;z0[h]=!0;const g=h.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(!!r)for(let _=o.length-1;_>=0;_--){const A=o[_];if(A.href===h&&(!g||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":By,g||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),g)return new Promise((_,A)=>{b.addEventListener("load",_),b.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function Ks(t){return Array.isArray?Array.isArray(t):Ng(t)==="[object Array]"}function Uy(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 kd(t){return t==null?"":Uy(t)}function On(t){return typeof t=="string"}function el(t){return typeof t=="number"}function Hy(t){return t===!0||t===!1||qy(t)&&Ng(t)=="[object Boolean]"}function yg(t){return typeof t=="object"}function qy(t){return yg(t)&&t!==null}function Un(t){return t!=null}function Ou(t){return!t.trim().length}function Ng(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const jy="Incorrect 'index' type",$y=t=>`Invalid value for key ${t}`,Yy=t=>`Pattern length exceeds max of ${t}.`,zy=t=>`Missing ${t} property in key`,Wy=t=>`Property 'weight' in key '${t}' must be a positive integer`,G0=Object.prototype.hasOwnProperty;class Gy{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(On(t)||Ks(t))r=t,e=K0(t),n=Pd(t);else{if(!G0.call(t,"name"))throw new Error(zy("name"));const i=t.name;if(r=i,G0.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(Wy(i));e=K0(i),n=Pd(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function K0(t){return Ks(t)?t:t.split(".")}function Pd(t){return Ks(t)?t.join("."):t}function Ky(t,e){const n=[];let r=!1;const s=(a,i,o,u)=>{if(Un(a))if(!i[o])n.push(u!==void 0?{v:a,i:u}:a);else{const d=i[o],h=a[d];if(!Un(h))return;if(o===i.length-1&&(On(h)||el(h)||Hy(h)||typeof h=="bigint"))n.push(u!==void 0?{v:kd(h),i:u}:kd(h));else if(Ks(h)){r=!0;for(let g=0,f=h.length;g<f;g+=1)s(h[g],i,o+1,g)}else i.length&&s(h,i,o+1,u)}};return s(t,On(e)?e.split("."):e,0),r?n:n[0]}const Vy={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Xy={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},Qy={location:0,threshold:.6,distance:100},Zy={useExtendedSearch:!1,useTokenSearch:!1,getFn:Ky,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Fe=Object.freeze({...Xy,...Vy,...Qy,...Zy}),Jy=/[^ ]+/g;function e3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(Jy).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),o=parseFloat(Math.round(i*r)/r);return n.set(a,o),o},clear(){n.clear()}}}class ch{constructor({getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){this.norm=e3(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,On(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();On(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)||Ou(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 o=[];for(let u=0,d=i.length;u<d;u+=1){const h=i[u];if(Un(h)){if(On(h)){if(!Ou(h)){const g={v:h,i:u,n:this.norm.get(h)};o.push(g)}}else if(Un(h.v)){const g=On(h.v)?h.v:kd(h.v);if(!Ou(g)){const f={v:g,i:h.i,n:this.norm.get(g)};o.push(f)}}}}r.$[a]=o}else if(On(i)&&!Ou(i)){const o={v:i,n:this.norm.get(i)};r.$[a]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function wg(t,e,{getFn:n=Fe.getFn,fieldNormWeight:r=Fe.fieldNormWeight}={}){const s=new ch({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(Sg)),s.setSources(e),s.create(),s}function t3(t,{getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new ch({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function n3(t=[],e=Fe.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const o=t[a];o&&r===-1?r=a:!o&&r!==-1&&(s=a-1,s-r+1>=e&&n.push([r,s]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const ua=32;function r3(t,e,n,{location:r=Fe.location,distance:s=Fe.distance,threshold:a=Fe.threshold,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:o=Fe.minMatchCharLength,includeMatches:u=Fe.includeMatches,ignoreLocation:d=Fe.ignoreLocation}={}){if(e.length>ua)throw new Error(Yy(ua));const h=e.length,g=t.length,f=Math.max(0,Math.min(r,g));let m=a,b=f;const _=(Y,X)=>{const te=Y/h;if(d)return te;const T=Math.abs(f-X);return s?te+T/s:T?1:te},A=o>1||u,E=A?Array(g):[];let C;for(;(C=t.indexOf(e,b))>-1;){const Y=_(0,C);if(m=Math.min(Y,m),b=C+h,A){let X=0;for(;X<h;)E[C+X]=1,X+=1}}b=-1;let I=[],H=1,B=h+g;const J=1<<h-1;for(let Y=0;Y<h;Y+=1){let X=0,te=B;for(;X<te;)_(Y,f+te)<=m?X=te:B=te,te=Math.floor((B-X)/2+X);B=te;let T=Math.max(1,f-te+1);const D=i?g:Math.min(f+te,g)+h,v=Array(D+2);v[D+1]=(1<<Y)-1;for(let k=D;k>=T;k-=1){const O=k-1,W=n[t[O]];if(A&&(E[O]=+!!W),v[k]=(v[k+1]<<1|1)&W,Y&&(v[k]|=(I[k+1]|I[k])<<1|1|I[k+1]),v[k]&J&&(H=_(Y,O),H<=m)){if(m=H,b=O,b<=f)break;T=Math.max(1,2*f-b)}}if(_(Y+1,f)>m)break;I=v}const F={isMatch:b>=0,score:Math.max(.001,H)};if(A){const Y=n3(E,o);Y.length?u&&(F.indices=Y):F.isMatch=!1}return F}function s3(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 dh(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"},a3=new RegExp("["+Object.keys(Ig).join("")+"]","g"),Po=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(a3,e=>Ig[e]):t=>t;class fh{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:o=Fe.minMatchCharLength,isCaseSensitive:u=Fe.isCaseSensitive,ignoreDiacritics:d=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:h},e=u?e:e.toLowerCase(),e=d?Po(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(m,b)=>{this.chunks.push({pattern:m,alphabet:s3(m),startIndex:b})},f=this.pattern.length;if(f>ua){let m=0;const b=f%ua,_=f-b;for(;m<_;)g(this.pattern.substr(m,ua),m),m+=ua;if(b){const A=f-ua;g(this.pattern.substr(A),A)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?Po(e):e,this.pattern===e){const _={isMatch:!0,score:0};return s&&(_.indices=[[0,e.length-1]]),_}const{location:a,distance:i,threshold:o,findAllMatches:u,minMatchCharLength:d,ignoreLocation:h}=this.options,g=[];let f=0,m=!1;this.chunks.forEach(({pattern:_,alphabet:A,startIndex:E})=>{const{isMatch:C,score:I,indices:H}=r3(e,_,A,{location:a+E,distance:i,threshold:o,findAllMatches:u,minMatchCharLength:d,includeMatches:s,ignoreLocation:h});C&&(m=!0),f+=I,C&&H&&g.push(...H)});const b={isMatch:m,score:m?f/this.chunks.length:1};return m&&s&&(b.indices=dh(g)),b}}class Vs{constructor(e){this.pattern=e}static isMultiMatch(e){return V0(e,this.multiRegex)}static isSingleMatch(e){return V0(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function V0(t,e){const n=t.match(e);return n?n[1]:null}class i3 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 o3 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 u3 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 l3 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 c3 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 d3 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 Cg 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:o=Fe.minMatchCharLength,isCaseSensitive:u=Fe.isCaseSensitive,ignoreDiacritics:d=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){super(e),this._bitapSearch=new fh(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Lg 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 Md=[i3,Lg,u3,l3,d3,c3,o3,Cg],X0=Md.length,f3="\0",h3="|";function p3(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 m3(t,e={}){return t.replace(/\\\|/g,f3).split(h3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=p3(s.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,u=a.length;o<u;o+=1){const d=a[o];let h=!1,g=-1;for(;!h&&++g<X0;){const f=Md[g],m=f.isMultiMatch(d);m&&(i.push(new f(m,e)),h=!0)}if(!h)for(g=-1;++g<X0;){const f=Md[g],m=f.isSingleMatch(d);if(m){i.push(new f(m,e));break}}}return i})}const g3=new Set([Cg.type,Lg.type]);class b3{constructor(e,{isCaseSensitive:n=Fe.isCaseSensitive,ignoreDiacritics:r=Fe.ignoreDiacritics,includeMatches:s=Fe.includeMatches,minMatchCharLength:a=Fe.minMatchCharLength,ignoreLocation:i=Fe.ignoreLocation,findAllMatches:o=Fe.findAllMatches,location:u=Fe.location,threshold:d=Fe.threshold,distance:h=Fe.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:o,ignoreLocation:i,location:u,threshold:d,distance:h},e=n?e:e.toLowerCase(),e=r?Po(e):e,this.pattern=e,this.query=m3(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?Po(e):e;let i=0;const o=[];let u=0,d=!1;for(let h=0,g=n.length;h<g;h+=1){const f=n[h];o.length=0,i=0,d=!1;for(let m=0,b=f.length;m<b;m+=1){const _=f[m],{isMatch:A,indices:E,score:C}=_.search(e);if(A){i+=1,u+=C;const I=_.constructor.type;I.startsWith("inverse")&&(d=!0),r&&(g3.has(I)?o.push(...E):o.push(E))}else{u=0,i=0,o.length=0,d=!1;break}}if(i){const m={isMatch:!0,score:u/i};return d&&(m.hasInverse=!0),r&&(m.indices=dh(o)),m}}return{isMatch:!1,score:1}}}const Bd=[];function hh(...t){Bd.push(...t)}function El(t,e){for(let n=0,r=Bd.length;n<r;n+=1){const s=Bd[n];if(s.condition(t,e))return new s(t,e)}return new fh(t,e)}const Tl={AND:"$and",OR:"$or"},Fd={PATH:"$path",PATTERN:"$val"},Ud=t=>!!(t[Tl.AND]||t[Tl.OR]),v3=t=>!!t[Fd.PATH],E3=t=>!Ks(t)&&yg(t)&&!Ud(t),Q0=t=>({[Tl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Og(t,e,{auto:n=!0}={}){const r=s=>{if(On(s)){const u={keyId:null,pattern:s};return n&&(u.searcher=El(s,e)),u}const a=Object.keys(s),i=v3(s);if(!i&&a.length>1&&!Ud(s))return r(Q0(s));if(E3(s)){const u=i?s[Fd.PATH]:a[0],d=i?s[Fd.PATTERN]:s[u];if(!On(d))throw new Error($y(u));const h={keyId:Pd(u),pattern:d};return n&&(h.searcher=El(d,e)),h}const o={children:[],operator:a[0]};return a.forEach(u=>{const d=s[u];Ks(d)&&d.forEach(h=>{o.children.push(r(h))})}),o};return Ud(t)||(t=Q0(t)),r(t)}function Hd(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 T3(t,{ignoreFieldNorm:e=Fe.ignoreFieldNorm}){t.forEach(n=>{n.score=Hd(n.matches,{ignoreFieldNorm:e})})}class _3{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const n=this.heap;for(;e>0;){const r=e-1>>1;if(n[e].score<=n[r].score)break;const s=n[e];n[e]=n[r],n[r]=s,e=r}}_sinkDown(e){const n=this.heap,r=n.length;let s=e;do{e=s;const a=2*e+1,i=2*e+2;if(a<r&&n[a].score>n[s].score&&(s=a),i<r&&n[i].score>n[s].score&&(s=i),s!==e){const o=n[e];n[e]=n[s],n[s]=o}}while(s!==e)}}function A3(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 y3(t,e){e.score=t.score}function N3(t,e,{includeMatches:n=Fe.includeMatches,includeScore:r=Fe.includeScore}={}){const s=[];return n&&s.push(A3),r&&s.push(y3),t.map(a=>{const{idx:i}=a,o={item:e[i],refIndex:i};return s.length&&s.forEach(u=>{u(a,o)}),o})}const S3=/\b\w+\b/g;function qd({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=Po(n)),n.match(S3)||[]}}}function w3(t,e,n){const r=new Map,s=new Map;let a=0;function i(o,u,d,h){const g=n.tokenize(o);if(!g.length)return;a++;const f=new Map;for(const m of g)f.set(m,(f.get(m)||0)+1);for(const[m,b]of f){const _={docIdx:u,keyIdx:d,subIdx:h,tf:b};let A=r.get(m);A||(A=[],r.set(m,A)),A.push(_),s.set(m,(s.get(m)||0)+1)}}for(const o of t){const{i:u,v:d,$:h}=o;if(d!==void 0){i(d,u,-1,-1);continue}if(h)for(let g=0;g<e;g++){const f=h[g];if(f)if(Array.isArray(f))for(const m of f)i(m.v,u,g,m.i??-1);else i(f.v,u,g,-1)}}return{terms:r,fieldCount:a,df:s}}function I3(t,e,n,r){const{i:s,v:a,$:i}=e;function o(u,d,h){const g=r.tokenize(u);if(!g.length)return;t.fieldCount++;const f=new Map;for(const m of g)f.set(m,(f.get(m)||0)+1);for(const[m,b]of f){const _={docIdx:s,keyIdx:d,subIdx:h,tf:b};let A=t.terms.get(m);A||(A=[],t.terms.set(m,A)),A.push(_),t.df.set(m,(t.df.get(m)||0)+1)}}if(a!==void 0){o(a,-1,-1);return}if(i)for(let u=0;u<n;u++){const d=i[u];if(d)if(Array.isArray(d))for(const h of d)o(h.v,u,h.i??-1);else o(d.v,u,-1)}}function Z0(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 Gy(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=El(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof ch))throw new Error(jy);if(this._myIndex=n||wg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=qd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=w3(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=qd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});I3(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)Z0(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&&Z0(this._invertedIndex,e);const n=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),n}getIndex(){return this._myIndex}search(e,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:i,sortFn:o,ignoreFieldNorm:u}=this.options;if(On(e)&&!e.trim()){let g=this._docs.map((f,m)=>({item:f,refIndex:m}));return el(r)&&r>-1&&(g=g.slice(0,r)),g}const d=el(r)&&r>0&&On(e);let h;if(d){const g=new _3(r);On(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:u}),h=g.extractSorted(o)}else h=On(e)?On(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),T3(h,{ignoreFieldNorm:u}),i&&h.sort(o),el(r)&&r>-1&&(h=h.slice(0,r));return N3(h,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{records:a}=this._myIndex,i=n?null:[];return a.forEach(({v:o,i:u,n:d})=>{if(!Un(o))return;const{isMatch:h,score:g,indices:f}=s.searchIn(o);if(h){const m={item:o,idx:u,matches:[{score:g,value:o,norm:d,indices:f}]};n?(m.score=Hd(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):i.push(m)}}),i}_searchLogical(e){const n=Og(e,this.options),r=(o,u,d)=>{if(!("children"in o)){const{keyId:m,searcher:b}=o;let _;return m===null?(_=[],this._myIndex.keys.forEach((A,E)=>{_.push(...this._findMatches({key:A,value:u[E],searcher:b}))})):_=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(u,m),searcher:b}),_&&_.length?[{idx:d,item:u,matches:_}]:[]}const{children:h,operator:g}=o,f=[];for(let m=0,b=h.length;m<b;m+=1){const _=h[m],A=r(_,u,d);if(A.length)f.push(...A);else if(g===Tl.AND)return[]}return f},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:o,i:u})=>{if(Un(o)){const d=r(n,o,u);d.length&&(a.has(u)||(a.set(u,{idx:u,item:o,matches:[]}),i.push(a.get(u))),d.forEach(({matches:h})=>{a.get(u).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,o=n?null:[];return i.forEach(({$:u,i:d})=>{if(!Un(u))return;const h=[];let g=!1,f=!1;if(a.forEach((m,b)=>{const _=this._findMatches({key:m,value:u[b],searcher:s});_.length?(h.push(..._),_[0].hasInverse&&(f=!0)):g=!0}),!(f&&g)&&h.length){const m={idx:d,item:u,matches:h};n?(m.score=Hd(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):o.push(m)}}),o}_findMatches({key:e,value:n,searcher:r}){if(!Un(n))return[];const s=[];if(Ks(n))n.forEach(({v:a,i,n:o})=>{if(!Un(a))return;const{isMatch:u,score:d,indices:h,hasInverse:g}=r.searchIn(a);u&&s.push({score:d,key:e,value:a,idx:i,norm:o,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:o,score:u,indices:d,hasInverse:h}=r.searchIn(a);o&&s.push({score:u,key:e,value:a,norm:i,indices:d,hasInverse:h})}return s}}class C3{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=qd({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(e),s=n._invertedIndex,{df:a,fieldCount:i}=s;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new fh(o,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const u=a.get(o)||0,d=Math.log(1+(i-u+.5)/(u+.5));this.idfWeights.push(d)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),h=this.idfWeights[u];s+=h,d.isMatch&&(a++,r+=h*(1-d.score),d.indices&&n.push(...d.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(o.indices=dh(n)),o}}Xs.version="7.3.0";Xs.createIndex=wg;Xs.parseIndex=t3;Xs.config=Fe;Xs.match=function(t,e,n){return El(t,{...Fe,...n}).searchIn(e)};Xs.parseQuery=Og;hh(b3);hh(C3);Xs.use=function(...t){t.forEach(e=>hh(e))};function L3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=u=>{a.has(u.path)||(a.add(u.path),s.push(u))};for(const u of t)u.title.toLowerCase()===r&&i(u);for(const u of t)u.title.toLowerCase().startsWith(r)&&i(u);for(const u of t)u.title.toLowerCase().includes(r)&&i(u);const o=new Xs(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const u of o.search(e))i(u.item);return s.slice(0,n)}const O3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function xg(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function Rg(...t){return t.filter(e=>e!=="").join("/")}function x3(t){return O3.has(xg(t))}function R3(t){return Rg(rt.content,t,"assets")}function Mo(t,e){return Rg(rt.content,t,e)}function ou(t,e){return Dg(Mo(t,e))}function Dg(t){return wa(`/api/read?path=${encodeURIComponent(t)}`)}function kg(t){return`assets/${t}`}function Pg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=xg(t),s=ps(n)||"image";return r===""?s:`${s}.${r}`}class D3{async list(e){return await(await Ge(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await Ge(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await Ge(`/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 Ge(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function tl(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function J0(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Pc=Z(0);const ph={get value(){return l(Pc)},bump(){y(Pc,l(Pc)+1)}};function k3(t){return{image:()=>{},file:e=>P3(e)?ou(t,e):void 0}}function P3(t){return t.startsWith("assets/")}async function jd(t,e){const n=new Map,r=async a=>(n.has(a)||n.set(a,await e(a)),n.get(a)),s=await B3(t,r);return U3(s,r)}function mh(t){return t.startsWith("/")&&!t.startsWith("//")}function Mg(t){return`data:${t.contentType};base64,${M3(t.bytes)}`}function M3(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}async function B3(t,e){var a;const n=new Set([...t.matchAll(/<link\b[^>]*>/gi)].map(i=>i[0])),r=new Map;for(const i of n){const o=(a=i.match(/\bhref="([^"]*)"/i))==null?void 0:a[1];if(o===void 0||!mh(o))continue;const u=await e(o);if(u!==void 0)if(/\brel="[^"]*stylesheet[^"]*"/i.test(i)){const d=new TextDecoder().decode(u.bytes);r.set(i,`<style>
10
+ ${await F3(d,e)}
11
+ </style>`)}else r.set(i,i.replace(/(\bhref=")[^"]*"/i,`$1${Mg(u)}"`))}let s=t;for(const[i,o]of r)s=s.split(i).join(o);return s}async function F3(t,e){const n=new Set;for(const s of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))mh(s[1])&&n.add(s[1]);const r=await Fg(n,e);return Bg(t,r)}async function U3(t,e){const n=new Set,r=o=>{o!==void 0&&mh(o)&&n.add(o)};for(const o of t.matchAll(/\s(?:src|poster)="([^"]*)"/g))r(o[1]);for(const o of t.matchAll(/\ssrcset="([^"]*)"/g))for(const u of ep(o[1]))r(u.url);for(const o of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))r(o[1]);const s=await Fg(n,e),a=o=>s.get(o)??o,i=t.replace(/(\s(?:src|poster)=")([^"]*)"/g,(o,u,d)=>s.has(d)?`${u}${a(d)}"`:o).replace(/(\ssrcset=")([^"]*)"/g,(o,u,d)=>{const h=ep(d).map(({url:g,descriptor:f})=>[a(g),f].filter(m=>m!=="").join(" ")).join(", ");return`${u}${h}"`});return Bg(i,s)}function Bg(t,e){return t.replace(/url\(\s*(['"]?)([^)'"]*)\1\s*\)/gi,(n,r,s)=>e.has(s)?`url(${r}${e.get(s)}${r})`:n)}async function Fg(t,e){const n=new Map;return await Promise.all([...t].map(async r=>{const s=await e(r);s!==void 0&&n.set(r,Mg(s))})),n}function ep(t){return t.split(",").map(e=>e.trim()).filter(e=>e!=="").map(e=>{const[n,...r]=e.split(/\s+/);return{url:n??"",descriptor:r.join(" ")}})}const H3=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
12
12
  <rect width='800' height='450' fill='#e2e8f0'/>
13
13
  <path d='M0 0 800 450 M800 0 0 450' stroke='#cbd5e1' stroke-width='2'/>
14
14
  <rect x='300' y='150' width='200' height='130' rx='10' fill='#cbd5e1'/>
15
15
  <circle cx='350' cy='195' r='18' fill='#94a3b8'/>
16
16
  <path d='M308 280 380 210 432 258 470 228 492 280Z' fill='#94a3b8'/>
17
17
  <text x='400' y='330' font-family='system-ui, sans-serif' font-size='24' fill='#64748b' text-anchor='middle'>image</text>
18
- </svg>`,Ug=`data:image/svg+xml,${encodeURIComponent(B3)}`;function F3(t){switch(t.type){case"image":return Ug;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 U3(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=F3(n));return e}function H3(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 q3(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 j3(t){return t.startsWith(`${rt.components}/`)}function $3(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}function Y3(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>
19
- <html lang="en">
18
+ </svg>`,Ug=`data:image/svg+xml,${encodeURIComponent(H3)}`;function q3(t){switch(t.type){case"image":return Ug;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 j3(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=q3(n));return e}function $3(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 Y3(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 z3(t){return t.startsWith(`${rt.components}/`)}function W3(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}const Hg={htmlAttrs:"",headStyles:""};function G3(t){var s,a,i;if(t===void 0||t.trim()==="")return Hg;const e=((a=(s=t.match(/<html\b([^>]*)>/i))==null?void 0:s[1])==null?void 0:a.trim())??"",n=((i=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i))==null?void 0:i[1])??"",r=[];for(const o of n.matchAll(/<link\b[^>]*>/gi))/\brel=(["'])[^"']*stylesheet[^"']*\1/i.test(o[0])&&r.push(o[0]);for(const o of n.matchAll(/<style\b[^>]*>[\s\S]*?<\/style>/gi))r.push(o[0]);return{htmlAttrs:e,headStyles:r.join(`
19
+ `)}}function qg(t){const e=t.htmlAttrs.trim()===""?'lang="en"':t.htmlAttrs.trim(),n=t.headStyles.trim()===""?"":`
20
+ ${t.headStyles}`;return`<!doctype html>
21
+ <html ${e}>
20
22
  <head>
21
23
  <meta charset="utf-8" />
22
24
  <meta name="viewport" content="width=device-width, initial-scale=1" />
23
- <title>${t} preview</title>
24
- <style>body { margin: 16px; font-family: system-ui, sans-serif; }</style>
25
+ <title>${t.title}</title>
26
+ <style>body { margin: 16px; font-family: system-ui, sans-serif; }</style>${n}
25
27
  </head>
26
28
  <body>
27
- ${r}Sample slot content</${t}>
29
+ ${t.body}
28
30
  </body>
29
- </html>`}function tp(){return{image:()=>{},file:t=>W3(t)?Ug:void 0}}const z3=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function W3(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:z3.test(t)}const st=new O3,$d=new Map;let Yd,zd,Wd,_l,Gd;function gh(){return Gd??(Gd=Vf(st)),Gd}async function Kd(){const t=[],e=n=>{for(const r of n.children)r.kind==="dir"&&(t.push(r.path),e(r))};return e(await gh()),t.sort()}async function G3(){const t=await Xe("/api/authors");return t.ok?await t.json():[]}function $i(){Gd=void 0,ph.bump()}const np=".json",bh="_sort.json",K3="assets",V3=new Set([bh,"_redirects.json","_site.json"]);function Vd(t,e){return t===""?e:`${t}/${e}`}function vh(t){return t===""?rt.content:`${rt.content}/${t}`}async function Eh(t){try{return Om(JSON.parse(await st.readText(`${t}/${bh}`)))}catch{return{order:[]}}}function X3(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 Q3(t){try{const{title:e}=Ul(JSON.parse(await st.readText(t)));return e===""?void 0:e}catch{return}}async function Xd(t){return t===""?"Home":(await Eh(vh(t))).name??Kf(tl(t))}async function Z3(t){return await Q3(Bs(Vd(t,"index")))??await Xd(t)}async function Hg(t){const e=vh(t),[n,r]=await Promise.all([st.list(e),Eh(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(V3.has(a.name)||!a.name.endsWith(np))continue;const i=a.name.slice(0,-np.length);try{const o=Ul(JSON.parse(await st.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:Vd(t,i),title:o.title,isPublished:o.isPublished,template:o.template})}catch{}}else if(a.name!==K3){const i=Vd(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await Z3(i)})}return{entries:X3(s,r.order),defaultTemplate:r.defaultTemplate}}function J3(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 qg(t,e=30){return t.trim()===""?[]:w3(J3(await gh()),t,e)}async function eN(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await Eh(vh(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function tN(t){const e=$d.get(t);if(e!==void 0)return e;const n=await pl(st,t);return $d.set(t,n),n}function uu(){return Yd??(Yd=Xf(st)),Yd}function nN(){return zd??(zd=Dm(st)),zd}function rN(){return Wd??(Wd=km(st)),Wd}async function sN(t){const[e,n]=await Promise.all([tN(t),uu()]);return gs(e,n)}function aN(){return _l??(_l=Zf(st)),_l}async function iN(){const[t,e]=await Promise.all([aN(),uu()]);return t===void 0?[]:gs(t,e).filter(n=>n.name!=="title")}const Qd=`${rt.templates}/${au}.html`;function RR(){return st.exists(Qd)}const oN=`<!doctype html>
31
+ </html>`}function K3(t,e,n=Hg){const r=e.filter(a=>a.multiple!==!0).map(a=>`${a.name}="{${a.name}}"`).join(" "),s=r===""?`<${t}>`:`<${t} ${r}>`;return qg({htmlAttrs:n.htmlAttrs,headStyles:n.headStyles,title:`${t} preview`,body:`${s}Sample slot content</${t}>`})}function tp(){return{image:()=>{},file:t=>X3(t)?Ug:void 0}}const V3=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function X3(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:V3.test(t)}const st=new D3,$d=new Map;let Yd,zd,Wd,_l,Gd;function gh(){return Gd??(Gd=Vf(st)),Gd}async function Kd(){const t=[],e=n=>{for(const r of n.children)r.kind==="dir"&&(t.push(r.path),e(r))};return e(await gh()),t.sort()}async function Q3(){const t=await Ge("/api/authors");return t.ok?await t.json():[]}function $i(){Gd=void 0,ph.bump()}const np=".json",bh="_sort.json",Z3="assets",J3=new Set([bh,"_redirects.json","_site.json"]);function Vd(t,e){return t===""?e:`${t}/${e}`}function vh(t){return t===""?rt.content:`${rt.content}/${t}`}async function Eh(t){try{return Om(JSON.parse(await st.readText(`${t}/${bh}`)))}catch{return{order:[]}}}function eN(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 tN(t){try{const{title:e}=Ul(JSON.parse(await st.readText(t)));return e===""?void 0:e}catch{return}}async function Xd(t){return t===""?"Home":(await Eh(vh(t))).name??Kf(tl(t))}async function nN(t){return await tN(Bs(Vd(t,"index")))??await Xd(t)}async function jg(t){const e=vh(t),[n,r]=await Promise.all([st.list(e),Eh(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(J3.has(a.name)||!a.name.endsWith(np))continue;const i=a.name.slice(0,-np.length);try{const o=Ul(JSON.parse(await st.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:Vd(t,i),title:o.title,isPublished:o.isPublished,template:o.template})}catch{}}else if(a.name!==Z3){const i=Vd(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await nN(i)})}return{entries:eN(s,r.order),defaultTemplate:r.defaultTemplate}}function rN(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 $g(t,e=30){return t.trim()===""?[]:L3(rN(await gh()),t,e)}async function sN(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await Eh(vh(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function aN(t){const e=$d.get(t);if(e!==void 0)return e;const n=await pl(st,t);return $d.set(t,n),n}function uu(){return Yd??(Yd=Xf(st)),Yd}function iN(){return zd??(zd=Dm(st)),zd}function oN(){return Wd??(Wd=km(st)),Wd}async function uN(t){const[e,n]=await Promise.all([aN(t),uu()]);return gs(e,n)}function Yg(){return _l??(_l=Zf(st)),_l}async function lN(){const[t,e]=await Promise.all([Yg(),uu()]);return t===void 0?[]:gs(t,e).filter(n=>n.name!=="title")}const Qd=`${rt.templates}/${au}.html`;function PR(){return st.exists(Qd)}const cN=`<!doctype html>
30
32
  <html lang="en">
31
33
  <head>
32
34
  <meta charset="utf-8" />
@@ -38,103 +40,103 @@ ${await P3(d,e)}
38
40
  <slot></slot>
39
41
  </body>
40
42
  </html>
41
- `;async function DR(){if(await st.exists(Qd))return;const t=await Xe(`/api/write?path=${encodeURIComponent(Qd)}`,{method:"POST",body:oN});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);_l=void 0}async function kR(){const t=await uu();return[...t.entries()].map(([e,n])=>({tag:e,props:gs(n,t).map(r=>r.name)}))}async function rp(t){const e=await st.readText(`${rt.content}/${t}.json`);return Ul(JSON.parse(e))}async function jg(t,e){const n=`${rt.content}/${t}.json`,r=await Xe(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);$i()}function uN(){return Ty(st)}async function lN(){const t=await Xe("/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 cN(){const t=await Xe("/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 sp(t,e){const n=await st.readText(`${rt.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await jg(t,`${JSON.stringify(r,null,2)}
42
- `)}async function dN(t,e){return(await st.list(L3(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function fN(t){return dN(t,e=>!C3(e))}async function Th(t,e){const n=Pg(e.name),r=kg(n),s=await Xe(`/api/write?path=${encodeURIComponent(Mo(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return r}async function hN(t,e){try{await Al(Mo(t,e))}catch{}}async function Zd(t){const e=[],n=async(r,s)=>{for(const a of await st.list(r)){const i=s===""?a.name:`${s}/${a.name}`;a.kind==="dir"?await n(`${r}/${a.name}`,i):a.name.endsWith(".html")&&e.push(i.slice(0,-5))}};return await n(t,""),e.sort()}async function pN(){const t=[],e=async(n,r)=>{for(const s of await st.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):t.push(a)}};return await e(rt.public,""),t.sort()}const mN=["templates","components","public"],$g=".gitkeep";function Yg(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function _h(t){const e=Yg(t),n=[],r=[];for(const s of await st.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===$g)continue;if(e){if(t===rt.templates&&s.name===`${au}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else r.push({kind:"file",name:s.name,path:a})}}return n.sort((s,a)=>s.name.localeCompare(a.name)),r.sort((s,a)=>s.name.localeCompare(a.name)),[...n,...r]}async function PR(t){const e=[t],n=async r=>{for(const s of await _h(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function MR(t,e){const n=e.split("/").map(i=>ps(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${$g}`;if(await st.exists(s))throw new Error(`"${r}" already exists.`);const a=await Xe(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return r}async function BR(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(Yg(t)?LN(t,r):Ra(t,r)),r)}async function FR(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 Ra(t,r),r)}function gN(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 UR(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([Zd("templates"),Zd("components"),pN()]);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:gN(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,o)=>o.score-i.score||i.hit.label.localeCompare(o.hit.label)).slice(0,30).map(i=>i.hit)}function HR(t){return st.readText(t)}async function qR(t){if(await st.exists(t))throw new Error(`"${t}" already exists.`);const e=await Xe(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`)}async function jR(t,e){const n=`${t}/${Pg(e.name)}`;if(await st.exists(n))throw new Error(`"${n}" already exists.`);const r=await Xe(`/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 zg(t,e,n){const r=`${rt.content}/${t}.json`;if(await st.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 Xe(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
43
- `});if(!a.ok)throw new Error(`Create failed (${a.status})`);$i()}function bN(t){return st.exists(`${rt.content}/${t}.json`)}async function vN(t,e){const n=e.split("/").map(u=>({raw:u.trim(),slug:ps(u)})).filter(u=>u.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(u=>u.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${rt.content}/${a}/${bh}`;if(await st.exists(i))throw new Error(`"${a}" already exists.`);const o=await Xe(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
44
- `});if(!o.ok)throw new Error(`Create folder failed (${o.status})`);return $i(),a}function Ah(t){return t===""?`${rt.content}/_sort.json`:`${rt.content}/${t}/_sort.json`}async function yh(t){try{const e=JSON.parse(await st.readText(Ah(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function EN(t){const e=await yh(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function TN(t,e){const n=await yh(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await Xe(`/api/write?path=${encodeURIComponent(Ah(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
45
- `});if(!r.ok)throw new Error(`Save failed (${r.status})`)}async function _N(t,e){const n=await yh(t);n.order=[...e];const r=await Xe(`/api/write?path=${encodeURIComponent(Ah(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
46
- `});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function $R(t,e){const n=await Xe(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);Nh(t);const r=await n.json().catch(()=>({}));return{...r.stamped!==void 0&&{stamped:r.stamped},...r.stampIncomplete===!0&&{stampIncomplete:!0},...r.schemaDelta!==void 0&&{schemaDelta:r.schemaDelta}}}function Nh(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&($d.clear(),Yd=void 0,_l=void 0,ph.bump()),t.some(n=>n.startsWith(`${rt.components}/`))&&(zd=void 0,Wd=void 0),t.some(n=>n.startsWith(`${rt.content}/`))&&$i()}function Bs(t){return`${rt.content}/${t}.json`}function di(t){return`${rt.content}/${t}`}async function Al(t){const e=await Xe(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);Nh(t)}async function Ra(t,e){const n=await Xe(`/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}.`)}Nh(t,e)}const AN=/assets\/[A-Za-z0-9._-]+/g;async function yN(t,e,n){const r=Mo(t,n),s=Mo(e,n);if(r===s)return;const a=await Xe(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await Xe(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function NN(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 st.exists(Bs(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await st.readText(Bs(t));for(const o of new Set(i.match(AN)??[]))await yN(s,e,o);return await Ra(Bs(t),Bs(a)),$i(),a}async function SN(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 st.exists(di(a)))throw new Error(`A folder named "${r}" already exists there.`);return await Ra(di(t),di(a)),$i(),a}const Wg=`${rt.content}/_redirects.json`;async function wN(){try{const t=JSON.parse(await st.readText(Wg));return Array.isArray(t)?t:[]}catch{return[]}}async function xu(t,e){if(t!==e)try{const n=await wN();n.push({from:t,to:e});const r=await Xe(`/api/write?path=${encodeURIComponent(Wg)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
47
- `});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const Gg=`${rt.content}/_site.json`;async function IN(){try{const t=JSON.parse(await st.readText(Gg));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function CN(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
48
- `,r=await Xe(`/api/write?path=${encodeURIComponent(Gg)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const Kg=["html","css","js"];async function YR(t){const e=t.replace(/\.html$/,"");await Promise.all(Kg.map(n=>Al(`${e}.${n}`)))}async function LN(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of Kg){const a=`${n}.${s}`;await st.exists(a)&&await Ra(a,`${r}.${s}`)}}async function ON(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await hy(st,t,{draft:e,media:x3(n)});return r===void 0?void 0:jd(r.html,Jd)}async function Jd(t){const e=t.startsWith("/api/")?t:Dg(`public/${t.slice(1)}`);try{const n=await Xe(e);if(!n.ok)return;const r=new Uint8Array(await n.arrayBuffer());return{contentType:n.headers.get("content-type")??(t.startsWith("/api/")?"":RT(t)),bytes:r}}catch{return}}async function zR(t){return gs(t,await uu())}async function WR(t,e,n){const[r,s,a,i]=await Promise.all([uu(),nN(),rN(),gh()]),o=_g(i),u=h=>({...H3(U3(h),n),...q3(h,n)});if(j3(t)){const h=$3(t),g=new Map(r).set(h,e.html),f=ap(new Map(s),h,e.css),m=ap(new Map(a),h,e.js),b=gs(e.html,g);return jd(Ld({template:Y3(h,b),scope:u(b),components:g,componentStyles:f,componentScripts:m,context:o,media:tp()}),Jd)}const d=gs(e.html,r);return jd(Ld({template:e.html,scope:u(d),components:r,componentStyles:s,componentScripts:a,context:o,media:tp(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}}),Jd)}function ap(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function xN(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 Vg="nanoesis:tree-expanded";function RN(){try{const t=JSON.parse(localStorage.getItem(Vg)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const Es=lt({}),fi=lt({}),ki=lt(RN());function Xg(){const t=Object.keys(ki).filter(e=>ki[e]);localStorage.setItem(Vg,JSON.stringify(t))}function ui(t){return Es[t]}function DN(t){return fi[t]===!0}function ei(t){return t===""||ki[t]===!0}async function Kl(t){if(!(Es[t]!==void 0||fi[t])){fi[t]=!0;try{Es[t]=await Hg(t)}finally{fi[t]=!1}}}async function In(t){fi[t]=!0;try{Es[t]=await Hg(t)}finally{fi[t]=!1}}async function kN(){await Promise.all(Object.keys(Es).map(t=>In(t)))}function ef(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function Qg(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function tf(t,e,n){const r=Es[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(Es[t]={...r,entries:a})}function PN(t,e){const n=Qg(t);if(n!==null){n!==""&&tf(ef(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}tf(ef(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function MN(t,e){Qg(t)===null&&tf(ef(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function BN(t,e){const n=Es[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);Es[t]={...n,entries:s}}async function ip(t){ei(t)?ki[t]=!1:(ki[t]=!0,await Kl(t)),Xg()}async function ro(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,ki[n]=!0,await Kl(n);Xg()}const Zg="nanoesis:dev-tree-expanded";function FN(){try{const t=JSON.parse(localStorage.getItem(Zg)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return Object.fromEntries(mN.map(t=>[t,!0]))}const Bo=lt({}),hi=lt({}),Ia=lt(FN());function Jg(){const t=Object.keys(Ia).filter(e=>Ia[e]);localStorage.setItem(Zg,JSON.stringify(t))}function GR(t){return Bo[t]}function KR(t){return hi[t]===!0}function VR(t){return Ia[t]===!0}async function eb(t){if(!(Bo[t]!==void 0||hi[t])){hi[t]=!0;try{Bo[t]=await _h(t)}finally{hi[t]=!1}}}async function UN(t){hi[t]=!0;try{Bo[t]=await _h(t)}finally{hi[t]=!1}}async function HN(){await Promise.all(Object.keys(Bo).map(t=>UN(t)))}async function XR(t){Ia[t]?Ia[t]=!1:(Ia[t]=!0,await eb(t)),Jg()}let Ir=Z(null),Sh=Z(null);function QR(){return l(Ir)}function ZR(){return l(Sh)}function JR(t,e){y(Ir,{entry:t,parent:e},!0)}function eD(t){y(Sh,t,!0)}function tD(){y(Ir,null),y(Sh,null)}const qN=new Set(["templates/home.html"]);function tb(t){return qN.has(t)}function nD(t,e){if(l(Ir)===null||e!=="dir"||tb(l(Ir).entry.path))return!1;const n=l(Ir).entry.path;return t!==n&&l(Ir).parent!==t&&!t.startsWith(`${n}/`)&&n.split("/")[0]===t.split("/")[0]}function rD(t){return l(Ir)===null||tb(l(Ir).entry.path)?!1:l(Ir).parent!==t&&l(Ir).entry.path.split("/")[0]===t}async function sD(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ia[n]=!0,await eb(n);Jg()}const jN=9e4;function $N(t){if(typeof t!="object"||t===null)return{changed:!1,added:0,removed:0};const e=t,n=typeof e.added=="number"?e.added:0,r=typeof e.removed=="number"?e.removed:0;return{changed:n>0||r>0,added:n,removed:r}}function YN(t){const e=t.intervalMs??jN;let n=null,r=!1;async function s(){if(!(r||!t.isVisible())){r=!0;try{const a=await t.reconcileOnce();a.changed&&t.onChanged(a)}catch{}finally{r=!1}}}return{start(){n===null&&(n=setInterval(()=>void s(),e))},stop(){n!==null&&(clearInterval(n),n=null)}}}let Ht=Z(null);const Ru={get pending(){return l(Ht)}};function yl(t,e={}){return new Promise(n=>{y(Ht,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function yo(t,e={}){return new Promise(n=>{y(Ht,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function aD(t,e,n={}){return new Promise(r=>{y(Ht,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function zN(t,e){return new Promise(n=>{y(Ht,{kind:"decide",message:t,options:e,resolve:n},!0)})}function en(t,e={}){return new Promise(n=>{y(Ht,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Mc(t){var e;((e=l(Ht))==null?void 0:e.kind)==="confirm"&&(l(Ht).resolve(t),y(Ht,null))}function Bc(t){var e;((e=l(Ht))==null?void 0:e.kind)==="prompt"&&(l(Ht).resolve(t),y(Ht,null))}function Fc(t){var e;((e=l(Ht))==null?void 0:e.kind)==="select"&&(l(Ht).resolve(t),y(Ht,null))}function Du(t){var e;((e=l(Ht))==null?void 0:e.kind)==="decide"&&(l(Ht).resolve(t),y(Ht,null))}function op(){var t;((t=l(Ht))==null?void 0:t.kind)==="alert"&&(l(Ht).resolve(),y(Ht,null))}let up=Z(null);const ku=lt({}),nf={get active(){return l(up)},get hasDirty(){return Object.keys(ku).length>0},isDirty(t){return ku[t]===!0},setActive(t){y(up,t,!0)},setDirty(t,e){e?ku[t]=!0:delete ku[t]}};async function nb(t){const e=nf.active;if(e===null||!nf.isDirty(e.key))return!0;const n=t===void 0?"":`
43
+ `;async function MR(){if(await st.exists(Qd))return;const t=await Ge(`/api/write?path=${encodeURIComponent(Qd)}`,{method:"POST",body:cN});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);_l=void 0}async function BR(){const t=await uu();return[...t.entries()].map(([e,n])=>({tag:e,props:gs(n,t).map(r=>r.name)}))}async function rp(t){const e=await st.readText(`${rt.content}/${t}.json`);return Ul(JSON.parse(e))}async function zg(t,e){const n=`${rt.content}/${t}.json`,r=await Ge(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);$i()}function dN(){return yy(st)}async function fN(){const t=await Ge("/api/publish",{method:"POST"});if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{ok:!0,written:e.written??0,...e.summary!==void 0&&{summary:e.summary}};if(t.status===422)return{ok:!1,errors:e.errors??["Validation failed."],...e.summary!==void 0&&{summary:e.summary}};throw new Error(`Publish failed (${t.status})`)}async function hN(){const t=await Ge("/api/scaffold",{method:"POST"});if(t.status===404)throw new Error("Scaffolding runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{created:e.created??[],skipped:e.skipped??[]};throw t.status===409?new Error("This site already has content, scaffolding is only for an empty site."):t.status===403?new Error("Only an admin can scaffold a starter site."):new Error(e.error??`Scaffold failed (${t.status})`)}async function sp(t,e){const n=await st.readText(`${rt.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await zg(t,`${JSON.stringify(r,null,2)}
44
+ `)}async function pN(t,e){return(await st.list(R3(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function mN(t){return pN(t,e=>!x3(e))}async function Th(t,e){const n=Pg(e.name),r=kg(n),s=await Ge(`/api/write?path=${encodeURIComponent(Mo(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return r}async function gN(t,e){try{await Al(Mo(t,e))}catch{}}async function Zd(t){const e=[],n=async(r,s)=>{for(const a of await st.list(r)){const i=s===""?a.name:`${s}/${a.name}`;a.kind==="dir"?await n(`${r}/${a.name}`,i):a.name.endsWith(".html")&&e.push(i.slice(0,-5))}};return await n(t,""),e.sort()}async function bN(){const t=[],e=async(n,r)=>{for(const s of await st.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):t.push(a)}};return await e(rt.public,""),t.sort()}const vN=["templates","components","public"],Wg=".gitkeep";function Gg(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function _h(t){const e=Gg(t),n=[],r=[];for(const s of await st.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===Wg)continue;if(e){if(t===rt.templates&&s.name===`${au}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else r.push({kind:"file",name:s.name,path:a})}}return n.sort((s,a)=>s.name.localeCompare(a.name)),r.sort((s,a)=>s.name.localeCompare(a.name)),[...n,...r]}async function FR(t){const e=[t],n=async r=>{for(const s of await _h(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function UR(t,e){const n=e.split("/").map(i=>ps(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${Wg}`;if(await st.exists(s))throw new Error(`"${r}" already exists.`);const a=await Ge(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return r}async function HR(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(Gg(t)?RN(t,r):Ra(t,r)),r)}async function qR(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 Ra(t,r),r)}function EN(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 jR(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([Zd("templates"),Zd("components"),bN()]);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:EN(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,o)=>o.score-i.score||i.hit.label.localeCompare(o.hit.label)).slice(0,30).map(i=>i.hit)}function $R(t){return st.readText(t)}async function YR(t){const e=await Ge(`/api/read?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Not found: ${t}`);return URL.createObjectURL(await e.blob())}async function zR(t){if(await st.exists(t))throw new Error(`"${t}" already exists.`);const e=await Ge(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`)}async function WR(t,e){const n=`${t}/${Pg(e.name)}`;if(await st.exists(n))throw new Error(`"${n}" already exists.`);const r=await Ge(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",body:await e.arrayBuffer()});if(!r.ok)throw new Error(`Upload failed (${r.status})`);return n}async function Kg(t,e,n){const r=`${rt.content}/${t}.json`;if(await st.exists(r))throw new Error(`"${t}" already exists.`);const s={title:e,isPublished:!1};n!==void 0&&n!==""&&(s.template=n),s.fields={};const a=await Ge(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
45
+ `});if(!a.ok)throw new Error(`Create failed (${a.status})`);$i()}function TN(t){return st.exists(`${rt.content}/${t}.json`)}async function _N(t,e){const n=e.split("/").map(u=>({raw:u.trim(),slug:ps(u)})).filter(u=>u.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(u=>u.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${rt.content}/${a}/${bh}`;if(await st.exists(i))throw new Error(`"${a}" already exists.`);const o=await Ge(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
46
+ `});if(!o.ok)throw new Error(`Create folder failed (${o.status})`);return $i(),a}function Ah(t){return t===""?`${rt.content}/_sort.json`:`${rt.content}/${t}/_sort.json`}async function yh(t){try{const e=JSON.parse(await st.readText(Ah(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function AN(t){const e=await yh(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function yN(t,e){const n=await yh(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await Ge(`/api/write?path=${encodeURIComponent(Ah(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
47
+ `});if(!r.ok)throw new Error(`Save failed (${r.status})`)}async function NN(t,e){const n=await yh(t);n.order=[...e];const r=await Ge(`/api/write?path=${encodeURIComponent(Ah(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
48
+ `});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function GR(t,e){const n=await Ge(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);Nh(t);const r=await n.json().catch(()=>({}));return{...r.stamped!==void 0&&{stamped:r.stamped},...r.stampIncomplete===!0&&{stampIncomplete:!0},...r.schemaDelta!==void 0&&{schemaDelta:r.schemaDelta}}}function Nh(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&($d.clear(),Yd=void 0,_l=void 0,ph.bump()),t.some(n=>n.startsWith(`${rt.components}/`))&&(zd=void 0,Wd=void 0),t.some(n=>n.startsWith(`${rt.content}/`))&&$i()}function Bs(t){return`${rt.content}/${t}.json`}function di(t){return`${rt.content}/${t}`}async function Al(t){const e=await Ge(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);Nh(t)}async function Ra(t,e){const n=await Ge(`/api/rename?from=${encodeURIComponent(t)}&to=${encodeURIComponent(e)}`,{method:"POST"});if(!n.ok){const r=n.status===409?"a file or folder with that name already exists":`status ${n.status}`;throw new Error(`Rename failed, ${r}.`)}Nh(t,e)}const SN=/assets\/[A-Za-z0-9._-]+/g;async function wN(t,e,n){const r=Mo(t,n),s=Mo(e,n);if(r===s)return;const a=await Ge(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await Ge(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function IN(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 st.exists(Bs(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await st.readText(Bs(t));for(const o of new Set(i.match(SN)??[]))await wN(s,e,o);return await Ra(Bs(t),Bs(a)),$i(),a}async function CN(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 st.exists(di(a)))throw new Error(`A folder named "${r}" already exists there.`);return await Ra(di(t),di(a)),$i(),a}const Vg=`${rt.content}/_redirects.json`;async function LN(){try{const t=JSON.parse(await st.readText(Vg));return Array.isArray(t)?t:[]}catch{return[]}}async function xu(t,e){if(t!==e)try{const n=await LN();n.push({from:t,to:e});const r=await Ge(`/api/write?path=${encodeURIComponent(Vg)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
49
+ `});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const Xg=`${rt.content}/_site.json`;async function ON(){try{const t=JSON.parse(await st.readText(Xg));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function xN(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
50
+ `,r=await Ge(`/api/write?path=${encodeURIComponent(Xg)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const Qg=["html","css","js"];async function KR(t){const e=t.replace(/\.html$/,"");await Promise.all(Qg.map(n=>Al(`${e}.${n}`)))}async function RN(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of Qg){const a=`${n}.${s}`;await st.exists(a)&&await Ra(a,`${r}.${s}`)}}async function DN(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await gy(st,t,{draft:e,media:k3(n)});return r===void 0?void 0:jd(r.html,Jd)}async function Jd(t){const e=t.startsWith("/api/")?t:Dg(`public/${t.slice(1)}`);try{const n=await Ge(e);if(!n.ok)return;const r=new Uint8Array(await n.arrayBuffer());return{contentType:n.headers.get("content-type")??(t.startsWith("/api/")?"":PT(t)),bytes:r}}catch{return}}async function VR(t){return gs(t,await uu())}async function XR(t,e,n){const[r,s,a,i,o]=await Promise.all([uu(),iN(),oN(),gh(),Yg()]),u=_g(i),d=G3(o),h=m=>({...$3(j3(m),n),...Y3(m,n)});if(z3(t)){const m=W3(t),b=new Map(r).set(m,e.html),_=ap(new Map(s),m,e.css),A=ap(new Map(a),m,e.js),E=gs(e.html,b);return jd(Ld({template:K3(m,E,d),scope:h(E),components:b,componentStyles:_,componentScripts:A,context:u,media:tp()}),Jd)}const g=gs(e.html,r),f=Ld({template:e.html,scope:h(g),components:r,componentStyles:s,componentScripts:a,context:u,media:tp(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}});return jd(qg({htmlAttrs:d.htmlAttrs,headStyles:d.headStyles,title:"Template preview",body:f}),Jd)}function ap(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function kN(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 Zg="nanoesis:tree-expanded";function PN(){try{const t=JSON.parse(localStorage.getItem(Zg)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const Es=lt({}),fi=lt({}),ki=lt(PN());function Jg(){const t=Object.keys(ki).filter(e=>ki[e]);localStorage.setItem(Zg,JSON.stringify(t))}function ui(t){return Es[t]}function MN(t){return fi[t]===!0}function ei(t){return t===""||ki[t]===!0}async function Kl(t){if(!(Es[t]!==void 0||fi[t])){fi[t]=!0;try{Es[t]=await jg(t)}finally{fi[t]=!1}}}async function In(t){fi[t]=!0;try{Es[t]=await jg(t)}finally{fi[t]=!1}}async function BN(){await Promise.all(Object.keys(Es).map(t=>In(t)))}function ef(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function eb(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function tf(t,e,n){const r=Es[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(Es[t]={...r,entries:a})}function FN(t,e){const n=eb(t);if(n!==null){n!==""&&tf(ef(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}tf(ef(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function UN(t,e){eb(t)===null&&tf(ef(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function HN(t,e){const n=Es[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);Es[t]={...n,entries:s}}async function ip(t){ei(t)?ki[t]=!1:(ki[t]=!0,await Kl(t)),Jg()}async function ro(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,ki[n]=!0,await Kl(n);Jg()}const tb="nanoesis:dev-tree-expanded";function qN(){try{const t=JSON.parse(localStorage.getItem(tb)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return Object.fromEntries(vN.map(t=>[t,!0]))}const Bo=lt({}),hi=lt({}),Ia=lt(qN());function nb(){const t=Object.keys(Ia).filter(e=>Ia[e]);localStorage.setItem(tb,JSON.stringify(t))}function QR(t){return Bo[t]}function ZR(t){return hi[t]===!0}function JR(t){return Ia[t]===!0}async function rb(t){if(!(Bo[t]!==void 0||hi[t])){hi[t]=!0;try{Bo[t]=await _h(t)}finally{hi[t]=!1}}}async function jN(t){hi[t]=!0;try{Bo[t]=await _h(t)}finally{hi[t]=!1}}async function $N(){await Promise.all(Object.keys(Bo).map(t=>jN(t)))}async function eD(t){Ia[t]?Ia[t]=!1:(Ia[t]=!0,await rb(t)),nb()}let Ir=Z(null),Sh=Z(null);function tD(){return l(Ir)}function nD(){return l(Sh)}function rD(t,e){y(Ir,{entry:t,parent:e},!0)}function sD(t){y(Sh,t,!0)}function aD(){y(Ir,null),y(Sh,null)}const YN=new Set(["templates/home.html"]);function sb(t){return YN.has(t)}function iD(t,e){if(l(Ir)===null||e!=="dir"||sb(l(Ir).entry.path))return!1;const n=l(Ir).entry.path;return t!==n&&l(Ir).parent!==t&&!t.startsWith(`${n}/`)&&n.split("/")[0]===t.split("/")[0]}function oD(t){return l(Ir)===null||sb(l(Ir).entry.path)?!1:l(Ir).parent!==t&&l(Ir).entry.path.split("/")[0]===t}async function uD(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ia[n]=!0,await rb(n);nb()}const zN=9e4;function WN(t){if(typeof t!="object"||t===null)return{changed:!1,added:0,removed:0};const e=t,n=typeof e.added=="number"?e.added:0,r=typeof e.removed=="number"?e.removed:0;return{changed:n>0||r>0,added:n,removed:r}}function GN(t){const e=t.intervalMs??zN;let n=null,r=!1;async function s(){if(!(r||!t.isVisible())){r=!0;try{const a=await t.reconcileOnce();a.changed&&t.onChanged(a)}catch{}finally{r=!1}}}return{start(){n===null&&(n=setInterval(()=>void s(),e))},stop(){n!==null&&(clearInterval(n),n=null)}}}let Ht=Z(null);const Ru={get pending(){return l(Ht)}};function yl(t,e={}){return new Promise(n=>{y(Ht,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function yo(t,e={}){return new Promise(n=>{y(Ht,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function lD(t,e,n={}){return new Promise(r=>{y(Ht,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function KN(t,e){return new Promise(n=>{y(Ht,{kind:"decide",message:t,options:e,resolve:n},!0)})}function en(t,e={}){return new Promise(n=>{y(Ht,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Mc(t){var e;((e=l(Ht))==null?void 0:e.kind)==="confirm"&&(l(Ht).resolve(t),y(Ht,null))}function Bc(t){var e;((e=l(Ht))==null?void 0:e.kind)==="prompt"&&(l(Ht).resolve(t),y(Ht,null))}function Fc(t){var e;((e=l(Ht))==null?void 0:e.kind)==="select"&&(l(Ht).resolve(t),y(Ht,null))}function Du(t){var e;((e=l(Ht))==null?void 0:e.kind)==="decide"&&(l(Ht).resolve(t),y(Ht,null))}function op(){var t;((t=l(Ht))==null?void 0:t.kind)==="alert"&&(l(Ht).resolve(),y(Ht,null))}let up=Z(null);const ku=lt({}),nf={get active(){return l(up)},get hasDirty(){return Object.keys(ku).length>0},isDirty(t){return ku[t]===!0},setActive(t){y(up,t,!0)},setDirty(t,e){e?ku[t]=!0:delete ku[t]}};async function ab(t){const e=nf.active;if(e===null||!nf.isDirty(e.key))return!0;const n=t===void 0?"":`
49
51
 
50
- ${t}`,r=await zN(`You have unsaved changes to ${e.key}. Save them, discard them, or stay on this file?${n}`,{title:"Unsaved changes",primaryLabel:"Save",secondaryLabel:"Discard",cancelLabel:"Stay",secondaryDanger:!0});if(r==="cancel")return!1;if(r==="secondary")return e.discard(),!0;try{return await e.flush(),!0}catch(s){return await en(`Couldn't save ${e.key}: ${s instanceof Error?s.message:String(s)}
52
+ ${t}`,r=await KN(`You have unsaved changes to ${e.key}. Save them, discard them, or stay on this file?${n}`,{title:"Unsaved changes",primaryLabel:"Save",secondaryLabel:"Discard",cancelLabel:"Stay",secondaryDanger:!0});if(r==="cancel")return!1;if(r==="secondary")return e.discard(),!0;try{return await e.flush(),!0}catch(s){return await en(`Couldn't save ${e.key}: ${s instanceof Error?s.message:String(s)}
51
53
 
52
- You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}const rb="nanoesis-restore:",sb="nanoesis:unit-values:",ab="nanoesis:tree-expanded",ib="nanoesis:dev-tree-expanded";function WN(t){t.removeItem(ab),t.removeItem(ib);for(let e=t.length-1;e>=0;e--){const n=t.key(e);n!==null&&(n.startsWith(rb)||n.startsWith(sb))&&t.removeItem(n)}}function lp(t,e){t.removeItem(`${rb}${e}`),t.removeItem(`${sb}${e}`);for(const n of[ab,ib]){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{}}}/**
54
+ You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}const ib="nanoesis-restore:",ob="nanoesis:unit-values:",ub="nanoesis:tree-expanded",lb="nanoesis:dev-tree-expanded";function VN(t){t.removeItem(ub),t.removeItem(lb);for(let e=t.length-1;e>=0;e--){const n=t.key(e);n!==null&&(n.startsWith(ib)||n.startsWith(ob))&&t.removeItem(n)}}function lp(t,e){t.removeItem(`${ib}${e}`),t.removeItem(`${ob}${e}`);for(const n of[ub,lb]){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{}}}/**
53
55
  * @file
54
56
  * @license @lucide/svelte v1.16.0 - ISC
55
57
  *
56
58
  * This source code is licensed under the ISC license.
57
59
  * See the LICENSE file in the root directory of this source tree.
58
- */const GN={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"};/**
60
+ */const XN={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"};/**
59
61
  * @file
60
62
  * @license @lucide/svelte v1.16.0 - ISC
61
63
  *
62
64
  * This source code is licensed under the ISC license.
63
65
  * See the LICENSE file in the root directory of this source tree.
64
- */const KN=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
66
+ */const QN=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
65
67
  * @file
66
68
  * @license @lucide/svelte v1.16.0 - ISC
67
69
  *
68
70
  * This source code is licensed under the ISC license.
69
71
  * See the LICENSE file in the root directory of this source tree.
70
- */const VN=Symbol("lucide-context"),XN=()=>dE(VN);var QN=tT("<svg><!><!></svg>");function Pr(t,e){ct(e,!0);const n=XN()??{},r=ir(e,"color",19,()=>n.color??"currentColor"),s=ir(e,"size",19,()=>n.size??24),a=ir(e,"strokeWidth",19,()=>n.strokeWidth??2),i=ir(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),o=ir(e,"iconNode",19,()=>[]),u=hr(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),d=Ae(()=>i()?Number(a())*24/Number(s()):a());var h=QN();f0(h,m=>({...GN,...m,...u,width:s(),height:s(),stroke:r(),"stroke-width":l(d),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!KN(u)&&{"aria-hidden":"true"}]);var g=S(h);It(g,17,o,xo,(m,b)=>{var _=Ae(()=>Rv(l(b),2));let A=()=>l(_)[0],E=()=>l(_)[1];var C=Gn(),I=nt(C);dT(I,A,!0,(H,B)=>{f0(H,()=>({...E()}))}),q(m,C)});var f=x(g);cT(f,()=>e.children??Pf),q(t,h),dt()}function wh(t,e){let n=hr(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"}]];Pr(t,Dr({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function ZN(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Pr(t,Dr({name:"plus"},()=>n,{get iconNode(){return r}}))}function Ih(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Pr(t,Dr({name:"x"},()=>n,{get iconNode(){return r}}))}function JN(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];Pr(t,Dr({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function e6(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];Pr(t,Dr({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function ob(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];Pr(t,Dr({name:"search"},()=>n,{get iconNode(){return r}}))}function t6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"house"},()=>n,{get iconNode(){return r}}))}function n6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"link"},()=>n,{get iconNode(){return r}}))}function r6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"external-link"},()=>n,{get iconNode(){return r}}))}function rf(t,e){let n=hr(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"}]];Pr(t,Dr({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function s6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}let Ch=Z(null),Lh=Z(null);function li(){return l(Ch)}function cp(){return l(Lh)}function a6(t,e){y(Ch,{entry:t,parent:e},!0)}function Uc(t){y(Lh,t,!0)}function Cs(){y(Ch,null),y(Lh,null)}let Hc=Z(null);const sf={get target(){return l(Hc)},request(t){y(Hc,t,!0)},clear(){y(Hc,null)}};function i6(){let t=Z("content");return{get mode(){return l(t)},set(e){y(t,e,!0)}}}const Ar=i6(),o6="nanoesis-restore:";function af(t){return`${o6}${t}`}function u6(t,e,n){t.getItem(af(e))===null&&t.setItem(af(e),JSON.stringify(n))}function l6(t,e){const n=t.getItem(af(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function c6(){let t=Z("saved"),e=null;return{get state(){return l(t)},get canRetry(){return l(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 Os=c6(),d6=new Set(["title","created","published","updated"]);function f6(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 h6(t,e,n){if(t.type==="authors")return f6(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 p6(t){return t===""||Array.isArray(t)&&t.length===0}function dp(t,e,n,r=t.isPublished){const s={...t.fields},a={title:t.title,created:t.created,published:t.published,updated:t.updated};for(const o of e){const u=n[o.name]??"";if(d6.has(o.name)){a[o.name]=o.name==="title"?u:u||void 0;continue}const d=h6(o,t.fields[o.name],u);p6(d)?delete s[o.name]:s[o.name]=d}const i={};return t.template!==void 0&&(i.template=t.template),i.title=a.title,i.isPublished=r,a.created!==void 0&&(i.created=a.created),a.published!==void 0&&(i.published=a.published),a.updated!==void 0&&(i.updated=a.updated),i.fields=s,`${JSON.stringify(i,null,2)}
71
- `}function of(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 m6=0;var g6=z('<li draggable="true"><span class="grip svelte-5hnbr8" aria-hidden="true"><!></span> <span class="name svelte-5hnbr8"> </span> <button type="button" class="remove svelte-5hnbr8"><!></button></li>'),b6=z('<ul class="pills svelte-5hnbr8"></ul>'),v6=z('<li role="option"> </li>'),E6=z('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),T6=z('<div class="authors svelte-5hnbr8" role="group"><!> <div class="add svelte-5hnbr8"><input type="text" class="add-input svelte-5hnbr8" placeholder="Add an author…" autocomplete="off" role="combobox" aria-autocomplete="list"/> <!></div></div>');function _6(t,e){ct(e,!0);function n(G){if(G.trim()==="")return[];try{const ee=JSON.parse(G);return Array.isArray(ee)?ee.flatMap(le=>{if(le===null||typeof le!="object")return[];const be=le,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-${++m6}`;let a=Z(lt([])),i=Z(""),o=Z(!1),u=Z(0),d=Z(void 0),h=Z(null),g=Z(null);Dt(()=>{G3().then(G=>y(a,G,!0))});const f=Ae(()=>new Map(l(a).map(G=>[G.user,G.name]))),m=Ae(()=>new Set(l(r).map(G=>G.user).filter(G=>G!==void 0)));function b(G){return G.user!==void 0?l(f).get(G.user)??G.name:G.name}const _=Ae(()=>{const G=l(i).trim().toLowerCase();return G===""?[]:l(a).filter(ee=>!l(m).has(ee.user)&&ee.name.toLowerCase().includes(G)).slice(0,6)}),A=Ae(()=>l(o)&&l(i).trim()!==""),E=Ae(()=>l(_).length),C=Ae(()=>l(A)?l(u)<l(_).length?`${s}-opt-${l(u)}`:`${s}-guest`:void 0);function I(G){e.onchange(G.length===0?"":JSON.stringify(G))}function H(G){l(m).has(G.user)||(I([...l(r),{name:G.name,user:G.user}]),y(i,""))}function B(G){const ee=G.trim();ee!==""&&(I([...l(r),{name:ee}]),y(i,""))}function J(){const G=l(_)[l(u)];G!==void 0?H(G):B(l(i))}function F(){var G,ee;(ee=(G=l(d))==null?void 0:G.children[l(u)])==null||ee.scrollIntoView({block:"nearest"})}function Y(G){if(!l(A)){G.key==="Enter"&&(G.preventDefault(),B(l(i)));return}const ee=l(_).length+1;G.key==="ArrowDown"?(G.preventDefault(),y(u,(l(u)+1)%ee),F()):G.key==="ArrowUp"?(G.preventDefault(),y(u,(l(u)-1+ee)%ee),F()):G.key==="Enter"?(G.preventDefault(),J()):G.key==="Escape"&&(G.preventDefault(),y(i,""))}function X(G){I(l(r).filter((ee,le)=>le!==G))}function te(G,ee){var le;y(h,G,!0),(le=ee.dataTransfer)==null||le.setData("text/plain",String(G)),ee.dataTransfer&&(ee.dataTransfer.effectAllowed="move")}function T(G,ee){l(h)!==null&&(ee.preventDefault(),y(g,G,!0))}function D(G){l(h)!==null&&l(h)!==G&&I(of(l(r),l(h),G)),y(h,null),y(g,null)}function v(){y(h,null),y(g,null)}var R=T6(),k=S(R);{var O=G=>{var ee=b6();It(ee,21,()=>l(r),xo,(le,be,pe)=>{var Ne=g6();let ce;var he=S(Ne),Se=S(he);rf(Se,{size:14});var ye=x(he,2),Ie=S(ye),xe=x(ye,2),De=S(xe);Ih(De,{size:14,"aria-hidden":"true"}),se((ze,et)=>{ce=Je(Ne,1,"pill svelte-5hnbr8",null,ce,{guest:l(be).user===void 0,dragging:l(h)===pe,over:l(g)===pe&&l(h)!==pe}),ve(ye,"title",l(be).user??"Guest"),oe(Ie,ze),ve(xe,"aria-label",et)},[()=>b(l(be)),()=>`Remove ${b(l(be))}`]),Be("dragstart",Ne,ze=>te(pe,ze)),Be("dragover",Ne,ze=>T(pe,ze)),Be("drop",Ne,()=>D(pe)),Be("dragend",Ne,v),ae("click",xe,()=>X(pe)),q(le,Ne)}),q(G,ee)};de(k,G=>{l(r).length>0&&G(O)})}var W=x(k,2),j=S(W),M=x(j,2);{var $=G=>{var ee=E6(),le=S(ee);It(le,19,()=>l(_),ce=>ce.user,(ce,he,Se)=>{var ye=v6();let Ie;var xe=S(ye);se(()=>{ve(ye,"id",`${s}-opt-${l(Se)}`),Ie=Je(ye,1,"option svelte-5hnbr8",null,Ie,{active:l(Se)===l(u)}),ve(ye,"aria-selected",l(Se)===l(u)),oe(xe,l(he).name)}),ae("click",ye,()=>H(l(he))),Be("mouseenter",ye,()=>y(u,l(Se),!0)),q(ce,ye)});var be=x(le,2);let pe;var Ne=S(be);pn(ee,ce=>y(d,ce),()=>l(d)),se(ce=>{ve(ee,"id",`${s}-listbox`),ve(be,"id",`${s}-guest`),pe=Je(be,1,"option guest-option svelte-5hnbr8",null,pe,{active:l(u)===l(E)}),ve(be,"aria-selected",l(u)===l(E)),oe(Ne,`Add “${ce??""}” as a guest`)},[()=>l(i).trim()]),ae("click",be,()=>B(l(i))),Be("mouseenter",be,()=>y(u,l(E),!0)),q(G,ee)};de(M,G=>{l(A)&&G($)})}se(()=>{ve(R,"aria-labelledby",e.labelledBy),ve(j,"aria-expanded",l(A)),ve(j,"aria-controls",`${s}-listbox`),ve(j,"aria-activedescendant",l(C))}),ae("input",j,()=>y(u,0)),ae("keydown",j,Y),Be("focus",j,()=>{y(o,!0),y(u,0)}),Be("blur",j,()=>setTimeout(()=>y(o,!1),120)),vt(j,()=>l(i),G=>y(i,G)),q(t,R),dt()}bt(["click","input","keydown"]);var A6=z('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),y6=z('<p class="empty svelte-1nm0yno">No file selected.</p>'),N6=z('<li class="hint svelte-1nm0yno">Loading…</li>'),S6=z('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),w6=z('<li><button type="button"> </button></li>'),I6=z('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),C6=z('<p class="error svelte-1nm0yno" role="alert"> </p>'),L6=z('<div class="file-field svelte-1nm0yno" role="group"><!> <div class="actions svelte-1nm0yno"><button type="button" class="action svelte-1nm0yno"> </button> <label class="action upload svelte-1nm0yno">Upload… <input type="file" class="svelte-1nm0yno"/></label></div> <!> <!></div>');function O6(t,e){ct(e,!0);let n=Z(lt([])),r=Z(!1),s=Z(!1),a=!1,i=Z(null);const o=Ae(()=>e.value.split("/").pop()??e.value);async function u(){y(s,!0);try{y(n,await fN(e.itemDir),!0),a=!0}finally{y(s,!1)}}function d(){y(r,!l(r)),l(r)&&!a&&u()}function h(X){var D;const te=X.currentTarget,T=(D=te.files)==null?void 0:D[0];te.value="",T&&g(T)}async function g(X){y(i,null);try{e.onchange(await Th(e.itemDir,X)),a=!1,l(r)&&await u()}catch(te){y(i,te instanceof Error?te.message:String(te),!0)}}var f=L6(),m=S(f);{var b=X=>{var te=A6(),T=S(te),D=S(T),v=x(T,2);se(R=>{ve(T,"href",R),oe(D,l(o))},[()=>ou(e.itemDir,e.value)]),ae("click",v,()=>e.onchange("")),q(X,te)},_=X=>{var te=y6();q(X,te)};de(m,X=>{e.value?X(b):X(_,-1)})}var A=x(m,2),E=S(A),C=S(E),I=x(E,2),H=x(S(I)),B=x(A,2);{var J=X=>{var te=I6(),T=S(te);{var D=k=>{var O=N6();q(k,O)},v=k=>{var O=S6();q(k,O)},R=k=>{var O=Gn(),W=nt(O);It(W,16,()=>l(n),j=>j,(j,M)=>{const $=Ae(()=>kg(M));var G=w6(),ee=S(G);let le;var be=S(ee);se(()=>{le=Je(ee,1,"file svelte-1nm0yno",null,le,{selected:e.value===l($)}),ve(ee,"aria-pressed",e.value===l($)),oe(be,M)}),ae("click",ee,()=>e.onchange(l($))),q(j,G)}),q(k,O)};de(T,k=>{l(s)?k(D):l(n).length===0?k(v,1):k(R,-1)})}q(X,te)};de(B,X=>{l(r)&&X(J)})}var F=x(B,2);{var Y=X=>{var te=C6(),T=S(te);se(()=>oe(T,l(i))),q(X,te)};de(F,X=>{l(i)&&X(Y)})}se(()=>{ve(f,"aria-labelledby",e.labelledBy),ve(E,"aria-expanded",l(r)),oe(C,l(r)?"Hide files":"Choose from files")}),ae("click",E,d),ae("change",H,h),q(t,f),dt()}bt(["click","change"]);var x6=z('<div class="preview svelte-s6anrr"><img class="preview-img svelte-s6anrr" alt=""/> <div class="preview-meta svelte-s6anrr"><span class="filename svelte-s6anrr"> </span> <div class="row svelte-s6anrr"><label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label> <button type="button" class="link svelte-s6anrr">Remove</button></div></div></div>'),R6=z('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),D6=z('<p class="error svelte-s6anrr" role="alert"> </p>'),k6=z('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function P6(t,e){ct(e,!0);let n=Z(!1),r=Z(null);const s=Ae(()=>e.value===""?"":/^(\/|[a-z][a-z0-9+.-]*:)/i.test(e.value)?e.value:ou(e.itemDir,e.value));function a(m){var A;const b=m.currentTarget,_=(A=b.files)==null?void 0:A[0];b.value="",_&&i(_)}async function i(m){y(r,null),y(n,!0);try{e.onchange(await Th(e.itemDir,m))}catch(b){y(r,b instanceof Error?b.message:String(b),!0)}finally{y(n,!1)}}var o=k6(),u=S(o);{var d=m=>{var b=x6(),_=S(b),A=x(_,2),E=S(A),C=S(E),I=x(E,2),H=S(I);let B;var J=S(H),F=x(J),Y=x(H,2);se(()=>{ve(_,"src",l(s)),oe(C,e.value),B=Je(H,1,"action svelte-s6anrr",null,B,{busy:l(n)}),oe(J,`${l(n)?"Uploading…":"Replace…"} `),F.disabled=l(n)}),ae("change",F,a),ae("click",Y,()=>e.onchange("")),q(m,b)},h=m=>{var b=R6();let _;var A=S(b),E=x(A);se(()=>{_=Je(b,1,"action svelte-s6anrr",null,_,{busy:l(n)}),oe(A,`${l(n)?"Uploading…":"Upload image…"} `),E.disabled=l(n)}),ae("change",E,a),q(m,b)};de(u,m=>{e.value?m(d):m(h,-1)})}var g=x(u,2);{var f=m=>{var b=D6(),_=S(b);se(()=>oe(_,l(r))),q(m,b)};de(g,m=>{l(r)&&m(f)})}se(()=>ve(o,"aria-labelledby",e.labelledBy)),q(t,o),dt()}bt(["change","click"]);var M6=z("<option> </option>"),B6=z("<option>Top level</option>"),F6=z("<option> </option>"),U6=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Move</h3> <div class="manage svelte-wge2ya"><label class="grow svelte-wge2ya"><span class="visually-hidden svelte-wge2ya">Move to folder</span> <select class="svelte-wge2ya"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-wge2ya">Move</button></div></div>'),H6=z('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),q6=z('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),j6=z(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
72
- heading at the top of the form.</p>`),$6=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),Y6=z('<dialog aria-label="Edit item" class="svelte-wge2ya"><form><h2 class="svelte-wge2ya">Edit item</h2> <label class="svelte-wge2ya"><span class="svelte-wge2ya">Template</span> <select class="svelte-wge2ya"></select> <span class="help svelte-wge2ya">Switching keeps any field values the new template doesn’t use.</span></label> <!> <!> <div class="actions svelte-wge2ya"><button type="button" class="ghost svelte-wge2ya">Cancel</button> <button type="submit" class="primary svelte-wge2ya">Save</button></div></form></dialog>');function z6(t,e){ct(e,!0);const n=ir(e,"currentFolder",3,""),r=ir(e,"folders",19,()=>[]);let s,a=Z(lt(e.templateName));const i="\0";let o=Z(i);const u=Ae(()=>r().filter(B=>B!==n())),d=Ae(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);Ua(()=>s.showModal());function h(B){B.preventDefault(),l(a)!==e.templateName?e.onchangetemplate(l(a)):e.onclose()}var g=Y6(),f=S(g),m=x(S(f),2),b=x(S(m),2);It(b,20,()=>l(d),B=>B,(B,J)=>{var F=M6(),Y=S(F),X={};se(()=>{oe(Y,J),X!==(X=J)&&(F.value=(F.__value=J)??"")}),q(B,F)});var _=x(m,2);{var A=B=>{var J=U6(),F=x(S(J),2),Y=S(F),X=x(S(Y),2),te=S(X);te.value=te.__value=i;var T=x(te);{var D=k=>{var O=B6();O.value=O.__value="",q(k,O)};de(T,k=>{n()!==""&&k(D)})}var v=x(T);It(v,16,()=>l(u),k=>k,(k,O)=>{var W=F6(),j=S(W),M={};se(()=>{oe(j,`${O??""}/`),M!==(M=O)&&(W.value=(W.__value=O)??"")}),q(k,W)});var R=x(Y,2);se(()=>R.disabled=l(o)===i),xa(X,()=>l(o),k=>y(o,k)),ae("click",R,()=>e.onmove(l(o))),q(B,J)};de(_,B=>{e.onmove&&B(A)})}var E=x(_,2);{var C=B=>{var J=$6(),F=x(S(J),2),Y=S(F);{var X=R=>{var k=H6();ae("click",k,function(...O){var W;(W=e.onrename)==null||W.apply(this,O)}),q(R,k)};de(Y,R=>{e.onrename&&R(X)})}var te=x(Y,2);{var T=R=>{var k=q6();ae("click",k,function(...O){var W;(W=e.ondelete)==null||W.apply(this,O)}),q(R,k)};de(te,R=>{e.ondelete&&R(T)})}var D=x(F,2);{var v=R=>{var k=j6();q(R,k)};de(D,R=>{e.onrename&&R(v)})}q(B,J)};de(E,B=>{(e.onrename||e.ondelete)&&B(C)})}var I=x(E,2),H=S(I);pn(g,B=>s=B,()=>s),Be("close",g,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),Be("cancel",g,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),Be("submit",f,h),xa(b,()=>l(a),B=>y(a,B)),ae("click",H,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),q(t,g),dt()}bt(["click"]);let No=Z(null);const W6={get pending(){return l(No)}};function ub(t=""){return new Promise(e=>{y(No,{current:t,resolve:e},!0)})}function Za(t){l(No)!==null&&(l(No).resolve(t),y(No,null))}const Oh="ref:";function Fo(t){return t.startsWith(Oh)}function uf(t){return Fo(t)?t.slice(Oh.length):t}function G6(t){return`${Oh}${t}`}var K6=z('<!> <span class="target svelte-147ryxk"> </span>',1),V6=z('<!> <span class="target svelte-147ryxk"> </span>',1),X6=z('<span class="value svelte-147ryxk"><!></span> <button type="button" class="action svelte-147ryxk">Edit</button> <button type="button" class="action svelte-147ryxk">Clear</button>',1),Q6=z('<button type="button" class="action svelte-147ryxk">Set link…</button>'),Z6=z('<div class="link-field svelte-147ryxk" role="group"><!></div>');function J6(t,e){ct(e,!0);async function n(){const o=await ub(e.value);o!==null&&e.onchange(o)}var r=Z6(),s=S(r);{var a=o=>{var u=X6(),d=nt(u),h=S(d);{var g=A=>{var E=K6(),C=nt(E);n6(C,{size:14,"aria-hidden":"true"});var I=x(C,2),H=S(I);se((B,J)=>{ve(I,"title",B),oe(H,J)},[()=>`Page: ${uf(e.value)}`,()=>uf(e.value)]),q(A,E)},f=Ae(()=>Fo(e.value)),m=A=>{var E=V6(),C=nt(E);r6(C,{size:14,"aria-hidden":"true"});var I=x(C,2),H=S(I);se(()=>{ve(I,"title",e.value),oe(H,e.value)}),q(A,E)};de(h,A=>{l(f)?A(g):A(m,-1)})}var b=x(d,2),_=x(b,2);ae("click",b,n),ae("click",_,()=>e.onchange("")),q(o,u)},i=o=>{var u=Q6();ae("click",u,n),q(o,u)};de(s,o=>{e.value?o(a):o(i,-1)})}se(()=>ve(r,"aria-labelledby",e.labelledBy)),q(t,r),dt()}bt(["click"]);var eS=z('<p class="note error svelte-1v8pkea"> </p>'),tS=z('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),nS=z('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),rS=z('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),sS=z('<section class="preview svelte-1v8pkea" aria-label="Preview"><header class="bar svelte-1v8pkea"><strong class="title svelte-1v8pkea">Preview</strong> <span class="dims svelte-1v8pkea" title="Current preview width"> </span> <button type="button" class="close svelte-1v8pkea" title="Close preview" aria-label="Close preview"><!></button></header> <div class="frame svelte-1v8pkea"><!></div></section>');function aS(t,e){ct(e,!0);let n=Z(""),r=Z("loading"),s=Z(""),a=Z(0),i=Z(void 0),o={x:0,y:0};function u(){var F;try{const Y=(F=l(i))==null?void 0:F.contentWindow;Y&&(o={x:Y.scrollX,y:Y.scrollY})}catch{}}function d(){var F,Y;try{(Y=(F=l(i))==null?void 0:F.contentWindow)==null||Y.scrollTo(o.x,o.y)}catch{}}let h;Dt(()=>{const F=e.previewItem,Y=e.path;if(clearTimeout(h),F===null){y(r,"loading");return}return h=setTimeout(()=>void g(Y,F),350),()=>clearTimeout(h)});async function g(F,Y){try{const X=await ON(F,Y);if(X===void 0){y(r,"empty");return}u(),y(n,X,!0),y(r,"ready")}catch(X){y(s,X instanceof Error?X.message:String(X),!0),y(r,"error")}}var f=sS(),m=S(f),b=x(S(m),2),_=S(b),A=x(b,2),E=S(A);Ih(E,{size:18,"aria-hidden":"true"});var C=x(m,2),I=S(C);{var H=F=>{var Y=eS(),X=S(Y);se(()=>oe(X,`Couldn’t render preview: ${l(s)??""}`)),q(F,Y)},B=F=>{var Y=tS();q(F,Y)},J=F=>{var Y=rS(),X=nt(Y);pn(X,D=>y(i,D),()=>l(i));var te=x(X,2);{var T=D=>{var v=nS();q(D,v)};de(te,D=>{l(r)==="loading"&&D(T)})}se(()=>ve(X,"srcdoc",l(n))),Be("load",X,d),q(F,Y)};de(I,F=>{l(r)==="error"?F(H):l(r)==="empty"?F(B,1):F(J,-1)})}se(F=>oe(_,`${F??""}px`),[()=>Math.round(l(a))]),ae("click",A,function(...F){var Y;(Y=e.onclose)==null||Y.apply(this,F)}),wT(C,"clientWidth",F=>y(a,F)),q(t,f),dt()}bt(["click"]);var lb=typeof global=="object"&&global&&global.Object===Object&&global,iS=typeof self=="object"&&self&&self.Object===Object&&self,ss=lb||iS||Function("return this")(),Gs=ss.Symbol,cb=Object.prototype,oS=cb.hasOwnProperty,uS=cb.toString,so=Gs?Gs.toStringTag:void 0;function lS(t){var e=oS.call(t,so),n=t[so];try{t[so]=void 0;var r=!0}catch{}var s=uS.call(t);return r&&(e?t[so]=n:delete t[so]),s}var cS=Object.prototype,dS=cS.toString;function fS(t){return dS.call(t)}var hS="[object Null]",pS="[object Undefined]",fp=Gs?Gs.toStringTag:void 0;function Yi(t){return t==null?t===void 0?pS:hS:fp&&fp in Object(t)?lS(t):fS(t)}function Ts(t){return t!=null&&typeof t=="object"}var Da=Array.isArray;function Qs(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function db(t){return t}var mS="[object AsyncFunction]",gS="[object Function]",bS="[object GeneratorFunction]",vS="[object Proxy]";function xh(t){if(!Qs(t))return!1;var e=Yi(t);return e==gS||e==bS||e==mS||e==vS}var qc=ss["__core-js_shared__"],hp=(function(){var t=/[^.]+$/.exec(qc&&qc.keys&&qc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ES(t){return!!hp&&hp in t}var TS=Function.prototype,_S=TS.toString;function ja(t){if(t!=null){try{return _S.call(t)}catch{}try{return t+""}catch{}}return""}var AS=/[\\^$.*+?()[\]{}|]/g,yS=/^\[object .+?Constructor\]$/,NS=Function.prototype,SS=Object.prototype,wS=NS.toString,IS=SS.hasOwnProperty,CS=RegExp("^"+wS.call(IS).replace(AS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function LS(t){if(!Qs(t)||ES(t))return!1;var e=xh(t)?CS:yS;return e.test(ja(t))}function OS(t,e){return t==null?void 0:t[e]}function $a(t,e){var n=OS(t,e);return LS(n)?n:void 0}var lf=$a(ss,"WeakMap"),pp=Object.create,xS=(function(){function t(){}return function(e){if(!Qs(e))return{};if(pp)return pp(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function RS(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 DS(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var kS=800,PS=16,MS=Date.now;function BS(t){var e=0,n=0;return function(){var r=MS(),s=PS-(r-n);if(n=r,s>0){if(++e>=kS)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function FS(t){return function(){return t}}var Nl=(function(){try{var t=$a(Object,"defineProperty");return t({},"",{}),t}catch{}})(),US=Nl?function(t,e){return Nl(t,"toString",{configurable:!0,enumerable:!1,value:FS(e),writable:!0})}:db,HS=BS(US);function qS(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var jS=9007199254740991,$S=/^(?:0|[1-9]\d*)$/;function fb(t,e){var n=typeof t;return e=e??jS,!!e&&(n=="number"||n!="symbol"&&$S.test(t))&&t>-1&&t%1==0&&t<e}function Rh(t,e,n){e=="__proto__"&&Nl?Nl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function lu(t,e){return t===e||t!==t&&e!==e}var YS=Object.prototype,zS=YS.hasOwnProperty;function hb(t,e,n){var r=t[e];(!(zS.call(t,e)&&lu(r,n))||n===void 0&&!(e in t))&&Rh(t,e,n)}function WS(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var o=e[a],u=void 0;u===void 0&&(u=t[o]),s?Rh(n,o,u):hb(n,o,u)}return n}var mp=Math.max;function GS(t,e,n){return e=mp(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=mp(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=n(i),RS(t,this,o)}}function KS(t,e){return HS(GS(t,e,db),t+"")}var VS=9007199254740991;function pb(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=VS}function Vl(t){return t!=null&&pb(t.length)&&!xh(t)}function XS(t,e,n){if(!Qs(n))return!1;var r=typeof e;return(r=="number"?Vl(n)&&fb(e,n.length):r=="string"&&e in n)?lu(n[e],t):!1}function QS(t){return KS(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&&XS(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=n[r];o&&t(e,o,r,a)}return e})}var ZS=Object.prototype;function Dh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ZS;return t===n}function JS(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var ew="[object Arguments]";function gp(t){return Ts(t)&&Yi(t)==ew}var mb=Object.prototype,tw=mb.hasOwnProperty,nw=mb.propertyIsEnumerable,cf=gp((function(){return arguments})())?gp:function(t){return Ts(t)&&tw.call(t,"callee")&&!nw.call(t,"callee")};function rw(){return!1}var gb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bp=gb&&typeof module=="object"&&module&&!module.nodeType&&module,sw=bp&&bp.exports===gb,vp=sw?ss.Buffer:void 0,aw=vp?vp.isBuffer:void 0,Uo=aw||rw,iw="[object Arguments]",ow="[object Array]",uw="[object Boolean]",lw="[object Date]",cw="[object Error]",dw="[object Function]",fw="[object Map]",hw="[object Number]",pw="[object Object]",mw="[object RegExp]",gw="[object Set]",bw="[object String]",vw="[object WeakMap]",Ew="[object ArrayBuffer]",Tw="[object DataView]",_w="[object Float32Array]",Aw="[object Float64Array]",yw="[object Int8Array]",Nw="[object Int16Array]",Sw="[object Int32Array]",ww="[object Uint8Array]",Iw="[object Uint8ClampedArray]",Cw="[object Uint16Array]",Lw="[object Uint32Array]",wt={};wt[_w]=wt[Aw]=wt[yw]=wt[Nw]=wt[Sw]=wt[ww]=wt[Iw]=wt[Cw]=wt[Lw]=!0;wt[iw]=wt[ow]=wt[Ew]=wt[uw]=wt[Tw]=wt[lw]=wt[cw]=wt[dw]=wt[fw]=wt[hw]=wt[pw]=wt[mw]=wt[gw]=wt[bw]=wt[vw]=!1;function Ow(t){return Ts(t)&&pb(t.length)&&!!wt[Yi(t)]}function kh(t){return function(e){return t(e)}}var bb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,So=bb&&typeof module=="object"&&module&&!module.nodeType&&module,xw=So&&So.exports===bb,jc=xw&&lb.process,Pi=(function(){try{var t=So&&So.require&&So.require("util").types;return t||jc&&jc.binding&&jc.binding("util")}catch{}})(),Ep=Pi&&Pi.isTypedArray,Ph=Ep?kh(Ep):Ow,Rw=Object.prototype,Dw=Rw.hasOwnProperty;function vb(t,e){var n=Da(t),r=!n&&cf(t),s=!n&&!r&&Uo(t),a=!n&&!r&&!s&&Ph(t),i=n||r||s||a,o=i?JS(t.length,String):[],u=o.length;for(var d in t)(e||Dw.call(t,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||fb(d,u)))&&o.push(d);return o}function Eb(t,e){return function(n){return t(e(n))}}var kw=Eb(Object.keys,Object),Pw=Object.prototype,Mw=Pw.hasOwnProperty;function Bw(t){if(!Dh(t))return kw(t);var e=[];for(var n in Object(t))Mw.call(t,n)&&n!="constructor"&&e.push(n);return e}function Fw(t){return Vl(t)?vb(t):Bw(t)}function Uw(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var Hw=Object.prototype,qw=Hw.hasOwnProperty;function jw(t){if(!Qs(t))return Uw(t);var e=Dh(t),n=[];for(var r in t)r=="constructor"&&(e||!qw.call(t,r))||n.push(r);return n}function Tb(t){return Vl(t)?vb(t,!0):jw(t)}var Ho=$a(Object,"create");function $w(){this.__data__=Ho?Ho(null):{},this.size=0}function Yw(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var zw="__lodash_hash_undefined__",Ww=Object.prototype,Gw=Ww.hasOwnProperty;function Kw(t){var e=this.__data__;if(Ho){var n=e[t];return n===zw?void 0:n}return Gw.call(e,t)?e[t]:void 0}var Vw=Object.prototype,Xw=Vw.hasOwnProperty;function Qw(t){var e=this.__data__;return Ho?e[t]!==void 0:Xw.call(e,t)}var Zw="__lodash_hash_undefined__";function Jw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ho&&e===void 0?Zw:e,this}function ka(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ka.prototype.clear=$w;ka.prototype.delete=Yw;ka.prototype.get=Kw;ka.prototype.has=Qw;ka.prototype.set=Jw;function eI(){this.__data__=[],this.size=0}function Xl(t,e){for(var n=t.length;n--;)if(lu(t[n][0],e))return n;return-1}var tI=Array.prototype,nI=tI.splice;function rI(t){var e=this.__data__,n=Xl(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():nI.call(e,n,1),--this.size,!0}function sI(t){var e=this.__data__,n=Xl(e,t);return n<0?void 0:e[n][1]}function aI(t){return Xl(this.__data__,t)>-1}function iI(t,e){var n=this.__data__,r=Xl(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ys(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])}}ys.prototype.clear=eI;ys.prototype.delete=rI;ys.prototype.get=sI;ys.prototype.has=aI;ys.prototype.set=iI;var qo=$a(ss,"Map");function oI(){this.size=0,this.__data__={hash:new ka,map:new(qo||ys),string:new ka}}function uI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ql(t,e){var n=t.__data__;return uI(e)?n[typeof e=="string"?"string":"hash"]:n.map}function lI(t){var e=Ql(this,t).delete(t);return this.size-=e?1:0,e}function cI(t){return Ql(this,t).get(t)}function dI(t){return Ql(this,t).has(t)}function fI(t,e){var n=Ql(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Ya(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])}}Ya.prototype.clear=oI;Ya.prototype.delete=lI;Ya.prototype.get=cI;Ya.prototype.has=dI;Ya.prototype.set=fI;function hI(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var _b=Eb(Object.getPrototypeOf,Object),pI="[object Object]",mI=Function.prototype,gI=Object.prototype,Ab=mI.toString,bI=gI.hasOwnProperty,vI=Ab.call(Object);function EI(t){if(!Ts(t)||Yi(t)!=pI)return!1;var e=_b(t);if(e===null)return!0;var n=bI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Ab.call(n)==vI}function TI(){this.__data__=new ys,this.size=0}function _I(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function AI(t){return this.__data__.get(t)}function yI(t){return this.__data__.has(t)}var NI=200;function SI(t,e){var n=this.__data__;if(n instanceof ys){var r=n.__data__;if(!qo||r.length<NI-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ya(r)}return n.set(t,e),this.size=n.size,this}function Qr(t){var e=this.__data__=new ys(t);this.size=e.size}Qr.prototype.clear=TI;Qr.prototype.delete=_I;Qr.prototype.get=AI;Qr.prototype.has=yI;Qr.prototype.set=SI;var yb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tp=yb&&typeof module=="object"&&module&&!module.nodeType&&module,wI=Tp&&Tp.exports===yb,_p=wI?ss.Buffer:void 0,Ap=_p?_p.allocUnsafe:void 0;function Nb(t,e){if(e)return t.slice();var n=t.length,r=Ap?Ap(n):new t.constructor(n);return t.copy(r),r}function II(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 CI(){return[]}var LI=Object.prototype,OI=LI.propertyIsEnumerable,yp=Object.getOwnPropertySymbols,xI=yp?function(t){return t==null?[]:(t=Object(t),II(yp(t),function(e){return OI.call(t,e)}))}:CI;function RI(t,e,n){var r=e(t);return Da(t)?r:hI(r,n(t))}function df(t){return RI(t,Fw,xI)}var ff=$a(ss,"DataView"),hf=$a(ss,"Promise"),pf=$a(ss,"Set"),Np="[object Map]",DI="[object Object]",Sp="[object Promise]",wp="[object Set]",Ip="[object WeakMap]",Cp="[object DataView]",kI=ja(ff),PI=ja(qo),MI=ja(hf),BI=ja(pf),FI=ja(lf),yr=Yi;(ff&&yr(new ff(new ArrayBuffer(1)))!=Cp||qo&&yr(new qo)!=Np||hf&&yr(hf.resolve())!=Sp||pf&&yr(new pf)!=wp||lf&&yr(new lf)!=Ip)&&(yr=function(t){var e=Yi(t),n=e==DI?t.constructor:void 0,r=n?ja(n):"";if(r)switch(r){case kI:return Cp;case PI:return Np;case MI:return Sp;case BI:return wp;case FI:return Ip}return e});var UI=Object.prototype,HI=UI.hasOwnProperty;function qI(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&HI.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Sl=ss.Uint8Array;function Mh(t){var e=new t.constructor(t.byteLength);return new Sl(e).set(new Sl(t)),e}function jI(t,e){var n=Mh(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var $I=/\w*$/;function YI(t){var e=new t.constructor(t.source,$I.exec(t));return e.lastIndex=t.lastIndex,e}var Lp=Gs?Gs.prototype:void 0,Op=Lp?Lp.valueOf:void 0;function zI(t){return Op?Object(Op.call(t)):{}}function Sb(t,e){var n=e?Mh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var WI="[object Boolean]",GI="[object Date]",KI="[object Map]",VI="[object Number]",XI="[object RegExp]",QI="[object Set]",ZI="[object String]",JI="[object Symbol]",eC="[object ArrayBuffer]",tC="[object DataView]",nC="[object Float32Array]",rC="[object Float64Array]",sC="[object Int8Array]",aC="[object Int16Array]",iC="[object Int32Array]",oC="[object Uint8Array]",uC="[object Uint8ClampedArray]",lC="[object Uint16Array]",cC="[object Uint32Array]";function dC(t,e,n){var r=t.constructor;switch(e){case eC:return Mh(t);case WI:case GI:return new r(+t);case tC:return jI(t);case nC:case rC:case sC:case aC:case iC:case oC:case uC:case lC:case cC:return Sb(t,n);case KI:return new r;case VI:case ZI:return new r(t);case XI:return YI(t);case QI:return new r;case JI:return zI(t)}}function wb(t){return typeof t.constructor=="function"&&!Dh(t)?xS(_b(t)):{}}var fC="[object Map]";function hC(t){return Ts(t)&&yr(t)==fC}var xp=Pi&&Pi.isMap,pC=xp?kh(xp):hC,mC="[object Set]";function gC(t){return Ts(t)&&yr(t)==mC}var Rp=Pi&&Pi.isSet,bC=Rp?kh(Rp):gC,vC=1,Ib="[object Arguments]",EC="[object Array]",TC="[object Boolean]",_C="[object Date]",AC="[object Error]",Cb="[object Function]",yC="[object GeneratorFunction]",NC="[object Map]",SC="[object Number]",Lb="[object Object]",wC="[object RegExp]",IC="[object Set]",CC="[object String]",LC="[object Symbol]",OC="[object WeakMap]",xC="[object ArrayBuffer]",RC="[object DataView]",DC="[object Float32Array]",kC="[object Float64Array]",PC="[object Int8Array]",MC="[object Int16Array]",BC="[object Int32Array]",FC="[object Uint8Array]",UC="[object Uint8ClampedArray]",HC="[object Uint16Array]",qC="[object Uint32Array]",Nt={};Nt[Ib]=Nt[EC]=Nt[xC]=Nt[RC]=Nt[TC]=Nt[_C]=Nt[DC]=Nt[kC]=Nt[PC]=Nt[MC]=Nt[BC]=Nt[NC]=Nt[SC]=Nt[Lb]=Nt[wC]=Nt[IC]=Nt[CC]=Nt[LC]=Nt[FC]=Nt[UC]=Nt[HC]=Nt[qC]=!0;Nt[AC]=Nt[Cb]=Nt[OC]=!1;function nl(t,e,n,r,s,a){var i,o=e&vC;if(i!==void 0)return i;if(!Qs(t))return t;var u=Da(t);if(u)i=qI(t);else{var d=yr(t),h=d==Cb||d==yC;if(Uo(t))return Nb(t,o);if(d==Lb||d==Ib||h&&!s)i=h?{}:wb(t);else{if(!Nt[d])return s?t:{};i=dC(t,d,o)}}a||(a=new Qr);var g=a.get(t);if(g)return g;a.set(t,i),bC(t)?t.forEach(function(b){i.add(nl(b,e,n,b,t,a))}):pC(t)&&t.forEach(function(b,_){i.set(_,nl(b,e,n,_,t,a))});var f=df,m=u?void 0:f(t);return qS(m||t,function(b,_){m&&(_=b,b=t[_]),hb(i,_,nl(b,e,n,_,t,a))}),i}var jC=1,$C=4;function pi(t){return nl(t,jC|$C)}var YC="__lodash_hash_undefined__";function zC(t){return this.__data__.set(t,YC),this}function WC(t){return this.__data__.has(t)}function wl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Ya;++e<n;)this.add(t[e])}wl.prototype.add=wl.prototype.push=zC;wl.prototype.has=WC;function GC(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 KC(t,e){return t.has(e)}var VC=1,XC=2;function Ob(t,e,n,r,s,a){var i=n&VC,o=t.length,u=e.length;if(o!=u&&!(i&&u>o))return!1;var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var g=-1,f=!0,m=n&XC?new wl:void 0;for(a.set(t,e),a.set(e,t);++g<o;){var b=t[g],_=e[g];if(r)var A=i?r(_,b,g,e,t,a):r(b,_,g,t,e,a);if(A!==void 0){if(A)continue;f=!1;break}if(m){if(!GC(e,function(E,C){if(!KC(m,C)&&(b===E||s(b,E,n,r,a)))return m.push(C)})){f=!1;break}}else if(!(b===_||s(b,_,n,r,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function QC(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function ZC(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var JC=1,e4=2,t4="[object Boolean]",n4="[object Date]",r4="[object Error]",s4="[object Map]",a4="[object Number]",i4="[object RegExp]",o4="[object Set]",u4="[object String]",l4="[object Symbol]",c4="[object ArrayBuffer]",d4="[object DataView]",Dp=Gs?Gs.prototype:void 0,$c=Dp?Dp.valueOf:void 0;function f4(t,e,n,r,s,a,i){switch(n){case d4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case c4:return!(t.byteLength!=e.byteLength||!a(new Sl(t),new Sl(e)));case t4:case n4:case a4:return lu(+t,+e);case r4:return t.name==e.name&&t.message==e.message;case i4:case u4:return t==e+"";case s4:var o=QC;case o4:var u=r&JC;if(o||(o=ZC),t.size!=e.size&&!u)return!1;var d=i.get(t);if(d)return d==e;r|=e4,i.set(t,e);var h=Ob(o(t),o(e),r,s,a,i);return i.delete(t),h;case l4:if($c)return $c.call(t)==$c.call(e)}return!1}var h4=1,p4=Object.prototype,m4=p4.hasOwnProperty;function g4(t,e,n,r,s,a){var i=n&h4,o=df(t),u=o.length,d=df(e),h=d.length;if(u!=h&&!i)return!1;for(var g=u;g--;){var f=o[g];if(!(i?f in e:m4.call(e,f)))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 A=i;++g<u;){f=o[g];var E=t[f],C=e[f];if(r)var I=i?r(C,E,f,e,t,a):r(E,C,f,t,e,a);if(!(I===void 0?E===C||s(E,C,n,r,a):I)){_=!1;break}A||(A=f=="constructor")}if(_&&!A){var H=t.constructor,B=e.constructor;H!=B&&"constructor"in t&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof B=="function"&&B instanceof B)&&(_=!1)}return a.delete(t),a.delete(e),_}var b4=1,kp="[object Arguments]",Pp="[object Array]",Pu="[object Object]",v4=Object.prototype,Mp=v4.hasOwnProperty;function E4(t,e,n,r,s,a){var i=Da(t),o=Da(e),u=i?Pp:yr(t),d=o?Pp:yr(e);u=u==kp?Pu:u,d=d==kp?Pu:d;var h=u==Pu,g=d==Pu,f=u==d;if(f&&Uo(t)){if(!Uo(e))return!1;i=!0,h=!1}if(f&&!h)return a||(a=new Qr),i||Ph(t)?Ob(t,e,n,r,s,a):f4(t,e,u,n,r,s,a);if(!(n&b4)){var m=h&&Mp.call(t,"__wrapped__"),b=g&&Mp.call(e,"__wrapped__");if(m||b){var _=m?t.value():t,A=b?e.value():e;return a||(a=new Qr),s(_,A,n,r,a)}}return f?(a||(a=new Qr),g4(t,e,n,r,s,a)):!1}function xb(t,e,n,r,s){return t===e?!0:t==null||e==null||!Ts(t)&&!Ts(e)?t!==t&&e!==e:E4(t,e,n,r,xb,s)}function T4(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),o=i.length;o--;){var u=i[++s];if(n(a[u],u,a)===!1)break}return e}}var _4=T4();function mf(t,e,n){(n!==void 0&&!lu(t[e],n)||n===void 0&&!(e in t))&&Rh(t,e,n)}function A4(t){return Ts(t)&&Vl(t)}function gf(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function y4(t){return WS(t,Tb(t))}function N4(t,e,n,r,s,a,i){var o=gf(t,n),u=gf(e,n),d=i.get(u);if(d){mf(t,n,d);return}var h=a?a(o,u,n+"",t,e,i):void 0,g=h===void 0;if(g){var f=Da(u),m=!f&&Uo(u),b=!f&&!m&&Ph(u);h=u,f||m||b?Da(o)?h=o:A4(o)?h=DS(o):m?(g=!1,h=Nb(u,!0)):b?(g=!1,h=Sb(u,!0)):h=[]:EI(u)||cf(u)?(h=o,cf(o)?h=y4(o):(!Qs(o)||xh(o))&&(h=wb(u))):g=!1}g&&(i.set(u,h),s(h,u,r,a,i),i.delete(u)),mf(t,n,h)}function Rb(t,e,n,r,s){t!==e&&_4(e,function(a,i){if(s||(s=new Qr),Qs(a))N4(t,e,i,n,Rb,r,s);else{var o=r?r(gf(t,i),a,i+"",t,e,s):void 0;o===void 0&&(o=a),mf(t,i,o)}},Tb)}function Bh(t,e){return xb(t,e)}var zs=QS(function(t,e,n){Rb(t,e,n)}),Re=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(Re||{});class ns{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Re.TYPE&Re.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Re.LEVEL|s:Re.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class mi extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Db=class bf{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 mi(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),o=new a(e,i,r);return bf.blots.set(o.domNode,o),o}find(e,n=!1){return bf.find(e,n)}query(e,n=Re.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Re.LEVEL&Re.BLOCK?r=this.types.block:e&Re.LEVEL&Re.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&Re.LEVEL&r.scope&&n&Re.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,s="attrName"in n;if(!r&&!s)throw new mi("Invalid definition");if(r&&n.blotName==="abstract")throw new mi("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})}};Db.blots=new WeakMap;let Mi=Db;function Bp(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class S4 extends ns{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){Bp(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(Bp(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Mr=S4;function Yc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class w4 extends ns{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[Yc(this.keyName)]=n,!0):!1}remove(e){e.style[Yc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[Yc(this.keyName)];return this.canAdd(e,n)?n:""}}const Zs=w4;class I4{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=Mi.find(this.domNode);if(e==null)return;const n=ns.keys(this.domNode),r=Mr.keys(this.domNode),s=Zs.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Re.ATTRIBUTE);i instanceof ns&&(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 Zl=I4,kb=class{constructor(e,n){this.scroll=e,this.domNode=n,Mi.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new mi("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),Mi.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,s){const a=this.isolate(e,n);if(this.scroll.query(r,Re.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Re.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);a.wrap(i),i.format(r,s)}}insertAt(e,n,r){const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new mi(`Cannot wrap ${e}`);return r.appendChild(this),r}};kb.blotName="abstract";let Pb=kb;const Mb=class extends Pb{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}}};Mb.scope=Re.INLINE_BLOT;let C4=Mb;const Tn=C4;class L4{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),s=0;for(;r;){if(r===e)return s;s+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||n&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[s,a]=this.find(e);let i=e-a;const o=this.iterator(s);let u=o();for(;u&&i<e+n;){const d=u.length();e>i?r(u,e-i,Math.min(n,i+d-e)):r(u,0,Math.min(d,e+n-i)),i+=d,u=o()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let s=r();for(;s;)n=e(n,s),s=r();return n}}function Fp(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Re.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const Bb=class Ls extends Pb{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,Ls.uiClass&&this.uiNode.classList.add(Ls.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new L4,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=Fp(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof mi)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 Ls?r.descendant(e,s):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(n,r,(i,o,u)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Ls&&(s=s.concat(i.descendants(e,o,a))),a-=u}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===Re.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Ls?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,o)=>{a.formatAt(i,o,r,s)})}insertAt(e,n,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,n,r);else{const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(i)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,s]=this.children.find(e,n),a=[[this,e]];return r instanceof Ls?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 Ls&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,i)=>{const o=s.split(a,n);o!=null&&r.appendChild(o)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const i=this.scroll.find(a);i!=null&&(i.domNode.parentNode==null||i.domNode.parentNode===this.domNode)&&i.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,i)=>a===i?0:a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let i=null;a.nextSibling!=null&&(i=this.scroll.find(a.nextSibling));const o=Fp(a,this.scroll);(o.next!==i||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,i||void 0))}),this.enforceAllowedChildren()}};Bb.uiClass="";let O4=Bb;const Lr=O4;function x4(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 ti=class ni extends Lr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(ni.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 Zl(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof ni||(r=r.wrap(ni.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Re.INLINE);if(r==null)return;r instanceof ns?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.formats()[r]!=null||this.scroll.query(r,Re.ATTRIBUTE)?this.isolate(e,n).format(r,s):super.formatAt(e,n,r,s)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof ni&&r.prev===this&&x4(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 ni&&this.attributes.move(r),r}};ti.allowedChildren=[ti,Tn],ti.blotName="inline",ti.scope=Re.INLINE_BLOT,ti.tagName="SPAN";let R4=ti;const Fh=R4,ri=class vf extends Lr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(vf.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 Zl(this.domNode)}format(e,n){const r=this.scroll.query(e,Re.BLOCK);r!=null&&(r instanceof ns?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(vf.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.scroll.query(r,Re.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Re.INLINE)!=null)super.insertAt(e,n,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(n,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};ri.blotName="block",ri.scope=Re.BLOCK_BLOT,ri.tagName="P",ri.allowedChildren=[Fh,ri,Tn];let D4=ri;const jo=D4,Ef=class extends Lr{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())}};Ef.blotName="container",Ef.scope=Re.BLOCK_BLOT;let k4=Ef;const Jl=k4;class P4 extends Tn{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 Vn=P4,M4={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},B4=100,si=class extends Lr{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,M4),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=Re.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,s){this.update(),super.formatAt(e,n,r,s)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(u,d=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(r.has(u.domNode)||r.set(u.domNode,[]),d&&a(u.parent))},i=u=>{r.has(u.domNode)&&(u instanceof Lr&&u.children.forEach(i),r.delete(u.domNode),u.optimize(n))};let o=e;for(let u=0;o.length>0;u+=1){if(u>=B4)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const h=this.find(d.target,!0);h!=null&&(h.domNode===d.target&&(d.type==="childList"?(a(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(g=>{const f=this.find(g,!1);a(f,!1),f instanceof Lr&&f.children.forEach(m=>{a(m,!1)})})):d.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};si.blotName="scroll",si.defaultChild=jo,si.allowedChildren=[jo,Jl],si.scope=Re.BLOCK_BLOT,si.tagName="DIV";let F4=si;const Uh=F4,Tf=class Fb extends Tn{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 Fb&&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}};Tf.blotName="text",Tf.scope=Re.INLINE_BLOT;let U4=Tf;const Il=U4,H4=Object.freeze(Object.defineProperty({__proto__:null,Attributor:ns,AttributorStore:Zl,BlockBlot:jo,ClassAttributor:Mr,ContainerBlot:Jl,EmbedBlot:Vn,InlineBlot:Fh,LeafBlot:Tn,ParentBlot:Lr,Registry:Mi,Scope:Re,ScrollBlot:Uh,StyleAttributor:Zs,TextBlot:Il},Symbol.toStringTag,{value:"Module"}));var Fs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ub(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mu={exports:{}},zc,Up;function q4(){if(Up)return zc;Up=1;var t=-1,e=1,n=0;function r(T,D,v,R,k){if(T===D)return T?[[n,T]]:[];if(v!=null){var O=X(T,D,v);if(O)return O}var W=o(T,D),j=T.substring(0,W);T=T.substring(W),D=D.substring(W),W=d(T,D);var M=T.substring(T.length-W);T=T.substring(0,T.length-W),D=D.substring(0,D.length-W);var $=s(T,D);return j&&$.unshift([n,j]),M&&$.push([n,M]),C($,k),R&&g($),$}function s(T,D){var v;if(!T)return[[e,D]];if(!D)return[[t,T]];var R=T.length>D.length?T:D,k=T.length>D.length?D:T,O=R.indexOf(k);if(O!==-1)return v=[[e,R.substring(0,O)],[n,k],[e,R.substring(O+k.length)]],T.length>D.length&&(v[0][0]=v[2][0]=t),v;if(k.length===1)return[[t,T],[e,D]];var W=h(T,D);if(W){var j=W[0],M=W[1],$=W[2],G=W[3],ee=W[4],le=r(j,$),be=r(M,G);return le.concat([[n,ee]],be)}return a(T,D)}function a(T,D){for(var v=T.length,R=D.length,k=Math.ceil((v+R)/2),O=k,W=2*k,j=new Array(W),M=new Array(W),$=0;$<W;$++)j[$]=-1,M[$]=-1;j[O+1]=0,M[O+1]=0;for(var G=v-R,ee=G%2!==0,le=0,be=0,pe=0,Ne=0,ce=0;ce<k;ce++){for(var he=-ce+le;he<=ce-be;he+=2){var Se=O+he,ye;he===-ce||he!==ce&&j[Se-1]<j[Se+1]?ye=j[Se+1]:ye=j[Se-1]+1;for(var Ie=ye-he;ye<v&&Ie<R&&T.charAt(ye)===D.charAt(Ie);)ye++,Ie++;if(j[Se]=ye,ye>v)be+=2;else if(Ie>R)le+=2;else if(ee){var xe=O+G-he;if(xe>=0&&xe<W&&M[xe]!==-1){var De=v-M[xe];if(ye>=De)return i(T,D,ye,Ie)}}}for(var ze=-ce+pe;ze<=ce-Ne;ze+=2){var xe=O+ze,De;ze===-ce||ze!==ce&&M[xe-1]<M[xe+1]?De=M[xe+1]:De=M[xe-1]+1;for(var et=De-ze;De<v&&et<R&&T.charAt(v-De-1)===D.charAt(R-et-1);)De++,et++;if(M[xe]=De,De>v)Ne+=2;else if(et>R)pe+=2;else if(!ee){var Se=O+G-ze;if(Se>=0&&Se<W&&j[Se]!==-1){var ye=j[Se],Ie=O+ye-Se;if(De=v-De,ye>=De)return i(T,D,ye,Ie)}}}}return[[t,T],[e,D]]}function i(T,D,v,R){var k=T.substring(0,v),O=D.substring(0,R),W=T.substring(v),j=D.substring(R),M=r(k,O),$=r(W,j);return M.concat($)}function o(T,D){if(!T||!D||T.charAt(0)!==D.charAt(0))return 0;for(var v=0,R=Math.min(T.length,D.length),k=R,O=0;v<k;)T.substring(O,k)==D.substring(O,k)?(v=k,O=v):R=k,k=Math.floor((R-v)/2+v);return I(T.charCodeAt(k-1))&&k--,k}function u(T,D){var v=T.length,R=D.length;if(v==0||R==0)return 0;v>R?T=T.substring(v-R):v<R&&(D=D.substring(0,v));var k=Math.min(v,R);if(T==D)return k;for(var O=0,W=1;;){var j=T.substring(k-W),M=D.indexOf(j);if(M==-1)return O;W+=M,(M==0||T.substring(k-W)==D.substring(0,W))&&(O=W,W++)}}function d(T,D){if(!T||!D||T.slice(-1)!==D.slice(-1))return 0;for(var v=0,R=Math.min(T.length,D.length),k=R,O=0;v<k;)T.substring(T.length-k,T.length-O)==D.substring(D.length-k,D.length-O)?(v=k,O=v):R=k,k=Math.floor((R-v)/2+v);return H(T.charCodeAt(T.length-k))&&k--,k}function h(T,D){var v=T.length>D.length?T:D,R=T.length>D.length?D:T;if(v.length<4||R.length*2<v.length)return null;function k(be,pe,Ne){for(var ce=be.substring(Ne,Ne+Math.floor(be.length/4)),he=-1,Se="",ye,Ie,xe,De;(he=pe.indexOf(ce,he+1))!==-1;){var ze=o(be.substring(Ne),pe.substring(he)),et=d(be.substring(0,Ne),pe.substring(0,he));Se.length<et+ze&&(Se=pe.substring(he-et,he)+pe.substring(he,he+ze),ye=be.substring(0,Ne-et),Ie=be.substring(Ne+ze),xe=pe.substring(0,he-et),De=pe.substring(he+ze))}return Se.length*2>=be.length?[ye,Ie,xe,De,Se]:null}var O=k(v,R,Math.ceil(v.length/4)),W=k(v,R,Math.ceil(v.length/2)),j;if(!O&&!W)return null;W?O?j=O[4].length>W[4].length?O:W:j=W:j=O;var M,$,G,ee;T.length>D.length?(M=j[0],$=j[1],G=j[2],ee=j[3]):(G=j[0],ee=j[1],M=j[2],$=j[3]);var le=j[4];return[M,$,G,ee,le]}function g(T){for(var D=!1,v=[],R=0,k=null,O=0,W=0,j=0,M=0,$=0;O<T.length;)T[O][0]==n?(v[R++]=O,W=M,j=$,M=0,$=0,k=T[O][1]):(T[O][0]==e?M+=T[O][1].length:$+=T[O][1].length,k&&k.length<=Math.max(W,j)&&k.length<=Math.max(M,$)&&(T.splice(v[R-1],0,[t,k]),T[v[R-1]+1][0]=e,R--,R--,O=R>0?v[R-1]:-1,W=0,j=0,M=0,$=0,k=null,D=!0)),O++;for(D&&C(T),E(T),O=1;O<T.length;){if(T[O-1][0]==t&&T[O][0]==e){var G=T[O-1][1],ee=T[O][1],le=u(G,ee),be=u(ee,G);le>=be?(le>=G.length/2||le>=ee.length/2)&&(T.splice(O,0,[n,ee.substring(0,le)]),T[O-1][1]=G.substring(0,G.length-le),T[O+1][1]=ee.substring(le),O++):(be>=G.length/2||be>=ee.length/2)&&(T.splice(O,0,[n,G.substring(0,be)]),T[O-1][0]=e,T[O-1][1]=ee.substring(0,ee.length-be),T[O+1][0]=t,T[O+1][1]=G.substring(be),O++),O++}O++}}var f=/[^a-zA-Z0-9]/,m=/\s/,b=/[\r\n]/,_=/\n\r?\n$/,A=/^\r?\n\r?\n/;function E(T){function D(be,pe){if(!be||!pe)return 6;var Ne=be.charAt(be.length-1),ce=pe.charAt(0),he=Ne.match(f),Se=ce.match(f),ye=he&&Ne.match(m),Ie=Se&&ce.match(m),xe=ye&&Ne.match(b),De=Ie&&ce.match(b),ze=xe&&be.match(_),et=De&&pe.match(A);return ze||et?5:xe||De?4:he&&!ye&&Ie?3:ye||Ie?2:he||Se?1:0}for(var v=1;v<T.length-1;){if(T[v-1][0]==n&&T[v+1][0]==n){var R=T[v-1][1],k=T[v][1],O=T[v+1][1],W=d(R,k);if(W){var j=k.substring(k.length-W);R=R.substring(0,R.length-W),k=j+k.substring(0,k.length-W),O=j+O}for(var M=R,$=k,G=O,ee=D(R,k)+D(k,O);k.charAt(0)===O.charAt(0);){R+=k.charAt(0),k=k.substring(1)+O.charAt(0),O=O.substring(1);var le=D(R,k)+D(k,O);le>=ee&&(ee=le,M=R,$=k,G=O)}T[v-1][1]!=M&&(M?T[v-1][1]=M:(T.splice(v-1,1),v--),T[v][1]=$,G?T[v+1][1]=G:(T.splice(v+1,1),v--))}v++}}function C(T,D){T.push([n,""]);for(var v=0,R=0,k=0,O="",W="",j;v<T.length;){if(v<T.length-1&&!T[v][1]){T.splice(v,1);continue}switch(T[v][0]){case e:k++,W+=T[v][1],v++;break;case t:R++,O+=T[v][1],v++;break;case n:var M=v-k-R-1;if(D){if(M>=0&&J(T[M][1])){var $=T[M][1].slice(-1);if(T[M][1]=T[M][1].slice(0,-1),O=$+O,W=$+W,!T[M][1]){T.splice(M,1),v--;var G=M-1;T[G]&&T[G][0]===e&&(k++,W=T[G][1]+W,G--),T[G]&&T[G][0]===t&&(R++,O=T[G][1]+O,G--),M=G}}if(B(T[v][1])){var $=T[v][1].charAt(0);T[v][1]=T[v][1].slice(1),O+=$,W+=$}}if(v<T.length-1&&!T[v][1]){T.splice(v,1);break}if(O.length>0||W.length>0){O.length>0&&W.length>0&&(j=o(W,O),j!==0&&(M>=0?T[M][1]+=W.substring(0,j):(T.splice(0,0,[n,W.substring(0,j)]),v++),W=W.substring(j),O=O.substring(j)),j=d(W,O),j!==0&&(T[v][1]=W.substring(W.length-j)+T[v][1],W=W.substring(0,W.length-j),O=O.substring(0,O.length-j)));var ee=k+R;O.length===0&&W.length===0?(T.splice(v-ee,ee),v=v-ee):O.length===0?(T.splice(v-ee,ee,[e,W]),v=v-ee+1):W.length===0?(T.splice(v-ee,ee,[t,O]),v=v-ee+1):(T.splice(v-ee,ee,[t,O],[e,W]),v=v-ee+2)}v!==0&&T[v-1][0]===n?(T[v-1][1]+=T[v][1],T.splice(v,1)):v++,k=0,R=0,O="",W="";break}}T[T.length-1][1]===""&&T.pop();var le=!1;for(v=1;v<T.length-1;)T[v-1][0]===n&&T[v+1][0]===n&&(T[v][1].substring(T[v][1].length-T[v-1][1].length)===T[v-1][1]?(T[v][1]=T[v-1][1]+T[v][1].substring(0,T[v][1].length-T[v-1][1].length),T[v+1][1]=T[v-1][1]+T[v+1][1],T.splice(v-1,1),le=!0):T[v][1].substring(0,T[v+1][1].length)==T[v+1][1]&&(T[v-1][1]+=T[v+1][1],T[v][1]=T[v][1].substring(T[v+1][1].length)+T[v+1][1],T.splice(v+1,1),le=!0)),v++;le&&C(T,D)}function I(T){return T>=55296&&T<=56319}function H(T){return T>=56320&&T<=57343}function B(T){return H(T.charCodeAt(0))}function J(T){return I(T.charCodeAt(T.length-1))}function F(T){for(var D=[],v=0;v<T.length;v++)T[v][1].length>0&&D.push(T[v]);return D}function Y(T,D,v,R){return J(T)||B(R)?null:F([[n,T],[t,D],[e,v],[n,R]])}function X(T,D,v){var R=typeof v=="number"?{index:v,length:0}:v.oldRange,k=typeof v=="number"?null:v.newRange,O=T.length,W=D.length;if(R.length===0&&(k===null||k.length===0)){var j=R.index,M=T.slice(0,j),$=T.slice(j),G=k?k.index:null;e:{var ee=j+W-O;if(G!==null&&G!==ee||ee<0||ee>W)break e;var le=D.slice(0,ee),be=D.slice(ee);if(be!==$)break e;var pe=Math.min(j,ee),Ne=M.slice(0,pe),ce=le.slice(0,pe);if(Ne!==ce)break e;var he=M.slice(pe),Se=le.slice(pe);return Y(Ne,he,Se,$)}e:{if(G!==null&&G!==j)break e;var ye=j,le=D.slice(0,ye),be=D.slice(ye);if(le!==M)break e;var Ie=Math.min(O-ye,W-ye),xe=$.slice($.length-Ie),De=be.slice(be.length-Ie);if(xe!==De)break e;var he=$.slice(0,$.length-Ie),Se=be.slice(0,be.length-Ie);return Y(M,he,Se,xe)}}if(R.length>0&&k&&k.length===0)e:{var Ne=T.slice(0,R.index),xe=T.slice(R.index+R.length),pe=Ne.length,Ie=xe.length;if(W<pe+Ie)break e;var ce=D.slice(0,pe),De=D.slice(W-Ie);if(Ne!==ce||xe!==De)break e;var he=T.slice(pe,O-Ie),Se=D.slice(pe,W-Ie);return Y(Ne,he,Se,xe)}return null}function te(T,D,v,R){return r(T,D,v,R,!0)}return te.INSERT=e,te.DELETE=t,te.EQUAL=n,zc=te,zc}var co={exports:{}};co.exports;var Hp;function Hb(){return Hp||(Hp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",o="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",b="[object Object]",_="[object Promise]",A="[object RegExp]",E="[object Set]",C="[object String]",I="[object Symbol]",H="[object WeakMap]",B="[object ArrayBuffer]",J="[object DataView]",F="[object Float32Array]",Y="[object Float64Array]",X="[object Int8Array]",te="[object Int16Array]",T="[object Int32Array]",D="[object Uint8Array]",v="[object Uint8ClampedArray]",R="[object Uint16Array]",k="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,j=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,$={};$[a]=$[i]=$[B]=$[J]=$[o]=$[u]=$[F]=$[Y]=$[X]=$[te]=$[T]=$[f]=$[m]=$[b]=$[A]=$[E]=$[C]=$[I]=$[D]=$[v]=$[R]=$[k]=!0,$[d]=$[h]=$[H]=!1;var G=typeof Fs=="object"&&Fs&&Fs.Object===Object&&Fs,ee=typeof self=="object"&&self&&self.Object===Object&&self,le=G||ee||Function("return this")(),be=e&&!e.nodeType&&e,pe=be&&!0&&t&&!t.nodeType&&t,Ne=pe&&pe.exports===be;function ce(p,N){return p.set(N[0],N[1]),p}function he(p,N){return p.add(N),p}function Se(p,N){for(var U=-1,re=p?p.length:0;++U<re&&N(p[U],U,p)!==!1;);return p}function ye(p,N){for(var U=-1,re=N.length,Ye=p.length;++U<re;)p[Ye+U]=N[U];return p}function Ie(p,N,U,re){for(var Ye=-1,ke=p?p.length:0;++Ye<ke;)U=N(U,p[Ye],Ye,p);return U}function xe(p,N){for(var U=-1,re=Array(p);++U<p;)re[U]=N(U);return re}function De(p,N){return p==null?void 0:p[N]}function ze(p){var N=!1;if(p!=null&&typeof p.toString!="function")try{N=!!(p+"")}catch{}return N}function et(p){var N=-1,U=Array(p.size);return p.forEach(function(re,Ye){U[++N]=[Ye,re]}),U}function Vt(p,N){return function(U){return p(N(U))}}function Qe(p){var N=-1,U=Array(p.size);return p.forEach(function(re){U[++N]=re}),U}var Xt=Array.prototype,nn=Function.prototype,qt=Object.prototype,yn=le["__core-js_shared__"],rn=(function(){var p=/[^.]+$/.exec(yn&&yn.keys&&yn.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),Bt=nn.toString,jt=qt.hasOwnProperty,Rn=qt.toString,qn=RegExp("^"+Bt.call(jt).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tt=Ne?le.Buffer:void 0,kt=le.Symbol,Qt=le.Uint8Array,_t=Vt(Object.getPrototypeOf,Object),un=Object.create,$t=qt.propertyIsEnumerable,Xn=Xt.splice,pr=Object.getOwnPropertySymbols,Nn=Tt?Tt.isBuffer:void 0,Ur=Vt(Object.keys,Object),K=gr(le,"DataView"),ge=gr(le,"Map"),we=gr(le,"Promise"),We=gr(le,"Set"),ht=gr(le,"WeakMap"),Ge=gr(Object,"create"),xt=wn(K),Ee=wn(ge),Ue=wn(we),$e=wn(We),Ke=wn(ht),fe=kt?kt.prototype:void 0,Zt=fe?fe.valueOf:void 0;function At(p){var N=-1,U=p?p.length:0;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Rt(){this.__data__=Ge?Ge(null):{}}function mn(p){return this.has(p)&&delete this.__data__[p]}function Qn(p){var N=this.__data__;if(Ge){var U=N[p];return U===r?void 0:U}return jt.call(N,p)?N[p]:void 0}function mr(p){var N=this.__data__;return Ge?N[p]!==void 0:jt.call(N,p)}function jn(p,N){var U=this.__data__;return U[p]=Ge&&N===void 0?r:N,this}At.prototype.clear=Rt,At.prototype.delete=mn,At.prototype.get=Qn,At.prototype.has=mr,At.prototype.set=jn;function Ct(p){var N=-1,U=p?p.length:0;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Js(){this.__data__=[]}function ea(p){var N=this.__data__,U=gt(N,p);if(U<0)return!1;var re=N.length-1;return U==re?N.pop():Xn.call(N,U,1),!0}function ta(p){var N=this.__data__,U=gt(N,p);return U<0?void 0:N[U][1]}function na(p){return gt(this.__data__,p)>-1}function ra(p,N){var U=this.__data__,re=gt(U,p);return re<0?U.push([p,N]):U[re][1]=N,this}Ct.prototype.clear=Js,Ct.prototype.delete=ea,Ct.prototype.get=ta,Ct.prototype.has=na,Ct.prototype.set=ra;function He(p){var N=-1,U=p?p.length:0;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Lt(){this.__data__={hash:new At,map:new(ge||Ct),string:new At}}function Yt(p){return ia(this,p).delete(p)}function Sn(p){return ia(this,p).get(p)}function gn(p){return ia(this,p).has(p)}function Ft(p,N){return ia(this,p).set(p,N),this}He.prototype.clear=Lt,He.prototype.delete=Yt,He.prototype.get=Sn,He.prototype.has=gn,He.prototype.set=Ft;function pt(p){this.__data__=new Ct(p)}function zt(){this.__data__=new Ct}function Ut(p){return this.__data__.delete(p)}function Dn(p){return this.__data__.get(p)}function yt(p){return this.__data__.has(p)}function Le(p,N){var U=this.__data__;if(U instanceof Ct){var re=U.__data__;if(!ge||re.length<n-1)return re.push([p,N]),this;U=this.__data__=new He(re)}return U.set(p,N),this}pt.prototype.clear=zt,pt.prototype.delete=Ut,pt.prototype.get=Dn,pt.prototype.has=yt,pt.prototype.set=Le;function Te(p,N){var U=Ki(p)||Va(p)?xe(p.length,String):[],re=U.length,Ye=!!re;for(var ke in p)jt.call(p,ke)&&!(Ye&&(ke=="length"||mc(ke,re)))&&U.push(ke);return U}function Me(p,N,U){var re=p[N];(!(jt.call(p,N)&&vu(re,U))||U===void 0&&!(N in p))&&(p[N]=U)}function gt(p,N){for(var U=p.length;U--;)if(vu(p[U][0],N))return U;return-1}function Wt(p,N){return p&&Gi(N,Xi(N),p)}function sa(p,N,U,re,Ye,ke,ot){var at;if(re&&(at=ke?re(p,Ye,ke,ot):re(p)),at!==void 0)return at;if(!qr(p))return p;var Gt=Ki(p);if(Gt){if(at=hc(p),!N)return cc(p,at)}else{var mt=is(p),bn=mt==h||mt==g;if(Eu(p))return Ka(p,N);if(mt==b||mt==a||bn&&!ke){if(ze(p))return ke?p:{};if(at=Hr(bn?{}:p),!N)return dc(p,Wt(at,p))}else{if(!$[mt])return ke?p:{};at=pc(p,mt,sa,N)}}ot||(ot=new pt);var kn=ot.get(p);if(kn)return kn;if(ot.set(p,at),!Gt)var Jt=U?fc(p):Xi(p);return Se(Jt||p,function(vn,ln){Jt&&(ln=vn,vn=p[ln]),Me(at,ln,sa(vn,N,U,re,ln,p,ot))}),at}function zi(p){return qr(p)?un(p):{}}function rc(p,N,U){var re=N(p);return Ki(p)?re:ye(re,U(p))}function sc(p){return Rn.call(p)}function ac(p){if(!qr(p)||bc(p))return!1;var N=Vi(p)||ze(p)?qn:j;return N.test(wn(p))}function ic(p){if(!gu(p))return Ur(p);var N=[];for(var U in Object(p))jt.call(p,U)&&U!="constructor"&&N.push(U);return N}function Ka(p,N){if(N)return p.slice();var U=new p.constructor(p.length);return p.copy(U),U}function Wi(p){var N=new p.constructor(p.byteLength);return new Qt(N).set(new Qt(p)),N}function aa(p,N){var U=N?Wi(p.buffer):p.buffer;return new p.constructor(U,p.byteOffset,p.byteLength)}function pu(p,N,U){var re=N?U(et(p),!0):et(p);return Ie(re,ce,new p.constructor)}function mu(p){var N=new p.constructor(p.source,W.exec(p));return N.lastIndex=p.lastIndex,N}function oc(p,N,U){var re=N?U(Qe(p),!0):Qe(p);return Ie(re,he,new p.constructor)}function uc(p){return Zt?Object(Zt.call(p)):{}}function lc(p,N){var U=N?Wi(p.buffer):p.buffer;return new p.constructor(U,p.byteOffset,p.length)}function cc(p,N){var U=-1,re=p.length;for(N||(N=Array(re));++U<re;)N[U]=p[U];return N}function Gi(p,N,U,re){U||(U={});for(var Ye=-1,ke=N.length;++Ye<ke;){var ot=N[Ye],at=void 0;Me(U,ot,at===void 0?p[ot]:at)}return U}function dc(p,N){return Gi(p,as(p),N)}function fc(p){return rc(p,Xi,as)}function ia(p,N){var U=p.__data__;return gc(N)?U[typeof N=="string"?"string":"hash"]:U.map}function gr(p,N){var U=De(p,N);return ac(U)?U:void 0}var as=pr?Vt(pr,Object):Ec,is=sc;(K&&is(new K(new ArrayBuffer(1)))!=J||ge&&is(new ge)!=f||we&&is(we.resolve())!=_||We&&is(new We)!=E||ht&&is(new ht)!=H)&&(is=function(p){var N=Rn.call(p),U=N==b?p.constructor:void 0,re=U?wn(U):void 0;if(re)switch(re){case xt:return J;case Ee:return f;case Ue:return _;case $e:return E;case Ke:return H}return N});function hc(p){var N=p.length,U=p.constructor(N);return N&&typeof p[0]=="string"&&jt.call(p,"index")&&(U.index=p.index,U.input=p.input),U}function Hr(p){return typeof p.constructor=="function"&&!gu(p)?zi(_t(p)):{}}function pc(p,N,U,re){var Ye=p.constructor;switch(N){case B:return Wi(p);case o:case u:return new Ye(+p);case J:return aa(p,re);case F:case Y:case X:case te:case T:case D:case v:case R:case k:return lc(p,re);case f:return pu(p,re,U);case m:case C:return new Ye(p);case A:return mu(p);case E:return oc(p,re,U);case I:return uc(p)}}function mc(p,N){return N=N??s,!!N&&(typeof p=="number"||M.test(p))&&p>-1&&p%1==0&&p<N}function gc(p){var N=typeof p;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?p!=="__proto__":p===null}function bc(p){return!!rn&&rn in p}function gu(p){var N=p&&p.constructor,U=typeof N=="function"&&N.prototype||qt;return p===U}function wn(p){if(p!=null){try{return Bt.call(p)}catch{}try{return p+""}catch{}}return""}function bu(p){return sa(p,!0,!0)}function vu(p,N){return p===N||p!==p&&N!==N}function Va(p){return vc(p)&&jt.call(p,"callee")&&(!$t.call(p,"callee")||Rn.call(p)==a)}var Ki=Array.isArray;function Xa(p){return p!=null&&Tu(p.length)&&!Vi(p)}function vc(p){return _u(p)&&Xa(p)}var Eu=Nn||Tc;function Vi(p){var N=qr(p)?Rn.call(p):"";return N==h||N==g}function Tu(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=s}function qr(p){var N=typeof p;return!!p&&(N=="object"||N=="function")}function _u(p){return!!p&&typeof p=="object"}function Xi(p){return Xa(p)?Te(p):ic(p)}function Ec(){return[]}function Tc(){return!1}t.exports=bu})(co,co.exports)),co.exports}var fo={exports:{}};fo.exports;var qp;function qb(){return qp||(qp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,o="[object Arguments]",u="[object Array]",d="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",f="[object Error]",m="[object Function]",b="[object GeneratorFunction]",_="[object Map]",A="[object Number]",E="[object Null]",C="[object Object]",I="[object Promise]",H="[object Proxy]",B="[object RegExp]",J="[object Set]",F="[object String]",Y="[object Symbol]",X="[object Undefined]",te="[object WeakMap]",T="[object ArrayBuffer]",D="[object DataView]",v="[object Float32Array]",R="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",W="[object Int32Array]",j="[object Uint8Array]",M="[object Uint8ClampedArray]",$="[object Uint16Array]",G="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,le=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,pe={};pe[v]=pe[R]=pe[k]=pe[O]=pe[W]=pe[j]=pe[M]=pe[$]=pe[G]=!0,pe[o]=pe[u]=pe[T]=pe[h]=pe[D]=pe[g]=pe[f]=pe[m]=pe[_]=pe[A]=pe[C]=pe[B]=pe[J]=pe[F]=pe[te]=!1;var Ne=typeof Fs=="object"&&Fs&&Fs.Object===Object&&Fs,ce=typeof self=="object"&&self&&self.Object===Object&&self,he=Ne||ce||Function("return this")(),Se=e&&!e.nodeType&&e,ye=Se&&!0&&t&&!t.nodeType&&t,Ie=ye&&ye.exports===Se,xe=Ie&&Ne.process,De=(function(){try{return xe&&xe.binding&&xe.binding("util")}catch{}})(),ze=De&&De.isTypedArray;function et(p,N){for(var U=-1,re=p==null?0:p.length,Ye=0,ke=[];++U<re;){var ot=p[U];N(ot,U,p)&&(ke[Ye++]=ot)}return ke}function Vt(p,N){for(var U=-1,re=N.length,Ye=p.length;++U<re;)p[Ye+U]=N[U];return p}function Qe(p,N){for(var U=-1,re=p==null?0:p.length;++U<re;)if(N(p[U],U,p))return!0;return!1}function Xt(p,N){for(var U=-1,re=Array(p);++U<p;)re[U]=N(U);return re}function nn(p){return function(N){return p(N)}}function qt(p,N){return p.has(N)}function yn(p,N){return p==null?void 0:p[N]}function rn(p){var N=-1,U=Array(p.size);return p.forEach(function(re,Ye){U[++N]=[Ye,re]}),U}function Bt(p,N){return function(U){return p(N(U))}}function jt(p){var N=-1,U=Array(p.size);return p.forEach(function(re){U[++N]=re}),U}var Rn=Array.prototype,qn=Function.prototype,Tt=Object.prototype,kt=he["__core-js_shared__"],Qt=qn.toString,_t=Tt.hasOwnProperty,un=(function(){var p=/[^.]+$/.exec(kt&&kt.keys&&kt.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),$t=Tt.toString,Xn=RegExp("^"+Qt.call(_t).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pr=Ie?he.Buffer:void 0,Nn=he.Symbol,Ur=he.Uint8Array,K=Tt.propertyIsEnumerable,ge=Rn.splice,we=Nn?Nn.toStringTag:void 0,We=Object.getOwnPropertySymbols,ht=pr?pr.isBuffer:void 0,Ge=Bt(Object.keys,Object),xt=as(he,"DataView"),Ee=as(he,"Map"),Ue=as(he,"Promise"),$e=as(he,"Set"),Ke=as(he,"WeakMap"),fe=as(Object,"create"),Zt=wn(xt),At=wn(Ee),Rt=wn(Ue),mn=wn($e),Qn=wn(Ke),mr=Nn?Nn.prototype:void 0,jn=mr?mr.valueOf:void 0;function Ct(p){var N=-1,U=p==null?0:p.length;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Js(){this.__data__=fe?fe(null):{},this.size=0}function ea(p){var N=this.has(p)&&delete this.__data__[p];return this.size-=N?1:0,N}function ta(p){var N=this.__data__;if(fe){var U=N[p];return U===r?void 0:U}return _t.call(N,p)?N[p]:void 0}function na(p){var N=this.__data__;return fe?N[p]!==void 0:_t.call(N,p)}function ra(p,N){var U=this.__data__;return this.size+=this.has(p)?0:1,U[p]=fe&&N===void 0?r:N,this}Ct.prototype.clear=Js,Ct.prototype.delete=ea,Ct.prototype.get=ta,Ct.prototype.has=na,Ct.prototype.set=ra;function He(p){var N=-1,U=p==null?0:p.length;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Lt(){this.__data__=[],this.size=0}function Yt(p){var N=this.__data__,U=Ka(N,p);if(U<0)return!1;var re=N.length-1;return U==re?N.pop():ge.call(N,U,1),--this.size,!0}function Sn(p){var N=this.__data__,U=Ka(N,p);return U<0?void 0:N[U][1]}function gn(p){return Ka(this.__data__,p)>-1}function Ft(p,N){var U=this.__data__,re=Ka(U,p);return re<0?(++this.size,U.push([p,N])):U[re][1]=N,this}He.prototype.clear=Lt,He.prototype.delete=Yt,He.prototype.get=Sn,He.prototype.has=gn,He.prototype.set=Ft;function pt(p){var N=-1,U=p==null?0:p.length;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function zt(){this.size=0,this.__data__={hash:new Ct,map:new(Ee||He),string:new Ct}}function Ut(p){var N=gr(this,p).delete(p);return this.size-=N?1:0,N}function Dn(p){return gr(this,p).get(p)}function yt(p){return gr(this,p).has(p)}function Le(p,N){var U=gr(this,p),re=U.size;return U.set(p,N),this.size+=U.size==re?0:1,this}pt.prototype.clear=zt,pt.prototype.delete=Ut,pt.prototype.get=Dn,pt.prototype.has=yt,pt.prototype.set=Le;function Te(p){var N=-1,U=p==null?0:p.length;for(this.__data__=new pt;++N<U;)this.add(p[N])}function Me(p){return this.__data__.set(p,r),this}function gt(p){return this.__data__.has(p)}Te.prototype.add=Te.prototype.push=Me,Te.prototype.has=gt;function Wt(p){var N=this.__data__=new He(p);this.size=N.size}function sa(){this.__data__=new He,this.size=0}function zi(p){var N=this.__data__,U=N.delete(p);return this.size=N.size,U}function rc(p){return this.__data__.get(p)}function sc(p){return this.__data__.has(p)}function ac(p,N){var U=this.__data__;if(U instanceof He){var re=U.__data__;if(!Ee||re.length<n-1)return re.push([p,N]),this.size=++U.size,this;U=this.__data__=new pt(re)}return U.set(p,N),this.size=U.size,this}Wt.prototype.clear=sa,Wt.prototype.delete=zi,Wt.prototype.get=rc,Wt.prototype.has=sc,Wt.prototype.set=ac;function ic(p,N){var U=Va(p),re=!U&&vu(p),Ye=!U&&!re&&Xa(p),ke=!U&&!re&&!Ye&&_u(p),ot=U||re||Ye||ke,at=ot?Xt(p.length,String):[],Gt=at.length;for(var mt in p)_t.call(p,mt)&&!(ot&&(mt=="length"||Ye&&(mt=="offset"||mt=="parent")||ke&&(mt=="buffer"||mt=="byteLength"||mt=="byteOffset")||pc(mt,Gt)))&&at.push(mt);return at}function Ka(p,N){for(var U=p.length;U--;)if(bu(p[U][0],N))return U;return-1}function Wi(p,N,U){var re=N(p);return Va(p)?re:Vt(re,U(p))}function aa(p){return p==null?p===void 0?X:E:we&&we in Object(p)?is(p):gu(p)}function pu(p){return qr(p)&&aa(p)==o}function mu(p,N,U,re,Ye){return p===N?!0:p==null||N==null||!qr(p)&&!qr(N)?p!==p&&N!==N:oc(p,N,U,re,mu,Ye)}function oc(p,N,U,re,Ye,ke){var ot=Va(p),at=Va(N),Gt=ot?u:Hr(p),mt=at?u:Hr(N);Gt=Gt==o?C:Gt,mt=mt==o?C:mt;var bn=Gt==C,kn=mt==C,Jt=Gt==mt;if(Jt&&Xa(p)){if(!Xa(N))return!1;ot=!0,bn=!1}if(Jt&&!bn)return ke||(ke=new Wt),ot||_u(p)?Gi(p,N,U,re,Ye,ke):dc(p,N,Gt,U,re,Ye,ke);if(!(U&s)){var vn=bn&&_t.call(p,"__wrapped__"),ln=kn&&_t.call(N,"__wrapped__");if(vn||ln){var Ss=vn?p.value():p,os=ln?N.value():N;return ke||(ke=new Wt),Ye(Ss,os,U,re,ke)}}return Jt?(ke||(ke=new Wt),fc(p,N,U,re,Ye,ke)):!1}function uc(p){if(!Tu(p)||gc(p))return!1;var N=Eu(p)?Xn:le;return N.test(wn(p))}function lc(p){return qr(p)&&Vi(p.length)&&!!pe[aa(p)]}function cc(p){if(!bc(p))return Ge(p);var N=[];for(var U in Object(p))_t.call(p,U)&&U!="constructor"&&N.push(U);return N}function Gi(p,N,U,re,Ye,ke){var ot=U&s,at=p.length,Gt=N.length;if(at!=Gt&&!(ot&&Gt>at))return!1;var mt=ke.get(p);if(mt&&ke.get(N))return mt==N;var bn=-1,kn=!0,Jt=U&a?new Te:void 0;for(ke.set(p,N),ke.set(N,p);++bn<at;){var vn=p[bn],ln=N[bn];if(re)var Ss=ot?re(ln,vn,bn,N,p,ke):re(vn,ln,bn,p,N,ke);if(Ss!==void 0){if(Ss)continue;kn=!1;break}if(Jt){if(!Qe(N,function(os,oa){if(!qt(Jt,oa)&&(vn===os||Ye(vn,os,U,re,ke)))return Jt.push(oa)})){kn=!1;break}}else if(!(vn===ln||Ye(vn,ln,U,re,ke))){kn=!1;break}}return ke.delete(p),ke.delete(N),kn}function dc(p,N,U,re,Ye,ke,ot){switch(U){case D:if(p.byteLength!=N.byteLength||p.byteOffset!=N.byteOffset)return!1;p=p.buffer,N=N.buffer;case T:return!(p.byteLength!=N.byteLength||!ke(new Ur(p),new Ur(N)));case h:case g:case A:return bu(+p,+N);case f:return p.name==N.name&&p.message==N.message;case B:case F:return p==N+"";case _:var at=rn;case J:var Gt=re&s;if(at||(at=jt),p.size!=N.size&&!Gt)return!1;var mt=ot.get(p);if(mt)return mt==N;re|=a,ot.set(p,N);var bn=Gi(at(p),at(N),re,Ye,ke,ot);return ot.delete(p),bn;case Y:if(jn)return jn.call(p)==jn.call(N)}return!1}function fc(p,N,U,re,Ye,ke){var ot=U&s,at=ia(p),Gt=at.length,mt=ia(N),bn=mt.length;if(Gt!=bn&&!ot)return!1;for(var kn=Gt;kn--;){var Jt=at[kn];if(!(ot?Jt in N:_t.call(N,Jt)))return!1}var vn=ke.get(p);if(vn&&ke.get(N))return vn==N;var ln=!0;ke.set(p,N),ke.set(N,p);for(var Ss=ot;++kn<Gt;){Jt=at[kn];var os=p[Jt],oa=N[Jt];if(re)var Qh=ot?re(oa,os,Jt,N,p,ke):re(os,oa,Jt,p,N,ke);if(!(Qh===void 0?os===oa||Ye(os,oa,U,re,ke):Qh)){ln=!1;break}Ss||(Ss=Jt=="constructor")}if(ln&&!Ss){var Au=p.constructor,yu=N.constructor;Au!=yu&&"constructor"in p&&"constructor"in N&&!(typeof Au=="function"&&Au instanceof Au&&typeof yu=="function"&&yu instanceof yu)&&(ln=!1)}return ke.delete(p),ke.delete(N),ln}function ia(p){return Wi(p,Xi,hc)}function gr(p,N){var U=p.__data__;return mc(N)?U[typeof N=="string"?"string":"hash"]:U.map}function as(p,N){var U=yn(p,N);return uc(U)?U:void 0}function is(p){var N=_t.call(p,we),U=p[we];try{p[we]=void 0;var re=!0}catch{}var Ye=$t.call(p);return re&&(N?p[we]=U:delete p[we]),Ye}var hc=We?function(p){return p==null?[]:(p=Object(p),et(We(p),function(N){return K.call(p,N)}))}:Ec,Hr=aa;(xt&&Hr(new xt(new ArrayBuffer(1)))!=D||Ee&&Hr(new Ee)!=_||Ue&&Hr(Ue.resolve())!=I||$e&&Hr(new $e)!=J||Ke&&Hr(new Ke)!=te)&&(Hr=function(p){var N=aa(p),U=N==C?p.constructor:void 0,re=U?wn(U):"";if(re)switch(re){case Zt:return D;case At:return _;case Rt:return I;case mn:return J;case Qn:return te}return N});function pc(p,N){return N=N??i,!!N&&(typeof p=="number"||be.test(p))&&p>-1&&p%1==0&&p<N}function mc(p){var N=typeof p;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?p!=="__proto__":p===null}function gc(p){return!!un&&un in p}function bc(p){var N=p&&p.constructor,U=typeof N=="function"&&N.prototype||Tt;return p===U}function gu(p){return $t.call(p)}function wn(p){if(p!=null){try{return Qt.call(p)}catch{}try{return p+""}catch{}}return""}function bu(p,N){return p===N||p!==p&&N!==N}var vu=pu((function(){return arguments})())?pu:function(p){return qr(p)&&_t.call(p,"callee")&&!K.call(p,"callee")},Va=Array.isArray;function Ki(p){return p!=null&&Vi(p.length)&&!Eu(p)}var Xa=ht||Tc;function vc(p,N){return mu(p,N)}function Eu(p){if(!Tu(p))return!1;var N=aa(p);return N==m||N==b||N==d||N==H}function Vi(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=i}function Tu(p){var N=typeof p;return p!=null&&(N=="object"||N=="function")}function qr(p){return p!=null&&typeof p=="object"}var _u=ze?nn(ze):lc;function Xi(p){return Ki(p)?ic(p):cc(p)}function Ec(){return[]}function Tc(){return!1}t.exports=vc})(fo,fo.exports)),fo.exports}var Bu={},jp;function j4(){if(jp)return Bu;jp=1,Object.defineProperty(Bu,"__esModule",{value:!0});const t=Hb(),e=qb();var n;return(function(r){function s(u={},d={},h=!1){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});let g=t(d);h||(g=Object.keys(g).reduce((f,m)=>(g[m]!=null&&(f[m]=g[m]),f),{}));for(const f in u)u[f]!==void 0&&d[f]===void 0&&(g[f]=u[f]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(u={},d={}){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});const h=Object.keys(u).concat(Object.keys(d)).reduce((g,f)=>(e(u[f],d[f])||(g[f]=d[f]===void 0?null:d[f]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(u={},d={}){u=u||{};const h=Object.keys(d).reduce((g,f)=>(d[f]!==u[f]&&u[f]!==void 0&&(g[f]=d[f]),g),{});return Object.keys(u).reduce((g,f)=>(u[f]!==d[f]&&d[f]===void 0&&(g[f]=null),g),h)}r.invert=i;function o(u,d,h=!1){if(typeof u!="object")return d;if(typeof d!="object")return;if(!h)return d;const g=Object.keys(d).reduce((f,m)=>(u[m]===void 0&&(f[m]=d[m]),f),{});return Object.keys(g).length>0?g:void 0}r.transform=o})(n||(n={})),Bu.default=n,Bu}var Fu={},$p;function jb(){if($p)return Fu;$p=1,Object.defineProperty(Fu,"__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={})),Fu.default=t,Fu}var Uu={},Yp;function $4(){if(Yp)return Uu;Yp=1,Object.defineProperty(Uu,"__esModule",{value:!0});const t=jb();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,i=t.default.length(s);if(r>=i-a?(r=i-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),i=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(i)}}else return[]}}return Uu.default=e,Uu}var zp;function Y4(){return zp||(zp=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=q4(),r=Hb(),s=qb(),a=j4();e.AttributeMap=a.default;const i=jb();e.Op=i.default;const o=$4();e.OpIterator=o.default;const u="\0",d=(g,f)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const m=Object.keys(g)[0];if(!m||m!==Object.keys(f)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(f)[0]}`);return[m,g[m],f[m]]};class h{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,m){this.handlers[f]=m}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const m=this.handlers[f];if(!m)throw new Error(`no handlers for embed type "${f}"`);return m}insert(f,m){const b={};return typeof f=="string"&&f.length===0?this:(b.insert=f,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,m){if(typeof f=="number"&&f<=0)return this;const b={retain:f};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b)}push(f){let m=this.ops.length,b=this.ops[m-1];if(f=r(f),typeof b=="object"){if(typeof f.delete=="number"&&typeof b.delete=="number")return this.ops[m-1]={delete:b.delete+f.delete},this;if(typeof b.delete=="number"&&f.insert!=null&&(m-=1,b=this.ops[m-1],typeof b!="object"))return this.ops.unshift(f),this;if(s(f.attributes,b.attributes)){if(typeof f.insert=="string"&&typeof b.insert=="string")return this.ops[m-1]={insert:b.insert+f.insert},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof b.retain=="number")return this.ops[m-1]={retain:b.retain+f.retain},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this}}return m===this.ops.length?this.ops.push(f):this.ops.splice(m,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const m=[],b=[];return this.forEach(_=>{(f(_)?m:b).push(_)}),[m,b]}reduce(f,m){return this.ops.reduce(f,m)}changeLength(){return this.reduce((f,m)=>m.insert?f+i.default.length(m):m.delete?f-m.delete:f,0)}length(){return this.reduce((f,m)=>f+i.default.length(m),0)}slice(f=0,m=1/0){const b=[],_=new o.default(this.ops);let A=0;for(;A<m&&_.hasNext();){let E;A<f?E=_.next(f-A):(E=_.next(m-A),b.push(E)),A+=i.default.length(E)}return new h(b)}compose(f){const m=new o.default(this.ops),b=new o.default(f.ops),_=[],A=b.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let C=A.retain;for(;m.peekType()==="insert"&&m.peekLength()<=C;)C-=m.peekLength(),_.push(m.next());A.retain-C>0&&b.next(A.retain-C)}const E=new h(_);for(;m.hasNext()||b.hasNext();)if(b.peekType()==="insert")E.push(b.next());else if(m.peekType()==="delete")E.push(m.next());else{const C=Math.min(m.peekLength(),b.peekLength()),I=m.next(C),H=b.next(C);if(H.retain){const B={};if(typeof I.retain=="number")B.retain=typeof H.retain=="number"?C:H.retain;else if(typeof H.retain=="number")I.retain==null?B.insert=I.insert:B.retain=I.retain;else{const F=I.retain==null?"insert":"retain",[Y,X,te]=d(I[F],H.retain),T=h.getHandler(Y);B[F]={[Y]:T.compose(X,te,F==="retain")}}const J=a.default.compose(I.attributes,H.attributes,typeof I.retain=="number");if(J&&(B.attributes=J),E.push(B),!b.hasNext()&&s(E.ops[E.ops.length-1],B)){const F=new h(m.rest());return E.concat(F).chop()}}else typeof H.delete=="number"&&(typeof I.retain=="number"||typeof I.retain=="object"&&I.retain!==null)&&E.push(H)}return E.chop()}concat(f){const m=new h(this.ops.slice());return f.ops.length>0&&(m.push(f.ops[0]),m.ops=m.ops.concat(f.ops.slice(1))),m}diff(f,m){if(this.ops===f.ops)return new h;const b=[this,f].map(I=>I.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:u;const B=I===f?"on":"with";throw new Error("diff() called "+B+" non-document")}).join("")),_=new h,A=n(b[0],b[1],m,!0),E=new o.default(this.ops),C=new o.default(f.ops);return A.forEach(I=>{let H=I[1].length;for(;H>0;){let B=0;switch(I[0]){case n.INSERT:B=Math.min(C.peekLength(),H),_.push(C.next(B));break;case n.DELETE:B=Math.min(H,E.peekLength()),E.next(B),_.delete(B);break;case n.EQUAL:B=Math.min(E.peekLength(),C.peekLength(),H);const J=E.next(B),F=C.next(B);s(J.insert,F.insert)?_.retain(B,a.default.diff(J.attributes,F.attributes)):_.push(F).delete(B);break}H-=B}}),_.chop()}eachLine(f,m=`
73
- `){const b=new o.default(this.ops);let _=new h,A=0;for(;b.hasNext();){if(b.peekType()!=="insert")return;const E=b.peek(),C=i.default.length(E)-b.peekLength(),I=typeof E.insert=="string"?E.insert.indexOf(m,C)-C:-1;if(I<0)_.push(b.next());else if(I>0)_.push(b.next(I));else{if(f(_,b.next(1).attributes||{},A)===!1)return;A+=1,_=new h}}_.length()>0&&f(_,{},A)}invert(f){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 A=_.delete||_.retain;return f.slice(b,b+A).forEach(C=>{_.delete?m.push(C):_.retain&&_.attributes&&m.retain(i.default.length(C),a.default.invert(_.attributes,C.attributes))}),b+A}else if(typeof _.retain=="object"&&_.retain!==null){const A=f.slice(b,b+1),E=new o.default(A.ops).next(),[C,I,H]=d(_.retain,E.insert),B=h.getHandler(C);return m.retain({[C]:B.invert(I,H)},a.default.invert(_.attributes,E.attributes)),b+1}}return b},0),m.chop()}transform(f,m=!1){if(m=!!m,typeof f=="number")return this.transformPosition(f,m);const b=f,_=new o.default(this.ops),A=new o.default(b.ops),E=new h;for(;_.hasNext()||A.hasNext();)if(_.peekType()==="insert"&&(m||A.peekType()!=="insert"))E.retain(i.default.length(_.next()));else if(A.peekType()==="insert")E.push(A.next());else{const C=Math.min(_.peekLength(),A.peekLength()),I=_.next(C),H=A.next(C);if(I.delete)continue;if(H.delete)E.push(H);else{const B=I.retain,J=H.retain;let F=typeof J=="object"&&J!==null?J:C;if(typeof B=="object"&&B!==null&&typeof J=="object"&&J!==null){const Y=Object.keys(B)[0];if(Y===Object.keys(J)[0]){const X=h.getHandler(Y);X&&(F={[Y]:X.transform(B[Y],J[Y],m)})}}E.retain(F,a.default.transform(I.attributes,H.attributes,m))}}return E.chop()}transformPosition(f,m=!1){m=!!m;const b=new o.default(this.ops);let _=0;for(;b.hasNext()&&_<=f;){const A=b.peekLength(),E=b.peekType();if(b.next(),E==="delete"){f-=Math.min(A,f-_);continue}else E==="insert"&&(_<f||!m)&&(f+=A);_+=A}return f}}h.Op=i.default,h.OpIterator=o.default,h.AttributeMap=a.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h})(Mu,Mu.exports)),Mu.exports}var ur=Y4();const Oe=Ub(ur);class Br extends Vn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Br.blotName="break";Br.tagName="BR";let xr=class extends Il{};const z4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ec(t){return t.replace(/[&<>"']/g,e=>z4[e])}const jr=class jr extends Fh{static compare(e,n){const r=jr.order.indexOf(e),s=jr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(jr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Re.BLOT)){const a=this.isolate(e,n);s&&a.wrap(r,s)}else super.formatAt(e,n,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof jr&&jr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};_e(jr,"allowedChildren",[jr,Br,Vn,xr]),_e(jr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let rs=jr;const Wp=1;class fn extends jo{constructor(){super(...arguments);_e(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=$b(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,Re.BLOCK)?n+r===this.length()&&this.format(s,a):super.formatAt(n,Math.min(r,this.length()-n-1),s,a),this.cache={})}insertAt(n,r,s){if(s!=null){super.insertAt(n,r,s),this.cache={};return}if(r.length===0)return;const a=r.split(`
72
+ */const ZN=Symbol("lucide-context"),JN=()=>pE(ZN);var e6=sT("<svg><!><!></svg>");function Pr(t,e){ct(e,!0);const n=JN()??{},r=ir(e,"color",19,()=>n.color??"currentColor"),s=ir(e,"size",19,()=>n.size??24),a=ir(e,"strokeWidth",19,()=>n.strokeWidth??2),i=ir(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),o=ir(e,"iconNode",19,()=>[]),u=hr(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),d=Ae(()=>i()?Number(a())*24/Number(s()):a());var h=e6();f0(h,m=>({...XN,...m,...u,width:s(),height:s(),stroke:r(),"stroke-width":l(d),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!QN(u)&&{"aria-hidden":"true"}]);var g=S(h);It(g,17,o,xo,(m,b)=>{var _=Ae(()=>Pv(l(b),2));let A=()=>l(_)[0],E=()=>l(_)[1];var C=Gn(),I=nt(C);pT(I,A,!0,(H,B)=>{f0(H,()=>({...E()}))}),q(m,C)});var f=x(g);hT(f,()=>e.children??Pf),q(t,h),dt()}function wh(t,e){let n=hr(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"}]];Pr(t,Dr({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function t6(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Pr(t,Dr({name:"plus"},()=>n,{get iconNode(){return r}}))}function Ih(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Pr(t,Dr({name:"x"},()=>n,{get iconNode(){return r}}))}function n6(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];Pr(t,Dr({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function r6(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];Pr(t,Dr({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function cb(t,e){let n=hr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];Pr(t,Dr({name:"search"},()=>n,{get iconNode(){return r}}))}function s6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"house"},()=>n,{get iconNode(){return r}}))}function a6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"link"},()=>n,{get iconNode(){return r}}))}function i6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"external-link"},()=>n,{get iconNode(){return r}}))}function rf(t,e){let n=hr(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"}]];Pr(t,Dr({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function o6(t,e){let n=hr(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"}]];Pr(t,Dr({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}let Ch=Z(null),Lh=Z(null);function li(){return l(Ch)}function cp(){return l(Lh)}function u6(t,e){y(Ch,{entry:t,parent:e},!0)}function Uc(t){y(Lh,t,!0)}function Cs(){y(Ch,null),y(Lh,null)}let Hc=Z(null);const sf={get target(){return l(Hc)},request(t){y(Hc,t,!0)},clear(){y(Hc,null)}};function l6(){let t=Z("content");return{get mode(){return l(t)},set(e){y(t,e,!0)}}}const Ar=l6(),c6="nanoesis-restore:";function af(t){return`${c6}${t}`}function d6(t,e,n){t.getItem(af(e))===null&&t.setItem(af(e),JSON.stringify(n))}function f6(t,e){const n=t.getItem(af(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function h6(){let t=Z("saved"),e=null;return{get state(){return l(t)},get canRetry(){return l(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 Os=h6(),p6=new Set(["title","created","published","updated"]);function m6(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 g6(t,e,n){if(t.type==="authors")return m6(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 b6(t){return t===""||Array.isArray(t)&&t.length===0}function dp(t,e,n,r=t.isPublished){const s={...t.fields},a={title:t.title,created:t.created,published:t.published,updated:t.updated};for(const o of e){const u=n[o.name]??"";if(p6.has(o.name)){a[o.name]=o.name==="title"?u:u||void 0;continue}const d=g6(o,t.fields[o.name],u);b6(d)?delete s[o.name]:s[o.name]=d}const i={};return t.template!==void 0&&(i.template=t.template),i.title=a.title,i.isPublished=r,a.created!==void 0&&(i.created=a.created),a.published!==void 0&&(i.published=a.published),a.updated!==void 0&&(i.updated=a.updated),i.fields=s,`${JSON.stringify(i,null,2)}
73
+ `}function of(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 v6=0;var E6=z('<li draggable="true"><span class="grip svelte-5hnbr8" aria-hidden="true"><!></span> <span class="name svelte-5hnbr8"> </span> <button type="button" class="remove svelte-5hnbr8"><!></button></li>'),T6=z('<ul class="pills svelte-5hnbr8"></ul>'),_6=z('<li role="option"> </li>'),A6=z('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),y6=z('<div class="authors svelte-5hnbr8" role="group"><!> <div class="add svelte-5hnbr8"><input type="text" class="add-input svelte-5hnbr8" placeholder="Add an author…" autocomplete="off" role="combobox" aria-autocomplete="list"/> <!></div></div>');function N6(t,e){ct(e,!0);function n(G){if(G.trim()==="")return[];try{const ee=JSON.parse(G);return Array.isArray(ee)?ee.flatMap(le=>{if(le===null||typeof le!="object")return[];const be=le,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-${++v6}`;let a=Z(lt([])),i=Z(""),o=Z(!1),u=Z(0),d=Z(void 0),h=Z(null),g=Z(null);Dt(()=>{Q3().then(G=>y(a,G,!0))});const f=Ae(()=>new Map(l(a).map(G=>[G.user,G.name]))),m=Ae(()=>new Set(l(r).map(G=>G.user).filter(G=>G!==void 0)));function b(G){return G.user!==void 0?l(f).get(G.user)??G.name:G.name}const _=Ae(()=>{const G=l(i).trim().toLowerCase();return G===""?[]:l(a).filter(ee=>!l(m).has(ee.user)&&ee.name.toLowerCase().includes(G)).slice(0,6)}),A=Ae(()=>l(o)&&l(i).trim()!==""),E=Ae(()=>l(_).length),C=Ae(()=>l(A)?l(u)<l(_).length?`${s}-opt-${l(u)}`:`${s}-guest`:void 0);function I(G){e.onchange(G.length===0?"":JSON.stringify(G))}function H(G){l(m).has(G.user)||(I([...l(r),{name:G.name,user:G.user}]),y(i,""))}function B(G){const ee=G.trim();ee!==""&&(I([...l(r),{name:ee}]),y(i,""))}function J(){const G=l(_)[l(u)];G!==void 0?H(G):B(l(i))}function F(){var G,ee;(ee=(G=l(d))==null?void 0:G.children[l(u)])==null||ee.scrollIntoView({block:"nearest"})}function Y(G){if(!l(A)){G.key==="Enter"&&(G.preventDefault(),B(l(i)));return}const ee=l(_).length+1;G.key==="ArrowDown"?(G.preventDefault(),y(u,(l(u)+1)%ee),F()):G.key==="ArrowUp"?(G.preventDefault(),y(u,(l(u)-1+ee)%ee),F()):G.key==="Enter"?(G.preventDefault(),J()):G.key==="Escape"&&(G.preventDefault(),y(i,""))}function X(G){I(l(r).filter((ee,le)=>le!==G))}function te(G,ee){var le;y(h,G,!0),(le=ee.dataTransfer)==null||le.setData("text/plain",String(G)),ee.dataTransfer&&(ee.dataTransfer.effectAllowed="move")}function T(G,ee){l(h)!==null&&(ee.preventDefault(),y(g,G,!0))}function D(G){l(h)!==null&&l(h)!==G&&I(of(l(r),l(h),G)),y(h,null),y(g,null)}function v(){y(h,null),y(g,null)}var R=y6(),k=S(R);{var O=G=>{var ee=T6();It(ee,21,()=>l(r),xo,(le,be,pe)=>{var Ne=E6();let ce;var he=S(Ne),Se=S(he);rf(Se,{size:14});var ye=x(he,2),Ie=S(ye),xe=x(ye,2),De=S(xe);Ih(De,{size:14,"aria-hidden":"true"}),se((ze,et)=>{ce=Je(Ne,1,"pill svelte-5hnbr8",null,ce,{guest:l(be).user===void 0,dragging:l(h)===pe,over:l(g)===pe&&l(h)!==pe}),ve(ye,"title",l(be).user??"Guest"),oe(Ie,ze),ve(xe,"aria-label",et)},[()=>b(l(be)),()=>`Remove ${b(l(be))}`]),Be("dragstart",Ne,ze=>te(pe,ze)),Be("dragover",Ne,ze=>T(pe,ze)),Be("drop",Ne,()=>D(pe)),Be("dragend",Ne,v),ae("click",xe,()=>X(pe)),q(le,Ne)}),q(G,ee)};de(k,G=>{l(r).length>0&&G(O)})}var W=x(k,2),j=S(W),M=x(j,2);{var $=G=>{var ee=A6(),le=S(ee);It(le,19,()=>l(_),ce=>ce.user,(ce,he,Se)=>{var ye=_6();let Ie;var xe=S(ye);se(()=>{ve(ye,"id",`${s}-opt-${l(Se)}`),Ie=Je(ye,1,"option svelte-5hnbr8",null,Ie,{active:l(Se)===l(u)}),ve(ye,"aria-selected",l(Se)===l(u)),oe(xe,l(he).name)}),ae("click",ye,()=>H(l(he))),Be("mouseenter",ye,()=>y(u,l(Se),!0)),q(ce,ye)});var be=x(le,2);let pe;var Ne=S(be);pn(ee,ce=>y(d,ce),()=>l(d)),se(ce=>{ve(ee,"id",`${s}-listbox`),ve(be,"id",`${s}-guest`),pe=Je(be,1,"option guest-option svelte-5hnbr8",null,pe,{active:l(u)===l(E)}),ve(be,"aria-selected",l(u)===l(E)),oe(Ne,`Add “${ce??""}” as a guest`)},[()=>l(i).trim()]),ae("click",be,()=>B(l(i))),Be("mouseenter",be,()=>y(u,l(E),!0)),q(G,ee)};de(M,G=>{l(A)&&G($)})}se(()=>{ve(R,"aria-labelledby",e.labelledBy),ve(j,"aria-expanded",l(A)),ve(j,"aria-controls",`${s}-listbox`),ve(j,"aria-activedescendant",l(C))}),ae("input",j,()=>y(u,0)),ae("keydown",j,Y),Be("focus",j,()=>{y(o,!0),y(u,0)}),Be("blur",j,()=>setTimeout(()=>y(o,!1),120)),vt(j,()=>l(i),G=>y(i,G)),q(t,R),dt()}bt(["click","input","keydown"]);var S6=z('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),w6=z('<p class="empty svelte-1nm0yno">No file selected.</p>'),I6=z('<li class="hint svelte-1nm0yno">Loading…</li>'),C6=z('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),L6=z('<li><button type="button"> </button></li>'),O6=z('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),x6=z('<p class="error svelte-1nm0yno" role="alert"> </p>'),R6=z('<div class="file-field svelte-1nm0yno" role="group"><!> <div class="actions svelte-1nm0yno"><button type="button" class="action svelte-1nm0yno"> </button> <label class="action upload svelte-1nm0yno">Upload… <input type="file" class="svelte-1nm0yno"/></label></div> <!> <!></div>');function D6(t,e){ct(e,!0);let n=Z(lt([])),r=Z(!1),s=Z(!1),a=!1,i=Z(null);const o=Ae(()=>e.value.split("/").pop()??e.value);async function u(){y(s,!0);try{y(n,await mN(e.itemDir),!0),a=!0}finally{y(s,!1)}}function d(){y(r,!l(r)),l(r)&&!a&&u()}function h(X){var D;const te=X.currentTarget,T=(D=te.files)==null?void 0:D[0];te.value="",T&&g(T)}async function g(X){y(i,null);try{e.onchange(await Th(e.itemDir,X)),a=!1,l(r)&&await u()}catch(te){y(i,te instanceof Error?te.message:String(te),!0)}}var f=R6(),m=S(f);{var b=X=>{var te=S6(),T=S(te),D=S(T),v=x(T,2);se(R=>{ve(T,"href",R),oe(D,l(o))},[()=>ou(e.itemDir,e.value)]),ae("click",v,()=>e.onchange("")),q(X,te)},_=X=>{var te=w6();q(X,te)};de(m,X=>{e.value?X(b):X(_,-1)})}var A=x(m,2),E=S(A),C=S(E),I=x(E,2),H=x(S(I)),B=x(A,2);{var J=X=>{var te=O6(),T=S(te);{var D=k=>{var O=I6();q(k,O)},v=k=>{var O=C6();q(k,O)},R=k=>{var O=Gn(),W=nt(O);It(W,16,()=>l(n),j=>j,(j,M)=>{const $=Ae(()=>kg(M));var G=L6(),ee=S(G);let le;var be=S(ee);se(()=>{le=Je(ee,1,"file svelte-1nm0yno",null,le,{selected:e.value===l($)}),ve(ee,"aria-pressed",e.value===l($)),oe(be,M)}),ae("click",ee,()=>e.onchange(l($))),q(j,G)}),q(k,O)};de(T,k=>{l(s)?k(D):l(n).length===0?k(v,1):k(R,-1)})}q(X,te)};de(B,X=>{l(r)&&X(J)})}var F=x(B,2);{var Y=X=>{var te=x6(),T=S(te);se(()=>oe(T,l(i))),q(X,te)};de(F,X=>{l(i)&&X(Y)})}se(()=>{ve(f,"aria-labelledby",e.labelledBy),ve(E,"aria-expanded",l(r)),oe(C,l(r)?"Hide files":"Choose from files")}),ae("click",E,d),ae("change",H,h),q(t,f),dt()}bt(["click","change"]);var k6=z('<div class="preview svelte-s6anrr"><img class="preview-img svelte-s6anrr" alt=""/> <div class="preview-meta svelte-s6anrr"><span class="filename svelte-s6anrr"> </span> <div class="row svelte-s6anrr"><label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label> <button type="button" class="link svelte-s6anrr">Remove</button></div></div></div>'),P6=z('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),M6=z('<p class="error svelte-s6anrr" role="alert"> </p>'),B6=z('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function F6(t,e){ct(e,!0);let n=Z(!1),r=Z(null);const s=Ae(()=>e.value===""?"":/^(\/|[a-z][a-z0-9+.-]*:)/i.test(e.value)?e.value:ou(e.itemDir,e.value));function a(m){var A;const b=m.currentTarget,_=(A=b.files)==null?void 0:A[0];b.value="",_&&i(_)}async function i(m){y(r,null),y(n,!0);try{e.onchange(await Th(e.itemDir,m))}catch(b){y(r,b instanceof Error?b.message:String(b),!0)}finally{y(n,!1)}}var o=B6(),u=S(o);{var d=m=>{var b=k6(),_=S(b),A=x(_,2),E=S(A),C=S(E),I=x(E,2),H=S(I);let B;var J=S(H),F=x(J),Y=x(H,2);se(()=>{ve(_,"src",l(s)),oe(C,e.value),B=Je(H,1,"action svelte-s6anrr",null,B,{busy:l(n)}),oe(J,`${l(n)?"Uploading…":"Replace…"} `),F.disabled=l(n)}),ae("change",F,a),ae("click",Y,()=>e.onchange("")),q(m,b)},h=m=>{var b=P6();let _;var A=S(b),E=x(A);se(()=>{_=Je(b,1,"action svelte-s6anrr",null,_,{busy:l(n)}),oe(A,`${l(n)?"Uploading…":"Upload image…"} `),E.disabled=l(n)}),ae("change",E,a),q(m,b)};de(u,m=>{e.value?m(d):m(h,-1)})}var g=x(u,2);{var f=m=>{var b=M6(),_=S(b);se(()=>oe(_,l(r))),q(m,b)};de(g,m=>{l(r)&&m(f)})}se(()=>ve(o,"aria-labelledby",e.labelledBy)),q(t,o),dt()}bt(["change","click"]);var U6=z("<option> </option>"),H6=z("<option>Top level</option>"),q6=z("<option> </option>"),j6=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Move</h3> <div class="manage svelte-wge2ya"><label class="grow svelte-wge2ya"><span class="visually-hidden svelte-wge2ya">Move to folder</span> <select class="svelte-wge2ya"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-wge2ya">Move</button></div></div>'),$6=z('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),Y6=z('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),z6=z(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
74
+ heading at the top of the form.</p>`),W6=z('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),G6=z('<dialog aria-label="Edit item" class="svelte-wge2ya"><form><h2 class="svelte-wge2ya">Edit item</h2> <label class="svelte-wge2ya"><span class="svelte-wge2ya">Template</span> <select class="svelte-wge2ya"></select> <span class="help svelte-wge2ya">Switching keeps any field values the new template doesn’t use.</span></label> <!> <!> <div class="actions svelte-wge2ya"><button type="button" class="ghost svelte-wge2ya">Cancel</button> <button type="submit" class="primary svelte-wge2ya">Save</button></div></form></dialog>');function K6(t,e){ct(e,!0);const n=ir(e,"currentFolder",3,""),r=ir(e,"folders",19,()=>[]);let s,a=Z(lt(e.templateName));const i="\0";let o=Z(i);const u=Ae(()=>r().filter(B=>B!==n())),d=Ae(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);Ua(()=>s.showModal());function h(B){B.preventDefault(),l(a)!==e.templateName?e.onchangetemplate(l(a)):e.onclose()}var g=G6(),f=S(g),m=x(S(f),2),b=x(S(m),2);It(b,20,()=>l(d),B=>B,(B,J)=>{var F=U6(),Y=S(F),X={};se(()=>{oe(Y,J),X!==(X=J)&&(F.value=(F.__value=J)??"")}),q(B,F)});var _=x(m,2);{var A=B=>{var J=j6(),F=x(S(J),2),Y=S(F),X=x(S(Y),2),te=S(X);te.value=te.__value=i;var T=x(te);{var D=k=>{var O=H6();O.value=O.__value="",q(k,O)};de(T,k=>{n()!==""&&k(D)})}var v=x(T);It(v,16,()=>l(u),k=>k,(k,O)=>{var W=q6(),j=S(W),M={};se(()=>{oe(j,`${O??""}/`),M!==(M=O)&&(W.value=(W.__value=O)??"")}),q(k,W)});var R=x(Y,2);se(()=>R.disabled=l(o)===i),xa(X,()=>l(o),k=>y(o,k)),ae("click",R,()=>e.onmove(l(o))),q(B,J)};de(_,B=>{e.onmove&&B(A)})}var E=x(_,2);{var C=B=>{var J=W6(),F=x(S(J),2),Y=S(F);{var X=R=>{var k=$6();ae("click",k,function(...O){var W;(W=e.onrename)==null||W.apply(this,O)}),q(R,k)};de(Y,R=>{e.onrename&&R(X)})}var te=x(Y,2);{var T=R=>{var k=Y6();ae("click",k,function(...O){var W;(W=e.ondelete)==null||W.apply(this,O)}),q(R,k)};de(te,R=>{e.ondelete&&R(T)})}var D=x(F,2);{var v=R=>{var k=z6();q(R,k)};de(D,R=>{e.onrename&&R(v)})}q(B,J)};de(E,B=>{(e.onrename||e.ondelete)&&B(C)})}var I=x(E,2),H=S(I);pn(g,B=>s=B,()=>s),Be("close",g,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),Be("cancel",g,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),Be("submit",f,h),xa(b,()=>l(a),B=>y(a,B)),ae("click",H,function(...B){var J;(J=e.onclose)==null||J.apply(this,B)}),q(t,g),dt()}bt(["click"]);let No=Z(null);const V6={get pending(){return l(No)}};function db(t=""){return new Promise(e=>{y(No,{current:t,resolve:e},!0)})}function Za(t){l(No)!==null&&(l(No).resolve(t),y(No,null))}const Oh="ref:";function Fo(t){return t.startsWith(Oh)}function uf(t){return Fo(t)?t.slice(Oh.length):t}function X6(t){return`${Oh}${t}`}var Q6=z('<!> <span class="target svelte-147ryxk"> </span>',1),Z6=z('<!> <span class="target svelte-147ryxk"> </span>',1),J6=z('<span class="value svelte-147ryxk"><!></span> <button type="button" class="action svelte-147ryxk">Edit</button> <button type="button" class="action svelte-147ryxk">Clear</button>',1),eS=z('<button type="button" class="action svelte-147ryxk">Set link…</button>'),tS=z('<div class="link-field svelte-147ryxk" role="group"><!></div>');function nS(t,e){ct(e,!0);async function n(){const o=await db(e.value);o!==null&&e.onchange(o)}var r=tS(),s=S(r);{var a=o=>{var u=J6(),d=nt(u),h=S(d);{var g=A=>{var E=Q6(),C=nt(E);a6(C,{size:14,"aria-hidden":"true"});var I=x(C,2),H=S(I);se((B,J)=>{ve(I,"title",B),oe(H,J)},[()=>`Page: ${uf(e.value)}`,()=>uf(e.value)]),q(A,E)},f=Ae(()=>Fo(e.value)),m=A=>{var E=Z6(),C=nt(E);i6(C,{size:14,"aria-hidden":"true"});var I=x(C,2),H=S(I);se(()=>{ve(I,"title",e.value),oe(H,e.value)}),q(A,E)};de(h,A=>{l(f)?A(g):A(m,-1)})}var b=x(d,2),_=x(b,2);ae("click",b,n),ae("click",_,()=>e.onchange("")),q(o,u)},i=o=>{var u=eS();ae("click",u,n),q(o,u)};de(s,o=>{e.value?o(a):o(i,-1)})}se(()=>ve(r,"aria-labelledby",e.labelledBy)),q(t,r),dt()}bt(["click"]);var rS=z('<p class="note error svelte-1v8pkea"> </p>'),sS=z('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),aS=z('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),iS=z('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),oS=z('<section class="preview svelte-1v8pkea" aria-label="Preview"><header class="bar svelte-1v8pkea"><strong class="title svelte-1v8pkea">Preview</strong> <span class="dims svelte-1v8pkea" title="Current preview width"> </span> <button type="button" class="close svelte-1v8pkea" title="Close preview" aria-label="Close preview"><!></button></header> <div class="frame svelte-1v8pkea"><!></div></section>');function uS(t,e){ct(e,!0);let n=Z(""),r=Z("loading"),s=Z(""),a=Z(0),i=Z(void 0),o={x:0,y:0};function u(){var F;try{const Y=(F=l(i))==null?void 0:F.contentWindow;Y&&(o={x:Y.scrollX,y:Y.scrollY})}catch{}}function d(){var F,Y;try{(Y=(F=l(i))==null?void 0:F.contentWindow)==null||Y.scrollTo(o.x,o.y)}catch{}}let h;Dt(()=>{const F=e.previewItem,Y=e.path;if(clearTimeout(h),F===null){y(r,"loading");return}return h=setTimeout(()=>void g(Y,F),350),()=>clearTimeout(h)});async function g(F,Y){try{const X=await DN(F,Y);if(X===void 0){y(r,"empty");return}u(),y(n,X,!0),y(r,"ready")}catch(X){y(s,X instanceof Error?X.message:String(X),!0),y(r,"error")}}var f=oS(),m=S(f),b=x(S(m),2),_=S(b),A=x(b,2),E=S(A);Ih(E,{size:18,"aria-hidden":"true"});var C=x(m,2),I=S(C);{var H=F=>{var Y=rS(),X=S(Y);se(()=>oe(X,`Couldn’t render preview: ${l(s)??""}`)),q(F,Y)},B=F=>{var Y=sS();q(F,Y)},J=F=>{var Y=iS(),X=nt(Y);pn(X,D=>y(i,D),()=>l(i));var te=x(X,2);{var T=D=>{var v=aS();q(D,v)};de(te,D=>{l(r)==="loading"&&D(T)})}se(()=>ve(X,"srcdoc",l(n))),Be("load",X,d),q(F,Y)};de(I,F=>{l(r)==="error"?F(H):l(r)==="empty"?F(B,1):F(J,-1)})}se(F=>oe(_,`${F??""}px`),[()=>Math.round(l(a))]),ae("click",A,function(...F){var Y;(Y=e.onclose)==null||Y.apply(this,F)}),LT(C,"clientWidth",F=>y(a,F)),q(t,f),dt()}bt(["click"]);var fb=typeof global=="object"&&global&&global.Object===Object&&global,lS=typeof self=="object"&&self&&self.Object===Object&&self,ss=fb||lS||Function("return this")(),Gs=ss.Symbol,hb=Object.prototype,cS=hb.hasOwnProperty,dS=hb.toString,so=Gs?Gs.toStringTag:void 0;function fS(t){var e=cS.call(t,so),n=t[so];try{t[so]=void 0;var r=!0}catch{}var s=dS.call(t);return r&&(e?t[so]=n:delete t[so]),s}var hS=Object.prototype,pS=hS.toString;function mS(t){return pS.call(t)}var gS="[object Null]",bS="[object Undefined]",fp=Gs?Gs.toStringTag:void 0;function Yi(t){return t==null?t===void 0?bS:gS:fp&&fp in Object(t)?fS(t):mS(t)}function Ts(t){return t!=null&&typeof t=="object"}var Da=Array.isArray;function Qs(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function pb(t){return t}var vS="[object AsyncFunction]",ES="[object Function]",TS="[object GeneratorFunction]",_S="[object Proxy]";function xh(t){if(!Qs(t))return!1;var e=Yi(t);return e==ES||e==TS||e==vS||e==_S}var qc=ss["__core-js_shared__"],hp=(function(){var t=/[^.]+$/.exec(qc&&qc.keys&&qc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function AS(t){return!!hp&&hp in t}var yS=Function.prototype,NS=yS.toString;function ja(t){if(t!=null){try{return NS.call(t)}catch{}try{return t+""}catch{}}return""}var SS=/[\\^$.*+?()[\]{}|]/g,wS=/^\[object .+?Constructor\]$/,IS=Function.prototype,CS=Object.prototype,LS=IS.toString,OS=CS.hasOwnProperty,xS=RegExp("^"+LS.call(OS).replace(SS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RS(t){if(!Qs(t)||AS(t))return!1;var e=xh(t)?xS:wS;return e.test(ja(t))}function DS(t,e){return t==null?void 0:t[e]}function $a(t,e){var n=DS(t,e);return RS(n)?n:void 0}var lf=$a(ss,"WeakMap"),pp=Object.create,kS=(function(){function t(){}return function(e){if(!Qs(e))return{};if(pp)return pp(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function PS(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 MS(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var BS=800,FS=16,US=Date.now;function HS(t){var e=0,n=0;return function(){var r=US(),s=FS-(r-n);if(n=r,s>0){if(++e>=BS)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function qS(t){return function(){return t}}var Nl=(function(){try{var t=$a(Object,"defineProperty");return t({},"",{}),t}catch{}})(),jS=Nl?function(t,e){return Nl(t,"toString",{configurable:!0,enumerable:!1,value:qS(e),writable:!0})}:pb,$S=HS(jS);function YS(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var zS=9007199254740991,WS=/^(?:0|[1-9]\d*)$/;function mb(t,e){var n=typeof t;return e=e??zS,!!e&&(n=="number"||n!="symbol"&&WS.test(t))&&t>-1&&t%1==0&&t<e}function Rh(t,e,n){e=="__proto__"&&Nl?Nl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function lu(t,e){return t===e||t!==t&&e!==e}var GS=Object.prototype,KS=GS.hasOwnProperty;function gb(t,e,n){var r=t[e];(!(KS.call(t,e)&&lu(r,n))||n===void 0&&!(e in t))&&Rh(t,e,n)}function VS(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var o=e[a],u=void 0;u===void 0&&(u=t[o]),s?Rh(n,o,u):gb(n,o,u)}return n}var mp=Math.max;function XS(t,e,n){return e=mp(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=mp(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=n(i),PS(t,this,o)}}function QS(t,e){return $S(XS(t,e,pb),t+"")}var ZS=9007199254740991;function bb(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ZS}function Vl(t){return t!=null&&bb(t.length)&&!xh(t)}function JS(t,e,n){if(!Qs(n))return!1;var r=typeof e;return(r=="number"?Vl(n)&&mb(e,n.length):r=="string"&&e in n)?lu(n[e],t):!1}function ew(t){return QS(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&&JS(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=n[r];o&&t(e,o,r,a)}return e})}var tw=Object.prototype;function Dh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||tw;return t===n}function nw(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var rw="[object Arguments]";function gp(t){return Ts(t)&&Yi(t)==rw}var vb=Object.prototype,sw=vb.hasOwnProperty,aw=vb.propertyIsEnumerable,cf=gp((function(){return arguments})())?gp:function(t){return Ts(t)&&sw.call(t,"callee")&&!aw.call(t,"callee")};function iw(){return!1}var Eb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bp=Eb&&typeof module=="object"&&module&&!module.nodeType&&module,ow=bp&&bp.exports===Eb,vp=ow?ss.Buffer:void 0,uw=vp?vp.isBuffer:void 0,Uo=uw||iw,lw="[object Arguments]",cw="[object Array]",dw="[object Boolean]",fw="[object Date]",hw="[object Error]",pw="[object Function]",mw="[object Map]",gw="[object Number]",bw="[object Object]",vw="[object RegExp]",Ew="[object Set]",Tw="[object String]",_w="[object WeakMap]",Aw="[object ArrayBuffer]",yw="[object DataView]",Nw="[object Float32Array]",Sw="[object Float64Array]",ww="[object Int8Array]",Iw="[object Int16Array]",Cw="[object Int32Array]",Lw="[object Uint8Array]",Ow="[object Uint8ClampedArray]",xw="[object Uint16Array]",Rw="[object Uint32Array]",wt={};wt[Nw]=wt[Sw]=wt[ww]=wt[Iw]=wt[Cw]=wt[Lw]=wt[Ow]=wt[xw]=wt[Rw]=!0;wt[lw]=wt[cw]=wt[Aw]=wt[dw]=wt[yw]=wt[fw]=wt[hw]=wt[pw]=wt[mw]=wt[gw]=wt[bw]=wt[vw]=wt[Ew]=wt[Tw]=wt[_w]=!1;function Dw(t){return Ts(t)&&bb(t.length)&&!!wt[Yi(t)]}function kh(t){return function(e){return t(e)}}var Tb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,So=Tb&&typeof module=="object"&&module&&!module.nodeType&&module,kw=So&&So.exports===Tb,jc=kw&&fb.process,Pi=(function(){try{var t=So&&So.require&&So.require("util").types;return t||jc&&jc.binding&&jc.binding("util")}catch{}})(),Ep=Pi&&Pi.isTypedArray,Ph=Ep?kh(Ep):Dw,Pw=Object.prototype,Mw=Pw.hasOwnProperty;function _b(t,e){var n=Da(t),r=!n&&cf(t),s=!n&&!r&&Uo(t),a=!n&&!r&&!s&&Ph(t),i=n||r||s||a,o=i?nw(t.length,String):[],u=o.length;for(var d in t)(e||Mw.call(t,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||mb(d,u)))&&o.push(d);return o}function Ab(t,e){return function(n){return t(e(n))}}var Bw=Ab(Object.keys,Object),Fw=Object.prototype,Uw=Fw.hasOwnProperty;function Hw(t){if(!Dh(t))return Bw(t);var e=[];for(var n in Object(t))Uw.call(t,n)&&n!="constructor"&&e.push(n);return e}function qw(t){return Vl(t)?_b(t):Hw(t)}function jw(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var $w=Object.prototype,Yw=$w.hasOwnProperty;function zw(t){if(!Qs(t))return jw(t);var e=Dh(t),n=[];for(var r in t)r=="constructor"&&(e||!Yw.call(t,r))||n.push(r);return n}function yb(t){return Vl(t)?_b(t,!0):zw(t)}var Ho=$a(Object,"create");function Ww(){this.__data__=Ho?Ho(null):{},this.size=0}function Gw(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Kw="__lodash_hash_undefined__",Vw=Object.prototype,Xw=Vw.hasOwnProperty;function Qw(t){var e=this.__data__;if(Ho){var n=e[t];return n===Kw?void 0:n}return Xw.call(e,t)?e[t]:void 0}var Zw=Object.prototype,Jw=Zw.hasOwnProperty;function eI(t){var e=this.__data__;return Ho?e[t]!==void 0:Jw.call(e,t)}var tI="__lodash_hash_undefined__";function nI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ho&&e===void 0?tI:e,this}function ka(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ka.prototype.clear=Ww;ka.prototype.delete=Gw;ka.prototype.get=Qw;ka.prototype.has=eI;ka.prototype.set=nI;function rI(){this.__data__=[],this.size=0}function Xl(t,e){for(var n=t.length;n--;)if(lu(t[n][0],e))return n;return-1}var sI=Array.prototype,aI=sI.splice;function iI(t){var e=this.__data__,n=Xl(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():aI.call(e,n,1),--this.size,!0}function oI(t){var e=this.__data__,n=Xl(e,t);return n<0?void 0:e[n][1]}function uI(t){return Xl(this.__data__,t)>-1}function lI(t,e){var n=this.__data__,r=Xl(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ys(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])}}ys.prototype.clear=rI;ys.prototype.delete=iI;ys.prototype.get=oI;ys.prototype.has=uI;ys.prototype.set=lI;var qo=$a(ss,"Map");function cI(){this.size=0,this.__data__={hash:new ka,map:new(qo||ys),string:new ka}}function dI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ql(t,e){var n=t.__data__;return dI(e)?n[typeof e=="string"?"string":"hash"]:n.map}function fI(t){var e=Ql(this,t).delete(t);return this.size-=e?1:0,e}function hI(t){return Ql(this,t).get(t)}function pI(t){return Ql(this,t).has(t)}function mI(t,e){var n=Ql(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Ya(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])}}Ya.prototype.clear=cI;Ya.prototype.delete=fI;Ya.prototype.get=hI;Ya.prototype.has=pI;Ya.prototype.set=mI;function gI(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var Nb=Ab(Object.getPrototypeOf,Object),bI="[object Object]",vI=Function.prototype,EI=Object.prototype,Sb=vI.toString,TI=EI.hasOwnProperty,_I=Sb.call(Object);function AI(t){if(!Ts(t)||Yi(t)!=bI)return!1;var e=Nb(t);if(e===null)return!0;var n=TI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Sb.call(n)==_I}function yI(){this.__data__=new ys,this.size=0}function NI(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function SI(t){return this.__data__.get(t)}function wI(t){return this.__data__.has(t)}var II=200;function CI(t,e){var n=this.__data__;if(n instanceof ys){var r=n.__data__;if(!qo||r.length<II-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ya(r)}return n.set(t,e),this.size=n.size,this}function Qr(t){var e=this.__data__=new ys(t);this.size=e.size}Qr.prototype.clear=yI;Qr.prototype.delete=NI;Qr.prototype.get=SI;Qr.prototype.has=wI;Qr.prototype.set=CI;var wb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tp=wb&&typeof module=="object"&&module&&!module.nodeType&&module,LI=Tp&&Tp.exports===wb,_p=LI?ss.Buffer:void 0,Ap=_p?_p.allocUnsafe:void 0;function Ib(t,e){if(e)return t.slice();var n=t.length,r=Ap?Ap(n):new t.constructor(n);return t.copy(r),r}function OI(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 xI(){return[]}var RI=Object.prototype,DI=RI.propertyIsEnumerable,yp=Object.getOwnPropertySymbols,kI=yp?function(t){return t==null?[]:(t=Object(t),OI(yp(t),function(e){return DI.call(t,e)}))}:xI;function PI(t,e,n){var r=e(t);return Da(t)?r:gI(r,n(t))}function df(t){return PI(t,qw,kI)}var ff=$a(ss,"DataView"),hf=$a(ss,"Promise"),pf=$a(ss,"Set"),Np="[object Map]",MI="[object Object]",Sp="[object Promise]",wp="[object Set]",Ip="[object WeakMap]",Cp="[object DataView]",BI=ja(ff),FI=ja(qo),UI=ja(hf),HI=ja(pf),qI=ja(lf),yr=Yi;(ff&&yr(new ff(new ArrayBuffer(1)))!=Cp||qo&&yr(new qo)!=Np||hf&&yr(hf.resolve())!=Sp||pf&&yr(new pf)!=wp||lf&&yr(new lf)!=Ip)&&(yr=function(t){var e=Yi(t),n=e==MI?t.constructor:void 0,r=n?ja(n):"";if(r)switch(r){case BI:return Cp;case FI:return Np;case UI:return Sp;case HI:return wp;case qI:return Ip}return e});var jI=Object.prototype,$I=jI.hasOwnProperty;function YI(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&$I.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Sl=ss.Uint8Array;function Mh(t){var e=new t.constructor(t.byteLength);return new Sl(e).set(new Sl(t)),e}function zI(t,e){var n=Mh(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var WI=/\w*$/;function GI(t){var e=new t.constructor(t.source,WI.exec(t));return e.lastIndex=t.lastIndex,e}var Lp=Gs?Gs.prototype:void 0,Op=Lp?Lp.valueOf:void 0;function KI(t){return Op?Object(Op.call(t)):{}}function Cb(t,e){var n=e?Mh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var VI="[object Boolean]",XI="[object Date]",QI="[object Map]",ZI="[object Number]",JI="[object RegExp]",eC="[object Set]",tC="[object String]",nC="[object Symbol]",rC="[object ArrayBuffer]",sC="[object DataView]",aC="[object Float32Array]",iC="[object Float64Array]",oC="[object Int8Array]",uC="[object Int16Array]",lC="[object Int32Array]",cC="[object Uint8Array]",dC="[object Uint8ClampedArray]",fC="[object Uint16Array]",hC="[object Uint32Array]";function pC(t,e,n){var r=t.constructor;switch(e){case rC:return Mh(t);case VI:case XI:return new r(+t);case sC:return zI(t);case aC:case iC:case oC:case uC:case lC:case cC:case dC:case fC:case hC:return Cb(t,n);case QI:return new r;case ZI:case tC:return new r(t);case JI:return GI(t);case eC:return new r;case nC:return KI(t)}}function Lb(t){return typeof t.constructor=="function"&&!Dh(t)?kS(Nb(t)):{}}var mC="[object Map]";function gC(t){return Ts(t)&&yr(t)==mC}var xp=Pi&&Pi.isMap,bC=xp?kh(xp):gC,vC="[object Set]";function EC(t){return Ts(t)&&yr(t)==vC}var Rp=Pi&&Pi.isSet,TC=Rp?kh(Rp):EC,_C=1,Ob="[object Arguments]",AC="[object Array]",yC="[object Boolean]",NC="[object Date]",SC="[object Error]",xb="[object Function]",wC="[object GeneratorFunction]",IC="[object Map]",CC="[object Number]",Rb="[object Object]",LC="[object RegExp]",OC="[object Set]",xC="[object String]",RC="[object Symbol]",DC="[object WeakMap]",kC="[object ArrayBuffer]",PC="[object DataView]",MC="[object Float32Array]",BC="[object Float64Array]",FC="[object Int8Array]",UC="[object Int16Array]",HC="[object Int32Array]",qC="[object Uint8Array]",jC="[object Uint8ClampedArray]",$C="[object Uint16Array]",YC="[object Uint32Array]",Nt={};Nt[Ob]=Nt[AC]=Nt[kC]=Nt[PC]=Nt[yC]=Nt[NC]=Nt[MC]=Nt[BC]=Nt[FC]=Nt[UC]=Nt[HC]=Nt[IC]=Nt[CC]=Nt[Rb]=Nt[LC]=Nt[OC]=Nt[xC]=Nt[RC]=Nt[qC]=Nt[jC]=Nt[$C]=Nt[YC]=!0;Nt[SC]=Nt[xb]=Nt[DC]=!1;function nl(t,e,n,r,s,a){var i,o=e&_C;if(i!==void 0)return i;if(!Qs(t))return t;var u=Da(t);if(u)i=YI(t);else{var d=yr(t),h=d==xb||d==wC;if(Uo(t))return Ib(t,o);if(d==Rb||d==Ob||h&&!s)i=h?{}:Lb(t);else{if(!Nt[d])return s?t:{};i=pC(t,d,o)}}a||(a=new Qr);var g=a.get(t);if(g)return g;a.set(t,i),TC(t)?t.forEach(function(b){i.add(nl(b,e,n,b,t,a))}):bC(t)&&t.forEach(function(b,_){i.set(_,nl(b,e,n,_,t,a))});var f=df,m=u?void 0:f(t);return YS(m||t,function(b,_){m&&(_=b,b=t[_]),gb(i,_,nl(b,e,n,_,t,a))}),i}var zC=1,WC=4;function pi(t){return nl(t,zC|WC)}var GC="__lodash_hash_undefined__";function KC(t){return this.__data__.set(t,GC),this}function VC(t){return this.__data__.has(t)}function wl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Ya;++e<n;)this.add(t[e])}wl.prototype.add=wl.prototype.push=KC;wl.prototype.has=VC;function XC(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 QC(t,e){return t.has(e)}var ZC=1,JC=2;function Db(t,e,n,r,s,a){var i=n&ZC,o=t.length,u=e.length;if(o!=u&&!(i&&u>o))return!1;var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var g=-1,f=!0,m=n&JC?new wl:void 0;for(a.set(t,e),a.set(e,t);++g<o;){var b=t[g],_=e[g];if(r)var A=i?r(_,b,g,e,t,a):r(b,_,g,t,e,a);if(A!==void 0){if(A)continue;f=!1;break}if(m){if(!XC(e,function(E,C){if(!QC(m,C)&&(b===E||s(b,E,n,r,a)))return m.push(C)})){f=!1;break}}else if(!(b===_||s(b,_,n,r,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function e4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function t4(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var n4=1,r4=2,s4="[object Boolean]",a4="[object Date]",i4="[object Error]",o4="[object Map]",u4="[object Number]",l4="[object RegExp]",c4="[object Set]",d4="[object String]",f4="[object Symbol]",h4="[object ArrayBuffer]",p4="[object DataView]",Dp=Gs?Gs.prototype:void 0,$c=Dp?Dp.valueOf:void 0;function m4(t,e,n,r,s,a,i){switch(n){case p4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case h4:return!(t.byteLength!=e.byteLength||!a(new Sl(t),new Sl(e)));case s4:case a4:case u4:return lu(+t,+e);case i4:return t.name==e.name&&t.message==e.message;case l4:case d4:return t==e+"";case o4:var o=e4;case c4:var u=r&n4;if(o||(o=t4),t.size!=e.size&&!u)return!1;var d=i.get(t);if(d)return d==e;r|=r4,i.set(t,e);var h=Db(o(t),o(e),r,s,a,i);return i.delete(t),h;case f4:if($c)return $c.call(t)==$c.call(e)}return!1}var g4=1,b4=Object.prototype,v4=b4.hasOwnProperty;function E4(t,e,n,r,s,a){var i=n&g4,o=df(t),u=o.length,d=df(e),h=d.length;if(u!=h&&!i)return!1;for(var g=u;g--;){var f=o[g];if(!(i?f in e:v4.call(e,f)))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 A=i;++g<u;){f=o[g];var E=t[f],C=e[f];if(r)var I=i?r(C,E,f,e,t,a):r(E,C,f,t,e,a);if(!(I===void 0?E===C||s(E,C,n,r,a):I)){_=!1;break}A||(A=f=="constructor")}if(_&&!A){var H=t.constructor,B=e.constructor;H!=B&&"constructor"in t&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof B=="function"&&B instanceof B)&&(_=!1)}return a.delete(t),a.delete(e),_}var T4=1,kp="[object Arguments]",Pp="[object Array]",Pu="[object Object]",_4=Object.prototype,Mp=_4.hasOwnProperty;function A4(t,e,n,r,s,a){var i=Da(t),o=Da(e),u=i?Pp:yr(t),d=o?Pp:yr(e);u=u==kp?Pu:u,d=d==kp?Pu:d;var h=u==Pu,g=d==Pu,f=u==d;if(f&&Uo(t)){if(!Uo(e))return!1;i=!0,h=!1}if(f&&!h)return a||(a=new Qr),i||Ph(t)?Db(t,e,n,r,s,a):m4(t,e,u,n,r,s,a);if(!(n&T4)){var m=h&&Mp.call(t,"__wrapped__"),b=g&&Mp.call(e,"__wrapped__");if(m||b){var _=m?t.value():t,A=b?e.value():e;return a||(a=new Qr),s(_,A,n,r,a)}}return f?(a||(a=new Qr),E4(t,e,n,r,s,a)):!1}function kb(t,e,n,r,s){return t===e?!0:t==null||e==null||!Ts(t)&&!Ts(e)?t!==t&&e!==e:A4(t,e,n,r,kb,s)}function y4(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),o=i.length;o--;){var u=i[++s];if(n(a[u],u,a)===!1)break}return e}}var N4=y4();function mf(t,e,n){(n!==void 0&&!lu(t[e],n)||n===void 0&&!(e in t))&&Rh(t,e,n)}function S4(t){return Ts(t)&&Vl(t)}function gf(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function w4(t){return VS(t,yb(t))}function I4(t,e,n,r,s,a,i){var o=gf(t,n),u=gf(e,n),d=i.get(u);if(d){mf(t,n,d);return}var h=a?a(o,u,n+"",t,e,i):void 0,g=h===void 0;if(g){var f=Da(u),m=!f&&Uo(u),b=!f&&!m&&Ph(u);h=u,f||m||b?Da(o)?h=o:S4(o)?h=MS(o):m?(g=!1,h=Ib(u,!0)):b?(g=!1,h=Cb(u,!0)):h=[]:AI(u)||cf(u)?(h=o,cf(o)?h=w4(o):(!Qs(o)||xh(o))&&(h=Lb(u))):g=!1}g&&(i.set(u,h),s(h,u,r,a,i),i.delete(u)),mf(t,n,h)}function Pb(t,e,n,r,s){t!==e&&N4(e,function(a,i){if(s||(s=new Qr),Qs(a))I4(t,e,i,n,Pb,r,s);else{var o=r?r(gf(t,i),a,i+"",t,e,s):void 0;o===void 0&&(o=a),mf(t,i,o)}},yb)}function Bh(t,e){return kb(t,e)}var zs=ew(function(t,e,n){Pb(t,e,n)}),Re=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(Re||{});class ns{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Re.TYPE&Re.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Re.LEVEL|s:Re.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class mi extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Mb=class bf{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 mi(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),o=new a(e,i,r);return bf.blots.set(o.domNode,o),o}find(e,n=!1){return bf.find(e,n)}query(e,n=Re.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Re.LEVEL&Re.BLOCK?r=this.types.block:e&Re.LEVEL&Re.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&Re.LEVEL&r.scope&&n&Re.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,s="attrName"in n;if(!r&&!s)throw new mi("Invalid definition");if(r&&n.blotName==="abstract")throw new mi("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})}};Mb.blots=new WeakMap;let Mi=Mb;function Bp(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class C4 extends ns{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){Bp(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(Bp(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Mr=C4;function Yc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class L4 extends ns{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[Yc(this.keyName)]=n,!0):!1}remove(e){e.style[Yc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[Yc(this.keyName)];return this.canAdd(e,n)?n:""}}const Zs=L4;class O4{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=Mi.find(this.domNode);if(e==null)return;const n=ns.keys(this.domNode),r=Mr.keys(this.domNode),s=Zs.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Re.ATTRIBUTE);i instanceof ns&&(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 Zl=O4,Bb=class{constructor(e,n){this.scroll=e,this.domNode=n,Mi.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new mi("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),Mi.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,s){const a=this.isolate(e,n);if(this.scroll.query(r,Re.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Re.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);a.wrap(i),i.format(r,s)}}insertAt(e,n,r){const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new mi(`Cannot wrap ${e}`);return r.appendChild(this),r}};Bb.blotName="abstract";let Fb=Bb;const Ub=class extends Fb{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}}};Ub.scope=Re.INLINE_BLOT;let x4=Ub;const Tn=x4;class R4{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),s=0;for(;r;){if(r===e)return s;s+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||n&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[s,a]=this.find(e);let i=e-a;const o=this.iterator(s);let u=o();for(;u&&i<e+n;){const d=u.length();e>i?r(u,e-i,Math.min(n,i+d-e)):r(u,0,Math.min(d,e+n-i)),i+=d,u=o()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let s=r();for(;s;)n=e(n,s),s=r();return n}}function Fp(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Re.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const Hb=class Ls extends Fb{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,Ls.uiClass&&this.uiNode.classList.add(Ls.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new R4,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=Fp(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof mi)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 Ls?r.descendant(e,s):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(n,r,(i,o,u)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Ls&&(s=s.concat(i.descendants(e,o,a))),a-=u}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===Re.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Ls?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,o)=>{a.formatAt(i,o,r,s)})}insertAt(e,n,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,n,r);else{const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(i)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,s]=this.children.find(e,n),a=[[this,e]];return r instanceof Ls?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 Ls&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,i)=>{const o=s.split(a,n);o!=null&&r.appendChild(o)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const i=this.scroll.find(a);i!=null&&(i.domNode.parentNode==null||i.domNode.parentNode===this.domNode)&&i.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,i)=>a===i?0:a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let i=null;a.nextSibling!=null&&(i=this.scroll.find(a.nextSibling));const o=Fp(a,this.scroll);(o.next!==i||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,i||void 0))}),this.enforceAllowedChildren()}};Hb.uiClass="";let D4=Hb;const Lr=D4;function k4(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 ti=class ni extends Lr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(ni.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 Zl(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof ni||(r=r.wrap(ni.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Re.INLINE);if(r==null)return;r instanceof ns?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.formats()[r]!=null||this.scroll.query(r,Re.ATTRIBUTE)?this.isolate(e,n).format(r,s):super.formatAt(e,n,r,s)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof ni&&r.prev===this&&k4(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 ni&&this.attributes.move(r),r}};ti.allowedChildren=[ti,Tn],ti.blotName="inline",ti.scope=Re.INLINE_BLOT,ti.tagName="SPAN";let P4=ti;const Fh=P4,ri=class vf extends Lr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(vf.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 Zl(this.domNode)}format(e,n){const r=this.scroll.query(e,Re.BLOCK);r!=null&&(r instanceof ns?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(vf.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.scroll.query(r,Re.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Re.INLINE)!=null)super.insertAt(e,n,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(n,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};ri.blotName="block",ri.scope=Re.BLOCK_BLOT,ri.tagName="P",ri.allowedChildren=[Fh,ri,Tn];let M4=ri;const jo=M4,Ef=class extends Lr{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())}};Ef.blotName="container",Ef.scope=Re.BLOCK_BLOT;let B4=Ef;const Jl=B4;class F4 extends Tn{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 Vn=F4,U4={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},H4=100,si=class extends Lr{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,U4),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=Re.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,s){this.update(),super.formatAt(e,n,r,s)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(u,d=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(r.has(u.domNode)||r.set(u.domNode,[]),d&&a(u.parent))},i=u=>{r.has(u.domNode)&&(u instanceof Lr&&u.children.forEach(i),r.delete(u.domNode),u.optimize(n))};let o=e;for(let u=0;o.length>0;u+=1){if(u>=H4)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const h=this.find(d.target,!0);h!=null&&(h.domNode===d.target&&(d.type==="childList"?(a(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(g=>{const f=this.find(g,!1);a(f,!1),f instanceof Lr&&f.children.forEach(m=>{a(m,!1)})})):d.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};si.blotName="scroll",si.defaultChild=jo,si.allowedChildren=[jo,Jl],si.scope=Re.BLOCK_BLOT,si.tagName="DIV";let q4=si;const Uh=q4,Tf=class qb extends Tn{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 qb&&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}};Tf.blotName="text",Tf.scope=Re.INLINE_BLOT;let j4=Tf;const Il=j4,$4=Object.freeze(Object.defineProperty({__proto__:null,Attributor:ns,AttributorStore:Zl,BlockBlot:jo,ClassAttributor:Mr,ContainerBlot:Jl,EmbedBlot:Vn,InlineBlot:Fh,LeafBlot:Tn,ParentBlot:Lr,Registry:Mi,Scope:Re,ScrollBlot:Uh,StyleAttributor:Zs,TextBlot:Il},Symbol.toStringTag,{value:"Module"}));var Fs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mu={exports:{}},zc,Up;function Y4(){if(Up)return zc;Up=1;var t=-1,e=1,n=0;function r(T,D,v,R,k){if(T===D)return T?[[n,T]]:[];if(v!=null){var O=X(T,D,v);if(O)return O}var W=o(T,D),j=T.substring(0,W);T=T.substring(W),D=D.substring(W),W=d(T,D);var M=T.substring(T.length-W);T=T.substring(0,T.length-W),D=D.substring(0,D.length-W);var $=s(T,D);return j&&$.unshift([n,j]),M&&$.push([n,M]),C($,k),R&&g($),$}function s(T,D){var v;if(!T)return[[e,D]];if(!D)return[[t,T]];var R=T.length>D.length?T:D,k=T.length>D.length?D:T,O=R.indexOf(k);if(O!==-1)return v=[[e,R.substring(0,O)],[n,k],[e,R.substring(O+k.length)]],T.length>D.length&&(v[0][0]=v[2][0]=t),v;if(k.length===1)return[[t,T],[e,D]];var W=h(T,D);if(W){var j=W[0],M=W[1],$=W[2],G=W[3],ee=W[4],le=r(j,$),be=r(M,G);return le.concat([[n,ee]],be)}return a(T,D)}function a(T,D){for(var v=T.length,R=D.length,k=Math.ceil((v+R)/2),O=k,W=2*k,j=new Array(W),M=new Array(W),$=0;$<W;$++)j[$]=-1,M[$]=-1;j[O+1]=0,M[O+1]=0;for(var G=v-R,ee=G%2!==0,le=0,be=0,pe=0,Ne=0,ce=0;ce<k;ce++){for(var he=-ce+le;he<=ce-be;he+=2){var Se=O+he,ye;he===-ce||he!==ce&&j[Se-1]<j[Se+1]?ye=j[Se+1]:ye=j[Se-1]+1;for(var Ie=ye-he;ye<v&&Ie<R&&T.charAt(ye)===D.charAt(Ie);)ye++,Ie++;if(j[Se]=ye,ye>v)be+=2;else if(Ie>R)le+=2;else if(ee){var xe=O+G-he;if(xe>=0&&xe<W&&M[xe]!==-1){var De=v-M[xe];if(ye>=De)return i(T,D,ye,Ie)}}}for(var ze=-ce+pe;ze<=ce-Ne;ze+=2){var xe=O+ze,De;ze===-ce||ze!==ce&&M[xe-1]<M[xe+1]?De=M[xe+1]:De=M[xe-1]+1;for(var et=De-ze;De<v&&et<R&&T.charAt(v-De-1)===D.charAt(R-et-1);)De++,et++;if(M[xe]=De,De>v)Ne+=2;else if(et>R)pe+=2;else if(!ee){var Se=O+G-ze;if(Se>=0&&Se<W&&j[Se]!==-1){var ye=j[Se],Ie=O+ye-Se;if(De=v-De,ye>=De)return i(T,D,ye,Ie)}}}}return[[t,T],[e,D]]}function i(T,D,v,R){var k=T.substring(0,v),O=D.substring(0,R),W=T.substring(v),j=D.substring(R),M=r(k,O),$=r(W,j);return M.concat($)}function o(T,D){if(!T||!D||T.charAt(0)!==D.charAt(0))return 0;for(var v=0,R=Math.min(T.length,D.length),k=R,O=0;v<k;)T.substring(O,k)==D.substring(O,k)?(v=k,O=v):R=k,k=Math.floor((R-v)/2+v);return I(T.charCodeAt(k-1))&&k--,k}function u(T,D){var v=T.length,R=D.length;if(v==0||R==0)return 0;v>R?T=T.substring(v-R):v<R&&(D=D.substring(0,v));var k=Math.min(v,R);if(T==D)return k;for(var O=0,W=1;;){var j=T.substring(k-W),M=D.indexOf(j);if(M==-1)return O;W+=M,(M==0||T.substring(k-W)==D.substring(0,W))&&(O=W,W++)}}function d(T,D){if(!T||!D||T.slice(-1)!==D.slice(-1))return 0;for(var v=0,R=Math.min(T.length,D.length),k=R,O=0;v<k;)T.substring(T.length-k,T.length-O)==D.substring(D.length-k,D.length-O)?(v=k,O=v):R=k,k=Math.floor((R-v)/2+v);return H(T.charCodeAt(T.length-k))&&k--,k}function h(T,D){var v=T.length>D.length?T:D,R=T.length>D.length?D:T;if(v.length<4||R.length*2<v.length)return null;function k(be,pe,Ne){for(var ce=be.substring(Ne,Ne+Math.floor(be.length/4)),he=-1,Se="",ye,Ie,xe,De;(he=pe.indexOf(ce,he+1))!==-1;){var ze=o(be.substring(Ne),pe.substring(he)),et=d(be.substring(0,Ne),pe.substring(0,he));Se.length<et+ze&&(Se=pe.substring(he-et,he)+pe.substring(he,he+ze),ye=be.substring(0,Ne-et),Ie=be.substring(Ne+ze),xe=pe.substring(0,he-et),De=pe.substring(he+ze))}return Se.length*2>=be.length?[ye,Ie,xe,De,Se]:null}var O=k(v,R,Math.ceil(v.length/4)),W=k(v,R,Math.ceil(v.length/2)),j;if(!O&&!W)return null;W?O?j=O[4].length>W[4].length?O:W:j=W:j=O;var M,$,G,ee;T.length>D.length?(M=j[0],$=j[1],G=j[2],ee=j[3]):(G=j[0],ee=j[1],M=j[2],$=j[3]);var le=j[4];return[M,$,G,ee,le]}function g(T){for(var D=!1,v=[],R=0,k=null,O=0,W=0,j=0,M=0,$=0;O<T.length;)T[O][0]==n?(v[R++]=O,W=M,j=$,M=0,$=0,k=T[O][1]):(T[O][0]==e?M+=T[O][1].length:$+=T[O][1].length,k&&k.length<=Math.max(W,j)&&k.length<=Math.max(M,$)&&(T.splice(v[R-1],0,[t,k]),T[v[R-1]+1][0]=e,R--,R--,O=R>0?v[R-1]:-1,W=0,j=0,M=0,$=0,k=null,D=!0)),O++;for(D&&C(T),E(T),O=1;O<T.length;){if(T[O-1][0]==t&&T[O][0]==e){var G=T[O-1][1],ee=T[O][1],le=u(G,ee),be=u(ee,G);le>=be?(le>=G.length/2||le>=ee.length/2)&&(T.splice(O,0,[n,ee.substring(0,le)]),T[O-1][1]=G.substring(0,G.length-le),T[O+1][1]=ee.substring(le),O++):(be>=G.length/2||be>=ee.length/2)&&(T.splice(O,0,[n,G.substring(0,be)]),T[O-1][0]=e,T[O-1][1]=ee.substring(0,ee.length-be),T[O+1][0]=t,T[O+1][1]=G.substring(be),O++),O++}O++}}var f=/[^a-zA-Z0-9]/,m=/\s/,b=/[\r\n]/,_=/\n\r?\n$/,A=/^\r?\n\r?\n/;function E(T){function D(be,pe){if(!be||!pe)return 6;var Ne=be.charAt(be.length-1),ce=pe.charAt(0),he=Ne.match(f),Se=ce.match(f),ye=he&&Ne.match(m),Ie=Se&&ce.match(m),xe=ye&&Ne.match(b),De=Ie&&ce.match(b),ze=xe&&be.match(_),et=De&&pe.match(A);return ze||et?5:xe||De?4:he&&!ye&&Ie?3:ye||Ie?2:he||Se?1:0}for(var v=1;v<T.length-1;){if(T[v-1][0]==n&&T[v+1][0]==n){var R=T[v-1][1],k=T[v][1],O=T[v+1][1],W=d(R,k);if(W){var j=k.substring(k.length-W);R=R.substring(0,R.length-W),k=j+k.substring(0,k.length-W),O=j+O}for(var M=R,$=k,G=O,ee=D(R,k)+D(k,O);k.charAt(0)===O.charAt(0);){R+=k.charAt(0),k=k.substring(1)+O.charAt(0),O=O.substring(1);var le=D(R,k)+D(k,O);le>=ee&&(ee=le,M=R,$=k,G=O)}T[v-1][1]!=M&&(M?T[v-1][1]=M:(T.splice(v-1,1),v--),T[v][1]=$,G?T[v+1][1]=G:(T.splice(v+1,1),v--))}v++}}function C(T,D){T.push([n,""]);for(var v=0,R=0,k=0,O="",W="",j;v<T.length;){if(v<T.length-1&&!T[v][1]){T.splice(v,1);continue}switch(T[v][0]){case e:k++,W+=T[v][1],v++;break;case t:R++,O+=T[v][1],v++;break;case n:var M=v-k-R-1;if(D){if(M>=0&&J(T[M][1])){var $=T[M][1].slice(-1);if(T[M][1]=T[M][1].slice(0,-1),O=$+O,W=$+W,!T[M][1]){T.splice(M,1),v--;var G=M-1;T[G]&&T[G][0]===e&&(k++,W=T[G][1]+W,G--),T[G]&&T[G][0]===t&&(R++,O=T[G][1]+O,G--),M=G}}if(B(T[v][1])){var $=T[v][1].charAt(0);T[v][1]=T[v][1].slice(1),O+=$,W+=$}}if(v<T.length-1&&!T[v][1]){T.splice(v,1);break}if(O.length>0||W.length>0){O.length>0&&W.length>0&&(j=o(W,O),j!==0&&(M>=0?T[M][1]+=W.substring(0,j):(T.splice(0,0,[n,W.substring(0,j)]),v++),W=W.substring(j),O=O.substring(j)),j=d(W,O),j!==0&&(T[v][1]=W.substring(W.length-j)+T[v][1],W=W.substring(0,W.length-j),O=O.substring(0,O.length-j)));var ee=k+R;O.length===0&&W.length===0?(T.splice(v-ee,ee),v=v-ee):O.length===0?(T.splice(v-ee,ee,[e,W]),v=v-ee+1):W.length===0?(T.splice(v-ee,ee,[t,O]),v=v-ee+1):(T.splice(v-ee,ee,[t,O],[e,W]),v=v-ee+2)}v!==0&&T[v-1][0]===n?(T[v-1][1]+=T[v][1],T.splice(v,1)):v++,k=0,R=0,O="",W="";break}}T[T.length-1][1]===""&&T.pop();var le=!1;for(v=1;v<T.length-1;)T[v-1][0]===n&&T[v+1][0]===n&&(T[v][1].substring(T[v][1].length-T[v-1][1].length)===T[v-1][1]?(T[v][1]=T[v-1][1]+T[v][1].substring(0,T[v][1].length-T[v-1][1].length),T[v+1][1]=T[v-1][1]+T[v+1][1],T.splice(v-1,1),le=!0):T[v][1].substring(0,T[v+1][1].length)==T[v+1][1]&&(T[v-1][1]+=T[v+1][1],T[v][1]=T[v][1].substring(T[v+1][1].length)+T[v+1][1],T.splice(v+1,1),le=!0)),v++;le&&C(T,D)}function I(T){return T>=55296&&T<=56319}function H(T){return T>=56320&&T<=57343}function B(T){return H(T.charCodeAt(0))}function J(T){return I(T.charCodeAt(T.length-1))}function F(T){for(var D=[],v=0;v<T.length;v++)T[v][1].length>0&&D.push(T[v]);return D}function Y(T,D,v,R){return J(T)||B(R)?null:F([[n,T],[t,D],[e,v],[n,R]])}function X(T,D,v){var R=typeof v=="number"?{index:v,length:0}:v.oldRange,k=typeof v=="number"?null:v.newRange,O=T.length,W=D.length;if(R.length===0&&(k===null||k.length===0)){var j=R.index,M=T.slice(0,j),$=T.slice(j),G=k?k.index:null;e:{var ee=j+W-O;if(G!==null&&G!==ee||ee<0||ee>W)break e;var le=D.slice(0,ee),be=D.slice(ee);if(be!==$)break e;var pe=Math.min(j,ee),Ne=M.slice(0,pe),ce=le.slice(0,pe);if(Ne!==ce)break e;var he=M.slice(pe),Se=le.slice(pe);return Y(Ne,he,Se,$)}e:{if(G!==null&&G!==j)break e;var ye=j,le=D.slice(0,ye),be=D.slice(ye);if(le!==M)break e;var Ie=Math.min(O-ye,W-ye),xe=$.slice($.length-Ie),De=be.slice(be.length-Ie);if(xe!==De)break e;var he=$.slice(0,$.length-Ie),Se=be.slice(0,be.length-Ie);return Y(M,he,Se,xe)}}if(R.length>0&&k&&k.length===0)e:{var Ne=T.slice(0,R.index),xe=T.slice(R.index+R.length),pe=Ne.length,Ie=xe.length;if(W<pe+Ie)break e;var ce=D.slice(0,pe),De=D.slice(W-Ie);if(Ne!==ce||xe!==De)break e;var he=T.slice(pe,O-Ie),Se=D.slice(pe,W-Ie);return Y(Ne,he,Se,xe)}return null}function te(T,D,v,R){return r(T,D,v,R,!0)}return te.INSERT=e,te.DELETE=t,te.EQUAL=n,zc=te,zc}var co={exports:{}};co.exports;var Hp;function $b(){return Hp||(Hp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",o="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",b="[object Object]",_="[object Promise]",A="[object RegExp]",E="[object Set]",C="[object String]",I="[object Symbol]",H="[object WeakMap]",B="[object ArrayBuffer]",J="[object DataView]",F="[object Float32Array]",Y="[object Float64Array]",X="[object Int8Array]",te="[object Int16Array]",T="[object Int32Array]",D="[object Uint8Array]",v="[object Uint8ClampedArray]",R="[object Uint16Array]",k="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,j=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,$={};$[a]=$[i]=$[B]=$[J]=$[o]=$[u]=$[F]=$[Y]=$[X]=$[te]=$[T]=$[f]=$[m]=$[b]=$[A]=$[E]=$[C]=$[I]=$[D]=$[v]=$[R]=$[k]=!0,$[d]=$[h]=$[H]=!1;var G=typeof Fs=="object"&&Fs&&Fs.Object===Object&&Fs,ee=typeof self=="object"&&self&&self.Object===Object&&self,le=G||ee||Function("return this")(),be=e&&!e.nodeType&&e,pe=be&&!0&&t&&!t.nodeType&&t,Ne=pe&&pe.exports===be;function ce(p,N){return p.set(N[0],N[1]),p}function he(p,N){return p.add(N),p}function Se(p,N){for(var U=-1,re=p?p.length:0;++U<re&&N(p[U],U,p)!==!1;);return p}function ye(p,N){for(var U=-1,re=N.length,Ye=p.length;++U<re;)p[Ye+U]=N[U];return p}function Ie(p,N,U,re){for(var Ye=-1,ke=p?p.length:0;++Ye<ke;)U=N(U,p[Ye],Ye,p);return U}function xe(p,N){for(var U=-1,re=Array(p);++U<p;)re[U]=N(U);return re}function De(p,N){return p==null?void 0:p[N]}function ze(p){var N=!1;if(p!=null&&typeof p.toString!="function")try{N=!!(p+"")}catch{}return N}function et(p){var N=-1,U=Array(p.size);return p.forEach(function(re,Ye){U[++N]=[Ye,re]}),U}function Vt(p,N){return function(U){return p(N(U))}}function Qe(p){var N=-1,U=Array(p.size);return p.forEach(function(re){U[++N]=re}),U}var Xt=Array.prototype,nn=Function.prototype,qt=Object.prototype,yn=le["__core-js_shared__"],rn=(function(){var p=/[^.]+$/.exec(yn&&yn.keys&&yn.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),Bt=nn.toString,jt=qt.hasOwnProperty,Rn=qt.toString,qn=RegExp("^"+Bt.call(jt).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tt=Ne?le.Buffer:void 0,kt=le.Symbol,Qt=le.Uint8Array,_t=Vt(Object.getPrototypeOf,Object),un=Object.create,$t=qt.propertyIsEnumerable,Xn=Xt.splice,pr=Object.getOwnPropertySymbols,Nn=Tt?Tt.isBuffer:void 0,Ur=Vt(Object.keys,Object),K=gr(le,"DataView"),ge=gr(le,"Map"),we=gr(le,"Promise"),We=gr(le,"Set"),ht=gr(le,"WeakMap"),Ke=gr(Object,"create"),xt=wn(K),Ee=wn(ge),Ue=wn(we),$e=wn(We),Ve=wn(ht),fe=kt?kt.prototype:void 0,Zt=fe?fe.valueOf:void 0;function At(p){var N=-1,U=p?p.length:0;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Rt(){this.__data__=Ke?Ke(null):{}}function mn(p){return this.has(p)&&delete this.__data__[p]}function Qn(p){var N=this.__data__;if(Ke){var U=N[p];return U===r?void 0:U}return jt.call(N,p)?N[p]:void 0}function mr(p){var N=this.__data__;return Ke?N[p]!==void 0:jt.call(N,p)}function jn(p,N){var U=this.__data__;return U[p]=Ke&&N===void 0?r:N,this}At.prototype.clear=Rt,At.prototype.delete=mn,At.prototype.get=Qn,At.prototype.has=mr,At.prototype.set=jn;function Ct(p){var N=-1,U=p?p.length:0;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Js(){this.__data__=[]}function ea(p){var N=this.__data__,U=gt(N,p);if(U<0)return!1;var re=N.length-1;return U==re?N.pop():Xn.call(N,U,1),!0}function ta(p){var N=this.__data__,U=gt(N,p);return U<0?void 0:N[U][1]}function na(p){return gt(this.__data__,p)>-1}function ra(p,N){var U=this.__data__,re=gt(U,p);return re<0?U.push([p,N]):U[re][1]=N,this}Ct.prototype.clear=Js,Ct.prototype.delete=ea,Ct.prototype.get=ta,Ct.prototype.has=na,Ct.prototype.set=ra;function He(p){var N=-1,U=p?p.length:0;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Lt(){this.__data__={hash:new At,map:new(ge||Ct),string:new At}}function Yt(p){return ia(this,p).delete(p)}function Sn(p){return ia(this,p).get(p)}function gn(p){return ia(this,p).has(p)}function Ft(p,N){return ia(this,p).set(p,N),this}He.prototype.clear=Lt,He.prototype.delete=Yt,He.prototype.get=Sn,He.prototype.has=gn,He.prototype.set=Ft;function pt(p){this.__data__=new Ct(p)}function zt(){this.__data__=new Ct}function Ut(p){return this.__data__.delete(p)}function Dn(p){return this.__data__.get(p)}function yt(p){return this.__data__.has(p)}function Le(p,N){var U=this.__data__;if(U instanceof Ct){var re=U.__data__;if(!ge||re.length<n-1)return re.push([p,N]),this;U=this.__data__=new He(re)}return U.set(p,N),this}pt.prototype.clear=zt,pt.prototype.delete=Ut,pt.prototype.get=Dn,pt.prototype.has=yt,pt.prototype.set=Le;function Te(p,N){var U=Ki(p)||Va(p)?xe(p.length,String):[],re=U.length,Ye=!!re;for(var ke in p)jt.call(p,ke)&&!(Ye&&(ke=="length"||mc(ke,re)))&&U.push(ke);return U}function Me(p,N,U){var re=p[N];(!(jt.call(p,N)&&vu(re,U))||U===void 0&&!(N in p))&&(p[N]=U)}function gt(p,N){for(var U=p.length;U--;)if(vu(p[U][0],N))return U;return-1}function Wt(p,N){return p&&Gi(N,Xi(N),p)}function sa(p,N,U,re,Ye,ke,ot){var at;if(re&&(at=ke?re(p,Ye,ke,ot):re(p)),at!==void 0)return at;if(!qr(p))return p;var Gt=Ki(p);if(Gt){if(at=hc(p),!N)return cc(p,at)}else{var mt=is(p),bn=mt==h||mt==g;if(Eu(p))return Ka(p,N);if(mt==b||mt==a||bn&&!ke){if(ze(p))return ke?p:{};if(at=Hr(bn?{}:p),!N)return dc(p,Wt(at,p))}else{if(!$[mt])return ke?p:{};at=pc(p,mt,sa,N)}}ot||(ot=new pt);var kn=ot.get(p);if(kn)return kn;if(ot.set(p,at),!Gt)var Jt=U?fc(p):Xi(p);return Se(Jt||p,function(vn,ln){Jt&&(ln=vn,vn=p[ln]),Me(at,ln,sa(vn,N,U,re,ln,p,ot))}),at}function zi(p){return qr(p)?un(p):{}}function rc(p,N,U){var re=N(p);return Ki(p)?re:ye(re,U(p))}function sc(p){return Rn.call(p)}function ac(p){if(!qr(p)||bc(p))return!1;var N=Vi(p)||ze(p)?qn:j;return N.test(wn(p))}function ic(p){if(!gu(p))return Ur(p);var N=[];for(var U in Object(p))jt.call(p,U)&&U!="constructor"&&N.push(U);return N}function Ka(p,N){if(N)return p.slice();var U=new p.constructor(p.length);return p.copy(U),U}function Wi(p){var N=new p.constructor(p.byteLength);return new Qt(N).set(new Qt(p)),N}function aa(p,N){var U=N?Wi(p.buffer):p.buffer;return new p.constructor(U,p.byteOffset,p.byteLength)}function pu(p,N,U){var re=N?U(et(p),!0):et(p);return Ie(re,ce,new p.constructor)}function mu(p){var N=new p.constructor(p.source,W.exec(p));return N.lastIndex=p.lastIndex,N}function oc(p,N,U){var re=N?U(Qe(p),!0):Qe(p);return Ie(re,he,new p.constructor)}function uc(p){return Zt?Object(Zt.call(p)):{}}function lc(p,N){var U=N?Wi(p.buffer):p.buffer;return new p.constructor(U,p.byteOffset,p.length)}function cc(p,N){var U=-1,re=p.length;for(N||(N=Array(re));++U<re;)N[U]=p[U];return N}function Gi(p,N,U,re){U||(U={});for(var Ye=-1,ke=N.length;++Ye<ke;){var ot=N[Ye],at=void 0;Me(U,ot,at===void 0?p[ot]:at)}return U}function dc(p,N){return Gi(p,as(p),N)}function fc(p){return rc(p,Xi,as)}function ia(p,N){var U=p.__data__;return gc(N)?U[typeof N=="string"?"string":"hash"]:U.map}function gr(p,N){var U=De(p,N);return ac(U)?U:void 0}var as=pr?Vt(pr,Object):Ec,is=sc;(K&&is(new K(new ArrayBuffer(1)))!=J||ge&&is(new ge)!=f||we&&is(we.resolve())!=_||We&&is(new We)!=E||ht&&is(new ht)!=H)&&(is=function(p){var N=Rn.call(p),U=N==b?p.constructor:void 0,re=U?wn(U):void 0;if(re)switch(re){case xt:return J;case Ee:return f;case Ue:return _;case $e:return E;case Ve:return H}return N});function hc(p){var N=p.length,U=p.constructor(N);return N&&typeof p[0]=="string"&&jt.call(p,"index")&&(U.index=p.index,U.input=p.input),U}function Hr(p){return typeof p.constructor=="function"&&!gu(p)?zi(_t(p)):{}}function pc(p,N,U,re){var Ye=p.constructor;switch(N){case B:return Wi(p);case o:case u:return new Ye(+p);case J:return aa(p,re);case F:case Y:case X:case te:case T:case D:case v:case R:case k:return lc(p,re);case f:return pu(p,re,U);case m:case C:return new Ye(p);case A:return mu(p);case E:return oc(p,re,U);case I:return uc(p)}}function mc(p,N){return N=N??s,!!N&&(typeof p=="number"||M.test(p))&&p>-1&&p%1==0&&p<N}function gc(p){var N=typeof p;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?p!=="__proto__":p===null}function bc(p){return!!rn&&rn in p}function gu(p){var N=p&&p.constructor,U=typeof N=="function"&&N.prototype||qt;return p===U}function wn(p){if(p!=null){try{return Bt.call(p)}catch{}try{return p+""}catch{}}return""}function bu(p){return sa(p,!0,!0)}function vu(p,N){return p===N||p!==p&&N!==N}function Va(p){return vc(p)&&jt.call(p,"callee")&&(!$t.call(p,"callee")||Rn.call(p)==a)}var Ki=Array.isArray;function Xa(p){return p!=null&&Tu(p.length)&&!Vi(p)}function vc(p){return _u(p)&&Xa(p)}var Eu=Nn||Tc;function Vi(p){var N=qr(p)?Rn.call(p):"";return N==h||N==g}function Tu(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=s}function qr(p){var N=typeof p;return!!p&&(N=="object"||N=="function")}function _u(p){return!!p&&typeof p=="object"}function Xi(p){return Xa(p)?Te(p):ic(p)}function Ec(){return[]}function Tc(){return!1}t.exports=bu})(co,co.exports)),co.exports}var fo={exports:{}};fo.exports;var qp;function Yb(){return qp||(qp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,o="[object Arguments]",u="[object Array]",d="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",f="[object Error]",m="[object Function]",b="[object GeneratorFunction]",_="[object Map]",A="[object Number]",E="[object Null]",C="[object Object]",I="[object Promise]",H="[object Proxy]",B="[object RegExp]",J="[object Set]",F="[object String]",Y="[object Symbol]",X="[object Undefined]",te="[object WeakMap]",T="[object ArrayBuffer]",D="[object DataView]",v="[object Float32Array]",R="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",W="[object Int32Array]",j="[object Uint8Array]",M="[object Uint8ClampedArray]",$="[object Uint16Array]",G="[object Uint32Array]",ee=/[\\^$.*+?()[\]{}|]/g,le=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,pe={};pe[v]=pe[R]=pe[k]=pe[O]=pe[W]=pe[j]=pe[M]=pe[$]=pe[G]=!0,pe[o]=pe[u]=pe[T]=pe[h]=pe[D]=pe[g]=pe[f]=pe[m]=pe[_]=pe[A]=pe[C]=pe[B]=pe[J]=pe[F]=pe[te]=!1;var Ne=typeof Fs=="object"&&Fs&&Fs.Object===Object&&Fs,ce=typeof self=="object"&&self&&self.Object===Object&&self,he=Ne||ce||Function("return this")(),Se=e&&!e.nodeType&&e,ye=Se&&!0&&t&&!t.nodeType&&t,Ie=ye&&ye.exports===Se,xe=Ie&&Ne.process,De=(function(){try{return xe&&xe.binding&&xe.binding("util")}catch{}})(),ze=De&&De.isTypedArray;function et(p,N){for(var U=-1,re=p==null?0:p.length,Ye=0,ke=[];++U<re;){var ot=p[U];N(ot,U,p)&&(ke[Ye++]=ot)}return ke}function Vt(p,N){for(var U=-1,re=N.length,Ye=p.length;++U<re;)p[Ye+U]=N[U];return p}function Qe(p,N){for(var U=-1,re=p==null?0:p.length;++U<re;)if(N(p[U],U,p))return!0;return!1}function Xt(p,N){for(var U=-1,re=Array(p);++U<p;)re[U]=N(U);return re}function nn(p){return function(N){return p(N)}}function qt(p,N){return p.has(N)}function yn(p,N){return p==null?void 0:p[N]}function rn(p){var N=-1,U=Array(p.size);return p.forEach(function(re,Ye){U[++N]=[Ye,re]}),U}function Bt(p,N){return function(U){return p(N(U))}}function jt(p){var N=-1,U=Array(p.size);return p.forEach(function(re){U[++N]=re}),U}var Rn=Array.prototype,qn=Function.prototype,Tt=Object.prototype,kt=he["__core-js_shared__"],Qt=qn.toString,_t=Tt.hasOwnProperty,un=(function(){var p=/[^.]+$/.exec(kt&&kt.keys&&kt.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),$t=Tt.toString,Xn=RegExp("^"+Qt.call(_t).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pr=Ie?he.Buffer:void 0,Nn=he.Symbol,Ur=he.Uint8Array,K=Tt.propertyIsEnumerable,ge=Rn.splice,we=Nn?Nn.toStringTag:void 0,We=Object.getOwnPropertySymbols,ht=pr?pr.isBuffer:void 0,Ke=Bt(Object.keys,Object),xt=as(he,"DataView"),Ee=as(he,"Map"),Ue=as(he,"Promise"),$e=as(he,"Set"),Ve=as(he,"WeakMap"),fe=as(Object,"create"),Zt=wn(xt),At=wn(Ee),Rt=wn(Ue),mn=wn($e),Qn=wn(Ve),mr=Nn?Nn.prototype:void 0,jn=mr?mr.valueOf:void 0;function Ct(p){var N=-1,U=p==null?0:p.length;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Js(){this.__data__=fe?fe(null):{},this.size=0}function ea(p){var N=this.has(p)&&delete this.__data__[p];return this.size-=N?1:0,N}function ta(p){var N=this.__data__;if(fe){var U=N[p];return U===r?void 0:U}return _t.call(N,p)?N[p]:void 0}function na(p){var N=this.__data__;return fe?N[p]!==void 0:_t.call(N,p)}function ra(p,N){var U=this.__data__;return this.size+=this.has(p)?0:1,U[p]=fe&&N===void 0?r:N,this}Ct.prototype.clear=Js,Ct.prototype.delete=ea,Ct.prototype.get=ta,Ct.prototype.has=na,Ct.prototype.set=ra;function He(p){var N=-1,U=p==null?0:p.length;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function Lt(){this.__data__=[],this.size=0}function Yt(p){var N=this.__data__,U=Ka(N,p);if(U<0)return!1;var re=N.length-1;return U==re?N.pop():ge.call(N,U,1),--this.size,!0}function Sn(p){var N=this.__data__,U=Ka(N,p);return U<0?void 0:N[U][1]}function gn(p){return Ka(this.__data__,p)>-1}function Ft(p,N){var U=this.__data__,re=Ka(U,p);return re<0?(++this.size,U.push([p,N])):U[re][1]=N,this}He.prototype.clear=Lt,He.prototype.delete=Yt,He.prototype.get=Sn,He.prototype.has=gn,He.prototype.set=Ft;function pt(p){var N=-1,U=p==null?0:p.length;for(this.clear();++N<U;){var re=p[N];this.set(re[0],re[1])}}function zt(){this.size=0,this.__data__={hash:new Ct,map:new(Ee||He),string:new Ct}}function Ut(p){var N=gr(this,p).delete(p);return this.size-=N?1:0,N}function Dn(p){return gr(this,p).get(p)}function yt(p){return gr(this,p).has(p)}function Le(p,N){var U=gr(this,p),re=U.size;return U.set(p,N),this.size+=U.size==re?0:1,this}pt.prototype.clear=zt,pt.prototype.delete=Ut,pt.prototype.get=Dn,pt.prototype.has=yt,pt.prototype.set=Le;function Te(p){var N=-1,U=p==null?0:p.length;for(this.__data__=new pt;++N<U;)this.add(p[N])}function Me(p){return this.__data__.set(p,r),this}function gt(p){return this.__data__.has(p)}Te.prototype.add=Te.prototype.push=Me,Te.prototype.has=gt;function Wt(p){var N=this.__data__=new He(p);this.size=N.size}function sa(){this.__data__=new He,this.size=0}function zi(p){var N=this.__data__,U=N.delete(p);return this.size=N.size,U}function rc(p){return this.__data__.get(p)}function sc(p){return this.__data__.has(p)}function ac(p,N){var U=this.__data__;if(U instanceof He){var re=U.__data__;if(!Ee||re.length<n-1)return re.push([p,N]),this.size=++U.size,this;U=this.__data__=new pt(re)}return U.set(p,N),this.size=U.size,this}Wt.prototype.clear=sa,Wt.prototype.delete=zi,Wt.prototype.get=rc,Wt.prototype.has=sc,Wt.prototype.set=ac;function ic(p,N){var U=Va(p),re=!U&&vu(p),Ye=!U&&!re&&Xa(p),ke=!U&&!re&&!Ye&&_u(p),ot=U||re||Ye||ke,at=ot?Xt(p.length,String):[],Gt=at.length;for(var mt in p)_t.call(p,mt)&&!(ot&&(mt=="length"||Ye&&(mt=="offset"||mt=="parent")||ke&&(mt=="buffer"||mt=="byteLength"||mt=="byteOffset")||pc(mt,Gt)))&&at.push(mt);return at}function Ka(p,N){for(var U=p.length;U--;)if(bu(p[U][0],N))return U;return-1}function Wi(p,N,U){var re=N(p);return Va(p)?re:Vt(re,U(p))}function aa(p){return p==null?p===void 0?X:E:we&&we in Object(p)?is(p):gu(p)}function pu(p){return qr(p)&&aa(p)==o}function mu(p,N,U,re,Ye){return p===N?!0:p==null||N==null||!qr(p)&&!qr(N)?p!==p&&N!==N:oc(p,N,U,re,mu,Ye)}function oc(p,N,U,re,Ye,ke){var ot=Va(p),at=Va(N),Gt=ot?u:Hr(p),mt=at?u:Hr(N);Gt=Gt==o?C:Gt,mt=mt==o?C:mt;var bn=Gt==C,kn=mt==C,Jt=Gt==mt;if(Jt&&Xa(p)){if(!Xa(N))return!1;ot=!0,bn=!1}if(Jt&&!bn)return ke||(ke=new Wt),ot||_u(p)?Gi(p,N,U,re,Ye,ke):dc(p,N,Gt,U,re,Ye,ke);if(!(U&s)){var vn=bn&&_t.call(p,"__wrapped__"),ln=kn&&_t.call(N,"__wrapped__");if(vn||ln){var Ss=vn?p.value():p,os=ln?N.value():N;return ke||(ke=new Wt),Ye(Ss,os,U,re,ke)}}return Jt?(ke||(ke=new Wt),fc(p,N,U,re,Ye,ke)):!1}function uc(p){if(!Tu(p)||gc(p))return!1;var N=Eu(p)?Xn:le;return N.test(wn(p))}function lc(p){return qr(p)&&Vi(p.length)&&!!pe[aa(p)]}function cc(p){if(!bc(p))return Ke(p);var N=[];for(var U in Object(p))_t.call(p,U)&&U!="constructor"&&N.push(U);return N}function Gi(p,N,U,re,Ye,ke){var ot=U&s,at=p.length,Gt=N.length;if(at!=Gt&&!(ot&&Gt>at))return!1;var mt=ke.get(p);if(mt&&ke.get(N))return mt==N;var bn=-1,kn=!0,Jt=U&a?new Te:void 0;for(ke.set(p,N),ke.set(N,p);++bn<at;){var vn=p[bn],ln=N[bn];if(re)var Ss=ot?re(ln,vn,bn,N,p,ke):re(vn,ln,bn,p,N,ke);if(Ss!==void 0){if(Ss)continue;kn=!1;break}if(Jt){if(!Qe(N,function(os,oa){if(!qt(Jt,oa)&&(vn===os||Ye(vn,os,U,re,ke)))return Jt.push(oa)})){kn=!1;break}}else if(!(vn===ln||Ye(vn,ln,U,re,ke))){kn=!1;break}}return ke.delete(p),ke.delete(N),kn}function dc(p,N,U,re,Ye,ke,ot){switch(U){case D:if(p.byteLength!=N.byteLength||p.byteOffset!=N.byteOffset)return!1;p=p.buffer,N=N.buffer;case T:return!(p.byteLength!=N.byteLength||!ke(new Ur(p),new Ur(N)));case h:case g:case A:return bu(+p,+N);case f:return p.name==N.name&&p.message==N.message;case B:case F:return p==N+"";case _:var at=rn;case J:var Gt=re&s;if(at||(at=jt),p.size!=N.size&&!Gt)return!1;var mt=ot.get(p);if(mt)return mt==N;re|=a,ot.set(p,N);var bn=Gi(at(p),at(N),re,Ye,ke,ot);return ot.delete(p),bn;case Y:if(jn)return jn.call(p)==jn.call(N)}return!1}function fc(p,N,U,re,Ye,ke){var ot=U&s,at=ia(p),Gt=at.length,mt=ia(N),bn=mt.length;if(Gt!=bn&&!ot)return!1;for(var kn=Gt;kn--;){var Jt=at[kn];if(!(ot?Jt in N:_t.call(N,Jt)))return!1}var vn=ke.get(p);if(vn&&ke.get(N))return vn==N;var ln=!0;ke.set(p,N),ke.set(N,p);for(var Ss=ot;++kn<Gt;){Jt=at[kn];var os=p[Jt],oa=N[Jt];if(re)var Qh=ot?re(oa,os,Jt,N,p,ke):re(os,oa,Jt,p,N,ke);if(!(Qh===void 0?os===oa||Ye(os,oa,U,re,ke):Qh)){ln=!1;break}Ss||(Ss=Jt=="constructor")}if(ln&&!Ss){var Au=p.constructor,yu=N.constructor;Au!=yu&&"constructor"in p&&"constructor"in N&&!(typeof Au=="function"&&Au instanceof Au&&typeof yu=="function"&&yu instanceof yu)&&(ln=!1)}return ke.delete(p),ke.delete(N),ln}function ia(p){return Wi(p,Xi,hc)}function gr(p,N){var U=p.__data__;return mc(N)?U[typeof N=="string"?"string":"hash"]:U.map}function as(p,N){var U=yn(p,N);return uc(U)?U:void 0}function is(p){var N=_t.call(p,we),U=p[we];try{p[we]=void 0;var re=!0}catch{}var Ye=$t.call(p);return re&&(N?p[we]=U:delete p[we]),Ye}var hc=We?function(p){return p==null?[]:(p=Object(p),et(We(p),function(N){return K.call(p,N)}))}:Ec,Hr=aa;(xt&&Hr(new xt(new ArrayBuffer(1)))!=D||Ee&&Hr(new Ee)!=_||Ue&&Hr(Ue.resolve())!=I||$e&&Hr(new $e)!=J||Ve&&Hr(new Ve)!=te)&&(Hr=function(p){var N=aa(p),U=N==C?p.constructor:void 0,re=U?wn(U):"";if(re)switch(re){case Zt:return D;case At:return _;case Rt:return I;case mn:return J;case Qn:return te}return N});function pc(p,N){return N=N??i,!!N&&(typeof p=="number"||be.test(p))&&p>-1&&p%1==0&&p<N}function mc(p){var N=typeof p;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?p!=="__proto__":p===null}function gc(p){return!!un&&un in p}function bc(p){var N=p&&p.constructor,U=typeof N=="function"&&N.prototype||Tt;return p===U}function gu(p){return $t.call(p)}function wn(p){if(p!=null){try{return Qt.call(p)}catch{}try{return p+""}catch{}}return""}function bu(p,N){return p===N||p!==p&&N!==N}var vu=pu((function(){return arguments})())?pu:function(p){return qr(p)&&_t.call(p,"callee")&&!K.call(p,"callee")},Va=Array.isArray;function Ki(p){return p!=null&&Vi(p.length)&&!Eu(p)}var Xa=ht||Tc;function vc(p,N){return mu(p,N)}function Eu(p){if(!Tu(p))return!1;var N=aa(p);return N==m||N==b||N==d||N==H}function Vi(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=i}function Tu(p){var N=typeof p;return p!=null&&(N=="object"||N=="function")}function qr(p){return p!=null&&typeof p=="object"}var _u=ze?nn(ze):lc;function Xi(p){return Ki(p)?ic(p):cc(p)}function Ec(){return[]}function Tc(){return!1}t.exports=vc})(fo,fo.exports)),fo.exports}var Bu={},jp;function z4(){if(jp)return Bu;jp=1,Object.defineProperty(Bu,"__esModule",{value:!0});const t=$b(),e=Yb();var n;return(function(r){function s(u={},d={},h=!1){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});let g=t(d);h||(g=Object.keys(g).reduce((f,m)=>(g[m]!=null&&(f[m]=g[m]),f),{}));for(const f in u)u[f]!==void 0&&d[f]===void 0&&(g[f]=u[f]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(u={},d={}){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});const h=Object.keys(u).concat(Object.keys(d)).reduce((g,f)=>(e(u[f],d[f])||(g[f]=d[f]===void 0?null:d[f]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(u={},d={}){u=u||{};const h=Object.keys(d).reduce((g,f)=>(d[f]!==u[f]&&u[f]!==void 0&&(g[f]=d[f]),g),{});return Object.keys(u).reduce((g,f)=>(u[f]!==d[f]&&d[f]===void 0&&(g[f]=null),g),h)}r.invert=i;function o(u,d,h=!1){if(typeof u!="object")return d;if(typeof d!="object")return;if(!h)return d;const g=Object.keys(d).reduce((f,m)=>(u[m]===void 0&&(f[m]=d[m]),f),{});return Object.keys(g).length>0?g:void 0}r.transform=o})(n||(n={})),Bu.default=n,Bu}var Fu={},$p;function zb(){if($p)return Fu;$p=1,Object.defineProperty(Fu,"__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={})),Fu.default=t,Fu}var Uu={},Yp;function W4(){if(Yp)return Uu;Yp=1,Object.defineProperty(Uu,"__esModule",{value:!0});const t=zb();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,i=t.default.length(s);if(r>=i-a?(r=i-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),i=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(i)}}else return[]}}return Uu.default=e,Uu}var zp;function G4(){return zp||(zp=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=Y4(),r=$b(),s=Yb(),a=z4();e.AttributeMap=a.default;const i=zb();e.Op=i.default;const o=W4();e.OpIterator=o.default;const u="\0",d=(g,f)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const m=Object.keys(g)[0];if(!m||m!==Object.keys(f)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(f)[0]}`);return[m,g[m],f[m]]};class h{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,m){this.handlers[f]=m}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const m=this.handlers[f];if(!m)throw new Error(`no handlers for embed type "${f}"`);return m}insert(f,m){const b={};return typeof f=="string"&&f.length===0?this:(b.insert=f,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,m){if(typeof f=="number"&&f<=0)return this;const b={retain:f};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b)}push(f){let m=this.ops.length,b=this.ops[m-1];if(f=r(f),typeof b=="object"){if(typeof f.delete=="number"&&typeof b.delete=="number")return this.ops[m-1]={delete:b.delete+f.delete},this;if(typeof b.delete=="number"&&f.insert!=null&&(m-=1,b=this.ops[m-1],typeof b!="object"))return this.ops.unshift(f),this;if(s(f.attributes,b.attributes)){if(typeof f.insert=="string"&&typeof b.insert=="string")return this.ops[m-1]={insert:b.insert+f.insert},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof b.retain=="number")return this.ops[m-1]={retain:b.retain+f.retain},typeof f.attributes=="object"&&(this.ops[m-1].attributes=f.attributes),this}}return m===this.ops.length?this.ops.push(f):this.ops.splice(m,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const m=[],b=[];return this.forEach(_=>{(f(_)?m:b).push(_)}),[m,b]}reduce(f,m){return this.ops.reduce(f,m)}changeLength(){return this.reduce((f,m)=>m.insert?f+i.default.length(m):m.delete?f-m.delete:f,0)}length(){return this.reduce((f,m)=>f+i.default.length(m),0)}slice(f=0,m=1/0){const b=[],_=new o.default(this.ops);let A=0;for(;A<m&&_.hasNext();){let E;A<f?E=_.next(f-A):(E=_.next(m-A),b.push(E)),A+=i.default.length(E)}return new h(b)}compose(f){const m=new o.default(this.ops),b=new o.default(f.ops),_=[],A=b.peek();if(A!=null&&typeof A.retain=="number"&&A.attributes==null){let C=A.retain;for(;m.peekType()==="insert"&&m.peekLength()<=C;)C-=m.peekLength(),_.push(m.next());A.retain-C>0&&b.next(A.retain-C)}const E=new h(_);for(;m.hasNext()||b.hasNext();)if(b.peekType()==="insert")E.push(b.next());else if(m.peekType()==="delete")E.push(m.next());else{const C=Math.min(m.peekLength(),b.peekLength()),I=m.next(C),H=b.next(C);if(H.retain){const B={};if(typeof I.retain=="number")B.retain=typeof H.retain=="number"?C:H.retain;else if(typeof H.retain=="number")I.retain==null?B.insert=I.insert:B.retain=I.retain;else{const F=I.retain==null?"insert":"retain",[Y,X,te]=d(I[F],H.retain),T=h.getHandler(Y);B[F]={[Y]:T.compose(X,te,F==="retain")}}const J=a.default.compose(I.attributes,H.attributes,typeof I.retain=="number");if(J&&(B.attributes=J),E.push(B),!b.hasNext()&&s(E.ops[E.ops.length-1],B)){const F=new h(m.rest());return E.concat(F).chop()}}else typeof H.delete=="number"&&(typeof I.retain=="number"||typeof I.retain=="object"&&I.retain!==null)&&E.push(H)}return E.chop()}concat(f){const m=new h(this.ops.slice());return f.ops.length>0&&(m.push(f.ops[0]),m.ops=m.ops.concat(f.ops.slice(1))),m}diff(f,m){if(this.ops===f.ops)return new h;const b=[this,f].map(I=>I.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:u;const B=I===f?"on":"with";throw new Error("diff() called "+B+" non-document")}).join("")),_=new h,A=n(b[0],b[1],m,!0),E=new o.default(this.ops),C=new o.default(f.ops);return A.forEach(I=>{let H=I[1].length;for(;H>0;){let B=0;switch(I[0]){case n.INSERT:B=Math.min(C.peekLength(),H),_.push(C.next(B));break;case n.DELETE:B=Math.min(H,E.peekLength()),E.next(B),_.delete(B);break;case n.EQUAL:B=Math.min(E.peekLength(),C.peekLength(),H);const J=E.next(B),F=C.next(B);s(J.insert,F.insert)?_.retain(B,a.default.diff(J.attributes,F.attributes)):_.push(F).delete(B);break}H-=B}}),_.chop()}eachLine(f,m=`
75
+ `){const b=new o.default(this.ops);let _=new h,A=0;for(;b.hasNext();){if(b.peekType()!=="insert")return;const E=b.peek(),C=i.default.length(E)-b.peekLength(),I=typeof E.insert=="string"?E.insert.indexOf(m,C)-C:-1;if(I<0)_.push(b.next());else if(I>0)_.push(b.next(I));else{if(f(_,b.next(1).attributes||{},A)===!1)return;A+=1,_=new h}}_.length()>0&&f(_,{},A)}invert(f){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 A=_.delete||_.retain;return f.slice(b,b+A).forEach(C=>{_.delete?m.push(C):_.retain&&_.attributes&&m.retain(i.default.length(C),a.default.invert(_.attributes,C.attributes))}),b+A}else if(typeof _.retain=="object"&&_.retain!==null){const A=f.slice(b,b+1),E=new o.default(A.ops).next(),[C,I,H]=d(_.retain,E.insert),B=h.getHandler(C);return m.retain({[C]:B.invert(I,H)},a.default.invert(_.attributes,E.attributes)),b+1}}return b},0),m.chop()}transform(f,m=!1){if(m=!!m,typeof f=="number")return this.transformPosition(f,m);const b=f,_=new o.default(this.ops),A=new o.default(b.ops),E=new h;for(;_.hasNext()||A.hasNext();)if(_.peekType()==="insert"&&(m||A.peekType()!=="insert"))E.retain(i.default.length(_.next()));else if(A.peekType()==="insert")E.push(A.next());else{const C=Math.min(_.peekLength(),A.peekLength()),I=_.next(C),H=A.next(C);if(I.delete)continue;if(H.delete)E.push(H);else{const B=I.retain,J=H.retain;let F=typeof J=="object"&&J!==null?J:C;if(typeof B=="object"&&B!==null&&typeof J=="object"&&J!==null){const Y=Object.keys(B)[0];if(Y===Object.keys(J)[0]){const X=h.getHandler(Y);X&&(F={[Y]:X.transform(B[Y],J[Y],m)})}}E.retain(F,a.default.transform(I.attributes,H.attributes,m))}}return E.chop()}transformPosition(f,m=!1){m=!!m;const b=new o.default(this.ops);let _=0;for(;b.hasNext()&&_<=f;){const A=b.peekLength(),E=b.peekType();if(b.next(),E==="delete"){f-=Math.min(A,f-_);continue}else E==="insert"&&(_<f||!m)&&(f+=A);_+=A}return f}}h.Op=i.default,h.OpIterator=o.default,h.AttributeMap=a.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h})(Mu,Mu.exports)),Mu.exports}var ur=G4();const Oe=jb(ur);class Br extends Vn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Br.blotName="break";Br.tagName="BR";let xr=class extends Il{};const K4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ec(t){return t.replace(/[&<>"']/g,e=>K4[e])}const jr=class jr extends Fh{static compare(e,n){const r=jr.order.indexOf(e),s=jr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(jr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Re.BLOT)){const a=this.isolate(e,n);s&&a.wrap(r,s)}else super.formatAt(e,n,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof jr&&jr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};_e(jr,"allowedChildren",[jr,Br,Vn,xr]),_e(jr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let rs=jr;const Wp=1;class fn extends jo{constructor(){super(...arguments);_e(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Wb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,Re.BLOCK)?n+r===this.length()&&this.format(s,a):super.formatAt(n,Math.min(r,this.length()-n-1),s,a),this.cache={})}insertAt(n,r,s){if(s!=null){super.insertAt(n,r,s),this.cache={};return}if(r.length===0)return;const a=r.split(`
74
76
  `),i=a.shift();i.length>0&&(n<this.length()-1||this.children.tail==null?super.insertAt(Math.min(n,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let o=this;a.reduce((u,d)=>(o=o.split(u,!0),o.insertAt(0,d),d.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Br&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Wp),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()-Wp)){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}}fn.blotName="block";fn.tagName="P";fn.defaultChild=Br;fn.allowedChildren=[Br,rs,Vn,xr];class or extends Vn{attach(){super.attach(),this.attributes=new Zl(this.domNode)}delta(){return new Oe().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,Re.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,n)}formatAt(e,n,r,s){this.format(r,s)}insertAt(e,n,r){if(r!=null){super.insertAt(e,n,r);return}const s=n.split(`
75
- `),a=s.pop(),i=s.map(u=>{const d=this.scroll.create(fn.blotName);return d.insertAt(0,u),d}),o=this.split(e);i.forEach(u=>{this.parent.insertBefore(u,o)}),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}or.scope=Re.BLOCK_BLOT;function $b(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(Tn).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),sr(r,{},e)),new Oe).insert(`
76
- `,sr(t))}function sr(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:sr(t.parent,e,n)}const Zn=class Zn extends Vn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(Zn.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,n){if(this.savedLength!==0){super.format(e,n);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Re.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Zn.CONTENTS.length,r.optimize(),r.formatAt(s,Zn.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 xr?this.prev:null,r=n?n.length():0,s=this.next instanceof xr?this.next:null,a=s?s.text:"",{textNode:i}=this,o=i.data.split(Zn.CONTENTS).join("");i.data=Zn.CONTENTS;let u;if(n)u=n,(o||s)&&(n.insertAt(n.length(),o+a),s&&s.remove());else if(s)u=s,s.insertAt(0,o);else{const d=document.createTextNode(o);u=this.scroll.create(d),this.parent.insertBefore(u,this)}if(this.remove(),e){const d=(f,m)=>n&&f===n.domNode?m:f===i?r+m-1:s&&f===s.domNode?r+o.length+m:null,h=d(e.start.node,e.start.offset),g=d(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:u.domNode,startOffset:h,endNode:u.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=Zn.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};_e(Zn,"blotName","cursor"),_e(Zn,"className","ql-cursor"),_e(Zn,"tagName","span"),_e(Zn,"CONTENTS","\uFEFF");let Bi=Zn;var Wc={exports:{}},Gp;function W4(){return Gp||(Gp=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(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function a(u,d,h,g,f){if(typeof h!="function")throw new TypeError("The listener must be a function");var m=new s(h,g||u,f),b=n?n+d:d;return u._events[b]?u._events[b].fn?u._events[b]=[u._events[b],m]:u._events[b].push(m):(u._events[b]=m,u._eventsCount++),u}function i(u,d){--u._eventsCount===0?u._events=new r:delete u._events[d]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],h,g;if(this._eventsCount===0)return d;for(g in h=this._events)e.call(h,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},o.prototype.listeners=function(d){var h=n?n+d:d,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var f=0,m=g.length,b=new Array(m);f<m;f++)b[f]=g[f].fn;return b},o.prototype.listenerCount=function(d){var h=n?n+d:d,g=this._events[h];return g?g.fn?1:g.length:0},o.prototype.emit=function(d,h,g,f,m,b){var _=n?n+d:d;if(!this._events[_])return!1;var A=this._events[_],E=arguments.length,C,I;if(A.fn){switch(A.once&&this.removeListener(d,A.fn,void 0,!0),E){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,h),!0;case 3:return A.fn.call(A.context,h,g),!0;case 4:return A.fn.call(A.context,h,g,f),!0;case 5:return A.fn.call(A.context,h,g,f,m),!0;case 6:return A.fn.call(A.context,h,g,f,m,b),!0}for(I=1,C=new Array(E-1);I<E;I++)C[I-1]=arguments[I];A.fn.apply(A.context,C)}else{var H=A.length,B;for(I=0;I<H;I++)switch(A[I].once&&this.removeListener(d,A[I].fn,void 0,!0),E){case 1:A[I].fn.call(A[I].context);break;case 2:A[I].fn.call(A[I].context,h);break;case 3:A[I].fn.call(A[I].context,h,g);break;case 4:A[I].fn.call(A[I].context,h,g,f);break;default:if(!C)for(B=1,C=new Array(E-1);B<E;B++)C[B-1]=arguments[B];A[I].fn.apply(A[I].context,C)}}return!0},o.prototype.on=function(d,h,g){return a(this,d,h,g,!1)},o.prototype.once=function(d,h,g){return a(this,d,h,g,!0)},o.prototype.removeListener=function(d,h,g,f){var m=n?n+d:d;if(!this._events[m])return this;if(!h)return i(this,m),this;var b=this._events[m];if(b.fn)b.fn===h&&(!f||b.once)&&(!g||b.context===g)&&i(this,m);else{for(var _=0,A=[],E=b.length;_<E;_++)(b[_].fn!==h||f&&!b[_].once||g&&b[_].context!==g)&&A.push(b[_]);A.length?this._events[m]=A.length===1?A[0]:A:i(this,m)}return this},o.prototype.removeAllListeners=function(d){var h;return d?(h=n?n+d:d,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(Wc)),Wc.exports}var G4=W4();const K4=Ub(G4),_f=new WeakMap,Af=["error","warn","log","info"];let yf="warn";function Yb(t){if(yf&&Af.indexOf(t)<=Af.indexOf(yf)){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 Ns(t){return Af.reduce((e,n)=>(e[n]=Yb.bind(console,n,t),e),{})}Ns.level=t=>{yf=t};Yb.level=Ns.level;const Gc=Ns("quill:events"),V4=["selectionchange","mousedown","mouseup","click"];V4.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=_f.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Ce extends K4{constructor(){super(),this.domListeners={},this.on("error",Gc.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Gc.log.call(Gc,...n),super.emit(...n)}handleDOM(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:i,handler:o}=a;(e.target===i||i.contains(e.target))&&o(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}_e(Ce,"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"}),_e(Ce,"sources",{API:"api",SILENT:"silent",USER:"user"});const Kc=Ns("quill:selection");class Pa{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class X4{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 Pa(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,Ce.sources.USER),1)}),this.emitter.on(Ce.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Ce.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const i=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(i?Ce.sources.SILENT:s)}catch{}})}),this.emitter.on(Ce.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:o,endOffset:u}=s.range;this.setNativeRange(a,i,o,u),this.update(Ce.sources.SILENT)}}),this.update(Ce.sources.SILENT)}handleComposition(){this.emitter.on(Ce.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Ce.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(Ce.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,n){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Re.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Tn){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),n=Math.min(e+n,r-1)-e;let s,[a,i]=this.scroll.leaf(e);if(a==null)return null;if(n>0&&i===a.length()){const[h]=this.scroll.leaf(e+1);if(h){const[g]=this.scroll.line(e),[f]=this.scroll.line(e+1);g===f&&(a=h,i=0)}}[s,i]=a.position(i,!0);const o=document.createRange();if(n>0)return o.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),o.setEnd(s,i),o.getBoundingClientRect());let u="left",d;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(o.setStart(s,i),o.setEnd(s,i+1)):(o.setStart(s,i-1),o.setEnd(s,i),u="right"),d=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;d=a.domNode.getBoundingClientRect(),i>0&&(u="right")}return{bottom:d.top+d.height,height:d.height,left:d[u],right:d[u],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const n=e.getRangeAt(0);if(n==null)return null;const r=this.normalizeNative(n);return Kc.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&&Vc(this.root,document.activeElement)}normalizedToRange(e){const n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);const r=n.map(i=>{const[o,u]=i,d=this.scroll.find(o,!0),h=d.offset(this.scroll);return u===0?h:d instanceof Tn?h+d.index(o,u):h+d.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Pa(a,s-a)}normalizeNative(e){if(!Vc(this.root,e.startContainer)||!e.collapsed&&!Vc(this.root,e.endContainer))return null;const n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),n}rangeToNative(e){const n=this.scroll.length(),r=(s,a)=>{s=Math.min(n-1,s);const[i,o]=this.scroll.leaf(s);return i?i.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Kc.info("setNativeRange",e,n,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const i=document.getSelection();if(i!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(n=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const u=document.createRange();u.setStart(e,n),u.setEnd(r,s),i.removeAllRanges(),i.addRange(u)}}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]:Ce.sources.API;if(typeof n=="string"&&(r=n,n=!1),Kc.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]:Ce.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Bh(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=[Ce.events.SELECTION_CHANGE,pi(this.lastRange),pi(n),e];this.emitter.emit(Ce.events.EDITOR_CHANGE,...a),e!==Ce.sources.SILENT&&this.emitter.emit(...a)}}}function Vc(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const Q4=/^[ -~]*$/;class Z4{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=Kp(e),s=new Oe;return eL(r.ops.slice()).reduce((i,o)=>{const u=ur.Op.length(o);let d=o.attributes||{},h=!1,g=!1;if(o.insert!=null){if(s.retain(u),typeof o.insert=="string"){const b=o.insert;g=!b.endsWith(`
77
+ `),a=s.pop(),i=s.map(u=>{const d=this.scroll.create(fn.blotName);return d.insertAt(0,u),d}),o=this.split(e);i.forEach(u=>{this.parent.insertBefore(u,o)}),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}or.scope=Re.BLOCK_BLOT;function Wb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(Tn).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),sr(r,{},e)),new Oe).insert(`
78
+ `,sr(t))}function sr(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:sr(t.parent,e,n)}const Zn=class Zn extends Vn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(Zn.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,n){if(this.savedLength!==0){super.format(e,n);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Re.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Zn.CONTENTS.length,r.optimize(),r.formatAt(s,Zn.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 xr?this.prev:null,r=n?n.length():0,s=this.next instanceof xr?this.next:null,a=s?s.text:"",{textNode:i}=this,o=i.data.split(Zn.CONTENTS).join("");i.data=Zn.CONTENTS;let u;if(n)u=n,(o||s)&&(n.insertAt(n.length(),o+a),s&&s.remove());else if(s)u=s,s.insertAt(0,o);else{const d=document.createTextNode(o);u=this.scroll.create(d),this.parent.insertBefore(u,this)}if(this.remove(),e){const d=(f,m)=>n&&f===n.domNode?m:f===i?r+m-1:s&&f===s.domNode?r+o.length+m:null,h=d(e.start.node,e.start.offset),g=d(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:u.domNode,startOffset:h,endNode:u.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=Zn.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};_e(Zn,"blotName","cursor"),_e(Zn,"className","ql-cursor"),_e(Zn,"tagName","span"),_e(Zn,"CONTENTS","\uFEFF");let Bi=Zn;var Wc={exports:{}},Gp;function V4(){return Gp||(Gp=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(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function a(u,d,h,g,f){if(typeof h!="function")throw new TypeError("The listener must be a function");var m=new s(h,g||u,f),b=n?n+d:d;return u._events[b]?u._events[b].fn?u._events[b]=[u._events[b],m]:u._events[b].push(m):(u._events[b]=m,u._eventsCount++),u}function i(u,d){--u._eventsCount===0?u._events=new r:delete u._events[d]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],h,g;if(this._eventsCount===0)return d;for(g in h=this._events)e.call(h,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},o.prototype.listeners=function(d){var h=n?n+d:d,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var f=0,m=g.length,b=new Array(m);f<m;f++)b[f]=g[f].fn;return b},o.prototype.listenerCount=function(d){var h=n?n+d:d,g=this._events[h];return g?g.fn?1:g.length:0},o.prototype.emit=function(d,h,g,f,m,b){var _=n?n+d:d;if(!this._events[_])return!1;var A=this._events[_],E=arguments.length,C,I;if(A.fn){switch(A.once&&this.removeListener(d,A.fn,void 0,!0),E){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,h),!0;case 3:return A.fn.call(A.context,h,g),!0;case 4:return A.fn.call(A.context,h,g,f),!0;case 5:return A.fn.call(A.context,h,g,f,m),!0;case 6:return A.fn.call(A.context,h,g,f,m,b),!0}for(I=1,C=new Array(E-1);I<E;I++)C[I-1]=arguments[I];A.fn.apply(A.context,C)}else{var H=A.length,B;for(I=0;I<H;I++)switch(A[I].once&&this.removeListener(d,A[I].fn,void 0,!0),E){case 1:A[I].fn.call(A[I].context);break;case 2:A[I].fn.call(A[I].context,h);break;case 3:A[I].fn.call(A[I].context,h,g);break;case 4:A[I].fn.call(A[I].context,h,g,f);break;default:if(!C)for(B=1,C=new Array(E-1);B<E;B++)C[B-1]=arguments[B];A[I].fn.apply(A[I].context,C)}}return!0},o.prototype.on=function(d,h,g){return a(this,d,h,g,!1)},o.prototype.once=function(d,h,g){return a(this,d,h,g,!0)},o.prototype.removeListener=function(d,h,g,f){var m=n?n+d:d;if(!this._events[m])return this;if(!h)return i(this,m),this;var b=this._events[m];if(b.fn)b.fn===h&&(!f||b.once)&&(!g||b.context===g)&&i(this,m);else{for(var _=0,A=[],E=b.length;_<E;_++)(b[_].fn!==h||f&&!b[_].once||g&&b[_].context!==g)&&A.push(b[_]);A.length?this._events[m]=A.length===1?A[0]:A:i(this,m)}return this},o.prototype.removeAllListeners=function(d){var h;return d?(h=n?n+d:d,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(Wc)),Wc.exports}var X4=V4();const Q4=jb(X4),_f=new WeakMap,Af=["error","warn","log","info"];let yf="warn";function Gb(t){if(yf&&Af.indexOf(t)<=Af.indexOf(yf)){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 Ns(t){return Af.reduce((e,n)=>(e[n]=Gb.bind(console,n,t),e),{})}Ns.level=t=>{yf=t};Gb.level=Ns.level;const Gc=Ns("quill:events"),Z4=["selectionchange","mousedown","mouseup","click"];Z4.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=_f.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Ce extends Q4{constructor(){super(),this.domListeners={},this.on("error",Gc.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Gc.log.call(Gc,...n),super.emit(...n)}handleDOM(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:i,handler:o}=a;(e.target===i||i.contains(e.target))&&o(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}_e(Ce,"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"}),_e(Ce,"sources",{API:"api",SILENT:"silent",USER:"user"});const Kc=Ns("quill:selection");class Pa{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class J4{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 Pa(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,Ce.sources.USER),1)}),this.emitter.on(Ce.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Ce.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const i=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(i?Ce.sources.SILENT:s)}catch{}})}),this.emitter.on(Ce.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:o,endOffset:u}=s.range;this.setNativeRange(a,i,o,u),this.update(Ce.sources.SILENT)}}),this.update(Ce.sources.SILENT)}handleComposition(){this.emitter.on(Ce.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Ce.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(Ce.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,n){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Re.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Tn){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),n=Math.min(e+n,r-1)-e;let s,[a,i]=this.scroll.leaf(e);if(a==null)return null;if(n>0&&i===a.length()){const[h]=this.scroll.leaf(e+1);if(h){const[g]=this.scroll.line(e),[f]=this.scroll.line(e+1);g===f&&(a=h,i=0)}}[s,i]=a.position(i,!0);const o=document.createRange();if(n>0)return o.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),o.setEnd(s,i),o.getBoundingClientRect());let u="left",d;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(o.setStart(s,i),o.setEnd(s,i+1)):(o.setStart(s,i-1),o.setEnd(s,i),u="right"),d=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;d=a.domNode.getBoundingClientRect(),i>0&&(u="right")}return{bottom:d.top+d.height,height:d.height,left:d[u],right:d[u],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const n=e.getRangeAt(0);if(n==null)return null;const r=this.normalizeNative(n);return Kc.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&&Vc(this.root,document.activeElement)}normalizedToRange(e){const n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);const r=n.map(i=>{const[o,u]=i,d=this.scroll.find(o,!0),h=d.offset(this.scroll);return u===0?h:d instanceof Tn?h+d.index(o,u):h+d.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Pa(a,s-a)}normalizeNative(e){if(!Vc(this.root,e.startContainer)||!e.collapsed&&!Vc(this.root,e.endContainer))return null;const n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),n}rangeToNative(e){const n=this.scroll.length(),r=(s,a)=>{s=Math.min(n-1,s);const[i,o]=this.scroll.leaf(s);return i?i.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Kc.info("setNativeRange",e,n,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const i=document.getSelection();if(i!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(n=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const u=document.createRange();u.setStart(e,n),u.setEnd(r,s),i.removeAllRanges(),i.addRange(u)}}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]:Ce.sources.API;if(typeof n=="string"&&(r=n,n=!1),Kc.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]:Ce.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Bh(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=[Ce.events.SELECTION_CHANGE,pi(this.lastRange),pi(n),e];this.emitter.emit(Ce.events.EDITOR_CHANGE,...a),e!==Ce.sources.SILENT&&this.emitter.emit(...a)}}}function Vc(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const eL=/^[ -~]*$/;class tL{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=Kp(e),s=new Oe;return rL(r.ops.slice()).reduce((i,o)=>{const u=ur.Op.length(o);let d=o.attributes||{},h=!1,g=!1;if(o.insert!=null){if(s.retain(u),typeof o.insert=="string"){const b=o.insert;g=!b.endsWith(`
77
79
  `)&&(n<=i||!!this.scroll.descendant(or,i)[0]),this.scroll.insertAt(i,b);const[_,A]=this.scroll.line(i);let E=zs({},sr(_));if(_ instanceof fn){const[C]=_.descendant(Tn,A);C&&(E=zs(E,sr(C)))}d=ur.AttributeMap.diff(E,d)||{}}else if(typeof o.insert=="object"){const b=Object.keys(o.insert)[0];if(b==null)return i;const _=this.scroll.query(b,Re.INLINE)!=null;if(_)(n<=i||this.scroll.descendant(or,i)[0])&&(g=!0);else if(i>0){const[A,E]=this.scroll.descendant(Tn,i-1);A instanceof xr?A.value()[E]!==`
78
- `&&(h=!0):A instanceof Vn&&A.statics.scope===Re.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(i,b,o.insert[b]),_){const[A]=this.scroll.descendant(Tn,i);if(A){const E=zs({},sr(A));d=ur.AttributeMap.diff(E,d)||{}}}}n+=u}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const b=Object.keys(o.retain)[0];if(b==null)return i;this.scroll.updateEmbedAt(i,b,o.retain[b])}Object.keys(d).forEach(b=>{this.scroll.formatAt(i,u,b,d[b])});const f=h?1:0,m=g?1:0;return n+=f+m,s.retain(f),s.delete(m),i+u+f+m},0),s.reduce((i,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(i,o.delete),i):i+ur.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new 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,pi(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,pi(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(o=>{const[u]=o;u instanceof fn?r.push(u):u instanceof Tn&&s.push(u)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(Tn,e,n));const[a,i]=[r,s].map(o=>{const u=o.shift();if(u==null)return{};let d=sr(u);for(;Object.keys(d).length>0;){const h=o.shift();if(h==null)return d;d=J4(sr(h),d)}return d});return{...a,...i}}getHTML(e,n){const[r,s]=this.scroll.line(e);if(r){const a=r.length();return r.length()>=s+n&&!(s===0&&n===a)?$o(r,s,n,!0):$o(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=Kp(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,`
80
+ `&&(h=!0):A instanceof Vn&&A.statics.scope===Re.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(i,b,o.insert[b]),_){const[A]=this.scroll.descendant(Tn,i);if(A){const E=zs({},sr(A));d=ur.AttributeMap.diff(E,d)||{}}}}n+=u}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const b=Object.keys(o.retain)[0];if(b==null)return i;this.scroll.updateEmbedAt(i,b,o.retain[b])}Object.keys(d).forEach(b=>{this.scroll.formatAt(i,u,b,d[b])});const f=h?1:0,m=g?1:0;return n+=f+m,s.retain(f),s.delete(m),i+u+f+m},0),s.reduce((i,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(i,o.delete),i):i+ur.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new 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,pi(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,pi(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(o=>{const[u]=o;u instanceof fn?r.push(u):u instanceof Tn&&s.push(u)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(Tn,e,n));const[a,i]=[r,s].map(o=>{const u=o.shift();if(u==null)return{};let d=sr(u);for(;Object.keys(d).length>0;){const h=o.shift();if(h==null)return d;d=nL(sr(h),d)}return d});return{...a,...i}}getHTML(e,n){const[r,s]=this.scroll.line(e);if(r){const a=r.length();return r.length()>=s+n&&!(s===0&&n===a)?$o(r,s,n,!0):$o(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=Kp(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,`
79
81
  `).replace(/\r/g,`
80
82
  `),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,pi(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)!==fn.blotName)return!1;const n=e;return n.children.length>1?!1:n.children.head instanceof Br}removeFormat(e,n){const r=this.getText(e,n),[s,a]=this.scroll.line(e+n);let i=0,o=new Oe;s!=null&&(i=s.length()-a,o=s.delta().slice(a,a+i-1).insert(`
81
- `));const d=this.getContents(e,n+i).diff(new Oe().insert(r).concat(o)),h=new Oe().retain(e).concat(d);return this.applyDelta(h)}update(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(n.length===1&&n[0].type==="characterData"&&n[0].target.data.match(Q4)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=sr(a),o=a.offset(this.scroll),u=n[0].oldValue.replace(Bi.CONTENTS,""),d=new Oe().insert(u),h=new Oe().insert(a.value()),g=r&&{oldRange:Vp(r.oldRange,-o),newRange:Vp(r.newRange,-o)};e=new Oe().retain(o).concat(d.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||!Bh(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function ai(t,e,n){if(t.length===0){const[m]=Xc(n.pop());return e<=0?`</li></${m}>`:`</li></${m}>${ai([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:o},...u]=t,[d,h]=Xc(o);if(i>e)return n.push(o),i===e+1?`<${d}><li${h}>${$o(r,s,a)}${ai(u,i,n)}`:`<${d}><li>${ai(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&o===g)return`</li><li${h}>${$o(r,s,a)}${ai(u,i,n)}`;const[f]=Xc(n.pop());return`</li></${f}>${ai(t,e-1,n)}`}function $o(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 xr)return ec(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof Lr){if(t.statics.blotName==="list-container"){const d=[];return t.children.forEachAt(e,n,(h,g,f)=>{const m="formats"in h&&typeof h.formats=="function"?h.formats():{};d.push({child:h,offset:g,length:f,indent:m.indent||0,type:m.list})}),ai(d,-1,[])}const s=[];if(t.children.forEachAt(e,n,(d,h,g)=>{s.push($o(d,h,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[o,u]=a.split(`>${i}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${o}>${s.join("")}<${u}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function J4(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 Xc(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 Kp(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
83
+ `));const d=this.getContents(e,n+i).diff(new Oe().insert(r).concat(o)),h=new Oe().retain(e).concat(d);return this.applyDelta(h)}update(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(n.length===1&&n[0].type==="characterData"&&n[0].target.data.match(eL)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=sr(a),o=a.offset(this.scroll),u=n[0].oldValue.replace(Bi.CONTENTS,""),d=new Oe().insert(u),h=new Oe().insert(a.value()),g=r&&{oldRange:Vp(r.oldRange,-o),newRange:Vp(r.newRange,-o)};e=new Oe().retain(o).concat(d.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||!Bh(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function ai(t,e,n){if(t.length===0){const[m]=Xc(n.pop());return e<=0?`</li></${m}>`:`</li></${m}>${ai([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:o},...u]=t,[d,h]=Xc(o);if(i>e)return n.push(o),i===e+1?`<${d}><li${h}>${$o(r,s,a)}${ai(u,i,n)}`:`<${d}><li>${ai(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&o===g)return`</li><li${h}>${$o(r,s,a)}${ai(u,i,n)}`;const[f]=Xc(n.pop());return`</li></${f}>${ai(t,e-1,n)}`}function $o(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 xr)return ec(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof Lr){if(t.statics.blotName==="list-container"){const d=[];return t.children.forEachAt(e,n,(h,g,f)=>{const m="formats"in h&&typeof h.formats=="function"?h.formats():{};d.push({child:h,offset:g,length:f,indent:m.indent||0,type:m.list})}),ai(d,-1,[])}const s=[];if(t.children.forEachAt(e,n,(d,h,g)=>{s.push($o(d,h,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[o,u]=a.split(`>${i}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${o}>${s.join("")}<${u}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function nL(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 Xc(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 Kp(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
82
84
  `).replace(/\r/g,`
83
- `);return e.insert(r,n.attributes)}return e.push(n)},new Oe)}function Vp(t,e){let{index:n,length:r}=t;return new Pa(n+e,r)}function eL(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
85
+ `);return e.insert(r,n.attributes)}return e.push(n)},new Oe)}function Vp(t,e){let{index:n,length:r}=t;return new Pa(n+e,r)}function rL(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
84
86
  `).forEach((s,a)=>{a&&e.push({insert:`
85
- `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Fr{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}_e(Fr,"DEFAULTS",{});const Hu="\uFEFF";class Hh extends Vn{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(Hu),this.rightGuard=document.createTextNode(Hu),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(Hu).join("");if(e===this.leftGuard)if(this.prev instanceof xr){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 xr?(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=Hu,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 tL{constructor(e,n){_e(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 Hh)&&(this.emitter.emit(Ce.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Ce.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Ce.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Ce.events.COMPOSITION_END,e),this.isComposing=!1}}const Co=class Co{constructor(e,n){_e(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]}};_e(Co,"DEFAULTS",{modules:{}}),_e(Co,"themes",{default:Co});let Fi=Co;const nL=t=>t.parentElement||t.getRootNode().host||null,rL=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}},qu=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},Xp=(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,sL=(t,e)=>{var a,i,o;const n=t.ownerDocument;let r=e,s=t;for(;s;){const u=s===n.body,d=u?{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}:rL(s),h=getComputedStyle(s),g=Xp(r.left,r.right,d.left,d.right,qu(h.scrollPaddingLeft),qu(h.scrollPaddingRight)),f=Xp(r.top,r.bottom,d.top,d.bottom,qu(h.scrollPaddingTop),qu(h.scrollPaddingBottom));if(g||f)if(u)(o=n.defaultView)==null||o.scrollBy(g,f);else{const{scrollLeft:m,scrollTop:b}=s;f&&(s.scrollTop+=f),g&&(s.scrollLeft+=g);const _=s.scrollLeft-m,A=s.scrollTop-b;r={left:r.left-_,top:r.top-A,right:r.right-_,bottom:r.bottom-A}}s=u||h.position==="fixed"?null:nL(s)}},aL=100,iL=["block","break","cursor","inline","scroll","text"],oL=(t,e,n)=>{const r=new Mi;return iL.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>aL){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},gi=Ns("quill"),ju=new Mi;Lr.uiClass="ql-ui";const Er=class Er{static debug(e){e===!0&&(e="log"),Ns.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return _f.get(e)||ju.find(e,n)}static import(e){return this.imports[e]==null&&gi.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&&gi.warn(`Overwriting ${e} with`,n),this.imports[e]=n,(e.startsWith("blots/")||e.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&ju.register(n),typeof n.register=="function"&&n.register(ju)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=uL(e,n),this.container=this.options.container,this.container==null){gi.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="",_f.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Ce;const s=Uh.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 Z4(this.scroll),this.selection=new X4(this.scroll,this.emitter),this.composition=new tL(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(Ce.events.EDITOR_CHANGE,i=>{i===Ce.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Ce.events.SCROLL_UPDATE,(i,o)=>{const u=this.selection.lastRange,[d]=this.selection.getRange(),h=u&&d?{oldRange:u,newRange:d}:void 0;br.call(this,()=>this.editor.update(null,o,h),i)}),this.emitter.on(Ce.events.SCROLL_EMBED_UPDATE,(i,o)=>{const u=this.selection.lastRange,[d]=this.selection.getRange(),h=u&&d?{oldRange:u,newRange:d}:void 0;br.call(this,()=>{const g=new Oe().retain(i.offset(this)).retain({[i.statics.blotName]:o});return this.editor.update(g,[],h)},Er.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
86
- `});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]:Ce.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,Re.BLOCK))a=this.editor.formatLine(s.index,s.length,{[e]:n});else{if(s.length===0)return this.selection.format(e,n),a;a=this.editor.formatText(s.index,s.length,{[e]:n})}return this.setSelection(s,Ce.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){sL(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]:Ce.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 Pa(Math.max(0,e),n),r),r!==Ce.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.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]:Ce.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]:Ce.sources.API;return br.call(this,()=>(e=new Oe(e),this.editor.applyDelta(e)),n,!0)}};_e(Er,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:ju,theme:"default"}),_e(Er,"events",Ce.events),_e(Er,"sources",Ce.sources),_e(Er,"version","2.0.3"),_e(Er,"imports",{delta:Oe,parchment:H4,"core/module":Fr,"core/theme":Fi});let ie=Er;function Qp(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 Zp(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function uL(t,e){const n=Qp(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===ie.DEFAULTS.theme?Fi:ie.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=ie.DEFAULTS,{modules:o,...u}=s.DEFAULTS;let d=Qc(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const h=zs({},Qc(a),Qc(o),d),g={...i,...Zp(u),...Zp(e)};let f=e.registry;return f?e.formats&&gi.warn('Ignoring "formats" option because "registry" is specified'):f=e.formats?oL(e.formats,g.registry,gi):g.registry,{...g,registry:f,container:n,theme:s,modules:Object.entries(h).reduce((m,b)=>{let[_,A]=b;if(!A)return m;const E=ie.import(`modules/${_}`);return E==null?(gi.error(`Cannot load ${_} module. Are you sure you registered it?`),m):{...m,[_]:zs({},E.DEFAULTS||{},A)}},{}),bounds:Qp(g.bounds)}}function br(t,e,n,r){if(!this.isEnabled()&&e===Ce.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=Jp(s,i,e):r!==0&&(s=Jp(s,n,r,e)),this.setSelection(s,Ce.sources.SILENT)),i.length()>0){const o=[Ce.events.TEXT_CHANGE,i,a,e];this.emitter.emit(Ce.events.EDITOR_CHANGE,...o),e!==Ce.sources.SILENT&&this.emitter.emit(...o)}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||Ce.sources.API,[t,e,a,s]}function Jp(t,e,n,r){const s=typeof n=="number"?n:0;if(t==null)return null;let a,i;return e&&typeof e.transformPosition=="function"?[a,i]=[t.index,t.index+t.length].map(o=>e.transformPosition(o,r!==Ce.sources.USER)):[a,i]=[t.index,t.index+t.length].map(o=>o<e||o===e&&r===Ce.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new Pa(a,i-a)}class za extends Jl{}function e1(t){return t instanceof fn||t instanceof or}function t1(t){return typeof t.updateContent=="function"}class ii extends Uh{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(Ce.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Ce.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(Ce.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 Br?null:a.children.head;r.moveChildren(a,i),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.optimize()}insertAt(e,n,r){if(e>=this.length())if(r==null||this.scroll.query(n,Re.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
87
+ `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Fr{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}_e(Fr,"DEFAULTS",{});const Hu="\uFEFF";class Hh extends Vn{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(Hu),this.rightGuard=document.createTextNode(Hu),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(Hu).join("");if(e===this.leftGuard)if(this.prev instanceof xr){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 xr?(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=Hu,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 sL{constructor(e,n){_e(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 Hh)&&(this.emitter.emit(Ce.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Ce.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Ce.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Ce.events.COMPOSITION_END,e),this.isComposing=!1}}const Co=class Co{constructor(e,n){_e(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]}};_e(Co,"DEFAULTS",{modules:{}}),_e(Co,"themes",{default:Co});let Fi=Co;const aL=t=>t.parentElement||t.getRootNode().host||null,iL=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}},qu=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},Xp=(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,oL=(t,e)=>{var a,i,o;const n=t.ownerDocument;let r=e,s=t;for(;s;){const u=s===n.body,d=u?{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}:iL(s),h=getComputedStyle(s),g=Xp(r.left,r.right,d.left,d.right,qu(h.scrollPaddingLeft),qu(h.scrollPaddingRight)),f=Xp(r.top,r.bottom,d.top,d.bottom,qu(h.scrollPaddingTop),qu(h.scrollPaddingBottom));if(g||f)if(u)(o=n.defaultView)==null||o.scrollBy(g,f);else{const{scrollLeft:m,scrollTop:b}=s;f&&(s.scrollTop+=f),g&&(s.scrollLeft+=g);const _=s.scrollLeft-m,A=s.scrollTop-b;r={left:r.left-_,top:r.top-A,right:r.right-_,bottom:r.bottom-A}}s=u||h.position==="fixed"?null:aL(s)}},uL=100,lL=["block","break","cursor","inline","scroll","text"],cL=(t,e,n)=>{const r=new Mi;return lL.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>uL){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},gi=Ns("quill"),ju=new Mi;Lr.uiClass="ql-ui";const Er=class Er{static debug(e){e===!0&&(e="log"),Ns.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return _f.get(e)||ju.find(e,n)}static import(e){return this.imports[e]==null&&gi.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&&gi.warn(`Overwriting ${e} with`,n),this.imports[e]=n,(e.startsWith("blots/")||e.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&ju.register(n),typeof n.register=="function"&&n.register(ju)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=dL(e,n),this.container=this.options.container,this.container==null){gi.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="",_f.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Ce;const s=Uh.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 tL(this.scroll),this.selection=new J4(this.scroll,this.emitter),this.composition=new sL(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(Ce.events.EDITOR_CHANGE,i=>{i===Ce.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Ce.events.SCROLL_UPDATE,(i,o)=>{const u=this.selection.lastRange,[d]=this.selection.getRange(),h=u&&d?{oldRange:u,newRange:d}:void 0;br.call(this,()=>this.editor.update(null,o,h),i)}),this.emitter.on(Ce.events.SCROLL_EMBED_UPDATE,(i,o)=>{const u=this.selection.lastRange,[d]=this.selection.getRange(),h=u&&d?{oldRange:u,newRange:d}:void 0;br.call(this,()=>{const g=new Oe().retain(i.offset(this)).retain({[i.statics.blotName]:o});return this.editor.update(g,[],h)},Er.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
88
+ `});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]:Ce.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,Re.BLOCK))a=this.editor.formatLine(s.index,s.length,{[e]:n});else{if(s.length===0)return this.selection.format(e,n),a;a=this.editor.formatText(s.index,s.length,{[e]:n})}return this.setSelection(s,Ce.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){oL(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]:Ce.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 Pa(Math.max(0,e),n),r),r!==Ce.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.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]:Ce.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]:Ce.sources.API;return br.call(this,()=>(e=new Oe(e),this.editor.applyDelta(e)),n,!0)}};_e(Er,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:ju,theme:"default"}),_e(Er,"events",Ce.events),_e(Er,"sources",Ce.sources),_e(Er,"version","2.0.3"),_e(Er,"imports",{delta:Oe,parchment:$4,"core/module":Fr,"core/theme":Fi});let ie=Er;function Qp(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 Zp(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function dL(t,e){const n=Qp(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===ie.DEFAULTS.theme?Fi:ie.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=ie.DEFAULTS,{modules:o,...u}=s.DEFAULTS;let d=Qc(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const h=zs({},Qc(a),Qc(o),d),g={...i,...Zp(u),...Zp(e)};let f=e.registry;return f?e.formats&&gi.warn('Ignoring "formats" option because "registry" is specified'):f=e.formats?cL(e.formats,g.registry,gi):g.registry,{...g,registry:f,container:n,theme:s,modules:Object.entries(h).reduce((m,b)=>{let[_,A]=b;if(!A)return m;const E=ie.import(`modules/${_}`);return E==null?(gi.error(`Cannot load ${_} module. Are you sure you registered it?`),m):{...m,[_]:zs({},E.DEFAULTS||{},A)}},{}),bounds:Qp(g.bounds)}}function br(t,e,n,r){if(!this.isEnabled()&&e===Ce.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=Jp(s,i,e):r!==0&&(s=Jp(s,n,r,e)),this.setSelection(s,Ce.sources.SILENT)),i.length()>0){const o=[Ce.events.TEXT_CHANGE,i,a,e];this.emitter.emit(Ce.events.EDITOR_CHANGE,...o),e!==Ce.sources.SILENT&&this.emitter.emit(...o)}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||Ce.sources.API,[t,e,a,s]}function Jp(t,e,n,r){const s=typeof n=="number"?n:0;if(t==null)return null;let a,i;return e&&typeof e.transformPosition=="function"?[a,i]=[t.index,t.index+t.length].map(o=>e.transformPosition(o,r!==Ce.sources.USER)):[a,i]=[t.index,t.index+t.length].map(o=>o<e||o===e&&r===Ce.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new Pa(a,i-a)}class za extends Jl{}function e1(t){return t instanceof fn||t instanceof or}function t1(t){return typeof t.updateContent=="function"}class ii extends Uh{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(Ce.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Ce.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(Ce.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 Br?null:a.children.head;r.moveChildren(a,i),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.optimize()}insertAt(e,n,r){if(e>=this.length())if(r==null||this.scroll.query(n,Re.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
87
89
  `)?s.insertAt(0,n.slice(0,-1),r):s.insertAt(0,n,r)}else{const s=this.scroll.create(n,r);this.appendChild(s)}else super.insertAt(e,n,r);this.optimize()}insertBefore(e,n){if(e.statics.scope===Re.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,n)}else super.insertBefore(e,n)}insertContents(e,n){const r=this.deltaToRenderBlocks(n.concat(new Oe().insert(`
88
90
  `))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const u=a.type==="block"&&(a.delta.length()===0||!this.descendant(or,e)[0]&&e<this.length()),d=a.type==="block"?a.delta:new Oe().insert({[a.key]:a.value});Zc(this,e,d);const h=a.type==="block"?1:0,g=e+d.length()+h;u&&this.insertAt(g-1,`
89
91
  `);const f=sr(this.line(e)[0]),m=ur.AttributeMap.diff(f,a.attributes)||{};Object.keys(m).forEach(b=>{this.formatAt(g-1,1,b,m[b])}),e=g}let[i,o]=this.children.find(e);if(r.length&&(i&&(i=i.split(o),o=0),r.forEach(u=>{if(u.type==="block"){const d=this.createBlock(u.attributes,i||void 0);Zc(d,0,u.delta)}else{const d=this.create(u.key,u.value);this.insertBefore(d,i||void 0),Object.keys(u.attributes).forEach(h=>{d.format(h,u.attributes[h])})}})),s.type==="block"&&s.delta.length()){const u=i?i.offset(i.scroll)+o:this.length();Zc(this,u,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 Tn?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(e1,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,a,i)=>{let o=[],u=i;return s.children.forEachAt(a,i,(d,h,g)=>{e1(d)?o.push(d):d instanceof Jl&&(o=o.concat(r(d,h,u))),u-=g}),o};return r(this,e,n)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,n),e.length>0&&this.emitter.emit(Ce.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=Ce.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&&!t1(a)}),e.length>0&&this.emitter.emit(Ce.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Ce.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof or,e);s&&s.statics.blotName===n&&t1(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(`
90
- `);i.slice(0,-1).forEach(u=>{r.insert(u,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new Oe});const o=i[i.length-1];o&&r.insert(o,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Re.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new 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(o=>{let[u,d]=o;this.query(u,Re.BLOCK&Re.BLOT)!=null?r=u:s[u]=d});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,n||void 0);const i=a.length();return Object.entries(s).forEach(o=>{let[u,d]=o;a.formatAt(0,i,u,d)}),a}}_e(ii,"blotName","scroll"),_e(ii,"className","ql-editor"),_e(ii,"tagName","DIV"),_e(ii,"defaultChild",fn),_e(ii,"allowedChildren",[fn,or,za]);function Zc(t,e,n){n.reduce((r,s)=>{const a=ur.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;t.insertAt(r,o);const[u]=t.descendant(Tn,r),d=sr(u);i=ur.AttributeMap.diff(d,i)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(t.insertAt(r,o,s.insert[o]),t.scroll.query(o,Re.INLINE)!=null){const[d]=t.descendant(Tn,r),h=sr(d);i=ur.AttributeMap.diff(h,i)||{}}}}return Object.keys(i).forEach(o=>{t.formatAt(r,a,o,i[o])}),r+a},e)}const qh={scope:Re.BLOCK,whitelist:["right","center","justify"]},lL=new ns("align","align",qh),zb=new Mr("align","ql-align",qh),Wb=new Zs("align","text-align",qh);class Gb 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 cL=new Mr("color","ql-color",{scope:Re.INLINE}),jh=new Gb("color","color",{scope:Re.INLINE}),dL=new Mr("background","ql-bg",{scope:Re.INLINE}),$h=new Gb("background","background-color",{scope:Re.INLINE});class Wa extends za{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(`
92
+ `);i.slice(0,-1).forEach(u=>{r.insert(u,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new Oe});const o=i[i.length-1];o&&r.insert(o,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Re.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new 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(o=>{let[u,d]=o;this.query(u,Re.BLOCK&Re.BLOT)!=null?r=u:s[u]=d});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,n||void 0);const i=a.length();return Object.entries(s).forEach(o=>{let[u,d]=o;a.formatAt(0,i,u,d)}),a}}_e(ii,"blotName","scroll"),_e(ii,"className","ql-editor"),_e(ii,"tagName","DIV"),_e(ii,"defaultChild",fn),_e(ii,"allowedChildren",[fn,or,za]);function Zc(t,e,n){n.reduce((r,s)=>{const a=ur.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;t.insertAt(r,o);const[u]=t.descendant(Tn,r),d=sr(u);i=ur.AttributeMap.diff(d,i)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(t.insertAt(r,o,s.insert[o]),t.scroll.query(o,Re.INLINE)!=null){const[d]=t.descendant(Tn,r),h=sr(d);i=ur.AttributeMap.diff(h,i)||{}}}}return Object.keys(i).forEach(o=>{t.formatAt(r,a,o,i[o])}),r+a},e)}const qh={scope:Re.BLOCK,whitelist:["right","center","justify"]},fL=new ns("align","align",qh),Kb=new Mr("align","ql-align",qh),Vb=new Zs("align","text-align",qh);class Xb 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 hL=new Mr("color","ql-color",{scope:Re.INLINE}),jh=new Xb("color","color",{scope:Re.INLINE}),pL=new Mr("background","ql-bg",{scope:Re.INLINE}),$h=new Xb("background","background-color",{scope:Re.INLINE});class Wa extends za{static create(e){const n=super.create(e);return n.setAttribute("spellcheck","false"),n}code(e,n){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
91
93
  `).slice(e,e+n)}html(e,n){return`<pre>
92
94
  ${ec(this.code(e,n))}
93
- </pre>`}}class _n extends fn{static register(){ie.register(Wa)}}_e(_n,"TAB"," ");class Yh extends rs{}Yh.blotName="code";Yh.tagName="CODE";_n.blotName="code-block";_n.className="ql-code-block";_n.tagName="DIV";Wa.blotName="code-block-container";Wa.className="ql-code-block-container";Wa.tagName="DIV";Wa.allowedChildren=[_n];_n.allowedChildren=[xr,Br,Bi];_n.requiredContainer=Wa;const zh={scope:Re.BLOCK,whitelist:["rtl"]},Kb=new ns("direction","dir",zh),Vb=new Mr("direction","ql-direction",zh),Xb=new Zs("direction","direction",zh),Qb={scope:Re.INLINE,whitelist:["serif","monospace"]},Zb=new Mr("font","ql-font",Qb);class fL extends Zs{value(e){return super.value(e).replace(/["']/g,"")}}const Jb=new fL("font","font-family",Qb),ev=new Mr("size","ql-size",{scope:Re.INLINE,whitelist:["small","large","huge"]}),tv=new Zs("size","font-size",{scope:Re.INLINE,whitelist:["10px","18px","32px"]}),hL=Ns("quill:keyboard"),pL=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class tc extends Fr{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=gL(e);if(s==null){hL.warn("Attempted to add invalid keyboard binding",s);return}typeof n=="function"&&(n={handler:n}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(i=>{const o={...s,key:i,...n,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(E=>tc.match(e,E));if(s.length===0)return;const a=ie.find(e.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;const[o,u]=this.quill.getLine(i.index),[d,h]=this.quill.getLeaf(i.index),[g,f]=i.length===0?[d,h]:this.quill.getLeaf(i.index+i.length),m=d instanceof Il?d.value().slice(0,h):"",b=g instanceof Il?g.value().slice(f):"",_={collapsed:i.length===0,empty:i.length===0&&o.length()<=1,format:this.quill.getFormat(i),line:o,offset:u,prefix:m,suffix:b,event:e};s.some(E=>{if(E.collapsed!=null&&E.collapsed!==_.collapsed||E.empty!=null&&E.empty!==_.empty||E.offset!=null&&E.offset!==_.offset)return!1;if(Array.isArray(E.format)){if(E.format.every(C=>_.format[C]==null))return!1}else if(typeof E.format=="object"&&!Object.keys(E.format).every(C=>E.format[C]===!0?_.format[C]!=null:E.format[C]===!1?_.format[C]==null:Bh(E.format[C],_.format[C])))return!1;return E.prefix!=null&&!E.prefix.test(_.prefix)||E.suffix!=null&&!E.suffix.test(_.suffix)?!1:E.handler.call(this,i,_,E)!==!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[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const d=a.formats(),h=this.quill.getFormat(e.index-1,1);if(s=ur.AttributeMap.diff(d,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,ie.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[o]=this.quill.getLine(e.index+1);if(o){const u=a.formats(),d=this.quill.getFormat(e.index,1);s=ur.AttributeMap.diff(u,d)||{},Object.keys(s).length>0&&(i=i.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(i,ie.sources.USER),this.quill.focus()}handleDeleteRange(e){Wh({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,n){const r=Object.keys(n.format).reduce((a,i)=>(this.quill.scroll.query(i,Re.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new Oe().retain(e.index).delete(e.length).insert(`
94
- `,r);this.quill.updateContents(s,ie.sources.USER),this.quill.setSelection(e.index+1,ie.sources.SILENT),this.quill.focus()}}const mL={bindings:{bold:Jc("bold"),italic:Jc("italic"),underline:Jc("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",ie.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",ie.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",ie.sources.USER):e.format.list!=null&&this.quill.format("list",!1,ie.sources.USER)}},"indent code-block":n1(!0),"outdent code-block":n1(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,ie.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,ie.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,ie.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,ie.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,ie.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(`
95
+ </pre>`}}class _n extends fn{static register(){ie.register(Wa)}}_e(_n,"TAB"," ");class Yh extends rs{}Yh.blotName="code";Yh.tagName="CODE";_n.blotName="code-block";_n.className="ql-code-block";_n.tagName="DIV";Wa.blotName="code-block-container";Wa.className="ql-code-block-container";Wa.tagName="DIV";Wa.allowedChildren=[_n];_n.allowedChildren=[xr,Br,Bi];_n.requiredContainer=Wa;const zh={scope:Re.BLOCK,whitelist:["rtl"]},Qb=new ns("direction","dir",zh),Zb=new Mr("direction","ql-direction",zh),Jb=new Zs("direction","direction",zh),ev={scope:Re.INLINE,whitelist:["serif","monospace"]},tv=new Mr("font","ql-font",ev);class mL extends Zs{value(e){return super.value(e).replace(/["']/g,"")}}const nv=new mL("font","font-family",ev),rv=new Mr("size","ql-size",{scope:Re.INLINE,whitelist:["small","large","huge"]}),sv=new Zs("size","font-size",{scope:Re.INLINE,whitelist:["10px","18px","32px"]}),gL=Ns("quill:keyboard"),bL=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class tc extends Fr{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=EL(e);if(s==null){gL.warn("Attempted to add invalid keyboard binding",s);return}typeof n=="function"&&(n={handler:n}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(i=>{const o={...s,key:i,...n,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(E=>tc.match(e,E));if(s.length===0)return;const a=ie.find(e.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;const[o,u]=this.quill.getLine(i.index),[d,h]=this.quill.getLeaf(i.index),[g,f]=i.length===0?[d,h]:this.quill.getLeaf(i.index+i.length),m=d instanceof Il?d.value().slice(0,h):"",b=g instanceof Il?g.value().slice(f):"",_={collapsed:i.length===0,empty:i.length===0&&o.length()<=1,format:this.quill.getFormat(i),line:o,offset:u,prefix:m,suffix:b,event:e};s.some(E=>{if(E.collapsed!=null&&E.collapsed!==_.collapsed||E.empty!=null&&E.empty!==_.empty||E.offset!=null&&E.offset!==_.offset)return!1;if(Array.isArray(E.format)){if(E.format.every(C=>_.format[C]==null))return!1}else if(typeof E.format=="object"&&!Object.keys(E.format).every(C=>E.format[C]===!0?_.format[C]!=null:E.format[C]===!1?_.format[C]==null:Bh(E.format[C],_.format[C])))return!1;return E.prefix!=null&&!E.prefix.test(_.prefix)||E.suffix!=null&&!E.suffix.test(_.suffix)?!1:E.handler.call(this,i,_,E)!==!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[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const d=a.formats(),h=this.quill.getFormat(e.index-1,1);if(s=ur.AttributeMap.diff(d,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,ie.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[o]=this.quill.getLine(e.index+1);if(o){const u=a.formats(),d=this.quill.getFormat(e.index,1);s=ur.AttributeMap.diff(u,d)||{},Object.keys(s).length>0&&(i=i.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(i,ie.sources.USER),this.quill.focus()}handleDeleteRange(e){Wh({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,n){const r=Object.keys(n.format).reduce((a,i)=>(this.quill.scroll.query(i,Re.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new Oe().retain(e.index).delete(e.length).insert(`
96
+ `,r);this.quill.updateContents(s,ie.sources.USER),this.quill.setSelection(e.index+1,ie.sources.SILENT),this.quill.focus()}}const vL={bindings:{bold:Jc("bold"),italic:Jc("italic"),underline:Jc("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",ie.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",ie.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",ie.sources.USER):e.format.list!=null&&this.quill.format("list",!1,ie.sources.USER)}},"indent code-block":n1(!0),"outdent code-block":n1(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,ie.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,ie.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,ie.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,ie.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,ie.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(`
95
97
  `,r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,ie.sources.USER),this.quill.setSelection(t.index+1,ie.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(`
96
- `,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,ie.sources.USER),this.quill.setSelection(t.index+1,ie.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=bL(n,r,s,a);if(i==null)return;let o=n.offset();if(i<0){const u=new Oe().retain(o).insert(`
98
+ `,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,ie.sources.USER),this.quill.setSelection(t.index+1,ie.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=TL(n,r,s,a);if(i==null)return;let o=n.offset();if(i<0){const u=new Oe().retain(o).insert(`
97
99
  `);this.quill.updateContents(u,ie.sources.USER),this.quill.setSelection(t.index+1,t.length,ie.sources.SILENT)}else if(i>0){o+=n.length();const u=new Oe().retain(o).insert(`
98
- `);this.quill.updateContents(u,ie.sources.USER),this.quill.setSelection(o,ie.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,ie.sources.USER):this.quill.setSelection(s+r.length(),ie.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," ",ie.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,ie.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,ie.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,ie.sources.USER),this.quill.setSelection(t.index-1,ie.sources.SILENT),!1}return!0}},"embed left":$u("ArrowLeft",!1),"embed left shift":$u("ArrowLeft",!0),"embed right":$u("ArrowRight",!1),"embed right shift":$u("ArrowRight",!0),"table down":r1(!1),"table up":r1(!0)}};tc.DEFAULTS=mL;function n1(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,ie.sources.USER),this.quill.setSelection(e.index+a.length,ie.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:u}=e;i.forEach((d,h)=>{t?(d.insertAt(0,a),h===0?o+=a.length:u+=a.length):d.domNode.textContent.startsWith(a)&&(d.deleteAt(0,a.length),h===0?o-=a.length:u-=a.length)}),this.quill.update(ie.sources.USER),this.quill.setSelection(o,u,ie.sources.SILENT)}}}function $u(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 Vn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,ie.sources.USER):this.quill.setSelection(r.index-1,ie.sources.USER):e?this.quill.setSelection(r.index,r.length+1,ie.sources.USER):this.quill.setSelection(r.index+r.length+1,ie.sources.USER),!1):!0}}}function Jc(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],ie.sources.USER)}}}function r1(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const r=t?"prev":"next",s=n.line,a=s.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let i=a.children.head,o=s;for(;o.prev!=null;)o=o.prev,i=i.next;const u=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(u,0,ie.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,ie.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,ie.sources.USER))}return!1}}}function gL(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=pi(t);else return null;return t.shortKey&&(t[pL]=t.shortKey,delete t.shortKey),t}function Wh(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=ur.AttributeMap.diff(i,a)||{}}e.deleteText(n,ie.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,ie.sources.USER),e.setSelection(n.index,ie.sources.SILENT)}function bL(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 vL=/font-weight:\s*normal/,EL=["P","OL","UL"],s1=t=>t&&EL.includes(t.tagName),TL=t=>{Array.from(t.querySelectorAll("br")).filter(e=>s1(e.previousElementSibling)&&s1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},_L=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(vL)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function AL(t){t.querySelector('[id^="docs-internal-guid-"]')&&(_L(t),TL(t))}const yL=/\bmso-list:[^;]*ignore/i,NL=/\bmso-list:[^;]*\bl(\d+)/i,SL=/\bmso-list:[^;]*\blevel(\d+)/i,wL=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(NL);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(SL),i=a?Number(a[1]):1,o=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=e.match(o),d=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:d,element:t}},IL=t=>{var i,o;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(u=>{(u.getAttribute("style")||"").match(yL)?n.push(u):r.push(u)}),n.forEach(u=>{var d;return(d=u.parentNode)==null?void 0:d.removeChild(u)});const s=t.documentElement.innerHTML,a=r.map(u=>wL(u,s)).filter(u=>u);for(;a.length;){const u=[];let d=a.shift();for(;d;)u.push(d),d=a.length&&((i=a[0])==null?void 0:i.element)===d.element.nextElementSibling&&a[0].id===d.id?a.shift():null;const h=document.createElement("ul");u.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=(o=u[0])==null?void 0:o.element,{parentNode:f}=g??{};g&&(f==null||f.replaceChild(h,g)),u.slice(1).forEach(m=>{let{element:b}=m;f==null||f.removeChild(b)})}};function CL(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&IL(t)}const LL=[CL,AL],OL=t=>{t.documentElement&&LL.forEach(e=>{e(t)})},xL=Ns("quill:clipboard"),RL=[[Node.TEXT_NODE,YL],[Node.TEXT_NODE,i1],["br",BL],[Node.ELEMENT_NODE,i1],[Node.ELEMENT_NODE,ML],[Node.ELEMENT_NODE,PL],[Node.ELEMENT_NODE,jL],["li",HL],["ol, ul",qL],["pre",FL],["tr",$L],["b",ed("bold")],["i",ed("italic")],["strike",ed("strike")],["style",UL]],DL=[lL,Kb].reduce((t,e)=>(t[e.keyName]=e,t),{}),a1=[Wb,$h,jh,Xb,Jb,tv].reduce((t,e)=>(t[e.keyName]=e,t),{});class nv extends Fr{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=[],RL.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[_n.blotName])return new Oe().insert(r||"",{[_n.blotName]:s[_n.blotName]});if(!n)return new Oe().insert(r||"",s);const a=this.convertHTML(n);return cu(a,`
99
- `)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new Oe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){OL(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 Gh(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ie.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,ie.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(),ie.sources.SILENT)}}onCaptureCopy(e){var i,o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:a}=this.onCopy(r,n);(i=e.clipboardData)==null||i.setData("text/plain",a),(o=e.clipboardData)==null||o.setData("text/html",s),n&&Wh({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
100
- `)}onCapturePaste(e){var i,o,u,d,h;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const n=this.quill.getSelection(!0);if(n==null)return;const r=(i=e.clipboardData)==null?void 0:i.getData("text/html");let s=(o=e.clipboardData)==null?void 0:o.getData("text/plain");if(!r&&!s){const g=(u=e.clipboardData)==null?void 0:u.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!r&&a.length>0){this.quill.uploader.upload(n,a);return}if(r&&a.length>0){const g=new DOMParser().parseFromString(r,"text/html");if(g.body.childElementCount===1&&((h=g.body.firstElementChild)==null?void 0:h.tagName)==="IMG"){this.quill.uploader.upload(n,a);return}}this.onPaste(n,{html:r,text:s})}onCopy(e){const n=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:n}}onPaste(e,n){let{text:r,html:s}=n;const a=this.quill.getFormat(e.index),i=this.convert({text:r,html:s},a);xL.log("onPaste",i,{text:r,html:s});const o=new Oe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,ie.sources.USER),this.quill.setSelection(o.length()-e.length,ie.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach(u=>{if(n.has(u)){const d=n.get(u);d==null||d.push(o)}else n.set(u,[o])});break}}),[r,s]}}_e(nv,"DEFAULTS",{matchers:[]});function Ga(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 cu(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 Us(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof Vn?!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 kL(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Us(t.previousElementSibling,e)&&!Us(t.nextElementSibling,e)}const Yu=new WeakMap;function rv(t){return t==null?!1:(Yu.has(t)||(t.tagName==="PRE"?Yu.set(t,!0):Yu.set(t,rv(t.parentNode))),Yu.get(t))}function Gh(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 o=Gh(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(o=n.reduce((u,d)=>d(i,u,t),o),o=(s.get(i)||[]).reduce((u,d)=>d(i,u,t),o)),a.concat(o)},new Oe):new Oe}function ed(t){return(e,n,r)=>Ga(n,t,!0,r)}function PL(t,e,n){const r=ns.keys(t),s=Mr.keys(t),a=Zs.keys(t),i={};return r.concat(s).concat(a).forEach(o=>{let u=n.query(o,Re.ATTRIBUTE);u!=null&&(i[u.attrName]=u.value(t),i[u.attrName])||(u=DL[o],u!=null&&(u.attrName===o||u.keyName===o)&&(i[u.attrName]=u.value(t)||void 0),u=a1[o],u!=null&&(u.attrName===o||u.keyName===o)&&(u=a1[o],i[u.attrName]=u.value(t)||void 0))}),Object.entries(i).reduce((o,u)=>{let[d,h]=u;return Ga(o,d,h,n)},e)}function ML(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Vn){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 jo&&!cu(e,`
100
+ `);this.quill.updateContents(u,ie.sources.USER),this.quill.setSelection(o,ie.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,ie.sources.USER):this.quill.setSelection(s+r.length(),ie.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," ",ie.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,ie.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,ie.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,ie.sources.USER),this.quill.setSelection(t.index-1,ie.sources.SILENT),!1}return!0}},"embed left":$u("ArrowLeft",!1),"embed left shift":$u("ArrowLeft",!0),"embed right":$u("ArrowRight",!1),"embed right shift":$u("ArrowRight",!0),"table down":r1(!1),"table up":r1(!0)}};tc.DEFAULTS=vL;function n1(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,ie.sources.USER),this.quill.setSelection(e.index+a.length,ie.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:u}=e;i.forEach((d,h)=>{t?(d.insertAt(0,a),h===0?o+=a.length:u+=a.length):d.domNode.textContent.startsWith(a)&&(d.deleteAt(0,a.length),h===0?o-=a.length:u-=a.length)}),this.quill.update(ie.sources.USER),this.quill.setSelection(o,u,ie.sources.SILENT)}}}function $u(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 Vn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,ie.sources.USER):this.quill.setSelection(r.index-1,ie.sources.USER):e?this.quill.setSelection(r.index,r.length+1,ie.sources.USER):this.quill.setSelection(r.index+r.length+1,ie.sources.USER),!1):!0}}}function Jc(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],ie.sources.USER)}}}function r1(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const r=t?"prev":"next",s=n.line,a=s.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let i=a.children.head,o=s;for(;o.prev!=null;)o=o.prev,i=i.next;const u=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(u,0,ie.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,ie.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,ie.sources.USER))}return!1}}}function EL(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=pi(t);else return null;return t.shortKey&&(t[bL]=t.shortKey,delete t.shortKey),t}function Wh(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=ur.AttributeMap.diff(i,a)||{}}e.deleteText(n,ie.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,ie.sources.USER),e.setSelection(n.index,ie.sources.SILENT)}function TL(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 _L=/font-weight:\s*normal/,AL=["P","OL","UL"],s1=t=>t&&AL.includes(t.tagName),yL=t=>{Array.from(t.querySelectorAll("br")).filter(e=>s1(e.previousElementSibling)&&s1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},NL=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(_L)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function SL(t){t.querySelector('[id^="docs-internal-guid-"]')&&(NL(t),yL(t))}const wL=/\bmso-list:[^;]*ignore/i,IL=/\bmso-list:[^;]*\bl(\d+)/i,CL=/\bmso-list:[^;]*\blevel(\d+)/i,LL=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(IL);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(CL),i=a?Number(a[1]):1,o=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=e.match(o),d=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:d,element:t}},OL=t=>{var i,o;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(u=>{(u.getAttribute("style")||"").match(wL)?n.push(u):r.push(u)}),n.forEach(u=>{var d;return(d=u.parentNode)==null?void 0:d.removeChild(u)});const s=t.documentElement.innerHTML,a=r.map(u=>LL(u,s)).filter(u=>u);for(;a.length;){const u=[];let d=a.shift();for(;d;)u.push(d),d=a.length&&((i=a[0])==null?void 0:i.element)===d.element.nextElementSibling&&a[0].id===d.id?a.shift():null;const h=document.createElement("ul");u.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=(o=u[0])==null?void 0:o.element,{parentNode:f}=g??{};g&&(f==null||f.replaceChild(h,g)),u.slice(1).forEach(m=>{let{element:b}=m;f==null||f.removeChild(b)})}};function xL(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&OL(t)}const RL=[xL,SL],DL=t=>{t.documentElement&&RL.forEach(e=>{e(t)})},kL=Ns("quill:clipboard"),PL=[[Node.TEXT_NODE,GL],[Node.TEXT_NODE,i1],["br",HL],[Node.ELEMENT_NODE,i1],[Node.ELEMENT_NODE,UL],[Node.ELEMENT_NODE,FL],[Node.ELEMENT_NODE,zL],["li",$L],["ol, ul",YL],["pre",qL],["tr",WL],["b",ed("bold")],["i",ed("italic")],["strike",ed("strike")],["style",jL]],ML=[fL,Qb].reduce((t,e)=>(t[e.keyName]=e,t),{}),a1=[Vb,$h,jh,Jb,nv,sv].reduce((t,e)=>(t[e.keyName]=e,t),{});class av extends Fr{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=[],PL.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[_n.blotName])return new Oe().insert(r||"",{[_n.blotName]:s[_n.blotName]});if(!n)return new Oe().insert(r||"",s);const a=this.convertHTML(n);return cu(a,`
101
+ `)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new Oe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){DL(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 Gh(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ie.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,ie.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(),ie.sources.SILENT)}}onCaptureCopy(e){var i,o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:a}=this.onCopy(r,n);(i=e.clipboardData)==null||i.setData("text/plain",a),(o=e.clipboardData)==null||o.setData("text/html",s),n&&Wh({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
102
+ `)}onCapturePaste(e){var i,o,u,d,h;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const n=this.quill.getSelection(!0);if(n==null)return;const r=(i=e.clipboardData)==null?void 0:i.getData("text/html");let s=(o=e.clipboardData)==null?void 0:o.getData("text/plain");if(!r&&!s){const g=(u=e.clipboardData)==null?void 0:u.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!r&&a.length>0){this.quill.uploader.upload(n,a);return}if(r&&a.length>0){const g=new DOMParser().parseFromString(r,"text/html");if(g.body.childElementCount===1&&((h=g.body.firstElementChild)==null?void 0:h.tagName)==="IMG"){this.quill.uploader.upload(n,a);return}}this.onPaste(n,{html:r,text:s})}onCopy(e){const n=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:n}}onPaste(e,n){let{text:r,html:s}=n;const a=this.quill.getFormat(e.index),i=this.convert({text:r,html:s},a);kL.log("onPaste",i,{text:r,html:s});const o=new Oe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,ie.sources.USER),this.quill.setSelection(o.length()-e.length,ie.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach(u=>{if(n.has(u)){const d=n.get(u);d==null||d.push(o)}else n.set(u,[o])});break}}),[r,s]}}_e(av,"DEFAULTS",{matchers:[]});function Ga(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 cu(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 Us(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof Vn?!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 BL(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Us(t.previousElementSibling,e)&&!Us(t.nextElementSibling,e)}const Yu=new WeakMap;function iv(t){return t==null?!1:(Yu.has(t)||(t.tagName==="PRE"?Yu.set(t,!0):Yu.set(t,iv(t.parentNode))),Yu.get(t))}function Gh(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 o=Gh(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(o=n.reduce((u,d)=>d(i,u,t),o),o=(s.get(i)||[]).reduce((u,d)=>d(i,u,t),o)),a.concat(o)},new Oe):new Oe}function ed(t){return(e,n,r)=>Ga(n,t,!0,r)}function FL(t,e,n){const r=ns.keys(t),s=Mr.keys(t),a=Zs.keys(t),i={};return r.concat(s).concat(a).forEach(o=>{let u=n.query(o,Re.ATTRIBUTE);u!=null&&(i[u.attrName]=u.value(t),i[u.attrName])||(u=ML[o],u!=null&&(u.attrName===o||u.keyName===o)&&(i[u.attrName]=u.value(t)||void 0),u=a1[o],u!=null&&(u.attrName===o||u.keyName===o)&&(u=a1[o],i[u.attrName]=u.value(t)||void 0))}),Object.entries(i).reduce((o,u)=>{let[d,h]=u;return Ga(o,d,h,n)},e)}function UL(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Vn){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 jo&&!cu(e,`
101
103
  `)&&e.insert(`
102
- `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Ga(e,r.blotName,r.formats(t,n),n);return e}function BL(t,e){return cu(e,`
104
+ `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Ga(e,r.blotName,r.formats(t,n),n);return e}function HL(t,e){return cu(e,`
103
105
  `)||e.insert(`
104
- `),e}function FL(t,e,n){const r=n.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(t,n):!0;return Ga(e,"code-block",s,n)}function UL(){return new Oe}function HL(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!cu(e,`
105
- `))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,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?i.push(o):i.insert(o.insert,{indent:s,...o.attributes||{}}):i,new Oe)}function qL(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"),Ga(e,"list",s,n)}function i1(t,e,n){if(!cu(e,`
106
+ `),e}function qL(t,e,n){const r=n.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(t,n):!0;return Ga(e,"code-block",s,n)}function jL(){return new Oe}function $L(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!cu(e,`
107
+ `))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,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?i.push(o):i.insert(o.insert,{indent:s,...o.attributes||{}}):i,new Oe)}function YL(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"),Ga(e,"list",s,n)}function i1(t,e,n){if(!cu(e,`
106
108
  `)){if(Us(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert(`
107
109
  `);if(e.length()>0&&t.nextSibling){let r=t.nextSibling;for(;r!=null;){if(Us(r,n))return e.insert(`
108
110
  `);const s=n.query(r);if(s&&s.prototype instanceof or)return e.insert(`
109
- `);r=r.firstChild}}}return e}function jL(t,e,n){var a;const r={},s=t.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),((a=s.fontWeight)!=null&&a.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,o)=>{let[u,d]=o;return Ga(i,u,d,n)},e),parseFloat(s.textIndent||0)>0?new Oe().insert(" ").concat(e):e}function $L(t,e,n){var s,a;const r=((s=t.parentElement)==null?void 0:s.tagName)==="TABLE"?t.parentElement:(a=t.parentElement)==null?void 0:a.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return Ga(e,"table",o,n)}return e}function YL(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(!rv(t)){if(r.trim().length===0&&r.includes(`
110
- `)&&!kL(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&Us(t.parentElement,n)||t.previousSibling instanceof Element&&Us(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&Us(t.parentElement,n)||t.nextSibling instanceof Element&&Us(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class sv extends Fr{constructor(n,r){super(n,r);_e(this,"lastRecorded",0);_e(this,"ignoreChange",!1);_e(this,"stack",{undo:[],redo:[]});_e(this,"currentRange",null);this.quill.on(ie.events.EDITOR_CHANGE,(s,a,i,o)=>{s===ie.events.SELECTION_CHANGE?a&&o!==ie.sources.SILENT&&(this.currentRange=a):s===ie.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===ie.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=Nf(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:Nf(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,ie.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(n,r){if(n.ops.length===0)return;this.stack.redo=[];let s=n.invert(r),a=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),a=o.range)}else this.lastRecorded=i;s.length()!==0&&(this.stack.undo.push({delta:s,range:a}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(n){o1(this.stack.undo,n),o1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,ie.sources.USER);else{const r=WL(this.quill.scroll,n.delta);this.quill.setSelection(r,ie.sources.USER)}}}_e(sv,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function o1(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&&Nf(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function zL(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
111
- `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Re.BLOCK)!=null):!1}function WL(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return zL(t,e)&&(r-=1),r}function Nf(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 av extends Fr{constructor(e,n){super(e,n),e.root.addEventListener("drop",r=>{var i;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const o=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(o,r.dataTransfer.files)}})}upload(e,n){const r=[];Array.from(n).forEach(s=>{var a;s&&((a=this.options.mimetypes)!=null&&a.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}av.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,Ce.sources.USER),this.quill.setSelection(t.index+r.length,Ce.sources.SILENT)})}};const GL=["insertText","insertReplacementText"];class KL extends Fr{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(ie.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Wh({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),ie.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,ie.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!GL.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=VL(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 VL(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 XL=/Mac/i.test(navigator.platform),QL=100,ZL=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||XL&&t.key==="a"&&t.ctrlKey===!0);class JL extends Fr{constructor(n,r){super(n,r);_e(this,"isListening",!1);_e(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 Lr)||!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),ie.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&ZL(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+QL,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 Lr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}ie.register({"blots/block":fn,"blots/block/embed":or,"blots/break":Br,"blots/container":za,"blots/cursor":Bi,"blots/embed":Hh,"blots/inline":rs,"blots/scroll":ii,"blots/text":xr,"modules/clipboard":nv,"modules/history":sv,"modules/keyboard":tc,"modules/uploader":av,"modules/input":KL,"modules/uiNode":JL});class eO extends Mr{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 tO=new eO("indent","ql-indent",{scope:Re.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Sf extends fn{}_e(Sf,"blotName","blockquote"),_e(Sf,"tagName","blockquote");class wf extends fn{static formats(e){return this.tagName.indexOf(e.tagName)+1}}_e(wf,"blotName","header"),_e(wf,"tagName",["H1","H2","H3","H4","H5","H6"]);class du extends za{}du.blotName="list-container";du.tagName="OL";class fu extends fn{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(){ie.register(du)}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)}}fu.blotName="list";fu.tagName="LI";du.allowedChildren=[fu];fu.requiredContainer=du;class Yo extends rs{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)}}_e(Yo,"blotName","bold"),_e(Yo,"tagName",["STRONG","B"]);class If extends Yo{}_e(If,"blotName","italic"),_e(If,"tagName",["EM","I"]);class Hs extends rs{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 iv(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))}}_e(Hs,"blotName","link"),_e(Hs,"tagName","A"),_e(Hs,"SANITIZED_URL","about:blank"),_e(Hs,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function iv(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 Cf extends rs{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"}}_e(Cf,"blotName","script"),_e(Cf,"tagName",["SUB","SUP"]);class Lf extends Yo{}_e(Lf,"blotName","strike"),_e(Lf,"tagName",["S","STRIKE"]);class Of extends rs{}_e(Of,"blotName","underline"),_e(Of,"tagName","U");class rl extends Hh{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>`}}_e(rl,"blotName","formula"),_e(rl,"className","ql-formula"),_e(rl,"tagName","SPAN");const u1=["alt","height","width"];class xf extends Vn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return u1.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 iv(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){u1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}_e(xf,"blotName","image"),_e(xf,"tagName","IMG");const l1=["height","width"];class sl 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 l1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Hs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){l1.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>`}}_e(sl,"blotName","video"),_e(sl,"className","ql-video"),_e(sl,"tagName","IFRAME");const ho=new Mr("code-token","hljs",{scope:Re.INLINE});class _s extends rs{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(_n.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),ho.add(this.domNode,r)}format(e,n){e!==_s.blotName?super.format(e,n):n?ho.add(this.domNode,n):(ho.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),ho.value(this.domNode)||this.unwrap()}}_s.blotName="code-token";_s.className="ql-token";class ar extends _n{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(),_s.blotName,!1),super.replaceWith(e,n)}}class wo extends Wa{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===ar.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===ar.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(`
111
+ `);r=r.firstChild}}}return e}function zL(t,e,n){var a;const r={},s=t.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),((a=s.fontWeight)!=null&&a.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,o)=>{let[u,d]=o;return Ga(i,u,d,n)},e),parseFloat(s.textIndent||0)>0?new Oe().insert(" ").concat(e):e}function WL(t,e,n){var s,a;const r=((s=t.parentElement)==null?void 0:s.tagName)==="TABLE"?t.parentElement:(a=t.parentElement)==null?void 0:a.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return Ga(e,"table",o,n)}return e}function GL(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(!iv(t)){if(r.trim().length===0&&r.includes(`
112
+ `)&&!BL(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&Us(t.parentElement,n)||t.previousSibling instanceof Element&&Us(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&Us(t.parentElement,n)||t.nextSibling instanceof Element&&Us(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class ov extends Fr{constructor(n,r){super(n,r);_e(this,"lastRecorded",0);_e(this,"ignoreChange",!1);_e(this,"stack",{undo:[],redo:[]});_e(this,"currentRange",null);this.quill.on(ie.events.EDITOR_CHANGE,(s,a,i,o)=>{s===ie.events.SELECTION_CHANGE?a&&o!==ie.sources.SILENT&&(this.currentRange=a):s===ie.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===ie.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=Nf(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:Nf(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,ie.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(n,r){if(n.ops.length===0)return;this.stack.redo=[];let s=n.invert(r),a=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),a=o.range)}else this.lastRecorded=i;s.length()!==0&&(this.stack.undo.push({delta:s,range:a}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(n){o1(this.stack.undo,n),o1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,ie.sources.USER);else{const r=VL(this.quill.scroll,n.delta);this.quill.setSelection(r,ie.sources.USER)}}}_e(ov,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function o1(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&&Nf(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function KL(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
113
+ `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Re.BLOCK)!=null):!1}function VL(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return KL(t,e)&&(r-=1),r}function Nf(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 uv extends Fr{constructor(e,n){super(e,n),e.root.addEventListener("drop",r=>{var i;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const o=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(o,r.dataTransfer.files)}})}upload(e,n){const r=[];Array.from(n).forEach(s=>{var a;s&&((a=this.options.mimetypes)!=null&&a.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}uv.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,Ce.sources.USER),this.quill.setSelection(t.index+r.length,Ce.sources.SILENT)})}};const XL=["insertText","insertReplacementText"];class QL extends Fr{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(ie.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Wh({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),ie.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,ie.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!XL.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=ZL(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 ZL(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 JL=/Mac/i.test(navigator.platform),eO=100,tO=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||JL&&t.key==="a"&&t.ctrlKey===!0);class nO extends Fr{constructor(n,r){super(n,r);_e(this,"isListening",!1);_e(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 Lr)||!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),ie.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&tO(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+eO,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 Lr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}ie.register({"blots/block":fn,"blots/block/embed":or,"blots/break":Br,"blots/container":za,"blots/cursor":Bi,"blots/embed":Hh,"blots/inline":rs,"blots/scroll":ii,"blots/text":xr,"modules/clipboard":av,"modules/history":ov,"modules/keyboard":tc,"modules/uploader":uv,"modules/input":QL,"modules/uiNode":nO});class rO extends Mr{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 sO=new rO("indent","ql-indent",{scope:Re.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Sf extends fn{}_e(Sf,"blotName","blockquote"),_e(Sf,"tagName","blockquote");class wf extends fn{static formats(e){return this.tagName.indexOf(e.tagName)+1}}_e(wf,"blotName","header"),_e(wf,"tagName",["H1","H2","H3","H4","H5","H6"]);class du extends za{}du.blotName="list-container";du.tagName="OL";class fu extends fn{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(){ie.register(du)}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)}}fu.blotName="list";fu.tagName="LI";du.allowedChildren=[fu];fu.requiredContainer=du;class Yo extends rs{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)}}_e(Yo,"blotName","bold"),_e(Yo,"tagName",["STRONG","B"]);class If extends Yo{}_e(If,"blotName","italic"),_e(If,"tagName",["EM","I"]);class Hs extends rs{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 lv(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))}}_e(Hs,"blotName","link"),_e(Hs,"tagName","A"),_e(Hs,"SANITIZED_URL","about:blank"),_e(Hs,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function lv(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 Cf extends rs{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"}}_e(Cf,"blotName","script"),_e(Cf,"tagName",["SUB","SUP"]);class Lf extends Yo{}_e(Lf,"blotName","strike"),_e(Lf,"tagName",["S","STRIKE"]);class Of extends rs{}_e(Of,"blotName","underline"),_e(Of,"tagName","U");class rl extends Hh{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>`}}_e(rl,"blotName","formula"),_e(rl,"className","ql-formula"),_e(rl,"tagName","SPAN");const u1=["alt","height","width"];class xf extends Vn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return u1.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 lv(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){u1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}_e(xf,"blotName","image"),_e(xf,"tagName","IMG");const l1=["height","width"];class sl 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 l1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Hs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){l1.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>`}}_e(sl,"blotName","video"),_e(sl,"className","ql-video"),_e(sl,"tagName","IFRAME");const ho=new Mr("code-token","hljs",{scope:Re.INLINE});class _s extends rs{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(_n.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),ho.add(this.domNode,r)}format(e,n){e!==_s.blotName?super.format(e,n):n?ho.add(this.domNode,n):(ho.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),ho.value(this.domNode)||this.unwrap()}}_s.blotName="code-token";_s.className="ql-token";class ar extends _n{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(),_s.blotName,!1),super.replaceWith(e,n)}}class wo extends Wa{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===ar.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===ar.blotName&&(this.forceNext=!0),super.formatAt(e,n,r,s)}highlight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(i=>i!==this.uiNode).map(i=>i.textContent).join(`
112
114
  `)}
113
- `,a=ar.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((u,d)=>u.concat($b(d,!1)),new Oe),o=e(s,a);i.diff(o).reduce((u,d)=>{let{retain:h,attributes:g}=d;return h?(g&&Object.keys(g).forEach(f=>{[ar.blotName,_s.blotName].includes(f)&&this.formatAt(u,h,f,g[f])}),u+h):u},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?ar.formats(r.domNode):"plain"}">
115
+ `,a=ar.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((u,d)=>u.concat(Wb(d,!1)),new Oe),o=e(s,a);i.diff(o).reduce((u,d)=>{let{retain:h,attributes:g}=d;return h?(g&&Object.keys(g).forEach(f=>{[ar.blotName,_s.blotName].includes(f)&&this.formatAt(u,h,f,g[f])}),u+h):u},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?ar.formats(r.domNode):"plain"}">
114
116
  ${ec(this.code(e,n))}
115
- </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=ar.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}wo.allowedChildren=[ar];ar.requiredContainer=wo;ar.allowedChildren=[_s,Bi,xr,Br];const nO=(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 ov extends Fr{static register(){ie.register(_s,!0),ie.register(ar,!0),ie.register(wo,!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(ie.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof wo))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(ar.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=ar.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(ie.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(ie.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(wo):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(ie.sources.SILENT),r!=null&&this.quill.setSelection(r,ie.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 ec(e).split(`
117
+ </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=ar.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}wo.allowedChildren=[ar];ar.requiredContainer=wo;ar.allowedChildren=[_s,Bi,xr,Br];const aO=(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 cv extends Fr{static register(){ie.register(_s,!0),ie.register(ar,!0),ie.register(wo,!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(ie.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof wo))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(ar.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=ar.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(ie.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(ie.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(wo):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(ie.sources.SILENT),r!=null&&this.quill.setSelection(r,ie.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 ec(e).split(`
116
118
  `).reduce((s,a,i)=>(i!==0&&s.insert(`
117
- `,{[_n.blotName]:n}),s.insert(a)),new Oe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(_n.className),r.innerHTML=nO(this.options.hljs,n,e),Gh(this.quill.scroll,r,[(s,a)=>{const i=ho.value(s);return i?a.compose(new Oe().retain(a.length(),{[_s.blotName]:i})):a}],[(s,a)=>s.data.split(`
119
+ `,{[_n.blotName]:n}),s.insert(a)),new Oe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(_n.className),r.innerHTML=aO(this.options.hljs,n,e),Gh(this.quill.scroll,r,[(s,a)=>{const i=ho.value(s);return i?a.compose(new Oe().retain(a.length(),{[_s.blotName]:i})):a}],[(s,a)=>s.data.split(`
118
120
  `).reduce((i,o,u)=>(u!==0&&i.insert(`
119
- `,{[_n.blotName]:n}),i.insert(o)),a)],new WeakMap)}}ov.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 Lo=class Lo extends fn{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",Kh()),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===Lo.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()}};_e(Lo,"blotName","table"),_e(Lo,"tagName","TD");let Nr=Lo;class As extends za{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}}_e(As,"blotName","table-row"),_e(As,"tagName","TR");class Zr extends za{}_e(Zr,"blotName","table-body"),_e(Zr,"tagName","TBODY");class Ui extends za{balanceCells(){const e=this.descendants(As),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=Nr.formats(r.children.head.domNode));const a=this.scroll.create(Nr.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(Zr);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(Zr);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=Nr.formats(r.children.head.domNode),i=this.scroll.create(Nr.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(Zr);if(n==null||n.children.head==null)return;const r=Kh(),s=this.scroll.create(As.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(Nr.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)}}_e(Ui,"blotName","table-container"),_e(Ui,"tagName","TABLE");Ui.allowedChildren=[Zr];Zr.requiredContainer=Ui;Zr.allowedChildren=[As];As.requiredContainer=Zr;As.allowedChildren=[Nr];Nr.requiredContainer=As;function Kh(){return`row-${Math.random().toString(36).slice(2,6)}`}class rO extends Fr{static register(){ie.register(Nr),ie.register(As),ie.register(Zr),ie.register(Ui)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ui).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(ie.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(ie.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(ie.sources.USER),this.quill.setSelection(n,ie.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!==Nr.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(ie.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(n.index+o,n.length,ie.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(ie.sources.USER),e>0?this.quill.setSelection(n,ie.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,ie.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(`
120
- `).join("");return a.insert(i,{table:Kh()})},new Oe().retain(r.index));this.quill.updateContents(s,ie.sources.USER),this.quill.setSelection(r.index,ie.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(ie.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(ie.events.TEXT_CHANGE,(r,s,a)=>{a===ie.sources.USER&&this.balanceTables()}),!0):!1)})}}const c1=Ns("quill:toolbar");class Vh extends Fr{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),sO(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)){c1.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(a=>{var o;const i=(o=this.options.handlers)==null?void 0:o[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(ie.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){c1.warn("ignoring attaching to nonexistent format",n,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof Vn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new Oe().retain(i.index).delete(i.length).insert({[n]:a}),ie.sources.USER)}else this.quill.format(n,a,ie.sources.USER);this.update(i)}),this.controls.push([n,e])}update(e){const n=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let i=null;if(e==null)i=null;else if(n[s]==null)i=a.querySelector("option[selected]");else if(!Array.isArray(n[s])){let o=n[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${o}"]`)}i==null?(a.value="",a.selectedIndex=-1):i.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const i=n[s],o=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}Vh.DEFAULTS={};function d1(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 sO(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")d1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?aO(r,a,i):d1(r,a,i)}}),t.appendChild(r)})}function aO(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)}Vh.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t!=null)if(t.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(n=>{this.quill.scroll.query(n,Re.INLINE)!=null&&this.quill.format(n,!1,ie.sources.USER)})}else this.quill.removeFormat(t.index,t.length,ie.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",ie.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,ie.sources.USER),this.quill.format("direction",t,ie.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,ie.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,ie.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,ie.sources.USER):this.quill.format("list","unchecked",ie.sources.USER):this.quill.format("list",t,ie.sources.USER)}}};const iO='<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>',oO='<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>',uO='<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>',lO='<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>',cO='<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>',dO='<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>',fO='<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>',hO='<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>',f1='<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>',pO='<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>',mO='<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>',gO='<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>',bO='<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>',vO='<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>',EO='<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>',TO='<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>',_O='<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>',AO='<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>',yO='<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>',NO='<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>',SO='<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>',wO='<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>',IO='<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>',CO='<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>',LO='<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>',OO='<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>',xO='<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>',RO='<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>',DO='<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>',kO='<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>',PO='<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>',MO='<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>',BO='<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>',zo={align:{"":iO,center:oO,right:uO,justify:lO},background:cO,blockquote:dO,bold:fO,clean:hO,code:f1,"code-block":f1,color:pO,direction:{"":mO,rtl:gO},formula:bO,header:{1:vO,2:EO,3:TO,4:_O,5:AO,6:yO},italic:NO,image:SO,indent:{"+1":wO,"-1":IO},link:CO,list:{bullet:LO,check:OO,ordered:xO},script:{sub:RO,super:DO},strike:kO,table:PO,underline:MO,video:BO},FO='<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 h1=0;function p1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class nc{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"),p1(this.label,"aria-expanded"),p1(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=FO,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-${h1}`,h1+=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 uv extends nc{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 lv extends nc{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 UO=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class cv{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,UO(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const n=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>s.right&&(i=s.right-a.right,this.root.style.left=`${n+i}px`),a.left<s.left&&(i=s.left-a.left,this.root.style.left=`${n+i}px`),a.bottom>s.bottom){const o=a.bottom-a.top,u=e.bottom-e.top+o;this.root.style.top=`${r-u}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const HO=[!1,"center","right","justify"],qO=["#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"],jO=[!1,"serif","monospace"],$O=["1","2","3",!1],YO=["small",!1,"large","huge"];class hu extends Fi{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&&ao(s,HO),typeof n.align=="object"))return new lv(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&&ao(s,qO,a==="background"?"#ffffff":"#000000"),new uv(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?ao(s,jO):s.classList.contains("ql-header")?ao(s,$O):s.classList.contains("ql-size")&&ao(s,YO)),new nc(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Ce.events.EDITOR_CHANGE,r)}}hu.DEFAULTS=zs({},Fi.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 dv extends cv{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,Ce.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Ce.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=zO(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,Ce.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Ce.sources.USER),this.quill.setSelection(r+2,Ce.sources.USER)}break}}this.textbox.value="",this.hide()}}function zO(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 ao(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 WO=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class fv extends dv{constructor(e,n){super(e,n),this.quill.on(Ce.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Ce.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Ce.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=o[o.length-1],d=this.quill.getIndex(u),h=Math.min(u.length()-1,s.index+s.length-d),g=this.quill.getBounds(new Pa(d,h));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Ce.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}}_e(fv,"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 hv extends hu{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=WO),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new fv(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),zo),this.buildPickers(e.container.querySelectorAll("select"),zo))}}hv.DEFAULTS=zs({},hu.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,ie.sources.USER)}}}}});const GO=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class pv extends dv{constructor(){super(...arguments);_e(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,Ce.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Ce.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Ce.sources.USER){const[a,i]=this.quill.scroll.descendant(Hs,n.index);if(a!=null){this.linkRange=new Pa(n.index-i,a.length());const o=Hs.formats(a.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}_e(pv,"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 mv extends hu{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=GO),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"),zo),this.buildPickers(e.container.querySelectorAll("select"),zo),this.tooltip=new pv(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)}))}}mv.DEFAULTS=zs({},hu.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,ie.sources.USER)}}}}});ie.register({"attributors/attribute/direction":Kb,"attributors/class/align":zb,"attributors/class/background":dL,"attributors/class/color":cL,"attributors/class/direction":Vb,"attributors/class/font":Zb,"attributors/class/size":ev,"attributors/style/align":Wb,"attributors/style/background":$h,"attributors/style/color":jh,"attributors/style/direction":Xb,"attributors/style/font":Jb,"attributors/style/size":tv},!0);ie.register({"formats/align":zb,"formats/direction":Vb,"formats/indent":tO,"formats/background":$h,"formats/color":jh,"formats/font":Zb,"formats/size":ev,"formats/blockquote":Sf,"formats/code-block":_n,"formats/header":wf,"formats/list":fu,"formats/bold":Yo,"formats/code":Yh,"formats/italic":If,"formats/link":Hs,"formats/script":Cf,"formats/strike":Lf,"formats/underline":Of,"formats/formula":rl,"formats/image":xf,"formats/video":sl,"modules/syntax":ov,"modules/table":rO,"modules/toolbar":Vh,"themes/bubble":hv,"themes/snow":mv,"ui/icons":zo,"ui/picker":nc,"ui/icon-picker":lv,"ui/color-picker":uv,"ui/tooltip":cv},!0);const m1="/api/read?path=",gv=/src="([^"]*)"/g,KO=/&nbsp;/g;function VO(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function g1(t,e){return t.replace(gv,(n,r)=>VO(r)?`src="${ou(e,r)}"`:n)}function b1(t,e){const n=`content/${e===""?"":`${e}/`}`;return t.replace(gv,(r,s)=>{const a=s.indexOf(m1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+m1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(KO," ")}var XO=z('<div class="rte svelte-1afg4yo"><div></div></div>');function QO(t,e){ct(e,!0);const n=ie.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"]];Ua(()=>{const f=new ie(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(f.root.setAttribute("aria-labelledby",e.labelledBy),f.root.setAttribute("aria-multiline","true"));const b=f.theme.tooltip;if(b!==void 0){const C=b.position.bind(b);b.position=I=>{const H=f.root.getBoundingClientRect();return C({...I,left:I.left+H.left,right:I.right+H.left,top:I.top+H.top-f.root.scrollTop,bottom:I.bottom+H.top-f.root.scrollTop})}}const _=f.getModule("toolbar");_.addHandler("image",()=>u(f)),_.addHandler("link",()=>o(f));const A=C=>{C.preventDefault(),setTimeout(()=>i(f),0)};f.root.addEventListener("contextmenu",A),e.value&&f.clipboard.dangerouslyPasteHTML(g1(e.value,e.itemDir),"silent");const E=()=>e.onchange(b1(f.root.innerHTML,e.itemDir));return f.on("text-change",E),s=f,()=>{f.off("text-change",E),f.root.removeEventListener("contextmenu",A)}});function i(f){var A;const m=f.getSelection(!0);if(m===null)return;const b=f.theme,_=f.getBounds(m.index,m.length);((A=b.tooltip)==null?void 0:A.show)!==void 0&&b.tooltip.position!==void 0&&_&&(b.tooltip.show(),b.tooltip.position(_))}function o(f){const m=f.getSelection(!0);if(m===null)return;const b=f.getFormat(m).link??"";ub(b).then(_=>{if(_!==null)if(_==="")f.formatText(m.index,m.length,"link",!1,"user");else if(m.length>0)f.formatText(m.index,m.length,"link",_,"user");else{const A=Fo(_)?uf(_):_;f.insertText(m.index,A,{link:_},"user")}})}function u(f){const m=document.createElement("input");m.type="file",m.accept="image/*",m.onchange=()=>{var _;const b=(_=m.files)==null?void 0:_[0];b&&d(f,b)},m.click()}async function d(f,m){try{const b=await Th(e.itemDir,m),_=f.getSelection(!0);f.insertEmbed(_.index,"image",ou(e.itemDir,b),"user"),f.setSelection(_.index+1,0)}catch(b){console.error("Inline image upload failed",b)}}Dt(()=>{const f=e.value;s&&b1(s.root.innerHTML,e.itemDir)!==f&&s.clipboard.dangerouslyPasteHTML(g1(f,e.itemDir),"silent")});var h=XO(),g=S(h);pn(g,f=>r=f,()=>r),q(t,h),dt()}var ZO=z('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),JO=z('<textarea rows="3"></textarea>'),e8=z('<input type="date" class="svelte-1bn65uv"/>'),t8=z('<input type="time" class="svelte-1bn65uv"/>'),n8=z('<input type="email" class="svelte-1bn65uv"/>'),r8=z('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),s8=z('<input type="text" class="svelte-1bn65uv"/>'),a8=z('<p class="hint svelte-1bn65uv"> </p>'),i8=z("<p> </p>"),o8=z('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),u8=z('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),l8=z('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),c8=z('<p class="hint svelte-1bn65uv">Loading fields…</p>'),d8=z('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),f8=z(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta &amp; SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's &lt;head&gt;.</p> <!></details>`),h8=z("<!> <!>",1),p8=z('<div class="divider svelte-1bn65uv" role="separator" aria-orientation="vertical" aria-label="Resize preview" tabindex="0"><span class="grip svelte-1bn65uv"></span></div> <div class="preview-pane svelte-1bn65uv"><!></div>',1),m8=z('<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 g8(t,e){ct(e,!0);const n=ir(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=Z(!1);const i=()=>new Date().toISOString().slice(0,10);function o(){y(a,!l(a)),l(a)&&(l(E).published??"").trim()===""&&(l(E).published=i()),Y()}let u=Z(!1),d=Z(lt([]));function h(){y(u,!0),e.onmove&&Kd().then(Ee=>y(d,Ee,!0))}async function g(Ee){var Ue;Ee!==e.templateName&&(await T(),(Ue=e.onchangetemplate)==null||Ue.call(e,Ee))}const f=Ae(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),m=new Set(["richtext","image","file","authors"]);function b(Ee){return m.has(Ee.type)?void 0:`f-${Ee.name}`}let _=Z(lt([])),A=Z(!0),E=Z(lt({})),C=Z(null);const I=700;let H,B=!1,J=0;Ua(()=>{F();const Ee=()=>void T();return window.addEventListener("beforeunload",Ee),()=>{window.removeEventListener("beforeunload",Ee),T()}});async function F(){y(A,!0);const[Ee,Ue]=await Promise.all([sN(e.templateName),iN()]),$e=Ee.filter(Rt=>Rt.name!=="title"&&Rt.name!=="published"),Ke=new Set($e.map(Rt=>Rt.name)),fe=Ue.filter(Rt=>Rt.name!=="published"&&!Ke.has(Rt.name)),Zt=[r,s,...$e,...fe],At={};for(const Rt of Zt)At[Rt.name]=xN(e.item,Rt.name);At.published=(At.published??"").slice(0,10),y(a,e.item.isPublished,!0),y(_,Zt,!0),y(O,$e,!0),y(W,fe,!0),y(E,At,!0),u6(localStorage,e.path,At),y(C,l6(localStorage,e.path),!0),y(A,!1)}function Y(){B=!0,J+=1,clearTimeout(H),H=setTimeout(()=>void T(),I)}function X(Ee,Ue){const $e=l(E)[Ee]??"";l(E)[Ee]=Ue,Y(),$e!==""&&$e!==Ue&&te($e)}async function te(Ee){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Ee))return;Object.values(l(E)).some($e=>typeof $e=="string"&&$e.includes(Ee))||await hN(l(f),Ee)}async function T(){var $e;if(clearTimeout(H),!B)return;const Ee=J,Ue=dp(e.item,l(_),l(E),l(a));Os.saving();try{await jg(e.path,Ue),J===Ee&&(B=!1),Os.saved(),($e=e.onsaved)==null||$e.call(e,e.path,l(E).title??e.item.title,l(a))}catch{Os.failed(()=>void T())}}async function D(){l(C)===null||!await yl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(y(E,{...l(C)},!0),Y())}const v=new Set(["text","code"]);function R(Ee,Ue){return Ee.maxLength!==void 0&&Ee.minLength!==void 0?`${Ue} / ${Ee.maxLength} characters (min ${Ee.minLength})`:Ee.maxLength!==void 0?`${Ue} / ${Ee.maxLength} characters`:`${Ue} characters (min ${Ee.minLength})`}function k(Ee,Ue){return Ee.minLength!==void 0&&Ue>0&&Ue<Ee.minLength?!0:Ee.maxLength!==void 0&&Ue>Ee.maxLength}let O=Z(lt([])),W=Z(lt([]));const j=Ae(()=>l(C)!==null&&JSON.stringify(l(E))!==JSON.stringify(l(C))),M="nanoesis:preview-open";let $=Z(localStorage.getItem(M)==="true");function G(Ee){y($,Ee,!0),localStorage.setItem(M,String(Ee))}const ee=Ae(()=>{if(l(A))return null;try{return{...Ul(JSON.parse(dp(e.item,l(_),l(E),l(a)))),template:e.templateName}}catch{return null}}),le="nanoesis:preview-split",be=.2,pe=.8;function Ne(Ee){return Math.min(pe,Math.max(be,Ee))}function ce(){const Ee=Number(localStorage.getItem(le));return Number.isFinite(Ee)&&Ee>0?Ne(Ee):.5}let he=Z(lt(ce())),Se=Z(!1),ye;function Ie(Ee){Ee.preventDefault(),y(Se,!0),Ee.currentTarget.setPointerCapture(Ee.pointerId)}function xe(Ee){if(!l(Se))return;const Ue=ye.getBoundingClientRect();y(he,Ne((Ee.clientX-Ue.left)/Ue.width),!0)}function De(Ee){var Ue,$e;l(Se)&&(y(Se,!1),($e=(Ue=Ee.currentTarget).releasePointerCapture)==null||$e.call(Ue,Ee.pointerId),localStorage.setItem(le,String(l(he))))}function ze(Ee){const Ue=Ee.key==="ArrowLeft"?-.02:Ee.key==="ArrowRight"?.02:0;Ue!==0&&(Ee.preventDefault(),y(he,Ne(l(he)+Ue),!0),localStorage.setItem(le,String(l(he))))}var et=m8(),Vt=nt(et);let Qe;var Xt=S(Vt),nn=S(Xt);{const Ee=(Ke,fe=Pf)=>{var Zt=o8(),At=S(Zt),Rt=S(At),mn=x(Rt);{var Qn=Le=>{var Te=ZO();q(Le,Te)};de(mn,Le=>{fe().required&&Le(Qn)})}var mr=x(mn,2),jn=S(mr),Ct=x(At,2);{var Js=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);QO(Le,{get value(){return l(Te)},get itemDir(){return l(f)},get labelledBy(){return l(Me)},placeholder:"Write…",onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},ea=Le=>{var Te=JO();let Me;se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength),Me=Je(Te,1,"svelte-1bn65uv",null,Me,{mono:fe().type==="code"})}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],gt=>l(E)[fe().name]=gt),q(Le,Te)},ta=Ae(()=>v.has(fe().type)),na=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);P6(Le,{get value(){return l(Te)},get itemDir(){return l(f)},get labelledBy(){return l(Me)},onchange:gt=>X(fe().name,gt)})}},ra=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);O6(Le,{get value(){return l(Te)},get itemDir(){return l(f)},get labelledBy(){return l(Me)},onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},He=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);_6(Le,{get value(){return l(Te)},get labelledBy(){return l(Me)},onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},Lt=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);J6(Le,{get value(){return l(Te)},get labelledBy(){return l(Me)},onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},Yt=Le=>{var Te=e8();se(()=>ve(Te,"id",`f-${fe().name}`)),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},Sn=Le=>{var Te=t8();se(()=>ve(Te,"id",`f-${fe().name}`)),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},gn=Le=>{var Te=n8();se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength)}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},Ft=Le=>{var Te=r8();se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength)}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},pt=Le=>{var Te=s8();se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength)}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)};de(Ct,Le=>{fe().type==="richtext"?Le(Js):l(ta)?Le(ea,1):fe().type==="image"?Le(na,2):fe().type==="file"?Le(ra,3):fe().type==="authors"?Le(He,4):fe().type==="url"?Le(Lt,5):fe().type==="date"?Le(Yt,6):fe().type==="time"?Le(Sn,7):fe().type==="email"?Le(gn,8):fe().type==="phone"?Le(Ft,9):Le(pt,-1)})}var zt=x(Ct,2);{var Ut=Le=>{var Te=a8(),Me=S(Te);se(()=>oe(Me,fe().help)),q(Le,Te)};de(zt,Le=>{fe().help&&Le(Ut)})}var Dn=x(zt,2);{var yt=Le=>{const Te=Ae(()=>(l(E)[fe().name]??"").length);var Me=i8();let gt;var Wt=S(Me);se((sa,zi)=>{gt=Je(Me,1,"hint count svelte-1bn65uv",null,gt,sa),oe(Wt,zi)},[()=>({over:k(fe(),l(Te))}),()=>R(fe(),l(Te))]),q(Le,Me)};de(Dn,Le=>{(fe().minLength!==void 0||fe().maxLength!==void 0)&&Le(yt)})}se(Le=>{ve(At,"id",`lbl-${fe().name}`),ve(At,"for",Le),oe(Rt,`${fe().label??""} `),oe(jn,fe().multiple?"references":fe().type)},[()=>b(fe())]),q(Ke,Zt)};var qt=S(nn),yn=S(qt),rn=S(yn),Bt=x(rn,2),jt=S(Bt),Rn=x(yn,2),qn=S(Rn),Tt=S(qn);{var kt=Ke=>{var fe=u8();ae("click",fe,D),q(Ke,fe)};de(Tt,Ke=>{l(j)&&Ke(kt)})}var Qt=x(Tt,2);{var _t=Ke=>{var fe=l8(),Zt=S(fe);wh(Zt,{size:16,"aria-hidden":"true"}),ae("click",fe,h),q(Ke,fe)};de(Qt,Ke=>{e.onchangetemplate&&Ke(_t)})}var un=x(Qt,2);let Ue;var $t=x(un,2);let $e;var Xn=S($t),pr=x(qn,2),Nn=x(S(pr),2),Ur=x(qt,2);{var K=Ke=>{var fe=c8();q(Ke,fe)},ge=Ke=>{var fe=d8();q(Ke,fe)},we=Ke=>{var fe=h8(),Zt=nt(fe);It(Zt,17,()=>l(O),mn=>mn.name,(mn,Qn)=>{Ee(mn,()=>l(Qn))});var At=x(Zt,2);{var Rt=mn=>{var Qn=f8(),mr=x(S(Qn),4);It(mr,17,()=>l(W),jn=>jn.name,(jn,Ct)=>{Ee(jn,()=>l(Ct))}),q(mn,Qn)};de(At,mn=>{l(W).length>0&&mn(Rt)})}q(Ke,fe)};de(Ur,Ke=>{l(A)?Ke(K):l(O).length===0&&l(W).length===0?Ke(ge,1):Ke(we,-1)})}se(()=>{oe(jt,e.templateName),Ue=Je(un,1,"preview-toggle svelte-1bn65uv",null,Ue,{active:l($)}),ve(un,"aria-pressed",l($)),$e=Je($t,1,"publish-btn svelte-1bn65uv",null,$e,{on:l(a)}),ve($t,"aria-pressed",l(a)),ve($t,"title",l(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),oe(Xn,l(a)?"Publish":"Don't Publish")}),ae("input",rn,Y),vt(rn,()=>l(E).title,Ke=>l(E).title=Ke),ae("click",un,()=>G(!l($))),ae("click",$t,o),ae("input",Nn,Y),vt(Nn,()=>l(E).published,Ke=>l(E).published=Ke)}var We=x(Xt,2);{var ht=Ee=>{var Ue=p8(),$e=nt(Ue),Ke=x($e,2),fe=S(Ke);aS(fe,{get path(){return e.path},get previewItem(){return l(ee)},onclose:()=>G(!1)}),se((Zt,At,Rt)=>{ve($e,"aria-valuemin",Zt),ve($e,"aria-valuemax",At),ve($e,"aria-valuenow",Rt)},[()=>Math.round(be*100),()=>Math.round(pe*100),()=>Math.round(l(he)*100)]),ae("pointerdown",$e,Ie),ae("pointermove",$e,xe),ae("pointerup",$e,De),Be("pointercancel",$e,De),ae("keydown",$e,ze),q(Ee,Ue)};de(We,Ee=>{l($)&&Ee(ht)})}pn(Vt,Ee=>ye=Ee,()=>ye);var Ge=x(Vt,2);{var xt=Ee=>{{let Ue=Ae(()=>e.onrename?()=>(y(u,!1),e.onrename()):void 0),$e=Ae(()=>e.ondelete?()=>(y(u,!1),e.ondelete()):void 0),Ke=Ae(()=>e.onmove?fe=>(y(u,!1),e.onmove(fe)):void 0);z6(Ee,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return l(f)},get folders(){return l(d)},onchangetemplate:fe=>{y(u,!1),g(fe)},get onrename(){return l(Ue)},get ondelete(){return l($e)},get onmove(){return l(Ke)},onclose:()=>y(u,!1)})}};de(Ge,Ee=>{l(u)&&e.onchangetemplate&&Ee(xt)})}se(()=>{Qe=Je(Vt,1,"layout svelte-1bn65uv",null,Qe,{split:l($),dragging:l(Se)}),Am(Xt,l($)?`flex-basis:${l(he)*100}%`:void 0)}),Be("submit",nn,Ee=>Ee.preventDefault()),ae("focusout",nn,()=>void T()),q(t,et),dt()}bt(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const bv=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,b8="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 Io=Z("idle"),al=Z(lt([])),il=Z(lt([])),td=Z(!1),nd;async function v1(){y(Io,"checking");try{const t=await uN();y(al,[...t.errors],!0),y(il,[...t.warnings],!0),y(Io,"done")}catch{y(Io,"error")}}const En={get status(){return l(Io)},get errors(){return l(al)},get warnings(){return l(il)},get count(){return l(al).length+l(il).length},get hasProblems(){return l(Io)==="done"&&l(al).length+l(il).length>0},get panelOpen(){return l(td)},refresh(){return clearTimeout(nd),v1()},scheduleRefresh(t=1200){clearTimeout(nd),nd=setTimeout(()=>void v1(),t)},openPanel(){y(td,!0)},closePanel(){y(td,!1)}};var v8=z('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),E8=z('<button type="button" class="problems svelte-jz8lnl"> </button>'),T8=z('<footer><div class="credit svelte-jz8lnl"><img class="logo svelte-jz8lnl" alt="" width="20" height="20"/> <span>nanoesis by <a target="_blank" rel="noopener noreferrer" class="svelte-jz8lnl">xtrable ltd</a></span></div> <div aria-live="polite"><span> </span> <!></div> <!> <a class="xtrable svelte-jz8lnl" target="_blank" rel="noopener noreferrer" aria-label="xtrable ltd"><img alt="xtrable" width="24" height="24" class="svelte-jz8lnl"/></a></footer>');function _8(t,e){ct(e,!0);const n=Ae(()=>Os.state==="saving"?"Saving…":Os.state==="error"?"Save failed":"Saved");Dt(()=>{ph.value,En.scheduleRefresh()});const r=Ae(()=>En.count),s="https://xtrable.com/";var a=T8();let i;var o=S(a),u=S(o),d=x(u,2),h=x(S(d));ve(h,"href",s);var g=x(o,2);let f;var m=S(g),b=S(m),_=x(m,2);{var A=B=>{var J=v8();ae("click",J,()=>Os.retry()),q(B,J)};de(_,B=>{Os.canRetry&&B(A)})}var E=x(g,2);{var C=B=>{var J=E8(),F=S(J);se(()=>oe(F,`${l(r)??""}
121
- ${l(r)===1?"problem":"problems"}`)),ae("click",J,()=>En.openPanel()),q(B,J)};de(E,B=>{En.hasProblems&&B(C)})}var I=x(E,2);ve(I,"href",s);var H=S(I);se(()=>{i=Je(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":En.hasProblems}),ve(u,"src",bv),f=Je(g,1,"save svelte-jz8lnl",null,f,{error:Os.state==="error"}),oe(b,l(n)),ve(H,"src",b8)}),q(t,a),dt()}bt(["click"]);var A8=z("<option> </option>"),y8=z("<option>Top level</option>"),N8=z("<option> </option>"),S8=z('<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Move</h3> <div class="manage svelte-1uvxo8j"><label class="grow svelte-1uvxo8j"><span class="visually-hidden svelte-1uvxo8j">Move to folder</span> <select class="svelte-1uvxo8j"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-1uvxo8j">Move</button></div></div>'),w8=z(`<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Manage folder</h3> <div class="manage svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">New subfolder…</button> <button type="button" class="ghost svelte-1uvxo8j">Change URL…</button> <button type="button" class="ghost danger svelte-1uvxo8j">Delete folder…</button></div> <p class="help svelte-1uvxo8j">“Change URL” renames this folder’s slug (its address). Its name in the tree is its section
122
- page’s title.</p></div>`),I8=z('<p class="error svelte-1uvxo8j" role="alert"> </p>'),C8=z('<dialog aria-label="Folder settings" class="svelte-1uvxo8j"><form><h2 class="svelte-1uvxo8j">Folder settings</h2> <p class="path svelte-1uvxo8j"> </p> <label class="svelte-1uvxo8j"><span class="svelte-1uvxo8j">Default template</span> <select class="svelte-1uvxo8j"><option>(none, items must set their own)</option><!></select> <span class="help svelte-1uvxo8j">New items here inherit this template unless they pick their own. Stored in the folder’s <code>_sort.json</code>.</span></label> <!> <!> <!> <div class="actions svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">Cancel</button> <button type="submit" class="primary svelte-1uvxo8j">Save</button></div></form></dialog>');function L8(t,e){ct(e,!0);const n=ir(e,"folders",19,()=>[]);let r=Z(""),s=Z(!0),a=Z(null),i;const o=Ae(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),u=Ae(()=>n().filter(v=>v!==e.folderPath&&v!==l(o)&&!v.startsWith(`${e.folderPath}/`))),d=" ";let h=Z(d);Ua(()=>{i.showModal(),EN(e.folderPath).then(v=>{y(r,v,!0)}).finally(()=>{y(s,!1)})});async function g(v){v.preventDefault(),y(a,null);try{await TN(e.folderPath,l(r)),e.onsaved()}catch(R){y(a,R instanceof Error?R.message:String(R),!0)}}var f=C8(),m=S(f),b=x(S(m),2),_=S(b),A=x(b,2),E=x(S(A),2),C=S(E);C.value=C.__value="";var I=x(C);It(I,16,()=>e.templates,v=>v,(v,R)=>{var k=A8(),O=S(k),W={};se(()=>{oe(O,R),W!==(W=R)&&(k.value=(k.__value=R)??"")}),q(v,k)});var H=x(A,2);{var B=v=>{var R=S8(),k=x(S(R),2),O=S(k),W=x(S(O),2),j=S(W);j.value=j.__value=d;var M=x(j);{var $=le=>{var be=y8();be.value=be.__value="",q(le,be)};de(M,le=>{l(o)!==""&&le($)})}var G=x(M);It(G,16,()=>l(u),le=>le,(le,be)=>{var pe=N8(),Ne=S(pe),ce={};se(()=>{oe(Ne,`${be??""}/`),ce!==(ce=be)&&(pe.value=(pe.__value=be)??"")}),q(le,pe)});var ee=x(O,2);se(()=>ee.disabled=l(h)===d),xa(W,()=>l(h),le=>y(h,le)),ae("click",ee,()=>e.onmove(l(h))),q(v,R)};de(H,v=>{e.onmove&&v(B)})}var J=x(H,2);{var F=v=>{var R=w8(),k=x(S(R),2),O=S(k),W=x(O,2),j=x(W,2);ae("click",O,function(...M){var $;($=e.onnewsubfolder)==null||$.apply(this,M)}),ae("click",W,function(...M){var $;($=e.onrenamefolder)==null||$.apply(this,M)}),ae("click",j,function(...M){var $;($=e.ondeletefolder)==null||$.apply(this,M)}),q(v,R)};de(J,v=>{e.folderPath!==""&&v(F)})}var Y=x(J,2);{var X=v=>{var R=I8(),k=S(R);se(()=>oe(k,l(a))),q(v,R)};de(Y,v=>{l(a)&&v(X)})}var te=x(Y,2),T=S(te),D=x(T,2);pn(f,v=>i=v,()=>i),se(()=>{oe(_,e.folderPath===""?"/ (root)":`${e.folderPath}/`),E.disabled=l(s),D.disabled=l(s)}),Be("cancel",f,function(...v){var R;(R=e.oncancel)==null||R.apply(this,v)}),Be("close",f,function(...v){var R;(R=e.oncancel)==null||R.apply(this,v)}),Be("submit",m,g),xa(E,()=>l(r),v=>y(r,v)),ae("click",T,function(...v){var R;(R=e.oncancel)==null||R.apply(this,v)}),q(t,f),dt()}bt(["click"]);var O8=z("<option></option>"),x8=z("<option> </option>"),R8=z('<p class="error svelte-1t0ew8l" role="alert"> </p>'),D8=z('<dialog aria-label="New content item" class="svelte-1t0ew8l"><form><h2 class="svelte-1t0ew8l">New content item</h2> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Title</span> <input required="" class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Slug</span> <input class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Folder</span> <input list="folder-options" placeholder="/ (root), or type a new folder" class="svelte-1t0ew8l"/> <datalist id="folder-options"></datalist> <span class="help svelte-1t0ew8l">Pick an existing folder or type a new path to create it.</span></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Template</span> <select class="svelte-1t0ew8l"><option>Inherit the folder’s default</option><!></select> <span class="help svelte-1t0ew8l">A folder’s default is set in its folder settings (the gear button in the tree).</span></label> <!> <div class="actions svelte-1t0ew8l"><button type="button" class="ghost svelte-1t0ew8l">Cancel</button> <button type="submit" class="primary svelte-1t0ew8l">Create</button></div></form></dialog>');function k8(t,e){ct(e,!0);let n=Z(""),r=Z(""),s=Z(""),a=Z(""),i=!1,o=Z(null),u;Ua(()=>u.showModal());function d(){i||y(r,ps(l(n)),!0)}async function h(D){D.preventDefault(),y(o,null);const v=ps(l(r)||l(n));if(v===""){y(o,"A title or slug is required.");return}const R=l(s).split("/").map(O=>ps(O)).filter(O=>O!=="").join("/"),k=R===""?v:`${R}/${v}`;try{await zg(k,l(n).trim()||v,l(a)),e.oncreated(k)}catch(O){y(o,O instanceof Error?O.message:String(O),!0)}}var g=D8(),f=S(g),m=x(S(f),2),b=x(S(m),2);Li(b,!0);var _=x(m,2),A=x(S(_),2),E=x(_,2),C=x(S(E),2),I=x(C,2);It(I,20,()=>e.folders,D=>D,(D,v)=>{var R=O8(),k={};se(()=>{k!==(k=v)&&(R.value=(R.__value=v)??"")}),q(D,R)});var H=x(E,2),B=x(S(H),2),J=S(B);J.value=J.__value="";var F=x(J);It(F,16,()=>e.templates,D=>D,(D,v)=>{var R=x8(),k=S(R),O={};se(()=>{oe(k,v),O!==(O=v)&&(R.value=(R.__value=v)??"")}),q(D,R)});var Y=x(H,2);{var X=D=>{var v=R8(),R=S(v);se(()=>oe(R,l(o))),q(D,v)};de(Y,D=>{l(o)&&D(X)})}var te=x(Y,2),T=S(te);pn(g,D=>u=D,()=>u),se(D=>ve(A,"placeholder",D),[()=>ps(l(n))||"my-item"]),Be("cancel",g,function(...D){var v;(v=e.oncancel)==null||v.apply(this,D)}),Be("close",g,function(...D){var v;(v=e.oncancel)==null||v.apply(this,D)}),Be("submit",f,h),ae("input",b,d),vt(b,()=>l(n),D=>y(n,D)),ae("input",A,()=>i=!0),vt(A,()=>l(r),D=>y(r,D)),vt(C,()=>l(s),D=>y(s,D)),xa(B,()=>l(a),D=>y(a,D)),ae("click",T,function(...D){var v;(v=e.oncancel)==null||v.apply(this,D)}),q(t,g),dt()}bt(["input","click"]);var P8=z("<option> </option>"),M8=z(`<div class="empty svelte-y9gf4p"><div class="card svelte-y9gf4p"><h1 class="svelte-y9gf4p"> </h1> <p class="svelte-y9gf4p">This section has no page yet, the page visitors see at <code class="svelte-y9gf4p"> </code>. Pick a template (a
123
- 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 B8(t,e){ct(e,!0);const n=Ae(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=Z(""),s=Z(!1);function a(){y(s,!0),e.oncreate(l(r))}var i=M8(),o=S(i),u=S(o),d=S(u),h=x(u,2),g=x(S(h)),f=S(g),m=x(h,2),b=x(S(m),2),_=S(b);_.value=_.__value="";var A=x(_);It(A,16,()=>e.templates,I=>I,(I,H)=>{var B=P8(),J=S(B),F={};se(()=>{oe(J,H),F!==(F=H)&&(B.value=(B.__value=H)??"")}),q(I,B)});var E=x(m,2),C=S(E);se(()=>{oe(d,e.name),oe(f,l(n)),b.disabled=l(s),E.disabled=l(s),oe(C,l(s)?"Creating…":"Create page")}),xa(b,()=>l(r),I=>y(r,I)),ae("click",E,a),q(t,i),dt()}bt(["click"]);const vv="nanoesis:sidebar-width",F8=180,U8=560,H8=260;function Ev(t){return Math.min(U8,Math.max(F8,Math.round(t)))}function q8(){const t=Number(localStorage.getItem(vv));return Number.isFinite(t)&&t>0?Ev(t):H8}let Cl=q8();function Tv(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${Cl}px`)}Tv();function j8(){return Cl}function $8(t){Cl=Ev(t),Tv(),localStorage.setItem(vv,String(Cl))}var Y8=z('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function z8(t,e){ct(e,!0);let n=Z(null);function r(u){u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),y(n,{startX:u.clientX,startWidth:j8()},!0)}function s(u){l(n)!==null&&$8(l(n).startWidth+(u.clientX-l(n).startX))}function a(u){var d,h;l(n)!==null&&((h=(d=u.currentTarget).releasePointerCapture)==null||h.call(d,u.pointerId),y(n,null))}var i=Y8();let o;se(()=>o=Je(i,1,"resizer svelte-1jo2gqq",null,o,{dragging:l(n)!==null})),ae("pointerdown",i,r),ae("pointermove",i,s),ae("pointerup",i,a),Be("pointercancel",i,a),q(t,i),dt()}bt(["pointerdown","pointermove","pointerup"]);const _v={"content-type":"application/json"};async function W8(){const t=await Xe("/api/migrations");if(!t.ok)throw new Error(`Failed to load migrations (HTTP ${t.status}).`);return await t.json()}async function dD(t){const e=await Xe(`/api/migrations/preview?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load migration preview (HTTP ${e.status}).`);return await e.json()}async function fD(t,e){const n=await Xe("/api/migrations/apply",{method:"POST",headers:_v,body:JSON.stringify({path:t,resolution:e})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error??`Migration failed (HTTP ${n.status}).`)}return await n.json()}async function hD(t,e){const n=await Xe("/api/templates/stamp",{method:"POST",headers:_v,body:JSON.stringify({name:t,kind:e})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Stamp failed (HTTP ${n.status}).`)}return await n.json()}function G8(){let t=Z(0),e=Z(null),n=Z(!1),r=Z(null),s=!1;async function a(){y(n,!0),y(r,null);try{const i=await W8();y(e,i,!0),y(t,i.items.length,!0),s=!0}catch(i){y(r,i instanceof Error?i.message:String(i),!0)}finally{y(n,!1)}}return{get count(){return l(t)},get list(){return l(e)},get loading(){return l(n)},get error(){return l(r)},async ensureLoaded(){s||l(n)||await a()},refresh:a}}const zu=G8();var K8=z(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),V8=z('<p class="error svelte-fna247" role="alert"> </p>'),X8=z('<p class="success svelte-fna247" role="status">Password updated.</p>'),Q8=z('<dialog aria-label="Change password" class="svelte-fna247"><h2 class="svelte-fna247">Change password</h2> <p class="lede svelte-fna247">You stay signed in here. Other sessions of yours (other devices, other tabs) are signed out.</p> <form class="svelte-fna247"><label class="svelte-fna247"><span class="svelte-fna247">Current password</span> <input type="password" autocomplete="current-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">New password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">Confirm new password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/> <!></label> <!> <!> <div class="actions svelte-fna247"><button type="button" class="ghost svelte-fna247">Cancel</button> <button type="submit" class="primary svelte-fna247"> </button></div></form></dialog>');function Z8(t,e){ct(e,!0);let n=ir(e,"open",15),r=Z(void 0),s=Z(""),a=Z(""),i=Z(""),o=Z(!1),u=Z(null),d=Z(!1);Dt(()=>{l(r)&&(n()&&!l(r).open?(y(s,""),y(a,""),y(i,""),y(u,null),y(d,!1),y(o,!1),l(r).showModal()):!n()&&l(r).open&&l(r).close())});let h=Ae(()=>l(a)!==""&&l(i)!==""&&l(a)!==l(i)),g=Ae(()=>!l(o)&&l(s)!==""&&l(a)!==""&&!l(h));async function f(O){if(O.preventDefault(),!l(g))return;y(o,!0),y(u,null);const W=await ut.changePassword(l(s),l(a));if(y(o,!1),!W.ok){const j=W.error??"Password change failed.";y(u,j.includes("credentials")?"Current password is incorrect.":j,!0);return}y(d,!0),setTimeout(()=>{n(!1)},900)}function m(O){O.preventDefault(),n(!1)}var b=Q8(),_=x(S(b),4),A=S(_),E=x(S(A),2),C=x(A,2),I=x(S(C),2),H=x(C,2),B=x(S(H),2),J=x(B,2);{var F=O=>{var W=K8();q(O,W)};de(J,O=>{l(h)&&O(F)})}var Y=x(H,2);{var X=O=>{var W=V8(),j=S(W);se(()=>oe(j,l(u))),q(O,W)};de(Y,O=>{l(u)&&O(X)})}var te=x(Y,2);{var T=O=>{var W=X8();q(O,W)};de(te,O=>{l(d)&&O(T)})}var D=x(te,2),v=S(D),R=x(v,2),k=S(R);pn(b,O=>y(r,O),()=>l(r)),se(()=>{R.disabled=!l(g),oe(k,l(o)?"Updating…":"Update password")}),Be("cancel",b,m),Be("submit",_,f),vt(E,()=>l(s),O=>y(s,O)),vt(I,()=>l(a),O=>y(a,O)),vt(B,()=>l(i),O=>y(i,O)),ae("click",v,()=>n(!1)),q(t,b),dt()}bt(["click"]);var J8=z(`<label class="svelte-szf2lz"><span class="svelte-szf2lz"> </span> <textarea readonly="" rows="3" class="svelte-szf2lz"></textarea></label> <p class="warn svelte-szf2lz" role="status">Copy it now, you won't be able to see it again.</p> <div class="actions svelte-szf2lz"><button type="button" class="ghost svelte-szf2lz">Done</button> <button type="button" class="primary svelte-szf2lz"> </button></div>`,1),e5=z('<p class="error svelte-szf2lz" role="alert"> </p>'),t5=z('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),n5=z('<!> <!> <div class="actions svelte-szf2lz"><button type="button" class="danger svelte-szf2lz">Revoke all</button> <span class="spacer svelte-szf2lz"></span> <button type="button" class="ghost svelte-szf2lz">Cancel</button> <button type="button" class="primary svelte-szf2lz"> </button></div>',1),r5=z(`<dialog aria-label="MCP access token" class="svelte-szf2lz"><h2 class="svelte-szf2lz">MCP access token</h2> <p class="lede svelte-szf2lz">A token lets an AI client (through the MCP server) read and edit this site as you, with your
121
+ `,{[_n.blotName]:n}),i.insert(o)),a)],new WeakMap)}}cv.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 Lo=class Lo extends fn{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",Kh()),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===Lo.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()}};_e(Lo,"blotName","table"),_e(Lo,"tagName","TD");let Nr=Lo;class As extends za{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}}_e(As,"blotName","table-row"),_e(As,"tagName","TR");class Zr extends za{}_e(Zr,"blotName","table-body"),_e(Zr,"tagName","TBODY");class Ui extends za{balanceCells(){const e=this.descendants(As),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=Nr.formats(r.children.head.domNode));const a=this.scroll.create(Nr.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(Zr);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(Zr);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=Nr.formats(r.children.head.domNode),i=this.scroll.create(Nr.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(Zr);if(n==null||n.children.head==null)return;const r=Kh(),s=this.scroll.create(As.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(Nr.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)}}_e(Ui,"blotName","table-container"),_e(Ui,"tagName","TABLE");Ui.allowedChildren=[Zr];Zr.requiredContainer=Ui;Zr.allowedChildren=[As];As.requiredContainer=Zr;As.allowedChildren=[Nr];Nr.requiredContainer=As;function Kh(){return`row-${Math.random().toString(36).slice(2,6)}`}class iO extends Fr{static register(){ie.register(Nr),ie.register(As),ie.register(Zr),ie.register(Ui)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ui).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(ie.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(ie.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(ie.sources.USER),this.quill.setSelection(n,ie.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!==Nr.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(ie.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(n.index+o,n.length,ie.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(ie.sources.USER),e>0?this.quill.setSelection(n,ie.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,ie.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(`
122
+ `).join("");return a.insert(i,{table:Kh()})},new Oe().retain(r.index));this.quill.updateContents(s,ie.sources.USER),this.quill.setSelection(r.index,ie.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(ie.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(ie.events.TEXT_CHANGE,(r,s,a)=>{a===ie.sources.USER&&this.balanceTables()}),!0):!1)})}}const c1=Ns("quill:toolbar");class Vh extends Fr{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),oO(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)){c1.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(a=>{var o;const i=(o=this.options.handlers)==null?void 0:o[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(ie.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){c1.warn("ignoring attaching to nonexistent format",n,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof Vn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new Oe().retain(i.index).delete(i.length).insert({[n]:a}),ie.sources.USER)}else this.quill.format(n,a,ie.sources.USER);this.update(i)}),this.controls.push([n,e])}update(e){const n=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let i=null;if(e==null)i=null;else if(n[s]==null)i=a.querySelector("option[selected]");else if(!Array.isArray(n[s])){let o=n[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${o}"]`)}i==null?(a.value="",a.selectedIndex=-1):i.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const i=n[s],o=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}Vh.DEFAULTS={};function d1(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 oO(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")d1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?uO(r,a,i):d1(r,a,i)}}),t.appendChild(r)})}function uO(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)}Vh.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t!=null)if(t.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(n=>{this.quill.scroll.query(n,Re.INLINE)!=null&&this.quill.format(n,!1,ie.sources.USER)})}else this.quill.removeFormat(t.index,t.length,ie.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",ie.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,ie.sources.USER),this.quill.format("direction",t,ie.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,ie.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,ie.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,ie.sources.USER):this.quill.format("list","unchecked",ie.sources.USER):this.quill.format("list",t,ie.sources.USER)}}};const lO='<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>',cO='<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>',dO='<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>',fO='<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>',hO='<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>',pO='<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>',mO='<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>',gO='<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>',f1='<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>',bO='<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>',vO='<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>',EO='<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>',TO='<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>',_O='<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>',AO='<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>',yO='<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>',NO='<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>',SO='<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>',wO='<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>',IO='<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>',CO='<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>',LO='<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>',OO='<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>',xO='<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>',RO='<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>',DO='<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>',kO='<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>',PO='<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>',MO='<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>',BO='<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>',FO='<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>',UO='<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>',HO='<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>',zo={align:{"":lO,center:cO,right:dO,justify:fO},background:hO,blockquote:pO,bold:mO,clean:gO,code:f1,"code-block":f1,color:bO,direction:{"":vO,rtl:EO},formula:TO,header:{1:_O,2:AO,3:yO,4:NO,5:SO,6:wO},italic:IO,image:CO,indent:{"+1":LO,"-1":OO},link:xO,list:{bullet:RO,check:DO,ordered:kO},script:{sub:PO,super:MO},strike:BO,table:FO,underline:UO,video:HO},qO='<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 h1=0;function p1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class nc{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"),p1(this.label,"aria-expanded"),p1(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=qO,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-${h1}`,h1+=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 dv extends nc{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 fv extends nc{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 jO=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class hv{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,jO(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const n=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>s.right&&(i=s.right-a.right,this.root.style.left=`${n+i}px`),a.left<s.left&&(i=s.left-a.left,this.root.style.left=`${n+i}px`),a.bottom>s.bottom){const o=a.bottom-a.top,u=e.bottom-e.top+o;this.root.style.top=`${r-u}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const $O=[!1,"center","right","justify"],YO=["#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"],zO=[!1,"serif","monospace"],WO=["1","2","3",!1],GO=["small",!1,"large","huge"];class hu extends Fi{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&&ao(s,$O),typeof n.align=="object"))return new fv(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&&ao(s,YO,a==="background"?"#ffffff":"#000000"),new dv(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?ao(s,zO):s.classList.contains("ql-header")?ao(s,WO):s.classList.contains("ql-size")&&ao(s,GO)),new nc(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Ce.events.EDITOR_CHANGE,r)}}hu.DEFAULTS=zs({},Fi.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 pv extends hv{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,Ce.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Ce.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=KO(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,Ce.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Ce.sources.USER),this.quill.setSelection(r+2,Ce.sources.USER)}break}}this.textbox.value="",this.hide()}}function KO(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 ao(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 VO=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class mv extends pv{constructor(e,n){super(e,n),this.quill.on(Ce.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Ce.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Ce.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=o[o.length-1],d=this.quill.getIndex(u),h=Math.min(u.length()-1,s.index+s.length-d),g=this.quill.getBounds(new Pa(d,h));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Ce.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}}_e(mv,"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 gv extends hu{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=VO),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new mv(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),zo),this.buildPickers(e.container.querySelectorAll("select"),zo))}}gv.DEFAULTS=zs({},hu.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,ie.sources.USER)}}}}});const XO=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class bv extends pv{constructor(){super(...arguments);_e(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,Ce.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Ce.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Ce.sources.USER){const[a,i]=this.quill.scroll.descendant(Hs,n.index);if(a!=null){this.linkRange=new Pa(n.index-i,a.length());const o=Hs.formats(a.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}_e(bv,"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 vv extends hu{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=XO),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"),zo),this.buildPickers(e.container.querySelectorAll("select"),zo),this.tooltip=new bv(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)}))}}vv.DEFAULTS=zs({},hu.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,ie.sources.USER)}}}}});ie.register({"attributors/attribute/direction":Qb,"attributors/class/align":Kb,"attributors/class/background":pL,"attributors/class/color":hL,"attributors/class/direction":Zb,"attributors/class/font":tv,"attributors/class/size":rv,"attributors/style/align":Vb,"attributors/style/background":$h,"attributors/style/color":jh,"attributors/style/direction":Jb,"attributors/style/font":nv,"attributors/style/size":sv},!0);ie.register({"formats/align":Kb,"formats/direction":Zb,"formats/indent":sO,"formats/background":$h,"formats/color":jh,"formats/font":tv,"formats/size":rv,"formats/blockquote":Sf,"formats/code-block":_n,"formats/header":wf,"formats/list":fu,"formats/bold":Yo,"formats/code":Yh,"formats/italic":If,"formats/link":Hs,"formats/script":Cf,"formats/strike":Lf,"formats/underline":Of,"formats/formula":rl,"formats/image":xf,"formats/video":sl,"modules/syntax":cv,"modules/table":iO,"modules/toolbar":Vh,"themes/bubble":gv,"themes/snow":vv,"ui/icons":zo,"ui/picker":nc,"ui/icon-picker":fv,"ui/color-picker":dv,"ui/tooltip":hv},!0);const m1="/api/read?path=",Ev=/src="([^"]*)"/g,QO=/&nbsp;/g;function ZO(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function g1(t,e){return t.replace(Ev,(n,r)=>ZO(r)?`src="${ou(e,r)}"`:n)}function b1(t,e){const n=`content/${e===""?"":`${e}/`}`;return t.replace(Ev,(r,s)=>{const a=s.indexOf(m1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+m1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(QO," ")}var JO=z('<div class="rte svelte-1afg4yo"><div></div></div>');function e8(t,e){ct(e,!0);const n=ie.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"]];Ua(()=>{const f=new ie(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(f.root.setAttribute("aria-labelledby",e.labelledBy),f.root.setAttribute("aria-multiline","true"));const b=f.theme.tooltip;if(b!==void 0){const C=b.position.bind(b);b.position=I=>{const H=f.root.getBoundingClientRect();return C({...I,left:I.left+H.left,right:I.right+H.left,top:I.top+H.top-f.root.scrollTop,bottom:I.bottom+H.top-f.root.scrollTop})}}const _=f.getModule("toolbar");_.addHandler("image",()=>u(f)),_.addHandler("link",()=>o(f));const A=C=>{C.preventDefault(),setTimeout(()=>i(f),0)};f.root.addEventListener("contextmenu",A),e.value&&f.clipboard.dangerouslyPasteHTML(g1(e.value,e.itemDir),"silent");const E=()=>e.onchange(b1(f.root.innerHTML,e.itemDir));return f.on("text-change",E),s=f,()=>{f.off("text-change",E),f.root.removeEventListener("contextmenu",A)}});function i(f){var A;const m=f.getSelection(!0);if(m===null)return;const b=f.theme,_=f.getBounds(m.index,m.length);((A=b.tooltip)==null?void 0:A.show)!==void 0&&b.tooltip.position!==void 0&&_&&(b.tooltip.show(),b.tooltip.position(_))}function o(f){const m=f.getSelection(!0);if(m===null)return;const b=f.getFormat(m).link??"";db(b).then(_=>{if(_!==null)if(_==="")f.formatText(m.index,m.length,"link",!1,"user");else if(m.length>0)f.formatText(m.index,m.length,"link",_,"user");else{const A=Fo(_)?uf(_):_;f.insertText(m.index,A,{link:_},"user")}})}function u(f){const m=document.createElement("input");m.type="file",m.accept="image/*",m.onchange=()=>{var _;const b=(_=m.files)==null?void 0:_[0];b&&d(f,b)},m.click()}async function d(f,m){try{const b=await Th(e.itemDir,m),_=f.getSelection(!0);f.insertEmbed(_.index,"image",ou(e.itemDir,b),"user"),f.setSelection(_.index+1,0)}catch(b){console.error("Inline image upload failed",b)}}Dt(()=>{const f=e.value;s&&b1(s.root.innerHTML,e.itemDir)!==f&&s.clipboard.dangerouslyPasteHTML(g1(f,e.itemDir),"silent")});var h=JO(),g=S(h);pn(g,f=>r=f,()=>r),q(t,h),dt()}var t8=z('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),n8=z('<textarea rows="3"></textarea>'),r8=z('<input type="date" class="svelte-1bn65uv"/>'),s8=z('<input type="time" class="svelte-1bn65uv"/>'),a8=z('<input type="email" class="svelte-1bn65uv"/>'),i8=z('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),o8=z('<input type="text" class="svelte-1bn65uv"/>'),u8=z('<p class="hint svelte-1bn65uv"> </p>'),l8=z("<p> </p>"),c8=z('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),d8=z('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),f8=z('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),h8=z('<p class="hint svelte-1bn65uv">Loading fields…</p>'),p8=z('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),m8=z(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta &amp; SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's &lt;head&gt;.</p> <!></details>`),g8=z("<!> <!>",1),b8=z('<div class="divider svelte-1bn65uv" role="separator" aria-orientation="vertical" aria-label="Resize preview" tabindex="0"><span class="grip svelte-1bn65uv"></span></div> <div class="preview-pane svelte-1bn65uv"><!></div>',1),v8=z('<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 E8(t,e){ct(e,!0);const n=ir(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=Z(!1);const i=()=>new Date().toISOString().slice(0,10);function o(){y(a,!l(a)),l(a)&&(l(E).published??"").trim()===""&&(l(E).published=i()),Y()}let u=Z(!1),d=Z(lt([]));function h(){y(u,!0),e.onmove&&Kd().then(Ee=>y(d,Ee,!0))}async function g(Ee){var Ue;Ee!==e.templateName&&(await T(),(Ue=e.onchangetemplate)==null||Ue.call(e,Ee))}const f=Ae(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),m=new Set(["richtext","image","file","authors"]);function b(Ee){return m.has(Ee.type)?void 0:`f-${Ee.name}`}let _=Z(lt([])),A=Z(!0),E=Z(lt({})),C=Z(null);const I=700;let H,B=!1,J=0;Ua(()=>{F();const Ee=()=>void T();return window.addEventListener("beforeunload",Ee),()=>{window.removeEventListener("beforeunload",Ee),T()}});async function F(){y(A,!0);const[Ee,Ue]=await Promise.all([uN(e.templateName),lN()]),$e=Ee.filter(Rt=>Rt.name!=="title"&&Rt.name!=="published"),Ve=new Set($e.map(Rt=>Rt.name)),fe=Ue.filter(Rt=>Rt.name!=="published"&&!Ve.has(Rt.name)),Zt=[r,s,...$e,...fe],At={};for(const Rt of Zt)At[Rt.name]=kN(e.item,Rt.name);At.published=(At.published??"").slice(0,10),y(a,e.item.isPublished,!0),y(_,Zt,!0),y(O,$e,!0),y(W,fe,!0),y(E,At,!0),d6(localStorage,e.path,At),y(C,f6(localStorage,e.path),!0),y(A,!1)}function Y(){B=!0,J+=1,clearTimeout(H),H=setTimeout(()=>void T(),I)}function X(Ee,Ue){const $e=l(E)[Ee]??"";l(E)[Ee]=Ue,Y(),$e!==""&&$e!==Ue&&te($e)}async function te(Ee){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Ee))return;Object.values(l(E)).some($e=>typeof $e=="string"&&$e.includes(Ee))||await gN(l(f),Ee)}async function T(){var $e;if(clearTimeout(H),!B)return;const Ee=J,Ue=dp(e.item,l(_),l(E),l(a));Os.saving();try{await zg(e.path,Ue),J===Ee&&(B=!1),Os.saved(),($e=e.onsaved)==null||$e.call(e,e.path,l(E).title??e.item.title,l(a))}catch{Os.failed(()=>void T())}}async function D(){l(C)===null||!await yl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(y(E,{...l(C)},!0),Y())}const v=new Set(["text","code"]);function R(Ee,Ue){return Ee.maxLength!==void 0&&Ee.minLength!==void 0?`${Ue} / ${Ee.maxLength} characters (min ${Ee.minLength})`:Ee.maxLength!==void 0?`${Ue} / ${Ee.maxLength} characters`:`${Ue} characters (min ${Ee.minLength})`}function k(Ee,Ue){return Ee.minLength!==void 0&&Ue>0&&Ue<Ee.minLength?!0:Ee.maxLength!==void 0&&Ue>Ee.maxLength}let O=Z(lt([])),W=Z(lt([]));const j=Ae(()=>l(C)!==null&&JSON.stringify(l(E))!==JSON.stringify(l(C))),M="nanoesis:preview-open";let $=Z(localStorage.getItem(M)==="true");function G(Ee){y($,Ee,!0),localStorage.setItem(M,String(Ee))}const ee=Ae(()=>{if(l(A))return null;try{return{...Ul(JSON.parse(dp(e.item,l(_),l(E),l(a)))),template:e.templateName}}catch{return null}}),le="nanoesis:preview-split",be=.2,pe=.8;function Ne(Ee){return Math.min(pe,Math.max(be,Ee))}function ce(){const Ee=Number(localStorage.getItem(le));return Number.isFinite(Ee)&&Ee>0?Ne(Ee):.5}let he=Z(lt(ce())),Se=Z(!1),ye;function Ie(Ee){Ee.preventDefault(),y(Se,!0),Ee.currentTarget.setPointerCapture(Ee.pointerId)}function xe(Ee){if(!l(Se))return;const Ue=ye.getBoundingClientRect();y(he,Ne((Ee.clientX-Ue.left)/Ue.width),!0)}function De(Ee){var Ue,$e;l(Se)&&(y(Se,!1),($e=(Ue=Ee.currentTarget).releasePointerCapture)==null||$e.call(Ue,Ee.pointerId),localStorage.setItem(le,String(l(he))))}function ze(Ee){const Ue=Ee.key==="ArrowLeft"?-.02:Ee.key==="ArrowRight"?.02:0;Ue!==0&&(Ee.preventDefault(),y(he,Ne(l(he)+Ue),!0),localStorage.setItem(le,String(l(he))))}var et=v8(),Vt=nt(et);let Qe;var Xt=S(Vt),nn=S(Xt);{const Ee=(Ve,fe=Pf)=>{var Zt=c8(),At=S(Zt),Rt=S(At),mn=x(Rt);{var Qn=Le=>{var Te=t8();q(Le,Te)};de(mn,Le=>{fe().required&&Le(Qn)})}var mr=x(mn,2),jn=S(mr),Ct=x(At,2);{var Js=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);e8(Le,{get value(){return l(Te)},get itemDir(){return l(f)},get labelledBy(){return l(Me)},placeholder:"Write…",onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},ea=Le=>{var Te=n8();let Me;se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength),Me=Je(Te,1,"svelte-1bn65uv",null,Me,{mono:fe().type==="code"})}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],gt=>l(E)[fe().name]=gt),q(Le,Te)},ta=Ae(()=>v.has(fe().type)),na=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);F6(Le,{get value(){return l(Te)},get itemDir(){return l(f)},get labelledBy(){return l(Me)},onchange:gt=>X(fe().name,gt)})}},ra=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);D6(Le,{get value(){return l(Te)},get itemDir(){return l(f)},get labelledBy(){return l(Me)},onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},He=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);N6(Le,{get value(){return l(Te)},get labelledBy(){return l(Me)},onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},Lt=Le=>{{let Te=Ae(()=>l(E)[fe().name]??""),Me=Ae(()=>`lbl-${fe().name}`);nS(Le,{get value(){return l(Te)},get labelledBy(){return l(Me)},onchange:gt=>{l(E)[fe().name]=gt,Y()}})}},Yt=Le=>{var Te=r8();se(()=>ve(Te,"id",`f-${fe().name}`)),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},Sn=Le=>{var Te=s8();se(()=>ve(Te,"id",`f-${fe().name}`)),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},gn=Le=>{var Te=a8();se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength)}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},Ft=Le=>{var Te=i8();se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength)}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)},pt=Le=>{var Te=o8();se(()=>{ve(Te,"id",`f-${fe().name}`),ve(Te,"maxlength",fe().maxLength),ve(Te,"minlength",fe().minLength)}),ae("input",Te,Y),vt(Te,()=>l(E)[fe().name],Me=>l(E)[fe().name]=Me),q(Le,Te)};de(Ct,Le=>{fe().type==="richtext"?Le(Js):l(ta)?Le(ea,1):fe().type==="image"?Le(na,2):fe().type==="file"?Le(ra,3):fe().type==="authors"?Le(He,4):fe().type==="url"?Le(Lt,5):fe().type==="date"?Le(Yt,6):fe().type==="time"?Le(Sn,7):fe().type==="email"?Le(gn,8):fe().type==="phone"?Le(Ft,9):Le(pt,-1)})}var zt=x(Ct,2);{var Ut=Le=>{var Te=u8(),Me=S(Te);se(()=>oe(Me,fe().help)),q(Le,Te)};de(zt,Le=>{fe().help&&Le(Ut)})}var Dn=x(zt,2);{var yt=Le=>{const Te=Ae(()=>(l(E)[fe().name]??"").length);var Me=l8();let gt;var Wt=S(Me);se((sa,zi)=>{gt=Je(Me,1,"hint count svelte-1bn65uv",null,gt,sa),oe(Wt,zi)},[()=>({over:k(fe(),l(Te))}),()=>R(fe(),l(Te))]),q(Le,Me)};de(Dn,Le=>{(fe().minLength!==void 0||fe().maxLength!==void 0)&&Le(yt)})}se(Le=>{ve(At,"id",`lbl-${fe().name}`),ve(At,"for",Le),oe(Rt,`${fe().label??""} `),oe(jn,fe().multiple?"references":fe().type)},[()=>b(fe())]),q(Ve,Zt)};var qt=S(nn),yn=S(qt),rn=S(yn),Bt=x(rn,2),jt=S(Bt),Rn=x(yn,2),qn=S(Rn),Tt=S(qn);{var kt=Ve=>{var fe=d8();ae("click",fe,D),q(Ve,fe)};de(Tt,Ve=>{l(j)&&Ve(kt)})}var Qt=x(Tt,2);{var _t=Ve=>{var fe=f8(),Zt=S(fe);wh(Zt,{size:16,"aria-hidden":"true"}),ae("click",fe,h),q(Ve,fe)};de(Qt,Ve=>{e.onchangetemplate&&Ve(_t)})}var un=x(Qt,2);let Ue;var $t=x(un,2);let $e;var Xn=S($t),pr=x(qn,2),Nn=x(S(pr),2),Ur=x(qt,2);{var K=Ve=>{var fe=h8();q(Ve,fe)},ge=Ve=>{var fe=p8();q(Ve,fe)},we=Ve=>{var fe=g8(),Zt=nt(fe);It(Zt,17,()=>l(O),mn=>mn.name,(mn,Qn)=>{Ee(mn,()=>l(Qn))});var At=x(Zt,2);{var Rt=mn=>{var Qn=m8(),mr=x(S(Qn),4);It(mr,17,()=>l(W),jn=>jn.name,(jn,Ct)=>{Ee(jn,()=>l(Ct))}),q(mn,Qn)};de(At,mn=>{l(W).length>0&&mn(Rt)})}q(Ve,fe)};de(Ur,Ve=>{l(A)?Ve(K):l(O).length===0&&l(W).length===0?Ve(ge,1):Ve(we,-1)})}se(()=>{oe(jt,e.templateName),Ue=Je(un,1,"preview-toggle svelte-1bn65uv",null,Ue,{active:l($)}),ve(un,"aria-pressed",l($)),$e=Je($t,1,"publish-btn svelte-1bn65uv",null,$e,{on:l(a)}),ve($t,"aria-pressed",l(a)),ve($t,"title",l(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),oe(Xn,l(a)?"Publish":"Don't Publish")}),ae("input",rn,Y),vt(rn,()=>l(E).title,Ve=>l(E).title=Ve),ae("click",un,()=>G(!l($))),ae("click",$t,o),ae("input",Nn,Y),vt(Nn,()=>l(E).published,Ve=>l(E).published=Ve)}var We=x(Xt,2);{var ht=Ee=>{var Ue=b8(),$e=nt(Ue),Ve=x($e,2),fe=S(Ve);uS(fe,{get path(){return e.path},get previewItem(){return l(ee)},onclose:()=>G(!1)}),se((Zt,At,Rt)=>{ve($e,"aria-valuemin",Zt),ve($e,"aria-valuemax",At),ve($e,"aria-valuenow",Rt)},[()=>Math.round(be*100),()=>Math.round(pe*100),()=>Math.round(l(he)*100)]),ae("pointerdown",$e,Ie),ae("pointermove",$e,xe),ae("pointerup",$e,De),Be("pointercancel",$e,De),ae("keydown",$e,ze),q(Ee,Ue)};de(We,Ee=>{l($)&&Ee(ht)})}pn(Vt,Ee=>ye=Ee,()=>ye);var Ke=x(Vt,2);{var xt=Ee=>{{let Ue=Ae(()=>e.onrename?()=>(y(u,!1),e.onrename()):void 0),$e=Ae(()=>e.ondelete?()=>(y(u,!1),e.ondelete()):void 0),Ve=Ae(()=>e.onmove?fe=>(y(u,!1),e.onmove(fe)):void 0);K6(Ee,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return l(f)},get folders(){return l(d)},onchangetemplate:fe=>{y(u,!1),g(fe)},get onrename(){return l(Ue)},get ondelete(){return l($e)},get onmove(){return l(Ve)},onclose:()=>y(u,!1)})}};de(Ke,Ee=>{l(u)&&e.onchangetemplate&&Ee(xt)})}se(()=>{Qe=Je(Vt,1,"layout svelte-1bn65uv",null,Qe,{split:l($),dragging:l(Se)}),Am(Xt,l($)?`flex-basis:${l(he)*100}%`:void 0)}),Be("submit",nn,Ee=>Ee.preventDefault()),ae("focusout",nn,()=>void T()),q(t,et),dt()}bt(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const Tv=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,T8="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 Io=Z("idle"),al=Z(lt([])),il=Z(lt([])),td=Z(!1),nd;async function v1(){y(Io,"checking");try{const t=await dN();y(al,[...t.errors],!0),y(il,[...t.warnings],!0),y(Io,"done")}catch{y(Io,"error")}}const En={get status(){return l(Io)},get errors(){return l(al)},get warnings(){return l(il)},get count(){return l(al).length+l(il).length},get hasProblems(){return l(Io)==="done"&&l(al).length+l(il).length>0},get panelOpen(){return l(td)},refresh(){return clearTimeout(nd),v1()},scheduleRefresh(t=1200){clearTimeout(nd),nd=setTimeout(()=>void v1(),t)},openPanel(){y(td,!0)},closePanel(){y(td,!1)}};var _8=z('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),A8=z('<button type="button" class="problems svelte-jz8lnl"> </button>'),y8=z('<footer><div class="credit svelte-jz8lnl"><img class="logo svelte-jz8lnl" alt="" width="20" height="20"/> <span>nanoesis by <a target="_blank" rel="noopener noreferrer" class="svelte-jz8lnl">xtrable ltd</a></span></div> <div aria-live="polite"><span> </span> <!></div> <!> <a class="xtrable svelte-jz8lnl" target="_blank" rel="noopener noreferrer" aria-label="xtrable ltd"><img alt="xtrable" width="24" height="24" class="svelte-jz8lnl"/></a></footer>');function N8(t,e){ct(e,!0);const n=Ae(()=>Os.state==="saving"?"Saving…":Os.state==="error"?"Save failed":"Saved");Dt(()=>{ph.value,En.scheduleRefresh()});const r=Ae(()=>En.count),s="https://xtrable.com/";var a=y8();let i;var o=S(a),u=S(o),d=x(u,2),h=x(S(d));ve(h,"href",s);var g=x(o,2);let f;var m=S(g),b=S(m),_=x(m,2);{var A=B=>{var J=_8();ae("click",J,()=>Os.retry()),q(B,J)};de(_,B=>{Os.canRetry&&B(A)})}var E=x(g,2);{var C=B=>{var J=A8(),F=S(J);se(()=>oe(F,`${l(r)??""}
123
+ ${l(r)===1?"problem":"problems"}`)),ae("click",J,()=>En.openPanel()),q(B,J)};de(E,B=>{En.hasProblems&&B(C)})}var I=x(E,2);ve(I,"href",s);var H=S(I);se(()=>{i=Je(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":En.hasProblems}),ve(u,"src",Tv),f=Je(g,1,"save svelte-jz8lnl",null,f,{error:Os.state==="error"}),oe(b,l(n)),ve(H,"src",T8)}),q(t,a),dt()}bt(["click"]);var S8=z("<option> </option>"),w8=z("<option>Top level</option>"),I8=z("<option> </option>"),C8=z('<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Move</h3> <div class="manage svelte-1uvxo8j"><label class="grow svelte-1uvxo8j"><span class="visually-hidden svelte-1uvxo8j">Move to folder</span> <select class="svelte-1uvxo8j"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-1uvxo8j">Move</button></div></div>'),L8=z(`<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Manage folder</h3> <div class="manage svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">New subfolder…</button> <button type="button" class="ghost svelte-1uvxo8j">Change URL…</button> <button type="button" class="ghost danger svelte-1uvxo8j">Delete folder…</button></div> <p class="help svelte-1uvxo8j">“Change URL” renames this folder’s slug (its address). Its name in the tree is its section
124
+ page’s title.</p></div>`),O8=z('<p class="error svelte-1uvxo8j" role="alert"> </p>'),x8=z('<dialog aria-label="Folder settings" class="svelte-1uvxo8j"><form><h2 class="svelte-1uvxo8j">Folder settings</h2> <p class="path svelte-1uvxo8j"> </p> <label class="svelte-1uvxo8j"><span class="svelte-1uvxo8j">Default template</span> <select class="svelte-1uvxo8j"><option>(none, items must set their own)</option><!></select> <span class="help svelte-1uvxo8j">New items here inherit this template unless they pick their own. Stored in the folder’s <code>_sort.json</code>.</span></label> <!> <!> <!> <div class="actions svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">Cancel</button> <button type="submit" class="primary svelte-1uvxo8j">Save</button></div></form></dialog>');function R8(t,e){ct(e,!0);const n=ir(e,"folders",19,()=>[]);let r=Z(""),s=Z(!0),a=Z(null),i;const o=Ae(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),u=Ae(()=>n().filter(v=>v!==e.folderPath&&v!==l(o)&&!v.startsWith(`${e.folderPath}/`))),d=" ";let h=Z(d);Ua(()=>{i.showModal(),AN(e.folderPath).then(v=>{y(r,v,!0)}).finally(()=>{y(s,!1)})});async function g(v){v.preventDefault(),y(a,null);try{await yN(e.folderPath,l(r)),e.onsaved()}catch(R){y(a,R instanceof Error?R.message:String(R),!0)}}var f=x8(),m=S(f),b=x(S(m),2),_=S(b),A=x(b,2),E=x(S(A),2),C=S(E);C.value=C.__value="";var I=x(C);It(I,16,()=>e.templates,v=>v,(v,R)=>{var k=S8(),O=S(k),W={};se(()=>{oe(O,R),W!==(W=R)&&(k.value=(k.__value=R)??"")}),q(v,k)});var H=x(A,2);{var B=v=>{var R=C8(),k=x(S(R),2),O=S(k),W=x(S(O),2),j=S(W);j.value=j.__value=d;var M=x(j);{var $=le=>{var be=w8();be.value=be.__value="",q(le,be)};de(M,le=>{l(o)!==""&&le($)})}var G=x(M);It(G,16,()=>l(u),le=>le,(le,be)=>{var pe=I8(),Ne=S(pe),ce={};se(()=>{oe(Ne,`${be??""}/`),ce!==(ce=be)&&(pe.value=(pe.__value=be)??"")}),q(le,pe)});var ee=x(O,2);se(()=>ee.disabled=l(h)===d),xa(W,()=>l(h),le=>y(h,le)),ae("click",ee,()=>e.onmove(l(h))),q(v,R)};de(H,v=>{e.onmove&&v(B)})}var J=x(H,2);{var F=v=>{var R=L8(),k=x(S(R),2),O=S(k),W=x(O,2),j=x(W,2);ae("click",O,function(...M){var $;($=e.onnewsubfolder)==null||$.apply(this,M)}),ae("click",W,function(...M){var $;($=e.onrenamefolder)==null||$.apply(this,M)}),ae("click",j,function(...M){var $;($=e.ondeletefolder)==null||$.apply(this,M)}),q(v,R)};de(J,v=>{e.folderPath!==""&&v(F)})}var Y=x(J,2);{var X=v=>{var R=O8(),k=S(R);se(()=>oe(k,l(a))),q(v,R)};de(Y,v=>{l(a)&&v(X)})}var te=x(Y,2),T=S(te),D=x(T,2);pn(f,v=>i=v,()=>i),se(()=>{oe(_,e.folderPath===""?"/ (root)":`${e.folderPath}/`),E.disabled=l(s),D.disabled=l(s)}),Be("cancel",f,function(...v){var R;(R=e.oncancel)==null||R.apply(this,v)}),Be("close",f,function(...v){var R;(R=e.oncancel)==null||R.apply(this,v)}),Be("submit",m,g),xa(E,()=>l(r),v=>y(r,v)),ae("click",T,function(...v){var R;(R=e.oncancel)==null||R.apply(this,v)}),q(t,f),dt()}bt(["click"]);var D8=z("<option></option>"),k8=z("<option> </option>"),P8=z('<p class="error svelte-1t0ew8l" role="alert"> </p>'),M8=z('<dialog aria-label="New content item" class="svelte-1t0ew8l"><form><h2 class="svelte-1t0ew8l">New content item</h2> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Title</span> <input required="" class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Slug</span> <input class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Folder</span> <input list="folder-options" placeholder="/ (root), or type a new folder" class="svelte-1t0ew8l"/> <datalist id="folder-options"></datalist> <span class="help svelte-1t0ew8l">Pick an existing folder or type a new path to create it.</span></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Template</span> <select class="svelte-1t0ew8l"><option>Inherit the folder’s default</option><!></select> <span class="help svelte-1t0ew8l">A folder’s default is set in its folder settings (the gear button in the tree).</span></label> <!> <div class="actions svelte-1t0ew8l"><button type="button" class="ghost svelte-1t0ew8l">Cancel</button> <button type="submit" class="primary svelte-1t0ew8l">Create</button></div></form></dialog>');function B8(t,e){ct(e,!0);let n=Z(""),r=Z(""),s=Z(""),a=Z(""),i=!1,o=Z(null),u;Ua(()=>u.showModal());function d(){i||y(r,ps(l(n)),!0)}async function h(D){D.preventDefault(),y(o,null);const v=ps(l(r)||l(n));if(v===""){y(o,"A title or slug is required.");return}const R=l(s).split("/").map(O=>ps(O)).filter(O=>O!=="").join("/"),k=R===""?v:`${R}/${v}`;try{await Kg(k,l(n).trim()||v,l(a)),e.oncreated(k)}catch(O){y(o,O instanceof Error?O.message:String(O),!0)}}var g=M8(),f=S(g),m=x(S(f),2),b=x(S(m),2);Li(b,!0);var _=x(m,2),A=x(S(_),2),E=x(_,2),C=x(S(E),2),I=x(C,2);It(I,20,()=>e.folders,D=>D,(D,v)=>{var R=D8(),k={};se(()=>{k!==(k=v)&&(R.value=(R.__value=v)??"")}),q(D,R)});var H=x(E,2),B=x(S(H),2),J=S(B);J.value=J.__value="";var F=x(J);It(F,16,()=>e.templates,D=>D,(D,v)=>{var R=k8(),k=S(R),O={};se(()=>{oe(k,v),O!==(O=v)&&(R.value=(R.__value=v)??"")}),q(D,R)});var Y=x(H,2);{var X=D=>{var v=P8(),R=S(v);se(()=>oe(R,l(o))),q(D,v)};de(Y,D=>{l(o)&&D(X)})}var te=x(Y,2),T=S(te);pn(g,D=>u=D,()=>u),se(D=>ve(A,"placeholder",D),[()=>ps(l(n))||"my-item"]),Be("cancel",g,function(...D){var v;(v=e.oncancel)==null||v.apply(this,D)}),Be("close",g,function(...D){var v;(v=e.oncancel)==null||v.apply(this,D)}),Be("submit",f,h),ae("input",b,d),vt(b,()=>l(n),D=>y(n,D)),ae("input",A,()=>i=!0),vt(A,()=>l(r),D=>y(r,D)),vt(C,()=>l(s),D=>y(s,D)),xa(B,()=>l(a),D=>y(a,D)),ae("click",T,function(...D){var v;(v=e.oncancel)==null||v.apply(this,D)}),q(t,g),dt()}bt(["input","click"]);var F8=z("<option> </option>"),U8=z(`<div class="empty svelte-y9gf4p"><div class="card svelte-y9gf4p"><h1 class="svelte-y9gf4p"> </h1> <p class="svelte-y9gf4p">This section has no page yet, the page visitors see at <code class="svelte-y9gf4p"> </code>. Pick a template (a
125
+ 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 H8(t,e){ct(e,!0);const n=Ae(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=Z(""),s=Z(!1);function a(){y(s,!0),e.oncreate(l(r))}var i=U8(),o=S(i),u=S(o),d=S(u),h=x(u,2),g=x(S(h)),f=S(g),m=x(h,2),b=x(S(m),2),_=S(b);_.value=_.__value="";var A=x(_);It(A,16,()=>e.templates,I=>I,(I,H)=>{var B=F8(),J=S(B),F={};se(()=>{oe(J,H),F!==(F=H)&&(B.value=(B.__value=H)??"")}),q(I,B)});var E=x(m,2),C=S(E);se(()=>{oe(d,e.name),oe(f,l(n)),b.disabled=l(s),E.disabled=l(s),oe(C,l(s)?"Creating…":"Create page")}),xa(b,()=>l(r),I=>y(r,I)),ae("click",E,a),q(t,i),dt()}bt(["click"]);const _v="nanoesis:sidebar-width",q8=180,j8=560,$8=260;function Av(t){return Math.min(j8,Math.max(q8,Math.round(t)))}function Y8(){const t=Number(localStorage.getItem(_v));return Number.isFinite(t)&&t>0?Av(t):$8}let Cl=Y8();function yv(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${Cl}px`)}yv();function z8(){return Cl}function W8(t){Cl=Av(t),yv(),localStorage.setItem(_v,String(Cl))}var G8=z('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function K8(t,e){ct(e,!0);let n=Z(null);function r(u){u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),y(n,{startX:u.clientX,startWidth:z8()},!0)}function s(u){l(n)!==null&&W8(l(n).startWidth+(u.clientX-l(n).startX))}function a(u){var d,h;l(n)!==null&&((h=(d=u.currentTarget).releasePointerCapture)==null||h.call(d,u.pointerId),y(n,null))}var i=G8();let o;se(()=>o=Je(i,1,"resizer svelte-1jo2gqq",null,o,{dragging:l(n)!==null})),ae("pointerdown",i,r),ae("pointermove",i,s),ae("pointerup",i,a),Be("pointercancel",i,a),q(t,i),dt()}bt(["pointerdown","pointermove","pointerup"]);const Nv={"content-type":"application/json"};async function V8(){const t=await Ge("/api/migrations");if(!t.ok)throw new Error(`Failed to load migrations (HTTP ${t.status}).`);return await t.json()}async function mD(t){const e=await Ge(`/api/migrations/preview?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load migration preview (HTTP ${e.status}).`);return await e.json()}async function gD(t,e){const n=await Ge("/api/migrations/apply",{method:"POST",headers:Nv,body:JSON.stringify({path:t,resolution:e})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error??`Migration failed (HTTP ${n.status}).`)}return await n.json()}async function bD(t,e){const n=await Ge("/api/templates/stamp",{method:"POST",headers:Nv,body:JSON.stringify({name:t,kind:e})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Stamp failed (HTTP ${n.status}).`)}return await n.json()}function X8(){let t=Z(0),e=Z(null),n=Z(!1),r=Z(null),s=!1;async function a(){y(n,!0),y(r,null);try{const i=await V8();y(e,i,!0),y(t,i.items.length,!0),s=!0}catch(i){y(r,i instanceof Error?i.message:String(i),!0)}finally{y(n,!1)}}return{get count(){return l(t)},get list(){return l(e)},get loading(){return l(n)},get error(){return l(r)},async ensureLoaded(){s||l(n)||await a()},refresh:a}}const zu=X8();var Q8=z(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),Z8=z('<p class="error svelte-fna247" role="alert"> </p>'),J8=z('<p class="success svelte-fna247" role="status">Password updated.</p>'),e5=z('<dialog aria-label="Change password" class="svelte-fna247"><h2 class="svelte-fna247">Change password</h2> <p class="lede svelte-fna247">You stay signed in here. Other sessions of yours (other devices, other tabs) are signed out.</p> <form class="svelte-fna247"><label class="svelte-fna247"><span class="svelte-fna247">Current password</span> <input type="password" autocomplete="current-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">New password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">Confirm new password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/> <!></label> <!> <!> <div class="actions svelte-fna247"><button type="button" class="ghost svelte-fna247">Cancel</button> <button type="submit" class="primary svelte-fna247"> </button></div></form></dialog>');function t5(t,e){ct(e,!0);let n=ir(e,"open",15),r=Z(void 0),s=Z(""),a=Z(""),i=Z(""),o=Z(!1),u=Z(null),d=Z(!1);Dt(()=>{l(r)&&(n()&&!l(r).open?(y(s,""),y(a,""),y(i,""),y(u,null),y(d,!1),y(o,!1),l(r).showModal()):!n()&&l(r).open&&l(r).close())});let h=Ae(()=>l(a)!==""&&l(i)!==""&&l(a)!==l(i)),g=Ae(()=>!l(o)&&l(s)!==""&&l(a)!==""&&!l(h));async function f(O){if(O.preventDefault(),!l(g))return;y(o,!0),y(u,null);const W=await ut.changePassword(l(s),l(a));if(y(o,!1),!W.ok){const j=W.error??"Password change failed.";y(u,j.includes("credentials")?"Current password is incorrect.":j,!0);return}y(d,!0),setTimeout(()=>{n(!1)},900)}function m(O){O.preventDefault(),n(!1)}var b=e5(),_=x(S(b),4),A=S(_),E=x(S(A),2),C=x(A,2),I=x(S(C),2),H=x(C,2),B=x(S(H),2),J=x(B,2);{var F=O=>{var W=Q8();q(O,W)};de(J,O=>{l(h)&&O(F)})}var Y=x(H,2);{var X=O=>{var W=Z8(),j=S(W);se(()=>oe(j,l(u))),q(O,W)};de(Y,O=>{l(u)&&O(X)})}var te=x(Y,2);{var T=O=>{var W=J8();q(O,W)};de(te,O=>{l(d)&&O(T)})}var D=x(te,2),v=S(D),R=x(v,2),k=S(R);pn(b,O=>y(r,O),()=>l(r)),se(()=>{R.disabled=!l(g),oe(k,l(o)?"Updating…":"Update password")}),Be("cancel",b,m),Be("submit",_,f),vt(E,()=>l(s),O=>y(s,O)),vt(I,()=>l(a),O=>y(a,O)),vt(B,()=>l(i),O=>y(i,O)),ae("click",v,()=>n(!1)),q(t,b),dt()}bt(["click"]);var n5=z(`<label class="svelte-szf2lz"><span class="svelte-szf2lz"> </span> <textarea readonly="" rows="3" class="svelte-szf2lz"></textarea></label> <p class="warn svelte-szf2lz" role="status">Copy it now, you won't be able to see it again.</p> <div class="actions svelte-szf2lz"><button type="button" class="ghost svelte-szf2lz">Done</button> <button type="button" class="primary svelte-szf2lz"> </button></div>`,1),r5=z('<p class="error svelte-szf2lz" role="alert"> </p>'),s5=z('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),a5=z('<!> <!> <div class="actions svelte-szf2lz"><button type="button" class="danger svelte-szf2lz">Revoke all</button> <span class="spacer svelte-szf2lz"></span> <button type="button" class="ghost svelte-szf2lz">Cancel</button> <button type="button" class="primary svelte-szf2lz"> </button></div>',1),i5=z(`<dialog aria-label="MCP access token" class="svelte-szf2lz"><h2 class="svelte-szf2lz">MCP access token</h2> <p class="lede svelte-szf2lz">A token lets an AI client (through the MCP server) read and edit this site as you, with your
124
126
  role. Paste it into your client's config as a Bearer token. It keeps working after you sign out,
125
- so treat it like a password.</p> <!></dialog>`);function s5(t,e){ct(e,!0);let n=ir(e,"open",15),r=Z(void 0),s=Z(!1),a=Z(null),i=Z(null),o=Z(null),u=Z(!1),d=Z(!1);Dt(()=>{l(r)&&(n()&&!l(r).open?(y(s,!1),y(a,null),y(i,null),y(o,null),y(u,!1),y(d,!1),l(r).showModal()):!n()&&l(r).open&&l(r).close())});let h=Ae(()=>l(o)===null?"":new Date(l(o)).toLocaleDateString());async function g(){y(s,!0),y(a,null),y(d,!1),y(u,!1);const H=await ut.createMcpToken();if(y(s,!1),!H.ok||H.token===void 0){y(a,H.error??"Could not create a token.",!0);return}y(i,H.token,!0),y(o,H.expiresAt??null,!0)}async function f(){if(l(i)!==null)try{await navigator.clipboard.writeText(l(i)),y(u,!0)}catch{y(u,!1)}}async function m(){y(s,!0),y(a,null);const H=await ut.revokeMcpTokens();if(y(s,!1),!H.ok){y(a,H.error??"Could not revoke tokens.",!0);return}y(i,null),y(o,null),y(d,!0)}function b(H){var B;(B=H.currentTarget)==null||B.select()}function _(H){H.preventDefault(),n(!1)}var A=r5(),E=x(S(A),4);{var C=H=>{var B=J8(),J=nt(B),F=S(J),Y=S(F),X=x(F,2),te=x(J,4),T=S(te),D=x(T,2),v=S(D);se(()=>{oe(Y,`Your new token${l(h)?` · expires ${l(h)}`:""}`),ET(X,l(i)),oe(v,l(u)?"Copied":"Copy token")}),ae("click",X,b),ae("click",T,()=>n(!1)),ae("click",D,f),q(H,B)},I=H=>{var B=n5(),J=nt(B);{var F=k=>{var O=e5(),W=S(O);se(()=>oe(W,l(a))),q(k,O)};de(J,k=>{l(a)&&k(F)})}var Y=x(J,2);{var X=k=>{var O=t5();q(k,O)};de(Y,k=>{l(d)&&k(X)})}var te=x(Y,2),T=S(te),D=x(T,4),v=x(D,2),R=S(v);se(()=>{T.disabled=l(s),v.disabled=l(s),oe(R,l(s)?"Working…":"Create token")}),ae("click",T,m),ae("click",D,()=>n(!1)),ae("click",v,g),q(H,B)};de(E,H=>{l(i)!==null?H(C):H(I,-1)})}pn(A,H=>y(r,H),()=>l(r)),Be("cancel",A,_),q(t,A),dt()}bt(["click"]);var a5=z('<details class="menu svelte-1y2gtaj"><summary aria-label="Account menu" class="svelte-1y2gtaj"><span class="label svelte-1y2gtaj"> </span> <span class="caret svelte-1y2gtaj" aria-hidden="true">▾</span></summary> <ul role="menu" class="svelte-1y2gtaj"><li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Change password…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">MCP access token…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Log out</button></li></ul></details> <!> <!>',1);function i5(t,e){ct(e,!0);let n=Z(!1),r=Z(!1),s=Ae(()=>{var m;return((m=ut.principal)==null?void 0:m.username)??""});function a(){l(d)&&(l(d).open=!1)}function i(){a(),y(n,!0)}function o(){a(),y(r,!0)}async function u(){a(),await ut.logout()}let d=Z(void 0);Dt(()=>{function m(b){l(d)&&l(d).open&&!l(d).contains(b.target)&&(l(d).open=!1)}return document.addEventListener("click",m),()=>document.removeEventListener("click",m)});var h=Gn(),g=nt(h);{var f=m=>{var b=a5(),_=nt(b),A=S(_),E=S(A),C=S(E),I=x(A,2),H=S(I),B=S(H),J=x(H,2),F=S(J),Y=x(J,2),X=S(Y);pn(_,D=>y(d,D),()=>l(d));var te=x(_,2);Z8(te,{get open(){return l(n)},set open(D){y(n,D,!0)}});var T=x(te,2);s5(T,{get open(){return l(r)},set open(D){y(r,D,!0)}}),se(()=>oe(C,l(s))),ae("click",B,i),ae("click",F,o),ae("click",X,u),q(m,b)};de(g,m=>{ut.status==="authenticated"&&ut.principal!==null&&m(f)})}q(t,h),dt()}bt(["click"]);var o5=z('<p class="error svelte-1e3birj" role="alert"> </p>'),u5=z('<p class="ok svelte-1e3birj" role="status"> </p>'),l5=z('<img alt="Current logo" class="svelte-1e3birj"/>'),c5=z('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),d5=z('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),f5=z(`<div class="panel svelte-1e3birj"><p class="lede svelte-1e3birj">Replace the editor's top-left logo and name with your own. Leave the name blank to use the
126
- 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 h5(t,e){ct(e,!0);let n=Z(lt(Ln.name??"")),r=Z(!1),s=Z(!1),a=Z(null),i=Z(null),o=Z(void 0);function u(j){y(i,j,!0),setTimeout(()=>y(i,null),1500)}async function d(){y(r,!0),y(a,null);const j=l(n).trim(),M=await Oy(j===""?null:j);if(y(r,!1),!M.ok){y(a,M.error,!0);return}await Ln.load(),u("Name saved.")}async function h(j){var ee;const M=j.currentTarget,$=(ee=M.files)==null?void 0:ee[0];if($===void 0)return;y(s,!0),y(a,null);const G=await xy($);if(y(s,!1),M.value="",!G.ok){y(a,G.error,!0);return}await Ln.load(),u("Logo updated.")}async function g(){y(a,null);const j=await Ry();if(!j.ok){y(a,j.error,!0);return}await Ln.load(),u("Logo removed.")}var f=f5(),m=x(S(f),2);{var b=j=>{var M=o5(),$=S(M);se(()=>oe($,l(a))),q(j,M)};de(m,j=>{l(a)&&j(b)})}var _=x(m,2);{var A=j=>{var M=u5(),$=S(M);se(()=>oe($,l(i))),q(j,M)};de(_,j=>{l(i)&&j(A)})}var E=x(_,2),C=x(S(E),2),I=S(C),H=x(I,2),B=S(H),J=x(E,2),F=x(S(J),2),Y=S(F),X=S(Y);{var te=j=>{var M=l5();se(()=>ve(M,"src",Ln.logoUrl)),q(j,M)},T=j=>{var M=c5();q(j,M)};de(X,j=>{Ln.logoUrl?j(te):j(T,-1)})}var D=x(Y,2),v=S(D);pn(v,j=>y(o,j),()=>l(o));var R=x(v,2),k=S(R),O=x(R,2);{var W=j=>{var M=d5();ae("click",M,g),q(j,M)};de(O,j=>{Ln.logoUrl&&j(W)})}se(()=>{H.disabled=l(r),oe(B,l(r)?"Saving…":"Save"),ve(Y,"aria-hidden",Ln.logoUrl===null),R.disabled=l(s),oe(k,l(s)?"Uploading…":Ln.logoUrl?"Replace logo…":"Upload logo…")}),vt(I,()=>l(n),j=>y(n,j)),ae("click",H,d),ae("change",v,h),ae("click",R,()=>{var j;return(j=l(o))==null?void 0:j.click()}),q(t,f),dt()}bt(["click","change"]);const p5={"content-type":"application/json"};async function m5(){const t=await Xe("/api/admin/diagnostics");if(t.status===404)throw new Error("Diagnostics are not available on this host.");if(!t.ok)throw new Error(`Couldn't load diagnostics (HTTP ${t.status}).`);return(await t.json()).findings}async function g5(t){const e=await Xe("/api/admin/diagnostics/repair",{method:"POST",headers:p5,body:JSON.stringify({id:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Repair failed (HTTP ${e.status}).`)}return(await e.json()).findings}var b5=z('<p class="error svelte-1iylrs" role="alert"> </p>'),v5=z('<p class="error svelte-1iylrs" role="alert"> </p>'),E5=z('<span class="all-good svelte-1iylrs">All checks passed.</span>'),T5=z('<span class="chip chip-error svelte-1iylrs"> </span>'),_5=z('<span class="chip chip-warning svelte-1iylrs"> </span>'),A5=z('<span class="chip chip-info svelte-1iylrs"> </span>'),y5=z("<!> <!> <!>",1),N5=z('<div class="finding-actions svelte-1iylrs"><button type="button" class="primary svelte-1iylrs"> </button></div>'),S5=z('<li><div class="finding-head svelte-1iylrs"><span> </span> <h3 class="svelte-1iylrs"> </h3></div> <p class="detail svelte-1iylrs"> </p> <!></li>'),w5=z('<ul class="findings svelte-1iylrs"></ul>'),I5=z(`<div class="panel svelte-1iylrs"><p class="lede svelte-1iylrs">A live check of your installation — what works, and what doesn't. Findings come from
127
- port-agnostic probes, so they catch problems regardless of how your storage and CDN are wired. <strong>Repair</strong> fixes that the engine can apply in place; advisory findings are everything else.</p> <!> <!> <div class="actions-bar svelte-1iylrs"><div class="summary svelte-1iylrs" aria-live="polite"><!></div> <button type="button" class="svelte-1iylrs"> </button></div> <!></div>`);function C5(t,e){ct(e,!0);let n=Z(!0),r=Z(null),s=Z(lt([])),a=Z(null),i=Z(null);const o={error:"Error",warning:"Warning",info:"Info"},u={error:0,warning:1,info:2},d=Ae(()=>[...l(s)].sort((D,v)=>u[D.severity]-u[v.severity])),h=Ae(()=>({error:l(s).filter(D=>D.severity==="error").length,warning:l(s).filter(D=>D.severity==="warning").length,info:l(s).filter(D=>D.severity==="info").length}));async function g(){y(n,!0),y(r,null);try{y(s,await m5(),!0)}catch(D){y(r,D instanceof Error?D.message:String(D),!0)}finally{y(n,!1)}}Dt(()=>{g()});async function f(D){if(D.repair){y(a,D.repair.id,!0),y(i,null);try{y(s,await g5(D.repair.id),!0)}catch(v){y(i,v instanceof Error?v.message:String(v),!0)}finally{y(a,null)}}}var m=I5(),b=x(S(m),2);{var _=D=>{var v=b5(),R=S(v);se(()=>oe(R,l(r))),q(D,v)};de(b,D=>{l(r)&&D(_)})}var A=x(b,2);{var E=D=>{var v=v5(),R=S(v);se(()=>oe(R,l(i))),q(D,v)};de(A,D=>{l(i)&&D(E)})}var C=x(A,2),I=S(C),H=S(I);{var B=D=>{var v=fl("Running checks…");q(D,v)},J=D=>{var v=E5();q(D,v)},F=D=>{var v=y5(),R=nt(v);{var k=$=>{var G=T5(),ee=S(G);se(()=>oe(ee,`${l(h).error??""} error${l(h).error===1?"":"s"}`)),q($,G)};de(R,$=>{l(h).error>0&&$(k)})}var O=x(R,2);{var W=$=>{var G=_5(),ee=S(G);se(()=>oe(ee,`${l(h).warning??""} warning${l(h).warning===1?"":"s"}`)),q($,G)};de(O,$=>{l(h).warning>0&&$(W)})}var j=x(O,2);{var M=$=>{var G=A5(),ee=S(G);se(()=>oe(ee,`${l(h).info??""} info`)),q($,G)};de(j,$=>{l(h).info>0&&$(M)})}q(D,v)};de(H,D=>{l(n)?D(B):l(s).length===0?D(J,1):D(F,-1)})}var Y=x(I,2),X=S(Y),te=x(C,2);{var T=D=>{var v=w5();It(v,21,()=>l(d),R=>R.id,(R,k)=>{var O=S5(),W=S(O),j=S(W),M=S(j),$=x(j,2),G=S($),ee=x(W,2),le=S(ee),be=x(ee,2);{var pe=Ne=>{var ce=N5(),he=S(ce),Se=S(he);se(()=>{he.disabled=l(a)!==null,oe(Se,l(a)===l(k).repair.id?"Repairing…":l(k).repair.label)}),ae("click",he,()=>f(l(k))),q(Ne,ce)};de(be,Ne=>{l(k).repair&&Ne(pe)})}se(()=>{Je(O,1,`finding finding-${l(k).severity??""}`,"svelte-1iylrs"),Je(j,1,`severity-tag severity-${l(k).severity??""}`,"svelte-1iylrs"),oe(M,o[l(k).severity]),oe(G,l(k).title),oe(le,l(k).detail)}),q(R,O)}),q(D,v)};de(te,D=>{!l(n)&&l(s).length>0&&D(T)})}se(()=>{Y.disabled=l(n),oe(X,l(n)?"Checking…":"Re-run checks")}),ae("click",Y,g),q(t,m),dt()}bt(["click"]);var L5=z('<p class="error svelte-8ydvuj" role="alert"> </p>'),O5=z('<p class="ok svelte-8ydvuj" role="status"> </p>'),x5=z(`<div class="panel svelte-8ydvuj"><p class="lede svelte-8ydvuj">The site's base URL, its public address, e.g. <code class="svelte-8ydvuj">https://example.com</code>. Setting it makes <code class="svelte-8ydvuj">publish</code> emit a <code class="svelte-8ydvuj">sitemap.xml</code> (and absolute links in the RSS feed). Leave it blank to skip the sitemap.</p> <!> <!> <section class="field svelte-8ydvuj"><label for="site-base-url" class="svelte-8ydvuj">Base URL</label> <div class="row svelte-8ydvuj"><input id="site-base-url" type="url" inputmode="url" placeholder="https://example.com" class="svelte-8ydvuj"/> <button type="button" class="primary svelte-8ydvuj"> </button></div> <small class="svelte-8ydvuj">No trailing slash needed. Used only to build absolute URLs in the sitemap and feed.</small></section></div>`);function R5(t,e){ct(e,!0);let n=Z(""),r=Z(!0),s=Z(!1),a=Z(null),i=Z(null);IN().then(I=>{y(n,I.baseUrl,!0),y(r,!1)});function o(I){y(i,I,!0),setTimeout(()=>y(i,null),1500)}async function u(){y(s,!0),y(a,null);try{await CN({baseUrl:l(n)}),o("Saved.")}catch(I){y(a,I instanceof Error?I.message:String(I),!0)}finally{y(s,!1)}}var d=x5(),h=x(S(d),2);{var g=I=>{var H=L5(),B=S(H);se(()=>oe(B,l(a))),q(I,H)};de(h,I=>{l(a)&&I(g)})}var f=x(h,2);{var m=I=>{var H=O5(),B=S(H);se(()=>oe(B,l(i))),q(I,H)};de(f,I=>{l(i)&&I(m)})}var b=x(f,2),_=x(S(b),2),A=S(_),E=x(A,2),C=S(E);se(()=>{A.disabled=l(r),E.disabled=l(r)||l(s),oe(C,l(s)?"Saving…":"Save")}),vt(A,()=>l(n),I=>y(n,I)),ae("click",E,u),q(t,d),dt()}bt(["click"]);async function D5(){const t=await Xe("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const Xh={"content-type":"application/json"};function k5(t){return qa("/api/users",{method:"POST",headers:Xh,body:JSON.stringify(t)})}function E1(t,e){return qa(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:Xh,body:JSON.stringify(e)})}function P5(t,e){return qa(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:Xh,body:JSON.stringify(e)})}function M5(t){return qa(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var B5=z('<p class="error svelte-plhp3i" role="alert"> </p>'),F5=z('<p class="muted svelte-plhp3i">Loading users…</p>'),U5=z('<p class="error svelte-plhp3i"> </p>'),H5=z('<span class="you svelte-plhp3i">(you)</span>'),q5=z('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),j5=z('<span class="you svelte-plhp3i">(you)</span>'),$5=z('<span class="username svelte-plhp3i"> <!></span>'),Y5=z('<span class="chip locked svelte-plhp3i">Locked</span>'),z5=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),W5=z('<tr><td class="svelte-plhp3i"><div class="who svelte-plhp3i"><!></div> <!></td><td class="svelte-plhp3i"><div class="roles svelte-plhp3i"></div></td><td class="row-actions svelte-plhp3i"><button type="button" class="link svelte-plhp3i">Edit name</button> <button type="button" class="link svelte-plhp3i">Reset password</button> <button type="button" class="link danger svelte-plhp3i">Delete</button></td></tr>'),G5=z('<table class="svelte-plhp3i"><thead><tr><th class="svelte-plhp3i">User</th><th class="svelte-plhp3i">Roles</th><th class="svelte-plhp3i"></th></tr></thead><tbody></tbody></table>'),K5=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),V5=z('<div class="panel svelte-plhp3i"><!> <section class="list"><!></section> <form class="create svelte-plhp3i"><h3 class="svelte-plhp3i">Add a user</h3> <div class="create-grid svelte-plhp3i"><label class="svelte-plhp3i"><span class="svelte-plhp3i">Username</span> <input type="text" autocomplete="off" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Display name <small class="optional svelte-plhp3i">(optional)</small></span> <input type="text" autocomplete="off" placeholder="Shown on bylines; defaults to the username" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Initial password</span> <input type="text" autocomplete="off" placeholder="Set a password" class="svelte-plhp3i"/></label> <fieldset class="roles-field svelte-plhp3i"><legend class="svelte-plhp3i">Roles</legend> <div class="roles svelte-plhp3i"></div></fieldset></div> <div class="create-actions svelte-plhp3i"><small class="svelte-plhp3i">Share the password with them; they can change it from their account menu.</small> <button type="submit" class="primary svelte-plhp3i"> </button></div></form></div>');function X5(t,e){ct(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=Z(lt([])),i=Z(!0),o=Z(null),u=Z(null),d=Z(""),h=Z(""),g=Z(""),f=Z(lt(["author"])),m=Z(!1);const b=Ae(()=>{var ce;return((ce=ut.principal)==null?void 0:ce.userId)??null}),_=Ae(()=>!l(m)&&l(d).trim()!==""&&l(g)!==""&&l(f).length>0);async function A(){y(i,!0),y(o,null);try{y(a,await D5(),!0)}catch(ce){y(o,ce instanceof Error?ce.message:String(ce),!0)}finally{y(i,!1)}}Dt(()=>{A()});async function E(ce){if(ce.preventDefault(),!l(_))return;y(m,!0),y(u,null);const he=await k5({username:l(d).trim(),password:l(g),roles:[...l(f)],...l(h).trim()!==""&&{displayName:l(h).trim()}});if(y(m,!1),!he.ok){y(u,he.error,!0);return}y(d,""),y(h,""),y(g,""),y(f,["author"],!0),await A()}async function C(ce){const he=await yo(`Display name for “${ce.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:ce.displayName??"",placeholder:ce.username});if(he===null)return;y(u,null);const Se=await E1(ce.id,{displayName:he});Se.ok||y(u,Se.error,!0),await A()}async function I(ce,he){const ye=ce.roles.includes(he)?ce.roles.filter(xe=>xe!==he):[...ce.roles,he];if(ye.length===0){y(u,"A user must keep at least one role."),await A();return}y(u,null);const Ie=await E1(ce.id,{roles:ye});Ie.ok||y(u,Ie.error,!0),await A()}async function H(ce){const he=await yo(`Set a new password for “${ce.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(he===null)return;y(u,null);const Se=await P5(ce.id,{newPassword:he});Se.ok||y(u,Se.error,!0)}async function B(ce){if(!await yl(`Delete the user “${ce.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;y(u,null);const Se=await M5(ce.id);if(!Se.ok){y(u,Se.error,!0);return}await A()}var J=V5(),F=S(J);{var Y=ce=>{var he=B5(),Se=S(he);se(()=>oe(Se,l(u))),q(ce,he)};de(F,ce=>{l(u)&&ce(Y)})}var X=x(F,2),te=S(X);{var T=ce=>{var he=F5();q(ce,he)},D=ce=>{var he=U5(),Se=S(he);se(()=>oe(Se,l(o))),q(ce,he)},v=ce=>{var he=G5(),Se=x(S(he));It(Se,21,()=>l(a),ye=>ye.id,(ye,Ie)=>{const xe=Ae(()=>l(Ie).id===l(b));var De=W5(),ze=S(De),et=S(ze),Vt=S(et);{var Qe=Tt=>{var kt=q5(),Qt=nt(kt),_t=S(Qt),un=x(_t);{var $t=Nn=>{var Ur=H5();q(Nn,Ur)};de(un,Nn=>{l(xe)&&Nn($t)})}var Xn=x(Qt,2),pr=S(Xn);se(()=>{oe(_t,l(Ie).displayName),oe(pr,l(Ie).username)}),q(Tt,kt)},Xt=Tt=>{var kt=$5(),Qt=S(kt),_t=x(Qt);{var un=$t=>{var Xn=j5();q($t,Xn)};de(_t,$t=>{l(xe)&&$t(un)})}se(()=>oe(Qt,l(Ie).username)),q(Tt,kt)};de(Vt,Tt=>{l(Ie).displayName?Tt(Qe):Tt(Xt,-1)})}var nn=x(et,2);{var qt=Tt=>{var kt=Y5();q(Tt,kt)};de(nn,Tt=>{l(Ie).locked&&Tt(qt)})}var yn=x(ze),rn=S(yn);It(rn,21,()=>r,xo,(Tt,kt)=>{var Qt=z5(),_t=S(Qt),un=x(_t);se($t=>{TT(_t,$t),_t.disabled=l(xe),oe(un,` ${s[l(kt)]??""}`)},[()=>l(Ie).roles.includes(l(kt))]),ae("change",_t,()=>I(l(Ie),l(kt))),q(Tt,Qt)});var Bt=x(yn),jt=S(Bt),Rn=x(jt,2),qn=x(Rn,2);se(()=>{ve(rn,"title",l(xe)?"You can't change your own roles":void 0),qn.disabled=l(xe),ve(qn,"title",l(xe)?"You can't delete your own account":void 0)}),ae("click",jt,()=>C(l(Ie))),ae("click",Rn,()=>H(l(Ie))),ae("click",qn,()=>B(l(Ie))),q(ye,De)}),q(ce,he)};de(te,ce=>{l(i)?ce(T):l(o)?ce(D,1):ce(v,-1)})}var R=x(X,2),k=x(S(R),2),O=S(k),W=x(S(O),2),j=x(O,2),M=x(S(j),2),$=x(j,2),G=x(S($),2),ee=x($,2),le=x(S(ee),2);It(le,21,()=>r,xo,(ce,he)=>{var Se=K5(),ye=S(Se),Ie,xe=x(ye);se(()=>{Ie!==(Ie=l(he))&&(ye.value=(ye.__value=l(he))??""),oe(xe,` ${s[l(he)]??""}`)}),yT(n,[],ye,()=>(l(he),l(f)),De=>y(f,De)),q(ce,Se)});var be=x(k,2),pe=x(S(be),2),Ne=S(pe);se(()=>{pe.disabled=!l(_),oe(Ne,l(m)?"Adding…":"Add user")}),Be("submit",R,E),vt(W,()=>l(d),ce=>y(d,ce)),vt(M,()=>l(h),ce=>y(h,ce)),vt(G,()=>l(g),ce=>y(g,ce)),q(t,J),dt()}bt(["change","click"]);var Q5=z('<dialog aria-label="Settings" class="svelte-1eaqpj"><header class="svelte-1eaqpj"><h2 class="svelte-1eaqpj">Settings</h2> <button type="button" class="close svelte-1eaqpj" aria-label="Close settings"><!></button></header> <div class="tabs svelte-1eaqpj" role="tablist" aria-label="Settings sections"><button type="button" role="tab">Users</button> <button type="button" role="tab">Branding</button> <button type="button" role="tab">Site</button> <button type="button" role="tab">Health</button></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function Z5(t,e){ct(e,!0);let n=ir(e,"open",15),r=Z(void 0),s=Z("users");Dt(()=>{l(r)&&(n()&&!l(r).open?(y(s,"users"),l(r).showModal()):!n()&&l(r).open&&l(r).close())});function a(X){X.preventDefault(),n(!1)}var i=Q5(),o=S(i),u=x(S(o),2),d=S(u);Ih(d,{size:18,"aria-hidden":"true"});var h=x(o,2),g=S(h);let f;var m=x(g,2);let b;var _=x(m,2);let A;var E=x(_,2);let C;var I=x(h,2),H=S(I);{var B=X=>{X5(X,{})},J=X=>{h5(X,{})},F=X=>{R5(X,{})},Y=X=>{C5(X,{})};de(H,X=>{l(s)==="users"?X(B):l(s)==="branding"?X(J,1):l(s)==="site"?X(F,2):X(Y,-1)})}pn(i,X=>y(r,X),()=>l(r)),se(()=>{ve(g,"aria-selected",l(s)==="users"),f=Je(g,1,"svelte-1eaqpj",null,f,{selected:l(s)==="users"}),ve(m,"aria-selected",l(s)==="branding"),b=Je(m,1,"svelte-1eaqpj",null,b,{selected:l(s)==="branding"}),ve(_,"aria-selected",l(s)==="site"),A=Je(_,1,"svelte-1eaqpj",null,A,{selected:l(s)==="site"}),ve(E,"aria-selected",l(s)==="health"),C=Je(E,1,"svelte-1eaqpj",null,C,{selected:l(s)==="health"})}),Be("cancel",i,a),ae("click",u,()=>n(!1)),ae("click",g,()=>y(s,"users")),ae("click",m,()=>y(s,"branding")),ae("click",_,()=>y(s,"site")),ae("click",E,()=>y(s,"health")),q(t,i),dt()}bt(["click"]);const rd="nanoesis-theme";function J5(t){return t==="system"||t==="light"||t==="dark"}function T1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function ex(){let t=Z("system"),e=Z(!1);const n=()=>{document.documentElement.dataset.theme=T1(l(t),l(e))};return{get choice(){return l(t)},get resolved(){return T1(l(t),l(e))},init(){const r=localStorage.getItem(rd);J5(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(rd):localStorage.setItem(rd,r),n()}}}const ol=ex();var tx=z('<button type="button"> </button>'),nx=z('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function rx(t,e){ct(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];Cm();var r=nx();It(r,5,()=>n,s=>s.value,(s,a)=>{var i=tx();let o;var u=S(i);se(()=>{o=Je(i,1,"option svelte-1cmi4dh",null,o,{selected:ol.choice===l(a).value}),ve(i,"aria-pressed",ol.choice===l(a).value),oe(u,l(a).label)}),ae("click",i,()=>ol.setChoice(l(a).value)),q(s,i)}),q(t,r),dt()}bt(["click"]);var sx=z('<span class="badge svelte-yic9pk"> </span>'),ax=z('<button type="button"> <!></button>'),ix=z('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),ox=z('<span class="spacer"></span>'),ux=z('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),lx=z('<header class="topbar svelte-yic9pk"><div class="brand svelte-yic9pk"><img class="logo svelte-yic9pk" alt="" width="24" height="24"/> </div> <!> <div class="actions svelte-yic9pk"><!> <button class="publish svelte-yic9pk" type="button"> </button> <!> <!></div></header> <!>',1);function cx(t,e){ct(e,!0);const n=Ae(()=>Ln.logoUrl??bv),r=Ae(()=>Ln.name??"nanoesis"),s=Ae(()=>ut.canAuthor&&ut.canDevelop);let a=Z(!1);Dt(()=>{ut.canDevelop&&!ut.canAuthor?Ar.set("templates"):ut.canAuthor&&!ut.canDevelop&&Ar.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"},{value:"migrations",label:"Migrations"}];async function o(T){T!==Ar.mode&&await nb("Switching workspaces will close this file.")&&Ar.set(T)}zu.ensureLoaded();let u=Z(!1);async function d(){if(!l(u)){y(u,!0);try{const T=await lN();if(T.ok){const D=T.summary;if(D===void 0){const v=T.written;await en(`Published ${v} file${v===1?"":"s"} to the live site.`,{title:"Published"})}else if(D.published===0)await en(D.firstPublishWarning??"Your site has no published pages. Toggle Publish on at least one page to go live.",{title:"Nothing went live"});else{const v=D.published,R=D.drafts,k=[`Published ${v} page${v===1?"":"s"} to the live site.`];R>0&&k.push("",`${R} draft${R===1?" was":"s were"} skipped.`),await en(k.join(`
127
+ so treat it like a password.</p> <!></dialog>`);function o5(t,e){ct(e,!0);let n=ir(e,"open",15),r=Z(void 0),s=Z(!1),a=Z(null),i=Z(null),o=Z(null),u=Z(!1),d=Z(!1);Dt(()=>{l(r)&&(n()&&!l(r).open?(y(s,!1),y(a,null),y(i,null),y(o,null),y(u,!1),y(d,!1),l(r).showModal()):!n()&&l(r).open&&l(r).close())});let h=Ae(()=>l(o)===null?"":new Date(l(o)).toLocaleDateString());async function g(){y(s,!0),y(a,null),y(d,!1),y(u,!1);const H=await ut.createMcpToken();if(y(s,!1),!H.ok||H.token===void 0){y(a,H.error??"Could not create a token.",!0);return}y(i,H.token,!0),y(o,H.expiresAt??null,!0)}async function f(){if(l(i)!==null)try{await navigator.clipboard.writeText(l(i)),y(u,!0)}catch{y(u,!1)}}async function m(){y(s,!0),y(a,null);const H=await ut.revokeMcpTokens();if(y(s,!1),!H.ok){y(a,H.error??"Could not revoke tokens.",!0);return}y(i,null),y(o,null),y(d,!0)}function b(H){var B;(B=H.currentTarget)==null||B.select()}function _(H){H.preventDefault(),n(!1)}var A=i5(),E=x(S(A),4);{var C=H=>{var B=n5(),J=nt(B),F=S(J),Y=S(F),X=x(F,2),te=x(J,4),T=S(te),D=x(T,2),v=S(D);se(()=>{oe(Y,`Your new token${l(h)?` · expires ${l(h)}`:""}`),AT(X,l(i)),oe(v,l(u)?"Copied":"Copy token")}),ae("click",X,b),ae("click",T,()=>n(!1)),ae("click",D,f),q(H,B)},I=H=>{var B=a5(),J=nt(B);{var F=k=>{var O=r5(),W=S(O);se(()=>oe(W,l(a))),q(k,O)};de(J,k=>{l(a)&&k(F)})}var Y=x(J,2);{var X=k=>{var O=s5();q(k,O)};de(Y,k=>{l(d)&&k(X)})}var te=x(Y,2),T=S(te),D=x(T,4),v=x(D,2),R=S(v);se(()=>{T.disabled=l(s),v.disabled=l(s),oe(R,l(s)?"Working…":"Create token")}),ae("click",T,m),ae("click",D,()=>n(!1)),ae("click",v,g),q(H,B)};de(E,H=>{l(i)!==null?H(C):H(I,-1)})}pn(A,H=>y(r,H),()=>l(r)),Be("cancel",A,_),q(t,A),dt()}bt(["click"]);var u5=z('<details class="menu svelte-1y2gtaj"><summary aria-label="Account menu" class="svelte-1y2gtaj"><span class="label svelte-1y2gtaj"> </span> <span class="caret svelte-1y2gtaj" aria-hidden="true">▾</span></summary> <ul role="menu" class="svelte-1y2gtaj"><li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Change password…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">MCP access token…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Log out</button></li></ul></details> <!> <!>',1);function l5(t,e){ct(e,!0);let n=Z(!1),r=Z(!1),s=Ae(()=>{var m;return((m=ut.principal)==null?void 0:m.username)??""});function a(){l(d)&&(l(d).open=!1)}function i(){a(),y(n,!0)}function o(){a(),y(r,!0)}async function u(){a(),await ut.logout()}let d=Z(void 0);Dt(()=>{function m(b){l(d)&&l(d).open&&!l(d).contains(b.target)&&(l(d).open=!1)}return document.addEventListener("click",m),()=>document.removeEventListener("click",m)});var h=Gn(),g=nt(h);{var f=m=>{var b=u5(),_=nt(b),A=S(_),E=S(A),C=S(E),I=x(A,2),H=S(I),B=S(H),J=x(H,2),F=S(J),Y=x(J,2),X=S(Y);pn(_,D=>y(d,D),()=>l(d));var te=x(_,2);t5(te,{get open(){return l(n)},set open(D){y(n,D,!0)}});var T=x(te,2);o5(T,{get open(){return l(r)},set open(D){y(r,D,!0)}}),se(()=>oe(C,l(s))),ae("click",B,i),ae("click",F,o),ae("click",X,u),q(m,b)};de(g,m=>{ut.status==="authenticated"&&ut.principal!==null&&m(f)})}q(t,h),dt()}bt(["click"]);var c5=z('<p class="error svelte-1e3birj" role="alert"> </p>'),d5=z('<p class="ok svelte-1e3birj" role="status"> </p>'),f5=z('<img alt="Current logo" class="svelte-1e3birj"/>'),h5=z('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),p5=z('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),m5=z(`<div class="panel svelte-1e3birj"><p class="lede svelte-1e3birj">Replace the editor's top-left logo and name with your own. Leave the name blank to use the
128
+ 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 g5(t,e){ct(e,!0);let n=Z(lt(Ln.name??"")),r=Z(!1),s=Z(!1),a=Z(null),i=Z(null),o=Z(void 0);function u(j){y(i,j,!0),setTimeout(()=>y(i,null),1500)}async function d(){y(r,!0),y(a,null);const j=l(n).trim(),M=await Dy(j===""?null:j);if(y(r,!1),!M.ok){y(a,M.error,!0);return}await Ln.load(),u("Name saved.")}async function h(j){var ee;const M=j.currentTarget,$=(ee=M.files)==null?void 0:ee[0];if($===void 0)return;y(s,!0),y(a,null);const G=await ky($);if(y(s,!1),M.value="",!G.ok){y(a,G.error,!0);return}await Ln.load(),u("Logo updated.")}async function g(){y(a,null);const j=await Py();if(!j.ok){y(a,j.error,!0);return}await Ln.load(),u("Logo removed.")}var f=m5(),m=x(S(f),2);{var b=j=>{var M=c5(),$=S(M);se(()=>oe($,l(a))),q(j,M)};de(m,j=>{l(a)&&j(b)})}var _=x(m,2);{var A=j=>{var M=d5(),$=S(M);se(()=>oe($,l(i))),q(j,M)};de(_,j=>{l(i)&&j(A)})}var E=x(_,2),C=x(S(E),2),I=S(C),H=x(I,2),B=S(H),J=x(E,2),F=x(S(J),2),Y=S(F),X=S(Y);{var te=j=>{var M=f5();se(()=>ve(M,"src",Ln.logoUrl)),q(j,M)},T=j=>{var M=h5();q(j,M)};de(X,j=>{Ln.logoUrl?j(te):j(T,-1)})}var D=x(Y,2),v=S(D);pn(v,j=>y(o,j),()=>l(o));var R=x(v,2),k=S(R),O=x(R,2);{var W=j=>{var M=p5();ae("click",M,g),q(j,M)};de(O,j=>{Ln.logoUrl&&j(W)})}se(()=>{H.disabled=l(r),oe(B,l(r)?"Saving…":"Save"),ve(Y,"aria-hidden",Ln.logoUrl===null),R.disabled=l(s),oe(k,l(s)?"Uploading…":Ln.logoUrl?"Replace logo…":"Upload logo…")}),vt(I,()=>l(n),j=>y(n,j)),ae("click",H,d),ae("change",v,h),ae("click",R,()=>{var j;return(j=l(o))==null?void 0:j.click()}),q(t,f),dt()}bt(["click","change"]);const b5={"content-type":"application/json"};async function v5(){const t=await Ge("/api/admin/diagnostics");if(t.status===404)throw new Error("Diagnostics are not available on this host.");if(!t.ok)throw new Error(`Couldn't load diagnostics (HTTP ${t.status}).`);return(await t.json()).findings}async function E5(t){const e=await Ge("/api/admin/diagnostics/repair",{method:"POST",headers:b5,body:JSON.stringify({id:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Repair failed (HTTP ${e.status}).`)}return(await e.json()).findings}var T5=z('<p class="error svelte-1iylrs" role="alert"> </p>'),_5=z('<p class="error svelte-1iylrs" role="alert"> </p>'),A5=z('<span class="all-good svelte-1iylrs">All checks passed.</span>'),y5=z('<span class="chip chip-error svelte-1iylrs"> </span>'),N5=z('<span class="chip chip-warning svelte-1iylrs"> </span>'),S5=z('<span class="chip chip-info svelte-1iylrs"> </span>'),w5=z("<!> <!> <!>",1),I5=z('<div class="finding-actions svelte-1iylrs"><button type="button" class="primary svelte-1iylrs"> </button></div>'),C5=z('<li><div class="finding-head svelte-1iylrs"><span> </span> <h3 class="svelte-1iylrs"> </h3></div> <p class="detail svelte-1iylrs"> </p> <!></li>'),L5=z('<ul class="findings svelte-1iylrs"></ul>'),O5=z(`<div class="panel svelte-1iylrs"><p class="lede svelte-1iylrs">A live check of your installation — what works, and what doesn't. Findings come from
129
+ port-agnostic probes, so they catch problems regardless of how your storage and CDN are wired. <strong>Repair</strong> fixes that the engine can apply in place; advisory findings are everything else.</p> <!> <!> <div class="actions-bar svelte-1iylrs"><div class="summary svelte-1iylrs" aria-live="polite"><!></div> <button type="button" class="svelte-1iylrs"> </button></div> <!></div>`);function x5(t,e){ct(e,!0);let n=Z(!0),r=Z(null),s=Z(lt([])),a=Z(null),i=Z(null);const o={error:"Error",warning:"Warning",info:"Info"},u={error:0,warning:1,info:2},d=Ae(()=>[...l(s)].sort((D,v)=>u[D.severity]-u[v.severity])),h=Ae(()=>({error:l(s).filter(D=>D.severity==="error").length,warning:l(s).filter(D=>D.severity==="warning").length,info:l(s).filter(D=>D.severity==="info").length}));async function g(){y(n,!0),y(r,null);try{y(s,await v5(),!0)}catch(D){y(r,D instanceof Error?D.message:String(D),!0)}finally{y(n,!1)}}Dt(()=>{g()});async function f(D){if(D.repair){y(a,D.repair.id,!0),y(i,null);try{y(s,await E5(D.repair.id),!0)}catch(v){y(i,v instanceof Error?v.message:String(v),!0)}finally{y(a,null)}}}var m=O5(),b=x(S(m),2);{var _=D=>{var v=T5(),R=S(v);se(()=>oe(R,l(r))),q(D,v)};de(b,D=>{l(r)&&D(_)})}var A=x(b,2);{var E=D=>{var v=_5(),R=S(v);se(()=>oe(R,l(i))),q(D,v)};de(A,D=>{l(i)&&D(E)})}var C=x(A,2),I=S(C),H=S(I);{var B=D=>{var v=fl("Running checks…");q(D,v)},J=D=>{var v=A5();q(D,v)},F=D=>{var v=w5(),R=nt(v);{var k=$=>{var G=y5(),ee=S(G);se(()=>oe(ee,`${l(h).error??""} error${l(h).error===1?"":"s"}`)),q($,G)};de(R,$=>{l(h).error>0&&$(k)})}var O=x(R,2);{var W=$=>{var G=N5(),ee=S(G);se(()=>oe(ee,`${l(h).warning??""} warning${l(h).warning===1?"":"s"}`)),q($,G)};de(O,$=>{l(h).warning>0&&$(W)})}var j=x(O,2);{var M=$=>{var G=S5(),ee=S(G);se(()=>oe(ee,`${l(h).info??""} info`)),q($,G)};de(j,$=>{l(h).info>0&&$(M)})}q(D,v)};de(H,D=>{l(n)?D(B):l(s).length===0?D(J,1):D(F,-1)})}var Y=x(I,2),X=S(Y),te=x(C,2);{var T=D=>{var v=L5();It(v,21,()=>l(d),R=>R.id,(R,k)=>{var O=C5(),W=S(O),j=S(W),M=S(j),$=x(j,2),G=S($),ee=x(W,2),le=S(ee),be=x(ee,2);{var pe=Ne=>{var ce=I5(),he=S(ce),Se=S(he);se(()=>{he.disabled=l(a)!==null,oe(Se,l(a)===l(k).repair.id?"Repairing…":l(k).repair.label)}),ae("click",he,()=>f(l(k))),q(Ne,ce)};de(be,Ne=>{l(k).repair&&Ne(pe)})}se(()=>{Je(O,1,`finding finding-${l(k).severity??""}`,"svelte-1iylrs"),Je(j,1,`severity-tag severity-${l(k).severity??""}`,"svelte-1iylrs"),oe(M,o[l(k).severity]),oe(G,l(k).title),oe(le,l(k).detail)}),q(R,O)}),q(D,v)};de(te,D=>{!l(n)&&l(s).length>0&&D(T)})}se(()=>{Y.disabled=l(n),oe(X,l(n)?"Checking…":"Re-run checks")}),ae("click",Y,g),q(t,m),dt()}bt(["click"]);var R5=z('<p class="error svelte-8ydvuj" role="alert"> </p>'),D5=z('<p class="ok svelte-8ydvuj" role="status"> </p>'),k5=z(`<div class="panel svelte-8ydvuj"><p class="lede svelte-8ydvuj">The site's base URL, its public address, e.g. <code class="svelte-8ydvuj">https://example.com</code>. Setting it makes <code class="svelte-8ydvuj">publish</code> emit a <code class="svelte-8ydvuj">sitemap.xml</code> (and absolute links in the RSS feed). Leave it blank to skip the sitemap.</p> <!> <!> <section class="field svelte-8ydvuj"><label for="site-base-url" class="svelte-8ydvuj">Base URL</label> <div class="row svelte-8ydvuj"><input id="site-base-url" type="url" inputmode="url" placeholder="https://example.com" class="svelte-8ydvuj"/> <button type="button" class="primary svelte-8ydvuj"> </button></div> <small class="svelte-8ydvuj">No trailing slash needed. Used only to build absolute URLs in the sitemap and feed.</small></section></div>`);function P5(t,e){ct(e,!0);let n=Z(""),r=Z(!0),s=Z(!1),a=Z(null),i=Z(null);ON().then(I=>{y(n,I.baseUrl,!0),y(r,!1)});function o(I){y(i,I,!0),setTimeout(()=>y(i,null),1500)}async function u(){y(s,!0),y(a,null);try{await xN({baseUrl:l(n)}),o("Saved.")}catch(I){y(a,I instanceof Error?I.message:String(I),!0)}finally{y(s,!1)}}var d=k5(),h=x(S(d),2);{var g=I=>{var H=R5(),B=S(H);se(()=>oe(B,l(a))),q(I,H)};de(h,I=>{l(a)&&I(g)})}var f=x(h,2);{var m=I=>{var H=D5(),B=S(H);se(()=>oe(B,l(i))),q(I,H)};de(f,I=>{l(i)&&I(m)})}var b=x(f,2),_=x(S(b),2),A=S(_),E=x(A,2),C=S(E);se(()=>{A.disabled=l(r),E.disabled=l(r)||l(s),oe(C,l(s)?"Saving…":"Save")}),vt(A,()=>l(n),I=>y(n,I)),ae("click",E,u),q(t,d),dt()}bt(["click"]);async function M5(){const t=await Ge("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const Xh={"content-type":"application/json"};function B5(t){return qa("/api/users",{method:"POST",headers:Xh,body:JSON.stringify(t)})}function E1(t,e){return qa(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:Xh,body:JSON.stringify(e)})}function F5(t,e){return qa(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:Xh,body:JSON.stringify(e)})}function U5(t){return qa(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var H5=z('<p class="error svelte-plhp3i" role="alert"> </p>'),q5=z('<p class="muted svelte-plhp3i">Loading users…</p>'),j5=z('<p class="error svelte-plhp3i"> </p>'),$5=z('<span class="you svelte-plhp3i">(you)</span>'),Y5=z('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),z5=z('<span class="you svelte-plhp3i">(you)</span>'),W5=z('<span class="username svelte-plhp3i"> <!></span>'),G5=z('<span class="chip locked svelte-plhp3i">Locked</span>'),K5=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),V5=z('<tr><td class="svelte-plhp3i"><div class="who svelte-plhp3i"><!></div> <!></td><td class="svelte-plhp3i"><div class="roles svelte-plhp3i"></div></td><td class="row-actions svelte-plhp3i"><button type="button" class="link svelte-plhp3i">Edit name</button> <button type="button" class="link svelte-plhp3i">Reset password</button> <button type="button" class="link danger svelte-plhp3i">Delete</button></td></tr>'),X5=z('<table class="svelte-plhp3i"><thead><tr><th class="svelte-plhp3i">User</th><th class="svelte-plhp3i">Roles</th><th class="svelte-plhp3i"></th></tr></thead><tbody></tbody></table>'),Q5=z('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),Z5=z('<div class="panel svelte-plhp3i"><!> <section class="list"><!></section> <form class="create svelte-plhp3i"><h3 class="svelte-plhp3i">Add a user</h3> <div class="create-grid svelte-plhp3i"><label class="svelte-plhp3i"><span class="svelte-plhp3i">Username</span> <input type="text" autocomplete="off" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Display name <small class="optional svelte-plhp3i">(optional)</small></span> <input type="text" autocomplete="off" placeholder="Shown on bylines; defaults to the username" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Initial password</span> <input type="text" autocomplete="off" placeholder="Set a password" class="svelte-plhp3i"/></label> <fieldset class="roles-field svelte-plhp3i"><legend class="svelte-plhp3i">Roles</legend> <div class="roles svelte-plhp3i"></div></fieldset></div> <div class="create-actions svelte-plhp3i"><small class="svelte-plhp3i">Share the password with them; they can change it from their account menu.</small> <button type="submit" class="primary svelte-plhp3i"> </button></div></form></div>');function J5(t,e){ct(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=Z(lt([])),i=Z(!0),o=Z(null),u=Z(null),d=Z(""),h=Z(""),g=Z(""),f=Z(lt(["author"])),m=Z(!1);const b=Ae(()=>{var ce;return((ce=ut.principal)==null?void 0:ce.userId)??null}),_=Ae(()=>!l(m)&&l(d).trim()!==""&&l(g)!==""&&l(f).length>0);async function A(){y(i,!0),y(o,null);try{y(a,await M5(),!0)}catch(ce){y(o,ce instanceof Error?ce.message:String(ce),!0)}finally{y(i,!1)}}Dt(()=>{A()});async function E(ce){if(ce.preventDefault(),!l(_))return;y(m,!0),y(u,null);const he=await B5({username:l(d).trim(),password:l(g),roles:[...l(f)],...l(h).trim()!==""&&{displayName:l(h).trim()}});if(y(m,!1),!he.ok){y(u,he.error,!0);return}y(d,""),y(h,""),y(g,""),y(f,["author"],!0),await A()}async function C(ce){const he=await yo(`Display name for “${ce.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:ce.displayName??"",placeholder:ce.username});if(he===null)return;y(u,null);const Se=await E1(ce.id,{displayName:he});Se.ok||y(u,Se.error,!0),await A()}async function I(ce,he){const ye=ce.roles.includes(he)?ce.roles.filter(xe=>xe!==he):[...ce.roles,he];if(ye.length===0){y(u,"A user must keep at least one role."),await A();return}y(u,null);const Ie=await E1(ce.id,{roles:ye});Ie.ok||y(u,Ie.error,!0),await A()}async function H(ce){const he=await yo(`Set a new password for “${ce.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(he===null)return;y(u,null);const Se=await F5(ce.id,{newPassword:he});Se.ok||y(u,Se.error,!0)}async function B(ce){if(!await yl(`Delete the user “${ce.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;y(u,null);const Se=await U5(ce.id);if(!Se.ok){y(u,Se.error,!0);return}await A()}var J=Z5(),F=S(J);{var Y=ce=>{var he=H5(),Se=S(he);se(()=>oe(Se,l(u))),q(ce,he)};de(F,ce=>{l(u)&&ce(Y)})}var X=x(F,2),te=S(X);{var T=ce=>{var he=q5();q(ce,he)},D=ce=>{var he=j5(),Se=S(he);se(()=>oe(Se,l(o))),q(ce,he)},v=ce=>{var he=X5(),Se=x(S(he));It(Se,21,()=>l(a),ye=>ye.id,(ye,Ie)=>{const xe=Ae(()=>l(Ie).id===l(b));var De=V5(),ze=S(De),et=S(ze),Vt=S(et);{var Qe=Tt=>{var kt=Y5(),Qt=nt(kt),_t=S(Qt),un=x(_t);{var $t=Nn=>{var Ur=$5();q(Nn,Ur)};de(un,Nn=>{l(xe)&&Nn($t)})}var Xn=x(Qt,2),pr=S(Xn);se(()=>{oe(_t,l(Ie).displayName),oe(pr,l(Ie).username)}),q(Tt,kt)},Xt=Tt=>{var kt=W5(),Qt=S(kt),_t=x(Qt);{var un=$t=>{var Xn=z5();q($t,Xn)};de(_t,$t=>{l(xe)&&$t(un)})}se(()=>oe(Qt,l(Ie).username)),q(Tt,kt)};de(Vt,Tt=>{l(Ie).displayName?Tt(Qe):Tt(Xt,-1)})}var nn=x(et,2);{var qt=Tt=>{var kt=G5();q(Tt,kt)};de(nn,Tt=>{l(Ie).locked&&Tt(qt)})}var yn=x(ze),rn=S(yn);It(rn,21,()=>r,xo,(Tt,kt)=>{var Qt=K5(),_t=S(Qt),un=x(_t);se($t=>{yT(_t,$t),_t.disabled=l(xe),oe(un,` ${s[l(kt)]??""}`)},[()=>l(Ie).roles.includes(l(kt))]),ae("change",_t,()=>I(l(Ie),l(kt))),q(Tt,Qt)});var Bt=x(yn),jt=S(Bt),Rn=x(jt,2),qn=x(Rn,2);se(()=>{ve(rn,"title",l(xe)?"You can't change your own roles":void 0),qn.disabled=l(xe),ve(qn,"title",l(xe)?"You can't delete your own account":void 0)}),ae("click",jt,()=>C(l(Ie))),ae("click",Rn,()=>H(l(Ie))),ae("click",qn,()=>B(l(Ie))),q(ye,De)}),q(ce,he)};de(te,ce=>{l(i)?ce(T):l(o)?ce(D,1):ce(v,-1)})}var R=x(X,2),k=x(S(R),2),O=S(k),W=x(S(O),2),j=x(O,2),M=x(S(j),2),$=x(j,2),G=x(S($),2),ee=x($,2),le=x(S(ee),2);It(le,21,()=>r,xo,(ce,he)=>{var Se=Q5(),ye=S(Se),Ie,xe=x(ye);se(()=>{Ie!==(Ie=l(he))&&(ye.value=(ye.__value=l(he))??""),oe(xe,` ${s[l(he)]??""}`)}),wT(n,[],ye,()=>(l(he),l(f)),De=>y(f,De)),q(ce,Se)});var be=x(k,2),pe=x(S(be),2),Ne=S(pe);se(()=>{pe.disabled=!l(_),oe(Ne,l(m)?"Adding…":"Add user")}),Be("submit",R,E),vt(W,()=>l(d),ce=>y(d,ce)),vt(M,()=>l(h),ce=>y(h,ce)),vt(G,()=>l(g),ce=>y(g,ce)),q(t,J),dt()}bt(["change","click"]);var ex=z('<dialog aria-label="Settings" class="svelte-1eaqpj"><header class="svelte-1eaqpj"><h2 class="svelte-1eaqpj">Settings</h2> <button type="button" class="close svelte-1eaqpj" aria-label="Close settings"><!></button></header> <div class="tabs svelte-1eaqpj" role="tablist" aria-label="Settings sections"><button type="button" role="tab">Users</button> <button type="button" role="tab">Branding</button> <button type="button" role="tab">Site</button> <button type="button" role="tab">Health</button></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function tx(t,e){ct(e,!0);let n=ir(e,"open",15),r=Z(void 0),s=Z("users");Dt(()=>{l(r)&&(n()&&!l(r).open?(y(s,"users"),l(r).showModal()):!n()&&l(r).open&&l(r).close())});function a(X){X.preventDefault(),n(!1)}var i=ex(),o=S(i),u=x(S(o),2),d=S(u);Ih(d,{size:18,"aria-hidden":"true"});var h=x(o,2),g=S(h);let f;var m=x(g,2);let b;var _=x(m,2);let A;var E=x(_,2);let C;var I=x(h,2),H=S(I);{var B=X=>{J5(X,{})},J=X=>{g5(X,{})},F=X=>{P5(X,{})},Y=X=>{x5(X,{})};de(H,X=>{l(s)==="users"?X(B):l(s)==="branding"?X(J,1):l(s)==="site"?X(F,2):X(Y,-1)})}pn(i,X=>y(r,X),()=>l(r)),se(()=>{ve(g,"aria-selected",l(s)==="users"),f=Je(g,1,"svelte-1eaqpj",null,f,{selected:l(s)==="users"}),ve(m,"aria-selected",l(s)==="branding"),b=Je(m,1,"svelte-1eaqpj",null,b,{selected:l(s)==="branding"}),ve(_,"aria-selected",l(s)==="site"),A=Je(_,1,"svelte-1eaqpj",null,A,{selected:l(s)==="site"}),ve(E,"aria-selected",l(s)==="health"),C=Je(E,1,"svelte-1eaqpj",null,C,{selected:l(s)==="health"})}),Be("cancel",i,a),ae("click",u,()=>n(!1)),ae("click",g,()=>y(s,"users")),ae("click",m,()=>y(s,"branding")),ae("click",_,()=>y(s,"site")),ae("click",E,()=>y(s,"health")),q(t,i),dt()}bt(["click"]);const rd="nanoesis-theme";function nx(t){return t==="system"||t==="light"||t==="dark"}function T1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function rx(){let t=Z("system"),e=Z(!1);const n=()=>{document.documentElement.dataset.theme=T1(l(t),l(e))};return{get choice(){return l(t)},get resolved(){return T1(l(t),l(e))},init(){const r=localStorage.getItem(rd);nx(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(rd):localStorage.setItem(rd,r),n()}}}const ol=rx();var sx=z('<button type="button"> </button>'),ax=z('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function ix(t,e){ct(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];Cm();var r=ax();It(r,5,()=>n,s=>s.value,(s,a)=>{var i=sx();let o;var u=S(i);se(()=>{o=Je(i,1,"option svelte-1cmi4dh",null,o,{selected:ol.choice===l(a).value}),ve(i,"aria-pressed",ol.choice===l(a).value),oe(u,l(a).label)}),ae("click",i,()=>ol.setChoice(l(a).value)),q(s,i)}),q(t,r),dt()}bt(["click"]);var ox=z('<span class="badge svelte-yic9pk"> </span>'),ux=z('<button type="button"> <!></button>'),lx=z('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),cx=z('<span class="spacer"></span>'),dx=z('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),fx=z('<header class="topbar svelte-yic9pk"><div class="brand svelte-yic9pk"><img class="logo svelte-yic9pk" alt="" width="24" height="24"/> </div> <!> <div class="actions svelte-yic9pk"><!> <button class="publish svelte-yic9pk" type="button"> </button> <!> <!></div></header> <!>',1);function hx(t,e){ct(e,!0);const n=Ae(()=>Ln.logoUrl??Tv),r=Ae(()=>Ln.name??"nanoesis"),s=Ae(()=>ut.canAuthor&&ut.canDevelop);let a=Z(!1);Dt(()=>{ut.canDevelop&&!ut.canAuthor?Ar.set("templates"):ut.canAuthor&&!ut.canDevelop&&Ar.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"},{value:"migrations",label:"Migrations"}];async function o(T){T!==Ar.mode&&await ab("Switching workspaces will close this file.")&&Ar.set(T)}zu.ensureLoaded();let u=Z(!1);async function d(){if(!l(u)){y(u,!0);try{const T=await fN();if(T.ok){const D=T.summary;if(D===void 0){const v=T.written;await en(`Published ${v} file${v===1?"":"s"} to the live site.`,{title:"Published"})}else if(D.published===0)await en(D.firstPublishWarning??"Your site has no published pages. Toggle Publish on at least one page to go live.",{title:"Nothing went live"});else{const v=D.published,R=D.drafts,k=[`Published ${v} page${v===1?"":"s"} to the live site.`];R>0&&k.push("",`${R} draft${R===1?" was":"s were"} skipped.`),await en(k.join(`
128
130
  `),{title:"Published"})}}else await en(`Fix these, then publish again:
129
131
 
130
132
  • ${T.errors.join(`
131
- • `)}`,{title:`Publish blocked, ${T.errors.length} ${T.errors.length===1?"thing":"things"} would break`})}catch(T){await en(T instanceof Error?T.message:String(T),{title:"Publish failed"})}finally{y(u,!1)}}}var h=lx(),g=nt(h),f=S(g),m=S(f),b=x(m,1,!0),_=x(f,2);{var A=T=>{var D=ix();It(D,21,()=>i,v=>v.value,(v,R)=>{var k=ax();let O;var W=S(k),j=x(W);{var M=$=>{var G=sx(),ee=S(G);se(()=>{ve(G,"aria-label",`${zu.count} pending`),oe(ee,zu.count)}),q($,G)};de(j,$=>{l(R).value==="migrations"&&zu.count>0&&$(M)})}se(()=>{O=Je(k,1,"option svelte-yic9pk",null,O,{selected:Ar.mode===l(R).value}),ve(k,"aria-pressed",Ar.mode===l(R).value),oe(W,`${l(R).label??""} `)}),ae("click",k,()=>void o(l(R).value)),q(v,k)}),q(T,D)},E=T=>{var D=ox();q(T,D)};de(_,T=>{l(s)?T(A):T(E,-1)})}var C=x(_,2),I=S(C);rx(I,{});var H=x(I,2),B=S(H),J=x(H,2);{var F=T=>{var D=ux(),v=S(D);wh(v,{size:18,"aria-hidden":"true"}),ae("click",D,()=>y(a,!0)),q(T,D)};de(J,T=>{ut.isAdmin&&T(F)})}var Y=x(J,2);i5(Y,{});var X=x(g,2);{var te=T=>{Z5(T,{get open(){return l(a)},set open(D){y(a,D,!0)}})};de(X,T=>{ut.isAdmin&&T(te)})}se(()=>{ve(m,"src",l(n)),oe(b,l(r)),H.disabled=l(u),oe(B,l(u)?"Publishing…":"Publish")}),ae("click",H,d),q(t,h),dt()}bt(["click"]);var dx=z('<li class="hint svelte-2dodtm">Loading…</li>'),fx=z('<li class="hint svelte-2dodtm">Empty</li>'),hx=z('<p class="hint nested svelte-2dodtm">Loading…</p>'),px=z("<div><!> <!></div>"),mx=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button" class="chevron svelte-2dodtm"><!></button> <button type="button"><span class="label svelte-2dodtm"> </span></button> <span class="actions svelte-2dodtm"><button type="button" title="Folder settings" class="svelte-2dodtm"><!></button></span></div> <!></li>'),gx=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),bx=z("<ul><!></ul>");function Av(t,e){ct(e,!0),Dt(()=>{Kl(e.treePath)});const n=Ae(()=>ui(e.treePath)),r=Ae(()=>{var F;return((F=l(n))==null?void 0:F.defaultTemplate)??e.inheritedTemplate}),s=Ae(()=>{var F;return(((F=l(n))==null?void 0:F.entries)??[]).filter(Y=>!(Y.kind==="item"&&Y.slug==="index"))});function a(F){return`tree-group-${F.replace(/\//g,"--")||"root"}`}function i(F){ei(F)||ip(F),e.onopenDir(F)}function o(F){return F.template??l(r)}function u(F){return F.isPublished?void 0:`${F.title}, not published`}function d(F){var te;const Y=[...F],X=(((te=l(n))==null?void 0:te.entries)??[]).map(T=>l(s).includes(T)?Y.shift()??T.slug:T.slug);BN(e.treePath,X),e.onreorder(e.treePath,X)}function h(F,Y){const X=l(s).map(T=>T.slug),te=X.indexOf(F);te<0||d(of(X,te,te+Y))}function g(F,Y){F.key==="ArrowUp"?(F.preventDefault(),h(Y.slug,-1)):F.key==="ArrowDown"&&(F.preventDefault(),h(Y.slug,1))}function f(F,Y){a6(F,e.treePath),Y.dataTransfer&&(Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData("text/plain",F.slug))}function m(F,Y){return Y.kind==="dir"&&Y.path!==F.entry.path&&F.parent!==Y.path&&!Y.path.startsWith(`${F.entry.path}/`)}function b(F,Y){return F.parent===e.treePath&&Y.path!==F.entry.path}function _(F,Y){const X=li();X!==null&&(!m(X,F)&&!b(X,F)||(Y.preventDefault(),Y.dataTransfer&&(Y.dataTransfer.dropEffect="move"),Uc(F.path)))}function A(F,Y){Y.preventDefault();const X=li();if(Cs(),X===null)return;if(m(X,F)){e.onmove(X.entry.path,X.entry.kind,F.path);return}if(!b(X,F))return;const te=l(s).map(v=>v.slug),T=te.indexOf(X.entry.slug),D=te.indexOf(F.slug);T<0||D<0||d(of(te,T,D))}var E=bx();let C;var I=S(E);{var H=F=>{var Y=dx();q(F,Y)},B=F=>{var Y=fx();q(F,Y)},J=F=>{var Y=Gn(),X=nt(Y);It(X,17,()=>l(s),te=>te.path,(te,T)=>{var D=Gn(),v=nt(D);{var R=O=>{var W=mx(),j=S(W);let M;var $=S(j),G=S($);rf(G,{size:16,"aria-hidden":"true"});var ee=x($,2),le=S(ee);{var be=Qe=>{e6(Qe,{size:16,"aria-hidden":"true"})},pe=Ae(()=>ei(l(T).path)),Ne=Qe=>{JN(Qe,{size:16,"aria-hidden":"true"})};de(le,Qe=>{l(pe)?Qe(be):Qe(Ne,-1)})}var ce=x(ee,2);let he;var Se=S(ce),ye=S(Se),Ie=x(ce,2),xe=S(Ie),De=S(xe);wh(De,{size:16,"aria-hidden":"true"});var ze=x(j,2);{var et=Qe=>{var Xt=px(),nn=S(Xt);{var qt=Bt=>{var jt=hx();q(Bt,jt)},yn=Ae(()=>DN(l(T).path)&&ui(l(T).path)===void 0);de(nn,Bt=>{l(yn)&&Bt(qt)})}var rn=x(nn,2);{let Bt=Ae(()=>e.level+1);Av(rn,{get treePath(){return l(T).path},get inheritedTemplate(){return l(r)},get level(){return l(Bt)},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}})}se(Bt=>ve(Xt,"id",Bt),[()=>a(l(T).path)]),q(Qe,Xt)},Vt=Ae(()=>ei(l(T).path));de(ze,Qe=>{l(Vt)&&Qe(et)})}se((Qe,Xt,nn,qt)=>{M=Je(j,1,"row svelte-2dodtm",null,M,Qe),ve($,"aria-label",`Reorder ${l(T).name}; arrow keys move it`),ve(ee,"aria-expanded",Xt),ve(ee,"aria-controls",nn),ve(ee,"aria-label",qt),he=Je(ce,1,"dir svelte-2dodtm",null,he,{active:l(T).path===e.activeDir}),ve(ce,"aria-current",l(T).path===e.activeDir),ve(ce,"title",`${l(T).name}, open this section's page`),oe(ye,l(T).name),ve(xe,"aria-label",`Settings for ${l(T).name}`)},[()=>({active:l(T).path===e.activeDir,"drop-target":cp()===l(T).path}),()=>ei(l(T).path),()=>a(l(T).path),()=>`${ei(l(T).path)?"Collapse":"Expand"} ${l(T).name}`]),Be("dragstart",j,Qe=>f(l(T),Qe)),Be("dragover",j,Qe=>_(l(T),Qe)),Be("dragleave",j,()=>Uc(null)),Be("drop",j,Qe=>A(l(T),Qe)),Be("dragend",j,function(...Qe){Cs==null||Cs.apply(this,Qe)}),ae("keydown",$,Qe=>g(Qe,l(T))),ae("click",ee,()=>ip(l(T).path)),ae("click",ce,()=>i(l(T).path)),ae("click",xe,()=>e.onsettingsDir(l(T).path)),q(O,W)},k=O=>{var W=gx(),j=S(W);let M;var $=S(j),G=S($);rf(G,{size:16,"aria-hidden":"true"});var ee=x($,2);let le;var be=S(ee),pe=S(be);se((Ne,ce)=>{M=Je(j,1,"row svelte-2dodtm",null,M,Ne),ve($,"aria-label",`Reorder ${l(T).title}; arrow keys move it`),le=Je(ee,1,"item svelte-2dodtm",null,le,{selected:l(T).path===e.selectedPath,unpublished:!l(T).isPublished}),ve(ee,"aria-current",l(T).path===e.selectedPath),ve(ee,"aria-label",ce),ve(ee,"title",l(T).title),oe(pe,l(T).title)},[()=>({"drop-target":cp()===l(T).path}),()=>u(l(T))]),Be("dragstart",j,Ne=>f(l(T),Ne)),Be("dragover",j,Ne=>_(l(T),Ne)),Be("dragleave",j,()=>Uc(null)),Be("drop",j,Ne=>A(l(T),Ne)),Be("dragend",j,function(...Ne){Cs==null||Cs.apply(this,Ne)}),ae("keydown",$,Ne=>g(Ne,l(T))),ae("click",ee,()=>e.onselect(l(T).path,o(l(T)))),q(O,W)};de(v,O=>{l(T).kind==="dir"?O(R):O(k,-1)})}q(te,D)}),q(F,Y)};de(I,F=>{l(n)===void 0?F(H):l(s).length===0?F(B,1):F(J,-1)})}se(()=>C=Je(E,1,"level svelte-2dodtm",null,C,{root:e.level===1})),q(t,E),dt()}bt(["keydown","click"]);var vx=z('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),Ex=z('<p class="placeholder pad svelte-whg6dh">Loading migrations…</p>'),Tx=z('<p class="placeholder svelte-whg6dh"> </p>'),_x=z('<p class="placeholder svelte-whg6dh"> </p>'),Ax=z('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),yx=z('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),Nx=z('<span class="home-hint svelte-whg6dh">needs template</span>'),Sx=z('<span class="home-hint svelte-whg6dh">draft</span>'),wx=z("<div>Move to top level</div>"),Ix=z('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),Cx=z("<option> </option>"),Lx=z('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),Ox=z(`<div class="work-pad svelte-whg6dh"><div class="broken-item svelte-whg6dh"><h1 class="svelte-whg6dh">This page has no template</h1> <p class="svelte-whg6dh">Pick a template to set up the form, or delete the page. This usually happens when
133
+ • `)}`,{title:`Publish blocked, ${T.errors.length} ${T.errors.length===1?"thing":"things"} would break`})}catch(T){await en(T instanceof Error?T.message:String(T),{title:"Publish failed"})}finally{y(u,!1)}}}var h=fx(),g=nt(h),f=S(g),m=S(f),b=x(m,1,!0),_=x(f,2);{var A=T=>{var D=lx();It(D,21,()=>i,v=>v.value,(v,R)=>{var k=ux();let O;var W=S(k),j=x(W);{var M=$=>{var G=ox(),ee=S(G);se(()=>{ve(G,"aria-label",`${zu.count} pending`),oe(ee,zu.count)}),q($,G)};de(j,$=>{l(R).value==="migrations"&&zu.count>0&&$(M)})}se(()=>{O=Je(k,1,"option svelte-yic9pk",null,O,{selected:Ar.mode===l(R).value}),ve(k,"aria-pressed",Ar.mode===l(R).value),oe(W,`${l(R).label??""} `)}),ae("click",k,()=>void o(l(R).value)),q(v,k)}),q(T,D)},E=T=>{var D=cx();q(T,D)};de(_,T=>{l(s)?T(A):T(E,-1)})}var C=x(_,2),I=S(C);ix(I,{});var H=x(I,2),B=S(H),J=x(H,2);{var F=T=>{var D=dx(),v=S(D);wh(v,{size:18,"aria-hidden":"true"}),ae("click",D,()=>y(a,!0)),q(T,D)};de(J,T=>{ut.isAdmin&&T(F)})}var Y=x(J,2);l5(Y,{});var X=x(g,2);{var te=T=>{tx(T,{get open(){return l(a)},set open(D){y(a,D,!0)}})};de(X,T=>{ut.isAdmin&&T(te)})}se(()=>{ve(m,"src",l(n)),oe(b,l(r)),H.disabled=l(u),oe(B,l(u)?"Publishing…":"Publish")}),ae("click",H,d),q(t,h),dt()}bt(["click"]);var px=z('<li class="hint svelte-2dodtm">Loading…</li>'),mx=z('<li class="hint svelte-2dodtm">Empty</li>'),gx=z('<p class="hint nested svelte-2dodtm">Loading…</p>'),bx=z("<div><!> <!></div>"),vx=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button" class="chevron svelte-2dodtm"><!></button> <button type="button"><span class="label svelte-2dodtm"> </span></button> <span class="actions svelte-2dodtm"><button type="button" title="Folder settings" class="svelte-2dodtm"><!></button></span></div> <!></li>'),Ex=z('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),Tx=z("<ul><!></ul>");function Sv(t,e){ct(e,!0),Dt(()=>{Kl(e.treePath)});const n=Ae(()=>ui(e.treePath)),r=Ae(()=>{var F;return((F=l(n))==null?void 0:F.defaultTemplate)??e.inheritedTemplate}),s=Ae(()=>{var F;return(((F=l(n))==null?void 0:F.entries)??[]).filter(Y=>!(Y.kind==="item"&&Y.slug==="index"))});function a(F){return`tree-group-${F.replace(/\//g,"--")||"root"}`}function i(F){ei(F)||ip(F),e.onopenDir(F)}function o(F){return F.template??l(r)}function u(F){return F.isPublished?void 0:`${F.title}, not published`}function d(F){var te;const Y=[...F],X=(((te=l(n))==null?void 0:te.entries)??[]).map(T=>l(s).includes(T)?Y.shift()??T.slug:T.slug);HN(e.treePath,X),e.onreorder(e.treePath,X)}function h(F,Y){const X=l(s).map(T=>T.slug),te=X.indexOf(F);te<0||d(of(X,te,te+Y))}function g(F,Y){F.key==="ArrowUp"?(F.preventDefault(),h(Y.slug,-1)):F.key==="ArrowDown"&&(F.preventDefault(),h(Y.slug,1))}function f(F,Y){u6(F,e.treePath),Y.dataTransfer&&(Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData("text/plain",F.slug))}function m(F,Y){return Y.kind==="dir"&&Y.path!==F.entry.path&&F.parent!==Y.path&&!Y.path.startsWith(`${F.entry.path}/`)}function b(F,Y){return F.parent===e.treePath&&Y.path!==F.entry.path}function _(F,Y){const X=li();X!==null&&(!m(X,F)&&!b(X,F)||(Y.preventDefault(),Y.dataTransfer&&(Y.dataTransfer.dropEffect="move"),Uc(F.path)))}function A(F,Y){Y.preventDefault();const X=li();if(Cs(),X===null)return;if(m(X,F)){e.onmove(X.entry.path,X.entry.kind,F.path);return}if(!b(X,F))return;const te=l(s).map(v=>v.slug),T=te.indexOf(X.entry.slug),D=te.indexOf(F.slug);T<0||D<0||d(of(te,T,D))}var E=Tx();let C;var I=S(E);{var H=F=>{var Y=px();q(F,Y)},B=F=>{var Y=mx();q(F,Y)},J=F=>{var Y=Gn(),X=nt(Y);It(X,17,()=>l(s),te=>te.path,(te,T)=>{var D=Gn(),v=nt(D);{var R=O=>{var W=vx(),j=S(W);let M;var $=S(j),G=S($);rf(G,{size:16,"aria-hidden":"true"});var ee=x($,2),le=S(ee);{var be=Qe=>{r6(Qe,{size:16,"aria-hidden":"true"})},pe=Ae(()=>ei(l(T).path)),Ne=Qe=>{n6(Qe,{size:16,"aria-hidden":"true"})};de(le,Qe=>{l(pe)?Qe(be):Qe(Ne,-1)})}var ce=x(ee,2);let he;var Se=S(ce),ye=S(Se),Ie=x(ce,2),xe=S(Ie),De=S(xe);wh(De,{size:16,"aria-hidden":"true"});var ze=x(j,2);{var et=Qe=>{var Xt=bx(),nn=S(Xt);{var qt=Bt=>{var jt=gx();q(Bt,jt)},yn=Ae(()=>MN(l(T).path)&&ui(l(T).path)===void 0);de(nn,Bt=>{l(yn)&&Bt(qt)})}var rn=x(nn,2);{let Bt=Ae(()=>e.level+1);Sv(rn,{get treePath(){return l(T).path},get inheritedTemplate(){return l(r)},get level(){return l(Bt)},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}})}se(Bt=>ve(Xt,"id",Bt),[()=>a(l(T).path)]),q(Qe,Xt)},Vt=Ae(()=>ei(l(T).path));de(ze,Qe=>{l(Vt)&&Qe(et)})}se((Qe,Xt,nn,qt)=>{M=Je(j,1,"row svelte-2dodtm",null,M,Qe),ve($,"aria-label",`Reorder ${l(T).name}; arrow keys move it`),ve(ee,"aria-expanded",Xt),ve(ee,"aria-controls",nn),ve(ee,"aria-label",qt),he=Je(ce,1,"dir svelte-2dodtm",null,he,{active:l(T).path===e.activeDir}),ve(ce,"aria-current",l(T).path===e.activeDir),ve(ce,"title",`${l(T).name}, open this section's page`),oe(ye,l(T).name),ve(xe,"aria-label",`Settings for ${l(T).name}`)},[()=>({active:l(T).path===e.activeDir,"drop-target":cp()===l(T).path}),()=>ei(l(T).path),()=>a(l(T).path),()=>`${ei(l(T).path)?"Collapse":"Expand"} ${l(T).name}`]),Be("dragstart",j,Qe=>f(l(T),Qe)),Be("dragover",j,Qe=>_(l(T),Qe)),Be("dragleave",j,()=>Uc(null)),Be("drop",j,Qe=>A(l(T),Qe)),Be("dragend",j,function(...Qe){Cs==null||Cs.apply(this,Qe)}),ae("keydown",$,Qe=>g(Qe,l(T))),ae("click",ee,()=>ip(l(T).path)),ae("click",ce,()=>i(l(T).path)),ae("click",xe,()=>e.onsettingsDir(l(T).path)),q(O,W)},k=O=>{var W=Ex(),j=S(W);let M;var $=S(j),G=S($);rf(G,{size:16,"aria-hidden":"true"});var ee=x($,2);let le;var be=S(ee),pe=S(be);se((Ne,ce)=>{M=Je(j,1,"row svelte-2dodtm",null,M,Ne),ve($,"aria-label",`Reorder ${l(T).title}; arrow keys move it`),le=Je(ee,1,"item svelte-2dodtm",null,le,{selected:l(T).path===e.selectedPath,unpublished:!l(T).isPublished}),ve(ee,"aria-current",l(T).path===e.selectedPath),ve(ee,"aria-label",ce),ve(ee,"title",l(T).title),oe(pe,l(T).title)},[()=>({"drop-target":cp()===l(T).path}),()=>u(l(T))]),Be("dragstart",j,Ne=>f(l(T),Ne)),Be("dragover",j,Ne=>_(l(T),Ne)),Be("dragleave",j,()=>Uc(null)),Be("drop",j,Ne=>A(l(T),Ne)),Be("dragend",j,function(...Ne){Cs==null||Cs.apply(this,Ne)}),ae("keydown",$,Ne=>g(Ne,l(T))),ae("click",ee,()=>e.onselect(l(T).path,o(l(T)))),q(O,W)};de(v,O=>{l(T).kind==="dir"?O(R):O(k,-1)})}q(te,D)}),q(F,Y)};de(I,F=>{l(n)===void 0?F(H):l(s).length===0?F(B,1):F(J,-1)})}se(()=>C=Je(E,1,"level svelte-2dodtm",null,C,{root:e.level===1})),q(t,E),dt()}bt(["keydown","click"]);var _x=z('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),Ax=z('<p class="placeholder pad svelte-whg6dh">Loading migrations…</p>'),yx=z('<p class="placeholder svelte-whg6dh"> </p>'),Nx=z('<p class="placeholder svelte-whg6dh"> </p>'),Sx=z('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),wx=z('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),Ix=z('<span class="home-hint svelte-whg6dh">needs template</span>'),Cx=z('<span class="home-hint svelte-whg6dh">draft</span>'),Lx=z("<div>Move to top level</div>"),Ox=z('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),xx=z("<option> </option>"),Rx=z('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),Dx=z(`<div class="work-pad svelte-whg6dh"><div class="broken-item svelte-whg6dh"><h1 class="svelte-whg6dh">This page has no template</h1> <p class="svelte-whg6dh">Pick a template to set up the form, or delete the page. This usually happens when
132
134
  an item was created before its template existed (a common state after recovering a
133
- store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`),xx=z(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">Setting up your starter site…</h1> <p class="svelte-whg6dh">Adding a home page, a template, and a stylesheet so you can get straight to
134
- editing. This only happens once.</p></div></div>`),Rx=z(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">nanoesis</h1> <p class="svelte-whg6dh">Pick an item from the tree to edit it. The form is generated from its template,
135
+ store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`),kx=z(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">Setting up your starter site…</h1> <p class="svelte-whg6dh">Adding a home page, a template, and a stylesheet so you can get straight to
136
+ editing. This only happens once.</p></div></div>`),Px=z(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">nanoesis</h1> <p class="svelte-whg6dh">Pick an item from the tree to edit it. The form is generated from its template,
135
137
  the template is the schema. Switch to <strong>Templates</strong> to edit those templates
136
- and components directly.</p></div></div>`),Dx=z('<div class="panes svelte-whg6dh"><aside class="tree svelte-whg6dh" aria-label="Content"><div class="tree-head svelte-whg6dh"><h2 class="tree-title svelte-whg6dh">Content</h2> <div class="tree-head-actions svelte-whg6dh"><button type="button" class="add svelte-whg6dh" title="New folder" aria-label="New folder"><!></button> <button type="button" class="add svelte-whg6dh" title="New content item" aria-label="New content item"><!></button></div></div> <div class="search svelte-whg6dh"><!> <input type="search" role="combobox" placeholder="Search titles…" aria-label="Search content by title" aria-controls="search-results" aria-autocomplete="list" class="svelte-whg6dh"/></div> <!></aside> <!> <main class="work svelte-whg6dh"><!></main></div>'),kx=z('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!>',1);function Px(t,e){ct(e,!0);let n=Z(null);Dt(()=>{const K=sf.target;K!==null&&(sf.clear(),(async()=>await nb("Opening this item will close the open file.")&&(Ar.set("content"),await B(K)))())});let r=Z(null),s=Z(""),a=Z(null),i=Z(!1);function o(K){return K==="index"?"":K.endsWith("/index")?K.slice(0,-6):null}const u=Ae(()=>l(r)??(l(n)!==null?o(l(n).path):null)),d=Ae(()=>l(n)!==null&&o(l(n).path)!==null),h=Ae(()=>{var K;return((K=l(n))==null?void 0:K.path)==="index"});let g=Z(""),f=Z(lt([])),m=Z(-1),b=Z(void 0),_;Dt(()=>{const K=l(g);if(clearTimeout(_),K.trim()===""){y(f,[],!0),y(m,-1);return}return _=setTimeout(()=>{qg(K).then(ge=>{K===l(g)&&(y(f,ge,!0),y(m,ge.length>0?0:-1,!0))})},200),()=>clearTimeout(_)});function A(){pm().then(()=>{var K,ge;return(ge=(K=l(b))==null?void 0:K.children[l(m)])==null?void 0:ge.scrollIntoView({block:"nearest"})})}function E(K){if(K.key==="Escape"){y(g,"");return}if(l(f).length!==0){if(K.key==="ArrowDown")K.preventDefault(),y(m,(l(m)+1)%l(f).length),A();else if(K.key==="ArrowUp")K.preventDefault(),y(m,(l(m)-1+l(f).length)%l(f).length),A();else if(K.key==="Enter"){K.preventDefault();const ge=l(f)[l(m)]??l(f)[0];ge!==void 0&&Y(ge)}}}Ua(()=>{Kl("").catch(we=>{y(a,we instanceof Error?we.message:String(we),!0)}),he();const K=we=>{nf.hasDirty&&(we.preventDefault(),we.returnValue="")};window.addEventListener("beforeunload",K);const ge=YN({reconcileOnce:async()=>{const we=await Xe("/api/reconcile",{method:"POST"});return we.ok?$N(await we.json().catch(()=>null)):{changed:!1,added:0,removed:0}},onChanged:()=>{kN(),HN()},isVisible:()=>document.visibilityState==="visible"});return ge.start(),()=>{window.removeEventListener("beforeunload",K),ge.stop()}});function C(K){return K.includes("/")?K.slice(0,K.lastIndexOf("/")):""}function I(K){return l(n)!==null&&(l(n).path===K||l(n).path.startsWith(`${K}/`))}async function H(K,ge){try{const we=await rp(K);y(r,null),y(n,{item:we,path:K,templateName:ge},!0)}catch(we){await en(we instanceof Error?we.message:String(we))}}async function B(K){try{const ge=await rp(K);y(r,null),y(n,{item:ge,path:K,templateName:await eN(K,ge.template)},!0)}catch(ge){await en(ge instanceof Error?ge.message:String(ge))}}async function J(K){const ge=K===""?"index":`${K}/index`;await bN(ge)?await B(ge):(y(n,null),await he(),y(s,await Xd(K),!0),y(r,K,!0))}async function F(K){const ge=l(r);if(ge===null)return;const we=ge===""?"index":`${ge}/index`,We=await Xd(ge);try{await zg(we,We,K)}catch(ht){await en(ht instanceof Error?ht.message:String(ht));return}await In(ge),await ro(we),await B(we)}async function Y(K){y(g,""),await ro(K.path),await H(K.path,K.template)}async function X(K,ge){try{await _N(K,ge)}catch(we){await en(we instanceof Error?we.message:String(we)),await In(K)}}async function te(K,ge,we){var Ge;const We=C(K);if(we===We)return;let ht;try{ht=ge==="item"?await NN(K,we):await SN(K,we)}catch(xt){await en(xt instanceof Error?xt.message:String(xt));return}ge==="item"?await xu(Tr(K),Tr(ht)):await xu(`${Tr(K)}*`,`${Tr(ht)}:splat`),await In(We),await In(we),await ro(ht),ge==="item"&&((Ge=l(n))==null?void 0:Ge.path)===K?await B(ht):ge==="dir"&&I(K)&&y(n,null)}async function T(K){K.preventDefault();const ge=li();Cs(),ge!==null&&ge.parent!==""&&await te(ge.entry.path,ge.entry.kind,"")}async function D(K){l(n)!==null&&await te(l(n).path,"item",K)}async function v(K){const ge=l(De);y(De,null),ge!==null&&await te(ge,"dir",K)}async function R(K){if(l(n)===null)return;const{path:ge}=l(n);try{await sp(ge,K)}catch(we){await en(we instanceof Error?we.message:String(we));return}await In(C(ge)),await B(ge)}const k=Ae(()=>ui("")!==void 0),O=Ae(()=>{var K;return(((K=ui(""))==null?void 0:K.entries.length)??-1)===0}),W=Ae(()=>{const K=ui(""),ge=K==null?void 0:K.entries.find(we=>we.kind==="item"&&we.slug==="index");return(ge==null?void 0:ge.kind)==="item"?ge:void 0}),j=Ae(()=>{var we;const K=l(W);return K===void 0?"missing":(K.template??((we=ui(""))==null?void 0:we.defaultTemplate))===void 0?"broken":K.isPublished?"published":"draft"}),M=Ae(()=>{switch(l(j)){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 $=Z(!1);async function G(K){if(!(l(n)===null||K==="")){y($,!0);try{await sp(l(n).path,K),await In(C(l(n).path)),await B(l(n).path)}catch(ge){await en(ge instanceof Error?ge.message:String(ge))}finally{y($,!1)}}}let ee=Z(!1),le=Z(!1);Dt(()=>{!l(le)&&!l(ee)&&ut.isAdmin&&l(k)&&l(O)&&(y(le,!0),be())});async function be(){y(ee,!0);try{await cN(),WN(localStorage),await In(""),await he(),await B("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(ee,!1)}}let pe=Z(!1),Ne=Z(lt([])),ce=Z(lt([]));async function he(){const K=await Zd("templates");y(Ne,K.filter(ge=>ge!==au&&!Id(ge.split("/").pop()??ge)),!0)}async function Se(){await he(),y(ce,await Kd(),!0),y(pe,!0)}async function ye(K){y(pe,!1),await In(C(K)),await ro(K),await B(K)}async function Ie(K){const ge=await yo("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ge===null||ge.trim()==="")return;let we;try{we=await vN(K,ge)}catch(We){await en(We instanceof Error?We.message:String(We));return}await In(K),await ro(`${we}/_`)}async function xe(){const K=l(De);y(De,null),K!==null&&await Ie(K)}let De=Z(null);async function ze(K){await he(),y(ce,await Kd(),!0),y(De,K,!0)}async function et(){const K=l(De);y(De,null),K!==null&&await In(K),l(n)!==null&&await B(l(n).path)}async function Vt(){const K=l(De);y(De,null),K!==null&&await nn(K)}async function Qe(){const K=l(De);y(De,null),K!==null&&await Xt(K)}async function Xt(K){const ge=tl(K);if(await yl(`Delete the folder “${ge}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Al(di(K))}catch(We){await en(We instanceof Error?We.message:String(We));return}I(K)&&y(n,null),await In(C(K))}}async function nn(K){const ge=tl(K),we=await yo("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ge,confirmLabel:"Change URL"});if(we===null)return;const We=ps(we);if(We===""||We===ge)return;const ht=J0(K,We);try{await Ra(di(K),di(ht))}catch(Ge){await en(Ge instanceof Error?Ge.message:String(Ge));return}await xu(`${Tr(K)}*`,`${Tr(ht)}:splat`),I(K)&&y(n,null),await In(C(K))}async function qt(){if(l(n)===null)return;const{path:K,item:ge}=l(n);if(await yl(`Delete “${ge.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Al(Bs(K))}catch(We){await en(We instanceof Error?We.message:String(We));return}lp(localStorage,K),y(n,null),await In(C(K))}}async function yn(){if(l(n)===null)return;const K=l(n).path,ge=tl(K),we=await yo("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ge,confirmLabel:"Change URL"});if(we===null)return;const We=ps(we);if(We===""||We===ge)return;const ht=J0(K,We);try{await Ra(Bs(K),Bs(ht))}catch(Ge){await en(Ge instanceof Error?Ge.message:String(Ge));return}lp(localStorage,K),await xu(Tr(K),Tr(ht)),await In(C(K)),await B(ht)}let rn=Z(null),Bt=Z(null);Dt(()=>{Ar.mode==="templates"&&l(rn)===null&&W0(()=>import("./TemplatesPane-s8Bmn-Xp.js").then(K=>K.T),__vite__mapDeps([0,1]),import.meta.url).then(K=>{y(rn,K.default,!0)}),Ar.mode==="migrations"&&l(Bt)===null&&W0(()=>import("./MigrationsPane-WSjr6ra4.js"),__vite__mapDeps([2,3]),import.meta.url).then(K=>{y(Bt,K.default,!0)})});var jt=kx(),Rn=nt(jt),qn=S(Rn);cx(qn,{});var Tt=x(qn,2),kt=S(Tt);{var Qt=K=>{var ge=Gn(),we=nt(ge);{var We=Ge=>{var xt=Gn(),Ee=nt(xt);l0(Ee,()=>l(rn),(Ue,$e)=>{$e(Ue,{})}),q(Ge,xt)},ht=Ge=>{var xt=vx();q(Ge,xt)};de(we,Ge=>{l(rn)?Ge(We):Ge(ht,-1)})}q(K,ge)},_t=K=>{var ge=Gn(),we=nt(ge);{var We=Ge=>{var xt=Gn(),Ee=nt(xt);l0(Ee,()=>l(Bt),(Ue,$e)=>{$e(Ue,{})}),q(Ge,xt)},ht=Ge=>{var xt=Ex();q(Ge,xt)};de(we,Ge=>{l(Bt)?Ge(We):Ge(ht,-1)})}q(K,ge)},un=K=>{var ge=Dx(),we=S(ge),We=S(we),ht=x(S(We),2),Ge=S(ht),xt=S(Ge);s6(xt,{size:18,"aria-hidden":"true"});var Ee=x(Ge,2),Ue=S(Ee);ZN(Ue,{size:18,"aria-hidden":"true"});var $e=x(We,2),Ke=S($e);ob(Ke,{class:"search-icon",size:16,"aria-hidden":"true"});var fe=x(Ke,2),Zt=x($e,2);{var At=He=>{var Lt=Tx(),Yt=S(Lt);se(()=>oe(Yt,`Couldn’t load content: ${l(a)??""}`)),q(He,Lt)},Rt=He=>{var Lt=Gn(),Yt=nt(Lt);{var Sn=Ft=>{var pt=_x(),zt=S(pt);se(Ut=>oe(zt,`No matches for “${Ut??""}”.`),[()=>l(g).trim()]),q(Ft,pt)},gn=Ft=>{var pt=yx();It(pt,23,()=>l(f),zt=>zt.path,(zt,Ut,Dn)=>{var yt=Ax();let Le;var Te=S(yt),Me=S(Te),gt=x(Te,2),Wt=S(gt);se(()=>{ve(yt,"id",`search-option-${l(Dn)}`),Le=Je(yt,1,"result svelte-whg6dh",null,Le,{active:l(Dn)===l(m),unpublished:!l(Ut).isPublished}),ve(yt,"aria-selected",l(Dn)===l(m)),ve(yt,"aria-label",l(Ut).isPublished?void 0:`${l(Ut).title}, not published`),oe(Me,l(Ut).title),oe(Wt,l(Ut).path)}),ae("click",yt,()=>Y(l(Ut))),Be("mouseenter",yt,()=>y(m,l(Dn),!0)),q(zt,yt)}),pn(pt,zt=>y(b,zt),()=>l(b)),q(Ft,pt)};de(Yt,Ft=>{l(f).length===0?Ft(Sn):Ft(gn,-1)})}q(He,Lt)},mn=Ae(()=>l(g).trim()!==""),Qn=He=>{var Lt=Ix(),Yt=S(Lt);let Sn;var gn=S(Yt);t6(gn,{size:16,"aria-hidden":"true"});var Ft=x(gn,4);{var pt=Te=>{var Me=Nx();q(Te,Me)},zt=Te=>{var Me=Sx();q(Te,Me)};de(Ft,Te=>{l(j)==="broken"?Te(pt):l(j)==="draft"&&Te(zt,1)})}var Ut=x(Yt,2);{let Te=Ae(()=>{var Me;return((Me=l(n))==null?void 0:Me.path)??null});Av(Ut,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return l(Te)},get activeDir(){return l(u)},onselect:H,onopenDir:J,onsettingsDir:ze,onreorder:X,onmove:te})}var Dn=x(Ut,2);{var yt=Te=>{var Me=wx();let gt;se(Wt=>gt=Je(Me,1,"root-drop svelte-whg6dh",null,gt,Wt),[()=>({over:li()!==null&&l(i)})]),Be("dragover",Me,Wt=>{Wt.preventDefault(),y(i,!0)}),Be("dragleave",Me,()=>y(i,!1)),Be("drop",Me,Wt=>{y(i,!1),T(Wt)}),q(Te,Me)},Le=Ae(()=>{var Te;return li()!==null&&((Te=li())==null?void 0:Te.parent)!==""});de(Dn,Te=>{l(Le)&&Te(yt)})}se(()=>{Sn=Je(Yt,1,"home-row svelte-whg6dh",null,Sn,{active:l(u)==="",unpublished:l(j)==="draft"||l(j)==="broken",broken:l(j)==="broken"}),ve(Yt,"aria-current",l(u)===""),ve(Yt,"title",l(M))}),ae("click",Yt,()=>J("")),q(He,Lt)};de(Zt,He=>{l(a)?He(At):l(mn)?He(Rt,1):He(Qn,-1)})}var mr=x(we,2);z8(mr,{});var jn=x(mr,2),Ct=S(jn);{var Js=He=>{var Lt=Gn(),Yt=nt(Lt);iT(Yt,()=>`${l(n).path}\0${l(n).templateName}`,Sn=>{{let gn=Ae(()=>l(d)?void 0:yn),Ft=Ae(()=>l(h)?void 0:qt);g8(Sn,{get item(){return l(n).item},get templateName(){return l(n).templateName},get path(){return l(n).path},get templates(){return l(Ne)},get onrename(){return l(gn)},get ondelete(){return l(Ft)},onchangetemplate:R,onmove:D,onsaved:(pt,zt,Ut)=>{PN(pt,zt),MN(pt,Ut)}})}}),q(He,Lt)},ea=He=>{var Lt=Ox(),Yt=S(Lt),Sn=x(S(Yt),4),gn=x(S(Sn),2),Ft=S(gn),pt=S(Ft);Ft.value=Ft.__value="";var zt=x(Ft);It(zt,16,()=>l(Ne),yt=>yt,(yt,Le)=>{var Te=Cx(),Me=S(Te),gt={};se(()=>{oe(Me,Le),gt!==(gt=Le)&&(Te.value=(Te.__value=Le)??"")}),q(yt,Te)});var Ut=x(Sn,2);{var Dn=yt=>{var Le=Lx();se(()=>Le.disabled=l($)),ae("click",Le,qt),q(yt,Le)};de(Ut,yt=>{l(h)||yt(Dn)})}se(()=>{gn.disabled=l($)||l(Ne).length===0,oe(pt,l(Ne).length===0?"No templates exist yet":"Choose…")}),ae("change",gn,yt=>G(yt.currentTarget.value)),q(He,Lt)},ta=He=>{B8(He,{get folderPath(){return l(r)},get name(){return l(s)},get templates(){return l(Ne)},oncreate:F})},na=He=>{var Lt=xx();q(He,Lt)},ra=He=>{var Lt=Rx();q(He,Lt)};de(Ct,He=>{l(n)&&l(n).templateName?He(Js):l(n)?He(ea,1):l(r)!==null?He(ta,2):ut.isAdmin&&l(k)&&l(O)?He(na,3):He(ra,-1)})}se(()=>{ve(fe,"aria-expanded",l(f).length>0),ve(fe,"aria-activedescendant",l(m)>=0?`search-option-${l(m)}`:void 0)}),ae("click",Ge,()=>Ie("")),ae("click",Ee,Se),ae("keydown",fe,E),vt(fe,()=>l(g),He=>y(g,He)),q(K,ge)};de(kt,K=>{Ar.mode==="templates"?K(Qt):Ar.mode==="migrations"?K(_t,1):K(un,-1)})}var $t=x(Tt,2);_8($t,{});var Xn=x(Rn,2);{var pr=K=>{k8(K,{get folders(){return l(ce)},get templates(){return l(Ne)},oncreated:ye,oncancel:()=>y(pe,!1)})};de(Xn,K=>{l(pe)&&K(pr)})}var Nn=x(Xn,2);{var Ur=K=>{L8(K,{get folderPath(){return l(De)},get templates(){return l(Ne)},get folders(){return l(ce)},onsaved:et,oncancel:()=>y(De,null),onnewsubfolder:xe,onrenamefolder:Vt,ondeletefolder:Qe,onmove:v})};de(Nn,K=>{l(De)!==null&&K(Ur)})}q(t,jt),dt()}bt(["click","keydown","change"]);var Mx=z('<h2 class="svelte-z86ibt"> </h2>'),Bx=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <input class="svelte-z86ibt"/></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),Fx=z('<h2 class="svelte-z86ibt"> </h2>'),Ux=z("<option> </option>"),Hx=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <select class="svelte-z86ibt"><option disabled=""> </option><!></select></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),qx=z('<h2 class="svelte-z86ibt"> </h2>'),jx=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button></div>',1),$x=z('<h2 class="svelte-z86ibt"> </h2>'),Yx=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions decide-actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button> <button type="button" class="primary svelte-z86ibt"> </button></div>',1),zx=z('<h2 class="svelte-z86ibt"> </h2>'),Wx=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),Gx=z('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function Kx(t,e){ct(e,!0);let n,r=Z(""),s=Z("");Dt(()=>{const m=Ru.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=Ru.pending;(m==null?void 0:m.kind)==="confirm"?Mc(!1):(m==null?void 0:m.kind)==="prompt"?Bc(null):(m==null?void 0:m.kind)==="select"?Fc(null):(m==null?void 0:m.kind)==="decide"?Du("cancel"):op()}function i(m){m.preventDefault(),a()}function o(m){m.target===n&&a()}function u(m){m.preventDefault(),Bc(l(r))}function d(m){m.preventDefault(),l(s)!==""&&Fc(l(s))}var h=Gx(),g=S(h);{var f=m=>{const b=Ae(()=>Ru.pending);var _=Gn(),A=nt(_);{var E=J=>{var F=Bx(),Y=S(F);{var X=j=>{var M=Mx(),$=S(M);se(()=>oe($,l(b).options.title)),q(j,M)};de(Y,j=>{l(b).options.title&&j(X)})}var te=x(Y,2),T=S(te),D=S(T),v=x(T,2);Li(v,!0);var R=x(te,2),k=S(R),O=x(k,2),W=S(O);se(()=>{oe(D,l(b).message),ve(v,"placeholder",l(b).options.placeholder??""),oe(W,l(b).options.confirmLabel??"OK")}),Be("submit",F,u),vt(v,()=>l(r),j=>y(r,j)),ae("click",k,()=>Bc(null)),q(J,F)},C=J=>{var F=Hx(),Y=S(F);{var X=G=>{var ee=Fx(),le=S(ee);se(()=>oe(le,l(b).options.title)),q(G,ee)};de(Y,G=>{l(b).options.title&&G(X)})}var te=x(Y,2),T=S(te),D=S(T),v=x(T,2);Li(v,!0);var R=S(v),k=S(R);R.value=R.__value="";var O=x(R);It(O,17,()=>l(b).choices,G=>G.value,(G,ee)=>{var le=Ux(),be=S(le),pe={};se(()=>{oe(be,l(ee).label),pe!==(pe=l(ee).value)&&(le.value=(le.__value=l(ee).value)??"")}),q(G,le)});var W=x(te,2),j=S(W),M=x(j,2),$=S(M);se(()=>{oe(D,l(b).message),oe(k,l(b).options.placeholder??"Choose…"),M.disabled=l(s)==="",oe($,l(b).options.confirmLabel??"OK")}),Be("submit",F,d),xa(v,()=>l(s),G=>y(s,G)),ae("click",j,()=>Fc(null)),q(J,F)},I=J=>{var F=jx(),Y=nt(F);{var X=j=>{var M=qx(),$=S(M);se(()=>oe($,l(b).options.title)),q(j,M)};de(Y,j=>{l(b).options.title&&j(X)})}var te=x(Y,2),T=S(te),D=x(te,2),v=S(D),R=S(v),k=x(v,2);let O;var W=S(k);se(()=>{oe(T,l(b).message),oe(R,l(b).options.cancelLabel??"Cancel"),O=Je(k,1,"primary svelte-z86ibt",null,O,{danger:l(b).options.danger}),oe(W,l(b).options.confirmLabel??"Confirm")}),ae("click",v,()=>Mc(!1)),ae("click",k,()=>Mc(!0)),q(J,F)},H=J=>{var F=Yx(),Y=nt(F);{var X=$=>{var G=$x(),ee=S(G);se(()=>oe(ee,l(b).options.title)),q($,G)};de(Y,$=>{l(b).options.title&&$(X)})}var te=x(Y,2),T=S(te),D=x(te,2),v=S(D),R=S(v),k=x(v,2);let O;var W=S(k),j=x(k,2),M=S(j);se(()=>{oe(T,l(b).message),oe(R,l(b).options.cancelLabel),O=Je(k,1,"ghost svelte-z86ibt",null,O,{"danger-ghost":l(b).options.secondaryDanger}),oe(W,l(b).options.secondaryLabel),oe(M,l(b).options.primaryLabel)}),ae("click",v,()=>Du("cancel")),ae("click",k,()=>Du("secondary")),ae("click",j,()=>Du("primary")),q(J,F)},B=J=>{var F=Wx(),Y=nt(F);{var X=R=>{var k=zx(),O=S(k);se(()=>oe(O,l(b).options.title)),q(R,k)};de(Y,R=>{l(b).options.title&&R(X)})}var te=x(Y,2),T=S(te),D=x(te,2),v=S(D);se(()=>oe(T,l(b).message)),ae("click",v,()=>op()),q(J,F)};de(A,J=>{l(b).kind==="prompt"?J(E):l(b).kind==="select"?J(C,1):l(b).kind==="confirm"?J(I,2):l(b).kind==="decide"?J(H,3):J(B,-1)})}q(m,_)};de(g,m=>{Ru.pending&&m(f)})}pn(h,m=>n=m,()=>n),Be("cancel",h,i),ae("click",h,o),q(t,h),dt()}bt(["click"]);var Vx=z('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),Xx=z('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),Qx=z('<p class="hint svelte-o6yxmi">No matching pages.</p>'),Zx=z('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),Jx=z('<div class="search svelte-o6yxmi"><!> <input type="search" role="combobox" placeholder="Search pages by title…" aria-label="Search pages by title" aria-controls="link-results" aria-autocomplete="list" class="svelte-o6yxmi"/></div> <div class="results-area svelte-o6yxmi"><!></div>',1),eR=z('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),tR=z('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),nR=z('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),rR=z('<h2 class="svelte-o6yxmi">Link</h2> <div class="tabs svelte-o6yxmi" role="tablist" aria-label="Link type"><button type="button" role="tab">Page</button> <button type="button" role="tab">External URL</button></div> <div class="body svelte-o6yxmi"><!></div> <div class="actions svelte-o6yxmi"><button type="button" class="ghost svelte-o6yxmi">Cancel</button> <!> <!></div>',1),sR=z('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function aR(t,e){ct(e,!0);let n=Z(void 0),r=Z("page"),s=Z(""),a=Z(lt([])),i=Z(-1),o=Z(""),u=Z(void 0);const d=Ae(()=>W6.pending);Dt(()=>{var I,H;if(l(d)===null){(I=l(n))==null||I.close();return}const C=l(d).current;y(r,C===""||Fo(C)?"page":"url",!0),y(s,""),y(a,[],!0),y(i,-1),y(o,Fo(C)?"":C,!0),(H=l(n))==null||H.showModal()});let h;Dt(()=>{const C=l(s);if(clearTimeout(h),l(r)!=="page"||C.trim()===""){y(a,[],!0),y(i,-1);return}return h=setTimeout(()=>{qg(C).then(I=>{C===l(s)&&(y(a,I,!0),y(i,I.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(C){Za(G6(C.path))}function f(){const C=l(o).trim();C!==""&&Za(C)}function m(){var C,I;(I=(C=l(u))==null?void 0:C.children[l(i)])==null||I.scrollIntoView({block:"nearest"})}function b(C){if(l(a).length!==0){if(C.key==="ArrowDown")C.preventDefault(),y(i,(l(i)+1)%l(a).length),m();else if(C.key==="ArrowUp")C.preventDefault(),y(i,(l(i)-1+l(a).length)%l(a).length),m();else if(C.key==="Enter"){C.preventDefault();const I=l(a)[l(i)]??l(a)[0];I!==void 0&&g(I)}}}var _=sR(),A=S(_);{var E=C=>{var I=rR(),H=x(nt(I),2),B=S(H);let J;var F=x(B,2);let Y;var X=x(H,2),te=S(X);{var T=M=>{var $=Jx(),G=nt($),ee=S(G);ob(ee,{class:"search-icon",size:16,"aria-hidden":"true"});var le=x(ee,2);Li(le,!0);var be=x(G,2),pe=S(be);{var Ne=ye=>{var Ie=Xx();It(Ie,23,()=>l(a),xe=>xe.path,(xe,De,ze)=>{var et=Vx();let Vt;var Qe=S(et),Xt=S(Qe),nn=x(Qe,2),qt=S(nn);se(()=>{ve(et,"id",`link-option-${l(ze)}`),Vt=Je(et,1,"result svelte-o6yxmi",null,Vt,{active:l(ze)===l(i)}),ve(et,"aria-selected",l(ze)===l(i)),oe(Xt,l(De).title),oe(qt,l(De).path)}),ae("click",et,()=>g(l(De))),Be("mouseenter",et,()=>y(i,l(ze),!0)),q(xe,et)}),pn(Ie,xe=>y(u,xe),()=>l(u)),q(ye,Ie)},ce=ye=>{var Ie=Qx();q(ye,Ie)},he=Ae(()=>l(s).trim()!==""),Se=ye=>{var Ie=Zx();q(ye,Ie)};de(pe,ye=>{l(a).length>0?ye(Ne):l(he)?ye(ce,1):ye(Se,-1)})}se(()=>{ve(le,"aria-expanded",l(a).length>0),ve(le,"aria-activedescendant",l(i)>=0?`link-option-${l(i)}`:void 0)}),ae("keydown",le,b),vt(le,()=>l(s),ye=>y(s,ye)),q(M,$)},D=M=>{var $=eR(),G=x(S($),2);ae("keydown",G,ee=>{ee.key==="Enter"&&(ee.preventDefault(),f())}),vt(G,()=>l(o),ee=>y(o,ee)),q(M,$)};de(te,M=>{l(r)==="page"?M(T):M(D,-1)})}var v=x(X,2),R=S(v),k=x(R,2);{var O=M=>{var $=tR();ae("click",$,()=>Za("")),q(M,$)};de(k,M=>{l(d).current!==""&&M(O)})}var W=x(k,2);{var j=M=>{var $=nR();se(G=>$.disabled=G,[()=>l(o).trim()===""]),ae("click",$,f),q(M,$)};de(W,M=>{l(r)==="url"&&M(j)})}se(()=>{J=Je(B,1,"tab svelte-o6yxmi",null,J,{active:l(r)==="page"}),ve(B,"aria-selected",l(r)==="page"),Y=Je(F,1,"tab svelte-o6yxmi",null,Y,{active:l(r)==="url"}),ve(F,"aria-selected",l(r)==="url")}),ae("click",B,()=>y(r,"page")),ae("click",F,()=>y(r,"url")),ae("click",R,()=>Za(null)),q(C,I)};de(A,C=>{l(d)!==null&&C(E)})}pn(_,C=>y(n,C),()=>l(n)),Be("close",_,()=>Za(null)),Be("cancel",_,()=>Za(null)),q(t,_),dt()}bt(["click","keydown"]);var iR=z('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),oR=z(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
137
- password.</p>`),uR=z('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),lR=z(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),cR=z('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),dR=z('<p class="error svelte-2jpsc9" role="alert"> </p>'),fR=z('<main class="screen svelte-2jpsc9"><section class="panel svelte-2jpsc9"><header class="svelte-2jpsc9"><!> <h1 class="svelte-2jpsc9"> </h1> <!></header> <form autocomplete="on" class="svelte-2jpsc9"><label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Username</span> <input type="text" name="username" autocomplete="username" required="" class="svelte-2jpsc9"/></label> <label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Password</span> <input type="password" name="password" required="" class="svelte-2jpsc9"/></label> <!> <!> <button type="submit" class="primary svelte-2jpsc9"><!></button></form></section></main>');function hR(t,e){ct(e,!0);const n=Ae(()=>Ln.name??"nanoesis");let r=Z(""),s=Z(""),a=Z(""),i=Z(!1),o=Z(null),u=Ae(()=>ut.firstRun&&l(a)!==""&&l(s)!==l(a)),d=Ae(()=>!l(i)&&l(r).trim()!==""&&l(s)!==""&&(!ut.firstRun||l(a)!==""&&!l(u)));async function h(M){if(M.preventDefault(),!l(d))return;y(i,!0),y(o,null);const $=await ut.login(l(r),l(s));if(y(i,!1),!$.ok){y(o,g($.error??"Sign-in failed."),!0);return}}function g(M){return M.includes("locked")?"Account temporarily locked, try again shortly.":M.includes("credentials")?"Invalid credentials. Check your username and password.":M}var f=fR(),m=S(f),b=S(m),_=S(b);{var A=M=>{var $=iR();se(()=>ve($,"src",Ln.logoUrl)),q(M,$)};de(_,M=>{Ln.logoUrl&&M(A)})}var E=x(_,2),C=S(E),I=x(E,2);{var H=M=>{var $=oR();q(M,$)},B=M=>{var $=uR();q(M,$)};de(I,M=>{ut.firstRun?M(H):M(B,-1)})}var J=x(b,2),F=S(J),Y=x(S(F),2);Li(Y,!0);var X=x(F,2),te=x(S(X),2),T=x(X,2);{var D=M=>{var $=cR(),G=x(S($),2),ee=x(G,2);{var le=be=>{var pe=lR();q(be,pe)};de(ee,be=>{l(u)&&be(le)})}vt(G,()=>l(a),be=>y(a,be)),q(M,$)};de(T,M=>{ut.firstRun&&M(D)})}var v=x(T,2);{var R=M=>{var $=dR(),G=S($);se(()=>oe(G,l(o))),q(M,$)};de(v,M=>{l(o)&&M(R)})}var k=x(v,2),O=S(k);{var W=M=>{var $=fl();se(()=>oe($,ut.firstRun?"Creating…":"Signing in…")),q(M,$)},j=M=>{var $=fl();se(()=>oe($,ut.firstRun?"Create admin account":"Sign in")),q(M,$)};de(O,M=>{l(i)?M(W):M(j,-1)})}se(()=>{oe(C,l(n)),ve(te,"autocomplete",ut.firstRun?"new-password":"current-password"),k.disabled=!l(d)}),Be("submit",J,h),vt(Y,()=>l(r),M=>y(r,M)),vt(te,()=>l(s),M=>y(s,M)),q(t,f),dt()}var pR=z('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),mR=z('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),gR=z('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),bR=z('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),vR=z('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),ER=z("<li><!></li>"),TR=z('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),_R=z('<dialog aria-label="Problems" class="svelte-7emrh2"><h2 class="svelte-7emrh2">Problems</h2> <!> <div class="actions svelte-7emrh2"><button type="button" class="ghost svelte-7emrh2">Re-check</button> <button type="button" class="primary svelte-7emrh2">Close</button></div></dialog>');function AR(t,e){ct(e,!0);let n;const r=Ae(()=>En.errors),s=Ae(()=>En.warnings);Dt(()=>{En.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(E){sf.request(E),En.closePanel()}function i(E){E.preventDefault(),En.closePanel()}function o(E){E.target===n&&En.closePanel()}var u=_R(),d=x(S(u),2);{var h=E=>{var C=pR();q(E,C)},g=E=>{var C=mR();q(E,C)},f=E=>{var C=gR();q(E,C)},m=E=>{var C=TR(),I=nt(C),H=S(I),B=x(H);{var J=Y=>{var X=fl();se(()=>oe(X,`,
138
+ and components directly.</p></div></div>`),Mx=z('<div class="panes svelte-whg6dh"><aside class="tree svelte-whg6dh" aria-label="Content"><div class="tree-head svelte-whg6dh"><h2 class="tree-title svelte-whg6dh">Content</h2> <div class="tree-head-actions svelte-whg6dh"><button type="button" class="add svelte-whg6dh" title="New folder" aria-label="New folder"><!></button> <button type="button" class="add svelte-whg6dh" title="New content item" aria-label="New content item"><!></button></div></div> <div class="search svelte-whg6dh"><!> <input type="search" role="combobox" placeholder="Search titles…" aria-label="Search content by title" aria-controls="search-results" aria-autocomplete="list" class="svelte-whg6dh"/></div> <!></aside> <!> <main class="work svelte-whg6dh"><!></main></div>'),Bx=z('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!>',1);function Fx(t,e){ct(e,!0);let n=Z(null);Dt(()=>{const K=sf.target;K!==null&&(sf.clear(),(async()=>await ab("Opening this item will close the open file.")&&(Ar.set("content"),await B(K)))())});let r=Z(null),s=Z(""),a=Z(null),i=Z(!1);function o(K){return K==="index"?"":K.endsWith("/index")?K.slice(0,-6):null}const u=Ae(()=>l(r)??(l(n)!==null?o(l(n).path):null)),d=Ae(()=>l(n)!==null&&o(l(n).path)!==null),h=Ae(()=>{var K;return((K=l(n))==null?void 0:K.path)==="index"});let g=Z(""),f=Z(lt([])),m=Z(-1),b=Z(void 0),_;Dt(()=>{const K=l(g);if(clearTimeout(_),K.trim()===""){y(f,[],!0),y(m,-1);return}return _=setTimeout(()=>{$g(K).then(ge=>{K===l(g)&&(y(f,ge,!0),y(m,ge.length>0?0:-1,!0))})},200),()=>clearTimeout(_)});function A(){pm().then(()=>{var K,ge;return(ge=(K=l(b))==null?void 0:K.children[l(m)])==null?void 0:ge.scrollIntoView({block:"nearest"})})}function E(K){if(K.key==="Escape"){y(g,"");return}if(l(f).length!==0){if(K.key==="ArrowDown")K.preventDefault(),y(m,(l(m)+1)%l(f).length),A();else if(K.key==="ArrowUp")K.preventDefault(),y(m,(l(m)-1+l(f).length)%l(f).length),A();else if(K.key==="Enter"){K.preventDefault();const ge=l(f)[l(m)]??l(f)[0];ge!==void 0&&Y(ge)}}}Ua(()=>{Kl("").catch(we=>{y(a,we instanceof Error?we.message:String(we),!0)}),he();const K=we=>{nf.hasDirty&&(we.preventDefault(),we.returnValue="")};window.addEventListener("beforeunload",K);const ge=GN({reconcileOnce:async()=>{const we=await Ge("/api/reconcile",{method:"POST"});return we.ok?WN(await we.json().catch(()=>null)):{changed:!1,added:0,removed:0}},onChanged:()=>{BN(),$N()},isVisible:()=>document.visibilityState==="visible"});return ge.start(),()=>{window.removeEventListener("beforeunload",K),ge.stop()}});function C(K){return K.includes("/")?K.slice(0,K.lastIndexOf("/")):""}function I(K){return l(n)!==null&&(l(n).path===K||l(n).path.startsWith(`${K}/`))}async function H(K,ge){try{const we=await rp(K);y(r,null),y(n,{item:we,path:K,templateName:ge},!0)}catch(we){await en(we instanceof Error?we.message:String(we))}}async function B(K){try{const ge=await rp(K);y(r,null),y(n,{item:ge,path:K,templateName:await sN(K,ge.template)},!0)}catch(ge){await en(ge instanceof Error?ge.message:String(ge))}}async function J(K){const ge=K===""?"index":`${K}/index`;await TN(ge)?await B(ge):(y(n,null),await he(),y(s,await Xd(K),!0),y(r,K,!0))}async function F(K){const ge=l(r);if(ge===null)return;const we=ge===""?"index":`${ge}/index`,We=await Xd(ge);try{await Kg(we,We,K)}catch(ht){await en(ht instanceof Error?ht.message:String(ht));return}await In(ge),await ro(we),await B(we)}async function Y(K){y(g,""),await ro(K.path),await H(K.path,K.template)}async function X(K,ge){try{await NN(K,ge)}catch(we){await en(we instanceof Error?we.message:String(we)),await In(K)}}async function te(K,ge,we){var Ke;const We=C(K);if(we===We)return;let ht;try{ht=ge==="item"?await IN(K,we):await CN(K,we)}catch(xt){await en(xt instanceof Error?xt.message:String(xt));return}ge==="item"?await xu(Tr(K),Tr(ht)):await xu(`${Tr(K)}*`,`${Tr(ht)}:splat`),await In(We),await In(we),await ro(ht),ge==="item"&&((Ke=l(n))==null?void 0:Ke.path)===K?await B(ht):ge==="dir"&&I(K)&&y(n,null)}async function T(K){K.preventDefault();const ge=li();Cs(),ge!==null&&ge.parent!==""&&await te(ge.entry.path,ge.entry.kind,"")}async function D(K){l(n)!==null&&await te(l(n).path,"item",K)}async function v(K){const ge=l(De);y(De,null),ge!==null&&await te(ge,"dir",K)}async function R(K){if(l(n)===null)return;const{path:ge}=l(n);try{await sp(ge,K)}catch(we){await en(we instanceof Error?we.message:String(we));return}await In(C(ge)),await B(ge)}const k=Ae(()=>ui("")!==void 0),O=Ae(()=>{var K;return(((K=ui(""))==null?void 0:K.entries.length)??-1)===0}),W=Ae(()=>{const K=ui(""),ge=K==null?void 0:K.entries.find(we=>we.kind==="item"&&we.slug==="index");return(ge==null?void 0:ge.kind)==="item"?ge:void 0}),j=Ae(()=>{var we;const K=l(W);return K===void 0?"missing":(K.template??((we=ui(""))==null?void 0:we.defaultTemplate))===void 0?"broken":K.isPublished?"published":"draft"}),M=Ae(()=>{switch(l(j)){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 $=Z(!1);async function G(K){if(!(l(n)===null||K==="")){y($,!0);try{await sp(l(n).path,K),await In(C(l(n).path)),await B(l(n).path)}catch(ge){await en(ge instanceof Error?ge.message:String(ge))}finally{y($,!1)}}}let ee=Z(!1),le=Z(!1);Dt(()=>{!l(le)&&!l(ee)&&ut.isAdmin&&l(k)&&l(O)&&(y(le,!0),be())});async function be(){y(ee,!0);try{await hN(),VN(localStorage),await In(""),await he(),await B("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(ee,!1)}}let pe=Z(!1),Ne=Z(lt([])),ce=Z(lt([]));async function he(){const K=await Zd("templates");y(Ne,K.filter(ge=>ge!==au&&!Id(ge.split("/").pop()??ge)),!0)}async function Se(){await he(),y(ce,await Kd(),!0),y(pe,!0)}async function ye(K){y(pe,!1),await In(C(K)),await ro(K),await B(K)}async function Ie(K){const ge=await yo("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ge===null||ge.trim()==="")return;let we;try{we=await _N(K,ge)}catch(We){await en(We instanceof Error?We.message:String(We));return}await In(K),await ro(`${we}/_`)}async function xe(){const K=l(De);y(De,null),K!==null&&await Ie(K)}let De=Z(null);async function ze(K){await he(),y(ce,await Kd(),!0),y(De,K,!0)}async function et(){const K=l(De);y(De,null),K!==null&&await In(K),l(n)!==null&&await B(l(n).path)}async function Vt(){const K=l(De);y(De,null),K!==null&&await nn(K)}async function Qe(){const K=l(De);y(De,null),K!==null&&await Xt(K)}async function Xt(K){const ge=tl(K);if(await yl(`Delete the folder “${ge}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Al(di(K))}catch(We){await en(We instanceof Error?We.message:String(We));return}I(K)&&y(n,null),await In(C(K))}}async function nn(K){const ge=tl(K),we=await yo("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ge,confirmLabel:"Change URL"});if(we===null)return;const We=ps(we);if(We===""||We===ge)return;const ht=J0(K,We);try{await Ra(di(K),di(ht))}catch(Ke){await en(Ke instanceof Error?Ke.message:String(Ke));return}await xu(`${Tr(K)}*`,`${Tr(ht)}:splat`),I(K)&&y(n,null),await In(C(K))}async function qt(){if(l(n)===null)return;const{path:K,item:ge}=l(n);if(await yl(`Delete “${ge.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Al(Bs(K))}catch(We){await en(We instanceof Error?We.message:String(We));return}lp(localStorage,K),y(n,null),await In(C(K))}}async function yn(){if(l(n)===null)return;const K=l(n).path,ge=tl(K),we=await yo("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ge,confirmLabel:"Change URL"});if(we===null)return;const We=ps(we);if(We===""||We===ge)return;const ht=J0(K,We);try{await Ra(Bs(K),Bs(ht))}catch(Ke){await en(Ke instanceof Error?Ke.message:String(Ke));return}lp(localStorage,K),await xu(Tr(K),Tr(ht)),await In(C(K)),await B(ht)}let rn=Z(null),Bt=Z(null);Dt(()=>{Ar.mode==="templates"&&l(rn)===null&&W0(()=>import("./TemplatesPane-DsexK0er.js").then(K=>K.T),__vite__mapDeps([0,1]),import.meta.url).then(K=>{y(rn,K.default,!0)}),Ar.mode==="migrations"&&l(Bt)===null&&W0(()=>import("./MigrationsPane-i0wjSyoQ.js"),__vite__mapDeps([2,3]),import.meta.url).then(K=>{y(Bt,K.default,!0)})});var jt=Bx(),Rn=nt(jt),qn=S(Rn);hx(qn,{});var Tt=x(qn,2),kt=S(Tt);{var Qt=K=>{var ge=Gn(),we=nt(ge);{var We=Ke=>{var xt=Gn(),Ee=nt(xt);l0(Ee,()=>l(rn),(Ue,$e)=>{$e(Ue,{})}),q(Ke,xt)},ht=Ke=>{var xt=_x();q(Ke,xt)};de(we,Ke=>{l(rn)?Ke(We):Ke(ht,-1)})}q(K,ge)},_t=K=>{var ge=Gn(),we=nt(ge);{var We=Ke=>{var xt=Gn(),Ee=nt(xt);l0(Ee,()=>l(Bt),(Ue,$e)=>{$e(Ue,{})}),q(Ke,xt)},ht=Ke=>{var xt=Ax();q(Ke,xt)};de(we,Ke=>{l(Bt)?Ke(We):Ke(ht,-1)})}q(K,ge)},un=K=>{var ge=Mx(),we=S(ge),We=S(we),ht=x(S(We),2),Ke=S(ht),xt=S(Ke);o6(xt,{size:18,"aria-hidden":"true"});var Ee=x(Ke,2),Ue=S(Ee);t6(Ue,{size:18,"aria-hidden":"true"});var $e=x(We,2),Ve=S($e);cb(Ve,{class:"search-icon",size:16,"aria-hidden":"true"});var fe=x(Ve,2),Zt=x($e,2);{var At=He=>{var Lt=yx(),Yt=S(Lt);se(()=>oe(Yt,`Couldn’t load content: ${l(a)??""}`)),q(He,Lt)},Rt=He=>{var Lt=Gn(),Yt=nt(Lt);{var Sn=Ft=>{var pt=Nx(),zt=S(pt);se(Ut=>oe(zt,`No matches for “${Ut??""}”.`),[()=>l(g).trim()]),q(Ft,pt)},gn=Ft=>{var pt=wx();It(pt,23,()=>l(f),zt=>zt.path,(zt,Ut,Dn)=>{var yt=Sx();let Le;var Te=S(yt),Me=S(Te),gt=x(Te,2),Wt=S(gt);se(()=>{ve(yt,"id",`search-option-${l(Dn)}`),Le=Je(yt,1,"result svelte-whg6dh",null,Le,{active:l(Dn)===l(m),unpublished:!l(Ut).isPublished}),ve(yt,"aria-selected",l(Dn)===l(m)),ve(yt,"aria-label",l(Ut).isPublished?void 0:`${l(Ut).title}, not published`),oe(Me,l(Ut).title),oe(Wt,l(Ut).path)}),ae("click",yt,()=>Y(l(Ut))),Be("mouseenter",yt,()=>y(m,l(Dn),!0)),q(zt,yt)}),pn(pt,zt=>y(b,zt),()=>l(b)),q(Ft,pt)};de(Yt,Ft=>{l(f).length===0?Ft(Sn):Ft(gn,-1)})}q(He,Lt)},mn=Ae(()=>l(g).trim()!==""),Qn=He=>{var Lt=Ox(),Yt=S(Lt);let Sn;var gn=S(Yt);s6(gn,{size:16,"aria-hidden":"true"});var Ft=x(gn,4);{var pt=Te=>{var Me=Ix();q(Te,Me)},zt=Te=>{var Me=Cx();q(Te,Me)};de(Ft,Te=>{l(j)==="broken"?Te(pt):l(j)==="draft"&&Te(zt,1)})}var Ut=x(Yt,2);{let Te=Ae(()=>{var Me;return((Me=l(n))==null?void 0:Me.path)??null});Sv(Ut,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return l(Te)},get activeDir(){return l(u)},onselect:H,onopenDir:J,onsettingsDir:ze,onreorder:X,onmove:te})}var Dn=x(Ut,2);{var yt=Te=>{var Me=Lx();let gt;se(Wt=>gt=Je(Me,1,"root-drop svelte-whg6dh",null,gt,Wt),[()=>({over:li()!==null&&l(i)})]),Be("dragover",Me,Wt=>{Wt.preventDefault(),y(i,!0)}),Be("dragleave",Me,()=>y(i,!1)),Be("drop",Me,Wt=>{y(i,!1),T(Wt)}),q(Te,Me)},Le=Ae(()=>{var Te;return li()!==null&&((Te=li())==null?void 0:Te.parent)!==""});de(Dn,Te=>{l(Le)&&Te(yt)})}se(()=>{Sn=Je(Yt,1,"home-row svelte-whg6dh",null,Sn,{active:l(u)==="",unpublished:l(j)==="draft"||l(j)==="broken",broken:l(j)==="broken"}),ve(Yt,"aria-current",l(u)===""),ve(Yt,"title",l(M))}),ae("click",Yt,()=>J("")),q(He,Lt)};de(Zt,He=>{l(a)?He(At):l(mn)?He(Rt,1):He(Qn,-1)})}var mr=x(we,2);K8(mr,{});var jn=x(mr,2),Ct=S(jn);{var Js=He=>{var Lt=Gn(),Yt=nt(Lt);lT(Yt,()=>`${l(n).path}\0${l(n).templateName}`,Sn=>{{let gn=Ae(()=>l(d)?void 0:yn),Ft=Ae(()=>l(h)?void 0:qt);E8(Sn,{get item(){return l(n).item},get templateName(){return l(n).templateName},get path(){return l(n).path},get templates(){return l(Ne)},get onrename(){return l(gn)},get ondelete(){return l(Ft)},onchangetemplate:R,onmove:D,onsaved:(pt,zt,Ut)=>{FN(pt,zt),UN(pt,Ut)}})}}),q(He,Lt)},ea=He=>{var Lt=Dx(),Yt=S(Lt),Sn=x(S(Yt),4),gn=x(S(Sn),2),Ft=S(gn),pt=S(Ft);Ft.value=Ft.__value="";var zt=x(Ft);It(zt,16,()=>l(Ne),yt=>yt,(yt,Le)=>{var Te=xx(),Me=S(Te),gt={};se(()=>{oe(Me,Le),gt!==(gt=Le)&&(Te.value=(Te.__value=Le)??"")}),q(yt,Te)});var Ut=x(Sn,2);{var Dn=yt=>{var Le=Rx();se(()=>Le.disabled=l($)),ae("click",Le,qt),q(yt,Le)};de(Ut,yt=>{l(h)||yt(Dn)})}se(()=>{gn.disabled=l($)||l(Ne).length===0,oe(pt,l(Ne).length===0?"No templates exist yet":"Choose…")}),ae("change",gn,yt=>G(yt.currentTarget.value)),q(He,Lt)},ta=He=>{H8(He,{get folderPath(){return l(r)},get name(){return l(s)},get templates(){return l(Ne)},oncreate:F})},na=He=>{var Lt=kx();q(He,Lt)},ra=He=>{var Lt=Px();q(He,Lt)};de(Ct,He=>{l(n)&&l(n).templateName?He(Js):l(n)?He(ea,1):l(r)!==null?He(ta,2):ut.isAdmin&&l(k)&&l(O)?He(na,3):He(ra,-1)})}se(()=>{ve(fe,"aria-expanded",l(f).length>0),ve(fe,"aria-activedescendant",l(m)>=0?`search-option-${l(m)}`:void 0)}),ae("click",Ke,()=>Ie("")),ae("click",Ee,Se),ae("keydown",fe,E),vt(fe,()=>l(g),He=>y(g,He)),q(K,ge)};de(kt,K=>{Ar.mode==="templates"?K(Qt):Ar.mode==="migrations"?K(_t,1):K(un,-1)})}var $t=x(Tt,2);N8($t,{});var Xn=x(Rn,2);{var pr=K=>{B8(K,{get folders(){return l(ce)},get templates(){return l(Ne)},oncreated:ye,oncancel:()=>y(pe,!1)})};de(Xn,K=>{l(pe)&&K(pr)})}var Nn=x(Xn,2);{var Ur=K=>{R8(K,{get folderPath(){return l(De)},get templates(){return l(Ne)},get folders(){return l(ce)},onsaved:et,oncancel:()=>y(De,null),onnewsubfolder:xe,onrenamefolder:Vt,ondeletefolder:Qe,onmove:v})};de(Nn,K=>{l(De)!==null&&K(Ur)})}q(t,jt),dt()}bt(["click","keydown","change"]);var Ux=z('<h2 class="svelte-z86ibt"> </h2>'),Hx=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <input class="svelte-z86ibt"/></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),qx=z('<h2 class="svelte-z86ibt"> </h2>'),jx=z("<option> </option>"),$x=z('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <select class="svelte-z86ibt"><option disabled=""> </option><!></select></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),Yx=z('<h2 class="svelte-z86ibt"> </h2>'),zx=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button></div>',1),Wx=z('<h2 class="svelte-z86ibt"> </h2>'),Gx=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions decide-actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button> <button type="button" class="primary svelte-z86ibt"> </button></div>',1),Kx=z('<h2 class="svelte-z86ibt"> </h2>'),Vx=z('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),Xx=z('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function Qx(t,e){ct(e,!0);let n,r=Z(""),s=Z("");Dt(()=>{const m=Ru.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=Ru.pending;(m==null?void 0:m.kind)==="confirm"?Mc(!1):(m==null?void 0:m.kind)==="prompt"?Bc(null):(m==null?void 0:m.kind)==="select"?Fc(null):(m==null?void 0:m.kind)==="decide"?Du("cancel"):op()}function i(m){m.preventDefault(),a()}function o(m){m.target===n&&a()}function u(m){m.preventDefault(),Bc(l(r))}function d(m){m.preventDefault(),l(s)!==""&&Fc(l(s))}var h=Xx(),g=S(h);{var f=m=>{const b=Ae(()=>Ru.pending);var _=Gn(),A=nt(_);{var E=J=>{var F=Hx(),Y=S(F);{var X=j=>{var M=Ux(),$=S(M);se(()=>oe($,l(b).options.title)),q(j,M)};de(Y,j=>{l(b).options.title&&j(X)})}var te=x(Y,2),T=S(te),D=S(T),v=x(T,2);Li(v,!0);var R=x(te,2),k=S(R),O=x(k,2),W=S(O);se(()=>{oe(D,l(b).message),ve(v,"placeholder",l(b).options.placeholder??""),oe(W,l(b).options.confirmLabel??"OK")}),Be("submit",F,u),vt(v,()=>l(r),j=>y(r,j)),ae("click",k,()=>Bc(null)),q(J,F)},C=J=>{var F=$x(),Y=S(F);{var X=G=>{var ee=qx(),le=S(ee);se(()=>oe(le,l(b).options.title)),q(G,ee)};de(Y,G=>{l(b).options.title&&G(X)})}var te=x(Y,2),T=S(te),D=S(T),v=x(T,2);Li(v,!0);var R=S(v),k=S(R);R.value=R.__value="";var O=x(R);It(O,17,()=>l(b).choices,G=>G.value,(G,ee)=>{var le=jx(),be=S(le),pe={};se(()=>{oe(be,l(ee).label),pe!==(pe=l(ee).value)&&(le.value=(le.__value=l(ee).value)??"")}),q(G,le)});var W=x(te,2),j=S(W),M=x(j,2),$=S(M);se(()=>{oe(D,l(b).message),oe(k,l(b).options.placeholder??"Choose…"),M.disabled=l(s)==="",oe($,l(b).options.confirmLabel??"OK")}),Be("submit",F,d),xa(v,()=>l(s),G=>y(s,G)),ae("click",j,()=>Fc(null)),q(J,F)},I=J=>{var F=zx(),Y=nt(F);{var X=j=>{var M=Yx(),$=S(M);se(()=>oe($,l(b).options.title)),q(j,M)};de(Y,j=>{l(b).options.title&&j(X)})}var te=x(Y,2),T=S(te),D=x(te,2),v=S(D),R=S(v),k=x(v,2);let O;var W=S(k);se(()=>{oe(T,l(b).message),oe(R,l(b).options.cancelLabel??"Cancel"),O=Je(k,1,"primary svelte-z86ibt",null,O,{danger:l(b).options.danger}),oe(W,l(b).options.confirmLabel??"Confirm")}),ae("click",v,()=>Mc(!1)),ae("click",k,()=>Mc(!0)),q(J,F)},H=J=>{var F=Gx(),Y=nt(F);{var X=$=>{var G=Wx(),ee=S(G);se(()=>oe(ee,l(b).options.title)),q($,G)};de(Y,$=>{l(b).options.title&&$(X)})}var te=x(Y,2),T=S(te),D=x(te,2),v=S(D),R=S(v),k=x(v,2);let O;var W=S(k),j=x(k,2),M=S(j);se(()=>{oe(T,l(b).message),oe(R,l(b).options.cancelLabel),O=Je(k,1,"ghost svelte-z86ibt",null,O,{"danger-ghost":l(b).options.secondaryDanger}),oe(W,l(b).options.secondaryLabel),oe(M,l(b).options.primaryLabel)}),ae("click",v,()=>Du("cancel")),ae("click",k,()=>Du("secondary")),ae("click",j,()=>Du("primary")),q(J,F)},B=J=>{var F=Vx(),Y=nt(F);{var X=R=>{var k=Kx(),O=S(k);se(()=>oe(O,l(b).options.title)),q(R,k)};de(Y,R=>{l(b).options.title&&R(X)})}var te=x(Y,2),T=S(te),D=x(te,2),v=S(D);se(()=>oe(T,l(b).message)),ae("click",v,()=>op()),q(J,F)};de(A,J=>{l(b).kind==="prompt"?J(E):l(b).kind==="select"?J(C,1):l(b).kind==="confirm"?J(I,2):l(b).kind==="decide"?J(H,3):J(B,-1)})}q(m,_)};de(g,m=>{Ru.pending&&m(f)})}pn(h,m=>n=m,()=>n),Be("cancel",h,i),ae("click",h,o),q(t,h),dt()}bt(["click"]);var Zx=z('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),Jx=z('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),eR=z('<p class="hint svelte-o6yxmi">No matching pages.</p>'),tR=z('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),nR=z('<div class="search svelte-o6yxmi"><!> <input type="search" role="combobox" placeholder="Search pages by title…" aria-label="Search pages by title" aria-controls="link-results" aria-autocomplete="list" class="svelte-o6yxmi"/></div> <div class="results-area svelte-o6yxmi"><!></div>',1),rR=z('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),sR=z('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),aR=z('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),iR=z('<h2 class="svelte-o6yxmi">Link</h2> <div class="tabs svelte-o6yxmi" role="tablist" aria-label="Link type"><button type="button" role="tab">Page</button> <button type="button" role="tab">External URL</button></div> <div class="body svelte-o6yxmi"><!></div> <div class="actions svelte-o6yxmi"><button type="button" class="ghost svelte-o6yxmi">Cancel</button> <!> <!></div>',1),oR=z('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function uR(t,e){ct(e,!0);let n=Z(void 0),r=Z("page"),s=Z(""),a=Z(lt([])),i=Z(-1),o=Z(""),u=Z(void 0);const d=Ae(()=>V6.pending);Dt(()=>{var I,H;if(l(d)===null){(I=l(n))==null||I.close();return}const C=l(d).current;y(r,C===""||Fo(C)?"page":"url",!0),y(s,""),y(a,[],!0),y(i,-1),y(o,Fo(C)?"":C,!0),(H=l(n))==null||H.showModal()});let h;Dt(()=>{const C=l(s);if(clearTimeout(h),l(r)!=="page"||C.trim()===""){y(a,[],!0),y(i,-1);return}return h=setTimeout(()=>{$g(C).then(I=>{C===l(s)&&(y(a,I,!0),y(i,I.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(C){Za(X6(C.path))}function f(){const C=l(o).trim();C!==""&&Za(C)}function m(){var C,I;(I=(C=l(u))==null?void 0:C.children[l(i)])==null||I.scrollIntoView({block:"nearest"})}function b(C){if(l(a).length!==0){if(C.key==="ArrowDown")C.preventDefault(),y(i,(l(i)+1)%l(a).length),m();else if(C.key==="ArrowUp")C.preventDefault(),y(i,(l(i)-1+l(a).length)%l(a).length),m();else if(C.key==="Enter"){C.preventDefault();const I=l(a)[l(i)]??l(a)[0];I!==void 0&&g(I)}}}var _=oR(),A=S(_);{var E=C=>{var I=iR(),H=x(nt(I),2),B=S(H);let J;var F=x(B,2);let Y;var X=x(H,2),te=S(X);{var T=M=>{var $=nR(),G=nt($),ee=S(G);cb(ee,{class:"search-icon",size:16,"aria-hidden":"true"});var le=x(ee,2);Li(le,!0);var be=x(G,2),pe=S(be);{var Ne=ye=>{var Ie=Jx();It(Ie,23,()=>l(a),xe=>xe.path,(xe,De,ze)=>{var et=Zx();let Vt;var Qe=S(et),Xt=S(Qe),nn=x(Qe,2),qt=S(nn);se(()=>{ve(et,"id",`link-option-${l(ze)}`),Vt=Je(et,1,"result svelte-o6yxmi",null,Vt,{active:l(ze)===l(i)}),ve(et,"aria-selected",l(ze)===l(i)),oe(Xt,l(De).title),oe(qt,l(De).path)}),ae("click",et,()=>g(l(De))),Be("mouseenter",et,()=>y(i,l(ze),!0)),q(xe,et)}),pn(Ie,xe=>y(u,xe),()=>l(u)),q(ye,Ie)},ce=ye=>{var Ie=eR();q(ye,Ie)},he=Ae(()=>l(s).trim()!==""),Se=ye=>{var Ie=tR();q(ye,Ie)};de(pe,ye=>{l(a).length>0?ye(Ne):l(he)?ye(ce,1):ye(Se,-1)})}se(()=>{ve(le,"aria-expanded",l(a).length>0),ve(le,"aria-activedescendant",l(i)>=0?`link-option-${l(i)}`:void 0)}),ae("keydown",le,b),vt(le,()=>l(s),ye=>y(s,ye)),q(M,$)},D=M=>{var $=rR(),G=x(S($),2);ae("keydown",G,ee=>{ee.key==="Enter"&&(ee.preventDefault(),f())}),vt(G,()=>l(o),ee=>y(o,ee)),q(M,$)};de(te,M=>{l(r)==="page"?M(T):M(D,-1)})}var v=x(X,2),R=S(v),k=x(R,2);{var O=M=>{var $=sR();ae("click",$,()=>Za("")),q(M,$)};de(k,M=>{l(d).current!==""&&M(O)})}var W=x(k,2);{var j=M=>{var $=aR();se(G=>$.disabled=G,[()=>l(o).trim()===""]),ae("click",$,f),q(M,$)};de(W,M=>{l(r)==="url"&&M(j)})}se(()=>{J=Je(B,1,"tab svelte-o6yxmi",null,J,{active:l(r)==="page"}),ve(B,"aria-selected",l(r)==="page"),Y=Je(F,1,"tab svelte-o6yxmi",null,Y,{active:l(r)==="url"}),ve(F,"aria-selected",l(r)==="url")}),ae("click",B,()=>y(r,"page")),ae("click",F,()=>y(r,"url")),ae("click",R,()=>Za(null)),q(C,I)};de(A,C=>{l(d)!==null&&C(E)})}pn(_,C=>y(n,C),()=>l(n)),Be("close",_,()=>Za(null)),Be("cancel",_,()=>Za(null)),q(t,_),dt()}bt(["click","keydown"]);var lR=z('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),cR=z(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
139
+ password.</p>`),dR=z('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),fR=z(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),hR=z('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),pR=z('<p class="error svelte-2jpsc9" role="alert"> </p>'),mR=z('<main class="screen svelte-2jpsc9"><section class="panel svelte-2jpsc9"><header class="svelte-2jpsc9"><!> <h1 class="svelte-2jpsc9"> </h1> <!></header> <form autocomplete="on" class="svelte-2jpsc9"><label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Username</span> <input type="text" name="username" autocomplete="username" required="" class="svelte-2jpsc9"/></label> <label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Password</span> <input type="password" name="password" required="" class="svelte-2jpsc9"/></label> <!> <!> <button type="submit" class="primary svelte-2jpsc9"><!></button></form></section></main>');function gR(t,e){ct(e,!0);const n=Ae(()=>Ln.name??"nanoesis");let r=Z(""),s=Z(""),a=Z(""),i=Z(!1),o=Z(null),u=Ae(()=>ut.firstRun&&l(a)!==""&&l(s)!==l(a)),d=Ae(()=>!l(i)&&l(r).trim()!==""&&l(s)!==""&&(!ut.firstRun||l(a)!==""&&!l(u)));async function h(M){if(M.preventDefault(),!l(d))return;y(i,!0),y(o,null);const $=await ut.login(l(r),l(s));if(y(i,!1),!$.ok){y(o,g($.error??"Sign-in failed."),!0);return}}function g(M){return M.includes("locked")?"Account temporarily locked, try again shortly.":M.includes("credentials")?"Invalid credentials. Check your username and password.":M}var f=mR(),m=S(f),b=S(m),_=S(b);{var A=M=>{var $=lR();se(()=>ve($,"src",Ln.logoUrl)),q(M,$)};de(_,M=>{Ln.logoUrl&&M(A)})}var E=x(_,2),C=S(E),I=x(E,2);{var H=M=>{var $=cR();q(M,$)},B=M=>{var $=dR();q(M,$)};de(I,M=>{ut.firstRun?M(H):M(B,-1)})}var J=x(b,2),F=S(J),Y=x(S(F),2);Li(Y,!0);var X=x(F,2),te=x(S(X),2),T=x(X,2);{var D=M=>{var $=hR(),G=x(S($),2),ee=x(G,2);{var le=be=>{var pe=fR();q(be,pe)};de(ee,be=>{l(u)&&be(le)})}vt(G,()=>l(a),be=>y(a,be)),q(M,$)};de(T,M=>{ut.firstRun&&M(D)})}var v=x(T,2);{var R=M=>{var $=pR(),G=S($);se(()=>oe(G,l(o))),q(M,$)};de(v,M=>{l(o)&&M(R)})}var k=x(v,2),O=S(k);{var W=M=>{var $=fl();se(()=>oe($,ut.firstRun?"Creating…":"Signing in…")),q(M,$)},j=M=>{var $=fl();se(()=>oe($,ut.firstRun?"Create admin account":"Sign in")),q(M,$)};de(O,M=>{l(i)?M(W):M(j,-1)})}se(()=>{oe(C,l(n)),ve(te,"autocomplete",ut.firstRun?"new-password":"current-password"),k.disabled=!l(d)}),Be("submit",J,h),vt(Y,()=>l(r),M=>y(r,M)),vt(te,()=>l(s),M=>y(s,M)),q(t,f),dt()}var bR=z('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),vR=z('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),ER=z('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),TR=z('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),_R=z('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),AR=z("<li><!></li>"),yR=z('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),NR=z('<dialog aria-label="Problems" class="svelte-7emrh2"><h2 class="svelte-7emrh2">Problems</h2> <!> <div class="actions svelte-7emrh2"><button type="button" class="ghost svelte-7emrh2">Re-check</button> <button type="button" class="primary svelte-7emrh2">Close</button></div></dialog>');function SR(t,e){ct(e,!0);let n;const r=Ae(()=>En.errors),s=Ae(()=>En.warnings);Dt(()=>{En.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(E){sf.request(E),En.closePanel()}function i(E){E.preventDefault(),En.closePanel()}function o(E){E.target===n&&En.closePanel()}var u=NR(),d=x(S(u),2);{var h=E=>{var C=bR();q(E,C)},g=E=>{var C=vR();q(E,C)},f=E=>{var C=ER();q(E,C)},m=E=>{var C=yR(),I=nt(C),H=S(I),B=x(H);{var J=Y=>{var X=fl();se(()=>oe(X,`,
138
140
  ${l(s).length??""}
139
- ${l(s).length===1?"warning":"warnings"}`)),q(Y,X)};de(B,Y=>{l(s).length>0&&Y(J)})}var F=x(I,2);It(F,21,()=>[...l(r),...l(s)],xo,(Y,X)=>{var te=ER(),T=S(te);{var D=R=>{var k=bR(),O=S(k),W=S(O),j=x(O,2),M=S(j);se(()=>{oe(W,l(X).severity),oe(M,l(X).message)}),ae("click",k,()=>a(l(X).path??"")),q(R,k)},v=R=>{var k=vR(),O=S(k),W=S(O),j=x(O,2),M=S(j);se(()=>{oe(W,l(X).severity),oe(M,l(X).message)}),q(R,k)};de(T,R=>{l(X).path?R(D):R(v,-1)})}se(()=>Je(te,1,_m(l(X).severity),"svelte-7emrh2")),q(Y,te)}),se(()=>oe(H,`${l(r).length??""}
140
- ${l(r).length===1?"error":"errors"}`)),q(E,C)};de(d,E=>{En.status==="checking"?E(h):En.status==="error"?E(g,1):l(r).length===0&&l(s).length===0?E(f,2):E(m,-1)})}var b=x(d,2),_=S(b),A=x(_,2);pn(u,E=>n=E,()=>n),se(()=>_.disabled=En.status==="checking"),Be("cancel",u,i),ae("click",u,o),ae("click",_,()=>void En.refresh()),ae("click",A,()=>En.closePanel()),q(t,u),dt()}bt(["click"]);var yR=z('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),NR=z("<!> <!> <!> <!>",1);function SR(t,e){ct(e,!1),Ua(()=>{ol.init(),ut.init(),Ln.load()}),Cm();var n=Gn(),r=nt(n);{var s=o=>{var u=yR();q(o,u)},a=o=>{hR(o,{})},i=o=>{var u=NR(),d=nt(u);Px(d,{});var h=x(d,2);Kx(h,{});var g=x(h,2);aR(g,{});var f=x(g,2);AR(f,{}),q(o,u)};de(r,o=>{ut.status==="loading"?o(s):ut.status==="unauthenticated"?o(a,1):o(i,-1)})}q(t,n),dt()}const wR=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],IR=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function yv(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&IR.has(t.type)))for(const[e,n]of wR)t.setAttribute(e,n)}function _1(t){for(const e of t.querySelectorAll("input, textarea"))yv(e)}function CR(){_1(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(yv(r),_1(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const Nv=document.getElementById("app");if(Nv===null)throw new Error("Missing #app mount point");wy().then(()=>{nT(SR,{target:Nv}),CR()});export{iT as $,nf as A,RR as B,e6 as C,mN as D,QR as E,ih as F,It as G,tD as H,Pr as I,eb as J,Be as K,sD as L,zR as M,nt as N,z as O,ZN as P,l as Q,nb as R,ob as S,de as T,ym as U,VR as V,KR as W,Ih as X,tb as Y,Id as Z,W0 as _,JN as a,GR as a0,Kd as a1,PR as a2,FR as a3,BR as a4,Ua as a5,zu as a6,dt as a7,dD as a8,WR as a9,hD as aA,Z as aB,se as aC,fl as aD,ol as aE,pm as aF,XR as aG,jR as aH,Ae as aI,Dt as aJ,yo as aa,ir as ab,lt as ac,lp as ad,ct as ae,HR as af,UN as ag,Ra as ah,LN as ai,hr as aj,$R as ak,Os as al,UR as am,aD as an,hl as ao,y as ap,eD as aq,ve as ar,TT as as,Je as at,Am as au,oe as av,ET as aw,x as ax,ps as ay,Dr as az,Qd as b,s6 as c,z8 as d,en as e,q as f,fD as g,xR as h,JR as i,wT as j,pn as k,vt as l,nD as m,rD as n,S as o,Gn as p,kR as q,yl as r,MR as s,DR as t,qR as u,bt as v,ae as w,Al as x,YR as y,ZR as z};
141
+ ${l(s).length===1?"warning":"warnings"}`)),q(Y,X)};de(B,Y=>{l(s).length>0&&Y(J)})}var F=x(I,2);It(F,21,()=>[...l(r),...l(s)],xo,(Y,X)=>{var te=AR(),T=S(te);{var D=R=>{var k=TR(),O=S(k),W=S(O),j=x(O,2),M=S(j);se(()=>{oe(W,l(X).severity),oe(M,l(X).message)}),ae("click",k,()=>a(l(X).path??"")),q(R,k)},v=R=>{var k=_R(),O=S(k),W=S(O),j=x(O,2),M=S(j);se(()=>{oe(W,l(X).severity),oe(M,l(X).message)}),q(R,k)};de(T,R=>{l(X).path?R(D):R(v,-1)})}se(()=>Je(te,1,_m(l(X).severity),"svelte-7emrh2")),q(Y,te)}),se(()=>oe(H,`${l(r).length??""}
142
+ ${l(r).length===1?"error":"errors"}`)),q(E,C)};de(d,E=>{En.status==="checking"?E(h):En.status==="error"?E(g,1):l(r).length===0&&l(s).length===0?E(f,2):E(m,-1)})}var b=x(d,2),_=S(b),A=x(_,2);pn(u,E=>n=E,()=>n),se(()=>_.disabled=En.status==="checking"),Be("cancel",u,i),ae("click",u,o),ae("click",_,()=>void En.refresh()),ae("click",A,()=>En.closePanel()),q(t,u),dt()}bt(["click"]);var wR=z('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),IR=z("<!> <!> <!> <!>",1);function CR(t,e){ct(e,!1),Ua(()=>{ol.init(),ut.init(),Ln.load()}),Cm();var n=Gn(),r=nt(n);{var s=o=>{var u=wR();q(o,u)},a=o=>{gR(o,{})},i=o=>{var u=IR(),d=nt(u);Fx(d,{});var h=x(d,2);Qx(h,{});var g=x(h,2);uR(g,{});var f=x(g,2);SR(f,{}),q(o,u)};de(r,o=>{ut.status==="loading"?o(s):ut.status==="unauthenticated"?o(a,1):o(i,-1)})}q(t,n),dt()}const LR=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],OR=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function wv(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&OR.has(t.type)))for(const[e,n]of LR)t.setAttribute(e,n)}function _1(t){for(const e of t.querySelectorAll("input, textarea"))wv(e)}function xR(){_1(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(wv(r),_1(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const Iv=document.getElementById("app");if(Iv===null)throw new Error("Missing #app mount point");Ly().then(()=>{aT(CR,{target:Iv}),xR()});export{Id as $,nf as A,PR as B,r6 as C,vN as D,tD as E,ih as F,It as G,aD as H,Pr as I,rb as J,Be as K,uD as L,VR as M,nt as N,z as O,t6 as P,l as Q,ab as R,cb as S,de as T,ym as U,JR as V,x3 as W,Ih as X,ZR as Y,sb as Z,W0 as _,n6 as a,lT as a0,QR as a1,Kd as a2,FR as a3,qR as a4,HR as a5,Ua as a6,zu as a7,dt as a8,mD as a9,ps as aA,Dr as aB,bD as aC,Z as aD,se as aE,fl as aF,ol as aG,pm as aH,eD as aI,WR as aJ,Ae as aK,Dt as aL,XR as aa,yo as ab,ir as ac,lt as ad,lp as ae,ct as af,YR as ag,$R as ah,jN as ai,Ra as aj,RN as ak,hr as al,GR as am,Os as an,jR as ao,lD as ap,hl as aq,y as ar,sD as as,ve as at,yT as au,Je as av,Am as aw,oe as ax,AT as ay,x as az,Qd as b,o6 as c,K8 as d,en as e,q as f,gD as g,kR as h,rD as i,LT as j,pn as k,vt as l,iD as m,oD as n,S as o,Gn as p,BR as q,yl as r,UR as s,MR as t,zR as u,bt as v,ae as w,Al as x,KR as y,nD as z};