@sqg/sqg 0.17.4 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var u={},d=Symbol(),f=`http://www.w3.org/1999/xhtml`,p=Array.isArray,m=Array.prototype.indexOf,h=Array.prototype.includes,g=Array.from,_=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyDescriptors,b=Object.prototype,x=Array.prototype,S=Object.getPrototypeOf,ee=Object.isExtensible;function te(e){return typeof e==`function`}var ne=()=>{};function C(e){return e()}function re(e){for(var t=0;t<e.length;t++)e[t]()}function ie(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function ae(e,t,n=!1){return e===void 0?n?t():t:e}function oe(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}function se(e,t){var n={};for(var r in e)t.includes(r)||(n[r]=e[r]);for(var i of Object.getOwnPropertySymbols(e))Object.propertyIsEnumerable.call(e,i)&&!t.includes(i)&&(n[i]=e[i]);return n}var ce=1<<24,le=1024,ue=2048,de=4096,fe=8192,pe=16384,me=32768,he=1<<25,ge=65536,_e=1<<19,ve=1<<20,ye=1<<25,be=65536,xe=1<<21,Se=1<<22,Ce=1<<23,we=Symbol(`$state`),Te=Symbol(`legacy props`),Ee=Symbol(``),De=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Oe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ke(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ae(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function je(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Me(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ne(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Pe(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Fe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ie(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Le(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function eee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function tee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function nee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ree(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Re(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function iee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function aee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var ze=!1;function Be(e){ze=e}var Ve;function He(e){if(e===null)throw Re(),u;return Ve=e}function Ue(){return He($t(Ve))}function We(e){if(ze){if($t(Ve)!==null)throw Re(),u;Ve=e}}function Ge(e=1){if(ze){for(var t=e,n=Ve;t--;)n=$t(n);Ve=n}}function Ke(e=!0){for(var t=0,n=Ve;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=$t(n);e&&n.remove(),n=i}}function qe(e){if(!e||e.nodeType!==8)throw Re(),u;return e.data}function oee(e){return e===this.v}function see(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Je(e){return!see(e,this.v)}var Ye=!1,Xe=!1;function cee(){Xe=!0}var Ze=[];function Qe(e,t=!1,n=!1){return $e(e,new Map,``,Ze,null,n)}function $e(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(p(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=$e(l,t,n,r,null,a))}return s}if(S(e)===b){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=$e(e[u],t,n,r,null,a);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON==`function`&&!a)return $e(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}var et=null;function tt(e){et=e}function nt(e){return st(`getContext`).get(e)}function rt(e,t){let n=st(`setContext`);if(Ye){var r=In.f;!Nn&&r&32&&!et.i||Le()}return n.set(e,t),t}function lee(e){return st(`hasContext`).has(e)}function it(e,t=!1,n){et={p:et,i:!1,c:null,e:null,s:e,x:null,r:In,l:Xe&&!t?{s:null,u:null,$:[]}:null}}function at(e){var t=et,n=t.e;if(n!==null){t.e=null;for(var r of n)pn(r)}return e!==void 0&&(t.x=e),t.i=!0,et=t.p,e??{}}function ot(){return!Xe||et!==null&&et.l===null}function st(e){return et===null&&ke(e),et.c??=new Map(uee(et)||void 0)}function uee(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var ct=[];function dee(){var e=ct;ct=[],re(e)}function lt(e){if(ct.length===0&&!St){var t=ct;queueMicrotask(()=>{t===ct&&dee()})}ct.push(e)}function fee(){for(;ct.length>0;)dee()}function ut(e){var t=In;if(t===null)return Nn.f|=Ce,e;if(!(t.f&32768)&&!(t.f&4))throw e;dt(e,t)}function dt(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var pee=~(ue|de|le);function ft(e,t){e.f=e.f&pee|t}function pt(e){e.f&512||e.deps===null?ft(e,le):ft(e,de)}function mt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=be,mt(t.deps))}function ht(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),mt(e.deps),ft(e,le)}var mee=!1,gt=!1;function hee(e){var t=gt;try{return gt=!1,[e(),gt]}finally{gt=t}}var _t=new Set,vt=null,yt=null,bt=null,xt=null,St=!1,Ct=!1,wt=null,Tt=null,gee=0,_ee=1,Et=class e{id=_ee++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=new Set;#s=new Set;#c=new Map;is_fork=!1;#l=!1;#u=new Set;#d(){return this.is_fork||this.#r.size>0}#f(){for(let n of this.#u)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#c.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#c.get(e);if(t){this.#c.delete(e);for(var n of t.d)ft(n,ue),this.schedule(n);for(n of t.m)ft(n,de),this.schedule(n)}}#p(){if(gee++>1e3&&(_t.delete(this),yee()),!this.#d()){for(let e of this.#o)this.#s.delete(e),ft(e,ue),this.schedule(e);for(let e of this.#s)ft(e,de),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=wt=[],r=[],i=Tt=[];for(let e of t)try{this.#m(e,n,r)}catch(t){throw jt(e),t}if(vt=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(wt=null,Tt=null,this.#d()||this.#f()){this.#h(r),this.#h(n);for(let[e,t]of this.#c)At(e,t)}else{this.#n.size===0&&_t.delete(this),this.#o.clear(),this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),yt=this,bee(r),bee(n),yt=null,this.#i?.resolve()}var o=vt;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(_t.add(o),o.#p()),_t.has(this)||this.#g()}#m(e,t,n){e.f^=le;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=le:i&4?t.push(r):Ye&&i&16777224?n.push(r):Kn(r)&&(i&16&&this.#s.add(r),Xn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#h(e){for(var t=0;t<e.length;t+=1)ht(e[t],this.#o,this.#s)}capture(e,t,n=!1){t!==d&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,n]),bt?.set(e,e.v))}activate(){vt=this}deactivate(){vt=null,bt=null}flush(){try{Ct=!0,vt=this,this.#p()}finally{gee=0,xt=null,wt=null,Tt=null,Ct=!1,vt=null,bt=null,Ht.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),_t.delete(this)}#g(){for(let c of _t){var e=c.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(c.current.has(r)){var n=c.current.get(r)[0];if(e&&i!==n)c.current.set(r,[i,a]);else continue}t.push(r)}var r=[...c.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&c.discard();else if(t.length>0){c.activate();var i=new Set,a=new Map;for(var o of t)xee(o,r,i,a);if(c.#a.length>0){c.apply();for(var s of c.#a)c.#m(s,[],[]);c.#a=[]}c.deactivate()}}for(let e of _t)e.#u.has(this)&&(e.#u.delete(this),e.#u.size===0&&!e.#d()&&(e.activate(),e.#p()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#l||n||(this.#l=!0,lt(()=>{this.#l=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#o.add(t);for(let e of t)this.#s.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=ie()).promise}static ensure(){if(vt===null){let t=vt=new e;Ct||(_t.add(vt),St||lt(()=>{vt===t&&t.flush()}))}return vt}apply(){if(!Ye||!this.is_fork&&_t.size===1){bt=null;return}bt=new Map;for(let[e,[t]]of this.current)bt.set(e,t);for(let n of _t)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#u.add(n);else for(let[e,t]of n.previous)bt.has(e)||bt.set(e,t)}}schedule(e){if(xt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(wt!==null&&t===In&&(Ye||(Nn===null||!(Nn.f&2))&&!mee))return;if(n&96){if(!(n&1024))return;t.f^=le}}this.#a.push(t)}};function vee(e){var t=St;St=!0;try{var n;for(e&&(vt!==null&&!vt.is_fork&&vt.flush(),n=e());;){if(fee(),vt===null)return n;vt.flush()}}finally{St=t}}function yee(){try{Fe()}catch(e){dt(e,xt)}}var Dt=null;function bee(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Kn(r)&&(Dt=new Set,Xn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&wn(r),Dt?.size>0)){Ht.clear();for(let e of Dt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Dt.has(n)&&(Dt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Xn(n)}}Dt.clear()}}Dt=null}}function xee(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?xee(i,t,n,r):e&4194320&&!(e&2048)&&Ot(i,t,r)&&(ft(i,ue),kt(i))}}function Ot(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(h.call(t,r))return!0;if(r.f&2&&Ot(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function kt(e){vt.schedule(e)}function At(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),ft(e,le);for(var n=e.first;n!==null;)At(n,t),n=n.next}}function jt(e){ft(e,le);for(var t=e.first;t!==null;)jt(t),t=t.next}function Mt(e){let t=0,n=Ut(0),r;return()=>{un()&&(w(n),gn(()=>(t===0&&(r=Qn(()=>e(()=>qt(n)))),t+=1,()=>{lt(()=>{--t,t===0&&(r?.(),r=void 0,qt(n))})})))}}var See=ge|_e;function Cee(e,t,n,r){new wee(e,t,n,r)}var wee=class{parent;is_pending=!1;transform_error;#e;#t=ze?Ve:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Mt(()=>(this.#m=Ut(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=In;t.b=this,t.f|=128,n(e)},this.parent=In.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=vn(()=>{if(ze){let e=this.#t;Ue();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},See),ze&&(this.#e=Ve)}#g(){try{this.#a=bn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=bn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=bn(()=>e(this.#e)),lt(()=>{var e=this.#c=document.createDocumentFragment(),t=Zt();e.append(t),this.#a=this.#x(()=>bn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Tn(this.#o,()=>{this.#o=null}),this.#b(vt))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=bn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();kn(this.#a,e);let t=this.#n.pending;this.#o=bn(()=>t(this.#e))}else this.#b(vt)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){ht(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=In,n=Nn,r=et;Ln(this.#i),Fn(this.#i),tt(this.#i.ctx);try{return Et.ensure(),e()}catch(e){return ut(e),null}finally{Ln(t),Fn(n),tt(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Tn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,lt(()=>{this.#d=!1,this.#m&&Kt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),w(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(Cn(this.#a),null),this.#o&&=(Cn(this.#o),null),this.#s&&=(Cn(this.#s),null),ze&&(He(this.#t),Ge(),He(Ke()));var r=!1,i=!1;let a=()=>{if(r){aee();return}r=!0,i&&ree(),this.#s!==null&&Tn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){dt(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return bn(()=>{var t=In;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return dt(e,this.#i.parent),null}}))};lt(()=>{var t;try{t=this.transform_error(e)}catch(e){dt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>dt(e,this.#i&&this.#i.parent)):o(t)})}};function Tee(e,t,n,r){let i=ot()?Ft:Lt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=In,s=Eee(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||dt(e,o)}Nt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=Pt();function d(){Promise.all(n.map(e=>Dee(e))).then(e=>l([...t.map(i),...e])).catch(e=>dt(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Nt()}):d()}function Eee(){var e=In,t=Nn,n=et,r=vt;return function(i=!0){Ln(e),Fn(t),tt(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Nt(e=!0){Ln(null),Fn(null),tt(null),e&&vt?.deactivate()}function Pt(){var e=In,t=e.b,n=vt,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Ft(e){var t=2|ue,n=Nn!==null&&Nn.f&2?Nn:null;return In!==null&&(In.f|=_e),{ctx:et,deps:null,effects:null,equals:oee,f:t,fn:e,reactions:null,rv:0,v:d,wv:0,parent:n??In,ac:null}}function Dee(e,t,n){let r=In;r===null&&Ae();var i=void 0,a=Ut(d),o=!Nn,s=new Map;return Jee(()=>{var t=In,n=ie();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Nt)}catch(e){n.reject(e),Nt()}var c=vt;if(o){if(t.f&32768)var l=Pt();if(r.b.is_rendered())s.get(c)?.reject(De),s.delete(c);else{for(let e of s.values())e.reject(De);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===De),!(n===De||t.f&16384)){if(c.activate(),n)a.f|=Ce,Kt(a,n);else{a.f&8388608&&(a.f^=Ce),Kt(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(De)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),dn(()=>{for(let e of s.values())e.reject(De)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function It(e){let t=Ft(e);return Ye||zn(t),t}function Lt(e){let t=Ft(e);return t.equals=Je,t}function Oee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Cn(t[n])}}function kee(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function Rt(e){var t,n=In;Ln(kee(e));try{e.f&=~be,Oee(e),t=Jn(e)}finally{Ln(n)}return t}function zt(e){var t=e.v,n=Rt(e);if(!e.equals(n)&&(e.wv=ete(),(!vt?.is_fork||e.deps===null)&&(e.v=n,vt?.capture(e,t,!0),e.deps===null))){ft(e,le);return}jn||(bt===null?pt(e):(un()||vt?.is_fork)&&bt.set(e,n))}function Aee(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(De),t.teardown=ne,t.ac=null,Yn(t,0),Sn(t))}function Bt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&Xn(t)}var Vt=new Set,Ht=new Map,jee=!1;function Ut(e,t){return{f:0,v:e,reactions:null,equals:oee,rv:0,wv:0}}function Wt(e,t){let n=Ut(e,t);return zn(n),n}function Mee(e,t=!1,n=!0){let r=Ut(e);return t||(r.equals=Je),Xe&&n&&et!==null&&et.l!==null&&(et.l.s??=[]).push(r),r}function Gt(e,t,n=!1){return Nn!==null&&(!Pn||Nn.f&131072)&&ot()&&Nn.f&4325394&&(Rn===null||!h.call(Rn,e))&&nee(),Kt(e,n?Jt(t):t,Tt)}function Kt(e,t,n=null){if(!e.equals(t)){var r=e.v;jn?Ht.set(e,t):Ht.set(e,r),e.v=t;var i=Et.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&Rt(t),bt===null&&pt(t)}e.wv=ete(),Pee(e,ue,n),ot()&&In!==null&&In.f&1024&&!(In.f&96)&&(Hn===null?Qee([e]):Hn.push(e)),!i.is_fork&&Vt.size>0&&!jee&&Nee()}return t}function Nee(){jee=!1;for(let e of Vt)e.f&1024&&ft(e,de),Kn(e)&&Xn(e);Vt.clear()}function qt(e){Gt(e,e.v+1)}function Pee(e,t,n){var r=e.reactions;if(r!==null)for(var i=ot(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===In)){var l=(c&ue)===0;if(l&&ft(s,t),c&2){var u=s;bt?.delete(u),c&65536||(c&512&&(s.f|=be),Pee(u,de,n))}else if(l){var d=s;c&16&&Dt!==null&&Dt.add(d),n===null?kt(d):n.push(d)}}}}function Jt(e){if(typeof e!=`object`||!e||we in e)return e;let t=S(e);if(t!==b&&t!==x)return e;var n=new Map,r=p(e),i=Wt(0),a=null,o=Gn,s=e=>{if(Gn===o)return e();var t=Nn,n=Gn;Fn(null),$ee(o);var r=e();return Fn(t),$ee(n),r};return r&&n.set(`length`,Wt(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&eee();var i=n.get(t);return i===void 0?s(()=>{var e=Wt(r.value,a);return n.set(t,e),e}):Gt(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>Wt(d,a));n.set(t,e),qt(i)}}else Gt(r,d),qt(i);return!0},get(t,r,i){if(r===we)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||v(t,r)?.writable)&&(o=s(()=>Wt(Jt(c?t[r]:d),a)),n.set(r,o)),o!==void 0){var l=w(o);return l===d?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=w(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==d)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===we)return!0;var r=n.get(t),i=r!==void 0&&r.v!==d||Reflect.has(e,t);return(r!==void 0||In!==null&&(!i||v(e,t)?.writable))&&(r===void 0&&(r=s(()=>Wt(i?Jt(e[t]):d,a)),n.set(t,r)),w(r)===d)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var f=o;f<l.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=s(()=>Wt(d,a)),n.set(f+``,p)):Gt(p,d)}if(l===void 0)(!u||v(e,t)?.writable)&&(l=s(()=>Wt(void 0,a)),Gt(l,Jt(o)),n.set(t,l));else{u=l.v!==d;var m=s(()=>Jt(o));Gt(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(c,o),!u){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&Gt(g,_+1)}qt(i)}return!0},ownKeys(e){w(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==d});for(var[r,a]of n)a.v!==d&&!(r in e)&&t.push(r);return t},setPrototypeOf(){tee()}})}function Fee(e){try{if(typeof e==`object`&&e&&we in e)return e[we]}catch{}return e}function Iee(e,t){return Object.is(Fee(e),Fee(t))}var Yt,Lee,Ree,Xt;function zee(){if(Yt===void 0){Yt=window,Lee=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ree=v(t,`firstChild`).get,Xt=v(t,`nextSibling`).get,ee(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ee(n)&&(n.__t=void 0)}}function Zt(e=``){return document.createTextNode(e)}function Qt(e){return Ree.call(e)}function $t(e){return Xt.call(e)}function en(e,t){if(!ze)return Qt(e);var n=Qt(Ve);if(n===null)n=Ve.appendChild(Zt());else if(t&&n.nodeType!==3){var r=Zt();return n?.before(r),He(r),r}return t&&an(n),He(n),n}function tn(e,t=!1){if(!ze){var n=Qt(e);return n instanceof Comment&&n.data===``?$t(n):n}if(t){if(Ve?.nodeType!==3){var r=Zt();return Ve?.before(r),He(r),r}an(Ve)}return Ve}function nn(e,t=1,n=!1){let r=ze?Ve:e;for(var i;t--;)i=r,r=$t(r);if(!ze)return r;if(n){if(r?.nodeType!==3){var a=Zt();return r===null?i?.after(a):r.before(a),He(a),a}an(r)}return He(r),r}function Bee(e){e.textContent=``}function rn(){return!Ye||Dt!==null?!1:(In.f&me)!==0}function Vee(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function an(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Hee(e,t){if(t){let t=document.body;e.autofocus=!0,lt(()=>{document.activeElement===t&&e.focus()})}}var Uee=!1;function on(){Uee||(Uee=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function sn(e){var t=Nn,n=In;Fn(null),Ln(null);try{return e()}finally{Fn(t),Ln(n)}}function Wee(e,t,n,r=n){e.addEventListener(t,()=>sn(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),on()}function cn(e){In===null&&(Nn===null&&Pe(e),Ne()),jn&&Me(e)}function Gee(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ln(e,t){var n=In;n!==null&&n.f&8192&&(e|=fe);var r={ctx:et,deps:null,nodes:null,f:e|ue|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(e&4)wt===null?Et.ensure().schedule(r):wt.push(r);else if(t!==null){try{Xn(r)}catch(e){throw Cn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ge))}if(i!==null&&(i.parent=n,n!==null&&Gee(i,n),Nn!==null&&Nn.f&2&&!(e&64))){var a=Nn;(a.effects??=[]).push(i)}return r}function un(){return Nn!==null&&!Pn}function dn(e){let t=ln(8,null);return ft(t,le),t.teardown=e,t}function fn(e){cn(`$effect`);var t=In.f;if(!Nn&&t&32&&!(t&32768)){var n=et;(n.e??=[]).push(e)}else return pn(e)}function pn(e){return ln(4|ve,e)}function mn(e){return cn(`$effect.pre`),ln(8|ve,e)}function Kee(e){Et.ensure();let t=ln(64|_e,e);return()=>{Cn(t)}}function qee(e){Et.ensure();let t=ln(64|_e,e);return(e={})=>new Promise(n=>{e.outro?Tn(t,()=>{Cn(t),n(void 0)}):(Cn(t),n(void 0))})}function hn(e){return ln(4,e)}function Jee(e){return ln(Se|_e,e)}function gn(e,t=0){return ln(8|t,e)}function _n(e,t=[],n=[],r=[]){Tee(r,t,n,t=>{ln(8,()=>e(...t.map(w)))})}function vn(e,t=0){return ln(16|t,e)}function yn(e,t=0){return ln(ce|t,e)}function bn(e){return ln(32|_e,e)}function xn(e){var t=e.teardown;if(t!==null){let e=jn,n=Nn;Mn(!0),Fn(null);try{t.call(null)}finally{Mn(e),Fn(n)}}}function Sn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&sn(()=>{e.abort(De)});var r=n.next;n.f&64?n.parent=null:Cn(n,t),n=r}}function Yee(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Cn(t),t=n}}function Cn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Xee(e.nodes.start,e.nodes.end),n=!0),ft(e,he),Sn(e,t&&!n),Yn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();xn(e),e.f^=he,e.f|=pe;var i=e.parent;i!==null&&i.first!==null&&wn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Xee(e,t){for(;e!==null;){var n=e===t?null:$t(e);e.remove(),e=n}}function wn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Tn(e,t,n=!0){var r=[];En(e,r,!0);var i=()=>{n&&Cn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function En(e,t,n){if(!(e.f&8192)){e.f^=fe;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;En(i,t,o?n:!1),i=a}}}function Dn(e){On(e,!0)}function On(e,t){if(e.f&8192){e.f^=fe,e.f&1024||(ft(e,ue),Et.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;On(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function kn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:$t(n);t.append(n),n=i}}var Zee=null,An=!1,jn=!1;function Mn(e){jn=e}var Nn=null,Pn=!1;function Fn(e){Nn=e}var In=null;function Ln(e){In=e}var Rn=null;function zn(e){Nn!==null&&(!Ye||Nn.f&2)&&(Rn===null?Rn=[e]:Rn.push(e))}var Bn=null,Vn=0,Hn=null;function Qee(e){Hn=e}var Un=1,Wn=0,Gn=Wn;function $ee(e){Gn=e}function ete(){return++Un}function Kn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~be),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Kn(a)&&zt(a),a.wv>e.wv)return!0}t&512&&bt===null&&ft(e,le)}return!1}function qn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ye&&Rn!==null&&h.call(Rn,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?qn(a,t,!1):t===a&&(n?ft(a,ue):a.f&1024&&ft(a,de),kt(a))}}function Jn(e){var t=Bn,n=Vn,r=Hn,i=Nn,a=Rn,o=et,s=Pn,c=Gn,l=e.f;Bn=null,Vn=0,Hn=null,Nn=l&96?null:e,Rn=null,tt(e.ctx),Pn=!1,Gn=++Wn,e.ac!==null&&(sn(()=>{e.ac.abort(De)}),e.ac=null);try{e.f|=xe;var u=e.fn,d=u();e.f|=me;var f=e.deps,p=vt?.is_fork;if(Bn!==null){var m;if(p||Yn(e,Vn),f!==null&&Vn>0)for(f.length=Vn+Bn.length,m=0;m<Bn.length;m++)f[Vn+m]=Bn[m];else e.deps=f=Bn;if(un()&&e.f&512)for(m=Vn;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Vn<f.length&&(Yn(e,Vn),f.length=Vn);if(ot()&&Hn!==null&&!Pn&&f!==null&&!(e.f&6146))for(m=0;m<Hn.length;m++)qn(Hn[m],e);if(i!==null&&i!==e){if(Wn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Wn;if(t!==null)for(let e of t)e.rv=Wn;Hn!==null&&(r===null?r=Hn:r.push(...Hn))}return e.f&8388608&&(e.f^=Ce),d}catch(e){return ut(e)}finally{e.f^=xe,Bn=t,Vn=n,Hn=r,Nn=i,Rn=a,tt(o),Pn=s,Gn=c}}function tte(e,t){let n=t.reactions;if(n!==null){var r=m.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Bn===null||!h.call(Bn,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~be),pt(a),Aee(a),Yn(a,0)}}function Yn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)tte(e,n[r])}function Xn(e){var t=e.f;if(!(t&16384)){ft(e,le);var n=In,r=An;In=e,An=!0;try{t&16777232?Yee(e):Sn(e),xn(e);var i=Jn(e);e.teardown=typeof i==`function`?i:null,e.wv=Un}finally{An=r,In=n}}}async function nte(){if(Ye)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),vee()}function w(e){var t=(e.f&2)!=0;if(Zee?.add(e),Nn!==null&&!Pn&&!(In!==null&&In.f&16384)&&(Rn===null||!h.call(Rn,e))){var n=Nn.deps;if(Nn.f&2097152)e.rv<Wn&&(e.rv=Wn,Bn===null&&n!==null&&n[Vn]===e?Vn++:Bn===null?Bn=[e]:Bn.push(e));else{(Nn.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[Nn]:h.call(r,Nn)||r.push(Nn)}}if(jn&&Ht.has(e))return Ht.get(e);if(t){var i=e;if(jn){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||rte(i))&&(a=Rt(i)),Ht.set(i,a),a}var o=(i.f&512)==0&&!Pn&&Nn!==null&&(An||(Nn.f&512)!=0),s=(i.f&me)===0;Kn(i)&&(o&&(i.f|=512),zt(i)),o&&!s&&(Bt(i),Zn(i))}if(bt?.has(e))return bt.get(e);if(e.f&8388608)throw e.v;return e.v}function Zn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Bt(t),Zn(t))}function rte(e){if(e.v===d)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ht.has(t)||t.f&2&&rte(t))return!0;return!1}function Qn(e){var t=Pn;try{return Pn=!0,e()}finally{Pn=t}}function ite(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(we in e)$n(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&we in n&&$n(n)}}}function $n(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{$n(e[n],t)}catch{}let n=S(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=y(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}var er=Symbol(`events`),tr=new Set,nr=new Set;function rr(e,t,n,r={}){function i(e){if(r.capture||lr.call(t,e),!e.cancelBubble)return sn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?lt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function ir(e,t,n,r={}){var i=rr(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function ar(e,t,n,r,i){var a={capture:r,passive:i},o=rr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&dn(()=>{t.removeEventListener(e,o,a)})}function or(e,t,n){(t[er]??={})[e]=n}function sr(e){for(var t=0;t<e.length;t++)tr.add(e[t]);for(var n of nr)n(e)}var cr=null;function lr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;cr=e;var o=0,s=cr===e&&e[er];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[er]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){_(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=Nn,d=In;Fn(null),Ln(null);try{for(var f,p=[];a!==null;){var m=a.assignedSlot||a.parentNode||a.host||null;try{var h=a[er]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble||m===t||m===null)break;a=m}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[er]=t,delete e.currentTarget,Fn(u),Ln(d)}}}var ate=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function ote(e){return ate?.createHTML(e)??e}function ur(e){var t=Vee(`template`);return t.innerHTML=ote(e.replaceAll(`<!>`,`<!---->`)),t.content}function dr(e,t){var n=In;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function fr(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(ze)return dr(Ve,null),Ve;i===void 0&&(i=ur(a?e:`<!>`+e),n||(i=Qt(i)));var t=r||Lee?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Qt(t),s=t.lastChild;dr(o,s)}else dr(t,t);return t}}function ste(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(ze)return dr(Ve,null),Ve;if(!o){var e=Qt(ur(a));if(i)for(o=document.createDocumentFragment();Qt(e);)o.appendChild(Qt(e));else o=Qt(e)}var t=o.cloneNode(!0);if(i){var n=Qt(t),r=t.lastChild;dr(n,r)}else dr(t,t);return t}}function pr(e,t){return ste(e,t,`svg`)}function mr(e=``){if(!ze){var t=Zt(e+``);return dr(t,t),t}var n=Ve;return n.nodeType===3?an(n):(n.before(n=Zt()),He(n)),dr(n,n),n}function hr(){if(ze)return dr(Ve,null),Ve;var e=document.createDocumentFragment(),t=document.createComment(``),n=Zt();return e.append(t,n),dr(t,n),e}function gr(e,t){if(ze){var n=In;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=Ve),Ue();return}e!==null&&e.before(t)}function cte(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var lte=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function ute(e){return lte.includes(e)}var dte=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),fte={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 pte(e){return e=e.toLowerCase(),fte[e]??e}[...dte];var mte=[`touchstart`,`touchmove`];function hte(e){return mte.includes(e)}function _r(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function gte(e,t){return _te(e,t)}var vr=new Map;function _te(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){zee();var c=void 0,l=qee(()=>{var o=n??t.appendChild(Zt());Cee(o,{pending:()=>{}},t=>{it({});var n=et;if(a&&(n.c=a),i&&(r.$$events=i),ze&&dr(t,null),c=e(t,r)||{},ze&&(In.nodes.end=Ve,Ve===null||Ve.nodeType!==8||Ve.data!==`]`))throw Re(),u;at()},s);var l=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=hte(r);for(let e of[t,document]){var a=vr.get(e);a===void 0&&(a=new Map,vr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,lr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(g(tr)),nr.add(d),()=>{for(var e of l)for(let n of[t,document]){var r=vr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,lr),r.delete(e),r.size===0&&vr.delete(n)):r.set(e,i)}nr.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return vte.set(c,l),c}var vte=new WeakMap,yr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Dn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Cn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();kn(r,t),t.append(Zt()),this.#n.set(e,{effect:r,fragment:t})}else Cn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Tn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Cn(n.effect),this.#n.delete(e))};ensure(e,t){var n=vt,r=rn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Zt();i.append(a),this.#n.set(e,{effect:bn(()=>t(a)),fragment:i})}else this.#t.set(e,bn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else ze&&(this.anchor=Ve),this.#a(n)}};function br(e,t,...n){var r=new yr(e);vn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ge)}function xr(e){et===null&&ke(`onMount`),Xe&&et.l!==null?yte(et).m.push(e):fn(()=>{let t=Qn(e);if(typeof t==`function`)return t})}function Sr(e){et===null&&ke(`onDestroy`),xr(()=>()=>Qn(e))}function yte(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function Cr(e,t,n=!1){var r;ze&&(r=Ve,Ue());var i=new yr(e),a=n?ge:0;function o(e,t){if(ze){var n=qe(r);if(e!==parseInt(n.substring(1))){var a=Ke();He(a),i.anchor=a,Be(!1),i.ensure(e,t),Be(!0);return}}i.ensure(e,t)}vn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var bte=Symbol(`NaN`);function xte(e,t,n){ze&&Ue();var r=new yr(e),i=!ot();vn(()=>{var e=t();e!==e&&(e=bte),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function wr(e,t){return t}function Ste(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Tn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Tr(e,g(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;Bee(u),u.append(l),e.items.clear()}Tr(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Tr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ye,kn(a,document.createDocumentFragment())):Cn(t[i],n)}}var Cte;function Er(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=ze?He(Qt(c)):c.appendChild(Zt())}ze&&Ue();var l=null,u=Lt(()=>{var e=n();return p(e)?e:e==null?[]:g(e)}),d,f=new Map,m=!0;function h(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=l,wte(v,d,o,t,r),l!==null&&(d.length===0?l.f&33554432?(l.f^=ye,Or(l,null,o)):Dn(l):Tn(l,()=>{l=null})))}function _(e){v.pending.delete(e)}var v={effect:vn(()=>{d=w(u);var e=d.length;let c=!1;ze&&qe(o)===`[!`!=(e===0)&&(o=Ke(),He(o),Be(!1),c=!0);for(var p=new Set,g=vt,v=rn(),y=0;y<e;y+=1){ze&&Ve.nodeType===8&&Ve.data===`]`&&(o=Ve,c=!0,Be(!1));var b=d[y],x=r(b,y),S=m?null:s.get(x);S?(S.v&&Kt(S.v,b),S.i&&Kt(S.i,y),v&&g.unskip_effect(S.e)):(S=Tte(s,m?o:Cte??=Zt(),b,x,y,i,t,n),m||(S.e.f|=ye),s.set(x,S)),p.add(x)}if(e===0&&a&&!l&&(m?l=bn(()=>a(o)):(l=bn(()=>a(Cte??=Zt())),l.f|=ye)),e>p.size&&je(``,``,``),ze&&e>0&&He(Ke()),!m)if(f.set(g,p),v){for(let[e,t]of s)p.has(e)||g.skip_effect(t.e);g.oncommit(h),g.ondiscard(_)}else h(g);c&&Be(!0),w(u)}),flags:t,items:s,pending:f,outrogroups:null,fallback:l};m=!1,ze&&(o=Ve)}function Dr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function wte(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=Dr(e.effect.first),l,u=null,d,f=[],p=[],m,h,_,v;if(a)for(v=0;v<o;v+=1)m=t[v],h=i(m,v),_=s.get(h).e,_.f&33554432||(_.nodes?.a?.measure(),(d??=new Set).add(_));for(v=0;v<o;v+=1){if(m=t[v],h=i(m,v),_=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Dn(_),a&&(_.nodes?.a?.unfix(),(d??=new Set).delete(_))),_.f&33554432)if(_.f^=ye,_===c)Or(_,null,n);else{var y=u?u.next:c;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),kr(e,u,_),kr(e,_,y),Or(_,y,n),u=_,f=[],p=[],c=Dr(u.next);continue}if(_!==c){if(l!==void 0&&l.has(_)){if(f.length<p.length){var b=p[0],x;u=b.prev;var S=f[0],ee=f[f.length-1];for(x=0;x<f.length;x+=1)Or(f[x],b,n);for(x=0;x<p.length;x+=1)l.delete(p[x]);kr(e,S.prev,ee.next),kr(e,u,S),kr(e,ee,b),c=b,u=ee,--v,f=[],p=[]}else l.delete(_),Or(_,c,n),kr(e,_.prev,_.next),kr(e,_,u===null?e.effect.first:u.next),kr(e,u,_),u=_;continue}for(f=[],p=[];c!==null&&c!==_;)(l??=new Set).add(c),p.push(c),c=Dr(c.next);if(c===null)continue}_.f&33554432||f.push(_),u=_,c=Dr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Tr(e,g(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var te=[];if(l!==void 0)for(_ of l)_.f&8192||te.push(_);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&te.push(c),c=Dr(c.next);var ne=te.length;if(ne>0){var C=r&4&&o===0?n:null;if(a){for(v=0;v<ne;v+=1)te[v].nodes?.a?.measure();for(v=0;v<ne;v+=1)te[v].nodes?.a?.fix()}Ste(e,te,C)}}a&&lt(()=>{if(d!==void 0)for(_ of d)_.nodes?.a?.apply()})}function Tte(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ut(n):Mee(n,!1,!1):null,l=o&2?Ut(i):null;return{v:c,i:l,e:bn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Or(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=$t(r);if(a.before(r),r===i)return;r=o}}function kr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ar(e,t,n){var r;ze&&(r=Ve,Ue());var i=new yr(e);vn(()=>{var e=t()??null;if(ze&&qe(r)===`[`!=(e!==null)){var a=Ke();He(a),i.anchor=a,Be(!1),i.ensure(e,e&&(t=>n(t,e))),Be(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ge)}function jr(e,t,n){hn(()=>{var r=Qn(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};gn(()=>{var e=n();ite(e),i&&see(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function Ete(e,t){var n=void 0,r;yn(()=>{n!==(n=t())&&(r&&=(Cn(r),null),n&&(r=bn(()=>{hn(()=>n(e))})))})}function Dte(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Dte(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ote(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Dte(e))&&(r&&(r+=` `),r+=t);return r}function Mr(e){return typeof e==`object`?Ote(e):e??``}var Nr=[...`
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var u={},d=Symbol(),f=`http://www.w3.org/1999/xhtml`,p=Array.isArray,m=Array.prototype.indexOf,h=Array.prototype.includes,g=Array.from,_=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyDescriptors,b=Object.prototype,x=Array.prototype,S=Object.getPrototypeOf,ee=Object.isExtensible;function te(e){return typeof e==`function`}var ne=()=>{};function C(e){return e()}function re(e){for(var t=0;t<e.length;t++)e[t]()}function ie(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function ae(e,t,n=!1){return e===void 0?n?t():t:e}function oe(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}function se(e,t){var n={};for(var r in e)t.includes(r)||(n[r]=e[r]);for(var i of Object.getOwnPropertySymbols(e))Object.propertyIsEnumerable.call(e,i)&&!t.includes(i)&&(n[i]=e[i]);return n}var ce=1<<24,le=1024,ue=2048,de=4096,fe=8192,pe=16384,me=32768,he=1<<25,ge=65536,_e=1<<19,ve=1<<20,ye=1<<25,be=65536,xe=1<<21,Se=1<<22,Ce=1<<23,we=Symbol(`$state`),Te=Symbol(`legacy props`),Ee=Symbol(``),De=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Oe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ke(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ae(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function je(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Me(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ne(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Pe(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Fe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ie(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Le(){throw Error(`https://svelte.dev/e/set_context_after_init`)}function eee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function tee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function nee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ree(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Re(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function iee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function aee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var ze=!1;function Be(e){ze=e}var Ve;function He(e){if(e===null)throw Re(),u;return Ve=e}function Ue(){return He($t(Ve))}function We(e){if(ze){if($t(Ve)!==null)throw Re(),u;Ve=e}}function Ge(e=1){if(ze){for(var t=e,n=Ve;t--;)n=$t(n);Ve=n}}function Ke(e=!0){for(var t=0,n=Ve;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=$t(n);e&&n.remove(),n=i}}function qe(e){if(!e||e.nodeType!==8)throw Re(),u;return e.data}function oee(e){return e===this.v}function see(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Je(e){return!see(e,this.v)}var Ye=!1,Xe=!1;function cee(){Xe=!0}var Ze=[];function Qe(e,t=!1,n=!1){return $e(e,new Map,``,Ze,null,n)}function $e(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(p(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=$e(l,t,n,r,null,a))}return s}if(S(e)===b){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=$e(e[u],t,n,r,null,a);return s}if(e instanceof Date)return structuredClone(e);if(typeof e.toJSON==`function`&&!a)return $e(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}var et=null;function tt(e){et=e}function nt(e){return st(`getContext`).get(e)}function rt(e,t){let n=st(`setContext`);if(Ye){var r=In.f;!Nn&&r&32&&!et.i||Le()}return n.set(e,t),t}function lee(e){return st(`hasContext`).has(e)}function it(e,t=!1,n){et={p:et,i:!1,c:null,e:null,s:e,x:null,r:In,l:Xe&&!t?{s:null,u:null,$:[]}:null}}function at(e){var t=et,n=t.e;if(n!==null){t.e=null;for(var r of n)pn(r)}return e!==void 0&&(t.x=e),t.i=!0,et=t.p,e??{}}function ot(){return!Xe||et!==null&&et.l===null}function st(e){return et===null&&ke(e),et.c??=new Map(uee(et)||void 0)}function uee(e){let t=e.p;for(;t!==null;){let e=t.c;if(e!==null)return e;t=t.p}return null}var ct=[];function dee(){var e=ct;ct=[],re(e)}function lt(e){if(ct.length===0&&!St){var t=ct;queueMicrotask(()=>{t===ct&&dee()})}ct.push(e)}function fee(){for(;ct.length>0;)dee()}function ut(e){var t=In;if(t===null)return Nn.f|=Ce,e;if(!(t.f&32768)&&!(t.f&4))throw e;dt(e,t)}function dt(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var pee=~(ue|de|le);function ft(e,t){e.f=e.f&pee|t}function pt(e){e.f&512||e.deps===null?ft(e,le):ft(e,de)}function mt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=be,mt(t.deps))}function ht(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),mt(e.deps),ft(e,le)}var mee=!1,gt=!1;function hee(e){var t=gt;try{return gt=!1,[e(),gt]}finally{gt=t}}var _t=new Set,vt=null,yt=null,bt=null,xt=null,St=!1,Ct=!1,wt=null,Tt=null,gee=0,_ee=1,Et=class e{id=_ee++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=new Set;#s=new Set;#c=new Map;is_fork=!1;#l=!1;#u=new Set;#d(){return this.is_fork||this.#r.size>0}#f(){for(let n of this.#u)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#c.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#c.get(e);if(t){this.#c.delete(e);for(var n of t.d)ft(n,ue),this.schedule(n);for(n of t.m)ft(n,de),this.schedule(n)}}#p(){if(gee++>1e3&&(_t.delete(this),yee()),!this.#d()){for(let e of this.#o)this.#s.delete(e),ft(e,ue),this.schedule(e);for(let e of this.#s)ft(e,de),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=wt=[],r=[],i=Tt=[];for(let e of t)try{this.#m(e,n,r)}catch(t){throw jt(e),t}if(vt=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(wt=null,Tt=null,this.#d()||this.#f()){this.#h(r),this.#h(n);for(let[e,t]of this.#c)At(e,t)}else{this.#n.size===0&&_t.delete(this),this.#o.clear(),this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),yt=this,bee(r),bee(n),yt=null,this.#i?.resolve()}var o=vt;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(_t.add(o),o.#p()),_t.has(this)||this.#g()}#m(e,t,n){e.f^=le;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=le:i&4?t.push(r):Ye&&i&16777224?n.push(r):Kn(r)&&(i&16&&this.#s.add(r),Xn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#h(e){for(var t=0;t<e.length;t+=1)ht(e[t],this.#o,this.#s)}capture(e,t,n=!1){t!==d&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,n]),bt?.set(e,e.v))}activate(){vt=this}deactivate(){vt=null,bt=null}flush(){try{Ct=!0,vt=this,this.#p()}finally{gee=0,xt=null,wt=null,Tt=null,Ct=!1,vt=null,bt=null,Ht.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),_t.delete(this)}#g(){for(let c of _t){var e=c.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(c.current.has(r)){var n=c.current.get(r)[0];if(e&&i!==n)c.current.set(r,[i,a]);else continue}t.push(r)}var r=[...c.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&c.discard();else if(t.length>0){c.activate();var i=new Set,a=new Map;for(var o of t)xee(o,r,i,a);if(c.#a.length>0){c.apply();for(var s of c.#a)c.#m(s,[],[]);c.#a=[]}c.deactivate()}}for(let e of _t)e.#u.has(this)&&(e.#u.delete(this),e.#u.size===0&&!e.#d()&&(e.activate(),e.#p()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#l||n||(this.#l=!0,lt(()=>{this.#l=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#o.add(t);for(let e of t)this.#s.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=ie()).promise}static ensure(){if(vt===null){let t=vt=new e;Ct||(_t.add(vt),St||lt(()=>{vt===t&&t.flush()}))}return vt}apply(){if(!Ye||!this.is_fork&&_t.size===1){bt=null;return}bt=new Map;for(let[e,[t]]of this.current)bt.set(e,t);for(let n of _t)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#u.add(n);else for(let[e,t]of n.previous)bt.has(e)||bt.set(e,t)}}schedule(e){if(xt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(wt!==null&&t===In&&(Ye||(Nn===null||!(Nn.f&2))&&!mee))return;if(n&96){if(!(n&1024))return;t.f^=le}}this.#a.push(t)}};function vee(e){var t=St;St=!0;try{var n;for(e&&(vt!==null&&!vt.is_fork&&vt.flush(),n=e());;){if(fee(),vt===null)return n;vt.flush()}}finally{St=t}}function yee(){try{Fe()}catch(e){dt(e,xt)}}var Dt=null;function bee(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Kn(r)&&(Dt=new Set,Xn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&wn(r),Dt?.size>0)){Ht.clear();for(let e of Dt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Dt.has(n)&&(Dt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Xn(n)}}Dt.clear()}}Dt=null}}function xee(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?xee(i,t,n,r):e&4194320&&!(e&2048)&&Ot(i,t,r)&&(ft(i,ue),kt(i))}}function Ot(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(h.call(t,r))return!0;if(r.f&2&&Ot(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function kt(e){vt.schedule(e)}function At(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),ft(e,le);for(var n=e.first;n!==null;)At(n,t),n=n.next}}function jt(e){ft(e,le);for(var t=e.first;t!==null;)jt(t),t=t.next}function Mt(e){let t=0,n=Ut(0),r;return()=>{un()&&(w(n),gn(()=>(t===0&&(r=Qn(()=>e(()=>qt(n)))),t+=1,()=>{lt(()=>{--t,t===0&&(r?.(),r=void 0,qt(n))})})))}}var See=ge|_e;function Cee(e,t,n,r){new wee(e,t,n,r)}var wee=class{parent;is_pending=!1;transform_error;#e;#t=ze?Ve:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Mt(()=>(this.#m=Ut(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=In;t.b=this,t.f|=128,n(e)},this.parent=In.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=vn(()=>{if(ze){let e=this.#t;Ue();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},See),ze&&(this.#e=Ve)}#g(){try{this.#a=bn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=bn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=bn(()=>e(this.#e)),lt(()=>{var e=this.#c=document.createDocumentFragment(),t=Zt();e.append(t),this.#a=this.#x(()=>bn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Tn(this.#o,()=>{this.#o=null}),this.#b(vt))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=bn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();kn(this.#a,e);let t=this.#n.pending;this.#o=bn(()=>t(this.#e))}else this.#b(vt)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){ht(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=In,n=Nn,r=et;Ln(this.#i),Fn(this.#i),tt(this.#i.ctx);try{return Et.ensure(),e()}catch(e){return ut(e),null}finally{Ln(t),Fn(n),tt(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Tn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,lt(()=>{this.#d=!1,this.#m&&Kt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),w(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(Cn(this.#a),null),this.#o&&=(Cn(this.#o),null),this.#s&&=(Cn(this.#s),null),ze&&(He(this.#t),Ge(),He(Ke()));var r=!1,i=!1;let a=()=>{if(r){aee();return}r=!0,i&&ree(),this.#s!==null&&Tn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){dt(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return bn(()=>{var t=In;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return dt(e,this.#i.parent),null}}))};lt(()=>{var t;try{t=this.transform_error(e)}catch(e){dt(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>dt(e,this.#i&&this.#i.parent)):o(t)})}};function Tee(e,t,n,r){let i=ot()?Ft:Lt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=In,s=Eee(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||dt(e,o)}Nt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=Pt();function d(){Promise.all(n.map(e=>Dee(e))).then(e=>l([...t.map(i),...e])).catch(e=>dt(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Nt()}):d()}function Eee(){var e=In,t=Nn,n=et,r=vt;return function(i=!0){Ln(e),Fn(t),tt(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Nt(e=!0){Ln(null),Fn(null),tt(null),e&&vt?.deactivate()}function Pt(){var e=In,t=e.b,n=vt,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Ft(e){var t=2|ue,n=Nn!==null&&Nn.f&2?Nn:null;return In!==null&&(In.f|=_e),{ctx:et,deps:null,effects:null,equals:oee,f:t,fn:e,reactions:null,rv:0,v:d,wv:0,parent:n??In,ac:null}}function Dee(e,t,n){let r=In;r===null&&Ae();var i=void 0,a=Ut(d),o=!Nn,s=new Map;return Jee(()=>{var t=In,n=ie();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Nt)}catch(e){n.reject(e),Nt()}var c=vt;if(o){if(t.f&32768)var l=Pt();if(r.b.is_rendered())s.get(c)?.reject(De),s.delete(c);else{for(let e of s.values())e.reject(De);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===De),!(n===De||t.f&16384)){if(c.activate(),n)a.f|=Ce,Kt(a,n);else{a.f&8388608&&(a.f^=Ce),Kt(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(De)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),dn(()=>{for(let e of s.values())e.reject(De)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function It(e){let t=Ft(e);return Ye||zn(t),t}function Lt(e){let t=Ft(e);return t.equals=Je,t}function Oee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Cn(t[n])}}function kee(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function Rt(e){var t,n=In;Ln(kee(e));try{e.f&=~be,Oee(e),t=Jn(e)}finally{Ln(n)}return t}function zt(e){var t=e.v,n=Rt(e);if(!e.equals(n)&&(e.wv=ete(),(!vt?.is_fork||e.deps===null)&&(e.v=n,vt?.capture(e,t,!0),e.deps===null))){ft(e,le);return}jn||(bt===null?pt(e):(un()||vt?.is_fork)&&bt.set(e,n))}function Aee(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(De),t.teardown=ne,t.ac=null,Yn(t,0),Sn(t))}function Bt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&Xn(t)}var Vt=new Set,Ht=new Map,jee=!1;function Ut(e,t){return{f:0,v:e,reactions:null,equals:oee,rv:0,wv:0}}function Wt(e,t){let n=Ut(e,t);return zn(n),n}function Mee(e,t=!1,n=!0){let r=Ut(e);return t||(r.equals=Je),Xe&&n&&et!==null&&et.l!==null&&(et.l.s??=[]).push(r),r}function Gt(e,t,n=!1){return Nn!==null&&(!Pn||Nn.f&131072)&&ot()&&Nn.f&4325394&&(Rn===null||!h.call(Rn,e))&&nee(),Kt(e,n?Jt(t):t,Tt)}function Kt(e,t,n=null){if(!e.equals(t)){var r=e.v;jn?Ht.set(e,t):Ht.set(e,r),e.v=t;var i=Et.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&Rt(t),bt===null&&pt(t)}e.wv=ete(),Pee(e,ue,n),ot()&&In!==null&&In.f&1024&&!(In.f&96)&&(Hn===null?Qee([e]):Hn.push(e)),!i.is_fork&&Vt.size>0&&!jee&&Nee()}return t}function Nee(){jee=!1;for(let e of Vt)e.f&1024&&ft(e,de),Kn(e)&&Xn(e);Vt.clear()}function qt(e){Gt(e,e.v+1)}function Pee(e,t,n){var r=e.reactions;if(r!==null)for(var i=ot(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===In)){var l=(c&ue)===0;if(l&&ft(s,t),c&2){var u=s;bt?.delete(u),c&65536||(c&512&&(s.f|=be),Pee(u,de,n))}else if(l){var d=s;c&16&&Dt!==null&&Dt.add(d),n===null?kt(d):n.push(d)}}}}function Jt(e){if(typeof e!=`object`||!e||we in e)return e;let t=S(e);if(t!==b&&t!==x)return e;var n=new Map,r=p(e),i=Wt(0),a=null,o=Gn,s=e=>{if(Gn===o)return e();var t=Nn,n=Gn;Fn(null),$ee(o);var r=e();return Fn(t),$ee(n),r};return r&&n.set(`length`,Wt(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&eee();var i=n.get(t);return i===void 0?s(()=>{var e=Wt(r.value,a);return n.set(t,e),e}):Gt(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>Wt(d,a));n.set(t,e),qt(i)}}else Gt(r,d),qt(i);return!0},get(t,r,i){if(r===we)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||v(t,r)?.writable)&&(o=s(()=>Wt(Jt(c?t[r]:d),a)),n.set(r,o)),o!==void 0){var l=w(o);return l===d?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=w(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==d)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===we)return!0;var r=n.get(t),i=r!==void 0&&r.v!==d||Reflect.has(e,t);return(r!==void 0||In!==null&&(!i||v(e,t)?.writable))&&(r===void 0&&(r=s(()=>Wt(i?Jt(e[t]):d,a)),n.set(t,r)),w(r)===d)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var f=o;f<l.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=s(()=>Wt(d,a)),n.set(f+``,p)):Gt(p,d)}if(l===void 0)(!u||v(e,t)?.writable)&&(l=s(()=>Wt(void 0,a)),Gt(l,Jt(o)),n.set(t,l));else{u=l.v!==d;var m=s(()=>Jt(o));Gt(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(c,o),!u){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&Gt(g,_+1)}qt(i)}return!0},ownKeys(e){w(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==d});for(var[r,a]of n)a.v!==d&&!(r in e)&&t.push(r);return t},setPrototypeOf(){tee()}})}function Fee(e){try{if(typeof e==`object`&&e&&we in e)return e[we]}catch{}return e}function Iee(e,t){return Object.is(Fee(e),Fee(t))}var Yt,Lee,Ree,Xt;function zee(){if(Yt===void 0){Yt=window,Lee=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ree=v(t,`firstChild`).get,Xt=v(t,`nextSibling`).get,ee(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ee(n)&&(n.__t=void 0)}}function Zt(e=``){return document.createTextNode(e)}function Qt(e){return Ree.call(e)}function $t(e){return Xt.call(e)}function en(e,t){if(!ze)return Qt(e);var n=Qt(Ve);if(n===null)n=Ve.appendChild(Zt());else if(t&&n.nodeType!==3){var r=Zt();return n?.before(r),He(r),r}return t&&an(n),He(n),n}function tn(e,t=!1){if(!ze){var n=Qt(e);return n instanceof Comment&&n.data===``?$t(n):n}if(t){if(Ve?.nodeType!==3){var r=Zt();return Ve?.before(r),He(r),r}an(Ve)}return Ve}function nn(e,t=1,n=!1){let r=ze?Ve:e;for(var i;t--;)i=r,r=$t(r);if(!ze)return r;if(n){if(r?.nodeType!==3){var a=Zt();return r===null?i?.after(a):r.before(a),He(a),a}an(r)}return He(r),r}function Bee(e){e.textContent=``}function rn(){return!Ye||Dt!==null?!1:(In.f&me)!==0}function Vee(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function an(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Hee(e,t){if(t){let t=document.body;e.autofocus=!0,lt(()=>{document.activeElement===t&&e.focus()})}}var Uee=!1;function on(){Uee||(Uee=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function sn(e){var t=Nn,n=In;Fn(null),Ln(null);try{return e()}finally{Fn(t),Ln(n)}}function Wee(e,t,n,r=n){e.addEventListener(t,()=>sn(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),on()}function cn(e){In===null&&(Nn===null&&Pe(e),Ne()),jn&&Me(e)}function Gee(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ln(e,t){var n=In;n!==null&&n.f&8192&&(e|=fe);var r={ctx:et,deps:null,nodes:null,f:e|ue|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(e&4)wt===null?Et.ensure().schedule(r):wt.push(r);else if(t!==null){try{Xn(r)}catch(e){throw Cn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ge))}if(i!==null&&(i.parent=n,n!==null&&Gee(i,n),Nn!==null&&Nn.f&2&&!(e&64))){var a=Nn;(a.effects??=[]).push(i)}return r}function un(){return Nn!==null&&!Pn}function dn(e){let t=ln(8,null);return ft(t,le),t.teardown=e,t}function fn(e){cn(`$effect`);var t=In.f;if(!Nn&&t&32&&!(t&32768)){var n=et;(n.e??=[]).push(e)}else return pn(e)}function pn(e){return ln(4|ve,e)}function mn(e){return cn(`$effect.pre`),ln(8|ve,e)}function Kee(e){Et.ensure();let t=ln(64|_e,e);return()=>{Cn(t)}}function qee(e){Et.ensure();let t=ln(64|_e,e);return(e={})=>new Promise(n=>{e.outro?Tn(t,()=>{Cn(t),n(void 0)}):(Cn(t),n(void 0))})}function hn(e){return ln(4,e)}function Jee(e){return ln(Se|_e,e)}function gn(e,t=0){return ln(8|t,e)}function _n(e,t=[],n=[],r=[]){Tee(r,t,n,t=>{ln(8,()=>e(...t.map(w)))})}function vn(e,t=0){return ln(16|t,e)}function yn(e,t=0){return ln(ce|t,e)}function bn(e){return ln(32|_e,e)}function xn(e){var t=e.teardown;if(t!==null){let e=jn,n=Nn;Mn(!0),Fn(null);try{t.call(null)}finally{Mn(e),Fn(n)}}}function Sn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&sn(()=>{e.abort(De)});var r=n.next;n.f&64?n.parent=null:Cn(n,t),n=r}}function Yee(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Cn(t),t=n}}function Cn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Xee(e.nodes.start,e.nodes.end),n=!0),ft(e,he),Sn(e,t&&!n),Yn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();xn(e),e.f^=he,e.f|=pe;var i=e.parent;i!==null&&i.first!==null&&wn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Xee(e,t){for(;e!==null;){var n=e===t?null:$t(e);e.remove(),e=n}}function wn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Tn(e,t,n=!0){var r=[];En(e,r,!0);var i=()=>{n&&Cn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function En(e,t,n){if(!(e.f&8192)){e.f^=fe;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;En(i,t,o?n:!1),i=a}}}function Dn(e){On(e,!0)}function On(e,t){if(e.f&8192){e.f^=fe,e.f&1024||(ft(e,ue),Et.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;On(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function kn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:$t(n);t.append(n),n=i}}var Zee=null,An=!1,jn=!1;function Mn(e){jn=e}var Nn=null,Pn=!1;function Fn(e){Nn=e}var In=null;function Ln(e){In=e}var Rn=null;function zn(e){Nn!==null&&(!Ye||Nn.f&2)&&(Rn===null?Rn=[e]:Rn.push(e))}var Bn=null,Vn=0,Hn=null;function Qee(e){Hn=e}var Un=1,Wn=0,Gn=Wn;function $ee(e){Gn=e}function ete(){return++Un}function Kn(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~be),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Kn(a)&&zt(a),a.wv>e.wv)return!0}t&512&&bt===null&&ft(e,le)}return!1}function qn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ye&&Rn!==null&&h.call(Rn,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?qn(a,t,!1):t===a&&(n?ft(a,ue):a.f&1024&&ft(a,de),kt(a))}}function Jn(e){var t=Bn,n=Vn,r=Hn,i=Nn,a=Rn,o=et,s=Pn,c=Gn,l=e.f;Bn=null,Vn=0,Hn=null,Nn=l&96?null:e,Rn=null,tt(e.ctx),Pn=!1,Gn=++Wn,e.ac!==null&&(sn(()=>{e.ac.abort(De)}),e.ac=null);try{e.f|=xe;var u=e.fn,d=u();e.f|=me;var f=e.deps,p=vt?.is_fork;if(Bn!==null){var m;if(p||Yn(e,Vn),f!==null&&Vn>0)for(f.length=Vn+Bn.length,m=0;m<Bn.length;m++)f[Vn+m]=Bn[m];else e.deps=f=Bn;if(un()&&e.f&512)for(m=Vn;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&Vn<f.length&&(Yn(e,Vn),f.length=Vn);if(ot()&&Hn!==null&&!Pn&&f!==null&&!(e.f&6146))for(m=0;m<Hn.length;m++)qn(Hn[m],e);if(i!==null&&i!==e){if(Wn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Wn;if(t!==null)for(let e of t)e.rv=Wn;Hn!==null&&(r===null?r=Hn:r.push(...Hn))}return e.f&8388608&&(e.f^=Ce),d}catch(e){return ut(e)}finally{e.f^=xe,Bn=t,Vn=n,Hn=r,Nn=i,Rn=a,tt(o),Pn=s,Gn=c}}function tte(e,t){let n=t.reactions;if(n!==null){var r=m.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Bn===null||!h.call(Bn,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~be),pt(a),Aee(a),Yn(a,0)}}function Yn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)tte(e,n[r])}function Xn(e){var t=e.f;if(!(t&16384)){ft(e,le);var n=In,r=An;In=e,An=!0;try{t&16777232?Yee(e):Sn(e),xn(e);var i=Jn(e);e.teardown=typeof i==`function`?i:null,e.wv=Un}finally{An=r,In=n}}}async function nte(){if(Ye)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),vee()}function w(e){var t=(e.f&2)!=0;if(Zee?.add(e),Nn!==null&&!Pn&&!(In!==null&&In.f&16384)&&(Rn===null||!h.call(Rn,e))){var n=Nn.deps;if(Nn.f&2097152)e.rv<Wn&&(e.rv=Wn,Bn===null&&n!==null&&n[Vn]===e?Vn++:Bn===null?Bn=[e]:Bn.push(e));else{(Nn.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[Nn]:h.call(r,Nn)||r.push(Nn)}}if(jn&&Ht.has(e))return Ht.get(e);if(t){var i=e;if(jn){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||rte(i))&&(a=Rt(i)),Ht.set(i,a),a}var o=(i.f&512)==0&&!Pn&&Nn!==null&&(An||(Nn.f&512)!=0),s=(i.f&me)===0;Kn(i)&&(o&&(i.f|=512),zt(i)),o&&!s&&(Bt(i),Zn(i))}if(bt?.has(e))return bt.get(e);if(e.f&8388608)throw e.v;return e.v}function Zn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Bt(t),Zn(t))}function rte(e){if(e.v===d)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ht.has(t)||t.f&2&&rte(t))return!0;return!1}function Qn(e){var t=Pn;try{return Pn=!0,e()}finally{Pn=t}}function ite(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(we in e)$n(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&we in n&&$n(n)}}}function $n(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{$n(e[n],t)}catch{}let n=S(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=y(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}var er=Symbol(`events`),tr=new Set,nr=new Set;function rr(e,t,n,r={}){function i(e){if(r.capture||lr.call(t,e),!e.cancelBubble)return sn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?lt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function ir(e,t,n,r={}){var i=rr(t,e,n,r);return()=>{e.removeEventListener(t,i,r)}}function ar(e,t,n,r,i){var a={capture:r,passive:i},o=rr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&dn(()=>{t.removeEventListener(e,o,a)})}function or(e,t,n){(t[er]??={})[e]=n}function sr(e){for(var t=0;t<e.length;t++)tr.add(e[t]);for(var n of nr)n(e)}var cr=null;function lr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;cr=e;var o=0,s=cr===e&&e[er];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[er]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){_(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=Nn,d=In;Fn(null),Ln(null);try{for(var f,p=[];a!==null;){var m=a.assignedSlot||a.parentNode||a.host||null;try{var h=a[er]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble||m===t||m===null)break;a=m}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[er]=t,delete e.currentTarget,Fn(u),Ln(d)}}}var ate=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function ote(e){return ate?.createHTML(e)??e}function ur(e){var t=Vee(`template`);return t.innerHTML=ote(e.replaceAll(`<!>`,`<!---->`)),t.content}function dr(e,t){var n=In;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function fr(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(ze)return dr(Ve,null),Ve;i===void 0&&(i=ur(a?e:`<!>`+e),n||(i=Qt(i)));var t=r||Lee?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Qt(t),s=t.lastChild;dr(o,s)}else dr(t,t);return t}}function ste(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(ze)return dr(Ve,null),Ve;if(!o){var e=Qt(ur(a));if(i)for(o=document.createDocumentFragment();Qt(e);)o.appendChild(Qt(e));else o=Qt(e)}var t=o.cloneNode(!0);if(i){var n=Qt(t),r=t.lastChild;dr(n,r)}else dr(t,t);return t}}function pr(e,t){return ste(e,t,`svg`)}function mr(e=``){if(!ze){var t=Zt(e+``);return dr(t,t),t}var n=Ve;return n.nodeType===3?an(n):(n.before(n=Zt()),He(n)),dr(n,n),n}function hr(){if(ze)return dr(Ve,null),Ve;var e=document.createDocumentFragment(),t=document.createComment(``),n=Zt();return e.append(t,n),dr(t,n),e}function gr(e,t){if(ze){var n=In;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=Ve),Ue();return}e!==null&&e.before(t)}function cte(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var lte=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function ute(e){return lte.includes(e)}var dte=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),fte={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 pte(e){return e=e.toLowerCase(),fte[e]??e}[...dte];var mte=[`touchstart`,`touchmove`];function hte(e){return mte.includes(e)}function _r(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function gte(e,t){return _te(e,t)}var vr=new Map;function _te(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){zee();var c=void 0,l=qee(()=>{var o=n??t.appendChild(Zt());Cee(o,{pending:()=>{}},t=>{it({});var n=et;if(a&&(n.c=a),i&&(r.$$events=i),ze&&dr(t,null),c=e(t,r)||{},ze&&(In.nodes.end=Ve,Ve===null||Ve.nodeType!==8||Ve.data!==`]`))throw Re(),u;at()},s);var l=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=hte(r);for(let e of[t,document]){var a=vr.get(e);a===void 0&&(a=new Map,vr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,lr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(g(tr)),nr.add(d),()=>{for(var e of l)for(let n of[t,document]){var r=vr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,lr),r.delete(e),r.size===0&&vr.delete(n)):r.set(e,i)}nr.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return vte.set(c,l),c}var vte=new WeakMap,yr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Dn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Cn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();kn(r,t),t.append(Zt()),this.#n.set(e,{effect:r,fragment:t})}else Cn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Tn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Cn(n.effect),this.#n.delete(e))};ensure(e,t){var n=vt,r=rn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=Zt();i.append(a),this.#n.set(e,{effect:bn(()=>t(a)),fragment:i})}else this.#t.set(e,bn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else ze&&(this.anchor=Ve),this.#a(n)}};function br(e,t,...n){var r=new yr(e);vn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ge)}function xr(e){et===null&&ke(`onMount`),Xe&&et.l!==null?yte(et).m.push(e):fn(()=>{let t=Qn(e);if(typeof t==`function`)return t})}function Sr(e){et===null&&ke(`onDestroy`),xr(()=>()=>Qn(e))}function yte(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function Cr(e,t,n=!1){var r;ze&&(r=Ve,Ue());var i=new yr(e),a=n?ge:0;function o(e,t){if(ze){var n=qe(r);if(e!==parseInt(n.substring(1))){var a=Ke();He(a),i.anchor=a,Be(!1),i.ensure(e,t),Be(!0);return}}i.ensure(e,t)}vn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var bte=Symbol(`NaN`);function xte(e,t,n){ze&&Ue();var r=new yr(e),i=!ot();vn(()=>{var e=t();e!==e&&(e=bte),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function wr(e,t){return t}function Ste(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Tn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Tr(e,g(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var c=r.length===0&&n!==null;if(c){var l=n,u=l.parentNode;Bee(u),u.append(l),e.items.clear()}Tr(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Tr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ye,kn(a,document.createDocumentFragment())):Cn(t[i],n)}}var Cte;function Er(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=ze?He(Qt(c)):c.appendChild(Zt())}ze&&Ue();var l=null,u=Lt(()=>{var e=n();return p(e)?e:e==null?[]:g(e)}),d,f=new Map,m=!0;function h(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=l,wte(v,d,o,t,r),l!==null&&(d.length===0?l.f&33554432?(l.f^=ye,Or(l,null,o)):Dn(l):Tn(l,()=>{l=null})))}function _(e){v.pending.delete(e)}var v={effect:vn(()=>{d=w(u);var e=d.length;let c=!1;ze&&qe(o)===`[!`!=(e===0)&&(o=Ke(),He(o),Be(!1),c=!0);for(var p=new Set,g=vt,v=rn(),y=0;y<e;y+=1){ze&&Ve.nodeType===8&&Ve.data===`]`&&(o=Ve,c=!0,Be(!1));var b=d[y],x=r(b,y),S=m?null:s.get(x);S?(S.v&&Kt(S.v,b),S.i&&Kt(S.i,y),v&&g.unskip_effect(S.e)):(S=Tte(s,m?o:Cte??=Zt(),b,x,y,i,t,n),m||(S.e.f|=ye),s.set(x,S)),p.add(x)}if(e===0&&a&&!l&&(m?l=bn(()=>a(o)):(l=bn(()=>a(Cte??=Zt())),l.f|=ye)),e>p.size&&je(``,``,``),ze&&e>0&&He(Ke()),!m)if(f.set(g,p),v){for(let[e,t]of s)p.has(e)||g.skip_effect(t.e);g.oncommit(h),g.ondiscard(_)}else h(g);c&&Be(!0),w(u)}),flags:t,items:s,pending:f,outrogroups:null,fallback:l};m=!1,ze&&(o=Ve)}function Dr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function wte(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,c=Dr(e.effect.first),l,u=null,d,f=[],p=[],m,h,_,v;if(a)for(v=0;v<o;v+=1)m=t[v],h=i(m,v),_=s.get(h).e,_.f&33554432||(_.nodes?.a?.measure(),(d??=new Set).add(_));for(v=0;v<o;v+=1){if(m=t[v],h=i(m,v),_=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Dn(_),a&&(_.nodes?.a?.unfix(),(d??=new Set).delete(_))),_.f&33554432)if(_.f^=ye,_===c)Or(_,null,n);else{var y=u?u.next:c;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),kr(e,u,_),kr(e,_,y),Or(_,y,n),u=_,f=[],p=[],c=Dr(u.next);continue}if(_!==c){if(l!==void 0&&l.has(_)){if(f.length<p.length){var b=p[0],x;u=b.prev;var S=f[0],ee=f[f.length-1];for(x=0;x<f.length;x+=1)Or(f[x],b,n);for(x=0;x<p.length;x+=1)l.delete(p[x]);kr(e,S.prev,ee.next),kr(e,u,S),kr(e,ee,b),c=b,u=ee,--v,f=[],p=[]}else l.delete(_),Or(_,c,n),kr(e,_.prev,_.next),kr(e,_,u===null?e.effect.first:u.next),kr(e,u,_),u=_;continue}for(f=[],p=[];c!==null&&c!==_;)(l??=new Set).add(c),p.push(c),c=Dr(c.next);if(c===null)continue}_.f&33554432||f.push(_),u=_,c=Dr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Tr(e,g(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var te=[];if(l!==void 0)for(_ of l)_.f&8192||te.push(_);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&te.push(c),c=Dr(c.next);var ne=te.length;if(ne>0){var C=r&4&&o===0?n:null;if(a){for(v=0;v<ne;v+=1)te[v].nodes?.a?.measure();for(v=0;v<ne;v+=1)te[v].nodes?.a?.fix()}Ste(e,te,C)}}a&&lt(()=>{if(d!==void 0)for(_ of d)_.nodes?.a?.apply()})}function Tte(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ut(n):Mee(n,!1,!1):null,l=o&2?Ut(i):null;return{v:c,i:l,e:bn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Or(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=$t(r);if(a.before(r),r===i)return;r=o}}function kr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ar(e,t,n){var r;ze&&(r=Ve,Ue());var i=new yr(e);vn(()=>{var e=t()??null;if(ze&&qe(r)===`[`!=(e!==null)){var a=Ke();He(a),i.anchor=a,Be(!1),i.ensure(e,e&&(t=>n(t,e))),Be(!0);return}i.ensure(e,e&&(t=>n(t,e)))},ge)}function jr(e,t,n){hn(()=>{var r=Qn(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};gn(()=>{var e=n();ite(e),i&&see(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function Ete(e,t){var n=void 0,r;yn(()=>{n!==(n=t())&&(r&&=(Cn(r),null),n&&(r=bn(()=>{hn(()=>n(e))})))})}function Dte(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Dte(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ote(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Dte(e))&&(r&&(r+=` `),r+=t);return r}function Mr(e){return typeof e==`object`?Ote(e):e??``}var Nr=[...`
2
2
  \r\f\xA0\v`];function Pr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Nr.includes(r[o-1]))&&(s===r.length||Nr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function kte(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Fr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Ate(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Fr)),i&&c.push(...Object.keys(i).map(Fr));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Fr(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=kte(r)),i&&(n+=kte(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Ir(e,t,n,r,i,a){var o=e.__className;if(ze||o!==n||o===void 0){var s=Pr(n,r,a);(!ze||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Lr(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Rr(e,t,n,r){var i=e.__style;if(ze||i!==t){var a=Ate(t,r);(!ze||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(Lr(e,n?.[0],r[0]),Lr(e,n?.[1],r[1],`important`)):Lr(e,n,r));return r}function zr(e,t,n=!1){if(e.multiple){if(t==null)return;if(!p(t))return iee();for(var r of e.options)r.selected=t.includes(Br(r));return}for(r of e.options)if(Iee(Br(r),t)){r.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}function jte(e){var t=new MutationObserver(()=>{zr(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),dn(()=>{t.disconnect()})}function Br(e){return`__value`in e?e.__value:e.value}var Vr=Symbol(`class`),Hr=Symbol(`style`),Ur=Symbol(`is custom element`),Wr=Symbol(`is html`),Mte=Oe?`link`:`LINK`,Nte=Oe?`input`:`INPUT`,Gr=Oe?`option`:`OPTION`,Pte=Oe?`select`:`SELECT`;function Kr(e){if(ze){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;qr(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;qr(e,`checked`,null),e.checked=r}}};e.__on_r=n,lt(n),on()}}function Fte(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function qr(e,t,n,r){var i=Yr(e);ze&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Mte)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[Ee]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Rte(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Ite(e,t,n,r,i=!1,a=!1){if(ze&&i&&e.nodeName===Nte){var o=e;(o.type===`checkbox`?`defaultChecked`:`defaultValue`)in n||Kr(o)}var s=Yr(e),c=s[Ur],l=!s[Wr];let u=ze&&c;u&&Be(!1);var f=t||{},p=e.nodeName===Gr;for(var m in t)m in n||(n[m]=null);n.class?n.class=Mr(n.class):(r||n[Vr])&&(n.class=null),n[Hr]&&(n.style??=null);var h=Rte(e);for(let i in n){let o=n[i];if(p&&i===`value`&&o==null){e.value=e.__value=``,f[i]=o;continue}if(i===`class`){Ir(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,o,r,t?.[Vr],n[Vr]),f[i]=o,f[Vr]=n[Vr];continue}if(i===`style`){Rr(e,o,t?.[Hr],n[Hr]),f[i]=o,f[Hr]=n[Hr];continue}var g=f[i];if(!(o===g&&!(o===void 0&&e.hasAttribute(i)))){f[i]=o;var _=i[0]+i[1];if(_!==`$$`)if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=ute(r);if(cte(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(o!=null)continue;e.removeEventListener(r,f[n],t),f[n]=null}if(v)or(r,e,o),sr([r]);else if(o!=null){function a(e){f[i].call(this,e)}f[n]=rr(r,e,a,t)}}else if(i===`style`)qr(e,i,o);else if(i===`autofocus`)Hee(e,!!o);else if(!c&&(i===`__value`||i===`value`&&o!=null))e.value=e.__value=o;else if(i===`selected`&&p)Fte(e,o);else{var y=i;l||(y=pte(y));var b=y===`defaultValue`||y===`defaultChecked`;if(o==null&&!c&&!b)if(s[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i);else b||h.includes(y)&&(c||typeof o!=`string`)?(e[y]=o,y in s&&(s[y]=d)):typeof o!=`function`&&qr(e,y,o,a)}}}return u&&Be(!0),f}function Jr(e,t,n=[],r=[],i=[],a,o=!1,s=!1){Tee(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Pte,l=!1;if(yn(()=>{var u=t(...n.map(w)),d=Ite(e,r,u,a,o,s);l&&c&&`value`in u&&zr(e,u.value);for(let e of Object.getOwnPropertySymbols(i))u[e]||Cn(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var f=u[t];t.description===`@attach`&&(!r||f!==r[t])&&(i[t]&&Cn(i[t]),i[t]=bn(()=>Ete(e,()=>f))),d[t]=f}r=d}),c){var u=e;hn(()=>{zr(u,r.value,!0),jte(u)})}l=!0})}function Yr(e){return e.__attributes??={[Ur]:e.nodeName.includes(`-`),[Wr]:e.namespaceURI===f}}var Lte=new Map;function Rte(e){var t=e.getAttribute(`is`)||e.nodeName,n=Lte.get(t);if(n)return n;Lte.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=y(i),r)r[o].set&&n.push(o);i=S(i)}return n}function Xr(e,t,n=t){var r=new WeakSet;Wee(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Zr(e)?Qr(a):a,n(a),vt!==null&&r.add(vt),await nte(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(ze&&e.defaultValue!==e.value||Qn(t)==null&&e.value)&&(n(Zr(e)?Qr(e.value):e.value),vt!==null&&r.add(vt)),gn(()=>{var n=t();if(e===document.activeElement){var i=Ye?yt:vt;if(r.has(i))return}Zr(e)&&n===Qr(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Zr(e){var t=e.type;return t===`number`||t===`range`}function Qr(e){return e===``?null:+e}var zte=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function Bte(e,t,n){var r=zte.observe(e,()=>n(e[t]));hn(()=>(Qn(()=>n(e[t])),r))}function Vte(e,t){return e===t||e?.[we]===t}function $r(e={},t,n,r){var i=et.r,a=In;return hn(()=>{var o,s;return gn(()=>{o=s,s=r?.()||[],Qn(()=>{e!==n(...s)&&(t(e,...s),o&&Vte(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Vte(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function ei(e=!1){let t=et,n=t.l.u;if(!n)return;let r=()=>ite(t.s);if(e){let e=0,n={},i=Ft(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>w(i)}n.b.length&&mn(()=>{ti(t,r),re(n.b)}),fn(()=>{let e=Qn(()=>n.m.map(C));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&fn(()=>{ti(t,r),re(n.a)})}function ti(e,t){if(e.l.s)for(let t of e.l.s)w(t);t()}var Hte={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function ni(e,t,n){return new Proxy({props:e,exclude:t},Hte)}var Ute={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(te(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];te(i)&&(i=i());let a=v(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(te(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=v(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===we||t===Te)return!1;for(let n of e.props)if(te(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(te(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function ri(...e){return new Proxy({props:e},Ute)}function ii(e,t,n,r){var i=!Xe||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?Qn(r):r),s);let u;if(a){var d=we in e||Te in e;u=v(e,t)?.set??(d&&t in e?n=>e[t]=n:void 0)}var f,p=!1;a?[f,p]=hee(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=l(),u&&(i&&Ie(t),u(f)));var m=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return m;if(u){var h=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||h||p)&&u(t?m():e),e):m()})}var g=!1,_=(n&1?Ft:Lt)(()=>(g=!1,m()));a&&w(_);var y=In;return(function(e,t){if(arguments.length>0){let n=t?w(_):i&&a?Jt(e):e;return Gt(_,n),g=!0,s!==void 0&&(s=n),e}return jn&&g||y.f&16384?_.v:w(_)})}var Wte=fr(`<div><div class="pane first svelte-1caar0q"><!></div> <div role="separator" tabindex="0"></div> <div class="pane second svelte-1caar0q"><!></div></div>`);function ai(e,t){let n=ii(t,`horizontal`,3,!1),r=ii(t,`initialSplit`,3,50),i=ii(t,`minSize`,3,10),a=Wt(Jt(r())),o,s=Wt(!1);function c(e){e.preventDefault(),Gt(s,!0);let t=e=>{if(!o)return;let t=o.getBoundingClientRect(),r;r=n()?(e.clientY-t.top)/t.height*100:(e.clientX-t.left)/t.width*100,Gt(a,Math.max(i(),Math.min(100-i(),r)),!0)},r=()=>{Gt(s,!1),window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,r)};window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,r)}var l=Wte();let u;var d=en(l);br(en(d),()=>t.first),We(d);var f=nn(d,2);let p;var m=nn(f,2);br(en(m),()=>t.second),We(m),We(l),$r(l,e=>o=e,()=>o),_n(()=>{u=Ir(l,1,`split-container svelte-1caar0q`,null,u,{horizontal:n(),dragging:w(s)}),Rr(d,`${n()?`height`:`width`}: ${w(a)??``}%`),p=Ir(f,1,`splitter svelte-1caar0q`,null,p,{horizontal:n()}),qr(f,`aria-orientation`,n()?`horizontal`:`vertical`),Rr(m,`${n()?`height`:`width`}: ${100-w(a)}%`)}),or(`mousedown`,f,c),gr(e,l)}sr([`mousedown`]);var oi=[],si=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?si:oi).push(n+=e[t])})();function Gte(e){if(e<768)return!1;for(let t=0,n=oi.length;;){let r=t+n>>1;if(e<oi[r])n=r;else if(e>=si[r])t=r+1;else return!0;if(t==n)return!1}}function ci(e){return e>=127462&&e<=127487}var li=8205;function Kte(e,t,n=!0,r=!0){return(n?ui:qte)(e,t,r)}function ui(e,t,n){if(t==e.length)return t;t&&Jte(e.charCodeAt(t))&&Yte(e.charCodeAt(t-1))&&t--;let r=di(e,t);for(t+=Xte(r);t<e.length;){let i=di(e,t);if(r==li||i==li||n&&Gte(i))t+=Xte(i),r=i;else if(ci(i)){let n=0,r=t-2;for(;r>=0&&ci(di(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function qte(e,t,n){for(;t>0;){let r=ui(e,t-2,n);if(r<t)return r;t--}return 0}function di(e,t){let n=e.charCodeAt(t);if(!Yte(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Jte(r)?(n-55296<<10)+(r-56320)+65536:n}function Jte(e){return e>=56320&&e<57344}function Yte(e){return e>=55296&&e<56320}function Xte(e){return e<65536?1:2}var fi=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=_i(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),mi.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=_i(this,e,t);let n=[];return this.decompose(e,t,n,0),mi.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new gi(this),i=new gi(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new gi(this,e)}iterRange(e,t=this.length){return new $te(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ene(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new pi(t):mi.from(pi.split(t,[]))}},pi=class e extends fi{constructor(e,t=Zte(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new tne(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(Qte(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=hi(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=_i(this,t,n);let i=hi(this.text,hi(r.text,Qte(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):mi.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
3
3
  `){[e,t]=_i(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},mi=class e extends fi{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=_i(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
4
4
  `){[e,t]=_i(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new pi(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof pi&&c&&(n=u[u.length-1])instanceof pi&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new pi(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};fi.empty=new pi([``],0);function Zte(e){let t=-1;for(let n of e)t+=n.length+1;return t}function hi(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function Qte(e,t,n){return hi(e,[``],t,n)}var gi=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof pi?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof pi?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
5
5
  `,this;e--}else if(r instanceof pi){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof pi?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},$te=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new gi(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},ene=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(fi.prototype[Symbol.iterator]=function(){return this.iter()},gi.prototype[Symbol.iterator]=$te.prototype[Symbol.iterator]=ene.prototype[Symbol.iterator]=function(){return this});var tne=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function _i(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function vi(e,t,n=!0,r=!0){return Kte(e,t,n,r)}function nne(e){return e>=56320&&e<57344}function rne(e){return e>=55296&&e<56320}function yi(e,t){let n=e.charCodeAt(t);if(!rne(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return nne(r)?(n-55296<<10)+(r-56320)+65536:n}function ine(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function bi(e){return e<65536?1:2}var xi=/\r\n?|\n/,Si=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(Si||={}),Ci=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){Di(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:ki(this,e)}mapDesc(e,t=!1){return e.empty?this:Oi(this,e,t)}mapPos(e,t=-1,n=Si.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=Si.Simple&&c>=e&&(n==Si.TrackDel&&r<e&&c>e||n==Si.TrackBefore&&r<e||n==Si.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},wi=class e extends Ci{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return Di(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return Oi(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(fi.empty);r.push(a?t.slice(i,i+a):fi.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:ki(this,e,!0)}map(e,t=!1){return e.empty?this:Oi(this,e,t,!0)}iterChanges(e,t=!1){Di(this,e,t)}get desc(){return Ci.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new Ai(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);Ti(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;Ti(n,e,t),t>0&&Ei(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);Ti(n,e,-1),Ti(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:Ci.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&Ti(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?fi.of(l.split(r||xi)):l:fi.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&Ti(i,e-o,-1),Ti(i,s-e,d),Ei(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(fi.empty);r[e]=fi.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function Ti(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Ei(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(fi.empty);e.push(n)}}function Di(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=fi.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function Oi(e,t,n,r=!1){let i=[],a=r?[]:null,o=new Ai(e),s=new Ai(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);Ti(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(Ti(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(Ti(i,0,o.ins),a&&Ei(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;Ti(i,t,e<o.i?o.ins:0),a&&e<o.i&&Ei(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?wi.createSet(i,a):Ci.create(i);else throw Error(`Mismatched change set lengths`)}function ki(e,t,n=!1){let r=[],i=n?[]:null,a=new Ai(e),o=new Ai(t);for(let e=!1;;)if(a.done&&o.done)return i?wi.createSet(r,i):Ci.create(r);else if(a.ins==0)Ti(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)Ti(r,0,o.ins,e),i&&Ei(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;Ti(r,t,n,e),i&&n&&Ei(i,r,o.text)}else o.ins==-1?(Ti(r,a.off?0:a.len,t,e),i&&Ei(i,r,a.textBit(t))):(Ti(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&Ei(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var Ai=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?fi.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?fi.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},ji=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Mi.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Mi.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return Mi.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},Mi=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>ji.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return ji.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r){let i=(n??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?ji.create(t,e,48|i):ji.create(e,t,(t>e?8:0)|i)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function Ni(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var Pi=0,Fi=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Pi++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:Ii),!!t.static,t.enables)}of(e){return new Li([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Li(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Li(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function Ii(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var Li=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Pi++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||zi(e,c)){let r=t(e);if(a?!Ri(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=qi(o,c);if(this.dependencies.every(t=>t instanceof Fi?o.facet(t)===e.facet(t):t instanceof Vi?o.field(t,!1)==e.field(t,!1):!0)||(a?Ri(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function Ri(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function zi(e,t){let n=!1;for(let r of t)Ki(e,r)&1&&(n=!0);return n}function ane(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=qi(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Ki(e,t);return e.values[o]=s(e),1},update(e,n){if(!zi(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=zi(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&Ii(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var Bi=Fi.define({static:!0}),Vi=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(Pi++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(Bi).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Bi),i=n.facet(Bi),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,Bi.of({field:this,create:e})]}get extension(){return this}},Hi={lowest:4,low:3,default:2,high:1,highest:0};function Ui(e){return t=>new one(t,e)}var Wi={highest:Ui(Hi.highest),high:Ui(Hi.high),default:Ui(Hi.default),low:Ui(Hi.low),lowest:Ui(Hi.lowest)},one=class{constructor(e,t){this.inner=e,this.prec=t}},sne=class e{of(e){return new Gi(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},Gi=class{constructor(e,t){this.compartment=e,this.inner=t}},cne=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of lne(t,n,o))e instanceof Vi?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,Ii(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>ane(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function lne(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof Gi&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof Gi){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof one)a(e.inner,e.prec);else if(e instanceof Vi)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof Li)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,Hi.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,Hi.default),r.reduce((e,t)=>e.concat(t))}function Ki(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function qi(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var une=Fi.define(),Ji=Fi.define({combine:e=>e.some(e=>e),static:!0}),dne=Fi.define({combine:e=>e.length?e[0]:void 0,static:!0}),Yi=Fi.define(),Xi=Fi.define(),Zi=Fi.define(),Qi=Fi.define({combine:e=>e.length?e[0]:!1}),$i=class{constructor(e,t){this.type=e,this.value=t}static define(){return new fne}},fne=class{of(e){return new $i(this,e)}},pne=class{constructor(e){this.map=e}of(e){return new ea(this,e)}},ea=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new pne(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};ea.reconfigure=ea.define(),ea.appendConfig=ea.define();var ta=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Ni(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};ta.time=$i.define(),ta.userEvent=$i.define(),ta.addToHistory=$i.define(),ta.remote=$i.define();function mne(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function na(e,t,n){let r,i,a;return n?(r=t.changes,i=wi.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:ea.mapEffects(e.effects,r).concat(ea.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function ra(e,t,n){let r=t.selection,i=aa(t.annotations);return t.userEvent&&(i=i.concat(ta.userEvent.of(t.userEvent))),{changes:t.changes instanceof wi?t.changes:wi.of(t.changes||[],n,e.facet(dne)),selection:r&&(r instanceof Mi?r:Mi.single(r.anchor,r.head)),effects:aa(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function ia(e,t,n){let r=ra(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=na(r,ra(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=ta.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return gne(n?hne(i):i)}function hne(e){let t=e.startState,n=!0;for(let r of t.facet(Yi)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:mne(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=wi.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=ta.create(t,r,e.selection&&e.selection.map(i),ea.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(Xi);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof ta?i:Array.isArray(i)&&i.length==1&&i[0]instanceof ta?i[0]:ia(t,aa(i),!1)}return e}function gne(e){let t=e.startState,n=t.facet(Zi),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=na(r,ra(t,a,e.changes.newLength),!0))}return r==e?e:ta.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var _ne=[];function aa(e){return e==null?_ne:Array.isArray(e)?e:[e]}var oa=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(oa||={}),vne=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,sa;try{sa=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function yne(e){if(sa)return sa.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>`€`&&(n.toUpperCase()!=n.toLowerCase()||vne.test(n)))return!0}return!1}function bne(e){return t=>{if(!/\S/.test(t))return oa.Space;if(yne(t))return oa.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return oa.Word;return oa.Other}}var ca=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Ki(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return Ki(this,n),qi(this,n)}update(...e){return ia(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(sne.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(ea.reconfigure)?(n=null,r=e.value):e.is(ea.appendConfig)&&(n=null,r=aa(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=cne.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(Ji)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Mi.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=aa(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=ea.mapEffects(a,c).concat(ea.mapEffects(aa(o.effects),l))}return{changes:r,selection:Mi.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof wi?t:wi.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return fi.of(t.split(this.facet(e.lineSeparator)||xi))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Ki(this,t),qi(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Vi&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:Mi.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=cne.resolve(t.extensions||[],new Map),r=t.doc instanceof fi?t.doc:fi.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||xi)),i=t.selection?t.selection instanceof Mi?t.selection:Mi.single(t.selection.anchor,t.selection.head):Mi.single(0);return Ni(i,r.length),n.staticFacet(Ji)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
6
- `}get readOnly(){return this.facet(Qi)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(une))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){return bne(this.languageDataAt(`wordChars`,e).join(``))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=vi(t,a,!1);if(i(t.slice(e,a))!=oa.Word)break;a=e}for(;o<r;){let e=vi(t,o);if(i(t.slice(o,e))!=oa.Word)break;o=e}return a==o?null:Mi.range(a+n,o+n)}};ca.allowMultipleSelections=Ji,ca.tabSize=Fi.define({combine:e=>e.length?e[0]:4}),ca.lineSeparator=dne,ca.readOnly=Qi,ca.phrases=Fi.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),ca.languageData=une,ca.changeFilter=Yi,ca.transactionFilter=Xi,ca.transactionExtender=Zi,sne.reconfigure=ea.define();function la(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var ua=class{eq(e){return this==e}range(e,t=e){return da.create(e,t,this)}};ua.prototype.startSide=ua.prototype.endSide=0,ua.prototype.point=!1,ua.prototype.mapMode=Si.TrackDel;var da=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function fa(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var xne=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},pa=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(fa)),this.isEmpty)return n.length?e.of(n):this;let s=new ga(this,null,-1).goto(0),c=0,l=[],u=new ma;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(da.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return _a.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return _a.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=ha(a,o,n),c=new ya(a,s,i),l=new ya(o,s,i);n.iterGaps((e,t,n)=>ba(c,e,l,t,n,r)),n.empty&&n.length==0&&ba(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=ha(i,a),s=new ya(i,o,0).goto(n),c=new ya(a,o,0).goto(n);for(;;){if(s.to!=c.to||!xa(s.active,c.active)||s.point&&(!c.point||!s.point.eq(c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new ya(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new ma;for(let r of e instanceof da?[e]:t?Sne(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};pa.empty=new pa([],[],null,-1);function Sne(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(fa(t,r)>0)return e.slice().sort(fa);t=r}return e}pa.empty.nextLayer=pa.empty;var ma=class e{finishChunk(e){this.chunks.push(new xne(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(pa.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=pa.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function ha(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var ga=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex];if(this.from=e+t.from[this.rangeIndex],this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},_a=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new ga(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)va(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)va(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),va(this.heap,0)}}};function va(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var ya=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_a.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Sa(this.active,e),Sa(this.activeTo,e),Sa(this.activeRank,e),this.minActive=wa(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Ca(this.active,t,n),Ca(this.activeTo,t,r),Ca(this.activeRank,t,i),e&&Ca(e,t,this.cursor.from),this.minActive=wa(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Sa(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function ba(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t;for(;;){let t=e.to+c-n.to,r=t||e.endSide-n.endSide,i=r<0?e.to+c:n.to,l=Math.min(i,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&xa(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,l,e.point,n.point):l>s&&!xa(e.active,n.active)&&a.compareRange(s,l,e.active,n.active),i>o)break;(t||e.openEnd!=n.openEnd)&&a.boundChange&&a.boundChange(i),s=i,r<=0&&e.next(),r>=0&&n.next()}}function xa(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function Sa(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Ca(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function wa(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function Ta(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=vi(e,i));return r}function Cne(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=vi(e,r)}return r===!0?-1:e.length}for(var Ea=`ͼ`,Da=typeof Symbol>`u`?`__`+Ea:Symbol.for(Ea),Oa=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),ka=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},Aa=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
6
+ `}get readOnly(){return this.facet(Qi)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(une))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){return bne(this.languageDataAt(`wordChars`,e).join(``))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=vi(t,a,!1);if(i(t.slice(e,a))!=oa.Word)break;a=e}for(;o<r;){let e=vi(t,o);if(i(t.slice(o,e))!=oa.Word)break;o=e}return a==o?null:Mi.range(a+n,o+n)}};ca.allowMultipleSelections=Ji,ca.tabSize=Fi.define({combine:e=>e.length?e[0]:4}),ca.lineSeparator=dne,ca.readOnly=Qi,ca.phrases=Fi.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),ca.languageData=une,ca.changeFilter=Yi,ca.transactionFilter=Xi,ca.transactionExtender=Zi,sne.reconfigure=ea.define();function la(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var ua=class{eq(e){return this==e}range(e,t=e){return da.create(e,t,this)}};ua.prototype.startSide=ua.prototype.endSide=0,ua.prototype.point=!1,ua.prototype.mapMode=Si.TrackDel;var da=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function fa(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var xne=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},pa=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(fa)),this.isEmpty)return n.length?e.of(n):this;let s=new ga(this,null,-1).goto(0),c=0,l=[],u=new ma;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(da.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return _a.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return _a.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=ha(a,o,n),c=new ya(a,s,i),l=new ya(o,s,i);n.iterGaps((e,t,n)=>ba(c,e,l,t,n,r)),n.empty&&n.length==0&&ba(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=ha(i,a),s=new ya(i,o,0).goto(n),c=new ya(a,o,0).goto(n);for(;;){if(s.to!=c.to||!xa(s.active,c.active)||s.point&&(!c.point||!s.point.eq(c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new ya(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new ma;for(let r of e instanceof da?[e]:t?Sne(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};pa.empty=new pa([],[],null,-1);function Sne(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(fa(t,r)>0)return e.slice().sort(fa);t=r}return e}pa.empty.nextLayer=pa.empty;var ma=class e{finishChunk(e){this.chunks.push(new xne(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(pa.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=pa.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function ha(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var ga=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},_a=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new ga(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)va(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)va(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),va(this.heap,0)}}};function va(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var ya=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_a.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Sa(this.active,e),Sa(this.activeTo,e),Sa(this.activeRank,e),this.minActive=wa(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Ca(this.active,t,n),Ca(this.activeTo,t,r),Ca(this.activeRank,t,i),e&&Ca(e,t,this.cursor.from),this.minActive=wa(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Sa(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function ba(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t;for(;;){let t=e.to+c-n.to,r=t||e.endSide-n.endSide,i=r<0?e.to+c:n.to,l=Math.min(i,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&xa(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,l,e.point,n.point):l>s&&!xa(e.active,n.active)&&a.compareRange(s,l,e.active,n.active),i>o)break;(t||e.openEnd!=n.openEnd)&&a.boundChange&&a.boundChange(i),s=i,r<=0&&e.next(),r>=0&&n.next()}}function xa(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function Sa(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Ca(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function wa(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function Ta(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=vi(e,i));return r}function Cne(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=vi(e,r)}return r===!0?-1:e.length}for(var Ea=`ͼ`,Da=typeof Symbol>`u`?`__`+Ea:Symbol.for(Ea),Oa=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),ka=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},Aa=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
7
7
  `)}static newName(){let e=ka[Da]||1;return ka[Da]=e+1,Ea+e.toString(36)}static mount(e,t,n){let r=e[Oa],i=n&&n.nonce;r?i&&r.setNonce(i):r=new wne(e,i),r.mount(Array.isArray(t)?t:[t],e)}},ja=new Map,wne=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=ja.get(n);if(t)return e[Oa]=t;this.sheet=new r.CSSStyleSheet,ja.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[Oa]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
8
8
  `;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},Ma={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Na={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Pa=typeof navigator<`u`&&/Mac/.test(navigator.platform),Tne=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Fa=0;Fa<10;Fa++)Ma[48+Fa]=Ma[96+Fa]=String(Fa);for(var Fa=1;Fa<=24;Fa++)Ma[Fa+111]=`F`+Fa;for(var Fa=65;Fa<=90;Fa++)Ma[Fa]=String.fromCharCode(Fa+32),Na[Fa]=String.fromCharCode(Fa);for(var Ia in Ma)Na.hasOwnProperty(Ia)||(Na[Ia]=Ma[Ia]);function Ene(e){var t=!(Pa&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Tne&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Na:Ma)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function La(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)Ra(e,arguments[t]);return e}function Ra(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)Ra(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var za=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},Ba=typeof document<`u`?document:{documentElement:{style:{}}},Va=/Edge\/(\d+)/.exec(za.userAgent),Dne=/MSIE \d/.test(za.userAgent),Ha=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(za.userAgent),Ua=!!(Dne||Ha||Va),Wa=!Ua&&/gecko\/(\d+)/i.test(za.userAgent),Ga=!Ua&&/Chrome\/(\d+)/.exec(za.userAgent),One=`webkitFontSmoothing`in Ba.documentElement.style,Ka=!Ua&&/Apple Computer/.test(za.vendor),kne=Ka&&(/Mobile\/\w+/.test(za.userAgent)||za.maxTouchPoints>2),qa={mac:kne||/Mac/.test(za.platform),windows:/Win/.test(za.platform),linux:/Linux|X11/.test(za.platform),ie:Ua,ie_version:Dne?Ba.documentMode||6:Ha?+Ha[1]:Va?+Va[1]:0,gecko:Wa,gecko_version:Wa?+(/Firefox\/(\d+)/.exec(za.userAgent)||[0,0])[1]:0,chrome:!!Ga,chrome_version:Ga?+Ga[1]:0,ios:kne,android:/Android\b/.test(za.userAgent),webkit:One,webkit_version:One?+(/\bAppleWebKit\/(\d+)/.exec(za.userAgent)||[0,0])[1]:0,safari:Ka,safari_version:Ka?+(/\bVersion\/(\d+(\.\d+)?)/.exec(za.userAgent)||[0,0])[1]:0,tabSize:Ba.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function Ja(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var Ya=Object.create(null);function Xa(e,t,n){if(e==t)return!0;e||=Ya,t||=Ya;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Ane(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function jne(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Mne(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var Za=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},Qa=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(Qa||={}),$a=class extends ua{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new eo(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new no(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=Nne(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new no(e,n,r,t,e.widget||null,!0)}static line(e){return new to(e)}static set(e,t=!1){return pa.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};$a.none=pa.empty;var eo=class e extends $a{constructor(e){let{start:t,end:n}=Nne(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Ja(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ya}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Xa(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};eo.prototype.point=!1;var to=class e extends $a{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Xa(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};to.prototype.mapMode=Si.TrackBefore,to.prototype.point=!0;var no=class e extends $a{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?Si.TrackBefore:Si.TrackAfter:Si.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?Qa.WidgetBefore:Qa.WidgetAfter:Qa.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Pne(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};no.prototype.point=!0;function Nne(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Pne(e,t){return e==t||!!(e&&t&&e.compare(t))}function ro(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var Fne=class e extends ua{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Xa(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||Ya)}static set(e,t=!1){return pa.of(e,t)}};Fne.prototype.startSide=Fne.prototype.endSide=-1;function io(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function ao(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function oo(e,t){if(!t.anchorNode)return!1;try{return ao(e,t.anchorNode)}catch{return!1}}function so(e){return e.nodeType==3?yo(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function co(e,t,n,r){return n?fo(e,t,n,r,-1)||fo(e,t,n,r,1):!1}function lo(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function uo(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function fo(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:po(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=lo(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?po(e):0}else return!1}}function po(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function mo(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Ine(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function ho(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function go(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=Ine(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=ho(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function _o(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var Lne=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?po(t):0),n,Math.min(e.focusOffset,n?po(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},vo=null;qa.safari&&qa.safari_version>=26&&(vo=!1);function Rne(e){if(e.setActive)return e.setActive();if(vo)return e.focus(vo);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(vo==null?{get preventScroll(){return vo={preventScroll:!0},!0}}:void 0),!vo){vo=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}var zne;function yo(e,t,n=t){let r=zne||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function bo(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function xo(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function So(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,po(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=po(n))}else if(n==e)return!0;else r=lo(n),n=n.parentNode}function Co(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function wo(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=po(n)}else if(n.parentNode&&!uo(n))r=lo(n),n=n.parentNode;else return null}function To(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!uo(n))r=lo(n)+1,n=n.parentNode;else return null}var Eo=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,lo(t),n)}static after(t,n){return new e(t.parentNode,lo(t)+1,n)}},Do=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(Do||={}),Oo=Do.LTR,ko=Do.RTL;function Ao(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var jo=Ao(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),Bne=Ao(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),Mo=Object.create(null),No=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);Mo[t]=n,Mo[n]=-t}function Po(e){return e<=247?jo[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Bne[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var Fo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,Io=class{get dir(){return this.level%2?ko:Oo}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function Lo(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!Lo(r.inner,i.inner))return!1}return!0}var Ro=[];function zo(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=Po(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),Ro[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=Ro[e];if(i==128)e<s-1&&t==Ro[e+1]&&t&24?i=Ro[e]=t:Ro[e]=256;else if(i==64){let i=e+1;for(;i<s&&Ro[i]==64;)i++;let a=e&&t==8||i<n&&Ro[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)Ro[t]=a;e=i-1}else i==8&&r==1&&(Ro[e]=1);t=i,i&7&&(r=i)}}}function Vne(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=Mo[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(No[e+1]==-r){let n=No[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(Ro[t]=Ro[No[e]]=r),s=e;break}}else if(No.length==189)break;else No[s++]=t,No[s++]=n,No[s++]=c;else if((o=Ro[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=No[t+2];if(n&2)break;if(e)No[t+2]|=2;else{if(n&4)break;No[t+2]|=4}}}}}function Hne(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=Ro[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(Ro[o]==256)o++;else break;let l=a==1,u=l==((o<t?Ro[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),Ro[--t]=u;c=o}else a=o,c++}}}function Bo(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=Ro[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(Ro[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new Io(c,m.from,f)),Vo(e,m.direction==Oo==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?Ro[p]!=s:Ro[p]==s))break;else p++;d?Bo(e,c,p,r+1,i,d,o):c<p&&o.push(new Io(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=Ro[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(Ro[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new Io(m.to,c,f)),Vo(e,m.direction==Oo==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?Ro[p-1]!=s:Ro[p-1]==s))break;else p--;d?Bo(e,p,c,r+1,i,d,o):p<c&&o.push(new Io(p,c,f)),c=p}}function Vo(e,t,n,r,i,a,o){let s=t%2?2:1;zo(e,i,a,r,s),Vne(e,i,a,r,s),Hne(i,a,r,s),Bo(e,i,a,t,n,r,o)}function Une(e,t,n){if(!e)return[new Io(0,0,+(t==ko))];if(t==Oo&&!n.length&&!Fo.test(e))return Ho(e.length);if(n.length)for(;e.length>Ro.length;)Ro[Ro.length]=256;let r=[],i=t==Oo?0:1;return Vo(e,i,i,n,0,e.length,r),r}function Ho(e){return[new Io(0,e,0)]}var Uo=``;function Wne(e,t,n,r,i){let a=r.head-e.from,o=Io.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=vi(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),Uo=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?Mi.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):Mi.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function Gne(e,t,n){for(let r=t;r<n;r++){let t=Po(e.charCodeAt(r));if(t==1)return Oo;if(t==2||t==4)return ko}return Oo}var Wo=Fi.define(),Go=Fi.define(),Ko=Fi.define(),qo=Fi.define(),Jo=Fi.define(),Yo=Fi.define(),Xo=Fi.define(),Zo=Fi.define(),Qo=Fi.define(),$o=Fi.define({combine:e=>e.some(e=>e)}),Kne=Fi.define({combine:e=>e.some(e=>e)}),es=Fi.define(),ts=class e{constructor(e,t=`nearest`,n=`nearest`,r=5,i=5,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(Mi.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},ns=ea.define({map:(e,t)=>e.map(t)}),rs=ea.define();function is(e,t,n){let r=e.facet(qo);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var as=Fi.define({combine:e=>e.length?e[0]:!0}),qne=0,os=Fi.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),ss=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(os.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(os.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(qne++,t,r,i,e=>{let t=[];return o&&t.push(ds.of(t=>{let n=t.plugin(e);return n?o(n):$a.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},cs=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){is(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(is(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){is(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},ls=Fi.define(),us=Fi.define(),ds=Fi.define(),fs=Fi.define(),ps=Fi.define(),ms=Fi.define(),hs=Fi.define();function gs(e,t){let n=e.state.facet(hs);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return pa.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=Gne(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var _s=Fi.define();function vs(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(_s)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var ys=Fi.define(),bs=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},xs=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=wi.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new bs(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},Jne=[],Ss=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Jne}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Ane(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=lo(this.dom),r=this.length?e>0:t>0;return new Eo(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Ts)return e;return null}static get(e){return e.cmTile}},Cs=class extends Ss{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=ws(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=ws(r);this.length=a}};function ws(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Ts=class extends Cs{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=Ss.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof Es)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},Es=class e extends Cs{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},Ds=class e extends Cs{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&Xne(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):Yne(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new Eo(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new Eo(e.dom,0);e==n.tile&&(a=!0)}}return new Eo(this.dom,0)}};function Yne(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=so(t);return n[n.length-1]||null}function Xne(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var Os=class e extends Cs{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},ks=class e extends Ss{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?qa.chrome||qa.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=yo(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return qa.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?mo(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},As=class e extends Ss{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return mo(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return mo(n,!r)}}get overrideDOMText(){if(!this.length)return fi.empty;let{root:e}=this;if(!e)return fi.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},js=class extends Ss{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return fi.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},Zne=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Qne=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},$ne=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new ks(a.dom,a.text+e);t.parent=i}else i.append(r||ks.of(e,this.cache.find(ks)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Ns(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof Os&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(Ns(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=Ss.get(n.dom);e&&e.setDOM(Ns(n.dom))}let e=Os.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=Ss.get(e.text);i&&this.cache.reused.set(i,2);let a=new ks(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=are;let n=Ds.start(e,t||this.cache.find(Ds)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof Os&&a.mark.eq(i))n=a,t--;else{let e=Os.of(i,this.cache.find(Os,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!rre(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(qa.ios&&rre(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Fs,0,32)||new As(Fs.toDOM(),0,Fs,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new Qne(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof Es&&n.wrapper.eq(t.wrapper))e=n;else{let n=Es.of(t.wrapper,this.cache.find(Es,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(js,void 0,1);return n&&(n.flags=t),n||new js(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},ere=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},Ms=[As,Ds,ks,Os,js,Es,Ts];for(let e=0;e<Ms.length;e++)Ms[e].bucket=e;var tre=class{constructor(e){this.view=e,this.buckets=Ms.map(()=>[]),this.index=Ms.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new As(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},nre=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new tre(e),this.text=new ere(e.state.doc),this.builder=new $ne(this.cache,new Ts(e,e.contentDOM),pa.iter(n)),this.cache.reused.set(t,2),this.old=new Zne(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=sre(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?As.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof js)this.cache.add(e);else if(e instanceof Os)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof Os&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof Os&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=pa.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof no){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?Ps.block:Ps.inline),c=ire(a),l=this.cache.findWidget(i,t-e,c)||As.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=ore(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let s=this.text.next(Math.min(512,t-o));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(s,i,o==e?a:i.length),o+=s.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=Ss.get(r);if(r==this.view.contentDOM)break;e instanceof Os?t.push(e):e?.isLine()?n=e:e instanceof Es||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new Ds(r,are):n||t.push(Os.of(new eo({tagName:r.nodeName.toLowerCase(),attributes:Mne(r)}),r)))}return{line:n,marks:t}}};function rre(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function ire(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var are={class:`cm-line`};function ore(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&Ja(n,e),r&&(e.class+=` `+r),e)}function sre(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Os&&t.push(r.mark)}return t}function Ns(e){let t=Ss.get(e);return t&&t.setDOM(e.cloneNode()),e}var Ps=class extends Za{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Ps.inline=new Ps(`span`),Ps.block=new Ps(`div`);var Fs=new class extends Za{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},cre=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=$a.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Ts(e,e.contentDOM),this.updateInner([new bs(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!vre(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?dre(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new bs(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(qa.ie||qa.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=mre(i,this.decorations,e.changes);o.length&&(t=bs.extendWithRanges(t,o));let s=gre(a,this.blockWrappers,e.changes);return s.length&&(t=bs.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new nre(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Ss.get(t.text)&&r.cache.reused.set(Ss.get(t.text),2),this.tile=r.run(e,t),Is(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=qa.chrome||qa.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof Ls&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(rs)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(as)||n.tabIndex>-1)&&oo(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),qa.gecko&&s.empty&&!this.hasComposition&&lre(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new Eo(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!co(c.node,c.offset,u.anchorNode,u.anchorOffset)||!co(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{qa.android&&qa.chrome&&n.contains(u.focusNode)&&_re(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=io(this.view.root);if(e)if(s.empty){if(qa.gecko){let e=fre(c.node,c.offset);if(e&&e!=3){let t=(e==1?wo:To)(c.node,c.offset);t&&(c=new Eo(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new Eo(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new Eo(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&co(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=io(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=po(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!Ss.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof Ls?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=vi(e.text,t);if(n==t)return null;let r=yo(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==Do.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof Es)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?so(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?Do.RTL:Do.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=so(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=so(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push($a.replace({widget:new Ls(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return $a.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ds).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(ps).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(pa.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(fs).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(es))try{if(t(this.view,e.range,e))return!0}catch(e){is(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc??(t.empty?0:t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=vs(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(go(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==Do.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Is(this.tile)}};function Is(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)Is(n,t)}}function lre(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function ure(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=wo(n.focusNode,n.focusOffset),i=To(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=Ss.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=Ss.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function dre(e,t,n){let r=ure(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new bs(c.mapPos(a),c.mapPos(o),a,o),text:i}}function fre(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var pre=class{constructor(){this.changes=[]}compareRange(e,t){ro(e,t,this.changes)}comparePoint(e,t){ro(e,t,this.changes)}boundChange(e){ro(e,e,this.changes)}};function mre(e,t,n){let r=new pre;return pa.compare(e,t,n,r),r.changes}var hre=class{constructor(){this.changes=[]}compareRange(e,t){ro(e,t,this.changes)}comparePoint(){}boundChange(e){ro(e,e,this.changes)}};function gre(e,t,n){let r=new hre;return pa.compare(e,t,n,r),r.changes}function _re(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function vre(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var Ls=class extends Za{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function yre(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return Mi.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=vi(i.text,a,!1):s=vi(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=vi(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=vi(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return Mi.range(o+i.from,s+i.from)}function bre(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+Cne(o,a,e.state.tabSize)}function xre(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==Qa.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function Sre(e,t,n,r){let i=xre(e,t.head,t.assoc||-1),a=!r||i.type!=Qa.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==Do.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return Mi.cursor(o,n?-1:1)}return Mi.cursor(n?i.to:i.from,n?-1:1)}function Cre(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=Wne(i,a,o,s,n),l=Uo;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
9
9
  `,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function wre(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==oa.Space&&(i=t),i==t}}function Tre(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return Mi.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Vs(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return Mi.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return Mi.cursor(i.pos,i.assoc,void 0,o)}}function Rs(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function Ere(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Rs(e,i.from,0);t!=i.from&&(a=Mi.cursor(t,-1))}else{let t=Rs(e,i.from,-1),n=Rs(e,i.to,1);(t!=i.from||n!=i.to)&&(a=Mi.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?Mi.create(n,t.mainIndex):t}function zs(e,t,n){let r=Rs(e.state.facet(ms).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Mi.cursor(r,r<n.from?1:-1)}var Bs=class{constructor(e,t){this.pos=e,this.assoc=t}};function Vs(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new Bs(0,1);if(c>e.viewState.docHeight)return new Bs(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==Qa.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==Qa.Text){let t=bre(e,i,l,o,s);return new Bs(t,t==l.from?1:-1)}}if(l.type!=Qa.Text)return c<(l.top+l.bottom)/2?new Bs(l.from,1):new Bs(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new Dre(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var Dre=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Io.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Io.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n=0,r=e.length-1,i=new Set,a=this.bidiIn(e[0],e[r]),o,s,c=-1,l=1e9,u;search:for(;n<r;){let d=r-n,f=n+r>>1;adjust:if(i.has(f)){let e=n+Math.floor(Math.random()*d);for(let t=0;t<d;t++){if(!i.has(e)){f=e;break adjust}e++,e==r&&(e=n)}break search}i.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let i=p[t],d=0;if(!(i.width==0&&p.length>1)){if(i.bottom<this.y)(!o||o.bottom<i.bottom)&&(o=i),d=1;else if(i.top>this.y)(!s||s.top>i.top)&&(s=i),d=-1;else{let e=i.left>this.x?this.x-i.left:i.right<this.x?this.x-i.right:0,t=Math.abs(e);t<l&&(c=f,l=t,u=i),e&&(d=e<0==(this.baseDir==Do.LTR)?-1:1)}d==-1&&(!a||this.baseDirAt(e[f],1))?r=f:d==1&&(!a||this.baseDirAt(e[f+1],-1))&&(n=f+1)}}}if(!u){let n=o&&(!s||this.y-o.bottom<s.top-this.y)?o:s;return this.y=(n.top+n.bottom)/2,this.scan(e,t)}let d=(a?this.dirAt(e[c],1):this.baseDir)==Do.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=vi(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return yo(e.dom,i,a).getClientRects()});return r.after?new Bs(n[r.i+1],-1):new Bs(n[r.i],1)}scanTile(e,t){if(!e.length)return new Bs(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:yo(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new Bs(n[r.i+1],-1):new Bs(a,1)}},Hs=`￿`,Ore=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(ca.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Hs}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=Ss.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=Ss.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:uo(r))||uo(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!Are(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=Ss.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(kre(e,n.node,n.offset)?t:0))}};function kre(e,t,n){for(;;){if(!t||n<po(t))return!1;if(t==e)return!0;n=lo(t)+1,t=t.parentNode}}function Are(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=Ss.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var jre=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},Mre=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Nre(e.docView.tile,t,n,0))){let t=i||a?[]:Ire(e),n=new Ore(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=Lre(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!ao(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!ao(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((qa.ios||qa.chrome)&&o.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(Mi.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=Mi.create([Mi.cursor(n,r)])}else this.newSel=Mi.single(r,n)}}};function Nre(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return Nre(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function Pre(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||qa.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,Hs),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:fi.of(t.text.slice(a.from-e,u).split(Hs))}:(d=Ws(l,t.text,s-e,c))&&(qa.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==Hs+Hs&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:fi.of(t.text.slice(d.from,d.toB).split(Hs))})}else r&&(!e.hasFocus&&i.facet(as)||Gs(r,a))&&(r=null);if(!n&&!r)return!1;if((qa.mac||qa.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=Mi.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:fi.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:qa.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
10
- `&&e.lineWrapping&&(r&&=Mi.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:fi.of([` `])}),n)return Us(e,n,r,o);if(r&&!Gs(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Ere(i.facet(ms).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function Us(e,t,n,r=-1){if(qa.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(qa.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&bo(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&bo(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&bo(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Fre(e,t,n);return e.state.facet(Yo).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Fre(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Rs(i.facet(ms).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:Mi.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&ure(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?Mi.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Ws(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function Ire(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new jre(n,r)),(i!=n||a!=r)&&t.push(new jre(i,a))),t}function Lre(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?Mi.single(n+t,r+t):null}function Gs(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var Rre=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,qa.safari&&e.contentDOM.addEventListener(`input`,()=>null),qa.gecko&&Zre(e.contentDOM.ownerDocument)}handleEvent(e){!Wre(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=zre(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Js.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),qa.android&&qa.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return qa.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=qs.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||Bre.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,bo(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:qa.safari&&!qa.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Ks(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){is(n.state,e)}}}function zre(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Ks(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Ks(t.value,r))}}for(let e in $s)n(e).handlers.push($s[e]);for(let e in ec)n(e).observers.push(ec[e]);return t}var qs=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],Bre=`dthko`,Js=[16,17,18,20,91,92,224,225],Ys=6;function Xs(e){return Math.max(0,e)*.7+8}function Zs(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var Vre=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=_o(e.contentDOM),this.atoms=e.state.facet(ms).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ca.allowMultipleSelections)&&Hre(e,t),this.dragging=Ure(e,t)&&cc(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Zs(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=vs(this.view);e.clientX-s.left<=r+Ys?t=-Xs(r-e.clientX):e.clientX+s.right>=a-Ys&&(t=Xs(e.clientX-a)),e.clientY-s.top<=i+Ys?n=-Xs(i-e.clientY):e.clientY+s.bottom>=o-Ys&&(n=Xs(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Ere(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function Hre(e,t){let n=e.state.facet(Wo);return n.length?n[0](t):qa.mac?t.metaKey:t.ctrlKey}function Qs(e,t){let n=e.state.facet(Go);return n.length?n[0](t):qa.mac?!t.altKey:!t.ctrlKey}function Ure(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=io(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function Wre(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Ss.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var $s=Object.create(null),ec=Object.create(null),tc=qa.ie&&qa.ie_version<15||qa.ios&&qa.webkit_version<604;function Gre(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),rc(e,n.value)},50)}function nc(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function rc(e,t){t=nc(e.state,Zo,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(uc!=null&&n.selection.ranges.every(e=>e.empty)&&uc==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:Mi.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Mi.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}ec.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},ec.wheel=ec.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},$s.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),ec.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},ec.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},$s.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(Ko))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=qre(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new Vre(e,t,n,r)),r&&e.observer.ignore(()=>{Rne(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function ic(e,t,n,r){if(r==1)return Mi.cursor(t,n);if(r==2)return yre(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,Mi.range(a,o)}}var Kre=qa.ie&&qa.ie_version<=11,ac=null,oc=0,sc=0;function cc(e){if(!Kre)return e.detail;let t=ac,n=sc;return ac=e,sc=Date.now(),oc=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(oc+1)%3:1}function qre(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=cc(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=ic(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=ic(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?Mi.range(i,a,l.assoc):Mi.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=Jre(i,s.pos))?c:o?i.addRange(l):Mi.create([l])}}}function Jre(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Mi.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}$s.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=Mi.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,nc(e.state,Qo,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},$s.dragend=e=>(e.inputState.draggedContent=null,!1);function lc(e,t,n,r){if(n=nc(e.state,Zo,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&Qs(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}$s.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&lc(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return lc(e,t,n,!0),!0}return!1},$s.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=tc?null:t.clipboardData;return n?(rc(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(Gre(e),!1)};function Yre(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function Xre(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:nc(e,Qo,t.join(e.lineBreak)),ranges:n,linewise:r}}var uc=null;$s.copy=$s.cut=(e,t)=>{if(!oo(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=Xre(e.state);if(!n&&!i)return!1;uc=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=tc?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(Yre(e,n),!1)};var dc=$i.define();function fc(e,t){let n=[];for(let r of e.facet(Xo)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:dc.of(!0)}):null}function pc(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=fc(e.state,t);n?e.dispatch(n):e.update([])}},10)}ec.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),pc(e)},ec.blur=e=>{e.observer.clearSelectionRange(),pc(e)},ec.compositionstart=ec.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},ec.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,qa.chrome&&qa.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},ec.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},$s.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return Us(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(qa.chrome&&qa.android&&(n=qs.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return qa.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),qa.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>ec.compositionend(e,t),20),!1};var mc=new Set;function Zre(e){mc.has(e)||(mc.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var hc=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],gc=!1;function _c(){gc=!1}var Qre=class{constructor(e){this.lineWrapping=e,this.doc=fi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return hc.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=hc.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},$re=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},vc=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?Qa.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof no?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},yc=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(yc||={}),bc=.001,xc=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>bc&&(gc=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,yc.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,yc.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,yc.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=rie.build(n.setDoc(a),e,l,u);i=Sc(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new wc(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new tie(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function Sc(e,t){return e==t?e:(e.constructor!=t.constructor&&(gc=!0),t)}xc.prototype.size=1;var eie=$a.replace({}),Cc=class extends xc{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new vc(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new vc(r,0,n,this.spaceAbove,eie):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,yc.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},wc=class e extends Cc{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new vc(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof Tc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Tc?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):xc.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},Tc=class e extends xc{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new vc(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new vc(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==yc.ByHeight)return this.blockAt(e,n,r,i);if(t==yc.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new vc(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new vc(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new vc(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return xc.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=bc&&(s=-2);let c=new wc(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=xc.of(r);return(s<0||Math.abs(c.height-this.height)>=bc||Math.abs(s-this.heightMetrics(t,n).perLine)>=bc)&&(gc=!0),Sc(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},tie=class extends xc{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==yc.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==yc.ByPosNoHeight?yc.ByPosNoHeight:yc.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,yc.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&Ec(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),Ec(i,e)}return xc.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?xc.of(this.break?[e,null,t]:[e,t]):(this.left=Sc(this.left,e),this.right=Sc(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function Ec(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Tc&&(r=e[t+1])instanceof Tc&&e.splice(t-1,3,new Tc(n.length+1+r.length))}var nie=5,rie=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof wc?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new wc(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new Cc(a,r,n)):(a||i||r>=nie)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new wc(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Tc(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof wc)return e;let t=new wc(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof wc)&&!this.isCovered?this.nodes.push(new wc(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof wc&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return pa.spans(n,r,i,a,0),a.finish(r)}};function iie(e,t,n){let r=new aie;return pa.compare(e,t,n,r,0),r.changes}var aie=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&ro(e,t,this.changes,5)}};function oie(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function Dc(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function sie(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var Oc=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return $a.replace({widget:new cie(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},cie=class extends Za{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},kc=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Pc,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Do.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1,this.heightOracle=new Qre(t.facet(us).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`)),this.stateDeco=Fc(t),this.heightMap=xc.empty().applyChanges(this.stateDeco,fi.empty,this.heightOracle.setDoc(t.doc),[new bs(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$a.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new Ac(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Pc:new uie(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ic(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=Fc(this.state);let r=e.changedRanges,i=bs.extendWithRanges(r,iie(n,this.stateDeco,e?e.changes:wi.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);_c(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||gc)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Kne)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?Do.RTL:Do.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=ho(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=_o(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Co(this.scrollParent||e.win);let m=(this.printing?sie:oie)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!Dc(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),_c();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?xc.empty().applyChanges(this.stateDeco,fi.empty,this.heightOracle,[new bs(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new $re(n.from,i))}gc&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new Ac(r.lineAt(a-n*1e3,yc.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,yc.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,yc.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new Ac(r.lineAt(o-1e3/2,yc.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,yc.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Ac(this.heightMap.lineAt(n,yc.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,yc.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,yc.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,yc.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new Oc(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=Do.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=lie(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(Mi.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new Oc(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=Qa.Text)return;let i=jc(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=Nc(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=Mc(i,n),l=Mc(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=Nc(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=Mc(i,f),l=Mc(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=Nc(r,n)-Nc(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){Oc.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=$a.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];pa.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ic(this.heightMap.lineAt(e,yc.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Ic(this.heightMap.lineAt(this.scaler.fromDOM(e),yc.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ic(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Ac=class{constructor(e,t){this.from=e,this.to=t}};function jc(e,t,n){let r=[],i=e,a=0;return pa.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function Mc({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function Nc(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function lie(e,t){for(let n of e)if(t(n))return n}var Pc={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function Fc(e){let t=e.facet(ds).filter(e=>typeof e!=`function`),n=e.facet(ps).filter(e=>typeof e!=`function`);return n.length&&t.push(pa.join(n)),t}var uie=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,yc.ByPos,e,0,0).top,o=t.lineAt(i,yc.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function Ic(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new vc(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>Ic(e,t)):e._content)}var Lc=Fi.define({combine:e=>e.join(` `)}),Rc=Fi.define({combine:e=>e.indexOf(!0)>-1}),zc=Aa.newName(),Bc=Aa.newName(),Vc=Aa.newName(),Hc={"&light":`.`+Bc,"&dark":`.`+Vc};function Uc(e,t,n){return new Aa(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var die=Uc(`.`+zc,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},Hc),fie={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Wc=qa.ie&&qa.ie_version<=11,Gc=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Lne,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(qa.ie&&qa.ie_version<=11||qa.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&qa.android&&e.constructor.EDIT_CONTEXT!==!1&&!(qa.chrome&&qa.chrome_version<126)&&(this.editContext=new Jc(e),e.state.facet(as)&&(e.contentDOM.editContext=this.editContext.editContext)),Wc&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(as)?n.root.activeElement!=this.dom:!oo(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(qa.ie&&qa.ie_version<=11||qa.android&&qa.chrome)&&!n.state.selection.main.empty&&r.focusNode&&co(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=io(e.root);if(!t)return!1;let n=qa.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&pie(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=oo(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&So(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,fie),Wc&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Wc&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){this.delayedAndroidKey||(this.flushingAndroidKey=this.view.win.requestAnimationFrame(()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&bo(this.dom,e.key,e.keyCode))})),(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&oo(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Mre(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Pre(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!Gs(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=Kc(t,e.previousSibling||e.target.previousSibling,-1),r=Kc(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(as)!=e.state.facet(as)&&(e.view.contentDOM.editContext=e.state.facet(as)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function Kc(e,t,n){for(;t;){let r=Ss.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function qc(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return co(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function pie(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return qc(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?qc(e,n):null}var Jc=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=Ws(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=Mi.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Gs(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:fi.of(n.text.slice(l.from,l.toB).split(`
11
- `))};if((qa.mac||qa.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:fi.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Us(e,u,Mi.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push($a.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:rs.of($a.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=io(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},Yc=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||xo(e.parent)||document,this.viewState=new kc(this,e.state||ca.create(e)),e.scrollTo&&e.scrollTo.is(ns)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(os).map(e=>new cs(e));for(let e of this.plugins)e.update(this);this.observer=new Gc(this),this.inputState=new Rre(this),this.inputState.ensureHandlers(this.plugins),this.docView=new cre(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof ta?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);i=t.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,o=0,s=null;e.some(e=>e.annotation(dc))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=fc(i,a),s||(o=1));let c=this.observer.delayedAndroidKey,l=null;if(c?(this.observer.clearDelayedAndroidKey(),l=this.observer.readChange(),(l&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(l=null)):this.observer.clear(),i.facet(ca.phrases)!=this.state.facet(ca.phrases))return this.setState(i);r=xs.create(this,i,e),r.flags|=o;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&=u.map(t.changes),t.scrollIntoView){let{main:e}=t.state.selection;u=new ts(e.empty?e:Mi.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(ns)&&(u=e.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=Zc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ys)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(r.startState.facet(Lc)!=r.state.facet(Lc)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(Jo))try{e(r)}catch(e){is(this.state,e,`update listener`)}(s||l)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),l&&!Pre(this,l)&&c.force&&bo(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new kc(this,e),this.plugins=e.facet(os).map(e=>new cs(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new cre(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(os),n=e.state.facet(os);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new cs(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){is(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(Co(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return is(this.state,e),Xc}}),l=xs.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=Xc)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){is(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Jo))e(t)}get themeClasses(){return zc+` `+(this.state.facet(Rc)?Vc:Bc)+` `+this.state.facet(Lc)}updateAttrs(){let e=Qc(this,ls,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(as)?`true`:`false`,class:`cm-content`,style:`${qa.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),Qc(this,us,t);let n=this.observer.ignore(()=>{let n=jne(this.contentDOM,this.contentAttrs,t),r=jne(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(ys);let t=this.state.facet(e.cspNonce);Aa.mount(this.root,this.styleModules.concat(die).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return zs(this,e,Cre(this,e,t,n))}moveByGroup(e,t){return zs(this,e,Cre(this,e,t,t=>wre(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return Mi.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Sre(this,e,t,n)}moveVertically(e,t,n){return zs(this,e,Tre(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Vs(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Vs(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[Io.find(i,e-r.from,-1,t)];return mo(n,a.dir==Do.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet($o)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>mie)return Ho(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Lo(r.isolates,n=gs(this,e))))return r.order;n||=gs(this,e);let r=Une(e.text,t,n);return this.bidiCache.push(new Zc(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||qa.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Rne(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return ns.of(new ts(typeof e==`number`?Mi.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return ns.of(new ts(Mi.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ss.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ss.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Aa.newName(),r=[Lc.of(n),ys.of(Uc(`.${n}`,e))];return t&&t.dark&&r.push(Rc.of(!0)),r}static baseTheme(e){return Wi.lowest(ys.of(Uc(`.`+zc,e,Hc)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&Ss.get(t)||Ss.get(e))?.root?.view||null}};Yc.styleModule=ys,Yc.inputHandler=Yo,Yc.clipboardInputFilter=Zo,Yc.clipboardOutputFilter=Qo,Yc.scrollHandler=es,Yc.focusChangeEffect=Xo,Yc.perLineTextDirection=$o,Yc.exceptionSink=qo,Yc.updateListener=Jo,Yc.editable=as,Yc.mouseSelectionStyle=Ko,Yc.dragMovesSelection=Go,Yc.clickAddsSelectionRange=Wo,Yc.decorations=ds,Yc.blockWrappers=fs,Yc.outerDecorations=ps,Yc.atomicRanges=ms,Yc.bidiIsolatedRanges=hs,Yc.scrollMargins=_s,Yc.darkTheme=Rc,Yc.cspNonce=Fi.define({combine:e=>e.length?e[0]:``}),Yc.contentAttributes=us,Yc.editorAttributes=ls,Yc.lineWrapping=Yc.contentAttributes.of({class:`cm-lineWrapping`}),Yc.announce=ea.define();var mie=4096,Xc={},Zc=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:Do.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function Qc(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Ja(a,n)}return n}var hie=qa.mac?`mac`:qa.windows?`win`:qa.linux?`linux`:`key`;function gie(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function $c(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var _ie=Wi.default(Yc.domEventHandlers({keydown(e,t){return xie(vie(t.state),e,t,`editor`)}})),el=Fi.define({enables:_ie}),tl=new WeakMap;function vie(e){let t=e.facet(el),n=tl.get(t);return n||tl.set(t,n=bie(t.reduce((e,t)=>e.concat(t),[]))),n}var nl=null,yie=4e3;function bie(e,t=hie){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>gie(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=nl={view:t,prefix:n,scope:e};return setTimeout(()=>{nl==r&&(nl=null)},yie),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,rl))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var rl=null;function xie(e,t,n,r){rl=t;let i=Ene(t),a=bi(yi(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;nl&&nl.view==n&&nl.scope==r&&(o=nl.prefix+` `,Js.indexOf(t.keyCode)<0&&(c=!0,nl=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+$c(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(qa.windows&&t.ctrlKey&&t.altKey)&&!(qa.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=Ma[t.keyCode])&&p!=i?(d(f[o+$c(p,t,!0)])||t.shiftKey&&(m=Na[t.keyCode])!=i&&m!=p&&d(f[o+$c(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+$c(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),rl=null,s}/x/.unicode;function Sie(){return il}var Cie=$a.line({class:`cm-activeLine`}),il=ss.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(Cie.range(i.from)),t=i.from)}return $a.set(n)}},{decorations:e=>e.decorations}),al=`-10000px`,ol=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function sl(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var cl=Fi.define({combine:e=>({position:qa.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||sl})}),ll=new WeakMap,ul=ss.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(cl);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new ol(e,dl,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(cl);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=al,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(qa.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=vs(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(cl).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=al;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=ll.get(c)??d.bottom-d.top,g=c.offset||Eie,_=this.view.textDirection==Do.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=al;continue}ll.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,wie(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,wie(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=al}},{eventObservers:{scroll(){this.maybeMeasure()}}});function wie(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var Tie=Yc.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),Eie={x:0,y:0},dl=Fi.define({enables:[ul,Tie]}),fl=Fi.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),Die=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new ol(e,fl,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},pl=dl.compute([fl],e=>{let t=e.facet(fl);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:Die.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),ml=class{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==Do.RTL?-1:1;i=t.x<n.left?-o:o}let a=this.source(e,r,i);if(a?.then){let t=this.pending={pos:r};a.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>is(e.state,t,`hover tooltip`))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(ul),t=e?e.manager.tooltips.findIndex(e=>e.create==Die.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&n&&!gl(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!_l(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},hl=4;function gl(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-hl&&t.clientX<=r+hl&&t.clientY>=i-hl&&t.clientY<=a+hl}function _l(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function Oie(e,t={}){let n=ea.define(),r=Vi.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,Si.TrackDel);if(e!=null){let i=Object.assign(Object.create(null),n);i.pos=e,i.end!=null&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(Aie)&&(e=[]);return e},provide:e=>fl.from(e)});return{active:r,extension:[r,ss.define(i=>new ml(i,e,r,n,t.hoverTime||300)),pl]}}function kie(e,t){let n=e.plugin(ul);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var Aie=ea.define(),jie=Fi.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}}),vl=ss.fromClass(class{constructor(e){this.input=e.state.facet(xl),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(jie);this.top=new yl(e,!0,t.topContainer),this.bottom=new yl(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(jie);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new yl(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new yl(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(xl);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Yc.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),yl=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`,this.dom.style[this.top?`top`:`bottom`]=`0`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=bl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=bl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function bl(e){let t=e.nextSibling;return e.remove(),t}var xl=Fi.define({enables:vl}),Sl=class extends ua{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Sl.prototype.elementClass=``,Sl.prototype.toDOM=void 0,Sl.prototype.mapMode=Si.TrackBefore,Sl.prototype.startSide=Sl.prototype.endSide=-1,Sl.prototype.point=!0;var Cl=Fi.define(),Mie=Fi.define(),wl=Fi.define(),Tl=Fi.define({combine:e=>e.some(e=>e)});function Nie(e){let t=[Pie];return e&&e.fixed===!1&&t.push(Tl.of(!0)),t}var Pie=ss.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(wl).map(t=>new Iie(e,t)),this.fixed=!e.state.facet(Tl);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Tl)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=pa.iter(this.view.state.facet(Cl),this.view.viewport.from),r=[],i=this.gutters.map(e=>new Dl(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==Qa.Text&&t){El(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==Qa.Text){El(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(wl),n=e.state.facet(wl),r=e.docChanged||e.heightChanged||e.viewportChanged||!pa.eq(e.startState.facet(Cl),e.state.facet(Cl),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new Iie(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Yc.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Do.LTR?{left:r,right:i}:{right:r,left:i}})});function Fie(e){return Array.isArray(e)?e:[e]}function El(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var Dl=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=pa.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new Lie(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];El(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(Mie)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Iie=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=Fie(t.markers(e)),t.initialSpacer&&(this.spacer=new Lie(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=Fie(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!pa.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Lie=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Rie(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function Rie(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var zie=Fi.define(),Bie=Fi.define(),Ol=Fi.define({combine(e){return la(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),kl=class extends Sl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Al(e,t){return e.state.facet(Ol).formatNumber(t,e.state)}var Vie=wl.compute([Ol],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(zie)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new kl(Al(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Bie)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Ol)!=e.state.facet(Ol),initialSpacer(e){return new kl(Al(e,Uie(e.state.doc.lines)))},updateSpacer(e,t){let n=Al(t.view,Uie(t.view.state.doc.lines));return n==e.number?e:new kl(n)},domEventHandlers:e.facet(Ol).domEventHandlers,side:`before`}));function Hie(e={}){return[Ol.of(e),Nie(),Vie]}function Uie(e){let t=9;for(;t<e;)t=t*10+9;return t}var Wie=1024,Gie=0,jl=class{constructor(e,t){this.from=e,this.to=t}},Ml=class{constructor(e={}){this.id=Gie++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=Pl.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Ml.closedBy=new Ml({deserialize:e=>e.split(` `)}),Ml.openedBy=new Ml({deserialize:e=>e.split(` `)}),Ml.group=new Ml({deserialize:e=>e.split(` `)}),Ml.isolate=new Ml({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),Ml.contextHash=new Ml({perNode:!0}),Ml.lookAhead=new Ml({perNode:!0}),Ml.mounted=new Ml({perNode:!0});var Nl=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Ml.mounted.id]}},Kie=Object.create(null),Pl=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Kie,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(Ml.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(Ml.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};Pl.none=new Pl(``,Object.create(null),0,8);var qie=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new Pl(e.name,r,e.id,e.flags):e)}return new e(n)}},Fl=new WeakMap,Il=new WeakMap,Ll;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(Ll||={});var Rl=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=Nl.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new Zl(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new Zl(Fl.get(this)||this.topNode);return r.moveTo(e,t),Fl.set(this,r._tree),r}get topNode(){return new Ul(this,0,0,null)}resolve(e,t=0){let n=Vl(Fl.get(this)||this.topNode,e,t,!1);return Fl.set(this,n),n}resolveInner(e,t=0){let n=Vl(Il.get(this)||this.topNode,e,t,!0);return Il.set(this,n),n}resolveStack(e,t=0){return Xl(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&Ll.IncludeAnonymous)>0;for(let e=this.cursor(a|Ll.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:tu(Pl.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(Pl.none,t,n,r)))}static build(e){return Yie(e)}};Rl.empty=new Rl(Pl.none,[],[],0);var zl=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},Bl=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Pl.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(Jie(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function Jie(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function Vl(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof Ul&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Ll.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof Ul&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var Hl=class{cursor(e=0){return new Zl(this,e)}getChild(e,t=null,n=null){let r=Wl(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return Wl(this,e,t,n)}resolve(e,t=0){return Vl(this,e,t,!1)}resolveInner(e,t=0){return Vl(this,e,t,!0)}matchContext(e){return Gl(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},Ul=class e extends Hl{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&Ll.EnterBracketed&&l instanceof Rl&&(d=Nl.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!Jie(i,r,u,u+l.length))){if(l instanceof Bl){if(a&Ll.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new ql(new Kl(o,l,t,u),null,e)}else if(a&Ll.IncludeAnonymous||!l.type.isAnonymous||Ql(l)){let s;if(!(a&Ll.IgnoreMounts)&&(s=Nl.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&Ll.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&Ll.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&Ll.IgnoreOverlays)&&(i=Nl.get(this._tree))&&i.overlay){let a=t-this.from,o=r&Ll.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Wl(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function Gl(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var Kl=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ql=class e extends Hl{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&Ll.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new Rl(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Jl(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof Ul&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Yl(i,n)}var Yl=class{constructor(e,t){this.heads=e,this.node=t}get next(){return Jl(this.heads)}};function Xl(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof Ul?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=Nl.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new Ul(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(Vl(o,t,n,!1))}}return i?Jl(i):r}var Zl=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Ll.EnterBracketed,e instanceof Ul)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Ul?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Ll.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ll.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ll.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&Ll.IncludeAnonymous||e instanceof Bl||!e.type.isAnonymous||Ql(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new ql(this.buffer,t,this.stack[e]);return this.bufferNode=new ql(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Gl(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return Gl(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function Ql(e){return e.children.some(e=>e instanceof Bl||!e.type.isAnonymous||Ql(e))}function Yie(e){let{buffer:t,nodeSet:n,maxBufferLength:r=Wie,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new zl(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:ee,size:te}=o,ne=l,C=c;if(te<0)if(o.next(),te==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(te==-3){c=x;return}else if(te==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${te}`);let re=s[x],ie,ae,oe=S-e;if(ee-S<=r&&(ae=h(o.pos-t,y))){let t=new Uint16Array(ae.size-ae.skip),r=o.pos-ae.size,i=t.length;for(;o.pos>r;)i=g(ae.start,t,i);ie=new Bl(t,ee-ae.start,n),oe=ae.start-e}else{let e=o.pos-te;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=ee;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,ne,C),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,ne,C),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(re,C);ie=tu(re,t,n,0,t.length,0,ee-S,e,e)}else ie=m(re,t,n,ee-S,ne-ee,C)}_.push(ie),v.push(oe)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new Bl(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof Rl){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(Ml.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[Ml.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[Ml.lookAhead,i];o=o?[e].concat(o):[e]}return new Rl(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new Rl(s[e.topID],_.reverse(),v.reverse(),y)}var $l=new WeakMap;function eu(e,t){if(!e.isAnonymous||t instanceof Bl||t.type!=e)return 1;let n=$l.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Rl)){n=1;break}n+=eu(e,r)}$l.set(t,n)}return n}function tu(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=eu(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=eu(e,t[s]);for(s++;s<i;s++){let n=eu(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(tu(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var nu=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},ru=class{startParse(e,t,n){return typeof e==`string`&&(e=new iu(e)),n=n?n.length?n.map(e=>new jl(e.from,e.to)):[new jl(0,0)]:[new jl(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},iu=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new Ml({perNode:!0});var T=0,au=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=T++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new ou(e);return e=>e.modified.indexOf(t)>-1?e:ou.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},Xie=0,ou=class e{constructor(e){this.name=e,this.instances=[],this.id=Xie++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&Zie(n,e.modified));if(r)return r;let i=[],a=new au(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=Qie(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function Zie(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function Qie(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function su(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new cu(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return $ie.add(t)}var $ie=new Ml({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new cu(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),cu=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};cu.empty=new cu([],2,null);function lu(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function eae(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function tae(e,t,n,r=0,i=e.length){let a=new nae(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var nae=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=rae(e)||cu.empty,u=eae(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(Ml.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function rae(e){let t=e.type.prop($ie);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var uu=au.define,du=uu(),fu=uu(),iae=uu(fu),aae=uu(fu),pu=uu(),mu=uu(pu),hu=uu(pu),gu=uu(),_u=uu(gu),vu=uu(),yu=uu(),bu=uu(),xu=uu(bu),Su=uu(),Cu={comment:du,lineComment:uu(du),blockComment:uu(du),docComment:uu(du),name:fu,variableName:uu(fu),typeName:iae,tagName:uu(iae),propertyName:aae,attributeName:uu(aae),className:uu(fu),labelName:uu(fu),namespace:uu(fu),macroName:uu(fu),literal:pu,string:mu,docString:uu(mu),character:uu(mu),attributeValue:uu(mu),number:hu,integer:uu(hu),float:uu(hu),bool:uu(pu),regexp:uu(pu),escape:uu(pu),color:uu(pu),url:uu(pu),keyword:vu,self:uu(vu),null:uu(vu),atom:uu(vu),unit:uu(vu),modifier:uu(vu),operatorKeyword:uu(vu),controlKeyword:uu(vu),definitionKeyword:uu(vu),moduleKeyword:uu(vu),operator:yu,derefOperator:uu(yu),arithmeticOperator:uu(yu),logicOperator:uu(yu),bitwiseOperator:uu(yu),compareOperator:uu(yu),updateOperator:uu(yu),definitionOperator:uu(yu),typeOperator:uu(yu),controlOperator:uu(yu),punctuation:bu,separator:uu(bu),bracket:xu,angleBracket:uu(xu),squareBracket:uu(xu),paren:uu(xu),brace:uu(xu),content:gu,heading:_u,heading1:uu(_u),heading2:uu(_u),heading3:uu(_u),heading4:uu(_u),heading5:uu(_u),heading6:uu(_u),contentSeparator:uu(gu),list:uu(gu),quote:uu(gu),emphasis:uu(gu),strong:uu(gu),link:uu(gu),monospace:uu(gu),strikethrough:uu(gu),inserted:uu(),deleted:uu(),changed:uu(),invalid:uu(),meta:Su,documentMeta:uu(Su),annotation:uu(Su),processingInstruction:uu(Su),definition:au.defineModifier(`definition`),constant:au.defineModifier(`constant`),function:au.defineModifier(`function`),standard:au.defineModifier(`standard`),local:au.defineModifier(`local`),special:au.defineModifier(`special`)};for(let e in Cu){let t=Cu[e];t instanceof au&&(t.name=e)}lu([{tag:Cu.link,class:`tok-link`},{tag:Cu.heading,class:`tok-heading`},{tag:Cu.emphasis,class:`tok-emphasis`},{tag:Cu.strong,class:`tok-strong`},{tag:Cu.keyword,class:`tok-keyword`},{tag:Cu.atom,class:`tok-atom`},{tag:Cu.bool,class:`tok-bool`},{tag:Cu.url,class:`tok-url`},{tag:Cu.labelName,class:`tok-labelName`},{tag:Cu.inserted,class:`tok-inserted`},{tag:Cu.deleted,class:`tok-deleted`},{tag:Cu.literal,class:`tok-literal`},{tag:Cu.string,class:`tok-string`},{tag:Cu.number,class:`tok-number`},{tag:[Cu.regexp,Cu.escape,Cu.special(Cu.string)],class:`tok-string2`},{tag:Cu.variableName,class:`tok-variableName`},{tag:Cu.local(Cu.variableName),class:`tok-variableName tok-local`},{tag:Cu.definition(Cu.variableName),class:`tok-variableName tok-definition`},{tag:Cu.special(Cu.variableName),class:`tok-variableName2`},{tag:Cu.definition(Cu.propertyName),class:`tok-propertyName tok-definition`},{tag:Cu.typeName,class:`tok-typeName`},{tag:Cu.namespace,class:`tok-namespace`},{tag:Cu.className,class:`tok-className`},{tag:Cu.macroName,class:`tok-macroName`},{tag:Cu.propertyName,class:`tok-propertyName`},{tag:Cu.operator,class:`tok-operator`},{tag:Cu.comment,class:`tok-comment`},{tag:Cu.meta,class:`tok-meta`},{tag:Cu.invalid,class:`tok-invalid`},{tag:Cu.punctuation,class:`tok-punctuation`}]);var wu=new Ml,oae=new Ml,Tu=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,ca.prototype.hasOwnProperty(`tree`)||Object.defineProperty(ca.prototype,`tree`,{get(){return Du(this)}}),this.parser=t,this.extension=[Pu.of(this),ca.languageData.of((e,t,n)=>{let r=Eu(e,t,n),i=r.type.prop(wu);if(!i)return[];let a=e.facet(i),o=r.type.prop(oae);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return Eu(e,t,n).type.prop(wu)==this.data}findRegions(e){let t=e.facet(Pu);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(wu)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(Ml.mounted);if(i){if(i.tree.prop(wu)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Rl&&r(i,e.positions[n]+t)}};return r(Du(e),0),n}get allowsNesting(){return!0}};Tu.setState=ea.define();function Eu(e,t,n){let r=e.facet(Pu),i=Du(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,Ll.ExcludeBuffers|Ll.EnterBracketed))e.type.isTop&&(i=e);return i}function Du(e){let t=e.field(Tu.state,!1);return t?t.tree:Rl.empty}var Ou=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},ku=null,Au=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],Rl.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Ou(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Rl.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(nu.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(nu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ku;ku=this;try{return e()}finally{ku=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ju(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=nu.applyChanges(r,e),i=Rl.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=ju(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ru{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=ku;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new Rl(Pl.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ku}};function ju(e,t,n){return nu.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var Mu=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=Au.create(t.facet(Pu).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};Tu.state=Vi.define({create:Mu.init,update(e,t){for(let e of t.effects)if(e.is(Tu.setState))return e.value;return t.startState.facet(Pu)==t.state.facet(Pu)?e.apply(t):Mu.init(t.state)}});var sae=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(sae=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var Nu=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,cae=ss.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Tu.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Tu.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=sae(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(Tu.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Nu?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>Nu&&Nu()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Tu.setState.of(new Mu(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>is(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Pu=Fi.define({combine(e){return e.length?e[0]:null},enables:e=>[Tu.state,cae,Yc.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),lae=Fi.define(),Fu=Fi.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function Iu(e){let t=e.facet(Fu);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function Lu(e,t){let n=``,r=e.tabSize,i=e.facet(Fu)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function uae(e,t){e instanceof ca&&(e=new Ru(e));for(let n of e.state.facet(lae)){let r=n(e,t);if(r!==void 0)return r}let n=Du(e.state);return n.length>=t?fae(e,n,t):null}var Ru=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Iu(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return Ta(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},dae=new Ml;function fae(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return pae(r,e,n)}function pae(e,t,n){for(let r=e;r;r=r.next){let e=hae(r.node);if(e)return e(_ae.create(t,n,r))}return 0}function mae(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function hae(e){let t=e.type.prop(dae);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Ml.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>bae(e,!0,1,void 0,n&&!mae(e)?t.from:void 0)}return e.parent==null?gae:null}function gae(){return 0}var _ae=class e extends Ru{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(vae(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return pae(this.context.next,this.base,this.pos)}};function vae(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function yae(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function bae(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?yae(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}Cu.meta,Cu.link,Cu.heading,Cu.emphasis,Cu.strong,Cu.strikethrough,Cu.keyword,Cu.atom,Cu.bool,Cu.url,Cu.contentSeparator,Cu.labelName,Cu.literal,Cu.inserted,Cu.string,Cu.deleted,Cu.regexp,Cu.escape,Cu.string,Cu.variableName,Cu.variableName,Cu.typeName,Cu.namespace,Cu.className,Cu.variableName,Cu.macroName,Cu.propertyName,Cu.comment,Cu.invalid;var xae=1e4,Sae=`()[]{}`,Cae=new Ml;function zu(e,t,n){let r=e.prop(t<0?Ml.openedBy:Ml.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function Bu(e){let t=e.type.prop(Cae);return t?t(e.node):e}function Vu(e,t,n,r={}){let i=r.maxScanDistance||xae,a=r.brackets||Sae,o=Du(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=zu(r.type,n,a);if(i&&r.from<r.to){let o=Bu(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return wae(e,t,n,r,o,i,a)}}return Tae(e,t,n,o,s.type,i,a)}function wae(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=Bu(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(zu(u.type,n,o))l++;else if(zu(u.type,-n,o)){if(l==0){let e=Bu(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function Tae(e,t,n,r,i,a,o){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var Eae=Object.create(null),Dae=[Pl.none],Oae=[],kae=Object.create(null),Aae=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])Aae[e]=jae(Eae,t);function Hu(e,t){Oae.indexOf(e)>-1||(Oae.push(e),console.warn(t))}function jae(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||Cu[n];r?typeof r==`function`?t.length?t=t.map(r):Hu(n,`Modifier ${n} used at start of tag`):t.length?Hu(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:Hu(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=kae[i];if(a)return a.id;let o=kae[i]=Pl.define({id:Dae.length,name:r,props:[su({[r]:n})]});return Dae.push(o),o.id}Do.RTL,Do.LTR;var Mae=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Wu(e.state,n.from);return r.line?Nae(e):r.block?Fae(e):!1};function Uu(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var Nae=Uu(zae,0),Pae=Uu(Rae,0),Fae=Uu((e,t)=>Rae(e,t,Lae(t)),0);function Wu(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var Gu=50;function Iae(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Gu,r),o=e.sliceDoc(i,i+Gu),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*Gu?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+Gu),d=e.sliceDoc(i-Gu,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function Lae(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function Rae(e,t,n=t.selection.ranges){let r=n.map(e=>Wu(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>Iae(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function zae(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Wu(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var Ku=$i.define(),Bae=$i.define(),Vae=Fi.define(),Hae=Fi.define({combine(e){return la(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Uae=Vi.define({create(){return $u.empty},update(e,t){let n=t.state.facet(Hae),r=t.annotation(Ku);if(r){let i=Yu.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Xu(o,o.length,n.minDepth,i):Qae(o,t.startState.selection),new $u(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(Bae);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(ta.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Yu.fromTransaction(t),o=t.annotation(ta.time),s=t.annotation(ta.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new $u(e.done.map(Yu.fromJSON),e.undone.map(Yu.fromJSON))}});function Wae(e={}){return[Uae,Hae.of(e),Yc.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?Gae:e.inputType==`historyRedo`?Ju:null;return n?(e.preventDefault(),n(t)):!1}})]}function qu(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Uae,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var Gae=qu(0,!1),Ju=qu(1,!1),Kae=qu(0,!0),qae=qu(1,!0),Yu=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&wi.fromJSON(t.changes),[],t.mapped&&Ci.fromJSON(t.mapped),t.startSelection&&Mi.fromJSON(t.startSelection),t.selectionsAfter.map(Mi.fromJSON))}static fromTransaction(t,n){let r=Zu;for(let e of t.startState.facet(Vae)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Zu)}static selection(t){return new e(void 0,Zu,void 0,void 0,t)}};function Xu(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Jae(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Yae(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function Xae(e,t){return e.length?t.length?e.concat(t):e:t}var Zu=[],Zae=200;function Qae(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Zae));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Xu(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Yu.selection([t])]}function $ae(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Qu(e,t){if(!e.length)return e;let n=e.length,r=Zu;for(;n;){let i=eoe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Yu.selection(r)]:Zu}function eoe(e,t,n){let r=Xae(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Zu,n);if(!e.changes)return Yu.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Yu(i,ea.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var toe=/^(input\.type|delete)($|\.)/,$u=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||toe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Jae(s.changes,t.changes))||r==`input.type.compose`)?Xu(o,o.length-1,i.minDepth,new Yu(t.changes.compose(s.changes),Xae(ea.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Zu)):Xu(o,o.length,i.minDepth,t),new e(o,Zu,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Zu;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Yae(a[a.length-1],t)?this:new e(Qae(this.done,t),this.undone,n,r)}addMapping(t){return new e(Qu(this.done,t),Qu(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Ku.of({side:e,rest:$ae(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Zu:r.slice(0,r.length-1);return i.mapped&&(n=Qu(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Ku.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};$u.empty=new $u(Zu,Zu);var noe=[{key:`Mod-z`,run:Gae,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Ju,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:Ju,preventDefault:!0},{key:`Mod-u`,run:Kae,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:qae,preventDefault:!0}];function ed(e,t){return Mi.create(e.ranges.map(t),e.mainIndex)}function td(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function nd({state:e,dispatch:t},n){let r=ed(e.selection,n);return r.eq(e.selection,!0)?!1:(t(td(e,r)),!0)}function rd(e,t){return Mi.cursor(t?e.to:e.from)}function id(e,t){return nd(e,n=>n.empty?e.moveByChar(n,t):rd(n,t))}function ad(e){return e.textDirectionAt(e.state.selection.main.head)==Do.LTR}var roe=e=>id(e,!ad(e)),od=e=>id(e,ad(e));function sd(e,t){return nd(e,n=>n.empty?e.moveByGroup(n,t):rd(n,t))}var ioe=e=>sd(e,!ad(e)),aoe=e=>sd(e,ad(e));typeof Intl<`u`&&Intl.Segmenter;function cd(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ld(e,t,n){let r=Du(e).resolveInner(t.head),i=n?Ml.closedBy:Ml.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;cd(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?Vu(e,r.from,1):Vu(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Mi.cursor(s,n?-1:1)}var ooe=e=>nd(e,t=>ld(e.state,t,!ad(e))),soe=e=>nd(e,t=>ld(e.state,t,ad(e)));function ud(e,t){return nd(e,n=>{if(!n.empty)return rd(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var dd=e=>ud(e,!1),fd=e=>ud(e,!0);function pd(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Yc.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function md(e,t){let n=pd(e),{state:r}=e,i=ed(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):rd(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=Yc.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(td(r,i),{effects:a}),!0}var coe=e=>md(e,!1),hd=e=>md(e,!0);function gd(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Mi.cursor(r.from+n))}return i}var loe=e=>nd(e,t=>gd(e,t,!0)),uoe=e=>nd(e,t=>gd(e,t,!1)),doe=e=>nd(e,t=>gd(e,t,!ad(e))),foe=e=>nd(e,t=>gd(e,t,ad(e))),poe=e=>nd(e,t=>Mi.cursor(e.lineBlockAt(t.head).from,1)),moe=e=>nd(e,t=>Mi.cursor(e.lineBlockAt(t.head).to,-1));function hoe(e,t,n){let r=!1,i=ed(e.selection,t=>{let i=Vu(e,t.head,-1)||Vu(e,t.head,1)||t.head>0&&Vu(e,t.head-1,1)||t.head<e.doc.length&&Vu(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Mi.range(t.anchor,a):Mi.cursor(a)});return r?(t(td(e,i)),!0):!1}var goe=({state:e,dispatch:t})=>hoe(e,t,!1);function _d(e,t){let n=ed(e.state.selection,e=>{let n=t(e);return Mi.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(td(e.state,n)),!0)}function vd(e,t){return _d(e,n=>e.moveByChar(n,t))}var _oe=e=>vd(e,!ad(e)),yd=e=>vd(e,ad(e));function bd(e,t){return _d(e,n=>e.moveByGroup(n,t))}var voe=e=>bd(e,!ad(e)),yoe=e=>bd(e,ad(e)),boe=e=>_d(e,t=>ld(e.state,t,!ad(e))),xd=e=>_d(e,t=>ld(e.state,t,ad(e)));function Sd(e,t){return _d(e,n=>e.moveVertically(n,t))}var Cd=e=>Sd(e,!1),wd=e=>Sd(e,!0);function Td(e,t){return _d(e,n=>e.moveVertically(n,t,pd(e).height))}var Ed=e=>Td(e,!1),xoe=e=>Td(e,!0),Soe=e=>_d(e,t=>gd(e,t,!0)),Coe=e=>_d(e,t=>gd(e,t,!1)),woe=e=>_d(e,t=>gd(e,t,!ad(e))),Toe=e=>_d(e,t=>gd(e,t,ad(e))),Eoe=e=>_d(e,t=>Mi.cursor(e.lineBlockAt(t.head).from)),Doe=e=>_d(e,t=>Mi.cursor(e.lineBlockAt(t.head).to)),Ooe=({state:e,dispatch:t})=>(t(td(e,{anchor:0})),!0),Dd=({state:e,dispatch:t})=>(t(td(e,{anchor:e.doc.length})),!0),Od=({state:e,dispatch:t})=>(t(td(e,{anchor:e.selection.main.anchor,head:0})),!0),kd=({state:e,dispatch:t})=>(t(td(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),koe=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),Aoe=({state:e,dispatch:t})=>{let n=zd(e).map(({from:t,to:n})=>Mi.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Mi.create(n),userEvent:`select`})),!0},joe=({state:e,dispatch:t})=>{let n=ed(e.selection,t=>{let n=Du(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Mi.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(td(e,n)),!0)};function Ad(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(td(n,Mi.create(i,i.length-1))),!0)}var Moe=e=>Ad(e,!1),Noe=e=>Ad(e,!0),Poe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Mi.create([n.main]):n.main.empty||(r=Mi.create([Mi.cursor(n.main.head)])),r?(t(td(e,r)),!0):!1};function jd(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Md(e,o,!1)):o>i&&(n=`delete.forward`,o=Md(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Md(e,i,!1),a=Md(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Mi.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?Yc.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Md(e,t,n){if(e instanceof Yc)for(let r of e.state.facet(Yc.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var Nd=(e,t,n)=>jd(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=Ta(s,a.tabSize)%Iu(a)||Iu(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=vi(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=vi(o.text,c-o.from,!1,!1)+o.from);return c}),Pd=e=>Nd(e,!1,!0),Fd=e=>Nd(e,!0,!1),Id=(e,t)=>jd(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=vi(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Ld=e=>Id(e,!1),Rd=e=>Id(e,!0),Foe=e=>jd(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Ioe=e=>jd(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Loe=e=>jd(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Roe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:fi.of([``,``])},range:Mi.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},zoe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:vi(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:vi(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Mi.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function zd(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Boe(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of zd(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Mi.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Mi.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Mi.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Voe=({state:e,dispatch:t})=>Boe(e,t,!1),Hoe=({state:e,dispatch:t})=>Boe(e,t,!0);function Bd(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of zd(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Uoe=({state:e,dispatch:t})=>Bd(e,t,!1),Woe=({state:e,dispatch:t})=>Bd(e,t,!0),Vd=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(zd(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=ed(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Hd(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Du(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Ml.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var Ud=Gd(!1),Wd=Gd(!0);function Gd(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Hd(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Ru(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=uae(s,r);for(c??=Ta(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Lu(t,c)];return o&&l.push(Lu(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:fi.of(l)},range:Mi.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function Kd(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Mi.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Goe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ru(e,{overrideIndentation:e=>n[e]??-1}),i=Kd(e,(t,i,a)=>{let o=uae(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Lu(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},Koe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Kd(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Fu)})}),{userEvent:`input.indent`})),!0),qd=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Kd(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=Ta(r,e.tabSize),a=0,o=Lu(e,Math.max(0,i-Iu(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),Jd=e=>(e.setTabFocusMode(),!0),Yd=[{key:`Ctrl-b`,run:roe,shift:_oe,preventDefault:!0},{key:`Ctrl-f`,run:od,shift:yd},{key:`Ctrl-p`,run:dd,shift:Cd},{key:`Ctrl-n`,run:fd,shift:wd},{key:`Ctrl-a`,run:poe,shift:Eoe},{key:`Ctrl-e`,run:moe,shift:Doe},{key:`Ctrl-d`,run:Fd},{key:`Ctrl-h`,run:Pd},{key:`Ctrl-k`,run:Foe},{key:`Ctrl-Alt-h`,run:Ld},{key:`Ctrl-o`,run:Roe},{key:`Ctrl-t`,run:zoe},{key:`Ctrl-v`,run:hd}],Xd=[{key:`ArrowLeft`,run:roe,shift:_oe,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:ioe,shift:voe,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:doe,shift:woe,preventDefault:!0},{key:`ArrowRight`,run:od,shift:yd,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:aoe,shift:yoe,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:foe,shift:Toe,preventDefault:!0},{key:`ArrowUp`,run:dd,shift:Cd,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Ooe,shift:Od},{mac:`Ctrl-ArrowUp`,run:coe,shift:Ed},{key:`ArrowDown`,run:fd,shift:wd,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Dd,shift:kd},{mac:`Ctrl-ArrowDown`,run:hd,shift:xoe},{key:`PageUp`,run:coe,shift:Ed},{key:`PageDown`,run:hd,shift:xoe},{key:`Home`,run:uoe,shift:Coe,preventDefault:!0},{key:`Mod-Home`,run:Ooe,shift:Od},{key:`End`,run:loe,shift:Soe,preventDefault:!0},{key:`Mod-End`,run:Dd,shift:kd},{key:`Enter`,run:Ud,shift:Ud},{key:`Mod-a`,run:koe},{key:`Backspace`,run:Pd,shift:Pd,preventDefault:!0},{key:`Delete`,run:Fd,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Ld,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Rd,preventDefault:!0},{mac:`Mod-Backspace`,run:Ioe,preventDefault:!0},{mac:`Mod-Delete`,run:Loe,preventDefault:!0}].concat(Yd.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Zd=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:ooe,shift:boe},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:soe,shift:xd},{key:`Alt-ArrowUp`,run:Voe},{key:`Shift-Alt-ArrowUp`,run:Uoe},{key:`Alt-ArrowDown`,run:Hoe},{key:`Shift-Alt-ArrowDown`,run:Woe},{key:`Mod-Alt-ArrowUp`,run:Moe},{key:`Mod-Alt-ArrowDown`,run:Noe},{key:`Escape`,run:Poe},{key:`Mod-Enter`,run:Wd},{key:`Alt-l`,mac:`Ctrl-l`,run:Aoe},{key:`Mod-i`,run:joe,preventDefault:!0},{key:`Mod-[`,run:qd},{key:`Mod-]`,run:Koe},{key:`Mod-Alt-\\`,run:Goe},{key:`Shift-Mod-k`,run:Vd},{key:`Shift-Mod-\\`,run:goe},{key:`Mod-/`,run:Mae},{key:`Alt-A`,run:Pae},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Jd}].concat(Xd),Qd=new Ml;function $d(e){return Fi.define({combine:e?t=>t.concat(e):void 0})}var qoe=new Ml,ef=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,ca.prototype.hasOwnProperty(`tree`)||Object.defineProperty(ca.prototype,`tree`,{get(){return nf(this)}}),this.parser=t,this.extension=[of.of(this),ca.languageData.of((e,t,n)=>{let r=tf(e,t,n),i=r.type.prop(Qd);if(!i)return[];let a=e.facet(i),o=r.type.prop(qoe);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return tf(e,t,n).type.prop(Qd)==this.data}findRegions(e){let t=e.facet(of);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(Qd)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(Ml.mounted);if(i){if(i.tree.prop(Qd)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Rl&&r(i,e.positions[n]+t)}};return r(nf(e),0),n}get allowsNesting(){return!0}};ef.setState=ea.define();function tf(e,t,n){let r=e.facet(of),i=nf(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,Ll.ExcludeBuffers|Ll.EnterBracketed))e.type.isTop&&(i=e);return i}var Joe=class e extends ef{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=$d(t.languageData);return new e(n,t.parser.configure({props:[Qd.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function nf(e){let t=e.field(ef.state,!1);return t?t.tree:Rl.empty}var Yoe=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},rf=null,Xoe=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],Rl.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Yoe(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Rl.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(nu.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(nu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rf;rf=this;try{return e()}finally{rf=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Zoe(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=nu.applyChanges(r,e),i=Rl.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=Zoe(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ru{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=rf;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new Rl(Pl.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return rf}};function Zoe(e,t,n){return nu.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var E=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=Xoe.create(t.facet(of).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};ef.state=Vi.define({create:E.init,update(e,t){for(let e of t.effects)if(e.is(ef.setState))return e.value;return t.startState.facet(of)==t.state.facet(of)?e.apply(t):E.init(t.state)}});var Qoe=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(Qoe=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var af=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,$oe=ss.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(ef.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(ef.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Qoe(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(ef.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!af?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>af&&af()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:ef.setState.of(new E(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>is(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),of=Fi.define({combine(e){return e.length?e[0]:null},enables:e=>[ef.state,$oe,Yc.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),ese=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},sf=new Ml;function tse({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var nse=new Ml,cf=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=Aa.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof ef?e=>e.prop(Qd)==a.data:a?e=>e==a:void 0,this.style=lu(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new Aa(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},lf=Fi.define(),uf=Fi.define({combine(e){return e.length?[e[0]]:null}});function df(e){let t=e.facet(lf);return t.length?t:e.facet(uf)}function ff(e,t){let n=[ise],r;return e instanceof cf&&(e.module&&n.push(Yc.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(uf.of(e)):r?n.push(lf.computeN([Yc.darkTheme],t=>t.facet(Yc.darkTheme)==(r==`dark`)?[e]:[])):n.push(lf.of(e)),n}var rse=class{constructor(e){this.markCache=Object.create(null),this.tree=nf(e.state),this.decorations=this.buildDeco(e,df(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=nf(e.state),n=df(e.state),r=n!=df(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return $a.none;let n=new ma;for(let{from:r,to:i}of e.visibleRanges)tae(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=$a.mark({class:r})))},r,i);return n.finish()}},ise=Wi.high(ss.fromClass(rse,{decorations:e=>e.decorations}));Cu.meta,Cu.link,Cu.heading,Cu.emphasis,Cu.strong,Cu.strikethrough,Cu.keyword,Cu.atom,Cu.bool,Cu.url,Cu.contentSeparator,Cu.labelName,Cu.literal,Cu.inserted,Cu.string,Cu.deleted,Cu.regexp,Cu.escape,Cu.string,Cu.variableName,Cu.variableName,Cu.typeName,Cu.namespace,Cu.className,Cu.variableName,Cu.macroName,Cu.propertyName,Cu.comment,Cu.invalid;var pf=Object.create(null),ase=[Pl.none],mf=[],hf=Object.create(null),gf=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])gf[e]=ose(pf,t);function _f(e,t){mf.indexOf(e)>-1||(mf.push(e),console.warn(t))}function ose(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||Cu[n];r?typeof r==`function`?t.length?t=t.map(r):_f(n,`Modifier ${n} used at start of tag`):t.length?_f(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:_f(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=hf[i];if(a)return a.id;let o=hf[i]=Pl.define({id:ase.length,name:r,props:[su({[r]:n})]});return ase.push(o),o.id}Do.RTL,Do.LTR;var vf=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new sse(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(r==0&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&e.buffer[r-4]==0&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new yf(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new sse(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},sse=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},yf=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3,this.state=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0)}},bf=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function xf(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var Sf=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Cf=new Sf,cse=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=Cf,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos);this.chunk=this.pos+e.length>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Cf,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},wf=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Tf(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};wf.prototype.contextual=wf.prototype.fallback=wf.prototype.extend=!1;var lse=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?xf(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(Tf(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};lse.prototype.contextual=wf.prototype.fallback=wf.prototype.extend=!1;var use=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function Tf(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||dse(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function Ef(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function dse(e,t,n,r){let i=Ef(n,r,t);return i<0||Ef(n,r,e)<i}var Df=typeof process<`u`&&/\bparse\b/.test({}.LOG),Of=null;function fse(e,t,n){let r=e.cursor(Ll.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var pse=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?fse(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?fse(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof Rl){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(Ml.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},kf=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new Sf)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new Sf,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Sf,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=Nf(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(Nf(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(Nf(o,s+1),t,n,r))}return r}},mse=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new cse(t,r),this.tokens=new kf(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[vf.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new pse(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&Pf(r);if(e)return Df&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw Df&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return Df&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=Df?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(Ml.contextHash)||0)==n))return e.useNode(o,r),Df&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof Rl)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof Rl&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),Df&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),Df&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Af(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=Df?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),Df&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(Df&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)Df&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))Df&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),Df&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),Af(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),Rl.build({buffer:bf.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Of||=new WeakMap).get(e);return t||Of.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Af(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var jf=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},Mf=class e extends ru{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=Ml[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new qie(t.map((t,i)=>Pl.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Wie;let a=xf(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(Ff),this.states=xf(e.states,Uint32Array),this.data=xf(e.stateData),this.goto=xf(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new wf(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new mse(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=Nf(n,i+2)];else if(n[i+1]==2)return Nf(n,i+2);else break;if(a==t||a==0)return Nf(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Nf(this.data,n+2);else break;r=t(Nf(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Nf(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=Ff(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new jf(e,n,r)}static deserialize(t){return new e(t)}};function Nf(e,t){return e[t]|e[t+1]<<16}function Pf(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function Ff(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var If=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Du(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(hse(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function Lf(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function Rf(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=Lf(t)+Lf(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function zf(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:Rf(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function Bf(e,t){return n=>{for(let t=Du(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var Vf=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function Hf(e){return e.selection.main.from}function hse(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var gse=$i.define();function _se(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:Mi.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var vse=new WeakMap;function yse(e){if(!Array.isArray(e))return e;let t=vse.get(e);return t||vse.set(e,t=zf(e)),t}var Uf=ea.define(),Wf=ea.define(),bse=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=yi(e,t),r=bi(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(yi(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=yi(e,0),i=bi(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=yi(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=bi(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=yi(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=ine(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=bi(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?bi(yi(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},xse=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},Gf=Fi.define({combine(e){return la(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Sse,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Kf(e(n),t(n)),optionClass:(e,t)=>n=>Kf(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Kf(e,t){return e?t?e+` `+t:e:t}function Sse(e,t,n,r,i,a){let o=e.textDirection==Do.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var qf=ea.define();function Jf(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function Yf(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var Xf=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(Gf);this.optionContent=Jf(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Yf(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:qf.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(Gf).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Wf.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=Yf(r.length,i,e.state.facet(Gf).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Yf(t.options.length,t.selected,this.view.state.facet(Gf).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>is(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&Zf(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(Gf).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function Cse(e,t){return n=>new Xf(n,e,t)}function Zf(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function Qf(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function wse(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(Gf);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new Vf(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new xse(n):new bse(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new Vf(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):Qf(e.completion)>Qf(c)&&(s[s.length-1]=e),c=e.completion}return s}var Tse=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,$f(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=wse(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(Gf).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,$f(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:Mse,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Ese=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(Ase,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Gf),i=(r.override||n.languageDataAt(`autocomplete`,Hf(n)).map(yse)).map(e=>(this.active.find(t=>t.source==e)||new tp(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(rp));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!Dse(i,this.active)||o?a=Tse.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new tp(e.source,0):e));for(let e of t.effects)e.is(qf)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Ose:kse}};function Dse(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var Ose={"aria-autocomplete":`list`},kse={};function $f(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var Ase=[];function ep(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(gse);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var tp=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=ep(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(Uf))i=new e(i.source,1,n.value);else if(n.is(Wf))i=new e(i.source,0);else if(n.is(rp))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Hf(e.state))}},np=class e extends tp{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=Hf(t.state);if(o>a||!r||n&2&&(Hf(t.startState)==this.from||o<this.limit))return new tp(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return jse(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new If(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??Hf(t.state)):new tp(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new tp(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function jse(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):hse(e,!0).test(i)}var rp=ea.define({map(e,t){return e.map(e=>e.map(t))}}),ip=Vi.define({create(){return Ese.start()},update(e,t){return e.update(t)},provide:e=>[dl.from(e,e=>e.tooltip),Yc.contentAttributes.from(e,e=>e.attrs)]});function ap(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(ip).active.find(e=>e.source==t.source);return r instanceof np?(typeof n==`string`?e.dispatch({..._se(e.state,n,r.from,r.to),annotations:gse.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var Mse=Cse(ip,ap);function op(e,t=`option`){return n=>{let r=n.state.field(ip,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Gf).interactionDelay)return!1;let i=1,a;t==`page`&&(a=kie(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:qf.of(s)}),!0}}var Nse=e=>{let t=e.state.field(ip,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Gf).interactionDelay?!1:ap(e,t.open.options[t.open.selected])},sp=e=>e.state.field(ip,!1)?(e.dispatch({effects:Uf.of(!0)}),!0):!1,cp=e=>{let t=e.state.field(ip,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:Wf.of(null)}),!0)},lp=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},up=50,dp=1e3,Pse=ss.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ip).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ip),n=e.state.facet(Gf);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ip)==t)return;let r=e.transactions.some(e=>{let t=ep(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>up&&Date.now()-n.time>dp){for(let e of n.context.abortListeners)try{e()}catch(e){is(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(Uf)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ip);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Gf).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new If(t,Hf(t),e.explicit,this.view),r=new lp(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:Wf.of(null)}),is(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Gf).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Gf),n=this.view.state.field(ip);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=Hf(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new np(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new tp(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:rp.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ip,!1);if(t&&t.tooltip&&this.view.state.facet(Gf).closeOnBlur){let n=t.open&&kie(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Wf.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Uf.of(!1)}),20),this.composing=0}}}),fp=typeof navigator==`object`&&/Win/.test(navigator.platform),Fse=Wi.highest(Yc.domEventHandlers({keydown(e,t){let n=t.state.field(ip,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(fp&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&ap(t,r),!1}})),Ise=Yc.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),pp=new class extends ua{};pp.startSide=1,pp.endSide=-1,typeof navigator==`object`&&navigator.userAgent;function mp(e={}){return[Fse,ip,Gf.of(e),Pse,Rse,Ise]}var Lse=[{key:`Ctrl-Space`,run:sp},{mac:"Alt-`",run:sp},{mac:`Alt-i`,run:sp},{key:`Escape`,run:cp},{key:`ArrowDown`,run:op(!0)},{key:`ArrowUp`,run:op(!1)},{key:`PageDown`,run:op(!0,`page`)},{key:`PageUp`,run:op(!1,`page`)},{key:`Enter`,run:Nse}],Rse=Wi.highest(el.computeN([Gf],e=>e.facet(Gf).defaultKeymap?[Lse]:[])),zse=36,hp=1,gp=2,_p=3,vp=4,Bse=5,yp=6,bp=7,xp=8,Vse=9,Hse=10,Use=11,Wse=12,Sp=13,Cp=14,Gse=15,Kse=16,qse=17,Jse=18,Yse=19,wp=20,Tp=21,Ep=22,Dp=23,Op=24;function kp(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ap(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function jp(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function Mp(e,t){scan:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue scan;e.advance()}if(e.next==36){e.advance();return}}else e.advance()}}function Np(e,t){let n=`[{<(`.indexOf(String.fromCharCode(t)),r=n<0?t:`]}>)`.charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function Pp(e,t){for(;!(e.next!=95&&!kp(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function Xse(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),jp(e,t,!1)}else Pp(e)}function Zse(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function Fp(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function Qse(e){for(;!(e.next<0||e.next==10);)e.advance()}function Ip(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}var Lp=` \r
12
- `;function $se(e,t,n){let r=Object.create(null);r.true=r.false=Bse,r.null=r.unknown=yp;for(let t of e.split(` `))t&&(r[t]=wp);for(let e of t.split(` `))e&&(r[e]=Tp);for(let e of(n||``).split(` `))e&&(r[e]=Op);return r}var Rp=`array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying `,zp=`absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone `,Bp={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:`*+-%<>!=&|~^/`,specialVar:`?`,identifierQuotes:`"`,caseInsensitiveIdentifiers:!1,words:$se(zp,Rp)};function ece(e,t,n,r){let i={};for(let t in Bp)i[t]=(e.hasOwnProperty(t)?e:Bp)[t];return t&&(i.words=$se(t,n||``,r)),i}function Vp(e){return new use(t=>{let{next:n}=t;if(t.advance(),Ip(n,Lp)){for(;Ip(t.next,Lp);)t.advance();t.acceptToken(zse)}else if(n==36&&e.doubleDollarQuotedStrings){let e=Pp(t,``);t.next==36&&(t.advance(),Mp(t,e),t.acceptToken(_p))}else if(n==39||n==34&&e.doubleQuotedStrings)jp(t,n,e.backslashEscapes),t.acceptToken(_p);else if(n==35&&e.hashComments||n==47&&t.next==47&&e.slashComments)Qse(t),t.acceptToken(hp);else if(n==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))Qse(t),t.acceptToken(hp);else if(n==47&&t.next==42){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),n==42&&t.next==47){if(e--,t.advance(),!e)break}else n==47&&t.next==42&&(e++,t.advance())}t.acceptToken(gp)}else if((n==101||n==69)&&t.next==39)t.advance(),jp(t,39,!0),t.acceptToken(_p);else if((n==110||n==78)&&t.next==39&&e.charSetCasts)t.advance(),jp(t,39,e.backslashEscapes),t.acceptToken(_p);else if(n==95&&e.charSetCasts)for(let n=0;;n++){if(t.next==39&&n>1){t.advance(),jp(t,39,e.backslashEscapes),t.acceptToken(_p);break}if(!kp(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(n==113||n==81)&&t.next==39&&t.peek(1)>0&&!Ip(t.peek(1),Lp)){let e=t.peek(1);t.advance(2),Np(t,e),t.acceptToken(_p)}else if(Ip(n,e.identifierQuotes))jp(t,n==91?93:n,!1),t.acceptToken(Yse);else if(n==40)t.acceptToken(bp);else if(n==41)t.acceptToken(xp);else if(n==123)t.acceptToken(Vse);else if(n==125)t.acceptToken(Hse);else if(n==91)t.acceptToken(Use);else if(n==93)t.acceptToken(Wse);else if(n==59)t.acceptToken(Sp);else if(e.unquotedBitLiterals&&n==48&&t.next==98)t.advance(),Zse(t),t.acceptToken(Ep);else if((n==98||n==66)&&(t.next==39||t.next==34)){let n=t.next;t.advance(),e.treatBitsAsBytes?(jp(t,n,e.backslashEscapes),t.acceptToken(Dp)):(Zse(t,n),t.acceptToken(Ep))}else if(n==48&&(t.next==120||t.next==88)||(n==120||n==88)&&t.next==39){let e=t.next==39;for(t.advance();Ap(t.next);)t.advance();e&&t.next==39&&t.advance(),t.acceptToken(vp)}else if(n==46&&t.next>=48&&t.next<=57)Fp(t,!0),t.acceptToken(vp);else if(n==46)t.acceptToken(Cp);else if(n>=48&&n<=57)Fp(t,!1),t.acceptToken(vp);else if(Ip(n,e.operatorChars)){for(;Ip(t.next,e.operatorChars);)t.advance();t.acceptToken(Gse)}else if(Ip(n,e.specialVar))t.next==n&&t.advance(),Xse(t),t.acceptToken(qse);else if(n==58||n==44)t.acceptToken(Kse);else if(kp(n)){let r=Pp(t,String.fromCharCode(n));t.acceptToken(t.next==46||t.peek(-r.length-1)==46?Jse:e.words[r.toLowerCase()]??Jse)}})}var Hp=Vp(Bp),Up=Mf.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:`⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement`,maxTerm:38,nodeProps:[[`isolate`,-4,1,2,3,19,``]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:`RORO`,tokenizers:[0,Hp],topRules:{Script:[0,25]},tokenPrec:0});function Wp(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function Gp(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function Kp(e){return e&&(e.name==`Identifier`||e.name==`QuotedIdentifier`)}function qp(e,t){if(t.name==`CompositeIdentifier`){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)Kp(r)&&n.push(Gp(e,r));return n}return[Gp(e,t)]}function Jp(e,t){for(let n=[];;){if(!t||t.name!=`.`)return n;let r=Wp(t);if(!Kp(r))return n;n.unshift(Gp(e,r)),t=Wp(r)}}function tce(e,t){let n=nf(e).resolveInner(t,-1),r=Xp(e.doc,n);return n.name==`Identifier`||n.name==`QuotedIdentifier`||n.name==`Keyword`?{from:n.from,quoted:n.name==`QuotedIdentifier`?e.doc.sliceString(n.from,n.from+1):null,parents:Jp(e.doc,Wp(n)),aliases:r}:n.name==`.`?{from:t,quoted:null,parents:Jp(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}var Yp=new Set(`where group having order union intersect except all distinct limit offset fetch for`.split(` `));function Xp(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;e.name==`Statement`&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,a=null;t;t=t.nextSibling){let n=t.name==`Keyword`?e.sliceString(t.from,t.to).toLowerCase():null,o=null;if(!i)i=n==`from`;else if(n==`as`&&a&&Kp(t.nextSibling))o=Gp(e,t.nextSibling);else if(n&&Yp.has(n))break;else a&&Kp(t)&&(o=Gp(e,t));o&&(r||=Object.create(null),r[o]=qp(e,a)),a=/Identifier$/.test(t.name)?t:null}return r}function nce(e,t,n){return n.map(n=>({...n,label:n.label[0]==e?n.label:e+n.label+t,apply:void 0}))}var Zp=/^\w*$/,Qp=/^[`'"\[]?\w*[`'"\]]?$/;function $p(e){return e.self&&typeof e.self.label==`string`}var em=class e{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(t){let n=this.children||=Object.create(null);return n[t]||(t&&!this.list.some(e=>e.label==t)&&this.list.push(rce(t,`type`,this.idQuote,this.idCaseInsensitive)),n[t]=new e(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion(typeof t==`string`?rce(t,`property`,this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):$p(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>e==`.`?`\0`:e).split(`\0`),a=this;$p(n)&&(r=n.self,n=n.children);for(let e=0;e<i.length;e++)r&&e==i.length-1&&a.addCompletion(r),a=a.child(i[e].replace(/\\\./g,`.`));a.addNamespace(n)}}};function rce(e,t,n,r){return RegExp(`^[a-z_][a-z_\\d]*$`,r?`i`:``).test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+tm(n)}}function tm(e){return e===`[`?`]`:e}function nm(e,t,n,r,i,a){let o=new em(a?.spec.identifierQuotes?.[0]||`"`,!!a?.spec.caseInsensitiveIdentifiers),s=i?o.child(i):null;return o.addNamespace(e),t&&(s||o).addCompletions(t),n&&o.addCompletions(n),s&&o.addCompletions(s.list),r&&o.addCompletions((s||o).child(r).list),e=>{let{parents:t,from:n,quoted:i,empty:a,aliases:c}=tce(e.state,e.pos);if(a&&!e.explicit)return null;c&&t.length==1&&(t=c[t[0]]||t);let l=o;for(let e of t){for(;!l.children||!l.children[e];)if(l==o&&s)l=s;else if(l==s&&r)l=l.child(r);else return null;let t=l.maybeChild(e);if(!t)return null;l=t}let u=l.list;if(l==o&&c&&(u=u.concat(Object.keys(c).map(e=>({label:e,type:`constant`})))),i){let t=i[0],r=tm(t);return{from:n,to:e.state.sliceDoc(e.pos,e.pos+1)==r?e.pos+1:void 0,options:nce(t,r,u),validFor:Qp}}else return{from:n,options:u,validFor:Zp}}}function rm(e){return e==Tp?`type`:e==wp?`keyword`:`variable`}function im(e,t,n){return Bf([`QuotedIdentifier`,`String`,`LineComment`,`BlockComment`,`.`],zf(Object.keys(e).map(r=>n(t?r.toUpperCase():r,rm(e[r])))))}var ice=Up.configure({props:[sf.add({Statement:tse()}),nse.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),su({Keyword:Cu.keyword,Type:Cu.typeName,Builtin:Cu.standard(Cu.name),Bits:Cu.number,Bytes:Cu.string,Bool:Cu.bool,Null:Cu.null,Number:Cu.number,String:Cu.string,Identifier:Cu.name,QuotedIdentifier:Cu.special(Cu.string),SpecialVar:Cu.special(Cu.name),LineComment:Cu.lineComment,BlockComment:Cu.blockComment,Operator:Cu.operator,"Semi Punctuation":Cu.punctuation,"( )":Cu.paren,"{ }":Cu.brace,"[ ]":Cu.squareBracket})]}),am=class e{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(t,n){return new e(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=ece(t,t.keywords,t.types,t.builtin);return new e(n,Joe.define({name:`sql`,parser:ice.configure({tokenizers:[{from:Hp,to:Vp(n)}]}),languageData:{commentTokens:{line:`--`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}}),t)}};function ace(e,t){return{label:e,type:t,boost:-1}}function oce(e,t=!1,n){return im(e.dialect.words,t,n||ace)}function om(e){return e.schema?nm(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||cm):()=>null}function sm(e){return e.schema?(e.dialect||cm).language.data.of({autocomplete:om(e)}):[]}function D(e={}){let t=e.dialect||cm;return new ese(t.language,[sm(e),t.language.data.of({autocomplete:oce(t,e.upperCaseKeywords,e.keywordCompletion)})])}var cm=am.define({});zp+``,Rp+``,Rp+``,zp+``,zp+``,zp+``,Rp+``,zp+``,Rp+``,Rp+``,zp+``,Rp+``;var lm=`#e5c07b`,sce=`#e06c75`,um=`#56b6c2`,dm=`#ffffff`,fm=`#abb2bf`,pm=`#7d8799`,mm=`#61afef`,hm=`#98c379`,gm=`#d19a66`,_m=`#c678dd`,cce=`#21252b`,vm=`#2c313a`,ym=`#282c34`,bm=`#353a42`,lce=`#3E4451`,uce=`#528bff`,xm=[Yc.theme({"&":{color:fm,backgroundColor:ym},".cm-content":{caretColor:uce},".cm-cursor, .cm-dropCursor":{borderLeftColor:uce},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:lce},".cm-panels":{backgroundColor:cce,color:fm},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:ym,color:pm,border:`none`},".cm-activeLineGutter":{backgroundColor:vm},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:bm},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bm,borderBottomColor:bm},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:vm,color:fm}}},{dark:!0}),ff(cf.define([{tag:Cu.keyword,color:_m},{tag:[Cu.name,Cu.deleted,Cu.character,Cu.propertyName,Cu.macroName],color:sce},{tag:[Cu.function(Cu.variableName),Cu.labelName],color:mm},{tag:[Cu.color,Cu.constant(Cu.name),Cu.standard(Cu.name)],color:gm},{tag:[Cu.definition(Cu.name),Cu.separator],color:fm},{tag:[Cu.typeName,Cu.className,Cu.number,Cu.changed,Cu.annotation,Cu.modifier,Cu.self,Cu.namespace],color:lm},{tag:[Cu.operator,Cu.operatorKeyword,Cu.url,Cu.escape,Cu.regexp,Cu.link,Cu.special(Cu.string)],color:um},{tag:[Cu.meta,Cu.comment],color:pm},{tag:Cu.strong,fontWeight:`bold`},{tag:Cu.emphasis,fontStyle:`italic`},{tag:Cu.strikethrough,textDecoration:`line-through`},{tag:Cu.link,color:pm,textDecoration:`underline`},{tag:Cu.heading,fontWeight:`bold`,color:sce},{tag:[Cu.atom,Cu.bool,Cu.special(Cu.variableName)],color:gm},{tag:[Cu.processingInstruction,Cu.string,Cu.inserted],color:hm},{tag:Cu.invalid,color:dm}]))],Sm=Mf.deserialize({version:14,states:`&fQVQPOOOkQPO'#ClO!SQPO'#C^OOQO'#Co'#CoOOQO'#Cw'#CwOOQO'#Cp'#CpQVQPOOO!_QPO,59WOOQO'#Cy'#CyOOQO'#Cr'#CrO!xQPO'#CjOOQO'#Cq'#CqO!VQPO,58xOOQO'#Cc'#CcO#PQPO'#CbO#UQPO,58xO!VQPO,58xOOQO-E6n-E6nOOQO1G.r1G.rOOQO-E6p-E6pOOQO-E6o-E6oO#pQPO1G.dO$[QPO,58|O!VQPO'#CsO#pQPO1G.dO!VQPO1G.dO$gQPO7+$OO%RQPO'#CfOOQO'#Cf'#CfOkQPO'#CiOOQO1G.h1G.hO$bQPO1G.hO!VQPO,59_OOQO,59_,59_OOQO-E6q-E6qO$gQPO7+$OOOQO,59Q,59QO%WQPO,59TOOQO7+$S7+$SOOQO1G.y1G.yO%]QPO<<GjOOQO1G.o1G.o`,stateData:"&R~OjOS~ORQOTROWRO_ROaROlPO~OTWOWWO_WOaWObWOlPOn^P~OS`OTZOW]O~OnbO~OTWOWWO_WOaWObWOlPO~On^X~P!dOXfO~ObgORQaTQaWQa_QaaQahQalQa~ObgORQiTQiWQi_QiaQihQilQi~OZkO[lOlmO~ObgORQqTQqWQq_QqaQqhQqlQq~O[tO~OnyO~ObgORQyTQyWQy_QyaQyhQylQy~OR_STaZX[W~",goto:"#ynPPoPPPs!TPP!]PP!`!fP!lPPo!u!{#Z#bPPP#pP#tTSOUQ_QSe[`QqgQsiRwp]^Q[`gipRofQnfRvoQVPRumSROUVWPYmQUORaUQ[QUd[ipQi`RpgSYPmRcYQh_QjeUrhjxRxsTTOUVXPYm",nodeNames:`⚠ Query WithClause With Recursive Comment CTEDef CTEName Word As NotMaterialized Not Materialized CTEBody ParenContent String Paren Punct Comma Token`,maxTerm:30,skippedNodes:[0],repeatNodeCount:4,tokenData:"9Q~RyOX#rXY#wYZ#wZ]#r]^#w^p#rpq#wqw#rwx$Yxy$zyz%Pz|#r|}%U}!O%Z!O!P#r!P!Q%z![!c#r!c!d'T!d!o'r!o!p(h!p!q/f!q!t'r!t!u1V!u!y'r!y!z6l!z!}'r!}#R#r#R#S'r#S#T#r#T#U'T#U#a'r#a#b(h#b#c/f#c#f'r#f#g1V#g#k'r#k#l6l#l#o'r#o;'S#r;'S;=`8z<%lO#r~#wOa~~#|Sj~XY#wYZ#w]^#wpq#w~$]TOw$Ywx$lx;'S$Y;'S;=`$t<%lO$Y~$qP_~wx$Y~$wP;=`<%l$Y~%POl~~%UOn~~%ZOb~~%`Pa~}!O%c~%hST~OY%cZ;'S%c;'S;=`%t<%lO%c~%wP;=`<%l%c~&PPa~z{&S~&VTOz&Sz{&f{;'S&S;'S;=`&}<%lO&S~&iTO!P&S!P!Q&x!Q;'S&S;'S;=`&}<%lO&S~&}OT~~'QP;=`<%l&S~'YWW~!Q!['r!c!u'r!u!v(T!v!}'r#R#S'r#T#g'r#g#h(T#h#o'r~'wSW~!Q!['r!c!}'r#R#S'r#T#o'r~([SX~W~!Q!['r!c!}'r#R#S'r#T#o'r~(mUW~!Q!['r!c!d)P!d!}'r#R#S'r#T#U)P#U#o'r~)UWW~!Q!['r!c!v'r!v!w)n!w!}'r#R#S'r#T#h'r#h#i)n#i#o'r~)sWW~!Q!['r!c!g'r!g!h*]!h!}'r#R#S'r#T#X'r#X#Y*]#Y#o'r~*bWW~!Q!['r!c!t'r!t!u*z!u!}'r#R#S'r#T#f'r#f#g*z#g#o'r~+PWW~!Q!['r!c!k'r!k!l+i!l!}'r#R#S'r#T#]'r#]#^+i#^#o'r~+nUW~!Q!['r!c!d,Q!d!}'r#R#S'r#T#U,Q#U#o'r~,VWW~!Q!['r!c!n'r!n!o,o!o!}'r#R#S'r#T#`'r#`#a,o#a#o'r~,tWW~!Q!['r!c!k'r!k!l-^!l!}'r#R#S'r#T#]'r#]#^-^#^#o'r~-cUW~!Q!['r!c!|'r!|!}-u#R#S'r#T#n'r#n#o-u~-zWW~!Q!['r!c!g'r!g!h.d!h!}'r#R#S'r#T#X'r#X#Y.d#Y#o'r~.iWW~!Q!['r!c!f'r!f!g/R!g!}'r#R#S'r#T#W'r#W#X/R#X#o'r~/YS[~W~!Q!['r!c!}'r#R#S'r#T#o'r~/kWW~!Q!['r!c!q'r!q!r0T!r!}'r#R#S'r#T#c'r#c#d0T#d#o'r~0YWW~!Q!['r!c!v'r!v!w0r!w!}'r#R#S'r#T#h'r#h#i0r#i#o'r~0ySZ~W~!Q!['r!c!}'r#R#S'r#T#o'r~1[WW~!Q!['r!c!g'r!g!h1t!h!}'r#R#S'r#T#X'r#X#Y1t#Y#o'r~1yWW~!Q!['r!c!e'r!e!f2c!f!}'r#R#S'r#T#V'r#V#W2c#W#o'r~2hWW~!Q!['r!c!w'r!w!x3Q!x!}'r#R#S'r#T#i'r#i#j3Q#j#o'r~3VWW~!Q!['r!c!t'r!t!u3o!u!}'r#R#S'r#T#f'r#f#g3o#g#o'r~3tWW~!Q!['r!c!u'r!u!v4^!v!}'r#R#S'r#T#g'r#g#h4^#h#o'r~4cWW~!Q!['r!c!k'r!k!l4{!l!}'r#R#S'r#T#]'r#]#^4{#^#o'r~5QWW~!Q!['r!c!x'r!x!y5j!y!}'r#R#S'r#T#j'r#j#k5j#k#o'r~5oWW~!Q!['r!c!g'r!g!h6X!h!}'r#R#S'r#T#X'r#X#Y6X#Y#o'r~6`SS~W~!Q!['r!c!}'r#R#S'r#T#o'r~6qWW~!Q!['r!c!k'r!k!l7Z!l!}'r#R#S'r#T#]'r#]#^7Z#^#o'r~7`WW~!Q!['r!c!v'r!v!w7x!w!}'r#R#S'r#T#h'r#h#i7x#i#o'r~7}WW~!Q!['r!c!j'r!j!k8g!k!}'r#R#S'r#T#['r#[#]8g#]#o'r~8nSR~W~!Q!['r!c!}'r#R#S'r#T#o'r~8}P;=`<%l#r",tokenizers:[0],topRules:{Query:[0,1]},tokenPrec:223});function Cm(e,t){let n=[],r=e.firstChild;for(;r;)r.name===t&&n.push(r),r=r.nextSibling;return n}function wm(e,t){let n=e.firstChild;for(;n;){if(n.name===t)return n;n=n.nextSibling}return null}function Tm(e,t){return wm(e,t)!==null}function Em(e,t){return e.slice(t.from,t.to)}function Dm(e){let t=Sm.parse(e),n=[],r=!1,i=0,a=t.cursor();if(a.firstChild())do if(a.name===`WithClause`){let t=a.node;t.to,r=Tm(t,`Recursive`);let o=Cm(t,`CTEDef`);for(let t of o){let r=wm(t,`CTEName`),i=wm(t,`CTEBody`);if(r&&i){let a=Em(e,r),o=Em(e,i).slice(1,-1).trim();n.push({name:a,body:o,start:t.from,end:t.to})}}i=t.to;break}while(a.nextSibling());return n.length===0?{recursive:!1,ctes:[],mainQuery:e.trim(),mainQueryStart:0}:{recursive:r,ctes:n,mainQuery:e.slice(i).trim(),mainQueryStart:i}}function Om(e){let t=new Map,n=new Set(e.map(e=>e.name.toLowerCase()));for(let r of e){let i=[];for(let t of n)if(t!==r.name.toLowerCase()&&RegExp(`\\b${t}\\b`,`i`).test(r.body)){let n=e.find(e=>e.name.toLowerCase()===t)?.name;n&&i.push(n)}t.set(r.name,i)}return t}var km=Object.create,Am=Object.defineProperty,jm=Object.getOwnPropertyDescriptor,dce=Object.getOwnPropertyNames,fce=Object.getPrototypeOf,pce=Object.prototype.hasOwnProperty,Mm=(e,t)=>function(){return t||(0,e[dce(e)[0]])((t={exports:{}}).exports,t),t.exports},mce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=dce(t),a=0,o=i.length,s;a<o;a++)s=i[a],!pce.call(e,s)&&s!==n&&Am(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=jm(t,s))||r.enumerable});return e},Nm=(e,t,n)=>(n=e==null?{}:km(fce(e)),mce(t||!e||!e.__esModule?Am(n,`default`,{value:e,enumerable:!0}):n,e)),Pm=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),O=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Pm().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),hce=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Pm().default,r=O();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Fm=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=hce();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Im=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Fm();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});function Lm(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1;function o(){if(n===null){a=!0;return}i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),o())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),o())}}),a&&o(),{unsubscribe:o}},pipe(...e){return e.reduce(gce,t)}};return t}function gce(e,t){return t(e)}function _ce(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}function vce(e){return e=>{let t=0,n=null,r=[];function i(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function a(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return Lm(e=>(t++,r.push(e),i(),{unsubscribe(){t--,a();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function Rm(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},i=e=>{n.splice(n.indexOf(e),1)},a=Lm(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},a.get=()=>t,a}function zm(e){return Lm(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}function Bm(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function Vm(){return Object.create(null)}var Hm={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};Hm.BAD_GATEWAY,Hm.SERVICE_UNAVAILABLE,Hm.GATEWAY_TIMEOUT,Hm.INTERNAL_SERVER_ERROR;var Um=Object.create,yce=Object.defineProperty,bce=Object.getOwnPropertyDescriptor,Wm=Object.getOwnPropertyNames,xce=Object.getPrototypeOf,Sce=Object.prototype.hasOwnProperty,Gm=(e,t)=>function(){return t||(0,e[Wm(e)[0]])((t={exports:{}}).exports,t),t.exports},Cce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Wm(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Sce.call(e,s)&&s!==n&&yce(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=bce(t,s))||r.enumerable});return e},Km=(e,t,n)=>(n=e==null?{}:Um(xce(e)),Cce(t||!e||!e.__esModule?yce(n,`default`,{value:e,enumerable:!0}):n,e)),qm=()=>{},Jm=e=>{Object.freeze&&Object.freeze(e)};function Ym(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(qm,{get(r,i){if(!(typeof i!=`string`||i===`then`))return Ym(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1],o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),Jm(o.args),Jm(o.path),e(o)}})),n[r]}var Xm=e=>Ym(e,[],Vm()),Zm=e=>new Proxy(qm,{get(t,n){if(n!==`then`)return e(n)}}),Qm=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),$m=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Qm().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),eh=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Qm().default,r=$m();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),th=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=eh();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),nh=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=th();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});Km(nh(),1),Km(th(),1);var rh=Km(nh(),1);function ih(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:(0,rh.default)((0,rh.default)({},e),{},{error:n})}}return{ok:!0,result:(0,rh.default)((0,rh.default)({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var ah=class extends Error{constructor(){super(`Unable to transform response from server`)}};function oh(e,t){let n;try{n=ih(e,t)}catch{throw new ah}if(!n.ok&&(!Bm(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!Bm(n.result))throw new ah;return n}Km(nh(),1);var sh=Nm(Fm(),1),ch=Nm(Im(),1);function lh(e){return e instanceof fh}function uh(e){return Bm(e)&&Bm(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function dh(e,t){return typeof e==`string`?e:Bm(e)&&typeof e.message==`string`?e.message:t}var fh=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),(0,sh.default)(this,`cause`,void 0),(0,sh.default)(this,`shape`,void 0),(0,sh.default)(this,`data`,void 0),(0,sh.default)(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return lh(r)?(n.meta&&(r.meta=(0,ch.default)((0,ch.default)({},r.meta),n.meta)),r):uh(r)?new e(r.error.message,(0,ch.default)((0,ch.default)({},n),{},{result:r,cause:n.cause})):new e(dh(r,`Unknown error`),(0,ch.default)((0,ch.default)({},n),{},{cause:r}))}};function wce(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var Tce=e=>typeof e==`function`;function Ece(e){if(e)return e;if(typeof window<`u`&&Tce(window.fetch))return window.fetch;if(typeof globalThis<`u`&&Tce(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}var ph=Nm(Im(),1);function Dce(e){return{url:e.url.toString(),fetch:e.fetch,transformer:wce(e.transformer),methodOverride:e.methodOverride}}function Oce(e){let t={};for(let n=0;n<e.length;n++)t[n]=e[n];return t}var kce={query:`GET`,mutation:`POST`,subscription:`PATCH`};function mh(e){return`input`in e?e.transformer.input.serialize(e.input):Oce(e.inputs.map(t=>e.transformer.input.serialize(t)))}var Ace=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=mh(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},hh=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=mh(e);return t===void 0?void 0:JSON.stringify(t)},gh=e=>Nce((0,ph.default)((0,ph.default)({},e),{},{contentTypeHeader:`application/json`,getUrl:Ace,getBody:hh})),_h=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},jce=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new _h};async function Mce(e){jce(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??kce[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=(0,ph.default)((0,ph.default)((0,ph.default)({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return Ece(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:a})}async function Nce(e){let t={},n=await Mce(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}Nm(Im(),1);var vh=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function yh(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let o=t[r];if(!o)break;let s=n[n.length-1];if(o.aborted){var i;(i=o.reject)==null||i.call(o,Error(`Aborted`)),r++;continue}if(e.validate(s.concat(o).map(e=>e.key))){s.push(o),r++;continue}if(s.length===0){var a;(a=o.reject)==null||a.call(o,Error(`Input is too big for a single dispatch`)),r++;continue}n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:vh,reject:vh},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}function bh(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}var xh=Nm(Im(),1);function Sh(e){let t=Dce(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return Ace((0,xh.default)((0,xh.default)({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=bh(...n.map(e=>e.signal)),s=await gh((0,xh.default)((0,xh.default)({},t),{},{path:r,inputs:a,type:i,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}},signal:o}));return(Array.isArray(s.json)?s.json:n.map(()=>s.json)).map(e=>({meta:s.meta,json:e}))}}),a={query:yh(i(`query`)),mutation:yh(i(`mutation`))};return({op:e})=>Lm(n=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r=a[e.type].load(e),i;return r.then(e=>{i=e;let r=oh(e.json,t.transformer.output);if(!r.ok){n.error(fh.from(r.error,{meta:e.meta}));return}n.next({context:e.meta,result:r.result}),n.complete()}).catch(e=>{n.error(fh.from(e,{meta:i?.meta}))}),()=>{}})}}Nm(Im(),1);var Ch=(e,...t)=>typeof e==`function`?e(...t):e;Nm(Fm(),1);function Pce(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Fce(e){let t=await Ch(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function Ice(e,t){let n={method:`connectionParams`,data:await Ch(e)};return t.encode(n)}Nm(Fm(),1);var wh=Nm(Fm(),1);function Lce(e){let{promise:t,resolve:n,reject:r}=Pce();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function Th(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}var Eh=class e{constructor(t){if((0,wh.default)(this,`id`,++e.connectCount),(0,wh.default)(this,`WebSocketPonyfill`,void 0),(0,wh.default)(this,`urlOptions`,void 0),(0,wh.default)(this,`keepAliveOpts`,void 0),(0,wh.default)(this,`encoder`,void 0),(0,wh.default)(this,`wsObservable`,Rm(null)),(0,wh.default)(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++e.connectCount,t.openPromise=Fce(t.urlOptions).then(e=>new t.WebSocketPonyfill(e)).then(async e=>{t.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),t.keepAliveOpts.enabled&&Th(e,t.keepAliveOpts),e.addEventListener(`close`,()=>{t.ws===e&&(t.ws=null)}),await Lce(e),t.urlOptions.connectionParams&&e.send(await Ice(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)==null||t.close()}}};(0,wh.default)(Eh,`connectCount`,0),Nm(Fm(),1),Nm(Im(),1);var Dh=Nm(Fm(),1),Oh=Nm(Im(),1),kh=class{constructor(e){(0,Dh.default)(this,`links`,void 0),(0,Dh.default)(this,`runtime`,void 0),(0,Dh.default)(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return zm({links:this.links,op:(0,Oh.default)((0,Oh.default)({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(vce())}async requestAsPromise(e){var t=this;try{return(await _ce(t.$request(e))).result.data}catch(e){throw fh.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data);break}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},Ah=Symbol.for(`trpc_untypedClient`),Rce={query:`query`,mutate:`mutation`,subscribe:`subscription`},zce=e=>Rce[e];function Bce(e){let t=Xm(({path:t,args:n})=>{let r=[...t],i=zce(r.pop()),a=r.join(`.`);return e[i](a,...n)});return Zm(n=>n===Ah?e:t[n])}function Vce(e){return Bce(new kh(e))}Nm(Im(),1),Nm(Im(),1),Nm(Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),Nm(Im(),1);var Hce=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),jh=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(e,t){this.v=e,this.k=t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Mh=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=jh();function r(e){return new n(e,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Nh=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=jh();function r(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,c=s instanceof n;Promise.resolve(c?s.v:s).then(function(n){if(c){var r=t===`return`?`return`:`next`;if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?`return`:`normal`,n)},function(e){i(`throw`,e)})}catch(e){a(`throw`,e)}}function a(e,n){switch(e){case`return`:t.resolve({value:n,done:!0});break;case`throw`:t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise(function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))})},typeof e.return!=`function`&&(this.return=void 0)}i.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},i.prototype.next=function(e){return this._invoke(`next`,e)},i.prototype.throw=function(e){return this._invoke(`throw`,e)},i.prototype.return=function(e){return this._invoke(`return`,e)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});Nm(Hce(),1),Nm(Mh(),1),Nm(Nh(),1),Nm(Im(),1);var Ph=Vce({links:[Sh({url:`/trpc`})]}),Fh=new class{#e=Wt(null);get message(){return w(this.#e)}set message(e){Gt(this.#e,e,!0)}#t=Wt(`info`);get level(){return w(this.#t)}set level(e){Gt(this.#t,e,!0)}timer=null;show(e,t=`info`,n=0){this.timer&&clearTimeout(this.timer),this.message=e,this.level=t,n>0&&(this.timer=setTimeout(()=>this.clear(),n))}error(e){this.show(e,`error`)}warn(e){this.show(e,`warning`,5e3)}info(e){this.show(e,`info`,3e3)}clear(){this.timer&&=(clearTimeout(this.timer),null),this.message=null}};function Uce(e){if(e instanceof TypeError&&e.message===`Failed to fetch`)return`Server not reachable. Is the IDE server running?`;if(e instanceof Error){let t=e.message;try{let e=JSON.parse(t);if(Array.isArray(e))return e[0]?.message||t;if(e.message)return e.message}catch{}return t}return`Unknown error`}var Ih=new class{#e=Wt(``);get sql(){return w(this.#e)}set sql(e){Gt(this.#e,e,!0)}#t=It(()=>{try{return Dm(this.sql)}catch(e){return console.error(`Parse error:`,e),null}});get parsed(){return w(this.#t)}set parsed(e){Gt(this.#t,e)}#n=It(()=>this.parsed?Om(this.parsed.ctes):new Map);get dependencies(){return w(this.#n)}set dependencies(e){Gt(this.#n,e)}#r=It(()=>this.parsed!=null&&this.parsed.ctes.length>0);get hasCTEs(){return w(this.#r)}set hasCTEs(e){Gt(this.#r,e)}#i=Wt(Jt([]));get annotations(){return w(this.#i)}set annotations(e){Gt(this.#i,e,!0)}setAnnotations(e){this.annotations=e}#a=Wt(Jt(new Map));get nodeStates(){return w(this.#a)}set nodeStates(e){Gt(this.#a,e,!0)}#o=Wt(null);get selectedCTE(){return w(this.#o)}set selectedCTE(e){Gt(this.#o,e,!0)}#s=Wt(null);get result(){return w(this.#s)}set result(e){Gt(this.#s,e,!0)}#c=Wt(null);get error(){return w(this.#c)}set error(e){Gt(this.#c,e,!0)}#l=Wt(!1);get isLoading(){return w(this.#l)}set isLoading(e){Gt(this.#l,e,!0)}#u=Wt(!1);get isPreviewLoading(){return w(this.#u)}set isPreviewLoading(e){Gt(this.#u,e,!0)}#d=Wt(null);get selectedQuerySQL(){return w(this.#d)}set selectedQuerySQL(e){Gt(this.#d,e,!0)}#f=It(()=>this.selectedQuerySQL||this.sql);get executableSQL(){return w(this.#f)}set executableSQL(e){Gt(this.#f,e)}setSQL(e){this.sql=e}setSelectedQuery(e){this.selectedQuerySQL=e}async previewAll(){let e=this.sql,t=this.parsed;if(!t||t.ctes.length===0)return;this.isPreviewLoading=!0;let n=new Map;for(let e of t.ctes){let t=this.nodeStates.get(e.name);n.set(e.name,t||{id:e.name,name:e.name,status:`pending`})}let r=this.nodeStates.get(`main`);n.set(`main`,r||{id:`main`,name:`Result`,status:`pending`}),this.nodeStates=n;try{let t=await Ph.previewAllCTEs.mutate({sql:e}),n=new Map(this.nodeStates);for(let[e,r]of Object.entries(t)){let t=n.get(e);t&&n.set(e,{...t,status:`success`,rowCount:r.rowCount,preview:{columns:r.columns,rows:r.rows}})}this.nodeStates=n}catch(e){console.error(`Preview error:`,e)}finally{this.isPreviewLoading=!1}}async execute(){let e=this.executableSQL,t=Dm(e)??this.parsed;if(!t){this.error=`Failed to parse SQL`;return}let n=new Map;for(let e of t.ctes)n.set(e.name,{id:e.name,name:e.name,status:`pending`});n.set(`main`,{id:`main`,name:`Result`,status:`pending`}),this.nodeStates=n;let r=new Map(n);r.set(`main`,{...r.get(`main`),status:`running`}),this.nodeStates=r,this.isLoading=!0,this.error=null;try{let t=await Ph.executeQuery.mutate({sql:e}),n=new Map(this.nodeStates);n.set(`main`,{id:`main`,name:`Result`,status:`success`,rowCount:t.rowCount}),this.nodeStates=n,this.result=t,this.error=null,this.selectedCTE=`main`}catch(e){let t=Uce(e),n=new Map(this.nodeStates);n.set(`main`,{id:`main`,name:`Result`,status:`error`,error:t}),this.nodeStates=n,this.error=t,this.result=null,Fh.error(t)}finally{this.isLoading=!1}}async executeCTE(e){let t=this.sql,n=new Map(this.nodeStates),r=n.get(e)||{id:e,name:e,status:`pending`};n.set(e,{...r,status:`running`}),this.nodeStates=n,this.isLoading=!0,this.error=null;try{let n=await Ph.executeCTE.mutate({fullSql:t,cteName:e}),i=new Map(this.nodeStates);i.set(e,{...r,status:`success`,rowCount:n.rowCount}),this.nodeStates=i,this.result=n,this.error=null,this.selectedCTE=e}catch(t){let n=Uce(t),i=new Map(this.nodeStates);i.set(e,{...r,status:`error`,error:n}),this.nodeStates=i,this.error=n,this.result=null,Fh.error(n)}finally{this.isLoading=!1}}clearResults(){this.result=null,this.error=null,this.isLoading=!1}clearPreviews(){let e=new Map;for(let[t,n]of this.nodeStates)e.set(t,{...n,preview:void 0});this.nodeStates=e}get hasPreview(){for(let e of this.nodeStates.values())if(e.preview&&e.preview.columns.length>0)return!0;return!1}},Lh=new class{#e=Wt(Jt([{id:`scratch`,label:`Scratch`,type:`editor`,content:``,originalContent:``,fileName:null,dirty:!1}]));get tabs(){return w(this.#e)}set tabs(e){Gt(this.#e,e,!0)}#t=Wt(`scratch`);get activeTabId(){return w(this.#t)}set activeTabId(e){Gt(this.#t,e,!0)}#n=It(()=>this.tabs.find(e=>e.id===this.activeTabId)??this.tabs[0]);get activeTab(){return w(this.#n)}set activeTab(e){Gt(this.#n,e)}#r=It(()=>this.activeTab?.type===`schema`);get isSchemaTab(){return w(this.#r)}set isSchemaTab(e){Gt(this.#r,e)}async openFile(e){let t=this.tabs.find(t=>t.fileName===e);if(t)return this.activeTabId=t.id,t.id;let{content:n}=await Ph.readFile.query({fileName:e}),r={id:`file:${e}`,label:e,type:`editor`,content:n,originalContent:n,fileName:e,dirty:!1};return this.tabs=[...this.tabs,r],this.activeTabId=r.id,r.id}openSchema(){if(this.tabs.find(e=>e.id===`schema`)){this.activeTabId=`schema`;return}let e={id:`schema`,label:`Schema`,type:`schema`,content:``,originalContent:``,fileName:null,dirty:!1};this.tabs=[...this.tabs,e],this.activeTabId=`schema`}switchTab(e){this.activeTabId=e}closeTab(e){if(this.tabs.length<=1)return;let t=this.tabs.findIndex(t=>t.id===e);this.tabs=this.tabs.filter(t=>t.id!==e),this.activeTabId===e&&(this.activeTabId=this.tabs[Math.min(t,this.tabs.length-1)].id)}updateContent(e){let t=this.tabs.find(e=>e.id===this.activeTabId);t&&t.type===`editor`&&(t.content=e,t.dirty=e!==t.originalContent)}setScratchContent(e){let t=this.tabs.find(e=>e.id===`scratch`);t&&(t.content=e,this.activeTabId=`scratch`)}},Wce=[{label:`QUERY`,type:`keyword`,detail:`SELECT query`,info:`Define a query that returns rows`},{label:`EXEC`,type:`keyword`,detail:`Execute statement`,info:`INSERT/UPDATE/DELETE statement`},{label:`MIGRATE`,type:`keyword`,detail:`Migration`,info:`Schema migration (CREATE TABLE, etc.)`},{label:`TESTDATA`,type:`keyword`,detail:`Test data`,info:`Insert test/sample data`},{label:`TABLE`,type:`keyword`,detail:`Appender table`,info:`Define table for bulk insert appender`}],Rh=[{label:`:one`,type:`property`,detail:`Single row`,info:`Query returns exactly one row`},{label:`:pluck`,type:`property`,detail:`Single column`,info:`Query returns a single value (first column)`},{label:`:all`,type:`property`,detail:`All rows`,info:`Query returns all rows (default)`},{label:`:appender`,type:`property`,detail:`Bulk insert`,info:`Generate appender for bulk inserts (TABLE only)`}],zh=[];function Bh(e){zh=e}function Gce(e){let t=e.state.doc.lineAt(e.pos),n=t.text.slice(0,e.pos-t.from);if(n.match(/^--\s+$/))return{from:e.pos,options:Wce};if(n.match(/^--\s+(?:QUERY|EXEC|TABLE)\s+\S+\s+$/))return{from:e.pos,options:Rh};let r=n.match(/^--\s+(?:QUERY|EXEC|TABLE)\s+\S+\s*:(\w*)$/);if(r)return{from:e.pos-r[1].length-1,options:Rh};let i=n.match(/@(\w*)$/);if(i)return{from:e.pos-i[1].length-1,options:[{label:`@set`,type:`keyword`,detail:`Set variable`,info:`Define a variable: @set name = value`}]};if(zh.length>0){let t=n.match(/(?:FROM|JOIN|INTO|UPDATE|TABLE)\s+(\w*)$/i);if(t)return{from:e.pos-t[1].length,options:zh.map(e=>({label:e.name,type:`class`,detail:`${e.columns.length} columns`}))};let r=n.match(/(\w+)\.(\w*)$/);if(r){let t=zh.find(e=>e.name.toLowerCase()===r[1].toLowerCase());if(t)return{from:e.pos-r[2].length,options:t.columns.map(e=>({label:e.name,type:`property`,detail:e.type}))}}}return null}function Kce(){return mp({override:[Gce],activateOnTyping:!0})}var qce=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Vh=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(Kh).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new ma,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=ule(s);if(i)o.add(n,n,$a.widget({widget:new qh(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,$a.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,Hh(f))}};function Hh(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new qce(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new qce(r.from,n,r.diagnostic)}),r}function Jce(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Kh).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Uh))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Yce(e,t){return e.field(Gh,!1)?t:t.concat(ea.appendConfig.of(dle))}function Xce(e,t){return{effects:Yce(e,[Uh.of(t)])}}var Uh=ea.define(),Zce=ea.define(),Wh=ea.define(),Gh=Vi.define({create(){return new Vh($a.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Hh(n,e.selected.diagnostic,i)||Hh(n,null,i)}!n.size&&i&&t.state.facet(Kh).autoPanel&&(i=null),e=new Vh(n,i,r)}for(let n of t.effects)if(n.is(Uh)){let r=t.state.facet(Kh).autoPanel?n.value.length?Yh.open:null:e.panel;e=Vh.init(n.value,r,t.state)}else n.is(Zce)?e=new Vh(e.diagnostics,n.value?Yh.open:null,e.selected):n.is(Wh)&&(e=new Vh(e.diagnostics,e.panel,n.value));return e},provide:e=>[xl.from(e,e=>e.panel),Yc.decorations.from(e,e=>e.diagnostics)]}),Qce=$a.mark({class:`cm-lintRange cm-lintRange-active`});function $ce(e,t,n){let{diagnostics:r}=e.state.field(Gh),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(Kh).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:ele(e,i)}}}:null}function ele(e,t){return La(`ul`,{class:`cm-tooltip-lint`},t.map(t=>sle(e,t,!1)))}var tle=e=>{let t=e.state.field(Gh,!1);return!t||!t.panel?!1:(e.dispatch({effects:Zce.of(!1)}),!0)},nle=ss.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Kh);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Kh);t.length&&rle(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(Xce(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{is(this.view.state,e)})}}update(e){let t=e.state.facet(Kh);(e.docChanged||t!=e.startState.facet(Kh)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function rle(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var Kh=Fi.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...la(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:ile,tooltipFilter:ile,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function ile(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function ale(e,t={}){return[Kh.of({source:e,config:t}),nle,dle]}function ole(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function sle(e,t,n){let r=n?ole(t.actions):[];return La(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},La(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=Hh(e.state.field(Gh).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),La(`u`,s.slice(c,c+1)),s.slice(c+1)];return La(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&La(`div`,{class:`cm-diagnosticSource`},t.source))}var qh=class extends Za{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return La(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},Jh=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=sle(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},Yh=class e{constructor(e){this.view=e,this.items=[],this.list=La(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)tle(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=ole(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Hh(this.view.state.field(Gh).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=La(`div`,{class:`cm-panel-lint`},this.list,La(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>tle(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(Gh).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Gh),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new Jh(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Jh(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Hh(this.view.state.field(Gh).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Wh.of(t)})}static open(t){return new e(t)}};function cle(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Xh(e){return cle(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Zh=Yc.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:Xh(`#d11`)},".cm-lintRange-warning":{backgroundImage:Xh(`orange`)},".cm-lintRange-info":{backgroundImage:Xh(`#999`)},".cm-lintRange-hint":{backgroundImage:Xh(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function lle(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function ule(e){let t=`hint`,n=1;for(let r of e){let e=lle(r.severity);e>n&&(n=e,t=r.severity)}return t}var dle=[Gh,Yc.decorations.compute([Gh],e=>{let{selected:t,panel:n}=e.field(Gh);return!t||!n||t.from==t.to?$a.none:$a.set([Qce.range(t.from,t.to)])}),Oie($ce,{hideOn:Jce}),Zh],Qh=null;function fle(e){Qh=e}function ple(){return ale(async e=>{let t=e.state.doc,n=t.toString();if(!n.trim())return[];try{let e=await Ph.validateSQL.mutate({content:n});Qh&&Qh(e.annotations);let r=[];for(let n of e.diagnostics){let e=Math.min(n.line,t.lines),i=t.line(e),a=n.column==null?i.from:i.from+n.column,o=n.endColumn==null?i.to:i.from+n.endColumn;r.push({from:a,to:o,severity:n.severity===`info`?`info`:n.severity,message:n.message})}return r}catch{return[]}},{delay:500})}function mle(){return Oie((e,t)=>{let n=e.state.doc.lineAt(t),r=n.text.match(/^--\s+(QUERY|EXEC|MIGRATE|TESTDATA|TABLE)\s+(\S+)((?:\s+:\w+)*)/);if(!r)return null;let i=r[1],a=r[2],o=(r[3]||``).trim(),s=[];switch(i){case`QUERY`:s.push(`SELECT query — generates a typed function`);break;case`EXEC`:s.push(`Execute statement — INSERT/UPDATE/DELETE`);break;case`MIGRATE`:s.push(`Migration #${a} — runs on database initialization`);break;case`TESTDATA`:s.push(`Test data — inserted after migrations`);break;case`TABLE`:s.push(`Table definition for appender generation`);break}return o.includes(`:one`)&&s.push(`Returns a single row`),o.includes(`:pluck`)&&s.push(`Returns a single value (first column)`),o.includes(`:all`)&&s.push(`Returns all rows (default)`),o.includes(`:appender`)&&s.push(`Generates bulk insert appender`),s.length===0?null:{pos:n.from,end:n.to,above:!0,create(){let e=document.createElement(`div`);return e.style.cssText=`padding: 4px 8px; font-size: 12px; line-height: 1.5; max-width: 300px;`,e.innerHTML=s.map(e=>`<div>${e}</div>`).join(``),{dom:e}}}})}var hle=fr(`<div class="h-full w-full"></div>`);function gle(e,t){it(t,!0);let n,r,i=``,a=``;xr(()=>{fle(e=>{Ih.setAnnotations(e)});let e=Yc.updateListener.of(e=>{if(e.docChanged){let t=e.state.doc.toString();i=t,Lh.updateContent(t),Ih.setSQL(t)}}),t=el.of([{key:`Ctrl-Enter`,mac:`Cmd-Enter`,run:()=>(document.dispatchEvent(new CustomEvent(`sqg-run-query`)),!0)},{key:`Ctrl-s`,mac:`Cmd-s`,run:()=>(document.dispatchEvent(new CustomEvent(`sqg-save-file`)),!0)}]),o=ca.create({doc:Lh.activeTab.content,extensions:[Wi.highest(t),Hie(),Sie(),Wae(),el.of([...Zd,...noe]),D(),Kce(),ple(),mle(),xm,e,Yc.theme({"&":{height:`100%`},".cm-scroller":{overflow:`auto`}})]});i=Lh.activeTab.content,a=Lh.activeTabId,Ih.setSQL(i),r=new Yc({state:o,parent:n});let s=e=>{let t=e.detail;if(r){let e=r.state.selection.main.head;r.dispatch({changes:{from:e,insert:t}}),r.focus()}};document.addEventListener(`sqg-insert-text`,s);let c=e=>{let t=e.detail;if(r&&t>0&&t<=r.state.doc.lines){let e=r.state.doc.line(t);r.dispatch({selection:{anchor:e.from},effects:Yc.scrollIntoView(e.from,{y:`start`,yMargin:50})}),r.focus()}};return document.addEventListener(`sqg-scroll-to-line`,c),()=>{document.removeEventListener(`sqg-insert-text`,s),document.removeEventListener(`sqg-scroll-to-line`,c),r?.destroy()}}),fn(()=>{let e=Lh.activeTab;!r||!e||e.id!==a&&(a=e.id,i=e.content,r.dispatch({changes:{from:0,to:r.state.doc.length,insert:e.content}}),Ih.setSQL(e.content))}),fn(()=>{let e=Lh.activeTab;!r||!e||e.id!==a||e.content!==i&&!e.dirty&&(i=e.content,r.dispatch({changes:{from:0,to:r.state.doc.length,insert:e.content}}),Ih.setSQL(e.content))});var o=hle();$r(o,e=>n=e,()=>n),gr(e,o),at()}cee();var $h=pr(`<svg class="w-3 h-3 text-green-400/70 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4"></path></svg>`),_le=pr(`<svg class="w-3 h-3 text-blue-400/70 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>`),vle=pr(`<svg class="w-3 h-3 text-gray-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>`),yle=fr(`<span class="w-1.5 h-1.5 rounded-full bg-blue-400 flex-shrink-0"></span>`),ble=fr(`<button class="ml-1 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-700 transition-opacity" title="Close tab"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>`),eg=fr(`<div role="tab" tabindex="0"><!> <span> </span> <!> <!></div>`),tg=fr(`<div class="flex items-center bg-gray-900 border-b border-gray-700 overflow-x-auto"></div>`);function ng(e,t){it(t,!1),ei();var n=tg();Er(n,5,()=>Lh.tabs,wr,(e,t)=>{var n=eg(),r=en(n),i=e=>{gr(e,$h())},a=e=>{gr(e,_le())},o=e=>{gr(e,vle())};Cr(r,e=>{w(t).type===`schema`?e(i):w(t).fileName?e(a,1):e(o,-1)});var s=nn(r,2),c=en(s,!0);We(s);var l=nn(s,2),u=e=>{gr(e,yle())};Cr(l,e=>{w(t).dirty&&e(u)});var d=nn(l,2),f=e=>{var n=ble();or(`click`,n,e=>{e.stopPropagation(),Lh.closeTab(w(t).id)}),gr(e,n)};Cr(d,e=>{Lh.tabs.length>1&&e(f)}),We(n),_n(()=>{qr(n,`aria-selected`,Lh.activeTabId===w(t).id),Ir(n,1,`group flex items-center gap-1.5 px-3 py-1.5 text-xs border-r border-gray-800 cursor-pointer transition-colors whitespace-nowrap select-none
13
- ${Lh.activeTabId===w(t).id?`bg-gray-800 text-gray-200 border-b-2 border-b-blue-500`:`text-gray-500 hover:text-gray-300 hover:bg-gray-800/50`}`),_r(c,w(t).label)}),or(`click`,n,()=>Lh.switchTab(w(t).id)),or(`keydown`,n,e=>{e.key===`Enter`&&Lh.switchTab(w(t).id)}),gr(e,n)}),We(n),gr(e,n),at()}sr([`click`,`keydown`]);var rg={value:()=>{}};function ig(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ag(n)}function ag(e){this._=e}function xle(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ag.prototype=ig.prototype={constructor:ag,on:function(e,t){var n=this._,r=xle(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Sle(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Cle(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Cle(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ag(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Sle(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Cle(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=rg,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var wle={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function og(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),wle.hasOwnProperty(t)?{space:wle[t],local:e}:e}function Tle(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Ele(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sg(e){var t=og(e);return(t.local?Ele:Tle)(t)}function cg(){}function lg(e){return e==null?cg:function(){return this.querySelector(e)}}function Dle(e){typeof e!=`function`&&(e=lg(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new d_(r,this._parents)}function Ole(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ug(){return[]}function dg(e){return e==null?ug:function(){return this.querySelectorAll(e)}}function kle(e){return function(){return Ole(e.apply(this,arguments))}}function Ale(e){e=typeof e==`function`?kle(e):dg(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new d_(r,i)}function jle(e){return function(){return this.matches(e)}}function Mle(e){return function(t){return t.matches(e)}}var fg=Array.prototype.find;function pg(e){return function(){return fg.call(this.children,e)}}function Nle(){return this.firstElementChild}function mg(e){return this.select(e==null?Nle:pg(typeof e==`function`?e:Mle(e)))}var hg=Array.prototype.filter;function gg(){return Array.from(this.children)}function Ple(e){return function(){return hg.call(this.children,e)}}function _g(e){return this.selectAll(e==null?gg:Ple(typeof e==`function`?e:Mle(e)))}function Fle(e){typeof e!=`function`&&(e=jle(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new d_(r,this._parents)}function vg(e){return Array(e.length)}function yg(){return new d_(this._enter||this._groups.map(vg),this._parents)}function bg(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bg.prototype={constructor:bg,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xg(e){return function(){return e}}function Sg(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new bg(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Cg(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new bg(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Ile(e){return e.__data__}function wg(e,t){if(!arguments.length)return Array.from(this,Ile);var n=t?Cg:Sg,r=this._parents,i=this._groups;typeof e!=`function`&&(e=xg(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Lle(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new d_(o,r),o._enter=s,o._exit=c,o}function Lle(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Rle(){return new d_(this._exit||this._groups.map(vg),this._parents)}function Tg(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Eg(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new d_(s,this._parents)}function zle(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Ble(e){e||=Vle;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new d_(i,this._parents).order()}function Vle(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Hle(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ule(){return Array.from(this)}function Dg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Og(){let e=0;for(let t of this)++e;return e}function kg(){return!this.node()}function Ag(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function jg(e){return function(){this.removeAttribute(e)}}function Wle(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Mg(e,t){return function(){this.setAttribute(e,t)}}function Gle(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ng(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Pg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Kle(e,t){var n=og(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Wle:jg:typeof t==`function`?n.local?Pg:Ng:n.local?Gle:Mg)(n,t))}function Fg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qle(e){return function(){this.style.removeProperty(e)}}function Ig(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Jle(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Lg(e,t,n){return arguments.length>1?this.each((t==null?qle:typeof t==`function`?Jle:Ig)(e,t,n??``)):Rg(this.node(),e)}function Rg(e,t){return e.style.getPropertyValue(t)||Fg(e).getComputedStyle(e,null).getPropertyValue(t)}function zg(e){return function(){delete this[e]}}function Bg(e,t){return function(){this[e]=t}}function Vg(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Yle(e,t){return arguments.length>1?this.each((t==null?zg:typeof t==`function`?Vg:Bg)(e,t)):this.node()[e]}function Hg(e){return e.trim().split(/^|\s+/)}function Ug(e){return e.classList||new Xle(e)}function Xle(e){this._node=e,this._names=Hg(e.getAttribute(`class`)||``)}Xle.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Wg(e,t){for(var n=Ug(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Zle(e,t){for(var n=Ug(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Qle(e){return function(){Wg(this,e)}}function $le(e){return function(){Zle(this,e)}}function eue(e,t){return function(){(t.apply(this,arguments)?Wg:Zle)(this,e)}}function Gg(e,t){var n=Hg(e+``);if(arguments.length<2){for(var r=Ug(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?eue:t?Qle:$le)(n,t))}function Kg(){this.textContent=``}function qg(e){return function(){this.textContent=e}}function Jg(e){return function(){this.textContent=e.apply(this,arguments)??``}}function tue(e){return arguments.length?this.each(e==null?Kg:(typeof e==`function`?Jg:qg)(e)):this.node().textContent}function nue(){this.innerHTML=``}function Yg(e){return function(){this.innerHTML=e}}function rue(e){return function(){this.innerHTML=e.apply(this,arguments)??``}}function Xg(e){return arguments.length?this.each(e==null?nue:(typeof e==`function`?rue:Yg)(e)):this.node().innerHTML}function Zg(){this.nextSibling&&this.parentNode.appendChild(this)}function Qg(){return this.each(Zg)}function $g(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function e_(){return this.each($g)}function t_(e){var t=typeof e==`function`?e:sg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function n_(){return null}function r_(e,t){var n=typeof e==`function`?e:sg(e),r=t==null?n_:typeof t==`function`?t:lg(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function i_(){var e=this.parentNode;e&&e.removeChild(this)}function iue(){return this.each(i_)}function a_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function aue(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function oue(e){return this.select(e?aue:a_)}function sue(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function cue(e){return function(t){e.call(this,t,this.__data__)}}function lue(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function uue(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function o_(e,t,n){return function(){var r=this.__on,i,a=cue(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function due(e,t,n){var r=lue(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?o_:uue,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function s_(e,t,n){var r=Fg(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function c_(e,t){return function(){return s_(this,e,t)}}function fue(e,t){return function(){return s_(this,e,t.apply(this,arguments))}}function pue(e,t){return this.each((typeof t==`function`?fue:c_)(e,t))}function*l_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var u_=[null];function d_(e,t){this._groups=e,this._parents=t}function f_(){return new d_([[document.documentElement]],u_)}function p_(){return this}d_.prototype=f_.prototype={constructor:d_,select:Dle,selectAll:Ale,selectChild:mg,selectChildren:_g,filter:Fle,data:wg,enter:yg,exit:Rle,join:Tg,merge:Eg,selection:p_,order:zle,sort:Ble,call:Hle,nodes:Ule,node:Dg,size:Og,empty:kg,each:Ag,attr:Kle,style:Lg,property:Yle,classed:Gg,text:tue,html:Xg,raise:Qg,lower:e_,append:t_,insert:r_,remove:iue,clone:oue,datum:sue,on:due,dispatch:pue,[Symbol.iterator]:l_};function m_(e){return typeof e==`string`?new d_([[document.querySelector(e)]],[document.documentElement]):new d_([[e]],u_)}function mue(e){let t;for(;t=e.sourceEvent;)e=t;return e}function h_(e,t){if(e=mue(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var hue={passive:!1},g_={capture:!0,passive:!1};function __(e){e.stopImmediatePropagation()}function v_(e){e.preventDefault(),e.stopImmediatePropagation()}function y_(e){var t=e.document.documentElement,n=m_(e).on(`dragstart.drag`,v_,g_);`onselectstart`in t?n.on(`selectstart.drag`,v_,g_):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function b_(e,t){var n=e.document.documentElement,r=m_(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,v_,g_),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var x_=e=>()=>e;function S_(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}S_.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function gue(e){return!e.ctrlKey&&!e.button}function C_(){return this.parentNode}function w_(e,t){return t??{x:e.x,y:e.y}}function T_(){return navigator.maxTouchPoints||`ontouchstart`in this}function E_(){var e=gue,t=C_,n=w_,r=T_,i={},a=ig(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,hue).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(m_(n.view).on(`mousemove.drag`,m,g_).on(`mouseup.drag`,h,g_),y_(n.view),__(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(v_(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){m_(e.view).on(`mousemove.drag mouseup.drag`,null),b_(e.view,l),v_(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(__(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(v_(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(__(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=h_(l||r,t),p,m,h;if((h=n.call(e,new S_(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=h_(l||a,t),_=o;break}u.call(r,e,new S_(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:x_(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:x_(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:x_(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:x_(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function D_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function O_(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function k_(){}var A_=.7,j_=1/A_,M_=`\\s*([+-]?\\d+)\\s*`,N_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,P_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,F_=/^#([0-9a-f]{3,8})$/,I_=RegExp(`^rgb\\(${M_},${M_},${M_}\\)$`),L_=RegExp(`^rgb\\(${P_},${P_},${P_}\\)$`),R_=RegExp(`^rgba\\(${M_},${M_},${M_},${N_}\\)$`),z_=RegExp(`^rgba\\(${P_},${P_},${P_},${N_}\\)$`),B_=RegExp(`^hsl\\(${N_},${P_},${P_}\\)$`),_ue=RegExp(`^hsla\\(${N_},${P_},${P_},${N_}\\)$`),V_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};D_(k_,K_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:H_,formatHex:H_,formatHex8:U_,formatHsl:W_,formatRgb:G_,toString:G_});function H_(){return this.rgb().formatHex()}function U_(){return this.rgb().formatHex8()}function W_(){return Tue(this).formatHsl()}function G_(){return this.rgb().formatRgb()}function K_(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=F_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vue(t):n===3?new J_(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?q_(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?q_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=I_.exec(e))?new J_(t[1],t[2],t[3],1):(t=L_.exec(e))?new J_(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=R_.exec(e))?q_(t[1],t[2],t[3],t[4]):(t=z_.exec(e))?q_(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=B_.exec(e))?wue(t[1],t[2]/100,t[3]/100,1):(t=_ue.exec(e))?wue(t[1],t[2]/100,t[3]/100,t[4]):V_.hasOwnProperty(e)?vue(V_[e]):e===`transparent`?new J_(NaN,NaN,NaN,0):null}function vue(e){return new J_(e>>16&255,e>>8&255,e&255,1)}function q_(e,t,n,r){return r<=0&&(e=t=n=NaN),new J_(e,t,n,r)}function yue(e){return e instanceof k_||(e=K_(e)),e?(e=e.rgb(),new J_(e.r,e.g,e.b,e.opacity)):new J_}function bue(e,t,n,r){return arguments.length===1?yue(e):new J_(e,t,n,r??1)}function J_(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}D_(J_,bue,O_(k_,{brighter(e){return e=e==null?j_:j_**+e,new J_(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?A_:A_**+e,new J_(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new J_(X_(this.r),X_(this.g),X_(this.b),Y_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xue,formatHex:xue,formatHex8:Sue,formatRgb:Cue,toString:Cue}));function xue(){return`#${Z_(this.r)}${Z_(this.g)}${Z_(this.b)}`}function Sue(){return`#${Z_(this.r)}${Z_(this.g)}${Z_(this.b)}${Z_((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cue(){let e=Y_(this.opacity);return`${e===1?`rgb(`:`rgba(`}${X_(this.r)}, ${X_(this.g)}, ${X_(this.b)}${e===1?`)`:`, ${e})`}`}function Y_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function X_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Z_(e){return e=X_(e),(e<16?`0`:``)+e.toString(16)}function wue(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Q_(e,t,n,r)}function Tue(e){if(e instanceof Q_)return new Q_(e.h,e.s,e.l,e.opacity);if(e instanceof k_||(e=K_(e)),!e)return new Q_;if(e instanceof Q_)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Q_(o,s,c,e.opacity)}function Eue(e,t,n,r){return arguments.length===1?Tue(e):new Q_(e,t,n,r??1)}function Q_(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}D_(Q_,Eue,O_(k_,{brighter(e){return e=e==null?j_:j_**+e,new Q_(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?A_:A_**+e,new Q_(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new J_(ev(e>=240?e-240:e+120,i,r),ev(e,i,r),ev(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Q_(Due(this.h),$_(this.s),$_(this.l),Y_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Y_(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Due(this.h)}, ${$_(this.s)*100}%, ${$_(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Due(e){return e=(e||0)%360,e<0?e+360:e}function $_(e){return Math.max(0,Math.min(1,e||0))}function ev(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var tv=e=>()=>e;function nv(e,t){return function(n){return e+n*t}}function rv(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function iv(e){return(e=+e)==1?av:function(t,n){return n-t?rv(t,n,e):tv(isNaN(t)?n:t)}}function av(e,t){var n=t-e;return n?nv(e,n):tv(isNaN(e)?t:e)}var ov=(function e(t){var n=iv(t);function r(e,t){var r=n((e=bue(e)).r,(t=bue(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=av(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function sv(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function cv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lv(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=vv(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function uv(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function dv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function fv(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=vv(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var pv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mv=new RegExp(pv.source,`g`);function hv(e){return function(){return e}}function gv(e){return function(t){return e(t)+``}}function _v(e,t){var n=pv.lastIndex=mv.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=pv.exec(e))&&(i=mv.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:dv(r,i)})),n=mv.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?gv(c[0].x):hv(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function vv(e,t){var n=typeof t,r;return t==null||n===`boolean`?tv(t):(n===`number`?dv:n===`string`?(r=K_(t))?(t=r,ov):_v:t instanceof K_?ov:t instanceof Date?uv:cv(t)?sv:Array.isArray(t)?lv:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?fv:dv)(e,t)}var yv=180/Math.PI,bv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xv(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*yv,skewX:Math.atan(c)*yv,scaleX:o,scaleY:s}}var Sv;function Cv(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?bv:xv(t.a,t.b,t.c,t.d,t.e,t.f)}function wv(e){return e==null||(Sv||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Sv.setAttribute(`transform`,e),!(e=Sv.transform.baseVal.consolidate()))?bv:(e=e.matrix,xv(e.a,e.b,e.c,e.d,e.e,e.f))}function Tv(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:dv(e,i)},{i:c-2,x:dv(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:dv(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:dv(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:dv(e,n)},{i:s-2,x:dv(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Ev=Tv(Cv,`px, `,`px)`,`deg)`),Dv=Tv(wv,`, `,`)`,`)`),Ov=1e-12;function kv(e){return((e=Math.exp(e))+1/e)/2}function Av(e){return((e=Math.exp(e))-1/e)/2}function jv(e){return((e=Math.exp(2*e))-1)/(e+1)}var Mv=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Ov)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=kv(y),c=s/(n*g)*(i*jv(t*r+y)-Av(y));return[a+c*d,o+c*f,s*i/kv(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),Nv=0,Pv=0,Fv=0,Iv=1e3,Lv,Rv,zv=0,Bv=0,Vv=0,Hv=typeof performance==`object`&&performance.now?performance:Date,Uv=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wv(){return Bv||=(Uv(Gv),Hv.now()+Vv)}function Gv(){Bv=0}function Kv(){this._call=this._time=this._next=null}Kv.prototype=qv.prototype={constructor:Kv,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Wv():+n)+(t==null?0:+t),!this._next&&Rv!==this&&(Rv?Rv._next=this:Lv=this,Rv=this),this._call=e,this._time=n,Xv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xv())}};function qv(e,t,n){var r=new Kv;return r.restart(e,t,n),r}function Jv(){Wv(),++Nv;for(var e=Lv,t;e;)(t=Bv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nv}function Yv(){Bv=(zv=Hv.now())+Vv,Nv=Pv=0;try{Jv()}finally{Nv=0,kue(),Bv=0}}function Oue(){var e=Hv.now(),t=e-zv;t>Iv&&(Vv-=t,zv=e)}function kue(){for(var e,t=Lv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Lv=n);Rv=e,Xv(r)}function Xv(e){Nv||(Pv&&=clearTimeout(Pv),e-Bv>24?(e<1/0&&(Pv=setTimeout(Yv,e-Hv.now()-Vv)),Fv&&=clearInterval(Fv)):(Fv||=(zv=Hv.now(),setInterval(Oue,Iv)),Nv=1,Uv(Yv)))}function Zv(e,t,n){var r=new Kv;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Qv=ig(`start`,`end`,`cancel`,`interrupt`),$v=[];function ey(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Aue(e,n,{name:t,index:r,group:i,on:Qv,tween:$v,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function ty(e,t){var n=ry(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function ny(e,t){var n=ry(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function ry(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Aue(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qv(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Zv(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Zv(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function iy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function jue(e){return this.each(function(){iy(this,e)})}function ay(e,t){var n,r;return function(){var i=ny(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function oy(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=ny(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function sy(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=ry(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?ay:oy)(n,e,t))}function cy(e,t,n){var r=e._id;return e.each(function(){var e=ny(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return ry(e,r).value[t]}}function ly(e,t){var n;return(typeof t==`number`?dv:t instanceof K_?ov:(n=K_(t))?(t=n,ov):_v)(e,t)}function uy(e){return function(){this.removeAttribute(e)}}function dy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fy(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function py(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function my(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function hy(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function gy(e,t){var n=og(e),r=n===`transform`?Dv:ly;return this.attrTween(e,typeof t==`function`?(n.local?hy:my)(n,r,cy(this,`attr.`+e,t)):t==null?(n.local?dy:uy)(n):(n.local?py:fy)(n,r,t))}function _y(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yy(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&vy(e,i)),n}return i._value=t,i}function by(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&_y(e,i)),n}return i._value=t,i}function xy(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=og(e);return this.tween(n,(r.local?yy:by)(r,t))}function Sy(e,t){return function(){ty(this,e).delay=+t.apply(this,arguments)}}function Mue(e,t){return t=+t,function(){ty(this,e).delay=t}}function Nue(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Sy:Mue)(t,e)):ry(this.node(),t).delay}function Pue(e,t){return function(){ny(this,e).duration=+t.apply(this,arguments)}}function Fue(e,t){return t=+t,function(){ny(this,e).duration=t}}function Iue(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Pue:Fue)(t,e)):ry(this.node(),t).duration}function Lue(e,t){if(typeof t!=`function`)throw Error();return function(){ny(this,e).ease=t}}function Rue(e){var t=this._id;return arguments.length?this.each(Lue(t,e)):ry(this.node(),t).ease}function zue(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();ny(this,e).ease=n}}function Cy(e){if(typeof e!=`function`)throw Error();return this.each(zue(this._id,e))}function wy(e){typeof e!=`function`&&(e=jle(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Ky(r,this._parents,this._name,this._id)}function Ty(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Ky(o,this._parents,this._name,this._id)}function Ey(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Dy(e,t,n){var r,i,a=Ey(t)?ty:ny;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Oy(e,t){var n=this._id;return arguments.length<2?ry(this.node(),n).on.on(e):this.each(Dy(n,e,t))}function ky(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ay(){return this.on(`end.remove`,ky(this._id))}function jy(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=lg(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,ey(l[f],t,n,f,l,ry(u,n)));return new Ky(a,this._parents,t,n)}function My(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=dg(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=ry(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&ey(p,t,n,h,f,m);a.push(f),o.push(u)}return new Ky(a,o,t,n)}var Ny=f_.prototype.constructor;function Py(){return new Ny(this._groups,this._parents)}function Fy(e,t){var n,r,i;return function(){var a=Rg(this,e),o=(this.style.removeProperty(e),Rg(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Iy(e){return function(){this.style.removeProperty(e)}}function Ly(e,t,n){var r,i=n+``,a;return function(){var o=Rg(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Ry(e,t,n){var r,i,a;return function(){var o=Rg(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Rg(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function zy(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=ny(this,e),l=c.on,u=c.value[a]==null?s||=Iy(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function By(e,t,n){var r=(e+=``)==`transform`?Ev:ly;return t==null?this.styleTween(e,Fy(e,r)).on(`end.style.`+e,Iy(e)):typeof t==`function`?this.styleTween(e,Ry(e,r,cy(this,`style.`+e,t))).each(zy(this._id,e)):this.styleTween(e,Ly(e,r,t),n).on(`end.style.`+e,null)}function Vy(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Hy(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Vy(e,a,n)),r}return a._value=t,a}function Uy(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Hy(e,t,n??``))}function Wy(e){return function(){this.textContent=e}}function k(e){return function(){this.textContent=e(this)??``}}function Bue(e){return this.tween(`text`,typeof e==`function`?k(cy(this,`text`,e)):Wy(e==null?``:e+``))}function Vue(e){return function(t){this.textContent=e.call(this,t)}}function Hue(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Vue(r)),t}return r._value=e,r}function Uue(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Hue(e))}function Wue(){for(var e=this._name,t=this._id,n=qy(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=ry(c,t);ey(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ky(r,this._parents,e,n)}function Gue(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=ny(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Gy=0;function Ky(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Kue(e){return f_().transition(e)}function qy(){return++Gy}var Jy=f_.prototype;Ky.prototype=Kue.prototype={constructor:Ky,select:jy,selectAll:My,selectChild:Jy.selectChild,selectChildren:Jy.selectChildren,filter:wy,merge:Ty,selection:Py,transition:Wue,call:Jy.call,nodes:Jy.nodes,node:Jy.node,size:Jy.size,empty:Jy.empty,each:Jy.each,on:Oy,attr:gy,attrTween:xy,style:By,styleTween:Uy,text:Bue,textTween:Uue,remove:Ay,tween:sy,delay:Nue,duration:Iue,ease:Rue,easeVarying:Cy,end:Gue,[Symbol.iterator]:Jy[Symbol.iterator]};function que(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Jue={time:null,delay:0,duration:250,ease:que};function Yue(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Xue(e){var t,n;e instanceof Ky?(t=e._id,e=e._name):(t=qy(),(n=Jue).time=Wv(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&ey(c,e,t,l,o,n||Yue(c,t));return new Ky(r,this._parents,e,t)}f_.prototype.interrupt=jue,f_.prototype.transition=Xue;var Yy=e=>()=>e;function Zue(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Xy(e,t,n){this.k=e,this.x=t,this.y=n}Xy.prototype={constructor:Xy,scale:function(e){return e===1?this:new Xy(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xy(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Zy=new Xy(1,0,0);Qy.prototype=Xy.prototype;function Qy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Zy;return e.__zoom}function $y(e){e.stopImmediatePropagation()}function eb(e){e.preventDefault(),e.stopImmediatePropagation()}function tb(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function nb(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function rb(){return this.__zoom||Zy}function ib(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Que(){return navigator.maxTouchPoints||`ontouchstart`in this}function ab(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function $ue(){var e=tb,t=nb,n=ab,r=ib,i=Que,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Mv,l=ig(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,rb).on(`wheel.zoom`,te,{passive:!1}).on(`mousedown.zoom`,ne).on(`dblclick.zoom`,C).filter(i).on(`touchstart.zoom`,re).on(`touchmove.zoom`,ie).on(`touchend.zoom touchcancel.zoom`,ae).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,rb),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Zy.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Xy(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Xy(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Xy(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new ee(e,t)}function ee(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}ee.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=m_(this.that).datum();l.call(e,this.that,new Zue(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function te(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=h_(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],iy(this),s.start();eb(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function ne(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=m_(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=h_(t,i),l=t.clientX,u=t.clientY;y_(t.view),$y(t),a.mouse=[c,this.__zoom.invert(c)],iy(this),a.start();function d(e){if(eb(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=h_(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),b_(e.view,a.moved),eb(e),a.event(e).end()}}function C(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=h_(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);eb(r),s>0?m_(this).transition().duration(s).call(x,d,c,r):m_(this).call(_.transform,d,c,r)}}function re(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for($y(t),s=0;s<i;++s)c=r[s],l=h_(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),iy(this),a.start())}}function ie(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(eb(e),s=0;s<a;++s)c=i[s],l=h_(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function ae(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for($y(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=h_(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=m_(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Yy(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Yy(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Yy(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Yy([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var ob={error001:()=>`[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The React Flow parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`},sb=[[-1/0,-1/0],[1/0,1/0]],ede=[`Enter`,` `,`Escape`],tde={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},cb;(function(e){e.Strict=`strict`,e.Loose=`loose`})(cb||={});var lb;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(lb||={});var ub;(function(e){e.Partial=`partial`,e.Full=`full`})(ub||={});var nde={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},db;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(db||={});var fb;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(fb||={});var pb;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(pb||={});var rde={[pb.Left]:pb.Right,[pb.Right]:pb.Left,[pb.Top]:pb.Bottom,[pb.Bottom]:pb.Top};function ide(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(let n of e.keys())if(!t.has(n))return!1;return!0}function ade(e,t,n){if(!n)return;let r=[];e.forEach((e,n)=>{t?.has(n)||r.push(e)}),r.length&&n(r)}function ode(e){return e===null?null:e?`valid`:`invalid`}var mb=e=>`id`in e&&`source`in e&&`target`in e,hb=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),gb=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),_b=(e,t=[0,0])=>{let{width:n,height:r}=Gb(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},A=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:jb(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):gb(n)?n:t.nodeLookup.get(n.id)),kb(e,i?Nb(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),vb=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=kb(n,Nb(e)),r=!0)}),r?jb(n):{x:0,y:0,width:0,height:0}},yb=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...zb(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=Pb(s,Mb(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},bb=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function xb(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Sb({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);let s=Hb(vb(xb(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)}function Cb({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,ob.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&Wb(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Wb(d)?Tb(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,ob.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function sde({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=bb(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var wb=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Tb=(e={x:0,y:0},t,n)=>({x:wb(e.x,t[0][0],t[1][0]-(n?.width??0)),y:wb(e.y,t[0][1],t[1][1]-(n?.height??0))});function Eb(e,t,n){let{width:r,height:i}=Gb(n),{x:a,y:o}=n.internals.positionAbsolute;return Tb(e,[[a,o],[a+r,o+i]],t)}var Db=(e,t,n)=>e<t?wb(Math.abs(e-t),1,t)/t:e>n?-wb(Math.abs(e-n),1,t)/t:0,Ob=(e,t,n=15,r=40)=>[Db(e.x,r,t.width-r)*n,Db(e.y,r,t.height-r)*n],kb=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ab=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),jb=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Mb=(e,t=[0,0])=>{let{x:n,y:r}=gb(e)?e.internals.positionAbsolute:_b(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Nb=(e,t=[0,0])=>{let{x:n,y:r}=gb(e)?e.internals.positionAbsolute:_b(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},cde=(e,t)=>jb(kb(Ab(e),Ab(t))),Pb=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Fb=e=>Ib(e.width)&&Ib(e.height)&&Ib(e.x)&&Ib(e.y),Ib=e=>!isNaN(e)&&isFinite(e),Lb=(e,t)=>{},Rb=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),zb=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Rb(s,o):s},Bb=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Vb(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function lde(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Vb(e,n),i=Vb(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Vb(e.top??e.y??0,n),i=Vb(e.bottom??e.y??0,n),a=Vb(e.left??e.x??0,t),o=Vb(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ude(e,t,n,r,i,a){let{x:o,y:s}=Bb(e,[t,n,r]),{x:c,y:l}=Bb({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Hb=(e,t,n,r,i,a)=>{let o=lde(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=wb(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=ude(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Ub=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Wb(e){return e!=null&&e!==`parent`}function Gb(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function dde(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function fde(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function pde(e){return{...tde,...e||{}}}function Kb(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Xb(e),s=zb({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Rb(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var mde=e=>({width:e.offsetWidth,height:e.offsetHeight}),qb=e=>e?.getRootNode?.()||window?.document,Jb=[`INPUT`,`SELECT`,`TEXTAREA`];function Yb(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Jb.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var hde=e=>`clientX`in e,Xb=(e,t)=>{let n=hde(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Zb=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...mde(t)}})};function gde({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function Qb(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $b({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case pb.Left:return[t-Qb(t-r,a),n];case pb.Right:return[t+Qb(r-t,a),n];case pb.Top:return[t,n-Qb(n-i,a)];case pb.Bottom:return[t,n+Qb(i-n,a)]}}function ex({sourceX:e,sourceY:t,sourcePosition:n=pb.Bottom,targetX:r,targetY:i,targetPosition:a=pb.Top,curvature:o=.25}){let[s,c]=$b({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=$b({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=gde({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function tx({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function nx({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function rx({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=kb(Nb(e),Nb(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Pb({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},jb(a))>0}var _de=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,ix=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),ax=(e,t,n={})=>{if(!e.source||!e.target)return ob.error006(),t;let r=n.getEdgeId||_de,i;return i=mb(e)?{...e}:{...e,id:r(e)},ix(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ox({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=tx({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var sx={[pb.Left]:{x:-1,y:0},[pb.Right]:{x:1,y:0},[pb.Top]:{x:0,y:-1},[pb.Bottom]:{x:0,y:1}},vde=({source:e,sourcePosition:t=pb.Bottom,target:n})=>t===pb.Left||t===pb.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},yde=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function bde({source:e,sourcePosition:t=pb.Bottom,target:n,targetPosition:r=pb.Top,center:i,offset:a,stepPosition:o}){let s=sx[t],c=sx[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=vde({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=tx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...m,{x:u.x+v.x,y:u.y+v.y},n],h,g,y,b]}function xde(e,t,n,r){let i=Math.min(yde(e,t)/2,yde(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function cx({sourceX:e,sourceY:t,sourcePosition:n=pb.Bottom,targetX:r,targetY:i,targetPosition:a=pb.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=bde({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u});return[d.reduce((e,t,n)=>{let r=``;return r=n>0&&n<d.length-1?xde(d[n-1],t,d[n+1],o):`${n===0?`M`:`L`}${t.x} ${t.y}`,e+=r,e},``),f,p,m,h]}function Sde(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Cde(e){let{sourceNode:t,targetNode:n}=e;if(!Sde(t)||!Sde(n))return null;let r=t.internals.handleBounds||wde(t.handles),i=n.internals.handleBounds||wde(n.handles),a=ux(r?.source??[],e.sourceHandle),o=ux(e.connectionMode===cb.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,ob.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||pb.Bottom,c=o?.position||pb.Top,l=lx(t,a,s),u=lx(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function wde(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function lx(e,t,n=pb.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??Gb(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case pb.Top:return{x:i+o/2,y:a};case pb.Right:return{x:i+o,y:a+s/2};case pb.Bottom:return{x:i+o/2,y:a+s};case pb.Left:return{x:i,y:a+s/2}}}function ux(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function dx(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Tde(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=dx(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var fx=1e3,px=10,mx={nodeOrigin:[0,0],nodeExtent:sb,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},hx={...mx,checkEquality:!0};function gx(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function _x(e,t,n){let r=gx(mx,n);for(let n of e.values())if(n.parentId)xx(n,e,t,r);else{let e=Tb(_b(n,r.nodeOrigin),Wb(n.extent)?n.extent:r.nodeExtent,Gb(n));n.internals.positionAbsolute=e}}function vx(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function yx(e){return e===`manual`}function bx(e,t,n,r={}){let i=gx(hx,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!yx(i.zIndexMode)?fx:0,c=e.length>0;t.clear(),n.clear();for(let l of e){let e=o.get(l.id);if(i.checkEquality&&l===e?.internals.userNode)t.set(l.id,e);else{let n=Tb(_b(l,i.nodeOrigin),Wb(l.extent)?l.extent:i.nodeExtent,Gb(l));e={...i.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:n,handleBounds:vx(l,e),z:Sx(l,s,i.zIndexMode),userNode:l}},t.set(l.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),l.parentId&&xx(e,t,n,r,a)}return c}function Ede(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function xx(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=gx(mx,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Ede(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*px),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Dde(e,u,o,s,a&&!yx(c)?fx:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function Sx(e,t,n){let r=Ib(e.zIndex)?e.zIndex:0;return yx(n)?r:r+(e.selected?t:0)}function Dde(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Gb(e),l=_b(e,n),u=Wb(e.extent)?Tb(l,e.extent,c):l,d=Tb({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Eb(d,c,t));let f=Sx(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Cx(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=cde(a.get(n.parentId)?.expandedRect??Mb(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=Gb(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function wx(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=mde(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Wb(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;e.parentId&&e.extent===`parent`?h=Eb(h,s,t.get(e.parentId)):m&&(h=Tb(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Zb(`source`,r.nodeElement,p,d,e.id),target:Zb(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&xx(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Mb(g,i)}))}}if(f.length>0){let e=Cx(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Tx({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),s=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(s)}function Ex(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function Dx(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;Ex(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),Ex(`target`,s,c,e,i,o),t.set(r.id,r)}}function Ox(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Ox(n,t):!1}function kx(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Ax(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Ox(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function jx({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Ode({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=Rb(a,t);return{x:o.x-a.x,y:o.y-a.y}}function kde({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=m_(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Ab(vb(s)):null,x=v&&l?Ode({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:Rb(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Cb({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=jx({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function ee(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Ob(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(ee)}function te(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=Kb(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Ax(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=jx({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let ne=E_().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&te(e),a=Kb(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Xb(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Kb(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,ee()),!d){let t=Xb(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&te(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=Xb(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!(!d||p)&&(c=!1,d=!1,cancelAnimationFrame(o),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=jx({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!kx(t,`.${g}`,v))&&(!_||kx(t,_,v))});f.call(ne)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Mx(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Pb(i,Mb(e))>0&&r.push(e);return r}var Nx=250;function Ade(e,t,n,r){let i=[],a=1/0,o=Mx(e,n,t+Nx);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=lx(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Px(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...lx(o,c,c.position,!0)}:c}function jde(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Mde(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Nde=()=>!0;function Pde(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=Nde,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:ee=1,handleDomNode:te}){let ne=qb(e.target),C=0,re,{x:ie,y:ae}=Xb(e),oe=jde(a,te),se=s?.getBoundingClientRect(),ce=!1;if(!se||!oe)return;let le=Px(i,oe,r,c,t);if(!le)return;let ue=Xb(e,se),de=!1,fe=null,pe=!1,me=null;function he(){if(!u||!se)return;let[e,t]=Ob(ue,se,S);f({x:e,y:t}),C=requestAnimationFrame(he)}let ge={...le,nodeId:i,type:oe,position:le.position},_e=c.get(i),ve={inProgress:!0,isValid:null,from:lx(_e,ge,pb.Left,!0),fromHandle:ge,fromPosition:ge.position,fromNode:_e,to:ue,toHandle:null,toPosition:rde[ge.position],toNode:null,pointer:ue};function ye(){ce=!0,y(ve),m?.(e,{nodeId:i,handleId:r,handleType:oe})}ee===0&&ye();function be(e){if(!ce){let{x:t,y:n}=Xb(e),r=t-ie,i=n-ae;if(!(r*r+i*i>ee*ee))return;ye()}if(!x()||!ge){xe(e);return}let a=b();ue=Xb(e,se),re=Ade(zb(ue,a,!1,[1,1]),n,c,ge),de||=(he(),!0);let s=Fde(e,{handle:re,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:ne,lib:l,flowId:d,nodeLookup:c});me=s.handleDomNode,fe=s.connection,pe=Mde(!!re,s.isValid);let u=c.get(i),f=u?lx(u,ge,pb.Left,!0):ve.from,p={...ve,from:f,isValid:pe,to:s.toHandle&&pe?Bb({x:s.toHandle.x,y:s.toHandle.y},a):ue,toHandle:s.toHandle,toPosition:pe&&s.toHandle?s.toHandle.position:rde[ge.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:ue};y(p),ve=p}function xe(e){if(!(`touches`in e&&e.touches.length>0)){if(ce){(re||me)&&fe&&pe&&h?.(fe);let{inProgress:t,...n}=ve,r={...n,toPosition:ve.toHandle?ve.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(C),de=!1,pe=!1,fe=null,me=null,ne.removeEventListener(`mousemove`,be),ne.removeEventListener(`mouseup`,xe),ne.removeEventListener(`touchmove`,be),ne.removeEventListener(`touchend`,xe)}}ne.addEventListener(`mousemove`,be),ne.addEventListener(`mouseup`,xe),ne.addEventListener(`touchmove`,be),ne.addEventListener(`touchend`,xe)}function Fde(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Nde,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Xb(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=jde(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===cb.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Px(t,e,a,u,n,!0)}return _}var Ide={onPointerDown:Pde,isValid:Fde},Fx=e=>({x:e.x,y:e.y,zoom:e.k}),Ix=({x:e,y:t,zoom:n})=>Zy.translate(e,t).scale(n),Lx=(e,t)=>e.target.closest(`.${t}`),Rx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Lde=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,zx=(e,t=0,n=Lde,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},Rde=e=>{let t=e.ctrlKey&&Ub()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Bx({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Lx(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=h_(u),t=d*2**Rde(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===lb.Vertical?0:u.deltaX*f,m=i===lb.Horizontal?0:u.deltaY*f;!Ub()&&u.shiftKey&&i!==lb.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Fx(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}function zde({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=Lx(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function Bde({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Fx(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Vde({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&Rx(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Fx(a.transform))}}function Vx({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&Rx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Fx(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function Hx({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(Lx(d,`${l}-flow__node`)||Lx(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||Lx(d,s)&&m||Lx(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function Hde({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=$ue().scaleExtent([t,n]).translateExtent(r),f=m_(e).call(d);v({x:i.x,y:i.y,zoom:wb(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let p=f.on(`wheel.zoom`),m=f.on(`dblclick.zoom`);d.wheelDelta(Rde);function h(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?vv:Mv).transform(zx(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:g,preventScrolling:v,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:ee,onTransformChange:te,connectionInProgress:ne,paneClickDistance:C,selectionOnDrag:re}){r&&!l.isZoomingOrPanning&&_();let ie=i&&!S&&!r;d.clickDistance(re?1/0:!Ib(C)||C<0?0:C);let ae=ie?Bx({zoomPanValues:l,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):zde({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});if(f.on(`wheel.zoom`,ae,{passive:!1}),!r){let e=Bde({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});d.on(`start`,e);let t=Vde({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:te});d.on(`zoom`,t);let r=Vx({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});d.on(`end`,r)}let oe=Hx({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:ee,connectionInProgress:ne});d.filter(oe),x?f.on(`dblclick.zoom`,m):f.on(`dblclick.zoom`,null)}function _(){d.on(`zoom`,null)}async function v(e,t,n){let r=Ix(e),i=d?.constrain()(r,t,n);return i&&await h(i),new Promise(e=>e(i))}async function y(e,t){let n=Ix(e);return await h(n,t),new Promise(e=>e(n))}function b(e){if(f){let t=Ix(e),n=f.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}}function x(){let e=f?Qy(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}function S(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?vv:Mv).scaleTo(zx(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function ee(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?vv:Mv).scaleBy(zx(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function te(e){d?.scaleExtent(e)}function ne(e){d?.translateExtent(e)}function C(e){let t=!Ib(e)||e<0?0:e;d?.clickDistance(t)}return{update:g,destroy:_,setViewport:y,setViewportConstrained:v,getViewport:x,scaleTo:S,scaleBy:ee,setScaleExtent:te,setTranslateExtent:ne,syncViewport:b,setClickDistance:C}}var Ude;(function(e){e.Line=`line`,e.Handle=`handle`})(Ude||={});function Ux(){let e={};return[t=>{if(t&&!lee(e))throw Error(t);return nt(e)},t=>rt(e,t)]}var[Wde,Gde]=Ux(),[Kde,Wx]=Ux(),[Gx,Kx]=Ux(),qde=fr(`<div><!></div>`);function qx(e,t){it(t,!0);let n=ii(t,`id`,3,null),r=ii(t,`type`,3,`source`),i=ii(t,`position`,19,()=>pb.Top),a=ii(t,`isConnectableStart`,3,!0),o=ii(t,`isConnectableEnd`,3,!0),s=ni(t,[`$$slots`,`$$events`,`$$legacy`,`id`,`type`,`position`,`style`,`class`,`isConnectable`,`isConnectableStart`,`isConnectableEnd`,`isValidConnection`,`onconnect`,`ondisconnect`,`children`]),c=Wde(`Handle must be used within a Custom Node component`),l=Kde(`Handle must be used within a Custom Node component`),u=It(()=>r()===`target`),d=It(()=>t.isConnectable===void 0?l.value:t.isConnectable),f=pS(),p=It(()=>f.ariaLabelConfig),m=null;mn(()=>{if(t.onconnect||t.ondisconnect){f.edges;let e=f.connectionLookup.get(`${c}-${r()}${n()?`-${n()}`:``}`);if(m&&!ide(e,m)){let n=e??new Map;ade(m,n,t.ondisconnect),ade(n,m,t.onconnect)}m=new Map(e)}});let h=It(()=>{if(!f.connection.inProgress)return[!1,!1,!1,!1,null];let{fromHandle:e,toHandle:t,isValid:i}=f.connection,a=e&&e.nodeId===c&&e.type===r()&&e.id===n(),o=t&&t.nodeId===c&&t.type===r()&&t.id===n();return[!0,a,o,f.connectionMode===cb.Strict?e?.type!==r():c!==e?.nodeId||n()!==e?.id,o&&i]}),g=It(()=>oe(w(h),5)),_=It(()=>w(g)[0]),v=It(()=>w(g)[1]),y=It(()=>w(g)[2]),b=It(()=>w(g)[3]),x=It(()=>w(g)[4]);function S(e){let t=f.onbeforeconnect?f.onbeforeconnect(e):e;t&&(f.addEdge(t),f.onconnect?.(e))}function ee(e){let r=hde(e);e.currentTarget&&(r&&e.button===0||!r)&&Ide.onPointerDown(e,{handleId:n(),nodeId:c,isTarget:w(u),connectionRadius:f.connectionRadius,domNode:f.domNode,nodeLookup:f.nodeLookup,connectionMode:f.connectionMode,lib:`svelte`,autoPanOnConnect:f.autoPanOnConnect,autoPanSpeed:f.autoPanSpeed,flowId:f.flowId,isValidConnection:t.isValidConnection||((...e)=>f.isValidConnection?.(...e)??!0),updateConnection:f.updateConnection,cancelConnection:f.cancelConnection,panBy:f.panBy,onConnect:S,onConnectStart:f.onconnectstart,onConnectEnd:(...e)=>f.onconnectend?.(...e),getTransform:()=>[f.viewport.x,f.viewport.y,f.viewport.zoom],getFromHandle:()=>f.connection.fromHandle,dragThreshold:f.connectionDragThreshold,handleDomNode:e.currentTarget})}function te(e){if(!c||!f.clickConnectStartHandle&&!a())return;if(!f.clickConnectStartHandle){f.onclickconnectstart?.(e,{nodeId:c,handleId:n(),handleType:r()}),f.clickConnectStartHandle={nodeId:c,type:r(),id:n()};return}let i=qb(e.target),o=t.isValidConnection??f.isValidConnection,{connectionMode:s,clickConnectStartHandle:l,flowId:u,nodeLookup:d}=f,{connection:p,isValid:m}=Ide.isValid(e,{handle:{nodeId:c,id:n(),type:r()},connectionMode:s,fromNodeId:l.nodeId,fromHandleId:l.id??null,fromType:l.type,isValidConnection:o,flowId:u,doc:i,lib:`svelte`,nodeLookup:d});m&&p&&S(p);let h=structuredClone(Qe(f.connection));delete h.inProgress,h.toPosition=h.toHandle?h.toHandle.position:null,f.onclickconnectend?.(e,h),f.clickConnectStartHandle=null}var C=qde(),re=()=>{};Jr(C,()=>({"data-handleid":n(),"data-nodeid":c,"data-handlepos":i(),"data-id":`${f.flowId??``}-${c??``}-${n()??`null`??``}-${r()??``}`,class:[`svelte-flow__handle`,`svelte-flow__handle-${i()}`,f.noDragClass,f.noPanClass,i(),t.class],onmousedown:ee,ontouchstart:ee,onclick:f.clickConnect?te:void 0,onkeypress:re,style:t.style,role:`button`,"aria-label":w(p)[`handle.ariaLabel`],tabindex:`-1`,...s,[Vr]:{valid:w(x),connectingto:w(y),connectingfrom:w(v),source:!w(u),target:w(u),connectablestart:a(),connectableend:o(),connectable:w(d),connectionindicator:w(d)&&(!w(_)||w(b))&&(w(_)||f.clickConnectStartHandle?o():a())}})),br(en(C),()=>t.children??ne),We(C),gr(e,C),at()}var Jx=fr(`<!> <!>`,1);function Yx(e,t){it(t,!0);let n=ii(t,`targetPosition`,19,()=>pb.Top),r=ii(t,`sourcePosition`,19,()=>pb.Bottom);var i=Jx(),a=tn(i);qx(a,{type:`target`,get position(){return n()}});var o=nn(a);qx(nn(o),{type:`source`,get position(){return r()}}),_n(()=>_r(o,` ${t.data?.label??``} `)),gr(e,i),at()}var Xx=fr(` <!>`,1);function Zx(e,t){it(t,!0);let n=ii(t,`data`,19,()=>({label:`Node`})),r=ii(t,`sourcePosition`,19,()=>pb.Bottom);Ge();var i=Xx(),a=tn(i);qx(nn(a),{type:`source`,get position(){return r()}}),_n(()=>_r(a,`${n()?.label??``} `)),gr(e,i),at()}var Jde=fr(` <!>`,1);function Qx(e,t){it(t,!0);let n=ii(t,`data`,19,()=>({label:`Node`})),r=ii(t,`targetPosition`,19,()=>pb.Top);Ge();var i=Jde(),a=tn(i);qx(nn(a),{type:`target`,get position(){return r()}}),_n(()=>_r(a,`${n()?.label??``} `)),gr(e,i),at()}function $x(e,t){}function eS(e,t,n){if(!n||!t)return;let r=n===`root`?t:t.querySelector(`.svelte-flow__${n}`);r&&r.appendChild(e)}function Yde(e,t){let n=It(pS),r=It(()=>w(n).domNode),i;return w(r)?eS(e,w(r),t):i=Kee(()=>{fn(()=>{eS(e,w(r),t),i?.()})}),{async update(t){eS(e,w(r),t)},destroy(){e.parentNode&&e.parentNode.removeChild(e),i?.()}}}function Xde(){let e=Wt(typeof window>`u`);if(w(e)){let t=Kee(()=>{fn(()=>{Gt(e,!1),t?.()})})}return{get value(){return w(e)}}}var Zde=e=>hb(e),Qde=e=>mb(e);function tS(e){return e===void 0?void 0:`${e}px`}var nS={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$de=fr(`<div><!></div>`);function rS(e,t){it(t,!0);let n=ii(t,`x`,3,0),r=ii(t,`y`,3,0),i=ii(t,`selectEdgeOnClick`,3,!1),a=ii(t,`transparent`,3,!1),o=ni(t,[`$$slots`,`$$events`,`$$legacy`,`x`,`y`,`width`,`height`,`selectEdgeOnClick`,`transparent`,`class`,`children`]),s=pS(),c=Gx(`EdgeLabel must be used within a Custom Edge component`),l=It(()=>s.visible.edges.get(c)?.zIndex);var u=$de(),d=()=>{i()&&c&&s.handleEdgeSelection(c)};Jr(u,e=>({class:[`svelte-flow__edge-label`,{transparent:a()},t.class],tabindex:`-1`,onclick:d,...o,[Hr]:e}),[()=>({display:Xde().value?`none`:void 0,cursor:i()?`pointer`:void 0,transform:`translate(-50%, -50%) translate(${n()??``}px,${r()??``}px)`,"pointer-events":`all`,width:tS(t.width),height:tS(t.height),"z-index":w(l)})],void 0,void 0,`svelte-190ul31`),br(en(u),()=>t.children??ne),We(u),jr(u,(e,t)=>Yde?.(e,t),()=>`edge-labels`),gr(e,u),at()}var efe=pr(`<path></path>`),tfe=pr(`<path fill="none"></path><!><!>`,1);function iS(e,t){let n=ii(t,`interactionWidth`,3,20),r=ni(t,[`$$slots`,`$$events`,`$$legacy`,`id`,`path`,`label`,`labelX`,`labelY`,`labelStyle`,`markerStart`,`markerEnd`,`style`,`interactionWidth`,`class`]);var i=tfe(),a=tn(i),o=nn(a),s=e=>{var i=efe();Jr(i,()=>({d:t.path,"stroke-opacity":0,"stroke-width":n(),fill:`none`,class:`svelte-flow__edge-interaction`,...r})),gr(e,i)};Cr(o,e=>{n()>0&&e(s)});var c=nn(o),l=e=>{rS(e,{get x(){return t.labelX},get y(){return t.labelY},get style(){return t.labelStyle},selectEdgeOnClick:!0,children:(e,n)=>{Ge();var r=mr();_n(()=>_r(r,t.label)),gr(e,r)},$$slots:{default:!0}})};Cr(c,e=>{t.label&&e(l)}),_n(()=>{qr(a,`id`,t.id),qr(a,`d`,t.path),Ir(a,0,Mr([`svelte-flow__edge-path`,t.class])),qr(a,`marker-start`,t.markerStart),qr(a,`marker-end`,t.markerEnd),Rr(a,t.style)}),gr(e,i)}function aS(e,t){it(t,!0);let n=It(()=>ex({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,curvature:t.pathOptions?.curvature})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get id(){return t.id},get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}function nfe(e,t){it(t,!0);let n=It(()=>cx({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}function oS(e,t){it(t,!0);let n=It(()=>ox({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}function rfe(e,t){it(t,!0);let n=It(()=>cx({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,borderRadius:0})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}var sS=class{#e;#t;constructor(e,t){this.#e=e,this.#t=Mt(t)}get current(){return this.#t(),this.#e()}},ife=/\(.+\)/,afe=new Set([`all`,`print`,`screen`,`and`,`or`,`not`,`only`]),cS=class extends sS{constructor(e,t){let n=ife.test(e)||e.split(/[\s,]+/).some(e=>afe.has(e.trim()))?e:`(${e})`,r=window.matchMedia(n);super(()=>r.matches,e=>ir(r,`change`,e))}};function lS(e,t,n,r){let i=new Map;return yb(e,{x:0,y:0,width:n,height:r},t,!0).forEach(e=>{i.set(e.id,e)}),i}function uS(e){let{edges:t,defaultEdgeOptions:n,nodeLookup:r,previousEdges:i,connectionMode:a,onerror:o,onlyRenderVisible:s,elevateEdgesOnSelect:c,zIndexMode:l}=e,u=new Map;for(let d of t){let t=r.get(d.source),f=r.get(d.target);if(!t||!f)continue;if(s){let{visibleNodes:n,transform:r,width:i,height:a}=e;if(rx({sourceNode:t,targetNode:f,width:i,height:a,transform:r}))n.set(t.id,t),n.set(f.id,f);else continue}let p=i.get(d.id);if(p&&d===p.edge&&t==p.sourceNode&&f==p.targetNode){u.set(d.id,p);continue}let m=Cde({id:d.id,sourceNode:t,targetNode:f,sourceHandle:d.sourceHandle||null,targetHandle:d.targetHandle||null,connectionMode:a,onError:o});m&&u.set(d.id,{...n,...d,...m,zIndex:nx({selected:d.selected,zIndex:d.zIndex??n.zIndex,sourceNode:t,targetNode:f,elevateOnSelect:c,zIndexMode:l}),sourceNode:t,targetNode:f,edge:d})}return u}var dS={input:Zx,output:Qx,default:Yx,group:$x},fS={straight:oS,smoothstep:nfe,default:aS,step:rfe};function j(e,t,n,r,i,a){return t&&!n&&r&&i?Hb(vb(a,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),r,i,.5,2,.1):n??{x:0,y:0,zoom:1}}function ofe(e){class t{#e=It(()=>e.props.id??`1`);get flowId(){return w(this.#e)}set flowId(e){Gt(this.#e,e)}#t=Wt(null);get domNode(){return w(this.#t)}set domNode(e){Gt(this.#t,e)}#n=Wt(null);get panZoom(){return w(this.#n)}set panZoom(e){Gt(this.#n,e)}#r=Wt(e.width??0);get width(){return w(this.#r)}set width(e){Gt(this.#r,e)}#i=Wt(e.height??0);get height(){return w(this.#i)}set height(e){Gt(this.#i,e)}#a=Wt(e.props.zIndexMode??`basic`);get zIndexMode(){return w(this.#a)}set zIndexMode(e){Gt(this.#a,e)}#o=It(()=>{let t=bx(e.nodes,this.nodeLookup,this.parentLookup,{nodeExtent:this.nodeExtent,nodeOrigin:this.nodeOrigin,elevateNodesOnSelect:e.props.elevateNodesOnSelect??!0,checkEquality:!0,zIndexMode:this.zIndexMode});return this.fitViewQueued&&t&&(this.fitViewOptions?.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),t});get nodesInitialized(){return w(this.#o)}set nodesInitialized(e){Gt(this.#o,e)}#s=It(()=>this.panZoom!==null);get viewportInitialized(){return w(this.#s)}set viewportInitialized(e){Gt(this.#s,e)}#c=It(()=>(Dx(this.connectionLookup,this.edgeLookup,e.edges),e.edges));get _edges(){return w(this.#c)}set _edges(e){Gt(this.#c,e)}get nodes(){return this.nodesInitialized,e.nodes}set nodes(t){e.nodes=t}get edges(){return this._edges}set edges(t){e.edges=t}_prevSelectedNodes=[];_prevSelectedNodeIds=new Set;#l=It(()=>{let e=this._prevSelectedNodeIds.size,t=new Set,n=this.nodes.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedNodeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=n),this._prevSelectedNodeIds=t,this._prevSelectedNodes});get selectedNodes(){return w(this.#l)}set selectedNodes(e){Gt(this.#l,e)}_prevSelectedEdges=[];_prevSelectedEdgeIds=new Set;#u=It(()=>{let e=this._prevSelectedEdgeIds.size,t=new Set,n=this.edges.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedEdgeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=n),this._prevSelectedEdgeIds=t,this._prevSelectedEdges});get selectedEdges(){return w(this.#u)}set selectedEdges(e){Gt(this.#u,e)}selectionChangeHandlers=new Map;nodeLookup=new Map;parentLookup=new Map;connectionLookup=new Map;edgeLookup=new Map;_prevVisibleEdges=new Map;#d=It(()=>{let{nodes:t,_edges:n,_prevVisibleEdges:r,nodeLookup:i,connectionMode:a,onerror:o,onlyRenderVisibleElements:s,defaultEdgeOptions:c,zIndexMode:l}=this,u,d,f={edges:n,defaultEdgeOptions:c,previousEdges:r,nodeLookup:i,connectionMode:a,elevateEdgesOnSelect:e.props.elevateEdgesOnSelect??!0,zIndexMode:l,onerror:o};if(s){let{viewport:e,width:t,height:n}=this,r=[e.x,e.y,e.zoom];u=lS(i,r,t,n),d=uS({...f,onlyRenderVisible:!0,visibleNodes:u,transform:r,width:t,height:n})}else u=this.nodeLookup,d=uS(f);return{nodes:u,edges:d}});get visible(){return w(this.#d)}set visible(e){Gt(this.#d,e)}#f=It(()=>e.props.nodesDraggable??!0);get nodesDraggable(){return w(this.#f)}set nodesDraggable(e){Gt(this.#f,e)}#p=It(()=>e.props.nodesConnectable??!0);get nodesConnectable(){return w(this.#p)}set nodesConnectable(e){Gt(this.#p,e)}#m=It(()=>e.props.elementsSelectable??!0);get elementsSelectable(){return w(this.#m)}set elementsSelectable(e){Gt(this.#m,e)}#h=It(()=>e.props.nodesFocusable??!0);get nodesFocusable(){return w(this.#h)}set nodesFocusable(e){Gt(this.#h,e)}#g=It(()=>e.props.edgesFocusable??!0);get edgesFocusable(){return w(this.#g)}set edgesFocusable(e){Gt(this.#g,e)}#_=It(()=>e.props.disableKeyboardA11y??!1);get disableKeyboardA11y(){return w(this.#_)}set disableKeyboardA11y(e){Gt(this.#_,e)}#v=It(()=>e.props.minZoom??.5);get minZoom(){return w(this.#v)}set minZoom(e){Gt(this.#v,e)}#y=It(()=>e.props.maxZoom??2);get maxZoom(){return w(this.#y)}set maxZoom(e){Gt(this.#y,e)}#b=It(()=>e.props.nodeOrigin??[0,0]);get nodeOrigin(){return w(this.#b)}set nodeOrigin(e){Gt(this.#b,e)}#x=It(()=>e.props.nodeExtent??sb);get nodeExtent(){return w(this.#x)}set nodeExtent(e){Gt(this.#x,e)}#S=It(()=>e.props.translateExtent??sb);get translateExtent(){return w(this.#S)}set translateExtent(e){Gt(this.#S,e)}#C=It(()=>e.props.defaultEdgeOptions??{});get defaultEdgeOptions(){return w(this.#C)}set defaultEdgeOptions(e){Gt(this.#C,e)}#w=It(()=>e.props.nodeDragThreshold??1);get nodeDragThreshold(){return w(this.#w)}set nodeDragThreshold(e){Gt(this.#w,e)}#T=It(()=>e.props.autoPanOnNodeDrag??!0);get autoPanOnNodeDrag(){return w(this.#T)}set autoPanOnNodeDrag(e){Gt(this.#T,e)}#E=It(()=>e.props.autoPanOnConnect??!0);get autoPanOnConnect(){return w(this.#E)}set autoPanOnConnect(e){Gt(this.#E,e)}#D=It(()=>e.props.autoPanOnNodeFocus??!0);get autoPanOnNodeFocus(){return w(this.#D)}set autoPanOnNodeFocus(e){Gt(this.#D,e)}#O=It(()=>e.props.autoPanSpeed??15);get autoPanSpeed(){return w(this.#O)}set autoPanSpeed(e){Gt(this.#O,e)}#k=It(()=>e.props.connectionDragThreshold??1);get connectionDragThreshold(){return w(this.#k)}set connectionDragThreshold(e){Gt(this.#k,e)}fitViewQueued=e.props.fitView??!1;fitViewOptions=e.props.fitViewOptions;fitViewResolver=null;#A=It(()=>e.props.snapGrid??null);get snapGrid(){return w(this.#A)}set snapGrid(e){Gt(this.#A,e)}#j=Wt(!1);get dragging(){return w(this.#j)}set dragging(e){Gt(this.#j,e)}#M=Wt(null);get selectionRect(){return w(this.#M)}set selectionRect(e){Gt(this.#M,e)}#N=Wt(!1);get selectionKeyPressed(){return w(this.#N)}set selectionKeyPressed(e){Gt(this.#N,e)}#P=Wt(!1);get multiselectionKeyPressed(){return w(this.#P)}set multiselectionKeyPressed(e){Gt(this.#P,e)}#F=Wt(!1);get deleteKeyPressed(){return w(this.#F)}set deleteKeyPressed(e){Gt(this.#F,e)}#I=Wt(!1);get panActivationKeyPressed(){return w(this.#I)}set panActivationKeyPressed(e){Gt(this.#I,e)}#L=Wt(!1);get zoomActivationKeyPressed(){return w(this.#L)}set zoomActivationKeyPressed(e){Gt(this.#L,e)}#R=Wt(null);get selectionRectMode(){return w(this.#R)}set selectionRectMode(e){Gt(this.#R,e)}#z=Wt(``);get ariaLiveMessage(){return w(this.#z)}set ariaLiveMessage(e){Gt(this.#z,e)}#B=It(()=>e.props.selectionMode??ub.Partial);get selectionMode(){return w(this.#B)}set selectionMode(e){Gt(this.#B,e)}#V=It(()=>({...dS,...e.props.nodeTypes}));get nodeTypes(){return w(this.#V)}set nodeTypes(e){Gt(this.#V,e)}#H=It(()=>({...fS,...e.props.edgeTypes}));get edgeTypes(){return w(this.#H)}set edgeTypes(e){Gt(this.#H,e)}#U=It(()=>e.props.noPanClass??`nopan`);get noPanClass(){return w(this.#U)}set noPanClass(e){Gt(this.#U,e)}#W=It(()=>e.props.noDragClass??`nodrag`);get noDragClass(){return w(this.#W)}set noDragClass(e){Gt(this.#W,e)}#G=It(()=>e.props.noWheelClass??`nowheel`);get noWheelClass(){return w(this.#G)}set noWheelClass(e){Gt(this.#G,e)}#K=It(()=>pde(e.props.ariaLabelConfig));get ariaLabelConfig(){return w(this.#K)}set ariaLabelConfig(e){Gt(this.#K,e)}#q=Wt(j(this.nodesInitialized,e.props.fitView,e.props.initialViewport,this.width,this.height,this.nodeLookup));get _viewport(){return w(this.#q)}set _viewport(e){Gt(this.#q,e)}get viewport(){return e.viewport??this._viewport}set viewport(t){e.viewport&&=t,this._viewport=t}#J=Wt(nde);get _connection(){return w(this.#J)}set _connection(e){Gt(this.#J,e)}#Y=It(()=>this._connection.inProgress?{...this._connection,to:zb(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection);get connection(){return w(this.#Y)}set connection(e){Gt(this.#Y,e)}#X=It(()=>e.props.connectionMode??cb.Strict);get connectionMode(){return w(this.#X)}set connectionMode(e){Gt(this.#X,e)}#Z=It(()=>e.props.connectionRadius??20);get connectionRadius(){return w(this.#Z)}set connectionRadius(e){Gt(this.#Z,e)}#Q=It(()=>e.props.isValidConnection??(()=>!0));get isValidConnection(){return w(this.#Q)}set isValidConnection(e){Gt(this.#Q,e)}#$=It(()=>e.props.selectNodesOnDrag??!0);get selectNodesOnDrag(){return w(this.#$)}set selectNodesOnDrag(e){Gt(this.#$,e)}#ee=It(()=>e.props.defaultMarkerColor===void 0?`#b1b1b7`:e.props.defaultMarkerColor);get defaultMarkerColor(){return w(this.#ee)}set defaultMarkerColor(e){Gt(this.#ee,e)}#te=It(()=>Tde(e.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd}));get markers(){return w(this.#te)}set markers(e){Gt(this.#te,e)}#ne=It(()=>e.props.onlyRenderVisibleElements??!1);get onlyRenderVisibleElements(){return w(this.#ne)}set onlyRenderVisibleElements(e){Gt(this.#ne,e)}#re=It(()=>e.props.onflowerror??Lb);get onerror(){return w(this.#re)}set onerror(e){Gt(this.#re,e)}#ie=It(()=>e.props.ondelete);get ondelete(){return w(this.#ie)}set ondelete(e){Gt(this.#ie,e)}#ae=It(()=>e.props.onbeforedelete);get onbeforedelete(){return w(this.#ae)}set onbeforedelete(e){Gt(this.#ae,e)}#oe=It(()=>e.props.onbeforeconnect);get onbeforeconnect(){return w(this.#oe)}set onbeforeconnect(e){Gt(this.#oe,e)}#se=It(()=>e.props.onconnect);get onconnect(){return w(this.#se)}set onconnect(e){Gt(this.#se,e)}#ce=It(()=>e.props.onconnectstart);get onconnectstart(){return w(this.#ce)}set onconnectstart(e){Gt(this.#ce,e)}#le=It(()=>e.props.onconnectend);get onconnectend(){return w(this.#le)}set onconnectend(e){Gt(this.#le,e)}#ue=It(()=>e.props.onbeforereconnect);get onbeforereconnect(){return w(this.#ue)}set onbeforereconnect(e){Gt(this.#ue,e)}#de=It(()=>e.props.onreconnect);get onreconnect(){return w(this.#de)}set onreconnect(e){Gt(this.#de,e)}#fe=It(()=>e.props.onreconnectstart);get onreconnectstart(){return w(this.#fe)}set onreconnectstart(e){Gt(this.#fe,e)}#pe=It(()=>e.props.onreconnectend);get onreconnectend(){return w(this.#pe)}set onreconnectend(e){Gt(this.#pe,e)}#me=It(()=>e.props.clickConnect??!0);get clickConnect(){return w(this.#me)}set clickConnect(e){Gt(this.#me,e)}#he=It(()=>e.props.onclickconnectstart);get onclickconnectstart(){return w(this.#he)}set onclickconnectstart(e){Gt(this.#he,e)}#ge=It(()=>e.props.onclickconnectend);get onclickconnectend(){return w(this.#ge)}set onclickconnectend(e){Gt(this.#ge,e)}#_e=Wt(null);get clickConnectStartHandle(){return w(this.#_e)}set clickConnectStartHandle(e){Gt(this.#_e,e)}#ve=It(()=>e.props.onselectiondrag);get onselectiondrag(){return w(this.#ve)}set onselectiondrag(e){Gt(this.#ve,e)}#ye=It(()=>e.props.onselectiondragstart);get onselectiondragstart(){return w(this.#ye)}set onselectiondragstart(e){Gt(this.#ye,e)}#be=It(()=>e.props.onselectiondragstop);get onselectiondragstop(){return w(this.#be)}set onselectiondragstop(e){Gt(this.#be,e)}resolveFitView=async()=>{this.panZoom&&(await Sb({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),this.fitViewResolver?.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)};_prefersDark=new cS(`(prefers-color-scheme: dark)`,e.props.colorModeSSR===`dark`);#xe=It(()=>e.props.colorMode===`system`?this._prefersDark.current?`dark`:`light`:e.props.colorMode??`light`);get colorMode(){return w(this.#xe)}set colorMode(e){Gt(this.#xe,e)}constructor(){}resetStoreValues(){this.dragging=!1,this.selectionRect=null,this.selectionRectMode=null,this.selectionKeyPressed=!1,this.multiselectionKeyPressed=!1,this.deleteKeyPressed=!1,this.panActivationKeyPressed=!1,this.zoomActivationKeyPressed=!1,this._connection=nde,this.clickConnectStartHandle=null,this.viewport=e.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=``}}return new t}function pS(){let e=nt(mS);if(!e)throw Error(`To call useStore outside of <SvelteFlow /> you need to wrap your component in a <SvelteFlowProvider />`);return e.getStore()}var mS=Symbol();function sfe(e){let t=ofe(e);function n(e){t.nodeTypes={...dS,...e}}function r(e){t.edgeTypes={...fS,...e}}function i(e){t.edges=ax(e,t.edges)}let a=(e,n=!1)=>{t.nodes=t.nodes.map(r=>{if(t.connection.inProgress&&t.connection.fromNode.id===r.id){let e=t.nodeLookup.get(r.id);e&&(t.connection={...t.connection,from:lx(e,t.connection.fromHandle,pb.Left,!0)})}let i=e.get(r.id);return i?{...r,position:i.position,dragging:n}:r})};function o(e){let{changes:n,updatedInternals:r}=wx(e,t.nodeLookup,t.parentLookup,t.domNode,t.nodeOrigin,t.nodeExtent,t.zIndexMode);if(!r)return;_x(t.nodeLookup,t.parentLookup,{nodeOrigin:t.nodeOrigin,nodeExtent:t.nodeExtent,zIndexMode:t.zIndexMode}),t.fitViewQueued&&t.resolveFitView();let i=new Map;for(let e of n){let n=t.nodeLookup.get(e.id)?.internals.userNode;if(!n)continue;let r={...n};switch(e.type){case`dimensions`:{let t={...r.measured,...e.dimensions};e.setAttributes&&(r.width=e.dimensions?.width??r.width,r.height=e.dimensions?.height??r.height),r.measured=t;break}case`position`:r.position=e.position??r.position;break}i.set(e.id,r)}t.nodes=t.nodes.map(e=>i.get(e.id)??e)}function s(e){let n=t.fitViewResolver??Promise.withResolvers();return t.fitViewQueued=!0,t.fitViewOptions=e,t.fitViewResolver=n,t.nodes=[...t.nodes],n.promise}async function c(e,n,r){let i=r?.zoom===void 0?t.maxZoom:r.zoom,a=t.panZoom;return a?(await a.setViewport({x:t.width/2-e*i,y:t.height/2-n*i,zoom:i},{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)}function l(e,n){let r=t.panZoom;return r?r.scaleBy(e,n):Promise.resolve(!1)}function u(e){return l(1.2,e)}function d(e){return l(1/1.2,e)}function f(e){let n=t.panZoom;n&&(n.setScaleExtent([e,t.maxZoom]),t.minZoom=e)}function p(e){let n=t.panZoom;n&&(n.setScaleExtent([t.minZoom,e]),t.maxZoom=e)}function m(e){let n=t.panZoom;n&&(n.setTranslateExtent(e),t.translateExtent=e)}function h(e,t=null){let n=!1,r=e.map(e=>(!t||t.has(e.id))&&e.selected?(n=!0,{...e,selected:!1}):e);return[n,r]}function g(e){let n=e?.nodes?new Set(e.nodes.map(e=>e.id)):null,[r,i]=h(t.nodes,n);r&&(t.nodes=i);let a=e?.edges?new Set(e.edges.map(e=>e.id)):null,[o,s]=h(t.edges,a);o&&(t.edges=s)}function _(e){let n=t.multiselectionKeyPressed;t.nodes=t.nodes.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({nodes:[]})}function v(e){let n=t.multiselectionKeyPressed;t.edges=t.edges.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({edges:[]})}function y(e,n,r){let i=t.nodeLookup.get(e);if(!i){console.warn(`012`,ob.error012(e));return}t.selectionRect=null,t.selectionRectMode=null,i.selected?(n||i.selected&&t.multiselectionKeyPressed)&&(g({nodes:[i],edges:[]}),requestAnimationFrame(()=>r?.blur())):_([e])}function b(e){let n=t.edgeLookup.get(e);if(!n){console.warn(`012`,ob.error012(e));return}(n.selectable||t.elementsSelectable&&n.selectable===void 0)&&(t.selectionRect=null,t.selectionRectMode=null,n.selected?n.selected&&t.multiselectionKeyPressed&&g({nodes:[],edges:[n]}):v([e]))}function x(e,n){let{nodeExtent:r,snapGrid:i,nodeOrigin:o,nodeLookup:s,nodesDraggable:c,onerror:l}=t,u=new Map,d=i?.[0]??5,f=i?.[1]??5,p=e.x*d*n,m=e.y*f*n;for(let e of s.values()){if(!(e.selected&&(e.draggable||c&&e.draggable===void 0)))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+m};i&&(t=Rb(t,i));let{position:n,positionAbsolute:a}=Cb({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:r,nodeOrigin:o,onError:l});e.position=n,e.internals.positionAbsolute=a,u.set(e.id,e)}a(u)}function S(e){return Tx({delta:e,panZoom:t.panZoom,transform:[t.viewport.x,t.viewport.y,t.viewport.zoom],translateExtent:t.translateExtent,width:t.width,height:t.height})}let ee=e=>{t._connection={...e}};function te(){t._connection=nde}function ne(){t.resetStoreValues(),g()}return Object.assign(t,{setNodeTypes:n,setEdgeTypes:r,addEdge:i,updateNodePositions:a,updateNodeInternals:o,zoomIn:u,zoomOut:d,fitView:s,setCenter:c,setMinZoom:f,setMaxZoom:p,setTranslateExtent:m,unselectNodesAndEdges:g,addSelectedNodes:_,addSelectedEdges:v,handleNodeSelection:y,handleEdgeSelection:b,moveSelectedNodes:x,panBy:S,updateConnection:ee,cancelConnection:te,reset:ne})}function cfe(e,t){let{minZoom:n,maxZoom:r,initialViewport:i,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:s,translateExtent:c,setPanZoomInstance:l,onDraggingChange:u,onTransformChange:d}=t,f=Hde({domNode:e,minZoom:n,maxZoom:r,translateExtent:c,viewport:i,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:s,onDraggingChange:u}),p=f.getViewport();return(i.x!==p.x||i.y!==p.y||i.zoom!==p.zoom)&&d([p.x,p.y,p.zoom]),l(f),f.update(t),{update(e){f.update(e)}}}var hS=fr(`<div class="svelte-flow__zoom svelte-flow__container"><!></div>`);function lfe(e,t){it(t,!0);let n=ii(t,`store`,15),r=It(()=>n().panActivationKeyPressed||t.panOnDrag),i=It(()=>n().panActivationKeyPressed||t.panOnScroll),{viewport:a}=n(),o=!1;fn(()=>{!o&&n().viewportInitialized&&(t.oninit?.(),o=!0)});var s=hS();br(en(s),()=>t.children),We(s),jr(s,(e,t)=>cfe?.(e,t),()=>({viewport:n().viewport,minZoom:n().minZoom,maxZoom:n().maxZoom,initialViewport:a,onDraggingChange:e=>{n(n().dragging=e,!0)},setPanZoomInstance:e=>{n(n().panZoom=e,!0)},onPanZoomStart:t.onmovestart,onPanZoom:t.onmove,onPanZoomEnd:t.onmoveend,zoomOnScroll:t.zoomOnScroll,zoomOnDoubleClick:t.zoomOnDoubleClick,zoomOnPinch:t.zoomOnPinch,panOnScroll:w(i),panOnDrag:w(r),panOnScrollSpeed:t.panOnScrollSpeed,panOnScrollMode:t.panOnScrollMode,zoomActivationKeyPressed:n().zoomActivationKeyPressed,preventScrolling:typeof t.preventScrolling==`boolean`?t.preventScrolling:!0,noPanClassName:n().noPanClass,noWheelClassName:n().noWheelClass,userSelectionActive:!!n().selectionRect,translateExtent:n().translateExtent,lib:`svelte`,paneClickDistance:t.paneClickDistance,selectionOnDrag:t.selectionOnDrag,onTransformChange:e=>{n(n().viewport={x:e[0],y:e[1],zoom:e[2]},!0)},connectionInProgress:n().connection.inProgress})),gr(e,s),at()}function gS(e,t){return n=>{n.target===t&&e?.(n)}}function _S(e){return t=>{let n=e.has(t.id);return!!t.selected===n?t:{...t,selected:n}}}function vS(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var ufe=fr(`<div><!></div>`);function dfe(e,t){it(t,!0);let n=ii(t,`store`,15),r=ii(t,`panOnDrag`,3,!0),i=ii(t,`paneClickDistance`,3,1),a,o=null,s=new Set,c=new Set,l=It(()=>n().panActivationKeyPressed||r()),u=It(()=>n().selectionKeyPressed||!!n().selectionRect||t.selectionOnDrag&&w(l)!==!0),d=It(()=>n().elementsSelectable&&(w(u)||n().selectionRectMode===`user`)),f=!1;function p(e){if(o=a?.getBoundingClientRect(),!o)return;let r=e.target===a,i=!r&&!!e.target.closest(`.nokey`),s=t.selectionOnDrag&&r||n().selectionKeyPressed;if(i||!w(u)||!s||e.button!==0||!e.isPrimary)return;e.target?.setPointerCapture?.(e.pointerId),f=!1;let{x:c,y:l}=Xb(e,o);n(n().selectionRect={width:0,height:0,startX:c,startY:l,x:c,y:l},!0),r||(e.stopPropagation(),e.preventDefault())}function m(e){if(!w(u)||!o||!n().selectionRect)return;let r=Xb(e,o),{startX:a=0,startY:l=0}=n().selectionRect;if(!f){let o=n().selectionKeyPressed?0:i();if(Math.hypot(r.x-a,r.y-l)<=o)return;n().unselectNodesAndEdges(),t.onselectionstart?.(e)}f=!0;let d={...n().selectionRect,x:r.x<a?r.x:a,y:r.y<l?r.y:l,width:Math.abs(r.x-a),height:Math.abs(r.y-l)},p=s,m=c;s=new Set(yb(n().nodeLookup,d,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===ub.Partial,!0).map(e=>e.id));let h=n().defaultEdgeOptions.selectable??!0;c=new Set;for(let e of s){let t=n().connectionLookup.get(e);if(t)for(let{edgeId:e}of t.values()){let t=n().edgeLookup.get(e);t&&(t.selectable??h)&&c.add(e)}}vS(p,s)||n(n().nodes=n().nodes.map(_S(s)),!0),vS(m,c)||n(n().edges=n().edges.map(_S(c)),!0),n(n().selectionRectMode=`user`,!0),n(n().selectionRect=d,!0)}function h(e){e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!f&&e.target===a&&v?.(e),n(n().selectionRect=null,!0),f&&n(n().selectionRectMode=s.size>0?`nodes`:null,!0),f&&t.onselectionend?.(e))}let g=e=>{if(Array.isArray(w(l))&&w(l).includes(2)){e.preventDefault();return}t.onpanecontextmenu?.({event:e})},_=e=>{f&&=(e.stopPropagation(),!1)};function v(e){if(f||n().connection.inProgress){f=!1;return}t.onpaneclick?.({event:e}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var y=ufe();let b;var x=It(()=>w(d)?void 0:gS(v,a)),S=It(()=>gS(g,a));br(en(y),()=>t.children),We(y),$r(y,e=>a=e,()=>a),_n(e=>b=Ir(y,1,`svelte-flow__pane svelte-flow__container`,null,b,e),[()=>({draggable:r()===!0||Array.isArray(r())&&r().includes(0),dragging:n().dragging,selection:w(u)})]),or(`click`,y,function(...e){w(x)?.apply(this,e)}),ar(`pointerdown`,y,function(...e){(w(d)?p:void 0)?.apply(this,e)},!0),or(`pointermove`,y,function(...e){(w(d)?m:void 0)?.apply(this,e)}),or(`pointerup`,y,function(...e){(w(d)?h:void 0)?.apply(this,e)}),or(`contextmenu`,y,function(...e){w(S)?.apply(this,e)}),ar(`click`,y,function(...e){(w(d)?_:void 0)?.apply(this,e)},!0),gr(e,y),at()}sr([`click`,`pointermove`,`pointerup`,`contextmenu`]);var ffe=fr(`<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>`);function yS(e,t){it(t,!0);var n=ffe();let r;br(en(n),()=>t.children),We(n),_n(()=>r=Rr(n,``,r,{transform:`translate(${t.store.viewport.x??``}px, ${t.store.viewport.y??``}px) scale(${t.store.viewport.zoom??``})`})),gr(e,n),at()}function bS(e,t){let{store:n,onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o}=t,s=kde({onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o,getStoreItems:()=>{let{snapGrid:e,viewport:t}=n;return{nodes:n.nodes,nodeLookup:n.nodeLookup,edges:n.edges,nodeExtent:n.nodeExtent,snapGrid:e||[0,0],snapToGrid:!!e,nodeOrigin:n.nodeOrigin,multiSelectionActive:n.multiselectionKeyPressed,domNode:n.domNode,transform:[t.x,t.y,t.zoom],autoPanOnNodeDrag:n.autoPanOnNodeDrag,nodesDraggable:n.nodesDraggable,selectNodesOnDrag:n.selectNodesOnDrag,nodeDragThreshold:n.nodeDragThreshold,unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,onSelectionDrag:n.onselectiondrag,onSelectionDragStart:n.onselectiondragstart,onSelectionDragStop:n.onselectiondragstop,panBy:n.panBy}}});function c(e,t){if(t.disabled){s.destroy();return}s.update({domNode:e,noDragClassName:t.noDragClass,handleSelector:t.handleSelector,nodeId:t.nodeId,isSelectable:t.isSelectable,nodeClickDistance:t.nodeClickDistance})}return c(e,t),{update(t){c(e,t)},destroy(){s.destroy()}}}var pfe=fr(`<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-1g71opt"> </div>`),mfe=fr(`<div class="a11y-hidden svelte-1g71opt"> </div> <div class="a11y-hidden svelte-1g71opt"> </div> <!>`,1);function xS(e,t){it(t,!0);var n=mfe(),r=tn(n),i=en(r,!0);We(r);var a=nn(r,2),o=en(a,!0);We(a);var s=nn(a,2),c=e=>{var n=pfe(),r=en(n,!0);We(n),_n(()=>{qr(n,`id`,`${hfe}-${t.store.flowId}`),_r(r,t.store.ariaLiveMessage)}),gr(e,n)};Cr(s,e=>{t.store.disableKeyboardA11y||e(c)}),_n(()=>{qr(r,`id`,`${SS}-${t.store.flowId}`),_r(i,t.store.disableKeyboardA11y?t.store.ariaLabelConfig[`node.a11yDescription.default`]:t.store.ariaLabelConfig[`node.a11yDescription.keyboardDisabled`]),qr(a,`id`,`${M}-${t.store.flowId}`),_r(o,t.store.ariaLabelConfig[`edge.a11yDescription.default`])}),gr(e,n),at()}var SS=`svelte-flow__node-desc`,M=`svelte-flow__edge-desc`,hfe=`svelte-flow__aria-live`,gfe=fr(`<div><!></div>`);function CS(e,t){it(t,!0);let n=ii(t,`store`,15),r=It(()=>ae(t.node.data,()=>({}),!0)),i=It(()=>ae(t.node.selected,!1)),a=It(()=>t.node.draggable),o=It(()=>t.node.selectable),s=It(()=>ae(t.node.deletable,!0)),c=It(()=>t.node.connectable),l=It(()=>t.node.focusable),u=It(()=>ae(t.node.hidden,!1)),d=It(()=>ae(t.node.dragging,!1)),f=It(()=>ae(t.node.style,``)),p=It(()=>t.node.class),m=It(()=>ae(t.node.type,`default`)),h=It(()=>t.node.parentId),g=It(()=>t.node.sourcePosition),_=It(()=>t.node.targetPosition),v=It(()=>ae(t.node.measured,()=>({width:0,height:0}),!0).width),y=It(()=>ae(t.node.measured,()=>({width:0,height:0}),!0).height),b=It(()=>t.node.initialWidth),x=It(()=>t.node.initialHeight),S=It(()=>t.node.width),ee=It(()=>t.node.height),te=It(()=>t.node.dragHandle),ne=It(()=>ae(t.node.internals.z,0)),C=It(()=>t.node.internals.positionAbsolute.x),re=It(()=>t.node.internals.positionAbsolute.y),ie=It(()=>t.node.internals.userNode),{id:oe}=t.node,se=It(()=>w(a)??n().nodesDraggable),ce=It(()=>w(o)??n().elementsSelectable),le=It(()=>w(c)??n().nodesConnectable),ue=It(()=>dde(t.node)),de=It(()=>!!t.node.internals.handleBounds),fe=It(()=>w(ue)&&w(de)),pe=It(()=>w(l)??n().nodesFocusable);function me(e){return n().parentLookup.has(e)}let he=It(()=>me(oe)),ge=Wt(null),_e=null,ve=w(m),ye=w(g),be=w(_),xe=It(()=>n().nodeTypes[w(m)]??Yx),Se=It(()=>n().ariaLabelConfig);Gde(oe),Wx({get value(){return w(le)}});let Ce=It(()=>{let e=w(v)===void 0?w(S)??w(b):w(S),t=w(y)===void 0?w(ee)??w(x):w(ee);if(!(e===void 0&&t===void 0&&w(f)===void 0))return`${w(f)};${e?`width:${tS(e)};`:``}${t?`height:${tS(t)};`:``}`});fn(()=>{(w(m)!==ve||w(g)!==ye||w(_)!==be)&&w(ge)!==null&&requestAnimationFrame(()=>{w(ge)!==null&&n().updateNodeInternals(new Map([[oe,{id:oe,nodeElement:w(ge),force:!0}]]))}),ve=w(m),ye=w(g),be=w(_)}),fn(()=>{t.resizeObserver&&(!w(fe)||w(ge)!==_e)&&(_e&&t.resizeObserver.unobserve(_e),w(ge)&&t.resizeObserver.observe(w(ge)),_e=w(ge))}),Sr(()=>{_e&&t.resizeObserver?.unobserve(_e)});function we(e){w(ce)&&(!n().selectNodesOnDrag||!w(se)||n().nodeDragThreshold>0)&&n().handleNodeSelection(oe),t.onnodeclick?.({node:w(ie),event:e})}function Te(e){if(!(Yb(e)||n().disableKeyboardA11y))if(ede.includes(e.key)&&w(ce)){let t=e.key===`Escape`;n().handleNodeSelection(oe,t,w(ge))}else w(se)&&t.node.selected&&Object.prototype.hasOwnProperty.call(nS,e.key)&&(e.preventDefault(),n(n().ariaLiveMessage=w(Se)[`node.a11yDescription.ariaLiveMessage`]({direction:e.key.replace(`Arrow`,``).toLowerCase(),x:~~t.node.internals.positionAbsolute.x,y:~~t.node.internals.positionAbsolute.y}),!0),n().moveSelectedNodes(nS[e.key],e.shiftKey?4:1))}let Ee=()=>{if(n().disableKeyboardA11y||!n().autoPanOnNodeFocus||!w(ge)?.matches(`:focus-visible`))return;let{width:e,height:r,viewport:i}=n();yb(new Map([[oe,t.node]]),{x:0,y:0,width:e,height:r},[i.x,i.y,i.zoom],!0).length>0||n().setCenter(t.node.position.x+(t.node.measured.width??0)/2,t.node.position.y+(t.node.measured.height??0)/2,{zoom:i.zoom})};var De=hr(),Oe=tn(De),ke=e=>{var a=gfe();Jr(a,()=>({"data-id":oe,class:[`svelte-flow__node`,`svelte-flow__node-${w(m)}`,w(p)],style:w(Ce),onclick:we,onpointerenter:t.onnodepointerenter?e=>t.onnodepointerenter({node:w(ie),event:e}):void 0,onpointerleave:t.onnodepointerleave?e=>t.onnodepointerleave({node:w(ie),event:e}):void 0,onpointermove:t.onnodepointermove?e=>t.onnodepointermove({node:w(ie),event:e}):void 0,oncontextmenu:t.onnodecontextmenu?e=>t.onnodecontextmenu({node:w(ie),event:e}):void 0,onkeydown:w(pe)?Te:void 0,onfocus:w(pe)?Ee:void 0,tabIndex:w(pe)?0:void 0,role:t.node.ariaRole??(w(pe)?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":n().disableKeyboardA11y?void 0:`${SS}-${n().flowId}`,...t.node.domAttributes,[Vr]:{dragging:w(d),selected:w(i),draggable:w(se),connectable:w(le),selectable:w(ce),nopan:w(se),parent:w(he)},[Hr]:{"z-index":w(ne),transform:`translate(${w(C)??``}px, ${w(re)??``}px)`,visibility:w(ue)?`visible`:`hidden`}})),Ar(en(a),()=>w(xe),(e,t)=>{t(e,{get data(){return w(r)},get id(){return oe},get selected(){return w(i)},get selectable(){return w(ce)},get deletable(){return w(s)},get sourcePosition(){return w(g)},get targetPosition(){return w(_)},get zIndex(){return w(ne)},get dragging(){return w(d)},get draggable(){return w(se)},get dragHandle(){return w(te)},get parentId(){return w(h)},get type(){return w(m)},get isConnectable(){return w(le)},get positionAbsoluteX(){return w(C)},get positionAbsoluteY(){return w(re)},get width(){return w(S)},get height(){return w(ee)}})}),We(a),jr(a,(e,t)=>bS?.(e,t),()=>({nodeId:oe,isSelectable:w(ce),disabled:!w(se),handleSelector:w(te),noDragClass:n().noDragClass,nodeClickDistance:t.nodeClickDistance,onNodeMouseDown:n().handleNodeSelection,onDrag:(e,n,r,i)=>{t.onnodedrag?.({event:e,targetNode:r,nodes:i})},onDragStart:(e,n,r,i)=>{t.onnodedragstart?.({event:e,targetNode:r,nodes:i})},onDragStop:(e,n,r,i)=>{t.onnodedragstop?.({event:e,targetNode:r,nodes:i})},store:n()})),$r(a,e=>Gt(ge,e),()=>w(ge)),gr(e,a)};Cr(Oe,e=>{w(u)||e(ke)}),gr(e,De),at()}var wS=fr(`<div class="svelte-flow__nodes"></div>`);function TS(e,t){it(t,!0);let n=ii(t,`store`,15),r=typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{let t=new Map;e.forEach(e=>{let n=e.target.getAttribute(`data-id`);t.set(n,{id:n,nodeElement:e.target,force:!0})}),n().updateNodeInternals(t)});Sr(()=>{r?.disconnect()});var i=wS();Er(i,21,()=>n().visible.nodes.values(),e=>e.id,(e,i)=>{CS(e,{get node(){return w(i)},get resizeObserver(){return r},get nodeClickDistance(){return t.nodeClickDistance},get onnodeclick(){return t.onnodeclick},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get onnodecontextmenu(){return t.onnodecontextmenu},get store(){return n()},set store(e){n(e)}})}),We(i),gr(e,i),at()}var _fe=pr(`<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>`);function vfe(e,t){it(t,!0);let n=It(()=>t.edge.id),r=It(()=>t.edge.source),i=It(()=>t.edge.target),a=It(()=>t.edge.sourceX),o=It(()=>t.edge.sourceY),s=It(()=>t.edge.targetX),c=It(()=>t.edge.targetY),l=It(()=>t.edge.sourcePosition),u=It(()=>t.edge.targetPosition),d=It(()=>ae(t.edge.animated,!1)),f=It(()=>ae(t.edge.selected,!1)),p=It(()=>t.edge.label),m=It(()=>t.edge.labelStyle),h=It(()=>ae(t.edge.data,()=>({}),!0)),g=It(()=>t.edge.style),_=It(()=>t.edge.interactionWidth),v=It(()=>ae(t.edge.type,`default`)),y=It(()=>t.edge.sourceHandle),b=It(()=>t.edge.targetHandle),x=It(()=>t.edge.markerStart),S=It(()=>t.edge.markerEnd),ee=It(()=>t.edge.selectable),te=It(()=>t.edge.focusable),ne=It(()=>ae(t.edge.deletable,!0)),C=It(()=>t.edge.hidden),re=It(()=>t.edge.zIndex),ie=It(()=>t.edge.class),oe=It(()=>t.edge.ariaLabel);Kx(w(n));let se=null,ce=It(()=>w(ee)??t.store.elementsSelectable),le=It(()=>w(te)??t.store.edgesFocusable),ue=It(()=>t.store.edgeTypes[w(v)]??aS),de=It(()=>w(x)?`url('#${dx(w(x),t.store.flowId)}')`:void 0),fe=It(()=>w(S)?`url('#${dx(w(S),t.store.flowId)}')`:void 0);function pe(e){let r=t.store.edgeLookup.get(w(n));r&&(w(ce)&&t.store.handleEdgeSelection(w(n)),t.onedgeclick?.({event:e,edge:r}))}function me(e,r){let i=t.store.edgeLookup.get(w(n));i&&r({event:e,edge:i})}function he(e){if(!t.store.disableKeyboardA11y&&ede.includes(e.key)&&w(ce)){let{unselectNodesAndEdges:r,addSelectedEdges:i}=t.store;e.key===`Escape`?(se?.blur(),r({edges:[t.edge]})):i([w(n)])}}var ge=hr(),_e=tn(ge),ve=e=>{var x=_fe();let S;var ee=en(x);Jr(ee,()=>({class:[`svelte-flow__edge`,w(ie)],"data-id":w(n),onclick:pe,oncontextmenu:t.onedgecontextmenu?e=>{me(e,t.onedgecontextmenu)}:void 0,onpointerenter:t.onedgepointerenter?e=>{me(e,t.onedgepointerenter)}:void 0,onpointerleave:t.onedgepointerleave?e=>{me(e,t.onedgepointerleave)}:void 0,"aria-label":w(oe)===null?void 0:w(oe)?w(oe):`Edge from ${w(r)} to ${w(i)}`,"aria-describedby":w(le)?`${M}-${t.store.flowId}`:void 0,role:t.edge.ariaRole??(w(le)?`group`:`img`),"aria-roledescription":`edge`,onkeydown:w(le)?he:void 0,tabindex:w(le)?0:void 0,...t.edge.domAttributes,[Vr]:{animated:w(d),selected:w(f),selectable:w(ce)}})),Ar(en(ee),()=>w(ue),(e,t)=>{t(e,{get id(){return w(n)},get source(){return w(r)},get target(){return w(i)},get sourceX(){return w(a)},get sourceY(){return w(o)},get targetX(){return w(s)},get targetY(){return w(c)},get sourcePosition(){return w(l)},get targetPosition(){return w(u)},get animated(){return w(d)},get selected(){return w(f)},get label(){return w(p)},get labelStyle(){return w(m)},get data(){return w(h)},get style(){return w(g)},get interactionWidth(){return w(_)},get selectable(){return w(ce)},get deletable(){return w(ne)},get type(){return w(v)},get sourceHandleId(){return w(y)},get targetHandleId(){return w(b)},get markerStart(){return w(de)},get markerEnd(){return w(fe)}})}),We(ee),$r(ee,e=>se=e,()=>se),We(x),_n(()=>S=Rr(x,``,S,{"z-index":w(re)})),gr(e,x)};Cr(_e,e=>{w(C)||e(ve)}),gr(e,ge),at()}var ES=pr(`<defs></defs>`);function yfe(e,t){it(t,!1);let n=pS();ei();var r=ES();Er(r,5,()=>n.markers,e=>e.id,(e,t)=>{Sfe(e,ri(()=>w(t)))}),We(r),gr(e,r),at()}var DS=pr(`<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>`),bfe=pr(`<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>`),xfe=pr(`<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>`);function Sfe(e,t){it(t,!0);let n=ii(t,`width`,3,12.5),r=ii(t,`height`,3,12.5),i=ii(t,`markerUnits`,3,`strokeWidth`),a=ii(t,`orient`,3,`auto-start-reverse`),o=ii(t,`color`,3,`none`);var s=xfe(),c=en(s),l=e=>{var n=DS();let r;_n(()=>{qr(n,`stroke-width`,t.strokeWidth),r=Rr(n,``,r,{stroke:o()})}),gr(e,n)},u=e=>{var n=bfe();let r;_n(()=>{qr(n,`stroke-width`,t.strokeWidth),r=Rr(n,``,r,{stroke:o(),fill:o()})}),gr(e,n)};Cr(c,e=>{t.type===fb.Arrow?e(l):t.type===fb.ArrowClosed&&e(u,1)}),We(s),_n(()=>{qr(s,`id`,t.id),qr(s,`markerWidth`,`${n()}`),qr(s,`markerHeight`,`${r()}`),qr(s,`markerUnits`,i()),qr(s,`orient`,a())}),gr(e,s),at()}var Cfe=fr(`<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>`);function wfe(e,t){it(t,!0);let n=ii(t,`store`,15);var r=Cfe(),i=en(r);yfe(en(i),{}),We(i),Er(nn(i,2),17,()=>n().visible.edges.values(),e=>e.id,(e,r)=>{vfe(e,{get edge(){return w(r)},get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return n()},set store(e){n(e)}})}),We(r),gr(e,r),at()}var Tfe=fr(`<div class="svelte-flow__selection svelte-12unaqd"></div>`);function OS(e,t){it(t,!0);let n=ii(t,`x`,3,0),r=ii(t,`y`,3,0),i=ii(t,`width`,3,0),a=ii(t,`height`,3,0),o=ii(t,`isVisible`,3,!0);var s=hr(),c=tn(s),l=e=>{var t=Tfe();let o;_n(e=>o=Rr(t,``,o,e),[()=>({width:typeof i()==`string`?i():tS(i()),height:typeof a()==`string`?a():tS(a()),transform:`translate(${n()}px, ${r()}px)`})]),gr(e,t)};Cr(c,e=>{o()&&e(l)}),gr(e,s),at()}var Efe=fr(`<div><!></div>`);function kS(e,t){it(t,!0);let n=Wt(void 0);fn(()=>{t.store.disableKeyboardA11y||w(n)?.focus({preventScroll:!0})});let r=It(()=>{if(t.store.selectionRectMode===`nodes`){t.store.nodes;let e=vb(t.store.nodeLookup,{filter:e=>!!e.selected});if(e.width>0&&e.height>0)return e}return null});function i(e){let n=t.store.nodes.filter(e=>e.selected);t.onselectioncontextmenu?.({nodes:n,event:e})}function a(e){let n=t.store.nodes.filter(e=>e.selected);t.onselectionclick?.({nodes:n,event:e})}function o(e){Object.prototype.hasOwnProperty.call(nS,e.key)&&(e.preventDefault(),t.store.moveSelectedNodes(nS[e.key],e.shiftKey?4:1))}var s=hr(),c=tn(s),l=e=>{var s=Efe();let c;OS(en(s),{width:`100%`,height:`100%`,x:0,y:0}),We(s),jr(s,(e,t)=>bS?.(e,t),()=>({disabled:!1,store:t.store,onDrag:(e,n,r,i)=>{t.onnodedrag?.({event:e,targetNode:null,nodes:i})},onDragStart:(e,n,r,i)=>{t.onnodedragstart?.({event:e,targetNode:null,nodes:i})},onDragStop:(e,n,r,i)=>{t.onnodedragstop?.({event:e,targetNode:null,nodes:i})}})),$r(s,e=>Gt(n,e),()=>w(n)),_n(e=>{Ir(s,1,Mr([`svelte-flow__selection-wrapper`,t.store.noPanClass]),`svelte-1ei7o7l`),qr(s,`role`,t.store.disableKeyboardA11y?void 0:`button`),qr(s,`tabindex`,t.store.disableKeyboardA11y?void 0:-1),c=Rr(s,``,c,e)},[()=>({width:tS(w(r).width),height:tS(w(r).height),transform:`translate(${w(r).x??``}px, ${w(r).y??``}px)`})]),or(`contextmenu`,s,i),or(`click`,s,a),or(`keydown`,s,function(...e){(t.store.disableKeyboardA11y?void 0:o)?.apply(this,e)}),gr(e,s)},u=It(()=>t.store.selectionRectMode===`nodes`&&w(r)&&Ib(w(r).x)&&Ib(w(r).y));Cr(c,e=>{w(u)&&e(l)}),gr(e,s),at()}sr([`contextmenu`,`click`,`keydown`]);function AS(e){switch(e){case`ctrl`:return 8;case`shift`:return 4;case`alt`:return 2;case`meta`:return 1}}function jS(e,t){let{enabled:n=!0,trigger:r,type:i=`keydown`}=t;function a(t){let n=Array.isArray(r)?r:[r],i=[t.metaKey,t.altKey,t.shiftKey,t.ctrlKey].reduce((e,t,n)=>t?e|1<<n:e,0);for(let r of n){let n={preventDefault:!1,enabled:!0,...r},{modifier:a,key:o,callback:s,preventDefault:c,enabled:l}=n;if(l){if(t.key!==o)continue;if(a===null||a===!1){if(i!==0)continue}else if(a!==void 0&&a?.[0]?.length>0){let e=Array.isArray(a)?a:[a],t=!1;for(let n of e)if((Array.isArray(n)?n:[n]).reduce((e,t)=>e|AS(t),0)===i){t=!0;break}if(!t)continue}c&&t.preventDefault();let r={node:e,trigger:n,originalEvent:t};e.dispatchEvent(new CustomEvent(`shortcut`,{detail:r})),s?.(r)}}}let o;return n&&(o=ir(e,i,a)),{update:t=>{let{enabled:s=!0,type:c=`keydown`}=t;n&&(!s||i!==c)?o?.():!n&&s&&(o=ir(e,c,a)),n=s,i=c,r=t.trigger},destroy:()=>{o?.()}}}function MS(){let e=It(pS),t=t=>{let n=Zde(t)?t:w(e).nodeLookup.get(t.id),r=n.parentId?fde(n.position,n.measured,n.parentId,w(e).nodeLookup,w(e).nodeOrigin):n.position;return Mb({...n,position:r,width:n.measured?.width??n.width,height:n.measured?.height??n.height})};function n(t,n,r={replace:!1}){w(e).nodes=Qn(()=>w(e).nodes).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r?.replace&&Zde(t)?t:{...e,...t}}return e})}function r(t,n,r={replace:!1}){w(e).edges=Qn(()=>w(e).edges).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r.replace&&Qde(t)?t:{...e,...t}}return e})}let i=t=>w(e).nodeLookup.get(t);return{zoomIn:w(e).zoomIn,zoomOut:w(e).zoomOut,getInternalNode:i,getNode:e=>i(e)?.internals.userNode,getNodes:t=>t===void 0?w(e).nodes:NS(w(e).nodeLookup,t),getEdge:t=>w(e).edgeLookup.get(t),getEdges:t=>t===void 0?w(e).edges:NS(w(e).edgeLookup,t),setZoom:(t,n)=>{let r=w(e).panZoom;return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>w(e).viewport.zoom,setViewport:async(t,n)=>{let r=w(e).viewport;return w(e).panZoom?(await w(e).panZoom.setViewport({x:t.x??r.x,y:t.y??r.y,zoom:t.zoom??r.zoom},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>Qe(w(e).viewport),setCenter:async(t,n,r)=>w(e).setCenter(t,n,r),fitView:t=>w(e).fitView(t),fitBounds:async(t,n)=>{if(!w(e).panZoom)return Promise.resolve(!1);let r=Hb(t,w(e).width,w(e).height,w(e).minZoom,w(e).maxZoom,n?.padding??.1);return await w(e).panZoom.setViewport(r,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},getIntersectingNodes:(n,r=!0,i)=>{let a=Fb(n),o=a?n:t(n);return o?(i||w(e).nodes).filter(t=>{let i=w(e).nodeLookup.get(t.id);if(!i||!a&&t.id===n.id)return!1;let s=Mb(i),c=Pb(s,o);return r&&c>0||c>=s.width*s.height||c>=o.width*o.height}):[]},isNodeIntersecting:(e,n,r=!0)=>{let i=Fb(e)?e:t(e);if(!i)return!1;let a=Pb(i,n);return r&&a>0||a>=n.width*n.height||a>=i.width*i.height},deleteElements:async({nodes:t=[],edges:n=[]})=>{let{nodes:r,edges:i}=await sde({nodesToRemove:t,edgesToRemove:n,nodes:w(e).nodes,edges:w(e).edges,onBeforeDelete:w(e).onbeforedelete});return r&&(w(e).nodes=Qn(()=>w(e).nodes).filter(e=>!r.some(({id:t})=>t===e.id))),i&&(w(e).edges=Qn(()=>w(e).edges).filter(e=>!i.some(({id:t})=>t===e.id))),(r.length>0||i.length>0)&&w(e).ondelete?.({nodes:r,edges:i}),{deletedNodes:r,deletedEdges:i}},screenToFlowPosition:(t,n={snapToGrid:!0})=>{if(!w(e).domNode)return t;let r=n.snapToGrid?w(e).snapGrid:!1,{x:i,y:a,zoom:o}=w(e).viewport,{x:s,y:c}=w(e).domNode.getBoundingClientRect();return zb({x:t.x-s,y:t.y-c},[i,a,o],r!==null,r||[1,1])},flowToScreenPosition:t=>{if(!w(e).domNode)return t;let{x:n,y:r,zoom:i}=w(e).viewport,{x:a,y:o}=w(e).domNode.getBoundingClientRect(),s=Bb(t,[n,r,i]);return{x:s.x+a,y:s.y+o}},toObject:()=>structuredClone({nodes:[...w(e).nodes],edges:[...w(e).edges],viewport:{...w(e).viewport}}),updateNode:n,updateNodeData:(t,r,i)=>{let a=w(e).nodeLookup.get(t)?.internals.userNode;if(!a)return;let o=typeof r==`function`?r(a):r;n(t,e=>({...e,data:i?.replace?o:{...e.data,...o}}))},updateEdge:r,getNodesBounds:t=>A(t,{nodeLookup:w(e).nodeLookup,nodeOrigin:w(e).nodeOrigin}),getHandleConnections:({type:t,id:n,nodeId:r})=>Array.from(w(e).connectionLookup.get(`${r}-${t}-${n??null}`)?.values()??[])}}function NS(e,t){let n=[];for(let r of t){let t=e.get(r);if(t){let e=`internals`in t?t.internals?.userNode:t;n.push(e)}}return n}function PS(e,t){it(t,!0);let n=ii(t,`store`,15),r=ii(t,`selectionKey`,3,`Shift`),i=ii(t,`multiSelectionKey`,19,()=>Ub()?`Meta`:`Control`),a=ii(t,`deleteKey`,3,`Backspace`),o=ii(t,`panActivationKey`,3,` `),s=ii(t,`zoomActivationKey`,19,()=>Ub()?`Meta`:`Control`),{deleteElements:c}=MS();function l(e){return typeof e==`object`&&!!e}function u(e){return l(e)&&e.modifier||[]}function d(e){return e==null?``:l(e)?e.key:e}function f(e,t){return(Array.isArray(e)?e:[e]).map(e=>{let n=d(e);return{key:n,modifier:u(e),enabled:n!==null,callback:t}})}function p(){n(n().selectionRect=null,!0),n(n().selectionKeyPressed=!1,!0),n(n().multiselectionKeyPressed=!1,!0),n(n().deleteKeyPressed=!1,!0),n(n().panActivationKeyPressed=!1,!0),n(n().zoomActivationKeyPressed=!1,!0)}function m(){c({nodes:n().nodes.filter(e=>e.selected),edges:n().edges.filter(e=>e.selected)})}ar(`blur`,Yt,p),ar(`contextmenu`,Yt,p),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!0,!0)),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(i(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(i(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(a(),e=>{!(e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)&&!Yb(e.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),m())}),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(a(),()=>n(n().deleteKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!0,!0)),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:`keyup`})),at()}var Dfe=pr(`<path fill="none" class="svelte-flow__connection-path"></path>`),FS=pr(`<svg class="svelte-flow__connectionline"><g><!></g></svg>`);function IS(e,t){it(t,!0);let n=It(()=>{if(!t.store.connection.inProgress)return``;let e={sourceX:t.store.connection.from.x,sourceY:t.store.connection.from.y,sourcePosition:t.store.connection.fromPosition,targetX:t.store.connection.to.x,targetY:t.store.connection.to.y,targetPosition:t.store.connection.toPosition};switch(t.type){case db.Bezier:{let[t]=ex(e);return t}case db.Straight:{let[t]=ox(e);return t}case db.Step:case db.SmoothStep:{let[n]=cx({...e,borderRadius:t.type===db.Step?0:void 0});return n}}});var r=hr(),i=tn(r),a=e=>{var r=FS(),i=en(r),a=en(i),o=e=>{var n=hr();Ar(tn(n),()=>t.LineComponent,(e,t)=>{t(e,{})}),gr(e,n)},s=e=>{var r=Dfe();_n(()=>{qr(r,`d`,w(n)),Rr(r,t.style)}),gr(e,r)};Cr(a,e=>{t.LineComponent?e(o):e(s,-1)}),We(i),We(r),_n(e=>{qr(r,`width`,t.store.width),qr(r,`height`,t.store.height),Rr(r,t.containerStyle),Ir(i,0,e)},[()=>Mr([`svelte-flow__connection`,ode(t.store.connection.isValid)])]),gr(e,r)};Cr(i,e=>{t.store.connection.inProgress&&e(a)}),gr(e,r),at()}var Ofe=fr(`<div><!></div>`);function LS(e,t){it(t,!0);let n=ii(t,`position`,3,`top-right`),r=ni(t,[`$$slots`,`$$events`,`$$legacy`,`position`,`style`,`class`,`children`]),i=It(()=>`${n()}`.split(`-`));var a=Ofe();Jr(a,e=>({class:e,style:t.style,...r}),[()=>[`svelte-flow__panel`,t.class,...w(i)]]),br(en(a),()=>t.children??ne),We(a),gr(e,a),at()}var kfe=fr(`<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>`);function Afe(e,t){it(t,!0);let n=ii(t,`position`,3,`bottom-right`);var r=hr(),i=tn(r),a=e=>{LS(e,{get position(){return n()},class:`svelte-flow__attribution`,"data-message":`Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us`,children:(e,t)=>{gr(e,kfe())},$$slots:{default:!0}})};Cr(i,e=>{t.proOptions?.hideAttribution||e(a)}),gr(e,r),at()}var RS=fr(`<div><!></div>`);function zS(e,t){it(t,!0);let n=ii(t,`domNode`,15),r=ii(t,`clientWidth`,15),i=ii(t,`clientHeight`,15),a=It(()=>t.rest.class),o=It(()=>se(t.rest,`id.class.nodeTypes.edgeTypes.colorMode.isValidConnection.onmove.onmovestart.onmoveend.onflowerror.ondelete.onbeforedelete.onbeforeconnect.onconnect.onconnectstart.onconnectend.onbeforereconnect.onreconnect.onreconnectstart.onreconnectend.onclickconnectstart.onclickconnectend.oninit.onselectionchange.onselectiondragstart.onselectiondrag.onselectiondragstop.onselectionstart.onselectionend.clickConnect.fitView.fitViewOptions.nodeOrigin.nodeDragThreshold.connectionDragThreshold.minZoom.maxZoom.initialViewport.connectionRadius.connectionMode.selectionMode.selectNodesOnDrag.snapGrid.defaultMarkerColor.translateExtent.nodeExtent.onlyRenderVisibleElements.autoPanOnConnect.autoPanOnNodeDrag.colorModeSSR.defaultEdgeOptions.elevateNodesOnSelect.elevateEdgesOnSelect.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.elementsSelectable.nodesFocusable.edgesFocusable.disableKeyboardA11y.noDragClass.noPanClass.noWheelClass.ariaLabelConfig.autoPanSpeed.panOnScrollSpeed.zIndexMode`.split(`.`)));function s(e){e.currentTarget.scrollTo({top:0,left:0,behavior:`auto`}),t.rest.onscroll&&t.rest.onscroll(e)}var c=RS();Jr(c,e=>({class:[`svelte-flow`,`svelte-flow__container`,w(a),t.colorMode],"data-testid":`svelte-flow__wrapper`,role:`application`,onscroll:s,...w(o),[Hr]:e}),[()=>({width:tS(t.width),height:tS(t.height)})],void 0,void 0,`svelte-ltj518`),br(en(c),()=>t.children??ne),We(c),$r(c,e=>n(e),()=>n()),Bte(c,`clientHeight`,i),Bte(c,`clientWidth`,r),gr(e,c),at()}var BS=fr(`<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>`,1),jfe=fr(`<!> <!>`,1),Mfe=fr(`<!> <!> <!> <!> <!>`,1);function Nfe(e,t){it(t,!0);let n=ii(t,`paneClickDistance`,3,1),r=ii(t,`nodeClickDistance`,3,1),i=ii(t,`panOnScrollMode`,19,()=>lb.Free),a=ii(t,`preventScrolling`,3,!0),o=ii(t,`zoomOnScroll`,3,!0),s=ii(t,`zoomOnDoubleClick`,3,!0),c=ii(t,`zoomOnPinch`,3,!0),l=ii(t,`panOnScroll`,3,!1),u=ii(t,`panOnScrollSpeed`,3,.5),d=ii(t,`panOnDrag`,3,!0),f=ii(t,`selectionOnDrag`,3,!1),p=ii(t,`connectionLineType`,19,()=>db.Bezier),m=ii(t,`nodes`,31,()=>Jt([])),h=ii(t,`edges`,31,()=>Jt([])),g=ii(t,`viewport`,15,void 0),_=ni(t,`$$slots.$$events.$$legacy.width.height.proOptions.selectionKey.deleteKey.panActivationKey.multiSelectionKey.zoomActivationKey.paneClickDistance.nodeClickDistance.onmovestart.onmoveend.onmove.oninit.onnodeclick.onnodecontextmenu.onnodedrag.onnodedragstart.onnodedragstop.onnodepointerenter.onnodepointermove.onnodepointerleave.onselectionclick.onselectioncontextmenu.onselectionstart.onselectionend.onedgeclick.onedgecontextmenu.onedgepointerenter.onedgepointerleave.onpaneclick.onpanecontextmenu.panOnScrollMode.preventScrolling.zoomOnScroll.zoomOnDoubleClick.zoomOnPinch.panOnScroll.panOnScrollSpeed.panOnDrag.selectionOnDrag.connectionLineComponent.connectionLineStyle.connectionLineContainerStyle.connectionLineType.attributionPosition.children.nodes.edges.viewport`.split(`.`)),v=sfe({props:_,width:t.width,height:t.height,get nodes(){return m()},set nodes(e){m(e)},get edges(){return h()},set edges(e){h(e)},get viewport(){return g()},set viewport(e){g(e)}}),y=nt(mS);y&&y.setStore&&y.setStore(v),rt(mS,{provider:!1,getStore(){return v}}),fn(()=>{let e={nodes:v.selectedNodes,edges:v.selectedEdges};Qn(()=>t.onselectionchange)?.(e);for(let t of v.selectionChangeHandlers.values())t(e)}),Sr(()=>{v.reset()}),zS(e,{get colorMode(){return v.colorMode},get width(){return t.width},get height(){return t.height},get rest(){return _},get domNode(){return v.domNode},set domNode(e){v.domNode=e},get clientWidth(){return v.width},set clientWidth(e){v.width=e},get clientHeight(){return v.height},set clientHeight(e){v.height=e},children:(e,m)=>{var h=Mfe(),g=tn(h);PS(g,{get selectionKey(){return t.selectionKey},get deleteKey(){return t.deleteKey},get panActivationKey(){return t.panActivationKey},get multiSelectionKey(){return t.multiSelectionKey},get zoomActivationKey(){return t.zoomActivationKey},get store(){return v},set store(e){v=e}});var _=nn(g,2);lfe(_,{get panOnScrollMode(){return i()},get preventScrolling(){return a()},get zoomOnScroll(){return o()},get zoomOnDoubleClick(){return s()},get zoomOnPinch(){return c()},get panOnScroll(){return l()},get panOnScrollSpeed(){return u()},get panOnDrag(){return d()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get onmovestart(){return t.onmovestart},get onmove(){return t.onmove},get onmoveend(){return t.onmoveend},get oninit(){return t.oninit},get store(){return v},set store(e){v=e},children:(e,i)=>{dfe(e,{get onpaneclick(){return t.onpaneclick},get onpanecontextmenu(){return t.onpanecontextmenu},get onselectionstart(){return t.onselectionstart},get onselectionend(){return t.onselectionend},get panOnDrag(){return d()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get store(){return v},set store(e){v=e},children:(e,n)=>{var i=jfe(),a=tn(i);yS(a,{get store(){return v},set store(e){v=e},children:(e,n)=>{var i=BS(),a=nn(tn(i),2);wfe(a,{get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return v},set store(e){v=e}});var o=nn(a,4);IS(o,{get type(){return p()},get LineComponent(){return t.connectionLineComponent},get containerStyle(){return t.connectionLineContainerStyle},get style(){return t.connectionLineStyle},get store(){return v},set store(e){v=e}});var s=nn(o,2);TS(s,{get nodeClickDistance(){return r()},get onnodeclick(){return t.onnodeclick},get onnodecontextmenu(){return t.onnodecontextmenu},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return v},set store(e){v=e}}),kS(nn(s,2),{get onselectionclick(){return t.onselectionclick},get onselectioncontextmenu(){return t.onselectioncontextmenu},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return v},set store(e){v=e}}),Ge(2),gr(e,i)},$$slots:{default:!0}});var o=nn(a,2);{let e=It(()=>!!(v.selectionRect&&v.selectionRectMode===`user`)),t=It(()=>v.selectionRect?.width),n=It(()=>v.selectionRect?.height),r=It(()=>v.selectionRect?.x),i=It(()=>v.selectionRect?.y);OS(o,{get isVisible(){return w(e)},get width(){return w(t)},get height(){return w(n)},get x(){return w(r)},get y(){return w(i)}})}gr(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}});var y=nn(_,2);Afe(y,{get proOptions(){return t.proOptions},get position(){return t.attributionPosition}});var b=nn(y,2);xS(b,{get store(){return v}}),br(nn(b,2),()=>t.children??ne),gr(e,h)},$$slots:{default:!0}}),at()}var VS=fr(`<button><!></button>`);function HS(e,t){let n=ni(t,[`$$slots`,`$$events`,`$$legacy`,`class`,`bgColor`,`bgColorHover`,`color`,`colorHover`,`borderColor`,`onclick`,`children`]);var r=VS();Jr(r,()=>({type:`button`,onclick:t.onclick,class:[`svelte-flow__controls-button`,t.class],...n,[Hr]:{"--xy-controls-button-background-color-props":t.bgColor,"--xy-controls-button-background-color-hover-props":t.bgColorHover,"--xy-controls-button-color-props":t.color,"--xy-controls-button-color-hover-props":t.colorHover,"--xy-controls-button-border-color-props":t.borderColor}})),br(en(r),()=>t.children??ne),We(r),gr(e,r)}var Pfe=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>`);function Ffe(e){gr(e,Pfe())}var Ife=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>`);function US(e){gr(e,Ife())}var Lfe=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg>`);function Rfe(e){gr(e,Lfe())}var zfe=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"></path></svg>`);function WS(e){gr(e,zfe())}var GS=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg>`);function KS(e){gr(e,GS())}var Bfe=fr(`<!> <!>`,1),Vfe=fr(`<!> <!> <!> <!> <!> <!>`,1);function Hfe(e,t){it(t,!0);let n=ii(t,`position`,3,`bottom-left`),r=ii(t,`orientation`,3,`vertical`),i=ii(t,`showZoom`,3,!0),a=ii(t,`showFitView`,3,!0),o=ii(t,`showLock`,3,!0),s=ni(t,[`$$slots`,`$$events`,`$$legacy`,`position`,`orientation`,`showZoom`,`showFitView`,`showLock`,`style`,`class`,`buttonBgColor`,`buttonBgColorHover`,`buttonColor`,`buttonColorHover`,`buttonBorderColor`,`fitViewOptions`,`children`,`before`,`after`]),c=It(pS),l={bgColor:t.buttonBgColor,bgColorHover:t.buttonBgColorHover,color:t.buttonColor,colorHover:t.buttonColorHover,borderColor:t.buttonBorderColor},u=It(()=>w(c).nodesDraggable||w(c).nodesConnectable||w(c).elementsSelectable),d=It(()=>w(c).viewport.zoom<=w(c).minZoom),f=It(()=>w(c).viewport.zoom>=w(c).maxZoom),p=It(()=>w(c).ariaLabelConfig),m=It(()=>r()===`horizontal`?`horizontal`:`vertical`),h=()=>{w(c).zoomIn()},g=()=>{w(c).zoomOut()},_=()=>{w(c).fitView(t.fitViewOptions)},v=()=>{let e=!w(u);w(c).nodesDraggable=e,w(c).nodesConnectable=e,w(c).elementsSelectable=e};{let r=It(()=>[`svelte-flow__controls`,w(m),t.class]);LS(e,ri({get class(){return w(r)},get position(){return n()},"data-testid":`svelte-flow__controls`,get"aria-label"(){return w(p)[`controls.ariaLabel`]},get style(){return t.style}},()=>s,{children:(e,n)=>{var r=Vfe(),s=tn(r),c=e=>{var n=hr();br(tn(n),()=>t.before),gr(e,n)};Cr(s,e=>{t.before&&e(c)});var m=nn(s,2),y=e=>{var t=Bfe(),n=tn(t);HS(n,ri({onclick:h,class:`svelte-flow__controls-zoomin`,get title(){return w(p)[`controls.zoomIn.ariaLabel`]},get"aria-label"(){return w(p)[`controls.zoomIn.ariaLabel`]},get disabled(){return w(f)}},()=>l,{children:(e,t)=>{Ffe(e,{})},$$slots:{default:!0}})),HS(nn(n,2),ri({onclick:g,class:`svelte-flow__controls-zoomout`,get title(){return w(p)[`controls.zoomOut.ariaLabel`]},get"aria-label"(){return w(p)[`controls.zoomOut.ariaLabel`]},get disabled(){return w(d)}},()=>l,{children:(e,t)=>{US(e,{})},$$slots:{default:!0}})),gr(e,t)};Cr(m,e=>{i()&&e(y)});var b=nn(m,2),x=e=>{HS(e,ri({class:`svelte-flow__controls-fitview`,onclick:_,get title(){return w(p)[`controls.fitView.ariaLabel`]},get"aria-label"(){return w(p)[`controls.fitView.ariaLabel`]}},()=>l,{children:(e,t)=>{Rfe(e,{})},$$slots:{default:!0}}))};Cr(b,e=>{a()&&e(x)});var S=nn(b,2),ee=e=>{HS(e,ri({class:`svelte-flow__controls-interactive`,onclick:v,get title(){return w(p)[`controls.interactive.ariaLabel`]},get"aria-label"(){return w(p)[`controls.interactive.ariaLabel`]}},()=>l,{children:(e,t)=>{var n=hr(),r=tn(n),i=e=>{KS(e,{})},a=e=>{WS(e,{})};Cr(r,e=>{w(u)?e(i):e(a,-1)}),gr(e,n)},$$slots:{default:!0}}))};Cr(S,e=>{o()&&e(ee)});var te=nn(S,2),ne=e=>{var n=hr();br(tn(n),()=>t.children),gr(e,n)};Cr(te,e=>{t.children&&e(ne)});var C=nn(te,2),re=e=>{var n=hr();br(tn(n),()=>t.after),gr(e,n)};Cr(C,e=>{t.after&&e(re)}),gr(e,r)},$$slots:{default:!0}}))}at()}var qS;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(qS||={});var JS=pr(`<circle></circle>`);function YS(e,t){var n=JS();_n(()=>{qr(n,`cx`,t.radius),qr(n,`cy`,t.radius),qr(n,`r`,t.radius),Ir(n,0,Mr([`svelte-flow__background-pattern`,`dots`,t.class]))}),gr(e,n)}var XS=pr(`<path></path>`);function Ufe(e,t){it(t,!0);var n=XS();_n(()=>{qr(n,`stroke-width`,t.lineWidth),qr(n,`d`,`M${t.dimensions[0]/2} 0 V${t.dimensions[1]} M0 ${t.dimensions[1]/2} H${t.dimensions[0]}`),Ir(n,0,Mr([`svelte-flow__background-pattern`,t.variant,t.class]))}),gr(e,n),at()}var ZS={[qS.Dots]:1,[qS.Lines]:1,[qS.Cross]:6},Wfe=pr(`<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>`);function QS(e,t){it(t,!0);let n=ii(t,`variant`,19,()=>qS.Dots),r=ii(t,`gap`,3,20),i=ii(t,`lineWidth`,3,1),a=It(pS),o=It(()=>n()===qS.Dots),s=It(()=>n()===qS.Cross),c=It(()=>Array.isArray(r())?r():[r(),r()]),l=It(()=>`background-pattern-${w(a).flowId}-${t.id??``}`),u=It(()=>[w(c)[0]*w(a).viewport.zoom||1,w(c)[1]*w(a).viewport.zoom||1]),d=It(()=>(t.size??ZS[n()])*w(a).viewport.zoom),f=It(()=>w(s)?[w(d),w(d)]:w(u)),p=It(()=>w(o)?[w(d)/2,w(d)/2]:[w(f)[0]/2,w(f)[1]/2]);var m=Wfe();let h;var g=en(m),_=en(g),v=e=>{{let n=It(()=>w(d)/2);YS(e,{get radius(){return w(n)},get class(){return t.patternClass}})}},y=e=>{Ufe(e,{get dimensions(){return w(f)},get variant(){return n()},get lineWidth(){return i()},get class(){return t.patternClass}})};Cr(_,e=>{w(o)?e(v):e(y,-1)}),We(g);var b=nn(g);We(m),_n(()=>{Ir(m,0,Mr([`svelte-flow__background`,`svelte-flow__container`,t.class])),h=Rr(m,``,h,{"--xy-background-color-props":t.bgColor,"--xy-background-pattern-color-props":t.patternColor}),qr(g,`id`,w(l)),qr(g,`x`,w(a).viewport.x%w(u)[0]),qr(g,`y`,w(a).viewport.y%w(u)[1]),qr(g,`width`,w(u)[0]),qr(g,`height`,w(u)[1]),qr(g,`patternTransform`,`translate(-${w(p)[0]},-${w(p)[1]})`),qr(b,`fill`,`url(#${w(l)})`)}),gr(e,m),at()}var $S=c(o(((e,t)=>{(function(n){if(typeof e==`object`&&t!==void 0)t.exports=n();else if(typeof define==`function`&&define.amd)define([],n);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=n()}})(function(){return(function(){function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o<r.length;o++)i(r[o]);return i}return e})()({1:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.default=void 0;function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function s(e){var t=c(e,`string`);return r(t)==`symbol`?t:t+``}function c(e,t){if(r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||`default`);if(r(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}n.default=function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,a=r===void 0?{}:r,o=n.algorithms,s=o===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:o,c=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=a,this.initialized=!1,u===void 0&&c===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=c;u!==void 0&&c===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new l(f),this.worker.postMessage({cmd:`register`,algorithms:s}).then(function(e){return t.initialized=!0}).catch(console.err)}return o(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i===void 0?!1:i,o=t.measureExecutionTime,s=o===void 0?!1:o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}])}();var l=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return o(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}])}()},{}],2:[function(e,t,n){(function(e){(function(){var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function ee(){}function te(){}function ne(){}function C(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function eee(){}function tee(){}function nee(){}function ree(){}function Re(){}function iee(){}function aee(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function oee(){}function see(){}function Je(){}function Ye(){}function Xe(){}function cee(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function lee(){}function it(){}function at(){}function ot(){}function st(){}function uee(){}function ct(){}function dee(){}function lt(){}function fee(){}function ut(){}function dt(){}function pee(){}function ft(){}function pt(){}function mt(){}function ht(){}function mee(){}function gt(){}function hee(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function gee(){}function _ee(){}function Et(){}function vee(){}function yee(){}function Dt(){}function bee(){}function xee(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function See(){}function Cee(){}function wee(){}function Tee(){}function Eee(){}function Nt(){}function Pt(){}function Ft(){}function Dee(){}function It(){}function Lt(){}function Oee(){}function kee(){}function Rt(){}function zt(){}function Aee(){}function Bt(){}function Vt(){}function Ht(){}function jee(){}function Ut(){}function Wt(){}function Mee(){}function Gt(){}function Kt(){}function Nee(){}function qt(){}function Pee(){}function Jt(){}function Fee(){}function Iee(){}function Yt(){}function Lee(){}function Ree(){}function Xt(){}function zee(){}function Zt(){}function Qt(){}function $t(){}function en(){}function tn(){}function nn(){}function Bee(){}function rn(){}function Vee(){}function an(){}function Hee(){}function Uee(){}function on(){}function sn(){}function Wee(){}function cn(){}function Gee(){}function ln(){}function un(){}function dn(){}function fn(){}function pn(){}function mn(){}function Kee(){}function qee(){}function hn(){}function Jee(){}function gn(){}function _n(){}function vn(){}function yn(){}function bn(){}function xn(){}function Sn(){}function Yee(){}function Cn(){}function Xee(){}function wn(){}function Tn(){}function En(){}function Dn(){}function On(){}function kn(){}function Zee(){}function An(){}function jn(){}function Mn(){}function Nn(){}function Pn(){}function Fn(){}function In(){}function Ln(){}function Rn(){}function zn(){}function Bn(){}function Vn(){}function Hn(){}function Qee(){}function Un(){}function Wn(){}function Gn(){}function $ee(){}function ete(){}function Kn(){}function qn(){}function Jn(){}function tte(){}function Yn(){}function Xn(){}function nte(){}function w(){}function Zn(){}function rte(){}function Qn(){}function ite(){}function $n(){}function er(){}function tr(){}function nr(){}function rr(){}function ir(){}function ar(){}function or(){}function sr(){}function cr(){}function lr(){}function ate(){}function ote(){}function ur(){}function dr(){}function fr(){}function ste(){}function pr(){}function mr(){}function hr(){}function gr(){}function cte(){}function lte(){}function ute(){}function dte(){}function fte(){}function pte(){}function mte(){}function hte(){}function _r(){}function gte(){}function vr(){}function _te(){}function vte(){}function yr(){}function br(){}function xr(){}function Sr(){}function yte(){}function Cr(){}function bte(){}function xte(){}function wr(){}function Ste(){}function Tr(){}function Cte(){}function Er(){}function Dr(){}function wte(){}function Tte(){}function Or(){}function kr(){}function Ar(){}function jr(){}function Ete(){}function Dte(){}function Ote(){}function Mr(){}function Nr(){}function Pr(){}function kte(){}function Fr(){}function Ate(){}function Ir(){}function Lr(){}function Rr(){}function zr(){}function jte(){}function Br(){}function Vr(){}function Hr(){}function Ur(){}function Wr(){}function Mte(){}function Nte(){}function Gr(){}function Pte(){}function Kr(){}function Fte(){}function qr(){}function Ite(){}function Jr(){}function Yr(){}function Lte(){}function Rte(){}function Xr(){}function Zr(){}function Qr(){}function zte(){}function Bte(){}function Vte(){}function $r(){}function ei(){}function ti(){}function Hte(){}function ni(){}function Ute(){}function ri(){}function ii(){}function Wte(){}function ai(){}function oi(){}function si(){}function Gte(){}function ci(){}function li(){}function Kte(){}function ui(){}function qte(){}function di(){}function Jte(){}function Yte(){}function Xte(){}function fi(){}function pi(){}function mi(){}function Zte(){}function hi(){}function Qte(){}function gi(){}function $te(){}function ene(){}function tne(){}function _i(){}function vi(){}function nne(){}function rne(){}function yi(){}function ine(){}function bi(){}function xi(){}function Si(){}function Ci(){}function wi(){}function Ti(){}function Ei(){}function Di(){}function Oi(){}function ki(){}function Ai(){}function ji(){}function Mi(){}function Ni(){}function Pi(){}function Fi(){}function Ii(){}function Li(){}function Ri(){}function zi(){}function ane(){}function Bi(){}function Vi(){}function Hi(){}function Ui(){}function Wi(){}function one(){}function sne(){}function Gi(){}function cne(){}function lne(){}function Ki(){}function qi(){}function une(){}function Ji(){}function dne(){}function Yi(){}function Xi(){}function Zi(){}function Qi(){}function $i(){}function fne(){}function pne(){}function ea(){}function ta(){}function mne(){}function na(){}function ra(){}function ia(){}function hne(){}function gne(){}function _ne(){}function aa(){}function oa(){}function vne(){}function sa(){}function yne(){}function bne(){}function ca(){}function la(){}function ua(){}function da(){}function fa(){}function xne(){}function pa(){}function Sne(){}function ma(){}function ha(){}function ga(){}function _a(){}function va(){}function ya(){}function ba(){}function xa(){}function Sa(){}function Ca(){}function wa(){}function Ta(){}function Cne(){}function Ea(){}function Da(){}function Oa(){}function ka(){}function Aa(){}function ja(){}function wne(){}function Ma(){}function Na(){}function Pa(){}function Tne(){}function Fa(){}function Ia(){}function Ene(){}function La(){}function Ra(){}function za(){}function Ba(){}function Va(){}function Dne(){}function Ha(){}function Ua(){}function Wa(){}function Ga(){}function One(){}function Ka(){}function kne(){}function qa(){}function Ja(){}function Ya(){}function Xa(){}function Ane(){}function jne(){}function Mne(){}function Za(){}function Qa(){}function $a(){}function eo(){}function to(){}function no(){}function Nne(){}function Pne(){}function ro(){}function Fne(){}function io(){}function ao(){}function oo(){}function so(){}function co(){}function lo(){}function uo(){}function fo(){}function po(){}function mo(){}function Ine(){}function ho(){}function go(){}function _o(){}function Lne(){}function vo(){}function Rne(){}function zne(){}function yo(){}function bo(){}function xo(){}function So(){}function Co(){}function wo(){}function To(){}function Eo(){}function Do(){}function Oo(){}function ko(){}function Ao(){}function jo(){}function Bne(){}function Mo(){}function No(){}function Po(){}function Fo(){}function Io(){}function Lo(){}function Ro(){}function zo(){}function Vne(){}function Hne(){}function Bo(){}function Vo(){}function Une(){}function Ho(){}function Uo(){}function Wne(){}function Gne(){}function Wo(){}function Go(){}function Ko(){}function qo(){}function Jo(){}function Yo(){}function Xo(){}function Zo(){}function Qo(){}function $o(){}function Kne(){}function es(){}function ts(){}function ns(){}function rs(){}function is(){}function as(){}function qne(){}function os(){}function ss(){}function cs(){}function ls(){}function us(){}function ds(){}function fs(){}function ps(){}function ms(){}function hs(){}function gs(){}function _s(){}function vs(){}function ys(){}function bs(){}function xs(){}function Jne(){}function Ss(){}function Cs(){}function ws(){}function Ts(){}function Es(){}function Ds(){}function Yne(){}function Xne(){}function Os(){}function ks(){}function As(){}function js(){}function Zne(){}function Qne(){}function $ne(){}function ere(){}function Ms(){}function tre(){}function nre(){}function rre(){}function ire(){}function are(){}function ore(){}function sre(){}function Ns(){}function Ps(){}function Fs(){}function cre(){}function Is(){}function lre(){}function ure(){}function dre(){}function fre(){}function pre(){}function mre(){}function hre(){}function gre(){}function _re(){}function vre(){}function Ls(){}function yre(){}function bre(){}function xre(){}function Sre(){}function Cre(){}function wre(){}function Tre(){}function Rs(){}function Ere(){}function zs(){}function Bs(){}function Vs(){}function Dre(){}function Hs(){}function Ore(){}function kre(){}function Are(){}function jre(){}function Mre(){}function Nre(){}function Pre(){}function Us(){}function Fre(){}function Ws(){}function Ire(){}function Lre(){}function Gs(){}function Rre(){}function Ks(){}function zre(){}function qs(){}function Bre(){}function Js(){}function Ys(){}function Xs(){}function Zs(){}function Vre(){}function Hre(){}function Qs(){yp()}function Ure(){B$e()}function Wre(){fV()}function $s(){tYe()}function ec(){tR()}function tc(){uT()}function Gre(){Lg()}function nc(){Pg()}function rc(){Jle()}function ic(){bN()}function Kre(){nMe()}function ac(){NP()}function oc(){GR()}function sc(){WIe()}function cc(){pEe()}function qre(){HIe()}function Jre(){gEe()}function lc(){hEe()}function Yre(){_Ee()}function Xre(){$Me()}function uc(){yEe()}function dc(){qIe()}function fc(){hH()}function pc(){zg()}function mc(){GIe()}function Zre(){KIe()}function hc(){GOe()}function gc(){$ct()}function _c(){JIe()}function Qre(){xEe()}function $re(){dM()}function vc(){XHe()}function yc(){fM()}function bc(){R4e()}function xc(){VR()}function Sc(){uRe()}function eie(){J9e()}function Cc(){cYe()}function wc(){bEe()}function Tc(){Net()}function tie(){_V()}function Ec(){FB()}function nie(){Stt()}function rie(){ez()}function iie(){RB()}function aie(){Tqe()}function oie(){mj()}function Dc(){vH()}function sie(){HR()}function Oc(){eF()}function cie(){BWe()}function kc(){DV()}function Ac(){JLe()}function jc(){tge()}function Mc(){jtt()}function Nc(e){yD(e)}function lie(e){this.a=e}function Pc(e){this.a=e}function Fc(e){this.a=e}function uie(e){this.a=e}function Ic(e){this.a=e}function Lc(e){this.a=e}function Rc(e){this.a=e}function zc(e){this.a=e}function Bc(e){this.a=e}function Vc(e){this.a=e}function Hc(e){this.a=e}function Uc(e){this.a=e}function die(e){this.a=e}function fie(e){this.c=e}function Wc(e){this.a=e}function Gc(e){this.a=e}function Kc(e){this.a=e}function qc(e){this.a=e}function pie(e){this.a=e}function Jc(e){this.a=e}function Yc(e){this.a=e}function mie(e){this.a=e}function Xc(e){this.a=e}function Zc(e){this.a=e}function Qc(e){this.a=e}function hie(e){this.a=e}function gie(e){this.a=e}function $c(e){this.a=e}function _ie(e){this.a=e}function el(e){this.a=e}function tl(e){this.a=e}function vie(e){this.a=e}function nl(e){this.a=e}function yie(e){this.a=e}function bie(e){this.a=e}function rl(e){this.a=e}function xie(e){this.a=e}function Sie(e){this.a=e}function Cie(e){this.a=e}function il(e){this.a=e}function al(e){this.a=e}function ol(e){this.a=e}function sl(e){this.a=e}function cl(e){this.b=e}function ll(){this.a=[]}function ul(e,t){e.a=t}function wie(e,t){e.a=t}function Tie(e,t){e.b=t}function Eie(e,t){e.c=t}function dl(e,t){e.c=t}function fl(e,t){e.d=t}function Die(e,t){e.d=t}function pl(e,t){e.k=t}function ml(e,t){e.j=t}function hl(e,t){e.c=t}function gl(e,t){e.c=t}function _l(e,t){e.a=t}function Oie(e,t){e.a=t}function kie(e,t){e.f=t}function Aie(e,t){e.a=t}function jie(e,t){e.b=t}function vl(e,t){e.d=t}function yl(e,t){e.i=t}function bl(e,t){e.o=t}function xl(e,t){e.r=t}function Sl(e,t){e.a=t}function Cl(e,t){e.b=t}function Mie(e,t){e.e=t}function wl(e,t){e.f=t}function Tl(e,t){e.g=t}function Nie(e,t){e.e=t}function Pie(e,t){e.f=t}function Fie(e,t){e.f=t}function El(e,t){e.a=t}function Dl(e,t){e.b=t}function Iie(e,t){e.n=t}function Lie(e,t){e.a=t}function Rie(e,t){e.c=t}function zie(e,t){e.c=t}function Bie(e,t){e.c=t}function Ol(e,t){e.a=t}function kl(e,t){e.a=t}function Al(e,t){e.d=t}function Vie(e,t){e.d=t}function Hie(e,t){e.e=t}function Uie(e,t){e.e=t}function Wie(e,t){e.g=t}function Gie(e,t){e.f=t}function jl(e,t){e.j=t}function Ml(e,t){e.a=t}function Nl(e,t){e.a=t}function Kie(e,t){e.b=t}function Pl(e){e.b=e.a}function qie(e){e.c=e.d.d}function Fl(e){this.a=e}function Il(e){this.a=e}function Ll(e){this.a=e}function Rl(e){this.a=e}function zl(e){this.a=e}function Bl(e){this.a=e}function Jie(e){this.a=e}function Vl(e){this.a=e}function Hl(e){this.a=e}function Ul(e){this.a=e}function Wl(e){this.a=e}function Gl(e){this.a=e}function Kl(e){this.a=e}function ql(e){this.a=e}function Jl(e){this.b=e}function Yl(e){this.b=e}function Xl(e){this.b=e}function Zl(e){this.d=e}function Ql(e){this.a=e}function Yie(e){this.a=e}function $l(e){this.a=e}function eu(e){this.a=e}function tu(e){this.a=e}function nu(e){this.a=e}function ru(e){this.a=e}function iu(e){this.c=e}function T(e){this.c=e}function au(e){this.c=e}function Xie(e){this.a=e}function ou(e){this.a=e}function Zie(e){this.a=e}function Qie(e){this.a=e}function su(e){this.a=e}function $ie(e){this.a=e}function cu(e){this.a=e}function lu(e){this.a=e}function eae(e){this.a=e}function tae(e){this.a=e}function nae(e){this.a=e}function rae(e){this.a=e}function uu(e){this.a=e}function du(e){this.a=e}function fu(e){this.a=e}function iae(e){this.a=e}function aae(e){this.a=e}function pu(e){this.a=e}function mu(e){this.a=e}function hu(e){this.a=e}function gu(e){this.a=e}function _u(e){this.a=e}function vu(e){this.a=e}function yu(e){this.a=e}function bu(e){this.a=e}function xu(e){this.a=e}function Su(e){this.a=e}function Cu(e){this.a=e}function wu(e){this.a=e}function oae(e){this.a=e}function Tu(e){this.a=e}function Eu(e){this.a=e}function Du(e){this.a=e}function Ou(e){this.a=e}function ku(e){this.a=e}function Au(e){this.a=e}function ju(e){this.a=e}function Mu(e){this.a=e}function sae(e){this.a=e}function Nu(e){this.a=e}function cae(e){this.a=e}function Pu(e){this.a=e}function lae(e){this.a=e}function Fu(e){this.a=e}function Iu(e){this.a=e}function Lu(e){this.a=e}function uae(e){this.a=e}function Ru(e){this.a=e}function dae(e){this.a=e}function fae(e){this.a=e}function pae(e){this.a=e}function mae(e){this.a=e}function hae(e){this.a=e}function gae(e){this.a=e}function _ae(e){this.a=e}function vae(e){this.a=e}function yae(e){this.a=e}function bae(e){this.a=e}function xae(e){this.a=e}function Sae(e){this.a=e}function Cae(e){this.a=e}function zu(e){this.a=e}function Bu(e){this.a=e}function Vu(e){this.a=e}function wae(e){this.a=e}function Tae(e){this.a=e}function Eae(e){this.a=e}function Dae(e){this.a=e}function Oae(e){this.a=e}function kae(e){this.a=e}function Aae(e){this.a=e}function Hu(e){this.a=e}function jae(e){this.a=e}function Mae(e){this.a=e}function Uu(e){this.a=e}function Nae(e){this.a=e}function Pae(e){this.a=e}function Fae(e){this.a=e}function Wu(e){this.a=e}function Gu(e){this.a=e}function Iae(e){this.a=e}function Lae(e){this.a=e}function Rae(e){this.a=e}function zae(e){this.a=e}function Ku(e){this.a=e}function Bae(e){this.b=e}function Vae(e){this.a=e}function Hae(e){this.a=e}function Uae(e){this.a=e}function Wae(e){this.a=e}function qu(e){this.a=e}function Gae(e){this.a=e}function Ju(e){this.c=e}function Kae(e){this.a=e}function qae(e){this.a=e}function Yu(e){this.a=e}function Xu(e){this.a=e}function Jae(e){this.a=e}function Yae(e){this.a=e}function Xae(e){this.a=e}function Zu(e){this.a=e}function Zae(e){this.a=e}function Qae(e){this.a=e}function $ae(e){this.a=e}function Qu(e){this.a=e}function eoe(e){this.a=e}function toe(e){this.a=e}function $u(e){this.a=e}function noe(e){this.a=e}function ed(e){this.a=e}function td(e){this.a=e}function nd(e){this.a=e}function rd(e){this.a=e}function id(e){this.a=e}function ad(e){this.a=e}function roe(e){this.a=e}function od(e){this.a=e}function sd(e){this.a=e}function ioe(e){this.a=e}function aoe(e){this.a=e}function cd(e){this.a=e}function ld(e){this.a=e}function ooe(e){this.a=e}function soe(e){this.a=e}function ud(e){this.a=e}function dd(e){this.a=e}function fd(e){this.a=e}function pd(e){this.a=e}function md(e){this.a=e}function coe(e){this.a=e}function hd(e){this.a=e}function gd(e){this.a=e}function loe(e){this.a=e}function uoe(e){this.a=e}function doe(e){this.a=e}function foe(e){this.a=e}function poe(e){this.a=e}function moe(e){this.a=e}function hoe(e){this.a=e}function goe(e){this.a=e}function _d(e){this.a=e}function vd(e){this.a=e}function _oe(e){this.a=e}function yd(e){this.a=e}function bd(e){this.a=e}function voe(e){this.a=e}function yoe(e){this.a=e}function boe(e){this.a=e}function xd(e){this.a=e}function Sd(e){this.f=e}function Cd(e){this.a=e}function wd(e){this.a=e}function Td(e){this.a=e}function Ed(e){this.a=e}function xoe(e){this.a=e}function Soe(e){this.a=e}function Coe(e){this.a=e}function woe(e){this.a=e}function Toe(e){this.a=e}function Eoe(e){this.a=e}function Doe(e){this.a=e}function Ooe(e){this.a=e}function Dd(e){this.a=e}function Od(e){this.a=e}function kd(e){this.a=e}function koe(e){this.a=e}function Aoe(e){this.a=e}function joe(e){this.a=e}function Ad(e){this.a=e}function Moe(e){this.a=e}function Noe(e){this.a=e}function Poe(e){this.a=e}function jd(e){this.a=e}function Md(e){this.a=e}function Nd(e){this.a=e}function Pd(e){this.a=e}function Fd(e){this.a=e}function Id(e){this.a=e}function Ld(e){this.a=e}function Rd(e){this.b=e}function Foe(e){this.a=e}function Ioe(e){this.a=e}function Loe(e){this.a=e}function Roe(e){this.a=e}function zoe(e){this.a=e}function zd(e){this.a=e}function Boe(e){this.a=e}function Voe(e){this.b=e}function Hoe(e){this.a=e}function Bd(e){this.a=e}function Uoe(e){this.a=e}function Woe(e){this.a=e}function Vd(e){this.a=e}function Hd(e){this.a=e}function Ud(e){this.c=e}function Wd(e){this.e=e}function Gd(e){this.e=e}function Kd(e){this.a=e}function Goe(e){this.d=e}function Koe(e){this.a=e}function qd(e){this.a=e}function Jd(e){this.a=e}function Yd(e){this.e=e}function Xd(){this.a=0}function Zd(){Rx(this)}function Qd(){SE(this)}function $d(){dCe(this)}function qoe(){}function ef(){this.c=IBt}function tf(e,t){e.b+=t}function Joe(e,t){t.Wb(e)}function nf(e){return e.a}function Yoe(e){return e.a}function rf(e){return e.a}function Xoe(e){return e.a}function Zoe(e){return e.a}function E(e){return e.e}function Qoe(){return null}function af(){return null}function $oe(e){throw E(e)}function of(e){this.a=nD(e)}function ese(){this.a=this}function sf(){Wfe.call(this)}function tse(e){e.b.Mf(e.e)}function nse(e){e.b=new gm}function cf(e,t){e.b=t-e.b}function lf(e,t){e.a=t-e.a}function uf(e,t){t.gd(e.a)}function df(e,t){bz(t,e)}function ff(e,t){e.push(t)}function rse(e,t){e.sort(t)}function ise(e,t,n){e.Wd(n,t)}function pf(e,t){e.e=t,t.b=e}function ase(){yh(),ect()}function mf(e){MO(),ayt.je(e)}function hf(){sf.call(this)}function gf(){sf.call(this)}function _f(){Wfe.call(this)}function ose(){sf.call(this)}function vf(){sf.call(this)}function sse(){sf.call(this)}function yf(){sf.call(this)}function bf(){sf.call(this)}function xf(){sf.call(this)}function Sf(){sf.call(this)}function Cf(){sf.call(this)}function cse(){sf.call(this)}function wf(){this.Bb|=256}function lse(){this.b=new Hb}function use(){use=C,new Qd}function Tf(e,t){e.length=t}function Ef(e,t){M(e.a,t)}function dse(e,t){a1e(e.c,t)}function Df(e,t){RE(e.b,t)}function Of(e,t){FN(e.e,t)}function fse(e,t){IL(e.a,t)}function pse(e,t){XF(e.a,t)}function kf(e){Fz(e.c,e.b)}function mse(e,t){e.kc().Nb(t)}function Af(e){this.a=fUe(e)}function jf(){this.a=new Qd}function Mf(){this.a=new Qd}function Nf(){this.a=new Zd}function Pf(){this.a=new Zd}function Ff(){this.a=new Zd}function If(){this.a=new Rje}function Lf(){this.a=new Fle}function Rf(){this.a=new qTe}function zf(){this.a=new bme}function Bf(){this.a=new ree}function Vf(){this.a=new Qe}function Hf(){this.a=new qDe}function hse(){this.a=new Zd}function gse(){this.a=new Zd}function _se(){this.a=new Zd}function vse(){this.a=new Zd}function yse(){this.d=new Zd}function Uf(){this.a=new jf}function Wf(){this.a=new Qd}function bse(){this.b=new Qd}function xse(){this.b=new Zd}function Gf(){this.e=new Zd}function Kf(){this.a=new oc}function Sse(){this.d=new Zd}function qf(){qoe.call(this)}function Jf(){qf.call(this)}function Yf(){qoe.call(this)}function Xf(){Yf.call(this)}function Cse(){hf.call(this)}function Zf(){Nf.call(this)}function Qf(){qw.call(this)}function wse(){_se.call(this)}function Tse(){Zd.call(this)}function Ese(){Bwe.call(this)}function Dse(){Bwe.call(this)}function Ose(){mp.call(this)}function kse(){mp.call(this)}function $f(){mp.call(this)}function Ase(){hp.call(this)}function ep(){yo.call(this)}function tp(){yo.call(this)}function np(){gg.call(this)}function jse(){_p.call(this)}function rp(){_p.call(this)}function ip(){Qd.call(this)}function ap(){Qd.call(this)}function Mse(){Qd.call(this)}function op(){FIe.call(this)}function Nse(){jf.call(this)}function sp(){wf.call(this)}function cp(){ZS.call(this)}function lp(){Qd.call(this)}function up(){ZS.call(this)}function dp(){Qd.call(this)}function Pse(){Qd.call(this)}function fp(){Fo.call(this)}function Fse(){fp.call(this)}function Ise(){Fo.call(this)}function pp(){Zs.call(this)}function mp(){this.a=new jf}function Lse(){this.a=new Qd}function Rse(){this.a=new Zd}function zse(){this.j=new Zd}function hp(){this.a=new Qd}function gp(){this.a=new gg}function _p(){this.a=new Bne}function vp(){this.a=new ma}function Bse(){this.a=new Xce}function yp(){yp=C,zY=new o}function bp(){bp=C,WY=new Hse}function xp(){xp=C,GY=new Vse}function Vse(){Xc.call(this,``)}function Hse(){Xc.call(this,``)}function Use(e){PFe.call(this,e)}function Wse(e){PFe.call(this,e)}function Sp(e){Lc.call(this,e)}function Cp(e){cle.call(this,e)}function Gse(e){cle.call(this,e)}function Kse(e){Cp.call(this,e)}function qse(e){Cp.call(this,e)}function Jse(e){Cp.call(this,e)}function Yse(e){mAe.call(this,e)}function wp(e){mAe.call(this,e)}function Tp(e){pfe.call(this,e)}function Ep(e){xle.call(this,e)}function Dp(e){eg.call(this,e)}function Op(e){eg.call(this,e)}function kp(e){eg.call(this,e)}function Ap(e){Rbe.call(this,e)}function jp(e){Ap.call(this,e)}function Mp(){sl.call(this,{})}function Np(e){xS(),this.a=e}function Pp(e){e.b=null,e.c=0}function Xse(e,t){e.e=t,S5e(e,t)}function Zse(e,t){e.a=t,s0e(e)}function Fp(e,t,n){e.a[t.g]=n}function Qse(e,t,n){xXe(n,e,t)}function Ip(e,t){Nme(t.i,e.n)}function Lp(e,t){NBe(e).Ad(t)}function $se(e,t){return e*e/t}function Rp(e,t){return e.g-t.g}function zp(e,t){e.a.ec().Kc(t)}function Bp(e){return new ol(e)}function ece(e){return new rD(e)}function Vp(){Vp=C,tyt=new a}function Hp(){Hp=C,iyt=new v}function Up(){Up=C,eX=new x}function Wp(){Wp=C,JY=new ffe}function Gp(){Gp=C,lyt=new ee}function Kp(e){lRe(),this.a=e}function qp(e){dbe(),this.f=e}function Jp(e){dbe(),this.f=e}function tce(e){ege(),this.a=e}function Yp(e){Ap.call(this,e)}function Xp(e){Ap.call(this,e)}function nce(e){Ap.call(this,e)}function Zp(e){Rbe.call(this,e)}function Qp(e){Ap.call(this,e)}function $p(e){Ap.call(this,e)}function em(e){Ap.call(this,e)}function rce(e){Ap.call(this,e)}function tm(e){Ap.call(this,e)}function nm(e){Ap.call(this,e)}function rm(e){yD(e),this.a=e}function im(e){Exe(e,e.length)}function ice(e){return PP(e),e}function am(e){return!!e&&e.b}function ace(e){return!!e&&e.k}function oce(e){return!!e&&e.j}function om(e){return e.b==e.c}function sm(e){return yD(e),e}function D(e){return yD(e),e}function cm(e){return yD(e),e}function lm(e){return yD(e),e}function sce(e){return yD(e),e}function um(e){Ap.call(this,e)}function dm(e){Ap.call(this,e)}function fm(e){Ap.call(this,e)}function pm(e){Ap.call(this,e)}function mm(e){Ap.call(this,e)}function hm(e){AC.call(this,e,0)}function gm(){EDe.call(this,12,3)}function _m(){this.a=gw(nD(NH))}function cce(){throw E(new Sf)}function vm(){throw E(new Sf)}function ym(){throw E(new Sf)}function bm(){throw E(new Sf)}function lce(){throw E(new Sf)}function uce(){throw E(new Sf)}function xm(){xm=C,MO()}function Sm(){Bl.call(this,``)}function Cm(){Bl.call(this,``)}function wm(){Bl.call(this,``)}function Tm(){Bl.call(this,``)}function Em(e){Xp.call(this,e)}function Dm(e){Xp.call(this,e)}function Om(e){$p.call(this,e)}function km(e){Yl.call(this,e)}function Am(e){km.call(this,e)}function jm(e){QS.call(this,e)}function dce(e,t,n){e.c.Cf(t,n)}function fce(e,t,n){t.Ad(e.a[n])}function pce(e,t,n){t.Ne(e.a[n])}function Mm(e,t){return e.a-t.a}function mce(e,t){return e.a-t.a}function Nm(e,t){return e.a-t.a}function Pm(e,t){return lj(e,t)}function O(e,t){return cEe(e,t)}function hce(e,t){return t in e.a}function Fm(e){return e.a?e.b:0}function Im(e){return e.a?e.b:0}function Lm(e,t){return e.f=t,e}function gce(e,t){return e.b=t,e}function _ce(e,t){return e.c=t,e}function vce(e,t){return e.g=t,e}function Rm(e,t){return e.a=t,e}function zm(e,t){return e.f=t,e}function Bm(e,t){return e.f=t,e}function Vm(e,t){return e.e=t,e}function Hm(e,t){return e.k=t,e}function Um(e,t){return e.a=t,e}function yce(e,t){return e.e=t,e}function bce(e,t){e.b=new fx(t)}function Wm(e,t){e._d(t),t.$d(e)}function xce(e,t){fT(),t.n.a+=e}function Sce(e,t){GR(),ZO(t,e)}function Gm(e){GCe.call(this,e)}function Cce(e){GCe.call(this,e)}function Km(){rS.call(this,``)}function qm(){this.b=0,this.a=0}function Jm(){Jm=C,Gyt=fZe()}function Ym(e,t){return e.b=t,e}function Xm(e,t){return e.a=t,e}function Zm(e,t){return e.c=t,e}function Qm(e,t){return e.d=t,e}function $m(e,t){return e.e=t,e}function eh(e,t){return e.f=t,e}function th(e,t){return e.a=t,e}function nh(e,t){return e.b=t,e}function rh(e,t){return e.c=t,e}function ih(e,t){return e.c=t,e}function ah(e,t){return e.b=t,e}function oh(e,t){return e.d=t,e}function sh(e,t){return e.e=t,e}function ch(e,t){return e.f=t,e}function lh(e,t){return e.g=t,e}function uh(e,t){return e.a=t,e}function dh(e,t){return e.i=t,e}function fh(e,t){return e.j=t,e}function wce(e,t){return t.pg(e)}function Tce(e,t){return e.b-t.b}function Ece(e,t){return e.g-t.g}function ph(e,t){return e.s-t.s}function Dce(e,t){return e?0:t-1}function Oce(e,t){return e?0:t-1}function kce(e,t){return e?t-1:0}function mh(e,t){return e.k=t,e}function Ace(e,t){return e.j=t,e}function hh(){this.a=0,this.b=0}function gh(e){whe.call(this,e)}function _h(e){aM.call(this,e)}function jce(e){YD.call(this,e)}function Mce(e){YD.call(this,e)}function Nce(){Nce=C,l7=tQe()}function vh(){vh=C,kzt=eXe()}function yh(){yh=C,T7=RM()}function bh(){bh=C,SBt=tXe()}function xh(){xh=C,lVt=nXe()}function Sh(){Sh=C,x9=i0e()}function Ch(e){return e.e&&e.e()}function Pce(e,t){return e.c._b(t)}function Fce(e,t){return ZVe(e.b,t)}function Ice(e,t){return uue(e.a,t)}function wh(e,t){e.b=0,AM(e,t)}function Lce(e,t){e.c=t,e.b=!0}function Th(e,t){return e.a+=t,e}function Eh(e,t){return e.a+=t,e}function Dh(e,t){return e.a+=t,e}function Oh(e,t){return e.a+=t,e}function kh(e){return mw(e),e.o}function Ah(e){$ot(),yct(this,e)}function Rce(){throw E(new Sf)}function zce(){throw E(new Sf)}function Bce(){throw E(new Sf)}function Vce(){throw E(new Sf)}function Hce(){throw E(new Sf)}function jh(){throw E(new Sf)}function Mh(e){this.a=new _g(e)}function Nh(e){this.a=new Zbe(e)}function Ph(e,t){for(;e.Pe(t););}function Fh(e,t){for(;e.zd(t););}function Uce(e,t,n){xbe(e.a,t,n)}function Ih(e,t,n){e.splice(t,n)}function Lh(e,t){return Jrt(t,e)}function Wce(e,t){return e.d[t.p]}function Rh(e){return e.b!=e.d.c}function zh(e){return e.l|e.m<<22}function Bh(e){return e?e.d:null}function Gce(e){return e?e.g:null}function Kce(e){return e?e.i:null}function qce(e,t){return b5e(e,t)}function Vh(e){return fD(e),e.a}function Hh(e){e.c?h7e(e):g7e(e)}function Jce(){this.b=new _B(fjt)}function Yce(){this.b=new _B(sFt)}function Xce(){this.b=new _B(sFt)}function Uh(){this.a=new _B(NMt)}function Zce(){this.a=new _B(VNt)}function Wh(e){this.a=0,this.b=e}function Gh(){throw E(new Sf)}function Qce(){throw E(new Sf)}function $ce(){throw E(new Sf)}function ele(){throw E(new Sf)}function tle(){throw E(new Sf)}function nle(){throw E(new Sf)}function rle(){throw E(new Sf)}function Kh(){throw E(new Sf)}function ile(){throw E(new Sf)}function ale(){throw E(new Sf)}function ole(){throw E(new Cf)}function sle(){throw E(new Cf)}function qh(e){this.a=new lg(e)}function Jh(e,t){this.e=e,this.d=t}function Yh(e,t){this.b=e,this.c=t}function cle(e){WS(e.dc()),this.c=e}function Xh(e,t){BS.call(this,e,t)}function Zh(e,t){Xh.call(this,e,t)}function lle(e,t){this.a=e,this.b=t}function ule(e,t){this.a=e,this.b=t}function dle(e,t){this.a=e,this.b=t}function Qh(e,t){this.a=e,this.b=t}function fle(e,t){this.a=e,this.b=t}function ple(e,t){this.a=e,this.b=t}function mle(e,t){this.a=e,this.b=t}function hle(e,t){this.b=e,this.a=t}function gle(e,t){this.b=e,this.a=t}function $h(e,t){this.g=e,this.i=t}function _le(e,t){this.a=e,this.b=t}function vle(e,t){this.b=e,this.a=t}function yle(e,t){this.a=e,this.b=t}function ble(e,t){this.b=e,this.a=t}function eg(e){this.b=P(nD(e),50)}function tg(e){this.b=P(nD(e),92)}function ng(e,t){this.f=e,this.g=t}function rg(e,t){this.a=e,this.b=t}function ig(e,t){this.a=e,this.f=t}function ag(e){this.a=P(nD(e),16)}function xle(e){this.a=P(nD(e),16)}function Sle(e,t){this.b=e,this.c=t}function Cle(e){this.a=P(nD(e),92)}function wle(e,t){this.a=e,this.b=t}function og(e,t){this.a=e,this.b=t}function Tle(e,t){return PE(e.b,t)}function Ele(e,t){return e>t&&t<dU}function sg(e){return j9[e]!=-1}function cg(e){return!e||ISe(e)}function lg(e){nLe(this,e,W$e())}function Dle(e,t){Rz(R(e.a),t)}function Ole(e,t){Rz(R(e.a),t)}function ug(e,t){return e.b.Gc(t)}function dg(e,t){return e.b.Hc(t)}function kle(e,t){return e.b.Oc(t)}function Ale(e,t){return e.c.uc(t)}function jle(e,t){return e.b.Gc(t)}function Mle(e,t){return OF(e.c,t)}function fg(e){return e.f.c+e.i.c}function pg(e,t){return e.a._b(t)}function Nle(e){return eSe(),e?cyt:syt}function mg(e,t){this.a=e,this.b=t}function hg(e){this.c=e,WPe(this)}function gg(){aS(this),tO(this)}function Ple(){Bvt??=[]}function _g(e){gBe.call(this,e,0)}function Fle(){Zbe.call(this,null)}function vg(){vg=C,Eyt=new re}function yg(){yg=C,OX=new oe}function bg(){bg=C,AX=new lde}function xg(){xg=C,obt=new Ee}function Sg(){Sg=C,BX=new De}function Cg(){Cg=C,Zyt=new ude}function Ile(){YMe.call(this,null)}function wg(e,t){fD(e),e.a.Nb(t)}function Lle(e,t){return e.a.Vc(t)}function Rle(e,t){return e.a.Wc(t)}function Tg(e,t){return e.a.Yc(t)}function Eg(e,t){return e.a.Zc(t)}function zle(e,t){return e.Fc(t),e}function Ble(e,t){return e.a.f=t,e}function Vle(e,t){return e.a.d=t,e}function Hle(e,t){return e.a.g=t,e}function Ule(e,t){return e.a.j=t,e}function Dg(e,t){return e.a.a=t,e}function Og(e,t){return e.a.d=t,e}function kg(e,t){return e.a.e=t,e}function Ag(e,t){return e.a.g=t,e}function jg(e,t){return e.a.f=t,e}function Wle(e){return e.b=!1,e}function Mg(){Mg=C,xSt=new fee}function Gle(){Gle=C,vbt=new Fe}function Ng(){Ng=C,uSt=new it}function Pg(){Pg=C,zSt=new Dee}function Kle(){Kle=C,dSt=new uee}function Fg(){Fg=C,fSt=new pbe}function qle(){qle=C,TSt=new _t}function Ig(){Ig=C,DSt=new vt}function Jle(){Jle=C,TCt=new an}function Lg(){Lg=C,RSt=new hh}function Rg(){Rg=C,LCt=new mte}function zg(){zg=C,t$=new Ar}function Bg(){Bg=C,hkt=new po}function Vg(){Vg=C,lFt=new Wg}function Yle(){UIe(),this.c=new gm}function Hg(){Hg=C,fFt=new Spe}function Ug(){Ug=C,u6=new YSe}function Xle(){QY!=0&&(QY=0),$Y=-1}function Wg(){ng.call(this,ddt,0)}function Zle(e,t,n,r){JKe(e,r,t,n)}function Qle(e,t,n,r){f8e(r,e,t,n)}function $le(e,t,n,r){Yot(r,e,t,n)}function eue(e,t,n){KO(e.d,t.f,n)}function Gg(e,t){uL(e.c.b,t.c,t)}function Kg(e,t){uL(e.c.c,t.b,t)}function qg(e,t){return e.a=t.g,e}function Jg(){Jg=C,Dzt=new zne}function tue(){tue=C,Bzt=new Po}function nue(){nue=C,yBt=new ap}function Yg(){Yg=C,V7=new lp}function rue(){rue=C,bBt=new Mse}function Xg(){Xg=C,xBt=new Pse}function Zg(){Zg=C,D7=new Qd}function Qg(){Qg=C,JBt=new Zd}function $g(){$g=C,LBt=new ufe}function e_(){e_=C,u9=new dfe}function t_(){t_=C,tVt=new rre}function n_(){n_=C,rVt=new ire}function r_(){r_=C,G9=new Hre}function i_(){this.q=new r.Date}function iue(e){this.a=P(nD(e),229)}function a_(e){return P(e,45).jd()}function aue(e){return(e.c+e.a)/2}function oue(e){return e.e.a+e.f.a}function sue(e){return e.e.b+e.f.b}function cue(e){return e.b?e.b:e.a}function lue(e,t){return _Ye(e.a,t)}function uue(e,t){return e.a.a.cc(t)}function o_(e){return e.b<e.d.gc()}function due(e,t){return t.split(e)}function s_(e,t){return _F(e,t)>0}function c_(e,t){return _F(e,t)<0}function fue(e,t){return obe(e.a,t)}function pue(e,t){JTe.call(this,e,t)}function l_(e){iCe(),R$e.call(this,e)}function u_(e){iCe(),l_.call(this,e)}function d_(e){Mye(),pfe.call(this,e)}function f_(e,t){abe(e,e.length,t)}function p_(e,t){Ixe(e,e.length,t)}function m_(e,t){return e.a.get(t)}function mue(e,t){return PE(e.e,t)}function h_(e){return yD(e),!1}function hue(){return Jm(),new Gyt}function g_(e){return UC(e.a),e.b}function __(e,t){this.b=e,this.a=t}function v_(e,t){this.d=e,this.e=t}function y_(e,t){this.a=e,this.b=t}function b_(e,t){this.a=e,this.b=t}function x_(e,t){this.a=e,this.b=t}function S_(e,t){this.a=e,this.b=t}function gue(e,t){this.b=e,this.a=t}function C_(e,t){this.a=e,this.b=t}function w_(e,t){ng.call(this,e,t)}function T_(e,t){ng.call(this,e,t)}function E_(e,t){ng.call(this,e,t)}function D_(e,t){ng.call(this,e,t)}function O_(e,t){ng.call(this,e,t)}function k_(e,t){ng.call(this,e,t)}function A_(e){sk.call(this,e,21)}function j_(e,t){this.b=e,this.a=t}function M_(e,t){this.b=e,this.a=t}function N_(e,t){this.b=e,this.a=t}function P_(e,t){ng.call(this,e,t)}function F_(e,t){ng.call(this,e,t)}function I_(e,t){ng.call(this,e,t)}function L_(e,t){this.b=e,this.a=t}function R_(e,t){this.c=e,this.d=t}function z_(e,t){ng.call(this,e,t)}function B_(e,t){ng.call(this,e,t)}function _ue(e,t){this.e=e,this.d=t}function V_(e,t){ng.call(this,e,t)}function H_(e,t){this.a=e,this.b=t}function U_(e,t){ng.call(this,e,t)}function W_(e,t){ng.call(this,e,t)}function G_(e,t){ng.call(this,e,t)}function K_(e,t,n){e.splice(t,0,n)}function vue(e,t,n){e.Mb(n)&&t.Ad(n)}function q_(e,t,n){t.Ne(e.a.We(n))}function yue(e,t,n){t.Bd(e.a.Xe(n))}function bue(e,t,n){t.Ad(e.a.Kb(n))}function J_(e,t){return hC(e.c,t)}function xue(e,t){return hC(e.e,t)}function Sue(e,t){this.a=e,this.b=t}function Cue(e,t){this.a=e,this.b=t}function Y_(e,t){this.a=e,this.b=t}function X_(e,t){this.a=e,this.b=t}function Z_(e,t){this.a=e,this.b=t}function wue(e,t){this.a=e,this.b=t}function Tue(e,t){this.a=e,this.b=t}function Eue(e,t){this.a=e,this.b=t}function Q_(e,t){this.b=e,this.a=t}function Due(e,t){this.b=e,this.a=t}function $_(e,t){this.b=e,this.a=t}function ev(e,t){this.b=t,this.c=e}function tv(e,t){ng.call(this,e,t)}function nv(e,t){ng.call(this,e,t)}function rv(e,t){ng.call(this,e,t)}function iv(e,t){ng.call(this,e,t)}function av(e,t){ng.call(this,e,t)}function ov(e,t){ng.call(this,e,t)}function sv(e,t){ng.call(this,e,t)}function cv(e,t){ng.call(this,e,t)}function lv(e,t){ng.call(this,e,t)}function uv(e,t){ng.call(this,e,t)}function dv(e,t){ng.call(this,e,t)}function fv(e,t){ng.call(this,e,t)}function pv(e,t){ng.call(this,e,t)}function mv(e,t){ng.call(this,e,t)}function hv(e,t){ng.call(this,e,t)}function gv(e,t){ng.call(this,e,t)}function _v(e,t){ng.call(this,e,t)}function vv(e,t){ng.call(this,e,t)}function yv(e,t){ng.call(this,e,t)}function bv(e,t){ng.call(this,e,t)}function xv(e,t){ng.call(this,e,t)}function Sv(e,t){ng.call(this,e,t)}function Cv(e,t){ng.call(this,e,t)}function wv(e,t){ng.call(this,e,t)}function Tv(e,t){ng.call(this,e,t)}function Ev(e,t){ng.call(this,e,t)}function Dv(e,t){ng.call(this,e,t)}function Ov(e,t){ng.call(this,e,t)}function kv(e,t){ng.call(this,e,t)}function Av(e,t){ng.call(this,e,t)}function jv(e,t){ng.call(this,e,t)}function Mv(e,t){ng.call(this,e,t)}function Nv(e,t){ng.call(this,e,t)}function Pv(e,t){ng.call(this,e,t)}function Fv(e,t){ng.call(this,e,t)}function Iv(e,t){this.b=e,this.a=t}function Lv(e,t){ng.call(this,e,t)}function Rv(e,t){this.a=e,this.b=t}function zv(e,t){this.a=e,this.b=t}function Bv(e,t){this.a=e,this.b=t}function Vv(e,t){ng.call(this,e,t)}function Hv(e,t){ng.call(this,e,t)}function Uv(e,t){this.a=e,this.b=t}function Wv(e,t){return pT(),t!=e}function Gv(e){return w4e(e,e.c),e}function Kv(e){r.clearTimeout(e)}function qv(e,t){ng.call(this,e,t)}function Jv(e,t){ng.call(this,e,t)}function Yv(e,t){this.a=e,this.b=t}function Oue(e,t){this.a=e,this.b=t}function kue(e,t){this.b=e,this.d=t}function Xv(e,t){this.a=e,this.b=t}function Zv(e,t){this.b=e,this.a=t}function Qv(e,t){ng.call(this,e,t)}function $v(e,t){ng.call(this,e,t)}function ey(e,t){ng.call(this,e,t)}function ty(e,t){ng.call(this,e,t)}function ny(e,t){ng.call(this,e,t)}function ry(e,t){this.b=e,this.a=t}function Aue(e,t){this.b=e,this.a=t}function iy(e,t){this.b=e,this.a=t}function jue(e,t){this.b=e,this.a=t}function ay(e,t){ng.call(this,e,t)}function oy(e,t){ng.call(this,e,t)}function sy(e,t){ng.call(this,e,t)}function cy(e,t){ng.call(this,e,t)}function ly(e,t){ng.call(this,e,t)}function uy(e,t){ng.call(this,e,t)}function dy(e,t){ng.call(this,e,t)}function fy(e,t){ng.call(this,e,t)}function py(e,t){ng.call(this,e,t)}function my(e,t){ng.call(this,e,t)}function hy(e,t){ng.call(this,e,t)}function gy(e,t){ng.call(this,e,t)}function _y(e,t){ng.call(this,e,t)}function vy(e,t){ng.call(this,e,t)}function yy(e,t){ng.call(this,e,t)}function by(e,t){ng.call(this,e,t)}function xy(e,t){ng.call(this,e,t)}function Sy(e,t){this.a=e,this.b=t}function Mue(e,t){this.a=e,this.b=t}function Nue(e,t){this.a=e,this.b=t}function Pue(){dT(),this.a=new yme}function Fue(){SB(),this.a=new jf}function Iue(){ek(),this.b=new jf}function Lue(){vEe(),gbe.call(this)}function Rue(){mEe(),zwe.call(this)}function zue(){mEe(),zwe.call(this)}function Cy(e,t){ng.call(this,e,t)}function wy(e,t){ng.call(this,e,t)}function Ty(e,t){ng.call(this,e,t)}function Ey(e,t){ng.call(this,e,t)}function Dy(e,t){ng.call(this,e,t)}function Oy(e,t){ng.call(this,e,t)}function ky(e,t){ng.call(this,e,t)}function Ay(e,t){ng.call(this,e,t)}function jy(e,t){ng.call(this,e,t)}function My(e,t){ng.call(this,e,t)}function Ny(e,t){ng.call(this,e,t)}function Py(e,t){ng.call(this,e,t)}function Fy(e,t){ng.call(this,e,t)}function Iy(e,t){ng.call(this,e,t)}function Ly(e,t){ng.call(this,e,t)}function Ry(e,t){ng.call(this,e,t)}function zy(e,t){ng.call(this,e,t)}function By(e,t){ng.call(this,e,t)}function Vy(e,t){ng.call(this,e,t)}function Hy(e,t){ng.call(this,e,t)}function Uy(e,t){ng.call(this,e,t)}function Wy(e,t){ng.call(this,e,t)}function k(e,t){this.a=e,this.b=t}function Bue(e,t){this.a=e,this.b=t}function Vue(e,t){this.a=e,this.b=t}function Hue(e,t){this.a=e,this.b=t}function Uue(e,t){this.a=e,this.b=t}function Wue(e,t){this.a=e,this.b=t}function Gue(e,t){this.a=e,this.b=t}function Gy(e,t){this.a=e,this.b=t}function Ky(e,t){this.a=e,this.b=t}function Kue(e,t){this.a=e,this.b=t}function qy(e,t){this.a=e,this.b=t}function Jy(e,t){this.a=e,this.b=t}function que(e,t){this.a=e,this.b=t}function Jue(e,t){this.a=e,this.b=t}function Yue(e,t){this.b=e,this.a=t}function Xue(e,t){this.b=e,this.a=t}function Yy(e,t){this.b=e,this.a=t}function Zue(e,t){this.b=e,this.a=t}function Xy(e,t){this.a=e,this.b=t}function Zy(e,t){this.a=e,this.b=t}function Qy(e,t){this.a=e,this.b=t}function $y(e,t){this.a=e,this.b=t}function eb(e,t){this.f=e,this.c=t}function tb(e,t){this.i=e,this.g=t}function nb(e,t){ng.call(this,e,t)}function rb(e,t){ng.call(this,e,t)}function ib(e,t){this.a=e,this.b=t}function Que(e,t){this.a=e,this.b=t}function ab(e,t){this.d=e,this.e=t}function $ue(e,t){this.a=e,this.b=t}function ob(e,t){this.a=e,this.b=t}function sb(e,t){this.d=e,this.b=t}function ede(e,t){this.e=e,this.a=t}function tde(e,t){e.i=null,nN(e,t)}function cb(e,t){e&&kD(C7,e,t)}function lb(e,t){return EWe(e.a,t)}function ub(e,t){return hC(e.g,t)}function nde(e,t){return hC(t.b,e)}function db(e,t){return-e.b.$e(t)}function fb(e){return LI(e.c,e.b)}function pb(e,t){GPe(new zS(e),t)}function rde(e,t,n){zXe(t,dz(e,n))}function ide(e,t,n){zXe(t,dz(e,n))}function ade(e,t){fPe(e.a,P(t,12))}function ode(e,t){this.a=e,this.b=t}function mb(e,t){this.b=e,this.c=t}function hb(e,t){return e.Pd().Xb(t)}function gb(e,t){return mRe(e.Jc(),t)}function _b(e){return e?e.kd():null}function A(e){return e??null}function vb(e){return typeof e===EH}function yb(e){return typeof e===slt}function bb(e){return typeof e===DH}function xb(e,t){return _F(e,t)==0}function Sb(e,t){return _F(e,t)>=0}function Cb(e,t){return _F(e,t)!=0}function sde(e,t){return e.a+=``+t,e}function wb(e){return``+(yD(e),e)}function Tb(e){return kI(e),e.d.gc()}function Eb(e){return dk(e,0),null}function Db(e){return NT(e==null),e}function Ob(e,t){return e.a+=``+t,e}function kb(e,t){return e.a+=``+t,e}function Ab(e,t){return e.a+=``+t,e}function jb(e,t){return e.a+=``+t,e}function Mb(e,t){return e.a+=``+t,e}function Nb(e,t){e.q.setTime(jk(t))}function cde(e,t){Qbe.call(this,e,t)}function Pb(e,t){Qbe.call(this,e,t)}function Fb(e,t){Qbe.call(this,e,t)}function Ib(e,t){oA(e,t,e.c.b,e.c)}function Lb(e,t){oA(e,t,e.a,e.a.a)}function Rb(e,t){return e.j[t.p]==2}function zb(e,t){return e.a=t.g+1,e}function Bb(e){return e.a=0,e.b=0,e}function Vb(e){SE(this),wN(this,e)}function lde(){this.b=0,this.a=!1}function ude(){this.b=0,this.a=!1}function Hb(){this.b=new _g(RN(12))}function Ub(){Ub=C,$bt=cF(uKe())}function Wb(){Wb=C,wCt=cF(P8e())}function Gb(){Gb=C,Ejt=cF(LRe())}function dde(){dde=C,use(),oyt=new Qd}function fde(e){return nD(e),new px(e)}function pde(e,t){return A(e)===A(t)}function Kb(e){return e<10?`0`+e:``+e}function mde(e){return eS(e.l,e.m,e.h)}function qb(e){return typeof e===slt}function Jb(e,t){return bO(e.a,0,t)}function Yb(e){return AO((yD(e),e))}function hde(e){return AO((yD(e),e))}function Xb(e,t){return BF(e.a,t.a)}function Zb(e,t){return Qx(e.a,t.a)}function gde(e,t){return jxe(e.a,t.a)}function Qb(e,t){return e.indexOf(t)}function $b(e,t){uj(e,0,e.length,t)}function ex(e,t){Zg(),kD(D7,e,t)}function tx(e,t){Aw.call(this,e,t)}function nx(e,t){Qw.call(this,e,t)}function rx(e,t){tb.call(this,e,t)}function _de(e,t){DC.call(this,e,t)}function ix(e,t){YN.call(this,e,t)}function ax(){nu.call(this,new aA)}function ox(){QT.call(this,0,0,0,0)}function sx(e){return xj(e.b.b,e,0)}function vde(e,t){return Qx(e.g,t.g)}function yde(e){return e==FZ||e==RZ}function bde(e){return e==FZ||e==IZ}function xde(e,t){return Qx(e.g,t.g)}function cx(e,t){return fT(),t.a+=e}function Sde(e,t){return fT(),t.a+=e}function Cde(e,t){return fT(),t.c+=e}function wde(e,t){return M(e.c,t),e}function lx(e,t){return M(e.a,t),t}function ux(e,t){return NN(e.a,t),e}function dx(e){this.a=hue(),this.b=e}function Tde(e){this.a=hue(),this.b=e}function fx(e){this.a=e.a,this.b=e.b}function px(e){this.a=e,Qs.call(this)}function mx(e){this.a=e,Qs.call(this)}function hx(e){return e.sh()&&e.th()}function gx(e){return e!=i5&&e!=a5}function _x(e){return e==y8||e==b8}function vx(e){return e==S8||e==v8}function yx(e){return e==r4||e==n4}function bx(e){return NN(new xD,e)}function Ede(e){return FD(P(e,125))}function xx(e,t){return BF(t.f,e.f)}function Sx(e,t){return new YN(t,e)}function Dde(e,t){return new YN(t,e)}function Cx(e,t,n){wM(e,t),TM(e,n)}function wx(e,t,n){yM(e,t),bM(e,n)}function Tx(e,t,n){CM(e,t),vM(e,n)}function Ex(e,t,n){xM(e,t),SM(e,n)}function Dx(e,t,n){EM(e,t),DM(e,n)}function Ox(e,t){iF(e,t),jM(e,e.D)}function kx(e){eb.call(this,e,!0)}function Ax(){KD.call(this,0,0,0,0)}function jx(){w_.call(this,`Head`,1)}function Ode(){w_.call(this,`Tail`,3)}function kde(e,t,n){Dw.call(this,e,t,n)}function Mx(e){QT.call(this,e,e,e,e)}function Nx(e){qB(),CRe.call(this,e)}function Ade(e){oM(e.Qf(),new _u(e))}function Px(e){return e==null?0:xN(e)}function jde(e,t){return rM(t,BO(e))}function Mde(e,t){return rM(t,BO(e))}function Nde(e,t){return e[e.length]=t}function Pde(e,t){return e[e.length]=t}function Fde(e,t){return YM(aSe(e.f),t)}function Ide(e,t){return YM(aSe(e.n),t)}function Fx(e,t){return YM(aSe(e.p),t)}function Ix(e){return pve(e.b.Jc(),e.a)}function Lx(e){return e==null?0:xN(e)}function Rx(e){e.c=V(RY,PH,1,0,5,1)}function Lde(e,t,n){iD(e.c[t.g],t.g,n)}function zx(e,t,n){P(e.c,72).Ei(t,n)}function Rde(e,t,n){Cx(n,n.i+e,n.j+t)}function Bx(e,t){Aw.call(this,e.b,t)}function zde(e,t){XA(Zk(e.a),BEe(t))}function Bde(e,t){XA(Ej(e.a),VEe(t))}function Vde(e,t){LX||(e.b=t)}function Vx(e,t,n){return iD(e,t,n),n}function Hx(){Hx=C,new Hde,new Zd}function Hde(){new Qd,new Qd,new Qd}function Ude(){throw E(new nm(Ivt))}function Ux(){throw E(new nm(Ivt))}function Wde(){throw E(new nm(Lvt))}function Gde(){throw E(new nm(Lvt))}function Kde(){Kde=C,J4=new DI(vRt)}function Wx(){Wx=C,r.Math.log(2)}function Gx(){Gx=C,f9=(tue(),Bzt)}function Kx(e){bH(),Yd.call(this,e)}function qde(e){this.a=e,uve.call(this,e)}function qx(e){this.a=e,tg.call(this,e)}function Jx(e){this.a=e,tg.call(this,e)}function Yx(e,t){ibe(e.c,e.c.length,t)}function Xx(e){return e.a<e.c.c.length}function Zx(e){return e.a<e.c.a.length}function Jde(e,t){return e.a?e.b:t.Ue()}function Qx(e,t){return e<t?-1:+(e>t)}function $x(e,t){return _F(e,t)>0?e:t}function eS(e,t,n){return{l:e,m:t,h:n}}function Yde(e,t){e.a!=null&&ade(t,e.a)}function Xde(e){JO(e,null),XO(e,null)}function Zde(e,t,n){return kD(e.g,n,t)}function Qde(e,t){nD(t),ID(e).Ic(new h)}function tS(){cXe(),this.a=new _B(cSt)}function nS(e){this.b=e,this.a=new Zd}function $de(e){this.b=new cee,this.a=e}function rS(e){xme.call(this),this.a=e}function efe(e){Vwe.call(this),this.b=e}function tfe(){w_.call(this,`Range`,2)}function iS(e){e.j=V(Tyt,X,324,0,0,1)}function aS(e){e.a=new me,e.c=new me}function nfe(e){e.a=new Qd,e.e=new Qd}function oS(e){return new k(e.c,e.d)}function rfe(e){return new k(e.c,e.d)}function sS(e){return new k(e.a,e.b)}function ife(e,t){return kD(e.a,t.a,t)}function afe(e,t,n){return kD(e.k,n,t)}function cS(e,t,n){return WWe(t,n,e.c)}function lS(e,t){return N(sD(e.i,t))}function uS(e,t){return N(sD(e.j,t))}function dS(e,t){return Qat(e.a,t,null)}function fS(e,t){return zit(e.c,e.b,t)}function j(e,t){return e!=null&&YKe(e,t)}function ofe(e,t){BV(e),e.Fc(P(t,16))}function pS(e,t,n){e.c._c(t,P(n,136))}function mS(e,t,n){e.c.Si(t,P(n,136))}function sfe(e,t,n){return Jat(e,t,n),n}function cfe(e,t){return $O(),t.n.b+=e}function hS(e,t){return Pze(e.Jc(),t)!=-1}function lfe(e,t){return new Yfe(e.Jc(),t)}function gS(e){return e.Ob()?e.Pb():null}function _S(e){return $I(e,0,e.length)}function vS(e){kEe(e,null),AEe(e,null)}function ufe(){DC.call(this,null,null)}function dfe(){OC.call(this,null,null)}function ffe(){ng.call(this,`INSTANCE`,0)}function yS(){this.a=V(RY,PH,1,8,5,1)}function bS(e){this.a=e,Qd.call(this)}function pfe(e){this.a=(QD(),new km(e))}function mfe(e){this.b=(QD(),new iu(e))}function xS(){xS=C,Xyt=new Np(null)}function SS(){SS=C,SS(),tbt=new _e}function M(e,t){return ff(e.c,t),!0}function hfe(e,t){e.c&&(tye(t),ETe(t))}function gfe(e,t){e.q.setHours(t),SV(e,t)}function CS(e,t){return e.a.Ac(t)!=null}function wS(e,t){return e.a.Ac(t)!=null}function TS(e,t){return e.a[t.c.p][t.p]}function _fe(e,t){return e.e[t.c.p][t.p]}function vfe(e,t){return e.c[t.c.p][t.p]}function ES(e,t,n){return e.a[t.g][n.g]}function yfe(e,t){return e.j[t.p]=k6e(t)}function DS(e,t){return e.a*t.a+e.b*t.b}function bfe(e,t){return e.a<Che(t)?-1:1}function xfe(e,t){return Lje(e.b,t.Og())}function Sfe(e,t){return Lje(e.f,t.Og())}function Cfe(e,t){return D(N(t.a))<=e}function wfe(e,t){return D(N(t.a))>=e}function Tfe(e,t,n){return n?t!=0:t!=e-1}function OS(e,t,n){e.a=t^1502,e.b=n^xW}function Efe(e,t,n){return e.a=t,e.b=n,e}function kS(e,t){return e.a*=t,e.b*=t,e}function AS(e,t,n){return iD(e.g,t,n),n}function jS(e,t,n,r){iD(e.a[t.g],n.g,r)}function MS(e,t,n){ET.call(this,e,t,n)}function NS(e,t,n){MS.call(this,e,t,n)}function PS(e,t,n){MS.call(this,e,t,n)}function Dfe(e,t,n){NS.call(this,e,t,n)}function FS(e,t,n){ET.call(this,e,t,n)}function IS(e,t,n){ET.call(this,e,t,n)}function Ofe(e,t,n){DT.call(this,e,t,n)}function LS(e,t,n){DT.call(this,e,t,n)}function kfe(e,t,n){LS.call(this,e,t,n)}function Afe(e,t,n){FS.call(this,e,t,n)}function RS(e){this.c=e,this.a=this.c.a}function zS(e){this.i=e,this.f=this.i.j}function BS(e,t){this.a=e,tg.call(this,t)}function jfe(e,t){this.a=e,hm.call(this,t)}function Mfe(e,t){this.a=e,hm.call(this,t)}function Nfe(e,t){this.a=e,hm.call(this,t)}function VS(e){this.a=e,fie.call(this,e.d)}function HS(e){e.b.Qb(),--e.d.f.d,aE(e.d)}function Pfe(e){e.a=P(BN(e.b.a,4),129)}function Ffe(e){e.a=P(BN(e.b.a,4),129)}function Ife(e){gO(e,Vgt),oB(e,mst(e))}function US(e,t){return pUe(e,new wm,t).a}function Lfe(e){return Rh(e.a)?zEe(e):null}function Rfe(e){Xc.call(this,P(nD(e),35))}function zfe(e){Xc.call(this,P(nD(e),35))}function WS(e){if(!e)throw E(new yf)}function GS(e){if(!e)throw E(new bf)}function KS(e,t){return nD(t),new Jfe(e,t)}function Bfe(e,t){return new U1e(e.a,e.b,t)}function Vfe(e){return e.l+e.m*ZU+e.h*QU}function Hfe(e){return e==null?null:e.name}function qS(e,t,n){return e.indexOf(t,n)}function JS(e,t){return e.lastIndexOf(t)}function YS(e){return e==null?FH:OI(e)}function XS(){XS=C,iX=!1,aX=!0}function Ufe(){Ufe=C,t_(),nVt=new Mc}function ZS(){this.Bb|=256,this.Bb|=512}function Wfe(){iS(this),nO(this),this.he()}function QS(e){Yl.call(this,e),this.a=e}function $S(e){Xl.call(this,e),this.a=e}function eC(e){km.call(this,e),this.a=e}function tC(e){Bl.call(this,(yD(e),e))}function nC(e){Bl.call(this,(yD(e),e))}function rC(e){nu.call(this,new ZMe(e))}function Gfe(e){this.a=e,Jl.call(this,e)}function iC(e,t){this.a=t,hm.call(this,e)}function Kfe(e,t){this.a=t,mAe.call(this,e)}function qfe(e,t){this.a=e,mAe.call(this,t)}function Jfe(e,t){this.a=t,eg.call(this,e)}function Yfe(e,t){this.a=t,eg.call(this,e)}function aC(e){Lf.call(this),vN(this,e)}function oC(e){return UC(e.a!=null),e.a}function sC(e,t){return M(t.a,e.a),e.a}function cC(e,t){return M(t.b,e.a),e.a}function lC(e,t){return M(t.a,e.a),e.a}function uC(e,t,n){return wRe(e,t,t,n),e}function dC(e,t){return++e.b,M(e.a,t)}function fC(e,t){return++e.b,bj(e.a,t)}function pC(e,t){return BF(e.c.d,t.c.d)}function Xfe(e,t){return BF(e.c.c,t.c.c)}function Zfe(e,t){return BF(e.n.a,t.n.a)}function mC(e,t){return P(wA(e.b,t),16)}function Qfe(e,t){return e.n.b=(yD(t),t)}function $fe(e,t){return e.n.b=(yD(t),t)}function hC(e,t){return!!t&&e.b[t.g]==t}function gC(e){return Xx(e.a)||Xx(e.b)}function epe(e,t){return BF(e.e.b,t.e.b)}function tpe(e,t){return BF(e.e.a,t.e.a)}function npe(e,t,n){return Fke(e,t,n,e.b)}function _C(e,t,n){return Fke(e,t,n,e.c)}function rpe(e){return fT(),!!e&&!e.dc()}function vC(){Rg(),this.b=new Dae(this)}function yC(){yC=C,nZ=new Aw(yut,0)}function bC(e){this.d=e,zS.call(this,e)}function xC(e){this.c=e,zS.call(this,e)}function SC(e){this.c=e,bC.call(this,e)}function CC(e,t){FGe.call(this,e,t,null)}function wC(e){return e.a==null?null:e.a}function TC(e){return e.$H||=++hbt}function EC(e){var t=e.a;e.a=e.b,e.b=t}function DC(e,t){$g(),this.a=e,this.b=t}function OC(e,t){e_(),this.b=e,this.c=t}function kC(e,t){dbe(),this.f=t,this.d=e}function AC(e,t){Pje(t,e),this.c=e,this.b=t}function jC(e,t){return Fbe(e.c).Kd().Xb(t)}function MC(e,t){return new Zme(e,e.gc(),t)}function NC(e){return Wp(),IM((SEe(),Zvt),e)}function ipe(e){return++W9,new nA(3,e)}function PC(e){return KM(e,fU),new VA(e)}function FC(e){return MO(),parseInt(e)||-1}function IC(e,t,n){return qS(e,IR(t),n)}function LC(e,t,n){P(Cj(e,t),22).Ec(n)}function ape(e,t,n){XF(e.a,n),IL(e.a,t)}function RC(e,t,n){e.dd(t).Rb(n)}function ope(e,t,n,r){zbe.call(this,e,t,n,r)}function spe(e){Cve.call(this,e,null,null)}function zC(e){bg(),this.b=e,this.a=!0}function BC(e){Cg(),this.b=e,this.a=!0}function VC(e){if(!e)throw E(new vf)}function HC(e){if(!e)throw E(new yf)}function cpe(e){if(!e)throw E(new gf)}function UC(e){if(!e)throw E(new Cf)}function WC(e){if(!e)throw E(new bf)}function lpe(e){e.d=new spe(e),e.e=new Qd}function GC(e){return UC(e.b!=0),e.a.a.c}function KC(e){return UC(e.b!=0),e.c.b.c}function qC(e,t){return wRe(e,t,t+1,``),e}function JC(e){fH(),nse(this),this.Df(e)}function YC(e){this.c=e,this.a=1,this.b=1}function XC(e){j(e,161)&&P(e,161).mi()}function upe(e){return e.b=P(twe(e.a),45)}function ZC(e,t){return P(Rj(e.a,t),35)}function QC(e,t){return!!e.q&&PE(e.q,t)}function dpe(e,t){return e>0?t/(e*e):t*100}function fpe(e,t){return e>0?t*t/e:t*t*100}function $C(e){return e.f==null?``+e.g:e.f}function ew(e){return e.f==null?``+e.g:e.f}function ppe(e){return fM(),e.e.a+e.f.a/2}function tw(e){return fM(),e.e.b+e.f.b/2}function mpe(e,t,n){return fM(),n.e.b-e*t}function hpe(e,t,n){return fM(),n.e.a-e*t}function gpe(e,t,n){return Bg(),n.Lg(e,t)}function _pe(e,t){return GR(),kz(e,t.e,t)}function vpe(e,t,n){return M(t,cWe(e,n))}function ype(e,t,n){mj(),e.nf(t)&&n.Ad(e)}function nw(e,t,n){return e.a+=t,e.b+=n,e}function rw(e,t,n){return e.a-=t,e.b-=n,e}function iw(e,t){return e.a=t.a,e.b=t.b,e}function aw(e){return e.a=-e.a,e.b=-e.b,e}function bpe(e){this.c=e,wM(e,0),TM(e,0)}function xpe(e){gg.call(this),HM(this,e)}function Spe(){ng.call(this,`GROW_TREE`,0)}function ow(e,t,n){ij.call(this,e,t,n,2)}function Cpe(e,t){e_(),sw.call(this,e,t)}function sw(e,t){e_(),OC.call(this,e,t)}function wpe(e,t){e_(),OC.call(this,e,t)}function Tpe(e,t){$g(),DC.call(this,e,t)}function cw(e,t){Gx(),YT.call(this,e,t)}function Epe(e,t){Gx(),cw.call(this,e,t)}function lw(e,t){Gx(),cw.call(this,e,t)}function Dpe(e,t){Gx(),lw.call(this,e,t)}function uw(e,t){Gx(),YT.call(this,e,t)}function Ope(e,t){Gx(),uw.call(this,e,t)}function kpe(e,t){Gx(),YT.call(this,e,t)}function dw(e,t){return e.c.Ec(P(t,136))}function Ape(e,t){return P(sD(e.e,t),26)}function jpe(e,t){return P(sD(e.e,t),26)}function fw(e,t,n){return IV(Oj(e,t),n)}function Mpe(e,t,n){return t.xl(e.e,e.c,n)}function Npe(e,t,n){return t.yl(e.e,e.c,n)}function pw(e,t){return bF(e.e,P(t,52))}function Ppe(e,t,n){LF(Zk(e.a),t,BEe(n))}function Fpe(e,t,n){LF(Ej(e.a),t,VEe(n))}function Ipe(e,t){return(yD(e),e)+Che(t)}function Lpe(e){return e==null?null:OI(e)}function Rpe(e){return e==null?null:OI(e)}function zpe(e){return e==null?null:X$e(e)}function Bpe(e){return e==null?null:tst(e)}function mw(e){e.o??I3e(e)}function hw(e){return NT(e==null||vb(e)),e}function N(e){return NT(e==null||yb(e)),e}function gw(e){return NT(e==null||bb(e)),e}function Vpe(e,t){return kqe(e,t),new sCe(e,t)}function _w(e,t){this.c=e,Jh.call(this,e,t)}function vw(e,t){this.a=e,_w.call(this,e,t)}function Hpe(e,t){this.d=e,qie(this),this.b=t}function yw(){FIe.call(this),this.Bb|=sW}function Upe(){this.a=new CO,this.b=new CO}function bw(e){this.q=new r.Date(jk(e))}function xw(){xw=C,N3=new Rd(`root`)}function Sw(){Sw=C,E7=new jse,new rp}function Cw(){Cw=C,ext=vI((YI(),z5))}function Wpe(e,t){t.a?M4e(e,t):wS(e.a,t.b)}function Gpe(e,t){LX||M(e.a,t)}function Kpe(e,t){return Lg(),IN(t.d.i,e)}function qpe(e,t){return bN(),new N9e(t,e)}function Jpe(e,t,n){return e.Le(t,n)<=0?n:t}function Ype(e,t,n){return e.Le(t,n)<=0?t:n}function Xpe(e,t){return P(Rj(e.b,t),144)}function Zpe(e,t){return P(Rj(e.c,t),233)}function ww(e){return P(qT(e.a,e.b),295)}function Qpe(e){return new k(e.c,e.d+e.a)}function $pe(e){return yD(e),e?1231:1237}function eme(e){return $O(),yx(P(e,203))}function Tw(e,t){return P(sD(e.b,t),278)}function tme(e,t,n){++e.j,e.oj(t,e.Xi(t,n))}function Ew(e,t,n){++e.j,e.rj(),zMe(e,t,n)}function Dw(e,t,n){BA.call(this,e,t,n,null)}function nme(e,t,n){BA.call(this,e,t,n,null)}function Ow(e,t){YMe.call(this,e),this.a=t}function kw(e,t){YMe.call(this,e),this.a=t}function Aw(e,t){Rd.call(this,e),this.a=t}function jw(e,t){Ud.call(this,e),this.a=t}function Mw(e,t){Ud.call(this,e),this.a=t}function rme(e,t){this.c=e,aM.call(this,t)}function ime(e,t){this.a=e,Voe.call(this,t)}function Nw(e,t){this.a=e,Voe.call(this,t)}function Pw(e,t,n){return n=lV(e,t,3,n),n}function Fw(e,t,n){return n=lV(e,t,6,n),n}function Iw(e,t,n){return n=lV(e,t,9,n),n}function Lw(e,t){return gO(t,hut),e.f=t,e}function Rw(e,t){return(t&kH)%e.d.length}function ame(e,t,n){return irt(e.c,e.b,t,n)}function ome(e,t,n){return e.apply(t,n)}function sme(e,t,n){e.dd(t).Rb(n)}function cme(e,t,n){return e.a+=$I(t,0,n),e}function zw(e){return!e.a&&(e.a=new te),e.a}function Bw(e,t){var n=e.e;return e.e=t,n}function Vw(e,t){var n=t;return!!e.De(n)}function Hw(e,t){return XS(),e==t?0:e?1:-1}function Uw(e,t){e.a._c(e.b,t),++e.b,e.c=-1}function lme(e,t){e[vW].call(e,t)}function ume(e,t){e[vW].call(e,t)}function dme(e,t,n){Sg(),ul(e,t.Te(e.a,n))}function fme(e,t,n){return BE(e,P(t,23),n)}function Ww(e,t){return Pm(Array(t),e)}function pme(e){return tE(vE(e,32))^tE(e)}function Gw(e){return String.fromCharCode(e)}function mme(e){return e==null?null:e.message}function Kw(e){this.a=(QD(),new Wl(nD(e)))}function hme(e){this.a=(KM(e,fU),new VA(e))}function gme(e){this.a=(KM(e,fU),new VA(e))}function _me(){this.a=new Zd,this.b=new Zd}function vme(){this.a=new Qe,this.b=new lse}function yme(){this.b=new aA,this.a=new aA}function bme(){this.b=new hh,this.c=new Zd}function xme(){this.n=new hh,this.o=new hh}function qw(){this.n=new Yf,this.i=new Ax}function Sme(){this.b=new jf,this.a=new jf}function Cme(){this.a=new Zd,this.d=new Zd}function wme(){this.a=new pc,this.b=new Dte}function Tme(){this.b=new Jce,this.a=new bi}function Eme(){this.b=new Qd,this.a=new Qd}function Dme(){qw.call(this),this.a=new hh}function Ome(e,t,n,r){QT.call(this,e,t,n,r)}function kme(e,t){return e.n.a=(yD(t),t)+10}function Ame(e,t){return e.n.a=(yD(t),t)+10}function jme(e,t){return Lg(),!IN(t.d.i,e)}function Mme(e){SE(e.e),e.d.b=e.d,e.d.a=e.d}function Jw(e){e.b?Jw(e.b):e.f.c.yc(e.e,e.d)}function Nme(e,t){_x(e.f)?E3e(e,t):hQe(e,t)}function Pme(e,t,n){n!=null&&$M(t,iJe(e,n))}function Fme(e,t,n){n!=null&&eN(t,iJe(e,n))}function Yw(e,t,n,r){F.call(this,e,t,n,r)}function Ime(e,t,n,r){F.call(this,e,t,n,r)}function Lme(e,t,n,r){Ime.call(this,e,t,n,r)}function Rme(e,t,n,r){kE.call(this,e,t,n,r)}function Xw(e,t,n,r){kE.call(this,e,t,n,r)}function zme(e,t,n,r){Xw.call(this,e,t,n,r)}function Bme(e,t,n,r){kE.call(this,e,t,n,r)}function Zw(e,t,n,r){Bme.call(this,e,t,n,r)}function Vme(e,t,n,r){Xw.call(this,e,t,n,r)}function Hme(e,t,n,r){Vme.call(this,e,t,n,r)}function Ume(e,t,n,r){mxe.call(this,e,t,n,r)}function Qw(e,t){Xp.call(this,OJ+e+mJ+t)}function Wme(e,t){return t==e||uR(rB(t),e)}function Gme(e,t){return e.hk().ti().oi(e,t)}function Kme(e,t){return e.hk().ti().qi(e,t)}function qme(e,t){return e.e=P(e.d.Kb(t),162)}function Jme(e,t){return kD(e.a,t,``)==null}function Yme(e,t){return yD(e),A(e)===A(t)}function $w(e,t){return yD(e),A(e)===A(t)}function Xme(e,t,n){return e.lastIndexOf(t,n)}function Zme(e,t,n){this.a=e,AC.call(this,t,n)}function Qme(e){this.c=e,Fb.call(this,$H,0)}function $me(e,t,n){this.c=t,this.b=n,this.a=e}function eT(e,t){return e.a+=t.a,e.b+=t.b,e}function tT(e,t){return e.a-=t.a,e.b-=t.b,e}function ehe(e){return Tf(e.j.c,0),e.a=-1,e}function the(e,t){return t.ni(e.a)}function nhe(e,t,n){return n=lV(e,t,11,n),n}function rhe(e,t,n){return BF(e[t.a],e[n.a])}function ihe(e,t){return Qx(e.a.d.p,t.a.d.p)}function ahe(e,t){return Qx(t.a.d.p,e.a.d.p)}function ohe(e,t){return BF(e.c-e.s,t.c-t.s)}function she(e,t){return BF(e.b.e.a,t.b.e.a)}function che(e,t){return BF(e.c.e.a,t.c.e.a)}function lhe(e,t){return W(t,(hH(),O0),e)}function uhe(e,t){return e.b.zd(new b_(e,t))}function dhe(e,t){return e.b.zd(new x_(e,t))}function fhe(e,t){return e.b.zd(new S_(e,t))}function phe(e,t){return j(t,16)&&j7e(e.c,t)}function mhe(e){return e.c?xj(e.c.a,e,0):-1}function hhe(e){return e<100?null:new _h(e)}function nT(e){return e==e5||e==n5||e==t5}function ghe(e,t,n){return P(e.c,72).Uk(t,n)}function rT(e,t,n){return P(e.c,72).Vk(t,n)}function _he(e,t,n){return Mpe(e,P(t,344),n)}function vhe(e,t,n){return Npe(e,P(t,344),n)}function yhe(e,t,n){return AZe(e,P(t,344),n)}function bhe(e,t,n){return NQe(e,P(t,344),n)}function iT(e,t){return t==null?null:xF(e.b,t)}function xhe(e,t){LX||t&&(e.d=t)}function She(e,t){if(!e)throw E(new $p(t))}function aT(e){if(!e)throw E(new em(ult))}function Che(e){return yb(e)?(yD(e),e):e.se()}function oT(e){return!isNaN(e)&&!isFinite(e)}function whe(e){aS(this),tO(this),vN(this,e)}function sT(e){Rx(this),Tve(this.c,0,e.Nc())}function cT(e){pT(),this.d=e,this.a=new yS}function The(e,t,n){this.d=e,this.b=n,this.a=t}function lT(e,t,n){this.a=e,this.b=t,this.c=n}function Ehe(e,t,n){this.a=e,this.b=t,this.c=n}function Dhe(e,t){this.c=e,WE.call(this,e,t)}function Ohe(e,t){yve.call(this,e,e.length,t)}function khe(e,t){if(e!=t)throw E(new vf)}function Ahe(e){this.a=e,vg(),zN(Date.now())}function jhe(e){uD(e.a),HMe(e.c,e.b),e.b=null}function Mhe(){Mhe=C,Jyt=new he,Yyt=new ge}function Nhe(e){var t=new Be;return t.e=e,t}function Phe(e,t,n){return Sg(),e.a.Wd(t,n),t}function Fhe(e,t,n){this.b=e,this.c=t,this.a=n}function Ihe(e){var t=new yse;return t.b=e,t}function Lhe(e){return lM(),IM((EMe(),Tbt),e)}function Rhe(e){return fj(),IM((jNe(),rbt),e)}function zhe(e){return QP(),IM((TMe(),pbt),e)}function Bhe(e){return pj(),IM((DMe(),Dbt),e)}function Vhe(e){return Pj(),IM((OMe(),Abt),e)}function Hhe(e){return xH(),IM((Ub(),$bt),e)}function Uhe(e){return QN(),IM((BNe(),nxt),e)}function Whe(e){return vP(),IM((VNe(),hSt),e)}function Ghe(e){return Kj(),IM((LAe(),_xt),e)}function Khe(e){return wj(),IM((wMe(),iSt),e)}function qhe(e){return BR(),IM((tFe(),lSt),e)}function Jhe(e){return aL(),IM((zNe(),wSt),e)}function Yhe(e){return Zz(),IM((NRe(),kSt),e)}function Xhe(e){return oN(),IM((RAe(),VSt),e)}function Zhe(e){QT.call(this,e.d,e.c,e.a,e.b)}function Qhe(e){QT.call(this,e.d,e.c,e.a,e.b)}function $he(e){return yH(),IM((Wb(),wCt),e)}function ege(){ege=C,nBt=V(RY,PH,1,0,5,1)}function tge(){tge=C,jBt=V(RY,PH,1,0,5,1)}function nge(){nge=C,MBt=V(RY,PH,1,0,5,1)}function uT(){uT=C,rQ=new Fee,iQ=new Iee}function dT(){dT=C,ACt=new pn,kCt=new mn}function fT(){fT=C,RCt=new lr,zCt=new ate}function rge(e){return cN(),IM((cMe(),YCt),e)}function ige(e){return rP(),IM((GNe(),HCt),e)}function age(e){return wR(),IM((YPe(),WCt),e)}function oge(e){return IB(),IM((IRe(),ZCt),e)}function sge(e){return uz(),IM((oIe(),QCt),e)}function cge(e){return GA(),IM((bAe(),twt),e)}function lge(e){return CI(),IM((qNe(),awt),e)}function uge(e){return VM(),IM((rMe(),cwt),e)}function dge(e){return Qz(),IM((rze(),dwt),e)}function fge(e){return qj(),IM((xAe(),mwt),e)}function pge(e){return bP(),IM((iMe(),gwt),e)}function mge(e){return YR(),IM((aIe(),vwt),e)}function hge(e){return _j(),IM((SAe(),xwt),e)}function gge(e){return mR(),IM((rIe(),Dwt),e)}function _ge(e){return KR(),IM((iIe(),Pwt),e)}function vge(e){return kB(),IM((Bze(),Fwt),e)}function yge(e){return eP(),IM((aMe(),Iwt),e)}function bge(e){return yP(),IM((oMe(),Rwt),e)}function xge(e){return Fj(),IM((sMe(),Bwt),e)}function Sge(e){return Fk(),IM((CAe(),Uwt),e)}function Cge(e){return SI(),IM((ZPe(),iTt),e)}function wge(e){return uA(),IM((wAe(),oTt),e)}function Tge(e){return pB(),IM((ize(),Skt),e)}function Ege(e){return fF(),IM((lMe(),Tkt),e)}function Dge(e){return OL(),IM((UNe(),Ekt),e)}function Oge(e){return xL(),IM((XPe(),kkt),e)}function kge(e){return YB(),IM((zze(),Fkt),e)}function Age(e){return JI(),IM((WNe(),Rkt),e)}function jge(e){return Tj(),IM((TAe(),Bkt),e)}function Mge(e){return BM(),IM((uMe(),Hkt),e)}function Nge(e){return tP(),IM((dMe(),Kkt),e)}function Pge(e){return ZP(),IM((fMe(),Jkt),e)}function Fge(e){return pF(),IM((pMe(),Zkt),e)}function Ige(e){return zM(),IM((mMe(),tAt),e)}function Lge(e){return nP(),IM((hMe(),rAt),e)}function Rge(e){return _P(),IM((RNe(),OCt),e)}function zge(e){return dF(),IM((HNe(),wAt),e)}function Bge(e,t){return(yD(e),e)+(yD(t),t)}function Vge(e){return lA(),IM((EAe(),jAt),e)}function Hge(e){return NO(),IM((OAe(),BAt),e)}function Uge(e){return PO(),IM((DAe(),HAt),e)}function Wge(e){return UA(),IM((kAe(),ijt),e)}function pT(){pT=C,DAt=(rH(),N5),z4=p5}function Gge(e){return FO(),IM((AAe(),djt),e)}function Kge(e){return QL(),IM((XNe(),pjt),e)}function qge(e){return QB(),IM((Gb(),Ejt),e)}function Jge(e){return YP(),IM((gMe(),kjt),e)}function Yge(e){return JP(),IM((KNe(),wMt),e)}function Xge(e){return Pk(),IM((jAe(),OMt),e)}function Zge(e){return sN(),IM((MAe(),PMt),e)}function Qge(e){return ER(),IM((QPe(),VMt),e)}function $ge(e){return gj(),IM((NAe(),GMt),e)}function e_e(e){return XP(),IM((_Me(),YMt),e)}function t_e(e){return VL(),IM((YNe(),PNt),e)}function n_e(e){return $N(),IM((vMe(),zNt),e)}function r_e(e){return qI(),IM((yMe(),HNt),e)}function i_e(e){return LR(),IM((JNe(),JNt),e)}function a_e(e){return wI(),IM((CMe(),rPt),e)}function o_e(e){return!e.e&&(e.e=new Zd),e.e}function mT(e,t,n){this.e=t,this.b=e,this.d=n}function s_e(e,t,n){this.a=e,this.b=t,this.c=n}function c_e(e,t,n){this.a=e,this.b=t,this.c=n}function l_e(e,t,n){this.a=e,this.b=t,this.c=n}function u_e(e,t,n){this.a=e,this.b=t,this.c=n}function d_e(e,t,n){this.a=e,this.c=t,this.b=n}function hT(e,t,n){this.b=e,this.a=t,this.c=n}function f_e(e,t,n){this.b=e,this.a=t,this.c=n}function p_e(e,t){this.c=e,this.a=t,this.b=t-e}function m_e(e){return VF(),IM((xMe(),rFt),e)}function h_e(e){return Hg(),IM((UOe(),mFt),e)}function g_e(e){return WA(),IM((FAe(),_Ft),e)}function __e(e){return QR(),IM((eFe(),wFt),e)}function v_e(e){return Vg(),IM((HOe(),dFt),e)}function y_e(e){return cB(),IM(($Pe(),oFt),e)}function b_e(e){return HF(),IM((SMe(),cFt),e)}function x_e(e){return _A(),IM((PAe(),qPt),e)}function S_e(e){return vj(),IM((bMe(),QPt),e)}function C_e(e){return Ug(),IM((WOe(),aIt),e)}function w_e(e){return iP(),IM((IAe(),cIt),e)}function T_e(e){return fL(),IM((rFe(),bIt),e)}function E_e(e){return oz(),IM((PRe(),CIt),e)}function D_e(e){return GF(),IM((QNe(),yRt),e)}function O_e(e){return KF(),IM((nFe(),uRt),e)}function k_e(e){return WF(),IM((ZNe(),mRt),e)}function A_e(e){return uM(),IM((kMe(),gRt),e)}function j_e(e){return kL(),IM(($Fe(),OIt),e)}function M_e(e){return xR(),IM((eIe(),WIt),e)}function N_e(e){return Hz(),IM((oze(),zRt),e)}function P_e(e){return pL(),IM((iFe(),HRt),e)}function F_e(e){return TR(),IM((nIe(),WRt),e)}function I_e(e){return Sz(),IM((tIe(),GRt),e)}function L_e(e){return $L(),IM(($Ne(),RRt),e)}function R_e(e){return RR(),IM((QFe(),DRt),e)}function z_e(e){return $P(),IM((jMe(),FRt),e)}function B_e(e){return dA(),IM((ePe(),pzt),e)}function V_e(e){return iV(),IM((aze(),azt),e)}function H_e(e){return UF(),IM((AMe(),czt),e)}function U_e(e){return rH(),IM((aFe(),KRt),e)}function W_e(e){return _M(),IM((MMe(),tzt),e)}function G_e(e){return YI(),IM((tPe(),nzt),e)}function K_e(e){return TI(),IM((nPe(),yzt),e)}function q_e(e){return qP(),IM((rPe(),Ezt),e)}function J_e(e){return Bz(),IM((FRe(),Yzt),e)}function Y_e(e,t,n){Gx(),STe.call(this,e,t,n)}function X_e(e,t,n){Gx(),OSe.call(this,e,t,n)}function Z_e(e,t,n){Gx(),X_e.call(this,e,t,n)}function Q_e(e,t,n){Gx(),X_e.call(this,e,t,n)}function $_e(e,t,n){Gx(),Q_e.call(this,e,t,n)}function eve(e,t,n){Gx(),tve.call(this,e,t,n)}function tve(e,t,n){Gx(),OSe.call(this,e,t,n)}function nve(e,t,n){Gx(),OSe.call(this,e,t,n)}function rve(e,t,n){Gx(),nve.call(this,e,t,n)}function ive(e,t,n){this.a=e,this.c=t,this.b=n}function ave(e,t,n){this.a=e,this.b=t,this.c=n}function ove(e,t,n){this.a=e,this.b=t,this.c=n}function sve(e,t,n){this.a=e,this.b=t,this.c=n}function cve(e,t,n){this.a=e,this.b=t,this.c=n}function lve(e,t,n){this.a=e,this.b=t,this.c=n}function gT(e,t,n){this.e=e,this.a=t,this.c=n}function uve(e){this.d=e,qie(this),this.b=Nbe(e.d)}function dve(e,t){wle.call(this,e,cI(new rm(t)))}function _T(e,t){return nD(e),nD(t),new ule(e,t)}function vT(e,t){return nD(e),nD(t),new Jve(e,t)}function fve(e,t){return nD(e),nD(t),new Yve(e,t)}function pve(e,t){return nD(e),nD(t),new ble(e,t)}function mve(e){return UC(e.b!=0),iM(e,e.a.a)}function hve(e){return UC(e.b!=0),iM(e,e.c.b)}function gve(e){return!e.c&&(e.c=new Zo),e.c}function yT(e){var t=new gg;return ALe(t,e),t}function _ve(e){var t=new Lf;return ALe(t,e),t}function vve(e){var t=new jf;return APe(t,e),t}function bT(e){var t=new Zd;return APe(t,e),t}function P(e,t){return NT(e==null||YKe(e,t)),e}function yve(e,t,n){$be.call(this,t,n),this.a=e}function bve(e,t){this.c=e,this.b=t,this.a=!1}function xve(){this.a=`;,;`,this.b=``,this.c=``}function Sve(e,t,n){this.b=e,cde.call(this,t,n)}function Cve(e,t,n){this.c=e,v_.call(this,t,n)}function wve(e,t,n){R_.call(this,e,t),this.b=n}function Tve(e,t,n){t4e(n,0,e,t,n.length,!1)}function xT(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function Eve(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function Dve(e,t){t&&(e.b=t,e.a=(fD(t),t.a))}function ST(e,t){if(!e)throw E(new $p(t))}function CT(e,t){if(!e)throw E(new em(t))}function Ove(e,t){if(!e)throw E(new nce(t))}function kve(e,t){return zg(),Qx(e.d.p,t.d.p)}function Ave(e,t){return fM(),BF(e.e.b,t.e.b)}function jve(e,t){return fM(),BF(e.e.a,t.e.a)}function Mve(e,t){return Qx(oye(e.d),oye(t.d))}function wT(e,t){return t&&mD(e,t.d)?t:null}function Nve(e,t){return t==(rH(),N5)?e.c:e.d}function Pve(e){return new k(e.c+e.b,e.d+e.a)}function Fve(e){return e!=null&&!FUe(e,O7,k7)}function Ive(e,t){return(MHe(e)<<4|MHe(t))&wU}function Lve(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function Rve(e){var t=e.b;e.b=e.c,e.c=t}function zve(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function Bve(e,t){var n=e.c;return QIe(e,t),n}function Vve(e,t){return t<0?e.g=-1:e.g=t,e}function TT(e,t){return BFe(e),e.a*=t,e.b*=t,e}function ET(e,t,n){ab.call(this,e,t),this.c=n}function DT(e,t,n){ab.call(this,e,t),this.c=n}function Hve(e){nge(),Fo.call(this),this._h(e)}function Uve(){MA(),MSe.call(this,(Yg(),V7))}function Wve(e){return bH(),++W9,new XT(0,e)}function Gve(){Gve=C,iVt=(QD(),new Wl(hY))}function OT(){OT=C,new iqe((xp(),GY),(bp(),WY))}function Kve(){this.b=D(N(hL((fV(),gZ))))}function qve(e){this.b=e,this.a=uE(this.b.a).Md()}function Jve(e,t){this.b=e,this.a=t,Qs.call(this)}function Yve(e,t){this.a=e,this.b=t,Qs.call(this)}function Xve(e,t,n){this.a=e,rx.call(this,t,n)}function Zve(e,t,n){this.a=e,rx.call(this,t,n)}function kT(e,t,n){Xj(e,t,new rD(n))}function Qve(e,t,n){var r=e[t];return e[t]=n,r}function AT(e){return lj(e.slice(),e)}function jT(e){var t=e.n;return e.a.b+t.d+t.a}function $ve(e){var t=e.n;return e.e.b+t.d+t.a}function eye(e){var t=e.n;return e.e.a+t.b+t.c}function tye(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function MT(e,t){return oA(e,t,e.c.b,e.c),!0}function nye(e){return e.a?e.a:VD(e)}function NT(e){if(!e)throw E(new Qp(null))}function PT(e,t){return sR(e,new R_(t.a,t.b))}function rye(e){return!xA(e)&&e.c.i.c==e.d.i.c}function iye(e,t){return e.c<t.c?-1:e.c==t.c?0:1}function aye(e){return e.b.c.length-e.e.c.length}function oye(e){return e.e.c.length-e.g.c.length}function sye(e){return e.e.c.length+e.g.c.length}function FT(e){return e==0||isNaN(e)?e:e<0?-1:1}function cye(e){return dM(),V(i3,$K,40,e,0,1)}function lye(){lye=C,vyt=V(dX,X,15,256,0,1)}function uye(){xT(this,!1,!1,!1,!1)}function dye(e){AC.call(this,e.length,0),this.a=e}function fye(e,t){$be.call(this,t,1040),this.a=e}function pye(e,t,n,r){uGe.call(this,e,t,n,r,0,0)}function mye(e){nge(),Hve.call(this,e),this.a=-1}function hye(e){return $O(),(rH(),v5).Gc(e.j)}function gye(e,t,n){return fM(),n.e.a+n.f.a+e*t}function _ye(e,t,n){return fM(),n.e.b+n.f.b+e*t}function vye(e,t,n){return kD(e.b,P(n.b,17),t)}function yye(e,t,n){return kD(e.b,P(n.b,17),t)}function bye(e,t){return M(e,new k(t.a,t.b))}function xye(e,t){$Ie(e,t==null?null:(yD(t),t))}function Sye(e,t){tLe(e,t==null?null:(yD(t),t))}function Cye(e,t){tLe(e,t==null?null:(yD(t),t))}function IT(e,t){var n;return++e.j,n=e.Aj(t),n}function LT(e,t){var n=sSe(e,t);return n.i=2,n}function RT(e,t,n){return e.a=-1,LC(e,t.g,n),e}function zT(e,t){mb.call(this,e,t),this.a=this}function wye(){Uy.call(this,`COUNT_CHILDREN`,0)}function Tye(e){this.c=e,this.b=this.c.d.vc().Jc()}function Eye(e){return e.e.Pd().gc()*e.c.Pd().gc()}function Dye(e,t,n){return new $me(VSe(e).Ze(),n,t)}function BT(e,t,n,r,i,a){return YXe(e,t,n,r,i,0,a)}function Oye(){Oye=C,byt=V(fX,X,190,256,0,1)}function kye(){kye=C,wyt=V(mX,X,191,256,0,1)}function Aye(){Aye=C,hyt=V(sX,X,221,256,0,1)}function jye(){jye=C,_yt=V(cX,X,180,128,0,1)}function VT(){VT=C,YY=new yk((QD(),QD(),TX))}function Mye(){Mye=C,eyt=new d_((QD(),QD(),DX))}function HT(e){for(nD(e);e.Ob();)e.Pb(),e.Qb()}function Nye(e){e.a.jd(),P(e.a.kd(),18).gc(),vm()}function UT(e){this.a=new _g(e.gc()),vN(this,e)}function Pye(e){nu.call(this,new aA),vN(this,e)}function Fye(e){this.c=e,this.a=new hg(this.c.a)}function Iye(e){if(e.e.c!=e.b)throw E(new vf)}function Lye(e){if(e.c.e!=e.a)throw E(new vf)}function Rye(e){return e.q?e.q:(QD(),QD(),EX)}function zye(e){return e.c-P(qT(e.a,e.b),295).b}function Bye(e,t){return yD(e),ON(e,(yD(t),t))}function Vye(e,t){return yD(t),ON(t,(yD(e),e))}function Hye(e,t,n){return Qx(t.d[e.g],n.d[e.g])}function Uye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function Wye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function Gye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function Kye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function qye(e,t){return e?0:r.Math.max(0,t-1)}function WT(e,t,n){return r.Math.min(n/e,1/t)}function GT(e){return e.c?e.c.f:e.e.b}function KT(e){return e.c?e.c.g:e.e.a}function qT(e,t){return dk(t,e.c.length),e.c[t]}function Jye(e,t){return dk(t,e.a.length),e.a[t]}function Yye(e,t){return e.a+=$I(t,0,t.length),e}function Xye(e,t){return e.a??Y7e(e),e.a[t]}function Zye(e){var t=tZe(e);return t?Zye(t):e}function Qye(e,t){var n;for(n=0;n<t;++n)e[n]=-1}function JT(e,t){Sg(),YMe.call(this,e),this.a=t}function YT(e,t){Gx(),Wd.call(this,t),this.a=e}function XT(e,t){bH(),Yd.call(this,e),this.a=t}function $ye(e){this.b=new gg,this.a=e,this.c=-1}function ebe(e){this.a=e,this.c=new Qd,Yze(this)}function ZT(e){aM.call(this,e.gc()),YE(this,e)}function QT(e,t,n,r){Eve(this,e,t,n,r)}function $T(e,t,n){this.a=e,MS.call(this,t,n,2)}function tbe(e,t){return e==null?t==null:$w(e,t)}function nbe(e,t){return e==null?t==null:rL(e,t)}function eE(e,t){return bH(),++W9,new Axe(e,t)}function tE(e){return qb(e)?e|0:zh(e)}function nE(e,t){var n=vI(e);return oBe(n,t),n}function rbe(e,t){return!e&&(e=[]),e[e.length]=t,e}function rE(e,t,n){QO(t,e.c.length),K_(e.c,t,n)}function ibe(e,t,n){aVe(0,t,e.length),uj(e,0,t,n)}function abe(e,t,n){var r;for(r=0;r<t;++r)e[r]=n}function obe(e,t){return j(t,23)&&hC(e,P(t,23))}function sbe(e,t){return j(t,23)&&NFe(e,P(t,23))}function iE(e,t){return gVe(e,t,JAe(e,e.b.Ae(t)))}function cbe(e,t){return e.a.get(t)!==void 0}function lbe(e){return Array.isArray(e)&&e.Rm===ne}function ube(e){return tB(e,26)*yW+tB(e,27)*bW}function dbe(){dbe=C,Ozt=new Bx((vH(),n8),0)}function fbe(){fbe=C,Yvt=new dye(V(RY,PH,1,0,5,1))}function pbe(){this.b=new lt,this.c=new Uwe(this)}function mbe(){this.d=new aee,this.e=new Hwe(this)}function hbe(e,t){this.b=new gg,this.a=e,this.c=t}function gbe(){vEe(),this.g=new gg,this.f=new gg}function _be(){$O(),this.k=new Qd,this.d=new jf}function vbe(e,t){ybe(e,tT(new k(t.a,t.b),e.c))}function ybe(e,t){eT(e.c,t),e.b.c+=t.a,e.b.d+=t.b}function aE(e){e.b?aE(e.b):e.d.dc()&&e.f.c.Ac(e.e)}function bbe(e,t,n){return-Qx(e.f[t.p],e.f[n.p])}function xbe(e,t,n){return RE(e,new C_(t.a,n.a))}function Sbe(e,t,n){b3e(n,e,1),M(t,new X_(n,e))}function Cbe(e,t,n){oR(n,e,1),M(t,new Due(n,e))}function wbe(e,t,n,r){Gx(),iOe.call(this,e,t,n,r)}function Tbe(e,t,n,r){Gx(),iOe.call(this,e,t,n,r)}function Ebe(e,t,n){this.a=e,NS.call(this,t,n,22)}function Dbe(e,t,n){this.a=e,NS.call(this,t,n,14)}function oE(e,t,n){return e.a=-1,LC(e,t.g+1,n),e}function Obe(e,t,n){return n=lV(e,P(t,52),7,n),n}function kbe(e,t,n){return n=lV(e,P(t,52),3,n),n}function sE(e,t,n){var r;e&&(r=e.i,r.c=t,r.b=n)}function cE(e,t,n){var r;e&&(r=e.i,r.d=t,r.a=n)}function Abe(e,t){(t.Bb&Rq)!=0&&!e.a.o&&(e.a.o=t)}function jbe(e){return e!=null&&vxe(e)&&e.Rm!==ne}function Mbe(e){return!Array.isArray(e)&&e.Rm===ne}function Nbe(e){return j(e,16)?P(e,16).cd():e.Jc()}function Pbe(e){return e.Oc(V(RY,PH,1,e.gc(),5,1))}function lE(e,t){return EGe(Oj(e,t))?t.wi():null}function Fbe(e){return e.d?e.d:e.d=e.Rd()}function uE(e){return e.c?e.c:e.c=e.Qd()}function dE(e){return e.i||=e.bc()}function Ibe(e){return e.f||=e.Cc()}function Lbe(e){return bH(),++W9,new wO(10,e,0)}function fE(e){r_(),this.a=0,this.b=e-1,this.c=1}function Rbe(e){iS(this),this.g=e,nO(this),this.he()}function zbe(e,t,n,r){this.a=e,BA.call(this,e,t,n,r)}function pE(e){this.a=(fbe(),Yvt),this.d=P(nD(e),50)}function mE(e){if(e.e.j!=e.d)throw E(new vf)}function hE(e){return qb(e)?``+e:E7e(e)}function Bbe(e,t){return Hw((yD(e),e),(yD(t),t))}function Vbe(e,t){return BF((yD(e),e),(yD(t),t))}function gE(e,t){return LN(j$e(qb(e)?KN(e):e,t))}function _E(e,t){return LN($4e(qb(e)?KN(e):e,t))}function vE(e,t){return LN(f1e(qb(e)?KN(e):e,t))}function Hbe(e,t){return nD(t),e.a.Hd(t)&&!e.b.Hd(t)}function Ube(e,t){return eS(e.l&t.l,e.m&t.m,e.h&t.h)}function Wbe(e,t){return eS(e.l|t.l,e.m|t.m,e.h|t.h)}function Gbe(e,t){return eS(e.l^t.l,e.m^t.m,e.h^t.h)}function yE(e,t){return kF(e,(yD(t),new $ie(t)))}function bE(e,t){return kF(e,(yD(t),new cu(t)))}function Kbe(e){return SN(),P(e,12).g.c.length!=0}function qbe(e){return SN(),P(e,12).e.c.length!=0}function Jbe(e,t){return bN(),BF(t.a.o.a,e.a.o.a)}function Ybe(e){e.d||(e.d=e.b.Jc(),e.c=e.b.gc())}function Xbe(e,t,n){e.a.Mb(n)&&(e.b=!0,t.Ad(n))}function xE(e,t){if(e<0||e>=t)throw E(new Cse)}function SE(e){e.f=new dx(e),e.i=new Tde(e),++e.g}function CE(e){this.b=new VA(11),this.a=($D(),e)}function Zbe(e){this.b=null,this.a=($D(),e||zyt)}function Qbe(e,t){this.e=e,this.d=t&64?t|YH:t}function $be(e,t){this.c=0,this.d=e,this.b=t|64|YH}function exe(e){this.a=QKe(e.a),this.b=new sT(e.b)}function wE(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function txe(e){for(var t=e;t.f;)t=t.f;return t}function nxe(e){return e.e?Yje(e.e):null}function TE(e){return Sz(),!e.Gc(c5)&&!e.Gc(u5)}function rxe(e,t,n){return AB(),bRe(e,t)&&bRe(e,n)}function ixe(e,t,n){return Zct(e,P(t,12),P(n,12))}function axe(e,t){return t.Sh()?bF(e.b,P(t,52)):t}function EE(e){return new k(e.c+e.b/2,e.d+e.a/2)}function oxe(e,t,n){t.of(n,D(N(sD(e.b,n)))*e.a)}function sxe(e,t){t.Tg(`General 'Rotator`,1),Iot(e)}function DE(e,t,n,r,i){aj.call(this,e,t,n,r,i,-1)}function OE(e,t,n,r,i){oj.call(this,e,t,n,r,i,-1)}function F(e,t,n,r){MS.call(this,e,t,n),this.b=r}function kE(e,t,n,r){ET.call(this,e,t,n),this.b=r}function cxe(e){eb.call(this,e,!1),this.a=!1}function lxe(){Uy.call(this,`LOOKAHEAD_LAYOUT`,1)}function uxe(){Uy.call(this,`LAYOUT_NEXT_LEVEL`,3)}function dxe(e){this.b=e,bC.call(this,e),Pfe(this)}function fxe(e){this.b=e,SC.call(this,e),Ffe(this)}function pxe(e,t){this.b=e,fie.call(this,e.b),this.a=t}function AE(e,t,n){this.a=e,Yw.call(this,t,n,5,6)}function mxe(e,t,n,r){this.b=e,MS.call(this,t,n,r)}function jE(e,t,n){qB(),this.e=e,this.d=t,this.a=n}function ME(e,t){for(yD(t);e.Ob();)t.Ad(e.Pb())}function NE(e,t){return bH(),++W9,new kSe(e,t,0)}function hxe(e,t){return bH(),++W9,new kSe(6,e,t)}function gxe(e,t){return $w(e.substr(0,t.length),t)}function PE(e,t){return bb(t)?cO(e,t):!!iE(e.f,t)}function _xe(e){return eS(~e.l&JU,~e.m&JU,~e.h&YU)}function vxe(e){return typeof e===TH||typeof e===OH}function FE(e){return new pE(new iC(e.a.length,e.a))}function yxe(e){return new JT(null,Pxe(e,e.length))}function bxe(e){if(!e)throw E(new Cf);return e.d}function IE(e){var t=OP(e);return UC(t!=null),t}function xxe(e){var t=BHe(e);return UC(t!=null),t}function LE(e,t){var n=e.a.gc();return Pje(t,n),n-t}function RE(e,t){return e.a.yc(t,e)==null}function zE(e,t){return e.a.yc(t,(XS(),iX))==null}function Sxe(e,t){return e>0?r.Math.log(e/t):-100}function Cxe(e,t){return t?vN(e,t):!1}function BE(e,t,n){return rN(e.a,t),Qve(e.b,t.g,n)}function wxe(e,t,n){xE(n,e.a.c.length),mA(e.a,n,t)}function I(e,t,n,r){aVe(t,n,e.length),Txe(e,t,n,r)}function Txe(e,t,n,r){var i;for(i=t;i<n;++i)e[i]=r}function Exe(e,t){var n;for(n=0;n<t;++n)e[n]=!1}function VE(e){WC(e.b!=-1),kA(e.c,e.a=e.b),e.b=-1}function HE(e,t,n){return iVe(e,t.g,n),rN(e.c,t),e}function Dxe(e,t,n){Vot(e.a,e.b,e.d,e.c,P(t,170),n)}function UE(e,t){ofe(e,j(t,163)?t:P(t,1998).Pl())}function Oxe(e,t){if(e==null)throw E(new tm(t))}function kxe(e,t,n){this.c=e,this.a=t,QD(),this.b=n}function WE(e,t){this.d=e,zS.call(this,e),this.e=t}function Axe(e,t){Yd.call(this,1),this.a=e,this.b=t}function jxe(e,t){return _F(e,t)<0?-1:+(_F(e,t)>0)}function GE(e){return e.e==0?e:new jE(-e.e,e.d,e.a)}function Mxe(e){return e==rW?bY:e==iW?`-INF`:``+e}function Nxe(e){return e==rW?bY:e==iW?`-INF`:``+e}function Pxe(e,t){return FFe(t,e.length),new fye(e,t)}function Fxe(e,t,n,r,i){for(;t<n;)r[i++]=jD(e,t++)}function Ixe(e,t,n){var r;for(r=0;r<t;++r)iD(e,r,n)}function Lxe(e,t,n){var r=Bj(e,t);return eA(e,t,n),r}function Rxe(e,t){return e.c?Rxe(e.c,t):M(e.b,t),e}function zxe(e){return!e.j&&jl(e,iet(e.g,e.b)),e.j}function Bxe(e){return $V(e,(KF(),y8)),e.d=!0,e}function KE(e,t){oA(e.d,t,e.b.b,e.b),++e.a,e.c=null}function Vxe(e,t){return BF(e.c.c+e.c.b,t.c.c+t.c.b)}function Hxe(e){return r.Math.abs(e.d.e-e.e.e)-e.a}function Uxe(e,t){return BF(e.e.a+e.f.a,t.e.a+t.f.a)}function Wxe(e,t){return BF(e.e.b+e.f.b,t.e.b+t.f.b)}function Gxe(e,t){this.d=JHe(e),this.c=t,this.a=.5*t}function qE(e){this.d=(yD(e),e),this.a=0,this.c=$H}function Kxe(e){Vwe.call(this),this.a=e,M(e.a,this)}function qxe(e){e?ZZe(e,(vg(),Eyt),``):Pwe((vg(),e))}function Jxe(e,t){cD(e,new rD(t.f==null?``+t.g:t.f))}function Yxe(e,t){cD(e,new rD(t.f==null?``+t.g:t.f))}function JE(e,t){wg(RD(e.Mc(),new vte),new Wu(t))}function YE(e,t){return e.Qi()&&(t=ZTe(e,t)),e.Di(t)}function Xxe(e,t){return t=e.Wk(null,t),vQe(e,null,t)}function Zxe(e,t){++e.j,DR(e,e.i,t),P2e(e,P(t,344))}function Qxe(e,t,n){return P(e.c.fd(t,P(n,136)),45)}function XE(e,t,n,r,i){AR(e,P(wA(t.k,n),16),n,r,i)}function ZE(e){e.s=NaN,e.c=NaN,j4e(e,e.e),j4e(e,e.j)}function $xe(e){e.a=null,e.e=null,SE(e.b),e.d=0,++e.c}function QE(e){return(e.i??vV(e),e.i).length}function $E(){$E=C,K7=N2e(),(SH(),J7)&&JYe()}function eSe(){eSe=C,syt=new al(!1),cyt=new al(!0)}function eD(e){var t;return t=e.g,t||(e.g=new Lc(e))}function tD(e){var t;return t=e.k,t||(e.k=new Rc(e))}function tSe(e){var t;return t=e.k,t||(e.k=new Rc(e))}function nSe(e){var t;return t=e.i,t||(e.i=new Vc(e))}function rSe(e){return e.j||=new bie(e)}function iSe(e){return e.f||=new VS(e)}function aSe(e){return e.d||=new Qc(e)}function oSe(e,t){var n=e.a.gc();return kk(t,n),n-1-t}function L(e,t,n){var r=sSe(e,t);return bIe(n,r),r}function sSe(e,t){var n=new tBe;return n.j=e,n.d=t,n}function nD(e){if(e==null)throw E(new xf);return e}function rD(e){if(e==null)throw E(new xf);this.a=e}function cSe(e){use(),this.b=new Zd,this.a=e,hat(this,e)}function lSe(e){this.b=e,this.a=P(vD(this.b.a.e),227)}function uSe(){aA.call(this),this.a=!0,this.b=!0}function dSe(e,t){return fk(t,e.length+1),e.substr(t)}function fSe(e,t){return kk(t,e.c.b.c.gc()),new lle(e,t)}function pSe(e,t,n){return bH(),++W9,new DDe(e,t,n)}function mSe(e){return j(e,606)?e:new ITe(e)}function iD(e,t,n){return cpe(n==null||htt(e,n)),e[t]=n}function aD(e,t){return e.a+=String.fromCharCode(t),e}function oD(e,t){return e.a+=String.fromCharCode(t),e}function hSe(e,t){return bN(),P(AD(e,t.d),16).Ec(t)}function sD(e,t){return bb(t)?DO(e,t):_b(iE(e.f,t))}function gSe(e,t){return P(uE(e.a).Kd().Xb(t),45).jd()}function _Se(e,t){return P(K(t,(hH(),h2)),15).a<e}function vSe(e,t,n,r){return n==0||(n-r)/n<e.e||t>=e.g}function ySe(e,t,n){return m9e(e,TLe(e,t,n))}function bSe(e,t){console[e].call(console,t)}function cD(e,t){var n=e.a.length;Bj(e,n),eA(e,n,t)}function xSe(e,t){var n;++e.j,n=e.Cj(),e.pj(e.Xi(n,t))}function SSe(e,t){for(yD(t);e.c<e.d;)e.Qe(t,e.c++)}function CSe(e,t,n){P(t.b,68),oM(t.a,new ove(e,n,t))}function wSe(e){for(;e.a.b!=0;)pot(e,P(DTe(e.a),9))}function TSe(e){this.d=e,this.c=e.a.d.a,this.b=e.a.e.g}function ESe(e){this.c=e,this.a=new gg,this.b=new gg}function lD(e){this.c=new hh,this.a=new Zd,this.b=e}function DSe(e){this.b=new Zd,this.a=new Zd,this.c=e}function OSe(e,t,n){Wd.call(this,t),this.a=e,this.b=n}function kSe(e,t,n){Yd.call(this,e),this.a=t,this.b=n}function ASe(e,t,n){this.a=e,Ud.call(this,t),this.b=n}function jSe(e,t,n){this.a=e,qOe.call(this,8,t,null,n)}function MSe(e){this.a=(yD(WJ),WJ),this.b=e,new lp}function NSe(e){this.c=e,this.b=this.c.a,this.a=this.c.e}function uD(e){WC(e.c!=-1),e.d.ed(e.c),e.b=e.c,e.c=-1}function dD(e){return r.Math.sqrt(e.a*e.a+e.b*e.b)}function PSe(e){return j(e,103)&&(P(e,19).Bb&Rq)!=0}function FSe(e){return vD(e),j(e,472)?P(e,472):OI(e)}function ISe(e){return e?e.dc():!e.Jc().Ob()}function LSe(e){return z9?cO(z9,e):!1}function fD(e){e.c?fD(e.c):(hI(e),e.d=!0)}function pD(e){e.c?e.c.Ye():(e.d=!0,w8e(e))}function RSe(e){TCe(e.a),e.b=V(RY,PH,1,e.b.length,5,1)}function mD(e,t){return qJe(e.c,e.f,t,e.b,e.a,e.e,e.d)}function hD(e,t){return xE(t,e.a.c.length),qT(e.a,t)}function gD(e,t){return A(e)===A(t)||e!=null&&OF(e,t)}function zSe(e,t){return Qx(t.j.c.length,e.j.c.length)}function BSe(e){return e.c.i.c==e.d.i.c}function _D(e){return!e.a&&e.c?e.c.b:e.a}function VSe(e){return 0>=e?new Ile:iLe(e-1)}function vD(e){if(e==null)throw E(new xf);return e}function yD(e){if(e==null)throw E(new xf);return e}function HSe(e){return!e.a&&(e.a=new MS(Q5,e,4)),e.a}function bD(e){return!e.d&&(e.d=new MS(z7,e,1)),e.d}function USe(e){if(e.p!=3)throw E(new bf);return e.e}function WSe(e){if(e.p!=4)throw E(new bf);return e.e}function GSe(e){if(e.p!=6)throw E(new bf);return e.f}function KSe(e){if(e.p!=3)throw E(new bf);return e.j}function qSe(e){if(e.p!=4)throw E(new bf);return e.j}function JSe(e){if(e.p!=6)throw E(new bf);return e.k}function xD(){zse.call(this),Tf(this.j.c,0),this.a=-1}function YSe(){ng.call(this,`DELAUNAY_TRIANGULATION`,0)}function XSe(){return Wp(),U(O(Xvt,1),Z,537,0,[JY])}function ZSe(e,t,n){return xP(),n.Kg(e,P(t.jd(),147))}function QSe(e,t){XA((!e.a&&(e.a=new Nw(e,e)),e.a),t)}function $Se(e,t){e.c<0||e.b.b<e.c?Ib(e.b,t):e.a.vf(t)}function eCe(e,t){var n=e.Fh(t);n>=0?e.hi(n):$0e(e,t)}function SD(e,t){var n=sSe(``,e);return n.n=t,n.i=1,n}function CD(e){return e.c==-2&&Bie(e,zQe(e.g,e.b)),e.c}function tCe(e){return!e.b&&(e.b=new Vd(new dp)),e.b}function nCe(e,t){return OT(),new iqe(new zfe(e),new Rfe(t))}function rCe(e){return KM(e,mU),Jj(lI(lI(5,e),e/10|0))}function iCe(){iCe=C,$vt=new u_(U(O(UY,1),rU,45,0,[]))}function aCe(){XQe.call(this,mY,(xh(),lVt)),Wit(this)}function oCe(){XQe.call(this,QJ,(bh(),SBt)),Frt(this)}function sCe(e,t){mfe.call(this,aLe(nD(e),nD(t))),this.a=t}function cCe(e,t,n,r){$h.call(this,e,t),this.d=n,this.a=r}function wD(e,t,n,r){$h.call(this,e,n),this.a=t,this.f=r}function lCe(e,t){this.b=e,WE.call(this,e,t),Pfe(this)}function uCe(e,t){this.b=e,Dhe.call(this,e,t),Ffe(this)}function TD(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function dCe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function ED(e){return!e.a&&(e.a=new Am(e.c.vc())),e.a}function fCe(e){return!e.b&&(e.b=new km(e.c.ec())),e.b}function pCe(e){return!e.d&&(e.d=new Yl(e.c.Bc())),e.d}function DD(e,t){for(;t-- >0;)e=e<<1|e<0;return e}function mCe(e,t){var n=new lD(e);return ff(t.c,n),n}function hCe(e,t){ybe(P(t.b,68),e),oM(t.a,new xu(e))}function gCe(e,t){e.u.Gc((Sz(),c5))&&b2e(e,t),BMe(e,t)}function OD(e,t){return A(e)===A(t)||e!=null&&OF(e,t)}function kD(e,t,n){return bb(t)?KO(e,t,n):gz(e.f,t,n)}function _Ce(e){return QD(),e?e.Me():($D(),$D(),Byt)}function vCe(){return Vg(),U(O(uFt,1),Z,477,0,[lFt])}function yCe(){return Hg(),U(O(pFt,1),Z,546,0,[fFt])}function bCe(){return Ug(),U(O(iIt,1),Z,527,0,[u6])}function AD(e,t){return obe(e.a,t)?e.b[P(t,23).g]:null}function xCe(e){return String.fromCharCode.apply(null,e)}function jD(e,t){return fk(t,e.length),e.charCodeAt(t)}function MD(e){return e.j.c.length=0,TCe(e.c),ehe(e.a),e}function ND(e){return e.e==gY&&Uie(e,VGe(e.g,e.b)),e.e}function PD(e){return e.f==gY&&Gie(e,jYe(e.g,e.b)),e.f}function SCe(e){return!e.b&&(e.b=new Zw(r7,e,4,7)),e.b}function CCe(e){return!e.c&&(e.c=new Zw(r7,e,5,8)),e.c}function wCe(e){return!e.c&&(e.c=new F(m7,e,9,9)),e.c}function FD(e){return!e.n&&(e.n=new F(f7,e,1,7)),e.n}function ID(e){var t=e.b;return!t&&(e.b=t=new zc(e)),t}function TCe(e){var t;for(t=e.Jc();t.Ob();)t.Pb(),t.Qb()}function ECe(e,t,n){var r=P(e.d.Kb(n),162);r&&r.Nb(t)}function DCe(e,t){return new kwe(P(nD(e),51),P(nD(t),51))}function LD(e,t){return hI(e),new JT(e,new bNe(t,e.a))}function RD(e,t){return hI(e),new JT(e,new Gje(t,e.a))}function zD(e,t){return hI(e),new Ow(e,new Uje(t,e.a))}function BD(e,t){return hI(e),new kw(e,new Wje(t,e.a))}function OCe(e,t){lUe(e,D(NM(t,`x`)),D(NM(t,`y`)))}function kCe(e,t){lUe(e,D(NM(t,`x`)),D(NM(t,`y`)))}function ACe(e,t){return Mg(),BF((yD(e),e),(yD(t),t))}function jCe(e,t){return BF(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function MCe(e,t){return BF(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function NCe(e){return e!=null&&ug(A7,e.toLowerCase())}function PCe(e){fT();var t=P(e.g,9);t.n.a=e.d.c+t.d.b}function VD(e){return cLe(e)||null}function HD(e,t,n,r){return TRe(e,t,n,!1),FF(e,r),e}function FCe(e,t,n){Ert(e.a,n),yze(n),r3e(e.b,n),ait(t,n)}function UD(e,t,n,r){ng.call(this,e,t),this.a=n,this.b=r}function WD(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function ICe(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function LCe(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function GD(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function RCe(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function KD(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function qD(e,t,n){this.a=Elt,this.d=e,this.b=t,this.c=n}function zCe(e,t){this.b=e,this.c=t,this.a=new hg(this.b)}function BCe(e,t){this.d=(yD(e),e),this.a=16449,this.c=t}function VCe(e,t,n,r){jBe.call(this,e,n,r,!1),this.f=t}function HCe(e,t,n){var r=bst(e);return t.qi(n,r)}function JD(e){var t,n=(t=new ef,t);return mM(n,e),n}function UCe(e){var t,n=(t=new ef,t);return l$e(n,e),n}function WCe(e){return!e.b&&(e.b=new F(i7,e,12,3)),e.b}function GCe(e){this.a=new Zd,this.e=V(q9,X,54,e,0,2)}function YD(e){this.f=e,this.c=this.f.e,e.f>0&&_Xe(this)}function KCe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function qCe(e,t,n,r){this.a=e,this.b=t,this.d=n,this.c=r}function JCe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function YCe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function XD(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function XCe(e,t,n,r){Gx(),Hje.call(this,t,n,r),this.a=e}function ZCe(e,t,n,r){Gx(),Hje.call(this,t,n,r),this.a=e}function QCe(e,t){this.a=e,Hpe.call(this,e,P(e.d,16).dd(t))}function $Ce(e,t){return BF(KT(e)*GT(e),KT(t)*GT(t))}function ewe(e,t){return BF(KT(e)*GT(e),KT(t)*GT(t))}function ZD(e){var t;return t=e.f,t||(e.f=new Jh(e,e.c))}function QD(){QD=C,TX=new ae,EX=new se,DX=new ce}function $D(){$D=C,zyt=new ue,kX=new ue,Byt=new de}function eO(e){if(kI(e.d),e.d.d!=e.c)throw E(new vf)}function tO(e){e.a.a=e.c,e.c.b=e.a,e.a.b=e.c.a=null,e.b=0}function twe(e){return UC(e.b<e.d.gc()),e.d.Xb(e.c=e.b++)}function nwe(e){return e.length>0?TA(e):new Zd}function nO(e){return e.n&&(e.e!==Clt&&e.he(),e.j=null),e}function rwe(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function iwe(e,t,n){return M(e.a,(kqe(t,n),new $h(t,n))),e}function awe(e,t){return P(K(e,(Y(),w1)),16).Ec(t),t}function owe(e,t){return kz(e,P(K(t,(hH(),h2)),15),t)}function swe(e){return Oz(e)&&sm(hw(J(e,(hH(),q0))))}function cwe(e,t,n){return Rg(),xUe(P(sD(e.e,t),516),n)}function lwe(e,t,n){e.i=0,e.e=0,t!=n&&xBe(e,t,n)}function uwe(e,t,n){e.i=0,e.e=0,t!=n&&SBe(e,t,n)}function dwe(e,t,n,r){this.b=e,this.c=r,Fb.call(this,t,n)}function fwe(e,t){this.g=e,this.d=U(O(GZ,1),qG,9,0,[t])}function pwe(e,t){e.d&&!e.d.a&&(tf(e.d,t),pwe(e.d,t))}function mwe(e,t){e.e&&!e.e.a&&(tf(e.e,t),mwe(e.e,t))}function hwe(e,t){return wF(e.j,t.s,t.c)+wF(t.e,e.s,e.c)}function gwe(e,t){return-BF(KT(e)*GT(e),KT(t)*GT(t))}function _we(e){return P(e.jd(),147).Og()+`:`+OI(e.kd())}function vwe(){qR(this,new kc),this.wb=($E(),K7),bh()}function ywe(e){this.b=new Rte,this.a=e,r.Math.random()}function bwe(e){this.b=new Zd,uP(this.b,this.b),this.a=e}function xwe(e,t){new gg,this.a=new np,this.b=e,this.c=t}function Swe(){Ap.call(this,`There is no more element.`)}function Cwe(e){xm(),r.setTimeout(function(){throw e},0)}function wwe(e){e.Tg(`No crossing minimization`,1),e.Ug()}function Twe(e,t){return VP(e),VP(t),Rp(P(e,23),P(t,23))}function rO(e,t,n){Xj(e,t,new ol(Che(n)))}function iO(e,t,n,r,i,a){oj.call(this,e,t,n,r,i,a?-2:-1)}function Ewe(e,t,n,r){ab.call(this,t,n),this.b=e,this.a=r}function Dwe(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function aO(e){return!e.a&&(e.a=new F(p7,e,10,11)),e.a}function oO(e){return!e.q&&(e.q=new F(B7,e,11,10)),e.q}function R(e){return!e.s&&(e.s=new F(N7,e,21,17)),e.s}function Owe(e){return NT(e==null||vxe(e)&&e.Rm!==ne),e}function sO(e,t){if(e==null)throw E(new tm(t));return e}function kwe(e,t){Kse.call(this,new Zbe(e)),this.a=e,this.b=t}function cO(e,t){return t==null?!!iE(e.f,null):cbe(e.i,t)}function lO(e){return j(e,18)?new UT(P(e,18)):vve(e.Jc())}function uO(e){return QD(),j(e,59)?new jm(e):new QS(e)}function Awe(e){return nD(e),zqe(new pE(KS(e.a.Jc(),new f)))}function jwe(e){return new jfe(e,e.e.Pd().gc()*e.c.Pd().gc())}function Mwe(e){return new Mfe(e,e.e.Pd().gc()*e.c.Pd().gc())}function Nwe(e){return e&&e.hashCode?e.hashCode():TC(e)}function Pwe(e){!e||yO(e,e.ge())}function Fwe(e,t){var n=CS(e.a,t);return n&&(t.d=null),n}function Iwe(e,t,n){return e.f?e.f.cf(t,n):!1}function dO(e,t,n,r){iD(e.c[t.g],n.g,r),iD(e.c[n.g],t.g,r)}function Lwe(e,t,n,r){iD(e.c[t.g],t.g,n),iD(e.b[t.g],t.g,r)}function Rwe(e,t,n){return D(N(n.a))<=e&&D(N(n.b))>=t}function zwe(){this.d=new gg,this.b=new Qd,this.c=new Zd}function Bwe(){this.b=new jf,this.d=new gg,this.e=new Zf}function Vwe(){this.c=new hh,this.d=new hh,this.e=new hh}function fO(){this.a=new np,this.b=(KM(3,fU),new VA(3))}function Hwe(e){this.c=e,this.b=new Nh(P(nD(new iee),51))}function Uwe(e){this.c=e,this.b=new Nh(P(nD(new dee),51))}function Wwe(e){this.b=e,this.a=new Nh(P(nD(new Xe),51))}function pO(e,t){this.e=e,this.a=RY,this.b=h9e(t),this.c=t}function mO(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function Gwe(e,t,n,r,i,a){this.a=e,JM.call(this,t,n,r,i,a)}function Kwe(e,t,n,r,i,a){this.a=e,JM.call(this,t,n,r,i,a)}function hO(e,t,n,r,i,a,o){return new pAe(e.e,t,n,r,i,a,o)}function qwe(e,t,n){return n>=0&&$w(e.substr(n,t.length),t)}function Jwe(e,t){return j(t,147)&&$w(e.b,P(t,147).Og())}function Ywe(e,t){return e.a?t.Dh().Jc():P(t.Dh(),72).Gi()}function Xwe(e,t){var n=e.b.Oc(t);return lAe(n,e.b.gc()),n}function gO(e,t){if(e==null)throw E(new tm(t));return e}function _O(e){return e.u||=(bA(e),new ime(e,e)),e.u}function vO(e){return P(BN(e,16),29)||e.fi()}function yO(e,t){var n=kh(e.Pm);return t==null?n:n+`: `+t}function bO(e,t,n){return YA(t,n,e.length),e.substr(t,n-t)}function Zwe(e,t){qw.call(this),qFe(this),this.a=e,this.c=t}function Qwe(){Uy.call(this,`FIXED_INTEGER_RATIO_BOXES`,2)}function $we(){return GA(),U(O(ewt,1),Z,422,0,[$Ct,l$])}function eTe(){return qj(),U(O(pwt,1),Z,419,0,[S$,fwt])}function tTe(){return _j(),U(O(bwt,1),Z,476,0,[ywt,M$])}function nTe(){return Fk(),U(O(Hwt,1),Z,420,0,[r1,Vwt])}function rTe(){return uA(),U(O(aTt,1),Z,423,0,[c0,s0])}function iTe(){return Tj(),U(O(zkt,1),Z,421,0,[b4,x4])}function aTe(){return lA(),U(O(AAt,1),Z,518,0,[V4,B4])}function oTe(){return PO(),U(O(VAt,1),Z,508,0,[K4,q4])}function sTe(){return NO(),U(O(zAt,1),Z,509,0,[G4,W4])}function cTe(){return UA(),U(O(rjt,1),Z,515,0,[Z4,X4])}function lTe(){return FO(),U(O(ujt,1),Z,454,0,[Q4,$4])}function uTe(){return Pk(),U(O(DMt,1),Z,425,0,[EMt,TMt])}function dTe(){return sN(),U(O(NMt,1),Z,487,0,[P3,F3])}function fTe(){return gj(),U(O(WMt,1),Z,426,0,[HMt,UMt])}function pTe(){return Kj(),U(O(gxt,1),Z,424,0,[uZ,dZ])}function mTe(){return oN(),U(O(BSt,1),Z,502,0,[nQ,tQ])}function hTe(){return _A(),U(O(KPt,1),Z,478,0,[WPt,GPt])}function gTe(){return WA(),U(O(gFt,1),Z,428,0,[hFt,c6])}function _Te(){return iP(),U(O(sIt,1),Z,427,0,[d6,oIt])}function xO(e,t,n,r){return n>=0?e.Rh(t,n,r):e.zh(null,n,r)}function SO(e){return e.b.b==0?e.a.uf():mve(e.b)}function vTe(e){if(e.p!=5)throw E(new bf);return tE(e.f)}function yTe(e){if(e.p!=5)throw E(new bf);return tE(e.k)}function bTe(e){return A(e.a)===A((JLe(),PBt))&&Rit(e),e.a}function xTe(e,t){Sl(this,new k(e.a,e.b)),Cl(this,yT(t))}function CO(){qse.call(this,new _g(RN(12))),WS(!0),this.a=2}function wO(e,t,n){bH(),Yd.call(this,e),this.b=t,this.a=n}function STe(e,t,n){Gx(),Wd.call(this,t),this.a=e,this.b=n}function CTe(e,t){return ZY[e.charCodeAt(0)]??e}function TO(e,t){return sO(e,`set1`),sO(t,`set2`),new og(e,t)}function EO(e,t){return aAe(t),xIe(e,V(q9,RU,30,t,15,1),t)}function wTe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=WT(e.c,e.b,e.a))}function TTe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=WT(e.c,e.b,e.a))}function ETe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function DTe(e){return e.b==0?null:(UC(e.b!=0),iM(e,e.a.a))}function DO(e,t){return t==null?_b(iE(e.f,null)):m_(e.i,t)}function OTe(e,t,n,r,i){return new tz(e,(fj(),NX),t,n,r,i)}function OO(e,t,n,r){var i=new Dme;t.a[n.g]=i,BE(e.b,r,i)}function kTe(e,t){var n=t,r=new ve;return Zat(e,n,r),r.d}function ATe(e,t){return eT(aw(GFe(e.f,t)),e.f.d)}function kO(e){var t;zIe(e.a),Ade(e.a),t=new vu(e.a),GUe(t)}function jTe(e,t){H7e(e,!0),oM(e.e.Pf(),new Fhe(e,!0,t))}function MTe(e,t){return fM(),P(K(t,(_V(),j3)),15).a==e}function AO(e){return Math.max(Math.min(e,kH),-2147483648)|0}function NTe(e){qw.call(this),qFe(this),this.a=e,this.c=!0}function PTe(e,t,n){this.a=new Zd,this.e=e,this.f=t,this.c=n}function jO(e,t,n){this.c=new Zd,this.e=e,this.f=t,this.b=n}function FTe(e,t,n){this.i=new Zd,this.b=e,this.g=t,this.a=n}function ITe(e){this.a=P(nD(e),277),this.b=(QD(),new eC(e))}function MO(){MO=C;var e,t=!XWe();e=new b,ayt=t?new y:e}function LTe(){LTe=C,ybt=new Ie,xbt=new mbe,bbt=new Re}function NO(){NO=C,G4=new Vv(VW,0),W4=new Vv(BW,1)}function PO(){PO=C,K4=new Hv(qW,0),q4=new Hv(`UP`,1)}function FO(){FO=C,Q4=new Jv(BW,0),$4=new Jv(VW,1)}function IO(e,t,n){tk(),e&&kD($zt,e,t),e&&kD(C7,e,n)}function RTe(e,t,n){var r=e.Fh(t);r>=0?e.$h(r,n):F6e(e,t,n)}function zTe(e,t){var n;for(nD(t),n=e.a;n;n=n.c)t.Wd(n.g,n.i)}function LO(e,t){var n=e.q.getHours();e.q.setDate(t),SV(e,n)}function BTe(e){var t=new Mh(RN(e.length));return oBe(t,e),t}function VTe(e){function t(){}return t.prototype=e||{},new t}function HTe(e,t){return hze(e,t)?(NIe(e),!0):!1}function RO(e,t){if(t==null)throw E(new xf);return dGe(e,t)}function UTe(e){if(e.ye())return null;var t=e.n;return LY[t]}function zO(e){return e.Db>>16==3?P(e.Cb,26):null}function BO(e){return e.Db>>16==9?P(e.Cb,26):null}function WTe(e){return e.Db>>16==6?P(e.Cb,85):null}function GTe(e,t){var n=e.Fh(t);return n>=0?e.Th(n):M2e(e,t)}function VO(e,t,n){e.b=new fN(uBe(e,t,n).c.length)}function KTe(e){this.a=e,this.b=V(TAt,X,2005,e.e.length,0,2)}function qTe(){this.a=new ax,this.e=new jf,this.g=0,this.i=0}function JTe(e,t){iS(this),this.f=t,this.g=e,nO(this),this.he()}function YTe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function XTe(e){var t=e.d;return t=e._i(e.f),XA(e,t),t.Ob()}function ZTe(e,t){var n=new Pye(t);return BQe(n,e),new sT(n)}function QTe(e){if(e.p!=0)throw E(new bf);return Cb(e.f,0)}function $Te(e){if(e.p!=0)throw E(new bf);return Cb(e.k,0)}function eEe(e){return e.Db>>16==7?P(e.Cb,241):null}function tEe(e){return e.Db>>16==7?P(e.Cb,174):null}function nEe(e){return e.Db>>16==3?P(e.Cb,158):null}function HO(e){return e.Db>>16==6?P(e.Cb,241):null}function UO(e){return e.Db>>16==11?P(e.Cb,26):null}function WO(e){return e.Db>>16==17?P(e.Cb,29):null}function GO(e,t,n,r,i,a){return new Wj(e.e,t,e.Jj(),n,r,i,a)}function KO(e,t,n){return t==null?gz(e.f,null,n):oI(e.i,t,n)}function qO(e,t){return r.Math.abs(e)<r.Math.abs(t)?e:t}function rEe(e,t){return dT(),XS(),P(t.a,15).a<e}function iEe(e,t){return dT(),XS(),P(t.b,15).a<e}function aEe(e){return tF(),XS(),P(e.a,82).d.e!=0}function oEe(e){return!e.a&&(e.a=new F(p7,e,10,11)),e.a.i>0}function sEe(e){var t;return hI(e),t=new jf,LD(e,new du(t))}function cEe(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.te(t))}function lEe(e,t){var n=e.q.getHours();e.q.setMonth(t),SV(e,n)}function JO(e,t){e.c&&bj(e.c.g,e),e.c=t,e.c&&M(e.c.g,e)}function YO(e,t){e.c&&bj(e.c.a,e),e.c=t,e.c&&M(e.c.a,e)}function XO(e,t){e.d&&bj(e.d.e,e),e.d=t,e.d&&M(e.d.e,e)}function ZO(e,t){e.i&&bj(e.i.j,e),e.i=t,e.i&&M(e.i.j,e)}function uEe(e,t,n){this.a=t,this.c=e,this.b=(nD(n),new sT(n))}function dEe(e,t,n){this.a=t,this.c=e,this.b=(nD(n),new sT(n))}function fEe(e,t){this.a=e,this.c=sS(this.a),this.b=new mO(t)}function QO(e,t){if(e<0||e>t)throw E(new Xp(Xlt+e+Zlt+t))}function pEe(){pEe=C,lAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function mEe(){mEe=C,uAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function hEe(){hEe=C,iAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function gEe(){gEe=C,aAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function _Ee(){_Ee=C,oAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function vEe(){vEe=C,sAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function yEe(){yEe=C,MAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function $O(){$O=C,FAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function bEe(){bEe=C,RAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function ek(){ek=C,UAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function xEe(){xEe=C,kMt=oE(new xD,(QL(),n3),(QB(),gjt))}function SEe(){SEe=C,Zvt=cF((Wp(),U(O(Xvt,1),Z,537,0,[JY])))}function tk(){tk=C,$zt=new Qd,C7=new Qd,cb(Uyt,new ko)}function CEe(e,t){t.c!=null&&cD(e,new rD(t.c))}function wEe(e,t){CSe(e,e.b,e.c),P(e.b.b,68),t&&P(t.b,68).b}function nk(e,t){j(e.Cb,184)&&(P(e.Cb,184).tb=null),pN(e,t)}function TEe(e,t){j(e.Cb,88)&&yz(bA(P(e.Cb,88)),4),pN(e,t)}function EEe(e,t){sUe(e,t),j(e.Cb,88)&&yz(bA(P(e.Cb,88)),2)}function DEe(e,t){return BF(P(e.c,65).c.e.b,P(t.c,65).c.e.b)}function OEe(e,t){return BF(P(e.c,65).c.e.a,P(t.c,65).c.e.a)}function rk(e,t){return n_(),kPe(t)?new zT(t,e):new mb(t,e)}function kEe(e,t){e.a&&bj(e.a.k,e),e.a=t,e.a&&M(e.a.k,e)}function AEe(e,t){e.b&&bj(e.b.f,e),e.b=t,e.b&&M(e.b.f,e)}function ik(e,t,n){THe(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function ak(e){this.c=new gg,this.b=e.b,this.d=e.c,this.a=e.a}function jEe(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function ok(e,t,n,r){this.c=e,this.d=r,kEe(this,t),AEe(this,n)}function sk(e,t){this.b=(yD(e),e),this.a=(t&aW)==0?t|64|YH:t}function MEe(e,t){OS(e,tE(hk(_E(t,24),CW)),tE(hk(t,CW)))}function ck(e){return qB(),_F(e,0)>=0?VI(e):GE(VI(yj(e)))}function NEe(){return QP(),U(O(zX,1),Z,130,0,[dbt,RX,fbt])}function PEe(e,t,n){return new tz(e,(fj(),MX),null,!1,t,n)}function FEe(e,t,n){return new tz(e,(fj(),PX),t,n,null,!1)}function IEe(e,t,n){var r;THe(t,n,e.c.length),r=n-t,Ih(e.c,t,r)}function LEe(e,t){var n=P(xF(ZD(e.a),t),18);return n?n.gc():0}function REe(e){var t;return hI(e),t=($D(),$D(),kX),Qj(e,t)}function zEe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function BEe(e){var t,n=(bh(),t=new ef,t);return mM(n,e),n}function VEe(e){var t,n=(bh(),t=new ef,t);return mM(n,e),n}function lk(e){return Rg(),j(e.g,9)?P(e.g,9):null}function HEe(){return cN(),U(O(KQ,1),Z,368,0,[GQ,WQ,UQ])}function UEe(){return VM(),U(O(swt,1),Z,350,0,[owt,p$,f$])}function WEe(){return bP(),U(O(hwt,1),Z,449,0,[w$,C$,T$])}function GEe(){return eP(),U(O(X$,1),Z,302,0,[J$,Y$,q$])}function KEe(){return yP(),U(O($$,1),Z,329,0,[Q$,Lwt,Z$])}function qEe(){return Fj(),U(O(zwt,1),Z,315,0,[t1,n1,e1])}function JEe(){return fF(),U(O(wkt,1),Z,352,0,[e4,Ckt,t4])}function YEe(){return BM(),U(O(Vkt,1),Z,452,0,[w4,S4,C4])}function XEe(){return tP(),U(O(Gkt,1),Z,381,0,[Ukt,T4,Wkt])}function ZEe(){return ZP(),U(O(qkt,1),Z,348,0,[O4,E4,D4])}function QEe(){return pF(),U(O(Xkt,1),Z,349,0,[k4,Ykt,A4])}function $Ee(){return zM(),U(O(eAt,1),Z,351,0,[$kt,j4,Qkt])}function eDe(){return nP(),U(O(nAt,1),Z,382,0,[N4,P4,M4])}function tDe(){return wj(),U(O(rSt,1),Z,384,0,[CZ,SZ,wZ])}function nDe(){return lM(),U(O(KX,1),Z,237,0,[UX,WX,GX])}function rDe(){return pj(),U(O(Ebt,1),Z,461,0,[XX,YX,ZX])}function iDe(){return Pj(),U(O(kbt,1),Z,462,0,[eZ,$X,QX])}function aDe(){return YP(),U(O(Ojt,1),Z,385,0,[Djt,s3,o3])}function oDe(){return XP(),U(O(JMt,1),Z,386,0,[I3,KMt,qMt])}function sDe(){return wI(),U(O(nPt,1),Z,387,0,[ePt,tPt,$Nt])}function cDe(){return $N(),U(O(RNt,1),Z,303,0,[INt,LNt,FNt])}function lDe(){return qI(),U(O(VNt,1),Z,436,0,[B3,V3,BNt])}function uDe(){return VF(),U(O(nFt,1),Z,430,0,[$Pt,tFt,eFt])}function dDe(){return HF(),U(O(sFt,1),Z,435,0,[a6,o6,s6])}function fDe(){return vj(),U(O(ZPt,1),Z,429,0,[JPt,XPt,YPt])}function pDe(){return uM(),U(O(hRt,1),Z,279,0,[E8,D8,O8])}function mDe(){return $P(),U(O(PRt,1),Z,347,0,[P8,N8,F8])}function hDe(){return _M(),U(O(ezt,1),Z,300,0,[F5,QRt,$Rt])}function gDe(){return UF(),U(O(szt,1),Z,281,0,[ozt,Y5,X5])}function uk(e){return jP(U(O(E6,1),X,8,0,[e.i.n,e.n,e.a]))}function _De(e,t,n){var r=new fx(n.d);eT(r,e),lUe(t,r.a,r.b)}function vDe(e,t,n){var r=new Jte;r.b=t,r.a=n,++t.b,M(e.d,r)}function yDe(e,t,n){var r=OV(e,t,!1);return r.b<=t&&r.a<=n}function bDe(e){if(e.p!=2)throw E(new bf);return tE(e.f)&wU}function xDe(e){if(e.p!=2)throw E(new bf);return tE(e.k)&wU}function dk(e,t){if(e<0||e>=t)throw E(new Xp(Xlt+e+Zlt+t))}function fk(e,t){if(e<0||e>=t)throw E(new Em(Xlt+e+Zlt+t))}function SDe(e){return e.Db>>16==6?P(zz(e),241):null}function CDe(e,t){var n,r=LE(e,t);return n=e.a.dd(r),new Sle(e,n)}function wDe(e,t){var n=(yD(e),e).g;return HC(!!n),yD(t),n(t)}function TDe(e){return e.a==(MA(),h9)&&kl(e,N7e(e.g,e.b)),e.a}function pk(e){return e.d==(MA(),h9)&&Vie(e,pnt(e.g,e.b)),e.d}function EDe(e,t){Gse.call(this,new _g(RN(e))),KM(t,glt),this.a=t}function DDe(e,t,n){Yd.call(this,25),this.b=e,this.a=t,this.c=n}function mk(e){bH(),Yd.call(this,e),this.c=!1,this.a=!1}function ODe(e,t){jE.call(this,1,2,U(O(q9,1),RU,30,15,[e,t]))}function hk(e,t){return LN(Ube(qb(e)?KN(e):e,qb(t)?KN(t):t))}function gk(e,t){return LN(Wbe(qb(e)?KN(e):e,qb(t)?KN(t):t))}function _k(e,t){return LN(Gbe(qb(e)?KN(e):e,qb(t)?KN(t):t))}function kDe(e,t){return sbe(e.a,t)?Qve(e.b,P(t,23).g,null):null}function vk(e){return nD(e),j(e,18)?new sT(P(e,18)):bT(e.Jc())}function yk(e){VT(),this.a=(QD(),j(e,59)?new jm(e):new QS(e))}function ADe(e){var t=P(AT(e.b),10);return new lT(e.a,t,e.c)}function jDe(e,t){Pst(e,t,D(N(e.a.mf((vH(),u8)))))}function MDe(e,t){return Gj(),e.c==t.c?BF(t.d,e.d):BF(e.c,t.c)}function NDe(e,t){return Gj(),e.c==t.c?BF(e.d,t.d):BF(e.c,t.c)}function PDe(e,t){return Gj(),e.c==t.c?BF(e.d,t.d):BF(t.c,e.c)}function FDe(e,t){return Gj(),e.c==t.c?BF(t.d,e.d):BF(t.c,e.c)}function IDe(e,t){e.b|=t.b,e.c|=t.c,e.d|=t.d,e.a|=t.a}function z(e){return UC(e.a<e.c.c.length),e.b=e.a++,e.c.c[e.b]}function LDe(e){return e.b==null||e.b.length==0?`n_`+e.a:`n_`+e.b}function bk(e){return P(cL(e,V(GZ,qG,9,e.c.length,0,1)),199)}function RDe(e){return lI(gE(zN(tB(e,32)),32),zN(tB(e,32)))}function zDe(e,t){return e&&e.equals?e.equals(t):A(e)===A(t)}function xk(e){return e.c==null||e.c.length==0?`n_`+e.g:`n_`+e.c}function BDe(e,t){for(var n=e+``;n.length<t;)n=`0`+n;return n}function VDe(e,t){var n=P(sD(e.g,t),60);oM(t.d,new Tue(e,n))}function HDe(e,t){var n=yJe(e),r=yJe(t);return n<r?-1:+(n>r)}function UDe(e,t){var n=kj(t);return P(sD(e.c,n),15).a}function Sk(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function WDe(e,t,n){var r;e.n&&t&&n&&(r=new Lne,M(e.e,r))}function Ck(e,t){if(RE(e.a,t),t.d)throw E(new Ap(eut));t.d=e}function GDe(e,t){this.a=new Zd,this.d=new Zd,this.f=e,this.c=t}function KDe(){xP(),this.b=new Qd,this.a=new Qd,this.c=new Zd}function qDe(){this.c=new tS,this.a=new zje,this.b=new bse,qle()}function JDe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function YDe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function XDe(e,t,n,r,i,a){dIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function ZDe(e,t,n,r,i,a){fIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function QDe(e,t,n,r,i,a){dje.call(this,e,t,n,r,i),a&&(this.o=-2)}function $De(e,t,n,r,i,a){hIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function eOe(e,t,n,r,i,a){fje.call(this,e,t,n,r,i),a&&(this.o=-2)}function tOe(e,t,n,r,i,a){pIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function nOe(e,t,n,r,i,a){mIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function rOe(e,t,n,r,i,a){pje.call(this,e,t,n,r,i),a&&(this.o=-2)}function iOe(e,t,n,r){Wd.call(this,n),this.b=e,this.c=t,this.d=r}function aOe(e,t){this.f=e,this.a=(MA(),m9),this.c=m9,this.b=t}function oOe(e,t){this.g=e,this.d=(MA(),h9),this.a=h9,this.b=t}function sOe(e,t){!e.c&&(e.c=new jN(e,0)),FV(e.c,(WV(),T9),t)}function cOe(e,t){return H3e(e,t,j(t,103)&&(P(t,19).Bb&sW)!=0)}function lOe(e,t){return jxe(zN(e.q.getTime()),zN(t.q.getTime()))}function uOe(e){return Dye(e.e.Pd().gc()*e.c.Pd().gc(),16,new Uc(e))}function dOe(e){return!!e.u&&Zk(e.u.a).i!=0&&!(e.n&&vqe(e.n))}function fOe(e){return!!e.a&&Ej(e.a.a).i!=0&&!(e.b&&yqe(e.b))}function pOe(e,t){return t==0?!!e.o&&e.o.f!=0:xKe(e,t)}function mOe(e){return UC(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function wk(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function hOe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function Tk(e,t){this.a=e,Zl.call(this,e),QO(t,e.gc()),this.b=t}function gOe(e){this.a=V(RY,PH,1,Qze(r.Math.max(8,e))<<1,5,1)}function _Oe(e){LLe.call(this,e,(fj(),jX),null,!1,null,!1)}function vOe(e,t){var n=1-t;return e.a[n]=uN(e.a[n],n),uN(e,t)}function yOe(e,t){var n,r=hk(e,dW);return n=gE(t,32),gk(n,r)}function bOe(e,t,n){var r=P(e.Zb().xc(t),18);return!!r&&r.Gc(n)}function xOe(e,t,n){var r=P(e.Zb().xc(t),18);return!!r&&r.Kc(n)}function SOe(e,t,n){ZJe(new uEe((nD(e),new sT(e)),t,n))}function Ek(e,t,n){QJe(new dEe((nD(e),new sT(e)),t,n))}function COe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),tO(e.d),Tf(e.e.a.c,0)}function wOe(e,t){var n;e.e=new vp,n=DB(t),Yx(n,e.c),f7e(e,n,0)}function TOe(e,t){return new cve(t,rw(sS(t.e),e,e),(XS(),!0))}function EOe(e,t){return dM(),P(K(t,(_V(),k3)),15).a>=e.gc()}function DOe(e){return $O(),!xA(e)&&!(!xA(e)&&e.c.i.c==e.d.i.c)}function Dk(e){return P(cL(e,V(WZ,KG,17,e.c.length,0,1)),323)}function OOe(e){LUe((!e.a&&(e.a=new F(p7,e,10,11)),e.a),new ya)}function kOe(){var e,t=(n=(e=new ef,e),n),n;return M(JBt,t),t}function Ok(e,t,n,r,i,a){return TRe(e,t,n,a),OHe(e,r),kHe(e,i),e}function AOe(e,t,n,r){return e.a+=``+bO(t==null?FH:OI(t),n,r),e}function kk(e,t){if(e<0||e>=t)throw E(new Xp(N0e(e,t)));return e}function jOe(e,t,n){if(e<0||t<e||t>n)throw E(new Xp(S1e(e,t,n)))}function B(e,t,n,r){var i=new Ga;i.a=t,i.b=n,i.c=r,MT(e.b,i)}function Ak(e,t,n,r){var i=new Ga;i.a=t,i.b=n,i.c=r,MT(e.a,i)}function MOe(e,t,n){var r=GGe();try{return ome(e,t,n)}finally{Cje(r)}}function jk(e){var t;return qb(e)?(t=e,t==-0?0:t):FPe(e)}function NOe(e,t){return j(t,45)?eJe(e.a,P(t,45)):!1}function POe(e,t){return j(t,45)?eJe(e.a,P(t,45)):!1}function FOe(e,t){return j(t,45)?eJe(e.a,P(t,45)):!1}function IOe(e,t){return e.a<=e.b?(t.Bd(e.a++),!0):!1}function LOe(e){return ID(e).dc()?!1:(Qde(e,new g),!0)}function ROe(e){var t;return fD(e),t=new fe,Ph(e.a,new nae(t)),t}function Mk(e){var t;return fD(e),t=new pe,Ph(e.a,new rae(t)),t}function zOe(e){if(!(`stack`in e))try{throw e}catch{}return e}function Nk(e){return new VA((KM(e,mU),Jj(lI(lI(5,e),e/10|0))))}function BOe(e){return P(cL(e,V(LSt,Wut,12,e.c.length,0,1)),2004)}function VOe(e){return Dye(e.e.Pd().gc()*e.c.Pd().gc(),273,new Hc(e))}function HOe(){HOe=C,dFt=cF((Vg(),U(O(uFt,1),Z,477,0,[lFt])))}function UOe(){UOe=C,mFt=cF((Hg(),U(O(pFt,1),Z,546,0,[fFt])))}function WOe(){WOe=C,aIt=cF((Ug(),U(O(iIt,1),Z,527,0,[u6])))}function GOe(){GOe=C,_At=nCe(G(1),G(4)),gAt=nCe(G(1),G(2))}function Pk(){Pk=C,EMt=new ny(`DFS`,0),TMt=new ny(`BFS`,1)}function Fk(){Fk=C,r1=new yv(zW,0),Vwt=new yv(`TOP_LEFT`,1)}function KOe(e,t,n){this.d=new qu(this),this.e=e,this.i=t,this.f=n}function qOe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function JOe(e,t,n){e.d&&bj(e.d.e,e),e.d=t,e.d&&rE(e.d.e,n,e)}function YOe(e,t,n){var r=XI(n);return JB(e.n,r,t),JB(e.o,t,n),t}function Ik(e,t){var n=Bj(e,t),r=null;return n&&(r=n.qe()),r}function Lk(e,t){var n=RO(e,t),r=null;return n&&(r=n.qe()),r}function Rk(e,t){var n=RO(e,t),r=null;return n&&(r=n.ne()),r}function zk(e,t){var n=RO(e,t),r=null;return n&&(r=A1e(n)),r}function Bk(e,t){nct(t,e),Rve(e.d),Rve(P(K(e,(hH(),r2)),213))}function Vk(e,t){rct(t,e),zve(e.d),zve(P(K(e,(hH(),r2)),213))}function Hk(e,t){yD(t),e.b=e.b-1&e.a.length-1,iD(e.a,e.b,t),IJe(e)}function XOe(e,t){yD(t),iD(e.a,e.c,t),e.c=e.c+1&e.a.length-1,IJe(e)}function Uk(e){return UC(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function ZOe(e){if(e.e.g!=e.b)throw E(new vf);return!!e.c&&e.d>0}function Wk(e){return j(e,18)?P(e,18).dc():!e.Jc().Ob()}function QOe(e){return new sk(YFe(P(e.a.kd(),18).gc(),e.a.jd()),16)}function $Oe(e){var t=e.Dh();this.a=j(t,72)?P(t,72).Gi():t.Jc()}function eke(e,t){var n=P(Rj(e.b,t),66);return!n&&(n=new gg),n}function tke(e,t){var n=t.a;JO(n,t.c.d),XO(n,t.d.d),DN(n.a,e.n)}function nke(e,t,n,r){return j(n,59)?new ope(e,t,n,r):new zbe(e,t,n,r)}function rke(){return rP(),U(O(VCt,1),Z,413,0,[PQ,FQ,IQ,LQ])}function ike(){return QN(),U(O(txt,1),Z,409,0,[oZ,rZ,iZ,aZ])}function ake(){return vP(),U(O(mSt,1),Z,408,0,[FZ,RZ,IZ,LZ])}function oke(){return fj(),U(O(FX,1),Z,309,0,[jX,MX,NX,PX])}function ske(){return aL(),U(O(CSt,1),Z,383,0,[HZ,SSt,BZ,VZ])}function cke(){return _P(),U(O(DCt,1),Z,367,0,[NQ,jQ,MQ,AQ])}function lke(){return CI(),U(O(iwt,1),Z,301,0,[d$,nwt,u$,rwt])}function uke(){return OL(),U(O(o4,1),Z,203,0,[i4,a4,r4,n4])}function dke(){return JI(),U(O(Lkt,1),Z,269,0,[_4,Ikt,v4,y4])}function fke(){return dF(),U(O(CAt,1),Z,404,0,[F4,L4,R4,I4])}function pke(e){var t;return e.j==(rH(),j5)&&(t=k4e(e),hC(t,p5))}function mke(){return QL(),U(O(fjt,1),Z,398,0,[e3,t3,n3,r3])}function hke(e,t){return P(oC(yE(P(wA(e.k,t),16).Mc(),t$)),113)}function gke(e,t){return P(oC(bE(P(wA(e.k,t),16).Mc(),t$)),113)}function _ke(e,t){return DS(new k(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function vke(){return LR(),U(O(qNt,1),Z,401,0,[KNt,UNt,GNt,WNt])}function yke(){return VL(),U(O(NNt,1),Z,354,0,[MNt,ANt,jNt,kNt])}function bke(){return JP(),U(O(CMt,1),Z,353,0,[SMt,M3,xMt,bMt])}function xke(){return WF(),U(O(pRt,1),Z,278,0,[T8,w8,dRt,fRt])}function Ske(){return GF(),U(O(vRt,1),Z,222,0,[_Rt,A8,k8,j8])}function Cke(){return $L(),U(O(LRt,1),Z,292,0,[z8,I8,L8,R8])}function wke(){return dA(),U(O(Z5,1),Z,288,0,[lzt,fzt,uzt,dzt])}function Tke(){return YI(),U(O(B5,1),Z,380,0,[R5,z5,L5,I5])}function Eke(){return TI(),U(O(vzt,1),Z,326,0,[_zt,mzt,gzt,hzt])}function Dke(){return qP(),U(O(Tzt,1),Z,407,0,[Szt,Czt,xzt,wzt])}function Gk(e,t,n){return t<0?M2e(e,n):P(n,69).uk().zk(e,e.ei(),t)}function Oke(e,t,n){var r=XI(n);return JB(e.f,r,t),kD(e.g,t,n),t}function kke(e,t,n){var r=XI(n);return JB(e.p,r,t),kD(e.q,t,n),t}function Ake(e){var t=(vh(),n=new bo,n),n;return e&&oB(t,e),t}function jke(e){var t=e.$i(e.i);return e.i>0&&hV(e.g,0,t,0,e.i),t}function Kk(e){return Rg(),j(e.g,156)?P(e.g,156):null}function Mke(e){return tk(),PE($zt,e)?P(sD($zt,e),342).Pg():null}function Nke(e){e.a=null,e.e=null,Tf(e.b.c,0),Tf(e.f.c,0),e.c=null}function Pke(e,t){var n;for(n=e.j.c.length;n<t;n++)M(e.j,e.Mg())}function Fke(e,t,n,r){var i=r[t.g][n.g];return D(N(K(e.a,i)))}function Ike(e,t){Zg();var n=P(sD(D7,e),58);return!n||n.dk(t)}function Lke(e){if(e.p!=1)throw E(new bf);return tE(e.f)<<24>>24}function Rke(e){if(e.p!=1)throw E(new bf);return tE(e.k)<<24>>24}function zke(e){if(e.p!=7)throw E(new bf);return tE(e.k)<<16>>16}function Bke(e){if(e.p!=7)throw E(new bf);return tE(e.f)<<16>>16}function qk(e,t){return t.e==0||e.e==0?xX:(jB(),fB(e,t))}function Vke(e,t){return A(t)===A(e)?`(this Map)`:t==null?FH:OI(t)}function Hke(e,t,n){return Vbe(N(_b(iE(e.f,t))),N(_b(iE(e.f,n))))}function Uke(e,t,n){var r=P(sD(e.g,n),60);M(e.a.c,new Gy(t,r))}function Wke(e,t){var n=new Tm;return e.Ed(n),n.a+=`..`,t.Fd(n),n.a}function Jk(e){for(var t=0;e.Ob();)e.Pb(),t=lI(t,1);return Jj(t)}function Gke(e,t,n,r,i){M(t,y0e(i,m6e(i,n,r))),g$e(e,i,t)}function Kke(e,t,n){e.i=0,e.e=0,t!=n&&(SBe(e,t,n),xBe(e,t,n))}function qke(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function Jke(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function Yke(e,t){Vwe.call(this),this.a=e,this.b=t,M(this.a.b,this)}function Yk(e,t){qB(),jE.call(this,e,1,U(O(q9,1),RU,30,15,[t]))}function Xke(e,t,n){return CV(e,t,n,j(t,103)&&(P(t,19).Bb&sW)!=0)}function Xk(e,t,n){return yV(e,t,n,j(t,103)&&(P(t,19).Bb&sW)!=0)}function Zke(e,t,n){return t6e(e,t,n,j(t,103)&&(P(t,19).Bb&sW)!=0)}function Qke(e,t){return e==(Zz(),ZZ)&&t==ZZ?4:e==ZZ||t==ZZ?8:32}function $ke(e,t){return P(t==null?_b(iE(e.f,null)):m_(e.i,t),290)}function eAe(e,t){for(var n=t;n;)nw(e,n.i,n.j),n=UO(n);return e}function Zk(e){return e.n||(bA(e),e.n=new Ebe(e,z7,e),_O(e)),e.n}function Qk(e,t){n_();var n=P(e,69).tk();return V$e(n,t),n.vl(t)}function $k(e){return UC(e.a<e.c.a.length),e.b=e.a,WPe(e),e.c.b[e.b]}function tAe(e){e.b!=e.c&&(e.a=V(RY,PH,1,8,5,1),e.b=0,e.c=0)}function nAe(e,t){var n=e.q.getHours();e.q.setFullYear(t+LU),SV(e,n)}function rAe(e,t){NP();var n=e.j.g-t.j.g;return n==0?0:n}function iAe(e,t,n){if(n){var r=n.me();e.a[t]=r(n)}else delete e.a[t]}function eA(e,t,n){n=n?n.me()(n):void 0,e.a[t]=n}function aAe(e){if(e<0)throw E(new rce(`Negative array size: `+e))}function oAe(e){j(e,206)&&!sm(hw(e.mf((vH(),$6))))&&ant(P(e,26))}function tA(e){return e.c&&e.d?LDe(e.c)+`->`+LDe(e.d):`e_`+TC(e)}function sAe(e,t){var n;return n=t==null?_b(iE(e.f,t)):DO(e,t),Db(n)}function cAe(e,t){var n;return n=t==null?_b(iE(e.f,t)):DO(e,t),Db(n)}function lAe(e,t){var n;for(n=0;n<t;++n)iD(e,n,new $l(P(e[n],45)))}function uAe(e,t){return vg(),XA(R(e.a),t)}function dAe(e,t){return vg(),XA(R(e.a),t)}function nA(e,t){bH(),Yd.call(this,e),this.a=t,this.c=-1,this.b=-1}function rA(e,t,n,r){JDe.call(this,1,n,r),this.c=e,this.b=t}function fAe(e,t,n,r){YDe.call(this,1,n,r),this.c=e,this.b=t}function pAe(e,t,n,r,i,a,o){JM.call(this,t,r,i,a,o),this.c=e,this.a=n}function iA(e,t,n){this.e=e,this.a=RY,this.b=h9e(t),this.c=t,this.d=n}function mAe(e){this.e=e,this.c=this.e.a,this.b=this.e.g,this.d=this.e.i}function hAe(e){this.d=e,this.b=this.d.a.entries(),this.a=this.b.next()}function gAe(e){this.c=e,this.a=P(aR(e),159),this.b=this.a.hk().ti()}function aA(){Qd.call(this),lpe(this),this.d.b=this.d,this.d.a=this.d}function oA(e,t,n,r){var i=new me;i.c=t,i.b=n,i.a=r,r.b=n.a=i,++e.b}function sA(e,t){var n;return t.b.Kb(cPe(e,t.c.Ve(),(n=new iae(t),n)))}function _Ae(e,t){var n;return aAe(t),n=e.slice(0,t),n.length=t,lj(n,e)}function cA(e){var t;return e?new Pye(e):(t=new ax,ALe(t,e),t)}function vAe(e,t){var n;for(n=e.d-1;n>=0&&e.a[n]===t[n];n--);return n<0}function yAe(e,t){var n,r=!1;do n=Jze(e,t),r|=n;while(n);return r}function lA(){lA=C,V4=new Lv(`UPPER`,0),B4=new Lv(`LOWER`,1)}function uA(){uA=C,c0=new xv(BG,0),s0=new xv(`ALTERNATING`,1)}function dA(){dA=C,lzt=new wye,fzt=new lxe,uzt=new Qwe,dzt=new uxe}function bAe(){bAe=C,twt=cF((GA(),U(O(ewt,1),Z,422,0,[$Ct,l$])))}function xAe(){xAe=C,mwt=cF((qj(),U(O(pwt,1),Z,419,0,[S$,fwt])))}function SAe(){SAe=C,xwt=cF((_j(),U(O(bwt,1),Z,476,0,[ywt,M$])))}function CAe(){CAe=C,Uwt=cF((Fk(),U(O(Hwt,1),Z,420,0,[r1,Vwt])))}function wAe(){wAe=C,oTt=cF((uA(),U(O(aTt,1),Z,423,0,[c0,s0])))}function TAe(){TAe=C,Bkt=cF((Tj(),U(O(zkt,1),Z,421,0,[b4,x4])))}function EAe(){EAe=C,jAt=cF((lA(),U(O(AAt,1),Z,518,0,[V4,B4])))}function DAe(){DAe=C,HAt=cF((PO(),U(O(VAt,1),Z,508,0,[K4,q4])))}function OAe(){OAe=C,BAt=cF((NO(),U(O(zAt,1),Z,509,0,[G4,W4])))}function kAe(){kAe=C,ijt=cF((UA(),U(O(rjt,1),Z,515,0,[Z4,X4])))}function AAe(){AAe=C,djt=cF((FO(),U(O(ujt,1),Z,454,0,[Q4,$4])))}function jAe(){jAe=C,OMt=cF((Pk(),U(O(DMt,1),Z,425,0,[EMt,TMt])))}function MAe(){MAe=C,PMt=cF((sN(),U(O(NMt,1),Z,487,0,[P3,F3])))}function NAe(){NAe=C,GMt=cF((gj(),U(O(WMt,1),Z,426,0,[HMt,UMt])))}function PAe(){PAe=C,qPt=cF((_A(),U(O(KPt,1),Z,478,0,[WPt,GPt])))}function FAe(){FAe=C,_Ft=cF((WA(),U(O(gFt,1),Z,428,0,[hFt,c6])))}function IAe(){IAe=C,cIt=cF((iP(),U(O(sIt,1),Z,427,0,[d6,oIt])))}function LAe(){LAe=C,_xt=cF((Kj(),U(O(gxt,1),Z,424,0,[uZ,dZ])))}function RAe(){RAe=C,VSt=cF((oN(),U(O(BSt,1),Z,502,0,[nQ,tQ])))}function fA(e){lQe(),OS(this,tE(hk(_E(e,24),CW)),tE(hk(e,CW)))}function zAe(e){return(e.k==(Zz(),ZZ)||e.k==qZ)&&QC(e,(Y(),d1))}function BAe(e,t,n){return P(t==null?gz(e.f,null,n):oI(e.i,t,n),290)}function VAe(){return KF(),U(O(C8,1),Z,86,0,[x8,b8,y8,v8,S8])}function HAe(){return rH(),U(O(P5,1),HG,64,0,[M5,m5,p5,j5,N5])}function UAe(e){return xm(),function(){return MOe(e,this,arguments)}}function WAe(e,t){var n=t.jd();return new $h(n,e.e.pc(n,P(t.kd(),18)))}function GAe(e,t){var n=t.jd(),r=e.De(n);return!!r&&OD(r.e,t.kd())}function pA(e,t){var n,r;for(yD(t),r=e.Jc();r.Ob();)n=r.Pb(),t.Ad(n)}function mA(e,t,n){var r=(dk(t,e.c.length),e.c[t]);return e.c[t]=n,r}function KAe(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function qAe(e,t){for(var n=t;n;)nw(e,-n.i,-n.j),n=UO(n);return e}function JAe(e,t){return e.a.get(t)??V(RY,PH,1,0,5,1)}function hA(e,t){return(hI(e),Vh(new JT(e,new bNe(t,e.a)))).zd(BX)}function YAe(){return BR(),U(O(cSt,1),Z,363,0,[TZ,EZ,DZ,OZ,kZ])}function XAe(e){Bct(),nse(this),this.a=new gg,RBe(this,e),MT(this.a,e)}function ZAe(){Rx(this),this.b=new k(rW,rW),this.a=new k(iW,iW)}function QAe(e){gA(),!LX&&(this.c=e,this.e=!0,this.a=new Zd)}function gA(){gA=C,LX=!0,sbt=!1,cbt=!1,ubt=!1,lbt=!1}function _A(){_A=C,WPt=new my(udt,0),GPt=new my(`TARGET_WIDTH`,1)}function $Ae(){return ER(),U(O(BMt,1),Z,364,0,[RMt,FMt,zMt,IMt,LMt])}function eje(){return wR(),U(O(UCt,1),Z,371,0,[zQ,VQ,HQ,BQ,RQ])}function tje(){return xL(),U(O(Okt,1),Z,328,0,[Dkt,c4,l4,s4,u4])}function nje(){return SI(),U(O(rTt,1),Z,165,0,[o0,n0,r0,i0,a0])}function rje(){return cB(),U(O(aFt,1),Z,369,0,[t6,e6,r6,n6,i6])}function ije(){return QR(),U(O(CFt,1),Z,330,0,[vFt,yFt,SFt,bFt,xFt])}function aje(){return fL(),U(O(_6,1),Z,160,0,[h6,m6,f6,g6,p6])}function oje(){return pL(),U(O($8,1),Z,257,0,[Z8,Q8,BRt,X8,VRt])}function sje(e,t){return P(Rj(e.d,t),21)||P(Rj(e.e,t),21)}function cje(e){this.b=e,zS.call(this,e),this.a=P(BN(this.b.a,4),129)}function lje(e){this.b=e,xC.call(this,e),this.a=P(BN(this.b.a,4),129)}function uje(e,t){this.c=0,this.b=t,Pb.call(this,e,17493),this.a=this.c}function vA(e,t,n,r,i){Bje.call(this,t,r,i),this.c=e,this.b=n}function dje(e,t,n,r,i){JDe.call(this,t,r,i),this.c=e,this.a=n}function fje(e,t,n,r,i){YDe.call(this,t,r,i),this.c=e,this.a=n}function pje(e,t,n,r,i){Bje.call(this,t,r,i),this.c=e,this.a=n}function mje(e,t,n){e.a.c.length=0,Uit(e,t,n),e.a.c.length==0||Fet(e,t)}function yA(e){e.i=0,p_(e.b,null),p_(e.c,null),e.a=null,e.e=null,++e.g}function hje(e){return e.e=3,e.d=e.Yb(),e.e==2?!1:(e.e=0,!0)}function gje(e,t){return j(t,144)?$w(e.c,P(t,144).c):!1}function _je(e){var t;return e.c||(t=e.r,j(t,88)&&(e.c=P(t,29))),e.c}function bA(e){return e.t||(e.t=new zd(e),LF(new tce(e),0,e.t)),e.t}function xA(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function SA(e,t){return t==0||e.e==0?e:t>0?KWe(e,t):C5e(e,-t)}function vje(e,t){return t==0||e.e==0?e:t>0?C5e(e,t):KWe(e,-t)}function CA(e){if(Vz(e))return e.c=e.a,e.a.Pb();throw E(new Cf)}function yje(e){var t=e.length;return $w(oW.substr(oW.length-t,t),e)}function bje(e){var t=e.c.i,n=e.d.i;return t.k==(Zz(),qZ)&&n.k==qZ}function xje(e){return eS(e&JU,e>>22&JU,e<0?YU:0)}function Sje(e,t){var n=P(QVe(e.c,t),18),r;n&&(r=n.gc(),n.$b(),e.d-=r)}function Cje(e){e&&UPe((Hp(),iyt)),--QY,e&&$Y!=-1&&(Kv($Y),$Y=-1)}function wje(e){pue.call(this,e==null?FH:OI(e),j(e,80)?P(e,80):null)}function Tje(e){var t=new fO;return qN(t,e),W(t,(hH(),J0),null),t}function Eje(e,t,n){var r;return r=e.Fh(t),r>=0?e.Ih(r,n,!0):jz(e,t,n)}function Dje(e,t,n){return BF(DS(dL(e),sS(t.b)),DS(dL(e),sS(n.b)))}function Oje(e,t,n){return BF(DS(dL(e),sS(t.e)),DS(dL(e),sS(n.e)))}function kje(e,t){return r.Math.min(QA(t.a,e.d.d.c),QA(t.b,e.d.d.c))}function Aje(e,t,n){var r=new bS(e.a);wN(r,e.a.a),gz(r.f,t,n),e.a.a=r}function jje(e,t,n,r){var i;for(i=0;i<JX;i++)sE(e.a[i][t.g],n,r[t.g])}function Mje(e,t,n,r){var i;for(i=0;i<qX;i++)cE(e.a[t.g][i],n,r[t.g])}function wA(e,t){var n=P(e.c.xc(t),18);return!n&&(n=e.ic(t)),e.pc(t,n)}function Nje(e){var t=(nD(e),e?new sT(e):bT(e.Jc()));return mz(t),cI(t)}function TA(e){var t,n;return nD(e),t=rCe(e.length),n=new VA(t),oBe(n,e),n}function EA(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Mi(n,t),e.Li()}function DA(e,t){e.Zi(e.i+1),AS(e,e.i,e.Xi(e.i,t)),e.Ki(e.i++,t),e.Li()}function OA(e,t){return bb(t)?t==null?P4e(e.f,null):YRe(e.i,t):P4e(e.f,t)}function kA(e,t){var n=(dk(t,e.c.length),e.c[t]);return Ih(e.c,t,1),n}function AA(e,t,n,r){var i=V(q9,RU,30,t,15,1);return sQe(i,e,t,n,r),i}function jA(e,t){return e.a?Mb(e.a,e.b):e.a=new nC(e.d),Ab(e.a,t),e}function Pje(e,t){if(e<0||e>t)throw E(new Xp(m0e(e,t,`index`)));return e}function Fje(e){var t=e.e+e.f;return isNaN(t)&&oT(e.d)?e.d:t}function Ije(e,t){var n=e.q.getHours()+(t/60|0);e.q.setMinutes(t),SV(e,n)}function Lje(e,t){var n=(yD(e),e),r=(yD(t),t);return n==r?0:n<r?-1:1}function MA(){MA=C;var e,t;m9=(bh(),t=new wf,t),h9=(e=new op,e)}function Rje(){this.g=new Ff,this.b=new Ff,this.a=new Zd,this.k=new Zd}function NA(){this.e=new Zd,this.c=new Zd,this.d=new Zd,this.b=new Zd}function zje(){this.a=new _se,this.b=new wse,this.d=new gt,this.e=new mee}function PA(e){this.c=e,this.a=new T(this.c.a),this.b=new T(this.c.b)}function Bje(e,t,n){this.d=e,this.k=+!!t,this.f=+!!n,this.o=-1,this.p=0}function Vje(e,t,n){this.a=e,this.c=t,this.d=n,M(t.e,this),M(n.b,this)}function Hje(e,t,n){Wd.call(this,n),this.b=e,this.c=t,this.d=(zWe(),KBt)}function Uje(e,t){cde.call(this,t.xd(),t.wd()&-6),yD(e),this.a=e,this.b=t}function Wje(e,t){Pb.call(this,t.xd(),t.wd()&-6),yD(e),this.a=e,this.b=t}function Gje(e,t){Fb.call(this,t.xd(),t.wd()&-6),yD(e),this.a=e,this.b=t}function FA(e,t,n){this.a=e,this.b=t,this.c=n,M(e.t,this),M(t.i,this)}function IA(){this.b=new gg,this.a=new gg,this.b=new gg,this.a=new gg}function Kje(e,t){var n=pat(e,t);return e.b=new fN(n.c.length),vit(e,n)}function qje(e,t,n){var r;return++e.e,--e.f,r=P(e.d[t].ed(n),136),r.kd()}function Jje(e){var t;return e.a||(t=e.r,j(t,159)&&(e.a=P(t,159))),e.a}function Yje(e){if(e.a){if(e.e)return Yje(e.e)}else return e;return null}function Xje(e,t){return e.p<t.p?1:e.p>t.p?-1:0}function Zje(e,t){return PE(e.a,t)?(OA(e.a,t),!0):!1}function Qje(e){var t=e.jd();return _T(P(e.kd(),18).Lc(),new Ic(t))}function LA(e){var t=e.b;return t.b==0?null:P(wL(t,0),65).b}function RA(e,t){return yD(t),e.c<e.d?(e.Qe(t,e.c++),!0):!1}function zA(e,t,n){return kk(t,e.e.Pd().gc()),kk(n,e.c.Pd().gc()),e.a[t][n]}function $je(e){var t;return hI(e),t=new Sve(e,e.a.e,e.a.d|4),new Ow(e,t)}function eMe(e){var t;for(fD(e),t=0;e.a.zd(new je);)t=lI(t,1);return t}function tMe(e,t,n){var r=0,i;for(i=0;i<t.length;i++)r+=e.sg(t[i],r,n)}function BA(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function VA(e){Rx(this),ST(e>=0,`Initial capacity must not be negative`)}function HA(){HA=C,T6=new Rd(`org.eclipse.elk.labels.labelManager`)}function nMe(){nMe=C,ECt=new Aw(`separateLayerConnections`,(_P(),NQ))}function UA(){UA=C,Z4=new qv(`REGULAR`,0),X4=new qv(`CRITICAL`,1)}function WA(){WA=C,hFt=new yy(`FIXED`,0),c6=new yy(`CENTER_NODE`,1)}function GA(){GA=C,$Ct=new rv(`QUADRATIC`,0),l$=new rv(`SCANLINE`,1)}function rMe(){rMe=C,cwt=cF((VM(),U(O(swt,1),Z,350,0,[owt,p$,f$])))}function iMe(){iMe=C,gwt=cF((bP(),U(O(hwt,1),Z,449,0,[w$,C$,T$])))}function aMe(){aMe=C,Iwt=cF((eP(),U(O(X$,1),Z,302,0,[J$,Y$,q$])))}function oMe(){oMe=C,Rwt=cF((yP(),U(O($$,1),Z,329,0,[Q$,Lwt,Z$])))}function sMe(){sMe=C,Bwt=cF((Fj(),U(O(zwt,1),Z,315,0,[t1,n1,e1])))}function cMe(){cMe=C,YCt=cF((cN(),U(O(KQ,1),Z,368,0,[GQ,WQ,UQ])))}function lMe(){lMe=C,Tkt=cF((fF(),U(O(wkt,1),Z,352,0,[e4,Ckt,t4])))}function uMe(){uMe=C,Hkt=cF((BM(),U(O(Vkt,1),Z,452,0,[w4,S4,C4])))}function dMe(){dMe=C,Kkt=cF((tP(),U(O(Gkt,1),Z,381,0,[Ukt,T4,Wkt])))}function fMe(){fMe=C,Jkt=cF((ZP(),U(O(qkt,1),Z,348,0,[O4,E4,D4])))}function pMe(){pMe=C,Zkt=cF((pF(),U(O(Xkt,1),Z,349,0,[k4,Ykt,A4])))}function mMe(){mMe=C,tAt=cF((zM(),U(O(eAt,1),Z,351,0,[$kt,j4,Qkt])))}function hMe(){hMe=C,rAt=cF((nP(),U(O(nAt,1),Z,382,0,[N4,P4,M4])))}function gMe(){gMe=C,kjt=cF((YP(),U(O(Ojt,1),Z,385,0,[Djt,s3,o3])))}function _Me(){_Me=C,YMt=cF((XP(),U(O(JMt,1),Z,386,0,[I3,KMt,qMt])))}function vMe(){vMe=C,zNt=cF(($N(),U(O(RNt,1),Z,303,0,[INt,LNt,FNt])))}function yMe(){yMe=C,HNt=cF((qI(),U(O(VNt,1),Z,436,0,[B3,V3,BNt])))}function bMe(){bMe=C,QPt=cF((vj(),U(O(ZPt,1),Z,429,0,[JPt,XPt,YPt])))}function xMe(){xMe=C,rFt=cF((VF(),U(O(nFt,1),Z,430,0,[$Pt,tFt,eFt])))}function SMe(){SMe=C,cFt=cF((HF(),U(O(sFt,1),Z,435,0,[a6,o6,s6])))}function CMe(){CMe=C,rPt=cF((wI(),U(O(nPt,1),Z,387,0,[ePt,tPt,$Nt])))}function wMe(){wMe=C,iSt=cF((wj(),U(O(rSt,1),Z,384,0,[CZ,SZ,wZ])))}function TMe(){TMe=C,pbt=cF((QP(),U(O(zX,1),Z,130,0,[dbt,RX,fbt])))}function EMe(){EMe=C,Tbt=cF((lM(),U(O(KX,1),Z,237,0,[UX,WX,GX])))}function DMe(){DMe=C,Dbt=cF((pj(),U(O(Ebt,1),Z,461,0,[XX,YX,ZX])))}function OMe(){OMe=C,Abt=cF((Pj(),U(O(kbt,1),Z,462,0,[eZ,$X,QX])))}function kMe(){kMe=C,gRt=cF((uM(),U(O(hRt,1),Z,279,0,[E8,D8,O8])))}function AMe(){AMe=C,czt=cF((UF(),U(O(szt,1),Z,281,0,[ozt,Y5,X5])))}function jMe(){jMe=C,FRt=cF(($P(),U(O(PRt,1),Z,347,0,[P8,N8,F8])))}function MMe(){MMe=C,tzt=cF((_M(),U(O(ezt,1),Z,300,0,[F5,QRt,$Rt])))}function KA(e,t){return!e.o&&(e.o=new ij((uH(),d7),g7,e,0)),EWe(e.o,t)}function NMe(e){return!e.g&&(e.g=new jo),!e.g.d&&(e.g.d=new Loe(e)),e.g.d}function PMe(e){return!e.g&&(e.g=new jo),!e.g.b&&(e.g.b=new Ioe(e)),e.g.b}function qA(e){return!e.g&&(e.g=new jo),!e.g.c&&(e.g.c=new zoe(e)),e.g.c}function FMe(e){return!e.g&&(e.g=new jo),!e.g.a&&(e.g.a=new Roe(e)),e.g.a}function IMe(e,t,n,r){return n&&(r=n.Oh(t,NI(n.Ah(),e.c.sk()),null,r)),r}function LMe(e,t,n,r){return n&&(r=n.Qh(t,NI(n.Ah(),e.c.sk()),null,r)),r}function JA(e,t,n,r){var i=V(q9,RU,30,t+1,15,1);return Jtt(i,e,t,n,r),i}function V(e,t,n,r,i,a){var o=_Je(i,r);return i!=10&&U(O(e,a),t,n,i,o),o}function RMe(e,t,n){var r,i=new YN(t,e);for(r=0;r<n;++r)DL(i);return i}function zMe(e,t,n){var r,i;if(n!=null)for(r=0;r<t;++r)i=n[r],e.Oi(r,i)}function BMe(e,t){var n;e.C&&(n=P(AD(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function VMe(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function HMe(e,t){var n=new ve;return n.c=!0,n.d=t.kd(),Zat(e,t.jd(),n)}function UMe(e,t){var n=e.q.getHours()+(t/3600|0);e.q.setSeconds(t),SV(e,n)}function WMe(e,t){var n=t,r=uO(bT(new Aj(e,n)));return HT(new Aj(e,n)),r}function GMe(e,t){t.Tg(`Label management`,1),Db(K(e,(HA(),T6))),t.Ug()}function KMe(e,t,n){P(e.b,68),P(e.b,68),P(e.b,68),oM(e.a,new s_e(n,t,e))}function qMe(e,t,n,r){Ftt(e,t,n,CV(e,t,r,j(t,103)&&(P(t,19).Bb&sW)!=0))}function YA(e,t,n){if(e<0||t>n||t<e)throw E(new Em(kW+e+Ylt+t+Hlt+n))}function JMe(e,t,n){this.d=new Zf,this.c=new Qd,this.a=e,this.e=t,this.c=n}function YMe(e){e?(this.c=e,this.b=null):(this.c=null,this.b=new Zd)}function XMe(e,t){v_.call(this,e,t),this.a=V(nbt,rU,438,2,0,1),this.b=!0}function ZMe(e){gBe.call(this,e,0),lpe(this),this.d.b=this.d,this.d.a=this.d}function QMe(e){this.e=e,this.b=this.e.a.entries(),this.a=V(RY,PH,1,0,5,1)}function $Me(){$Me=C,cAt=oE(RT(new xD,(BR(),TZ),(yH(),lQ)),kZ,wQ)}function eNe(){return uz(),U(O(c$,1),Z,231,0,[i$,o$,r$,a$,s$,n$])}function tNe(){return YR(),U(O(_wt,1),Z,284,0,[D$,E$,k$,O$,j$,A$])}function nNe(){return mR(),U(O(Ewt,1),Z,282,0,[P$,Cwt,Twt,Swt,wwt,N$])}function rNe(){return KR(),U(O(Nwt,1),Z,283,0,[F$,kwt,Mwt,jwt,Awt,Owt])}function iNe(){return kL(),U(O(DIt,1),Z,256,0,[EIt,k6,A6,j6,D6,O6])}function aNe(){return xR(),U(O(UIt,1),Z,299,0,[HIt,F6,P6,VIt,M6,N6])}function oNe(){return Sz(),U(O(f5,1),Z,280,0,[u5,c5,l5,s5,o5,d5])}function sNe(){return TR(),U(O(URt,1),Z,102,0,[a5,i5,r5,e5,n5,t5])}function cNe(){return RR(),U(O(ERt,1),Z,327,0,[wRt,SRt,TRt,bRt,CRt,xRt])}function lNe(e){var t;return!e.a&&e.b!=-1&&(t=e.c.Ah(),e.a=$j(t,e.b)),e.a}function XA(e,t){return e.Qi()&&e.Gc(t)?!1:(e.Fi(t),!0)}function ZA(e,t){return gO(t,`Horizontal alignment cannot be null`),e.b=t,e}function uNe(e,t,n){bH();var r=oH(e,t);return n&&r&&LSe(e)&&(r=null),r}function dNe(e,t,n){var r=e.b[n.c.p][n.p];r.b+=t.b,r.c+=t.c,r.a+=t.a,++r.a}function fNe(e,t,n){var i;e.d[t.g]=n,i=e.g.c,i[t.g]=r.Math.max(i[t.g],n+1)}function QA(e,t){var n=e.a-t.a,i=e.b-t.b;return r.Math.sqrt(n*n+i*i)}function pNe(e,t){var n,r;for(r=t.Jc();r.Ob();)n=P(r.Pb(),37),tet(e,n,0,0)}function $A(e,t,n){var r,i;for(i=e.Jc();i.Ob();)r=P(i.Pb(),37),WB(r,t,n)}function mNe(e){var t,n;for(n=mL(e.a,0);n.b!=n.d.c;)t=P(Uk(n),65),p2e(t)}function hNe(e,t){var n=sD(e.k,t);return S8e(e,t),XB(e,t),R3e(e,t,n),null}function ej(e,t){var n;return n=e.Fh(t),n>=0?e.Ih(n,!0,!0):jz(e,t,!0)}function tj(e,t){var n,r,i=e.r;return r=e.d,n=OV(e,t,!0),n.b!=i||n.a!=r}function gNe(e,t){return mue(e.e,t)||uL(e.e,t,new mKe(t)),P(Rj(e.e,t),113)}function nj(e,t,n,r){return yD(e),yD(t),yD(n),yD(r),new kxe(e,t,new Te)}function rj(e,t,n){var r,i=(r=Jz(e.b,t),r);return i?IV(Oj(e,i),n):null}function _Ne(e,t,n){var r=RO(e,n),i=null,a;r&&(i=A1e(r)),a=i,iKe(t,n,a)}function vNe(e,t,n){var r=RO(e,n),i=null,a;r&&(i=A1e(r)),a=i,iKe(t,n,a)}function ij(e,t,n,r){this.$j(),this.a=t,this.b=e,this.c=new mxe(this,t,n,r)}function aj(e,t,n,r,i,a){qOe.call(this,t,r,i,a),this.c=e,this.b=n}function oj(e,t,n,r,i,a){qOe.call(this,t,r,i,a),this.c=e,this.a=n}function yNe(e,t,n,r,i){nfe(this),this.b=e,this.d=t,this.f=n,this.g=r,this.c=i}function bNe(e,t){Fb.call(this,t.xd(),t.wd()&-16449),yD(e),this.a=e,this.c=t}function xNe(e,t){e.a.Le(t.d,e.b)>0&&(M(e.c,new wve(t.c,t.d,e.d)),e.b=t.d)}function sj(e){e.a=V(q9,RU,30,e.b+1,15,1),e.c=V(q9,RU,30,e.b,15,1),e.d=0}function SNe(e,t,n){var r=uBe(e,t,n);return e.b=new fN(r.c.length),X5e(e,r)}function CNe(e){if(e.b<=0)throw E(new Cf);return--e.b,e.a-=e.c.c,G(e.a)}function wNe(e){var t;if(!e.a)throw E(new Swe);return t=e.a,e.a=UO(e.a),t}function TNe(e){var t;if(e.ll())for(t=e.i-1;t>=0;--t)H(e,t);return jke(e)}function cj(e){var t;return nD(e),j(e,204)?(t=P(e,204),t):new gie(e)}function ENe(e){for(;!e.a;)if(!fhe(e.c,new uu(e)))return!1;return!0}function DNe(e,t){if(e.g==null||t>=e.i)throw E(new nx(t,e.i));return e.g[t]}function ONe(e,t,n){if(RP(e,n),n!=null&&!e.dk(n))throw E(new gf);return n}function lj(e,t){return Uj(t)!=10&&U(VP(t),t.Qm,t.__elementTypeId$,Uj(t),e),e}function kNe(e,t){var n,r=t/e.c.Pd().gc()|0;return n=t%e.c.Pd().gc(),zA(e,r,n)}function uj(e,t,n,r){var i;r=($D(),r||zyt),i=e.slice(t,n),h0e(i,e,t,n,-t,r)}function dj(e,t,n,r,i){return t<0?jz(e,n,r):P(n,69).uk().wk(e,e.ei(),t,r,i)}function ANe(e,t){return BF(D(N(K(e,(Y(),R1)))),D(N(K(t,R1))))}function jNe(){jNe=C,rbt=cF((fj(),U(O(FX,1),Z,309,0,[jX,MX,NX,PX])))}function fj(){fj=C,jX=new w_(`All`,0),MX=new jx,NX=new tfe,PX=new Ode}function pj(){pj=C,XX=new D_(BW,0),YX=new D_(zW,1),ZX=new D_(VW,2)}function MNe(){MNe=C,DV(),EVt=rW,TVt=iW,OVt=new zl(rW),DVt=new zl(iW)}function mj(){mj=C,mIt=new Va,gIt=new Dne,hIt=Vze((vH(),LLt),mIt,Q6,gIt)}function NNe(e){mj(),P(e.mf((vH(),i8)),182).Ec((Sz(),l5)),e.of(LLt,null)}function PNe(e){return j(e,180)?``+P(e,180).a:e==null?null:OI(e)}function FNe(e){return j(e,180)?``+P(e,180).a:e==null?null:OI(e)}function INe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function LNe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function hj(e){var t;for(t=e.p+1;t<e.c.a.c.length;++t)--P(qT(e.c.a,t),9).p}function RNe(){RNe=C,OCt=cF((_P(),U(O(DCt,1),Z,367,0,[NQ,jQ,MQ,AQ])))}function zNe(){zNe=C,wSt=cF((aL(),U(O(CSt,1),Z,383,0,[HZ,SSt,BZ,VZ])))}function BNe(){BNe=C,nxt=cF((QN(),U(O(txt,1),Z,409,0,[oZ,rZ,iZ,aZ])))}function VNe(){VNe=C,hSt=cF((vP(),U(O(mSt,1),Z,408,0,[FZ,RZ,IZ,LZ])))}function HNe(){HNe=C,wAt=cF((dF(),U(O(CAt,1),Z,404,0,[F4,L4,R4,I4])))}function UNe(){UNe=C,Ekt=cF((OL(),U(O(o4,1),Z,203,0,[i4,a4,r4,n4])))}function WNe(){WNe=C,Rkt=cF((JI(),U(O(Lkt,1),Z,269,0,[_4,Ikt,v4,y4])))}function GNe(){GNe=C,HCt=cF((rP(),U(O(VCt,1),Z,413,0,[PQ,FQ,IQ,LQ])))}function KNe(){KNe=C,wMt=cF((JP(),U(O(CMt,1),Z,353,0,[SMt,M3,xMt,bMt])))}function qNe(){qNe=C,awt=cF((CI(),U(O(iwt,1),Z,301,0,[d$,nwt,u$,rwt])))}function JNe(){JNe=C,JNt=cF((LR(),U(O(qNt,1),Z,401,0,[KNt,UNt,GNt,WNt])))}function YNe(){YNe=C,PNt=cF((VL(),U(O(NNt,1),Z,354,0,[MNt,ANt,jNt,kNt])))}function XNe(){XNe=C,pjt=cF((QL(),U(O(fjt,1),Z,398,0,[e3,t3,n3,r3])))}function ZNe(){ZNe=C,mRt=cF((WF(),U(O(pRt,1),Z,278,0,[T8,w8,dRt,fRt])))}function QNe(){QNe=C,yRt=cF((GF(),U(O(vRt,1),Z,222,0,[_Rt,A8,k8,j8])))}function $Ne(){$Ne=C,RRt=cF(($L(),U(O(LRt,1),Z,292,0,[z8,I8,L8,R8])))}function ePe(){ePe=C,pzt=cF((dA(),U(O(Z5,1),Z,288,0,[lzt,fzt,uzt,dzt])))}function tPe(){tPe=C,nzt=cF((YI(),U(O(B5,1),Z,380,0,[R5,z5,L5,I5])))}function nPe(){nPe=C,yzt=cF((TI(),U(O(vzt,1),Z,326,0,[_zt,mzt,gzt,hzt])))}function rPe(){rPe=C,Ezt=cF((qP(),U(O(Tzt,1),Z,407,0,[Szt,Czt,xzt,wzt])))}function gj(){gj=C,HMt=new sy(`LEAF_NUMBER`,0),UMt=new sy(`NODE_SIZE`,1)}function _j(){_j=C,ywt=new mv(BG,0),M$=new mv(`IMPROVE_STRAIGHTNESS`,1)}function vj(){vj=C,JPt=new hy(fmt,0),XPt=new hy(Ppt,1),YPt=new hy(BG,2)}function iPe(e,t){if(t.a)throw E(new Ap(eut));RE(e.a,t),t.a=e,!e.j&&(e.j=t)}function aPe(e){var t;if(!tN(e))throw E(new Cf);return e.e=1,t=e.d,e.d=null,t}function yj(e){var t;return qb(e)&&(t=0-e,!isNaN(t))?t:LN(EP(e))}function oPe(e,t){var n=P(OA(e.e,t),393);return n?(tye(n),n.e):null}function bj(e,t){var n=xj(e,t,0);return n==-1?!1:(kA(e,n),!0)}function sPe(e){var t;return fD(e),t=V(Z9,lW,30,0,15,1),Ph(e.a,new tae(t)),t}function cPe(e,t,n){var r;return fD(e),r=new ke,r.a=t,e.a.Nb(new gue(r,n)),r.a}function xj(e,t,n){for(;n<e.c.length;++n)if(OD(t,e.c[n]))return n;return-1}function lPe(e,t,n,r,i){return yD(e),yD(t),yD(n),yD(r),yD(i),new kxe(e,t,r)}function uPe(e,t){Rg();var n=Kk(e),r=Kk(t);return!!n&&!!r&&!FKe(n.k,r.k)}function dPe(e,t){return pT(),M(e,new Gy(t,G(t.e.c.length+t.g.c.length)))}function fPe(e,t){return pT(),M(e,new Gy(t,G(t.e.c.length+t.g.c.length)))}function pPe(e,t){return new cve(t,nw(sS(t.e),t.f.a+e,t.f.b+e),(XS(),!1))}function Sj(e,t){return OD(t,qT(e.f,0))||OD(t,qT(e.f,1))||OD(t,qT(e.f,2))}function Cj(e,t){if(t<0)throw E(new Xp(vht+t));return Pke(e,t+1),qT(e.j,t)}function wj(){wj=C,CZ=new F_(`XY`,0),SZ=new F_(`X`,1),wZ=new F_(`Y`,2)}function Tj(){Tj=C,b4=new Ov(`INPUT_ORDER`,0),x4=new Ov(`PORT_DEGREE`,1)}function Ej(e){return e.b||(e.b=new Dbe(e,z7,e),!e.a&&(e.a=new Nw(e,e))),e.b}function Dj(e,t){var n=P(t,682),r=n.Yk();return!r&&n.al(r=new oOe(e,t)),r}function Oj(e,t){var n=P(t,680),r=n.ui();return!r&&n.xi(r=new ede(e,t)),r}function kj(e){return P(K(P(qT(e.j,0),12),(Y(),P1)),12)}function Aj(e,t){var n;this.f=e,this.b=t,n=P(sD(e.b,t),262),this.c=n?n.b:null}function mPe(){fT(),this.b=new Qd,this.f=new Qd,this.g=new Qd,this.e=new Qd}function jj(e){iS(this),this.g=e?yO(e,e.ge()):null,this.f=e,nO(this),this.he()}function hPe(e){var t=e.hj();t!=null&&e.d!=-1&&P(t,94).uh(e),e.i&&e.i.mj()}function Mj(e){var t,n=e.length;return t=V(K9,CU,30,n,15,1),Fxe(e,0,n,t,0),t}function Nj(e){Aye();var t=e+128,n=hyt[t];return!n&&(n=hyt[t]=new Jie(e)),n}function gPe(e){return khe(e.d.a.e.g,e.b),UC(e.c!=e.d.a.d),e.a=e.c,e.c=e.c.a,e.a}function _Pe(e){WC(!!e.c),khe(e.f.g,e.d),e.c.Qb(),e.c=null,e.b=gze(e),e.d=e.f.g}function vPe(e,t){ixt=new Ze,rxt=t,sZ=e,P(sZ.b,68),KMe(sZ,ixt,null),dit(sZ)}function Pj(){Pj=C,eZ=new O_(`TOP`,0),$X=new O_(zW,1),QX=new O_(gut,2)}function Fj(){Fj=C,t1=new vv(BG,0),n1=new vv(`TOP`,1),e1=new vv(gut,2)}function Ij(){Ij=C,uyt=eS(JU,JU,524287),dyt=eS(0,0,XU),fyt=xje(1),xje(2),pyt=xje(0)}function yPe(e){var t;return e.Lh()||(t=QE(e.Ah())-e.gi(),e.Xh().Kk(t)),e.wh()}function bPe(e){var t=hM(BN(e,32));return t??=(tL(e),hM(BN(e,32))),t}function xPe(e,t){var n=NI(e.d,t);return n>=0?EL(e,n,!0,!0):jz(e,t,!0)}function SPe(e,t){nT(P(P(e.f,26).mf((vH(),r8)),102))&&LUe(wCe(P(e.f,26)),t)}function CPe(e,t){wM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function wPe(e,t){TM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function TPe(e,t){CM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function EPe(e,t){vM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function DPe(e){(this.q?this.q:(QD(),QD(),EX)).zc(e.q?e.q:(QD(),QD(),EX))}function OPe(e,t,n){var r=e.g[t];return AS(e,t,e.Xi(t,n)),e.Pi(t,n,r),e.Li(),r}function Lj(e,t){var n=e.bd(t);return n>=0?(e.ed(n),!0):!1}function kPe(e){var t;return e.d!=e.r&&(t=aR(e),e.e=!!t&&t.jk()==B_t,e.d=t),e.e}function APe(e,t){var n;for(nD(e),nD(t),n=!1;t.Ob();)n|=e.Ec(t.Pb());return n}function Rj(e,t){var n=P(sD(e.e,t),393);return n?(hfe(e,n),n.e):null}function jPe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function zj(e,t){var n,r;return hI(e),r=new Gje(t,e.a),n=new Qme(r),new JT(e,n)}function Bj(e,t){var n=e.a[t],r=(SP(),nX)[typeof n];return r?r(n):wHe(typeof n)}function MPe(e,t){var n,r,i=t.c.i;n=P(sD(e.f,i),60),r=n.d.c-n.e.c,ULe(t.a,r,0)}function Vj(e,t,n){var r=10,i;for(i=0;i<n-1;i++)t<r&&(e.a+=`0`),r*=10;e.a+=t}function NPe(e,t){var n;for(++e.d,++e.c[t],n=t+1;n<e.a.length;)++e.a[n],n+=n&-n}function Hj(e){var t=e.b.c.length==0?null:qT(e.b,0);return t!=null&&iN(e,0),t}function PPe(e){switch(e.g){case 0:return kH;case 1:return vU;default:return 0}}function FPe(e){return YYe(e,(Ij(),pyt))<0?-Vfe(EP(e)):e.l+e.m*ZU+e.h*QU}function Uj(e){return e.__elementTypeCategory$==null?10:e.__elementTypeCategory$}function IPe(e,t){return j(t,103)&&(P(t,19).Bb&sW)!=0?new ix(t,e):new YN(t,e)}function LPe(e,t){return j(t,103)&&(P(t,19).Bb&sW)!=0?new ix(t,e):new YN(t,e)}function RPe(e,t,n){return DS(new k(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)==(yD(t),t)}function zPe(e,t,n,r){if(!e)throw E(new $p(VB(t,U(O(RY,1),PH,1,5,[n,r]))))}function BPe(e){if(!e.e)throw E(new Cf);return e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function VPe(e){if(!e.c)throw E(new Cf);return e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function HPe(e){var t,n;if(e.a){n=null;do t=e.a,e.a=null,n=C1e(t,n);while(e.a);e.a=n}}function UPe(e){var t,n;if(e.b){n=null;do t=e.b,e.b=null,n=C1e(t,n);while(e.b);e.b=n}}function WPe(e){var t;for(++e.a,t=e.c.a.length;e.a<t;++e.a)if(e.c.b[e.a])return}function GPe(e,t){for(var n=0;e.e!=e.i.gc();)Dxe(t,gL(e),G(n)),n!=kH&&++n}function KPe(e,t){for(;t[0]<e.length&&Qb(` \r
10
+ `&&e.lineWrapping&&(r&&=Mi.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:fi.of([` `])}),n)return Us(e,n,r,o);if(r&&!Gs(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Ere(i.facet(ms).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function Us(e,t,n,r=-1){if(qa.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(qa.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&bo(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&bo(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&bo(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Fre(e,t,n);return e.state.facet(Yo).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Fre(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Rs(i.facet(ms).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:Mi.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&ure(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?Mi.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Ws(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function Ire(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new jre(n,r)),(i!=n||a!=r)&&t.push(new jre(i,a))),t}function Lre(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?Mi.single(n+t,r+t):null}function Gs(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var Rre=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,qa.safari&&e.contentDOM.addEventListener(`input`,()=>null),qa.gecko&&Zre(e.contentDOM.ownerDocument)}handleEvent(e){!Wre(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=zre(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Js.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),qa.android&&qa.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return qa.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=qs.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||Bre.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,bo(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:qa.safari&&!qa.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function Ks(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){is(n.state,e)}}}function zre(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Ks(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Ks(t.value,r))}}for(let e in $s)n(e).handlers.push($s[e]);for(let e in ec)n(e).observers.push(ec[e]);return t}var qs=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],Bre=`dthko`,Js=[16,17,18,20,91,92,224,225],Ys=6;function Xs(e){return Math.max(0,e)*.7+8}function Zs(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var Vre=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=_o(e.contentDOM),this.atoms=e.state.facet(ms).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ca.allowMultipleSelections)&&Hre(e,t),this.dragging=Ure(e,t)&&cc(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Zs(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=vs(this.view);e.clientX-s.left<=r+Ys?t=-Xs(r-e.clientX):e.clientX+s.right>=a-Ys&&(t=Xs(e.clientX-a)),e.clientY-s.top<=i+Ys?n=-Xs(i-e.clientY):e.clientY+s.bottom>=o-Ys&&(n=Xs(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Ere(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function Hre(e,t){let n=e.state.facet(Wo);return n.length?n[0](t):qa.mac?t.metaKey:t.ctrlKey}function Qs(e,t){let n=e.state.facet(Go);return n.length?n[0](t):qa.mac?!t.altKey:!t.ctrlKey}function Ure(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=io(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function Wre(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Ss.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var $s=Object.create(null),ec=Object.create(null),tc=qa.ie&&qa.ie_version<15||qa.ios&&qa.webkit_version<604;function Gre(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),rc(e,n.value)},50)}function nc(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function rc(e,t){t=nc(e.state,Zo,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(uc!=null&&n.selection.ranges.every(e=>e.empty)&&uc==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:Mi.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Mi.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}ec.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},ec.wheel=ec.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},$s.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),ec.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},ec.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},$s.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(Ko))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=qre(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new Vre(e,t,n,r)),r&&e.observer.ignore(()=>{Rne(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function ic(e,t,n,r){if(r==1)return Mi.cursor(t,n);if(r==2)return yre(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,Mi.range(a,o)}}var Kre=qa.ie&&qa.ie_version<=11,ac=null,oc=0,sc=0;function cc(e){if(!Kre)return e.detail;let t=ac,n=sc;return ac=e,sc=Date.now(),oc=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(oc+1)%3:1}function qre(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=cc(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=ic(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=ic(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?Mi.range(i,a,l.assoc):Mi.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=Jre(i,s.pos))?c:o?i.addRange(l):Mi.create([l])}}}function Jre(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Mi.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}$s.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=Mi.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,nc(e.state,Qo,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},$s.dragend=e=>(e.inputState.draggedContent=null,!1);function lc(e,t,n,r){if(n=nc(e.state,Zo,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&Qs(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}$s.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&lc(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return lc(e,t,n,!0),!0}return!1},$s.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=tc?null:t.clipboardData;return n?(rc(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(Gre(e),!1)};function Yre(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function Xre(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:nc(e,Qo,t.join(e.lineBreak)),ranges:n,linewise:r}}var uc=null;$s.copy=$s.cut=(e,t)=>{if(!oo(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=Xre(e.state);if(!n&&!i)return!1;uc=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=tc?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(Yre(e,n),!1)};var dc=$i.define();function fc(e,t){let n=[];for(let r of e.facet(Xo)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:dc.of(!0)}):null}function pc(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=fc(e.state,t);n?e.dispatch(n):e.update([])}},10)}ec.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),pc(e)},ec.blur=e=>{e.observer.clearSelectionRange(),pc(e)},ec.compositionstart=ec.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},ec.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,qa.chrome&&qa.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},ec.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},$s.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return Us(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(qa.chrome&&qa.android&&(n=qs.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return qa.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),qa.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>ec.compositionend(e,t),20),!1};var mc=new Set;function Zre(e){mc.has(e)||(mc.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var hc=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],gc=!1;function _c(){gc=!1}var Qre=class{constructor(e){this.lineWrapping=e,this.doc=fi.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return hc.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=hc.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},$re=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},vc=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?Qa.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof no?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},yc=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(yc||={}),bc=.001,xc=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>bc&&(gc=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,yc.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,yc.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,yc.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=rie.build(n.setDoc(a),e,l,u);i=Sc(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new wc(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new tie(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function Sc(e,t){return e==t?e:(e.constructor!=t.constructor&&(gc=!0),t)}xc.prototype.size=1;var eie=$a.replace({}),Cc=class extends xc{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new vc(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new vc(r,0,n,this.spaceAbove,eie):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,yc.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},wc=class e extends Cc{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new vc(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof Tc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Tc?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):xc.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},Tc=class e extends xc{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new vc(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new vc(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==yc.ByHeight)return this.blockAt(e,n,r,i);if(t==yc.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new vc(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new vc(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new vc(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return xc.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=bc&&(s=-2);let c=new wc(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=xc.of(r);return(s<0||Math.abs(c.height-this.height)>=bc||Math.abs(s-this.heightMetrics(t,n).perLine)>=bc)&&(gc=!0),Sc(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},tie=class extends xc{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==yc.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==yc.ByPosNoHeight?yc.ByPosNoHeight:yc.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,yc.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&Ec(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),Ec(i,e)}return xc.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?xc.of(this.break?[e,null,t]:[e,t]):(this.left=Sc(this.left,e),this.right=Sc(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function Ec(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Tc&&(r=e[t+1])instanceof Tc&&e.splice(t-1,3,new Tc(n.length+1+r.length))}var nie=5,rie=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof wc?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new wc(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new Cc(a,r,n)):(a||i||r>=nie)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new wc(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Tc(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof wc)return e;let t=new wc(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof wc)&&!this.isCovered?this.nodes.push(new wc(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof wc&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return pa.spans(n,r,i,a,0),a.finish(r)}};function iie(e,t,n){let r=new aie;return pa.compare(e,t,n,r,0),r.changes}var aie=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&ro(e,t,this.changes,5)}};function oie(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function Dc(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function sie(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var Oc=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return $a.replace({widget:new cie(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},cie=class extends Za{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},kc=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Pc,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Do.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(us).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new Qre(n),this.stateDeco=Fc(t),this.heightMap=xc.empty().applyChanges(this.stateDeco,fi.empty,this.heightOracle.setDoc(t.doc),[new bs(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=$a.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new Ac(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Pc:new uie(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ic(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=Fc(this.state);let r=e.changedRanges,i=bs.extendWithRanges(r,iie(n,this.stateDeco,e?e.changes:wi.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);_c(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||gc)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Kne)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?Do.RTL:Do.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=ho(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=_o(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Co(this.scrollParent||e.win);let m=(this.printing?sie:oie)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!Dc(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),_c();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?xc.empty().applyChanges(this.stateDeco,fi.empty,this.heightOracle,[new bs(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new $re(n.from,i))}gc&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new Ac(r.lineAt(a-n*1e3,yc.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,yc.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,yc.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new Ac(r.lineAt(o-1e3/2,yc.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,yc.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Ac(this.heightMap.lineAt(n,yc.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,yc.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,yc.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,yc.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new Oc(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=Do.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=lie(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(Mi.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new Oc(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=Qa.Text)return;let i=jc(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=Nc(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=Mc(i,n),l=Mc(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=Nc(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=Mc(i,f),l=Mc(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=Nc(r,n)-Nc(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){Oc.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=$a.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];pa.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ic(this.heightMap.lineAt(e,yc.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Ic(this.heightMap.lineAt(this.scaler.fromDOM(e),yc.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ic(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Ac=class{constructor(e,t){this.from=e,this.to=t}};function jc(e,t,n){let r=[],i=e,a=0;return pa.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function Mc({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function Nc(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function lie(e,t){for(let n of e)if(t(n))return n}var Pc={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function Fc(e){let t=e.facet(ds).filter(e=>typeof e!=`function`),n=e.facet(ps).filter(e=>typeof e!=`function`);return n.length&&t.push(pa.join(n)),t}var uie=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,yc.ByPos,e,0,0).top,o=t.lineAt(i,yc.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}};function Ic(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new vc(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>Ic(e,t)):e._content)}var Lc=Fi.define({combine:e=>e.join(` `)}),Rc=Fi.define({combine:e=>e.indexOf(!0)>-1}),zc=Aa.newName(),Bc=Aa.newName(),Vc=Aa.newName(),Hc={"&light":`.`+Bc,"&dark":`.`+Vc};function Uc(e,t,n){return new Aa(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var die=Uc(`.`+zc,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},Hc),fie={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Wc=qa.ie&&qa.ie_version<=11,Gc=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Lne,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(qa.ie&&qa.ie_version<=11||qa.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&qa.android&&e.constructor.EDIT_CONTEXT!==!1&&!(qa.chrome&&qa.chrome_version<126)&&(this.editContext=new Jc(e),e.state.facet(as)&&(e.contentDOM.editContext=this.editContext.editContext)),Wc&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(as)?n.root.activeElement!=this.dom:!oo(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(qa.ie&&qa.ie_version<=11||qa.android&&qa.chrome)&&!n.state.selection.main.empty&&r.focusNode&&co(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=io(e.root);if(!t)return!1;let n=qa.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&pie(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=oo(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&So(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,fie),Wc&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Wc&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&bo(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&oo(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Mre(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Pre(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!Gs(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=Kc(t,e.previousSibling||e.target.previousSibling,-1),r=Kc(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(as)!=e.state.facet(as)&&(e.view.contentDOM.editContext=e.state.facet(as)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function Kc(e,t,n){for(;t;){let r=Ss.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function qc(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return co(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function pie(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return qc(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?qc(e,n):null}var Jc=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=Ws(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=Mi.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));Gs(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:fi.of(n.text.slice(l.from,l.toB).split(`
11
+ `))};if((qa.mac||qa.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:fi.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Us(e,u,Mi.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push($a.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:rs.of($a.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=io(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},Yc=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||xo(e.parent)||document,this.viewState=new kc(this,e.state||ca.create(e)),e.scrollTo&&e.scrollTo.is(ns)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(os).map(e=>new cs(e));for(let e of this.plugins)e.update(this);this.observer=new Gc(this),this.inputState=new Rre(this),this.inputState.ensureHandlers(this.plugins),this.docView=new cre(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof ta?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);i=t.state}if(this.destroyed){this.viewState.state=i;return}let a=this.hasFocus,o=0,s=null;e.some(e=>e.annotation(dc))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,s=fc(i,a),s||(o=1));let c=this.observer.delayedAndroidKey,l=null;if(c?(this.observer.clearDelayedAndroidKey(),l=this.observer.readChange(),(l&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(l=null)):this.observer.clear(),i.facet(ca.phrases)!=this.state.facet(ca.phrases))return this.setState(i);r=xs.create(this,i,e),r.flags|=o;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&=u.map(t.changes),t.scrollIntoView){let{main:e}=t.state.selection;u=new ts(e.empty?e:Mi.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(ns)&&(u=e.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=Zc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ys)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(r.startState.facet(Lc)!=r.state.facet(Lc)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(Jo))try{e(r)}catch(e){is(this.state,e,`update listener`)}(s||l)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),l&&!Pre(this,l)&&c.force&&bo(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new kc(this,e),this.plugins=e.facet(os).map(e=>new cs(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new cre(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(os),n=e.state.facet(os);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new cs(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){is(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(Co(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return is(this.state,e),Xc}}),l=xs.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=Xc)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){is(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Jo))e(t)}get themeClasses(){return zc+` `+(this.state.facet(Rc)?Vc:Bc)+` `+this.state.facet(Lc)}updateAttrs(){let e=Qc(this,ls,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(as)?`true`:`false`,class:`cm-content`,style:`${qa.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),Qc(this,us,t);let n=this.observer.ignore(()=>{let n=jne(this.contentDOM,this.contentAttrs,t),r=jne(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(ys);let t=this.state.facet(e.cspNonce);Aa.mount(this.root,this.styleModules.concat(die).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return zs(this,e,Cre(this,e,t,n))}moveByGroup(e,t){return zs(this,e,Cre(this,e,t,t=>wre(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return Mi.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Sre(this,e,t,n)}moveVertically(e,t,n){return zs(this,e,Tre(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Vs(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Vs(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[Io.find(i,e-r.from,-1,t)];return mo(n,a.dir==Do.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet($o)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>mie)return Ho(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Lo(r.isolates,n=gs(this,e))))return r.order;n||=gs(this,e);let r=Une(e.text,t,n);return this.bidiCache.push(new Zc(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||qa.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Rne(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return ns.of(new ts(typeof e==`number`?Mi.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return ns.of(new ts(Mi.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ss.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ss.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Aa.newName(),r=[Lc.of(n),ys.of(Uc(`.${n}`,e))];return t&&t.dark&&r.push(Rc.of(!0)),r}static baseTheme(e){return Wi.lowest(ys.of(Uc(`.`+zc,e,Hc)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&Ss.get(t)||Ss.get(e))?.root?.view||null}};Yc.styleModule=ys,Yc.inputHandler=Yo,Yc.clipboardInputFilter=Zo,Yc.clipboardOutputFilter=Qo,Yc.scrollHandler=es,Yc.focusChangeEffect=Xo,Yc.perLineTextDirection=$o,Yc.exceptionSink=qo,Yc.updateListener=Jo,Yc.editable=as,Yc.mouseSelectionStyle=Ko,Yc.dragMovesSelection=Go,Yc.clickAddsSelectionRange=Wo,Yc.decorations=ds,Yc.blockWrappers=fs,Yc.outerDecorations=ps,Yc.atomicRanges=ms,Yc.bidiIsolatedRanges=hs,Yc.scrollMargins=_s,Yc.darkTheme=Rc,Yc.cspNonce=Fi.define({combine:e=>e.length?e[0]:``}),Yc.contentAttributes=us,Yc.editorAttributes=ls,Yc.lineWrapping=Yc.contentAttributes.of({class:`cm-lineWrapping`}),Yc.announce=ea.define();var mie=4096,Xc={},Zc=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:Do.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function Qc(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Ja(a,n)}return n}var hie=qa.mac?`mac`:qa.windows?`win`:qa.linux?`linux`:`key`;function gie(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function $c(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var _ie=Wi.default(Yc.domEventHandlers({keydown(e,t){return xie(vie(t.state),e,t,`editor`)}})),el=Fi.define({enables:_ie}),tl=new WeakMap;function vie(e){let t=e.facet(el),n=tl.get(t);return n||tl.set(t,n=bie(t.reduce((e,t)=>e.concat(t),[]))),n}var nl=null,yie=4e3;function bie(e,t=hie){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>gie(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=nl={view:t,prefix:n,scope:e};return setTimeout(()=>{nl==r&&(nl=null)},yie),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,rl))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var rl=null;function xie(e,t,n,r){rl=t;let i=Ene(t),a=bi(yi(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;nl&&nl.view==n&&nl.scope==r&&(o=nl.prefix+` `,Js.indexOf(t.keyCode)<0&&(c=!0,nl=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+$c(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(qa.windows&&t.ctrlKey&&t.altKey)&&!(qa.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=Ma[t.keyCode])&&p!=i?(d(f[o+$c(p,t,!0)])||t.shiftKey&&(m=Na[t.keyCode])!=i&&m!=p&&d(f[o+$c(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+$c(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),rl=null,s}/x/.unicode;function Sie(){return il}var Cie=$a.line({class:`cm-activeLine`}),il=ss.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(Cie.range(i.from)),t=i.from)}return $a.set(n)}},{decorations:e=>e.decorations}),al=`-10000px`,ol=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function sl(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var cl=Fi.define({combine:e=>({position:qa.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||sl})}),ll=new WeakMap,ul=ss.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(cl);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new ol(e,dl,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(cl);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=al,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(qa.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=vs(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(cl).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=al;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=ll.get(c)??d.bottom-d.top,g=c.offset||Eie,_=this.view.textDirection==Do.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=al;continue}ll.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,wie(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,wie(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=al}},{eventObservers:{scroll(){this.maybeMeasure()}}});function wie(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var Tie=Yc.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),Eie={x:0,y:0},dl=Fi.define({enables:[ul,Tie]}),fl=Fi.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),Die=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new ol(e,fl,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},pl=dl.compute([fl],e=>{let t=e.facet(fl);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:Die.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),ml=class{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==Do.RTL?-1:1;i=t.x<n.left?-o:o}let a=this.source(e,r,i);if(a?.then){let t=this.pending={pos:r};a.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>is(e.state,t,`hover tooltip`))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(ul),t=e?e.manager.tooltips.findIndex(e=>e.create==Die.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&n&&!gl(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!_l(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},hl=4;function gl(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-hl&&t.clientX<=r+hl&&t.clientY>=i-hl&&t.clientY<=a+hl}function _l(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function Oie(e,t={}){let n=ea.define(),r=Vi.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,Si.TrackDel);if(e!=null){let i=Object.assign(Object.create(null),n);i.pos=e,i.end!=null&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(Aie)&&(e=[]);return e},provide:e=>fl.from(e)});return{active:r,extension:[r,ss.define(i=>new ml(i,e,r,n,t.hoverTime||300)),pl]}}function kie(e,t){let n=e.plugin(ul);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var Aie=ea.define(),jie=Fi.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}}),vl=ss.fromClass(class{constructor(e){this.input=e.state.facet(xl),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(jie);this.top=new yl(e,!0,t.topContainer),this.bottom=new yl(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(jie);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new yl(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new yl(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(xl);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Yc.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),yl=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`,this.dom.style[this.top?`top`:`bottom`]=`0`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=bl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=bl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function bl(e){let t=e.nextSibling;return e.remove(),t}var xl=Fi.define({enables:vl}),Sl=class extends ua{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Sl.prototype.elementClass=``,Sl.prototype.toDOM=void 0,Sl.prototype.mapMode=Si.TrackBefore,Sl.prototype.startSide=Sl.prototype.endSide=-1,Sl.prototype.point=!0;var Cl=Fi.define(),Mie=Fi.define(),wl=Fi.define(),Tl=Fi.define({combine:e=>e.some(e=>e)});function Nie(e){let t=[Pie];return e&&e.fixed===!1&&t.push(Tl.of(!0)),t}var Pie=ss.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(wl).map(t=>new Iie(e,t)),this.fixed=!e.state.facet(Tl);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Tl)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=pa.iter(this.view.state.facet(Cl),this.view.viewport.from),r=[],i=this.gutters.map(e=>new Dl(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==Qa.Text&&t){El(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==Qa.Text){El(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(wl),n=e.state.facet(wl),r=e.docChanged||e.heightChanged||e.viewportChanged||!pa.eq(e.startState.facet(Cl),e.state.facet(Cl),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new Iie(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Yc.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Do.LTR?{left:r,right:i}:{right:r,left:i}})});function Fie(e){return Array.isArray(e)?e:[e]}function El(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var Dl=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=pa.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new Lie(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];El(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(Mie)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Iie=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=Fie(t.markers(e)),t.initialSpacer&&(this.spacer=new Lie(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=Fie(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!pa.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Lie=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Rie(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function Rie(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var zie=Fi.define(),Bie=Fi.define(),Ol=Fi.define({combine(e){return la(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),kl=class extends Sl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Al(e,t){return e.state.facet(Ol).formatNumber(t,e.state)}var Vie=wl.compute([Ol],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(zie)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new kl(Al(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(Bie)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Ol)!=e.state.facet(Ol),initialSpacer(e){return new kl(Al(e,Uie(e.state.doc.lines)))},updateSpacer(e,t){let n=Al(t.view,Uie(t.view.state.doc.lines));return n==e.number?e:new kl(n)},domEventHandlers:e.facet(Ol).domEventHandlers,side:`before`}));function Hie(e={}){return[Ol.of(e),Nie(),Vie]}function Uie(e){let t=9;for(;t<e;)t=t*10+9;return t}var Wie=1024,Gie=0,jl=class{constructor(e,t){this.from=e,this.to=t}},Ml=class{constructor(e={}){this.id=Gie++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=Pl.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Ml.closedBy=new Ml({deserialize:e=>e.split(` `)}),Ml.openedBy=new Ml({deserialize:e=>e.split(` `)}),Ml.group=new Ml({deserialize:e=>e.split(` `)}),Ml.isolate=new Ml({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),Ml.contextHash=new Ml({perNode:!0}),Ml.lookAhead=new Ml({perNode:!0}),Ml.mounted=new Ml({perNode:!0});var Nl=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[Ml.mounted.id]}},Kie=Object.create(null),Pl=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Kie,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(Ml.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(Ml.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};Pl.none=new Pl(``,Object.create(null),0,8);var qie=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new Pl(e.name,r,e.id,e.flags):e)}return new e(n)}},Fl=new WeakMap,Il=new WeakMap,Ll;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(Ll||={});var Rl=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=Nl.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new Zl(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new Zl(Fl.get(this)||this.topNode);return r.moveTo(e,t),Fl.set(this,r._tree),r}get topNode(){return new Ul(this,0,0,null)}resolve(e,t=0){let n=Vl(Fl.get(this)||this.topNode,e,t,!1);return Fl.set(this,n),n}resolveInner(e,t=0){let n=Vl(Il.get(this)||this.topNode,e,t,!0);return Il.set(this,n),n}resolveStack(e,t=0){return Xl(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&Ll.IncludeAnonymous)>0;for(let e=this.cursor(a|Ll.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:tu(Pl.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(Pl.none,t,n,r)))}static build(e){return Yie(e)}};Rl.empty=new Rl(Pl.none,[],[],0);var zl=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},Bl=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Pl.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(Jie(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function Jie(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function Vl(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof Ul&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Ll.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof Ul&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var Hl=class{cursor(e=0){return new Zl(this,e)}getChild(e,t=null,n=null){let r=Wl(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return Wl(this,e,t,n)}resolve(e,t=0){return Vl(this,e,t,!1)}resolveInner(e,t=0){return Vl(this,e,t,!0)}matchContext(e){return Gl(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},Ul=class e extends Hl{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&Ll.EnterBracketed&&l instanceof Rl&&(d=Nl.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!Jie(i,r,u,u+l.length))){if(l instanceof Bl){if(a&Ll.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new ql(new Kl(o,l,t,u),null,e)}else if(a&Ll.IncludeAnonymous||!l.type.isAnonymous||Ql(l)){let s;if(!(a&Ll.IgnoreMounts)&&(s=Nl.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&Ll.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&Ll.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&Ll.IgnoreOverlays)&&(i=Nl.get(this._tree))&&i.overlay){let a=t-this.from,o=r&Ll.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Wl(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function Gl(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var Kl=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},ql=class e extends Hl{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&Ll.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new Rl(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Jl(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof Ul&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Yl(i,n)}var Yl=class{constructor(e,t){this.heads=e,this.node=t}get next(){return Jl(this.heads)}};function Xl(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof Ul?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=Nl.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new Ul(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(Vl(o,t,n,!1))}}return i?Jl(i):r}var Zl=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Ll.EnterBracketed,e instanceof Ul)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Ul?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Ll.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ll.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ll.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&Ll.IncludeAnonymous||e instanceof Bl||!e.type.isAnonymous||Ql(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new ql(this.buffer,t,this.stack[e]);return this.bufferNode=new ql(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Gl(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return Gl(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function Ql(e){return e.children.some(e=>e instanceof Bl||!e.type.isAnonymous||Ql(e))}function Yie(e){let{buffer:t,nodeSet:n,maxBufferLength:r=Wie,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new zl(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:ee,size:te}=o,ne=l,C=c;if(te<0)if(o.next(),te==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(te==-3){c=x;return}else if(te==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${te}`);let re=s[x],ie,ae,oe=S-e;if(ee-S<=r&&(ae=h(o.pos-t,y))){let t=new Uint16Array(ae.size-ae.skip),r=o.pos-ae.size,i=t.length;for(;o.pos>r;)i=g(ae.start,t,i);ie=new Bl(t,ee-ae.start,n),oe=ae.start-e}else{let e=o.pos-te;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=ee;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,ne,C),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,ne,C),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(re,C);ie=tu(re,t,n,0,t.length,0,ee-S,e,e)}else ie=m(re,t,n,ee-S,ne-ee,C)}_.push(ie),v.push(oe)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new Bl(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof Rl){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(Ml.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[Ml.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[Ml.lookAhead,i];o=o?[e].concat(o):[e]}return new Rl(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new Rl(s[e.topID],_.reverse(),v.reverse(),y)}var $l=new WeakMap;function eu(e,t){if(!e.isAnonymous||t instanceof Bl||t.type!=e)return 1;let n=$l.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Rl)){n=1;break}n+=eu(e,r)}$l.set(t,n)}return n}function tu(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=eu(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=eu(e,t[s]);for(s++;s<i;s++){let n=eu(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(tu(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var nu=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},ru=class{startParse(e,t,n){return typeof e==`string`&&(e=new iu(e)),n=n?n.length?n.map(e=>new jl(e.from,e.to)):[new jl(0,0)]:[new jl(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},iu=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new Ml({perNode:!0});var T=0,au=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=T++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new ou(e);return e=>e.modified.indexOf(t)>-1?e:ou.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},Xie=0,ou=class e{constructor(e){this.name=e,this.instances=[],this.id=Xie++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&Zie(n,e.modified));if(r)return r;let i=[],a=new au(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=Qie(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function Zie(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function Qie(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function su(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new cu(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return $ie.add(t)}var $ie=new Ml({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new cu(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),cu=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};cu.empty=new cu([],2,null);function lu(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function eae(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function tae(e,t,n,r=0,i=e.length){let a=new nae(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var nae=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=rae(e)||cu.empty,u=eae(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(Ml.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function rae(e){let t=e.type.prop($ie);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var uu=au.define,du=uu(),fu=uu(),iae=uu(fu),aae=uu(fu),pu=uu(),mu=uu(pu),hu=uu(pu),gu=uu(),_u=uu(gu),vu=uu(),yu=uu(),bu=uu(),xu=uu(bu),Su=uu(),Cu={comment:du,lineComment:uu(du),blockComment:uu(du),docComment:uu(du),name:fu,variableName:uu(fu),typeName:iae,tagName:uu(iae),propertyName:aae,attributeName:uu(aae),className:uu(fu),labelName:uu(fu),namespace:uu(fu),macroName:uu(fu),literal:pu,string:mu,docString:uu(mu),character:uu(mu),attributeValue:uu(mu),number:hu,integer:uu(hu),float:uu(hu),bool:uu(pu),regexp:uu(pu),escape:uu(pu),color:uu(pu),url:uu(pu),keyword:vu,self:uu(vu),null:uu(vu),atom:uu(vu),unit:uu(vu),modifier:uu(vu),operatorKeyword:uu(vu),controlKeyword:uu(vu),definitionKeyword:uu(vu),moduleKeyword:uu(vu),operator:yu,derefOperator:uu(yu),arithmeticOperator:uu(yu),logicOperator:uu(yu),bitwiseOperator:uu(yu),compareOperator:uu(yu),updateOperator:uu(yu),definitionOperator:uu(yu),typeOperator:uu(yu),controlOperator:uu(yu),punctuation:bu,separator:uu(bu),bracket:xu,angleBracket:uu(xu),squareBracket:uu(xu),paren:uu(xu),brace:uu(xu),content:gu,heading:_u,heading1:uu(_u),heading2:uu(_u),heading3:uu(_u),heading4:uu(_u),heading5:uu(_u),heading6:uu(_u),contentSeparator:uu(gu),list:uu(gu),quote:uu(gu),emphasis:uu(gu),strong:uu(gu),link:uu(gu),monospace:uu(gu),strikethrough:uu(gu),inserted:uu(),deleted:uu(),changed:uu(),invalid:uu(),meta:Su,documentMeta:uu(Su),annotation:uu(Su),processingInstruction:uu(Su),definition:au.defineModifier(`definition`),constant:au.defineModifier(`constant`),function:au.defineModifier(`function`),standard:au.defineModifier(`standard`),local:au.defineModifier(`local`),special:au.defineModifier(`special`)};for(let e in Cu){let t=Cu[e];t instanceof au&&(t.name=e)}lu([{tag:Cu.link,class:`tok-link`},{tag:Cu.heading,class:`tok-heading`},{tag:Cu.emphasis,class:`tok-emphasis`},{tag:Cu.strong,class:`tok-strong`},{tag:Cu.keyword,class:`tok-keyword`},{tag:Cu.atom,class:`tok-atom`},{tag:Cu.bool,class:`tok-bool`},{tag:Cu.url,class:`tok-url`},{tag:Cu.labelName,class:`tok-labelName`},{tag:Cu.inserted,class:`tok-inserted`},{tag:Cu.deleted,class:`tok-deleted`},{tag:Cu.literal,class:`tok-literal`},{tag:Cu.string,class:`tok-string`},{tag:Cu.number,class:`tok-number`},{tag:[Cu.regexp,Cu.escape,Cu.special(Cu.string)],class:`tok-string2`},{tag:Cu.variableName,class:`tok-variableName`},{tag:Cu.local(Cu.variableName),class:`tok-variableName tok-local`},{tag:Cu.definition(Cu.variableName),class:`tok-variableName tok-definition`},{tag:Cu.special(Cu.variableName),class:`tok-variableName2`},{tag:Cu.definition(Cu.propertyName),class:`tok-propertyName tok-definition`},{tag:Cu.typeName,class:`tok-typeName`},{tag:Cu.namespace,class:`tok-namespace`},{tag:Cu.className,class:`tok-className`},{tag:Cu.macroName,class:`tok-macroName`},{tag:Cu.propertyName,class:`tok-propertyName`},{tag:Cu.operator,class:`tok-operator`},{tag:Cu.comment,class:`tok-comment`},{tag:Cu.meta,class:`tok-meta`},{tag:Cu.invalid,class:`tok-invalid`},{tag:Cu.punctuation,class:`tok-punctuation`}]);var wu=new Ml,oae=new Ml,Tu=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,ca.prototype.hasOwnProperty(`tree`)||Object.defineProperty(ca.prototype,`tree`,{get(){return Du(this)}}),this.parser=t,this.extension=[Pu.of(this),ca.languageData.of((e,t,n)=>{let r=Eu(e,t,n),i=r.type.prop(wu);if(!i)return[];let a=e.facet(i),o=r.type.prop(oae);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return Eu(e,t,n).type.prop(wu)==this.data}findRegions(e){let t=e.facet(Pu);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(wu)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(Ml.mounted);if(i){if(i.tree.prop(wu)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Rl&&r(i,e.positions[n]+t)}};return r(Du(e),0),n}get allowsNesting(){return!0}};Tu.setState=ea.define();function Eu(e,t,n){let r=e.facet(Pu),i=Du(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,Ll.ExcludeBuffers|Ll.EnterBracketed))e.type.isTop&&(i=e);return i}function Du(e){let t=e.field(Tu.state,!1);return t?t.tree:Rl.empty}var Ou=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},ku=null,Au=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],Rl.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Ou(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Rl.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(nu.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(nu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ku;ku=this;try{return e()}finally{ku=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ju(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=nu.applyChanges(r,e),i=Rl.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=ju(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ru{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=ku;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new Rl(Pl.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ku}};function ju(e,t,n){return nu.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var Mu=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=Au.create(t.facet(Pu).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};Tu.state=Vi.define({create:Mu.init,update(e,t){for(let e of t.effects)if(e.is(Tu.setState))return e.value;return t.startState.facet(Pu)==t.state.facet(Pu)?e.apply(t):Mu.init(t.state)}});var sae=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(sae=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var Nu=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,cae=ss.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Tu.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Tu.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=sae(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(Tu.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Nu?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>Nu&&Nu()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Tu.setState.of(new Mu(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>is(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Pu=Fi.define({combine(e){return e.length?e[0]:null},enables:e=>[Tu.state,cae,Yc.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),lae=Fi.define(),Fu=Fi.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function Iu(e){let t=e.facet(Fu);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function Lu(e,t){let n=``,r=e.tabSize,i=e.facet(Fu)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function uae(e,t){e instanceof ca&&(e=new Ru(e));for(let n of e.state.facet(lae)){let r=n(e,t);if(r!==void 0)return r}let n=Du(e.state);return n.length>=t?fae(e,n,t):null}var Ru=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Iu(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return Ta(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},dae=new Ml;function fae(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return pae(r,e,n)}function pae(e,t,n){for(let r=e;r;r=r.next){let e=hae(r.node);if(e)return e(_ae.create(t,n,r))}return 0}function mae(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function hae(e){let t=e.type.prop(dae);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Ml.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>bae(e,!0,1,void 0,n&&!mae(e)?t.from:void 0)}return e.parent==null?gae:null}function gae(){return 0}var _ae=class e extends Ru{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(vae(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return pae(this.context.next,this.base,this.pos)}};function vae(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function yae(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function bae(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?yae(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}Cu.meta,Cu.link,Cu.heading,Cu.emphasis,Cu.strong,Cu.strikethrough,Cu.keyword,Cu.atom,Cu.bool,Cu.url,Cu.contentSeparator,Cu.labelName,Cu.literal,Cu.inserted,Cu.string,Cu.deleted,Cu.regexp,Cu.escape,Cu.string,Cu.variableName,Cu.variableName,Cu.typeName,Cu.namespace,Cu.className,Cu.variableName,Cu.macroName,Cu.propertyName,Cu.comment,Cu.invalid;var xae=1e4,Sae=`()[]{}`,Cae=new Ml;function zu(e,t,n){let r=e.prop(t<0?Ml.openedBy:Ml.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function Bu(e){let t=e.type.prop(Cae);return t?t(e.node):e}function Vu(e,t,n,r={}){let i=r.maxScanDistance||xae,a=r.brackets||Sae,o=Du(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=zu(r.type,n,a);if(i&&r.from<r.to){let o=Bu(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return wae(e,t,n,r,o,i,a)}}return Tae(e,t,n,o,s.type,i,a)}function wae(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=Bu(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(zu(u.type,n,o))l++;else if(zu(u.type,-n,o)){if(l==0){let e=Bu(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function Tae(e,t,n,r,i,a,o){let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var Eae=Object.create(null),Dae=[Pl.none],Oae=[],kae=Object.create(null),Aae=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])Aae[e]=jae(Eae,t);function Hu(e,t){Oae.indexOf(e)>-1||(Oae.push(e),console.warn(t))}function jae(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||Cu[n];r?typeof r==`function`?t.length?t=t.map(r):Hu(n,`Modifier ${n} used at start of tag`):t.length?Hu(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:Hu(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=kae[i];if(a)return a.id;let o=kae[i]=Pl.define({id:Dae.length,name:r,props:[su({[r]:n})]});return Dae.push(o),o.id}Do.RTL,Do.LTR;var Mae=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Wu(e.state,n.from);return r.line?Nae(e):r.block?Fae(e):!1};function Uu(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var Nae=Uu(zae,0),Pae=Uu(Rae,0),Fae=Uu((e,t)=>Rae(e,t,Lae(t)),0);function Wu(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var Gu=50;function Iae(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Gu,r),o=e.sliceDoc(i,i+Gu),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*Gu?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+Gu),d=e.sliceDoc(i-Gu,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function Lae(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function Rae(e,t,n=t.selection.ranges){let r=n.map(e=>Wu(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>Iae(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function zae(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Wu(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var Ku=$i.define(),Bae=$i.define(),Vae=Fi.define(),Hae=Fi.define({combine(e){return la(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),Uae=Vi.define({create(){return $u.empty},update(e,t){let n=t.state.facet(Hae),r=t.annotation(Ku);if(r){let i=Yu.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?Xu(o,o.length,n.minDepth,i):Qae(o,t.startState.selection),new $u(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(Bae);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(ta.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Yu.fromTransaction(t),o=t.annotation(ta.time),s=t.annotation(ta.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new $u(e.done.map(Yu.fromJSON),e.undone.map(Yu.fromJSON))}});function Wae(e={}){return[Uae,Hae.of(e),Yc.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?Gae:e.inputType==`historyRedo`?Ju:null;return n?(e.preventDefault(),n(t)):!1}})]}function qu(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(Uae,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var Gae=qu(0,!1),Ju=qu(1,!1),Kae=qu(0,!0),qae=qu(1,!0),Yu=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&wi.fromJSON(t.changes),[],t.mapped&&Ci.fromJSON(t.mapped),t.startSelection&&Mi.fromJSON(t.startSelection),t.selectionsAfter.map(Mi.fromJSON))}static fromTransaction(t,n){let r=Zu;for(let e of t.startState.facet(Vae)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Zu)}static selection(t){return new e(void 0,Zu,void 0,void 0,t)}};function Xu(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Jae(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Yae(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function Xae(e,t){return e.length?t.length?e.concat(t):e:t}var Zu=[],Zae=200;function Qae(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Zae));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Xu(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Yu.selection([t])]}function $ae(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Qu(e,t){if(!e.length)return e;let n=e.length,r=Zu;for(;n;){let i=eoe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Yu.selection(r)]:Zu}function eoe(e,t,n){let r=Xae(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Zu,n);if(!e.changes)return Yu.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Yu(i,ea.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var toe=/^(input\.type|delete)($|\.)/,$u=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||toe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Jae(s.changes,t.changes))||r==`input.type.compose`)?Xu(o,o.length-1,i.minDepth,new Yu(t.changes.compose(s.changes),Xae(ea.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Zu)):Xu(o,o.length,i.minDepth,t),new e(o,Zu,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Zu;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Yae(a[a.length-1],t)?this:new e(Qae(this.done,t),this.undone,n,r)}addMapping(t){return new e(Qu(this.done,t),Qu(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Ku.of({side:e,rest:$ae(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?Zu:r.slice(0,r.length-1);return i.mapped&&(n=Qu(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Ku.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};$u.empty=new $u(Zu,Zu);var noe=[{key:`Mod-z`,run:Gae,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:Ju,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:Ju,preventDefault:!0},{key:`Mod-u`,run:Kae,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:qae,preventDefault:!0}];function ed(e,t){return Mi.create(e.ranges.map(t),e.mainIndex)}function td(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function nd({state:e,dispatch:t},n){let r=ed(e.selection,n);return r.eq(e.selection,!0)?!1:(t(td(e,r)),!0)}function rd(e,t){return Mi.cursor(t?e.to:e.from)}function id(e,t){return nd(e,n=>n.empty?e.moveByChar(n,t):rd(n,t))}function ad(e){return e.textDirectionAt(e.state.selection.main.head)==Do.LTR}var roe=e=>id(e,!ad(e)),od=e=>id(e,ad(e));function sd(e,t){return nd(e,n=>n.empty?e.moveByGroup(n,t):rd(n,t))}var ioe=e=>sd(e,!ad(e)),aoe=e=>sd(e,ad(e));typeof Intl<`u`&&Intl.Segmenter;function cd(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ld(e,t,n){let r=Du(e).resolveInner(t.head),i=n?Ml.closedBy:Ml.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;cd(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?Vu(e,r.from,1):Vu(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Mi.cursor(s,n?-1:1)}var ooe=e=>nd(e,t=>ld(e.state,t,!ad(e))),soe=e=>nd(e,t=>ld(e.state,t,ad(e)));function ud(e,t){return nd(e,n=>{if(!n.empty)return rd(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var dd=e=>ud(e,!1),fd=e=>ud(e,!0);function pd(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Yc.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function md(e,t){let n=pd(e),{state:r}=e,i=ed(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):rd(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=Yc.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(td(r,i),{effects:a}),!0}var coe=e=>md(e,!1),hd=e=>md(e,!0);function gd(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Mi.cursor(r.from+n))}return i}var loe=e=>nd(e,t=>gd(e,t,!0)),uoe=e=>nd(e,t=>gd(e,t,!1)),doe=e=>nd(e,t=>gd(e,t,!ad(e))),foe=e=>nd(e,t=>gd(e,t,ad(e))),poe=e=>nd(e,t=>Mi.cursor(e.lineBlockAt(t.head).from,1)),moe=e=>nd(e,t=>Mi.cursor(e.lineBlockAt(t.head).to,-1));function hoe(e,t,n){let r=!1,i=ed(e.selection,t=>{let i=Vu(e,t.head,-1)||Vu(e,t.head,1)||t.head>0&&Vu(e,t.head-1,1)||t.head<e.doc.length&&Vu(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Mi.range(t.anchor,a):Mi.cursor(a)});return r?(t(td(e,i)),!0):!1}var goe=({state:e,dispatch:t})=>hoe(e,t,!1);function _d(e,t){let n=ed(e.state.selection,e=>{let n=t(e);return Mi.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(td(e.state,n)),!0)}function vd(e,t){return _d(e,n=>e.moveByChar(n,t))}var _oe=e=>vd(e,!ad(e)),yd=e=>vd(e,ad(e));function bd(e,t){return _d(e,n=>e.moveByGroup(n,t))}var voe=e=>bd(e,!ad(e)),yoe=e=>bd(e,ad(e)),boe=e=>_d(e,t=>ld(e.state,t,!ad(e))),xd=e=>_d(e,t=>ld(e.state,t,ad(e)));function Sd(e,t){return _d(e,n=>e.moveVertically(n,t))}var Cd=e=>Sd(e,!1),wd=e=>Sd(e,!0);function Td(e,t){return _d(e,n=>e.moveVertically(n,t,pd(e).height))}var Ed=e=>Td(e,!1),xoe=e=>Td(e,!0),Soe=e=>_d(e,t=>gd(e,t,!0)),Coe=e=>_d(e,t=>gd(e,t,!1)),woe=e=>_d(e,t=>gd(e,t,!ad(e))),Toe=e=>_d(e,t=>gd(e,t,ad(e))),Eoe=e=>_d(e,t=>Mi.cursor(e.lineBlockAt(t.head).from)),Doe=e=>_d(e,t=>Mi.cursor(e.lineBlockAt(t.head).to)),Ooe=({state:e,dispatch:t})=>(t(td(e,{anchor:0})),!0),Dd=({state:e,dispatch:t})=>(t(td(e,{anchor:e.doc.length})),!0),Od=({state:e,dispatch:t})=>(t(td(e,{anchor:e.selection.main.anchor,head:0})),!0),kd=({state:e,dispatch:t})=>(t(td(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),koe=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),Aoe=({state:e,dispatch:t})=>{let n=zd(e).map(({from:t,to:n})=>Mi.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Mi.create(n),userEvent:`select`})),!0},joe=({state:e,dispatch:t})=>{let n=ed(e.selection,t=>{let n=Du(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Mi.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(td(e,n)),!0)};function Ad(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(td(n,Mi.create(i,i.length-1))),!0)}var Moe=e=>Ad(e,!1),Noe=e=>Ad(e,!0),Poe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Mi.create([n.main]):n.main.empty||(r=Mi.create([Mi.cursor(n.main.head)])),r?(t(td(e,r)),!0):!1};function jd(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Md(e,o,!1)):o>i&&(n=`delete.forward`,o=Md(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Md(e,i,!1),a=Md(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Mi.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?Yc.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Md(e,t,n){if(e instanceof Yc)for(let r of e.state.facet(Yc.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var Nd=(e,t,n)=>jd(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=Ta(s,a.tabSize)%Iu(a)||Iu(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=vi(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=vi(o.text,c-o.from,!1,!1)+o.from);return c}),Pd=e=>Nd(e,!1,!0),Fd=e=>Nd(e,!0,!1),Id=(e,t)=>jd(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=vi(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Ld=e=>Id(e,!1),Rd=e=>Id(e,!0),Foe=e=>jd(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Ioe=e=>jd(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Loe=e=>jd(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Roe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:fi.of([``,``])},range:Mi.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},zoe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:vi(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:vi(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Mi.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function zd(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Boe(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of zd(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Mi.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Mi.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Mi.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Voe=({state:e,dispatch:t})=>Boe(e,t,!1),Hoe=({state:e,dispatch:t})=>Boe(e,t,!0);function Bd(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of zd(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Uoe=({state:e,dispatch:t})=>Bd(e,t,!1),Woe=({state:e,dispatch:t})=>Bd(e,t,!0),Vd=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(zd(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=ed(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Hd(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Du(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Ml.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var Ud=Gd(!1),Wd=Gd(!0);function Gd(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Hd(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Ru(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=uae(s,r);for(c??=Ta(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Lu(t,c)];return o&&l.push(Lu(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:fi.of(l)},range:Mi.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function Kd(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Mi.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Goe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ru(e,{overrideIndentation:e=>n[e]??-1}),i=Kd(e,(t,i,a)=>{let o=uae(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Lu(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},Koe=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Kd(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Fu)})}),{userEvent:`input.indent`})),!0),qd=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Kd(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=Ta(r,e.tabSize),a=0,o=Lu(e,Math.max(0,i-Iu(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),Jd=e=>(e.setTabFocusMode(),!0),Yd=[{key:`Ctrl-b`,run:roe,shift:_oe,preventDefault:!0},{key:`Ctrl-f`,run:od,shift:yd},{key:`Ctrl-p`,run:dd,shift:Cd},{key:`Ctrl-n`,run:fd,shift:wd},{key:`Ctrl-a`,run:poe,shift:Eoe},{key:`Ctrl-e`,run:moe,shift:Doe},{key:`Ctrl-d`,run:Fd},{key:`Ctrl-h`,run:Pd},{key:`Ctrl-k`,run:Foe},{key:`Ctrl-Alt-h`,run:Ld},{key:`Ctrl-o`,run:Roe},{key:`Ctrl-t`,run:zoe},{key:`Ctrl-v`,run:hd}],Xd=[{key:`ArrowLeft`,run:roe,shift:_oe,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:ioe,shift:voe,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:doe,shift:woe,preventDefault:!0},{key:`ArrowRight`,run:od,shift:yd,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:aoe,shift:yoe,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:foe,shift:Toe,preventDefault:!0},{key:`ArrowUp`,run:dd,shift:Cd,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:Ooe,shift:Od},{mac:`Ctrl-ArrowUp`,run:coe,shift:Ed},{key:`ArrowDown`,run:fd,shift:wd,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:Dd,shift:kd},{mac:`Ctrl-ArrowDown`,run:hd,shift:xoe},{key:`PageUp`,run:coe,shift:Ed},{key:`PageDown`,run:hd,shift:xoe},{key:`Home`,run:uoe,shift:Coe,preventDefault:!0},{key:`Mod-Home`,run:Ooe,shift:Od},{key:`End`,run:loe,shift:Soe,preventDefault:!0},{key:`Mod-End`,run:Dd,shift:kd},{key:`Enter`,run:Ud,shift:Ud},{key:`Mod-a`,run:koe},{key:`Backspace`,run:Pd,shift:Pd,preventDefault:!0},{key:`Delete`,run:Fd,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Ld,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Rd,preventDefault:!0},{mac:`Mod-Backspace`,run:Ioe,preventDefault:!0},{mac:`Mod-Delete`,run:Loe,preventDefault:!0}].concat(Yd.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),Zd=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:ooe,shift:boe},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:soe,shift:xd},{key:`Alt-ArrowUp`,run:Voe},{key:`Shift-Alt-ArrowUp`,run:Uoe},{key:`Alt-ArrowDown`,run:Hoe},{key:`Shift-Alt-ArrowDown`,run:Woe},{key:`Mod-Alt-ArrowUp`,run:Moe},{key:`Mod-Alt-ArrowDown`,run:Noe},{key:`Escape`,run:Poe},{key:`Mod-Enter`,run:Wd},{key:`Alt-l`,mac:`Ctrl-l`,run:Aoe},{key:`Mod-i`,run:joe,preventDefault:!0},{key:`Mod-[`,run:qd},{key:`Mod-]`,run:Koe},{key:`Mod-Alt-\\`,run:Goe},{key:`Shift-Mod-k`,run:Vd},{key:`Shift-Mod-\\`,run:goe},{key:`Mod-/`,run:Mae},{key:`Alt-A`,run:Pae},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Jd}].concat(Xd),Qd=new Ml;function $d(e){return Fi.define({combine:e?t=>t.concat(e):void 0})}var qoe=new Ml,ef=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,ca.prototype.hasOwnProperty(`tree`)||Object.defineProperty(ca.prototype,`tree`,{get(){return nf(this)}}),this.parser=t,this.extension=[of.of(this),ca.languageData.of((e,t,n)=>{let r=tf(e,t,n),i=r.type.prop(Qd);if(!i)return[];let a=e.facet(i),o=r.type.prop(qoe);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return tf(e,t,n).type.prop(Qd)==this.data}findRegions(e){let t=e.facet(of);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(Qd)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(Ml.mounted);if(i){if(i.tree.prop(Qd)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof Rl&&r(i,e.positions[n]+t)}};return r(nf(e),0),n}get allowsNesting(){return!0}};ef.setState=ea.define();function tf(e,t,n){let r=e.facet(of),i=nf(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,Ll.ExcludeBuffers|Ll.EnterBracketed))e.type.isTop&&(i=e);return i}var Joe=class e extends ef{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=$d(t.languageData);return new e(n,t.parser.configure({props:[Qd.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function nf(e){let t=e.field(ef.state,!1);return t?t.tree:Rl.empty}var Yoe=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},rf=null,Xoe=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],Rl.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Yoe(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Rl.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(nu.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(nu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rf;rf=this;try{return e()}finally{rf=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Zoe(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=nu.applyChanges(r,e),i=Rl.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=Zoe(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ru{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=rf;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new Rl(Pl.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return rf}};function Zoe(e,t,n){return nu.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var E=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=Xoe.create(t.facet(of).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};ef.state=Vi.define({create:E.init,update(e,t){for(let e of t.effects)if(e.is(ef.setState))return e.value;return t.startState.facet(of)==t.state.facet(of)?e.apply(t):E.init(t.state)}});var Qoe=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(Qoe=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var af=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,$oe=ss.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(ef.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(ef.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Qoe(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(ef.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!af?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>af&&af()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:ef.setState.of(new E(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>is(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),of=Fi.define({combine(e){return e.length?e[0]:null},enables:e=>[ef.state,$oe,Yc.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),ese=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},sf=new Ml;function tse({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var nse=new Ml,cf=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=Aa.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof ef?e=>e.prop(Qd)==a.data:a?e=>e==a:void 0,this.style=lu(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new Aa(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},lf=Fi.define(),uf=Fi.define({combine(e){return e.length?[e[0]]:null}});function df(e){let t=e.facet(lf);return t.length?t:e.facet(uf)}function ff(e,t){let n=[ise],r;return e instanceof cf&&(e.module&&n.push(Yc.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(uf.of(e)):r?n.push(lf.computeN([Yc.darkTheme],t=>t.facet(Yc.darkTheme)==(r==`dark`)?[e]:[])):n.push(lf.of(e)),n}var rse=class{constructor(e){this.markCache=Object.create(null),this.tree=nf(e.state),this.decorations=this.buildDeco(e,df(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=nf(e.state),n=df(e.state),r=n!=df(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return $a.none;let n=new ma;for(let{from:r,to:i}of e.visibleRanges)tae(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=$a.mark({class:r})))},r,i);return n.finish()}},ise=Wi.high(ss.fromClass(rse,{decorations:e=>e.decorations}));Cu.meta,Cu.link,Cu.heading,Cu.emphasis,Cu.strong,Cu.strikethrough,Cu.keyword,Cu.atom,Cu.bool,Cu.url,Cu.contentSeparator,Cu.labelName,Cu.literal,Cu.inserted,Cu.string,Cu.deleted,Cu.regexp,Cu.escape,Cu.string,Cu.variableName,Cu.variableName,Cu.typeName,Cu.namespace,Cu.className,Cu.variableName,Cu.macroName,Cu.propertyName,Cu.comment,Cu.invalid;var pf=Object.create(null),ase=[Pl.none],mf=[],hf=Object.create(null),gf=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])gf[e]=ose(pf,t);function _f(e,t){mf.indexOf(e)>-1||(mf.push(e),console.warn(t))}function ose(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||Cu[n];r?typeof r==`function`?t.length?t=t.map(r):_f(n,`Modifier ${n} used at start of tag`):t.length?_f(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:_f(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=hf[i];if(a)return a.id;let o=hf[i]=Pl.define({id:ase.length,name:r,props:[su({[r]:n})]});return ase.push(o),o.id}Do.RTL,Do.LTR;var vf=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new sse(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(r==0&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&e.buffer[r-4]==0&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new yf(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new sse(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},sse=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},yf=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},bf=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function xf(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var Sf=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Cf=new Sf,cse=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=Cf,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Cf,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},wf=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Tf(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};wf.prototype.contextual=wf.prototype.fallback=wf.prototype.extend=!1;var lse=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?xf(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(Tf(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};lse.prototype.contextual=wf.prototype.fallback=wf.prototype.extend=!1;var use=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function Tf(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||dse(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function Ef(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function dse(e,t,n,r){let i=Ef(n,r,t);return i<0||Ef(n,r,e)<i}var Df=typeof process<`u`&&/\bparse\b/.test({}.LOG),Of=null;function fse(e,t,n){let r=e.cursor(Ll.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var pse=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?fse(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?fse(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof Rl){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(Ml.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},kf=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new Sf)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new Sf,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Sf,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=Nf(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(Nf(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(Nf(o,s+1),t,n,r))}return r}},mse=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new cse(t,r),this.tokens=new kf(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[vf.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new pse(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&Pf(r);if(e)return Df&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw Df&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return Df&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=Df?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(Ml.contextHash)||0)==n))return e.useNode(o,r),Df&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof Rl)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof Rl&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),Df&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),Df&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Af(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=Df?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),Df&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(Df&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)Df&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))Df&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),Df&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),Af(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),Rl.build({buffer:bf.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Of||=new WeakMap).get(e);return t||Of.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function Af(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var jf=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},Mf=class e extends ru{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=Ml[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new qie(t.map((t,i)=>Pl.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Wie;let a=xf(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(Ff),this.states=xf(e.states,Uint32Array),this.data=xf(e.stateData),this.goto=xf(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new wf(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new mse(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=Nf(n,i+2)];else if(n[i+1]==2)return Nf(n,i+2);else break;if(a==t||a==0)return Nf(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Nf(this.data,n+2);else break;r=t(Nf(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Nf(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=Ff(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new jf(e,n,r)}static deserialize(t){return new e(t)}};function Nf(e,t){return e[t]|e[t+1]<<16}function Pf(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function Ff(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var If=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Du(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(hse(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function Lf(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function Rf(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=Lf(t)+Lf(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function zf(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:Rf(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function Bf(e,t){return n=>{for(let t=Du(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}var Vf=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function Hf(e){return e.selection.main.from}function hse(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var gse=$i.define();function _se(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:Mi.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var vse=new WeakMap;function yse(e){if(!Array.isArray(e))return e;let t=vse.get(e);return t||vse.set(e,t=zf(e)),t}var Uf=ea.define(),Wf=ea.define(),bse=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=yi(e,t),r=bi(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(yi(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=yi(e,0),i=bi(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=yi(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=bi(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=yi(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=ine(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=bi(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?bi(yi(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},xse=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},Gf=Fi.define({combine(e){return la(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Sse,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Kf(e(n),t(n)),optionClass:(e,t)=>n=>Kf(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Kf(e,t){return e?t?e+` `+t:e:t}function Sse(e,t,n,r,i,a){let o=e.textDirection==Do.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var qf=ea.define();function Jf(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function Yf(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}var Xf=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(Gf);this.optionContent=Jf(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Yf(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:qf.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(Gf).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Wf.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=Yf(r.length,i,e.state.facet(Gf).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Yf(t.options.length,t.selected,this.view.state.facet(Gf).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>is(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&Zf(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(Gf).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function Cse(e,t){return n=>new Xf(n,e,t)}function Zf(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function Qf(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function wse(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(Gf);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new Vf(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new xse(n):new bse(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new Vf(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):Qf(e.completion)>Qf(c)&&(s[s.length-1]=e),c=e.completion}return s}var Tse=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,$f(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=wse(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(Gf).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,$f(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:Mse,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Ese=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(Ase,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Gf),i=(r.override||n.languageDataAt(`autocomplete`,Hf(n)).map(yse)).map(e=>(this.active.find(t=>t.source==e)||new tp(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(rp));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!Dse(i,this.active)||o?a=Tse.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new tp(e.source,0):e));for(let e of t.effects)e.is(qf)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Ose:kse}};function Dse(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var Ose={"aria-autocomplete":`list`},kse={};function $f(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var Ase=[];function ep(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(gse);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var tp=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=ep(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(Uf))i=new e(i.source,1,n.value);else if(n.is(Wf))i=new e(i.source,0);else if(n.is(rp))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Hf(e.state))}},np=class e extends tp{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=Hf(t.state);if(o>a||!r||n&2&&(Hf(t.startState)==this.from||o<this.limit))return new tp(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return jse(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new If(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??Hf(t.state)):new tp(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new tp(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function jse(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):hse(e,!0).test(i)}var rp=ea.define({map(e,t){return e.map(e=>e.map(t))}}),ip=Vi.define({create(){return Ese.start()},update(e,t){return e.update(t)},provide:e=>[dl.from(e,e=>e.tooltip),Yc.contentAttributes.from(e,e=>e.attrs)]});function ap(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(ip).active.find(e=>e.source==t.source);return r instanceof np?(typeof n==`string`?e.dispatch({..._se(e.state,n,r.from,r.to),annotations:gse.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}var Mse=Cse(ip,ap);function op(e,t=`option`){return n=>{let r=n.state.field(ip,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Gf).interactionDelay)return!1;let i=1,a;t==`page`&&(a=kie(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:qf.of(s)}),!0}}var Nse=e=>{let t=e.state.field(ip,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Gf).interactionDelay?!1:ap(e,t.open.options[t.open.selected])},sp=e=>e.state.field(ip,!1)?(e.dispatch({effects:Uf.of(!0)}),!0):!1,cp=e=>{let t=e.state.field(ip,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:Wf.of(null)}),!0)},lp=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},up=50,dp=1e3,Pse=ss.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ip).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(ip),n=e.state.facet(Gf);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ip)==t)return;let r=e.transactions.some(e=>{let t=ep(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>up&&Date.now()-n.time>dp){for(let e of n.context.abortListeners)try{e()}catch(e){is(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(Uf)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ip);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Gf).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new If(t,Hf(t),e.explicit,this.view),r=new lp(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:Wf.of(null)}),is(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Gf).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Gf),n=this.view.state.field(ip);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=Hf(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new np(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new tp(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:rp.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ip,!1);if(t&&t.tooltip&&this.view.state.facet(Gf).closeOnBlur){let n=t.open&&kie(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Wf.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Uf.of(!1)}),20),this.composing=0}}}),fp=typeof navigator==`object`&&/Win/.test(navigator.platform),Fse=Wi.highest(Yc.domEventHandlers({keydown(e,t){let n=t.state.field(ip,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(fp&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&ap(t,r),!1}})),Ise=Yc.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),pp=new class extends ua{};pp.startSide=1,pp.endSide=-1,typeof navigator==`object`&&navigator.userAgent;function mp(e={}){return[Fse,ip,Gf.of(e),Pse,Rse,Ise]}var Lse=[{key:`Ctrl-Space`,run:sp},{mac:"Alt-`",run:sp},{mac:`Alt-i`,run:sp},{key:`Escape`,run:cp},{key:`ArrowDown`,run:op(!0)},{key:`ArrowUp`,run:op(!1)},{key:`PageDown`,run:op(!0,`page`)},{key:`PageUp`,run:op(!1,`page`)},{key:`Enter`,run:Nse}],Rse=Wi.highest(el.computeN([Gf],e=>e.facet(Gf).defaultKeymap?[Lse]:[])),zse=36,hp=1,gp=2,_p=3,vp=4,Bse=5,yp=6,bp=7,xp=8,Vse=9,Hse=10,Use=11,Wse=12,Sp=13,Cp=14,Gse=15,Kse=16,qse=17,Jse=18,Yse=19,wp=20,Tp=21,Ep=22,Dp=23,Op=24;function kp(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Ap(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function jp(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r){e.advance();return}r=n&&!r&&e.next==92,e.advance()}}function Mp(e,t){scan:for(;;){if(e.next<0)return;if(e.next==36){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue scan;e.advance()}if(e.next==36){e.advance();return}}else e.advance()}}function Np(e,t){let n=`[{<(`.indexOf(String.fromCharCode(t)),r=n<0?t:`]}>)`.charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&e.peek(1)==39){e.advance(2);return}e.advance()}}function Pp(e,t){for(;!(e.next!=95&&!kp(e.next));)t!=null&&(t+=String.fromCharCode(e.next)),e.advance();return t}function Xse(e){if(e.next==39||e.next==34||e.next==96){let t=e.next;e.advance(),jp(e,t,!1)}else Pp(e)}function Zse(e,t){for(;e.next==48||e.next==49;)e.advance();t&&e.next==t&&e.advance()}function Fp(e,t){for(;;){if(e.next==46){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function Qse(e){for(;!(e.next<0||e.next==10);)e.advance()}function Ip(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}var Lp=` \r
12
+ `;function $se(e,t,n){let r=Object.create(null);r.true=r.false=Bse,r.null=r.unknown=yp;for(let t of e.split(` `))t&&(r[t]=wp);for(let e of t.split(` `))e&&(r[e]=Tp);for(let e of(n||``).split(` `))e&&(r[e]=Op);return r}var Rp=`array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying `,zp=`absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone `,Bp={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:`*+-%<>!=&|~^/`,specialVar:`?`,identifierQuotes:`"`,caseInsensitiveIdentifiers:!1,words:$se(zp,Rp)};function ece(e,t,n,r){let i={};for(let t in Bp)i[t]=(e.hasOwnProperty(t)?e:Bp)[t];return t&&(i.words=$se(t,n||``,r)),i}function Vp(e){return new use(t=>{let{next:n}=t;if(t.advance(),Ip(n,Lp)){for(;Ip(t.next,Lp);)t.advance();t.acceptToken(zse)}else if(n==36&&e.doubleDollarQuotedStrings){let e=Pp(t,``);t.next==36&&(t.advance(),Mp(t,e),t.acceptToken(_p))}else if(n==39||n==34&&e.doubleQuotedStrings)jp(t,n,e.backslashEscapes),t.acceptToken(_p);else if(n==35&&e.hashComments||n==47&&t.next==47&&e.slashComments)Qse(t),t.acceptToken(hp);else if(n==45&&t.next==45&&(!e.spaceAfterDashes||t.peek(1)==32))Qse(t),t.acceptToken(hp);else if(n==47&&t.next==42){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),n==42&&t.next==47){if(e--,t.advance(),!e)break}else n==47&&t.next==42&&(e++,t.advance())}t.acceptToken(gp)}else if((n==101||n==69)&&t.next==39)t.advance(),jp(t,39,!0),t.acceptToken(_p);else if((n==110||n==78)&&t.next==39&&e.charSetCasts)t.advance(),jp(t,39,e.backslashEscapes),t.acceptToken(_p);else if(n==95&&e.charSetCasts)for(let n=0;;n++){if(t.next==39&&n>1){t.advance(),jp(t,39,e.backslashEscapes),t.acceptToken(_p);break}if(!kp(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(n==113||n==81)&&t.next==39&&t.peek(1)>0&&!Ip(t.peek(1),Lp)){let e=t.peek(1);t.advance(2),Np(t,e),t.acceptToken(_p)}else if(Ip(n,e.identifierQuotes))jp(t,n==91?93:n,!1),t.acceptToken(Yse);else if(n==40)t.acceptToken(bp);else if(n==41)t.acceptToken(xp);else if(n==123)t.acceptToken(Vse);else if(n==125)t.acceptToken(Hse);else if(n==91)t.acceptToken(Use);else if(n==93)t.acceptToken(Wse);else if(n==59)t.acceptToken(Sp);else if(e.unquotedBitLiterals&&n==48&&t.next==98)t.advance(),Zse(t),t.acceptToken(Ep);else if((n==98||n==66)&&(t.next==39||t.next==34)){let n=t.next;t.advance(),e.treatBitsAsBytes?(jp(t,n,e.backslashEscapes),t.acceptToken(Dp)):(Zse(t,n),t.acceptToken(Ep))}else if(n==48&&(t.next==120||t.next==88)||(n==120||n==88)&&t.next==39){let e=t.next==39;for(t.advance();Ap(t.next);)t.advance();e&&t.next==39&&t.advance(),t.acceptToken(vp)}else if(n==46&&t.next>=48&&t.next<=57)Fp(t,!0),t.acceptToken(vp);else if(n==46)t.acceptToken(Cp);else if(n>=48&&n<=57)Fp(t,!1),t.acceptToken(vp);else if(Ip(n,e.operatorChars)){for(;Ip(t.next,e.operatorChars);)t.advance();t.acceptToken(Gse)}else if(Ip(n,e.specialVar))t.next==n&&t.advance(),Xse(t),t.acceptToken(qse);else if(n==58||n==44)t.acceptToken(Kse);else if(kp(n)){let r=Pp(t,String.fromCharCode(n));t.acceptToken(t.next==46||t.peek(-r.length-1)==46?Jse:e.words[r.toLowerCase()]??Jse)}})}var Hp=Vp(Bp),Up=Mf.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:`⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement`,maxTerm:38,nodeProps:[[`isolate`,-4,1,2,3,19,``]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:`RORO`,tokenizers:[0,Hp],topRules:{Script:[0,25]},tokenPrec:0});function Wp(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function Gp(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function Kp(e){return e&&(e.name==`Identifier`||e.name==`QuotedIdentifier`)}function qp(e,t){if(t.name==`CompositeIdentifier`){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)Kp(r)&&n.push(Gp(e,r));return n}return[Gp(e,t)]}function Jp(e,t){for(let n=[];;){if(!t||t.name!=`.`)return n;let r=Wp(t);if(!Kp(r))return n;n.unshift(Gp(e,r)),t=Wp(r)}}function tce(e,t){let n=nf(e).resolveInner(t,-1),r=Xp(e.doc,n);return n.name==`Identifier`||n.name==`QuotedIdentifier`||n.name==`Keyword`?{from:n.from,quoted:n.name==`QuotedIdentifier`?e.doc.sliceString(n.from,n.from+1):null,parents:Jp(e.doc,Wp(n)),aliases:r}:n.name==`.`?{from:t,quoted:null,parents:Jp(e.doc,n),aliases:r}:{from:t,quoted:null,parents:[],empty:!0,aliases:r}}var Yp=new Set(`where group having order union intersect except all distinct limit offset fetch for`.split(` `));function Xp(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;e.name==`Statement`&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,a=null;t;t=t.nextSibling){let n=t.name==`Keyword`?e.sliceString(t.from,t.to).toLowerCase():null,o=null;if(!i)i=n==`from`;else if(n==`as`&&a&&Kp(t.nextSibling))o=Gp(e,t.nextSibling);else if(n&&Yp.has(n))break;else a&&Kp(t)&&(o=Gp(e,t));o&&(r||=Object.create(null),r[o]=qp(e,a)),a=/Identifier$/.test(t.name)?t:null}return r}function nce(e,t,n){return n.map(n=>({...n,label:n.label[0]==e?n.label:e+n.label+t,apply:void 0}))}var Zp=/^\w*$/,Qp=/^[`'"\[]?\w*[`'"\]]?$/;function $p(e){return e.self&&typeof e.self.label==`string`}var em=class e{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(t){let n=this.children||=Object.create(null);return n[t]||(t&&!this.list.some(e=>e.label==t)&&this.list.push(rce(t,`type`,this.idQuote,this.idCaseInsensitive)),n[t]=new e(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion(typeof t==`string`?rce(t,`property`,this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):$p(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>e==`.`?`\0`:e).split(`\0`),a=this;$p(n)&&(r=n.self,n=n.children);for(let e=0;e<i.length;e++)r&&e==i.length-1&&a.addCompletion(r),a=a.child(i[e].replace(/\\\./g,`.`));a.addNamespace(n)}}};function rce(e,t,n,r){return RegExp(`^[a-z_][a-z_\\d]*$`,r?`i`:``).test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+tm(n)}}function tm(e){return e===`[`?`]`:e}function nm(e,t,n,r,i,a){let o=new em(a?.spec.identifierQuotes?.[0]||`"`,!!a?.spec.caseInsensitiveIdentifiers),s=i?o.child(i):null;return o.addNamespace(e),t&&(s||o).addCompletions(t),n&&o.addCompletions(n),s&&o.addCompletions(s.list),r&&o.addCompletions((s||o).child(r).list),e=>{let{parents:t,from:n,quoted:i,empty:a,aliases:c}=tce(e.state,e.pos);if(a&&!e.explicit)return null;c&&t.length==1&&(t=c[t[0]]||t);let l=o;for(let e of t){for(;!l.children||!l.children[e];)if(l==o&&s)l=s;else if(l==s&&r)l=l.child(r);else return null;let t=l.maybeChild(e);if(!t)return null;l=t}let u=l.list;if(l==o&&c&&(u=u.concat(Object.keys(c).map(e=>({label:e,type:`constant`})))),i){let t=i[0],r=tm(t);return{from:n,to:e.state.sliceDoc(e.pos,e.pos+1)==r?e.pos+1:void 0,options:nce(t,r,u),validFor:Qp}}else return{from:n,options:u,validFor:Zp}}}function rm(e){return e==Tp?`type`:e==wp?`keyword`:`variable`}function im(e,t,n){return Bf([`QuotedIdentifier`,`String`,`LineComment`,`BlockComment`,`.`],zf(Object.keys(e).map(r=>n(t?r.toUpperCase():r,rm(e[r])))))}var ice=Up.configure({props:[sf.add({Statement:tse()}),nse.add({Statement(e,t){return{from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),su({Keyword:Cu.keyword,Type:Cu.typeName,Builtin:Cu.standard(Cu.name),Bits:Cu.number,Bytes:Cu.string,Bool:Cu.bool,Null:Cu.null,Number:Cu.number,String:Cu.string,Identifier:Cu.name,QuotedIdentifier:Cu.special(Cu.string),SpecialVar:Cu.special(Cu.name),LineComment:Cu.lineComment,BlockComment:Cu.blockComment,Operator:Cu.operator,"Semi Punctuation":Cu.punctuation,"( )":Cu.paren,"{ }":Cu.brace,"[ ]":Cu.squareBracket})]}),am=class e{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(t,n){return new e(this.dialect,this.language.configure(t,n),this.spec)}static define(t){let n=ece(t,t.keywords,t.types,t.builtin);return new e(n,Joe.define({name:`sql`,parser:ice.configure({tokenizers:[{from:Hp,to:Vp(n)}]}),languageData:{commentTokens:{line:`--`,block:{open:`/*`,close:`*/`}},closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]}}}),t)}};function ace(e,t){return{label:e,type:t,boost:-1}}function oce(e,t=!1,n){return im(e.dialect.words,t,n||ace)}function om(e){return e.schema?nm(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema,e.dialect||cm):()=>null}function sm(e){return e.schema?(e.dialect||cm).language.data.of({autocomplete:om(e)}):[]}function D(e={}){let t=e.dialect||cm;return new ese(t.language,[sm(e),t.language.data.of({autocomplete:oce(t,e.upperCaseKeywords,e.keywordCompletion)})])}var cm=am.define({});zp+``,Rp+``,Rp+``,zp+``,zp+``,zp+``,Rp+``,zp+``,Rp+``,Rp+``,zp+``,Rp+``;var lm=`#e5c07b`,sce=`#e06c75`,um=`#56b6c2`,dm=`#ffffff`,fm=`#abb2bf`,pm=`#7d8799`,mm=`#61afef`,hm=`#98c379`,gm=`#d19a66`,_m=`#c678dd`,cce=`#21252b`,vm=`#2c313a`,ym=`#282c34`,bm=`#353a42`,lce=`#3E4451`,uce=`#528bff`,xm=[Yc.theme({"&":{color:fm,backgroundColor:ym},".cm-content":{caretColor:uce},".cm-cursor, .cm-dropCursor":{borderLeftColor:uce},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:lce},".cm-panels":{backgroundColor:cce,color:fm},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:ym,color:pm,border:`none`},".cm-activeLineGutter":{backgroundColor:vm},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:bm},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bm,borderBottomColor:bm},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:vm,color:fm}}},{dark:!0}),ff(cf.define([{tag:Cu.keyword,color:_m},{tag:[Cu.name,Cu.deleted,Cu.character,Cu.propertyName,Cu.macroName],color:sce},{tag:[Cu.function(Cu.variableName),Cu.labelName],color:mm},{tag:[Cu.color,Cu.constant(Cu.name),Cu.standard(Cu.name)],color:gm},{tag:[Cu.definition(Cu.name),Cu.separator],color:fm},{tag:[Cu.typeName,Cu.className,Cu.number,Cu.changed,Cu.annotation,Cu.modifier,Cu.self,Cu.namespace],color:lm},{tag:[Cu.operator,Cu.operatorKeyword,Cu.url,Cu.escape,Cu.regexp,Cu.link,Cu.special(Cu.string)],color:um},{tag:[Cu.meta,Cu.comment],color:pm},{tag:Cu.strong,fontWeight:`bold`},{tag:Cu.emphasis,fontStyle:`italic`},{tag:Cu.strikethrough,textDecoration:`line-through`},{tag:Cu.link,color:pm,textDecoration:`underline`},{tag:Cu.heading,fontWeight:`bold`,color:sce},{tag:[Cu.atom,Cu.bool,Cu.special(Cu.variableName)],color:gm},{tag:[Cu.processingInstruction,Cu.string,Cu.inserted],color:hm},{tag:Cu.invalid,color:dm}]))],Sm=Mf.deserialize({version:14,states:`&fQVQPOOOkQPO'#ClO!SQPO'#C^OOQO'#Co'#CoOOQO'#Cw'#CwOOQO'#Cp'#CpQVQPOOO!_QPO,59WOOQO'#Cy'#CyOOQO'#Cr'#CrO!xQPO'#CjOOQO'#Cq'#CqO!VQPO,58xOOQO'#Cc'#CcO#PQPO'#CbO#UQPO,58xO!VQPO,58xOOQO-E6n-E6nOOQO1G.r1G.rOOQO-E6p-E6pOOQO-E6o-E6oO#pQPO1G.dO$[QPO,58|O!VQPO'#CsO#pQPO1G.dO!VQPO1G.dO$gQPO7+$OO%RQPO'#CfOOQO'#Cf'#CfOkQPO'#CiOOQO1G.h1G.hO$bQPO1G.hO!VQPO,59_OOQO,59_,59_OOQO-E6q-E6qO$gQPO7+$OOOQO,59Q,59QO%WQPO,59TOOQO7+$S7+$SOOQO1G.y1G.yO%]QPO<<GjOOQO1G.o1G.o`,stateData:"&R~OjOS~ORQOTROWRO_ROaROlPO~OTWOWWO_WOaWObWOlPOn^P~OS`OTZOW]O~OnbO~OTWOWWO_WOaWObWOlPO~On^X~P!dOXfO~ObgORQaTQaWQa_QaaQahQalQa~ObgORQiTQiWQi_QiaQihQilQi~OZkO[lOlmO~ObgORQqTQqWQq_QqaQqhQqlQq~O[tO~OnyO~ObgORQyTQyWQy_QyaQyhQylQy~OR_STaZX[W~",goto:"#ynPPoPPPs!TPP!]PP!`!fP!lPPo!u!{#Z#bPPP#pP#tTSOUQ_QSe[`QqgQsiRwp]^Q[`gipRofQnfRvoQVPRumSROUVWPYmQUORaUQ[QUd[ipQi`RpgSYPmRcYQh_QjeUrhjxRxsTTOUVXPYm",nodeNames:`⚠ Query WithClause With Recursive Comment CTEDef CTEName Word As NotMaterialized Not Materialized CTEBody ParenContent String Paren Punct Comma Token`,maxTerm:30,skippedNodes:[0],repeatNodeCount:4,tokenData:"9Q~RyOX#rXY#wYZ#wZ]#r]^#w^p#rpq#wqw#rwx$Yxy$zyz%Pz|#r|}%U}!O%Z!O!P#r!P!Q%z![!c#r!c!d'T!d!o'r!o!p(h!p!q/f!q!t'r!t!u1V!u!y'r!y!z6l!z!}'r!}#R#r#R#S'r#S#T#r#T#U'T#U#a'r#a#b(h#b#c/f#c#f'r#f#g1V#g#k'r#k#l6l#l#o'r#o;'S#r;'S;=`8z<%lO#r~#wOa~~#|Sj~XY#wYZ#w]^#wpq#w~$]TOw$Ywx$lx;'S$Y;'S;=`$t<%lO$Y~$qP_~wx$Y~$wP;=`<%l$Y~%POl~~%UOn~~%ZOb~~%`Pa~}!O%c~%hST~OY%cZ;'S%c;'S;=`%t<%lO%c~%wP;=`<%l%c~&PPa~z{&S~&VTOz&Sz{&f{;'S&S;'S;=`&}<%lO&S~&iTO!P&S!P!Q&x!Q;'S&S;'S;=`&}<%lO&S~&}OT~~'QP;=`<%l&S~'YWW~!Q!['r!c!u'r!u!v(T!v!}'r#R#S'r#T#g'r#g#h(T#h#o'r~'wSW~!Q!['r!c!}'r#R#S'r#T#o'r~([SX~W~!Q!['r!c!}'r#R#S'r#T#o'r~(mUW~!Q!['r!c!d)P!d!}'r#R#S'r#T#U)P#U#o'r~)UWW~!Q!['r!c!v'r!v!w)n!w!}'r#R#S'r#T#h'r#h#i)n#i#o'r~)sWW~!Q!['r!c!g'r!g!h*]!h!}'r#R#S'r#T#X'r#X#Y*]#Y#o'r~*bWW~!Q!['r!c!t'r!t!u*z!u!}'r#R#S'r#T#f'r#f#g*z#g#o'r~+PWW~!Q!['r!c!k'r!k!l+i!l!}'r#R#S'r#T#]'r#]#^+i#^#o'r~+nUW~!Q!['r!c!d,Q!d!}'r#R#S'r#T#U,Q#U#o'r~,VWW~!Q!['r!c!n'r!n!o,o!o!}'r#R#S'r#T#`'r#`#a,o#a#o'r~,tWW~!Q!['r!c!k'r!k!l-^!l!}'r#R#S'r#T#]'r#]#^-^#^#o'r~-cUW~!Q!['r!c!|'r!|!}-u#R#S'r#T#n'r#n#o-u~-zWW~!Q!['r!c!g'r!g!h.d!h!}'r#R#S'r#T#X'r#X#Y.d#Y#o'r~.iWW~!Q!['r!c!f'r!f!g/R!g!}'r#R#S'r#T#W'r#W#X/R#X#o'r~/YS[~W~!Q!['r!c!}'r#R#S'r#T#o'r~/kWW~!Q!['r!c!q'r!q!r0T!r!}'r#R#S'r#T#c'r#c#d0T#d#o'r~0YWW~!Q!['r!c!v'r!v!w0r!w!}'r#R#S'r#T#h'r#h#i0r#i#o'r~0ySZ~W~!Q!['r!c!}'r#R#S'r#T#o'r~1[WW~!Q!['r!c!g'r!g!h1t!h!}'r#R#S'r#T#X'r#X#Y1t#Y#o'r~1yWW~!Q!['r!c!e'r!e!f2c!f!}'r#R#S'r#T#V'r#V#W2c#W#o'r~2hWW~!Q!['r!c!w'r!w!x3Q!x!}'r#R#S'r#T#i'r#i#j3Q#j#o'r~3VWW~!Q!['r!c!t'r!t!u3o!u!}'r#R#S'r#T#f'r#f#g3o#g#o'r~3tWW~!Q!['r!c!u'r!u!v4^!v!}'r#R#S'r#T#g'r#g#h4^#h#o'r~4cWW~!Q!['r!c!k'r!k!l4{!l!}'r#R#S'r#T#]'r#]#^4{#^#o'r~5QWW~!Q!['r!c!x'r!x!y5j!y!}'r#R#S'r#T#j'r#j#k5j#k#o'r~5oWW~!Q!['r!c!g'r!g!h6X!h!}'r#R#S'r#T#X'r#X#Y6X#Y#o'r~6`SS~W~!Q!['r!c!}'r#R#S'r#T#o'r~6qWW~!Q!['r!c!k'r!k!l7Z!l!}'r#R#S'r#T#]'r#]#^7Z#^#o'r~7`WW~!Q!['r!c!v'r!v!w7x!w!}'r#R#S'r#T#h'r#h#i7x#i#o'r~7}WW~!Q!['r!c!j'r!j!k8g!k!}'r#R#S'r#T#['r#[#]8g#]#o'r~8nSR~W~!Q!['r!c!}'r#R#S'r#T#o'r~8}P;=`<%l#r",tokenizers:[0],topRules:{Query:[0,1]},tokenPrec:223});function Cm(e,t){let n=[],r=e.firstChild;for(;r;)r.name===t&&n.push(r),r=r.nextSibling;return n}function wm(e,t){let n=e.firstChild;for(;n;){if(n.name===t)return n;n=n.nextSibling}return null}function Tm(e,t){return wm(e,t)!==null}function Em(e,t){return e.slice(t.from,t.to)}function Dm(e){let t=Sm.parse(e),n=[],r=!1,i=0,a=t.cursor();if(a.firstChild())do if(a.name===`WithClause`){let t=a.node;t.to,r=Tm(t,`Recursive`);let o=Cm(t,`CTEDef`);for(let t of o){let r=wm(t,`CTEName`),i=wm(t,`CTEBody`);if(r&&i){let a=Em(e,r),o=Em(e,i).slice(1,-1).trim();n.push({name:a,body:o,start:t.from,end:t.to})}}i=t.to;break}while(a.nextSibling());return n.length===0?{recursive:!1,ctes:[],mainQuery:e.trim(),mainQueryStart:0}:{recursive:r,ctes:n,mainQuery:e.slice(i).trim(),mainQueryStart:i}}function Om(e){let t=new Map,n=new Set(e.map(e=>e.name.toLowerCase()));for(let r of e){let i=[];for(let t of n)if(t!==r.name.toLowerCase()&&RegExp(`\\b${t}\\b`,`i`).test(r.body)){let n=e.find(e=>e.name.toLowerCase()===t)?.name;n&&i.push(n)}t.set(r.name,i)}return t}var km=Object.create,Am=Object.defineProperty,jm=Object.getOwnPropertyDescriptor,dce=Object.getOwnPropertyNames,fce=Object.getPrototypeOf,pce=Object.prototype.hasOwnProperty,Mm=(e,t)=>function(){return t||(0,e[dce(e)[0]])((t={exports:{}}).exports,t),t.exports},mce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=dce(t),a=0,o=i.length,s;a<o;a++)s=i[a],!pce.call(e,s)&&s!==n&&Am(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=jm(t,s))||r.enumerable});return e},Nm=(e,t,n)=>(n=e==null?{}:km(fce(e)),mce(t||!e||!e.__esModule?Am(n,`default`,{value:e,enumerable:!0}):n,e)),Pm=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),O=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Pm().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),hce=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Pm().default,r=O();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Fm=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=hce();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Im=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Fm();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});function Lm(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1;function o(){if(n===null){a=!0;return}i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),o())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),o())}}),a&&o(),{unsubscribe:o}},pipe(...e){return e.reduce(gce,t)}};return t}function gce(e,t){return t(e)}function _ce(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}function vce(e){return e=>{let t=0,n=null,r=[];function i(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function a(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return Lm(e=>(t++,r.push(e),i(),{unsubscribe(){t--,a();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function Rm(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},i=e=>{n.splice(n.indexOf(e),1)},a=Lm(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},a.get=()=>t,a}function zm(e){return Lm(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}function Bm(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function Vm(){return Object.create(null)}var Hm={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};Hm.BAD_GATEWAY,Hm.SERVICE_UNAVAILABLE,Hm.GATEWAY_TIMEOUT,Hm.INTERNAL_SERVER_ERROR;var Um=Object.create,yce=Object.defineProperty,bce=Object.getOwnPropertyDescriptor,Wm=Object.getOwnPropertyNames,xce=Object.getPrototypeOf,Sce=Object.prototype.hasOwnProperty,Gm=(e,t)=>function(){return t||(0,e[Wm(e)[0]])((t={exports:{}}).exports,t),t.exports},Cce=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Wm(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Sce.call(e,s)&&s!==n&&yce(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=bce(t,s))||r.enumerable});return e},Km=(e,t,n)=>(n=e==null?{}:Um(xce(e)),Cce(t||!e||!e.__esModule?yce(n,`default`,{value:e,enumerable:!0}):n,e)),qm=()=>{},Jm=e=>{Object.freeze&&Object.freeze(e)};function Ym(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(qm,{get(r,i){if(!(typeof i!=`string`||i===`then`))return Ym(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1],o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),Jm(o.args),Jm(o.path),e(o)}})),n[r]}var Xm=e=>Ym(e,[],Vm()),Zm=e=>new Proxy(qm,{get(t,n){if(n!==`then`)return e(n)}}),Qm=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),$m=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Qm().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),eh=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Qm().default,r=$m();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),th=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=eh();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),nh=Gm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=th();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});Km(nh(),1),Km(th(),1);var rh=Km(nh(),1);function ih(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:(0,rh.default)((0,rh.default)({},e),{},{error:n})}}return{ok:!0,result:(0,rh.default)((0,rh.default)({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var ah=class extends Error{constructor(){super(`Unable to transform response from server`)}};function oh(e,t){let n;try{n=ih(e,t)}catch{throw new ah}if(!n.ok&&(!Bm(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!Bm(n.result))throw new ah;return n}Km(nh(),1);var sh=Nm(Fm(),1),ch=Nm(Im(),1);function lh(e){return e instanceof fh}function uh(e){return Bm(e)&&Bm(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function dh(e,t){return typeof e==`string`?e:Bm(e)&&typeof e.message==`string`?e.message:t}var fh=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),(0,sh.default)(this,`cause`,void 0),(0,sh.default)(this,`shape`,void 0),(0,sh.default)(this,`data`,void 0),(0,sh.default)(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return lh(r)?(n.meta&&(r.meta=(0,ch.default)((0,ch.default)({},r.meta),n.meta)),r):uh(r)?new e(r.error.message,(0,ch.default)((0,ch.default)({},n),{},{result:r,cause:n.cause})):new e(dh(r,`Unknown error`),(0,ch.default)((0,ch.default)({},n),{},{cause:r}))}};function wce(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var Tce=e=>typeof e==`function`;function Ece(e){if(e)return e;if(typeof window<`u`&&Tce(window.fetch))return window.fetch;if(typeof globalThis<`u`&&Tce(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}var ph=Nm(Im(),1);function Dce(e){return{url:e.url.toString(),fetch:e.fetch,transformer:wce(e.transformer),methodOverride:e.methodOverride}}function Oce(e){let t={};for(let n=0;n<e.length;n++)t[n]=e[n];return t}var kce={query:`GET`,mutation:`POST`,subscription:`PATCH`};function mh(e){return`input`in e?e.transformer.input.serialize(e.input):Oce(e.inputs.map(t=>e.transformer.input.serialize(t)))}var Ace=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=mh(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},hh=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=mh(e);return t===void 0?void 0:JSON.stringify(t)},gh=e=>Nce((0,ph.default)((0,ph.default)({},e),{},{contentTypeHeader:`application/json`,getUrl:Ace,getBody:hh})),_h=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},jce=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new _h};async function Mce(e){jce(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??kce[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=(0,ph.default)((0,ph.default)((0,ph.default)({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return Ece(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:a})}async function Nce(e){let t={},n=await Mce(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}Nm(Im(),1);var vh=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function yh(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let o=t[r];if(!o)break;let s=n[n.length-1];if(o.aborted){var i;(i=o.reject)==null||i.call(o,Error(`Aborted`)),r++;continue}if(e.validate(s.concat(o).map(e=>e.key))){s.push(o),r++;continue}if(s.length===0){var a;(a=o.reject)==null||a.call(o,Error(`Input is too big for a single dispatch`)),r++;continue}n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:vh,reject:vh},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}function bh(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}var xh=Nm(Im(),1);function Sh(e){let t=Dce(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return Ace((0,xh.default)((0,xh.default)({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=bh(...n.map(e=>e.signal)),s=await gh((0,xh.default)((0,xh.default)({},t),{},{path:r,inputs:a,type:i,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}},signal:o}));return(Array.isArray(s.json)?s.json:n.map(()=>s.json)).map(e=>({meta:s.meta,json:e}))}}),a={query:yh(i(`query`)),mutation:yh(i(`mutation`))};return({op:e})=>Lm(n=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r=a[e.type].load(e),i;return r.then(e=>{i=e;let r=oh(e.json,t.transformer.output);if(!r.ok){n.error(fh.from(r.error,{meta:e.meta}));return}n.next({context:e.meta,result:r.result}),n.complete()}).catch(e=>{n.error(fh.from(e,{meta:i?.meta}))}),()=>{}})}}Nm(Im(),1);var Ch=(e,...t)=>typeof e==`function`?e(...t):e;Nm(Fm(),1);function Pce(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Fce(e){let t=await Ch(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function Ice(e,t){let n={method:`connectionParams`,data:await Ch(e)};return t.encode(n)}Nm(Fm(),1);var wh=Nm(Fm(),1);function Lce(e){let{promise:t,resolve:n,reject:r}=Pce();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function Th(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}var Eh=class e{constructor(t){if((0,wh.default)(this,`id`,++e.connectCount),(0,wh.default)(this,`WebSocketPonyfill`,void 0),(0,wh.default)(this,`urlOptions`,void 0),(0,wh.default)(this,`keepAliveOpts`,void 0),(0,wh.default)(this,`encoder`,void 0),(0,wh.default)(this,`wsObservable`,Rm(null)),(0,wh.default)(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++e.connectCount,t.openPromise=Fce(t.urlOptions).then(e=>new t.WebSocketPonyfill(e)).then(async e=>{t.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),t.keepAliveOpts.enabled&&Th(e,t.keepAliveOpts),e.addEventListener(`close`,()=>{t.ws===e&&(t.ws=null)}),await Lce(e),t.urlOptions.connectionParams&&e.send(await Ice(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)==null||t.close()}}};(0,wh.default)(Eh,`connectCount`,0),Nm(Fm(),1),Nm(Im(),1);var Dh=Nm(Fm(),1),Oh=Nm(Im(),1),kh=class{constructor(e){(0,Dh.default)(this,`links`,void 0),(0,Dh.default)(this,`runtime`,void 0),(0,Dh.default)(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return zm({links:this.links,op:(0,Oh.default)((0,Oh.default)({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(vce())}async requestAsPromise(e){var t=this;try{return(await _ce(t.$request(e))).result.data}catch(e){throw fh.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data);break}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},Ah=Symbol.for(`trpc_untypedClient`),Rce={query:`query`,mutate:`mutation`,subscribe:`subscription`},zce=e=>Rce[e];function Bce(e){let t=Xm(({path:t,args:n})=>{let r=[...t],i=zce(r.pop()),a=r.join(`.`);return e[i](a,...n)});return Zm(n=>n===Ah?e:t[n])}function Vce(e){return Bce(new kh(e))}Nm(Im(),1),Nm(Im(),1),Nm(Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),Nm(Im(),1);var Hce=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),jh=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(e,t){this.v=e,this.k=t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Mh=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=jh();function r(e){return new n(e,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Nh=Mm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=jh();function r(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,c=s instanceof n;Promise.resolve(c?s.v:s).then(function(n){if(c){var r=t===`return`?`return`:`next`;if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?`return`:`normal`,n)},function(e){i(`throw`,e)})}catch(e){a(`throw`,e)}}function a(e,n){switch(e){case`return`:t.resolve({value:n,done:!0});break;case`throw`:t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise(function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))})},typeof e.return!=`function`&&(this.return=void 0)}i.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},i.prototype.next=function(e){return this._invoke(`next`,e)},i.prototype.throw=function(e){return this._invoke(`throw`,e)},i.prototype.return=function(e){return this._invoke(`return`,e)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});Nm(Hce(),1),Nm(Mh(),1),Nm(Nh(),1),Nm(Im(),1);var Ph=Vce({links:[Sh({url:`/trpc`})]}),Fh=new class{#e=Wt(null);get message(){return w(this.#e)}set message(e){Gt(this.#e,e,!0)}#t=Wt(`info`);get level(){return w(this.#t)}set level(e){Gt(this.#t,e,!0)}timer=null;show(e,t=`info`,n=0){this.timer&&clearTimeout(this.timer),this.message=e,this.level=t,n>0&&(this.timer=setTimeout(()=>this.clear(),n))}error(e){this.show(e,`error`)}warn(e){this.show(e,`warning`,5e3)}info(e){this.show(e,`info`,3e3)}clear(){this.timer&&=(clearTimeout(this.timer),null),this.message=null}};function Uce(e){if(e instanceof TypeError&&e.message===`Failed to fetch`)return`Server not reachable. Is the IDE server running?`;if(e instanceof Error){let t=e.message;try{let e=JSON.parse(t);if(Array.isArray(e))return e[0]?.message||t;if(e.message)return e.message}catch{}return t}return`Unknown error`}var Ih=new class{#e=Wt(``);get sql(){return w(this.#e)}set sql(e){Gt(this.#e,e,!0)}#t=It(()=>{try{return Dm(this.sql)}catch(e){return console.error(`Parse error:`,e),null}});get parsed(){return w(this.#t)}set parsed(e){Gt(this.#t,e)}#n=It(()=>this.parsed?Om(this.parsed.ctes):new Map);get dependencies(){return w(this.#n)}set dependencies(e){Gt(this.#n,e)}#r=It(()=>this.parsed!=null&&this.parsed.ctes.length>0);get hasCTEs(){return w(this.#r)}set hasCTEs(e){Gt(this.#r,e)}#i=Wt(Jt([]));get annotations(){return w(this.#i)}set annotations(e){Gt(this.#i,e,!0)}setAnnotations(e){this.annotations=e}#a=Wt(Jt(new Map));get nodeStates(){return w(this.#a)}set nodeStates(e){Gt(this.#a,e,!0)}#o=Wt(null);get selectedCTE(){return w(this.#o)}set selectedCTE(e){Gt(this.#o,e,!0)}#s=Wt(null);get result(){return w(this.#s)}set result(e){Gt(this.#s,e,!0)}#c=Wt(null);get error(){return w(this.#c)}set error(e){Gt(this.#c,e,!0)}#l=Wt(!1);get isLoading(){return w(this.#l)}set isLoading(e){Gt(this.#l,e,!0)}#u=Wt(!1);get isPreviewLoading(){return w(this.#u)}set isPreviewLoading(e){Gt(this.#u,e,!0)}#d=Wt(null);get selectedQuerySQL(){return w(this.#d)}set selectedQuerySQL(e){Gt(this.#d,e,!0)}#f=It(()=>this.selectedQuerySQL||this.sql);get executableSQL(){return w(this.#f)}set executableSQL(e){Gt(this.#f,e)}setSQL(e){this.sql=e}setSelectedQuery(e){this.selectedQuerySQL=e}async previewAll(){let e=this.sql,t=this.parsed;if(!t||t.ctes.length===0)return;this.isPreviewLoading=!0;let n=new Map;for(let e of t.ctes){let t=this.nodeStates.get(e.name);n.set(e.name,t||{id:e.name,name:e.name,status:`pending`})}let r=this.nodeStates.get(`main`);n.set(`main`,r||{id:`main`,name:`Result`,status:`pending`}),this.nodeStates=n;try{let t=await Ph.previewAllCTEs.mutate({sql:e}),n=new Map(this.nodeStates);for(let[e,r]of Object.entries(t)){let t=n.get(e);t&&n.set(e,{...t,status:`success`,rowCount:r.rowCount,preview:{columns:r.columns,rows:r.rows}})}this.nodeStates=n}catch(e){console.error(`Preview error:`,e)}finally{this.isPreviewLoading=!1}}async execute(){let e=this.executableSQL,t=Dm(e)??this.parsed;if(!t){this.error=`Failed to parse SQL`;return}let n=new Map;for(let e of t.ctes)n.set(e.name,{id:e.name,name:e.name,status:`pending`});n.set(`main`,{id:`main`,name:`Result`,status:`pending`}),this.nodeStates=n;let r=new Map(n);r.set(`main`,{...r.get(`main`),status:`running`}),this.nodeStates=r,this.isLoading=!0,this.error=null;try{let t=await Ph.executeQuery.mutate({sql:e}),n=new Map(this.nodeStates);n.set(`main`,{id:`main`,name:`Result`,status:`success`,rowCount:t.rowCount}),this.nodeStates=n,this.result=t,this.error=null,this.selectedCTE=`main`}catch(e){let t=Uce(e),n=new Map(this.nodeStates);n.set(`main`,{id:`main`,name:`Result`,status:`error`,error:t}),this.nodeStates=n,this.error=t,this.result=null,Fh.error(t)}finally{this.isLoading=!1}}async executeCTE(e){let t=this.sql,n=new Map(this.nodeStates),r=n.get(e)||{id:e,name:e,status:`pending`};n.set(e,{...r,status:`running`}),this.nodeStates=n,this.isLoading=!0,this.error=null;try{let n=await Ph.executeCTE.mutate({fullSql:t,cteName:e}),i=new Map(this.nodeStates);i.set(e,{...r,status:`success`,rowCount:n.rowCount}),this.nodeStates=i,this.result=n,this.error=null,this.selectedCTE=e}catch(t){let n=Uce(t),i=new Map(this.nodeStates);i.set(e,{...r,status:`error`,error:n}),this.nodeStates=i,this.error=n,this.result=null,Fh.error(n)}finally{this.isLoading=!1}}clearResults(){this.result=null,this.error=null,this.isLoading=!1}clearPreviews(){let e=new Map;for(let[t,n]of this.nodeStates)e.set(t,{...n,preview:void 0});this.nodeStates=e}get hasPreview(){for(let e of this.nodeStates.values())if(e.preview&&e.preview.columns.length>0)return!0;return!1}},Lh=new class{#e=Wt(Jt([{id:`scratch`,label:`Scratch`,type:`editor`,content:``,originalContent:``,fileName:null,dirty:!1}]));get tabs(){return w(this.#e)}set tabs(e){Gt(this.#e,e,!0)}#t=Wt(`scratch`);get activeTabId(){return w(this.#t)}set activeTabId(e){Gt(this.#t,e,!0)}#n=It(()=>this.tabs.find(e=>e.id===this.activeTabId)??this.tabs[0]);get activeTab(){return w(this.#n)}set activeTab(e){Gt(this.#n,e)}#r=It(()=>this.activeTab?.type===`schema`);get isSchemaTab(){return w(this.#r)}set isSchemaTab(e){Gt(this.#r,e)}async openFile(e){let t=this.tabs.find(t=>t.fileName===e);if(t)return this.activeTabId=t.id,t.id;let{content:n}=await Ph.readFile.query({fileName:e}),r={id:`file:${e}`,label:e,type:`editor`,content:n,originalContent:n,fileName:e,dirty:!1};return this.tabs=[...this.tabs,r],this.activeTabId=r.id,r.id}openSchema(){if(this.tabs.find(e=>e.id===`schema`)){this.activeTabId=`schema`;return}let e={id:`schema`,label:`Schema`,type:`schema`,content:``,originalContent:``,fileName:null,dirty:!1};this.tabs=[...this.tabs,e],this.activeTabId=`schema`}switchTab(e){this.activeTabId=e}closeTab(e){if(this.tabs.length<=1)return;let t=this.tabs.findIndex(t=>t.id===e);this.tabs=this.tabs.filter(t=>t.id!==e),this.activeTabId===e&&(this.activeTabId=this.tabs[Math.min(t,this.tabs.length-1)].id)}updateContent(e){let t=this.tabs.find(e=>e.id===this.activeTabId);t&&t.type===`editor`&&(t.content=e,t.dirty=e!==t.originalContent)}setScratchContent(e){let t=this.tabs.find(e=>e.id===`scratch`);t&&(t.content=e,this.activeTabId=`scratch`)}},Wce=[{label:`QUERY`,type:`keyword`,detail:`SELECT query`,info:`Define a query that returns rows`},{label:`EXEC`,type:`keyword`,detail:`Execute statement`,info:`INSERT/UPDATE/DELETE statement`},{label:`MIGRATE`,type:`keyword`,detail:`Migration`,info:`Schema migration (CREATE TABLE, etc.)`},{label:`TESTDATA`,type:`keyword`,detail:`Test data`,info:`Insert test/sample data`},{label:`TABLE`,type:`keyword`,detail:`Appender table`,info:`Define table for bulk insert appender`}],Rh=[{label:`:one`,type:`property`,detail:`Single row`,info:`Query returns exactly one row`},{label:`:pluck`,type:`property`,detail:`Single column`,info:`Query returns a single value (first column)`},{label:`:all`,type:`property`,detail:`All rows`,info:`Query returns all rows (default)`},{label:`:appender`,type:`property`,detail:`Bulk insert`,info:`Generate appender for bulk inserts (TABLE only)`}],zh=[];function Bh(e){zh=e}function Gce(e){let t=e.state.doc.lineAt(e.pos),n=t.text.slice(0,e.pos-t.from);if(n.match(/^--\s+$/))return{from:e.pos,options:Wce};if(n.match(/^--\s+(?:QUERY|EXEC|TABLE)\s+\S+\s+$/))return{from:e.pos,options:Rh};let r=n.match(/^--\s+(?:QUERY|EXEC|TABLE)\s+\S+\s*:(\w*)$/);if(r)return{from:e.pos-r[1].length-1,options:Rh};let i=n.match(/@(\w*)$/);if(i)return{from:e.pos-i[1].length-1,options:[{label:`@set`,type:`keyword`,detail:`Set variable`,info:`Define a variable: @set name = value`}]};if(zh.length>0){let t=n.match(/(?:FROM|JOIN|INTO|UPDATE|TABLE)\s+(\w*)$/i);if(t)return{from:e.pos-t[1].length,options:zh.map(e=>({label:e.name,type:`class`,detail:`${e.columns.length} columns`}))};let r=n.match(/(\w+)\.(\w*)$/);if(r){let t=zh.find(e=>e.name.toLowerCase()===r[1].toLowerCase());if(t)return{from:e.pos-r[2].length,options:t.columns.map(e=>({label:e.name,type:`property`,detail:e.type}))}}}return null}function Kce(){return mp({override:[Gce],activateOnTyping:!0})}var qce=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Vh=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(Kh).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new ma,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=ule(s);if(i)o.add(n,n,$a.widget({widget:new qh(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,$a.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,Hh(f))}};function Hh(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new qce(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new qce(r.from,n,r.diagnostic)}),r}function Jce(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Kh).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Uh))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Yce(e,t){return e.field(Gh,!1)?t:t.concat(ea.appendConfig.of(dle))}function Xce(e,t){return{effects:Yce(e,[Uh.of(t)])}}var Uh=ea.define(),Zce=ea.define(),Wh=ea.define(),Gh=Vi.define({create(){return new Vh($a.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Hh(n,e.selected.diagnostic,i)||Hh(n,null,i)}!n.size&&i&&t.state.facet(Kh).autoPanel&&(i=null),e=new Vh(n,i,r)}for(let n of t.effects)if(n.is(Uh)){let r=t.state.facet(Kh).autoPanel?n.value.length?Yh.open:null:e.panel;e=Vh.init(n.value,r,t.state)}else n.is(Zce)?e=new Vh(e.diagnostics,n.value?Yh.open:null,e.selected):n.is(Wh)&&(e=new Vh(e.diagnostics,e.panel,n.value));return e},provide:e=>[xl.from(e,e=>e.panel),Yc.decorations.from(e,e=>e.diagnostics)]}),Qce=$a.mark({class:`cm-lintRange cm-lintRange-active`});function $ce(e,t,n){let{diagnostics:r}=e.state.field(Gh),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(Kh).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:ele(e,i)}}}:null}function ele(e,t){return La(`ul`,{class:`cm-tooltip-lint`},t.map(t=>sle(e,t,!1)))}var tle=e=>{let t=e.state.field(Gh,!1);return!t||!t.panel?!1:(e.dispatch({effects:Zce.of(!1)}),!0)},nle=ss.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Kh);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Kh);t.length&&rle(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(Xce(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{is(this.view.state,e)})}}update(e){let t=e.state.facet(Kh);(e.docChanged||t!=e.startState.facet(Kh)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function rle(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var Kh=Fi.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...la(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:ile,tooltipFilter:ile,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function ile(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function ale(e,t={}){return[Kh.of({source:e,config:t}),nle,dle]}function ole(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function sle(e,t,n){let r=n?ole(t.actions):[];return La(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},La(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=Hh(e.state.field(Gh).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),La(`u`,s.slice(c,c+1)),s.slice(c+1)];return La(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&La(`div`,{class:`cm-diagnosticSource`},t.source))}var qh=class extends Za{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return La(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},Jh=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=sle(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},Yh=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)tle(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=ole(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Hh(this.view.state.field(Gh).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=La(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=La(`div`,{class:`cm-panel-lint`},this.list,La(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>tle(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(Gh).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Gh),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new Jh(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Jh(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Hh(this.view.state.field(Gh).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Wh.of(t)})}static open(t){return new e(t)}};function cle(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Xh(e){return cle(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Zh=Yc.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:Xh(`#d11`)},".cm-lintRange-warning":{backgroundImage:Xh(`orange`)},".cm-lintRange-info":{backgroundImage:Xh(`#999`)},".cm-lintRange-hint":{backgroundImage:Xh(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function lle(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function ule(e){let t=`hint`,n=1;for(let r of e){let e=lle(r.severity);e>n&&(n=e,t=r.severity)}return t}var dle=[Gh,Yc.decorations.compute([Gh],e=>{let{selected:t,panel:n}=e.field(Gh);return!t||!n||t.from==t.to?$a.none:$a.set([Qce.range(t.from,t.to)])}),Oie($ce,{hideOn:Jce}),Zh],Qh=null;function fle(e){Qh=e}function ple(){return ale(async e=>{let t=e.state.doc,n=t.toString();if(!n.trim())return[];try{let e=await Ph.validateSQL.mutate({content:n});Qh&&Qh(e.annotations);let r=[];for(let n of e.diagnostics){let e=Math.min(n.line,t.lines),i=t.line(e),a=n.column==null?i.from:i.from+n.column,o=n.endColumn==null?i.to:i.from+n.endColumn;r.push({from:a,to:o,severity:n.severity===`info`?`info`:n.severity,message:n.message})}return r}catch{return[]}},{delay:500})}function mle(){return Oie((e,t)=>{let n=e.state.doc.lineAt(t),r=n.text.match(/^--\s+(QUERY|EXEC|MIGRATE|TESTDATA|TABLE)\s+(\S+)((?:\s+:\w+)*)/);if(!r)return null;let i=r[1],a=r[2],o=(r[3]||``).trim(),s=[];switch(i){case`QUERY`:s.push(`SELECT query — generates a typed function`);break;case`EXEC`:s.push(`Execute statement — INSERT/UPDATE/DELETE`);break;case`MIGRATE`:s.push(`Migration #${a} — runs on database initialization`);break;case`TESTDATA`:s.push(`Test data — inserted after migrations`);break;case`TABLE`:s.push(`Table definition for appender generation`);break}return o.includes(`:one`)&&s.push(`Returns a single row`),o.includes(`:pluck`)&&s.push(`Returns a single value (first column)`),o.includes(`:all`)&&s.push(`Returns all rows (default)`),o.includes(`:appender`)&&s.push(`Generates bulk insert appender`),s.length===0?null:{pos:n.from,end:n.to,above:!0,create(){let e=document.createElement(`div`);return e.style.cssText=`padding: 4px 8px; font-size: 12px; line-height: 1.5; max-width: 300px;`,e.innerHTML=s.map(e=>`<div>${e}</div>`).join(``),{dom:e}}}})}var hle=fr(`<div class="h-full w-full"></div>`);function gle(e,t){it(t,!0);let n,r,i=``,a=``;xr(()=>{fle(e=>{Ih.setAnnotations(e)});let e=Yc.updateListener.of(e=>{if(e.docChanged){let t=e.state.doc.toString();i=t,Lh.updateContent(t),Ih.setSQL(t)}}),t=el.of([{key:`Ctrl-Enter`,mac:`Cmd-Enter`,run:()=>(document.dispatchEvent(new CustomEvent(`sqg-run-query`)),!0)},{key:`Ctrl-s`,mac:`Cmd-s`,run:()=>(document.dispatchEvent(new CustomEvent(`sqg-save-file`)),!0)}]),o=ca.create({doc:Lh.activeTab.content,extensions:[Wi.highest(t),Hie(),Sie(),Wae(),el.of([...Zd,...noe]),D(),Kce(),ple(),mle(),xm,e,Yc.theme({"&":{height:`100%`},".cm-scroller":{overflow:`auto`}})]});i=Lh.activeTab.content,a=Lh.activeTabId,Ih.setSQL(i),r=new Yc({state:o,parent:n});let s=e=>{let t=e.detail;if(r){let e=r.state.selection.main.head;r.dispatch({changes:{from:e,insert:t}}),r.focus()}};document.addEventListener(`sqg-insert-text`,s);let c=e=>{let t=e.detail;if(r&&t>0&&t<=r.state.doc.lines){let e=r.state.doc.line(t);r.dispatch({selection:{anchor:e.from},effects:Yc.scrollIntoView(e.from,{y:`start`,yMargin:50})}),r.focus()}};return document.addEventListener(`sqg-scroll-to-line`,c),()=>{document.removeEventListener(`sqg-insert-text`,s),document.removeEventListener(`sqg-scroll-to-line`,c),r?.destroy()}}),fn(()=>{let e=Lh.activeTab;!r||!e||e.id!==a&&(a=e.id,i=e.content,r.dispatch({changes:{from:0,to:r.state.doc.length,insert:e.content}}),Ih.setSQL(e.content))}),fn(()=>{let e=Lh.activeTab;!r||!e||e.id!==a||e.content!==i&&!e.dirty&&(i=e.content,r.dispatch({changes:{from:0,to:r.state.doc.length,insert:e.content}}),Ih.setSQL(e.content))});var o=hle();$r(o,e=>n=e,()=>n),gr(e,o),at()}cee();var $h=pr(`<svg class="w-3 h-3 text-green-400/70 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4"></path></svg>`),_le=pr(`<svg class="w-3 h-3 text-blue-400/70 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>`),vle=pr(`<svg class="w-3 h-3 text-gray-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>`),yle=fr(`<span class="w-1.5 h-1.5 rounded-full bg-blue-400 flex-shrink-0"></span>`),ble=fr(`<button class="ml-1 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-gray-700 transition-opacity" title="Close tab"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>`),eg=fr(`<div role="tab" tabindex="0"><!> <span> </span> <!> <!></div>`),tg=fr(`<div class="flex items-center bg-gray-900 border-b border-gray-700 overflow-x-auto"></div>`);function ng(e,t){it(t,!1),ei();var n=tg();Er(n,5,()=>Lh.tabs,wr,(e,t)=>{var n=eg(),r=en(n),i=e=>{gr(e,$h())},a=e=>{gr(e,_le())},o=e=>{gr(e,vle())};Cr(r,e=>{w(t).type===`schema`?e(i):w(t).fileName?e(a,1):e(o,-1)});var s=nn(r,2),c=en(s,!0);We(s);var l=nn(s,2),u=e=>{gr(e,yle())};Cr(l,e=>{w(t).dirty&&e(u)});var d=nn(l,2),f=e=>{var n=ble();or(`click`,n,e=>{e.stopPropagation(),Lh.closeTab(w(t).id)}),gr(e,n)};Cr(d,e=>{Lh.tabs.length>1&&e(f)}),We(n),_n(()=>{qr(n,`aria-selected`,Lh.activeTabId===w(t).id),Ir(n,1,`group flex items-center gap-1.5 px-3 py-1.5 text-xs border-r border-gray-800 cursor-pointer transition-colors whitespace-nowrap select-none
13
+ ${Lh.activeTabId===w(t).id?`bg-gray-800 text-gray-200 border-b-2 border-b-blue-500`:`text-gray-500 hover:text-gray-300 hover:bg-gray-800/50`}`),_r(c,w(t).label)}),or(`click`,n,()=>Lh.switchTab(w(t).id)),or(`keydown`,n,e=>{e.key===`Enter`&&Lh.switchTab(w(t).id)}),gr(e,n)}),We(n),gr(e,n),at()}sr([`click`,`keydown`]);var rg={value:()=>{}};function ig(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ag(n)}function ag(e){this._=e}function xle(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ag.prototype=ig.prototype={constructor:ag,on:function(e,t){var n=this._,r=xle(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Sle(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Cle(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Cle(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ag(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Sle(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Cle(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=rg,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var wle={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function og(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),wle.hasOwnProperty(t)?{space:wle[t],local:e}:e}function Tle(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Ele(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sg(e){var t=og(e);return(t.local?Ele:Tle)(t)}function cg(){}function lg(e){return e==null?cg:function(){return this.querySelector(e)}}function Dle(e){typeof e!=`function`&&(e=lg(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new d_(r,this._parents)}function Ole(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ug(){return[]}function dg(e){return e==null?ug:function(){return this.querySelectorAll(e)}}function kle(e){return function(){return Ole(e.apply(this,arguments))}}function Ale(e){e=typeof e==`function`?kle(e):dg(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new d_(r,i)}function jle(e){return function(){return this.matches(e)}}function Mle(e){return function(t){return t.matches(e)}}var fg=Array.prototype.find;function pg(e){return function(){return fg.call(this.children,e)}}function Nle(){return this.firstElementChild}function mg(e){return this.select(e==null?Nle:pg(typeof e==`function`?e:Mle(e)))}var hg=Array.prototype.filter;function gg(){return Array.from(this.children)}function Ple(e){return function(){return hg.call(this.children,e)}}function _g(e){return this.selectAll(e==null?gg:Ple(typeof e==`function`?e:Mle(e)))}function Fle(e){typeof e!=`function`&&(e=jle(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new d_(r,this._parents)}function vg(e){return Array(e.length)}function yg(){return new d_(this._enter||this._groups.map(vg),this._parents)}function bg(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bg.prototype={constructor:bg,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xg(e){return function(){return e}}function Sg(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new bg(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Cg(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new bg(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Ile(e){return e.__data__}function wg(e,t){if(!arguments.length)return Array.from(this,Ile);var n=t?Cg:Sg,r=this._parents,i=this._groups;typeof e!=`function`&&(e=xg(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Lle(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new d_(o,r),o._enter=s,o._exit=c,o}function Lle(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Rle(){return new d_(this._exit||this._groups.map(vg),this._parents)}function Tg(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Eg(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new d_(s,this._parents)}function zle(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Ble(e){e||=Vle;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new d_(i,this._parents).order()}function Vle(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Hle(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ule(){return Array.from(this)}function Dg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Og(){let e=0;for(let t of this)++e;return e}function kg(){return!this.node()}function Ag(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function jg(e){return function(){this.removeAttribute(e)}}function Wle(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Mg(e,t){return function(){this.setAttribute(e,t)}}function Gle(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ng(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Pg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Kle(e,t){var n=og(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Wle:jg:typeof t==`function`?n.local?Pg:Ng:n.local?Gle:Mg)(n,t))}function Fg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qle(e){return function(){this.style.removeProperty(e)}}function Ig(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Jle(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Lg(e,t,n){return arguments.length>1?this.each((t==null?qle:typeof t==`function`?Jle:Ig)(e,t,n??``)):Rg(this.node(),e)}function Rg(e,t){return e.style.getPropertyValue(t)||Fg(e).getComputedStyle(e,null).getPropertyValue(t)}function zg(e){return function(){delete this[e]}}function Bg(e,t){return function(){this[e]=t}}function Vg(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Yle(e,t){return arguments.length>1?this.each((t==null?zg:typeof t==`function`?Vg:Bg)(e,t)):this.node()[e]}function Hg(e){return e.trim().split(/^|\s+/)}function Ug(e){return e.classList||new Xle(e)}function Xle(e){this._node=e,this._names=Hg(e.getAttribute(`class`)||``)}Xle.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Wg(e,t){for(var n=Ug(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Zle(e,t){for(var n=Ug(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Qle(e){return function(){Wg(this,e)}}function $le(e){return function(){Zle(this,e)}}function eue(e,t){return function(){(t.apply(this,arguments)?Wg:Zle)(this,e)}}function Gg(e,t){var n=Hg(e+``);if(arguments.length<2){for(var r=Ug(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?eue:t?Qle:$le)(n,t))}function Kg(){this.textContent=``}function qg(e){return function(){this.textContent=e}}function Jg(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function tue(e){return arguments.length?this.each(e==null?Kg:(typeof e==`function`?Jg:qg)(e)):this.node().textContent}function nue(){this.innerHTML=``}function Yg(e){return function(){this.innerHTML=e}}function rue(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Xg(e){return arguments.length?this.each(e==null?nue:(typeof e==`function`?rue:Yg)(e)):this.node().innerHTML}function Zg(){this.nextSibling&&this.parentNode.appendChild(this)}function Qg(){return this.each(Zg)}function $g(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function e_(){return this.each($g)}function t_(e){var t=typeof e==`function`?e:sg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function n_(){return null}function r_(e,t){var n=typeof e==`function`?e:sg(e),r=t==null?n_:typeof t==`function`?t:lg(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function i_(){var e=this.parentNode;e&&e.removeChild(this)}function iue(){return this.each(i_)}function a_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function aue(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function oue(e){return this.select(e?aue:a_)}function sue(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function cue(e){return function(t){e.call(this,t,this.__data__)}}function lue(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function uue(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function o_(e,t,n){return function(){var r=this.__on,i,a=cue(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function due(e,t,n){var r=lue(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?o_:uue,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function s_(e,t,n){var r=Fg(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function c_(e,t){return function(){return s_(this,e,t)}}function fue(e,t){return function(){return s_(this,e,t.apply(this,arguments))}}function pue(e,t){return this.each((typeof t==`function`?fue:c_)(e,t))}function*l_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var u_=[null];function d_(e,t){this._groups=e,this._parents=t}function f_(){return new d_([[document.documentElement]],u_)}function p_(){return this}d_.prototype=f_.prototype={constructor:d_,select:Dle,selectAll:Ale,selectChild:mg,selectChildren:_g,filter:Fle,data:wg,enter:yg,exit:Rle,join:Tg,merge:Eg,selection:p_,order:zle,sort:Ble,call:Hle,nodes:Ule,node:Dg,size:Og,empty:kg,each:Ag,attr:Kle,style:Lg,property:Yle,classed:Gg,text:tue,html:Xg,raise:Qg,lower:e_,append:t_,insert:r_,remove:iue,clone:oue,datum:sue,on:due,dispatch:pue,[Symbol.iterator]:l_};function m_(e){return typeof e==`string`?new d_([[document.querySelector(e)]],[document.documentElement]):new d_([[e]],u_)}function mue(e){let t;for(;t=e.sourceEvent;)e=t;return e}function h_(e,t){if(e=mue(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var hue={passive:!1},g_={capture:!0,passive:!1};function __(e){e.stopImmediatePropagation()}function v_(e){e.preventDefault(),e.stopImmediatePropagation()}function y_(e){var t=e.document.documentElement,n=m_(e).on(`dragstart.drag`,v_,g_);`onselectstart`in t?n.on(`selectstart.drag`,v_,g_):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function b_(e,t){var n=e.document.documentElement,r=m_(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,v_,g_),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var x_=e=>()=>e;function S_(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}S_.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function gue(e){return!e.ctrlKey&&!e.button}function C_(){return this.parentNode}function w_(e,t){return t??{x:e.x,y:e.y}}function T_(){return navigator.maxTouchPoints||`ontouchstart`in this}function E_(){var e=gue,t=C_,n=w_,r=T_,i={},a=ig(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,hue).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(m_(n.view).on(`mousemove.drag`,m,g_).on(`mouseup.drag`,h,g_),y_(n.view),__(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(v_(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){m_(e.view).on(`mousemove.drag mouseup.drag`,null),b_(e.view,l),v_(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(__(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(v_(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(__(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=h_(l||r,t),p,m,h;if((h=n.call(e,new S_(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=h_(l||a,t),_=o;break}u.call(r,e,new S_(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:x_(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:x_(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:x_(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:x_(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function D_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function O_(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function k_(){}var A_=.7,j_=1/A_,M_=`\\s*([+-]?\\d+)\\s*`,N_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,P_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,F_=/^#([0-9a-f]{3,8})$/,I_=RegExp(`^rgb\\(${M_},${M_},${M_}\\)$`),L_=RegExp(`^rgb\\(${P_},${P_},${P_}\\)$`),R_=RegExp(`^rgba\\(${M_},${M_},${M_},${N_}\\)$`),z_=RegExp(`^rgba\\(${P_},${P_},${P_},${N_}\\)$`),B_=RegExp(`^hsl\\(${N_},${P_},${P_}\\)$`),_ue=RegExp(`^hsla\\(${N_},${P_},${P_},${N_}\\)$`),V_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};D_(k_,K_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:H_,formatHex:H_,formatHex8:U_,formatHsl:W_,formatRgb:G_,toString:G_});function H_(){return this.rgb().formatHex()}function U_(){return this.rgb().formatHex8()}function W_(){return Tue(this).formatHsl()}function G_(){return this.rgb().formatRgb()}function K_(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=F_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vue(t):n===3?new J_(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?q_(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?q_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=I_.exec(e))?new J_(t[1],t[2],t[3],1):(t=L_.exec(e))?new J_(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=R_.exec(e))?q_(t[1],t[2],t[3],t[4]):(t=z_.exec(e))?q_(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=B_.exec(e))?wue(t[1],t[2]/100,t[3]/100,1):(t=_ue.exec(e))?wue(t[1],t[2]/100,t[3]/100,t[4]):V_.hasOwnProperty(e)?vue(V_[e]):e===`transparent`?new J_(NaN,NaN,NaN,0):null}function vue(e){return new J_(e>>16&255,e>>8&255,e&255,1)}function q_(e,t,n,r){return r<=0&&(e=t=n=NaN),new J_(e,t,n,r)}function yue(e){return e instanceof k_||(e=K_(e)),e?(e=e.rgb(),new J_(e.r,e.g,e.b,e.opacity)):new J_}function bue(e,t,n,r){return arguments.length===1?yue(e):new J_(e,t,n,r??1)}function J_(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}D_(J_,bue,O_(k_,{brighter(e){return e=e==null?j_:j_**+e,new J_(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?A_:A_**+e,new J_(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new J_(X_(this.r),X_(this.g),X_(this.b),Y_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xue,formatHex:xue,formatHex8:Sue,formatRgb:Cue,toString:Cue}));function xue(){return`#${Z_(this.r)}${Z_(this.g)}${Z_(this.b)}`}function Sue(){return`#${Z_(this.r)}${Z_(this.g)}${Z_(this.b)}${Z_((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cue(){let e=Y_(this.opacity);return`${e===1?`rgb(`:`rgba(`}${X_(this.r)}, ${X_(this.g)}, ${X_(this.b)}${e===1?`)`:`, ${e})`}`}function Y_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function X_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Z_(e){return e=X_(e),(e<16?`0`:``)+e.toString(16)}function wue(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Q_(e,t,n,r)}function Tue(e){if(e instanceof Q_)return new Q_(e.h,e.s,e.l,e.opacity);if(e instanceof k_||(e=K_(e)),!e)return new Q_;if(e instanceof Q_)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Q_(o,s,c,e.opacity)}function Eue(e,t,n,r){return arguments.length===1?Tue(e):new Q_(e,t,n,r??1)}function Q_(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}D_(Q_,Eue,O_(k_,{brighter(e){return e=e==null?j_:j_**+e,new Q_(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?A_:A_**+e,new Q_(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new J_(ev(e>=240?e-240:e+120,i,r),ev(e,i,r),ev(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Q_(Due(this.h),$_(this.s),$_(this.l),Y_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Y_(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Due(this.h)}, ${$_(this.s)*100}%, ${$_(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Due(e){return e=(e||0)%360,e<0?e+360:e}function $_(e){return Math.max(0,Math.min(1,e||0))}function ev(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var tv=e=>()=>e;function nv(e,t){return function(n){return e+n*t}}function rv(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function iv(e){return(e=+e)==1?av:function(t,n){return n-t?rv(t,n,e):tv(isNaN(t)?n:t)}}function av(e,t){var n=t-e;return n?nv(e,n):tv(isNaN(e)?t:e)}var ov=(function e(t){var n=iv(t);function r(e,t){var r=n((e=bue(e)).r,(t=bue(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=av(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function sv(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function cv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lv(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=vv(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function uv(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function dv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function fv(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=vv(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var pv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mv=new RegExp(pv.source,`g`);function hv(e){return function(){return e}}function gv(e){return function(t){return e(t)+``}}function _v(e,t){var n=pv.lastIndex=mv.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=pv.exec(e))&&(i=mv.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:dv(r,i)})),n=mv.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?gv(c[0].x):hv(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function vv(e,t){var n=typeof t,r;return t==null||n===`boolean`?tv(t):(n===`number`?dv:n===`string`?(r=K_(t))?(t=r,ov):_v:t instanceof K_?ov:t instanceof Date?uv:cv(t)?sv:Array.isArray(t)?lv:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?fv:dv)(e,t)}var yv=180/Math.PI,bv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xv(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*yv,skewX:Math.atan(c)*yv,scaleX:o,scaleY:s}}var Sv;function Cv(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?bv:xv(t.a,t.b,t.c,t.d,t.e,t.f)}function wv(e){return e==null||(Sv||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Sv.setAttribute(`transform`,e),!(e=Sv.transform.baseVal.consolidate()))?bv:(e=e.matrix,xv(e.a,e.b,e.c,e.d,e.e,e.f))}function Tv(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:dv(e,i)},{i:c-2,x:dv(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:dv(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:dv(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:dv(e,n)},{i:s-2,x:dv(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Ev=Tv(Cv,`px, `,`px)`,`deg)`),Dv=Tv(wv,`, `,`)`,`)`),Ov=1e-12;function kv(e){return((e=Math.exp(e))+1/e)/2}function Av(e){return((e=Math.exp(e))-1/e)/2}function jv(e){return((e=Math.exp(2*e))-1)/(e+1)}var Mv=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Ov)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=kv(y),c=s/(n*g)*(i*jv(t*r+y)-Av(y));return[a+c*d,o+c*f,s*i/kv(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),Nv=0,Pv=0,Fv=0,Iv=1e3,Lv,Rv,zv=0,Bv=0,Vv=0,Hv=typeof performance==`object`&&performance.now?performance:Date,Uv=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wv(){return Bv||=(Uv(Gv),Hv.now()+Vv)}function Gv(){Bv=0}function Kv(){this._call=this._time=this._next=null}Kv.prototype=qv.prototype={constructor:Kv,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Wv():+n)+(t==null?0:+t),!this._next&&Rv!==this&&(Rv?Rv._next=this:Lv=this,Rv=this),this._call=e,this._time=n,Xv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xv())}};function qv(e,t,n){var r=new Kv;return r.restart(e,t,n),r}function Jv(){Wv(),++Nv;for(var e=Lv,t;e;)(t=Bv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nv}function Yv(){Bv=(zv=Hv.now())+Vv,Nv=Pv=0;try{Jv()}finally{Nv=0,kue(),Bv=0}}function Oue(){var e=Hv.now(),t=e-zv;t>Iv&&(Vv-=t,zv=e)}function kue(){for(var e,t=Lv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Lv=n);Rv=e,Xv(r)}function Xv(e){Nv||(Pv&&=clearTimeout(Pv),e-Bv>24?(e<1/0&&(Pv=setTimeout(Yv,e-Hv.now()-Vv)),Fv&&=clearInterval(Fv)):(Fv||=(zv=Hv.now(),setInterval(Oue,Iv)),Nv=1,Uv(Yv)))}function Zv(e,t,n){var r=new Kv;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Qv=ig(`start`,`end`,`cancel`,`interrupt`),$v=[];function ey(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Aue(e,n,{name:t,index:r,group:i,on:Qv,tween:$v,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function ty(e,t){var n=ry(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function ny(e,t){var n=ry(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function ry(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Aue(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qv(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Zv(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Zv(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function iy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function jue(e){return this.each(function(){iy(this,e)})}function ay(e,t){var n,r;return function(){var i=ny(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function oy(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=ny(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function sy(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=ry(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?ay:oy)(n,e,t))}function cy(e,t,n){var r=e._id;return e.each(function(){var e=ny(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return ry(e,r).value[t]}}function ly(e,t){var n;return(typeof t==`number`?dv:t instanceof K_?ov:(n=K_(t))?(t=n,ov):_v)(e,t)}function uy(e){return function(){this.removeAttribute(e)}}function dy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fy(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function py(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function my(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function hy(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function gy(e,t){var n=og(e),r=n===`transform`?Dv:ly;return this.attrTween(e,typeof t==`function`?(n.local?hy:my)(n,r,cy(this,`attr.`+e,t)):t==null?(n.local?dy:uy)(n):(n.local?py:fy)(n,r,t))}function _y(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yy(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&vy(e,i)),n}return i._value=t,i}function by(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&_y(e,i)),n}return i._value=t,i}function xy(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=og(e);return this.tween(n,(r.local?yy:by)(r,t))}function Sy(e,t){return function(){ty(this,e).delay=+t.apply(this,arguments)}}function Mue(e,t){return t=+t,function(){ty(this,e).delay=t}}function Nue(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Sy:Mue)(t,e)):ry(this.node(),t).delay}function Pue(e,t){return function(){ny(this,e).duration=+t.apply(this,arguments)}}function Fue(e,t){return t=+t,function(){ny(this,e).duration=t}}function Iue(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Pue:Fue)(t,e)):ry(this.node(),t).duration}function Lue(e,t){if(typeof t!=`function`)throw Error();return function(){ny(this,e).ease=t}}function Rue(e){var t=this._id;return arguments.length?this.each(Lue(t,e)):ry(this.node(),t).ease}function zue(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();ny(this,e).ease=n}}function Cy(e){if(typeof e!=`function`)throw Error();return this.each(zue(this._id,e))}function wy(e){typeof e!=`function`&&(e=jle(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Ky(r,this._parents,this._name,this._id)}function Ty(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Ky(o,this._parents,this._name,this._id)}function Ey(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Dy(e,t,n){var r,i,a=Ey(t)?ty:ny;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Oy(e,t){var n=this._id;return arguments.length<2?ry(this.node(),n).on.on(e):this.each(Dy(n,e,t))}function ky(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ay(){return this.on(`end.remove`,ky(this._id))}function jy(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=lg(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,ey(l[f],t,n,f,l,ry(u,n)));return new Ky(a,this._parents,t,n)}function My(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=dg(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=ry(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&ey(p,t,n,h,f,m);a.push(f),o.push(u)}return new Ky(a,o,t,n)}var Ny=f_.prototype.constructor;function Py(){return new Ny(this._groups,this._parents)}function Fy(e,t){var n,r,i;return function(){var a=Rg(this,e),o=(this.style.removeProperty(e),Rg(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Iy(e){return function(){this.style.removeProperty(e)}}function Ly(e,t,n){var r,i=n+``,a;return function(){var o=Rg(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Ry(e,t,n){var r,i,a;return function(){var o=Rg(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Rg(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function zy(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=ny(this,e),l=c.on,u=c.value[a]==null?s||=Iy(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function By(e,t,n){var r=(e+=``)==`transform`?Ev:ly;return t==null?this.styleTween(e,Fy(e,r)).on(`end.style.`+e,Iy(e)):typeof t==`function`?this.styleTween(e,Ry(e,r,cy(this,`style.`+e,t))).each(zy(this._id,e)):this.styleTween(e,Ly(e,r,t),n).on(`end.style.`+e,null)}function Vy(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Hy(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Vy(e,a,n)),r}return a._value=t,a}function Uy(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Hy(e,t,n??``))}function Wy(e){return function(){this.textContent=e}}function k(e){return function(){var t=e(this);this.textContent=t??``}}function Bue(e){return this.tween(`text`,typeof e==`function`?k(cy(this,`text`,e)):Wy(e==null?``:e+``))}function Vue(e){return function(t){this.textContent=e.call(this,t)}}function Hue(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Vue(r)),t}return r._value=e,r}function Uue(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Hue(e))}function Wue(){for(var e=this._name,t=this._id,n=qy(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=ry(c,t);ey(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ky(r,this._parents,e,n)}function Gue(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=ny(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Gy=0;function Ky(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Kue(e){return f_().transition(e)}function qy(){return++Gy}var Jy=f_.prototype;Ky.prototype=Kue.prototype={constructor:Ky,select:jy,selectAll:My,selectChild:Jy.selectChild,selectChildren:Jy.selectChildren,filter:wy,merge:Ty,selection:Py,transition:Wue,call:Jy.call,nodes:Jy.nodes,node:Jy.node,size:Jy.size,empty:Jy.empty,each:Jy.each,on:Oy,attr:gy,attrTween:xy,style:By,styleTween:Uy,text:Bue,textTween:Uue,remove:Ay,tween:sy,delay:Nue,duration:Iue,ease:Rue,easeVarying:Cy,end:Gue,[Symbol.iterator]:Jy[Symbol.iterator]};function que(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Jue={time:null,delay:0,duration:250,ease:que};function Yue(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Xue(e){var t,n;e instanceof Ky?(t=e._id,e=e._name):(t=qy(),(n=Jue).time=Wv(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&ey(c,e,t,l,o,n||Yue(c,t));return new Ky(r,this._parents,e,t)}f_.prototype.interrupt=jue,f_.prototype.transition=Xue;var Yy=e=>()=>e;function Zue(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Xy(e,t,n){this.k=e,this.x=t,this.y=n}Xy.prototype={constructor:Xy,scale:function(e){return e===1?this:new Xy(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xy(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Zy=new Xy(1,0,0);Qy.prototype=Xy.prototype;function Qy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Zy;return e.__zoom}function $y(e){e.stopImmediatePropagation()}function eb(e){e.preventDefault(),e.stopImmediatePropagation()}function tb(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function nb(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function rb(){return this.__zoom||Zy}function ib(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Que(){return navigator.maxTouchPoints||`ontouchstart`in this}function ab(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function $ue(){var e=tb,t=nb,n=ab,r=ib,i=Que,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Mv,l=ig(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,rb).on(`wheel.zoom`,te,{passive:!1}).on(`mousedown.zoom`,ne).on(`dblclick.zoom`,C).filter(i).on(`touchstart.zoom`,re).on(`touchmove.zoom`,ie).on(`touchend.zoom touchcancel.zoom`,ae).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,rb),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Zy.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Xy(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Xy(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Xy(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new ee(e,t)}function ee(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}ee.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=m_(this.that).datum();l.call(e,this.that,new Zue(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function te(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=h_(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],iy(this),s.start();eb(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function ne(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=m_(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=h_(t,i),l=t.clientX,u=t.clientY;y_(t.view),$y(t),a.mouse=[c,this.__zoom.invert(c)],iy(this),a.start();function d(e){if(eb(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=h_(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),b_(e.view,a.moved),eb(e),a.event(e).end()}}function C(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=h_(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);eb(r),s>0?m_(this).transition().duration(s).call(x,d,c,r):m_(this).call(_.transform,d,c,r)}}function re(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for($y(t),s=0;s<i;++s)c=r[s],l=h_(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),iy(this),a.start())}}function ie(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(eb(e),s=0;s<a;++s)c=i[s],l=h_(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function ae(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for($y(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=h_(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=m_(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Yy(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Yy(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Yy(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Yy([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var ob={error001:()=>`[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The React Flow parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`},sb=[[-1/0,-1/0],[1/0,1/0]],ede=[`Enter`,` `,`Escape`],tde={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},cb;(function(e){e.Strict=`strict`,e.Loose=`loose`})(cb||={});var lb;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(lb||={});var ub;(function(e){e.Partial=`partial`,e.Full=`full`})(ub||={});var nde={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},db;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(db||={});var fb;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(fb||={});var pb;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(pb||={});var rde={[pb.Left]:pb.Right,[pb.Right]:pb.Left,[pb.Top]:pb.Bottom,[pb.Bottom]:pb.Top};function ide(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(let n of e.keys())if(!t.has(n))return!1;return!0}function ade(e,t,n){if(!n)return;let r=[];e.forEach((e,n)=>{t?.has(n)||r.push(e)}),r.length&&n(r)}function ode(e){return e===null?null:e?`valid`:`invalid`}var mb=e=>`id`in e&&`source`in e&&`target`in e,hb=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),gb=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),_b=(e,t=[0,0])=>{let{width:n,height:r}=Gb(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},A=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:jb(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):gb(n)?n:t.nodeLookup.get(n.id)),kb(e,i?Nb(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),vb=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=kb(n,Nb(e)),r=!0)}),r?jb(n):{x:0,y:0,width:0,height:0}},yb=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...zb(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=Pb(s,Mb(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},bb=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function xb(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Sb({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);let s=Hb(vb(xb(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)}function Cb({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,ob.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&Wb(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Wb(d)?Tb(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,ob.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function sde({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=bb(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var wb=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Tb=(e={x:0,y:0},t,n)=>({x:wb(e.x,t[0][0],t[1][0]-(n?.width??0)),y:wb(e.y,t[0][1],t[1][1]-(n?.height??0))});function Eb(e,t,n){let{width:r,height:i}=Gb(n),{x:a,y:o}=n.internals.positionAbsolute;return Tb(e,[[a,o],[a+r,o+i]],t)}var Db=(e,t,n)=>e<t?wb(Math.abs(e-t),1,t)/t:e>n?-wb(Math.abs(e-n),1,t)/t:0,Ob=(e,t,n=15,r=40)=>[Db(e.x,r,t.width-r)*n,Db(e.y,r,t.height-r)*n],kb=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ab=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),jb=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Mb=(e,t=[0,0])=>{let{x:n,y:r}=gb(e)?e.internals.positionAbsolute:_b(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Nb=(e,t=[0,0])=>{let{x:n,y:r}=gb(e)?e.internals.positionAbsolute:_b(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},cde=(e,t)=>jb(kb(Ab(e),Ab(t))),Pb=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Fb=e=>Ib(e.width)&&Ib(e.height)&&Ib(e.x)&&Ib(e.y),Ib=e=>!isNaN(e)&&isFinite(e),Lb=(e,t)=>{},Rb=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),zb=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Rb(s,o):s},Bb=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Vb(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function lde(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Vb(e,n),i=Vb(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Vb(e.top??e.y??0,n),i=Vb(e.bottom??e.y??0,n),a=Vb(e.left??e.x??0,t),o=Vb(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ude(e,t,n,r,i,a){let{x:o,y:s}=Bb(e,[t,n,r]),{x:c,y:l}=Bb({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Hb=(e,t,n,r,i,a)=>{let o=lde(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=wb(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=ude(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Ub=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Wb(e){return e!=null&&e!==`parent`}function Gb(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function dde(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function fde(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function pde(e){return{...tde,...e||{}}}function Kb(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Xb(e),s=zb({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Rb(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var mde=e=>({width:e.offsetWidth,height:e.offsetHeight}),qb=e=>e?.getRootNode?.()||window?.document,Jb=[`INPUT`,`SELECT`,`TEXTAREA`];function Yb(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Jb.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var hde=e=>`clientX`in e,Xb=(e,t)=>{let n=hde(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Zb=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...mde(t)}})};function gde({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function Qb(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function $b({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case pb.Left:return[t-Qb(t-r,a),n];case pb.Right:return[t+Qb(r-t,a),n];case pb.Top:return[t,n-Qb(n-i,a)];case pb.Bottom:return[t,n+Qb(i-n,a)]}}function ex({sourceX:e,sourceY:t,sourcePosition:n=pb.Bottom,targetX:r,targetY:i,targetPosition:a=pb.Top,curvature:o=.25}){let[s,c]=$b({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=$b({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=gde({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function tx({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function nx({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function rx({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=kb(Nb(e),Nb(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Pb({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},jb(a))>0}var _de=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,ix=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),ax=(e,t,n={})=>{if(!e.source||!e.target)return ob.error006(),t;let r=n.getEdgeId||_de,i;return i=mb(e)?{...e}:{...e,id:r(e)},ix(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ox({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=tx({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var sx={[pb.Left]:{x:-1,y:0},[pb.Right]:{x:1,y:0},[pb.Top]:{x:0,y:-1},[pb.Bottom]:{x:0,y:1}},vde=({source:e,sourcePosition:t=pb.Bottom,target:n})=>t===pb.Left||t===pb.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},yde=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function bde({source:e,sourcePosition:t=pb.Bottom,target:n,targetPosition:r=pb.Top,center:i,offset:a,stepPosition:o}){let s=sx[t],c=sx[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=vde({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=tx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...m,{x:u.x+v.x,y:u.y+v.y},n],h,g,y,b]}function xde(e,t,n,r){let i=Math.min(yde(e,t)/2,yde(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function cx({sourceX:e,sourceY:t,sourcePosition:n=pb.Bottom,targetX:r,targetY:i,targetPosition:a=pb.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=bde({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u});return[d.reduce((e,t,n)=>{let r=``;return r=n>0&&n<d.length-1?xde(d[n-1],t,d[n+1],o):`${n===0?`M`:`L`}${t.x} ${t.y}`,e+=r,e},``),f,p,m,h]}function Sde(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Cde(e){let{sourceNode:t,targetNode:n}=e;if(!Sde(t)||!Sde(n))return null;let r=t.internals.handleBounds||wde(t.handles),i=n.internals.handleBounds||wde(n.handles),a=ux(r?.source??[],e.sourceHandle),o=ux(e.connectionMode===cb.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,ob.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||pb.Bottom,c=o?.position||pb.Top,l=lx(t,a,s),u=lx(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function wde(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function lx(e,t,n=pb.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??Gb(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case pb.Top:return{x:i+o/2,y:a};case pb.Right:return{x:i+o,y:a+s/2};case pb.Bottom:return{x:i+o/2,y:a+s};case pb.Left:return{x:i,y:a+s/2}}}function ux(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function dx(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Tde(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=dx(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var fx=1e3,px=10,mx={nodeOrigin:[0,0],nodeExtent:sb,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},hx={...mx,checkEquality:!0};function gx(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function _x(e,t,n){let r=gx(mx,n);for(let n of e.values())if(n.parentId)xx(n,e,t,r);else{let e=Tb(_b(n,r.nodeOrigin),Wb(n.extent)?n.extent:r.nodeExtent,Gb(n));n.internals.positionAbsolute=e}}function vx(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function yx(e){return e===`manual`}function bx(e,t,n,r={}){let i=gx(hx,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!yx(i.zIndexMode)?fx:0,c=e.length>0;t.clear(),n.clear();for(let l of e){let e=o.get(l.id);if(i.checkEquality&&l===e?.internals.userNode)t.set(l.id,e);else{let n=Tb(_b(l,i.nodeOrigin),Wb(l.extent)?l.extent:i.nodeExtent,Gb(l));e={...i.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:n,handleBounds:vx(l,e),z:Sx(l,s,i.zIndexMode),userNode:l}},t.set(l.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),l.parentId&&xx(e,t,n,r,a)}return c}function Ede(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function xx(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=gx(mx,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Ede(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*px),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Dde(e,u,o,s,a&&!yx(c)?fx:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function Sx(e,t,n){let r=Ib(e.zIndex)?e.zIndex:0;return yx(n)?r:r+(e.selected?t:0)}function Dde(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Gb(e),l=_b(e,n),u=Wb(e.extent)?Tb(l,e.extent,c):l,d=Tb({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Eb(d,c,t));let f=Sx(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Cx(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=cde(a.get(n.parentId)?.expandedRect??Mb(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=Gb(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function wx(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=mde(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Wb(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;e.parentId&&e.extent===`parent`?h=Eb(h,s,t.get(e.parentId)):m&&(h=Tb(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Zb(`source`,r.nodeElement,p,d,e.id),target:Zb(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&xx(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Mb(g,i)}))}}if(f.length>0){let e=Cx(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Tx({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),s=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(s)}function Ex(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function Dx(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;Ex(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),Ex(`target`,s,c,e,i,o),t.set(r.id,r)}}function Ox(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Ox(n,t):!1}function kx(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Ax(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Ox(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function jx({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Ode({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=Rb(a,t);return{x:o.x-a.x,y:o.y-a.y}}function kde({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=m_(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Ab(vb(s)):null,x=v&&l?Ode({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:Rb(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Cb({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=jx({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function ee(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Ob(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(ee)}function te(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=Kb(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Ax(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=jx({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let ne=E_().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&te(e),a=Kb(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Xb(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Kb(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,ee()),!d){let t=Xb(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&te(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=Xb(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!(!d||p)&&(c=!1,d=!1,cancelAnimationFrame(o),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=jx({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!kx(t,`.${g}`,v))&&(!_||kx(t,_,v))});f.call(ne)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Mx(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Pb(i,Mb(e))>0&&r.push(e);return r}var Nx=250;function Ade(e,t,n,r){let i=[],a=1/0,o=Mx(e,n,t+Nx);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=lx(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Px(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...lx(o,c,c.position,!0)}:c}function jde(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Mde(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Nde=()=>!0;function Pde(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=Nde,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:ee=1,handleDomNode:te}){let ne=qb(e.target),C=0,re,{x:ie,y:ae}=Xb(e),oe=jde(a,te),se=s?.getBoundingClientRect(),ce=!1;if(!se||!oe)return;let le=Px(i,oe,r,c,t);if(!le)return;let ue=Xb(e,se),de=!1,fe=null,pe=!1,me=null;function he(){if(!u||!se)return;let[e,t]=Ob(ue,se,S);f({x:e,y:t}),C=requestAnimationFrame(he)}let ge={...le,nodeId:i,type:oe,position:le.position},_e=c.get(i),ve={inProgress:!0,isValid:null,from:lx(_e,ge,pb.Left,!0),fromHandle:ge,fromPosition:ge.position,fromNode:_e,to:ue,toHandle:null,toPosition:rde[ge.position],toNode:null,pointer:ue};function ye(){ce=!0,y(ve),m?.(e,{nodeId:i,handleId:r,handleType:oe})}ee===0&&ye();function be(e){if(!ce){let{x:t,y:n}=Xb(e),r=t-ie,i=n-ae;if(!(r*r+i*i>ee*ee))return;ye()}if(!x()||!ge){xe(e);return}let a=b();ue=Xb(e,se),re=Ade(zb(ue,a,!1,[1,1]),n,c,ge),de||=(he(),!0);let s=Fde(e,{handle:re,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:ne,lib:l,flowId:d,nodeLookup:c});me=s.handleDomNode,fe=s.connection,pe=Mde(!!re,s.isValid);let u=c.get(i),f=u?lx(u,ge,pb.Left,!0):ve.from,p={...ve,from:f,isValid:pe,to:s.toHandle&&pe?Bb({x:s.toHandle.x,y:s.toHandle.y},a):ue,toHandle:s.toHandle,toPosition:pe&&s.toHandle?s.toHandle.position:rde[ge.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:ue};y(p),ve=p}function xe(e){if(!(`touches`in e&&e.touches.length>0)){if(ce){(re||me)&&fe&&pe&&h?.(fe);let{inProgress:t,...n}=ve,r={...n,toPosition:ve.toHandle?ve.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(C),de=!1,pe=!1,fe=null,me=null,ne.removeEventListener(`mousemove`,be),ne.removeEventListener(`mouseup`,xe),ne.removeEventListener(`touchmove`,be),ne.removeEventListener(`touchend`,xe)}}ne.addEventListener(`mousemove`,be),ne.addEventListener(`mouseup`,xe),ne.addEventListener(`touchmove`,be),ne.addEventListener(`touchend`,xe)}function Fde(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Nde,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Xb(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=jde(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===cb.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Px(t,e,a,u,n,!0)}return _}var Ide={onPointerDown:Pde,isValid:Fde},Fx=e=>({x:e.x,y:e.y,zoom:e.k}),Ix=({x:e,y:t,zoom:n})=>Zy.translate(e,t).scale(n),Lx=(e,t)=>e.target.closest(`.${t}`),Rx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Lde=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,zx=(e,t=0,n=Lde,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},Rde=e=>{let t=e.ctrlKey&&Ub()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Bx({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Lx(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=h_(u),t=d*2**Rde(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===lb.Vertical?0:u.deltaX*f,m=i===lb.Horizontal?0:u.deltaY*f;!Ub()&&u.shiftKey&&i!==lb.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Fx(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}function zde({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=Lx(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function Bde({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Fx(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Vde({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&Rx(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Fx(a.transform))}}function Vx({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&Rx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Fx(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function Hx({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(Lx(d,`${l}-flow__node`)||Lx(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||Lx(d,s)&&m||Lx(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function Hde({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=$ue().scaleExtent([t,n]).translateExtent(r),f=m_(e).call(d);v({x:i.x,y:i.y,zoom:wb(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let p=f.on(`wheel.zoom`),m=f.on(`dblclick.zoom`);d.wheelDelta(Rde);function h(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?vv:Mv).transform(zx(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:g,preventScrolling:v,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:ee,onTransformChange:te,connectionInProgress:ne,paneClickDistance:C,selectionOnDrag:re}){r&&!l.isZoomingOrPanning&&_();let ie=i&&!S&&!r;d.clickDistance(re?1/0:!Ib(C)||C<0?0:C);let ae=ie?Bx({zoomPanValues:l,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):zde({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});if(f.on(`wheel.zoom`,ae,{passive:!1}),!r){let e=Bde({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});d.on(`start`,e);let t=Vde({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:te});d.on(`zoom`,t);let r=Vx({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});d.on(`end`,r)}let oe=Hx({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:ee,connectionInProgress:ne});d.filter(oe),x?f.on(`dblclick.zoom`,m):f.on(`dblclick.zoom`,null)}function _(){d.on(`zoom`,null)}async function v(e,t,n){let r=Ix(e),i=d?.constrain()(r,t,n);return i&&await h(i),new Promise(e=>e(i))}async function y(e,t){let n=Ix(e);return await h(n,t),new Promise(e=>e(n))}function b(e){if(f){let t=Ix(e),n=f.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}}function x(){let e=f?Qy(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}function S(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?vv:Mv).scaleTo(zx(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function ee(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?vv:Mv).scaleBy(zx(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function te(e){d?.scaleExtent(e)}function ne(e){d?.translateExtent(e)}function C(e){let t=!Ib(e)||e<0?0:e;d?.clickDistance(t)}return{update:g,destroy:_,setViewport:y,setViewportConstrained:v,getViewport:x,scaleTo:S,scaleBy:ee,setScaleExtent:te,setTranslateExtent:ne,syncViewport:b,setClickDistance:C}}var Ude;(function(e){e.Line=`line`,e.Handle=`handle`})(Ude||={});function Ux(){let e={};return[t=>{if(t&&!lee(e))throw Error(t);return nt(e)},t=>rt(e,t)]}var[Wde,Gde]=Ux(),[Kde,Wx]=Ux(),[Gx,Kx]=Ux(),qde=fr(`<div><!></div>`);function qx(e,t){it(t,!0);let n=ii(t,`id`,3,null),r=ii(t,`type`,3,`source`),i=ii(t,`position`,19,()=>pb.Top),a=ii(t,`isConnectableStart`,3,!0),o=ii(t,`isConnectableEnd`,3,!0),s=ni(t,[`$$slots`,`$$events`,`$$legacy`,`id`,`type`,`position`,`style`,`class`,`isConnectable`,`isConnectableStart`,`isConnectableEnd`,`isValidConnection`,`onconnect`,`ondisconnect`,`children`]),c=Wde(`Handle must be used within a Custom Node component`),l=Kde(`Handle must be used within a Custom Node component`),u=It(()=>r()===`target`),d=It(()=>t.isConnectable===void 0?l.value:t.isConnectable),f=pS(),p=It(()=>f.ariaLabelConfig),m=null;mn(()=>{if(t.onconnect||t.ondisconnect){f.edges;let e=f.connectionLookup.get(`${c}-${r()}${n()?`-${n()}`:``}`);if(m&&!ide(e,m)){let n=e??new Map;ade(m,n,t.ondisconnect),ade(n,m,t.onconnect)}m=new Map(e)}});let h=It(()=>{if(!f.connection.inProgress)return[!1,!1,!1,!1,null];let{fromHandle:e,toHandle:t,isValid:i}=f.connection,a=e&&e.nodeId===c&&e.type===r()&&e.id===n(),o=t&&t.nodeId===c&&t.type===r()&&t.id===n();return[!0,a,o,f.connectionMode===cb.Strict?e?.type!==r():c!==e?.nodeId||n()!==e?.id,o&&i]}),g=It(()=>oe(w(h),5)),_=It(()=>w(g)[0]),v=It(()=>w(g)[1]),y=It(()=>w(g)[2]),b=It(()=>w(g)[3]),x=It(()=>w(g)[4]);function S(e){let t=f.onbeforeconnect?f.onbeforeconnect(e):e;t&&(f.addEdge(t),f.onconnect?.(e))}function ee(e){let r=hde(e);e.currentTarget&&(r&&e.button===0||!r)&&Ide.onPointerDown(e,{handleId:n(),nodeId:c,isTarget:w(u),connectionRadius:f.connectionRadius,domNode:f.domNode,nodeLookup:f.nodeLookup,connectionMode:f.connectionMode,lib:`svelte`,autoPanOnConnect:f.autoPanOnConnect,autoPanSpeed:f.autoPanSpeed,flowId:f.flowId,isValidConnection:t.isValidConnection||((...e)=>f.isValidConnection?.(...e)??!0),updateConnection:f.updateConnection,cancelConnection:f.cancelConnection,panBy:f.panBy,onConnect:S,onConnectStart:f.onconnectstart,onConnectEnd:(...e)=>f.onconnectend?.(...e),getTransform:()=>[f.viewport.x,f.viewport.y,f.viewport.zoom],getFromHandle:()=>f.connection.fromHandle,dragThreshold:f.connectionDragThreshold,handleDomNode:e.currentTarget})}function te(e){if(!c||!f.clickConnectStartHandle&&!a())return;if(!f.clickConnectStartHandle){f.onclickconnectstart?.(e,{nodeId:c,handleId:n(),handleType:r()}),f.clickConnectStartHandle={nodeId:c,type:r(),id:n()};return}let i=qb(e.target),o=t.isValidConnection??f.isValidConnection,{connectionMode:s,clickConnectStartHandle:l,flowId:u,nodeLookup:d}=f,{connection:p,isValid:m}=Ide.isValid(e,{handle:{nodeId:c,id:n(),type:r()},connectionMode:s,fromNodeId:l.nodeId,fromHandleId:l.id??null,fromType:l.type,isValidConnection:o,flowId:u,doc:i,lib:`svelte`,nodeLookup:d});m&&p&&S(p);let h=structuredClone(Qe(f.connection));delete h.inProgress,h.toPosition=h.toHandle?h.toHandle.position:null,f.onclickconnectend?.(e,h),f.clickConnectStartHandle=null}var C=qde(),re=()=>{};Jr(C,()=>({"data-handleid":n(),"data-nodeid":c,"data-handlepos":i(),"data-id":`${f.flowId??``}-${c??``}-${n()??`null`??``}-${r()??``}`,class:[`svelte-flow__handle`,`svelte-flow__handle-${i()}`,f.noDragClass,f.noPanClass,i(),t.class],onmousedown:ee,ontouchstart:ee,onclick:f.clickConnect?te:void 0,onkeypress:re,style:t.style,role:`button`,"aria-label":w(p)[`handle.ariaLabel`],tabindex:`-1`,...s,[Vr]:{valid:w(x),connectingto:w(y),connectingfrom:w(v),source:!w(u),target:w(u),connectablestart:a(),connectableend:o(),connectable:w(d),connectionindicator:w(d)&&(!w(_)||w(b))&&(w(_)||f.clickConnectStartHandle?o():a())}})),br(en(C),()=>t.children??ne),We(C),gr(e,C),at()}var Jx=fr(`<!> <!>`,1);function Yx(e,t){it(t,!0);let n=ii(t,`targetPosition`,19,()=>pb.Top),r=ii(t,`sourcePosition`,19,()=>pb.Bottom);var i=Jx(),a=tn(i);qx(a,{type:`target`,get position(){return n()}});var o=nn(a);qx(nn(o),{type:`source`,get position(){return r()}}),_n(()=>_r(o,` ${t.data?.label??``} `)),gr(e,i),at()}var Xx=fr(` <!>`,1);function Zx(e,t){it(t,!0);let n=ii(t,`data`,19,()=>({label:`Node`})),r=ii(t,`sourcePosition`,19,()=>pb.Bottom);Ge();var i=Xx(),a=tn(i);qx(nn(a),{type:`source`,get position(){return r()}}),_n(()=>_r(a,`${n()?.label??``} `)),gr(e,i),at()}var Jde=fr(` <!>`,1);function Qx(e,t){it(t,!0);let n=ii(t,`data`,19,()=>({label:`Node`})),r=ii(t,`targetPosition`,19,()=>pb.Top);Ge();var i=Jde(),a=tn(i);qx(nn(a),{type:`target`,get position(){return r()}}),_n(()=>_r(a,`${n()?.label??``} `)),gr(e,i),at()}function $x(e,t){}function eS(e,t,n){if(!n||!t)return;let r=n===`root`?t:t.querySelector(`.svelte-flow__${n}`);r&&r.appendChild(e)}function Yde(e,t){let n=It(pS),r=It(()=>w(n).domNode),i;return w(r)?eS(e,w(r),t):i=Kee(()=>{fn(()=>{eS(e,w(r),t),i?.()})}),{async update(t){eS(e,w(r),t)},destroy(){e.parentNode&&e.parentNode.removeChild(e),i?.()}}}function Xde(){let e=Wt(typeof window>`u`);if(w(e)){let t=Kee(()=>{fn(()=>{Gt(e,!1),t?.()})})}return{get value(){return w(e)}}}var Zde=e=>hb(e),Qde=e=>mb(e);function tS(e){return e===void 0?void 0:`${e}px`}var nS={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$de=fr(`<div><!></div>`);function rS(e,t){it(t,!0);let n=ii(t,`x`,3,0),r=ii(t,`y`,3,0),i=ii(t,`selectEdgeOnClick`,3,!1),a=ii(t,`transparent`,3,!1),o=ni(t,[`$$slots`,`$$events`,`$$legacy`,`x`,`y`,`width`,`height`,`selectEdgeOnClick`,`transparent`,`class`,`children`]),s=pS(),c=Gx(`EdgeLabel must be used within a Custom Edge component`),l=It(()=>s.visible.edges.get(c)?.zIndex);var u=$de(),d=()=>{i()&&c&&s.handleEdgeSelection(c)};Jr(u,e=>({class:[`svelte-flow__edge-label`,{transparent:a()},t.class],tabindex:`-1`,onclick:d,...o,[Hr]:e}),[()=>({display:Xde().value?`none`:void 0,cursor:i()?`pointer`:void 0,transform:`translate(-50%, -50%) translate(${n()??``}px,${r()??``}px)`,"pointer-events":`all`,width:tS(t.width),height:tS(t.height),"z-index":w(l)})],void 0,void 0,`svelte-190ul31`),br(en(u),()=>t.children??ne),We(u),jr(u,(e,t)=>Yde?.(e,t),()=>`edge-labels`),gr(e,u),at()}var efe=pr(`<path></path>`),tfe=pr(`<path fill="none"></path><!><!>`,1);function iS(e,t){let n=ii(t,`interactionWidth`,3,20),r=ni(t,[`$$slots`,`$$events`,`$$legacy`,`id`,`path`,`label`,`labelX`,`labelY`,`labelStyle`,`markerStart`,`markerEnd`,`style`,`interactionWidth`,`class`]);var i=tfe(),a=tn(i),o=nn(a),s=e=>{var i=efe();Jr(i,()=>({d:t.path,"stroke-opacity":0,"stroke-width":n(),fill:`none`,class:`svelte-flow__edge-interaction`,...r})),gr(e,i)};Cr(o,e=>{n()>0&&e(s)});var c=nn(o),l=e=>{rS(e,{get x(){return t.labelX},get y(){return t.labelY},get style(){return t.labelStyle},selectEdgeOnClick:!0,children:(e,n)=>{Ge();var r=mr();_n(()=>_r(r,t.label)),gr(e,r)},$$slots:{default:!0}})};Cr(c,e=>{t.label&&e(l)}),_n(()=>{qr(a,`id`,t.id),qr(a,`d`,t.path),Ir(a,0,Mr([`svelte-flow__edge-path`,t.class])),qr(a,`marker-start`,t.markerStart),qr(a,`marker-end`,t.markerEnd),Rr(a,t.style)}),gr(e,i)}function aS(e,t){it(t,!0);let n=It(()=>ex({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,curvature:t.pathOptions?.curvature})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get id(){return t.id},get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}function nfe(e,t){it(t,!0);let n=It(()=>cx({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}function oS(e,t){it(t,!0);let n=It(()=>ox({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}function rfe(e,t){it(t,!0);let n=It(()=>cx({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition,borderRadius:0})),r=It(()=>oe(w(n),3)),i=It(()=>w(r)[0]),a=It(()=>w(r)[1]),o=It(()=>w(r)[2]);iS(e,{get path(){return w(i)},get labelX(){return w(a)},get labelY(){return w(o)},get label(){return t.label},get labelStyle(){return t.labelStyle},get markerStart(){return t.markerStart},get markerEnd(){return t.markerEnd},get interactionWidth(){return t.interactionWidth},get style(){return t.style}}),at()}var sS=class{#e;#t;constructor(e,t){this.#e=e,this.#t=Mt(t)}get current(){return this.#t(),this.#e()}},ife=/\(.+\)/,afe=new Set([`all`,`print`,`screen`,`and`,`or`,`not`,`only`]),cS=class extends sS{constructor(e,t){let n=ife.test(e)||e.split(/[\s,]+/).some(e=>afe.has(e.trim()))?e:`(${e})`,r=window.matchMedia(n);super(()=>r.matches,e=>ir(r,`change`,e))}};function lS(e,t,n,r){let i=new Map;return yb(e,{x:0,y:0,width:n,height:r},t,!0).forEach(e=>{i.set(e.id,e)}),i}function uS(e){let{edges:t,defaultEdgeOptions:n,nodeLookup:r,previousEdges:i,connectionMode:a,onerror:o,onlyRenderVisible:s,elevateEdgesOnSelect:c,zIndexMode:l}=e,u=new Map;for(let d of t){let t=r.get(d.source),f=r.get(d.target);if(!t||!f)continue;if(s){let{visibleNodes:n,transform:r,width:i,height:a}=e;if(rx({sourceNode:t,targetNode:f,width:i,height:a,transform:r}))n.set(t.id,t),n.set(f.id,f);else continue}let p=i.get(d.id);if(p&&d===p.edge&&t==p.sourceNode&&f==p.targetNode){u.set(d.id,p);continue}let m=Cde({id:d.id,sourceNode:t,targetNode:f,sourceHandle:d.sourceHandle||null,targetHandle:d.targetHandle||null,connectionMode:a,onError:o});m&&u.set(d.id,{...n,...d,...m,zIndex:nx({selected:d.selected,zIndex:d.zIndex??n.zIndex,sourceNode:t,targetNode:f,elevateOnSelect:c,zIndexMode:l}),sourceNode:t,targetNode:f,edge:d})}return u}var dS={input:Zx,output:Qx,default:Yx,group:$x},fS={straight:oS,smoothstep:nfe,default:aS,step:rfe};function j(e,t,n,r,i,a){return t&&!n&&r&&i?Hb(vb(a,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),r,i,.5,2,.1):n??{x:0,y:0,zoom:1}}function ofe(e){class t{#e=It(()=>e.props.id??`1`);get flowId(){return w(this.#e)}set flowId(e){Gt(this.#e,e)}#t=Wt(null);get domNode(){return w(this.#t)}set domNode(e){Gt(this.#t,e)}#n=Wt(null);get panZoom(){return w(this.#n)}set panZoom(e){Gt(this.#n,e)}#r=Wt(e.width??0);get width(){return w(this.#r)}set width(e){Gt(this.#r,e)}#i=Wt(e.height??0);get height(){return w(this.#i)}set height(e){Gt(this.#i,e)}#a=Wt(e.props.zIndexMode??`basic`);get zIndexMode(){return w(this.#a)}set zIndexMode(e){Gt(this.#a,e)}#o=It(()=>{let t=bx(e.nodes,this.nodeLookup,this.parentLookup,{nodeExtent:this.nodeExtent,nodeOrigin:this.nodeOrigin,elevateNodesOnSelect:e.props.elevateNodesOnSelect??!0,checkEquality:!0,zIndexMode:this.zIndexMode});return this.fitViewQueued&&t&&(this.fitViewOptions?.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),t});get nodesInitialized(){return w(this.#o)}set nodesInitialized(e){Gt(this.#o,e)}#s=It(()=>this.panZoom!==null);get viewportInitialized(){return w(this.#s)}set viewportInitialized(e){Gt(this.#s,e)}#c=It(()=>(Dx(this.connectionLookup,this.edgeLookup,e.edges),e.edges));get _edges(){return w(this.#c)}set _edges(e){Gt(this.#c,e)}get nodes(){return this.nodesInitialized,e.nodes}set nodes(t){e.nodes=t}get edges(){return this._edges}set edges(t){e.edges=t}_prevSelectedNodes=[];_prevSelectedNodeIds=new Set;#l=It(()=>{let e=this._prevSelectedNodeIds.size,t=new Set,n=this.nodes.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedNodeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=n),this._prevSelectedNodeIds=t,this._prevSelectedNodes});get selectedNodes(){return w(this.#l)}set selectedNodes(e){Gt(this.#l,e)}_prevSelectedEdges=[];_prevSelectedEdgeIds=new Set;#u=It(()=>{let e=this._prevSelectedEdgeIds.size,t=new Set,n=this.edges.filter(e=>(e.selected&&(t.add(e.id),this._prevSelectedEdgeIds.delete(e.id)),e.selected));return(e!==t.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=n),this._prevSelectedEdgeIds=t,this._prevSelectedEdges});get selectedEdges(){return w(this.#u)}set selectedEdges(e){Gt(this.#u,e)}selectionChangeHandlers=new Map;nodeLookup=new Map;parentLookup=new Map;connectionLookup=new Map;edgeLookup=new Map;_prevVisibleEdges=new Map;#d=It(()=>{let{nodes:t,_edges:n,_prevVisibleEdges:r,nodeLookup:i,connectionMode:a,onerror:o,onlyRenderVisibleElements:s,defaultEdgeOptions:c,zIndexMode:l}=this,u,d,f={edges:n,defaultEdgeOptions:c,previousEdges:r,nodeLookup:i,connectionMode:a,elevateEdgesOnSelect:e.props.elevateEdgesOnSelect??!0,zIndexMode:l,onerror:o};if(s){let{viewport:e,width:t,height:n}=this,r=[e.x,e.y,e.zoom];u=lS(i,r,t,n),d=uS({...f,onlyRenderVisible:!0,visibleNodes:u,transform:r,width:t,height:n})}else u=this.nodeLookup,d=uS(f);return{nodes:u,edges:d}});get visible(){return w(this.#d)}set visible(e){Gt(this.#d,e)}#f=It(()=>e.props.nodesDraggable??!0);get nodesDraggable(){return w(this.#f)}set nodesDraggable(e){Gt(this.#f,e)}#p=It(()=>e.props.nodesConnectable??!0);get nodesConnectable(){return w(this.#p)}set nodesConnectable(e){Gt(this.#p,e)}#m=It(()=>e.props.elementsSelectable??!0);get elementsSelectable(){return w(this.#m)}set elementsSelectable(e){Gt(this.#m,e)}#h=It(()=>e.props.nodesFocusable??!0);get nodesFocusable(){return w(this.#h)}set nodesFocusable(e){Gt(this.#h,e)}#g=It(()=>e.props.edgesFocusable??!0);get edgesFocusable(){return w(this.#g)}set edgesFocusable(e){Gt(this.#g,e)}#_=It(()=>e.props.disableKeyboardA11y??!1);get disableKeyboardA11y(){return w(this.#_)}set disableKeyboardA11y(e){Gt(this.#_,e)}#v=It(()=>e.props.minZoom??.5);get minZoom(){return w(this.#v)}set minZoom(e){Gt(this.#v,e)}#y=It(()=>e.props.maxZoom??2);get maxZoom(){return w(this.#y)}set maxZoom(e){Gt(this.#y,e)}#b=It(()=>e.props.nodeOrigin??[0,0]);get nodeOrigin(){return w(this.#b)}set nodeOrigin(e){Gt(this.#b,e)}#x=It(()=>e.props.nodeExtent??sb);get nodeExtent(){return w(this.#x)}set nodeExtent(e){Gt(this.#x,e)}#S=It(()=>e.props.translateExtent??sb);get translateExtent(){return w(this.#S)}set translateExtent(e){Gt(this.#S,e)}#C=It(()=>e.props.defaultEdgeOptions??{});get defaultEdgeOptions(){return w(this.#C)}set defaultEdgeOptions(e){Gt(this.#C,e)}#w=It(()=>e.props.nodeDragThreshold??1);get nodeDragThreshold(){return w(this.#w)}set nodeDragThreshold(e){Gt(this.#w,e)}#T=It(()=>e.props.autoPanOnNodeDrag??!0);get autoPanOnNodeDrag(){return w(this.#T)}set autoPanOnNodeDrag(e){Gt(this.#T,e)}#E=It(()=>e.props.autoPanOnConnect??!0);get autoPanOnConnect(){return w(this.#E)}set autoPanOnConnect(e){Gt(this.#E,e)}#D=It(()=>e.props.autoPanOnNodeFocus??!0);get autoPanOnNodeFocus(){return w(this.#D)}set autoPanOnNodeFocus(e){Gt(this.#D,e)}#O=It(()=>e.props.autoPanSpeed??15);get autoPanSpeed(){return w(this.#O)}set autoPanSpeed(e){Gt(this.#O,e)}#k=It(()=>e.props.connectionDragThreshold??1);get connectionDragThreshold(){return w(this.#k)}set connectionDragThreshold(e){Gt(this.#k,e)}fitViewQueued=e.props.fitView??!1;fitViewOptions=e.props.fitViewOptions;fitViewResolver=null;#A=It(()=>e.props.snapGrid??null);get snapGrid(){return w(this.#A)}set snapGrid(e){Gt(this.#A,e)}#j=Wt(!1);get dragging(){return w(this.#j)}set dragging(e){Gt(this.#j,e)}#M=Wt(null);get selectionRect(){return w(this.#M)}set selectionRect(e){Gt(this.#M,e)}#N=Wt(!1);get selectionKeyPressed(){return w(this.#N)}set selectionKeyPressed(e){Gt(this.#N,e)}#P=Wt(!1);get multiselectionKeyPressed(){return w(this.#P)}set multiselectionKeyPressed(e){Gt(this.#P,e)}#F=Wt(!1);get deleteKeyPressed(){return w(this.#F)}set deleteKeyPressed(e){Gt(this.#F,e)}#I=Wt(!1);get panActivationKeyPressed(){return w(this.#I)}set panActivationKeyPressed(e){Gt(this.#I,e)}#L=Wt(!1);get zoomActivationKeyPressed(){return w(this.#L)}set zoomActivationKeyPressed(e){Gt(this.#L,e)}#R=Wt(null);get selectionRectMode(){return w(this.#R)}set selectionRectMode(e){Gt(this.#R,e)}#z=Wt(``);get ariaLiveMessage(){return w(this.#z)}set ariaLiveMessage(e){Gt(this.#z,e)}#B=It(()=>e.props.selectionMode??ub.Partial);get selectionMode(){return w(this.#B)}set selectionMode(e){Gt(this.#B,e)}#V=It(()=>({...dS,...e.props.nodeTypes}));get nodeTypes(){return w(this.#V)}set nodeTypes(e){Gt(this.#V,e)}#H=It(()=>({...fS,...e.props.edgeTypes}));get edgeTypes(){return w(this.#H)}set edgeTypes(e){Gt(this.#H,e)}#U=It(()=>e.props.noPanClass??`nopan`);get noPanClass(){return w(this.#U)}set noPanClass(e){Gt(this.#U,e)}#W=It(()=>e.props.noDragClass??`nodrag`);get noDragClass(){return w(this.#W)}set noDragClass(e){Gt(this.#W,e)}#G=It(()=>e.props.noWheelClass??`nowheel`);get noWheelClass(){return w(this.#G)}set noWheelClass(e){Gt(this.#G,e)}#K=It(()=>pde(e.props.ariaLabelConfig));get ariaLabelConfig(){return w(this.#K)}set ariaLabelConfig(e){Gt(this.#K,e)}#q=Wt(j(this.nodesInitialized,e.props.fitView,e.props.initialViewport,this.width,this.height,this.nodeLookup));get _viewport(){return w(this.#q)}set _viewport(e){Gt(this.#q,e)}get viewport(){return e.viewport??this._viewport}set viewport(t){e.viewport&&=t,this._viewport=t}#J=Wt(nde);get _connection(){return w(this.#J)}set _connection(e){Gt(this.#J,e)}#Y=It(()=>this._connection.inProgress?{...this._connection,to:zb(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection);get connection(){return w(this.#Y)}set connection(e){Gt(this.#Y,e)}#X=It(()=>e.props.connectionMode??cb.Strict);get connectionMode(){return w(this.#X)}set connectionMode(e){Gt(this.#X,e)}#Z=It(()=>e.props.connectionRadius??20);get connectionRadius(){return w(this.#Z)}set connectionRadius(e){Gt(this.#Z,e)}#Q=It(()=>e.props.isValidConnection??(()=>!0));get isValidConnection(){return w(this.#Q)}set isValidConnection(e){Gt(this.#Q,e)}#$=It(()=>e.props.selectNodesOnDrag??!0);get selectNodesOnDrag(){return w(this.#$)}set selectNodesOnDrag(e){Gt(this.#$,e)}#ee=It(()=>e.props.defaultMarkerColor===void 0?`#b1b1b7`:e.props.defaultMarkerColor);get defaultMarkerColor(){return w(this.#ee)}set defaultMarkerColor(e){Gt(this.#ee,e)}#te=It(()=>Tde(e.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd}));get markers(){return w(this.#te)}set markers(e){Gt(this.#te,e)}#ne=It(()=>e.props.onlyRenderVisibleElements??!1);get onlyRenderVisibleElements(){return w(this.#ne)}set onlyRenderVisibleElements(e){Gt(this.#ne,e)}#re=It(()=>e.props.onflowerror??Lb);get onerror(){return w(this.#re)}set onerror(e){Gt(this.#re,e)}#ie=It(()=>e.props.ondelete);get ondelete(){return w(this.#ie)}set ondelete(e){Gt(this.#ie,e)}#ae=It(()=>e.props.onbeforedelete);get onbeforedelete(){return w(this.#ae)}set onbeforedelete(e){Gt(this.#ae,e)}#oe=It(()=>e.props.onbeforeconnect);get onbeforeconnect(){return w(this.#oe)}set onbeforeconnect(e){Gt(this.#oe,e)}#se=It(()=>e.props.onconnect);get onconnect(){return w(this.#se)}set onconnect(e){Gt(this.#se,e)}#ce=It(()=>e.props.onconnectstart);get onconnectstart(){return w(this.#ce)}set onconnectstart(e){Gt(this.#ce,e)}#le=It(()=>e.props.onconnectend);get onconnectend(){return w(this.#le)}set onconnectend(e){Gt(this.#le,e)}#ue=It(()=>e.props.onbeforereconnect);get onbeforereconnect(){return w(this.#ue)}set onbeforereconnect(e){Gt(this.#ue,e)}#de=It(()=>e.props.onreconnect);get onreconnect(){return w(this.#de)}set onreconnect(e){Gt(this.#de,e)}#fe=It(()=>e.props.onreconnectstart);get onreconnectstart(){return w(this.#fe)}set onreconnectstart(e){Gt(this.#fe,e)}#pe=It(()=>e.props.onreconnectend);get onreconnectend(){return w(this.#pe)}set onreconnectend(e){Gt(this.#pe,e)}#me=It(()=>e.props.clickConnect??!0);get clickConnect(){return w(this.#me)}set clickConnect(e){Gt(this.#me,e)}#he=It(()=>e.props.onclickconnectstart);get onclickconnectstart(){return w(this.#he)}set onclickconnectstart(e){Gt(this.#he,e)}#ge=It(()=>e.props.onclickconnectend);get onclickconnectend(){return w(this.#ge)}set onclickconnectend(e){Gt(this.#ge,e)}#_e=Wt(null);get clickConnectStartHandle(){return w(this.#_e)}set clickConnectStartHandle(e){Gt(this.#_e,e)}#ve=It(()=>e.props.onselectiondrag);get onselectiondrag(){return w(this.#ve)}set onselectiondrag(e){Gt(this.#ve,e)}#ye=It(()=>e.props.onselectiondragstart);get onselectiondragstart(){return w(this.#ye)}set onselectiondragstart(e){Gt(this.#ye,e)}#be=It(()=>e.props.onselectiondragstop);get onselectiondragstop(){return w(this.#be)}set onselectiondragstop(e){Gt(this.#be,e)}resolveFitView=async()=>{this.panZoom&&(await Sb({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),this.fitViewResolver?.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)};_prefersDark=new cS(`(prefers-color-scheme: dark)`,e.props.colorModeSSR===`dark`);#xe=It(()=>e.props.colorMode===`system`?this._prefersDark.current?`dark`:`light`:e.props.colorMode??`light`);get colorMode(){return w(this.#xe)}set colorMode(e){Gt(this.#xe,e)}constructor(){}resetStoreValues(){this.dragging=!1,this.selectionRect=null,this.selectionRectMode=null,this.selectionKeyPressed=!1,this.multiselectionKeyPressed=!1,this.deleteKeyPressed=!1,this.panActivationKeyPressed=!1,this.zoomActivationKeyPressed=!1,this._connection=nde,this.clickConnectStartHandle=null,this.viewport=e.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=``}}return new t}function pS(){let e=nt(mS);if(!e)throw Error(`To call useStore outside of <SvelteFlow /> you need to wrap your component in a <SvelteFlowProvider />`);return e.getStore()}var mS=Symbol();function sfe(e){let t=ofe(e);function n(e){t.nodeTypes={...dS,...e}}function r(e){t.edgeTypes={...fS,...e}}function i(e){t.edges=ax(e,t.edges)}let a=(e,n=!1)=>{t.nodes=t.nodes.map(r=>{if(t.connection.inProgress&&t.connection.fromNode.id===r.id){let e=t.nodeLookup.get(r.id);e&&(t.connection={...t.connection,from:lx(e,t.connection.fromHandle,pb.Left,!0)})}let i=e.get(r.id);return i?{...r,position:i.position,dragging:n}:r})};function o(e){let{changes:n,updatedInternals:r}=wx(e,t.nodeLookup,t.parentLookup,t.domNode,t.nodeOrigin,t.nodeExtent,t.zIndexMode);if(!r)return;_x(t.nodeLookup,t.parentLookup,{nodeOrigin:t.nodeOrigin,nodeExtent:t.nodeExtent,zIndexMode:t.zIndexMode}),t.fitViewQueued&&t.resolveFitView();let i=new Map;for(let e of n){let n=t.nodeLookup.get(e.id)?.internals.userNode;if(!n)continue;let r={...n};switch(e.type){case`dimensions`:{let t={...r.measured,...e.dimensions};e.setAttributes&&(r.width=e.dimensions?.width??r.width,r.height=e.dimensions?.height??r.height),r.measured=t;break}case`position`:r.position=e.position??r.position;break}i.set(e.id,r)}t.nodes=t.nodes.map(e=>i.get(e.id)??e)}function s(e){let n=t.fitViewResolver??Promise.withResolvers();return t.fitViewQueued=!0,t.fitViewOptions=e,t.fitViewResolver=n,t.nodes=[...t.nodes],n.promise}async function c(e,n,r){let i=r?.zoom===void 0?t.maxZoom:r.zoom,a=t.panZoom;return a?(await a.setViewport({x:t.width/2-e*i,y:t.height/2-n*i,zoom:i},{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)}function l(e,n){let r=t.panZoom;return r?r.scaleBy(e,n):Promise.resolve(!1)}function u(e){return l(1.2,e)}function d(e){return l(1/1.2,e)}function f(e){let n=t.panZoom;n&&(n.setScaleExtent([e,t.maxZoom]),t.minZoom=e)}function p(e){let n=t.panZoom;n&&(n.setScaleExtent([t.minZoom,e]),t.maxZoom=e)}function m(e){let n=t.panZoom;n&&(n.setTranslateExtent(e),t.translateExtent=e)}function h(e,t=null){let n=!1,r=e.map(e=>(!t||t.has(e.id))&&e.selected?(n=!0,{...e,selected:!1}):e);return[n,r]}function g(e){let n=e?.nodes?new Set(e.nodes.map(e=>e.id)):null,[r,i]=h(t.nodes,n);r&&(t.nodes=i);let a=e?.edges?new Set(e.edges.map(e=>e.id)):null,[o,s]=h(t.edges,a);o&&(t.edges=s)}function _(e){let n=t.multiselectionKeyPressed;t.nodes=t.nodes.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({nodes:[]})}function v(e){let n=t.multiselectionKeyPressed;t.edges=t.edges.map(t=>{let r=e.includes(t.id),i=n&&t.selected||r;return!!t.selected===i?t:{...t,selected:i}}),n||g({edges:[]})}function y(e,n,r){let i=t.nodeLookup.get(e);if(!i){console.warn(`012`,ob.error012(e));return}t.selectionRect=null,t.selectionRectMode=null,i.selected?(n||i.selected&&t.multiselectionKeyPressed)&&(g({nodes:[i],edges:[]}),requestAnimationFrame(()=>r?.blur())):_([e])}function b(e){let n=t.edgeLookup.get(e);if(!n){console.warn(`012`,ob.error012(e));return}(n.selectable||t.elementsSelectable&&n.selectable===void 0)&&(t.selectionRect=null,t.selectionRectMode=null,n.selected?n.selected&&t.multiselectionKeyPressed&&g({nodes:[],edges:[n]}):v([e]))}function x(e,n){let{nodeExtent:r,snapGrid:i,nodeOrigin:o,nodeLookup:s,nodesDraggable:c,onerror:l}=t,u=new Map,d=i?.[0]??5,f=i?.[1]??5,p=e.x*d*n,m=e.y*f*n;for(let e of s.values()){if(!(e.selected&&(e.draggable||c&&e.draggable===void 0)))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+m};i&&(t=Rb(t,i));let{position:n,positionAbsolute:a}=Cb({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:r,nodeOrigin:o,onError:l});e.position=n,e.internals.positionAbsolute=a,u.set(e.id,e)}a(u)}function S(e){return Tx({delta:e,panZoom:t.panZoom,transform:[t.viewport.x,t.viewport.y,t.viewport.zoom],translateExtent:t.translateExtent,width:t.width,height:t.height})}let ee=e=>{t._connection={...e}};function te(){t._connection=nde}function ne(){t.resetStoreValues(),g()}return Object.assign(t,{setNodeTypes:n,setEdgeTypes:r,addEdge:i,updateNodePositions:a,updateNodeInternals:o,zoomIn:u,zoomOut:d,fitView:s,setCenter:c,setMinZoom:f,setMaxZoom:p,setTranslateExtent:m,unselectNodesAndEdges:g,addSelectedNodes:_,addSelectedEdges:v,handleNodeSelection:y,handleEdgeSelection:b,moveSelectedNodes:x,panBy:S,updateConnection:ee,cancelConnection:te,reset:ne})}function cfe(e,t){let{minZoom:n,maxZoom:r,initialViewport:i,onPanZoomStart:a,onPanZoom:o,onPanZoomEnd:s,translateExtent:c,setPanZoomInstance:l,onDraggingChange:u,onTransformChange:d}=t,f=Hde({domNode:e,minZoom:n,maxZoom:r,translateExtent:c,viewport:i,onPanZoom:o,onPanZoomStart:a,onPanZoomEnd:s,onDraggingChange:u}),p=f.getViewport();return(i.x!==p.x||i.y!==p.y||i.zoom!==p.zoom)&&d([p.x,p.y,p.zoom]),l(f),f.update(t),{update(e){f.update(e)}}}var hS=fr(`<div class="svelte-flow__zoom svelte-flow__container"><!></div>`);function lfe(e,t){it(t,!0);let n=ii(t,`store`,15),r=It(()=>n().panActivationKeyPressed||t.panOnDrag),i=It(()=>n().panActivationKeyPressed||t.panOnScroll),{viewport:a}=n(),o=!1;fn(()=>{!o&&n().viewportInitialized&&(t.oninit?.(),o=!0)});var s=hS();br(en(s),()=>t.children),We(s),jr(s,(e,t)=>cfe?.(e,t),()=>({viewport:n().viewport,minZoom:n().minZoom,maxZoom:n().maxZoom,initialViewport:a,onDraggingChange:e=>{n(n().dragging=e,!0)},setPanZoomInstance:e=>{n(n().panZoom=e,!0)},onPanZoomStart:t.onmovestart,onPanZoom:t.onmove,onPanZoomEnd:t.onmoveend,zoomOnScroll:t.zoomOnScroll,zoomOnDoubleClick:t.zoomOnDoubleClick,zoomOnPinch:t.zoomOnPinch,panOnScroll:w(i),panOnDrag:w(r),panOnScrollSpeed:t.panOnScrollSpeed,panOnScrollMode:t.panOnScrollMode,zoomActivationKeyPressed:n().zoomActivationKeyPressed,preventScrolling:typeof t.preventScrolling==`boolean`?t.preventScrolling:!0,noPanClassName:n().noPanClass,noWheelClassName:n().noWheelClass,userSelectionActive:!!n().selectionRect,translateExtent:n().translateExtent,lib:`svelte`,paneClickDistance:t.paneClickDistance,selectionOnDrag:t.selectionOnDrag,onTransformChange:e=>{n(n().viewport={x:e[0],y:e[1],zoom:e[2]},!0)},connectionInProgress:n().connection.inProgress})),gr(e,s),at()}function gS(e,t){return n=>{n.target===t&&e?.(n)}}function _S(e){return t=>{let n=e.has(t.id);return!!t.selected===n?t:{...t,selected:n}}}function vS(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var ufe=fr(`<div><!></div>`);function dfe(e,t){it(t,!0);let n=ii(t,`store`,15),r=ii(t,`panOnDrag`,3,!0),i=ii(t,`paneClickDistance`,3,1),a,o=null,s=new Set,c=new Set,l=It(()=>n().panActivationKeyPressed||r()),u=It(()=>n().selectionKeyPressed||!!n().selectionRect||t.selectionOnDrag&&w(l)!==!0),d=It(()=>n().elementsSelectable&&(w(u)||n().selectionRectMode===`user`)),f=!1;function p(e){if(o=a?.getBoundingClientRect(),!o)return;let r=e.target===a,i=!r&&!!e.target.closest(`.nokey`),s=t.selectionOnDrag&&r||n().selectionKeyPressed;if(i||!w(u)||!s||e.button!==0||!e.isPrimary)return;e.target?.setPointerCapture?.(e.pointerId),f=!1;let{x:c,y:l}=Xb(e,o);n(n().selectionRect={width:0,height:0,startX:c,startY:l,x:c,y:l},!0),r||(e.stopPropagation(),e.preventDefault())}function m(e){if(!w(u)||!o||!n().selectionRect)return;let r=Xb(e,o),{startX:a=0,startY:l=0}=n().selectionRect;if(!f){let o=n().selectionKeyPressed?0:i();if(Math.hypot(r.x-a,r.y-l)<=o)return;n().unselectNodesAndEdges(),t.onselectionstart?.(e)}f=!0;let d={...n().selectionRect,x:r.x<a?r.x:a,y:r.y<l?r.y:l,width:Math.abs(r.x-a),height:Math.abs(r.y-l)},p=s,m=c;s=new Set(yb(n().nodeLookup,d,[n().viewport.x,n().viewport.y,n().viewport.zoom],n().selectionMode===ub.Partial,!0).map(e=>e.id));let h=n().defaultEdgeOptions.selectable??!0;c=new Set;for(let e of s){let t=n().connectionLookup.get(e);if(t)for(let{edgeId:e}of t.values()){let t=n().edgeLookup.get(e);t&&(t.selectable??h)&&c.add(e)}}vS(p,s)||n(n().nodes=n().nodes.map(_S(s)),!0),vS(m,c)||n(n().edges=n().edges.map(_S(c)),!0),n(n().selectionRectMode=`user`,!0),n(n().selectionRect=d,!0)}function h(e){e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!f&&e.target===a&&v?.(e),n(n().selectionRect=null,!0),f&&n(n().selectionRectMode=s.size>0?`nodes`:null,!0),f&&t.onselectionend?.(e))}let g=e=>{if(Array.isArray(w(l))&&w(l).includes(2)){e.preventDefault();return}t.onpanecontextmenu?.({event:e})},_=e=>{f&&=(e.stopPropagation(),!1)};function v(e){if(f||n().connection.inProgress){f=!1;return}t.onpaneclick?.({event:e}),n().unselectNodesAndEdges(),n(n().selectionRectMode=null,!0),n(n().selectionRect=null,!0)}var y=ufe();let b;var x=It(()=>w(d)?void 0:gS(v,a)),S=It(()=>gS(g,a));br(en(y),()=>t.children),We(y),$r(y,e=>a=e,()=>a),_n(e=>b=Ir(y,1,`svelte-flow__pane svelte-flow__container`,null,b,e),[()=>({draggable:r()===!0||Array.isArray(r())&&r().includes(0),dragging:n().dragging,selection:w(u)})]),or(`click`,y,function(...e){w(x)?.apply(this,e)}),ar(`pointerdown`,y,function(...e){(w(d)?p:void 0)?.apply(this,e)},!0),or(`pointermove`,y,function(...e){(w(d)?m:void 0)?.apply(this,e)}),or(`pointerup`,y,function(...e){(w(d)?h:void 0)?.apply(this,e)}),or(`contextmenu`,y,function(...e){w(S)?.apply(this,e)}),ar(`click`,y,function(...e){(w(d)?_:void 0)?.apply(this,e)},!0),gr(e,y),at()}sr([`click`,`pointermove`,`pointerup`,`contextmenu`]);var ffe=fr(`<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>`);function yS(e,t){it(t,!0);var n=ffe();let r;br(en(n),()=>t.children),We(n),_n(()=>r=Rr(n,``,r,{transform:`translate(${t.store.viewport.x??``}px, ${t.store.viewport.y??``}px) scale(${t.store.viewport.zoom??``})`})),gr(e,n),at()}function bS(e,t){let{store:n,onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o}=t,s=kde({onDrag:r,onDragStart:i,onDragStop:a,onNodeMouseDown:o,getStoreItems:()=>{let{snapGrid:e,viewport:t}=n;return{nodes:n.nodes,nodeLookup:n.nodeLookup,edges:n.edges,nodeExtent:n.nodeExtent,snapGrid:e||[0,0],snapToGrid:!!e,nodeOrigin:n.nodeOrigin,multiSelectionActive:n.multiselectionKeyPressed,domNode:n.domNode,transform:[t.x,t.y,t.zoom],autoPanOnNodeDrag:n.autoPanOnNodeDrag,nodesDraggable:n.nodesDraggable,selectNodesOnDrag:n.selectNodesOnDrag,nodeDragThreshold:n.nodeDragThreshold,unselectNodesAndEdges:n.unselectNodesAndEdges,updateNodePositions:n.updateNodePositions,onSelectionDrag:n.onselectiondrag,onSelectionDragStart:n.onselectiondragstart,onSelectionDragStop:n.onselectiondragstop,panBy:n.panBy}}});function c(e,t){if(t.disabled){s.destroy();return}s.update({domNode:e,noDragClassName:t.noDragClass,handleSelector:t.handleSelector,nodeId:t.nodeId,isSelectable:t.isSelectable,nodeClickDistance:t.nodeClickDistance})}return c(e,t),{update(t){c(e,t)},destroy(){s.destroy()}}}var pfe=fr(`<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-1g71opt"> </div>`),mfe=fr(`<div class="a11y-hidden svelte-1g71opt"> </div> <div class="a11y-hidden svelte-1g71opt"> </div> <!>`,1);function xS(e,t){it(t,!0);var n=mfe(),r=tn(n),i=en(r,!0);We(r);var a=nn(r,2),o=en(a,!0);We(a);var s=nn(a,2),c=e=>{var n=pfe(),r=en(n,!0);We(n),_n(()=>{qr(n,`id`,`${hfe}-${t.store.flowId}`),_r(r,t.store.ariaLiveMessage)}),gr(e,n)};Cr(s,e=>{t.store.disableKeyboardA11y||e(c)}),_n(()=>{qr(r,`id`,`${SS}-${t.store.flowId}`),_r(i,t.store.disableKeyboardA11y?t.store.ariaLabelConfig[`node.a11yDescription.default`]:t.store.ariaLabelConfig[`node.a11yDescription.keyboardDisabled`]),qr(a,`id`,`${M}-${t.store.flowId}`),_r(o,t.store.ariaLabelConfig[`edge.a11yDescription.default`])}),gr(e,n),at()}var SS=`svelte-flow__node-desc`,M=`svelte-flow__edge-desc`,hfe=`svelte-flow__aria-live`,gfe=fr(`<div><!></div>`);function CS(e,t){it(t,!0);let n=ii(t,`store`,15),r=It(()=>ae(t.node.data,()=>({}),!0)),i=It(()=>ae(t.node.selected,!1)),a=It(()=>t.node.draggable),o=It(()=>t.node.selectable),s=It(()=>ae(t.node.deletable,!0)),c=It(()=>t.node.connectable),l=It(()=>t.node.focusable),u=It(()=>ae(t.node.hidden,!1)),d=It(()=>ae(t.node.dragging,!1)),f=It(()=>ae(t.node.style,``)),p=It(()=>t.node.class),m=It(()=>ae(t.node.type,`default`)),h=It(()=>t.node.parentId),g=It(()=>t.node.sourcePosition),_=It(()=>t.node.targetPosition),v=It(()=>ae(t.node.measured,()=>({width:0,height:0}),!0).width),y=It(()=>ae(t.node.measured,()=>({width:0,height:0}),!0).height),b=It(()=>t.node.initialWidth),x=It(()=>t.node.initialHeight),S=It(()=>t.node.width),ee=It(()=>t.node.height),te=It(()=>t.node.dragHandle),ne=It(()=>ae(t.node.internals.z,0)),C=It(()=>t.node.internals.positionAbsolute.x),re=It(()=>t.node.internals.positionAbsolute.y),ie=It(()=>t.node.internals.userNode),{id:oe}=t.node,se=It(()=>w(a)??n().nodesDraggable),ce=It(()=>w(o)??n().elementsSelectable),le=It(()=>w(c)??n().nodesConnectable),ue=It(()=>dde(t.node)),de=It(()=>!!t.node.internals.handleBounds),fe=It(()=>w(ue)&&w(de)),pe=It(()=>w(l)??n().nodesFocusable);function me(e){return n().parentLookup.has(e)}let he=It(()=>me(oe)),ge=Wt(null),_e=null,ve=w(m),ye=w(g),be=w(_),xe=It(()=>n().nodeTypes[w(m)]??Yx),Se=It(()=>n().ariaLabelConfig);Gde(oe),Wx({get value(){return w(le)}});let Ce=It(()=>{let e=w(v)===void 0?w(S)??w(b):w(S),t=w(y)===void 0?w(ee)??w(x):w(ee);if(!(e===void 0&&t===void 0&&w(f)===void 0))return`${w(f)};${e?`width:${tS(e)};`:``}${t?`height:${tS(t)};`:``}`});fn(()=>{(w(m)!==ve||w(g)!==ye||w(_)!==be)&&w(ge)!==null&&requestAnimationFrame(()=>{w(ge)!==null&&n().updateNodeInternals(new Map([[oe,{id:oe,nodeElement:w(ge),force:!0}]]))}),ve=w(m),ye=w(g),be=w(_)}),fn(()=>{t.resizeObserver&&(!w(fe)||w(ge)!==_e)&&(_e&&t.resizeObserver.unobserve(_e),w(ge)&&t.resizeObserver.observe(w(ge)),_e=w(ge))}),Sr(()=>{_e&&t.resizeObserver?.unobserve(_e)});function we(e){w(ce)&&(!n().selectNodesOnDrag||!w(se)||n().nodeDragThreshold>0)&&n().handleNodeSelection(oe),t.onnodeclick?.({node:w(ie),event:e})}function Te(e){if(!(Yb(e)||n().disableKeyboardA11y))if(ede.includes(e.key)&&w(ce)){let t=e.key===`Escape`;n().handleNodeSelection(oe,t,w(ge))}else w(se)&&t.node.selected&&Object.prototype.hasOwnProperty.call(nS,e.key)&&(e.preventDefault(),n(n().ariaLiveMessage=w(Se)[`node.a11yDescription.ariaLiveMessage`]({direction:e.key.replace(`Arrow`,``).toLowerCase(),x:~~t.node.internals.positionAbsolute.x,y:~~t.node.internals.positionAbsolute.y}),!0),n().moveSelectedNodes(nS[e.key],e.shiftKey?4:1))}let Ee=()=>{if(n().disableKeyboardA11y||!n().autoPanOnNodeFocus||!w(ge)?.matches(`:focus-visible`))return;let{width:e,height:r,viewport:i}=n();yb(new Map([[oe,t.node]]),{x:0,y:0,width:e,height:r},[i.x,i.y,i.zoom],!0).length>0||n().setCenter(t.node.position.x+(t.node.measured.width??0)/2,t.node.position.y+(t.node.measured.height??0)/2,{zoom:i.zoom})};var De=hr(),Oe=tn(De),ke=e=>{var a=gfe();Jr(a,()=>({"data-id":oe,class:[`svelte-flow__node`,`svelte-flow__node-${w(m)}`,w(p)],style:w(Ce),onclick:we,onpointerenter:t.onnodepointerenter?e=>t.onnodepointerenter({node:w(ie),event:e}):void 0,onpointerleave:t.onnodepointerleave?e=>t.onnodepointerleave({node:w(ie),event:e}):void 0,onpointermove:t.onnodepointermove?e=>t.onnodepointermove({node:w(ie),event:e}):void 0,oncontextmenu:t.onnodecontextmenu?e=>t.onnodecontextmenu({node:w(ie),event:e}):void 0,onkeydown:w(pe)?Te:void 0,onfocus:w(pe)?Ee:void 0,tabIndex:w(pe)?0:void 0,role:t.node.ariaRole??(w(pe)?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":n().disableKeyboardA11y?void 0:`${SS}-${n().flowId}`,...t.node.domAttributes,[Vr]:{dragging:w(d),selected:w(i),draggable:w(se),connectable:w(le),selectable:w(ce),nopan:w(se),parent:w(he)},[Hr]:{"z-index":w(ne),transform:`translate(${w(C)??``}px, ${w(re)??``}px)`,visibility:w(ue)?`visible`:`hidden`}})),Ar(en(a),()=>w(xe),(e,t)=>{t(e,{get data(){return w(r)},get id(){return oe},get selected(){return w(i)},get selectable(){return w(ce)},get deletable(){return w(s)},get sourcePosition(){return w(g)},get targetPosition(){return w(_)},get zIndex(){return w(ne)},get dragging(){return w(d)},get draggable(){return w(se)},get dragHandle(){return w(te)},get parentId(){return w(h)},get type(){return w(m)},get isConnectable(){return w(le)},get positionAbsoluteX(){return w(C)},get positionAbsoluteY(){return w(re)},get width(){return w(S)},get height(){return w(ee)}})}),We(a),jr(a,(e,t)=>bS?.(e,t),()=>({nodeId:oe,isSelectable:w(ce),disabled:!w(se),handleSelector:w(te),noDragClass:n().noDragClass,nodeClickDistance:t.nodeClickDistance,onNodeMouseDown:n().handleNodeSelection,onDrag:(e,n,r,i)=>{t.onnodedrag?.({event:e,targetNode:r,nodes:i})},onDragStart:(e,n,r,i)=>{t.onnodedragstart?.({event:e,targetNode:r,nodes:i})},onDragStop:(e,n,r,i)=>{t.onnodedragstop?.({event:e,targetNode:r,nodes:i})},store:n()})),$r(a,e=>Gt(ge,e),()=>w(ge)),gr(e,a)};Cr(Oe,e=>{w(u)||e(ke)}),gr(e,De),at()}var wS=fr(`<div class="svelte-flow__nodes"></div>`);function TS(e,t){it(t,!0);let n=ii(t,`store`,15),r=typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{let t=new Map;e.forEach(e=>{let n=e.target.getAttribute(`data-id`);t.set(n,{id:n,nodeElement:e.target,force:!0})}),n().updateNodeInternals(t)});Sr(()=>{r?.disconnect()});var i=wS();Er(i,21,()=>n().visible.nodes.values(),e=>e.id,(e,i)=>{CS(e,{get node(){return w(i)},get resizeObserver(){return r},get nodeClickDistance(){return t.nodeClickDistance},get onnodeclick(){return t.onnodeclick},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get onnodecontextmenu(){return t.onnodecontextmenu},get store(){return n()},set store(e){n(e)}})}),We(i),gr(e,i),at()}var _fe=pr(`<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>`);function vfe(e,t){it(t,!0);let n=It(()=>t.edge.id),r=It(()=>t.edge.source),i=It(()=>t.edge.target),a=It(()=>t.edge.sourceX),o=It(()=>t.edge.sourceY),s=It(()=>t.edge.targetX),c=It(()=>t.edge.targetY),l=It(()=>t.edge.sourcePosition),u=It(()=>t.edge.targetPosition),d=It(()=>ae(t.edge.animated,!1)),f=It(()=>ae(t.edge.selected,!1)),p=It(()=>t.edge.label),m=It(()=>t.edge.labelStyle),h=It(()=>ae(t.edge.data,()=>({}),!0)),g=It(()=>t.edge.style),_=It(()=>t.edge.interactionWidth),v=It(()=>ae(t.edge.type,`default`)),y=It(()=>t.edge.sourceHandle),b=It(()=>t.edge.targetHandle),x=It(()=>t.edge.markerStart),S=It(()=>t.edge.markerEnd),ee=It(()=>t.edge.selectable),te=It(()=>t.edge.focusable),ne=It(()=>ae(t.edge.deletable,!0)),C=It(()=>t.edge.hidden),re=It(()=>t.edge.zIndex),ie=It(()=>t.edge.class),oe=It(()=>t.edge.ariaLabel);Kx(w(n));let se=null,ce=It(()=>w(ee)??t.store.elementsSelectable),le=It(()=>w(te)??t.store.edgesFocusable),ue=It(()=>t.store.edgeTypes[w(v)]??aS),de=It(()=>w(x)?`url('#${dx(w(x),t.store.flowId)}')`:void 0),fe=It(()=>w(S)?`url('#${dx(w(S),t.store.flowId)}')`:void 0);function pe(e){let r=t.store.edgeLookup.get(w(n));r&&(w(ce)&&t.store.handleEdgeSelection(w(n)),t.onedgeclick?.({event:e,edge:r}))}function me(e,r){let i=t.store.edgeLookup.get(w(n));i&&r({event:e,edge:i})}function he(e){if(!t.store.disableKeyboardA11y&&ede.includes(e.key)&&w(ce)){let{unselectNodesAndEdges:r,addSelectedEdges:i}=t.store;e.key===`Escape`?(se?.blur(),r({edges:[t.edge]})):i([w(n)])}}var ge=hr(),_e=tn(ge),ve=e=>{var x=_fe();let S;var ee=en(x);Jr(ee,()=>({class:[`svelte-flow__edge`,w(ie)],"data-id":w(n),onclick:pe,oncontextmenu:t.onedgecontextmenu?e=>{me(e,t.onedgecontextmenu)}:void 0,onpointerenter:t.onedgepointerenter?e=>{me(e,t.onedgepointerenter)}:void 0,onpointerleave:t.onedgepointerleave?e=>{me(e,t.onedgepointerleave)}:void 0,"aria-label":w(oe)===null?void 0:w(oe)?w(oe):`Edge from ${w(r)} to ${w(i)}`,"aria-describedby":w(le)?`${M}-${t.store.flowId}`:void 0,role:t.edge.ariaRole??(w(le)?`group`:`img`),"aria-roledescription":`edge`,onkeydown:w(le)?he:void 0,tabindex:w(le)?0:void 0,...t.edge.domAttributes,[Vr]:{animated:w(d),selected:w(f),selectable:w(ce)}})),Ar(en(ee),()=>w(ue),(e,t)=>{t(e,{get id(){return w(n)},get source(){return w(r)},get target(){return w(i)},get sourceX(){return w(a)},get sourceY(){return w(o)},get targetX(){return w(s)},get targetY(){return w(c)},get sourcePosition(){return w(l)},get targetPosition(){return w(u)},get animated(){return w(d)},get selected(){return w(f)},get label(){return w(p)},get labelStyle(){return w(m)},get data(){return w(h)},get style(){return w(g)},get interactionWidth(){return w(_)},get selectable(){return w(ce)},get deletable(){return w(ne)},get type(){return w(v)},get sourceHandleId(){return w(y)},get targetHandleId(){return w(b)},get markerStart(){return w(de)},get markerEnd(){return w(fe)}})}),We(ee),$r(ee,e=>se=e,()=>se),We(x),_n(()=>S=Rr(x,``,S,{"z-index":w(re)})),gr(e,x)};Cr(_e,e=>{w(C)||e(ve)}),gr(e,ge),at()}var ES=pr(`<defs></defs>`);function yfe(e,t){it(t,!1);let n=pS();ei();var r=ES();Er(r,5,()=>n.markers,e=>e.id,(e,t)=>{Sfe(e,ri(()=>w(t)))}),We(r),gr(e,r),at()}var DS=pr(`<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>`),bfe=pr(`<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>`),xfe=pr(`<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>`);function Sfe(e,t){it(t,!0);let n=ii(t,`width`,3,12.5),r=ii(t,`height`,3,12.5),i=ii(t,`markerUnits`,3,`strokeWidth`),a=ii(t,`orient`,3,`auto-start-reverse`),o=ii(t,`color`,3,`none`);var s=xfe(),c=en(s),l=e=>{var n=DS();let r;_n(()=>{qr(n,`stroke-width`,t.strokeWidth),r=Rr(n,``,r,{stroke:o()})}),gr(e,n)},u=e=>{var n=bfe();let r;_n(()=>{qr(n,`stroke-width`,t.strokeWidth),r=Rr(n,``,r,{stroke:o(),fill:o()})}),gr(e,n)};Cr(c,e=>{t.type===fb.Arrow?e(l):t.type===fb.ArrowClosed&&e(u,1)}),We(s),_n(()=>{qr(s,`id`,t.id),qr(s,`markerWidth`,`${n()}`),qr(s,`markerHeight`,`${r()}`),qr(s,`markerUnits`,i()),qr(s,`orient`,a())}),gr(e,s),at()}var Cfe=fr(`<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>`);function wfe(e,t){it(t,!0);let n=ii(t,`store`,15);var r=Cfe(),i=en(r);yfe(en(i),{}),We(i),Er(nn(i,2),17,()=>n().visible.edges.values(),e=>e.id,(e,r)=>{vfe(e,{get edge(){return w(r)},get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return n()},set store(e){n(e)}})}),We(r),gr(e,r),at()}var Tfe=fr(`<div class="svelte-flow__selection svelte-12unaqd"></div>`);function OS(e,t){it(t,!0);let n=ii(t,`x`,3,0),r=ii(t,`y`,3,0),i=ii(t,`width`,3,0),a=ii(t,`height`,3,0),o=ii(t,`isVisible`,3,!0);var s=hr(),c=tn(s),l=e=>{var t=Tfe();let o;_n(e=>o=Rr(t,``,o,e),[()=>({width:typeof i()==`string`?i():tS(i()),height:typeof a()==`string`?a():tS(a()),transform:`translate(${n()}px, ${r()}px)`})]),gr(e,t)};Cr(c,e=>{o()&&e(l)}),gr(e,s),at()}var Efe=fr(`<div><!></div>`);function kS(e,t){it(t,!0);let n=Wt(void 0);fn(()=>{t.store.disableKeyboardA11y||w(n)?.focus({preventScroll:!0})});let r=It(()=>{if(t.store.selectionRectMode===`nodes`){t.store.nodes;let e=vb(t.store.nodeLookup,{filter:e=>!!e.selected});if(e.width>0&&e.height>0)return e}return null});function i(e){let n=t.store.nodes.filter(e=>e.selected);t.onselectioncontextmenu?.({nodes:n,event:e})}function a(e){let n=t.store.nodes.filter(e=>e.selected);t.onselectionclick?.({nodes:n,event:e})}function o(e){Object.prototype.hasOwnProperty.call(nS,e.key)&&(e.preventDefault(),t.store.moveSelectedNodes(nS[e.key],e.shiftKey?4:1))}var s=hr(),c=tn(s),l=e=>{var s=Efe();let c;OS(en(s),{width:`100%`,height:`100%`,x:0,y:0}),We(s),jr(s,(e,t)=>bS?.(e,t),()=>({disabled:!1,store:t.store,onDrag:(e,n,r,i)=>{t.onnodedrag?.({event:e,targetNode:null,nodes:i})},onDragStart:(e,n,r,i)=>{t.onnodedragstart?.({event:e,targetNode:null,nodes:i})},onDragStop:(e,n,r,i)=>{t.onnodedragstop?.({event:e,targetNode:null,nodes:i})}})),$r(s,e=>Gt(n,e),()=>w(n)),_n(e=>{Ir(s,1,Mr([`svelte-flow__selection-wrapper`,t.store.noPanClass]),`svelte-1ei7o7l`),qr(s,`role`,t.store.disableKeyboardA11y?void 0:`button`),qr(s,`tabindex`,t.store.disableKeyboardA11y?void 0:-1),c=Rr(s,``,c,e)},[()=>({width:tS(w(r).width),height:tS(w(r).height),transform:`translate(${w(r).x??``}px, ${w(r).y??``}px)`})]),or(`contextmenu`,s,i),or(`click`,s,a),or(`keydown`,s,function(...e){(t.store.disableKeyboardA11y?void 0:o)?.apply(this,e)}),gr(e,s)},u=It(()=>t.store.selectionRectMode===`nodes`&&w(r)&&Ib(w(r).x)&&Ib(w(r).y));Cr(c,e=>{w(u)&&e(l)}),gr(e,s),at()}sr([`contextmenu`,`click`,`keydown`]);function AS(e){switch(e){case`ctrl`:return 8;case`shift`:return 4;case`alt`:return 2;case`meta`:return 1}}function jS(e,t){let{enabled:n=!0,trigger:r,type:i=`keydown`}=t;function a(t){let n=Array.isArray(r)?r:[r],i=[t.metaKey,t.altKey,t.shiftKey,t.ctrlKey].reduce((e,t,n)=>t?e|1<<n:e,0);for(let r of n){let n={preventDefault:!1,enabled:!0,...r},{modifier:a,key:o,callback:s,preventDefault:c,enabled:l}=n;if(l){if(t.key!==o)continue;if(a===null||a===!1){if(i!==0)continue}else if(a!==void 0&&a?.[0]?.length>0){let e=Array.isArray(a)?a:[a],t=!1;for(let n of e)if((Array.isArray(n)?n:[n]).reduce((e,t)=>e|AS(t),0)===i){t=!0;break}if(!t)continue}c&&t.preventDefault();let r={node:e,trigger:n,originalEvent:t};e.dispatchEvent(new CustomEvent(`shortcut`,{detail:r})),s?.(r)}}}let o;return n&&(o=ir(e,i,a)),{update:t=>{let{enabled:s=!0,type:c=`keydown`}=t;n&&(!s||i!==c)?o?.():!n&&s&&(o=ir(e,c,a)),n=s,i=c,r=t.trigger},destroy:()=>{o?.()}}}function MS(){let e=It(pS),t=t=>{let n=Zde(t)?t:w(e).nodeLookup.get(t.id),r=n.parentId?fde(n.position,n.measured,n.parentId,w(e).nodeLookup,w(e).nodeOrigin):n.position;return Mb({...n,position:r,width:n.measured?.width??n.width,height:n.measured?.height??n.height})};function n(t,n,r={replace:!1}){w(e).nodes=Qn(()=>w(e).nodes).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r?.replace&&Zde(t)?t:{...e,...t}}return e})}function r(t,n,r={replace:!1}){w(e).edges=Qn(()=>w(e).edges).map(e=>{if(e.id===t){let t=typeof n==`function`?n(e):n;return r.replace&&Qde(t)?t:{...e,...t}}return e})}let i=t=>w(e).nodeLookup.get(t);return{zoomIn:w(e).zoomIn,zoomOut:w(e).zoomOut,getInternalNode:i,getNode:e=>i(e)?.internals.userNode,getNodes:t=>t===void 0?w(e).nodes:NS(w(e).nodeLookup,t),getEdge:t=>w(e).edgeLookup.get(t),getEdges:t=>t===void 0?w(e).edges:NS(w(e).edgeLookup,t),setZoom:(t,n)=>{let r=w(e).panZoom;return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>w(e).viewport.zoom,setViewport:async(t,n)=>{let r=w(e).viewport;return w(e).panZoom?(await w(e).panZoom.setViewport({x:t.x??r.x,y:t.y??r.y,zoom:t.zoom??r.zoom},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>Qe(w(e).viewport),setCenter:async(t,n,r)=>w(e).setCenter(t,n,r),fitView:t=>w(e).fitView(t),fitBounds:async(t,n)=>{if(!w(e).panZoom)return Promise.resolve(!1);let r=Hb(t,w(e).width,w(e).height,w(e).minZoom,w(e).maxZoom,n?.padding??.1);return await w(e).panZoom.setViewport(r,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},getIntersectingNodes:(n,r=!0,i)=>{let a=Fb(n),o=a?n:t(n);return o?(i||w(e).nodes).filter(t=>{let i=w(e).nodeLookup.get(t.id);if(!i||!a&&t.id===n.id)return!1;let s=Mb(i),c=Pb(s,o);return r&&c>0||c>=s.width*s.height||c>=o.width*o.height}):[]},isNodeIntersecting:(e,n,r=!0)=>{let i=Fb(e)?e:t(e);if(!i)return!1;let a=Pb(i,n);return r&&a>0||a>=n.width*n.height||a>=i.width*i.height},deleteElements:async({nodes:t=[],edges:n=[]})=>{let{nodes:r,edges:i}=await sde({nodesToRemove:t,edgesToRemove:n,nodes:w(e).nodes,edges:w(e).edges,onBeforeDelete:w(e).onbeforedelete});return r&&(w(e).nodes=Qn(()=>w(e).nodes).filter(e=>!r.some(({id:t})=>t===e.id))),i&&(w(e).edges=Qn(()=>w(e).edges).filter(e=>!i.some(({id:t})=>t===e.id))),(r.length>0||i.length>0)&&w(e).ondelete?.({nodes:r,edges:i}),{deletedNodes:r,deletedEdges:i}},screenToFlowPosition:(t,n={snapToGrid:!0})=>{if(!w(e).domNode)return t;let r=n.snapToGrid?w(e).snapGrid:!1,{x:i,y:a,zoom:o}=w(e).viewport,{x:s,y:c}=w(e).domNode.getBoundingClientRect();return zb({x:t.x-s,y:t.y-c},[i,a,o],r!==null,r||[1,1])},flowToScreenPosition:t=>{if(!w(e).domNode)return t;let{x:n,y:r,zoom:i}=w(e).viewport,{x:a,y:o}=w(e).domNode.getBoundingClientRect(),s=Bb(t,[n,r,i]);return{x:s.x+a,y:s.y+o}},toObject:()=>structuredClone({nodes:[...w(e).nodes],edges:[...w(e).edges],viewport:{...w(e).viewport}}),updateNode:n,updateNodeData:(t,r,i)=>{let a=w(e).nodeLookup.get(t)?.internals.userNode;if(!a)return;let o=typeof r==`function`?r(a):r;n(t,e=>({...e,data:i?.replace?o:{...e.data,...o}}))},updateEdge:r,getNodesBounds:t=>A(t,{nodeLookup:w(e).nodeLookup,nodeOrigin:w(e).nodeOrigin}),getHandleConnections:({type:t,id:n,nodeId:r})=>Array.from(w(e).connectionLookup.get(`${r}-${t}-${n??null}`)?.values()??[])}}function NS(e,t){let n=[];for(let r of t){let t=e.get(r);if(t){let e=`internals`in t?t.internals?.userNode:t;n.push(e)}}return n}function PS(e,t){it(t,!0);let n=ii(t,`store`,15),r=ii(t,`selectionKey`,3,`Shift`),i=ii(t,`multiSelectionKey`,19,()=>Ub()?`Meta`:`Control`),a=ii(t,`deleteKey`,3,`Backspace`),o=ii(t,`panActivationKey`,3,` `),s=ii(t,`zoomActivationKey`,19,()=>Ub()?`Meta`:`Control`),{deleteElements:c}=MS();function l(e){return typeof e==`object`&&!!e}function u(e){return l(e)&&e.modifier||[]}function d(e){return e==null?``:l(e)?e.key:e}function f(e,t){return(Array.isArray(e)?e:[e]).map(e=>{let n=d(e);return{key:n,modifier:u(e),enabled:n!==null,callback:t}})}function p(){n(n().selectionRect=null,!0),n(n().selectionKeyPressed=!1,!0),n(n().multiselectionKeyPressed=!1,!0),n(n().deleteKeyPressed=!1,!0),n(n().panActivationKeyPressed=!1,!0),n(n().zoomActivationKeyPressed=!1,!0)}function m(){c({nodes:n().nodes.filter(e=>e.selected),edges:n().edges.filter(e=>e.selected)})}ar(`blur`,Yt,p),ar(`contextmenu`,Yt,p),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!0,!0)),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(r(),()=>n(n().selectionKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(i(),()=>{n(n().multiselectionKeyPressed=!0,!0)}),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(i(),()=>n(n().multiselectionKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(a(),e=>{!(e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)&&!Yb(e.originalEvent)&&(n(n().deleteKeyPressed=!0,!0),m())}),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(a(),()=>n(n().deleteKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!0,!0)),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(o(),()=>n(n().panActivationKeyPressed=!1,!0)),type:`keyup`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!0,!0)),type:`keydown`})),jr(Yt,(e,t)=>jS?.(e,t),()=>({trigger:f(s(),()=>n(n().zoomActivationKeyPressed=!1,!0)),type:`keyup`})),at()}var Dfe=pr(`<path fill="none" class="svelte-flow__connection-path"></path>`),FS=pr(`<svg class="svelte-flow__connectionline"><g><!></g></svg>`);function IS(e,t){it(t,!0);let n=It(()=>{if(!t.store.connection.inProgress)return``;let e={sourceX:t.store.connection.from.x,sourceY:t.store.connection.from.y,sourcePosition:t.store.connection.fromPosition,targetX:t.store.connection.to.x,targetY:t.store.connection.to.y,targetPosition:t.store.connection.toPosition};switch(t.type){case db.Bezier:{let[t]=ex(e);return t}case db.Straight:{let[t]=ox(e);return t}case db.Step:case db.SmoothStep:{let[n]=cx({...e,borderRadius:t.type===db.Step?0:void 0});return n}}});var r=hr(),i=tn(r),a=e=>{var r=FS(),i=en(r),a=en(i),o=e=>{var n=hr();Ar(tn(n),()=>t.LineComponent,(e,t)=>{t(e,{})}),gr(e,n)},s=e=>{var r=Dfe();_n(()=>{qr(r,`d`,w(n)),Rr(r,t.style)}),gr(e,r)};Cr(a,e=>{t.LineComponent?e(o):e(s,-1)}),We(i),We(r),_n(e=>{qr(r,`width`,t.store.width),qr(r,`height`,t.store.height),Rr(r,t.containerStyle),Ir(i,0,e)},[()=>Mr([`svelte-flow__connection`,ode(t.store.connection.isValid)])]),gr(e,r)};Cr(i,e=>{t.store.connection.inProgress&&e(a)}),gr(e,r),at()}var Ofe=fr(`<div><!></div>`);function LS(e,t){it(t,!0);let n=ii(t,`position`,3,`top-right`),r=ni(t,[`$$slots`,`$$events`,`$$legacy`,`position`,`style`,`class`,`children`]),i=It(()=>`${n()}`.split(`-`));var a=Ofe();Jr(a,e=>({class:e,style:t.style,...r}),[()=>[`svelte-flow__panel`,t.class,...w(i)]]),br(en(a),()=>t.children??ne),We(a),gr(e,a),at()}var kfe=fr(`<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>`);function Afe(e,t){it(t,!0);let n=ii(t,`position`,3,`bottom-right`);var r=hr(),i=tn(r),a=e=>{LS(e,{get position(){return n()},class:`svelte-flow__attribution`,"data-message":`Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us`,children:(e,t)=>{gr(e,kfe())},$$slots:{default:!0}})};Cr(i,e=>{t.proOptions?.hideAttribution||e(a)}),gr(e,r),at()}var RS=fr(`<div><!></div>`);function zS(e,t){it(t,!0);let n=ii(t,`domNode`,15),r=ii(t,`clientWidth`,15),i=ii(t,`clientHeight`,15),a=It(()=>t.rest.class),o=It(()=>se(t.rest,`id.class.nodeTypes.edgeTypes.colorMode.isValidConnection.onmove.onmovestart.onmoveend.onflowerror.ondelete.onbeforedelete.onbeforeconnect.onconnect.onconnectstart.onconnectend.onbeforereconnect.onreconnect.onreconnectstart.onreconnectend.onclickconnectstart.onclickconnectend.oninit.onselectionchange.onselectiondragstart.onselectiondrag.onselectiondragstop.onselectionstart.onselectionend.clickConnect.fitView.fitViewOptions.nodeOrigin.nodeDragThreshold.connectionDragThreshold.minZoom.maxZoom.initialViewport.connectionRadius.connectionMode.selectionMode.selectNodesOnDrag.snapGrid.defaultMarkerColor.translateExtent.nodeExtent.onlyRenderVisibleElements.autoPanOnConnect.autoPanOnNodeDrag.colorModeSSR.defaultEdgeOptions.elevateNodesOnSelect.elevateEdgesOnSelect.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.elementsSelectable.nodesFocusable.edgesFocusable.disableKeyboardA11y.noDragClass.noPanClass.noWheelClass.ariaLabelConfig.autoPanSpeed.panOnScrollSpeed.zIndexMode`.split(`.`)));function s(e){e.currentTarget.scrollTo({top:0,left:0,behavior:`auto`}),t.rest.onscroll&&t.rest.onscroll(e)}var c=RS();Jr(c,e=>({class:[`svelte-flow`,`svelte-flow__container`,w(a),t.colorMode],"data-testid":`svelte-flow__wrapper`,role:`application`,onscroll:s,...w(o),[Hr]:e}),[()=>({width:tS(t.width),height:tS(t.height)})],void 0,void 0,`svelte-ltj518`),br(en(c),()=>t.children??ne),We(c),$r(c,e=>n(e),()=>n()),Bte(c,`clientHeight`,i),Bte(c,`clientWidth`,r),gr(e,c),at()}var BS=fr(`<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>`,1),jfe=fr(`<!> <!>`,1),Mfe=fr(`<!> <!> <!> <!> <!>`,1);function Nfe(e,t){it(t,!0);let n=ii(t,`paneClickDistance`,3,1),r=ii(t,`nodeClickDistance`,3,1),i=ii(t,`panOnScrollMode`,19,()=>lb.Free),a=ii(t,`preventScrolling`,3,!0),o=ii(t,`zoomOnScroll`,3,!0),s=ii(t,`zoomOnDoubleClick`,3,!0),c=ii(t,`zoomOnPinch`,3,!0),l=ii(t,`panOnScroll`,3,!1),u=ii(t,`panOnScrollSpeed`,3,.5),d=ii(t,`panOnDrag`,3,!0),f=ii(t,`selectionOnDrag`,3,!1),p=ii(t,`connectionLineType`,19,()=>db.Bezier),m=ii(t,`nodes`,31,()=>Jt([])),h=ii(t,`edges`,31,()=>Jt([])),g=ii(t,`viewport`,15,void 0),_=ni(t,`$$slots.$$events.$$legacy.width.height.proOptions.selectionKey.deleteKey.panActivationKey.multiSelectionKey.zoomActivationKey.paneClickDistance.nodeClickDistance.onmovestart.onmoveend.onmove.oninit.onnodeclick.onnodecontextmenu.onnodedrag.onnodedragstart.onnodedragstop.onnodepointerenter.onnodepointermove.onnodepointerleave.onselectionclick.onselectioncontextmenu.onselectionstart.onselectionend.onedgeclick.onedgecontextmenu.onedgepointerenter.onedgepointerleave.onpaneclick.onpanecontextmenu.panOnScrollMode.preventScrolling.zoomOnScroll.zoomOnDoubleClick.zoomOnPinch.panOnScroll.panOnScrollSpeed.panOnDrag.selectionOnDrag.connectionLineComponent.connectionLineStyle.connectionLineContainerStyle.connectionLineType.attributionPosition.children.nodes.edges.viewport`.split(`.`)),v=sfe({props:_,width:t.width,height:t.height,get nodes(){return m()},set nodes(e){m(e)},get edges(){return h()},set edges(e){h(e)},get viewport(){return g()},set viewport(e){g(e)}}),y=nt(mS);y&&y.setStore&&y.setStore(v),rt(mS,{provider:!1,getStore(){return v}}),fn(()=>{let e={nodes:v.selectedNodes,edges:v.selectedEdges};Qn(()=>t.onselectionchange)?.(e);for(let t of v.selectionChangeHandlers.values())t(e)}),Sr(()=>{v.reset()}),zS(e,{get colorMode(){return v.colorMode},get width(){return t.width},get height(){return t.height},get rest(){return _},get domNode(){return v.domNode},set domNode(e){v.domNode=e},get clientWidth(){return v.width},set clientWidth(e){v.width=e},get clientHeight(){return v.height},set clientHeight(e){v.height=e},children:(e,m)=>{var h=Mfe(),g=tn(h);PS(g,{get selectionKey(){return t.selectionKey},get deleteKey(){return t.deleteKey},get panActivationKey(){return t.panActivationKey},get multiSelectionKey(){return t.multiSelectionKey},get zoomActivationKey(){return t.zoomActivationKey},get store(){return v},set store(e){v=e}});var _=nn(g,2);lfe(_,{get panOnScrollMode(){return i()},get preventScrolling(){return a()},get zoomOnScroll(){return o()},get zoomOnDoubleClick(){return s()},get zoomOnPinch(){return c()},get panOnScroll(){return l()},get panOnScrollSpeed(){return u()},get panOnDrag(){return d()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get onmovestart(){return t.onmovestart},get onmove(){return t.onmove},get onmoveend(){return t.onmoveend},get oninit(){return t.oninit},get store(){return v},set store(e){v=e},children:(e,i)=>{dfe(e,{get onpaneclick(){return t.onpaneclick},get onpanecontextmenu(){return t.onpanecontextmenu},get onselectionstart(){return t.onselectionstart},get onselectionend(){return t.onselectionend},get panOnDrag(){return d()},get paneClickDistance(){return n()},get selectionOnDrag(){return f()},get store(){return v},set store(e){v=e},children:(e,n)=>{var i=jfe(),a=tn(i);yS(a,{get store(){return v},set store(e){v=e},children:(e,n)=>{var i=BS(),a=nn(tn(i),2);wfe(a,{get onedgeclick(){return t.onedgeclick},get onedgecontextmenu(){return t.onedgecontextmenu},get onedgepointerenter(){return t.onedgepointerenter},get onedgepointerleave(){return t.onedgepointerleave},get store(){return v},set store(e){v=e}});var o=nn(a,4);IS(o,{get type(){return p()},get LineComponent(){return t.connectionLineComponent},get containerStyle(){return t.connectionLineContainerStyle},get style(){return t.connectionLineStyle},get store(){return v},set store(e){v=e}});var s=nn(o,2);TS(s,{get nodeClickDistance(){return r()},get onnodeclick(){return t.onnodeclick},get onnodecontextmenu(){return t.onnodecontextmenu},get onnodepointerenter(){return t.onnodepointerenter},get onnodepointermove(){return t.onnodepointermove},get onnodepointerleave(){return t.onnodepointerleave},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return v},set store(e){v=e}}),kS(nn(s,2),{get onselectionclick(){return t.onselectionclick},get onselectioncontextmenu(){return t.onselectioncontextmenu},get onnodedrag(){return t.onnodedrag},get onnodedragstart(){return t.onnodedragstart},get onnodedragstop(){return t.onnodedragstop},get store(){return v},set store(e){v=e}}),Ge(2),gr(e,i)},$$slots:{default:!0}});var o=nn(a,2);{let e=It(()=>!!(v.selectionRect&&v.selectionRectMode===`user`)),t=It(()=>v.selectionRect?.width),n=It(()=>v.selectionRect?.height),r=It(()=>v.selectionRect?.x),i=It(()=>v.selectionRect?.y);OS(o,{get isVisible(){return w(e)},get width(){return w(t)},get height(){return w(n)},get x(){return w(r)},get y(){return w(i)}})}gr(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}});var y=nn(_,2);Afe(y,{get proOptions(){return t.proOptions},get position(){return t.attributionPosition}});var b=nn(y,2);xS(b,{get store(){return v}}),br(nn(b,2),()=>t.children??ne),gr(e,h)},$$slots:{default:!0}}),at()}var VS=fr(`<button><!></button>`);function HS(e,t){let n=ni(t,[`$$slots`,`$$events`,`$$legacy`,`class`,`bgColor`,`bgColorHover`,`color`,`colorHover`,`borderColor`,`onclick`,`children`]);var r=VS();Jr(r,()=>({type:`button`,onclick:t.onclick,class:[`svelte-flow__controls-button`,t.class],...n,[Hr]:{"--xy-controls-button-background-color-props":t.bgColor,"--xy-controls-button-background-color-hover-props":t.bgColorHover,"--xy-controls-button-color-props":t.color,"--xy-controls-button-color-hover-props":t.colorHover,"--xy-controls-button-border-color-props":t.borderColor}})),br(en(r),()=>t.children??ne),We(r),gr(e,r)}var Pfe=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>`);function Ffe(e){gr(e,Pfe())}var Ife=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>`);function US(e){gr(e,Ife())}var Lfe=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg>`);function Rfe(e){gr(e,Lfe())}var zfe=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"></path></svg>`);function WS(e){gr(e,zfe())}var GS=pr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg>`);function KS(e){gr(e,GS())}var Bfe=fr(`<!> <!>`,1),Vfe=fr(`<!> <!> <!> <!> <!> <!>`,1);function Hfe(e,t){it(t,!0);let n=ii(t,`position`,3,`bottom-left`),r=ii(t,`orientation`,3,`vertical`),i=ii(t,`showZoom`,3,!0),a=ii(t,`showFitView`,3,!0),o=ii(t,`showLock`,3,!0),s=ni(t,[`$$slots`,`$$events`,`$$legacy`,`position`,`orientation`,`showZoom`,`showFitView`,`showLock`,`style`,`class`,`buttonBgColor`,`buttonBgColorHover`,`buttonColor`,`buttonColorHover`,`buttonBorderColor`,`fitViewOptions`,`children`,`before`,`after`]),c=It(pS),l={bgColor:t.buttonBgColor,bgColorHover:t.buttonBgColorHover,color:t.buttonColor,colorHover:t.buttonColorHover,borderColor:t.buttonBorderColor},u=It(()=>w(c).nodesDraggable||w(c).nodesConnectable||w(c).elementsSelectable),d=It(()=>w(c).viewport.zoom<=w(c).minZoom),f=It(()=>w(c).viewport.zoom>=w(c).maxZoom),p=It(()=>w(c).ariaLabelConfig),m=It(()=>r()===`horizontal`?`horizontal`:`vertical`),h=()=>{w(c).zoomIn()},g=()=>{w(c).zoomOut()},_=()=>{w(c).fitView(t.fitViewOptions)},v=()=>{let e=!w(u);w(c).nodesDraggable=e,w(c).nodesConnectable=e,w(c).elementsSelectable=e};{let r=It(()=>[`svelte-flow__controls`,w(m),t.class]);LS(e,ri({get class(){return w(r)},get position(){return n()},"data-testid":`svelte-flow__controls`,get"aria-label"(){return w(p)[`controls.ariaLabel`]},get style(){return t.style}},()=>s,{children:(e,n)=>{var r=Vfe(),s=tn(r),c=e=>{var n=hr();br(tn(n),()=>t.before),gr(e,n)};Cr(s,e=>{t.before&&e(c)});var m=nn(s,2),y=e=>{var t=Bfe(),n=tn(t);HS(n,ri({onclick:h,class:`svelte-flow__controls-zoomin`,get title(){return w(p)[`controls.zoomIn.ariaLabel`]},get"aria-label"(){return w(p)[`controls.zoomIn.ariaLabel`]},get disabled(){return w(f)}},()=>l,{children:(e,t)=>{Ffe(e,{})},$$slots:{default:!0}})),HS(nn(n,2),ri({onclick:g,class:`svelte-flow__controls-zoomout`,get title(){return w(p)[`controls.zoomOut.ariaLabel`]},get"aria-label"(){return w(p)[`controls.zoomOut.ariaLabel`]},get disabled(){return w(d)}},()=>l,{children:(e,t)=>{US(e,{})},$$slots:{default:!0}})),gr(e,t)};Cr(m,e=>{i()&&e(y)});var b=nn(m,2),x=e=>{HS(e,ri({class:`svelte-flow__controls-fitview`,onclick:_,get title(){return w(p)[`controls.fitView.ariaLabel`]},get"aria-label"(){return w(p)[`controls.fitView.ariaLabel`]}},()=>l,{children:(e,t)=>{Rfe(e,{})},$$slots:{default:!0}}))};Cr(b,e=>{a()&&e(x)});var S=nn(b,2),ee=e=>{HS(e,ri({class:`svelte-flow__controls-interactive`,onclick:v,get title(){return w(p)[`controls.interactive.ariaLabel`]},get"aria-label"(){return w(p)[`controls.interactive.ariaLabel`]}},()=>l,{children:(e,t)=>{var n=hr(),r=tn(n),i=e=>{KS(e,{})},a=e=>{WS(e,{})};Cr(r,e=>{w(u)?e(i):e(a,-1)}),gr(e,n)},$$slots:{default:!0}}))};Cr(S,e=>{o()&&e(ee)});var te=nn(S,2),ne=e=>{var n=hr();br(tn(n),()=>t.children),gr(e,n)};Cr(te,e=>{t.children&&e(ne)});var C=nn(te,2),re=e=>{var n=hr();br(tn(n),()=>t.after),gr(e,n)};Cr(C,e=>{t.after&&e(re)}),gr(e,r)},$$slots:{default:!0}}))}at()}var qS;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(qS||={});var JS=pr(`<circle></circle>`);function YS(e,t){var n=JS();_n(()=>{qr(n,`cx`,t.radius),qr(n,`cy`,t.radius),qr(n,`r`,t.radius),Ir(n,0,Mr([`svelte-flow__background-pattern`,`dots`,t.class]))}),gr(e,n)}var XS=pr(`<path></path>`);function Ufe(e,t){it(t,!0);var n=XS();_n(()=>{qr(n,`stroke-width`,t.lineWidth),qr(n,`d`,`M${t.dimensions[0]/2} 0 V${t.dimensions[1]} M0 ${t.dimensions[1]/2} H${t.dimensions[0]}`),Ir(n,0,Mr([`svelte-flow__background-pattern`,t.variant,t.class]))}),gr(e,n),at()}var ZS={[qS.Dots]:1,[qS.Lines]:1,[qS.Cross]:6},Wfe=pr(`<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>`);function QS(e,t){it(t,!0);let n=ii(t,`variant`,19,()=>qS.Dots),r=ii(t,`gap`,3,20),i=ii(t,`lineWidth`,3,1),a=It(pS),o=It(()=>n()===qS.Dots),s=It(()=>n()===qS.Cross),c=It(()=>Array.isArray(r())?r():[r(),r()]),l=It(()=>`background-pattern-${w(a).flowId}-${t.id??``}`),u=It(()=>[w(c)[0]*w(a).viewport.zoom||1,w(c)[1]*w(a).viewport.zoom||1]),d=It(()=>(t.size??ZS[n()])*w(a).viewport.zoom),f=It(()=>w(s)?[w(d),w(d)]:w(u)),p=It(()=>w(o)?[w(d)/2,w(d)/2]:[w(f)[0]/2,w(f)[1]/2]);var m=Wfe();let h;var g=en(m),_=en(g),v=e=>{{let n=It(()=>w(d)/2);YS(e,{get radius(){return w(n)},get class(){return t.patternClass}})}},y=e=>{Ufe(e,{get dimensions(){return w(f)},get variant(){return n()},get lineWidth(){return i()},get class(){return t.patternClass}})};Cr(_,e=>{w(o)?e(v):e(y,-1)}),We(g);var b=nn(g);We(m),_n(()=>{Ir(m,0,Mr([`svelte-flow__background`,`svelte-flow__container`,t.class])),h=Rr(m,``,h,{"--xy-background-color-props":t.bgColor,"--xy-background-pattern-color-props":t.patternColor}),qr(g,`id`,w(l)),qr(g,`x`,w(a).viewport.x%w(u)[0]),qr(g,`y`,w(a).viewport.y%w(u)[1]),qr(g,`width`,w(u)[0]),qr(g,`height`,w(u)[1]),qr(g,`patternTransform`,`translate(-${w(p)[0]},-${w(p)[1]})`),qr(b,`fill`,`url(#${w(l)})`)}),gr(e,m),at()}var $S=c(o(((e,t)=>{(function(n){if(typeof e==`object`&&t!==void 0)t.exports=n();else if(typeof define==`function`&&define.amd)define([],n);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=n()}})(function(){return(function(){function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o<r.length;o++)i(r[o]);return i}return e})()({1:[function(e,t,n){Object.defineProperty(n,`__esModule`,{value:!0}),n.default=void 0;function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function s(e){var t=c(e,`string`);return r(t)==`symbol`?t:t+``}function c(e,t){if(r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||`default`);if(r(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}n.default=function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,a=r===void 0?{}:r,o=n.algorithms,s=o===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:o,c=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=a,this.initialized=!1,u===void 0&&c===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=c;u!==void 0&&c===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new l(f),this.worker.postMessage({cmd:`register`,algorithms:s}).then(function(e){return t.initialized=!0}).catch(console.err)}return o(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i===void 0?!1:i,o=t.measureExecutionTime,s=o===void 0?!1:o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}])}();var l=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return o(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}])}()},{}],2:[function(e,t,n){(function(e){(function(){var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function ee(){}function te(){}function ne(){}function C(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function eee(){}function tee(){}function nee(){}function ree(){}function Re(){}function iee(){}function aee(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function oee(){}function see(){}function Je(){}function Ye(){}function Xe(){}function cee(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function lee(){}function it(){}function at(){}function ot(){}function st(){}function uee(){}function ct(){}function dee(){}function lt(){}function fee(){}function ut(){}function dt(){}function pee(){}function ft(){}function pt(){}function mt(){}function ht(){}function mee(){}function gt(){}function hee(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function gee(){}function _ee(){}function Et(){}function vee(){}function yee(){}function Dt(){}function bee(){}function xee(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function See(){}function Cee(){}function wee(){}function Tee(){}function Eee(){}function Nt(){}function Pt(){}function Ft(){}function Dee(){}function It(){}function Lt(){}function Oee(){}function kee(){}function Rt(){}function zt(){}function Aee(){}function Bt(){}function Vt(){}function Ht(){}function jee(){}function Ut(){}function Wt(){}function Mee(){}function Gt(){}function Kt(){}function Nee(){}function qt(){}function Pee(){}function Jt(){}function Fee(){}function Iee(){}function Yt(){}function Lee(){}function Ree(){}function Xt(){}function zee(){}function Zt(){}function Qt(){}function $t(){}function en(){}function tn(){}function nn(){}function Bee(){}function rn(){}function Vee(){}function an(){}function Hee(){}function Uee(){}function on(){}function sn(){}function Wee(){}function cn(){}function Gee(){}function ln(){}function un(){}function dn(){}function fn(){}function pn(){}function mn(){}function Kee(){}function qee(){}function hn(){}function Jee(){}function gn(){}function _n(){}function vn(){}function yn(){}function bn(){}function xn(){}function Sn(){}function Yee(){}function Cn(){}function Xee(){}function wn(){}function Tn(){}function En(){}function Dn(){}function On(){}function kn(){}function Zee(){}function An(){}function jn(){}function Mn(){}function Nn(){}function Pn(){}function Fn(){}function In(){}function Ln(){}function Rn(){}function zn(){}function Bn(){}function Vn(){}function Hn(){}function Qee(){}function Un(){}function Wn(){}function Gn(){}function $ee(){}function ete(){}function Kn(){}function qn(){}function Jn(){}function tte(){}function Yn(){}function Xn(){}function nte(){}function w(){}function Zn(){}function rte(){}function Qn(){}function ite(){}function $n(){}function er(){}function tr(){}function nr(){}function rr(){}function ir(){}function ar(){}function or(){}function sr(){}function cr(){}function lr(){}function ate(){}function ote(){}function ur(){}function dr(){}function fr(){}function ste(){}function pr(){}function mr(){}function hr(){}function gr(){}function cte(){}function lte(){}function ute(){}function dte(){}function fte(){}function pte(){}function mte(){}function hte(){}function _r(){}function gte(){}function vr(){}function _te(){}function vte(){}function yr(){}function br(){}function xr(){}function Sr(){}function yte(){}function Cr(){}function bte(){}function xte(){}function wr(){}function Ste(){}function Tr(){}function Cte(){}function Er(){}function Dr(){}function wte(){}function Tte(){}function Or(){}function kr(){}function Ar(){}function jr(){}function Ete(){}function Dte(){}function Ote(){}function Mr(){}function Nr(){}function Pr(){}function kte(){}function Fr(){}function Ate(){}function Ir(){}function Lr(){}function Rr(){}function zr(){}function jte(){}function Br(){}function Vr(){}function Hr(){}function Ur(){}function Wr(){}function Mte(){}function Nte(){}function Gr(){}function Pte(){}function Kr(){}function Fte(){}function qr(){}function Ite(){}function Jr(){}function Yr(){}function Lte(){}function Rte(){}function Xr(){}function Zr(){}function Qr(){}function zte(){}function Bte(){}function Vte(){}function $r(){}function ei(){}function ti(){}function Hte(){}function ni(){}function Ute(){}function ri(){}function ii(){}function Wte(){}function ai(){}function oi(){}function si(){}function Gte(){}function ci(){}function li(){}function Kte(){}function ui(){}function qte(){}function di(){}function Jte(){}function Yte(){}function Xte(){}function fi(){}function pi(){}function mi(){}function Zte(){}function hi(){}function Qte(){}function gi(){}function $te(){}function ene(){}function tne(){}function _i(){}function vi(){}function nne(){}function rne(){}function yi(){}function ine(){}function bi(){}function xi(){}function Si(){}function Ci(){}function wi(){}function Ti(){}function Ei(){}function Di(){}function Oi(){}function ki(){}function Ai(){}function ji(){}function Mi(){}function Ni(){}function Pi(){}function Fi(){}function Ii(){}function Li(){}function Ri(){}function zi(){}function ane(){}function Bi(){}function Vi(){}function Hi(){}function Ui(){}function Wi(){}function one(){}function sne(){}function Gi(){}function cne(){}function lne(){}function Ki(){}function qi(){}function une(){}function Ji(){}function dne(){}function Yi(){}function Xi(){}function Zi(){}function Qi(){}function $i(){}function fne(){}function pne(){}function ea(){}function ta(){}function mne(){}function na(){}function ra(){}function ia(){}function hne(){}function gne(){}function _ne(){}function aa(){}function oa(){}function vne(){}function sa(){}function yne(){}function bne(){}function ca(){}function la(){}function ua(){}function da(){}function fa(){}function xne(){}function pa(){}function Sne(){}function ma(){}function ha(){}function ga(){}function _a(){}function va(){}function ya(){}function ba(){}function xa(){}function Sa(){}function Ca(){}function wa(){}function Ta(){}function Cne(){}function Ea(){}function Da(){}function Oa(){}function ka(){}function Aa(){}function ja(){}function wne(){}function Ma(){}function Na(){}function Pa(){}function Tne(){}function Fa(){}function Ia(){}function Ene(){}function La(){}function Ra(){}function za(){}function Ba(){}function Va(){}function Dne(){}function Ha(){}function Ua(){}function Wa(){}function Ga(){}function One(){}function Ka(){}function kne(){}function qa(){}function Ja(){}function Ya(){}function Xa(){}function Ane(){}function jne(){}function Mne(){}function Za(){}function Qa(){}function $a(){}function eo(){}function to(){}function no(){}function Nne(){}function Pne(){}function ro(){}function Fne(){}function io(){}function ao(){}function oo(){}function so(){}function co(){}function lo(){}function uo(){}function fo(){}function po(){}function mo(){}function Ine(){}function ho(){}function go(){}function _o(){}function Lne(){}function vo(){}function Rne(){}function zne(){}function yo(){}function bo(){}function xo(){}function So(){}function Co(){}function wo(){}function To(){}function Eo(){}function Do(){}function Oo(){}function ko(){}function Ao(){}function jo(){}function Bne(){}function Mo(){}function No(){}function Po(){}function Fo(){}function Io(){}function Lo(){}function Ro(){}function zo(){}function Vne(){}function Hne(){}function Bo(){}function Vo(){}function Une(){}function Ho(){}function Uo(){}function Wne(){}function Gne(){}function Wo(){}function Go(){}function Ko(){}function qo(){}function Jo(){}function Yo(){}function Xo(){}function Zo(){}function Qo(){}function $o(){}function Kne(){}function es(){}function ts(){}function ns(){}function rs(){}function is(){}function as(){}function qne(){}function os(){}function ss(){}function cs(){}function ls(){}function us(){}function ds(){}function fs(){}function ps(){}function ms(){}function hs(){}function gs(){}function _s(){}function vs(){}function ys(){}function bs(){}function xs(){}function Jne(){}function Ss(){}function Cs(){}function ws(){}function Ts(){}function Es(){}function Ds(){}function Yne(){}function Xne(){}function Os(){}function ks(){}function As(){}function js(){}function Zne(){}function Qne(){}function $ne(){}function ere(){}function Ms(){}function tre(){}function nre(){}function rre(){}function ire(){}function are(){}function ore(){}function sre(){}function Ns(){}function Ps(){}function Fs(){}function cre(){}function Is(){}function lre(){}function ure(){}function dre(){}function fre(){}function pre(){}function mre(){}function hre(){}function gre(){}function _re(){}function vre(){}function Ls(){}function yre(){}function bre(){}function xre(){}function Sre(){}function Cre(){}function wre(){}function Tre(){}function Rs(){}function Ere(){}function zs(){}function Bs(){}function Vs(){}function Dre(){}function Hs(){}function Ore(){}function kre(){}function Are(){}function jre(){}function Mre(){}function Nre(){}function Pre(){}function Us(){}function Fre(){}function Ws(){}function Ire(){}function Lre(){}function Gs(){}function Rre(){}function Ks(){}function zre(){}function qs(){}function Bre(){}function Js(){}function Ys(){}function Xs(){}function Zs(){}function Vre(){}function Hre(){}function Qs(){yp()}function Ure(){B$e()}function Wre(){fV()}function $s(){tYe()}function ec(){tR()}function tc(){uT()}function Gre(){Lg()}function nc(){Pg()}function rc(){Jle()}function ic(){bN()}function Kre(){nMe()}function ac(){NP()}function oc(){GR()}function sc(){WIe()}function cc(){pEe()}function qre(){HIe()}function Jre(){gEe()}function lc(){hEe()}function Yre(){_Ee()}function Xre(){$Me()}function uc(){yEe()}function dc(){qIe()}function fc(){hH()}function pc(){zg()}function mc(){GIe()}function Zre(){KIe()}function hc(){GOe()}function gc(){$ct()}function _c(){JIe()}function Qre(){xEe()}function $re(){dM()}function vc(){XHe()}function yc(){fM()}function bc(){R4e()}function xc(){VR()}function Sc(){uRe()}function eie(){J9e()}function Cc(){cYe()}function wc(){bEe()}function Tc(){Net()}function tie(){_V()}function Ec(){FB()}function nie(){Stt()}function rie(){ez()}function iie(){RB()}function aie(){Tqe()}function oie(){mj()}function Dc(){vH()}function sie(){HR()}function Oc(){eF()}function cie(){BWe()}function kc(){DV()}function Ac(){JLe()}function jc(){tge()}function Mc(){jtt()}function Nc(e){yD(e)}function lie(e){this.a=e}function Pc(e){this.a=e}function Fc(e){this.a=e}function uie(e){this.a=e}function Ic(e){this.a=e}function Lc(e){this.a=e}function Rc(e){this.a=e}function zc(e){this.a=e}function Bc(e){this.a=e}function Vc(e){this.a=e}function Hc(e){this.a=e}function Uc(e){this.a=e}function die(e){this.a=e}function fie(e){this.c=e}function Wc(e){this.a=e}function Gc(e){this.a=e}function Kc(e){this.a=e}function qc(e){this.a=e}function pie(e){this.a=e}function Jc(e){this.a=e}function Yc(e){this.a=e}function mie(e){this.a=e}function Xc(e){this.a=e}function Zc(e){this.a=e}function Qc(e){this.a=e}function hie(e){this.a=e}function gie(e){this.a=e}function $c(e){this.a=e}function _ie(e){this.a=e}function el(e){this.a=e}function tl(e){this.a=e}function vie(e){this.a=e}function nl(e){this.a=e}function yie(e){this.a=e}function bie(e){this.a=e}function rl(e){this.a=e}function xie(e){this.a=e}function Sie(e){this.a=e}function Cie(e){this.a=e}function il(e){this.a=e}function al(e){this.a=e}function ol(e){this.a=e}function sl(e){this.a=e}function cl(e){this.b=e}function ll(){this.a=[]}function ul(e,t){e.a=t}function wie(e,t){e.a=t}function Tie(e,t){e.b=t}function Eie(e,t){e.c=t}function dl(e,t){e.c=t}function fl(e,t){e.d=t}function Die(e,t){e.d=t}function pl(e,t){e.k=t}function ml(e,t){e.j=t}function hl(e,t){e.c=t}function gl(e,t){e.c=t}function _l(e,t){e.a=t}function Oie(e,t){e.a=t}function kie(e,t){e.f=t}function Aie(e,t){e.a=t}function jie(e,t){e.b=t}function vl(e,t){e.d=t}function yl(e,t){e.i=t}function bl(e,t){e.o=t}function xl(e,t){e.r=t}function Sl(e,t){e.a=t}function Cl(e,t){e.b=t}function Mie(e,t){e.e=t}function wl(e,t){e.f=t}function Tl(e,t){e.g=t}function Nie(e,t){e.e=t}function Pie(e,t){e.f=t}function Fie(e,t){e.f=t}function El(e,t){e.a=t}function Dl(e,t){e.b=t}function Iie(e,t){e.n=t}function Lie(e,t){e.a=t}function Rie(e,t){e.c=t}function zie(e,t){e.c=t}function Bie(e,t){e.c=t}function Ol(e,t){e.a=t}function kl(e,t){e.a=t}function Al(e,t){e.d=t}function Vie(e,t){e.d=t}function Hie(e,t){e.e=t}function Uie(e,t){e.e=t}function Wie(e,t){e.g=t}function Gie(e,t){e.f=t}function jl(e,t){e.j=t}function Ml(e,t){e.a=t}function Nl(e,t){e.a=t}function Kie(e,t){e.b=t}function Pl(e){e.b=e.a}function qie(e){e.c=e.d.d}function Fl(e){this.a=e}function Il(e){this.a=e}function Ll(e){this.a=e}function Rl(e){this.a=e}function zl(e){this.a=e}function Bl(e){this.a=e}function Jie(e){this.a=e}function Vl(e){this.a=e}function Hl(e){this.a=e}function Ul(e){this.a=e}function Wl(e){this.a=e}function Gl(e){this.a=e}function Kl(e){this.a=e}function ql(e){this.a=e}function Jl(e){this.b=e}function Yl(e){this.b=e}function Xl(e){this.b=e}function Zl(e){this.d=e}function Ql(e){this.a=e}function Yie(e){this.a=e}function $l(e){this.a=e}function eu(e){this.a=e}function tu(e){this.a=e}function nu(e){this.a=e}function ru(e){this.a=e}function iu(e){this.c=e}function T(e){this.c=e}function au(e){this.c=e}function Xie(e){this.a=e}function ou(e){this.a=e}function Zie(e){this.a=e}function Qie(e){this.a=e}function su(e){this.a=e}function $ie(e){this.a=e}function cu(e){this.a=e}function lu(e){this.a=e}function eae(e){this.a=e}function tae(e){this.a=e}function nae(e){this.a=e}function rae(e){this.a=e}function uu(e){this.a=e}function du(e){this.a=e}function fu(e){this.a=e}function iae(e){this.a=e}function aae(e){this.a=e}function pu(e){this.a=e}function mu(e){this.a=e}function hu(e){this.a=e}function gu(e){this.a=e}function _u(e){this.a=e}function vu(e){this.a=e}function yu(e){this.a=e}function bu(e){this.a=e}function xu(e){this.a=e}function Su(e){this.a=e}function Cu(e){this.a=e}function wu(e){this.a=e}function oae(e){this.a=e}function Tu(e){this.a=e}function Eu(e){this.a=e}function Du(e){this.a=e}function Ou(e){this.a=e}function ku(e){this.a=e}function Au(e){this.a=e}function ju(e){this.a=e}function Mu(e){this.a=e}function sae(e){this.a=e}function Nu(e){this.a=e}function cae(e){this.a=e}function Pu(e){this.a=e}function lae(e){this.a=e}function Fu(e){this.a=e}function Iu(e){this.a=e}function Lu(e){this.a=e}function uae(e){this.a=e}function Ru(e){this.a=e}function dae(e){this.a=e}function fae(e){this.a=e}function pae(e){this.a=e}function mae(e){this.a=e}function hae(e){this.a=e}function gae(e){this.a=e}function _ae(e){this.a=e}function vae(e){this.a=e}function yae(e){this.a=e}function bae(e){this.a=e}function xae(e){this.a=e}function Sae(e){this.a=e}function Cae(e){this.a=e}function zu(e){this.a=e}function Bu(e){this.a=e}function Vu(e){this.a=e}function wae(e){this.a=e}function Tae(e){this.a=e}function Eae(e){this.a=e}function Dae(e){this.a=e}function Oae(e){this.a=e}function kae(e){this.a=e}function Aae(e){this.a=e}function Hu(e){this.a=e}function jae(e){this.a=e}function Mae(e){this.a=e}function Uu(e){this.a=e}function Nae(e){this.a=e}function Pae(e){this.a=e}function Fae(e){this.a=e}function Wu(e){this.a=e}function Gu(e){this.a=e}function Iae(e){this.a=e}function Lae(e){this.a=e}function Rae(e){this.a=e}function zae(e){this.a=e}function Ku(e){this.a=e}function Bae(e){this.b=e}function Vae(e){this.a=e}function Hae(e){this.a=e}function Uae(e){this.a=e}function Wae(e){this.a=e}function qu(e){this.a=e}function Gae(e){this.a=e}function Ju(e){this.c=e}function Kae(e){this.a=e}function qae(e){this.a=e}function Yu(e){this.a=e}function Xu(e){this.a=e}function Jae(e){this.a=e}function Yae(e){this.a=e}function Xae(e){this.a=e}function Zu(e){this.a=e}function Zae(e){this.a=e}function Qae(e){this.a=e}function $ae(e){this.a=e}function Qu(e){this.a=e}function eoe(e){this.a=e}function toe(e){this.a=e}function $u(e){this.a=e}function noe(e){this.a=e}function ed(e){this.a=e}function td(e){this.a=e}function nd(e){this.a=e}function rd(e){this.a=e}function id(e){this.a=e}function ad(e){this.a=e}function roe(e){this.a=e}function od(e){this.a=e}function sd(e){this.a=e}function ioe(e){this.a=e}function aoe(e){this.a=e}function cd(e){this.a=e}function ld(e){this.a=e}function ooe(e){this.a=e}function soe(e){this.a=e}function ud(e){this.a=e}function dd(e){this.a=e}function fd(e){this.a=e}function pd(e){this.a=e}function md(e){this.a=e}function coe(e){this.a=e}function hd(e){this.a=e}function gd(e){this.a=e}function loe(e){this.a=e}function uoe(e){this.a=e}function doe(e){this.a=e}function foe(e){this.a=e}function poe(e){this.a=e}function moe(e){this.a=e}function hoe(e){this.a=e}function goe(e){this.a=e}function _d(e){this.a=e}function vd(e){this.a=e}function _oe(e){this.a=e}function yd(e){this.a=e}function bd(e){this.a=e}function voe(e){this.a=e}function yoe(e){this.a=e}function boe(e){this.a=e}function xd(e){this.a=e}function Sd(e){this.f=e}function Cd(e){this.a=e}function wd(e){this.a=e}function Td(e){this.a=e}function Ed(e){this.a=e}function xoe(e){this.a=e}function Soe(e){this.a=e}function Coe(e){this.a=e}function woe(e){this.a=e}function Toe(e){this.a=e}function Eoe(e){this.a=e}function Doe(e){this.a=e}function Ooe(e){this.a=e}function Dd(e){this.a=e}function Od(e){this.a=e}function kd(e){this.a=e}function koe(e){this.a=e}function Aoe(e){this.a=e}function joe(e){this.a=e}function Ad(e){this.a=e}function Moe(e){this.a=e}function Noe(e){this.a=e}function Poe(e){this.a=e}function jd(e){this.a=e}function Md(e){this.a=e}function Nd(e){this.a=e}function Pd(e){this.a=e}function Fd(e){this.a=e}function Id(e){this.a=e}function Ld(e){this.a=e}function Rd(e){this.b=e}function Foe(e){this.a=e}function Ioe(e){this.a=e}function Loe(e){this.a=e}function Roe(e){this.a=e}function zoe(e){this.a=e}function zd(e){this.a=e}function Boe(e){this.a=e}function Voe(e){this.b=e}function Hoe(e){this.a=e}function Bd(e){this.a=e}function Uoe(e){this.a=e}function Woe(e){this.a=e}function Vd(e){this.a=e}function Hd(e){this.a=e}function Ud(e){this.c=e}function Wd(e){this.e=e}function Gd(e){this.e=e}function Kd(e){this.a=e}function Goe(e){this.d=e}function Koe(e){this.a=e}function qd(e){this.a=e}function Jd(e){this.a=e}function Yd(e){this.e=e}function Xd(){this.a=0}function Zd(){Rx(this)}function Qd(){SE(this)}function $d(){dCe(this)}function qoe(){}function ef(){this.c=IBt}function tf(e,t){e.b+=t}function Joe(e,t){t.Wb(e)}function nf(e){return e.a}function Yoe(e){return e.a}function rf(e){return e.a}function Xoe(e){return e.a}function Zoe(e){return e.a}function E(e){return e.e}function Qoe(){return null}function af(){return null}function $oe(e){throw E(e)}function of(e){this.a=nD(e)}function ese(){this.a=this}function sf(){Wfe.call(this)}function tse(e){e.b.Mf(e.e)}function nse(e){e.b=new gm}function cf(e,t){e.b=t-e.b}function lf(e,t){e.a=t-e.a}function uf(e,t){t.gd(e.a)}function df(e,t){bz(t,e)}function ff(e,t){e.push(t)}function rse(e,t){e.sort(t)}function ise(e,t,n){e.Wd(n,t)}function pf(e,t){e.e=t,t.b=e}function ase(){yh(),ect()}function mf(e){MO(),ayt.je(e)}function hf(){sf.call(this)}function gf(){sf.call(this)}function _f(){Wfe.call(this)}function ose(){sf.call(this)}function vf(){sf.call(this)}function sse(){sf.call(this)}function yf(){sf.call(this)}function bf(){sf.call(this)}function xf(){sf.call(this)}function Sf(){sf.call(this)}function Cf(){sf.call(this)}function cse(){sf.call(this)}function wf(){this.Bb|=256}function lse(){this.b=new Hb}function use(){use=C,new Qd}function Tf(e,t){e.length=t}function Ef(e,t){M(e.a,t)}function dse(e,t){a1e(e.c,t)}function Df(e,t){RE(e.b,t)}function Of(e,t){FN(e.e,t)}function fse(e,t){IL(e.a,t)}function pse(e,t){XF(e.a,t)}function kf(e){Fz(e.c,e.b)}function mse(e,t){e.kc().Nb(t)}function Af(e){this.a=fUe(e)}function jf(){this.a=new Qd}function Mf(){this.a=new Qd}function Nf(){this.a=new Zd}function Pf(){this.a=new Zd}function Ff(){this.a=new Zd}function If(){this.a=new Rje}function Lf(){this.a=new Fle}function Rf(){this.a=new qTe}function zf(){this.a=new bme}function Bf(){this.a=new ree}function Vf(){this.a=new Qe}function Hf(){this.a=new qDe}function hse(){this.a=new Zd}function gse(){this.a=new Zd}function _se(){this.a=new Zd}function vse(){this.a=new Zd}function yse(){this.d=new Zd}function Uf(){this.a=new jf}function Wf(){this.a=new Qd}function bse(){this.b=new Qd}function xse(){this.b=new Zd}function Gf(){this.e=new Zd}function Kf(){this.a=new oc}function Sse(){this.d=new Zd}function qf(){qoe.call(this)}function Jf(){qf.call(this)}function Yf(){qoe.call(this)}function Xf(){Yf.call(this)}function Cse(){hf.call(this)}function Zf(){Nf.call(this)}function Qf(){qw.call(this)}function wse(){_se.call(this)}function Tse(){Zd.call(this)}function Ese(){Bwe.call(this)}function Dse(){Bwe.call(this)}function Ose(){mp.call(this)}function kse(){mp.call(this)}function $f(){mp.call(this)}function Ase(){hp.call(this)}function ep(){yo.call(this)}function tp(){yo.call(this)}function np(){gg.call(this)}function jse(){_p.call(this)}function rp(){_p.call(this)}function ip(){Qd.call(this)}function ap(){Qd.call(this)}function Mse(){Qd.call(this)}function op(){FIe.call(this)}function Nse(){jf.call(this)}function sp(){wf.call(this)}function cp(){ZS.call(this)}function lp(){Qd.call(this)}function up(){ZS.call(this)}function dp(){Qd.call(this)}function Pse(){Qd.call(this)}function fp(){Fo.call(this)}function Fse(){fp.call(this)}function Ise(){Fo.call(this)}function pp(){Zs.call(this)}function mp(){this.a=new jf}function Lse(){this.a=new Qd}function Rse(){this.a=new Zd}function zse(){this.j=new Zd}function hp(){this.a=new Qd}function gp(){this.a=new gg}function _p(){this.a=new Bne}function vp(){this.a=new ma}function Bse(){this.a=new Xce}function yp(){yp=C,zY=new o}function bp(){bp=C,WY=new Hse}function xp(){xp=C,GY=new Vse}function Vse(){Xc.call(this,``)}function Hse(){Xc.call(this,``)}function Use(e){PFe.call(this,e)}function Wse(e){PFe.call(this,e)}function Sp(e){Lc.call(this,e)}function Cp(e){cle.call(this,e)}function Gse(e){cle.call(this,e)}function Kse(e){Cp.call(this,e)}function qse(e){Cp.call(this,e)}function Jse(e){Cp.call(this,e)}function Yse(e){mAe.call(this,e)}function wp(e){mAe.call(this,e)}function Tp(e){pfe.call(this,e)}function Ep(e){xle.call(this,e)}function Dp(e){eg.call(this,e)}function Op(e){eg.call(this,e)}function kp(e){eg.call(this,e)}function Ap(e){Rbe.call(this,e)}function jp(e){Ap.call(this,e)}function Mp(){sl.call(this,{})}function Np(e){xS(),this.a=e}function Pp(e){e.b=null,e.c=0}function Xse(e,t){e.e=t,S5e(e,t)}function Zse(e,t){e.a=t,s0e(e)}function Fp(e,t,n){e.a[t.g]=n}function Qse(e,t,n){xXe(n,e,t)}function Ip(e,t){Nme(t.i,e.n)}function Lp(e,t){NBe(e).Ad(t)}function $se(e,t){return e*e/t}function Rp(e,t){return e.g-t.g}function zp(e,t){e.a.ec().Kc(t)}function Bp(e){return new ol(e)}function ece(e){return new rD(e)}function Vp(){Vp=C,tyt=new a}function Hp(){Hp=C,iyt=new v}function Up(){Up=C,eX=new x}function Wp(){Wp=C,JY=new ffe}function Gp(){Gp=C,lyt=new ee}function Kp(e){lRe(),this.a=e}function qp(e){dbe(),this.f=e}function Jp(e){dbe(),this.f=e}function tce(e){ege(),this.a=e}function Yp(e){Ap.call(this,e)}function Xp(e){Ap.call(this,e)}function nce(e){Ap.call(this,e)}function Zp(e){Rbe.call(this,e)}function Qp(e){Ap.call(this,e)}function $p(e){Ap.call(this,e)}function em(e){Ap.call(this,e)}function rce(e){Ap.call(this,e)}function tm(e){Ap.call(this,e)}function nm(e){Ap.call(this,e)}function rm(e){yD(e),this.a=e}function im(e){Exe(e,e.length)}function ice(e){return PP(e),e}function am(e){return!!e&&e.b}function ace(e){return!!e&&e.k}function oce(e){return!!e&&e.j}function om(e){return e.b==e.c}function sm(e){return yD(e),e}function D(e){return yD(e),e}function cm(e){return yD(e),e}function lm(e){return yD(e),e}function sce(e){return yD(e),e}function um(e){Ap.call(this,e)}function dm(e){Ap.call(this,e)}function fm(e){Ap.call(this,e)}function pm(e){Ap.call(this,e)}function mm(e){Ap.call(this,e)}function hm(e){AC.call(this,e,0)}function gm(){EDe.call(this,12,3)}function _m(){this.a=gw(nD(NH))}function cce(){throw E(new Sf)}function vm(){throw E(new Sf)}function ym(){throw E(new Sf)}function bm(){throw E(new Sf)}function lce(){throw E(new Sf)}function uce(){throw E(new Sf)}function xm(){xm=C,MO()}function Sm(){Bl.call(this,``)}function Cm(){Bl.call(this,``)}function wm(){Bl.call(this,``)}function Tm(){Bl.call(this,``)}function Em(e){Xp.call(this,e)}function Dm(e){Xp.call(this,e)}function Om(e){$p.call(this,e)}function km(e){Yl.call(this,e)}function Am(e){km.call(this,e)}function jm(e){QS.call(this,e)}function dce(e,t,n){e.c.Cf(t,n)}function fce(e,t,n){t.Ad(e.a[n])}function pce(e,t,n){t.Ne(e.a[n])}function Mm(e,t){return e.a-t.a}function mce(e,t){return e.a-t.a}function Nm(e,t){return e.a-t.a}function Pm(e,t){return lj(e,t)}function O(e,t){return cEe(e,t)}function hce(e,t){return t in e.a}function Fm(e){return e.a?e.b:0}function Im(e){return e.a?e.b:0}function Lm(e,t){return e.f=t,e}function gce(e,t){return e.b=t,e}function _ce(e,t){return e.c=t,e}function vce(e,t){return e.g=t,e}function Rm(e,t){return e.a=t,e}function zm(e,t){return e.f=t,e}function Bm(e,t){return e.f=t,e}function Vm(e,t){return e.e=t,e}function Hm(e,t){return e.k=t,e}function Um(e,t){return e.a=t,e}function yce(e,t){return e.e=t,e}function bce(e,t){e.b=new fx(t)}function Wm(e,t){e._d(t),t.$d(e)}function xce(e,t){fT(),t.n.a+=e}function Sce(e,t){GR(),ZO(t,e)}function Gm(e){GCe.call(this,e)}function Cce(e){GCe.call(this,e)}function Km(){rS.call(this,``)}function qm(){this.b=0,this.a=0}function Jm(){Jm=C,Gyt=fZe()}function Ym(e,t){return e.b=t,e}function Xm(e,t){return e.a=t,e}function Zm(e,t){return e.c=t,e}function Qm(e,t){return e.d=t,e}function $m(e,t){return e.e=t,e}function eh(e,t){return e.f=t,e}function th(e,t){return e.a=t,e}function nh(e,t){return e.b=t,e}function rh(e,t){return e.c=t,e}function ih(e,t){return e.c=t,e}function ah(e,t){return e.b=t,e}function oh(e,t){return e.d=t,e}function sh(e,t){return e.e=t,e}function ch(e,t){return e.f=t,e}function lh(e,t){return e.g=t,e}function uh(e,t){return e.a=t,e}function dh(e,t){return e.i=t,e}function fh(e,t){return e.j=t,e}function wce(e,t){return t.pg(e)}function Tce(e,t){return e.b-t.b}function Ece(e,t){return e.g-t.g}function ph(e,t){return e.s-t.s}function Dce(e,t){return e?0:t-1}function Oce(e,t){return e?0:t-1}function kce(e,t){return e?t-1:0}function mh(e,t){return e.k=t,e}function Ace(e,t){return e.j=t,e}function hh(){this.a=0,this.b=0}function gh(e){whe.call(this,e)}function _h(e){aM.call(this,e)}function jce(e){YD.call(this,e)}function Mce(e){YD.call(this,e)}function Nce(){Nce=C,l7=tQe()}function vh(){vh=C,kzt=eXe()}function yh(){yh=C,T7=RM()}function bh(){bh=C,SBt=tXe()}function xh(){xh=C,lVt=nXe()}function Sh(){Sh=C,x9=i0e()}function Ch(e){return e.e&&e.e()}function Pce(e,t){return e.c._b(t)}function Fce(e,t){return ZVe(e.b,t)}function Ice(e,t){return uue(e.a,t)}function wh(e,t){e.b=0,AM(e,t)}function Lce(e,t){e.c=t,e.b=!0}function Th(e,t){return e.a+=t,e}function Eh(e,t){return e.a+=t,e}function Dh(e,t){return e.a+=t,e}function Oh(e,t){return e.a+=t,e}function kh(e){return mw(e),e.o}function Ah(e){$ot(),yct(this,e)}function Rce(){throw E(new Sf)}function zce(){throw E(new Sf)}function Bce(){throw E(new Sf)}function Vce(){throw E(new Sf)}function Hce(){throw E(new Sf)}function jh(){throw E(new Sf)}function Mh(e){this.a=new _g(e)}function Nh(e){this.a=new Zbe(e)}function Ph(e,t){for(;e.Pe(t););}function Fh(e,t){for(;e.zd(t););}function Uce(e,t,n){xbe(e.a,t,n)}function Ih(e,t,n){e.splice(t,n)}function Lh(e,t){return Jrt(t,e)}function Wce(e,t){return e.d[t.p]}function Rh(e){return e.b!=e.d.c}function zh(e){return e.l|e.m<<22}function Bh(e){return e?e.d:null}function Gce(e){return e?e.g:null}function Kce(e){return e?e.i:null}function qce(e,t){return b5e(e,t)}function Vh(e){return fD(e),e.a}function Hh(e){e.c?h7e(e):g7e(e)}function Jce(){this.b=new _B(fjt)}function Yce(){this.b=new _B(sFt)}function Xce(){this.b=new _B(sFt)}function Uh(){this.a=new _B(NMt)}function Zce(){this.a=new _B(VNt)}function Wh(e){this.a=0,this.b=e}function Gh(){throw E(new Sf)}function Qce(){throw E(new Sf)}function $ce(){throw E(new Sf)}function ele(){throw E(new Sf)}function tle(){throw E(new Sf)}function nle(){throw E(new Sf)}function rle(){throw E(new Sf)}function Kh(){throw E(new Sf)}function ile(){throw E(new Sf)}function ale(){throw E(new Sf)}function ole(){throw E(new Cf)}function sle(){throw E(new Cf)}function qh(e){this.a=new lg(e)}function Jh(e,t){this.e=e,this.d=t}function Yh(e,t){this.b=e,this.c=t}function cle(e){WS(e.dc()),this.c=e}function Xh(e,t){BS.call(this,e,t)}function Zh(e,t){Xh.call(this,e,t)}function lle(e,t){this.a=e,this.b=t}function ule(e,t){this.a=e,this.b=t}function dle(e,t){this.a=e,this.b=t}function Qh(e,t){this.a=e,this.b=t}function fle(e,t){this.a=e,this.b=t}function ple(e,t){this.a=e,this.b=t}function mle(e,t){this.a=e,this.b=t}function hle(e,t){this.b=e,this.a=t}function gle(e,t){this.b=e,this.a=t}function $h(e,t){this.g=e,this.i=t}function _le(e,t){this.a=e,this.b=t}function vle(e,t){this.b=e,this.a=t}function yle(e,t){this.a=e,this.b=t}function ble(e,t){this.b=e,this.a=t}function eg(e){this.b=P(nD(e),50)}function tg(e){this.b=P(nD(e),92)}function ng(e,t){this.f=e,this.g=t}function rg(e,t){this.a=e,this.b=t}function ig(e,t){this.a=e,this.f=t}function ag(e){this.a=P(nD(e),16)}function xle(e){this.a=P(nD(e),16)}function Sle(e,t){this.b=e,this.c=t}function Cle(e){this.a=P(nD(e),92)}function wle(e,t){this.a=e,this.b=t}function og(e,t){this.a=e,this.b=t}function Tle(e,t){return PE(e.b,t)}function Ele(e,t){return e>t&&t<dU}function sg(e){return j9[e]!=-1}function cg(e){return!e||ISe(e)}function lg(e){nLe(this,e,W$e())}function Dle(e,t){Rz(R(e.a),t)}function Ole(e,t){Rz(R(e.a),t)}function ug(e,t){return e.b.Gc(t)}function dg(e,t){return e.b.Hc(t)}function kle(e,t){return e.b.Oc(t)}function Ale(e,t){return e.c.uc(t)}function jle(e,t){return e.b.Gc(t)}function Mle(e,t){return OF(e.c,t)}function fg(e){return e.f.c+e.i.c}function pg(e,t){return e.a._b(t)}function Nle(e){return eSe(),e?cyt:syt}function mg(e,t){this.a=e,this.b=t}function hg(e){this.c=e,WPe(this)}function gg(){aS(this),tO(this)}function Ple(){Bvt??=[]}function _g(e){gBe.call(this,e,0)}function Fle(){Zbe.call(this,null)}function vg(){vg=C,Eyt=new re}function yg(){yg=C,OX=new oe}function bg(){bg=C,AX=new lde}function xg(){xg=C,obt=new Ee}function Sg(){Sg=C,BX=new De}function Cg(){Cg=C,Zyt=new ude}function Ile(){YMe.call(this,null)}function wg(e,t){fD(e),e.a.Nb(t)}function Lle(e,t){return e.a.Vc(t)}function Rle(e,t){return e.a.Wc(t)}function Tg(e,t){return e.a.Yc(t)}function Eg(e,t){return e.a.Zc(t)}function zle(e,t){return e.Fc(t),e}function Ble(e,t){return e.a.f=t,e}function Vle(e,t){return e.a.d=t,e}function Hle(e,t){return e.a.g=t,e}function Ule(e,t){return e.a.j=t,e}function Dg(e,t){return e.a.a=t,e}function Og(e,t){return e.a.d=t,e}function kg(e,t){return e.a.e=t,e}function Ag(e,t){return e.a.g=t,e}function jg(e,t){return e.a.f=t,e}function Wle(e){return e.b=!1,e}function Mg(){Mg=C,xSt=new fee}function Gle(){Gle=C,vbt=new Fe}function Ng(){Ng=C,uSt=new it}function Pg(){Pg=C,zSt=new Dee}function Kle(){Kle=C,dSt=new uee}function Fg(){Fg=C,fSt=new pbe}function qle(){qle=C,TSt=new _t}function Ig(){Ig=C,DSt=new vt}function Jle(){Jle=C,TCt=new an}function Lg(){Lg=C,RSt=new hh}function Rg(){Rg=C,LCt=new mte}function zg(){zg=C,t$=new Ar}function Bg(){Bg=C,hkt=new po}function Vg(){Vg=C,lFt=new Wg}function Yle(){UIe(),this.c=new gm}function Hg(){Hg=C,fFt=new Spe}function Ug(){Ug=C,u6=new YSe}function Xle(){QY!=0&&(QY=0),$Y=-1}function Wg(){ng.call(this,ddt,0)}function Zle(e,t,n,r){JKe(e,r,t,n)}function Qle(e,t,n,r){f8e(r,e,t,n)}function $le(e,t,n,r){Yot(r,e,t,n)}function eue(e,t,n){KO(e.d,t.f,n)}function Gg(e,t){uL(e.c.b,t.c,t)}function Kg(e,t){uL(e.c.c,t.b,t)}function qg(e,t){return e.a=t.g,e}function Jg(){Jg=C,Dzt=new zne}function tue(){tue=C,Bzt=new Po}function nue(){nue=C,yBt=new ap}function Yg(){Yg=C,V7=new lp}function rue(){rue=C,bBt=new Mse}function Xg(){Xg=C,xBt=new Pse}function Zg(){Zg=C,D7=new Qd}function Qg(){Qg=C,JBt=new Zd}function $g(){$g=C,LBt=new ufe}function e_(){e_=C,u9=new dfe}function t_(){t_=C,tVt=new rre}function n_(){n_=C,rVt=new ire}function r_(){r_=C,G9=new Hre}function i_(){this.q=new r.Date}function iue(e){this.a=P(nD(e),229)}function a_(e){return P(e,45).jd()}function aue(e){return(e.c+e.a)/2}function oue(e){return e.e.a+e.f.a}function sue(e){return e.e.b+e.f.b}function cue(e){return e.b?e.b:e.a}function lue(e,t){return _Ye(e.a,t)}function uue(e,t){return e.a.a.cc(t)}function o_(e){return e.b<e.d.gc()}function due(e,t){return t.split(e)}function s_(e,t){return _F(e,t)>0}function c_(e,t){return _F(e,t)<0}function fue(e,t){return obe(e.a,t)}function pue(e,t){JTe.call(this,e,t)}function l_(e){iCe(),R$e.call(this,e)}function u_(e){iCe(),l_.call(this,e)}function d_(e){Mye(),pfe.call(this,e)}function f_(e,t){abe(e,e.length,t)}function p_(e,t){Ixe(e,e.length,t)}function m_(e,t){return e.a.get(t)}function mue(e,t){return PE(e.e,t)}function h_(e){return yD(e),!1}function hue(){return Jm(),new Gyt}function g_(e){return UC(e.a),e.b}function __(e,t){this.b=e,this.a=t}function v_(e,t){this.d=e,this.e=t}function y_(e,t){this.a=e,this.b=t}function b_(e,t){this.a=e,this.b=t}function x_(e,t){this.a=e,this.b=t}function S_(e,t){this.a=e,this.b=t}function gue(e,t){this.b=e,this.a=t}function C_(e,t){this.a=e,this.b=t}function w_(e,t){ng.call(this,e,t)}function T_(e,t){ng.call(this,e,t)}function E_(e,t){ng.call(this,e,t)}function D_(e,t){ng.call(this,e,t)}function O_(e,t){ng.call(this,e,t)}function k_(e,t){ng.call(this,e,t)}function A_(e){sk.call(this,e,21)}function j_(e,t){this.b=e,this.a=t}function M_(e,t){this.b=e,this.a=t}function N_(e,t){this.b=e,this.a=t}function P_(e,t){ng.call(this,e,t)}function F_(e,t){ng.call(this,e,t)}function I_(e,t){ng.call(this,e,t)}function L_(e,t){this.b=e,this.a=t}function R_(e,t){this.c=e,this.d=t}function z_(e,t){ng.call(this,e,t)}function B_(e,t){ng.call(this,e,t)}function _ue(e,t){this.e=e,this.d=t}function V_(e,t){ng.call(this,e,t)}function H_(e,t){this.a=e,this.b=t}function U_(e,t){ng.call(this,e,t)}function W_(e,t){ng.call(this,e,t)}function G_(e,t){ng.call(this,e,t)}function K_(e,t,n){e.splice(t,0,n)}function vue(e,t,n){e.Mb(n)&&t.Ad(n)}function q_(e,t,n){t.Ne(e.a.We(n))}function yue(e,t,n){t.Bd(e.a.Xe(n))}function bue(e,t,n){t.Ad(e.a.Kb(n))}function J_(e,t){return hC(e.c,t)}function xue(e,t){return hC(e.e,t)}function Sue(e,t){this.a=e,this.b=t}function Cue(e,t){this.a=e,this.b=t}function Y_(e,t){this.a=e,this.b=t}function X_(e,t){this.a=e,this.b=t}function Z_(e,t){this.a=e,this.b=t}function wue(e,t){this.a=e,this.b=t}function Tue(e,t){this.a=e,this.b=t}function Eue(e,t){this.a=e,this.b=t}function Q_(e,t){this.b=e,this.a=t}function Due(e,t){this.b=e,this.a=t}function $_(e,t){this.b=e,this.a=t}function ev(e,t){this.b=t,this.c=e}function tv(e,t){ng.call(this,e,t)}function nv(e,t){ng.call(this,e,t)}function rv(e,t){ng.call(this,e,t)}function iv(e,t){ng.call(this,e,t)}function av(e,t){ng.call(this,e,t)}function ov(e,t){ng.call(this,e,t)}function sv(e,t){ng.call(this,e,t)}function cv(e,t){ng.call(this,e,t)}function lv(e,t){ng.call(this,e,t)}function uv(e,t){ng.call(this,e,t)}function dv(e,t){ng.call(this,e,t)}function fv(e,t){ng.call(this,e,t)}function pv(e,t){ng.call(this,e,t)}function mv(e,t){ng.call(this,e,t)}function hv(e,t){ng.call(this,e,t)}function gv(e,t){ng.call(this,e,t)}function _v(e,t){ng.call(this,e,t)}function vv(e,t){ng.call(this,e,t)}function yv(e,t){ng.call(this,e,t)}function bv(e,t){ng.call(this,e,t)}function xv(e,t){ng.call(this,e,t)}function Sv(e,t){ng.call(this,e,t)}function Cv(e,t){ng.call(this,e,t)}function wv(e,t){ng.call(this,e,t)}function Tv(e,t){ng.call(this,e,t)}function Ev(e,t){ng.call(this,e,t)}function Dv(e,t){ng.call(this,e,t)}function Ov(e,t){ng.call(this,e,t)}function kv(e,t){ng.call(this,e,t)}function Av(e,t){ng.call(this,e,t)}function jv(e,t){ng.call(this,e,t)}function Mv(e,t){ng.call(this,e,t)}function Nv(e,t){ng.call(this,e,t)}function Pv(e,t){ng.call(this,e,t)}function Fv(e,t){ng.call(this,e,t)}function Iv(e,t){this.b=e,this.a=t}function Lv(e,t){ng.call(this,e,t)}function Rv(e,t){this.a=e,this.b=t}function zv(e,t){this.a=e,this.b=t}function Bv(e,t){this.a=e,this.b=t}function Vv(e,t){ng.call(this,e,t)}function Hv(e,t){ng.call(this,e,t)}function Uv(e,t){this.a=e,this.b=t}function Wv(e,t){return pT(),t!=e}function Gv(e){return w4e(e,e.c),e}function Kv(e){r.clearTimeout(e)}function qv(e,t){ng.call(this,e,t)}function Jv(e,t){ng.call(this,e,t)}function Yv(e,t){this.a=e,this.b=t}function Oue(e,t){this.a=e,this.b=t}function kue(e,t){this.b=e,this.d=t}function Xv(e,t){this.a=e,this.b=t}function Zv(e,t){this.b=e,this.a=t}function Qv(e,t){ng.call(this,e,t)}function $v(e,t){ng.call(this,e,t)}function ey(e,t){ng.call(this,e,t)}function ty(e,t){ng.call(this,e,t)}function ny(e,t){ng.call(this,e,t)}function ry(e,t){this.b=e,this.a=t}function Aue(e,t){this.b=e,this.a=t}function iy(e,t){this.b=e,this.a=t}function jue(e,t){this.b=e,this.a=t}function ay(e,t){ng.call(this,e,t)}function oy(e,t){ng.call(this,e,t)}function sy(e,t){ng.call(this,e,t)}function cy(e,t){ng.call(this,e,t)}function ly(e,t){ng.call(this,e,t)}function uy(e,t){ng.call(this,e,t)}function dy(e,t){ng.call(this,e,t)}function fy(e,t){ng.call(this,e,t)}function py(e,t){ng.call(this,e,t)}function my(e,t){ng.call(this,e,t)}function hy(e,t){ng.call(this,e,t)}function gy(e,t){ng.call(this,e,t)}function _y(e,t){ng.call(this,e,t)}function vy(e,t){ng.call(this,e,t)}function yy(e,t){ng.call(this,e,t)}function by(e,t){ng.call(this,e,t)}function xy(e,t){ng.call(this,e,t)}function Sy(e,t){this.a=e,this.b=t}function Mue(e,t){this.a=e,this.b=t}function Nue(e,t){this.a=e,this.b=t}function Pue(){dT(),this.a=new yme}function Fue(){SB(),this.a=new jf}function Iue(){ek(),this.b=new jf}function Lue(){vEe(),gbe.call(this)}function Rue(){mEe(),zwe.call(this)}function zue(){mEe(),zwe.call(this)}function Cy(e,t){ng.call(this,e,t)}function wy(e,t){ng.call(this,e,t)}function Ty(e,t){ng.call(this,e,t)}function Ey(e,t){ng.call(this,e,t)}function Dy(e,t){ng.call(this,e,t)}function Oy(e,t){ng.call(this,e,t)}function ky(e,t){ng.call(this,e,t)}function Ay(e,t){ng.call(this,e,t)}function jy(e,t){ng.call(this,e,t)}function My(e,t){ng.call(this,e,t)}function Ny(e,t){ng.call(this,e,t)}function Py(e,t){ng.call(this,e,t)}function Fy(e,t){ng.call(this,e,t)}function Iy(e,t){ng.call(this,e,t)}function Ly(e,t){ng.call(this,e,t)}function Ry(e,t){ng.call(this,e,t)}function zy(e,t){ng.call(this,e,t)}function By(e,t){ng.call(this,e,t)}function Vy(e,t){ng.call(this,e,t)}function Hy(e,t){ng.call(this,e,t)}function Uy(e,t){ng.call(this,e,t)}function Wy(e,t){ng.call(this,e,t)}function k(e,t){this.a=e,this.b=t}function Bue(e,t){this.a=e,this.b=t}function Vue(e,t){this.a=e,this.b=t}function Hue(e,t){this.a=e,this.b=t}function Uue(e,t){this.a=e,this.b=t}function Wue(e,t){this.a=e,this.b=t}function Gue(e,t){this.a=e,this.b=t}function Gy(e,t){this.a=e,this.b=t}function Ky(e,t){this.a=e,this.b=t}function Kue(e,t){this.a=e,this.b=t}function qy(e,t){this.a=e,this.b=t}function Jy(e,t){this.a=e,this.b=t}function que(e,t){this.a=e,this.b=t}function Jue(e,t){this.a=e,this.b=t}function Yue(e,t){this.b=e,this.a=t}function Xue(e,t){this.b=e,this.a=t}function Yy(e,t){this.b=e,this.a=t}function Zue(e,t){this.b=e,this.a=t}function Xy(e,t){this.a=e,this.b=t}function Zy(e,t){this.a=e,this.b=t}function Qy(e,t){this.a=e,this.b=t}function $y(e,t){this.a=e,this.b=t}function eb(e,t){this.f=e,this.c=t}function tb(e,t){this.i=e,this.g=t}function nb(e,t){ng.call(this,e,t)}function rb(e,t){ng.call(this,e,t)}function ib(e,t){this.a=e,this.b=t}function Que(e,t){this.a=e,this.b=t}function ab(e,t){this.d=e,this.e=t}function $ue(e,t){this.a=e,this.b=t}function ob(e,t){this.a=e,this.b=t}function sb(e,t){this.d=e,this.b=t}function ede(e,t){this.e=e,this.a=t}function tde(e,t){e.i=null,nN(e,t)}function cb(e,t){e&&kD(C7,e,t)}function lb(e,t){return EWe(e.a,t)}function ub(e,t){return hC(e.g,t)}function nde(e,t){return hC(t.b,e)}function db(e,t){return-e.b.$e(t)}function fb(e){return LI(e.c,e.b)}function pb(e,t){GPe(new zS(e),t)}function rde(e,t,n){zXe(t,dz(e,n))}function ide(e,t,n){zXe(t,dz(e,n))}function ade(e,t){fPe(e.a,P(t,12))}function ode(e,t){this.a=e,this.b=t}function mb(e,t){this.b=e,this.c=t}function hb(e,t){return e.Pd().Xb(t)}function gb(e,t){return mRe(e.Jc(),t)}function _b(e){return e?e.kd():null}function A(e){return e??null}function vb(e){return typeof e===EH}function yb(e){return typeof e===slt}function bb(e){return typeof e===DH}function xb(e,t){return _F(e,t)==0}function Sb(e,t){return _F(e,t)>=0}function Cb(e,t){return _F(e,t)!=0}function sde(e,t){return e.a+=``+t,e}function wb(e){return``+(yD(e),e)}function Tb(e){return kI(e),e.d.gc()}function Eb(e){return dk(e,0),null}function Db(e){return NT(e==null),e}function Ob(e,t){return e.a+=``+t,e}function kb(e,t){return e.a+=``+t,e}function Ab(e,t){return e.a+=``+t,e}function jb(e,t){return e.a+=``+t,e}function Mb(e,t){return e.a+=``+t,e}function Nb(e,t){e.q.setTime(jk(t))}function cde(e,t){Qbe.call(this,e,t)}function Pb(e,t){Qbe.call(this,e,t)}function Fb(e,t){Qbe.call(this,e,t)}function Ib(e,t){oA(e,t,e.c.b,e.c)}function Lb(e,t){oA(e,t,e.a,e.a.a)}function Rb(e,t){return e.j[t.p]==2}function zb(e,t){return e.a=t.g+1,e}function Bb(e){return e.a=0,e.b=0,e}function Vb(e){SE(this),wN(this,e)}function lde(){this.b=0,this.a=!1}function ude(){this.b=0,this.a=!1}function Hb(){this.b=new _g(RN(12))}function Ub(){Ub=C,$bt=cF(uKe())}function Wb(){Wb=C,wCt=cF(P8e())}function Gb(){Gb=C,Ejt=cF(LRe())}function dde(){dde=C,use(),oyt=new Qd}function fde(e){return nD(e),new px(e)}function pde(e,t){return A(e)===A(t)}function Kb(e){return e<10?`0`+e:``+e}function mde(e){return eS(e.l,e.m,e.h)}function qb(e){return typeof e===slt}function Jb(e,t){return bO(e.a,0,t)}function Yb(e){return AO((yD(e),e))}function hde(e){return AO((yD(e),e))}function Xb(e,t){return BF(e.a,t.a)}function Zb(e,t){return Qx(e.a,t.a)}function gde(e,t){return jxe(e.a,t.a)}function Qb(e,t){return e.indexOf(t)}function $b(e,t){uj(e,0,e.length,t)}function ex(e,t){Zg(),kD(D7,e,t)}function tx(e,t){Aw.call(this,e,t)}function nx(e,t){Qw.call(this,e,t)}function rx(e,t){tb.call(this,e,t)}function _de(e,t){DC.call(this,e,t)}function ix(e,t){YN.call(this,e,t)}function ax(){nu.call(this,new aA)}function ox(){QT.call(this,0,0,0,0)}function sx(e){return xj(e.b.b,e,0)}function vde(e,t){return Qx(e.g,t.g)}function yde(e){return e==FZ||e==RZ}function bde(e){return e==FZ||e==IZ}function xde(e,t){return Qx(e.g,t.g)}function cx(e,t){return fT(),t.a+=e}function Sde(e,t){return fT(),t.a+=e}function Cde(e,t){return fT(),t.c+=e}function wde(e,t){return M(e.c,t),e}function lx(e,t){return M(e.a,t),t}function ux(e,t){return NN(e.a,t),e}function dx(e){this.a=hue(),this.b=e}function Tde(e){this.a=hue(),this.b=e}function fx(e){this.a=e.a,this.b=e.b}function px(e){this.a=e,Qs.call(this)}function mx(e){this.a=e,Qs.call(this)}function hx(e){return e.sh()&&e.th()}function gx(e){return e!=i5&&e!=a5}function _x(e){return e==y8||e==b8}function vx(e){return e==S8||e==v8}function yx(e){return e==r4||e==n4}function bx(e){return NN(new xD,e)}function Ede(e){return FD(P(e,125))}function xx(e,t){return BF(t.f,e.f)}function Sx(e,t){return new YN(t,e)}function Dde(e,t){return new YN(t,e)}function Cx(e,t,n){wM(e,t),TM(e,n)}function wx(e,t,n){yM(e,t),bM(e,n)}function Tx(e,t,n){CM(e,t),vM(e,n)}function Ex(e,t,n){xM(e,t),SM(e,n)}function Dx(e,t,n){EM(e,t),DM(e,n)}function Ox(e,t){iF(e,t),jM(e,e.D)}function kx(e){eb.call(this,e,!0)}function Ax(){KD.call(this,0,0,0,0)}function jx(){w_.call(this,`Head`,1)}function Ode(){w_.call(this,`Tail`,3)}function kde(e,t,n){Dw.call(this,e,t,n)}function Mx(e){QT.call(this,e,e,e,e)}function Nx(e){qB(),CRe.call(this,e)}function Ade(e){oM(e.Qf(),new _u(e))}function Px(e){return e==null?0:xN(e)}function jde(e,t){return rM(t,BO(e))}function Mde(e,t){return rM(t,BO(e))}function Nde(e,t){return e[e.length]=t}function Pde(e,t){return e[e.length]=t}function Fde(e,t){return YM(aSe(e.f),t)}function Ide(e,t){return YM(aSe(e.n),t)}function Fx(e,t){return YM(aSe(e.p),t)}function Ix(e){return pve(e.b.Jc(),e.a)}function Lx(e){return e==null?0:xN(e)}function Rx(e){e.c=V(RY,PH,1,0,5,1)}function Lde(e,t,n){iD(e.c[t.g],t.g,n)}function zx(e,t,n){P(e.c,72).Ei(t,n)}function Rde(e,t,n){Cx(n,n.i+e,n.j+t)}function Bx(e,t){Aw.call(this,e.b,t)}function zde(e,t){XA(Zk(e.a),BEe(t))}function Bde(e,t){XA(Ej(e.a),VEe(t))}function Vde(e,t){LX||(e.b=t)}function Vx(e,t,n){return iD(e,t,n),n}function Hx(){Hx=C,new Hde,new Zd}function Hde(){new Qd,new Qd,new Qd}function Ude(){throw E(new nm(Ivt))}function Ux(){throw E(new nm(Ivt))}function Wde(){throw E(new nm(Lvt))}function Gde(){throw E(new nm(Lvt))}function Kde(){Kde=C,J4=new DI(vRt)}function Wx(){Wx=C,r.Math.log(2)}function Gx(){Gx=C,f9=(tue(),Bzt)}function Kx(e){bH(),Yd.call(this,e)}function qde(e){this.a=e,uve.call(this,e)}function qx(e){this.a=e,tg.call(this,e)}function Jx(e){this.a=e,tg.call(this,e)}function Yx(e,t){ibe(e.c,e.c.length,t)}function Xx(e){return e.a<e.c.c.length}function Zx(e){return e.a<e.c.a.length}function Jde(e,t){return e.a?e.b:t.Ue()}function Qx(e,t){return e<t?-1:+(e>t)}function $x(e,t){return _F(e,t)>0?e:t}function eS(e,t,n){return{l:e,m:t,h:n}}function Yde(e,t){e.a!=null&&ade(t,e.a)}function Xde(e){JO(e,null),XO(e,null)}function Zde(e,t,n){return kD(e.g,n,t)}function Qde(e,t){nD(t),ID(e).Ic(new h)}function tS(){cXe(),this.a=new _B(cSt)}function nS(e){this.b=e,this.a=new Zd}function $de(e){this.b=new cee,this.a=e}function rS(e){xme.call(this),this.a=e}function efe(e){Vwe.call(this),this.b=e}function tfe(){w_.call(this,`Range`,2)}function iS(e){e.j=V(Tyt,X,324,0,0,1)}function aS(e){e.a=new me,e.c=new me}function nfe(e){e.a=new Qd,e.e=new Qd}function oS(e){return new k(e.c,e.d)}function rfe(e){return new k(e.c,e.d)}function sS(e){return new k(e.a,e.b)}function ife(e,t){return kD(e.a,t.a,t)}function afe(e,t,n){return kD(e.k,n,t)}function cS(e,t,n){return WWe(t,n,e.c)}function lS(e,t){return N(sD(e.i,t))}function uS(e,t){return N(sD(e.j,t))}function dS(e,t){return Qat(e.a,t,null)}function fS(e,t){return zit(e.c,e.b,t)}function j(e,t){return e!=null&&YKe(e,t)}function ofe(e,t){BV(e),e.Fc(P(t,16))}function pS(e,t,n){e.c._c(t,P(n,136))}function mS(e,t,n){e.c.Si(t,P(n,136))}function sfe(e,t,n){return Jat(e,t,n),n}function cfe(e,t){return $O(),t.n.b+=e}function hS(e,t){return Pze(e.Jc(),t)!=-1}function lfe(e,t){return new Yfe(e.Jc(),t)}function gS(e){return e.Ob()?e.Pb():null}function _S(e){return $I(e,0,e.length)}function vS(e){kEe(e,null),AEe(e,null)}function ufe(){DC.call(this,null,null)}function dfe(){OC.call(this,null,null)}function ffe(){ng.call(this,`INSTANCE`,0)}function yS(){this.a=V(RY,PH,1,8,5,1)}function bS(e){this.a=e,Qd.call(this)}function pfe(e){this.a=(QD(),new km(e))}function mfe(e){this.b=(QD(),new iu(e))}function xS(){xS=C,Xyt=new Np(null)}function SS(){SS=C,SS(),tbt=new _e}function M(e,t){return ff(e.c,t),!0}function hfe(e,t){e.c&&(tye(t),ETe(t))}function gfe(e,t){e.q.setHours(t),SV(e,t)}function CS(e,t){return e.a.Ac(t)!=null}function wS(e,t){return e.a.Ac(t)!=null}function TS(e,t){return e.a[t.c.p][t.p]}function _fe(e,t){return e.e[t.c.p][t.p]}function vfe(e,t){return e.c[t.c.p][t.p]}function ES(e,t,n){return e.a[t.g][n.g]}function yfe(e,t){return e.j[t.p]=k6e(t)}function DS(e,t){return e.a*t.a+e.b*t.b}function bfe(e,t){return e.a<Che(t)?-1:1}function xfe(e,t){return Lje(e.b,t.Og())}function Sfe(e,t){return Lje(e.f,t.Og())}function Cfe(e,t){return D(N(t.a))<=e}function wfe(e,t){return D(N(t.a))>=e}function Tfe(e,t,n){return n?t!=0:t!=e-1}function OS(e,t,n){e.a=t^1502,e.b=n^xW}function Efe(e,t,n){return e.a=t,e.b=n,e}function kS(e,t){return e.a*=t,e.b*=t,e}function AS(e,t,n){return iD(e.g,t,n),n}function jS(e,t,n,r){iD(e.a[t.g],n.g,r)}function MS(e,t,n){ET.call(this,e,t,n)}function NS(e,t,n){MS.call(this,e,t,n)}function PS(e,t,n){MS.call(this,e,t,n)}function Dfe(e,t,n){NS.call(this,e,t,n)}function FS(e,t,n){ET.call(this,e,t,n)}function IS(e,t,n){ET.call(this,e,t,n)}function Ofe(e,t,n){DT.call(this,e,t,n)}function LS(e,t,n){DT.call(this,e,t,n)}function kfe(e,t,n){LS.call(this,e,t,n)}function Afe(e,t,n){FS.call(this,e,t,n)}function RS(e){this.c=e,this.a=this.c.a}function zS(e){this.i=e,this.f=this.i.j}function BS(e,t){this.a=e,tg.call(this,t)}function jfe(e,t){this.a=e,hm.call(this,t)}function Mfe(e,t){this.a=e,hm.call(this,t)}function Nfe(e,t){this.a=e,hm.call(this,t)}function VS(e){this.a=e,fie.call(this,e.d)}function HS(e){e.b.Qb(),--e.d.f.d,aE(e.d)}function Pfe(e){e.a=P(BN(e.b.a,4),129)}function Ffe(e){e.a=P(BN(e.b.a,4),129)}function Ife(e){gO(e,Vgt),oB(e,mst(e))}function US(e,t){return pUe(e,new wm,t).a}function Lfe(e){return Rh(e.a)?zEe(e):null}function Rfe(e){Xc.call(this,P(nD(e),35))}function zfe(e){Xc.call(this,P(nD(e),35))}function WS(e){if(!e)throw E(new yf)}function GS(e){if(!e)throw E(new bf)}function KS(e,t){return nD(t),new Jfe(e,t)}function Bfe(e,t){return new U1e(e.a,e.b,t)}function Vfe(e){return e.l+e.m*ZU+e.h*QU}function Hfe(e){return e==null?null:e.name}function qS(e,t,n){return e.indexOf(t,n)}function JS(e,t){return e.lastIndexOf(t)}function YS(e){return e==null?FH:OI(e)}function XS(){XS=C,iX=!1,aX=!0}function Ufe(){Ufe=C,t_(),nVt=new Mc}function ZS(){this.Bb|=256,this.Bb|=512}function Wfe(){iS(this),nO(this),this.he()}function QS(e){Yl.call(this,e),this.a=e}function $S(e){Xl.call(this,e),this.a=e}function eC(e){km.call(this,e),this.a=e}function tC(e){Bl.call(this,(yD(e),e))}function nC(e){Bl.call(this,(yD(e),e))}function rC(e){nu.call(this,new ZMe(e))}function Gfe(e){this.a=e,Jl.call(this,e)}function iC(e,t){this.a=t,hm.call(this,e)}function Kfe(e,t){this.a=t,mAe.call(this,e)}function qfe(e,t){this.a=e,mAe.call(this,t)}function Jfe(e,t){this.a=t,eg.call(this,e)}function Yfe(e,t){this.a=t,eg.call(this,e)}function aC(e){Lf.call(this),vN(this,e)}function oC(e){return UC(e.a!=null),e.a}function sC(e,t){return M(t.a,e.a),e.a}function cC(e,t){return M(t.b,e.a),e.a}function lC(e,t){return M(t.a,e.a),e.a}function uC(e,t,n){return wRe(e,t,t,n),e}function dC(e,t){return++e.b,M(e.a,t)}function fC(e,t){return++e.b,bj(e.a,t)}function pC(e,t){return BF(e.c.d,t.c.d)}function Xfe(e,t){return BF(e.c.c,t.c.c)}function Zfe(e,t){return BF(e.n.a,t.n.a)}function mC(e,t){return P(wA(e.b,t),16)}function Qfe(e,t){return e.n.b=(yD(t),t)}function $fe(e,t){return e.n.b=(yD(t),t)}function hC(e,t){return!!t&&e.b[t.g]==t}function gC(e){return Xx(e.a)||Xx(e.b)}function epe(e,t){return BF(e.e.b,t.e.b)}function tpe(e,t){return BF(e.e.a,t.e.a)}function npe(e,t,n){return Fke(e,t,n,e.b)}function _C(e,t,n){return Fke(e,t,n,e.c)}function rpe(e){return fT(),!!e&&!e.dc()}function vC(){Rg(),this.b=new Dae(this)}function yC(){yC=C,nZ=new Aw(yut,0)}function bC(e){this.d=e,zS.call(this,e)}function xC(e){this.c=e,zS.call(this,e)}function SC(e){this.c=e,bC.call(this,e)}function CC(e,t){FGe.call(this,e,t,null)}function wC(e){return e.a==null?null:e.a}function TC(e){return e.$H||=++hbt}function EC(e){var t=e.a;e.a=e.b,e.b=t}function DC(e,t){$g(),this.a=e,this.b=t}function OC(e,t){e_(),this.b=e,this.c=t}function kC(e,t){dbe(),this.f=t,this.d=e}function AC(e,t){Pje(t,e),this.c=e,this.b=t}function jC(e,t){return Fbe(e.c).Kd().Xb(t)}function MC(e,t){return new Zme(e,e.gc(),t)}function NC(e){return Wp(),IM((SEe(),Zvt),e)}function ipe(e){return++W9,new nA(3,e)}function PC(e){return KM(e,fU),new VA(e)}function FC(e){return MO(),parseInt(e)||-1}function IC(e,t,n){return qS(e,IR(t),n)}function LC(e,t,n){P(Cj(e,t),22).Ec(n)}function ape(e,t,n){XF(e.a,n),IL(e.a,t)}function RC(e,t,n){e.dd(t).Rb(n)}function ope(e,t,n,r){zbe.call(this,e,t,n,r)}function spe(e){Cve.call(this,e,null,null)}function zC(e){bg(),this.b=e,this.a=!0}function BC(e){Cg(),this.b=e,this.a=!0}function VC(e){if(!e)throw E(new vf)}function HC(e){if(!e)throw E(new yf)}function cpe(e){if(!e)throw E(new gf)}function UC(e){if(!e)throw E(new Cf)}function WC(e){if(!e)throw E(new bf)}function lpe(e){e.d=new spe(e),e.e=new Qd}function GC(e){return UC(e.b!=0),e.a.a.c}function KC(e){return UC(e.b!=0),e.c.b.c}function qC(e,t){return wRe(e,t,t+1,``),e}function JC(e){fH(),nse(this),this.Df(e)}function YC(e){this.c=e,this.a=1,this.b=1}function XC(e){j(e,161)&&P(e,161).mi()}function upe(e){return e.b=P(twe(e.a),45)}function ZC(e,t){return P(Rj(e.a,t),35)}function QC(e,t){return!!e.q&&PE(e.q,t)}function dpe(e,t){return e>0?t/(e*e):t*100}function fpe(e,t){return e>0?t*t/e:t*t*100}function $C(e){return e.f==null?``+e.g:e.f}function ew(e){return e.f==null?``+e.g:e.f}function ppe(e){return fM(),e.e.a+e.f.a/2}function tw(e){return fM(),e.e.b+e.f.b/2}function mpe(e,t,n){return fM(),n.e.b-e*t}function hpe(e,t,n){return fM(),n.e.a-e*t}function gpe(e,t,n){return Bg(),n.Lg(e,t)}function _pe(e,t){return GR(),kz(e,t.e,t)}function vpe(e,t,n){return M(t,cWe(e,n))}function ype(e,t,n){mj(),e.nf(t)&&n.Ad(e)}function nw(e,t,n){return e.a+=t,e.b+=n,e}function rw(e,t,n){return e.a-=t,e.b-=n,e}function iw(e,t){return e.a=t.a,e.b=t.b,e}function aw(e){return e.a=-e.a,e.b=-e.b,e}function bpe(e){this.c=e,wM(e,0),TM(e,0)}function xpe(e){gg.call(this),HM(this,e)}function Spe(){ng.call(this,`GROW_TREE`,0)}function ow(e,t,n){ij.call(this,e,t,n,2)}function Cpe(e,t){e_(),sw.call(this,e,t)}function sw(e,t){e_(),OC.call(this,e,t)}function wpe(e,t){e_(),OC.call(this,e,t)}function Tpe(e,t){$g(),DC.call(this,e,t)}function cw(e,t){Gx(),YT.call(this,e,t)}function Epe(e,t){Gx(),cw.call(this,e,t)}function lw(e,t){Gx(),cw.call(this,e,t)}function Dpe(e,t){Gx(),lw.call(this,e,t)}function uw(e,t){Gx(),YT.call(this,e,t)}function Ope(e,t){Gx(),uw.call(this,e,t)}function kpe(e,t){Gx(),YT.call(this,e,t)}function dw(e,t){return e.c.Ec(P(t,136))}function Ape(e,t){return P(sD(e.e,t),26)}function jpe(e,t){return P(sD(e.e,t),26)}function fw(e,t,n){return IV(Oj(e,t),n)}function Mpe(e,t,n){return t.xl(e.e,e.c,n)}function Npe(e,t,n){return t.yl(e.e,e.c,n)}function pw(e,t){return bF(e.e,P(t,52))}function Ppe(e,t,n){LF(Zk(e.a),t,BEe(n))}function Fpe(e,t,n){LF(Ej(e.a),t,VEe(n))}function Ipe(e,t){return(yD(e),e)+Che(t)}function Lpe(e){return e==null?null:OI(e)}function Rpe(e){return e==null?null:OI(e)}function zpe(e){return e==null?null:X$e(e)}function Bpe(e){return e==null?null:tst(e)}function mw(e){e.o??I3e(e)}function hw(e){return NT(e==null||vb(e)),e}function N(e){return NT(e==null||yb(e)),e}function gw(e){return NT(e==null||bb(e)),e}function Vpe(e,t){return kqe(e,t),new sCe(e,t)}function _w(e,t){this.c=e,Jh.call(this,e,t)}function vw(e,t){this.a=e,_w.call(this,e,t)}function Hpe(e,t){this.d=e,qie(this),this.b=t}function yw(){FIe.call(this),this.Bb|=sW}function Upe(){this.a=new CO,this.b=new CO}function bw(e){this.q=new r.Date(jk(e))}function xw(){xw=C,N3=new Rd(`root`)}function Sw(){Sw=C,E7=new jse,new rp}function Cw(){Cw=C,ext=vI((YI(),z5))}function Wpe(e,t){t.a?M4e(e,t):wS(e.a,t.b)}function Gpe(e,t){LX||M(e.a,t)}function Kpe(e,t){return Lg(),IN(t.d.i,e)}function qpe(e,t){return bN(),new N9e(t,e)}function Jpe(e,t,n){return e.Le(t,n)<=0?n:t}function Ype(e,t,n){return e.Le(t,n)<=0?t:n}function Xpe(e,t){return P(Rj(e.b,t),144)}function Zpe(e,t){return P(Rj(e.c,t),233)}function ww(e){return P(qT(e.a,e.b),295)}function Qpe(e){return new k(e.c,e.d+e.a)}function $pe(e){return yD(e),e?1231:1237}function eme(e){return $O(),yx(P(e,203))}function Tw(e,t){return P(sD(e.b,t),278)}function tme(e,t,n){++e.j,e.oj(t,e.Xi(t,n))}function Ew(e,t,n){++e.j,e.rj(),zMe(e,t,n)}function Dw(e,t,n){BA.call(this,e,t,n,null)}function nme(e,t,n){BA.call(this,e,t,n,null)}function Ow(e,t){YMe.call(this,e),this.a=t}function kw(e,t){YMe.call(this,e),this.a=t}function Aw(e,t){Rd.call(this,e),this.a=t}function jw(e,t){Ud.call(this,e),this.a=t}function Mw(e,t){Ud.call(this,e),this.a=t}function rme(e,t){this.c=e,aM.call(this,t)}function ime(e,t){this.a=e,Voe.call(this,t)}function Nw(e,t){this.a=e,Voe.call(this,t)}function Pw(e,t,n){return n=lV(e,t,3,n),n}function Fw(e,t,n){return n=lV(e,t,6,n),n}function Iw(e,t,n){return n=lV(e,t,9,n),n}function Lw(e,t){return gO(t,hut),e.f=t,e}function Rw(e,t){return(t&kH)%e.d.length}function ame(e,t,n){return irt(e.c,e.b,t,n)}function ome(e,t,n){return e.apply(t,n)}function sme(e,t,n){e.dd(t).Rb(n)}function cme(e,t,n){return e.a+=$I(t,0,n),e}function zw(e){return!e.a&&(e.a=new te),e.a}function Bw(e,t){var n=e.e;return e.e=t,n}function Vw(e,t){var n=t;return!!e.De(n)}function Hw(e,t){return XS(),e==t?0:e?1:-1}function Uw(e,t){e.a._c(e.b,t),++e.b,e.c=-1}function lme(e,t){e[vW].call(e,t)}function ume(e,t){e[vW].call(e,t)}function dme(e,t,n){Sg(),ul(e,t.Te(e.a,n))}function fme(e,t,n){return BE(e,P(t,23),n)}function Ww(e,t){return Pm(Array(t),e)}function pme(e){return tE(vE(e,32))^tE(e)}function Gw(e){return String.fromCharCode(e)}function mme(e){return e==null?null:e.message}function Kw(e){this.a=(QD(),new Wl(nD(e)))}function hme(e){this.a=(KM(e,fU),new VA(e))}function gme(e){this.a=(KM(e,fU),new VA(e))}function _me(){this.a=new Zd,this.b=new Zd}function vme(){this.a=new Qe,this.b=new lse}function yme(){this.b=new aA,this.a=new aA}function bme(){this.b=new hh,this.c=new Zd}function xme(){this.n=new hh,this.o=new hh}function qw(){this.n=new Yf,this.i=new Ax}function Sme(){this.b=new jf,this.a=new jf}function Cme(){this.a=new Zd,this.d=new Zd}function wme(){this.a=new pc,this.b=new Dte}function Tme(){this.b=new Jce,this.a=new bi}function Eme(){this.b=new Qd,this.a=new Qd}function Dme(){qw.call(this),this.a=new hh}function Ome(e,t,n,r){QT.call(this,e,t,n,r)}function kme(e,t){return e.n.a=(yD(t),t)+10}function Ame(e,t){return e.n.a=(yD(t),t)+10}function jme(e,t){return Lg(),!IN(t.d.i,e)}function Mme(e){SE(e.e),e.d.b=e.d,e.d.a=e.d}function Jw(e){e.b?Jw(e.b):e.f.c.yc(e.e,e.d)}function Nme(e,t){_x(e.f)?E3e(e,t):hQe(e,t)}function Pme(e,t,n){n!=null&&$M(t,iJe(e,n))}function Fme(e,t,n){n!=null&&eN(t,iJe(e,n))}function Yw(e,t,n,r){F.call(this,e,t,n,r)}function Ime(e,t,n,r){F.call(this,e,t,n,r)}function Lme(e,t,n,r){Ime.call(this,e,t,n,r)}function Rme(e,t,n,r){kE.call(this,e,t,n,r)}function Xw(e,t,n,r){kE.call(this,e,t,n,r)}function zme(e,t,n,r){Xw.call(this,e,t,n,r)}function Bme(e,t,n,r){kE.call(this,e,t,n,r)}function Zw(e,t,n,r){Bme.call(this,e,t,n,r)}function Vme(e,t,n,r){Xw.call(this,e,t,n,r)}function Hme(e,t,n,r){Vme.call(this,e,t,n,r)}function Ume(e,t,n,r){mxe.call(this,e,t,n,r)}function Qw(e,t){Xp.call(this,OJ+e+mJ+t)}function Wme(e,t){return t==e||uR(rB(t),e)}function Gme(e,t){return e.hk().ti().oi(e,t)}function Kme(e,t){return e.hk().ti().qi(e,t)}function qme(e,t){return e.e=P(e.d.Kb(t),162)}function Jme(e,t){return kD(e.a,t,``)==null}function Yme(e,t){return yD(e),A(e)===A(t)}function $w(e,t){return yD(e),A(e)===A(t)}function Xme(e,t,n){return e.lastIndexOf(t,n)}function Zme(e,t,n){this.a=e,AC.call(this,t,n)}function Qme(e){this.c=e,Fb.call(this,$H,0)}function $me(e,t,n){this.c=t,this.b=n,this.a=e}function eT(e,t){return e.a+=t.a,e.b+=t.b,e}function tT(e,t){return e.a-=t.a,e.b-=t.b,e}function ehe(e){return Tf(e.j.c,0),e.a=-1,e}function the(e,t){return t.ni(e.a)}function nhe(e,t,n){return n=lV(e,t,11,n),n}function rhe(e,t,n){return BF(e[t.a],e[n.a])}function ihe(e,t){return Qx(e.a.d.p,t.a.d.p)}function ahe(e,t){return Qx(t.a.d.p,e.a.d.p)}function ohe(e,t){return BF(e.c-e.s,t.c-t.s)}function she(e,t){return BF(e.b.e.a,t.b.e.a)}function che(e,t){return BF(e.c.e.a,t.c.e.a)}function lhe(e,t){return W(t,(hH(),O0),e)}function uhe(e,t){return e.b.zd(new b_(e,t))}function dhe(e,t){return e.b.zd(new x_(e,t))}function fhe(e,t){return e.b.zd(new S_(e,t))}function phe(e,t){return j(t,16)&&j7e(e.c,t)}function mhe(e){return e.c?xj(e.c.a,e,0):-1}function hhe(e){return e<100?null:new _h(e)}function nT(e){return e==e5||e==n5||e==t5}function ghe(e,t,n){return P(e.c,72).Uk(t,n)}function rT(e,t,n){return P(e.c,72).Vk(t,n)}function _he(e,t,n){return Mpe(e,P(t,344),n)}function vhe(e,t,n){return Npe(e,P(t,344),n)}function yhe(e,t,n){return AZe(e,P(t,344),n)}function bhe(e,t,n){return NQe(e,P(t,344),n)}function iT(e,t){return t==null?null:xF(e.b,t)}function xhe(e,t){LX||t&&(e.d=t)}function She(e,t){if(!e)throw E(new $p(t))}function aT(e){if(!e)throw E(new em(ult))}function Che(e){return yb(e)?(yD(e),e):e.se()}function oT(e){return!isNaN(e)&&!isFinite(e)}function whe(e){aS(this),tO(this),vN(this,e)}function sT(e){Rx(this),Tve(this.c,0,e.Nc())}function cT(e){pT(),this.d=e,this.a=new yS}function The(e,t,n){this.d=e,this.b=n,this.a=t}function lT(e,t,n){this.a=e,this.b=t,this.c=n}function Ehe(e,t,n){this.a=e,this.b=t,this.c=n}function Dhe(e,t){this.c=e,WE.call(this,e,t)}function Ohe(e,t){yve.call(this,e,e.length,t)}function khe(e,t){if(e!=t)throw E(new vf)}function Ahe(e){this.a=e,vg(),zN(Date.now())}function jhe(e){uD(e.a),HMe(e.c,e.b),e.b=null}function Mhe(){Mhe=C,Jyt=new he,Yyt=new ge}function Nhe(e){var t=new Be;return t.e=e,t}function Phe(e,t,n){return Sg(),e.a.Wd(t,n),t}function Fhe(e,t,n){this.b=e,this.c=t,this.a=n}function Ihe(e){var t=new yse;return t.b=e,t}function Lhe(e){return lM(),IM((EMe(),Tbt),e)}function Rhe(e){return fj(),IM((jNe(),rbt),e)}function zhe(e){return QP(),IM((TMe(),pbt),e)}function Bhe(e){return pj(),IM((DMe(),Dbt),e)}function Vhe(e){return Pj(),IM((OMe(),Abt),e)}function Hhe(e){return xH(),IM((Ub(),$bt),e)}function Uhe(e){return QN(),IM((BNe(),nxt),e)}function Whe(e){return vP(),IM((VNe(),hSt),e)}function Ghe(e){return Kj(),IM((LAe(),_xt),e)}function Khe(e){return wj(),IM((wMe(),iSt),e)}function qhe(e){return BR(),IM((tFe(),lSt),e)}function Jhe(e){return aL(),IM((zNe(),wSt),e)}function Yhe(e){return Zz(),IM((NRe(),kSt),e)}function Xhe(e){return oN(),IM((RAe(),VSt),e)}function Zhe(e){QT.call(this,e.d,e.c,e.a,e.b)}function Qhe(e){QT.call(this,e.d,e.c,e.a,e.b)}function $he(e){return yH(),IM((Wb(),wCt),e)}function ege(){ege=C,nBt=V(RY,PH,1,0,5,1)}function tge(){tge=C,jBt=V(RY,PH,1,0,5,1)}function nge(){nge=C,MBt=V(RY,PH,1,0,5,1)}function uT(){uT=C,rQ=new Fee,iQ=new Iee}function dT(){dT=C,ACt=new pn,kCt=new mn}function fT(){fT=C,RCt=new lr,zCt=new ate}function rge(e){return cN(),IM((cMe(),YCt),e)}function ige(e){return rP(),IM((GNe(),HCt),e)}function age(e){return wR(),IM((YPe(),WCt),e)}function oge(e){return IB(),IM((IRe(),ZCt),e)}function sge(e){return uz(),IM((oIe(),QCt),e)}function cge(e){return GA(),IM((bAe(),twt),e)}function lge(e){return CI(),IM((qNe(),awt),e)}function uge(e){return VM(),IM((rMe(),cwt),e)}function dge(e){return Qz(),IM((rze(),dwt),e)}function fge(e){return qj(),IM((xAe(),mwt),e)}function pge(e){return bP(),IM((iMe(),gwt),e)}function mge(e){return YR(),IM((aIe(),vwt),e)}function hge(e){return _j(),IM((SAe(),xwt),e)}function gge(e){return mR(),IM((rIe(),Dwt),e)}function _ge(e){return KR(),IM((iIe(),Pwt),e)}function vge(e){return kB(),IM((Bze(),Fwt),e)}function yge(e){return eP(),IM((aMe(),Iwt),e)}function bge(e){return yP(),IM((oMe(),Rwt),e)}function xge(e){return Fj(),IM((sMe(),Bwt),e)}function Sge(e){return Fk(),IM((CAe(),Uwt),e)}function Cge(e){return SI(),IM((ZPe(),iTt),e)}function wge(e){return uA(),IM((wAe(),oTt),e)}function Tge(e){return pB(),IM((ize(),Skt),e)}function Ege(e){return fF(),IM((lMe(),Tkt),e)}function Dge(e){return OL(),IM((UNe(),Ekt),e)}function Oge(e){return xL(),IM((XPe(),kkt),e)}function kge(e){return YB(),IM((zze(),Fkt),e)}function Age(e){return JI(),IM((WNe(),Rkt),e)}function jge(e){return Tj(),IM((TAe(),Bkt),e)}function Mge(e){return BM(),IM((uMe(),Hkt),e)}function Nge(e){return tP(),IM((dMe(),Kkt),e)}function Pge(e){return ZP(),IM((fMe(),Jkt),e)}function Fge(e){return pF(),IM((pMe(),Zkt),e)}function Ige(e){return zM(),IM((mMe(),tAt),e)}function Lge(e){return nP(),IM((hMe(),rAt),e)}function Rge(e){return _P(),IM((RNe(),OCt),e)}function zge(e){return dF(),IM((HNe(),wAt),e)}function Bge(e,t){return(yD(e),e)+(yD(t),t)}function Vge(e){return lA(),IM((EAe(),jAt),e)}function Hge(e){return NO(),IM((OAe(),BAt),e)}function Uge(e){return PO(),IM((DAe(),HAt),e)}function Wge(e){return UA(),IM((kAe(),ijt),e)}function pT(){pT=C,DAt=(rH(),N5),z4=p5}function Gge(e){return FO(),IM((AAe(),djt),e)}function Kge(e){return QL(),IM((XNe(),pjt),e)}function qge(e){return QB(),IM((Gb(),Ejt),e)}function Jge(e){return YP(),IM((gMe(),kjt),e)}function Yge(e){return JP(),IM((KNe(),wMt),e)}function Xge(e){return Pk(),IM((jAe(),OMt),e)}function Zge(e){return sN(),IM((MAe(),PMt),e)}function Qge(e){return ER(),IM((QPe(),VMt),e)}function $ge(e){return gj(),IM((NAe(),GMt),e)}function e_e(e){return XP(),IM((_Me(),YMt),e)}function t_e(e){return VL(),IM((YNe(),PNt),e)}function n_e(e){return $N(),IM((vMe(),zNt),e)}function r_e(e){return qI(),IM((yMe(),HNt),e)}function i_e(e){return LR(),IM((JNe(),JNt),e)}function a_e(e){return wI(),IM((CMe(),rPt),e)}function o_e(e){return!e.e&&(e.e=new Zd),e.e}function mT(e,t,n){this.e=t,this.b=e,this.d=n}function s_e(e,t,n){this.a=e,this.b=t,this.c=n}function c_e(e,t,n){this.a=e,this.b=t,this.c=n}function l_e(e,t,n){this.a=e,this.b=t,this.c=n}function u_e(e,t,n){this.a=e,this.b=t,this.c=n}function d_e(e,t,n){this.a=e,this.c=t,this.b=n}function hT(e,t,n){this.b=e,this.a=t,this.c=n}function f_e(e,t,n){this.b=e,this.a=t,this.c=n}function p_e(e,t){this.c=e,this.a=t,this.b=t-e}function m_e(e){return VF(),IM((xMe(),rFt),e)}function h_e(e){return Hg(),IM((UOe(),mFt),e)}function g_e(e){return WA(),IM((FAe(),_Ft),e)}function __e(e){return QR(),IM((eFe(),wFt),e)}function v_e(e){return Vg(),IM((HOe(),dFt),e)}function y_e(e){return cB(),IM(($Pe(),oFt),e)}function b_e(e){return HF(),IM((SMe(),cFt),e)}function x_e(e){return _A(),IM((PAe(),qPt),e)}function S_e(e){return vj(),IM((bMe(),QPt),e)}function C_e(e){return Ug(),IM((WOe(),aIt),e)}function w_e(e){return iP(),IM((IAe(),cIt),e)}function T_e(e){return fL(),IM((rFe(),bIt),e)}function E_e(e){return oz(),IM((PRe(),CIt),e)}function D_e(e){return GF(),IM((QNe(),yRt),e)}function O_e(e){return KF(),IM((nFe(),uRt),e)}function k_e(e){return WF(),IM((ZNe(),mRt),e)}function A_e(e){return uM(),IM((kMe(),gRt),e)}function j_e(e){return kL(),IM(($Fe(),OIt),e)}function M_e(e){return xR(),IM((eIe(),WIt),e)}function N_e(e){return Hz(),IM((oze(),zRt),e)}function P_e(e){return pL(),IM((iFe(),HRt),e)}function F_e(e){return TR(),IM((nIe(),WRt),e)}function I_e(e){return Sz(),IM((tIe(),GRt),e)}function L_e(e){return $L(),IM(($Ne(),RRt),e)}function R_e(e){return RR(),IM((QFe(),DRt),e)}function z_e(e){return $P(),IM((jMe(),FRt),e)}function B_e(e){return dA(),IM((ePe(),pzt),e)}function V_e(e){return iV(),IM((aze(),azt),e)}function H_e(e){return UF(),IM((AMe(),czt),e)}function U_e(e){return rH(),IM((aFe(),KRt),e)}function W_e(e){return _M(),IM((MMe(),tzt),e)}function G_e(e){return YI(),IM((tPe(),nzt),e)}function K_e(e){return TI(),IM((nPe(),yzt),e)}function q_e(e){return qP(),IM((rPe(),Ezt),e)}function J_e(e){return Bz(),IM((FRe(),Yzt),e)}function Y_e(e,t,n){Gx(),STe.call(this,e,t,n)}function X_e(e,t,n){Gx(),OSe.call(this,e,t,n)}function Z_e(e,t,n){Gx(),X_e.call(this,e,t,n)}function Q_e(e,t,n){Gx(),X_e.call(this,e,t,n)}function $_e(e,t,n){Gx(),Q_e.call(this,e,t,n)}function eve(e,t,n){Gx(),tve.call(this,e,t,n)}function tve(e,t,n){Gx(),OSe.call(this,e,t,n)}function nve(e,t,n){Gx(),OSe.call(this,e,t,n)}function rve(e,t,n){Gx(),nve.call(this,e,t,n)}function ive(e,t,n){this.a=e,this.c=t,this.b=n}function ave(e,t,n){this.a=e,this.b=t,this.c=n}function ove(e,t,n){this.a=e,this.b=t,this.c=n}function sve(e,t,n){this.a=e,this.b=t,this.c=n}function cve(e,t,n){this.a=e,this.b=t,this.c=n}function lve(e,t,n){this.a=e,this.b=t,this.c=n}function gT(e,t,n){this.e=e,this.a=t,this.c=n}function uve(e){this.d=e,qie(this),this.b=Nbe(e.d)}function dve(e,t){wle.call(this,e,cI(new rm(t)))}function _T(e,t){return nD(e),nD(t),new ule(e,t)}function vT(e,t){return nD(e),nD(t),new Jve(e,t)}function fve(e,t){return nD(e),nD(t),new Yve(e,t)}function pve(e,t){return nD(e),nD(t),new ble(e,t)}function mve(e){return UC(e.b!=0),iM(e,e.a.a)}function hve(e){return UC(e.b!=0),iM(e,e.c.b)}function gve(e){return!e.c&&(e.c=new Zo),e.c}function yT(e){var t=new gg;return ALe(t,e),t}function _ve(e){var t=new Lf;return ALe(t,e),t}function vve(e){var t=new jf;return APe(t,e),t}function bT(e){var t=new Zd;return APe(t,e),t}function P(e,t){return NT(e==null||YKe(e,t)),e}function yve(e,t,n){$be.call(this,t,n),this.a=e}function bve(e,t){this.c=e,this.b=t,this.a=!1}function xve(){this.a=`;,;`,this.b=``,this.c=``}function Sve(e,t,n){this.b=e,cde.call(this,t,n)}function Cve(e,t,n){this.c=e,v_.call(this,t,n)}function wve(e,t,n){R_.call(this,e,t),this.b=n}function Tve(e,t,n){t4e(n,0,e,t,n.length,!1)}function xT(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function Eve(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function Dve(e,t){t&&(e.b=t,e.a=(fD(t),t.a))}function ST(e,t){if(!e)throw E(new $p(t))}function CT(e,t){if(!e)throw E(new em(t))}function Ove(e,t){if(!e)throw E(new nce(t))}function kve(e,t){return zg(),Qx(e.d.p,t.d.p)}function Ave(e,t){return fM(),BF(e.e.b,t.e.b)}function jve(e,t){return fM(),BF(e.e.a,t.e.a)}function Mve(e,t){return Qx(oye(e.d),oye(t.d))}function wT(e,t){return t&&mD(e,t.d)?t:null}function Nve(e,t){return t==(rH(),N5)?e.c:e.d}function Pve(e){return new k(e.c+e.b,e.d+e.a)}function Fve(e){return e!=null&&!FUe(e,O7,k7)}function Ive(e,t){return(MHe(e)<<4|MHe(t))&wU}function Lve(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function Rve(e){var t=e.b;e.b=e.c,e.c=t}function zve(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function Bve(e,t){var n=e.c;return QIe(e,t),n}function Vve(e,t){return t<0?e.g=-1:e.g=t,e}function TT(e,t){return BFe(e),e.a*=t,e.b*=t,e}function ET(e,t,n){ab.call(this,e,t),this.c=n}function DT(e,t,n){ab.call(this,e,t),this.c=n}function Hve(e){nge(),Fo.call(this),this._h(e)}function Uve(){MA(),MSe.call(this,(Yg(),V7))}function Wve(e){return bH(),++W9,new XT(0,e)}function Gve(){Gve=C,iVt=(QD(),new Wl(hY))}function OT(){OT=C,new iqe((xp(),GY),(bp(),WY))}function Kve(){this.b=D(N(hL((fV(),gZ))))}function qve(e){this.b=e,this.a=uE(this.b.a).Md()}function Jve(e,t){this.b=e,this.a=t,Qs.call(this)}function Yve(e,t){this.a=e,this.b=t,Qs.call(this)}function Xve(e,t,n){this.a=e,rx.call(this,t,n)}function Zve(e,t,n){this.a=e,rx.call(this,t,n)}function kT(e,t,n){Xj(e,t,new rD(n))}function Qve(e,t,n){var r=e[t];return e[t]=n,r}function AT(e){return lj(e.slice(),e)}function jT(e){var t=e.n;return e.a.b+t.d+t.a}function $ve(e){var t=e.n;return e.e.b+t.d+t.a}function eye(e){var t=e.n;return e.e.a+t.b+t.c}function tye(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function MT(e,t){return oA(e,t,e.c.b,e.c),!0}function nye(e){return e.a?e.a:VD(e)}function NT(e){if(!e)throw E(new Qp(null))}function PT(e,t){return sR(e,new R_(t.a,t.b))}function rye(e){return!xA(e)&&e.c.i.c==e.d.i.c}function iye(e,t){return e.c<t.c?-1:e.c==t.c?0:1}function aye(e){return e.b.c.length-e.e.c.length}function oye(e){return e.e.c.length-e.g.c.length}function sye(e){return e.e.c.length+e.g.c.length}function FT(e){return e==0||isNaN(e)?e:e<0?-1:1}function cye(e){return dM(),V(i3,$K,40,e,0,1)}function lye(){lye=C,vyt=V(dX,X,15,256,0,1)}function uye(){xT(this,!1,!1,!1,!1)}function dye(e){AC.call(this,e.length,0),this.a=e}function fye(e,t){$be.call(this,t,1040),this.a=e}function pye(e,t,n,r){uGe.call(this,e,t,n,r,0,0)}function mye(e){nge(),Hve.call(this,e),this.a=-1}function hye(e){return $O(),(rH(),v5).Gc(e.j)}function gye(e,t,n){return fM(),n.e.a+n.f.a+e*t}function _ye(e,t,n){return fM(),n.e.b+n.f.b+e*t}function vye(e,t,n){return kD(e.b,P(n.b,17),t)}function yye(e,t,n){return kD(e.b,P(n.b,17),t)}function bye(e,t){return M(e,new k(t.a,t.b))}function xye(e,t){$Ie(e,t==null?null:(yD(t),t))}function Sye(e,t){tLe(e,t==null?null:(yD(t),t))}function Cye(e,t){tLe(e,t==null?null:(yD(t),t))}function IT(e,t){var n;return++e.j,n=e.Aj(t),n}function LT(e,t){var n=sSe(e,t);return n.i=2,n}function RT(e,t,n){return e.a=-1,LC(e,t.g,n),e}function zT(e,t){mb.call(this,e,t),this.a=this}function wye(){Uy.call(this,`COUNT_CHILDREN`,0)}function Tye(e){this.c=e,this.b=this.c.d.vc().Jc()}function Eye(e){return e.e.Pd().gc()*e.c.Pd().gc()}function Dye(e,t,n){return new $me(VSe(e).Ze(),n,t)}function BT(e,t,n,r,i,a){return YXe(e,t,n,r,i,0,a)}function Oye(){Oye=C,byt=V(fX,X,190,256,0,1)}function kye(){kye=C,wyt=V(mX,X,191,256,0,1)}function Aye(){Aye=C,hyt=V(sX,X,221,256,0,1)}function jye(){jye=C,_yt=V(cX,X,180,128,0,1)}function VT(){VT=C,YY=new yk((QD(),QD(),TX))}function Mye(){Mye=C,eyt=new d_((QD(),QD(),DX))}function HT(e){for(nD(e);e.Ob();)e.Pb(),e.Qb()}function Nye(e){e.a.jd(),P(e.a.kd(),18).gc(),vm()}function UT(e){this.a=new _g(e.gc()),vN(this,e)}function Pye(e){nu.call(this,new aA),vN(this,e)}function Fye(e){this.c=e,this.a=new hg(this.c.a)}function Iye(e){if(e.e.c!=e.b)throw E(new vf)}function Lye(e){if(e.c.e!=e.a)throw E(new vf)}function Rye(e){return e.q?e.q:(QD(),QD(),EX)}function zye(e){return e.c-P(qT(e.a,e.b),295).b}function Bye(e,t){return yD(e),ON(e,(yD(t),t))}function Vye(e,t){return yD(t),ON(t,(yD(e),e))}function Hye(e,t,n){return Qx(t.d[e.g],n.d[e.g])}function Uye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function Wye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function Gye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function Kye(e,t,n){return Qx(e.d[t.p],e.d[n.p])}function qye(e,t){return e?0:r.Math.max(0,t-1)}function WT(e,t,n){return r.Math.min(n/e,1/t)}function GT(e){return e.c?e.c.f:e.e.b}function KT(e){return e.c?e.c.g:e.e.a}function qT(e,t){return dk(t,e.c.length),e.c[t]}function Jye(e,t){return dk(t,e.a.length),e.a[t]}function Yye(e,t){return e.a+=$I(t,0,t.length),e}function Xye(e,t){return e.a??Y7e(e),e.a[t]}function Zye(e){var t=tZe(e);return t?Zye(t):e}function Qye(e,t){var n;for(n=0;n<t;++n)e[n]=-1}function JT(e,t){Sg(),YMe.call(this,e),this.a=t}function YT(e,t){Gx(),Wd.call(this,t),this.a=e}function XT(e,t){bH(),Yd.call(this,e),this.a=t}function $ye(e){this.b=new gg,this.a=e,this.c=-1}function ebe(e){this.a=e,this.c=new Qd,Yze(this)}function ZT(e){aM.call(this,e.gc()),YE(this,e)}function QT(e,t,n,r){Eve(this,e,t,n,r)}function $T(e,t,n){this.a=e,MS.call(this,t,n,2)}function tbe(e,t){return e==null?t==null:$w(e,t)}function nbe(e,t){return e==null?t==null:rL(e,t)}function eE(e,t){return bH(),++W9,new Axe(e,t)}function tE(e){return qb(e)?e|0:zh(e)}function nE(e,t){var n=vI(e);return oBe(n,t),n}function rbe(e,t){return!e&&(e=[]),e[e.length]=t,e}function rE(e,t,n){QO(t,e.c.length),K_(e.c,t,n)}function ibe(e,t,n){aVe(0,t,e.length),uj(e,0,t,n)}function abe(e,t,n){var r;for(r=0;r<t;++r)e[r]=n}function obe(e,t){return j(t,23)&&hC(e,P(t,23))}function sbe(e,t){return j(t,23)&&NFe(e,P(t,23))}function iE(e,t){return gVe(e,t,JAe(e,e.b.Ae(t)))}function cbe(e,t){return e.a.get(t)!==void 0}function lbe(e){return Array.isArray(e)&&e.Rm===ne}function ube(e){return tB(e,26)*yW+tB(e,27)*bW}function dbe(){dbe=C,Ozt=new Bx((vH(),n8),0)}function fbe(){fbe=C,Yvt=new dye(V(RY,PH,1,0,5,1))}function pbe(){this.b=new lt,this.c=new Uwe(this)}function mbe(){this.d=new aee,this.e=new Hwe(this)}function hbe(e,t){this.b=new gg,this.a=e,this.c=t}function gbe(){vEe(),this.g=new gg,this.f=new gg}function _be(){$O(),this.k=new Qd,this.d=new jf}function vbe(e,t){ybe(e,tT(new k(t.a,t.b),e.c))}function ybe(e,t){eT(e.c,t),e.b.c+=t.a,e.b.d+=t.b}function aE(e){e.b?aE(e.b):e.d.dc()&&e.f.c.Ac(e.e)}function bbe(e,t,n){return-Qx(e.f[t.p],e.f[n.p])}function xbe(e,t,n){return RE(e,new C_(t.a,n.a))}function Sbe(e,t,n){b3e(n,e,1),M(t,new X_(n,e))}function Cbe(e,t,n){oR(n,e,1),M(t,new Due(n,e))}function wbe(e,t,n,r){Gx(),iOe.call(this,e,t,n,r)}function Tbe(e,t,n,r){Gx(),iOe.call(this,e,t,n,r)}function Ebe(e,t,n){this.a=e,NS.call(this,t,n,22)}function Dbe(e,t,n){this.a=e,NS.call(this,t,n,14)}function oE(e,t,n){return e.a=-1,LC(e,t.g+1,n),e}function Obe(e,t,n){return n=lV(e,P(t,52),7,n),n}function kbe(e,t,n){return n=lV(e,P(t,52),3,n),n}function sE(e,t,n){var r;e&&(r=e.i,r.c=t,r.b=n)}function cE(e,t,n){var r;e&&(r=e.i,r.d=t,r.a=n)}function Abe(e,t){(t.Bb&Rq)!=0&&!e.a.o&&(e.a.o=t)}function jbe(e){return e!=null&&vxe(e)&&e.Rm!==ne}function Mbe(e){return!Array.isArray(e)&&e.Rm===ne}function Nbe(e){return j(e,16)?P(e,16).cd():e.Jc()}function Pbe(e){return e.Oc(V(RY,PH,1,e.gc(),5,1))}function lE(e,t){return EGe(Oj(e,t))?t.wi():null}function Fbe(e){return e.d?e.d:e.d=e.Rd()}function uE(e){return e.c?e.c:e.c=e.Qd()}function dE(e){return e.i||=e.bc()}function Ibe(e){return e.f||=e.Cc()}function Lbe(e){return bH(),++W9,new wO(10,e,0)}function fE(e){r_(),this.a=0,this.b=e-1,this.c=1}function Rbe(e){iS(this),this.g=e,nO(this),this.he()}function zbe(e,t,n,r){this.a=e,BA.call(this,e,t,n,r)}function pE(e){this.a=(fbe(),Yvt),this.d=P(nD(e),50)}function mE(e){if(e.e.j!=e.d)throw E(new vf)}function hE(e){return qb(e)?``+e:E7e(e)}function Bbe(e,t){return Hw((yD(e),e),(yD(t),t))}function Vbe(e,t){return BF((yD(e),e),(yD(t),t))}function gE(e,t){return LN(j$e(qb(e)?KN(e):e,t))}function _E(e,t){return LN($4e(qb(e)?KN(e):e,t))}function vE(e,t){return LN(f1e(qb(e)?KN(e):e,t))}function Hbe(e,t){return nD(t),e.a.Hd(t)&&!e.b.Hd(t)}function Ube(e,t){return eS(e.l&t.l,e.m&t.m,e.h&t.h)}function Wbe(e,t){return eS(e.l|t.l,e.m|t.m,e.h|t.h)}function Gbe(e,t){return eS(e.l^t.l,e.m^t.m,e.h^t.h)}function yE(e,t){return kF(e,(yD(t),new $ie(t)))}function bE(e,t){return kF(e,(yD(t),new cu(t)))}function Kbe(e){return SN(),P(e,12).g.c.length!=0}function qbe(e){return SN(),P(e,12).e.c.length!=0}function Jbe(e,t){return bN(),BF(t.a.o.a,e.a.o.a)}function Ybe(e){e.d||(e.d=e.b.Jc(),e.c=e.b.gc())}function Xbe(e,t,n){e.a.Mb(n)&&(e.b=!0,t.Ad(n))}function xE(e,t){if(e<0||e>=t)throw E(new Cse)}function SE(e){e.f=new dx(e),e.i=new Tde(e),++e.g}function CE(e){this.b=new VA(11),this.a=($D(),e)}function Zbe(e){this.b=null,this.a=($D(),e||zyt)}function Qbe(e,t){this.e=e,this.d=t&64?t|YH:t}function $be(e,t){this.c=0,this.d=e,this.b=t|64|YH}function exe(e){this.a=QKe(e.a),this.b=new sT(e.b)}function wE(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function txe(e){for(var t=e;t.f;)t=t.f;return t}function nxe(e){return e.e?Yje(e.e):null}function TE(e){return Sz(),!e.Gc(c5)&&!e.Gc(u5)}function rxe(e,t,n){return AB(),bRe(e,t)&&bRe(e,n)}function ixe(e,t,n){return Zct(e,P(t,12),P(n,12))}function axe(e,t){return t.Sh()?bF(e.b,P(t,52)):t}function EE(e){return new k(e.c+e.b/2,e.d+e.a/2)}function oxe(e,t,n){t.of(n,D(N(sD(e.b,n)))*e.a)}function sxe(e,t){t.Tg(`General 'Rotator`,1),Iot(e)}function DE(e,t,n,r,i){aj.call(this,e,t,n,r,i,-1)}function OE(e,t,n,r,i){oj.call(this,e,t,n,r,i,-1)}function F(e,t,n,r){MS.call(this,e,t,n),this.b=r}function kE(e,t,n,r){ET.call(this,e,t,n),this.b=r}function cxe(e){eb.call(this,e,!1),this.a=!1}function lxe(){Uy.call(this,`LOOKAHEAD_LAYOUT`,1)}function uxe(){Uy.call(this,`LAYOUT_NEXT_LEVEL`,3)}function dxe(e){this.b=e,bC.call(this,e),Pfe(this)}function fxe(e){this.b=e,SC.call(this,e),Ffe(this)}function pxe(e,t){this.b=e,fie.call(this,e.b),this.a=t}function AE(e,t,n){this.a=e,Yw.call(this,t,n,5,6)}function mxe(e,t,n,r){this.b=e,MS.call(this,t,n,r)}function jE(e,t,n){qB(),this.e=e,this.d=t,this.a=n}function ME(e,t){for(yD(t);e.Ob();)t.Ad(e.Pb())}function NE(e,t){return bH(),++W9,new kSe(e,t,0)}function hxe(e,t){return bH(),++W9,new kSe(6,e,t)}function gxe(e,t){return $w(e.substr(0,t.length),t)}function PE(e,t){return bb(t)?cO(e,t):!!iE(e.f,t)}function _xe(e){return eS(~e.l&JU,~e.m&JU,~e.h&YU)}function vxe(e){return typeof e===TH||typeof e===OH}function FE(e){return new pE(new iC(e.a.length,e.a))}function yxe(e){return new JT(null,Pxe(e,e.length))}function bxe(e){if(!e)throw E(new Cf);return e.d}function IE(e){var t=OP(e);return UC(t!=null),t}function xxe(e){var t=BHe(e);return UC(t!=null),t}function LE(e,t){var n=e.a.gc();return Pje(t,n),n-t}function RE(e,t){return e.a.yc(t,e)==null}function zE(e,t){return e.a.yc(t,(XS(),iX))==null}function Sxe(e,t){return e>0?r.Math.log(e/t):-100}function Cxe(e,t){return t?vN(e,t):!1}function BE(e,t,n){return rN(e.a,t),Qve(e.b,t.g,n)}function wxe(e,t,n){xE(n,e.a.c.length),mA(e.a,n,t)}function I(e,t,n,r){aVe(t,n,e.length),Txe(e,t,n,r)}function Txe(e,t,n,r){var i;for(i=t;i<n;++i)e[i]=r}function Exe(e,t){var n;for(n=0;n<t;++n)e[n]=!1}function VE(e){WC(e.b!=-1),kA(e.c,e.a=e.b),e.b=-1}function HE(e,t,n){return iVe(e,t.g,n),rN(e.c,t),e}function Dxe(e,t,n){Vot(e.a,e.b,e.d,e.c,P(t,170),n)}function UE(e,t){ofe(e,j(t,163)?t:P(t,1998).Pl())}function Oxe(e,t){if(e==null)throw E(new tm(t))}function kxe(e,t,n){this.c=e,this.a=t,QD(),this.b=n}function WE(e,t){this.d=e,zS.call(this,e),this.e=t}function Axe(e,t){Yd.call(this,1),this.a=e,this.b=t}function jxe(e,t){return _F(e,t)<0?-1:+(_F(e,t)>0)}function GE(e){return e.e==0?e:new jE(-e.e,e.d,e.a)}function Mxe(e){return e==rW?bY:e==iW?`-INF`:``+e}function Nxe(e){return e==rW?bY:e==iW?`-INF`:``+e}function Pxe(e,t){return FFe(t,e.length),new fye(e,t)}function Fxe(e,t,n,r,i){for(;t<n;)r[i++]=jD(e,t++)}function Ixe(e,t,n){var r;for(r=0;r<t;++r)iD(e,r,n)}function Lxe(e,t,n){var r=Bj(e,t);return eA(e,t,n),r}function Rxe(e,t){return e.c?Rxe(e.c,t):M(e.b,t),e}function zxe(e){return!e.j&&jl(e,iet(e.g,e.b)),e.j}function Bxe(e){return $V(e,(KF(),y8)),e.d=!0,e}function KE(e,t){oA(e.d,t,e.b.b,e.b),++e.a,e.c=null}function Vxe(e,t){return BF(e.c.c+e.c.b,t.c.c+t.c.b)}function Hxe(e){return r.Math.abs(e.d.e-e.e.e)-e.a}function Uxe(e,t){return BF(e.e.a+e.f.a,t.e.a+t.f.a)}function Wxe(e,t){return BF(e.e.b+e.f.b,t.e.b+t.f.b)}function Gxe(e,t){this.d=JHe(e),this.c=t,this.a=.5*t}function qE(e){this.d=(yD(e),e),this.a=0,this.c=$H}function Kxe(e){Vwe.call(this),this.a=e,M(e.a,this)}function qxe(e){e?ZZe(e,(vg(),Eyt),``):Pwe((vg(),e))}function Jxe(e,t){cD(e,new rD(t.f==null?``+t.g:t.f))}function Yxe(e,t){cD(e,new rD(t.f==null?``+t.g:t.f))}function JE(e,t){wg(RD(e.Mc(),new vte),new Wu(t))}function YE(e,t){return e.Qi()&&(t=ZTe(e,t)),e.Di(t)}function Xxe(e,t){return t=e.Wk(null,t),vQe(e,null,t)}function Zxe(e,t){++e.j,DR(e,e.i,t),P2e(e,P(t,344))}function Qxe(e,t,n){return P(e.c.fd(t,P(n,136)),45)}function XE(e,t,n,r,i){AR(e,P(wA(t.k,n),16),n,r,i)}function ZE(e){e.s=NaN,e.c=NaN,j4e(e,e.e),j4e(e,e.j)}function $xe(e){e.a=null,e.e=null,SE(e.b),e.d=0,++e.c}function QE(e){return(e.i??vV(e),e.i).length}function $E(){$E=C,K7=N2e(),(SH(),J7)&&JYe()}function eSe(){eSe=C,syt=new al(!1),cyt=new al(!0)}function eD(e){var t;return t=e.g,t||(e.g=new Lc(e))}function tD(e){var t;return t=e.k,t||(e.k=new Rc(e))}function tSe(e){var t;return t=e.k,t||(e.k=new Rc(e))}function nSe(e){var t;return t=e.i,t||(e.i=new Vc(e))}function rSe(e){return e.j||=new bie(e)}function iSe(e){return e.f||=new VS(e)}function aSe(e){return e.d||=new Qc(e)}function oSe(e,t){var n=e.a.gc();return kk(t,n),n-1-t}function L(e,t,n){var r=sSe(e,t);return bIe(n,r),r}function sSe(e,t){var n=new tBe;return n.j=e,n.d=t,n}function nD(e){if(e==null)throw E(new xf);return e}function rD(e){if(e==null)throw E(new xf);this.a=e}function cSe(e){use(),this.b=new Zd,this.a=e,hat(this,e)}function lSe(e){this.b=e,this.a=P(vD(this.b.a.e),227)}function uSe(){aA.call(this),this.a=!0,this.b=!0}function dSe(e,t){return fk(t,e.length+1),e.substr(t)}function fSe(e,t){return kk(t,e.c.b.c.gc()),new lle(e,t)}function pSe(e,t,n){return bH(),++W9,new DDe(e,t,n)}function mSe(e){return j(e,606)?e:new ITe(e)}function iD(e,t,n){return cpe(n==null||htt(e,n)),e[t]=n}function aD(e,t){return e.a+=String.fromCharCode(t),e}function oD(e,t){return e.a+=String.fromCharCode(t),e}function hSe(e,t){return bN(),P(AD(e,t.d),16).Ec(t)}function sD(e,t){return bb(t)?DO(e,t):_b(iE(e.f,t))}function gSe(e,t){return P(uE(e.a).Kd().Xb(t),45).jd()}function _Se(e,t){return P(K(t,(hH(),h2)),15).a<e}function vSe(e,t,n,r){return n==0||(n-r)/n<e.e||t>=e.g}function ySe(e,t,n){return m9e(e,TLe(e,t,n))}function bSe(e,t){console[e].call(console,t)}function cD(e,t){var n=e.a.length;Bj(e,n),eA(e,n,t)}function xSe(e,t){var n;++e.j,n=e.Cj(),e.pj(e.Xi(n,t))}function SSe(e,t){for(yD(t);e.c<e.d;)e.Qe(t,e.c++)}function CSe(e,t,n){P(t.b,68),oM(t.a,new ove(e,n,t))}function wSe(e){for(;e.a.b!=0;)pot(e,P(DTe(e.a),9))}function TSe(e){this.d=e,this.c=e.a.d.a,this.b=e.a.e.g}function ESe(e){this.c=e,this.a=new gg,this.b=new gg}function lD(e){this.c=new hh,this.a=new Zd,this.b=e}function DSe(e){this.b=new Zd,this.a=new Zd,this.c=e}function OSe(e,t,n){Wd.call(this,t),this.a=e,this.b=n}function kSe(e,t,n){Yd.call(this,e),this.a=t,this.b=n}function ASe(e,t,n){this.a=e,Ud.call(this,t),this.b=n}function jSe(e,t,n){this.a=e,qOe.call(this,8,t,null,n)}function MSe(e){this.a=(yD(WJ),WJ),this.b=e,new lp}function NSe(e){this.c=e,this.b=this.c.a,this.a=this.c.e}function uD(e){WC(e.c!=-1),e.d.ed(e.c),e.b=e.c,e.c=-1}function dD(e){return r.Math.sqrt(e.a*e.a+e.b*e.b)}function PSe(e){return j(e,103)&&(P(e,19).Bb&Rq)!=0}function FSe(e){return vD(e),j(e,472)?P(e,472):OI(e)}function ISe(e){return e?e.dc():!e.Jc().Ob()}function LSe(e){return z9?cO(z9,e):!1}function fD(e){e.c?fD(e.c):(hI(e),e.d=!0)}function pD(e){e.c?e.c.Ye():(e.d=!0,w8e(e))}function RSe(e){TCe(e.a),e.b=V(RY,PH,1,e.b.length,5,1)}function mD(e,t){return qJe(e.c,e.f,t,e.b,e.a,e.e,e.d)}function hD(e,t){return xE(t,e.a.c.length),qT(e.a,t)}function gD(e,t){return A(e)===A(t)||e!=null&&OF(e,t)}function zSe(e,t){return Qx(t.j.c.length,e.j.c.length)}function BSe(e){return e.c.i.c==e.d.i.c}function _D(e){return!e.a&&e.c?e.c.b:e.a}function VSe(e){return 0>=e?new Ile:iLe(e-1)}function vD(e){if(e==null)throw E(new xf);return e}function yD(e){if(e==null)throw E(new xf);return e}function HSe(e){return!e.a&&(e.a=new MS(Q5,e,4)),e.a}function bD(e){return!e.d&&(e.d=new MS(z7,e,1)),e.d}function USe(e){if(e.p!=3)throw E(new bf);return e.e}function WSe(e){if(e.p!=4)throw E(new bf);return e.e}function GSe(e){if(e.p!=6)throw E(new bf);return e.f}function KSe(e){if(e.p!=3)throw E(new bf);return e.j}function qSe(e){if(e.p!=4)throw E(new bf);return e.j}function JSe(e){if(e.p!=6)throw E(new bf);return e.k}function xD(){zse.call(this),Tf(this.j.c,0),this.a=-1}function YSe(){ng.call(this,`DELAUNAY_TRIANGULATION`,0)}function XSe(){return Wp(),U(O(Xvt,1),Z,537,0,[JY])}function ZSe(e,t,n){return xP(),n.Kg(e,P(t.jd(),147))}function QSe(e,t){XA((!e.a&&(e.a=new Nw(e,e)),e.a),t)}function $Se(e,t){e.c<0||e.b.b<e.c?Ib(e.b,t):e.a.vf(t)}function eCe(e,t){var n=e.Fh(t);n>=0?e.hi(n):$0e(e,t)}function SD(e,t){var n=sSe(``,e);return n.n=t,n.i=1,n}function CD(e){return e.c==-2&&Bie(e,zQe(e.g,e.b)),e.c}function tCe(e){return!e.b&&(e.b=new Vd(new dp)),e.b}function nCe(e,t){return OT(),new iqe(new zfe(e),new Rfe(t))}function rCe(e){return KM(e,mU),Jj(lI(lI(5,e),e/10|0))}function iCe(){iCe=C,$vt=new u_(U(O(UY,1),rU,45,0,[]))}function aCe(){XQe.call(this,mY,(xh(),lVt)),Wit(this)}function oCe(){XQe.call(this,QJ,(bh(),SBt)),Frt(this)}function sCe(e,t){mfe.call(this,aLe(nD(e),nD(t))),this.a=t}function cCe(e,t,n,r){$h.call(this,e,t),this.d=n,this.a=r}function wD(e,t,n,r){$h.call(this,e,n),this.a=t,this.f=r}function lCe(e,t){this.b=e,WE.call(this,e,t),Pfe(this)}function uCe(e,t){this.b=e,Dhe.call(this,e,t),Ffe(this)}function TD(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function dCe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function ED(e){return!e.a&&(e.a=new Am(e.c.vc())),e.a}function fCe(e){return!e.b&&(e.b=new km(e.c.ec())),e.b}function pCe(e){return!e.d&&(e.d=new Yl(e.c.Bc())),e.d}function DD(e,t){for(;t-- >0;)e=e<<1|e<0;return e}function mCe(e,t){var n=new lD(e);return ff(t.c,n),n}function hCe(e,t){ybe(P(t.b,68),e),oM(t.a,new xu(e))}function gCe(e,t){e.u.Gc((Sz(),c5))&&b2e(e,t),BMe(e,t)}function OD(e,t){return A(e)===A(t)||e!=null&&OF(e,t)}function kD(e,t,n){return bb(t)?KO(e,t,n):gz(e.f,t,n)}function _Ce(e){return QD(),e?e.Me():($D(),$D(),Byt)}function vCe(){return Vg(),U(O(uFt,1),Z,477,0,[lFt])}function yCe(){return Hg(),U(O(pFt,1),Z,546,0,[fFt])}function bCe(){return Ug(),U(O(iIt,1),Z,527,0,[u6])}function AD(e,t){return obe(e.a,t)?e.b[P(t,23).g]:null}function xCe(e){return String.fromCharCode.apply(null,e)}function jD(e,t){return fk(t,e.length),e.charCodeAt(t)}function MD(e){return e.j.c.length=0,TCe(e.c),ehe(e.a),e}function ND(e){return e.e==gY&&Uie(e,VGe(e.g,e.b)),e.e}function PD(e){return e.f==gY&&Gie(e,jYe(e.g,e.b)),e.f}function SCe(e){return!e.b&&(e.b=new Zw(r7,e,4,7)),e.b}function CCe(e){return!e.c&&(e.c=new Zw(r7,e,5,8)),e.c}function wCe(e){return!e.c&&(e.c=new F(m7,e,9,9)),e.c}function FD(e){return!e.n&&(e.n=new F(f7,e,1,7)),e.n}function ID(e){var t=e.b;return!t&&(e.b=t=new zc(e)),t}function TCe(e){var t;for(t=e.Jc();t.Ob();)t.Pb(),t.Qb()}function ECe(e,t,n){var r=P(e.d.Kb(n),162);r&&r.Nb(t)}function DCe(e,t){return new kwe(P(nD(e),51),P(nD(t),51))}function LD(e,t){return hI(e),new JT(e,new bNe(t,e.a))}function RD(e,t){return hI(e),new JT(e,new Gje(t,e.a))}function zD(e,t){return hI(e),new Ow(e,new Uje(t,e.a))}function BD(e,t){return hI(e),new kw(e,new Wje(t,e.a))}function OCe(e,t){lUe(e,D(NM(t,`x`)),D(NM(t,`y`)))}function kCe(e,t){lUe(e,D(NM(t,`x`)),D(NM(t,`y`)))}function ACe(e,t){return Mg(),BF((yD(e),e),(yD(t),t))}function jCe(e,t){return BF(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function MCe(e,t){return BF(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function NCe(e){return e!=null&&ug(A7,e.toLowerCase())}function PCe(e){fT();var t=P(e.g,9);t.n.a=e.d.c+t.d.b}function VD(e){return cLe(e)||null}function HD(e,t,n,r){return TRe(e,t,n,!1),FF(e,r),e}function FCe(e,t,n){Ert(e.a,n),yze(n),r3e(e.b,n),ait(t,n)}function UD(e,t,n,r){ng.call(this,e,t),this.a=n,this.b=r}function WD(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function ICe(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function LCe(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function GD(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function RCe(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function KD(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function qD(e,t,n){this.a=Elt,this.d=e,this.b=t,this.c=n}function zCe(e,t){this.b=e,this.c=t,this.a=new hg(this.b)}function BCe(e,t){this.d=(yD(e),e),this.a=16449,this.c=t}function VCe(e,t,n,r){jBe.call(this,e,n,r,!1),this.f=t}function HCe(e,t,n){var r=bst(e);return t.qi(n,r)}function JD(e){var t,n=(t=new ef,t);return mM(n,e),n}function UCe(e){var t,n=(t=new ef,t);return l$e(n,e),n}function WCe(e){return!e.b&&(e.b=new F(i7,e,12,3)),e.b}function GCe(e){this.a=new Zd,this.e=V(q9,X,54,e,0,2)}function YD(e){this.f=e,this.c=this.f.e,e.f>0&&_Xe(this)}function KCe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function qCe(e,t,n,r){this.a=e,this.b=t,this.d=n,this.c=r}function JCe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function YCe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function XD(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function XCe(e,t,n,r){Gx(),Hje.call(this,t,n,r),this.a=e}function ZCe(e,t,n,r){Gx(),Hje.call(this,t,n,r),this.a=e}function QCe(e,t){this.a=e,Hpe.call(this,e,P(e.d,16).dd(t))}function $Ce(e,t){return BF(KT(e)*GT(e),KT(t)*GT(t))}function ewe(e,t){return BF(KT(e)*GT(e),KT(t)*GT(t))}function ZD(e){var t;return t=e.f,t||(e.f=new Jh(e,e.c))}function QD(){QD=C,TX=new ae,EX=new se,DX=new ce}function $D(){$D=C,zyt=new ue,kX=new ue,Byt=new de}function eO(e){if(kI(e.d),e.d.d!=e.c)throw E(new vf)}function tO(e){e.a.a=e.c,e.c.b=e.a,e.a.b=e.c.a=null,e.b=0}function twe(e){return UC(e.b<e.d.gc()),e.d.Xb(e.c=e.b++)}function nwe(e){return e.length>0?TA(e):new Zd}function nO(e){return e.n&&(e.e!==Clt&&e.he(),e.j=null),e}function rwe(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function iwe(e,t,n){return M(e.a,(kqe(t,n),new $h(t,n))),e}function awe(e,t){return P(K(e,(Y(),w1)),16).Ec(t),t}function owe(e,t){return kz(e,P(K(t,(hH(),h2)),15),t)}function swe(e){return Oz(e)&&sm(hw(J(e,(hH(),q0))))}function cwe(e,t,n){return Rg(),xUe(P(sD(e.e,t),516),n)}function lwe(e,t,n){e.i=0,e.e=0,t!=n&&xBe(e,t,n)}function uwe(e,t,n){e.i=0,e.e=0,t!=n&&SBe(e,t,n)}function dwe(e,t,n,r){this.b=e,this.c=r,Fb.call(this,t,n)}function fwe(e,t){this.g=e,this.d=U(O(GZ,1),qG,9,0,[t])}function pwe(e,t){e.d&&!e.d.a&&(tf(e.d,t),pwe(e.d,t))}function mwe(e,t){e.e&&!e.e.a&&(tf(e.e,t),mwe(e.e,t))}function hwe(e,t){return wF(e.j,t.s,t.c)+wF(t.e,e.s,e.c)}function gwe(e,t){return-BF(KT(e)*GT(e),KT(t)*GT(t))}function _we(e){return P(e.jd(),147).Og()+`:`+OI(e.kd())}function vwe(){qR(this,new kc),this.wb=($E(),K7),bh()}function ywe(e){this.b=new Rte,this.a=e,r.Math.random()}function bwe(e){this.b=new Zd,uP(this.b,this.b),this.a=e}function xwe(e,t){new gg,this.a=new np,this.b=e,this.c=t}function Swe(){Ap.call(this,`There is no more element.`)}function Cwe(e){xm(),r.setTimeout(function(){throw e},0)}function wwe(e){e.Tg(`No crossing minimization`,1),e.Ug()}function Twe(e,t){return VP(e),VP(t),Rp(P(e,23),P(t,23))}function rO(e,t,n){Xj(e,t,new ol(Che(n)))}function iO(e,t,n,r,i,a){oj.call(this,e,t,n,r,i,a?-2:-1)}function Ewe(e,t,n,r){ab.call(this,t,n),this.b=e,this.a=r}function Dwe(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function aO(e){return!e.a&&(e.a=new F(p7,e,10,11)),e.a}function oO(e){return!e.q&&(e.q=new F(B7,e,11,10)),e.q}function R(e){return!e.s&&(e.s=new F(N7,e,21,17)),e.s}function Owe(e){return NT(e==null||vxe(e)&&e.Rm!==ne),e}function sO(e,t){if(e==null)throw E(new tm(t));return e}function kwe(e,t){Kse.call(this,new Zbe(e)),this.a=e,this.b=t}function cO(e,t){return t==null?!!iE(e.f,null):cbe(e.i,t)}function lO(e){return j(e,18)?new UT(P(e,18)):vve(e.Jc())}function uO(e){return QD(),j(e,59)?new jm(e):new QS(e)}function Awe(e){return nD(e),zqe(new pE(KS(e.a.Jc(),new f)))}function jwe(e){return new jfe(e,e.e.Pd().gc()*e.c.Pd().gc())}function Mwe(e){return new Mfe(e,e.e.Pd().gc()*e.c.Pd().gc())}function Nwe(e){return e&&e.hashCode?e.hashCode():TC(e)}function Pwe(e){!e||yO(e,e.ge())}function Fwe(e,t){var n=CS(e.a,t);return n&&(t.d=null),n}function Iwe(e,t,n){return e.f?e.f.cf(t,n):!1}function dO(e,t,n,r){iD(e.c[t.g],n.g,r),iD(e.c[n.g],t.g,r)}function Lwe(e,t,n,r){iD(e.c[t.g],t.g,n),iD(e.b[t.g],t.g,r)}function Rwe(e,t,n){return D(N(n.a))<=e&&D(N(n.b))>=t}function zwe(){this.d=new gg,this.b=new Qd,this.c=new Zd}function Bwe(){this.b=new jf,this.d=new gg,this.e=new Zf}function Vwe(){this.c=new hh,this.d=new hh,this.e=new hh}function fO(){this.a=new np,this.b=(KM(3,fU),new VA(3))}function Hwe(e){this.c=e,this.b=new Nh(P(nD(new iee),51))}function Uwe(e){this.c=e,this.b=new Nh(P(nD(new dee),51))}function Wwe(e){this.b=e,this.a=new Nh(P(nD(new Xe),51))}function pO(e,t){this.e=e,this.a=RY,this.b=h9e(t),this.c=t}function mO(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function Gwe(e,t,n,r,i,a){this.a=e,JM.call(this,t,n,r,i,a)}function Kwe(e,t,n,r,i,a){this.a=e,JM.call(this,t,n,r,i,a)}function hO(e,t,n,r,i,a,o){return new pAe(e.e,t,n,r,i,a,o)}function qwe(e,t,n){return n>=0&&$w(e.substr(n,t.length),t)}function Jwe(e,t){return j(t,147)&&$w(e.b,P(t,147).Og())}function Ywe(e,t){return e.a?t.Dh().Jc():P(t.Dh(),72).Gi()}function Xwe(e,t){var n=e.b.Oc(t);return lAe(n,e.b.gc()),n}function gO(e,t){if(e==null)throw E(new tm(t));return e}function _O(e){return e.u||=(bA(e),new ime(e,e)),e.u}function vO(e){return P(BN(e,16),29)||e.fi()}function yO(e,t){var n=kh(e.Pm);return t==null?n:n+`: `+t}function bO(e,t,n){return YA(t,n,e.length),e.substr(t,n-t)}function Zwe(e,t){qw.call(this),qFe(this),this.a=e,this.c=t}function Qwe(){Uy.call(this,`FIXED_INTEGER_RATIO_BOXES`,2)}function $we(){return GA(),U(O(ewt,1),Z,422,0,[$Ct,l$])}function eTe(){return qj(),U(O(pwt,1),Z,419,0,[S$,fwt])}function tTe(){return _j(),U(O(bwt,1),Z,476,0,[ywt,M$])}function nTe(){return Fk(),U(O(Hwt,1),Z,420,0,[r1,Vwt])}function rTe(){return uA(),U(O(aTt,1),Z,423,0,[c0,s0])}function iTe(){return Tj(),U(O(zkt,1),Z,421,0,[b4,x4])}function aTe(){return lA(),U(O(AAt,1),Z,518,0,[V4,B4])}function oTe(){return PO(),U(O(VAt,1),Z,508,0,[K4,q4])}function sTe(){return NO(),U(O(zAt,1),Z,509,0,[G4,W4])}function cTe(){return UA(),U(O(rjt,1),Z,515,0,[Z4,X4])}function lTe(){return FO(),U(O(ujt,1),Z,454,0,[Q4,$4])}function uTe(){return Pk(),U(O(DMt,1),Z,425,0,[EMt,TMt])}function dTe(){return sN(),U(O(NMt,1),Z,487,0,[P3,F3])}function fTe(){return gj(),U(O(WMt,1),Z,426,0,[HMt,UMt])}function pTe(){return Kj(),U(O(gxt,1),Z,424,0,[uZ,dZ])}function mTe(){return oN(),U(O(BSt,1),Z,502,0,[nQ,tQ])}function hTe(){return _A(),U(O(KPt,1),Z,478,0,[WPt,GPt])}function gTe(){return WA(),U(O(gFt,1),Z,428,0,[hFt,c6])}function _Te(){return iP(),U(O(sIt,1),Z,427,0,[d6,oIt])}function xO(e,t,n,r){return n>=0?e.Rh(t,n,r):e.zh(null,n,r)}function SO(e){return e.b.b==0?e.a.uf():mve(e.b)}function vTe(e){if(e.p!=5)throw E(new bf);return tE(e.f)}function yTe(e){if(e.p!=5)throw E(new bf);return tE(e.k)}function bTe(e){return A(e.a)===A((JLe(),PBt))&&Rit(e),e.a}function xTe(e,t){Sl(this,new k(e.a,e.b)),Cl(this,yT(t))}function CO(){qse.call(this,new _g(RN(12))),WS(!0),this.a=2}function wO(e,t,n){bH(),Yd.call(this,e),this.b=t,this.a=n}function STe(e,t,n){Gx(),Wd.call(this,t),this.a=e,this.b=n}function CTe(e,t){return ZY[e.charCodeAt(0)]??e}function TO(e,t){return sO(e,`set1`),sO(t,`set2`),new og(e,t)}function EO(e,t){return aAe(t),xIe(e,V(q9,RU,30,t,15,1),t)}function wTe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=WT(e.c,e.b,e.a))}function TTe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=WT(e.c,e.b,e.a))}function ETe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function DTe(e){return e.b==0?null:(UC(e.b!=0),iM(e,e.a.a))}function DO(e,t){return t==null?_b(iE(e.f,null)):m_(e.i,t)}function OTe(e,t,n,r,i){return new tz(e,(fj(),NX),t,n,r,i)}function OO(e,t,n,r){var i=new Dme;t.a[n.g]=i,BE(e.b,r,i)}function kTe(e,t){var n=t,r=new ve;return Zat(e,n,r),r.d}function ATe(e,t){return eT(aw(GFe(e.f,t)),e.f.d)}function kO(e){var t;zIe(e.a),Ade(e.a),t=new vu(e.a),GUe(t)}function jTe(e,t){H7e(e,!0),oM(e.e.Pf(),new Fhe(e,!0,t))}function MTe(e,t){return fM(),P(K(t,(_V(),j3)),15).a==e}function AO(e){return Math.max(Math.min(e,kH),-2147483648)|0}function NTe(e){qw.call(this),qFe(this),this.a=e,this.c=!0}function PTe(e,t,n){this.a=new Zd,this.e=e,this.f=t,this.c=n}function jO(e,t,n){this.c=new Zd,this.e=e,this.f=t,this.b=n}function FTe(e,t,n){this.i=new Zd,this.b=e,this.g=t,this.a=n}function ITe(e){this.a=P(nD(e),277),this.b=(QD(),new eC(e))}function MO(){MO=C;var e,t=!XWe();e=new b,ayt=t?new y:e}function LTe(){LTe=C,ybt=new Ie,xbt=new mbe,bbt=new Re}function NO(){NO=C,G4=new Vv(VW,0),W4=new Vv(BW,1)}function PO(){PO=C,K4=new Hv(qW,0),q4=new Hv(`UP`,1)}function FO(){FO=C,Q4=new Jv(BW,0),$4=new Jv(VW,1)}function IO(e,t,n){tk(),e&&kD($zt,e,t),e&&kD(C7,e,n)}function RTe(e,t,n){var r=e.Fh(t);r>=0?e.$h(r,n):F6e(e,t,n)}function zTe(e,t){var n;for(nD(t),n=e.a;n;n=n.c)t.Wd(n.g,n.i)}function LO(e,t){var n=e.q.getHours();e.q.setDate(t),SV(e,n)}function BTe(e){var t=new Mh(RN(e.length));return oBe(t,e),t}function VTe(e){function t(){}return t.prototype=e||{},new t}function HTe(e,t){return hze(e,t)?(NIe(e),!0):!1}function RO(e,t){if(t==null)throw E(new xf);return dGe(e,t)}function UTe(e){if(e.ye())return null;var t=e.n;return LY[t]}function zO(e){return e.Db>>16==3?P(e.Cb,26):null}function BO(e){return e.Db>>16==9?P(e.Cb,26):null}function WTe(e){return e.Db>>16==6?P(e.Cb,85):null}function GTe(e,t){var n=e.Fh(t);return n>=0?e.Th(n):M2e(e,t)}function VO(e,t,n){e.b=new fN(uBe(e,t,n).c.length)}function KTe(e){this.a=e,this.b=V(TAt,X,2005,e.e.length,0,2)}function qTe(){this.a=new ax,this.e=new jf,this.g=0,this.i=0}function JTe(e,t){iS(this),this.f=t,this.g=e,nO(this),this.he()}function YTe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function XTe(e){var t=e.d;return t=e._i(e.f),XA(e,t),t.Ob()}function ZTe(e,t){var n=new Pye(t);return BQe(n,e),new sT(n)}function QTe(e){if(e.p!=0)throw E(new bf);return Cb(e.f,0)}function $Te(e){if(e.p!=0)throw E(new bf);return Cb(e.k,0)}function eEe(e){return e.Db>>16==7?P(e.Cb,241):null}function tEe(e){return e.Db>>16==7?P(e.Cb,174):null}function nEe(e){return e.Db>>16==3?P(e.Cb,158):null}function HO(e){return e.Db>>16==6?P(e.Cb,241):null}function UO(e){return e.Db>>16==11?P(e.Cb,26):null}function WO(e){return e.Db>>16==17?P(e.Cb,29):null}function GO(e,t,n,r,i,a){return new Wj(e.e,t,e.Jj(),n,r,i,a)}function KO(e,t,n){return t==null?gz(e.f,null,n):oI(e.i,t,n)}function qO(e,t){return r.Math.abs(e)<r.Math.abs(t)?e:t}function rEe(e,t){return dT(),XS(),P(t.a,15).a<e}function iEe(e,t){return dT(),XS(),P(t.b,15).a<e}function aEe(e){return tF(),XS(),P(e.a,82).d.e!=0}function oEe(e){return!e.a&&(e.a=new F(p7,e,10,11)),e.a.i>0}function sEe(e){var t;return hI(e),t=new jf,LD(e,new du(t))}function cEe(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.te(t))}function lEe(e,t){var n=e.q.getHours();e.q.setMonth(t),SV(e,n)}function JO(e,t){e.c&&bj(e.c.g,e),e.c=t,e.c&&M(e.c.g,e)}function YO(e,t){e.c&&bj(e.c.a,e),e.c=t,e.c&&M(e.c.a,e)}function XO(e,t){e.d&&bj(e.d.e,e),e.d=t,e.d&&M(e.d.e,e)}function ZO(e,t){e.i&&bj(e.i.j,e),e.i=t,e.i&&M(e.i.j,e)}function uEe(e,t,n){this.a=t,this.c=e,this.b=(nD(n),new sT(n))}function dEe(e,t,n){this.a=t,this.c=e,this.b=(nD(n),new sT(n))}function fEe(e,t){this.a=e,this.c=sS(this.a),this.b=new mO(t)}function QO(e,t){if(e<0||e>t)throw E(new Xp(Xlt+e+Zlt+t))}function pEe(){pEe=C,lAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function mEe(){mEe=C,uAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function hEe(){hEe=C,iAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function gEe(){gEe=C,aAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function _Ee(){_Ee=C,oAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function vEe(){vEe=C,sAt=oE(new xD,(BR(),kZ),(yH(),wQ))}function yEe(){yEe=C,MAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function $O(){$O=C,FAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function bEe(){bEe=C,RAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function ek(){ek=C,UAt=RT(new xD,(BR(),kZ),(yH(),cQ))}function xEe(){xEe=C,kMt=oE(new xD,(QL(),n3),(QB(),gjt))}function SEe(){SEe=C,Zvt=cF((Wp(),U(O(Xvt,1),Z,537,0,[JY])))}function tk(){tk=C,$zt=new Qd,C7=new Qd,cb(Uyt,new ko)}function CEe(e,t){t.c!=null&&cD(e,new rD(t.c))}function wEe(e,t){CSe(e,e.b,e.c),P(e.b.b,68),t&&P(t.b,68).b}function nk(e,t){j(e.Cb,184)&&(P(e.Cb,184).tb=null),pN(e,t)}function TEe(e,t){j(e.Cb,88)&&yz(bA(P(e.Cb,88)),4),pN(e,t)}function EEe(e,t){sUe(e,t),j(e.Cb,88)&&yz(bA(P(e.Cb,88)),2)}function DEe(e,t){return BF(P(e.c,65).c.e.b,P(t.c,65).c.e.b)}function OEe(e,t){return BF(P(e.c,65).c.e.a,P(t.c,65).c.e.a)}function rk(e,t){return n_(),kPe(t)?new zT(t,e):new mb(t,e)}function kEe(e,t){e.a&&bj(e.a.k,e),e.a=t,e.a&&M(e.a.k,e)}function AEe(e,t){e.b&&bj(e.b.f,e),e.b=t,e.b&&M(e.b.f,e)}function ik(e,t,n){THe(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function ak(e){this.c=new gg,this.b=e.b,this.d=e.c,this.a=e.a}function jEe(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function ok(e,t,n,r){this.c=e,this.d=r,kEe(this,t),AEe(this,n)}function sk(e,t){this.b=(yD(e),e),this.a=(t&aW)==0?t|64|YH:t}function MEe(e,t){OS(e,tE(hk(_E(t,24),CW)),tE(hk(t,CW)))}function ck(e){return qB(),_F(e,0)>=0?VI(e):GE(VI(yj(e)))}function NEe(){return QP(),U(O(zX,1),Z,130,0,[dbt,RX,fbt])}function PEe(e,t,n){return new tz(e,(fj(),MX),null,!1,t,n)}function FEe(e,t,n){return new tz(e,(fj(),PX),t,n,null,!1)}function IEe(e,t,n){var r;THe(t,n,e.c.length),r=n-t,Ih(e.c,t,r)}function LEe(e,t){var n=P(xF(ZD(e.a),t),18);return n?n.gc():0}function REe(e){var t;return hI(e),t=($D(),$D(),kX),Qj(e,t)}function zEe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function BEe(e){var t,n=(bh(),t=new ef,t);return mM(n,e),n}function VEe(e){var t,n=(bh(),t=new ef,t);return mM(n,e),n}function lk(e){return Rg(),j(e.g,9)?P(e.g,9):null}function HEe(){return cN(),U(O(KQ,1),Z,368,0,[GQ,WQ,UQ])}function UEe(){return VM(),U(O(swt,1),Z,350,0,[owt,p$,f$])}function WEe(){return bP(),U(O(hwt,1),Z,449,0,[w$,C$,T$])}function GEe(){return eP(),U(O(X$,1),Z,302,0,[J$,Y$,q$])}function KEe(){return yP(),U(O($$,1),Z,329,0,[Q$,Lwt,Z$])}function qEe(){return Fj(),U(O(zwt,1),Z,315,0,[t1,n1,e1])}function JEe(){return fF(),U(O(wkt,1),Z,352,0,[e4,Ckt,t4])}function YEe(){return BM(),U(O(Vkt,1),Z,452,0,[w4,S4,C4])}function XEe(){return tP(),U(O(Gkt,1),Z,381,0,[Ukt,T4,Wkt])}function ZEe(){return ZP(),U(O(qkt,1),Z,348,0,[O4,E4,D4])}function QEe(){return pF(),U(O(Xkt,1),Z,349,0,[k4,Ykt,A4])}function $Ee(){return zM(),U(O(eAt,1),Z,351,0,[$kt,j4,Qkt])}function eDe(){return nP(),U(O(nAt,1),Z,382,0,[N4,P4,M4])}function tDe(){return wj(),U(O(rSt,1),Z,384,0,[CZ,SZ,wZ])}function nDe(){return lM(),U(O(KX,1),Z,237,0,[UX,WX,GX])}function rDe(){return pj(),U(O(Ebt,1),Z,461,0,[XX,YX,ZX])}function iDe(){return Pj(),U(O(kbt,1),Z,462,0,[eZ,$X,QX])}function aDe(){return YP(),U(O(Ojt,1),Z,385,0,[Djt,s3,o3])}function oDe(){return XP(),U(O(JMt,1),Z,386,0,[I3,KMt,qMt])}function sDe(){return wI(),U(O(nPt,1),Z,387,0,[ePt,tPt,$Nt])}function cDe(){return $N(),U(O(RNt,1),Z,303,0,[INt,LNt,FNt])}function lDe(){return qI(),U(O(VNt,1),Z,436,0,[B3,V3,BNt])}function uDe(){return VF(),U(O(nFt,1),Z,430,0,[$Pt,tFt,eFt])}function dDe(){return HF(),U(O(sFt,1),Z,435,0,[a6,o6,s6])}function fDe(){return vj(),U(O(ZPt,1),Z,429,0,[JPt,XPt,YPt])}function pDe(){return uM(),U(O(hRt,1),Z,279,0,[E8,D8,O8])}function mDe(){return $P(),U(O(PRt,1),Z,347,0,[P8,N8,F8])}function hDe(){return _M(),U(O(ezt,1),Z,300,0,[F5,QRt,$Rt])}function gDe(){return UF(),U(O(szt,1),Z,281,0,[ozt,Y5,X5])}function uk(e){return jP(U(O(E6,1),X,8,0,[e.i.n,e.n,e.a]))}function _De(e,t,n){var r=new fx(n.d);eT(r,e),lUe(t,r.a,r.b)}function vDe(e,t,n){var r=new Jte;r.b=t,r.a=n,++t.b,M(e.d,r)}function yDe(e,t,n){var r=OV(e,t,!1);return r.b<=t&&r.a<=n}function bDe(e){if(e.p!=2)throw E(new bf);return tE(e.f)&wU}function xDe(e){if(e.p!=2)throw E(new bf);return tE(e.k)&wU}function dk(e,t){if(e<0||e>=t)throw E(new Xp(Xlt+e+Zlt+t))}function fk(e,t){if(e<0||e>=t)throw E(new Em(Xlt+e+Zlt+t))}function SDe(e){return e.Db>>16==6?P(zz(e),241):null}function CDe(e,t){var n,r=LE(e,t);return n=e.a.dd(r),new Sle(e,n)}function wDe(e,t){var n=(yD(e),e).g;return HC(!!n),yD(t),n(t)}function TDe(e){return e.a==(MA(),h9)&&kl(e,N7e(e.g,e.b)),e.a}function pk(e){return e.d==(MA(),h9)&&Vie(e,pnt(e.g,e.b)),e.d}function EDe(e,t){Gse.call(this,new _g(RN(e))),KM(t,glt),this.a=t}function DDe(e,t,n){Yd.call(this,25),this.b=e,this.a=t,this.c=n}function mk(e){bH(),Yd.call(this,e),this.c=!1,this.a=!1}function ODe(e,t){jE.call(this,1,2,U(O(q9,1),RU,30,15,[e,t]))}function hk(e,t){return LN(Ube(qb(e)?KN(e):e,qb(t)?KN(t):t))}function gk(e,t){return LN(Wbe(qb(e)?KN(e):e,qb(t)?KN(t):t))}function _k(e,t){return LN(Gbe(qb(e)?KN(e):e,qb(t)?KN(t):t))}function kDe(e,t){return sbe(e.a,t)?Qve(e.b,P(t,23).g,null):null}function vk(e){return nD(e),j(e,18)?new sT(P(e,18)):bT(e.Jc())}function yk(e){VT(),this.a=(QD(),j(e,59)?new jm(e):new QS(e))}function ADe(e){var t=P(AT(e.b),10);return new lT(e.a,t,e.c)}function jDe(e,t){Pst(e,t,D(N(e.a.mf((vH(),u8)))))}function MDe(e,t){return Gj(),e.c==t.c?BF(t.d,e.d):BF(e.c,t.c)}function NDe(e,t){return Gj(),e.c==t.c?BF(e.d,t.d):BF(e.c,t.c)}function PDe(e,t){return Gj(),e.c==t.c?BF(e.d,t.d):BF(t.c,e.c)}function FDe(e,t){return Gj(),e.c==t.c?BF(t.d,e.d):BF(t.c,e.c)}function IDe(e,t){e.b|=t.b,e.c|=t.c,e.d|=t.d,e.a|=t.a}function z(e){return UC(e.a<e.c.c.length),e.b=e.a++,e.c.c[e.b]}function LDe(e){return e.b==null||e.b.length==0?`n_`+e.a:`n_`+e.b}function bk(e){return P(cL(e,V(GZ,qG,9,e.c.length,0,1)),199)}function RDe(e){return lI(gE(zN(tB(e,32)),32),zN(tB(e,32)))}function zDe(e,t){return e&&e.equals?e.equals(t):A(e)===A(t)}function xk(e){return e.c==null||e.c.length==0?`n_`+e.g:`n_`+e.c}function BDe(e,t){for(var n=e+``;n.length<t;)n=`0`+n;return n}function VDe(e,t){var n=P(sD(e.g,t),60);oM(t.d,new Tue(e,n))}function HDe(e,t){var n=yJe(e),r=yJe(t);return n<r?-1:+(n>r)}function UDe(e,t){var n=kj(t);return P(sD(e.c,n),15).a}function Sk(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function WDe(e,t,n){var r;e.n&&t&&n&&(r=new Lne,M(e.e,r))}function Ck(e,t){if(RE(e.a,t),t.d)throw E(new Ap(eut));t.d=e}function GDe(e,t){this.a=new Zd,this.d=new Zd,this.f=e,this.c=t}function KDe(){xP(),this.b=new Qd,this.a=new Qd,this.c=new Zd}function qDe(){this.c=new tS,this.a=new zje,this.b=new bse,qle()}function JDe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function YDe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function XDe(e,t,n,r,i,a){dIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function ZDe(e,t,n,r,i,a){fIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function QDe(e,t,n,r,i,a){dje.call(this,e,t,n,r,i),a&&(this.o=-2)}function $De(e,t,n,r,i,a){hIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function eOe(e,t,n,r,i,a){fje.call(this,e,t,n,r,i),a&&(this.o=-2)}function tOe(e,t,n,r,i,a){pIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function nOe(e,t,n,r,i,a){mIe.call(this,e,t,n,r,i),a&&(this.o=-2)}function rOe(e,t,n,r,i,a){pje.call(this,e,t,n,r,i),a&&(this.o=-2)}function iOe(e,t,n,r){Wd.call(this,n),this.b=e,this.c=t,this.d=r}function aOe(e,t){this.f=e,this.a=(MA(),m9),this.c=m9,this.b=t}function oOe(e,t){this.g=e,this.d=(MA(),h9),this.a=h9,this.b=t}function sOe(e,t){!e.c&&(e.c=new jN(e,0)),FV(e.c,(WV(),T9),t)}function cOe(e,t){return H3e(e,t,j(t,103)&&(P(t,19).Bb&sW)!=0)}function lOe(e,t){return jxe(zN(e.q.getTime()),zN(t.q.getTime()))}function uOe(e){return Dye(e.e.Pd().gc()*e.c.Pd().gc(),16,new Uc(e))}function dOe(e){return!!e.u&&Zk(e.u.a).i!=0&&!(e.n&&vqe(e.n))}function fOe(e){return!!e.a&&Ej(e.a.a).i!=0&&!(e.b&&yqe(e.b))}function pOe(e,t){return t==0?!!e.o&&e.o.f!=0:xKe(e,t)}function mOe(e){return UC(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function wk(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function hOe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function Tk(e,t){this.a=e,Zl.call(this,e),QO(t,e.gc()),this.b=t}function gOe(e){this.a=V(RY,PH,1,Qze(r.Math.max(8,e))<<1,5,1)}function _Oe(e){LLe.call(this,e,(fj(),jX),null,!1,null,!1)}function vOe(e,t){var n=1-t;return e.a[n]=uN(e.a[n],n),uN(e,t)}function yOe(e,t){var n,r=hk(e,dW);return n=gE(t,32),gk(n,r)}function bOe(e,t,n){var r=P(e.Zb().xc(t),18);return!!r&&r.Gc(n)}function xOe(e,t,n){var r=P(e.Zb().xc(t),18);return!!r&&r.Kc(n)}function SOe(e,t,n){ZJe(new uEe((nD(e),new sT(e)),t,n))}function Ek(e,t,n){QJe(new dEe((nD(e),new sT(e)),t,n))}function COe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),tO(e.d),Tf(e.e.a.c,0)}function wOe(e,t){var n;e.e=new vp,n=DB(t),Yx(n,e.c),f7e(e,n,0)}function TOe(e,t){return new cve(t,rw(sS(t.e),e,e),(XS(),!0))}function EOe(e,t){return dM(),P(K(t,(_V(),k3)),15).a>=e.gc()}function DOe(e){return $O(),!xA(e)&&!(!xA(e)&&e.c.i.c==e.d.i.c)}function Dk(e){return P(cL(e,V(WZ,KG,17,e.c.length,0,1)),323)}function OOe(e){LUe((!e.a&&(e.a=new F(p7,e,10,11)),e.a),new ya)}function kOe(){var e,t=(n=(e=new ef,e),n),n;return M(JBt,t),t}function Ok(e,t,n,r,i,a){return TRe(e,t,n,a),OHe(e,r),kHe(e,i),e}function AOe(e,t,n,r){return e.a+=``+bO(t==null?FH:OI(t),n,r),e}function kk(e,t){if(e<0||e>=t)throw E(new Xp(N0e(e,t)));return e}function jOe(e,t,n){if(e<0||t<e||t>n)throw E(new Xp(S1e(e,t,n)))}function B(e,t,n,r){var i=new Ga;i.a=t,i.b=n,i.c=r,MT(e.b,i)}function Ak(e,t,n,r){var i=new Ga;i.a=t,i.b=n,i.c=r,MT(e.a,i)}function MOe(e,t,n){var r=GGe();try{return ome(e,t,n)}finally{Cje(r)}}function jk(e){var t;return qb(e)?(t=e,t==-0?0:t):FPe(e)}function NOe(e,t){return j(t,45)?eJe(e.a,P(t,45)):!1}function POe(e,t){return j(t,45)?eJe(e.a,P(t,45)):!1}function FOe(e,t){return j(t,45)?eJe(e.a,P(t,45)):!1}function IOe(e,t){return e.a<=e.b?(t.Bd(e.a++),!0):!1}function LOe(e){return ID(e).dc()?!1:(Qde(e,new g),!0)}function ROe(e){var t;return fD(e),t=new fe,Ph(e.a,new nae(t)),t}function Mk(e){var t;return fD(e),t=new pe,Ph(e.a,new rae(t)),t}function zOe(e){if(!(`stack`in e))try{throw e}catch{}return e}function Nk(e){return new VA((KM(e,mU),Jj(lI(lI(5,e),e/10|0))))}function BOe(e){return P(cL(e,V(LSt,Wut,12,e.c.length,0,1)),2004)}function VOe(e){return Dye(e.e.Pd().gc()*e.c.Pd().gc(),273,new Hc(e))}function HOe(){HOe=C,dFt=cF((Vg(),U(O(uFt,1),Z,477,0,[lFt])))}function UOe(){UOe=C,mFt=cF((Hg(),U(O(pFt,1),Z,546,0,[fFt])))}function WOe(){WOe=C,aIt=cF((Ug(),U(O(iIt,1),Z,527,0,[u6])))}function GOe(){GOe=C,_At=nCe(G(1),G(4)),gAt=nCe(G(1),G(2))}function Pk(){Pk=C,EMt=new ny(`DFS`,0),TMt=new ny(`BFS`,1)}function Fk(){Fk=C,r1=new yv(zW,0),Vwt=new yv(`TOP_LEFT`,1)}function KOe(e,t,n){this.d=new qu(this),this.e=e,this.i=t,this.f=n}function qOe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function JOe(e,t,n){e.d&&bj(e.d.e,e),e.d=t,e.d&&rE(e.d.e,n,e)}function YOe(e,t,n){var r=XI(n);return JB(e.n,r,t),JB(e.o,t,n),t}function Ik(e,t){var n=Bj(e,t),r=null;return n&&(r=n.qe()),r}function Lk(e,t){var n=RO(e,t),r=null;return n&&(r=n.qe()),r}function Rk(e,t){var n=RO(e,t),r=null;return n&&(r=n.ne()),r}function zk(e,t){var n=RO(e,t),r=null;return n&&(r=A1e(n)),r}function Bk(e,t){nct(t,e),Rve(e.d),Rve(P(K(e,(hH(),r2)),213))}function Vk(e,t){rct(t,e),zve(e.d),zve(P(K(e,(hH(),r2)),213))}function Hk(e,t){yD(t),e.b=e.b-1&e.a.length-1,iD(e.a,e.b,t),IJe(e)}function XOe(e,t){yD(t),iD(e.a,e.c,t),e.c=e.c+1&e.a.length-1,IJe(e)}function Uk(e){return UC(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function ZOe(e){if(e.e.g!=e.b)throw E(new vf);return!!e.c&&e.d>0}function Wk(e){return j(e,18)?P(e,18).dc():!e.Jc().Ob()}function QOe(e){return new sk(YFe(P(e.a.kd(),18).gc(),e.a.jd()),16)}function $Oe(e){var t=e.Dh();this.a=j(t,72)?P(t,72).Gi():t.Jc()}function eke(e,t){var n=P(Rj(e.b,t),66);return!n&&(n=new gg),n}function tke(e,t){var n=t.a;JO(n,t.c.d),XO(n,t.d.d),DN(n.a,e.n)}function nke(e,t,n,r){return j(n,59)?new ope(e,t,n,r):new zbe(e,t,n,r)}function rke(){return rP(),U(O(VCt,1),Z,413,0,[PQ,FQ,IQ,LQ])}function ike(){return QN(),U(O(txt,1),Z,409,0,[oZ,rZ,iZ,aZ])}function ake(){return vP(),U(O(mSt,1),Z,408,0,[FZ,RZ,IZ,LZ])}function oke(){return fj(),U(O(FX,1),Z,309,0,[jX,MX,NX,PX])}function ske(){return aL(),U(O(CSt,1),Z,383,0,[HZ,SSt,BZ,VZ])}function cke(){return _P(),U(O(DCt,1),Z,367,0,[NQ,jQ,MQ,AQ])}function lke(){return CI(),U(O(iwt,1),Z,301,0,[d$,nwt,u$,rwt])}function uke(){return OL(),U(O(o4,1),Z,203,0,[i4,a4,r4,n4])}function dke(){return JI(),U(O(Lkt,1),Z,269,0,[_4,Ikt,v4,y4])}function fke(){return dF(),U(O(CAt,1),Z,404,0,[F4,L4,R4,I4])}function pke(e){var t;return e.j==(rH(),j5)&&(t=k4e(e),hC(t,p5))}function mke(){return QL(),U(O(fjt,1),Z,398,0,[e3,t3,n3,r3])}function hke(e,t){return P(oC(yE(P(wA(e.k,t),16).Mc(),t$)),113)}function gke(e,t){return P(oC(bE(P(wA(e.k,t),16).Mc(),t$)),113)}function _ke(e,t){return DS(new k(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function vke(){return LR(),U(O(qNt,1),Z,401,0,[KNt,UNt,GNt,WNt])}function yke(){return VL(),U(O(NNt,1),Z,354,0,[MNt,ANt,jNt,kNt])}function bke(){return JP(),U(O(CMt,1),Z,353,0,[SMt,M3,xMt,bMt])}function xke(){return WF(),U(O(pRt,1),Z,278,0,[T8,w8,dRt,fRt])}function Ske(){return GF(),U(O(vRt,1),Z,222,0,[_Rt,A8,k8,j8])}function Cke(){return $L(),U(O(LRt,1),Z,292,0,[z8,I8,L8,R8])}function wke(){return dA(),U(O(Z5,1),Z,288,0,[lzt,fzt,uzt,dzt])}function Tke(){return YI(),U(O(B5,1),Z,380,0,[R5,z5,L5,I5])}function Eke(){return TI(),U(O(vzt,1),Z,326,0,[_zt,mzt,gzt,hzt])}function Dke(){return qP(),U(O(Tzt,1),Z,407,0,[Szt,Czt,xzt,wzt])}function Gk(e,t,n){return t<0?M2e(e,n):P(n,69).uk().zk(e,e.ei(),t)}function Oke(e,t,n){var r=XI(n);return JB(e.f,r,t),kD(e.g,t,n),t}function kke(e,t,n){var r=XI(n);return JB(e.p,r,t),kD(e.q,t,n),t}function Ake(e){var t=(vh(),n=new bo,n),n;return e&&oB(t,e),t}function jke(e){var t=e.$i(e.i);return e.i>0&&hV(e.g,0,t,0,e.i),t}function Kk(e){return Rg(),j(e.g,156)?P(e.g,156):null}function Mke(e){return tk(),PE($zt,e)?P(sD($zt,e),342).Pg():null}function Nke(e){e.a=null,e.e=null,Tf(e.b.c,0),Tf(e.f.c,0),e.c=null}function Pke(e,t){var n;for(n=e.j.c.length;n<t;n++)M(e.j,e.Mg())}function Fke(e,t,n,r){var i=r[t.g][n.g];return D(N(K(e.a,i)))}function Ike(e,t){Zg();var n=P(sD(D7,e),58);return!n||n.dk(t)}function Lke(e){if(e.p!=1)throw E(new bf);return tE(e.f)<<24>>24}function Rke(e){if(e.p!=1)throw E(new bf);return tE(e.k)<<24>>24}function zke(e){if(e.p!=7)throw E(new bf);return tE(e.k)<<16>>16}function Bke(e){if(e.p!=7)throw E(new bf);return tE(e.f)<<16>>16}function qk(e,t){return t.e==0||e.e==0?xX:(jB(),fB(e,t))}function Vke(e,t){return A(t)===A(e)?`(this Map)`:t==null?FH:OI(t)}function Hke(e,t,n){return Vbe(N(_b(iE(e.f,t))),N(_b(iE(e.f,n))))}function Uke(e,t,n){var r=P(sD(e.g,n),60);M(e.a.c,new Gy(t,r))}function Wke(e,t){var n=new Tm;return e.Ed(n),n.a+=`..`,t.Fd(n),n.a}function Jk(e){for(var t=0;e.Ob();)e.Pb(),t=lI(t,1);return Jj(t)}function Gke(e,t,n,r,i){M(t,y0e(i,m6e(i,n,r))),g$e(e,i,t)}function Kke(e,t,n){e.i=0,e.e=0,t!=n&&(SBe(e,t,n),xBe(e,t,n))}function qke(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function Jke(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function Yke(e,t){Vwe.call(this),this.a=e,this.b=t,M(this.a.b,this)}function Yk(e,t){qB(),jE.call(this,e,1,U(O(q9,1),RU,30,15,[t]))}function Xke(e,t,n){return CV(e,t,n,j(t,103)&&(P(t,19).Bb&sW)!=0)}function Xk(e,t,n){return yV(e,t,n,j(t,103)&&(P(t,19).Bb&sW)!=0)}function Zke(e,t,n){return t6e(e,t,n,j(t,103)&&(P(t,19).Bb&sW)!=0)}function Qke(e,t){return e==(Zz(),ZZ)&&t==ZZ?4:e==ZZ||t==ZZ?8:32}function $ke(e,t){return P(t==null?_b(iE(e.f,null)):m_(e.i,t),290)}function eAe(e,t){for(var n=t;n;)nw(e,n.i,n.j),n=UO(n);return e}function Zk(e){return e.n||(bA(e),e.n=new Ebe(e,z7,e),_O(e)),e.n}function Qk(e,t){n_();var n=P(e,69).tk();return V$e(n,t),n.vl(t)}function $k(e){return UC(e.a<e.c.a.length),e.b=e.a,WPe(e),e.c.b[e.b]}function tAe(e){e.b!=e.c&&(e.a=V(RY,PH,1,8,5,1),e.b=0,e.c=0)}function nAe(e,t){var n=e.q.getHours();e.q.setFullYear(t+LU),SV(e,n)}function rAe(e,t){NP();var n=e.j.g-t.j.g;return n==0?0:n}function iAe(e,t,n){if(n){var r=n.me();e.a[t]=r(n)}else delete e.a[t]}function eA(e,t,n){n=n?n.me()(n):void 0,e.a[t]=n}function aAe(e){if(e<0)throw E(new rce(`Negative array size: `+e))}function oAe(e){j(e,206)&&!sm(hw(e.mf((vH(),$6))))&&ant(P(e,26))}function tA(e){return e.c&&e.d?LDe(e.c)+`->`+LDe(e.d):`e_`+TC(e)}function sAe(e,t){var n;return n=t==null?_b(iE(e.f,t)):DO(e,t),Db(n)}function cAe(e,t){var n;return n=t==null?_b(iE(e.f,t)):DO(e,t),Db(n)}function lAe(e,t){var n;for(n=0;n<t;++n)iD(e,n,new $l(P(e[n],45)))}function uAe(e,t){return vg(),XA(R(e.a),t)}function dAe(e,t){return vg(),XA(R(e.a),t)}function nA(e,t){bH(),Yd.call(this,e),this.a=t,this.c=-1,this.b=-1}function rA(e,t,n,r){JDe.call(this,1,n,r),this.c=e,this.b=t}function fAe(e,t,n,r){YDe.call(this,1,n,r),this.c=e,this.b=t}function pAe(e,t,n,r,i,a,o){JM.call(this,t,r,i,a,o),this.c=e,this.a=n}function iA(e,t,n){this.e=e,this.a=RY,this.b=h9e(t),this.c=t,this.d=n}function mAe(e){this.e=e,this.c=this.e.a,this.b=this.e.g,this.d=this.e.i}function hAe(e){this.d=e,this.b=this.d.a.entries(),this.a=this.b.next()}function gAe(e){this.c=e,this.a=P(aR(e),159),this.b=this.a.hk().ti()}function aA(){Qd.call(this),lpe(this),this.d.b=this.d,this.d.a=this.d}function oA(e,t,n,r){var i=new me;i.c=t,i.b=n,i.a=r,r.b=n.a=i,++e.b}function sA(e,t){var n;return t.b.Kb(cPe(e,t.c.Ve(),(n=new iae(t),n)))}function _Ae(e,t){var n;return aAe(t),n=e.slice(0,t),n.length=t,lj(n,e)}function cA(e){var t;return e?new Pye(e):(t=new ax,ALe(t,e),t)}function vAe(e,t){var n;for(n=e.d-1;n>=0&&e.a[n]===t[n];n--);return n<0}function yAe(e,t){var n,r=!1;do n=Jze(e,t),r|=n;while(n);return r}function lA(){lA=C,V4=new Lv(`UPPER`,0),B4=new Lv(`LOWER`,1)}function uA(){uA=C,c0=new xv(BG,0),s0=new xv(`ALTERNATING`,1)}function dA(){dA=C,lzt=new wye,fzt=new lxe,uzt=new Qwe,dzt=new uxe}function bAe(){bAe=C,twt=cF((GA(),U(O(ewt,1),Z,422,0,[$Ct,l$])))}function xAe(){xAe=C,mwt=cF((qj(),U(O(pwt,1),Z,419,0,[S$,fwt])))}function SAe(){SAe=C,xwt=cF((_j(),U(O(bwt,1),Z,476,0,[ywt,M$])))}function CAe(){CAe=C,Uwt=cF((Fk(),U(O(Hwt,1),Z,420,0,[r1,Vwt])))}function wAe(){wAe=C,oTt=cF((uA(),U(O(aTt,1),Z,423,0,[c0,s0])))}function TAe(){TAe=C,Bkt=cF((Tj(),U(O(zkt,1),Z,421,0,[b4,x4])))}function EAe(){EAe=C,jAt=cF((lA(),U(O(AAt,1),Z,518,0,[V4,B4])))}function DAe(){DAe=C,HAt=cF((PO(),U(O(VAt,1),Z,508,0,[K4,q4])))}function OAe(){OAe=C,BAt=cF((NO(),U(O(zAt,1),Z,509,0,[G4,W4])))}function kAe(){kAe=C,ijt=cF((UA(),U(O(rjt,1),Z,515,0,[Z4,X4])))}function AAe(){AAe=C,djt=cF((FO(),U(O(ujt,1),Z,454,0,[Q4,$4])))}function jAe(){jAe=C,OMt=cF((Pk(),U(O(DMt,1),Z,425,0,[EMt,TMt])))}function MAe(){MAe=C,PMt=cF((sN(),U(O(NMt,1),Z,487,0,[P3,F3])))}function NAe(){NAe=C,GMt=cF((gj(),U(O(WMt,1),Z,426,0,[HMt,UMt])))}function PAe(){PAe=C,qPt=cF((_A(),U(O(KPt,1),Z,478,0,[WPt,GPt])))}function FAe(){FAe=C,_Ft=cF((WA(),U(O(gFt,1),Z,428,0,[hFt,c6])))}function IAe(){IAe=C,cIt=cF((iP(),U(O(sIt,1),Z,427,0,[d6,oIt])))}function LAe(){LAe=C,_xt=cF((Kj(),U(O(gxt,1),Z,424,0,[uZ,dZ])))}function RAe(){RAe=C,VSt=cF((oN(),U(O(BSt,1),Z,502,0,[nQ,tQ])))}function fA(e){lQe(),OS(this,tE(hk(_E(e,24),CW)),tE(hk(e,CW)))}function zAe(e){return(e.k==(Zz(),ZZ)||e.k==qZ)&&QC(e,(Y(),d1))}function BAe(e,t,n){return P(t==null?gz(e.f,null,n):oI(e.i,t,n),290)}function VAe(){return KF(),U(O(C8,1),Z,86,0,[x8,b8,y8,v8,S8])}function HAe(){return rH(),U(O(P5,1),HG,64,0,[M5,m5,p5,j5,N5])}function UAe(e){return xm(),function(){return MOe(e,this,arguments)}}function WAe(e,t){var n=t.jd();return new $h(n,e.e.pc(n,P(t.kd(),18)))}function GAe(e,t){var n=t.jd(),r=e.De(n);return!!r&&OD(r.e,t.kd())}function pA(e,t){var n,r;for(yD(t),r=e.Jc();r.Ob();)n=r.Pb(),t.Ad(n)}function mA(e,t,n){var r=(dk(t,e.c.length),e.c[t]);return e.c[t]=n,r}function KAe(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function qAe(e,t){for(var n=t;n;)nw(e,-n.i,-n.j),n=UO(n);return e}function JAe(e,t){return e.a.get(t)??V(RY,PH,1,0,5,1)}function hA(e,t){return(hI(e),Vh(new JT(e,new bNe(t,e.a)))).zd(BX)}function YAe(){return BR(),U(O(cSt,1),Z,363,0,[TZ,EZ,DZ,OZ,kZ])}function XAe(e){Bct(),nse(this),this.a=new gg,RBe(this,e),MT(this.a,e)}function ZAe(){Rx(this),this.b=new k(rW,rW),this.a=new k(iW,iW)}function QAe(e){gA(),!LX&&(this.c=e,this.e=!0,this.a=new Zd)}function gA(){gA=C,LX=!0,sbt=!1,cbt=!1,ubt=!1,lbt=!1}function _A(){_A=C,WPt=new my(udt,0),GPt=new my(`TARGET_WIDTH`,1)}function $Ae(){return ER(),U(O(BMt,1),Z,364,0,[RMt,FMt,zMt,IMt,LMt])}function eje(){return wR(),U(O(UCt,1),Z,371,0,[zQ,VQ,HQ,BQ,RQ])}function tje(){return xL(),U(O(Okt,1),Z,328,0,[Dkt,c4,l4,s4,u4])}function nje(){return SI(),U(O(rTt,1),Z,165,0,[o0,n0,r0,i0,a0])}function rje(){return cB(),U(O(aFt,1),Z,369,0,[t6,e6,r6,n6,i6])}function ije(){return QR(),U(O(CFt,1),Z,330,0,[vFt,yFt,SFt,bFt,xFt])}function aje(){return fL(),U(O(_6,1),Z,160,0,[h6,m6,f6,g6,p6])}function oje(){return pL(),U(O($8,1),Z,257,0,[Z8,Q8,BRt,X8,VRt])}function sje(e,t){return P(Rj(e.d,t),21)||P(Rj(e.e,t),21)}function cje(e){this.b=e,zS.call(this,e),this.a=P(BN(this.b.a,4),129)}function lje(e){this.b=e,xC.call(this,e),this.a=P(BN(this.b.a,4),129)}function uje(e,t){this.c=0,this.b=t,Pb.call(this,e,17493),this.a=this.c}function vA(e,t,n,r,i){Bje.call(this,t,r,i),this.c=e,this.b=n}function dje(e,t,n,r,i){JDe.call(this,t,r,i),this.c=e,this.a=n}function fje(e,t,n,r,i){YDe.call(this,t,r,i),this.c=e,this.a=n}function pje(e,t,n,r,i){Bje.call(this,t,r,i),this.c=e,this.a=n}function mje(e,t,n){e.a.c.length=0,Uit(e,t,n),e.a.c.length==0||Fet(e,t)}function yA(e){e.i=0,p_(e.b,null),p_(e.c,null),e.a=null,e.e=null,++e.g}function hje(e){return e.e=3,e.d=e.Yb(),e.e==2?!1:(e.e=0,!0)}function gje(e,t){return j(t,144)?$w(e.c,P(t,144).c):!1}function _je(e){var t;return e.c||(t=e.r,j(t,88)&&(e.c=P(t,29))),e.c}function bA(e){return e.t||(e.t=new zd(e),LF(new tce(e),0,e.t)),e.t}function xA(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function SA(e,t){return t==0||e.e==0?e:t>0?KWe(e,t):C5e(e,-t)}function vje(e,t){return t==0||e.e==0?e:t>0?C5e(e,t):KWe(e,-t)}function CA(e){if(Vz(e))return e.c=e.a,e.a.Pb();throw E(new Cf)}function yje(e){var t=e.length;return $w(oW.substr(oW.length-t,t),e)}function bje(e){var t=e.c.i,n=e.d.i;return t.k==(Zz(),qZ)&&n.k==qZ}function xje(e){return eS(e&JU,e>>22&JU,e<0?YU:0)}function Sje(e,t){var n=P(QVe(e.c,t),18),r;n&&(r=n.gc(),n.$b(),e.d-=r)}function Cje(e){e&&UPe((Hp(),iyt)),--QY,e&&$Y!=-1&&(Kv($Y),$Y=-1)}function wje(e){pue.call(this,e==null?FH:OI(e),j(e,80)?P(e,80):null)}function Tje(e){var t=new fO;return qN(t,e),W(t,(hH(),J0),null),t}function Eje(e,t,n){var r;return r=e.Fh(t),r>=0?e.Ih(r,n,!0):jz(e,t,n)}function Dje(e,t,n){return BF(DS(dL(e),sS(t.b)),DS(dL(e),sS(n.b)))}function Oje(e,t,n){return BF(DS(dL(e),sS(t.e)),DS(dL(e),sS(n.e)))}function kje(e,t){return r.Math.min(QA(t.a,e.d.d.c),QA(t.b,e.d.d.c))}function Aje(e,t,n){var r=new bS(e.a);wN(r,e.a.a),gz(r.f,t,n),e.a.a=r}function jje(e,t,n,r){var i;for(i=0;i<JX;i++)sE(e.a[i][t.g],n,r[t.g])}function Mje(e,t,n,r){var i;for(i=0;i<qX;i++)cE(e.a[t.g][i],n,r[t.g])}function wA(e,t){var n=P(e.c.xc(t),18);return!n&&(n=e.ic(t)),e.pc(t,n)}function Nje(e){var t=(nD(e),e?new sT(e):bT(e.Jc()));return mz(t),cI(t)}function TA(e){var t,n;return nD(e),t=rCe(e.length),n=new VA(t),oBe(n,e),n}function EA(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Mi(n,t),e.Li()}function DA(e,t){e.Zi(e.i+1),AS(e,e.i,e.Xi(e.i,t)),e.Ki(e.i++,t),e.Li()}function OA(e,t){return bb(t)?t==null?P4e(e.f,null):YRe(e.i,t):P4e(e.f,t)}function kA(e,t){var n=(dk(t,e.c.length),e.c[t]);return Ih(e.c,t,1),n}function AA(e,t,n,r){var i=V(q9,RU,30,t,15,1);return sQe(i,e,t,n,r),i}function jA(e,t){return e.a?Mb(e.a,e.b):e.a=new nC(e.d),Ab(e.a,t),e}function Pje(e,t){if(e<0||e>t)throw E(new Xp(m0e(e,t,`index`)));return e}function Fje(e){var t=e.e+e.f;return isNaN(t)&&oT(e.d)?e.d:t}function Ije(e,t){var n=e.q.getHours()+(t/60|0);e.q.setMinutes(t),SV(e,n)}function Lje(e,t){var n=(yD(e),e),r=(yD(t),t);return n==r?0:n<r?-1:1}function MA(){MA=C;var e,t;m9=(bh(),t=new wf,t),h9=(e=new op,e)}function Rje(){this.g=new Ff,this.b=new Ff,this.a=new Zd,this.k=new Zd}function NA(){this.e=new Zd,this.c=new Zd,this.d=new Zd,this.b=new Zd}function zje(){this.a=new _se,this.b=new wse,this.d=new gt,this.e=new mee}function PA(e){this.c=e,this.a=new T(this.c.a),this.b=new T(this.c.b)}function Bje(e,t,n){this.d=e,this.k=+!!t,this.f=+!!n,this.o=-1,this.p=0}function Vje(e,t,n){this.a=e,this.c=t,this.d=n,M(t.e,this),M(n.b,this)}function Hje(e,t,n){Wd.call(this,n),this.b=e,this.c=t,this.d=(zWe(),KBt)}function Uje(e,t){cde.call(this,t.xd(),t.wd()&-6),yD(e),this.a=e,this.b=t}function Wje(e,t){Pb.call(this,t.xd(),t.wd()&-6),yD(e),this.a=e,this.b=t}function Gje(e,t){Fb.call(this,t.xd(),t.wd()&-6),yD(e),this.a=e,this.b=t}function FA(e,t,n){this.a=e,this.b=t,this.c=n,M(e.t,this),M(t.i,this)}function IA(){this.b=new gg,this.a=new gg,this.b=new gg,this.a=new gg}function Kje(e,t){var n=pat(e,t);return e.b=new fN(n.c.length),vit(e,n)}function qje(e,t,n){var r;return++e.e,--e.f,r=P(e.d[t].ed(n),136),r.kd()}function Jje(e){var t;return e.a||(t=e.r,j(t,159)&&(e.a=P(t,159))),e.a}function Yje(e){if(e.a){if(e.e)return Yje(e.e)}else return e;return null}function Xje(e,t){return e.p<t.p?1:e.p>t.p?-1:0}function Zje(e,t){return PE(e.a,t)?(OA(e.a,t),!0):!1}function Qje(e){var t=e.jd();return _T(P(e.kd(),18).Lc(),new Ic(t))}function LA(e){var t=e.b;return t.b==0?null:P(wL(t,0),65).b}function RA(e,t){return yD(t),e.c<e.d?(e.Qe(t,e.c++),!0):!1}function zA(e,t,n){return kk(t,e.e.Pd().gc()),kk(n,e.c.Pd().gc()),e.a[t][n]}function $je(e){var t;return hI(e),t=new Sve(e,e.a.e,e.a.d|4),new Ow(e,t)}function eMe(e){var t;for(fD(e),t=0;e.a.zd(new je);)t=lI(t,1);return t}function tMe(e,t,n){var r=0,i;for(i=0;i<t.length;i++)r+=e.sg(t[i],r,n)}function BA(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function VA(e){Rx(this),ST(e>=0,`Initial capacity must not be negative`)}function HA(){HA=C,T6=new Rd(`org.eclipse.elk.labels.labelManager`)}function nMe(){nMe=C,ECt=new Aw(`separateLayerConnections`,(_P(),NQ))}function UA(){UA=C,Z4=new qv(`REGULAR`,0),X4=new qv(`CRITICAL`,1)}function WA(){WA=C,hFt=new yy(`FIXED`,0),c6=new yy(`CENTER_NODE`,1)}function GA(){GA=C,$Ct=new rv(`QUADRATIC`,0),l$=new rv(`SCANLINE`,1)}function rMe(){rMe=C,cwt=cF((VM(),U(O(swt,1),Z,350,0,[owt,p$,f$])))}function iMe(){iMe=C,gwt=cF((bP(),U(O(hwt,1),Z,449,0,[w$,C$,T$])))}function aMe(){aMe=C,Iwt=cF((eP(),U(O(X$,1),Z,302,0,[J$,Y$,q$])))}function oMe(){oMe=C,Rwt=cF((yP(),U(O($$,1),Z,329,0,[Q$,Lwt,Z$])))}function sMe(){sMe=C,Bwt=cF((Fj(),U(O(zwt,1),Z,315,0,[t1,n1,e1])))}function cMe(){cMe=C,YCt=cF((cN(),U(O(KQ,1),Z,368,0,[GQ,WQ,UQ])))}function lMe(){lMe=C,Tkt=cF((fF(),U(O(wkt,1),Z,352,0,[e4,Ckt,t4])))}function uMe(){uMe=C,Hkt=cF((BM(),U(O(Vkt,1),Z,452,0,[w4,S4,C4])))}function dMe(){dMe=C,Kkt=cF((tP(),U(O(Gkt,1),Z,381,0,[Ukt,T4,Wkt])))}function fMe(){fMe=C,Jkt=cF((ZP(),U(O(qkt,1),Z,348,0,[O4,E4,D4])))}function pMe(){pMe=C,Zkt=cF((pF(),U(O(Xkt,1),Z,349,0,[k4,Ykt,A4])))}function mMe(){mMe=C,tAt=cF((zM(),U(O(eAt,1),Z,351,0,[$kt,j4,Qkt])))}function hMe(){hMe=C,rAt=cF((nP(),U(O(nAt,1),Z,382,0,[N4,P4,M4])))}function gMe(){gMe=C,kjt=cF((YP(),U(O(Ojt,1),Z,385,0,[Djt,s3,o3])))}function _Me(){_Me=C,YMt=cF((XP(),U(O(JMt,1),Z,386,0,[I3,KMt,qMt])))}function vMe(){vMe=C,zNt=cF(($N(),U(O(RNt,1),Z,303,0,[INt,LNt,FNt])))}function yMe(){yMe=C,HNt=cF((qI(),U(O(VNt,1),Z,436,0,[B3,V3,BNt])))}function bMe(){bMe=C,QPt=cF((vj(),U(O(ZPt,1),Z,429,0,[JPt,XPt,YPt])))}function xMe(){xMe=C,rFt=cF((VF(),U(O(nFt,1),Z,430,0,[$Pt,tFt,eFt])))}function SMe(){SMe=C,cFt=cF((HF(),U(O(sFt,1),Z,435,0,[a6,o6,s6])))}function CMe(){CMe=C,rPt=cF((wI(),U(O(nPt,1),Z,387,0,[ePt,tPt,$Nt])))}function wMe(){wMe=C,iSt=cF((wj(),U(O(rSt,1),Z,384,0,[CZ,SZ,wZ])))}function TMe(){TMe=C,pbt=cF((QP(),U(O(zX,1),Z,130,0,[dbt,RX,fbt])))}function EMe(){EMe=C,Tbt=cF((lM(),U(O(KX,1),Z,237,0,[UX,WX,GX])))}function DMe(){DMe=C,Dbt=cF((pj(),U(O(Ebt,1),Z,461,0,[XX,YX,ZX])))}function OMe(){OMe=C,Abt=cF((Pj(),U(O(kbt,1),Z,462,0,[eZ,$X,QX])))}function kMe(){kMe=C,gRt=cF((uM(),U(O(hRt,1),Z,279,0,[E8,D8,O8])))}function AMe(){AMe=C,czt=cF((UF(),U(O(szt,1),Z,281,0,[ozt,Y5,X5])))}function jMe(){jMe=C,FRt=cF(($P(),U(O(PRt,1),Z,347,0,[P8,N8,F8])))}function MMe(){MMe=C,tzt=cF((_M(),U(O(ezt,1),Z,300,0,[F5,QRt,$Rt])))}function KA(e,t){return!e.o&&(e.o=new ij((uH(),d7),g7,e,0)),EWe(e.o,t)}function NMe(e){return!e.g&&(e.g=new jo),!e.g.d&&(e.g.d=new Loe(e)),e.g.d}function PMe(e){return!e.g&&(e.g=new jo),!e.g.b&&(e.g.b=new Ioe(e)),e.g.b}function qA(e){return!e.g&&(e.g=new jo),!e.g.c&&(e.g.c=new zoe(e)),e.g.c}function FMe(e){return!e.g&&(e.g=new jo),!e.g.a&&(e.g.a=new Roe(e)),e.g.a}function IMe(e,t,n,r){return n&&(r=n.Oh(t,NI(n.Ah(),e.c.sk()),null,r)),r}function LMe(e,t,n,r){return n&&(r=n.Qh(t,NI(n.Ah(),e.c.sk()),null,r)),r}function JA(e,t,n,r){var i=V(q9,RU,30,t+1,15,1);return Jtt(i,e,t,n,r),i}function V(e,t,n,r,i,a){var o=_Je(i,r);return i!=10&&U(O(e,a),t,n,i,o),o}function RMe(e,t,n){var r,i=new YN(t,e);for(r=0;r<n;++r)DL(i);return i}function zMe(e,t,n){var r,i;if(n!=null)for(r=0;r<t;++r)i=n[r],e.Oi(r,i)}function BMe(e,t){var n;e.C&&(n=P(AD(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function VMe(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function HMe(e,t){var n=new ve;return n.c=!0,n.d=t.kd(),Zat(e,t.jd(),n)}function UMe(e,t){var n=e.q.getHours()+(t/3600|0);e.q.setSeconds(t),SV(e,n)}function WMe(e,t){var n=t,r=uO(bT(new Aj(e,n)));return HT(new Aj(e,n)),r}function GMe(e,t){t.Tg(`Label management`,1),Db(K(e,(HA(),T6))),t.Ug()}function KMe(e,t,n){P(e.b,68),P(e.b,68),P(e.b,68),oM(e.a,new s_e(n,t,e))}function qMe(e,t,n,r){Ftt(e,t,n,CV(e,t,r,j(t,103)&&(P(t,19).Bb&sW)!=0))}function YA(e,t,n){if(e<0||t>n||t<e)throw E(new Em(kW+e+Ylt+t+Hlt+n))}function JMe(e,t,n){this.d=new Zf,this.c=new Qd,this.a=e,this.e=t,this.c=n}function YMe(e){e?(this.c=e,this.b=null):(this.c=null,this.b=new Zd)}function XMe(e,t){v_.call(this,e,t),this.a=V(nbt,rU,438,2,0,1),this.b=!0}function ZMe(e){gBe.call(this,e,0),lpe(this),this.d.b=this.d,this.d.a=this.d}function QMe(e){this.e=e,this.b=this.e.a.entries(),this.a=V(RY,PH,1,0,5,1)}function $Me(){$Me=C,cAt=oE(RT(new xD,(BR(),TZ),(yH(),lQ)),kZ,wQ)}function eNe(){return uz(),U(O(c$,1),Z,231,0,[i$,o$,r$,a$,s$,n$])}function tNe(){return YR(),U(O(_wt,1),Z,284,0,[D$,E$,k$,O$,j$,A$])}function nNe(){return mR(),U(O(Ewt,1),Z,282,0,[P$,Cwt,Twt,Swt,wwt,N$])}function rNe(){return KR(),U(O(Nwt,1),Z,283,0,[F$,kwt,Mwt,jwt,Awt,Owt])}function iNe(){return kL(),U(O(DIt,1),Z,256,0,[EIt,k6,A6,j6,D6,O6])}function aNe(){return xR(),U(O(UIt,1),Z,299,0,[HIt,F6,P6,VIt,M6,N6])}function oNe(){return Sz(),U(O(f5,1),Z,280,0,[u5,c5,l5,s5,o5,d5])}function sNe(){return TR(),U(O(URt,1),Z,102,0,[a5,i5,r5,e5,n5,t5])}function cNe(){return RR(),U(O(ERt,1),Z,327,0,[wRt,SRt,TRt,bRt,CRt,xRt])}function lNe(e){var t;return!e.a&&e.b!=-1&&(t=e.c.Ah(),e.a=$j(t,e.b)),e.a}function XA(e,t){return e.Qi()&&e.Gc(t)?!1:(e.Fi(t),!0)}function ZA(e,t){return gO(t,`Horizontal alignment cannot be null`),e.b=t,e}function uNe(e,t,n){bH();var r=oH(e,t);return n&&r&&LSe(e)&&(r=null),r}function dNe(e,t,n){var r=e.b[n.c.p][n.p];r.b+=t.b,r.c+=t.c,r.a+=t.a,++r.a}function fNe(e,t,n){var i;e.d[t.g]=n,i=e.g.c,i[t.g]=r.Math.max(i[t.g],n+1)}function QA(e,t){var n=e.a-t.a,i=e.b-t.b;return r.Math.sqrt(n*n+i*i)}function pNe(e,t){var n,r;for(r=t.Jc();r.Ob();)n=P(r.Pb(),37),tet(e,n,0,0)}function $A(e,t,n){var r,i;for(i=e.Jc();i.Ob();)r=P(i.Pb(),37),WB(r,t,n)}function mNe(e){var t,n;for(n=mL(e.a,0);n.b!=n.d.c;)t=P(Uk(n),65),p2e(t)}function hNe(e,t){var n=sD(e.k,t);return S8e(e,t),XB(e,t),R3e(e,t,n),null}function ej(e,t){var n;return n=e.Fh(t),n>=0?e.Ih(n,!0,!0):jz(e,t,!0)}function tj(e,t){var n,r,i=e.r;return r=e.d,n=OV(e,t,!0),n.b!=i||n.a!=r}function gNe(e,t){return mue(e.e,t)||uL(e.e,t,new mKe(t)),P(Rj(e.e,t),113)}function nj(e,t,n,r){return yD(e),yD(t),yD(n),yD(r),new kxe(e,t,new Te)}function rj(e,t,n){var r,i=(r=Jz(e.b,t),r);return i?IV(Oj(e,i),n):null}function _Ne(e,t,n){var r=RO(e,n),i=null,a;r&&(i=A1e(r)),a=i,iKe(t,n,a)}function vNe(e,t,n){var r=RO(e,n),i=null,a;r&&(i=A1e(r)),a=i,iKe(t,n,a)}function ij(e,t,n,r){this.$j(),this.a=t,this.b=e,this.c=new mxe(this,t,n,r)}function aj(e,t,n,r,i,a){qOe.call(this,t,r,i,a),this.c=e,this.b=n}function oj(e,t,n,r,i,a){qOe.call(this,t,r,i,a),this.c=e,this.a=n}function yNe(e,t,n,r,i){nfe(this),this.b=e,this.d=t,this.f=n,this.g=r,this.c=i}function bNe(e,t){Fb.call(this,t.xd(),t.wd()&-16449),yD(e),this.a=e,this.c=t}function xNe(e,t){e.a.Le(t.d,e.b)>0&&(M(e.c,new wve(t.c,t.d,e.d)),e.b=t.d)}function sj(e){e.a=V(q9,RU,30,e.b+1,15,1),e.c=V(q9,RU,30,e.b,15,1),e.d=0}function SNe(e,t,n){var r=uBe(e,t,n);return e.b=new fN(r.c.length),X5e(e,r)}function CNe(e){if(e.b<=0)throw E(new Cf);return--e.b,e.a-=e.c.c,G(e.a)}function wNe(e){var t;if(!e.a)throw E(new Swe);return t=e.a,e.a=UO(e.a),t}function TNe(e){var t;if(e.ll())for(t=e.i-1;t>=0;--t)H(e,t);return jke(e)}function cj(e){var t;return nD(e),j(e,204)?(t=P(e,204),t):new gie(e)}function ENe(e){for(;!e.a;)if(!fhe(e.c,new uu(e)))return!1;return!0}function DNe(e,t){if(e.g==null||t>=e.i)throw E(new nx(t,e.i));return e.g[t]}function ONe(e,t,n){if(RP(e,n),n!=null&&!e.dk(n))throw E(new gf);return n}function lj(e,t){return Uj(t)!=10&&U(VP(t),t.Qm,t.__elementTypeId$,Uj(t),e),e}function kNe(e,t){var n,r=t/e.c.Pd().gc()|0;return n=t%e.c.Pd().gc(),zA(e,r,n)}function uj(e,t,n,r){var i;r=($D(),r||zyt),i=e.slice(t,n),h0e(i,e,t,n,-t,r)}function dj(e,t,n,r,i){return t<0?jz(e,n,r):P(n,69).uk().wk(e,e.ei(),t,r,i)}function ANe(e,t){return BF(D(N(K(e,(Y(),R1)))),D(N(K(t,R1))))}function jNe(){jNe=C,rbt=cF((fj(),U(O(FX,1),Z,309,0,[jX,MX,NX,PX])))}function fj(){fj=C,jX=new w_(`All`,0),MX=new jx,NX=new tfe,PX=new Ode}function pj(){pj=C,XX=new D_(BW,0),YX=new D_(zW,1),ZX=new D_(VW,2)}function MNe(){MNe=C,DV(),EVt=rW,TVt=iW,OVt=new zl(rW),DVt=new zl(iW)}function mj(){mj=C,mIt=new Va,gIt=new Dne,hIt=Vze((vH(),LLt),mIt,Q6,gIt)}function NNe(e){mj(),P(e.mf((vH(),i8)),182).Ec((Sz(),l5)),e.of(LLt,null)}function PNe(e){return j(e,180)?``+P(e,180).a:e==null?null:OI(e)}function FNe(e){return j(e,180)?``+P(e,180).a:e==null?null:OI(e)}function INe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function LNe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function hj(e){var t;for(t=e.p+1;t<e.c.a.c.length;++t)--P(qT(e.c.a,t),9).p}function RNe(){RNe=C,OCt=cF((_P(),U(O(DCt,1),Z,367,0,[NQ,jQ,MQ,AQ])))}function zNe(){zNe=C,wSt=cF((aL(),U(O(CSt,1),Z,383,0,[HZ,SSt,BZ,VZ])))}function BNe(){BNe=C,nxt=cF((QN(),U(O(txt,1),Z,409,0,[oZ,rZ,iZ,aZ])))}function VNe(){VNe=C,hSt=cF((vP(),U(O(mSt,1),Z,408,0,[FZ,RZ,IZ,LZ])))}function HNe(){HNe=C,wAt=cF((dF(),U(O(CAt,1),Z,404,0,[F4,L4,R4,I4])))}function UNe(){UNe=C,Ekt=cF((OL(),U(O(o4,1),Z,203,0,[i4,a4,r4,n4])))}function WNe(){WNe=C,Rkt=cF((JI(),U(O(Lkt,1),Z,269,0,[_4,Ikt,v4,y4])))}function GNe(){GNe=C,HCt=cF((rP(),U(O(VCt,1),Z,413,0,[PQ,FQ,IQ,LQ])))}function KNe(){KNe=C,wMt=cF((JP(),U(O(CMt,1),Z,353,0,[SMt,M3,xMt,bMt])))}function qNe(){qNe=C,awt=cF((CI(),U(O(iwt,1),Z,301,0,[d$,nwt,u$,rwt])))}function JNe(){JNe=C,JNt=cF((LR(),U(O(qNt,1),Z,401,0,[KNt,UNt,GNt,WNt])))}function YNe(){YNe=C,PNt=cF((VL(),U(O(NNt,1),Z,354,0,[MNt,ANt,jNt,kNt])))}function XNe(){XNe=C,pjt=cF((QL(),U(O(fjt,1),Z,398,0,[e3,t3,n3,r3])))}function ZNe(){ZNe=C,mRt=cF((WF(),U(O(pRt,1),Z,278,0,[T8,w8,dRt,fRt])))}function QNe(){QNe=C,yRt=cF((GF(),U(O(vRt,1),Z,222,0,[_Rt,A8,k8,j8])))}function $Ne(){$Ne=C,RRt=cF(($L(),U(O(LRt,1),Z,292,0,[z8,I8,L8,R8])))}function ePe(){ePe=C,pzt=cF((dA(),U(O(Z5,1),Z,288,0,[lzt,fzt,uzt,dzt])))}function tPe(){tPe=C,nzt=cF((YI(),U(O(B5,1),Z,380,0,[R5,z5,L5,I5])))}function nPe(){nPe=C,yzt=cF((TI(),U(O(vzt,1),Z,326,0,[_zt,mzt,gzt,hzt])))}function rPe(){rPe=C,Ezt=cF((qP(),U(O(Tzt,1),Z,407,0,[Szt,Czt,xzt,wzt])))}function gj(){gj=C,HMt=new sy(`LEAF_NUMBER`,0),UMt=new sy(`NODE_SIZE`,1)}function _j(){_j=C,ywt=new mv(BG,0),M$=new mv(`IMPROVE_STRAIGHTNESS`,1)}function vj(){vj=C,JPt=new hy(fmt,0),XPt=new hy(Ppt,1),YPt=new hy(BG,2)}function iPe(e,t){if(t.a)throw E(new Ap(eut));RE(e.a,t),t.a=e,!e.j&&(e.j=t)}function aPe(e){var t;if(!tN(e))throw E(new Cf);return e.e=1,t=e.d,e.d=null,t}function yj(e){var t;return qb(e)&&(t=0-e,!isNaN(t))?t:LN(EP(e))}function oPe(e,t){var n=P(OA(e.e,t),393);return n?(tye(n),n.e):null}function bj(e,t){var n=xj(e,t,0);return n==-1?!1:(kA(e,n),!0)}function sPe(e){var t;return fD(e),t=V(Z9,lW,30,0,15,1),Ph(e.a,new tae(t)),t}function cPe(e,t,n){var r;return fD(e),r=new ke,r.a=t,e.a.Nb(new gue(r,n)),r.a}function xj(e,t,n){for(;n<e.c.length;++n)if(OD(t,e.c[n]))return n;return-1}function lPe(e,t,n,r,i){return yD(e),yD(t),yD(n),yD(r),yD(i),new kxe(e,t,r)}function uPe(e,t){Rg();var n=Kk(e),r=Kk(t);return!!n&&!!r&&!FKe(n.k,r.k)}function dPe(e,t){return pT(),M(e,new Gy(t,G(t.e.c.length+t.g.c.length)))}function fPe(e,t){return pT(),M(e,new Gy(t,G(t.e.c.length+t.g.c.length)))}function pPe(e,t){return new cve(t,nw(sS(t.e),t.f.a+e,t.f.b+e),(XS(),!1))}function Sj(e,t){return OD(t,qT(e.f,0))||OD(t,qT(e.f,1))||OD(t,qT(e.f,2))}function Cj(e,t){if(t<0)throw E(new Xp(vht+t));return Pke(e,t+1),qT(e.j,t)}function wj(){wj=C,CZ=new F_(`XY`,0),SZ=new F_(`X`,1),wZ=new F_(`Y`,2)}function Tj(){Tj=C,b4=new Ov(`INPUT_ORDER`,0),x4=new Ov(`PORT_DEGREE`,1)}function Ej(e){return e.b||(e.b=new Dbe(e,z7,e),!e.a&&(e.a=new Nw(e,e))),e.b}function Dj(e,t){var n=P(t,682),r=n.Yk();return!r&&n.al(r=new oOe(e,t)),r}function Oj(e,t){var n=P(t,680),r=n.ui();return!r&&n.xi(r=new ede(e,t)),r}function kj(e){return P(K(P(qT(e.j,0),12),(Y(),P1)),12)}function Aj(e,t){var n;this.f=e,this.b=t,n=P(sD(e.b,t),262),this.c=n?n.b:null}function mPe(){fT(),this.b=new Qd,this.f=new Qd,this.g=new Qd,this.e=new Qd}function jj(e){iS(this),this.g=e?yO(e,e.ge()):null,this.f=e,nO(this),this.he()}function hPe(e){var t=e.hj();t!=null&&e.d!=-1&&P(t,94).uh(e),e.i&&e.i.mj()}function Mj(e){var t,n=e.length;return t=V(K9,CU,30,n,15,1),Fxe(e,0,n,t,0),t}function Nj(e){Aye();var t=e+128,n=hyt[t];return!n&&(n=hyt[t]=new Jie(e)),n}function gPe(e){return khe(e.d.a.e.g,e.b),UC(e.c!=e.d.a.d),e.a=e.c,e.c=e.c.a,e.a}function _Pe(e){WC(!!e.c),khe(e.f.g,e.d),e.c.Qb(),e.c=null,e.b=gze(e),e.d=e.f.g}function vPe(e,t){ixt=new Ze,rxt=t,sZ=e,P(sZ.b,68),KMe(sZ,ixt,null),dit(sZ)}function Pj(){Pj=C,eZ=new O_(`TOP`,0),$X=new O_(zW,1),QX=new O_(gut,2)}function Fj(){Fj=C,t1=new vv(BG,0),n1=new vv(`TOP`,1),e1=new vv(gut,2)}function Ij(){Ij=C,uyt=eS(JU,JU,524287),dyt=eS(0,0,XU),fyt=xje(1),xje(2),pyt=xje(0)}function yPe(e){var t;return e.Lh()||(t=QE(e.Ah())-e.gi(),e.Xh().Kk(t)),e.wh()}function bPe(e){var t=hM(BN(e,32));return t??=(tL(e),hM(BN(e,32))),t}function xPe(e,t){var n=NI(e.d,t);return n>=0?EL(e,n,!0,!0):jz(e,t,!0)}function SPe(e,t){nT(P(P(e.f,26).mf((vH(),r8)),102))&&LUe(wCe(P(e.f,26)),t)}function CPe(e,t){wM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function wPe(e,t){TM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function TPe(e,t){CM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function EPe(e,t){vM(e,t==null||oT((yD(t),t))||isNaN((yD(t),t))?0:(yD(t),t))}function DPe(e){(this.q?this.q:(QD(),QD(),EX)).zc(e.q?e.q:(QD(),QD(),EX))}function OPe(e,t,n){var r=e.g[t];return AS(e,t,e.Xi(t,n)),e.Pi(t,n,r),e.Li(),r}function Lj(e,t){var n=e.bd(t);return n>=0?(e.ed(n),!0):!1}function kPe(e){var t;return e.d!=e.r&&(t=aR(e),e.e=!!t&&t.jk()==B_t,e.d=t),e.e}function APe(e,t){var n;for(nD(e),nD(t),n=!1;t.Ob();)n|=e.Ec(t.Pb());return n}function Rj(e,t){var n=P(sD(e.e,t),393);return n?(hfe(e,n),n.e):null}function jPe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function zj(e,t){var n,r;return hI(e),r=new Gje(t,e.a),n=new Qme(r),new JT(e,n)}function Bj(e,t){var n=e.a[t],r=(SP(),nX)[typeof n];return r?r(n):wHe(typeof n)}function MPe(e,t){var n,r,i=t.c.i;n=P(sD(e.f,i),60),r=n.d.c-n.e.c,ULe(t.a,r,0)}function Vj(e,t,n){var r=10,i;for(i=0;i<n-1;i++)t<r&&(e.a+=`0`),r*=10;e.a+=t}function NPe(e,t){var n;for(++e.d,++e.c[t],n=t+1;n<e.a.length;)++e.a[n],n+=n&-n}function Hj(e){var t=e.b.c.length==0?null:qT(e.b,0);return t!=null&&iN(e,0),t}function PPe(e){switch(e.g){case 0:return kH;case 1:return vU;default:return 0}}function FPe(e){return YYe(e,(Ij(),pyt))<0?-Vfe(EP(e)):e.l+e.m*ZU+e.h*QU}function Uj(e){return e.__elementTypeCategory$==null?10:e.__elementTypeCategory$}function IPe(e,t){return j(t,103)&&(P(t,19).Bb&sW)!=0?new ix(t,e):new YN(t,e)}function LPe(e,t){return j(t,103)&&(P(t,19).Bb&sW)!=0?new ix(t,e):new YN(t,e)}function RPe(e,t,n){return DS(new k(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)==(yD(t),t)}function zPe(e,t,n,r){if(!e)throw E(new $p(VB(t,U(O(RY,1),PH,1,5,[n,r]))))}function BPe(e){if(!e.e)throw E(new Cf);return e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function VPe(e){if(!e.c)throw E(new Cf);return e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function HPe(e){var t,n;if(e.a){n=null;do t=e.a,e.a=null,n=C1e(t,n);while(e.a);e.a=n}}function UPe(e){var t,n;if(e.b){n=null;do t=e.b,e.b=null,n=C1e(t,n);while(e.b);e.b=n}}function WPe(e){var t;for(++e.a,t=e.c.a.length;e.a<t;++e.a)if(e.c.b[e.a])return}function GPe(e,t){for(var n=0;e.e!=e.i.gc();)Dxe(t,gL(e),G(n)),n!=kH&&++n}function KPe(e,t){for(;t[0]<e.length&&Qb(` \r
14
14
  `,IR(jD(e,t[0])))>=0;)++t[0]}function qPe(e,t,n,r){bH(),Yd.call(this,26),this.c=e,this.a=t,this.d=n,this.b=r}function Wj(e,t,n,r,i,a,o){JM.call(this,t,r,i,a,o),this.c=e,this.b=n}function JPe(e){this.g=e,this.f=new Zd,this.a=r.Math.min(this.g.c.c,this.g.d.c)}function Gj(){Gj=C,vSt=new ut,ySt=new dt,gSt=new pee,_St=new ft,bSt=new pt}function Kj(){Kj=C,uZ=new P_(`EADES`,0),dZ=new P_(`FRUCHTERMAN_REINGOLD`,1)}function qj(){qj=C,S$=new uv(`READING_DIRECTION`,0),fwt=new uv(`ROTATION`,1)}function YPe(){YPe=C,WCt=cF((wR(),U(O(UCt,1),Z,371,0,[zQ,VQ,HQ,BQ,RQ])))}function XPe(){XPe=C,kkt=cF((xL(),U(O(Okt,1),Z,328,0,[Dkt,c4,l4,s4,u4])))}function ZPe(){ZPe=C,iTt=cF((SI(),U(O(rTt,1),Z,165,0,[o0,n0,r0,i0,a0])))}function QPe(){QPe=C,VMt=cF((ER(),U(O(BMt,1),Z,364,0,[RMt,FMt,zMt,IMt,LMt])))}function $Pe(){$Pe=C,oFt=cF((cB(),U(O(aFt,1),Z,369,0,[t6,e6,r6,n6,i6])))}function eFe(){eFe=C,wFt=cF((QR(),U(O(CFt,1),Z,330,0,[vFt,yFt,SFt,bFt,xFt])))}function tFe(){tFe=C,lSt=cF((BR(),U(O(cSt,1),Z,363,0,[TZ,EZ,DZ,OZ,kZ])))}function nFe(){nFe=C,uRt=cF((KF(),U(O(C8,1),Z,86,0,[x8,b8,y8,v8,S8])))}function rFe(){rFe=C,bIt=cF((fL(),U(O(_6,1),Z,160,0,[h6,m6,f6,g6,p6])))}function iFe(){iFe=C,HRt=cF((pL(),U(O($8,1),Z,257,0,[Z8,Q8,BRt,X8,VRt])))}function aFe(){aFe=C,KRt=cF((rH(),U(O(P5,1),HG,64,0,[M5,m5,p5,j5,N5])))}function oFe(e){var t=P(K(e,(Y(),a1)),317);return t?t.a==e:!1}function sFe(e){var t=P(K(e,(Y(),a1)),317);return t?t.i==e:!1}function cFe(e,t){return yD(t),Ybe(e),e.d.Ob()?(t.Ad(e.d.Pb()),!0):!1}function Jj(e){return _F(e,kH)>0?kH:_F(e,vU)<0?vU:tE(e)}function lFe(e,t){var n=EI(e.e.c,t.e.c);return n==0?BF(e.e.d,t.e.d):n}function Yj(e,t){var n=P(sD(e.a,t),150);return n||(n=new et,kD(e.a,t,n)),n}function Xj(e,t,n){var r;if(t==null)throw E(new xf);return r=RO(e,t),iAe(e,t,n),r}function uFe(e,t){var n,r=t.c;for(n=r+1;n<=t.f;n++)e.a[n]>e.a[r]&&(r=n);return r}function dFe(e,t,n){return AO(FT(e.a.e[P(t.a,9).p]-e.a.e[P(n.a,9).p]))}function fFe(e,t,n){var r,i;for(i=new T(n);i.a<i.c.c.length;)r=z(i),IZe(e,t,r)}function pFe(e,t,n){qw.call(this),qFe(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function mFe(e){this.b=new Zd,this.a=new Zd,this.c=new Zd,this.d=new Zd,this.e=e}function hFe(e,t){return t==(Mhe(),Mhe(),Yyt)?e.toLocaleLowerCase():e.toLowerCase()}function gFe(e,t){return dM(),-Qx(P(K(e,(_V(),k3)),15).a,P(K(t,k3),15).a)}function _Fe(){return Zz(),U(O(eQ,1),Z,249,0,[ZZ,YZ,qZ,QZ,JZ,KZ,$Z,XZ])}function vFe(){return oz(),U(O(SIt,1),Z,285,0,[xIt,v6,S6,w6,y6,b6,x6,C6])}function yFe(){return Bz(),U(O(S7,1),Z,244,0,[Jzt,b7,x7,y7,qzt,v7,_7,Kzt])}function bFe(){return IB(),U(O(XCt,1),Z,275,0,[JQ,ZQ,qQ,e$,XQ,YQ,$Q,QQ])}function xFe(e,t){return!!EN(e,t,tE(uI(sU,DD(tE(uI(t==null?0:xN(t),cU)),15))))}function SFe(e){return(e.i&2?`interface `:e.i&1?``:`class `)+(mw(e),e.o)}function Zj(e){var t,n=(t=new cp,t);XA((!e.q&&(e.q=new F(B7,e,11,10)),e.q),n)}function CFe(e,t){var n=t>0?t-1:t;return mh(Ace(cIe(Vve(new gp,n),e.n),e.j),e.k)}function wFe(e,t,n,r){var i;e.j=-1,h4e(e,j1e(e,t,n),(n_(),i=P(t,69).tk(),i.vl(r)))}function TFe(e,t,n,r,i,a){var o=Tje(r);JO(o,i),XO(o,a),kz(e.a,r,new hT(o,t,n.f))}function Qj(e,t){var n;return hI(e),n=new dwe(e,e.a.xd(),e.a.wd()|4,t),new JT(e,n)}function EFe(e,t){var n=P(xF(e.d,t),18),r;return n?(r=t,e.e.pc(r,n)):null}function $j(e,t){var n=(e.i??vV(e),e.i);return t>=0&&t<n.length?n[t]:null}function eM(e){var t;WC(!!e.c),t=e.c.a,iM(e.d,e.c),e.b==e.c?e.b=t:--e.a,e.c=null}function DFe(e){return e.a>=-.01&&e.a<=WW&&(e.a=0),e.b>=-.01&&e.b<=WW&&(e.b=0),e}function tM(e){AB();var t,n=Ypt;for(t=0;t<e.length;t++)e[t]>n&&(n=e[t]);return n}function OFe(e){var t=D(N(K(e,(hH(),H0))));return t<0&&(t=0,W(e,H0,t)),t}function kFe(e,t){nT(P(K(P(e.e,9),(hH(),v2)),102))&&(QD(),Yx(P(e.e,9).j,t))}function nM(e,t){var n,r;for(r=e.Jc();r.Ob();)n=P(r.Pb(),70),W(n,(Y(),T1),t)}function AFe(e,t){var n,r=t.a.jd(),i;for(n=P(t.a.kd(),18).gc(),i=0;i<n;i++)e.Ad(r)}function jFe(e,t,n){var i=r.Math.max(0,e.b/2-.5);oR(n,i,1),M(t,new Cue(n,i))}function MFe(e,t){var n=mB(e.Ah(),t);if(!n)throw E(new $p(Fq+t+Lq));return n}function rM(e,t){for(var n=e;UO(n);)if(n=UO(n),n==t)return!0;return!1}function NFe(e,t){return t&&e.b[t.g]==t?(iD(e.b,t.g,null),--e.c,!0):!1}function iM(e,t){var n=t.c;return t.a.b=t.b,t.b.a=t.a,t.a=t.b=null,t.c=null,--e.b,n}function PFe(e){this.d=e,this.c=e.c.vc().Jc(),this.b=null,this.a=null,this.e=(Wp(),JY)}function aM(e){if(e<0)throw E(new $p(`Illegal Capacity: `+e));this.g=this.$i(e)}function FFe(e,t){if(0>e||e>t)throw E(new Dm(`fromIndex: 0, toIndex: `+e+Hlt+t))}function IFe(e,t){CL(e,(zB(),QNt),t.f),CL(e,XNt,t.e),CL(e,ZNt,t.d),CL(e,YNt,t.c)}function oM(e,t){var n,r,i,a;for(yD(t),r=e.c,i=0,a=r.length;i<a;++i)n=r[i],t.Ad(n)}function sM(e,t){var n,r,i,a;for(r=e.d,i=0,a=r.length;i<a;++i)n=r[i],TS(e.g,n).a=t}function LFe(e,t,n){var r,i=t[n],a;for(r=0;r<i.length;r++)a=i[r],e.e[a.c.p][a.p]=r}function RFe(e){var t;for(t=0;t<e.c.length;t++)(dk(t,e.c.length),P(e.c[t],12)).p=t}function zFe(e){for(var t=e.a.d.j,n=e.c.d.j;t!=n;)rN(e.b,t),t=JF(t);rN(e.b,t)}function BFe(e){var t=r.Math.sqrt(e.a*e.a+e.b*e.b);return t>0&&(e.a/=t,e.b/=t),e}function VFe(e,t,n){var r=t,i;do i=D(e.p[r.p])+n,e.p[r.p]=i,r=e.a[r.p];while(r!=t)}function cM(e){var t;return e.w?e.w:(t=SDe(e),t&&!t.Sh()&&(e.w=t),t)}function HFe(e,t){return Wx(),LM(_U),r.Math.abs(e-t)<=_U||e==t||isNaN(e)&&isNaN(t)}function UFe(e){var t;return e==null?null:(t=P(e,195),kQe(t,t.length))}function H(e,t){if(e.g==null||t>=e.i)throw E(new nx(t,e.i));return e.Ui(t,e.g[t])}function lM(){lM=C,UX=new E_(`BEGIN`,0),WX=new E_(zW,1),GX=new E_(`END`,2)}function uM(){uM=C,E8=new ky(zW,0),D8=new ky(`HEAD`,1),O8=new ky(`TAIL`,2)}function dM(){dM=C,AMt=eL(eL(eL(qg(new xD,(QL(),t3)),(QB(),a3)),vjt),Sjt)}function fM(){fM=C,MMt=eL(eL(eL(qg(new xD,(QL(),r3)),(QB(),bjt)),hjt),yjt)}function pM(e,t){return Kce(TN(e,t,tE(uI(sU,DD(tE(uI(t==null?0:xN(t),cU)),15)))))}function WFe(e,t){return Wx(),LM(_U),r.Math.abs(e-t)<=_U||e==t||isNaN(e)&&isNaN(t)}function mM(e,t){var n,r=e.a;n=AHe(e,t,null),r!=t&&!e.e&&(n=YV(e,t,n)),n&&n.mj()}function GFe(e,t){return tT(sS(P(sD(e.g,t),8)),oS(P(sD(e.f,t),460).b))}function KFe(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function hM(e){var t;return NT(e==null||Array.isArray(e)&&(t=Uj(e),!(t>=14&&t<=16))),e}function qFe(e){e.b=(pj(),YX),e.f=(Pj(),$X),e.d=(KM(2,fU),new VA(2)),e.e=new hh}function gM(e){this.b=(nD(e),new sT(e)),this.a=new Zd,this.d=new Zd,this.e=new hh}function JFe(e){return hI(e),CT(!0,`n may not be negative`),new JT(e,new PIe(e.a))}function YFe(e,t){QD();var n,r=new Zd;for(n=0;n<e;++n)ff(r.c,t);return new jm(r)}function XFe(e,t){return GR(),Qx(e.b.c.length-e.e.c.length,t.b.c.length-t.e.c.length)}function ZFe(){return Hz(),U(O(Y8,1),Z,96,0,[V8,B8,U8,J8,q8,K8,W8,G8,H8])}function QFe(){QFe=C,DRt=cF((RR(),U(O(ERt,1),Z,327,0,[wRt,SRt,TRt,bRt,CRt,xRt])))}function $Fe(){$Fe=C,OIt=cF((kL(),U(O(DIt,1),Z,256,0,[EIt,k6,A6,j6,D6,O6])))}function eIe(){eIe=C,WIt=cF((xR(),U(O(UIt,1),Z,299,0,[HIt,F6,P6,VIt,M6,N6])))}function tIe(){tIe=C,GRt=cF((Sz(),U(O(f5,1),Z,280,0,[u5,c5,l5,s5,o5,d5])))}function nIe(){nIe=C,WRt=cF((TR(),U(O(URt,1),Z,102,0,[a5,i5,r5,e5,n5,t5])))}function rIe(){rIe=C,Dwt=cF((mR(),U(O(Ewt,1),Z,282,0,[P$,Cwt,Twt,Swt,wwt,N$])))}function iIe(){iIe=C,Pwt=cF((KR(),U(O(Nwt,1),Z,283,0,[F$,kwt,Mwt,jwt,Awt,Owt])))}function aIe(){aIe=C,vwt=cF((YR(),U(O(_wt,1),Z,284,0,[D$,E$,k$,O$,j$,A$])))}function oIe(){oIe=C,QCt=cF((uz(),U(O(c$,1),Z,231,0,[i$,o$,r$,a$,s$,n$])))}function sIe(){sIe=C,JX=(lM(),U(O(KX,1),Z,237,0,[UX,WX,GX])).length,qX=JX}function _M(){_M=C,F5=new Ry(igt,0),QRt=new Ry(`PARENT`,1),$Rt=new Ry(`ROOT`,2)}function cIe(e,t){return e.n=t,e.n?(e.f=new Zd,e.e=new Zd):(e.f=null,e.e=null),e}function vM(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,3,n,e.f))}function yM(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,0,n,e.a))}function bM(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,1,n,e.b))}function xM(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,3,n,e.b))}function SM(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,4,n,e.c))}function CM(e,t){var n=e.g;e.g=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,4,n,e.g))}function wM(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,5,n,e.i))}function TM(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,6,n,e.j))}function EM(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,1,n,e.j))}function DM(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&FN(e,new rA(e,2,n,e.k))}function OM(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&FN(e,new fAe(e,2,n,e.d))}function kM(e,t){var n=e.s;e.s=t,e.Db&4&&!(e.Db&1)&&FN(e,new fAe(e,4,n,e.s))}function AM(e,t){var n=e.t;e.t=t,e.Db&4&&!(e.Db&1)&&FN(e,new fAe(e,5,n,e.t))}function jM(e,t){var n=e.F;e.F=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,5,n,t))}function MM(e,t){var n=P(sD((Zg(),D7),e),58);return n?n.ek(t):V(RY,PH,1,t,5,1)}function NM(e,t){var n=t in e.a,r;return n&&(r=RO(e,t).pe(),r)?r.a:null}function lIe(e,t){var n=(r=(vh(),i=new wo,i),t&&A8e(r,t),r),r,i;return eLe(n,e),n}function uIe(e,t,n){var r=XI(n);return kD(e.c,r,t),kD(e.d,t,n),kD(e.e,t,zO(t)),t}function PM(e,t,n,r,i,a){var o=sSe(e,t);return bIe(n,o),o.i=i?8:0,o.f=r,o.e=i,o.g=a,o}function dIe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=1,this.c=e,this.a=n}function fIe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=2,this.c=e,this.a=n}function pIe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=6,this.c=e,this.a=n}function mIe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=7,this.c=e,this.a=n}function hIe(e,t,n,r,i){this.d=t,this.j=r,this.e=i,this.o=-1,this.p=4,this.c=e,this.a=n}function gIe(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],iPe(e.a,n);return e}function FM(e){var t,n,r,i;for(n=e,r=0,i=n.length;r<i;++r)t=n[r],nD(t);return new mx(e)}function _Ie(e){var t=tT(sS(e.d.d),e.c.d);return cR(t,e.c.e.a,e.c.e.b),eT(t,e.c.d)}function vIe(e){var t=tT(sS(e.c.d),e.d.d);return cR(t,e.d.e.a,e.d.e.b),eT(t,e.d.d)}function yIe(e){var t=/function(?:\s+([\w$]+))?\s*\(/.exec(e);return t&&t[1]||xU}function bIe(e,t){if(e){t.n=e;var n=UTe(t);if(!n){LY[e]=[t];return}n.Pm=t}}function xIe(e,t,n){var i,a=e.length;return i=r.Math.min(n,a),t4e(e,0,t,0,i,!0),t}function SIe(e,t,n){if(RP(e,n),!e.il()&&n!=null&&!e.dk(n))throw E(new gf);return n}function IM(e,t){var n;return yD(t),n=e[`:`+t],ST(!!n,`Enum constant undefined: `+t),n}function CIe(e,t){var n=e.c,r=t.e[e.p];return r>0?P(qT(n.a,r-1),9):null}function LM(e){if(!(e>=0))throw E(new $p(`tolerance (`+e+`) must be >= 0`));return e}function RM(){return vIt||(vIt=new p9e,WP(vIt,U(O(lZ,1),PH,148,0,[new Dc]))),vIt}function zM(){zM=C,$kt=new Nv(`NO`,0),j4=new Nv(udt,1),Qkt=new Nv(`LOOK_BACK`,2)}function BM(){BM=C,w4=new kv(UW,0),S4=new kv(`INPUT`,1),C4=new kv(`OUTPUT`,2)}function VM(){VM=C,owt=new ov(`ARD`,0),p$=new ov(`MSD`,1),f$=new ov(`MANUAL`,2)}function wIe(){return Qz(),U(O(uwt,1),Z,267,0,[g$,lwt,v$,y$,_$,b$,x$,h$,m$])}function TIe(){return pB(),U(O(xkt,1),Z,268,0,[$2,vkt,ykt,X2,_kt,bkt,Q2,Y2,Z2])}function EIe(){return iV(),U(O(izt,1),Z,266,0,[U5,W5,H5,G5,K5,J5,q5,rzt,V5])}function DIe(){Ple();for(var e=Bvt,t=0;t<arguments.length;t++)e.push(arguments[t])}function HM(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],oA(e,n,e.c.b,e.c)}function OIe(e,t){var n;return j(t,45)?e.c.Kc(t):(n=EWe(e,t),QI(e,t),n)}function UM(e,t,n){return mF(e,t),pN(e,n),kM(e,0),AM(e,1),PF(e,!0),NF(e,!0),e}function WM(e,t){var n=e.gc();if(t<0||t>n)throw E(new Qw(t,n));return new Dhe(e,t)}function GM(e){var t,n;for(n=e.c.Bc().Jc();n.Ob();)t=P(n.Pb(),18),t.$b();e.c.$b(),e.d=0}function kIe(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r<i;++r)t=n[r],Ixe(t,t.length,null)}function AIe(e,t){var n,r;for(n=0,r=e.gc();n<r;++n)if(OD(t,e.Xb(n)))return n;return-1}function jIe(e){var t,n;if(e==0)return 32;for(n=0,t=1;(t&e)==0;t<<=1)++n;return n}function KM(e,t){if(e<0)throw E(new $p(t+` cannot be negative but was: `+e));return e}function MIe(e,t){t.Tg(`Hierarchical port constraint processing`,1),AKe(e),Act(e),t.Ug()}function qM(e,t){e.b=r.Math.max(e.b,t.d),e.e+=t.r+(e.a.c.length==0?0:e.c),M(e.a,t)}function NIe(e){WC(e.c>=0),yGe(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function PIe(e){Fb.call(this,e.yd(64)?$x(0,dI(e.xd(),1)):$H,e.wd()),this.b=1,this.a=e}function FIe(){ZS.call(this),this.n=-1,this.g=null,this.i=null,this.j=null,this.Bb|=AJ}function IIe(e,t,n,r){this.$j(),this.a=t,this.b=e,this.c=null,this.c=new Ume(this,t,n,r)}function JM(e,t,n,r,i){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1,i||(this.o=-2-r-1)}function LIe(e){Ng(),this.g=new Qd,this.f=new Qd,this.b=new Qd,this.c=new CO,this.i=e}function RIe(){this.f=new hh,this.d=new Xf,this.c=new hh,this.a=new Zd,this.b=new Zd}function zIe(e){var t,n;for(n=new T(OJe(e));n.a<n.c.c.length;)t=P(z(n),685),t.Zf()}function BIe(e,t){var n,r,i=t.c.i;n=P(sD(e.f,i),60),r=n.d.c-n.e.c,oM(t.b,new Pae(r))}function YM(e,t){return Gce(EN(e.a,t,tE(uI(sU,DD(tE(uI(t==null?0:xN(t),cU)),15)))))}function VIe(e,t){return dM(),P(K(t,(_V(),k3)),15).a<e.gc()&&P(K(t,k3),15).a>=0}function HIe(){HIe=C,dAt=RT(RT(RT(new xD,(BR(),TZ),(yH(),aQ)),EZ,_Q),DZ,gQ)}function UIe(){UIe=C,fAt=RT(RT(RT(new xD,(BR(),TZ),(yH(),aQ)),EZ,_Q),DZ,gQ)}function WIe(){WIe=C,pAt=RT(RT(RT(new xD,(BR(),TZ),(yH(),aQ)),EZ,_Q),DZ,gQ)}function GIe(){GIe=C,mAt=RT(RT(RT(new xD,(BR(),TZ),(yH(),aQ)),EZ,_Q),DZ,gQ)}function KIe(){KIe=C,hAt=RT(RT(RT(new xD,(BR(),TZ),(yH(),aQ)),EZ,_Q),DZ,gQ)}function qIe(){qIe=C,vAt=RT(RT(RT(new xD,(BR(),TZ),(yH(),aQ)),EZ,_Q),DZ,gQ)}function JIe(){JIe=C,xAt=oE(RT(RT(new xD,(BR(),DZ),(yH(),yQ)),OZ,dQ),kZ,vQ)}function YIe(){YIe=C,yyt=U(O(q9,1),RU,30,15,[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15])}function XIe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,0,n,e.b))}function ZIe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,1,n,e.c))}function XM(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,4,n,e.c))}function QIe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,1,n,e.c))}function $Ie(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,1,n,e.d))}function ZM(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,2,n,e.k))}function QM(e,t){var n=e.D;e.D=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,2,n,e.D))}function $M(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,8,n,e.f))}function eN(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,7,n,e.i))}function eLe(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,8,n,e.a))}function tLe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,0,n,e.b))}function nLe(e,t,n){var r;e.b=t,e.a=n,r=(e.a&512)==512?new pp:new Zs,e.c=U5e(r,e.b,e.a)}function rLe(e,t){return wB(e.e,t)?(n_(),kPe(t)?new zT(t,e):new mb(t,e)):new ode(t,e)}function iLe(e){var t,n;return 0>e?new Ile:(t=e+1,n=new uje(t,e),new kw(null,n))}function aLe(e,t){QD();var n=new _g(1);return bb(e)?KO(n,e,t):gz(n.f,e,t),new iu(n)}function oLe(e,t){var n=new Ze;P(t.b,68),P(t.b,68),P(t.b,68),oM(t.a,new sve(e,n,t))}function sLe(e,t){var n;return j(t,8)?(n=P(t,8),e.a==n.a&&e.b==n.b):!1}function cLe(e){var t=K(e,(Y(),P1));return j(t,174)?aWe(P(t,174)):null}function lLe(e){var t;return e=r.Math.max(e,2),t=Qze(e),e>t?(t<<=1,t>0?t:dU):t}function tN(e){switch(GS(e.e!=3),e.e){case 2:return!1;case 0:return!0}return hje(e)}function uLe(e){var t;return e.b==null?(e_(),e_(),u9):(t=e.sl()?e.rl():e.ql(),t)}function dLe(e,t){var n,r;for(r=t.vc().Jc();r.Ob();)n=P(r.Pb(),45),lR(e,n.jd(),n.kd())}function fLe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,11,n,e.d))}function nN(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,13,n,e.j))}function pLe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,21,n,e.b))}function mLe(e,t){e.r>0&&e.c<e.r&&(e.c+=t,e.i&&e.i.d>0&&e.g!=0&&mLe(e.i,t/e.r*e.i.d))}function hLe(e,t,n){var r,i,a=e.a.length-1;for(i=e.b,r=0;r<n;i=i+1&a,++r)iD(t,r,e.a[i])}function rN(e,t){var n;return yD(t),n=t.g,e.b[n]?!1:(iD(e.b,n,t),++e.c,!0)}function gLe(e,t){var n=t==null?-1:xj(e.b,t,0);return n<0?!1:(iN(e,n),!0)}function iN(e,t){var n=kA(e.b,e.b.c.length-1);t<e.b.c.length&&(mA(e.b,t,n),R0e(e,t))}function _Le(e,t){(gA(),LX?null:t.c).length==0&&Gpe(t,new be),KO(e.a,LX?null:t.c,t)}function vLe(e,t){var n=P(K(e,(hH(),S2)),8),r=P(K(t,S2),8);return BF(n.b,r.b)}function yLe(e){mbe.call(this),this.b=D(N(K(e,(hH(),O2)))),this.a=P(K(e,z0),222)}function bLe(e){this.e=e,this.d=new Mh(RN(dE(this.e).gc())),this.c=this.e.a,this.b=this.e.c}function xLe(e,t,n){KOe.call(this,e,t,n),this.a=new Qd,this.b=new Qd,this.d=new Jae(this)}function SLe(e,t){wg(LD(new JT(null,new sk(new Il(e.b),1)),new Bue(e,t)),new Hue(e,t))}function aN(){aN=C,yZ=new Rd(kut),bZ=new Rd(Aut),vZ=new Rd(jut),_Z=new Rd(Mut)}function oN(){oN=C,nQ=new U_(`TO_INTERNAL_LTR`,0),tQ=new U_(`TO_INPUT_DIRECTION`,1)}function sN(){sN=C,P3=new ay(`P1_NODE_PLACEMENT`,0),F3=new ay(`P2_EDGE_ROUTING`,1)}function cN(){cN=C,GQ=new sv(`START`,0),WQ=new sv(`MIDDLE`,1),UQ=new sv(`END`,2)}function CLe(e){var t,n;for(n=new zS(e);n.e!=n.i.gc();)t=P(gL(n),26),wM(t,0),TM(t,0)}function wLe(e,t){var n,r=new Zd;n=t;do ff(r.c,n),n=P(sD(e.k,n),17);while(n);return r}function TLe(e,t,n){var r=new Zd;return g5e(e,t,r,n,!0,!0),e.b=new fN(r.c.length),r}function ELe(e,t){var n=P(sD(e.c,t),456);return n||(n=new Sse,n.c=t,kD(e.c,n.c,n)),n}function lN(e){var t;return khe(e.f.g,e.d),UC(e.b),e.c=e.a,t=P(e.a.Pb(),45),e.b=gze(e),t}function uN(e,t){var n=1-t,r=e.a[n];return e.a[n]=r.a[t],r.a[t]=e,e.b=!0,r.b=!1,r}function dN(e,t){var n=e.Nc(),r;for(uj(n,0,n.length,t),r=0;r<n.length;r++)e.fd(r,n[r])}function DLe(e){var t,n;for(n=e.c.a.ec().Jc();n.Ob();)t=P(n.Pb(),218),Oie(t,new exe(t.f))}function OLe(e){var t,n;for(n=e.c.a.ec().Jc();n.Ob();)t=P(n.Pb(),218),kie(t,new f$e(t.e))}function kLe(){this.c=new Wh(0),this.b=new Wh(qpt),this.d=new Wh(Gpt),this.a=new Wh(Kpt)}function fN(e){this.b=e,this.a=V(q9,RU,30,e+1,15,1),this.c=V(q9,RU,30,e,15,1),this.d=0}function pN(e,t){var n=e.zb;e.zb=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,1,n,e.zb))}function mN(e,t){var n=(r=new op,r),r;n.n=t,XA((!e.s&&(e.s=new F(N7,e,21,17)),e.s),n)}function hN(e,t){var n,r=(n=new yw,n);r.n=t,XA((!e.s&&(e.s=new F(N7,e,21,17)),e.s),r)}function gN(e,t){var n=e.xb;e.xb=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,3,n,e.xb))}function _N(e,t){var n=e.yb;e.yb=t,e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,1,2,n,e.yb))}function ALe(e,t){var n;return j(t,18)?(n=P(t,18),e.Fc(n)):APe(e,P(nD(t),20).Jc())}function vN(e,t){var n,r,i;for(yD(t),n=!1,i=t.Jc();i.Ob();)r=i.Pb(),n|=e.Ec(r);return n}function jLe(e){var t=0,n,r;for(r=e.Jc();r.Ob();)n=r.Pb(),t+=n==null?0:xN(n),t=~~t;return t}function MLe(e,t){var n=e.a,r=0;for(var i in n)n.hasOwnProperty(i)&&(t[r++]=i);return t}function NLe(e){var t;return e==0?`UTC`:(e<0?(e=-e,t=`UTC+`):t=`UTC-`,t+jPe(e))}function PLe(e){return e.a<54?e.f<0?-1:+(e.f>0):(!e.c&&(e.c=ck(zN(e.f))),e.c).e}function FLe(e,t){t?e.B??(e.B=e.D,e.D=null):e.B!=null&&(e.D=e.B,e.B=null)}function ILe(e,t){t.Tg(edt,1),wg(zj(new JT(null,new sk(e.b,16)),new Ot),new kt),t.Ug()}function LLe(e,t,n,r,i,a){var o;this.c=e,o=new Zd,Qqe(e,o,t,e.b,n,r,i,a),this.a=new Tk(o,0)}function yN(e,t,n,r,i,a,o,s,c,l,u,d,f){return p0e(e,t,n,r,i,a,o,s,c,l,u,d,f),iI(e,!1),e}function RLe(e,t){typeof window===TH&&typeof window.$gwt===TH&&(window.$gwt[e]=t)}function zLe(e,t,n){var r=0,i,a;for(i=0;i<n;i++)a=t[i],e[i]=a<<1|r,r=a>>>31;r!=0&&(e[n]=r)}function BLe(e,t,n){n.Tg(`DFS Treeifying phase`,1),HWe(e,t),Y8e(e,t),e.a=null,e.b=null,n.Ug()}function VLe(e,t){var n;t.Tg(`General Compactor`,1),n=$Ue(P(J(e,(ez(),mNt)),386)),n.Bg(e)}function HLe(e,t){var n=P(J(e,(ez(),L3)),15),r=P(J(t,L3),15);return Qx(n.a,r.a)}function ULe(e,t,n){var r,i;for(i=mL(e,0);i.b!=i.d.c;)r=P(Uk(i),8),r.a+=t,r.b+=n;return e}function WLe(e,t,n,r){var i=new Mp;rO(i,`x`,SR(e,t,r.a)),rO(i,`y`,CR(e,t,r.b)),cD(n,i)}function GLe(e,t,n,r){var i=new Mp;rO(i,`x`,SR(e,t,r.a)),rO(i,`y`,CR(e,t,r.b)),cD(n,i)}function KLe(){return YB(),U(O(Pkt,1),Z,243,0,[h4,p4,m4,jkt,Mkt,Akt,Nkt,g4,d4,f4])}function qLe(){return kB(),U(O(K$,1),Z,261,0,[L$,z$,B$,V$,H$,U$,G$,I$,R$,W$])}function JLe(){JLe=C,l9=new Nse,PBt=U(O(N7,1),VJ,179,0,[]),NBt=U(O(B7,1),H_t,62,0,[])}function bN(){bN=C,kQ=new Aw(`edgelabelcenterednessanalysis.includelabel`,(XS(),iX))}function YLe(e,t){return D(N(oC(kF(RD(new JT(null,new sk(e.c.b,16)),new Ku(e)),t))))}function XLe(e,t){return D(N(oC(kF(RD(new JT(null,new sk(e.c.b,16)),new zae(e)),t))))}function xN(e){return bb(e)?zP(e):yb(e)?Yb(e):vb(e)?$pe(e):Mbe(e)?e.Hb():lbe(e)?TC(e):Nwe(e)}function ZLe(e,t){return Wx(),LM(WW),r.Math.abs(0-t)<=WW||t==0?0:e/t}function QLe(e,t){return vP(),e==FZ&&t==IZ||e==FZ&&t==LZ||e==RZ&&t==LZ||e==RZ&&t==IZ}function $Le(e,t){return vP(),e==FZ&&t==RZ||e==RZ&&t==FZ||e==LZ&&t==IZ||e==IZ&&t==LZ}function SN(){SN=C,PSt=new xt,MSt=new St,NSt=new Ct,jSt=new wt,FSt=new Tt,ISt=new gee}function eRe(e){var t=Mk(e);return xb(t.a,0)?(Cg(),Cg(),Zyt):(Cg(),new BC(t.b))}function tRe(e){var t=ROe(e);return xb(t.a,0)?(bg(),bg(),AX):(bg(),new zC(t.b))}function nRe(e){var t=ROe(e);return xb(t.a,0)?(bg(),bg(),AX):(bg(),new zC(t.c))}function rRe(e){return e.b.c.i.k==(Zz(),qZ)?P(K(e.b.c.i,(Y(),P1)),12):e.b.c}function iRe(e){return e.b.d.i.k==(Zz(),qZ)?P(K(e.b.d.i,(Y(),P1)),12):e.b.d}function aRe(e){switch(e.g){case 2:return rH(),N5;case 4:return rH(),p5;default:return e}}function oRe(e){switch(e.g){case 1:return rH(),j5;case 3:return rH(),m5;default:return e}}function sRe(e,t){var n=TQe(e);return T2e(new k(n.c,n.d),new k(n.b,n.a),e.Kf(),t,e.$f())}function cRe(e,t){t.Tg(edt,1),GUe(Wle(new vu((Ig(),new GD(e,!1,!1,new yt))))),t.Ug()}function lRe(){lRe=C,SAt=eL(zb(RT(RT(new xD,(BR(),DZ),(yH(),yQ)),OZ,dQ),kZ),vQ)}function uRe(){uRe=C,EAt=eL(zb(RT(RT(new xD,(BR(),DZ),(yH(),yQ)),OZ,dQ),kZ),vQ)}function dRe(e,t,n){this.g=e,this.d=t,this.e=n,this.a=new Zd,G0e(this),QD(),Yx(this.a,null)}function CN(e,t,n,r,i,a,o){ng.call(this,e,t),this.d=n,this.e=r,this.c=i,this.b=a,this.a=TA(o)}function fRe(e){this.i=e.gc(),this.i>0&&(this.g=this.$i(this.i+(this.i/8|0)+1),e.Oc(this.g))}function wN(e,t){var n,r;for(yD(t),r=t.vc().Jc();r.Ob();)n=P(r.Pb(),45),e.yc(n.jd(),n.kd())}function pRe(e,t,n){var r;for(r=n.Jc();r.Ob();)if(!Xk(e,t,r.Pb()))return!1;return!0}function TN(e,t,n){var r;for(r=e.b[n&e.f];r;r=r.b)if(n==r.a&&gD(t,r.g))return r;return null}function EN(e,t,n){var r;for(r=e.c[n&e.f];r;r=r.d)if(n==r.f&&gD(t,r.i))return r;return null}function mRe(e,t){var n;for(nD(t);e.Ob();)if(n=e.Pb(),!nze(P(n,9)))return!1;return!0}function hRe(e,t,n,r,i){var a;return n&&(a=NI(t.Ah(),e.c),i=n.Oh(t,-1-(a==-1?r:a),null,i)),i}function gRe(e,t,n,r,i){var a;return n&&(a=NI(t.Ah(),e.c),i=n.Qh(t,-1-(a==-1?r:a),null,i)),i}function _Re(e){var t;if(e.b==-2){if(e.e==0)t=-1;else for(t=0;e.a[t]==0;t++);e.b=t}return e.b}function vRe(e){var t,n,r;return e.j==(rH(),m5)&&(t=k4e(e),n=hC(t,p5),r=hC(t,N5),r||r&&n)}function yRe(e){var t,n,r=0;for(n=new T(e.b);n.a<n.c.c.length;)t=P(z(n),25),t.p=r,++r}function DN(e,t){var n,r;for(r=mL(e,0);r.b!=r.d.c;)n=P(Uk(r),8),n.a+=t.a,n.b+=t.b;return e}function bRe(e,t){var n,r,i=e.c,a;return n=e.c+e.b,a=e.d,r=e.d+e.a,t.a>i&&t.a<n&&t.b>a&&t.b<r}function xRe(e,t){t.q=e,e.d=r.Math.max(e.d,t.r),e.b+=t.d+(e.a.c.length==0?0:e.c),M(e.a,t)}function SRe(e,t){return t<e.b.gc()?P(e.b.Xb(t),9):t==e.b.gc()?e.a:P(qT(e.e,t-e.b.gc()-1),9)}function ON(e,t){return XS(),bb(e)?Lje(e,gw(t)):yb(e)?Vbe(e,N(t)):vb(e)?Bbe(e,hw(t)):e.Dd(t)}function kN(e,t){var n;j(t,92)?(P(e.c,77).Ek(),n=P(t,92),dLe(e,n)):P(e.c,77).Wb(t)}function AN(e,t){var n,r;for(yD(t),r=e.vc().Jc();r.Ob();)n=P(r.Pb(),45),t.Wd(n.jd(),n.kd())}function jN(e,t){DT.call(this,RBt,e,t),this.b=this,this.a=xB(e.Ah(),$j(this.e.Ah(),this.c))}function MN(e){this.f=e,this.e=new hAe(this.f.i),this.a=this.e,this.b=gze(this),this.d=this.f.g}function CRe(e){if(yD(e),e.length==0)throw E(new Om(`Zero length BigInteger`));det(this,e)}function wRe(e,t,n,r){var i=e.a.length;n>i?n=i:fk(t,n+1),e.a=bO(e.a,0,t)+(``+r)+dSe(e.a,n)}function TRe(e,t,n,r){j(e.Cb,184)&&(P(e.Cb,184).tb=null),pN(e,n),t&&A2e(e,t),r&&e.el(!0)}function ERe(e,t){var n,r;for(r=new T(t.b);r.a<r.c.c.length;)n=P(z(r),25),e.a[n.p]=u$e(n)}function NN(e,t){var n;for(n=0;n<t.j.c.length;n++)P(Cj(e,n),22).Fc(P(Cj(t,n),18));return e}function DRe(e,t){var n=O9e(RM(),e);return n?(CL(t,(vH(),c8),n),!0):!1}function PN(e,t,n){var r,i=P(iT(e.d,t),15);return r=P(iT(e.b,n),15),!i||!r?null:zA(e,i.a,r.a)}function ORe(e,t){var n;t.Tg(`Edge and layer constraint edge reversal`,1),n=$7e(e),kot(n),t.Ug()}function kRe(e,t){e.a=lI(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d=lI(e.d,t)}function ARe(){var e;return IX||(IX=new Mf,e=new QAe(``),Vde(e,(xg(),obt)),_Le(IX,e)),IX}function jRe(e){return Cw(),e.A.Gc((YI(),I5))&&!e.B.Gc((iV(),W5))?TWe(e):null}function MRe(){this.a=P(hL((fV(),fZ)),15).a,this.c=D(N(hL(hZ))),this.b=D(N(hL(mZ)))}function NRe(){NRe=C,kSt=cF((Zz(),U(O(eQ,1),Z,249,0,[ZZ,YZ,qZ,QZ,JZ,KZ,$Z,XZ])))}function PRe(){PRe=C,CIt=cF((oz(),U(O(SIt,1),Z,285,0,[xIt,v6,S6,w6,y6,b6,x6,C6])))}function FRe(){FRe=C,Yzt=cF((Bz(),U(O(S7,1),Z,244,0,[Jzt,b7,x7,y7,qzt,v7,_7,Kzt])))}function IRe(){IRe=C,ZCt=cF((IB(),U(O(XCt,1),Z,275,0,[JQ,ZQ,qQ,e$,XQ,YQ,$Q,QQ])))}function LRe(){return QB(),U(O(Tjt,1),Z,264,0,[a3,vjt,Sjt,Cjt,xjt,_jt,wjt,hjt,bjt,yjt,gjt])}function RRe(e,t,n){return BF(DS(dL(e),new k(t.e.a,t.e.b)),DS(dL(e),new k(n.e.a,n.e.b)))}function zRe(e,t,n){return e==(dF(),R4)?new Pte:tB(t,1)==0?new Cce(n.length):new Gm(n.length)}function FN(e,t){var n=e.qh(),r,i;if(n!=null&&e.th())for(r=0,i=n.length;r<i;++r)n[r].bj(t)}function IN(e,t){for(var n=e,r=_D(n).e;r;){if(n=r,n==t)return!0;r=_D(n).e}return!1}function LN(e){var t=e.h;return t==0?e.l+e.m*ZU:t==YU?e.l+e.m*ZU-QU:e}function BRe(e,t,n){var r=e.a.f[t.p],i=e.a.f[n.p];return r<i?-1:r==i?0:1}function RN(e){return e<3?(KM(e,xlt),e+1):e<dU?AO(r.Math.ceil(e/.75)):kH}function zN(e){return eW<e&&e<QU?e<0?r.Math.ceil(e):r.Math.floor(e):LN(C8e(e))}function VRe(e){switch(e.a.g){case 1:return new Fue;case 3:return new MJe;default:return new Tc}}function HRe(e,t){e.c&&(U9e(e,t,!0),wg(new JT(null,new sk(t,16)),new Gae(e))),U9e(e,t,!1)}function URe(e){Kde();var t;return fue(J4,e)||(t=new Xte,t.a=e,fme(J4,e,t)),P(AD(J4,e),635)}function WRe(e){var t;if(e.a==e.b.a)throw E(new Cf);return t=e.a,e.c=t,e.a=P(vD(e.a.e),227),t}function GRe(e){var t;e.d==null?(++e.e,e.f=0,JVe(null)):(++e.e,t=e.d,e.d=null,e.f=0,JVe(t))}function BN(e,t){var n;return(e.Db&t)==0?null:(n=mJe(e,t),n==-1?e.Eb:hM(e.Eb)[n])}function VN(e){var t;if(e.g>1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw E(new Cf)}function KRe(e,t){var n,r;for(r=new T(t);r.a<r.c.c.length;)n=P(z(r),70),M(e.d,n),d$e(e,n)}function qRe(e,t){var n,r;for(r=new zS(e);r.e!=r.i.gc();)n=P(gL(r),26),Cx(n,n.i+t.b,n.j+t.d)}function HN(e,t){var n=(r=new Ac,r),r;return n.G=t,!e.rb&&(e.rb=new AE(e,F7,e)),XA(e.rb,n),n}function UN(e,t){var n=(r=new wf,r),r;return n.G=t,!e.rb&&(e.rb=new AE(e,F7,e)),XA(e.rb,n),n}function WN(e){var t,n,r=0;for(n=new hg(e.a);n.a<n.c.a.length;)t=$k(n),e.b.Gc(t)&&++r;return r}function JRe(e){var t=1,n,r;for(r=e.Jc();r.Ob();)n=r.Pb(),t=31*t+(n==null?0:xN(n)),t=~~t;return t}function GN(e){var t;return e<128?(jye(),t=_yt[e],!t&&(t=_yt[e]=new Rl(e)),t):new Rl(e)}function KN(e){var t,n,r,i=e;return r=0,i<0&&(i+=QU,r=YU),n=AO(i/ZU),t=AO(i-n*ZU),eS(t,n,r)}function YRe(e,t){var n=e.a.get(t);return n===void 0?++e.d:(ume(e.a,t),--e.c,++e.b.g),n}function qN(e,t){var n;return t?(n=t.lf(),n.dc()||(e.q?wN(e.q,n):e.q=new Vb(n)),e):e}function XRe(e,t){var n=t.p-e.p,r,i;return n==0?(r=e.f.a*e.f.b,i=t.f.a*t.f.b,BF(r,i)):n}function ZRe(e,t){switch(t){case 1:return!!e.n&&e.n.i!=0;case 2:return e.k!=null}return pOe(e,t)}function QRe(e){return e.b.c.length!=0&&P(qT(e.b,0),70).a?P(qT(e.b,0),70).a:VD(e)}function $Re(e,t){var n;try{t.be()}catch(t){if(t=fP(t),j(t,80))n=t,ff(e.c,n);else throw E(t)}}function JN(e,t,n){this.b=(yD(e),e),this.d=(yD(t),t),this.e=(yD(n),n),this.c=this.d+(``+this.e)}function YN(e,t){this.b=e,this.e=t,this.d=t.j,this.f=(n_(),P(e,69).vk()),this.k=xB(t.e.Ah(),e)}function eze(e,t,n,r,i){jBe.call(this,e,n,r,i),this.f=V(GZ,qG,9,t.a.c.length,0,1),cL(t.a,this.f)}function XN(e,t,n,r,i){iD(e.c[t.g],n.g,r),iD(e.c[n.g],t.g,r),iD(e.b[t.g],n.g,i),iD(e.b[n.g],t.g,i)}function tze(e,t){var n=e.j,r=t.j;return n==r?e.p==t.p?0:n==(rH(),m5)?e.p-t.p:t.p-e.p:n.g-r.g}function nze(e){var t=P(K(e,(Y(),g1)),64);return e.k==(Zz(),qZ)&&(t==(rH(),N5)||t==p5)}function rze(){rze=C,dwt=cF((Qz(),U(O(uwt,1),Z,267,0,[g$,lwt,v$,y$,_$,b$,x$,h$,m$])))}function ize(){ize=C,Skt=cF((pB(),U(O(xkt,1),Z,268,0,[$2,vkt,ykt,X2,_kt,bkt,Q2,Y2,Z2])))}function aze(){aze=C,azt=cF((iV(),U(O(izt,1),Z,266,0,[U5,W5,H5,G5,K5,J5,q5,rzt,V5])))}function oze(){oze=C,zRt=cF((Hz(),U(O(Y8,1),Z,96,0,[V8,B8,U8,J8,q8,K8,W8,G8,H8])))}function ZN(){ZN=C,cZ=new Aw(`debugSVG`,(XS(),!1)),axt=new Aw(`overlapsExisted`,!0)}function QN(){QN=C,oZ=new k_(`UP`,0),rZ=new k_(qW,1),iZ=new k_(BW,2),aZ=new k_(VW,3)}function $N(){$N=C,INt=new uy(BG,0),LNt=new uy(`POLAR_COORDINATE`,1),FNt=new uy(`ID`,2)}function eP(){eP=C,J$=new gv(`ONE_SIDED`,0),Y$=new gv(`TWO_SIDED`,1),q$=new gv(`OFF`,2)}function tP(){tP=C,Ukt=new Av(`EQUALLY`,0),T4=new Av(`NORTH`,1),Wkt=new Av(`NORTH_SOUTH`,2)}function nP(){nP=C,N4=new Pv(`OFF`,0),P4=new Pv(`SINGLE_EDGE`,1),M4=new Pv(`MULTI_EDGE`,2)}function rP(){rP=C,PQ=new tv(zW,0),FQ=new tv(BW,1),IQ=new tv(VW,2),LQ=new tv(`TOP`,3)}function iP(){iP=C,d6=new xy(`MINIMUM_SPANNING_TREE`,0),oIt=new xy(`MAXIMUM_SPANNING_TREE`,1)}function sze(e){e.r=new jf,e.w=new jf,e.t=new Zd,e.i=new Zd,e.d=new jf,e.a=new Ax,e.c=new Qd}function aP(e){this.n=new Zd,this.e=new gg,this.j=new gg,this.k=new Zd,this.f=new Zd,this.p=e}function cze(e){switch(e.g){case 0:return new ka;case 1:return new ja;default:return null}}function lze(){return gA(),LX?new QAe(null):x4e(ARe(),`com.google.common.base.Strings`)}function uze(e){var t;if(e){if(t=e,t.dc())throw E(new Cf);return t.Xb(t.gc()-1)}return zEe(e.Jc())}function oP(e){var t;return(!e.a||!(e.Bb&1)&&e.a.Sh())&&(t=aR(e),j(t,159)&&(e.a=P(t,159))),e.a}function dze(e,t,n){var r,i,a=null;return i=Rk(t,eJ),r=new Ky(e,n),a=(wXe(r.a,r.b,i),i),a}function sP(e,t){var n,r=(n=new Qo,n);return pN(r,t),XA((!e.A&&(e.A=new PS(W7,e,7)),e.A),r),r}function cP(e,t,n,r){return n==1?(!e.n&&(e.n=new F(f7,e,1,7)),TL(e.n,t,r)):C$e(e,t,n,r)}function fze(e,t,n,r){P(n.b,68),P(n.b,68),P(r.b,68),P(r.b,68),P(r.b,68),oM(r.a,new ove(e,t,r))}function pze(e,t){e.d==(KF(),y8)||e.d==S8?P(t.a,60).c.Ec(P(t.b,60)):P(t.b,60).c.Ec(P(t.a,60))}function lP(e,t,n){var r,i,a,o=_D(e);r=o.d,i=o.c,a=e.n,t&&(a.a=a.a-r.b-i.a),n&&(a.b=a.b-r.d-i.b)}function mze(e,t,n){var r,i=P(K(e,(hH(),J0)),78);i&&(r=new np,nF(r,0,i),DN(r,n),vN(t,r))}function uP(e,t){var n=t.Nc();return n.length==0?!1:(Tve(e.c,e.c.length,n),!0)}function dP(e,t){var n,r;for(yD(t),r=t.Jc();r.Ob();)if(n=r.Pb(),!e.Gc(n))return!1;return!0}function hze(e,t){if(t==null)return!1;for(;e.a!=e.b;)if(OF(t,gF(e)))return!0;return!1}function gze(e){return e.a.Ob()?!0:e.a==e.e?(e.a=new QMe(e.f.f),e.a.Ob()):!1}function fP(e){var t;return j(e,80)?e:(t=e&&e.__java$exception,t||(t=new xVe(e),mf(t)),t)}function pP(e){if(j(e,193))return P(e,125);if(e)return null;throw E(new tm(Bgt))}function _ze(e){switch(P(K(e,(hH(),Y0)),165).g){case 2:case 4:return!0;default:return!1}}function vze(e,t){var n=e.c,r=t.e[e.p];return r<n.a.c.length-1?P(qT(n.a,r+1),9):null}function yze(e){var t,n;for(Xnt(e),n=new T(e.d);n.a<n.c.c.length;)t=P(z(n),107),t.i&&o1e(t)}function bze(e,t){var n,r;for(r=new T(e.b);r.a<r.c.c.length;)n=P(z(r),70),W(n,(Y(),T1),t)}function xze(e,t,n){var r,i;for(i=new T(e.b);i.a<i.c.c.length;)r=P(z(i),26),Cx(r,r.i+t,r.j+n)}function mP(e){var t=new gg,n,r;for(r=mL(e.d,0);r.b!=r.d.c;)n=P(Uk(r),65),MT(t,n.c);return t}function Sze(e){var t=1,n,r,i;for(n=0,i=e.gc();n<i;++n)r=e.Ti(n),t=31*t+(r==null?0:xN(r));return t}function Cze(e){var t,n=(t=new Qo,t);return pN(n,`T`),XA((!e.d&&(e.d=new PS(W7,e,11)),e.d),n),n}function wze(e,t){var n=PC(t.a.gc());return wg(Qj(new JT(null,new sk(t,1)),e.i),new Nue(e,n)),n}function Tze(e,t,n,r){var i;return kk(t,e.e.Pd().gc()),kk(n,e.c.Pd().gc()),i=e.a[t][n],iD(e.a[t],n,r),i}function U(e,t,n,r,i){return i.Pm=e,i.Qm=t,i.Rm=ne,i.__elementTypeId$=n,i.__elementTypeCategory$=r,i}function Eze(e,t,n,i,a){return AB(),r.Math.min(Uat(e,t,n,i,a),Uat(n,i,e,t,aw(new k(a.a,a.b))))}function Dze(e,t){return!e||!t||e==t?!1:cGe(e.d.c,t.d.c+t.d.b)&&cGe(t.d.c,e.d.c+e.d.b)}function Oze(e,t){if(!e)throw E(new $p(VB(`value already present: %s`,U(O(RY,1),PH,1,5,[t]))))}function kze(e,t){var n=e.l+t.l,r=e.m+t.m+(n>>22),i=e.h+t.h+(r>>22);return eS(n&JU,r&JU,i&YU)}function Aze(e,t){var n=e.l-t.l,r=e.m-t.m+(n>>22),i=e.h-t.h+(r>>22);return eS(n&JU,r&JU,i&YU)}function hP(e){var t,n,r,i=new Zd;for(r=e.Jc();r.Ob();)n=P(r.Pb(),26),t=DB(n),uP(i,t);return i}function jze(e){var t;bV(e,!0),t=uU,QC(e,(hH(),C2))&&(t+=P(K(e,C2),15).a),W(e,C2,G(t))}function Mze(e,t,n){var r;SE(e.a),oM(n.i,new goe(e)),r=new nS(P(sD(e.a,t.b),68)),NGe(e,r,t),n.f=r}function Nze(e){var t,n=(vh(),t=new xo,t);return e&&XA((!e.a&&(e.a=new F(a7,e,6,6)),e.a),n),n}function gP(e,t){var n,r=0;if(e<64&&e<=t)for(t=t<64?t:63,n=e;n<=t;n++)r=gk(r,gE(1,n));return r}function Pze(e,t){var n,r;for(sO(t,`predicate`),r=0;e.Ob();r++)if(n=e.Pb(),t.Lb(n))return r;return-1}function Fze(e,t){switch(t){case 0:!e.o&&(e.o=new ij((uH(),d7),g7,e,0)),e.o.c.$b();return}iz(e,t)}function Ize(e){switch(e.g){case 1:return L8;case 2:return I8;case 3:return R8;default:return z8}}function Lze(e){QD();var t,n,r=0;for(n=e.Jc();n.Ob();)t=n.Pb(),r+=t==null?0:xN(t),r|=0;return r}function Rze(e){var t=new S;return t.a=e,t.b=$ze(e),t.c=V(hX,X,2,2,6,1),t.c[0]=NLe(e),t.c[1]=NLe(e),t}function _P(){_P=C,NQ=new G_(BG,0),jQ=new G_(odt,1),MQ=new G_(sdt,2),AQ=new G_(`BOTH`,3)}function vP(){vP=C,FZ=new z_(`Q1`,0),RZ=new z_(`Q4`,1),IZ=new z_(`Q2`,2),LZ=new z_(`Q3`,3)}function yP(){yP=C,Q$=new _v(`ONLY_WITHIN_GROUP`,0),Lwt=new _v(VG,1),Z$=new _v(`ENFORCED`,2)}function bP(){bP=C,w$=new fv(BG,0),C$=new fv(`INCOMING_ONLY`,1),T$=new fv(`OUTGOING_ONLY`,2)}function xP(){xP=C,new Rd(`org.eclipse.elk.addLayoutConfig`),dIt=new Ia,uIt=new Ene,fIt=new Fa}function SP(){SP=C,nX={boolean:Nle,number:Bp,string:ece,object:w0e,function:w0e,undefined:af}}function zze(){zze=C,Fkt=cF((YB(),U(O(Pkt,1),Z,243,0,[h4,p4,m4,jkt,Mkt,Akt,Nkt,g4,d4,f4])))}function Bze(){Bze=C,Fwt=cF((kB(),U(O(K$,1),Z,261,0,[L$,z$,B$,V$,H$,U$,G$,I$,R$,W$])))}function Vze(e,t,n,r){return new u_(U(O(UY,1),rU,45,0,[(kqe(e,t),new $h(e,t)),(kqe(n,r),new $h(n,r))]))}function Hze(e,t){return ztt(P(P(sD(e.g,t.a),49).a,68),P(P(sD(e.g,t.b),49).a,68))}function Uze(e,t,n){var r=e.gc();if(t>r)throw E(new Qw(t,r));return e.Qi()&&(n=ZTe(e,n)),e.Ci(t,n)}function Wze(e){var t,n=e.n,r=e.o;return t=e.d,new KD(n.a-t.b,n.b-t.d,r.a+(t.b+t.c),r.b+(t.d+t.a))}function Gze(e,t){return!e||!t||e==t?!1:EI(e.b.c,t.b.c+t.b.b)<0&&EI(t.b.c,e.b.c+e.b.b)<0}function CP(e,t,n){return e>=128?!1:Cb(e<64?hk(gE(1,e),n):hk(gE(1,e-64),t),0)}function wP(e,t,n){switch(n.g){case 2:e.b=t;break;case 1:e.c=t;break;case 4:e.d=t;break;case 3:e.a=t}}function TP(e,t,n){return n==null?(!e.q&&(e.q=new Qd),OA(e.q,t)):(!e.q&&(e.q=new Qd),kD(e.q,t,n)),e}function W(e,t,n){return n==null?(!e.q&&(e.q=new Qd),OA(e.q,t)):(!e.q&&(e.q=new Qd),kD(e.q,t,n)),e}function Kze(e){var t,n=new NA;return qN(n,e),W(n,(aN(),yZ),e),t=new Qd,Tnt(e,n,t),yot(e,n,t),n}function qze(e){AB();var t,n=V(E6,X,8,2,0,1),r=0;for(t=0;t<2;t++)r+=.5,n[t]=Kqe(r,e);return n}function Jze(e,t){var n=!1,r=e.a[t].length,i,a;for(a=0;a<r-1;a++)i=a+1,n|=eGe(e,t,a,i);return n}function Yze(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r<i;++r)t=n[r],cBe(e,t,(rH(),j5)),cBe(e,t,m5)}function EP(e){var t=~e.l+1&JU,n=~e.m+ +(t==0)&JU;return eS(t,n,~e.h+ +(t==0&&n==0)&YU)}function Xze(e){var t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d;return t||n}function Zze(e){var t;return(!e.c||!(e.Bb&1)&&e.c.Db&64)&&(t=aR(e),j(t,88)&&(e.c=P(t,29))),e.c}function Qze(e){var t;if(e<0)return vU;if(e==0)return 0;for(t=dU;(t&e)==0;t>>=1);return t}function $ze(e){var t;return e==0?`Etc/GMT`:(e<0?(e=-e,t=`Etc/GMT-`):t=`Etc/GMT+`,t+jPe(e))}function eBe(e){var t,n=Az(e.h);return n==32?(t=Az(e.m),t==32?Az(e.l)+32:t+20-10):n-12}function DP(e){var t=~e.l+1&JU,n=~e.m+ +(t==0)&JU,r=~e.h+ +(t==0&&n==0)&YU;e.l=t,e.m=n,e.h=r}function OP(e){var t=e.a[e.b];return t==null?null:(iD(e.a,e.b,null),e.b=e.b+1&e.a.length-1,t)}function tBe(){++Gvt,this.o=null,this.k=null,this.j=null,this.d=null,this.b=null,this.n=null,this.a=null}function nBe(e,t){this.c=e,this.d=t,this.b=this.d/this.c.c.Pd().gc()|0,this.a=this.d%this.c.c.Pd().gc()}function rBe(e,t){this.b=e,rx.call(this,(P(H(R(($E(),K7).o),10),19),t.i),t.g),this.a=(JLe(),PBt)}function iBe(e,t,n){this.q=new r.Date,this.q.setFullYear(e+LU,t,n),this.q.setHours(0,0,0,0),SV(this,0)}function aBe(e,t,n){var r=new XMe(t,n),i=new ve;return e.b=L5e(e,e.b,r,i),i.b||++e.c,e.b.b=!1,i.d}function oBe(e,t){QD();var n,r,i,a,o=!1;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],o|=e.Ec(n);return o}function sBe(e,t,n,r,i){var a,o=e.length;if(a=n.length,t<0||r<0||i<0||t+i>o||r+i>a)throw E(new hf)}function cBe(e,t,n){var r,i,a,o=AF(t,n);for(a=0,i=o.Jc();i.Ob();)r=P(i.Pb(),12),kD(e.c,r,G(a++))}function kP(e){var t,n;for(n=new T(e.a.b);n.a<n.c.c.length;)t=P(z(n),82),t.g.c=-t.g.c-t.g.b;dB(e)}function AP(e){var t,n;for(n=new T(e.a.b);n.a<n.c.c.length;)t=P(z(n),60),t.d.c=-t.d.c-t.d.b;E8e(e)}function lBe(e){var t=P(e.e&&e.e(),10),n;return new lT(t,(n=t.slice(),P(lj(n,t),10)),t.length)}function jP(e){var t=new hh,n,r,i,a;for(r=e,i=0,a=r.length;i<a;++i)n=r[i],t.a+=n.a,t.b+=n.b;return t}function uBe(e,t,n){var r=new Zd;return g5e(e,t,r,(rH(),p5),!0,!1),g5e(e,n,r,N5,!1,!1),r}function MP(e,t,n){var r,i,a=null;return i=Rk(t,`labels`),r=new Xy(e,n),a=(v3e(r.a,r.b,i),i),a}function dBe(e,t){return DS(dL(P(K(t,(_V(),O3)),86)),new k(e.c.e.a-e.b.e.a,e.c.e.b-e.b.e.b))<=0}function fBe(e,t,n){return!Vh(LD(new JT(null,new sk(e.c,16)),new lu(new Vue(t,n)))).zd((Sg(),BX))}function NP(){NP=C,FCt=new Cn,ICt=new Xee,PCt=new wn,NCt=new Tn,MCt=new En,jCt=(yD(MCt),new le)}function pBe(e,t){switch(t.g){case 0:j(e.b,631)||(e.b=new MRe);break;case 1:j(e.b,632)||(e.b=new Kve)}}function mBe(e,t){switch(t){case 7:return!!e.e&&e.e.i!=0;case 8:return!!e.d&&e.d.i!=0}return XUe(e,t)}function hBe(e,t){for(;e.g==null&&!e.c?XTe(e):e.g==null||e.i!=0&&P(e.g[e.i-1],50).Ob();)t.Bi(Xz(e))}function gBe(e,t){ST(e>=0,`Negative initial capacity`),ST(t>=0,`Non-positive load factor`),SE(this)}function _Be(e,t){var n;for(n=0;n<e.a.a.length;n++)if(!P(Jye(e.a,n),178).Lb(t))return!1;return!0}function vBe(e,t,n,r){var i=B3e(e,t,n,r);return!i&&(i=LHe(e,n,r),i&&!UV(e,t,i))?null:i}function yBe(e,t,n,r){var i=V3e(e,t,n,r);return!i&&(i=RF(e,n,r),i&&!UV(e,t,i))?null:i}function bBe(e,t,n,r,i){var a=$4e(e,t);return n&&DP(a),i&&(e=tJe(e,t),rX=r?EP(e):eS(e.l,e.m,e.h)),a}function xBe(e,t,n){e.g=lz(e,t,(rH(),p5),e.b),e.d=lz(e,n,p5,e.b),!(e.g.c==0||e.d.c==0)&&h$e(e)}function SBe(e,t,n){e.g=lz(e,t,(rH(),N5),e.j),e.d=lz(e,n,N5,e.j),!(e.g.c==0||e.d.c==0)&&h$e(e)}function CBe(e,t,n){if(nD(t),n.Ob())for(sde(t,FSe(n.Pb()));n.Ob();)sde(t,e.a),sde(t,FSe(n.Pb()));return t}function wBe(e){QD();var t,n,r=1;for(n=e.Jc();n.Ob();)t=n.Pb(),r=31*r+(t==null?0:xN(t)),r|=0;return r}function TBe(e){var t=new np,n,r;for(r=mL(e,0);r.b!=r.d.c;)n=P(Uk(r),8),RC(t,0,new fx(n));return t}function PP(e){var t,n;for(n=new T(e.a.b);n.a<n.c.c.length;)t=P(z(n),82),t.f.$b();Zse(e.b,e),R8e(e)}function FP(e){var t;return fD(e),t=new ke,e.a.zd(t)?(xS(),new Np(yD(t.a))):(xS(),xS(),Xyt)}function EBe(e){var t;return e.b<=0?!1:(t=Qb(`MLydhHmsSDkK`,IR(jD(e.c,0))),t>1||t>=0&&e.b<3)}function DBe(){bH();var e;return NVt||(e=ipe(oH(`M`,!0)),e=eE(oH(`M`,!1),e),NVt=e,NVt)}function OBe(e){switch(e.g){case 0:return new Tne;default:throw E(new $p(mq+(e.f==null?``+e.g:e.f)))}}function kBe(e){switch(e.g){case 0:return new Na;default:throw E(new $p(mq+(e.f==null?``+e.g:e.f)))}}function ABe(e,t,n){switch(t){case 0:!e.o&&(e.o=new ij((uH(),d7),g7,e,0)),kN(e.o,n);return}vz(e,t,n)}function IP(e,t,n){this.g=e,this.e=new hh,this.f=new hh,this.d=new gg,this.b=new gg,this.a=t,this.c=n}function LP(e,t,n,r){this.b=new Zd,this.n=new Zd,this.i=r,this.j=n,this.s=e,this.t=t,this.r=0,this.d=0}function jBe(e,t,n,r){this.b=new Qd,this.g=new Qd,this.d=(fF(),t4),this.c=e,this.e=t,this.d=n,this.a=r}function RP(e,t){if(!e.Ji()&&t==null)throw E(new $p(`The 'no null' constraint is violated`));return t}function MBe(e){switch(e.g){case 1:return Gpt;default:case 2:return 0;case 3:return Kpt;case 4:return qpt}}function NBe(e){return M(e.c,(xP(),dIt)),HFe(e.a,D(N(hL((vWe(),J2)))))?new mo:new voe(e)}function PBe(e){for(;!e.d||!e.d.Ob();)if(e.b&&!om(e.b))e.d=P(IE(e.b),50);else return null;return e.d}function zP(e){var t=0,n;for(n=0;n<e.length;n++)t=(t<<5)-t+(fk(n,e.length),e.charCodeAt(n))|0;return t}function FBe(e){var t=P(K(e,(Y(),L1)),9),n;t&&(n=t.c,bj(n.a,t),n.a.c.length==0&&bj(_D(t).b,n))}function IBe(e,t){var n=P(J(e,(FB(),X3)),15).a,r=P(J(t,X3),15).a;return n==r||n<r?-1:+(n>r)}function LBe(e,t){for(var n,r,i=e.b;i;){if(n=e.a.Le(t,i.d),n==0)return i;r=n<0?0:1,i=i.a[r]}return null}function BP(e,t){var n;return t===e?!0:j(t,229)?(n=P(t,229),OF(e.Zb(),n.Zb())):!1}function RBe(e,t){return y8e(e,t)?(kz(e.b,P(K(t,(Y(),p1)),22),t),MT(e.a,t),!0):!1}function zBe(e,t){return QC(e,(Y(),N1))&&QC(t,N1)?P(K(t,N1),15).a-P(K(e,N1),15).a:0}function BBe(e,t){return QC(e,(Y(),N1))&&QC(t,N1)?P(K(e,N1),15).a-P(K(t,N1),15).a:0}function VBe(e){return LX?V(abt,Klt,567,0,0,1):P(cL(e.a,V(abt,Klt,567,e.a.c.length,0,1)),840)}function VP(e){return bb(e)?hX:yb(e)?lX:vb(e)?oX:Mbe(e)||lbe(e)?e.Pm:e.Pm||Array.isArray(e)&&O(nyt,1)||nyt}function HP(e,t,n){var r,i=(r=new cp,r);return UM(i,t,n),XA((!e.q&&(e.q=new F(B7,e,11,10)),e.q),i),i}function UP(e){var t,n,r,i=due(Hzt,e);for(n=i.length,r=V(hX,X,2,n,6,1),t=0;t<n;++t)r[t]=i[t];return r}function WP(e,t){var n,r,i,a,o;for(r=t,i=0,a=r.length;i<a;++i)n=r[i],o=new ESe(e),n.tf(o),Knt(o);SE(e.f)}function HBe(e,t){var n;t*2+1>=e.b.c.length||(HBe(e,2*t+1),n=2*t+2,n<e.b.c.length&&HBe(e,n),R0e(e,t))}function UBe(e,t){var n,r;for(r=mL(e,0);r.b!=r.d.c;)n=P(Uk(r),218),n.e.length>0&&(t.Ad(n),n.i&&hKe(n))}function WBe(e,t,n){var r;for(r=n-1;r>=0&&e[r]===t[r];r--);return r<0?0:c_(hk(e[r],dW),hk(t[r],dW))?-1:1}function GBe(e,t){var n;return!e||e==t||!QC(t,(Y(),C1))?!1:(n=P(K(t,(Y(),C1)),9),n!=e)}function GP(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.Yl()}}function KBe(e,t,n){return e.d[t.p][n.p]||(ZKe(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function qBe(e,t,n){var r,i;this.g=e,this.c=t,this.a=this,this.d=this,i=lLe(n),r=V(Qvt,lU,227,i,0,1),this.b=r}function JBe(e,t){var n,r;for(r=e.Zb().Bc().Jc();r.Ob();)if(n=P(r.Pb(),18),n.Gc(t))return!0;return!1}function YBe(e,t,n){var r,i,a,o;for(yD(n),o=!1,a=e.dd(t),i=n.Jc();i.Ob();)r=i.Pb(),a.Rb(r),o=!0;return o}function KP(e,t){var n,r=P(BN(e.a,4),129);return n=V(eBt,kJ,415,t,0,1),r!=null&&hV(r,0,n,0,r.length),n}function XBe(e,t){var n=new LB((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,t);return e.e??(n.c=e),n}function ZBe(e,t){var n;return e===t?!0:j(t,92)?(n=P(t,92),i1e(uE(e),n.vc())):!1}function QBe(e,t,n){var r,i;for(i=n.Jc();i.Ob();)if(r=P(i.Pb(),45),e.ze(t,r.kd()))return!0;return!1}function qP(){qP=C,Szt=new nb(`ELK`,0),Czt=new nb(`JSON`,1),xzt=new nb(`DOT`,2),wzt=new nb(`SVG`,3)}function JP(){JP=C,SMt=new ty(VG,0),M3=new ty(Qpt,1),xMt=new ty(`FAN`,2),bMt=new ty(`CONSTRAINT`,3)}function YP(){YP=C,Djt=new ey(BG,0),s3=new ey(`MIDDLE_TO_MIDDLE`,1),o3=new ey(`AVOID_OVERLAP`,2)}function XP(){XP=C,I3=new cy(BG,0),KMt=new cy(`RADIAL_COMPACTION`,1),qMt=new cy(`WEDGE_COMPACTION`,2)}function ZP(){ZP=C,O4=new jv(`STACKED`,0),E4=new jv(`REVERSE_STACKED`,1),D4=new jv(`SEQUENCED`,2)}function QP(){QP=C,dbt=new T_(`CONCURRENT`,0),RX=new T_(`IDENTITY_FINISH`,1),fbt=new T_(`UNORDERED`,2)}function $P(){$P=C,P8=new My(igt,0),N8=new My(`INCLUDE_CHILDREN`,1),F8=new My(`SEPARATE_CHILDREN`,2)}function eF(){eF=C,NRt=new Mx(15),MRt=new Bx((vH(),t8),NRt),M8=o8,ORt=qIt,kRt=Y6,jRt=Z6,ARt=X6}function tF(){tF=C,jZ=BTe(U(O(C8,1),Z,86,0,[(KF(),y8),b8])),MZ=BTe(U(O(C8,1),Z,86,0,[S8,v8]))}function $Be(e){var t=0,n,r=V(E6,X,8,e.b,0,1);for(n=mL(e,0);n.b!=n.d.c;)r[t++]=P(Uk(n),8);return r}function nF(e,t,n){var r=new gg,i,a;for(a=mL(n,0);a.b!=a.d.c;)i=P(Uk(a),8),MT(r,new fx(i));YBe(e,t,r)}function eVe(e,t){var n=hL((vWe(),J2))!=null&&t.Rg()!=null?D(N(t.Rg()))/D(N(hL(J2))):1;kD(e.b,t,n)}function tVe(e,t){var n=P(e.d.Ac(t),18),r;return n?(r=e.e.hc(),r.Fc(n),e.e.d-=n.gc(),n.$b(),r):null}function nVe(e,t){var n,r=e.c[t];if(r!=0)for(e.c[t]=0,e.d-=r,n=t+1;n<e.a.length;)e.a[n]-=r,n+=n&-n}function rVe(e){var t=e.a.c.length;if(t>0)return xE(t-1,e.a.c.length),kA(e.a,t-1);throw E(new sse)}function iVe(e,t,n){if(t<0)throw E(new Xp(vht+t));t<e.j.c.length?mA(e.j,t,n):(Pke(e,t),M(e.j,n))}function aVe(e,t,n){if(e>t)throw E(new $p(kW+e+Jlt+t));if(e<0||t>n)throw E(new Dm(kW+e+Ylt+t+Hlt+n))}function oVe(e){if(!e.a||!(e.a.i&8))throw E(new em(`Enumeration class expected for layout option `+e.f))}function sVe(e){JTe.call(this,`The given string does not match the expected format for individual spacings.`,e)}function cVe(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e.Zl()}}function rF(e){switch(e.c){case 0:return Mye(),eyt;case 1:return new of(X0e(new hg(e)));default:return new Tp(e)}}function lVe(e){switch(e.gc()){case 0:return Mye(),eyt;case 1:return new of(e.Jc().Pb());default:return new d_(e)}}function uVe(e){var t=(!e.a&&(e.a=new F(R7,e,9,5)),e.a);return t.i==0?null:cue(P(H(t,0),684))}function dVe(e,t){var n=lI(e,t);return c_(_k(e,t),0)|Sb(_k(e,n),0)?n:lI($H,_k(vE(n,63),1))}function fVe(e,t,n){var r,i;return QO(t,e.c.length),r=n.Nc(),i=r.length,i==0?!1:(Tve(e.c,t,r),!0)}function pVe(e,t){for(var n=e.a.length-1,r;t!=e.b;)r=t-1&n,iD(e.a,t,e.a[r]),t=r;iD(e.a,e.b,null),e.b=e.b+1&n}function mVe(e,t){var n=e.a.length-1,r;for(e.c=e.c-1&n;t!=e.c;)r=t+1&n,iD(e.a,t,e.a[r]),t=r;iD(e.a,e.c,null)}function iF(e,t){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),QM(e,t==null?null:(yD(t),t)),e.C&&e.fl(null)}function aF(e){return(e.c!=e.b.b||e.i!=e.g.b)&&(Tf(e.a.c,0),uP(e.a,e.b),uP(e.a,e.g),e.c=e.b.b,e.i=e.g.b),e.a}function oF(e){var t;++e.j,e.i==0?e.g=null:e.i<e.g.length&&(t=e.g,e.g=e.$i(e.i),hV(t,0,e.g,0,e.i))}function hVe(e){var t,n;if(e==null)return null;for(t=0,n=e.length;t<n;t++)if(!Fve(e[t]))return e[t];return null}function sF(e){var t,n,r,i,a=1;for(n=e,r=0,i=n.length;r<i;++r)t=n[r],a=31*a+(t==null?0:xN(t)),a|=0;return a}function cF(e){var t={},n,r,i,a;for(r=e,i=0,a=r.length;i<a;++i)n=r[i],t[`:`+(n.f==null?``+n.g:n.f)]=n;return t}function gVe(e,t,n){var r,i,a,o;for(i=n,a=0,o=i.length;a<o;++a)if(r=i[a],e.b.ze(t,r.jd()))return r;return null}function lF(e,t){return!e||t&&!e.j||j(e,127)&&P(e,127).a.b==0?0:e.ff()}function uF(e,t){return!e||t&&!e.k||j(e,127)&&P(e,127).a.a==0?0:e.gf()}function _Ve(e,t){var n=e,r,i=0;do{if(n==t)return i;if(r=n.e,!r)throw E(new yf);n=_D(r),++i}while(!0)}function vVe(e){var t,n,r=0;for(n=new pE(KS(e.a.Jc(),new f));Vz(n);)t=P(CA(n),17),t.c.i==t.d.i||++r;return r}function yVe(e,t){var n,r,i=t-e.f;for(r=new T(e.d);r.a<r.c.c.length;)n=P(z(r),319),UWe(n,n.e,n.f+i);e.f=t}function bVe(e){var t;for(nD(e),She(!0,`numberToAdvance must be nonnegative`),t=0;t<0&&Vz(e);t++)CA(e);return t}function xVe(e){Vp(),iS(this),nO(this),this.e=e,S5e(this,e),this.g=e==null?FH:OI(e),this.a=``,this.b=e,this.a=``}function SVe(){this.a=new wne,this.f=new loe(this),this.b=new uoe(this),this.i=new doe(this),this.e=new foe(this)}function CVe(){Jse.call(this,new ZMe(RN(16))),KM(2,glt),this.b=2,this.a=new cCe(null,null,0,null),pf(this.a,this.a)}function dF(){dF=C,F4=new Fv(`BARYCENTER`,0),L4=new Fv(tdt,1),R4=new Fv(ndt,2),I4=new Fv(`MEDIAN`,3)}function fF(){fF=C,e4=new Cv(`DUMMY_NODE_OVER`,0),Ckt=new Cv(`DUMMY_NODE_UNDER`,1),t4=new Cv(`EQUAL`,2)}function pF(){pF=C,k4=new Mv(`CONSERVATIVE`,0),Ykt=new Mv(`CONSERVATIVE_SOFT`,1),A4=new Mv(`SLOPPY`,2)}function wVe(e){var t,n;for(n=new T(e.r);n.a<n.c.c.length;)if(t=P(z(n),9),e.n[t.p]<=0)return t;return null}function TVe(e,t){var n;for(n=0;n<t.length;n++)if(e==(fk(n,t.length),t.charCodeAt(n)))return!0;return!1}function EVe(e,t){return t<e.length&&(fk(t,e.length),e.charCodeAt(t)!=63)&&(fk(t,e.length),e.charCodeAt(t)!=35)}function DVe(e,t,n,r){var i,a;e.a=t,a=+!r,e.f=(i=new p1e(e.c,e.a,n,a),new V7e(n,e.a,i,e.e,e.b,e.c==(dF(),L4)))}function mF(e,t){var n,r=e.Wk(t,null),i=null;t&&(i=(bh(),n=new ef,n),mM(i,e.r)),r=PR(e,i,r),r&&r.mj()}function OVe(e,t){var n,r=tB(e.d,1)!=0;for(n=!0;n;)n=!1,n=t.c.kg(t.e,r),n|=hB(e,t,r,!1),r=!r;OLe(e)}function kVe(e,t){var n,r=!1,i;return n=t.q.d,t.d<e.b&&(i=x8e(t.q,e.b),t.q.d>i&&(lZe(t.q,i),r=n!=t.q.d)),r}function AVe(e,t){var n,i,a,o,s,c,l=t.i,u=t.j;return i=e.f,a=i.i,o=i.j,s=l-a,c=u-o,n=r.Math.sqrt(s*s+c*c),n}function jVe(e,t){var n,r=oL(e);return r||(!Uzt&&(Uzt=new Ho),n=(Brt(),z3e(t)),r=new Goe(n),XA(r.Cl(),e)),r}function hF(e,t){var n=P(e.c.Ac(t),18),r;return n?(r=e.hc(),r.Fc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function MVe(e){var t;if(!(e.c.c<0?e.a>=e.c.b:e.a<=e.c.b))throw E(new Cf);return t=e.a,e.a+=e.c.c,++e.b,G(t)}function NVe(e){var t,n;if(e==null)return!1;for(t=0,n=e.length;t<n;t++)if(!Fve(e[t]))return!1;return!0}function PVe(e,t){var n;for(n=0;n<t.length;n++)if(e==(fk(n,t.length),t.charCodeAt(n)))return!0;return!1}function FVe(e){var t;if(e.c!=0)return e.c;for(t=0;t<e.a.length;t++)e.c=e.c*33+(e.a[t]&-1);return e.c*=e.e,e.c}function gF(e){var t;return UC(e.a!=e.b),t=e.d.a[e.a],VC(e.b==e.d.c&&t!=null),e.c=e.a,e.a=e.a+1&e.d.a.length-1,t}function IVe(e){var t=new JPe(e);return Ek(e.a,bSt,new rm(U(O(PZ,1),PH,377,0,[t]))),t.d&&M(t.f,t.d),t.f}function _F(e,t){var n;return qb(e)&&qb(t)&&(n=e-t,!isNaN(n))?n:YYe(qb(e)?KN(e):e,qb(t)?KN(t):t)}function LVe(e,t,n){var r=new a4e(e,t);kz(e.r,t.$f(),r),n&&!TE(e.u)&&(r.c=new NTe(e.d),oM(t.Pf(),new yu(r)))}function vF(e){var t=new rS(e.a);return qN(t,e),W(t,(Y(),P1),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function yF(e){return(rH(),T5).Gc(e.j)?D(N(K(e,(Y(),q1)))):jP(U(O(E6,1),X,8,0,[e.i.n,e.n,e.a])).b}function RVe(e){var t=bx(xAt);return P(K(e,(Y(),v1)),22).Gc((kB(),H$))&&RT(t,(BR(),DZ),(yH(),SQ)),t}function zVe(e){var t,n,r,i=new jf;for(r=new T(e);r.a<r.c.c.length;)n=P(z(r),26),t=i7e(n),vN(i,t);return i}function BVe(e,t,n){var r,i;for(i=t.a.a.ec().Jc();i.Ob();)if(r=P(i.Pb(),60),Iwe(e,r,n))return!0;return!1}function VVe(e,t,n,r){var i,a;for(a=e.Jc();a.Ob();)i=P(a.Pb(),70),i.n.a=t.a+(r.a-i.o.a)/2,i.n.b=t.b,t.b+=i.o.b+n}function HVe(e,t,n,r,i,a,o,s){for(var c=n;a<o;)c>=r||t<n&&s.Le(e[t],e[c])<=0?iD(i,a++,e[t++]):iD(i,a++,e[c++])}function UVe(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function WVe(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function bF(e,t){var n,r,i,a=(i=e?oL(e):null,x0e((r=t,i&&i.El(),r)));return a==t&&(n=oL(e),n&&n.El()),a}function GVe(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new DE(e,1,1,i,t),n?n.lj(r):n=r),n}function KVe(e,t,n){var r,i=e.b;return e.b=t,e.Db&4&&!(e.Db&1)&&(r=new DE(e,1,3,i,t),n?n.lj(r):n=r),n}function qVe(e,t,n){var r,i=e.f;return e.f=t,e.Db&4&&!(e.Db&1)&&(r=new DE(e,1,0,i,t),n?n.lj(r):n=r),n}function JVe(e){var t,n,r,i;if(e!=null){for(n=0;n<e.length;++n)if(t=e[n],t)for(P(t.g,374),i=t.i,r=0;r<i;++r);}}function YVe(e,t){nD(e);try{return e.Gc(t)}catch(e){if(e=fP(e),j(e,211)||j(e,172))return!1;throw E(e)}}function XVe(e,t){nD(e);try{return e.Kc(t)}catch(e){if(e=fP(e),j(e,211)||j(e,172))return!1;throw E(e)}}function ZVe(e,t){nD(e);try{return e._b(t)}catch(e){if(e=fP(e),j(e,211)||j(e,172))return!1;throw E(e)}}function xF(e,t){nD(e);try{return e.xc(t)}catch(e){if(e=fP(e),j(e,211)||j(e,172))return null;throw E(e)}}function QVe(e,t){nD(e);try{return e.Ac(t)}catch(e){if(e=fP(e),j(e,211)||j(e,172))return null;throw E(e)}}function $Ve(e,t,n){var r,i;for(i=e.Jc();i.Ob();){if(r=P(i.Pb(),9),r==t)return-1;if(r==n)return 1}return 0}function eHe(e,t,n){var r=n/e.gc(),i=0,a,o;for(o=e.Jc();o.Ob();)a=P(o.Pb(),186),yVe(a,a.f+r*i),gXe(a,t,r),++i}function tHe(e){var t,n,r;for(r=new T(e.b);r.a<r.c.c.length;)n=P(z(r),218),t=n.c.ig()?n.f:n.a,t&&Zrt(t,n.j)}function nHe(e){var t,n,i=0;for(n=new T(e.a);n.a<n.c.c.length;)t=P(z(n),173),i=r.Math.max(i,t.g);return i}function rHe(e,t){var n=new RL(e);return pl(n,(Zz(),YZ)),W(n,(Y(),P1),t),W(n,(hH(),v2),(TR(),t5)),n}function iHe(e,t){switch(t){case 1:!e.n&&(e.n=new F(f7,e,1,7)),BV(e.n);return;case 2:ZM(e,null);return}Fze(e,t)}function aHe(e){switch(e.g){case 0:return new Ea;case 1:return new Oa;case 2:return new Da;default:return null}}function SF(e){var t,n;return e>-129&&e<128?(kye(),t=e+128,n=wyt[t],!n&&(n=wyt[t]=new Fl(e)),n):new Fl(e)}function G(e){var t,n;return e>-129&&e<128?(lye(),t=e+128,n=vyt[t],!n&&(n=vyt[t]=new Vl(e)),n):new Vl(e)}function oHe(e,t,n,r,i){t==0||r==0||(t==1?i[r]=aqe(i,n,r,e[0]):r==1?i[t]=aqe(i,e,t,n[0]):O4e(e,n,i,t,r))}function sHe(e,t){var n;e.c.length!=0&&(n=P(cL(e,V(GZ,qG,9,e.c.length,0,1)),199),$b(n,new Nee),z2e(n,t))}function cHe(e,t){var n;e.c.length!=0&&(n=P(cL(e,V(GZ,qG,9,e.c.length,0,1)),199),$b(n,new qt),z2e(n,t))}function lHe(e,t){var n;e.a.c.length>0&&(n=P(qT(e.a,e.a.c.length-1),565),RBe(n,t))||M(e.a,new XAe(t))}function uHe(e){fT();var t=e.d.c-e.e.c,n=P(e.g,156);oM(n.b,new kae(t)),oM(n.c,new Aae(t)),pA(n.i,new Hu(t))}function dHe(e){var t=new wm;return t.a+=`VerticalSegment `,jb(t,e.e),t.a+=` `,Mb(t,US(new _m,new T(e.k))),t.a}function fHe(e,t){var n;e.c=t,e.a=oWe(t),e.a<54&&(e.f=(n=t.d>1?yOe(t.a[0],t.a[1]):yOe(t.a[0],0),jk(t.e>0?n:yj(n))))}function CF(e,t){var n=0,r,i;for(i=aI(e,t).Jc();i.Ob();)r=P(i.Pb(),12),n+=K(r,(Y(),L1))==null?0:1;return n}function wF(e,t,n){var r=0,i,a;for(a=mL(e,0);a.b!=a.d.c&&(i=D(N(Uk(a))),!(i>n));)i>=t&&++r;return r}function pHe(e){var t=P(Rj(e.c.c,``),233);return t||(t=new ak(rh(nh(new Wa,``),`Other`)),uL(e.c.c,``,t)),t}function TF(e){var t;return e.Db&64?Kz(e):(t=new tC(Kz(e)),t.a+=` (name: `,kb(t,e.zb),t.a+=`)`,t.a)}function mHe(e,t,n){var r,i=e.sb;return e.sb=t,e.Db&4&&!(e.Db&1)&&(r=new DE(e,1,4,i,t),n?n.lj(r):n=r),n}function EF(e,t,n){var r;e.Zi(e.i+1),r=e.Xi(t,n),t!=e.i&&hV(e.g,t,e.g,t+1,e.i-t),iD(e.g,t,r),++e.i,e.Ki(t,n),e.Li()}function hHe(e,t,n){var r,i=e.r;return e.r=t,e.Db&4&&!(e.Db&1)&&(r=new DE(e,1,8,i,e.r),n?n.lj(r):n=r),n}function gHe(e,t,n){var r=new Wj(e.e,3,13,null,(i=t.c,i||(SH(),e9)),jL(e,t),!1),i;return n?n.lj(r):n=r,n}function _He(e,t,n){var r=new Wj(e.e,4,13,(i=t.c,i||(SH(),e9)),null,jL(e,t),!1),i;return n?n.lj(r):n=r,n}function vHe(e,t){var n,r,i,a;if(t.cj(e.a),a=P(BN(e.a,8),1997),a!=null)for(n=a,r=0,i=n.length;r<i;++r)null.Sm()}function DF(e,t){var n=P(t,681),r=n.cl();return!r&&n.dl(r=j(t,88)?new sb(e,P(t,29)):new aOe(e,P(t,159))),r}function yHe(e){return e-=e>>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function bHe(e){return e?e.i&1?e==J9?oX:e==q9?dX:e==Q9?uX:e==Z9?lX:e==Y9?fX:e==$9?mX:e==X9?sX:cX:e:null}function OF(e,t){return bb(e)?$w(e,t):yb(e)?Yme(e,t):vb(e)?(yD(e),A(e)===A(t)):Mbe(e)?e.Fb(t):lbe(e)?pde(e,t):zDe(e,t)}function xHe(e){var t;return _F(e,0)<0&&(e=LN(_xe(qb(e)?KN(e):e))),t=tE(vE(e,32)),64-(t==0?Az(tE(e))+32:Az(t))}function kF(e,t){var n=new ke;return e.a.zd(n)?(xS(),new Np(yD(cPe(e,n.a,t)))):(fD(e),xS(),xS(),Xyt)}function AF(e,t){switch(t.g){case 2:case 1:return aI(e,t);case 3:case 4:return AI(aI(e,t))}return QD(),QD(),TX}function SHe(e,t){var n;return t.a&&(n=t.a.a.length,e.a?Mb(e.a,e.b):e.a=new nC(e.d),AOe(e.a,t.a,t.d.length,n)),e}function CHe(e){xH();var t,n,r,i;for(n=uKe(),r=0,i=n.length;r<i;++r)if(t=n[r],xj(t.a,e,0)!=-1)return t;return tZ}function wHe(e){throw SP(),E(new jp(`Unexpected typeof result '`+e+`'; please report this bug to the GWT team`))}function THe(e,t,n){if(e<0||t>n)throw E(new Xp(kW+e+Ylt+t+`, size: `+n));if(e>t)throw E(new $p(kW+e+Jlt+t))}function jF(e,t,n){if(t<0)$0e(e,n);else{if(!n.pk())throw E(new $p(Fq+n.ve()+Iq));P(n,69).uk().Ck(e,e.ei(),t)}}function MF(e,t,n){return r.Math.abs(t-e)<JK||r.Math.abs(n-e)<JK?!0:t-e>JK?e-n>JK:n-e>JK}function EHe(e,t,n,r){switch(t){case 1:return!e.n&&(e.n=new F(f7,e,1,7)),e.n;case 2:return e.k}return HJe(e,t,n,r)}function DHe(e){var t;return e.Db&64?Kz(e):(t=new tC(Kz(e)),t.a+=` (source: `,kb(t,e.d),t.a+=`)`,t.a)}function NF(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,2,n,t))}function OHe(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,8,n,t))}function kHe(e,t){var n=(e.Bb&512)!=0;t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,9,n,t))}function PF(e,t){var n=(e.Bb&512)!=0;t?e.Bb|=512:e.Bb&=-513,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,3,n,t))}function FF(e,t){var n=(e.Bb&256)!=0;t?e.Bb|=256:e.Bb&=-257,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,8,n,t))}function AHe(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new DE(e,1,5,i,e.a),n?kZe(n,r):n=r),n}function IF(e,t){var n;return e.b==-1&&e.a&&(n=e.a.nk(),e.b=n?e.c.Eh(e.a.Jj(),n):NI(e.c.Ah(),e.a)),e.c.vh(e.b,t)}function jHe(e,t){var n,r;for(r=new zS(e);r.e!=r.i.gc();)if(n=P(gL(r),29),A(t)===A(n))return!0;return!1}function MHe(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function NHe(e){var t=e.k,n;return t==(Zz(),qZ)?(n=P(K(e,(Y(),g1)),64),n==(rH(),m5)||n==j5):!1}function PHe(e){var t=ROe(e);return xb(t.a,0)?(bg(),bg(),AX):(bg(),new zC(s_(t.a,0)?Fje(t)/jk(t.a):0))}function FHe(e,t){var n=mB(e,t);if(j(n,335))return P(n,38);throw E(new $p(Fq+t+`' is not a valid attribute`))}function LF(e,t,n){var r=e.gc();if(t>r)throw E(new Qw(t,r));if(e.Qi()&&e.Gc(n))throw E(new $p(fJ));e.Ei(t,n)}function IHe(e,t){var n,r;for(r=new zS(e);r.e!=r.i.gc();)if(n=P(gL(r),143),A(t)===A(n))return!0;return!1}function LHe(e,t,n){var r,i,a=(i=Jz(e.b,t),i);return a&&(r=P(IV(Oj(e,a),``),29),r)?B3e(e,r,t,n):null}function RF(e,t,n){var r,i,a=(i=Jz(e.b,t),i);return a&&(r=P(IV(Oj(e,a),``),29),r)?V3e(e,r,t,n):null}function RHe(e){var t,n,r=0;for(n=e.length,t=0;t<n;t++)e[t]==32||e[t]==13||e[t]==10||e[t]==9||(e[r++]=e[t]);return r}function zF(e,t){this.e=t,this.a=xHe(e),this.a<54?this.f=jk(e):this.c=(qB(),_F(e,0)>=0?VI(e):GE(VI(yj(e))))}function zHe(e,t,n,r,i,a){this.e=new Zd,this.f=(BM(),w4),M(this.e,e),this.d=t,this.a=n,this.b=r,this.f=i,this.c=a}function BF(e,t){return e<t?-1:e>t?1:e==t?e==0?BF(1/e,1/t):0:isNaN(e)?+!isNaN(t):-1}function BHe(e){var t=e.a[e.c-1&e.a.length-1];return t==null?null:(e.c=e.c-1&e.a.length-1,iD(e.a,e.c,null),t)}function VHe(e){var t,n;for(n=e.p.a.ec().Jc();n.Ob();)if(t=P(n.Pb(),217),t.f&&e.b[t.c]<-1e-10)return t;return null}function HHe(e){var t=new Zd,n,r;for(r=new T(e.b);r.a<r.c.c.length;)n=P(z(r),591),uP(t,P(n.Af(),18));return t}function UHe(e){var t;if(!e.a)throw E(new em(`Cannot offset an unassigned cut.`));t=e.c-e.b,e.b+=t,pwe(e,t),mwe(e,t)}function VF(){VF=C,$Pt=new gy(`EQUAL_BETWEEN_STRUCTURES`,0),tFt=new gy(`TO_ASPECT_RATIO`,1),eFt=new gy(BG,2)}function HF(){HF=C,a6=new vy(`P1_STRUCTURE`,0),o6=new vy(`P2_PROCESSING_ORDER`,1),s6=new vy(`P3_EXECUTION`,2)}function UF(){UF=C,ozt=new Hy(`PARALLEL_NODE`,0),Y5=new Hy(`HIERARCHICAL_NODE`,1),X5=new Hy(`ROOT_NODE`,2)}function WF(){WF=C,T8=new Oy(igt,0),w8=new Oy(`CONTAINER`,1),dRt=new Oy(`PARENT`,2),fRt=new Oy(`ROOT`,3)}function GF(){GF=C,_Rt=new Ay(UW,0),A8=new Ay(`POLYLINE`,1),k8=new Ay(`ORTHOGONAL`,2),j8=new Ay(`SPLINES`,3)}function KF(){KF=C,x8=new Dy(UW,0),b8=new Dy(VW,1),y8=new Dy(BW,2),v8=new Dy(qW,3),S8=new Dy(`UP`,4)}function WHe(e,t){t.Tg(`Sort end labels`,1),wg(LD(zj(new JT(null,new sk(e.b,16)),new It),new Lt),new Oee),t.Ug()}function GHe(e,t){switch(e.b.g){case 0:case 1:return t;case 2:case 3:return new KD(t.d,0,t.a,t.b);default:return null}}function KHe(e){switch(e.g){case 1:return N5;case 2:return m5;case 3:return p5;case 4:return j5;default:return M5}}function qF(e){switch(e.g){case 1:return j5;case 2:return N5;case 3:return m5;case 4:return p5;default:return M5}}function JF(e){switch(e.g){case 1:return p5;case 2:return j5;case 3:return N5;case 4:return m5;default:return M5}}function qHe(e){switch(e.g){case 2:return b8;case 1:return y8;case 4:return v8;case 3:return S8;default:return x8}}function JHe(e){switch(e){case 0:return new $f;case 1:return new Ose;case 2:return new kse;default:throw E(new yf)}}function YHe(e){switch(P(K(e,(Y(),S1)),315).g){case 1:W(e,S1,(Fj(),e1));break;case 2:W(e,S1,(Fj(),n1))}}function XHe(){XHe=C,jMt=eL(eL(qg(eL(eL(qg(RT(new xD,(QL(),t3),(QB(),a3)),n3),xjt),Cjt),r3),_jt),wjt)}function YF(e,t,n){var r,i;return e.Nj()?(i=e.Oj(),r=I2e(e,t,n),e.Hj(e.Gj(7,G(n),r,t,i)),r):I2e(e,t,n)}function XF(e,t){var n,r,i;e.d==null?(++e.e,--e.f):(i=t.jd(),n=t.yi(),r=(n&kH)%e.d.length,qje(e,r,Q3e(e,r,n,i)))}function ZF(e,t){var n=(e.Bb&AJ)!=0;t?e.Bb|=AJ:e.Bb&=-1025,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,10,n,t))}function QF(e,t){var n=(e.Bb&NJ)!=0;t?e.Bb|=NJ:e.Bb&=-8193,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,15,n,t))}function $F(e,t){var n=(e.Bb&aW)!=0;t?e.Bb|=aW:e.Bb&=-4097,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,12,n,t))}function eI(e,t){var n=(e.Bb&JH)!=0;t?e.Bb|=JH:e.Bb&=-2049,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,11,n,t))}function ZHe(e,t){var n=BF(e.b.c,t.b.c);return n!=0||(n=BF(e.a.a,t.a.a),n!=0)?n:BF(e.a.b,t.a.b)}function tI(e){var t,n=P(K(e,(hH(),P0)),86);return n==(KF(),x8)?(t=D(N(K(e,d0))),t>=1?b8:v8):n}function QHe(e){var t,n;for(n=U3e(cM(e)).Jc();n.Ob();)if(t=gw(n.Pb()),uV(e,t))return sAe((nue(),yBt),t);return null}function $He(e,t,n){var r,i;for(i=e.a.ec().Jc();i.Ob();)if(r=P(i.Pb(),9),dP(n,P(qT(t,r.p),18)))return r;return null}function eUe(e,t,n){var r,i=j(t,103)&&(P(t,19).Bb&sW)!=0?new ix(t,e):new YN(t,e);for(r=0;r<n;++r)DL(i);return i}function tUe(e,t){var n,r,i,a,o=xB(e.e.Ah(),t);for(a=0,n=P(e.g,122),i=0;i<e.i;++i)r=n[i],o.$l(r.Jk())&&++a;return a}function nUe(e,t,n){var r,i;if(e.c)WQe(e.c,t,n);else for(i=new T(e.b);i.a<i.c.c.length;)r=P(z(i),167),nUe(r,t,n)}function nI(e,t){var n,r;for(r=new T(t);r.a<r.c.c.length;)n=P(z(r),49),bj(e.b.b,n.b),Fwe(P(n.a,194),P(n.b,82))}function rUe(e,t){var n,r,i;for(yD(t),n=!1,r=new T(e);r.a<r.c.c.length;)i=z(r),t.Gc(i)&&(VE(r),n=!0);return n}function iUe(e){var t,n=oD(new wm,91);for(t=!0;e.Ob();)t||(n.a+=NH),t=!1,jb(n,e.Pb());return(n.a+=`]`,n).a}function aUe(e){var t=V(K9,CU,30,2,15,1);return e-=sW,t[0]=(e>>10)+cW&wU,t[1]=(e&1023)+56320&wU,$I(t,0,t.length)}function oUe(e,t){var n=(e.Bb&sW)!=0;t?e.Bb|=sW:e.Bb&=-65537,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,20,n,t))}function rI(e,t){var n=(e.Bb&YH)!=0;t?e.Bb|=YH:e.Bb&=-16385,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,16,n,t))}function iI(e,t){var n=(e.Bb&Rq)!=0;t?e.Bb|=Rq:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,18,n,t))}function sUe(e,t){var n=(e.Bb&Rq)!=0;t?e.Bb|=Rq:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&FN(e,new vA(e,1,18,n,t))}function aI(e,t){var n;return e.i||Q0e(e),n=P(AD(e.g,t),49),n?new ik(e.j,P(n.a,15).a,P(n.b,15).a):(QD(),QD(),TX)}function cUe(e,t,n){var r=P(t.mf(e.a),35),i=P(n.mf(e.a),35);return r!=null&&i!=null?ON(r,i):r==null?i==null?0:1:-1}function lUe(e,t,n){var r=(vh(),i=new So,i),i;return yM(r,t),bM(r,n),e&&XA((!e.a&&(e.a=new MS(e7,e,5)),e.a),r),r}function uUe(e,t,n){var r=0;return t&&(vx(e.a)?r+=t.f.a/2:r+=t.f.b/2),n&&(vx(e.a)?r+=n.f.a/2:r+=n.f.b/2),r}function oI(e,t,n){var r=e.a.get(t);return e.a.set(t,n===void 0?null:n),r===void 0?(++e.c,++e.b.g):++e.d,r}function sI(e){var t;return e.Db&64?Kz(e):(t=new tC(Kz(e)),t.a+=` (identifier: `,kb(t,e.k),t.a+=`)`,t.a)}function cI(e){var t;switch(e.gc()){case 0:return VT(),YY;case 1:return new Kw(nD(e.Xb(0)));default:return t=e,new yk(t)}}function dUe(e){switch(P(K(e,(hH(),z0)),222).g){case 1:return new kr;case 3:return new Ote;default:return new Or}}function fUe(e){var t=JR(e);return t>34028234663852886e22?rW:t<-34028234663852886e22?iW:t}function lI(e,t){var n;return qb(e)&&qb(t)&&(n=e+t,eW<n&&n<QU)?n:LN(kze(qb(e)?KN(e):e,qb(t)?KN(t):t))}function uI(e,t){var n;return qb(e)&&qb(t)&&(n=e*t,eW<n&&n<QU)?n:LN(mit(qb(e)?KN(e):e,qb(t)?KN(t):t))}function dI(e,t){var n;return qb(e)&&qb(t)&&(n=e-t,eW<n&&n<QU)?n:LN(Aze(qb(e)?KN(e):e,qb(t)?KN(t):t))}function pUe(e,t,n){var r;try{CBe(e,t,n)}catch(e){throw e=fP(e),j(e,595)?(r=e,E(new wje(r))):E(e)}return t}function fI(e){var t=new Zd,n,r;for(r=new T(e.j);r.a<r.c.c.length;)n=P(z(r),12),M(t,n.e);return nD(t),new px(t)}function pI(e){var t=new Zd,n,r;for(r=new T(e.j);r.a<r.c.c.length;)n=P(z(r),12),M(t,n.b);return nD(t),new px(t)}function mI(e){var t=new Zd,n,r;for(r=new T(e.j);r.a<r.c.c.length;)n=P(z(r),12),M(t,n.g);return nD(t),new px(t)}function mUe(e,t,n){var r=n;!r&&(r=Vve(new gp,0)),r.Tg(zut,2),eqe(e.b,t,r.dh(1)),jit(e,t,r.dh(1)),Dst(t,r.dh(1)),r.Ug()}function hUe(e,t,n){var r;n.Tg(`Straight Line Edge Routing`,1),n.bh(t,umt),r=P(J(t,(xw(),N3)),26),frt(e,r),n.bh(t,aq)}function gUe(e,t){e.n.c.length==0&&M(e.n,new jO(e.s,e.t,e.i)),M(e.b,t),Gqe(P(qT(e.n,e.n.c.length-1),208),t),cnt(e,t)}function _Ue(e){var t,n;for(n=t3e(cM(WO(e))).Jc();n.Ob();)if(t=gw(n.Pb()),uV(e,t))return cAe((rue(),bBt),t);return null}function vUe(e){var t=new gme(e.Pd().gc()),n,r,i=0;for(r=cj(e.Pd().Jc());r.Ob();)n=r.Pb(),iwe(t,n,G(i++));return Z$e(t.a)}function yUe(e){var t,n,r;for(n=0,r=e.length;n<r;n++)if(e[n]==null)throw E(new tm(`at index `+n));return t=e,new rm(t)}function hI(e){if(e.c)hI(e.c);else if(e.d)throw E(new em(`Stream already terminated, can't be modified or used`))}function bUe(e,t,n){switch(t.g){case 1:e.b-=n.b/2;break;case 3:e.b+=n.b/2;break;case 4:e.a-=n.a/2;break;case 2:e.a+=n.a/2}}function xUe(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function SUe(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function CUe(e,t,n,r,i){nfe(this),this.b=e,this.d=V(GZ,qG,9,t.a.c.length,0,1),this.f=n,cL(t.a,this.d),this.g=r,this.c=i}function gI(){lQe();var e,t,n=ebt+++Date.now();e=AO(r.Math.floor(n*SW))&CW,t=AO(n-e*Vlt),this.a=e^1502,this.b=t^xW}function wUe(e){return tF(),XS(),!!(SUe(P(e.a,82).j,P(e.b,86))||P(e.a,82).d.e!=0&&SUe(P(e.a,82).j,P(e.b,86)))}function _I(e,t){var n,r,i=0;for(r=P(t.Kb(e),20).Jc();r.Ob();)n=P(r.Pb(),17),sm(hw(K(n,(Y(),H1))))||++i;return i}function vI(e){var t,n=(t=P(Ch((r=e.Pm,i=r.f,i==qY?r:i)),10),new lT(t,P(Ww(t,t.length),10),0)),r,i;return rN(n,e),n}function TUe(e,t){var n,i=D(N(UI(lk(t),(hH(),O2))));n=r.Math.max(0,i/2-.5),oR(t,n,1),M(e,new Q_(t,n))}function EUe(e,t){for(var n=mL(e,0),r;n.b!=n.d.c;){if(r=cm(N(Uk(n))),r==t)return;if(r>t){mOe(n);break}}KE(n,t)}function yI(e,t){var n=t.f,r,i,a,o;if(uL(e.c.d,n,t),t.g!=null)for(i=t.g,a=0,o=i.length;a<o;++a)r=i[a],uL(e.c.e,r,t)}function DUe(e,t,n,r){var i,a,o;for(i=t+1;i<n;++i)for(a=i;a>t&&r.Le(e[a-1],e[a])>0;--a)o=e[a],iD(e,a,e[a-1]),iD(e,a-1,o)}function bI(e,t,n,r){if(t<0)F6e(e,n,r);else{if(!n.pk())throw E(new $p(Fq+n.ve()+Iq));P(n,69).uk().Ak(e,e.ei(),t,r)}}function OUe(e,t){var n=mB(e.Ah(),t);if(j(n,103))return P(n,19);throw E(new $p(Fq+t+`' is not a valid reference`))}function xI(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw E(new $p(`Node `+t+` not part of edge `+e))}function kUe(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return EHe(e,t,n,r)}function AUe(e){return e.k==(Zz(),ZZ)?hA(new JT(null,new qE(new pE(KS(mI(e).a.Jc(),new f)))),new hte):!1}function SI(){SI=C,o0=new bv(BG,0),n0=new bv(`FIRST`,1),r0=new bv(odt,2),i0=new bv(`LAST`,3),a0=new bv(sdt,4)}function CI(){CI=C,d$=new av(`LAYER_SWEEP`,0),nwt=new av(`MEDIAN_LAYER_SWEEP`,1),u$=new av(ldt,2),rwt=new av(BG,3)}function wI(){wI=C,ePt=new py(`ASPECT_RATIO_DRIVEN`,0),tPt=new py(`MAX_SCALE_DRIVEN`,1),$Nt=new py(`AREA_DRIVEN`,2)}function TI(){TI=C,_zt=new Wy(Ppt,0),mzt=new Wy(`GROUP_DEC`,1),gzt=new Wy(`GROUP_MIXED`,2),hzt=new Wy(`GROUP_INC`,3)}function jUe(e,t){return $w(t.b&&t.c?xk(t.b)+`->`+xk(t.c):`e_`+xN(t),e.b&&e.c?xk(e.b)+`->`+xk(e.c):`e_`+xN(e))}function MUe(e,t){return $w(t.b&&t.c?xk(t.b)+`->`+xk(t.c):`e_`+xN(t),e.b&&e.c?xk(e.b)+`->`+xk(e.c):`e_`+xN(e))}function EI(e,t){return Wx(),LM(_U),r.Math.abs(e-t)<=_U||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:Hw(isNaN(e),isNaN(t))}function NUe(e){vWe(),this.c=TA(U(O(pIt,1),PH,829,0,[hkt])),this.b=new Qd,this.a=e,kD(this.b,J2,1),oM(gkt,new bd(this))}function DI(e){var t;this.a=(t=P(e.e&&e.e(),10),new lT(t,P(Ww(t,t.length),10),0)),this.b=V(RY,PH,1,this.a.a.length,5,1)}function OI(e){var t;return Array.isArray(e)&&e.Rm===ne?kh(VP(e))+`@`+(t=xN(e)>>>0,t.toString(16)):e.toString()}function PUe(e){var t;return e==null?!0:(t=e.length,t>0&&(fk(t-1,e.length),e.charCodeAt(t-1)==58)&&!FUe(e,O7,k7))}function FUe(e,t,n){var r,i;for(r=0,i=e.length;r<i;r++)if(CP((fk(r,e.length),e.charCodeAt(r)),t,n))return!0;return!1}function IUe(e,t){var n,r=v9e(e,t),i=r[r.length-1]/2;for(n=0;n<r.length;n++)if(r[n]>=i)return t.c+n;return t.c+t.b.gc()}function LUe(e,t){Sw();var n,r=TNe(e),i=t,a;for(uj(r,0,r.length,i),n=0;n<r.length;n++)a=AYe(e,r[n],n),n!=a&&YF(e,n,a)}function RUe(e,t){var n,r=0,i,a,o,s;for(n=0,a=t,o=0,s=a.length;o<s;++o)i=a[o],i>0&&(r+=i,++n);return n>1&&(r+=e.d*(n-1)),r}function zUe(e){var t,n,r=new Sm;for(r.a+=`[`,t=0,n=e.gc();t<n;)kb(r,YS(e.Ti(t))),++t<n&&(r.a+=NH);return r.a+=`]`,r.a}function BUe(e,t,n,r,i){for(var a,o=i,s;t.b!=t.c;)a=P(IE(t),9),s=P(aI(a,r).Xb(0),12),e.d[s.p]=o++,ff(n.c,s);return o}function VUe(e){var t,n,r,i,a=_Qe(e);return n=cg(e.c),r=!n,r&&(i=new ll,Xj(a,`knownLayouters`,i),t=new Pd(i),pA(e.c,t)),a}function HUe(e,t){var n;return A(e)===A(t)?!0:j(t,91)?(n=P(t,91),e.e==n.e&&e.d==n.d&&vAe(e,n.a)):!1}function UUe(e){return e.e==null?e:(!e.c&&(e.c=new LB((e.f&256)!=0,e.i,e.a,e.d,(e.f&16)!=0,e.j,e.g,null)),e.c)}function WUe(e,t){return e.h==XU&&e.m==0&&e.l==0?(t&&(rX=eS(0,0,0)),mde((Ij(),fyt))):(t&&(rX=eS(e.l,e.m,e.h)),eS(0,0,0))}function kI(e){var t;if(e.b){if(kI(e.b),e.b.d!=e.c)throw E(new vf)}else e.d.dc()&&(t=P(e.f.c.xc(e.e),18),t&&(e.d=t))}function GUe(e){var t,n,r=D(N(e.a.mf((vH(),u8))));for(n=new T(e.a.Qf());n.a<n.c.c.length;)t=P(z(n),685),Pst(e,t,r)}function KUe(e){Cw();var t=e.o.b,n,r,i;for(r=P(P(wA(e.r,(rH(),j5)),22),83).Jc();r.Ob();)n=P(r.Pb(),115),i=n.e,i.b+=t}function qUe(e,t,n){var r,i=e.a.b;for(r=i.c.length;r<n;r++)rE(i,0,new lD(e.a));YO(t,P(qT(i,i.c.length-n),25)),e.b[t.p]=n}function JUe(e,t){var n,r;for(r=new T(t);r.a<r.c.c.length;)n=P(z(r),49),M(e.b.b,P(n.b,82)),Ck(P(n.a,194),P(n.b,82))}function YUe(e){var t=e.e;function n(e){return!e||e.length==0?``:` `+e.join(`
15
15
  `)}return t&&(t.stack||n(e[SU]))}function AI(e){var t,n;return j(e,311)?(n=Nje(P(e,311)),t=n,t):j(e,432)?P(e,432).a:j(e,59)?new Ep(e):new xle(e)}function jI(e){switch(rH(),e.g){case 4:return m5;case 1:return p5;case 3:return j5;case 2:return N5;default:return M5}}function XUe(e,t){switch(t){case 3:return e.f!=0;case 4:return e.g!=0;case 5:return e.i!=0;case 6:return e.j!=0}return ZRe(e,t)}function ZUe(e){switch(e.g){case 0:return new fa;case 1:return new Sne;default:throw E(new $p(rdt+(e.f==null?``+e.g:e.f)))}}function QUe(e){switch(e.g){case 0:return new xne;case 1:return new pa;default:throw E(new $p(gmt+(e.f==null?``+e.g:e.f)))}}function $Ue(e){switch(e.g){case 1:return new sa;case 2:return new Upe;default:throw E(new $p(gmt+(e.f==null?``+e.g:e.f)))}}function eWe(e){switch(e.g){case 0:return new hp;case 1:return new Ase;default:throw E(new $p(mq+(e.f==null?``+e.g:e.f)))}}function tWe(e,t,n,r,i){$O(),yB(kg(Og(Dg(Ag(new Bf,0),i.d.e-e),t),i.d)),yB(kg(Og(Dg(Ag(new Bf,0),n-i.a.e),i.a),r))}function nWe(e,t){var n,r,i,a;t&&(i=NM(t,`x`),n=new joe(e),EM(n.a,(yD(i),i)),a=NM(t,`y`),r=new Ad(e),DM(r.a,(yD(a),a)))}function rWe(e,t){var n,r,i,a;t&&(i=NM(t,`x`),n=new Noe(e),xM(n.a,(yD(i),i)),a=NM(t,`y`),r=new Poe(e),SM(r.a,(yD(a),a)))}function iWe(e,t){var n,r,i=new VA(t.gc()),a;for(r=t.Jc();r.Ob();)n=r.Pb(),a=aV(e,P(n,57)),a&&ff(i.c,a);return i}function MI(e,t,n){var r,i;for(i=e.Jc();i.Ob();)if(r=i.Pb(),A(t)===A(r)||t!=null&&OF(t,r))return n&&i.Qb(),!0;return!1}function aWe(e){var t,n=e.ih(),r;return n?(t=e.Bh(),j(t,174)&&(r=aWe(P(t,174)),r!=null)?r+`.`+n:n):null}function oWe(e){var t,n,r;return e.e==0?0:(t=e.d<<5,n=e.a[e.d-1],e.e<0&&(r=_Re(e),r==e.d-1&&(--n,n|=0)),t-=Az(n),t)}function sWe(e){var t,n;if(e.b)return e.b;for(n=LX?null:e.d;n;){if(t=LX?null:n.b,t)return t;n=LX?null:n.d}return xg(),obt}function cWe(e,t){var n;return e.d?PE(e.b,t)?P(sD(e.b,t),43):(n=t.bg(),kD(e.b,t,n),n):t.bg()}function lWe(e,t,n){var r,i;if(++e.j,n.dc())return!1;for(i=n.Jc();i.Ob();)r=i.Pb(),e.oj(t,e.Xi(t,r)),++t;return!0}function uWe(e,t){var n,r;if(t){for(n=0;n<e.i;++n)if(r=P(e.g[n],373),r.kj(t))return!1;return XA(e,t)}else return!1}function dWe(e){var t=new ll,n,r,i;for(i=new Xl(e.b.Jc());i.b.Ob();)r=P(i.b.Pb(),690),n=l1e(r),Lxe(t,t.a.length,n);return t.a}function fWe(e){var t;return!e.c&&(e.c=new qe),Yx(e.d,new see),l7e(e),t=Q5e(e),wg(new JT(null,new sk(e.d,16)),new bu(e)),t}function pWe(e,t){t.Tg(`End label post-processing`,1),wg(LD(zj(new JT(null,new sk(e.b,16)),new Cee),new wee),new Tee),t.Ug()}function mWe(e){var t,n,r,i;for(t=(e.j??=(MO(),i=ayt.ke(e),FXe(i)),e.j),n=0,r=t.length;n<r;++n);}function NI(e,t){var n=(e.i??vV(e),e.i),r=t.Jj(),i;if(r!=-1){for(i=n.length;r<i;++r)if(n[r]==t)return r}return-1}function hWe(e){var t,n=P(e.g,679),r,i,a;for(r=e.i-1;r>=0;--r)for(t=n[r],i=0;i<r;++i)if(a=n[i],Ptt(e,t,a)){ZL(e,r);break}}function gWe(e){mj(),P(e.mf((vH(),Q6)),182).Gc((iV(),q5))&&(P(e.mf(i8),182).Ec((Sz(),d5)),P(e.mf(Q6),182).Kc(q5))}function _We(e){var t=e.d==(uz(),r$),n=EZe(e);t&&!n||!t&&n?W(e.a,(hH(),l0),(kL(),A6)):W(e.a,(hH(),l0),(kL(),k6))}function vWe(){vWe=C,Bg(),J2=(hH(),R2),gkt=TA(U(O(yIt,1),Mpt,147,0,[D2,O2,A2,j2,P2,F2,I2,L2,B2,H2,k2,M2,z2]))}function yWe(e,t){var n=P(sA(e,nj(new Ce,new Se,new Ae,U(O(zX,1),Z,130,0,[(QP(),RX)]))),16);return n.Oc(cye(n.gc()))}function bWe(e){var t,n,r;return e<bX.length?bX[e]:(n=e>>5,t=e&31,r=V(q9,RU,30,n+1,15,1),r[n]=1<<t,new jE(1,n+1,r))}function xWe(e,t){var n,r=new su(e.a.$c(t,!0));if(r.a.gc()<=1)throw E(new xf);return n=r.a.ec().Jc(),n.Pb(),P(n.Pb(),40)}function SWe(e,t,n){var r=D(e.p[t.i.p])+D(e.d[t.i.p])+t.n.b+t.a.b;return D(e.p[n.i.p])+D(e.d[n.i.p])+n.n.b+n.a.b-r}function CWe(e,t){var n;return e.i>0&&(t.length<e.i&&(n=MM(VP(t).c,e.i),t=n),hV(e.g,0,t,0,e.i)),t.length>e.i&&iD(t,e.i,null),t}function PI(e){var t;return e.Db&64?TF(e):(t=new tC(TF(e)),t.a+=` (instanceClassName: `,kb(t,e.D),t.a+=`)`,t.a)}function FI(e){var t,n,r,i=0;for(n=0,r=e.length;n<r;n++)t=(fk(n,e.length),e.charCodeAt(n)),t<64&&(i=gk(i,gE(1,t)));return i}function wWe(e,t,n){var r=hk(n,dW),i;for(i=0;_F(r,0)!=0&&i<t;i++)r=lI(r,hk(e[i],dW)),e[i]=tE(r),r=_E(r,32);return tE(r)}function II(e,t){dde();var n=zw((Up(),Up(),eX)),r=null;return t==n&&(r=P(DO(oyt,e),615)),r||(r=new cSe(e),t==n&&KO(oyt,e,r)),r}function TWe(e){Cw();var t=new fx(P(e.e.mf((vH(),Z6)),8));return e.B.Gc((iV(),U5))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function LI(e,t){var n,r,i,a=xB(e.e.Ah(),t);for(n=P(e.g,122),i=0;i<e.i;++i)if(r=n[i],a.$l(r.Jk()))return!1;return!0}function EWe(e,t){var n,r,i;return e.f>0?(e.Zj(),r=t==null?0:xN(t),i=(r&kH)%e.d.length,n=Q3e(e,i,r,t),n!=-1):!1}function RI(e,t,n){var r,i,a;return e.Nj()?(r=e.i,a=e.Oj(),EF(e,r,t),i=e.Gj(3,null,t,r,a),n?n.lj(i):n=i):EF(e,e.i,t),n}function zI(e,t){var n,r,i;return e.f>0&&(e.Zj(),r=t==null?0:xN(t),i=(r&kH)%e.d.length,n=H2e(e,i,r,t),n)?n.kd():null}function DWe(e,t,n){var r=new Wj(e.e,3,10,null,(i=t.c,j(i,88)?P(i,29):(SH(),t9)),jL(e,t),!1),i;return n?n.lj(r):n=r,n}function OWe(e,t,n){var r=new Wj(e.e,4,10,(i=t.c,j(i,88)?P(i,29):(SH(),t9)),null,jL(e,t),!1),i;return n?n.lj(r):n=r,n}function kWe(e,t){var n,r,i;return j(t,45)?(n=P(t,45),r=n.jd(),i=xF(e.Pc(),r),gD(i,n.kd())&&(i!=null||e.Pc()._b(r))):!1}function AWe(e,t){switch(t){case 3:vM(e,0);return;case 4:CM(e,0);return;case 5:wM(e,0);return;case 6:TM(e,0);return}iHe(e,t)}function BI(e,t){switch(t.g){case 1:return vT(e.j,(SN(),MSt));case 2:return vT(e.j,(SN(),PSt));default:return QD(),QD(),TX}}function VI(e){qB();var t,n=tE(e);return t=tE(vE(e,32)),t==0?n>10||n<0?new Yk(1,n):Fyt[n]:new ODe(n,t)}function jWe(e){return OL(),(e.q?e.q:(QD(),QD(),EX))._b((hH(),s2))?P(K(e,s2),203):P(K(_D(e),c2),203)}function MWe(e,t,n,r){var i,a=n-t;if(a<3)for(;a<3;)e*=10,++a;else{for(i=1;a>3;)i*=10,--a;e=(e+(i>>1))/i|0}return r.i=e,!0}function NWe(e,t,n){sIe(),Qf.call(this),this.a=BT(wbt,[X,mut],[592,216],0,[JX,qX],2),this.c=new Ax,this.g=e,this.f=t,this.d=n}function PWe(e){this.e=V(q9,RU,30,e.length,15,1),this.c=V(J9,LW,30,e.length,16,1),this.b=V(J9,LW,30,e.length,16,1),this.f=0}function FWe(e){var t,n;for(e.j=V(Z9,lW,30,e.p.c.length,15,1),n=new T(e.p);n.a<n.c.c.length;)t=P(z(n),9),e.j[t.p]=t.o.b/e.i}function IWe(e){var t,n,r=c0e(e),i;for(Yx(r,zSt),i=e.d,i.c.length=0,n=new T(r);n.a<n.c.c.length;)t=P(z(n),455),uP(i,t.b)}function HI(e,t){var n;Eot(t),n=P(K(e,(hH(),R0)),284),n&&W(e,R0,YJe(n)),EC(e.c),EC(e.f),VMe(e.d),VMe(P(K(e,r2),213))}function LWe(e,t){var n;return qb(e)&&qb(t)&&(n=e%t,eW<n&&n<QU)?n:LN((Fit(qb(e)?KN(e):e,qb(t)?KN(t):t,!0),rX))}function RWe(e,t){e.Vj();try{e.d._c(e.e++,t),e.f=e.d.j,e.g=-1}catch(e){throw e=fP(e),j(e,99)?E(new vf):E(e)}}function zWe(){zWe=C,KBt=new Wne,zBt=new Gne,BBt=new Wo,VBt=new Go,HBt=new Ko,UBt=new qo,WBt=new Jo,GBt=new Yo,qBt=new Xo}function BWe(){BWe=C,YRt=new Mx(15),JRt=new Bx((vH(),t8),YRt),ZRt=new Bx(d8,15),XRt=new Bx(VLt,G(0)),qRt=new Bx(L6,cG)}function VWe(e,t){var n,i;e.a=lI(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d+=t,n=t-e.f,i=e.e+n,e.f=i-e.e-n,e.e=i}function HWe(e,t){var n,r,i,a=t.b.b;for(e.a=new gg,e.b=V(q9,RU,30,a,15,1),n=0,i=mL(t.b,0);i.b!=i.d.c;)r=P(Uk(i),40),r.g=n++}function UI(e,t){var n,r=null;return QC(e,(hH(),N2))&&(n=P(K(e,N2),105),n.nf(t)&&(r=n.mf(t))),r??=K(_D(e),t),r}function WI(e,t){var n,r=t.length;for(n=0;n<r;n+=2)EB(e,(fk(n,t.length),t.charCodeAt(n)),(fk(n+1,t.length),t.charCodeAt(n+1)))}function UWe(e,t,n){var r,i,a=t-e.e,o=n-e.f;for(i=new T(e.a);i.a<i.c.c.length;)r=P(z(i),173),NL(r,r.s+a,r.t+o);e.e=t,e.f=n}function WWe(e,t,n){var i,a,o,s=e.k,c=t.k;return i=n[s.g][c.g],a=N(UI(e,i)),o=N(UI(t,i)),r.Math.max((yD(a),a),(yD(o),o))}function GWe(e,t,n){var r=P(DO(L9,t),121),i=P(DO(R9,t),121);n?(KO(L9,e,r),KO(R9,e,i)):(KO(R9,e,r),KO(L9,e,i))}function KWe(e,t){var n=t>>5,r,i,a;return t&=31,i=e.d+n+(t==0?0:1),r=V(q9,RU,30,i,15,1),xQe(r,e.a,n,t),a=new jE(e.e,i,r),wk(a),a}function GI(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Le(t,a.d),n&&r==0)return a;r>=0?a=a.a[1]:(i=a,a=a.a[0])}return i}function KI(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Le(t,a.d),n&&r==0)return a;r<=0?a=a.a[0]:(i=a,a=a.a[1])}return i}function qWe(e,t){for(var n=0;!t[n]||t[n]==``;)n++;for(var r=t[n++];n<t.length;n++)!t[n]||t[n]==``||(r+=e+t[n]);return r}function JWe(e,t){t.Tg(`Min Size Postprocessing`,1),CL(e,(zB(),J3),r.Math.max(D(N(J(e,J3))),D(N(J(e,K3))))),t.Ug()}function YWe(e){if(e.b==null){for(;e.a.Ob();)if(e.b=e.a.Pb(),!P(e.b,52).Gh())return!0;return e.b=null,!1}else return!0}function XWe(){return Error.stackTraceLimit>0?(r.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):`stack`in Error()}function ZWe(e){var t=e.a;do t=P(CA(new pE(KS(mI(t).a.Jc(),new f))),17).d.i,t.k==(Zz(),YZ)&&M(e.e,t);while(t.k==(Zz(),YZ))}function QWe(e,t){var n,r,i;for(r=new pE(KS(mI(e).a.Jc(),new f));Vz(r);)if(n=P(CA(r),17),i=n.d.i,i.c==t)return!1;return!0}function $We(e,t,n){var r,i=P(sD(e.b,n),171),a,o;for(r=0,o=new T(t.j);o.a<o.c.c.length;)a=P(z(o),113),i[a.d.p]&&++r;return r}function eGe(e,t,n,r){var i=!1,a,o;return jat(e.f,n,r)&&(JGe(e.f,e.a[t][n],e.a[t][r]),a=e.a[t],o=a[r],a[r]=a[n],a[n]=o,i=!0),i}function tGe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Zd,n=UP(e),r=0,i=n.length;r<i;++r)t=n[r],M(a,NV(t,!0));return a}function nGe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Zd,n=UP(e),r=0,i=n.length;r<i;++r)t=n[r],M(a,NV(t,!0));return a}function rGe(e){var t,n,r,i,a;if(e==null)return null;for(a=new Zd,n=UP(e),r=0,i=n.length;r<i;++r)t=n[r],M(a,NV(t,!0));return a}function iGe(e){var t=P(BN(e.a,4),129),n;return t==null?nBt:(n=V(eBt,kJ,415,t.length,0,1),hV(t,0,n,0,t.length),n)}function aGe(e){var t;e.c!=0&&(t=P(qT(e.a,e.b),295),t.b==1?(++e.b,e.b<e.a.c.length&&Pl(P(qT(e.a,e.b),295))):--t.b,--e.c)}function qI(){qI=C,B3=new dy(`P1_WIDTH_APPROXIMATION`,0),V3=new dy(`P2_PACKING`,1),BNt=new dy(`P3_WHITESPACE_ELIMINATION`,2)}function JI(){JI=C,_4=new Dv(BG,0),Ikt=new Dv(`NODES_AND_EDGES`,1),v4=new Dv(`PREFER_EDGES`,2),y4=new Dv(`PREFER_NODES`,3)}function YI(){YI=C,R5=new By(`PORTS`,0),z5=new By(`PORT_LABELS`,1),L5=new By(`NODE_LABELS`,2),I5=new By(`MINIMUM_SIZE`,3)}function oGe(e,t){return Wx(),Wx(),LM(_U),(r.Math.abs(e-t)<=_U||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:Hw(isNaN(e),isNaN(t)))>0}function sGe(e,t){return Wx(),Wx(),LM(_U),(r.Math.abs(e-t)<=_U||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:Hw(isNaN(e),isNaN(t)))<0}function cGe(e,t){return Wx(),Wx(),LM(_U),(r.Math.abs(e-t)<=_U||e==t||isNaN(e)&&isNaN(t)?0:e<t?-1:e>t?1:Hw(isNaN(e),isNaN(t)))<=0}function lGe(e){switch(e.g){case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:return!0;default:return!1}}function uGe(e,t,n,r,i,a){this.a=e,this.c=t,this.b=n,this.f=r,this.d=i,this.e=a,this.c>0&&this.b>0&&(this.g=WT(this.c,this.b,this.a))}function dGe(e,t){var n=e.a,r;t=String(t),n.hasOwnProperty(t)&&(r=n[t]);var i=(SP(),nX)[typeof r];return i?i(r):wHe(typeof r)}function XI(e){var t,n,r=null;if(t=aJ in e.a,n=!t,n)throw E(new um(`Every element must have an id.`));return r=Cz(RO(e,aJ)),r}function ZI(e){var t,n=x1e(e);for(t=null;e.c==2;)mH(e),t||(t=(bH(),bH(),++W9,new Kx(2)),zV(t,n),n=t),n.Hm(x1e(e));return n}function QI(e,t){var n,r,i;return e.Zj(),r=t==null?0:xN(t),i=(r&kH)%e.d.length,n=H2e(e,i,r,t),n?(OIe(e,n),n.kd()):null}function $I(e,t,n){var i,a,o=t+n,s;for(YA(t,o,e.length),s=``,a=t;a<o;)i=r.Math.min(a+1e4,o),s+=xCe(e.slice(a,i)),a=i;return s}function fGe(e,t){var n,r,i;if(e.c)vM(e.c,t);else for(n=t-GT(e),i=new T(e.a);i.a<i.c.c.length;)r=P(z(i),167),fGe(r,GT(r)+n)}function pGe(e,t){var n,r,i;if(e.c)CM(e.c,t);else for(n=t-KT(e),i=new T(e.d);i.a<i.c.c.length;)r=P(z(i),167),pGe(r,KT(r)+n)}function mGe(e,t){return e.e>t.e?1:e.e<t.e?-1:e.d>t.d?e.e:e.d<t.d?-t.e:e.e*WBe(e.a,t.a,e.d)}function hGe(e){return e>=48&&e<48+r.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function gGe(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw E(new $p(`Input edge is not connected to the input port.`))}function eL(e,t){if(e.a<0)throw E(new em(`Did not call before(...) or after(...) before calling add(...).`));return LC(e,e.a,t),e}function _Ge(e){return tk(),j(e,166)?P(sD(C7,Uyt),296).Qg(e):PE(C7,VP(e))?P(sD(C7,VP(e)),296).Qg(e):null}function tL(e){var t,n;return e.Db&32||(n=(t=P(BN(e,16),29),QE(t||e.fi())-QE(e.fi())),n!=0&&nL(e,32,V(RY,PH,1,n,5,1))),e}function nL(e,t,n){var r;(e.Db&t)==0?n!=null&&m5e(e,t,n):n==null?E4e(e,t):(r=mJe(e,t),r==-1?e.Eb=n:iD(hM(e.Eb),r,n))}function vGe(e,t,n,r){var i,a;t.c.length!=0&&(i=R6e(n,r),a=t2e(t),wg(Qj(new JT(null,new sk(a,1)),new $te),new RCe(e,n,i,r)))}function yGe(e,t){var n,r=e.a.length-1,i,a;return n=t-e.b&r,a=e.c-t&r,i=e.c-e.b&r,VC(n<i),n>=a?(mVe(e,t),-1):(pVe(e,t),1)}function bGe(e,t){for(var n=(fk(t,e.length),e.charCodeAt(t)),r=t+1;r<e.length&&(fk(r,e.length),e.charCodeAt(r)==n);)++r;return r-t}function xGe(e){var t,n=e.Nc();switch(n.length){case 0:return VT(),YY;case 1:return t=n[0],new Kw(nD(t));default:return new yk(yUe(n))}}function SGe(e){switch(typeof e){case DH:return zP(e);case slt:return Yb(e);case EH:return $pe(e);default:return e==null?0:TC(e)}}function CGe(e){if(rL(Sq,e))return XS(),aX;if(rL(xht,e))return XS(),iX;throw E(new $p(`Expecting true or false`))}function wGe(e,t){return e.e<t.e?-1:e.e>t.e?1:e.f<t.f?-1:e.f>t.f?1:xN(e)-xN(t)}function TGe(e,t){var n;return A(t)===A(e)?!0:!j(t,22)||(n=P(t,22),n.gc()!=e.gc())?!1:e.Hc(n)}function rL(e,t){return yD(e),t==null?!1:$w(e,t)?!0:e.length==t.length&&$w(e.toLowerCase(),t.toLowerCase())}function iL(e){var t,n;return _F(e,-129)>0&&_F(e,128)<0?(Oye(),t=tE(e)+128,n=byt[t],!n&&(n=byt[t]=new Hl(e)),n):new Hl(e)}function aL(){aL=C,HZ=new B_(BG,0),SSt=new B_(`INSIDE_PORT_SIDE_GROUPS`,1),BZ=new B_(`GROUP_MODEL_ORDER`,2),VZ=new B_(VG,3)}function oL(e){var t,n,r=e.Gh();if(!r)for(t=0,n=e.Mh();n;n=n.Mh()){if(++t>uW)return n.Nh();if(r=n.Gh(),r||n==e)break}return r}function EGe(e){var t;return e.b||Lce(e,(t=the(e.e,e.a),!t||!$w(xht,zI((!t.b&&(t.b=new ow((SH(),o9),d9,t)),t.b),`qualified`)))),e.c}function DGe(e){var t,n;for(n=new T(e.a.b);n.a<n.c.c.length;)if(t=P(z(n),70),sm(hw(K(t,(hH(),I0)))))return!0;return!1}function OGe(e,t){ek();var n,r;for(r=new pE(KS(pI(e).a.Jc(),new f));Vz(r);)if(n=P(CA(r),17),n.d.i==t||n.c.i==t)return n;return null}function kGe(e,t){(!t&&console.groupCollapsed!=null?console.groupCollapsed:console.group==null?console.log:console.group).call(console,e)}function AGe(e,t,n,r){P(n.b,68),P(n.b,68),P(r.b,68),P(r.b,68).c.b,KMe(r,t,e)}function jGe(e,t,n){t.b=r.Math.max(t.b,-n.a),t.c=r.Math.max(t.c,n.a-e.a),t.d=r.Math.max(t.d,-n.b),t.a=r.Math.max(t.a,n.b-e.b)}function MGe(e,t,n){var r=P(H(Ej(e.a),t),87),i,a=(i=r.c,i||(SH(),e9));return(a.Sh()?bF(e.b,P(a,52)):a)==n?pV(r):mM(r,n),a}function NGe(e,t,n){var r,i,a;for(a=new T(n.a);a.a<a.c.c.length;)i=P(z(a),225),r=new nS(P(sD(e.a,i.b),68)),M(t.a,r),NGe(e,r,i)}function PGe(e,t,n){var r=t.c.p,i,a=t.p;e.b[r][a]=new fwe(e,t),n&&(e.a[r][a]=new Ju(t),i=P(K(t,(Y(),C1)),9),i&&kz(e.d,i,t))}function FGe(e,t,n){this.c=e,this.f=new Zd,this.e=new hh,this.j=new uye,this.n=new uye,this.b=t,this.g=new KD(t.c,t.d,t.b,t.a),this.a=n}function IGe(e){var t,n,r,i;for(this.a=new ax,this.d=new jf,this.e=0,n=e,r=0,i=n.length;r<i;++r)t=n[r],!this.f&&(this.f=t),Ck(this,t)}function LGe(e){qB(),e.length==0?(this.e=0,this.d=1,this.a=U(O(q9,1),RU,30,15,[0])):(this.e=1,this.d=e.length,this.a=e,wk(this))}function sL(e,t,n){Qf.call(this),this.a=V(wbt,mut,216,(lM(),U(O(KX,1),Z,237,0,[UX,WX,GX])).length,0,1),this.b=e,this.d=t,this.c=n}function RGe(e){var t,n,r,i,a,o=P(K(e,(Y(),P1)),12);for(W(o,q1,e.i.n.b),t=Dk(e.e),r=t,i=0,a=r.length;i<a;++i)n=r[i],XO(n,o)}function zGe(e){var t,n=P(K(e,(Y(),P1)),12),r,i,a,o;for(W(n,q1,e.i.n.b),t=Dk(e.g),i=t,a=0,o=i.length;a<o;++a)r=i[a],JO(r,n)}function BGe(e,t){var n=t.ni(e.a),r;return n&&(r=gw(zI((!n.b&&(n.b=new ow((SH(),o9),d9,n)),n.b),uJ)),r!=null)?r:t.ve()}function VGe(e,t){var n=t.ni(e.a),r;return n&&(r=gw(zI((!n.b&&(n.b=new ow((SH(),o9),d9,n)),n.b),uJ)),r!=null)?r:t.ve()}function HGe(e,t){var n=Qx(e.a.c.p,t.a.c.p),r;return n==0?(r=Qx(e.a.d.i.p,t.a.d.i.p),r==0?Qx(t.a.d.p,e.a.d.p):r):n}function UGe(e,t,n){var r,i,a=t.j,o=n.j;return a==o?(r=e.f[t.p],i=e.f[n.p],r==0&&i==0?0:r==0?-1:i==0?1:BF(r,i)):a.g-o.g}function WGe(e,t){var n,r,i,a;for(r=0,i=t.gc();r<i;++r)n=t.Rl(r),j(n,103)&&(P(n,19).Bb&Rq)!=0&&(a=t.Sl(r),a!=null&&aV(e,P(a,57)))}function GGe(){var e;return QY!=0&&(e=Date.now(),e-ryt>2e3&&(ryt=e,$Y=r.setTimeout(Xle,10))),QY++==0?(HPe((Hp(),iyt)),!0):!1}function KGe(e,t,n){var r;(sbt?(sWe(e),!0):cbt||ubt?(xg(),!0):lbt&&(xg(),!1))&&(r=new Ahe(t),r.b=n,E$e(e,r))}function qGe(e,t){var n=!e.A.Gc((YI(),z5))||e.q==(TR(),t5);e.u.Gc((Sz(),c5))?n?_st(e,t):Kot(e,t):e.u.Gc(u5)&&(n?Cot(e,t):zst(e,t))}function JGe(e,t,n){var r,i;UQe(e.e,t,n,(rH(),N5)),UQe(e.i,t,n,p5),e.a&&(i=P(K(t,(Y(),P1)),12),r=P(K(n,P1),12),Sk(e.g,i,r))}function YGe(e){var t;A(J(e,(vH(),U6)))===A(($P(),P8))&&(UO(e)?(t=P(J(UO(e),U6),347),CL(e,U6,t)):CL(e,U6,F8))}function XGe(e,t,n){return new KD(r.Math.min(e.a,t.a)-n/2,r.Math.min(e.b,t.b)-n/2,r.Math.abs(e.a-t.a)+n,r.Math.abs(e.b-t.b)+n)}function ZGe(e){var t;this.d=new Zd,this.j=new hh,this.g=new hh,t=e.g.b,this.f=P(K(_D(t),(hH(),P0)),86),this.e=D(N(vL(t,P2)))}function QGe(e){this.d=new Zd,this.e=new aA,this.c=V(q9,RU,30,(rH(),U(O(P5,1),HG,64,0,[M5,m5,p5,j5,N5])).length,15,1),this.b=e}function $Ge(e,t,n){var r=n[e.g][t];switch(e.g){case 1:case 3:return new k(0,r);case 2:case 4:return new k(r,0);default:return null}}function eKe(e,t){var n=pM(e.o,t);if(n==null)throw E(new um(`Node did not exist in input.`));return S8e(e,t),XB(e,t),R3e(e,t,n),null}function tKe(e,t){var n,r=e.a.length;for(t.length<r&&(t=Pm(Array(r),t)),n=0;n<r;++n)iD(t,n,e.a[n]);return t.length>r&&iD(t,r,null),t}function cL(e,t){var n,r=e.c.length;for(t.length<r&&(t=Pm(Array(r),t)),n=0;n<r;++n)iD(t,n,e.c[n]);return t.length>r&&iD(t,r,null),t}function nKe(e,t,n,r){var i=e.length;if(t>=i)return i;for(t=t>0?t:0;t<i&&!CP((fk(t,e.length),e.charCodeAt(t)),n,r);t++);return t}function rKe(e,t,n){var r,i=P(SO(t.f),214);try{i.kf(e,n),$Se(t.f,i)}catch(e){throw e=fP(e),j(e,101)?(r=e,E(r)):E(e)}}function iKe(e,t,n){var r=null,i,a,o,s=mat(RM(),t),c;return a=null,s&&(i=null,c=$it(s,n),o=null,c!=null&&(o=e.of(s,c)),i=o,a=i),r=a,r}function aKe(e,t,n,r){var i=new Wj(e.e,1,13,(o=t.c,o||(SH(),e9)),(a=n.c,a||(SH(),e9)),jL(e,t),!1),a,o;return r?r.lj(i):r=i,r}function oKe(e){var t;if(e==null)return null;if(t=$3e(NV(e,!0)),t==null)throw E(new pm(`Invalid hexBinary value: '`+e+`'`));return t}function lL(e,t,n){var r;t.a.length>0&&(M(e.b,new bve(t.a,n)),r=t.a.length,0<r?t.a=bO(t.a,0,0):0>r&&(t.a+=_S(V(K9,CU,30,-r,15,1))))}function sKe(e,t,n){var r,i,a;if(!n[t.d])for(n[t.d]=!0,i=new T(aF(t));i.a<i.c.c.length;)r=P(z(i),217),a=xI(r,t),sKe(e,a,n)}function cKe(e,t){var n=0,i,a,o;for(a=new T(t.a);a.a<a.c.c.length;)i=P(z(a),9),o=i.o.a+i.d.c+i.d.b+e.j,n=r.Math.max(n,o);return n}function uL(e,t,n){var r,i=P(sD(e.e,t),393),a;return i?(a=Bw(i,n),hfe(e,i),a):(r=new Cve(e,t,n),kD(e.e,t,r),ETe(r),null)}function lKe(e,t){var n=sD(e.q,t);if(n==null)throw E(new um(`Port did not exist in input.`));return S8e(e,t),XB(e,t),R3e(e,t,n),null}function uKe(){return xH(),U(O(Qbt,1),Z,168,0,[Xbt,Ybt,Zbt,Vbt,Bbt,Hbt,Gbt,Wbt,Ubt,Jbt,qbt,Kbt,Rbt,Lbt,zbt,Fbt,Pbt,Ibt,Mbt,jbt,Nbt,tZ])}function dL(e){switch(e.g){case 4:return new k(0,-1);case 1:return new k(1,0);case 2:return new k(-1,0);default:return new k(0,1)}}function dKe(e){switch(e.g){case 1:return KF(),S8;case 4:return KF(),y8;case 2:return KF(),b8;case 3:return KF(),v8}return KF(),x8}function fKe(e){switch(e.fj(null)){case 10:return 0;case 15:return 1;case 14:return 2;case 11:return 3;case 21:return 4}return-1}function fL(){fL=C,h6=new Cy(`PARENTS`,0),m6=new Cy(`NODES`,1),f6=new Cy(`EDGES`,2),g6=new Cy(`PORTS`,3),p6=new Cy(`LABELS`,4)}function pL(){pL=C,Z8=new Fy(`DISTRIBUTED`,0),Q8=new Fy(`JUSTIFIED`,1),BRt=new Fy(`BEGIN`,2),X8=new Fy(zW,3),VRt=new Fy(`END`,4)}function pKe(e,t,n){var r=n.q.getFullYear()-LU+LU;switch(r<0&&(r=-r),t){case 1:e.a+=r;break;case 2:Vj(e,r%100,2);break;default:Vj(e,r,t)}}function mL(e,t){var n,r;if(QO(t,e.b),t>=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(r=e.a.a,n=0;n<t;++n)r=r.a;return new The(e,t,r)}function mKe(e){this.b=new Zd,this.e=new Zd,this.d=e,this.a=!Vh(LD(new JT(null,new qE(new PA(e.b))),new lu(new _r))).zd((Sg(),BX))}function hKe(e){var t;e.g&&(e.c.ig()?e.f:e.a)&&(t=e.c.ig()?e.f:e.a,D5e(t.a,e.o,!0),D5e(t.a,e.o,!1),W(e.o,(hH(),v2),(TR(),e5)))}function gKe(e,t){var n,r,i=t.d.i;r=i.k,!(r==(Zz(),ZZ)||r==KZ)&&(n=new pE(KS(mI(i).a.Jc(),new f)),Vz(n)&&kD(e.k,t,P(CA(n),17)))}function _Ke(e,t){return fM(),BF((e.a.b==0?new k(e.c.e.a,e.c.e.b):P(GC(e.a),8)).b,(t.a.b==0?new k(t.c.e.a,t.c.e.b):P(GC(t.a),8)).b)}function vKe(e,t){return fM(),BF((e.a.b==0?new k(e.c.e.a,e.c.e.b):P(GC(e.a),8)).a,(t.a.b==0?new k(t.c.e.a,t.c.e.b):P(GC(t.a),8)).a)}function yKe(e,t){return fM(),BF((e.a.b==0?new k(e.b.e.a,e.b.e.b):P(KC(e.a),8)).a,(t.a.b==0?new k(t.b.e.a,t.b.e.b):P(KC(t.a),8)).a)}function bKe(e,t){return fM(),BF((e.a.b==0?new k(e.b.e.a,e.b.e.b):P(KC(e.a),8)).b,(t.a.b==0?new k(t.b.e.a,t.b.e.b):P(KC(t.a),8)).b)}function xKe(e,t){var n,r=$j(e.Ah(),t),i;return n=t-e.gi(),n<0?(i=e.Fh(r),i>=0?e.Th(i):M2e(e,r)):n<0?M2e(e,r):P(r,69).uk().zk(e,e.ei(),n)}function SKe(e){var t,n,r=(!e.o&&(e.o=new ij((uH(),d7),g7,e,0)),e.o);for(n=r.c.Jc();n.e!=n.i.gc();)t=P(n.Wj(),45),t.kd();return qA(r)}function hL(e){var t;if(j(e.a,4)){if(t=_Ge(e.a),t==null)throw E(new em(Sht+e.b+`'. `+yht+(mw(w7),w7.k)+bht));return t}else return e.a}function CKe(e){var t;if(e==null)return null;if(t=Ast(NV(e,!0)),t==null)throw E(new pm(`Invalid base64Binary value: '`+e+`'`));return t}function gL(e){var t;try{return t=e.i.Xb(e.e),e.Vj(),e.g=e.e++,t}catch(t){throw t=fP(t),j(t,99)?(e.Vj(),E(new Cf)):E(t)}}function wKe(e){var t;try{return t=e.c.Ti(e.e),e.Vj(),e.g=e.e++,t}catch(t){throw t=fP(t),j(t,99)?(e.Vj(),E(new Cf)):E(t)}}function _L(e){var t,n,r,i=0;for(n=0,r=e.length;n<r;n++)t=(fk(n,e.length),e.charCodeAt(n)),t>=64&&t<128&&(i=gk(i,gE(1,t-64)));return i}function vL(e,t){var n,r=null;return QC(e,(vH(),l8))&&(n=P(K(e,l8),105),n.nf(t)&&(r=n.mf(t))),r==null&&_D(e)&&(r=K(_D(e),t)),r}function TKe(e,t){var n=P(K(e,(hH(),J0)),78);return hS(t,TSt)?n?tO(n):(n=new np,W(e,J0,n)):n&&W(e,J0,null),n}function EKe(e,t){var n,r,i=new VA(t.gc());for(r=t.Jc();r.Ob();)n=P(r.Pb(),294),n.c==n.f?rz(e,n,n.c):_1e(e,n)||ff(i.c,n);return i}function DKe(e,t){var n=e.o,r,i;for(i=P(P(wA(e.r,t),22),83).Jc();i.Ob();)r=P(i.Pb(),115),r.e.a=LJe(r,n.a),r.e.b=n.b*D(N(r.b.mf(nZ)))}function OKe(e,t){var n,r,i=e.k,a;return n=D(N(K(e,(Y(),R1)))),a=t.k,r=D(N(K(t,R1))),a==(Zz(),qZ)?i==qZ?n==r?0:n<r?-1:1:1:-1}function kKe(e,t){var n=P(P(sD(e.g,t.a),49).a,68),r=P(P(sD(e.g,t.b),49).a,68);return QA(t.a,t.b)-QA(t.a,oS(n.b))-QA(t.b,oS(r.b))}function yL(e,t){var n,r;if(++e.j,t!=null&&(n=(r=e.a.Cb,j(r,100)?P(r,100).qh():null),W2e(t,n))){nL(e.a,4,n);return}nL(e.a,4,P(t,129))}function bL(e){switch(Mg(),this.c=new Zd,this.d=e,e.g){case 0:case 2:this.a=_Ce(xSt),this.b=rW;break;case 3:case 1:this.a=xSt,this.b=iW}}function AKe(e){var t;nT(P(K(e,(hH(),v2)),102))&&(t=e.b,J2e((dk(0,t.c.length),P(t.c[0],25))),J2e(P(qT(t,t.c.length-1),25)))}function jKe(e,t){t.Tg(`Self-Loop post-processing`,1),wg(LD(LD(zj(new JT(null,new sk(e.b,16)),new Pn),new Fn),new In),new Ln),t.Ug()}function MKe(e,t,n){var r,i;if(e.c)wM(e.c,e.c.i+t),TM(e.c,e.c.j+n);else for(i=new T(e.b);i.a<i.c.c.length;)r=P(z(i),167),MKe(r,t,n)}function NKe(e){var t,n,r=e.c.a;for(e.p=(nD(r),new sT(r)),n=new T(r);n.a<n.c.c.length;)t=P(z(n),9),t.p=d0e(t).a;QD(),Yx(e.p,new Xr)}function PKe(e,t){var n,r;if(e.j.length!=t.j.length)return!1;for(n=0,r=e.j.length;n<r;n++)if(!$w(e.j[n],t.j[n]))return!1;return!0}function FKe(e,t){QD();var n=e,r,i,a=t;for(j(e,22)&&!j(t,22)&&(n=t,a=e),i=n.Jc();i.Ob();)if(r=i.Pb(),a.Gc(r))return!1;return!0}function IKe(e,t,n,r){return t.a<r.a||t.a==r.a&&(t.b<r.b||t.b==r.b&&e.b>n.b)}function LKe(e){var t=new wm;return t.a+=`n`,e.k!=(Zz(),ZZ)&&Mb(Mb((t.a+=`(`,t),ew(e.k).toLowerCase()),`)`),Mb((t.a+=`_`,t),qL(e)),t.a}function xL(){xL=C,Dkt=new Tv(Ppt,0),c4=new Tv(ldt,1),l4=new Tv(`LINEAR_SEGMENTS`,2),s4=new Tv(`BRANDES_KOEPF`,3),u4=new Tv(Npt,4)}function SL(e,t,n,r){var i;return n>=0?e.Ph(t,n,r):(e.Mh()&&(r=(i=e.Ch(),i>=0?e.xh(r):e.Mh().Qh(e,-1-i,null,r))),e.zh(t,n,r))}function RKe(e,t){switch(t){case 7:!e.e&&(e.e=new Zw(i7,e,7,4)),BV(e.e);return;case 8:!e.d&&(e.d=new Zw(i7,e,8,5)),BV(e.d);return}AWe(e,t)}function CL(e,t,n){return n==null?(!e.o&&(e.o=new ij((uH(),d7),g7,e,0)),QI(e.o,t)):(!e.o&&(e.o=new ij((uH(),d7),g7,e,0)),lR(e.o,t,n)),e}function wL(e,t){var n=e.dd(t);try{return n.Pb()}catch(e){throw e=fP(e),j(e,112)?E(new Xp(`Can't get element `+t)):E(e)}}function zKe(e,t){var n=P(AD(e.b,t),127).n;switch(t.g){case 1:e.t>=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function BKe(e){var t=e.a;do t=P(CA(new pE(KS(fI(t).a.Jc(),new f))),17).c.i,t.k==(Zz(),YZ)&&e.b.Ec(t);while(t.k==(Zz(),YZ));e.b=AI(e.b)}function VKe(e,t){var n,i,a=e;for(i=new pE(KS(fI(t).a.Jc(),new f));Vz(i);)n=P(CA(i),17),n.c.i.c&&(a=r.Math.max(a,n.c.i.c.p));return a}function HKe(e,t){var n,r,i=0;for(r=P(P(wA(e.r,t),22),83).Jc();r.Ob();)n=P(r.Pb(),115),i+=n.d.d+n.b.Kf().b+n.d.a,r.Ob()&&(i+=e.w);return i}function UKe(e,t){var n,r,i=0;for(r=P(P(wA(e.r,t),22),83).Jc();r.Ob();)n=P(r.Pb(),115),i+=n.d.b+n.b.Kf().a+n.d.c,r.Ob()&&(i+=e.w);return i}function WKe(e){var t,n,r=0,i=DB(e);if(i.c.length==0)return 1;for(n=new T(i);n.a<n.c.c.length;)t=P(z(n),26),r+=WKe(t);return r}function GKe(e){var t,n;for(this.b=new Zd,this.c=e,this.a=!1,n=new T(e.a);n.a<n.c.c.length;)t=P(z(n),9),this.a|=t.k==(Zz(),ZZ)}function KKe(e,t,n){var r=e.bd(t),i,a,o;return r!=-1&&(e.Nj()?(a=e.Oj(),o=IT(e,r),i=e.Gj(4,o,null,r,a),n?n.lj(i):n=i):IT(e,r)),n}function TL(e,t,n){var r=e.bd(t),i,a,o;return r!=-1&&(e.Nj()?(a=e.Oj(),o=ZL(e,r),i=e.Gj(4,o,null,r,a),n?n.lj(i):n=i):ZL(e,r)),n}function qKe(e,t,n,r){var i,a,o;n.Uh(t)&&(n_(),kPe(t)?(i=P(n.Jh(t),163),WGe(e,i)):(a=(o=t,o?P(r,52).di(o):null),a&&Joe(n.Jh(t),a)))}function EL(e,t,n,r){var i,a=$j(e.Ah(),t),o;return i=t-e.gi(),i<0?(o=e.Fh(a),o>=0?e.Ih(o,n,!0):jz(e,a,n)):P(a,69).uk().wk(e,e.ei(),i,n,r)}function JKe(e,t,n,r){var i=CHe(t.nf((vH(),J6))?P(t.mf(J6),22):e.j);i!=(xH(),tZ)&&(n&&!lGe(i)||a1e(e6e(e,i,r),t))}function YKe(e,t){return bb(e)?!!Wvt[t]:e.Qm?!!e.Qm[t]:yb(e)?!!Uvt[t]:vb(e)?!!Hvt[t]:!1}function XKe(e){switch(e.g){case 1:return QN(),oZ;case 3:return QN(),rZ;case 2:return QN(),aZ;case 4:return QN(),iZ;default:return null}}function ZKe(e,t,n){if(e.e)switch(e.b){case 1:lwe(e.c,t,n);break;case 0:uwe(e.c,t,n)}else Kke(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function QKe(e){var t,n;if(e==null)return null;for(n=V(GZ,X,199,e.length,0,2),t=0;t<n.length;t++)n[t]=P(_Ae(e[t],e[t].length),199);return n}function $Ke(e){var t=P(K(e,(_V(),sMt)),104);W(e,(nH(),l3),new k(0,0)),bet(new IA,e,t.b-D(N(K(e,p3))),t.d-D(N(K(e,m3))))}function DL(e){var t;if(GP(e))return mE(e),e.sl()&&(t=Ez(e.e,e.b,e.c,e.a,e.j),e.j=t),e.g=e.a,++e.a,++e.c,e.i=0,e.j;throw E(new Cf)}function eqe(e,t,n){n.Tg(`Compound graph preprocessor`,1),e.a=new CO,wot(e,t,null),Xrt(e,t),a8e(e),W(t,(Y(),qwt),e.a),e.a=null,SE(e.b),n.Ug()}function tqe(e,t,n){var r,i,a;for(i=new pE(KS((t?fI(e):mI(e)).a.Jc(),new f));Vz(i);)r=P(CA(i),17),a=t?r.c.i:r.d.i,a.k==(Zz(),JZ)&&YO(a,n)}function nqe(e,t,n){var r=t.i.j.c.length,i,a;return QC(t,(Y(),N1))&&QC(n,N1)?(i=vB(t,n,e.b,r),a=vB(n,t,e.b,r),i<a?-1:+(i>a)):0}function OL(){OL=C,i4=new wv(BG,0),a4=new wv(`PORT_POSITION`,1),r4=new wv(`NODE_SIZE_WHERE_SPACE_PERMITS`,2),n4=new wv(`NODE_SIZE`,3)}function rqe(e,t){var n,r,i;for(t.Tg(`Untreeify`,1),n=P(K(e,(nH(),Pjt)),16),i=n.Jc();i.Ob();)r=P(i.Pb(),65),MT(r.b.d,r),MT(r.c.b,r);t.Ug()}function kL(){kL=C,EIt=new Ty(`AUTOMATIC`,0),k6=new Ty(BW,1),A6=new Ty(VW,2),j6=new Ty(`TOP`,3),D6=new Ty(gut,4),O6=new Ty(zW,5)}function AL(e,t,n){var r,i=e.gc();if(t>=i)throw E(new Qw(t,i));if(e.Qi()&&(r=e.bd(n),r>=0&&r!=t))throw E(new $p(fJ));return e.Vi(t,n)}function jL(e,t){var n,r,i=uYe(e,t);if(i>=0)return i;if(e.ml()){for(r=0;r<e.i;++r)if(n=e.nl(P(e.g[r],57)),A(n)===A(t))return r}return-1}function iqe(e,t){if(this.a=P(nD(e),254),this.b=P(nD(t),254),e.Cd(t)>0||e==(bp(),WY)||t==(xp(),GY))throw E(new $p(`Invalid range: `+Wke(e,t)))}function aqe(e,t,n,r){jB();var i=0,a;for(a=0;a<n;a++)i=lI(uI(hk(t[a],dW),hk(r,dW)),hk(tE(i),dW)),e[a]=tE(i),i=vE(i,32);return tE(i)}function oqe(e,t,n){var i,a=0;for(i=0;i<qX;i++)a=r.Math.max(a,lF(e.a[t.g][i],n));return t==(lM(),WX)&&e.b&&(a=r.Math.max(a,e.b.b)),a}function ML(e,t){var n,r;if(HC(t>0),(t&-t)==t)return AO(t*tB(e,31)*4656612873077393e-25);do n=tB(e,31),r=n%t;while(n-r+(t-1)<0);return AO(r)}function sqe(e,t){var n=lC(new If,e),r,i;for(i=new T(t);i.a<i.c.c.length;)r=P(z(i),124),yB(kg(Og(Ag(Dg(new Bf,0),0),n),r));return n}function NL(e,t,n){var r,i;for(xze(e,t-e.s,n-e.t),i=new T(e.n);i.a<i.c.c.length;)r=P(z(i),208),Nie(r,r.e+t-e.s),Pie(r,r.f+n-e.t);e.s=t,e.t=n}function cqe(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function PL(e,t,n,r){var i,a;for(i=t;i<e.c.length;i++)if(a=(dk(i,e.c.length),P(e.c[i],12)),n.Mb(a))ff(r.c,a);else return i;return e.c.length}function lqe(e){var t,n,r;for(r=P(wA(e.a,(wR(),VQ)),16).Jc();r.Ob();)n=P(r.Pb(),107),t=oYe(n),XE(e,n,t[0],(cN(),UQ),0),XE(e,n,t[1],GQ,1)}function uqe(e){var t,n,r;for(r=P(wA(e.a,(wR(),HQ)),16).Jc();r.Ob();)n=P(r.Pb(),107),t=oYe(n),XE(e,n,t[0],(cN(),UQ),0),XE(e,n,t[1],GQ,1)}function dqe(e){switch(e.g){case 0:return null;case 1:return new kLe;case 2:return new vp;default:throw E(new $p(gmt+(e.f==null?``+e.g:e.f)))}}function fqe(e){var t=D(N(J(e,(vH(),p8))))*r.Math.sqrt((!e.a&&(e.a=new F(p7,e,10,11)),e.a).i);return new k(t,t/D(N(J(e,f8))))}function pqe(e){var t;return e.f&&e.f.Sh()&&(t=P(e.f,52),e.f=P(bF(e,t),84),e.f!=t&&e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,9,8,t,e.f))),e.f}function mqe(e){var t;return e.i&&e.i.Sh()&&(t=P(e.i,52),e.i=P(bF(e,t),84),e.i!=t&&e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,9,7,t,e.i))),e.i}function FL(e){var t;return e.b&&e.b.Db&64&&(t=e.b,e.b=P(bF(e,t),19),e.b!=t&&e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,9,21,t,e.b))),e.b}function IL(e,t){var n,r,i;e.d==null?(++e.e,++e.f):(r=t.yi(),_8e(e,e.f+1),i=(r&kH)%e.d.length,n=e.d[i],!n&&(n=e.d[i]=e.bk()),n.Ec(t),++e.f)}function hqe(e,t,n){var r;return t.rk()?!1:t.Gk()==-2?t.ok()==e.e.Ah()&&n==null:(r=t.gk(),r==null?n==null:OF(r,n))}function LL(){var e;KM(16,xlt),e=lLe(16),this.b=V(KY,lU,308,e,0,1),this.c=V(KY,lU,308,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function RL(e){xme.call(this),this.k=(Zz(),ZZ),this.j=(KM(6,fU),new VA(6)),this.b=(KM(2,fU),new VA(2)),this.d=new Jf,this.f=new Xf,this.a=e}function gqe(e){var t,n=0,r,i,a;for(i=new T(e.a);i.a<i.c.c.length;)r=P(z(i),124),r.d=n++;return t=KQe(e),a=null,t.c.length>1&&(a=sqe(e,t)),a}function _qe(e){var t=0,n,r;for(r=new T(e.c.a);r.a<r.c.c.length;)n=P(z(r),9),t+=Jk(new pE(KS(mI(n).a.Jc(),new f)));return t/e.c.a.c.length}function vqe(e){var t,n;for(n=new zS(e);n.e!=n.i.gc();)if(t=P(gL(n),87),t.e||(!t.d&&(t.d=new MS(z7,t,1)),t.d).i!=0)return!0;return!1}function yqe(e){var t,n;for(n=new zS(e);n.e!=n.i.gc();)if(t=P(gL(n),87),t.e||(!t.d&&(t.d=new MS(z7,t,1)),t.d).i!=0)return!0;return!1}function bqe(e,t,n,r){var i=P(wA(r?e.a:e.b,t),22),a,o;for(o=i.Jc();o.Ob();)if(a=P(o.Pb(),26),MB(e,n,a))return!0;return!1}function xqe(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(A(n)===A(r)||n!=null&&OF(n,r))))return!1;return!t.Ob()}function Sqe(e){var t,n;e.c.length<=1||(t=a7e(e,(rH(),j5)),O1e(e,P(t.a,15).a,P(t.b,15).a),n=a7e(e,N5),O1e(e,P(n.a,15).a,P(n.b,15).a))}function Cqe(e,t,n){var r,i=e.a.b;for(r=i.c.length;r<n;r++)rE(i,i.c.length,new lD(e.a));YO(t,(dk(n-1,i.c.length),P(i.c[n-1],25))),e.b[t.p]=n}function wqe(e,t){var n,r,i;for(e.b[t.g]=1,r=mL(t.d,0);r.b!=r.d.c;)n=P(Uk(r),65),i=n.c,e.b[i.g]==1?MT(e.a,n):e.b[i.g]==2?e.b[i.g]=1:wqe(e,i)}function Tqe(){Tqe=C,rIt=(RB(),ZFt),tIt=new Mx(8),new Bx((vH(),t8),tIt),new Bx(d8,8),nIt=YFt,$Ft=zFt,eIt=BFt,QFt=new Bx(V6,(XS(),!1))}function Eqe(e,t,n){var r;n.Tg(`Shrinking tree compaction`,1),sm(hw(K(t,(ZN(),cZ))))?(oLe(e,t.f),vPe(t.f,(r=t.c,r))):vPe(t.f,t.c),n.Ug()}function Dqe(e,t,n,r){switch(t){case 7:return!e.e&&(e.e=new Zw(i7,e,7,4)),e.e;case 8:return!e.d&&(e.d=new Zw(i7,e,8,5)),e.d}return kUe(e,t,n,r)}function Oqe(e){var t;return e.a&&e.a.Sh()&&(t=P(e.a,52),e.a=P(bF(e,t),143),e.a!=t&&e.Db&4&&!(e.Db&1)&&FN(e,new DE(e,9,5,t,e.a))),e.a}function zL(e){return e<48||e>102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function kqe(e,t){if(e==null)throw E(new tm(`null key in entry: null=`+t));if(t==null)throw E(new tm(`null value in entry: `+e+`=null`))}function Aqe(e,t){var n=U(O(Z9,1),lW,30,15,[lF(e.a[0],t),lF(e.a[1],t),lF(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function jqe(e,t){var n=U(O(Z9,1),lW,30,15,[uF(e.a[0],t),uF(e.a[1],t),uF(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function Mqe(e,t,n){nT(P(K(t,(hH(),v2)),102))||(mje(e,t,$R(t,n)),mje(e,t,$R(t,(rH(),j5))),mje(e,t,$R(t,m5)),QD(),Yx(t.j,new Wae(e)))}function Nqe(e){var t,n;for(e.c||Hit(e),n=new np,t=new T(e.a),z(t);t.a<t.c.c.length;)MT(n,P(z(t),410).a);return UC(n.b!=0),iM(n,n.c.b),n}function Pqe(e,t,n){var r,i,a,o,s=e.r+t;for(e.r+=t,e.d+=n,r=n/e.n.c.length,i=0,o=new T(e.n);o.a<o.c.c.length;)a=P(z(o),208),P3e(a,s,r,i),++i}function Fqe(e){var t,n,r;for(e.b.a.$b(),e.a=V(VX,PH,60,e.c.c.a.b.c.length,0,1),t=0,r=new T(e.c.c.a.b);r.a<r.c.c.length;)n=P(z(r),60),n.f=t++}function Iqe(e){var t,n,r;for(e.b.a.$b(),e.a=V(AZ,PH,82,e.c.a.a.b.c.length,0,1),t=0,r=new T(e.c.a.a.b);r.a<r.c.c.length;)n=P(z(r),82),n.i=t++}function Lqe(e){var t,n,r,i,a;for(r=new T(e.b);r.a<r.c.c.length;)for(n=P(z(r),25),t=0,a=new T(n.a);a.a<a.c.c.length;)i=P(z(a),9),i.p=t++}function Rqe(e,t,n){var r,i,a,o=0;for(r=n/e.a.c.length,a=new T(e.a);a.a<a.c.c.length;)i=P(z(a),173),NL(i,i.s,i.t+o*r),Pqe(i,e.d-i.r+t,r),++o}function zqe(e){var t=bVe(e);if(!Vz(e))throw E(new Xp(`position (0) must be less than the number of elements that remained (`+t+`)`));return CA(e)}function Bqe(e,t){var n;return e.a||=(n=V(Z9,lW,30,0,15,1),Ph(e.b.a,new eae(n)),rse(n,KFe(ie.prototype.Ke,ie,[])),new Ohe(n,e.d)),RA(e.a,t)}function Vqe(e){switch(e.g){case 1:return rH(),N5;case 4:return rH(),m5;case 3:return rH(),p5;case 2:return rH(),j5;default:return rH(),M5}}function Hqe(e,t,n){t.k==(Zz(),ZZ)&&n.k==YZ&&(e.d=CF(t,(rH(),j5)),e.b=CF(t,m5)),n.k==ZZ&&t.k==YZ&&(e.d=CF(n,(rH(),m5)),e.b=CF(n,j5))}function Uqe(e,t){var n,r;for(r=aI(e,t).Jc();r.Ob();)if(n=P(r.Pb(),12),K(n,(Y(),L1))!=null||gC(new PA(n.b)))return!0;return!1}function Wqe(e,t,n){n.Tg(`Linear segments node placement`,1),e.b=P(K(t,(Y(),G1)),316),jct(e,t),yrt(e,t),tit(e,t),Xst(e),e.a=null,e.b=null,n.Ug()}function Gqe(e,t){return wM(t,e.e+e.d+(e.c.c.length==0?0:e.b)),TM(t,e.f),e.a=r.Math.max(e.a,t.f),e.d+=t.g+(e.c.c.length==0?0:e.b),M(e.c,t),!0}function Kqe(e,t){var n,r,i=t.length-1,a,o=0,s=0;for(r=0;r<=i;r++)a=t[r],n=I$e(i,r)*UVe(1-e,i-r)*UVe(e,r),o+=a.a*n,s+=a.b*n;return new k(o,s)}function qqe(e,t){var n=t.gc(),r,i,a,o;for(e.Zi(e.i+n),a=t.Jc(),o=e.i,e.i+=n,r=o;r<e.i;++r)i=a.Pb(),AS(e,r,e.Xi(r,i)),e.Ki(r,i),e.Li();return n!=0}function Jqe(e,t,n){var r,i,a;return e.Nj()?(r=e.Cj(),a=e.Oj(),++e.j,e.oj(r,e.Xi(r,t)),i=e.Gj(3,null,t,r,a),n?n.lj(i):n=i):tme(e,e.Cj(),t),n}function Yqe(e,t,n){var r=P(H(Zk(e.a),t),87),i,a=(i=r.c,j(i,88)?P(i,29):(SH(),t9));return(a.Db&64?bF(e.b,a):a)==n?pV(r):mM(r,n),a}function Xqe(e){var t;return e==null?null:new Nx((t=NV(e,!0),t.length>0&&(fk(0,t.length),t.charCodeAt(0)==43)?(fk(1,t.length+1),t.substr(1)):t))}function Zqe(e){var t;return e==null?null:new Nx((t=NV(e,!0),t.length>0&&(fk(0,t.length),t.charCodeAt(0)==43)?(fk(1,t.length+1),t.substr(1)):t))}function Qqe(e,t,n,r,i,a,o,s){var c,l;r&&(c=r.a[0],c&&Qqe(e,t,n,c,i,a,o,s),qJe(e,n,r.d,i,a,o,s)&&t.Ec(r),l=r.a[1],l&&Qqe(e,t,n,l,i,a,o,s))}function BL(e,t){var n,r,i,a=e.gc();for(t.length<a&&(t=Pm(Array(a),t)),i=t,r=e.Jc(),n=0;n<a;++n)iD(i,n,r.Pb());return t.length>a&&iD(t,a,null),t}function $qe(e,t){var n,r=e.gc();if(t==null){for(n=0;n<r;n++)if(e.Xb(n)==null)return n}else for(n=0;n<r;n++)if(OF(t,e.Xb(n)))return n;return-1}function eJe(e,t){var n=t.jd(),r,i=t.kd();return r=e.xc(n),!(!(A(i)===A(r)||i!=null&&OF(i,r))||r==null&&!e._b(n))}function tJe(e,t){var n,r,i;return t<=22?(n=e.l&(1<<t)-1,r=i=0):t<=44?(n=e.l,r=e.m&(1<<t-22)-1,i=0):(n=e.l,r=e.m,i=e.h&(1<<t-44)-1),eS(n,r,i)}function nJe(e,t){switch(t.g){case 1:return e.f.n.d+e.t;case 3:return e.f.n.a+e.t;case 2:return e.f.n.c+e.s;case 4:return e.f.n.b+e.s;default:return 0}}function rJe(e,t){var n,r=t.c;switch(n=t.a,e.b.g){case 0:n.d=e.e-r.a-r.d;break;case 1:n.d+=e.e;break;case 2:n.c=e.e-r.a-r.d;break;case 3:n.c=e.e+r.d}}function VL(){VL=C,MNt=new ly(BG,0),ANt=new ly(fdt,1),jNt=new ly(`EDGE_LENGTH_BY_POSITION`,2),kNt=new ly(`CROSSING_MINIMIZATION_BY_POSITION`,3)}function iJe(e,t){var n=P(pM(e.n,t),26),r;if(n)return n;if(r=P(pM(e.p,t),125),r)return r;throw E(new um(`Referenced shape does not exist: `+t))}function aJe(e,t){if(e.g==-1)throw E(new bf);e.Vj();try{e.d.fd(e.g,t),e.f=e.d.j}catch(e){throw e=fP(e),j(e,99)?E(new vf):E(e)}}function oJe(e,t){var n,r;if(j(t,254)){r=P(t,254);try{return n=e.Cd(r),n==0}catch(e){if(e=fP(e),j(e,211))return!1;throw E(e)}}return!1}function sJe(e,t){if(e.c==t)return e.d;if(e.d==t)return e.c;throw E(new $p(`Node 'one' must be either source or target of edge 'edge'.`))}function cJe(e,t){if(e.c.i==t)return e.d.i;if(e.d.i==t)return e.c.i;throw E(new $p(`Node `+t+` is neither source nor target of edge `+e))}function lJe(e,t,n){n.Tg(`Self-Loop ordering`,1),wg(RD(LD(LD(zj(new JT(null,new sk(t.b,16)),new kn),new Zee),new An),new jn),new Cae(e)),n.Ug()}function uJe(e,t,n,r,i,a){var o=uXe(t,n,a),s=n==(rH(),m5)||n==N5?-1:1,c,l=e[n.g],u;for(u=0;u<l.length;u++)c=l[u],c>0&&(c+=i),l[u]=o,o+=s*(c+r)}function dJe(e){var t;for(t=0;t<e.a.c.length;t++)if(QC(P(qT(e.a,t),9),(hH(),e2))&&sm(hw(K(P(qT(e.a,t),9),e2))))return!0;return!1}function fJe(e){var t,n,r=e.f;for(e.n=V(Z9,lW,30,r,15,1),e.d=V(Z9,lW,30,r,15,1),t=0;t<r;t++)n=P(qT(e.c.b,t),25),e.n[t]=cKe(e,n),e.d[t]=Y6e(e,n)}function pJe(e,t,n,r){var i;this.c=e,this.d=t,i=new gg,oA(i,n,i.c.b,i.c),this.a=i,this.b=P(K(r,(_V(),O3)),86),this.e=D(N(K(r,fMt))),Gct(this)}function mJe(e,t){var n,r,i=0;for(r=2;r<t;r<<=1)(e.Db&r)!=0&&++i;if(i==0){for(n=t<<=1;n<=128;n<<=1)if((e.Db&n)!=0)return 0;return-1}else return i}function hJe(e,t){var n,r,i,a,o=xB(e.e.Ah(),t);for(a=null,n=P(e.g,122),i=0;i<e.i;++i)r=n[i],o.$l(r.Jk())&&(!a&&(a=new Do),XA(a,r));a&&Kst(e,a)}function gJe(e){var t,n,r;if(!e)return null;if(e.dc())return``;for(r=new Sm,n=e.Jc();n.Ob();)t=n.Pb(),kb(r,gw(t)),r.a+=` `;return Jb(r,r.a.length-1)}function _Je(e,t){var n=Array(t),r;switch(e){case 14:case 15:r=0;break;case 16:r=!1;break;default:return n}for(var i=0;i<t;++i)n[i]=r;return n}function HL(e){var t,n,r;for(n=new T(e.a.b);n.a<n.c.c.length;)t=P(z(n),60),t.c.$b();r=_x(e.d)?e.a.c:e.a.d,oM(r,new gu(e)),e.c.bf(e),M5e(e)}function vJe(e){var t,n,r,i;for(n=new T(e.e.c);n.a<n.c.c.length;){for(t=P(z(n),291),i=new T(t.b);i.a<i.c.c.length;)r=P(z(i),445),Ynt(r);s4e(t)}}function yJe(e){var t,n,i=kH;for(n=new T(e.a);n.a<n.c.c.length;)t=P(z(n),9),QC(t,(Y(),N1))&&(i=r.Math.min(i,P(K(t,N1),15).a));return i}function UL(e){var t,n,i=0,a,o=0;for(a=0,n=new T(e.a);n.a<n.c.c.length;)t=P(z(n),173),o=r.Math.max(o,t.r),i+=t.d+(a>0?e.c:0),++a;e.b=i,e.d=o}function bJe(e,t){var n=U(O(Z9,1),lW,30,15,[oqe(e,(lM(),UX),t),oqe(e,WX,t),oqe(e,GX,t)]);return e.f&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function xJe(e){var t;QC(e,(hH(),i2))&&(t=P(K(e,i2),22),t.Gc((Hz(),V8))?(t.Kc(V8),t.Ec(U8)):t.Gc(U8)&&(t.Kc(U8),t.Ec(V8)))}function SJe(e){var t;QC(e,(hH(),i2))&&(t=P(K(e,i2),22),t.Gc((Hz(),J8))?(t.Kc(J8),t.Ec(K8)):t.Gc(K8)&&(t.Kc(K8),t.Ec(J8)))}function CJe(e,t,n,r){var i,a,o,s;return e.a??F$e(e,t),o=t.b.j.c.length,a=n.d.p,s=r.d.p,i=s-1,i<0&&(i=o-1),a<=i?e.a[i]-e.a[a]:e.a[o-1]-e.a[a]+e.a[i]}function wJe(e){var t;for(t=0;t<e.a.c.length;t++)if(QC(P(qT(e.a,t),9),(hH(),t2))&&!sm(hw(K(P(qT(e.a,t),9),t2))))return!1;return!0}function TJe(e,t,n){var r,i,a=e.c,o,s=n?t:e;for(r=n?e:t,i=s.p+1;i<r.p;++i)if(o=P(qT(a.a,i),9),!(o.k==(Zz(),KZ)||HYe(o)))return!1;return!0}function EJe(e){var t,n;if(!e.b)for(e.b=Nk(P(e.f,26).jh().i),n=new zS(P(e.f,26).jh());n.e!=n.i.gc();)t=P(gL(n),157),M(e.b,new qp(t));return e.b}function DJe(e){var t,n;if(!e.e)for(e.e=Nk(wCe(P(e.f,26)).i),n=new zS(wCe(P(e.f,26)));n.e!=n.i.gc();)t=P(gL(n),125),M(e.e,new Sd(t));return e.e}function OJe(e){var t,n;if(!e.a)for(e.a=Nk(aO(P(e.f,26)).i),n=new zS(aO(P(e.f,26)));n.e!=n.i.gc();)t=P(gL(n),26),M(e.a,new kC(e,t));return e.a}function WL(e){var t;if(!e.C&&(e.D!=null||e.B!=null))if(t=mot(e),t)e.fl(t);else try{e.fl(null)}catch(e){if(e=fP(e),!j(e,63))throw E(e)}return e.C}function kJe(e){switch(e.q.g){case 5:DXe(e,(rH(),m5)),DXe(e,j5);break;case 4:nat(e,(rH(),m5)),nat(e,j5);break;default:G1e(e,(rH(),m5)),G1e(e,j5)}}function AJe(e){switch(e.q.g){case 5:OXe(e,(rH(),p5)),OXe(e,N5);break;case 4:rat(e,(rH(),p5)),rat(e,N5);break;default:K1e(e,(rH(),p5)),K1e(e,N5)}}function GL(e,t){var n,i,a=new hh;for(i=e.Jc();i.Ob();)n=P(i.Pb(),37),WB(n,a.a,0),a.a+=n.f.a+t,a.b=r.Math.max(a.b,n.f.b);return a.b>0&&(a.b+=t),a}function KL(e,t){var n,i,a=new hh;for(i=e.Jc();i.Ob();)n=P(i.Pb(),37),WB(n,0,a.b),a.b+=n.f.b+t,a.a=r.Math.max(a.a,n.f.a);return a.a>0&&(a.a+=t),a}function jJe(e,t){var n,r;if(t.length==0)return 0;for(n=ySe(e.a,t[0],(rH(),N5)),n+=ySe(e.a,t[t.length-1],p5),r=0;r<t.length;r++)n+=p$e(e,r,t);return n}function MJe(){CB(),this.c=new Zd,this.i=new Zd,this.e=new ax,this.f=new ax,this.g=new ax,this.j=new Zd,this.a=new Zd,this.b=new Qd,this.k=new Qd}function NJe(e,t){var n,r;return e.Db>>16==6?e.Cb.Qh(e,5,c7,t):(r=FL(P($j((n=P(BN(e,16),29),n||e.fi()),e.Db>>16),19)),e.Cb.Qh(e,r.n,r.f,t))}function PJe(e){MO();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+`
16
16
  `;return n.substring(0,r.length)==r&&(n=n.substring(r.length)),n.split(`