vendor: 8,622 bytes, line 1
1import{e as yd,f as _d,g as c0}from"/build/_shared/chunk-36BZLZAA.js";import{A as Ge,B as l0,Ba as ud,D as kn,E as Kh,F as wt,Fa as fd,G as Z,Ga as md,H as Oi,Ha as pa,I as Yh,Ia as pd,J as Xh,Ja as gd,K as Qh,L as Zh,La as Cn,M as ed,Ma as bd,N as td,Na as ji,O as nd,Oa as xd,P as id,Q as rd,R as ua,Ra as vd,S as sd,Sa as h0,T as od,U as ad,V as ld,W as kt,X as St,a as ca,b as Pt,c as Hh,d as qh,da as Jr,e as Vh,g as Wh,ga as cd,h as Gh,ha as z,i as F,ia as Kr,j as rt,k as ha,l as Ni,m as da,n as Vr,na as hd,o as Ut,oa as Sn,q as vt,qa as Ri,r as Ft,ra as dd,s as Li,sa as Bi,ta as Yr,ua as zi,v as Wr,va as fa,w as Gr,wa as ma,x as $t,y as Jh,z as a0}from"/build/_shared/chunk-6FEZWRIS.js";import{b as Xb}from"/build/_shared/chunk-ST3XSP4H.js";import{$ as Oh,A as Hr,B as Ih,C as ut,D as G,E as tn,F as Qb,G as aa,H as Dh,I as ft,J as Zb,L as re,M as Ii,N as Di,O as e0,P as la,Q as t0,R as qr,S as n0,T as ie,U as nn,V as i0,W as Nh,X as Lh,Y as Pe,Z as wn,aa as Rh,ba as Bh,c as Ch,ca as zh,d as Jb,da as jh,e as $r,ea as Ph,f as Kb,i as Mh,ia as r0,j as Yb,ja as Uh,k as le,ka as Fh,l as vn,la as s0,na as $h,s as D,t as Gn,u as oa,w as Eh,wa as o0,x as Ah,z as Th}from"/build/_shared/chunk-C4DFGG5C.js";import"/build/_shared/chunk-FZ2S7OYD.js";import"/build/_shared/chunk-JEM6JXYA.js";import"/build/_shared/chunk-34XIY2DH.js";import{a as it}from"/build/_shared/chunk-JJXTQVMA.js";import{b as E,c as j,f as ne}from"/build/_shared/chunk-OZE3FFNP.js";function xa(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}function va(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}function p0(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-Pi,n),o=i.sliceDoc(r,r+Pi),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:n-a,margin:a&&1},close:{pos:r+l,margin:l&&1}};let h,d;r-n<=2*Pi?h=d=i.sliceDoc(n,r):(h=i.sliceDoc(n,n+Pi),d=i.sliceDoc(r-Pi,r));let u=/^\s*/.exec(h)[0].length,f=/\s*$/.exec(d)[0].length,p=d.length-f-t.length;return h.slice(u,u+e.length)==e&&d.slice(p,p+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(h.charAt(u+e.length))?1:0},close:{pos:r-f-t.length,margin:/\s/.test(d.charAt(p-1))?1:0}}:null}function g0(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to);r.from>n.from&&r.from==t.to&&(r=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function Id(i,e,t=e.selection.ranges){let n=t.map(s=>va(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>p0(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,a;o<r.length;o++)if(a=r[o]){let l=n[o],{open:c,close:h}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:h.pos-h.margin,to:h.pos+l.close.length})}return{changes:s}}return null}function b0(i,e,t=e.selection.ranges){let n=[],r=-1;for(let{from:s,to:o}of t){let a=n.length,l=1e9,c=va(e,s).line;if(c){for(let h=s;h<=o;){let d=e.doc.lineAt(h);if(d.from>r&&(s==o||o>d.from)){r=d.from;let u=/^\s*/.exec(d.text)[0].length,f=u==d.length,p=d.text.slice(u,u+c.length)==c?u:-1;u<d.text.length&&u<l&&(l=u),n.push({line:d,comment:p,token:c,indent:u,empty:f,single:!1})}h=d.to+1}if(l<1e9)for(let h=a;h<n.length;h++)n[h].indent<n[h].line.text.length&&(n[h].indent=l);n.length==a+1&&(n[a].single=!0)}}if(i!=2&&n.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:h,single:d}of n)(d||!h)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of n)if(a>=0){let c=o.from+a,h=c+l.length;o.text[h-o.from]==" "&&h++,s.push({from:c,to:h})}return{changes:s}}return null}function ba(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function _0(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,a)=>{for(let l=0;l<t.length;){let c=t[l++],h=t[l++];a>=c&&o<=h&&(n=!0)}}),n}function x0(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function Dd(i,e){return i.length?e.length?i.concat(e):i:e}function w0(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-v0));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),ba(i,i.length-1,1e9,t.setSelAfter(n)))}else return[st.selection([e])]}function k0(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ga(i,e){if(!i.length)return i;let t=i.length,n=ot;for(;t;){let r=S0(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[st.selection(n)]:ot}function S0(i,e,t){let n=Dd(i.selectionsAfter.length?i.selectionsAfter.map(a=>a.map(e)):ot,t);if(!i.changes)return st.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new st(r,Ut.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}function Jn(i,e){return F.create(i.ranges.map(e),i.mainIndex)}function mt(i,e){return i.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function pt({state:i,dispatch:e},t){let n=Jn(i.selection,t);return n.eq(i.selection,!0)?!1:(e(mt(i,n)),!0)}function Zr(i,e){return F.cursor(e?i.to:i.from)}function Nd(i,e){return pt(i,t=>t.empty?i.moveByChar(t,e):Zr(t,e))}function Te(i){return i.textDirectionAt(i.state.selection.main.head)==Kh.LTR}function Rd(i,e){return pt(i,t=>t.empty?i.moveByGroup(t,e):Zr(t,e))}function A0(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function es(i,e,t){let n=Sn(i).resolveInner(e.head),r=t?St.closedBy:St.openedBy;for(let l=e.head;;){let c=t?n.childAfter(l):n.childBefore(l);if(!c)break;A0(i,c,r)?n=c:l=t?c.to:c.from}let s=n.type.prop(r),o,a;return s&&(o=t?Cn(i,n.from,1):Cn(i,n.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?n.to:n.from,F.cursor(a,t?-1:1)}function Bd(i,e){return pt(i,t=>{if(!t.empty)return Zr(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}function Pd(i){let e=i.scrollDOM.clientHeight<i.scrollDOM.scrollHeight-2,t=0,n=0,r;if(e){for(let s of i.state.facet(Z.scrollMargins)){let o=s(i);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(n=Math.max(o?.bottom,n))}r=i.scrollDOM.clientHeight-t-n}else r=(i.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:n,selfScroll:e,height:Math.max(i.defaultLineHeight,r-5)}}function Ud(i,e){let t=Pd(i),{state:n}=i,r=Jn(n.selection,o=>o.empty?i.moveVertically(o,e,t.height):Zr(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),a=i.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;o&&o.top>l&&o.bottom<c&&(s=Z.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-l}))}return i.dispatch(mt(n,r),{effects:s}),!0}function rn(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=F.cursor(n.from+s))}return r}function z0(i,e,t){let n=!1,r=Jn(i.selection,s=>{let o=Cn(i,s.head,-1)||Cn(i,s.head,1)||s.head>0&&Cn(i,s.head-1,1)||s.head<i.doc.length&&Cn(i,s.head+1,-1);if(!o||!o.end)return s;n=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return t?F.range(s.anchor,a):F.cursor(a)});return n?(e(mt(i,r)),!0):!1}function at(i,e){let t=Jn(i.state.selection,n=>{let r=e(n);return F.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(mt(i.state,t)),!0)}function Fd(i,e){return at(i,t=>i.moveByChar(t,e))}function qd(i,e){return at(i,t=>i.moveByGroup(t,e))}function Vd(i,e){return at(i,t=>i.moveVertically(t,e))}function Jd(i,e){return at(i,t=>i.moveVertically(t,e,Pd(i).height))}function Kd(i,e){let{state:t}=i,n=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to<i.state.doc.length:o.from>0)for(let a=s;;){let l=i.moveVertically(a,e);if(l.head<o.from||l.head>o.to){r.some(c=>
1c.head==l.head)||r.push(l);break}else{if(l.head==a.head)break;a=l}}}return r.length==n.ranges.length?!1:(i.dispatch(mt(t,F.create(r,r.length-1))),!0)}function Ui(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(t="delete.backward",l=Xr(i,l,!1)):l>o&&(t="delete.forward",l=Xr(i,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Xr(i,o,!1),a=Xr(i,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:F.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(i.dispatch(n.update(r,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Z.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function Xr(i,e,t){if(i instanceof Z)for(let n of i.state.facet(Z.atomicRanges).map(r=>r(i)))n.between(e,e,(r,s)=>{r<e&&s>e&&(e=t?s:r)});return e}function ts(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function eu(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of ts(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let l of s.ranges)r.push(F.range(Math.min(i.doc.length,l.anchor+a),Math.min(i.doc.length,l.head+a)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let l of s.ranges)r.push(F.range(l.anchor-a,l.head-a))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:F.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}function tu(i,e,t){if(i.readOnly)return!1;let n=[];for(let r of ts(i))t?n.push({from:r.from,insert:i.doc.slice(r.from,r.to)+i.lineBreak}):n.push({from:r.to,insert:i.lineBreak+i.doc.slice(r.from,r.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}function dy(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Sn(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(St.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}function nu(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,a=e.doc.lineAt(s),l=!i&&s==o&&dy(e,s);i&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new ma(e,{simulateBreak:s,simulateDoubleBreak:!!l}),h=fa(c,s);for(h==null&&(h=Gr(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let d=["",zi(e,h)];return l&&d.push(zi(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:ca.of(d)},range:F.cursor(s+1+d[1].length)}});return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Sa(i,e){let t=-1;return i.changeByRange(n=>{let r=[];for(let o=n.from;o<=n.to;){let a=i.doc.lineAt(o);a.number>t&&(n.empty||n.to>a.from)&&(e(a,r,n),t=a.number),o=a.to+1}let s=i.changes(r);return{changes:r,range:F.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}var d0,u0,f0,m0,Pi,wd,y0,st,ot,v0,C0,Ht,Ld,Od,M0,E0,R1,T0,I0,zd,jd,kd,ya,D0,N0,L0,O0,R0,B0,j0,$d,Hd,P0,U0,F0,$0,Wd,Gd,Sd,Cd,H0,q0,V0,W0,G0,J0,Md,Ed,Ad,Td,K0,Y0,X0,Q0,Z0,wa,Yd,_a,Xd,Qd,Zd,ey,ty,ny,iy,ry,sy,oy,ay,ly,cy,hy,Qr,ka,uy,Fi,Ca,fy,iu,my,py,ru,Ma=E(()=>{$t();kt();ji();Jr();d0=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=va(i.state,t.from);return n.line?u0(i):n.block?m0(i):!1};u0=xa(b0,0),f0=xa(Id,0),m0=xa((i,e)=>Id(i,e,g0(e)),0);Pi=50;wd=Vr.define(),y0=rt.define(),st=class{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new st(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new st(e.changes&&Gh.fromJSON(e.changes),[],e.mapped&&Wh.fromJSON(e.mapped),e.startSelection&&F.fromJSON(e.startSelection),e.selectionsAfter.map(F.fromJSON))}static fromTransaction(e,t){let n=ot;for(let r of e.startState.facet(y0)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new st(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,ot)}static selection(e){return new st(void 0,ot,void 0,void 0,e)}};ot=[],v0=200;C0=/^(input\.type|delete)($|\.)/,Ht=class{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 Ht(this.done,this.undone):this}
vendor: 4,763 bytes, line 1
1addChanges(e,t,n,r,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!n||C0.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,_0(a.changes,e.changes))||n=="input.type.compose")?o=ba(o,o.length-1,r.minDepth,new st(e.changes.compose(a.changes),Dd(Ut.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,ot)):o=ba(o,o.length,r.minDepth,e),new Ht(o,ot,t,n)}addSelection(e,t,n,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ot;return s.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&x0(s[s.length-1],e)?this:new Ht(w0(this.done,e),this.undone,t,n)}addMapping(e){return new Ht(ga(this.done,e),ga(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||t.selection;if(n&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:wd.of({side:e,rest:k0(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=r.length==1?ot:r.slice(0,r.length-1);return s.mapped&&(a=ga(a,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:wd.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};Ht.empty=new Ht(ot,ot);Ld=i=>Nd(i,!Te(i)),Od=i=>Nd(i,Te(i));M0=i=>Rd(i,!Te(i)),E0=i=>Rd(i,Te(i)),R1=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;T0=i=>pt(i,e=>es(i.state,e,!Te(i))),I0=i=>pt(i,e=>es(i.state,e,Te(i)));zd=i=>Bd(i,!1),jd=i=>Bd(i,!0);kd=i=>Ud(i,!1),ya=i=>Ud(i,!0);D0=i=>pt(i,e=>rn(i,e,!0)),N0=i=>pt(i,e=>rn(i,e,!1)),L0=i=>pt(i,e=>rn(i,e,!Te(i))),O0=i=>pt(i,e=>rn(i,e,Te(i))),R0=i=>pt(i,e=>F.cursor(i.lineBlockAt(e.head).from,1)),B0=i=>pt(i,e=>F.cursor(i.lineBlockAt(e.head).to,-1));j0=({state:i,dispatch:e})=>z0(i,e,!1);$d=i=>Fd(i,!Te(i)),Hd=i=>Fd(i,Te(i));P0=i=>qd(i,!Te(i)),U0=i=>qd(i,Te(i)),F0=i=>at(i,e=>es(i.state,e,!Te(i))),$0=i=>at(i,e=>es(i.state,e,Te(i)));Wd=i=>Vd(i,!1),Gd=i=>Vd(i,!0);Sd=i=>Jd(i,!1),Cd=i=>Jd(i,!0),H0=i=>at(i,e=>rn(i,e,!0)),q0=i=>at(i,e=>rn(i,e,!1)),V0=i=>at(i,e=>rn(i,e,!Te(i))),W0=i=>at(i,e=>rn(i,e,Te(i))),G0=i=>at(i,e=>F.cursor(i.lineBlockAt(e.head).from)),J0=i=>at(i,e=>F.cursor(i.lineBlockAt(e.head).to)),Md=({state:i,dispatch:e})=>(e(mt(i,{anchor:0})),!0),Ed=({state:i,dispatch:e})=>(e(mt(i,{anchor:i.doc.length})),!0),Ad=({state:i,dispatch:e})=>(e(mt(i,{anchor:i.selection.main.anchor,head:0})),!0),Td=({state:i,dispatch:e})=>(e(mt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),K0=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),Y0=({state:i,dispatch:e})=>{let t=ts(i).map(({from:n,to:r})=>F.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:F.create(t),userEvent:"select"})),!0},X0=({state:i,dispatch:e})=>{let t=Jn(i.selection,n=>{let r=Sn(i),s=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<n.from&&a.to>=n.to||a.to>n.to&&a.from<=n.from)&&o.next)return F.range(a.to,a.from)}return n});return t.eq(i.selection)?!1:(e(mt(i,t)),!0)};Q0=i=>Kd(i,!1),Z0=i=>Kd(i,!0),wa=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=F.create([t.main]):t.main.empty||(n=F.create([F.cursor(t.main.head)])),n?(e(mt(i,n)),!0):!1};Yd=(i,e,t)=>Ui(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),a,l;if(t&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,r-o.from))){if(a[a.length-1]==" ")return r-1;let c=Gr(a,s.tabSize),h=c%Yr(s)||Yr(s);for(let d=0;d<h&&a[a.length-1-d]==" ";d++)r--;l=r}else l=Pt(o.text,r-o.from,e,e)+o.from,l==r&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,r-o.from))&&(l=Pt(o.text,l-o.from,!1,!1)+o.from);return l}),_a=i=>Yd(i,!1,!0),Xd=i=>Yd(i,!0,!1),Qd=(i,e)=>Ui(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let a=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let l=Pt(s.text,n-s.from,e)+s.from,c=s.text.slice(Math.min(n,l)-s.from,Math.max(n,l)-s.from),h=o(c);if(a!=null&&h!=a)break;(c!=" "||n!=t.head)&&(a=h),n=l}return n}),Zd=i=>Qd(i,!1),ey=i=>Qd(i,!0),ty=i=>Ui(i,e=>{let t=i.lineBlockAt(e.head).to;return e.head<t?t:Math.min(i.state.doc.length,e.head+1)}),ny=i=>Ui(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),iy=i=>Ui(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(i.state.doc.length,e.head+1)}),ry=({state:i,dispatch:e})=>
1{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:ca.of(["",""])},range:F.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},sy=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:Pt(s.text,r-s.from,!1)+s.from,a=r==s.to?r+1:Pt(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:i.doc.slice(r,a).append(i.doc.slice(o,r))},range:F.cursor(a)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};oy=({state:i,dispatch:e})=>eu(i,e,!1),ay=({state:i,dispatch:e})=>eu(i,e,!0);ly=({state:i,dispatch:e})=>tu(i,e,!1),cy=({state:i,dispatch:e})=>tu(i,e,!0),hy=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(ts(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),n=Jn(e.selection,r=>{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),a=i.coordsAtPos(r.head,r.assoc||1);a&&(s=o.bottom+i.documentTop-a.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};Qr=nu(!1),ka=nu(!0);uy=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new ma(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=Sa(i,(s,o,a)=>{let l=fa(n,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],h=zi(i,l);(c!=h||a.from<s.from+c.length)&&(t[s.from]=l,o.push({from:s.from,to:s.from+c.length,insert:h}))});return r.changes.empty||e(i.update(r,{userEvent:"indent"})),!0},Fi=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Sa(i,(t,n)=>{n.push({from:t.from,insert:i.facet(Bi)})}),{userEvent:"input.indent"})),!0),Ca=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Sa(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=Gr(r,i.tabSize),o=0,a=zi(i,Math.max(0,s-Yr(i)));for(;o<r.length&&o<a.length&&r.charCodeAt(o)==a.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),fy=i=>(i.setTabFocusMode(),!0),iu=({state:i,dispatch:e})=>i.selection.ranges.some(t=>!t.empty)?Fi({state:i,dispatch:e}):(e(i.update(i.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0),my=[{key:"Ctrl-b",run:Ld,shift:$d,preventDefault:!0},{key:"Ctrl-f",run:Od,shift:Hd},{key:"Ctrl-p",run:zd,shift:Wd},{key:"Ctrl-n",run:jd,shift:Gd},{key:"Ctrl-a",run:R0,shift:G0},{key:"Ctrl-e",run:B0,shift:J0},{key:"Ctrl-d",run:Xd},{key:"Ctrl-h",run:_a},{key:"Ctrl-k",run:ty},{key:"Ctrl-Alt-h",run:Zd},{key:"Ctrl-o",run:ry},{key:"Ctrl-t",run:sy},{key:"Ctrl-v",run:ya}],py=[{key:"ArrowLeft",run:Ld,shift:$d,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:M0,shift:P0,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:L0,shift:V0,preventDefault:!0},{key:"ArrowRight",run:Od,shift:Hd,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:E0,shift:U0,preventDefault:!0},{mac:"Cmd-ArrowRight",run:O0,shift:W0,preventDefault:!0},{key:"ArrowUp",run:zd,shift:Wd,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Md,shift:Ad},{mac:"Ctrl-ArrowUp",run:kd,shift:Sd},{key:"ArrowDown",run:jd,shift:Gd,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ed,shift:Td},{mac:"Ctrl-ArrowDown",run:ya,shift:Cd},{key:"PageUp",run:kd,shift:Sd},{key:"PageDown",run:ya,shift:Cd},{key:"Home",run:N0,shift:q0,preventDefault:!0},{key:"Mod-Home",run:Md,shift:Ad},{key:"End",run:D0,shift:H0,preventDefault:!0},{key:"Mod-End",run:Ed,shift:Td},{key:"Enter",run:Qr,shift:Qr},{key:"Mod-a",run:K0},{key:"Backspace",run:_a,shift:_a,preventDefault:!0},{key:"Delete",run:Xd,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Zd,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ey,preventDefault:!0},{mac:"Mod-Backspace",run:ny,preventDefault:!0},{mac:"Mod-Delete",run:iy,preventDefault:!0}].concat(my.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),ru=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:T0,shift:F0},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:I0,shift:$0},{key:"Alt-ArrowUp",run:oy},{key:"Shift-Alt-ArrowUp",run:ly},{key:"Alt-ArrowDown",run:ay},{key:"Shift-Alt-ArrowDown",run:cy},{key:"Mod-Alt-ArrowUp",run:Q0},{key:"Mod-Alt-ArrowDown",run:Z0},{key:"Escape",run:wa},{key:"Mod-Enter",run:ka},{key:"Alt-l",mac:"Ctrl-l",run:Y0},{key:"Mod-i",run:X0,preventDefault:!0},{key:"Mod-[",run:Ca},{key:"Mod-]",run:Fi},{key:"Mod-Alt-\\",run:uy},{key:"Shift-Mod-k",run:hy},{key:"Shift-Mod-\\",run:j0},{key:"Mod-/",run:d0},{key:"Alt-A",run:f0},{key:"Ctrl-m",mac:"Shift-Alt-m",run:fy}].concat(py)});var su=E(()=>{});var ou=E(()=>{});var au=E(()=>{});var lu=E(()=>{});var lt,Kn,ns,sn,j1,cu,$i=E(()=>{lt=Math.floor,Kn=Math.abs,ns=(i,e)=>i<e?i:e,sn=(i,e)=>i>e?i:e,j1=Number.isNaN,cu=i=>i!==0?i<0:1/i<0});var P1,U1,F1,hu,$1,H1,du=E(()=>{$i();P1=Number.MAX_SAFE_INTEGER,U1=Number.MIN_SAFE_INTEGER,F1=1<<31,hu=Number.isInteger||(i=>typeof i=="number"&&isFinite(i)&<(i)===i),$1=Number.isNaN,H1=Number.parseInt});
1var Ct,rs=E(()=>{Ct=()=>new Set});var ss,uu,qt,fu,Hi,os=E(()=>{ss=i=>i[i.length-1],uu=(i,e)=>{for(let t=0;t<e.length;t++)i.push(e[t])},qt=Array.from,fu=(i,e)=>{for(let t=0;t<i.length;t++)if(e(i[t],t,i))return!0;return!1},Hi=Array.isArray});var by,q1,V1,yy,_y,xy,vy,Ia,wy,Yn,ky,mu,Ta,Da=E(()=>{by=String.fromCharCode,q1=String.fromCodePoint,V1=by(65535),yy=i=>i.toLowerCase(),_y=/^\s*/g,xy=i=>i.replace(_y,""),vy=/([A-Z])/g,Ia=(i,e)=>xy(i.replace(vy,t=>`${e}${yy(t)}`)),wy=i=>{let e=unescape(encodeURIComponent(i)),t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=e.codePointAt(r);return n},Yn=typeof TextEncoder<"u"?new TextEncoder:null,ky=i=>Yn.encode(i),mu=Yn?ky:wy,Ta=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ta&&Ta.decode(new Uint8Array).length===1&&(Ta=null)});var Mn,cs,My,Mt,Ey,we,hs,ee,ds,La,Ay,Ty,Iy,En,us,Ue,Oa,Dy,Ny,Ly,gu,Oy,Xn,qi,bu,An,yu,Qn,ls,_u=E(()=>{$i();du();Da();os();Mn=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},cs=()=>new Mn,My=i=>{let e=i.cpos;for(let t=0;t<i.bufs.length;t++)e+=i.bufs[t].length;return e},Mt=i=>{let e=new Uint8Array(My(i)),t=0;for(let n=0;n<i.bufs.length;n++){let r=i.bufs[n];e.set(r,t),t+=r.length}return e.set(new Uint8Array(i.cbuf.buffer,0,i.cpos),t),e},Ey=(i,e)=>{let t=i.cbuf.length;t-i.cpos<e&&(i.bufs.push(new Uint8Array(i.cbuf.buffer,0,i.cpos)),i.cbuf=new Uint8Array(sn(t,e)*2),i.cpos=0)},we=(i,e)=>{let t=i.cbuf.length;i.cpos===t&&(i.bufs.push(i.cbuf),i.cbuf=new Uint8Array(t*2),i.cpos=0),i.cbuf[i.cpos++]=e},hs=we,ee=(i,e)=>{for(;e>127;)we(i,128|127&e),e=lt(e/128);we(i,127&e)},ds=(i,e)=>{let t=cu(e);for(t&&(e=-e),we(i,(e>63?128:0)|(t?64:0)|63&e),e=lt(e/64);e>0;)we(i,(e>127?128:0)|127&e),e=lt(e/128)},La=new Uint8Array(3e4),Ay=La.length/3,Ty=(i,e)=>{if(e.length<Ay){let t=Yn.encodeInto(e,La).written||0;ee(i,t);for(let n=0;n<t;n++)we(i,La[n])}else Ue(i,mu(e))},Iy=(i,e)=>{let t=unescape(encodeURIComponent(e)),n=t.length;ee(i,n);for(let r=0;r<n;r++)we(i,t.codePointAt(r))},En=Yn&&Yn.encodeInto?Ty:Iy,us=(i,e)=>{let t=i.cbuf.length,n=i.cpos,r=ns(t-n,e.length),s=e.length-r;i.cbuf.set(e.subarray(0,r),n),i.cpos+=r,s>0&&(i.bufs.push(i.cbuf),i.cbuf=new Uint8Array(sn(t*2,s)),i.cbuf.set(e.subarray(r)),i.cpos=s)},Ue=(i,e)=>{ee(i,e.byteLength),us(i,e)},Oa=(i,e)=>{Ey(i,e);let t=new DataView(i.cbuf.buffer,i.cpos,e);return i.cpos+=e,t},Dy=(i,e)=>Oa(i,4).setFloat32(0,e,!1),Ny=(i,e)=>Oa(i,8).setFloat64(0,e,!1),Ly=(i,e)=>Oa(i,8).setBigInt64(0,e,!1),gu=new DataView(new ArrayBuffer(4)),Oy=i=>(gu.setFloat32(0,i),gu.getFloat32(0)===i),Xn=(i,e)=>{switch(typeof e){case"string":we(i,119),En(i,e);break;case"number":hu(e)&&Kn(e)<=2147483647?(we(i,125),ds(i,e)):Oy(e)?(we(i,124),Dy(i,e)):(we(i,123),Ny(i,e));break;case"bigint":we(i,122),Ly(i,e);break;case"object":if(e===null)we(i,126);else if(Hi(e)){we(i,117),ee(i,e.length);for(let t=0;t<e.length;t++)Xn(i,e[t])}else if(e instanceof Uint8Array)we(i,116),Ue(i,e);else{we(i,118);let t=Object.keys(e);ee(i,t.length);for(let n=0;n<t.length;n++){let r=t[n];En(i,r),Xn(i,e[r])}}break;case"boolean":we(i,e?120:121);break;default:we(i,127)}},qi=class extends Mn{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ee(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},bu=i=>{i.count>0&&(ds(i.encoder,i.count===1?i.s:-i.s),i.count>1&&ee(i.encoder,i.count-2))},An=class{constructor(){this.encoder=new Mn,this.s=0,this.count=0}write(e){this.s===e?this.count++:(bu(this),this.count=1,this.s=e)}toUint8Array(){return bu(this),Mt(this.encoder)}},yu=i=>{if(i.count>0){let e=i.diff*2+(i.count===1?0:1);ds(i.encoder,e),i.count>1&&ee(i.encoder,i.count-2)}},Qn=class{constructor(){this.encoder=new Mn,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(yu(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return yu(this),Mt(this.encoder)}},ls=class{constructor(){this.sarr=[],this.s="",this.lensE=new An}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){let e=new Mn;return this.sarr.push(this.s),this.s="",En(e,this.sarr.join("")),us(e,this.lensE.toUint8Array()),Mt(e)}}});var Tn,gt,on,xu=E(()=>{Tn=i=>new Error(i),gt=()=>{throw Tn("Method unimplemented")},on=()=>{throw Tn("Unexpected case")}});var an,fs=E(()=>{an=Date.now});var Ce,ms,Vt,vu,wu,Zn=E(()=>{Ce=()=>new Map,ms=i=>{let e=Ce();
1return i.forEach((t,n)=>{e.set(n,t)}),e},Vt=(i,e,t)=>{let n=i.get(e);return n===void 0&&i.set(e,n=t()),n},vu=(i,e)=>{let t=[];for(let[n,r]of i)t.push(e(r,n));return t},wu=(i,e)=>{for(let[t,n]of i)if(e(n,t))return!0;return!1}});var Wi,ps,Ba=E(()=>{Zn();rs();os();Wi=class{constructor(){this._observers=Ce()}on(e,t){return Vt(this._observers,e,Ct).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return qt((this._observers.get(e)||Ce()).values()).forEach(n=>n(...t))}destroy(){this._observers=Ce()}},ps=class{constructor(){this._observers=Ce()}on(e,t){Vt(this._observers,e,Ct).add(t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return qt((this._observers.get(e)||Ce()).values()).forEach(n=>n(...t))}destroy(){this._observers=Ce()}}});var Su,Cu,Mu,za,ku,Eu,zy,ja,Pa,jy,Ua,Fa=E(()=>{Su=Object.assign,Cu=Object.keys,Mu=(i,e)=>{for(let t in i)e(i[t],t)},za=i=>Cu(i).length,ku=i=>Cu(i).length,Eu=i=>{for(let e in i)return!1;return!0},zy=(i,e)=>{for(let t in i)if(!e(i[t],t))return!1;return!0},ja=(i,e)=>Object.prototype.hasOwnProperty.call(i,e),Pa=(i,e)=>i===e||ku(i)===ku(e)&&zy(i,(t,n)=>(t!==void 0||ja(e,n))&&e[n]===t),jy=Object.freeze,Ua=i=>{for(let e in i){let t=i[e];(typeof t=="object"||typeof t=="function")&&Ua(i[e])}return jy(i)}});var $a,Tu=E(()=>{$a=Symbol("Equality")});var Ji,Gi,Iu,Ki=E(()=>{Fa();Tu();Ji=(i,e,t=0)=>{try{for(;t<i.length;t++)i[t](...e)}finally{t<i.length&&Ji(i,e,t+1)}},Gi=(i,e)=>{if(i===e)return!0;if(i==null||e==null||i.constructor!==e.constructor)return!1;if(i[$a]!=null)return i[$a](e);switch(i.constructor){case ArrayBuffer:i=new Uint8Array(i),e=new Uint8Array(e);case Uint8Array:{if(i.byteLength!==e.byteLength)return!1;for(let t=0;t<i.length;t++)if(i[t]!==e[t])return!1;break}case Set:{if(i.size!==e.size)return!1;for(let t of i)if(!e.has(t))return!1;break}case Map:{if(i.size!==e.size)return!1;for(let t of i.keys())if(!e.has(t)||!Gi(i.get(t),e.get(t)))return!1;break}case Object:if(za(i)!==za(e))return!1;for(let t in i)if(!ja(i,t)||!Gi(i[t],e[t]))return!1;break;case Array:if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(!Gi(i[t],e[t]))return!1;break;default:return!1}return!0},Iu=(i,e)=>e.includes(i)});var J1,Du,Nu=E(()=>{J1=crypto.subtle,Du=crypto.getRandomValues.bind(crypto)});var qa,Uy,Lu,Ou=E(()=>{Nu();qa=()=>Du(new Uint32Array(1))[0],Uy=[1e7]+-1e3+-4e3+-8e3+-1e11,Lu=()=>Uy.replace(/[018]/g,i=>(i^qa()&15>>i/4).toString(16))});var Va,X1,Ru=E(()=>{Va=i=>new Promise(i),X1=Promise.all.bind(Promise)});var Wa,Bu=E(()=>{Wa=i=>i===void 0?null:i});var Ga,zu,qy,ju,Pu=E(()=>{Ga=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},zu=new Ga,qy=!0;try{typeof localStorage<"u"&&localStorage&&(zu=localStorage,qy=!1)}catch{}ju=zu});var Yi,Q1,Et,Wy,Gy,Ja,Xi,Uu,Z1,Jy,Fu,Ka=E(()=>{Zn();Da();Bu();Pu();Ki();Yi=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",Q1=typeof navigator<"u"?/Mac/.test(navigator.platform):!1,Wy=[],Gy=()=>{if(Et===void 0)if(Yi){Et=Ce();let i=process.argv,e=null;for(let t=0;t<i.length;t++){let n=i[t];n[0]==="-"?(e!==null&&Et.set(e,""),e=n):e!==null?(Et.set(e,n),e=null):Wy.push(n)}e!==null&&Et.set(e,"")}else typeof location=="object"?(Et=Ce(),(location.search||"?").slice(1).split("&").forEach(i=>{if(i.length!==0){let[e,t]=i.split("=");Et.set(`--${Ia(e,"-")}`,t),Et.set(`-${Ia(e,"-")}`,t)}})):Et=Ce();return Et},Ja=i=>Gy().has(i),Xi=i=>Yi?Wa(process.env[i.toUpperCase().replaceAll("-","_")]):Wa(ju.getItem(i)),Uu=i=>Ja("--"+i)||Xi(i)!==null,Z1=Uu("production"),Jy=Yi&&Iu(process.env.FORCE_COLOR,["true","1","2"]),Fu=Jy||!Ja("--no-colors")&&!Uu("no-color")&&(!Yi||process.stdout.isTTY)&&(!Yi||Ja("--color")||Xi("COLORTERM")!==null||(Xi("TERM")||"").includes("color"))});var Ya,At,Hu=E(()=>{Ya=class{constructor(e,t){this.left=e,this.right=t}},At=(i,e)=>new Ya(i,e)});var In,ek,qu,tk,nk,ik,rk,sk,ok,ak,Vu=E(()=>{Zn();In=typeof document<"u"?document:{},ek=typeof DOMParser<"u"?new DOMParser:null,qu=i=>vu(i,(e,t)=>`${t}:${e};`).join(""),tk=In.ELEMENT_NODE,nk=In.TEXT_NODE,ik=In.CDATA_SECTION_NODE,rk=In.COMMENT_NODE,sk=In.DOCUMENT_NODE,ok=In.DOCUMENT_TYPE_NODE,ak=In.DOCUMENT_FRAGMENT_NODE}
1);var Tt,Wu=E(()=>{Tt=Symbol});var Qi,Zi,Xa,Qa,Za,er,el,ei,tl,Gu,lk,nl=E(()=>{Wu();fs();Qi=Tt(),Zi=Tt(),Xa=Tt(),Qa=Tt(),Za=Tt(),er=Tt(),el=Tt(),ei=Tt(),tl=Tt(),Gu=i=>{i.length===1&&i[0]?.constructor===Function&&(i=i[0]());let e=[],t=[],n=0;for(;n<i.length;n++){let r=i[n];if(r===void 0)break;if(r.constructor===String||r.constructor===Number)e.push(r);else if(r.constructor===Object)break}for(n>0&&t.push(e.join(""));n<i.length;n++){let r=i[n];r instanceof Symbol||t.push(r)}return t},lk=an()});var Zy,e_,Ju,Ku,il,Yu,Xu=E(()=>{Ka();rs();Hu();Vu();Zn();nl();nl();Zy={[Qi]:At("font-weight","bold"),[Zi]:At("font-weight","normal"),[Xa]:At("color","blue"),[Za]:At("color","green"),[Qa]:At("color","grey"),[er]:At("color","red"),[el]:At("color","purple"),[ei]:At("color","orange"),[tl]:At("color","black")},e_=i=>{i.length===1&&i[0]?.constructor===Function&&(i=i[0]());let e=[],t=[],n=Ce(),r=[],s=0;for(;s<i.length;s++){let o=i[s],a=Zy[o];if(a!==void 0)n.set(a.left,a.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){let l=qu(n);s>0||l.length>
10?(e.push("%c"+o),t.push(l)):e.push(o)}else break}}for(s>0&&(r=t,r.unshift(e.join("")));s<i.length;s++){let o=i[s];o instanceof Symbol||r.push(o)}return r},Ju=Fu?e_:Gu,Ku=(...i)=>{console.log(...Ju(i)),Yu.forEach(e=>e.print(i))},il=(...i)=>{console.warn(...Ju(i)),i.unshift(ei),Yu.forEach(e=>e.print(i))},Yu=Ct()});var Qu,Zu,gs,ef=E(()=>{Qu=i=>({[Symbol.iterator](){return this},next:i}),Zu=(i,e)=>Qu(()=>{let t;do t=i.next();while(!t.done&&!e(t.value));return t}),gs=(i,e)=>Qu(()=>{let{done:t,value:n}=i.next();return{done:t,value:t?void 0:e(n)}})});var sl,ii,ri,s_,sr,wl,rf,kl,o_,a_,yf,Dt,ol,al,ll,cl,l_,c_,h_,hl,sf,of,af,_f,ni,bs,oe,d_,ws,dl,u_,wk,ti,ul,fl,Sl,Le,xf,Wt,f_,xs,ml,Fe,lf,m_,vf,pl,cf,hf,vs,p_,g_,wf,se,gl,df,uf,ks,ff,si,b_,Ie,kf,Cl,bl,y_,Sf,__,Es,nr,As,me,Cf,Mf,ir,Ef,x_,Af,Ss,Tf,If,v_,Df,Cs,Ml,El,Nf,Lf,w_,ys,yl,Dn,_l,oi,ln,rr,mf,_s,Of,di,Rf,Bf,rl,pf,zf,k_,S_,C_,gf,xl,ai,tr,cn,Nn,vl,Ms,M_,It,li,ci,E_,hi,hn,pe,A_,dn,bt,T_,I_,D_,N_,L_,Nt,O_,Al,jf,bf,Pf,ae,Uf,Ff,$f=E(()=>{Ba();os();$i();Zn();_u();Ou();Ru();xu();Ki();Ki();rs();Xu();fs();ef();Fa();Ka();sl=class{constructor(e,t){this.clock=e,this.len=t}},ii=class{constructor(){this.clients=new Map}},ri=(i,e,t)=>e.clients.forEach((n,r)=>{let s=i.doc.store.clients.get(r);if(s!=null){let o=s[s.length-1],a=o.id.clock+o.length;for(let l=0,c=n[l];l<n.length&&c.clock<a;c=n[++l])vf(i,s,c.clock,c.len,t)}}),s_=(i,e)=>{let t=0,n=i.length-1;for(;t<=n;){let r=lt((t+n)/2),s=i[r],o=s.clock;if(o<=e){if(e<o+s.len)return r;t=r+1}else n=r-1}return null},sr=(i,e)=>{let t=i.clients.get(e.client);return t!==void 0&&s_(t,e.clock)!==null},wl=i=>{i.clients.forEach(e=>{e.sort((r,s)=>r.clock-s.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],s=e[t];r.clock+r.len>=s.clock?r.len=sn(r.len,s.clock+s.len-r.clock):(n<t&&(e[n]=s),n++)}e.length=n})},rf=i=>{let e=new ii;for(let t=0;t<i.length;t++)i[t].clients.forEach((n,r)=>{if(!e.clients.has(r)){let s=n.slice();for(let o=t+1;o<i.length;o++)uu(s,i[o].clients.get(r)||[]);e.clients.set(r,s)}});return wl(e),e},kl=(i,e,t,n)=>{Vt(i.clients,e,()=>[]).push(new sl(t,n))},o_=()=>new ii,a_=(i,e)=>{ee(i.restEncoder,e.clients.size),qt(e.clients.entries()).sort((t,n)=>n[0]-t[0]).forEach(([t,n])=>{i.resetDsCurVal(),ee(i.restEncoder,t);let r=n.length;ee(i.restEncoder,r);for(let s=0;s<r;s++){let o=n[s];i.writeDsClock(o.clock),i.writeDsLen(o.len)}})},yf=qa,Dt=class extends Wi{constructor({guid:e=Lu(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:a=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=yf(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new fl,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Va(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});let l=()=>Va(c=>{let h=d=>{(d===void 0||d===!0)&&(this.off("sync",h),c())};this.on("sync",h)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){let e=this._item;e!==null&&!this.shouldLoad&&se(e.parent.doc,t=>{t.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(qt(this.subdocs).map(e=>e.guid))}transact(e,t=null){return se(this,e,t)}get(e,t=me){let n=Vt(this.share,e,()=>{let s=new t;return s._integrate(this,null),s}),r=n.constructor;if(t!==me&&r!==t)if(r===me){let s=new t;s._map=n._map,n._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=n._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=n._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=""){return this.get(e,Dn)}getText(e=""){return this.get(e,ai)}getMap(e=""){return this.get(e,oi)}getXmlElement(e=""){return this.get(e,Nn)}getXmlFragment(e=""){return this.get(e,cn)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}
1destroy(){this.isDestroyed=!0,qt(this.subdocs).forEach(t=>t.destroy());let e=this._item;if(e!==null){this._item=null;let t=e.content;t.doc=new Dt({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,se(e.parent.doc,n=>{let r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}},ol=class{constructor(){this.restEncoder=cs()}toUint8Array(){return Mt(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ee(this.restEncoder,e)}writeDsLen(e){ee(this.restEncoder,e)}},al=class extends ol{writeLeftID(e){ee(this.restEncoder,e.client),ee(this.restEncoder,e.clock)}writeRightID(e){ee(this.restEncoder,e.client),ee(this.restEncoder,e.clock)}writeClient(e){ee(this.restEncoder,e)}writeInfo(e){hs(this.restEncoder,e)}writeString(e){En(this.restEncoder,e)}writeParentInfo(e){ee(this.restEncoder,e?1:0)}writeTypeRef(e){ee(this.restEncoder,e)}writeLen(e){ee(this.restEncoder,e)}writeAny(e){Xn(this.restEncoder,e)}writeBuf(e){Ue(this.restEncoder,e)}writeJSON(e){En(this.restEncoder,JSON.stringify(e))}writeKey(e){En(this.restEncoder,e)}},ll=class{constructor(){this.restEncoder=cs(),this.dsCurrVal=0}toUint8Array(){return Mt(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,ee(this.restEncoder,t)}writeDsLen(e){e===0&&on(),ee(this.restEncoder,e-1),this.dsCurrVal+=e}},cl=class extends ll{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Qn,this.clientEncoder=new An,this.leftClockEncoder=new Qn,this.rightClockEncoder=new Qn,this.infoEncoder=new qi(hs),this.stringEncoder=new ls,this.parentInfoEncoder=new qi(hs),this.typeRefEncoder=new An,this.lenEncoder=new An}toUint8Array(){let e=cs();return ee(e,0),Ue(e,this.keyClockEncoder.toUint8Array()),Ue(e,this.clientEncoder.toUint8Array()),Ue(e,this.leftClockEncoder.toUint8Array()),Ue(e,this.rightClockEncoder.toUint8Array()),Ue(e,Mt(this.infoEncoder)),Ue(e,this.stringEncoder.toUint8Array()),Ue(e,Mt(this.parentInfoEncoder)),Ue(e,this.typeRefEncoder.toUint8Array()),Ue(e,this.lenEncoder.toUint8Array()),us(e,Mt(this.restEncoder)),Mt(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Xn(this.restEncoder,e)}writeBuf(e){Ue(this.restEncoder,e)}writeJSON(e){Xn(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},l_=(i,e,t,n)=>{n=sn(n,e[0].id.clock);let r=Wt(e,n);ee(i.restEncoder,e.length-r),i.writeClient(t),ee(i.restEncoder,n);let s=e[r];s.write(i,n-s.id.clock);for(let o=r+1;o<e.length;o++)e[o].write(i,0)},c_=(i,e,t)=>{let n=new Map;t.forEach((r,s)=>{Le(e,s)>r&&n.set(s,r)}),Sl(e).forEach((r,s)=>{t.has(s)||n.set(s,0)}),ee(i.restEncoder,n.size),qt(n.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{l_(i,e.clients.get(r),r,s)})},h_=(i,e)=>c_(i,e.doc.store,e.beforeState),hl=class{constructor(){this.l=[]}},sf=()=>new hl,of=(i,e)=>i.l.push(e),af=(i,e)=>{let t=i.l,n=t.length;i.l=t.filter(r=>e!==r),n===i.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},_f=(i,e,t)=>Ji(i.l,[e,t]),ni=class{constructor(e,t){this.client=e,this.clock=t}},bs=(i,e)=>i===e||i!==null&&e!==null&&i.client===e.client&&i.clock===e.clock,oe=(i,e)=>new ni(i,e),d_=i=>{for(let[e,t]of i.doc.share.entries())if(t===i)return e;throw on()},ws=(i,e)=>{for(;e!==null;){if(e.parent===i)return!0;e=e.parent._item}return!1},dl=class{constructor(e,t){this.ds=e,this.sv=t}},u_=(i,e)=>new dl(i,e),wk=u_(o_(),new Map),ti=(i,e)=>e===void 0?!i.deleted:e.sv.has(i.id.client)&&(e.sv.get(i.id.client)||0)>i.id.clock&&!sr(e.ds,i.id),ul=(i,e)=>{let t=Vt(i.meta,ul,Ct),n=i.doc.store;t.has(e)||(e.sv.forEach((r,s)=>{r<Le(n,s)&&Fe(i,oe(s,r))}),ri(i,e.ds,r=>{}),t.add(e))},fl=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},Sl=i=>{let e=new Map;
1return i.clients.forEach((t,n)=>{let r=t[t.length-1];e.set(n,r.id.clock+r.length)}),e},Le=(i,e)=>{let t=i.clients.get(e);if(t===void 0)return 0;let n=t[t.length-1];return n.id.clock+n.length},xf=(i,e)=>{let t=i.clients.get(e.id.client);if(t===void 0)t=[],i.clients.set(e.id.client,t);else{let n=t[t.length-1];if(n.id.clock+n.length!==e.id.clock)throw on()}t.push(e)},Wt=(i,e)=>{let t=0,n=i.length-1,r=i[n],s=r.id.clock;if(s===e)return n;let o=lt(e/(s+r.length-1)*n);for(;t<=n;){if(r=i[o],s=r.id.clock,s<=e){if(e<s+r.length)return o;t=o+1}else n=o-1;o=lt((t+n)/2)}throw on()},f_=(i,e)=>{let t=i.clients.get(e.client);return t[Wt(t,e.clock)]},xs=f_,ml=(i,e,t)=>{let n=Wt(e,t),r=e[n];return r.id.clock<t&&r instanceof ae?(e.splice(n+1,0,jf(i,r,t-r.id.clock)),n+1):n},Fe=(i,e)=>{let t=i.doc.store.clients.get(e.client);return t[ml(i,t,e.clock)]},lf=(i,e,t)=>{let n=e.clients.get(t.client),r=Wt(n,t.clock),s=n[r];return t.clock!==s.id.clock+s.length-1&&s.constructor!==It&&n.splice(r+1,0,jf(i,s,t.clock-s.id.clock+1)),s},m_=(i,e,t)=>{let n=i.clients.get(e.id.client);n[Wt(n,e.id.clock)]=t},vf=(i,e,t,n,r)=>{if(n===0)return;let s=t+n,o=ml(i,e,t),a;do a=e[o++],s<a.id.clock+a.length&&ml(i,e,s),r(a);while(o<e.length&&e[o].id.clock<s)},pl=class{constructor(e,t,n){this.doc=e,this.deleteSet=new ii,this.beforeState=Sl(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},cf=(i,e)=>e.deleteSet.clients.size===0&&!wu(e.afterState,(t,n)=>e.beforeState.get(n)!==t)?!1:(wl(e.deleteSet),h_(i,e),a_(i,e.deleteSet),!0),hf=(i,e,t)=>{let n=e._item;(n===null||n.id.clock<(i.beforeState.get(n.id.client)||0)&&!n.deleted)&&Vt(i.changed,e,Ct).add(t)},vs=(i,e)=>{let t=i[e],n=i[e-1],r=e;for(;r>0;t=n,n=i[--r-1]){if(n.deleted===t.deleted&&n.constructor===t.constructor&&n.mergeWith(t)){t instanceof ae&&t.parentSub!==null&&t.parent._map.get(t.parentSub)===t&&t.parent._map.set(t.parentSub,n);continue}break}let s=e-r;return s&&i.splice(e+1-s,s),s},p_=(i,e,t)=>{for(let[n,r]of i.clients.entries()){let s=e.clients.get(n);for(let o=r.length-1;o>=0;o--){let a=r[o],l=a.clock+a.len;for(let c=Wt(s,a.clock),h=s[c];c<s.length&&h.id.clock<l;h=s[++c]){let d=s[c];if(a.clock+a.len<=d.id.clock)break;d instanceof ae&&d.deleted&&!d.keep&&t(d)&&d.gc(e,!1)}}}},g_=(i,e)=>{i.clients.forEach((t,n)=>{let r=e.clients.get(n);for(let s=t.length-1;s>=0;s--){let o=t[s],a=ns(r.length-1,1+Wt(r,o.clock+o.len-1));for(let l=a,c=r[l];l>0&&c.id.clock>=o.clock;c=r[l])l-=1+vs(r,l)}})},wf=(i,e)=>{if(e<i.length){let t=i[e],n=t.doc,r=n.store,s=t.deleteSet,o=t._mergeStructs;try{wl(s),t.afterState=Sl(t.doc.store),n.emit("beforeObserverCalls",[t,n]);let a=[];t.changed.forEach((l,c)=>a.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(t,l)})),a.push(()=>{t.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(h=>h.target._item===null||!h.target._item.deleted),l.forEach(h=>{h.currentTarget=c,h._path=null}),l.sort((h,d)=>h.path.length-d.path.length),_f(c._dEH,l,t))})}),a.push(()=>n.emit("afterTransaction",[t,n])),Ji(a,[]),t._needFormattingCleanup&&C_(t)}finally{n.gc&&p_(s,r,n.gcFilter),g_(s,r),t.afterState.forEach((h,d)=>{let u=t.beforeState.get(d)||0;if(u!==h){let f=r.clients.get(d),p=sn(Wt(f,u),1);for(let m=f.length-1;m>=p;)m-=1+vs(f,m)}});for(let h=o.length-1;h>=0;h--){let{client:d,clock:u}=o[h].id,f=r.clients.get(d),p=Wt(f,u);p+1<f.length&&vs(f,p+1)>1||p>0&&vs(f,p)}if(!t.local&&t.afterState.get(n.clientID)!==t.beforeState.get(n.clientID)&&(Ku(ei,Qi,"[yjs] ",Zi,er,"Changed the client-id because another client seems to be using it."),n.clientID=yf()),n.emit("afterTransactionCleanup",[t,n]),n._observers.has("update")){let h=new al;cf(h,t)&&n.emit("update",[h.toUint8Array(),t.origin,n,t])}if(n._observers.has("updateV2")){let h=new cl;cf(h,t)&&n.emit("updateV2",[h.toUint8Array(),t.origin,n,t])}let{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=t;(a.size>0||c.size>0||l.size>
10)&&(a.forEach(h=>{h.clientID=n.clientID,h.collectionid==null&&(h.collectionid=n.collectionid),n.subdocs.add(h)}),c.forEach(h=>n.subdocs.delete(h)),n.emit("subdocs",[{loaded:l,added:a,removed:c},n,t]),c.forEach(h=>h.destroy())),i.length<=e+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,i])):wf(i,e+1)}}},se=(i,e,t=null,n=!0)=>{let r=i._transactionCleanups,s=!1,o=null;i._transaction===null&&(s=!0,i._transaction=new pl(i,t,n),r.push(i._transaction),r.length===1&&i.emit("beforeAllTransactions",[i]),i.emit("beforeTransaction",[i._transaction,i]));try{o=e(i._transaction)}finally{if(s){let a=i._transaction===r[0];i._transaction=null,a&&wf(r,0)}}return o},gl=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},df=(i,e,t)=>{ri(i,t.deletions,n=>{n instanceof ae&&e.scope.some(r=>r===i.doc||ws(r,n))&&Al(n,!1)})},uf=(i,e,t)=>{let n=null,r=i.doc,s=i.scope;se(r,a=>{for(;e.length>0&&i.currStackItem===null;){let l=r.store,c=e.pop(),h=new Set,d=[],u=!1;ri(a,c.insertions,f=>{if(f instanceof ae){if(f.redone!==null){let{item:p,diff:m}=O_(l,f.id);m>0&&(p=Fe(a,oe(p.id.client,p.id.clock+m))),f=p}!f.deleted&&s.some(p=>p===a.doc||ws(p,f))&&d.push(f)}}),ri(a,c.deletions,f=>{f instanceof ae&&s.some(p=>p===a.doc||ws(p,f))&&!sr(c.insertions,f.id)&&h.add(f)}),h.forEach(f=>{u=Pf(a,f,h,c.insertions,i.ignoreRemoteMapChanges,i)!==null||u});for(let f=d.length-1;f>=0;f--){let p=d[f];i.deleteFilter(p)&&(p.delete(a),u=!0)}i.currStackItem=u?c:null}a.changed.forEach((l,c)=>{l.has(null)&&c._searchMarker&&(c._searchMarker.length=0)}),n=a},i);let o=i.currStackItem;if(o!=null){let a=n.changedParentTypes;i.emit("stack-item-popped",[{stackItem:o,type:t,changedParentTypes:a,origin:i},i]),i.currStackItem=null}return o},ks=class extends Wi{constructor(e,{captureTimeout:t=500,captureTransaction:n=l=>!0,deleteFilter:r=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:a=Hi(e)?e[0].doc:e instanceof Dt?e:e.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(e),this.deleteFilter=r,s.add(this),this.trackedOrigins=s,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=t,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(g=>l.changedParentTypes.has(g)||g===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;let c=this.undoing,h=this.redoing,d=c?this.redoStack:this.undoStack;c?this.stopCapturing():h||this.clear(!1,!0);let u=new ii;l.afterState.forEach((g,b)=>{let y=l.beforeState.get(b)||0,_=g-y;_>0&&kl(u,b,y,_)});let f=an(),p=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&d.length>0&&!c&&!h){let g=d[d.length-1];g.deletions=rf([g.deletions,l.deleteSet]),g.insertions=rf([g.insertions,u])}else d.push(new gl(l.deleteSet,u)),p=!0;!c&&!h&&(this.lastChange=f),ri(l,l.deleteSet,g=>{g instanceof ae&&this.scope.some(b=>b===l.doc||ws(b,g))&&Al(g,!0)});let m=[{stackItem:d[d.length-1],origin:l.origin,type:c?"redo":"undo",changedParentTypes:l.changedParentTypes},this];p?this.emit("stack-item-added",m):this.emit("stack-item-updated",m)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=Hi(e)?e:[e],e.forEach(n=>{t.has(n)||(t.add(n),(n instanceof me?n.doc!==this.doc:n!==this.doc)&&il("[yjs#509] Not same Y.Doc"),this.scope.push(n))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(r=>df(n,this,r)),this.undoStack=[]),t&&(this.redoStack.forEach(r=>df(n,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=uf(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=uf(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}},ff="You must not compute changes after the event-handler fired.",si=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=b_(this.currentTarget,this.target))}deletes(e){return sr(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Tn(ff);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(r=>{if(r!==null){let s=t._map.get(r),o,a;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);
1)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",a=ss(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",a=ss(l.content.getContent())):(o="add",a=void 0)}else if(this.deletes(s))o="delete",a=ss(s.content.getContent());else return;e.set(r,{action:o,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Tn(ff);let t=this.target,n=Ct(),r=Ct(),s=[];if(e={added:n,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(t).has(null)){let a=null,l=()=>{a&&s.push(a)};for(let c=t._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,r.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),n.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}},b_=(i,e)=>{let t=[];for(;e._item!==null&&e!==i;){if(e._item.parentSub!==null)t.unshift(e._item.parentSub);else{let n=0,r=e._item.parent._start;for(;r!==e._item&&r!==null;)!r.deleted&&r.countable&&(n+=r.length),r=r.right;t.unshift(n)}e=e._item.parent}return t},Ie=()=>{il("Invalid access: Add Yjs type to a document before reading data.")},kf=80,Cl=0,bl=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Cl++}},y_=i=>{i.timestamp=Cl++},Sf=(i,e,t)=>{i.p.marker=!1,i.p=e,e.marker=!0,i.index=t,i.timestamp=Cl++},__=(i,e,t)=>{if(i.length>=kf){let n=i.reduce((r,s)=>r.timestamp<s.timestamp?r:s);return Sf(n,e,t),n}else{let n=new bl(e,t);return i.push(n),n}},Es=(i,e)=>{if(i._start===null||e===0||i._searchMarker===null)return null;let t=i._searchMarker.length===0?null:i._searchMarker.reduce((s,o)=>Kn(e-s.index)<Kn(e-o.index)?s:o),n=i._start,r=0;for(t!==null&&(n=t.p,r=t.index,y_(t));n.right!==null&&r<e;){if(!n.deleted&&n.countable){if(e<r+n.length)break;r+=n.length}n=n.right}for(;n.left!==null&&r>e;)n=n.left,!n.deleted&&n.countable&&(r-=n.length);for(;n.left!==null&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(r-=n.length);return t!==null&&Kn(t.index-r)<n.parent.length/kf?(Sf(t,n,r),t):__(i._searchMarker,n,r)},nr=(i,e,t)=>{for(let n=i.length-1;n>=0;n--){let r=i[n];if(t>0){let s=r.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(r.index-=s.length);if(s===null||s.marker===!0){i.splice(n,1);continue}r.p=s,s.marker=!0}(e<r.index||t>0&&e===r.index)&&(r.index=sn(e,r.index+t))}},As=(i,e,t)=>{let n=i,r=e.changedParentTypes;for(;Vt(r,i,()=>[]).push(t),i._item!==null;)i=i._item.parent;_f(n._eH,t,e)},me=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=sf(),this._dEH=sf(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw gt()}clone(){throw gt()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){of(this._eH,e)}observeDeep(e){of(this._dEH,e)}unobserve(e){af(this._eH,e)}unobserveDeep(e){af(this._dEH,e)}toJSON(){}},Cf=(i,e,t)=>{i.doc??Ie(),e<0&&(e=i._length+e),t<0&&(t=i._length+t);let n=t-e,r=[],s=i._start;for(;s!==null&&n>0;){if(s.countable&&!s.deleted){let o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let a=e;a<o.length&&n>0;a++)r.push(o[a]),n--;e=0}}s=s.right}return r},Mf=i=>{i.doc??Ie();let e=[],t=i._start;for(;t!==null;){if(t.countable&&!t.deleted){let n=t.content.getContent();for(let r=0;r<n.length;r++)e.push(n[r])}t=t.right}return e},ir=(i,e)=>{let t=0,n=i._start;for(i.doc??Ie();n!==null;){if(n.countable&&!n.deleted){let r=n.content.getContent();for(let s=0;s<r.length;s++)e(r[s],t++,i)}n=n.right}},Ef=(i,e)=>{let t=[];return ir(i,(n,r)=>{t.push(e(n,r,i))}),t},x_=i=>{let e=i._start,t=null,n=0;return{[Symbol.iterator](){return this},next:()=>{if(t===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};t=e.content.getContent(),n=0,e=e.right}let r=t[n++];return t.length<=n&&(t=null),{done:!1,value:r}}}},Af=(i,e)=>{i.doc??Ie();let t=Es(i,e),n=i._start;for(t!==null&&(n=t.p,e-=t.index);n!==null;
1n=n.right)if(!n.deleted&&n.countable){if(e<n.length)return n.content.getContent()[e];e-=n.length}},Ss=(i,e,t,n)=>{let r=t,s=i.doc,o=s.clientID,a=s.store,l=t===null?e._start:t.right,c=[],h=()=>{c.length>0&&(r=new ae(oe(o,Le(a,o)),r,r&&r.lastId,l,l&&l.id,e,null,new dn(c)),r.integrate(i,0),c=[])};n.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(h(),d.constructor){case Uint8Array:case ArrayBuffer:r=new ae(oe(o,Le(a,o)),r,r&&r.lastId,l,l&&l.id,e,null,new li(new Uint8Array(d))),r.integrate(i,0);break;case Dt:r=new ae(oe(o,Le(a,o)),r,r&&r.lastId,l,l&&l.id,e,null,new hi(d)),r.integrate(i,0);break;default:if(d instanceof me)r=new ae(oe(o,Le(a,o)),r,r&&r.lastId,l,l&&l.id,e,null,new Nt(d)),r.integrate(i,0);else throw new Error("Unexpected content type in insert operation")}}}),h()},Tf=()=>Tn("Length exceeded!"),If=(i,e,t,n)=>{if(t>e._length)throw Tf();if(t===0)return e._searchMarker&&nr(e._searchMarker,t,n.length),Ss(i,e,null,n);let r=t,s=Es(e,t),o=e._start;for(s!==null&&(o=s.p,t-=s.index,t===0&&(o=o.prev,t+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(t<=o.length){t<o.length&&Fe(i,oe(o.id.client,o.id.clock+t));break}t-=o.length}return e._searchMarker&&nr(e._searchMarker,r,n.length),Ss(i,e,o,n)},v_=(i,e,t)=>{let r=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(r)for(;r.right;)r=r.right;return Ss(i,e,r,t)},Df=(i,e,t,n)=>{if(n===0)return;let r=t,s=n,o=Es(e,t),a=e._start;for(o!==null&&(a=o.p,t-=o.index);a!==null&&t>0;a=a.right)!a.deleted&&a.countable&&(t<a.length&&Fe(i,oe(a.id.client,a.id.clock+t)),t-=a.length);for(;n>0&&a!==null;)a.deleted||(n<a.length&&Fe(i,oe(a.id.client,a.id.clock+n)),a.delete(i),n-=a.length),a=a.right;if(n>0)throw Tf();e._searchMarker&&nr(e._searchMarker,r,-s+n)},Cs=(i,e,t)=>{let n=e._map.get(t);n!==void 0&&n.delete(i)},Ml=(i,e,t,n)=>{let r=e._map.get(t)||null,s=i.doc,o=s.clientID,a;if(n==null)a=new dn([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new dn([n]);break;case Uint8Array:a=new li(n);break;case Dt:a=new hi(n);break;default:if(n instanceof me)a=new Nt(n);else throw new Error("Unexpected content type")}new ae(oe(o,Le(s.store,o)),r,r&&r.lastId,null,null,e,t,a).integrate(i,0)},El=(i,e)=>{i.doc??Ie();let t=i._map.get(e);return t!==void 0&&!t.deleted?t.content.getContent()[t.length-1]:void 0},Nf=i=>{let e={};return i.doc??Ie(),i._map.forEach((t,n)=>{t.deleted||(e[n]=t.content.getContent()[t.length-1])}),e},Lf=(i,e)=>{i.doc??Ie();let t=i._map.get(e);return t!==void 0&&!t.deleted},w_=(i,e)=>{let t={};return i._map.forEach((n,r)=>{let s=n;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&ti(s,e)&&(t[r]=s.content.getContent()[s.length-1])}),t},ys=i=>(i.doc??Ie(),Zu(i._map.entries(),e=>!e[1].deleted)),yl=class extends si{},Dn=class extends me{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){let t=new Dn;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Dn}clone(){let e=new Dn;return e.insert(0,this.toArray().map(t=>t instanceof me?t.clone():t)),e}get length(){return this.doc??Ie(),this._length}_callObserver(e,t){super._callObserver(e,t),As(this,e,new yl(this,e))}insert(e,t){this.doc!==null?se(this.doc,n=>{If(n,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){this.doc!==null?se(this.doc,t=>{v_(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc!==null?se(this.doc,n=>{Df(n,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return Af(this,e)}toArray(){return Mf(this)}slice(e=0,t=this.length){return Cf(this,e,t)}toJSON(){return this.map(e=>e instanceof me?e.toJSON():e)}map(e){return Ef(this,e)}forEach(e){ir(this,e)}[Symbol.iterator](){return x_(this)}_write(e){e.writeTypeRef(T_)}},_l=class extends si{constructor(e,t,n){super(e,t),this.keysChanged=n}},oi=class extends me{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((n,r)=>{this.set(r,n)}),this._prelimContent=null}_copy(){return new oi}clone(){let e=new oi;return this.forEach((t,n)=>{e.set(n,t instanceof me?t.clone():t)}),e}_callObserver(e,t){As(this,e,new _l(this,e,t))}toJSON(){this.doc??Ie();let e={};
1return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof me?r.toJSON():r}}),e}get size(){return[...ys(this)].length}keys(){return gs(ys(this),e=>e[0])}values(){return gs(ys(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return gs(ys(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Ie(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?se(this.doc,t=>{Cs(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return this.doc!==null?se(this.doc,n=>{Ml(n,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return El(this,e)}has(e){return Lf(this,e)}clear(){this.doc!==null?se(this.doc,e=>{this.forEach(function(t,n,r){Cs(e,r,n)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(I_)}},ln=(i,e)=>i===e||typeof i=="object"&&typeof e=="object"&&i&&e&&Pa(i,e),rr=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&on(),this.right.content.constructor){case pe:this.right.deleted||di(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},mf=(i,e,t)=>{for(;e.right!==null&&t>0;){switch(e.right.content.constructor){case pe:e.right.deleted||di(e.currentAttributes,e.right.content);break;default:e.right.deleted||(t<e.right.length&&Fe(i,oe(e.right.id.client,e.right.id.clock+t)),e.index+=e.right.length,t-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},_s=(i,e,t,n)=>{let r=new Map,s=n?Es(e,t):null;if(s){let o=new rr(s.p.left,s.p,s.index,r);return mf(i,o,t-s.index)}else{let o=new rr(null,e._start,0,r);return mf(i,o,t)}},Of=(i,e,t,n)=>{for(;t.right!==null&&(t.right.deleted===!0||t.right.content.constructor===pe&&ln(n.get(t.right.content.key),t.right.content.value));)t.right.deleted||n.delete(t.right.content.key),t.forward();let r=i.doc,s=r.clientID;n.forEach((o,a)=>{let l=t.left,c=t.right,h=new ae(oe(s,Le(r.store,s)),l,l&&l.lastId,c,c&&c.id,e,null,new pe(a,o));h.integrate(i,0),t.right=h,t.forward()})},di=(i,e)=>{let{key:t,value:n}=e;n===null?i.delete(t):i.set(t,n)},Rf=(i,e)=>{for(;i.right!==null;){if(!(i.right.deleted||i.right.content.constructor===pe&&ln(e[i.right.content.key]??null,i.right.content.value)))break;i.forward()}},Bf=(i,e,t,n)=>{let r=i.doc,s=r.clientID,o=new Map;for(let a in n){let l=n[a],c=t.currentAttributes.get(a)??null;if(!ln(c,l)){o.set(a,c);let{left:h,right:d}=t;t.right=new ae(oe(s,Le(r.store,s)),h,h&&h.lastId,d,d&&d.id,e,null,new pe(a,l)),t.right.integrate(i,0),t.forward()}}return o},rl=(i,e,t,n,r)=>{t.currentAttributes.forEach((u,f)=>{r[f]===void 0&&(r[f]=null)});let s=i.doc,o=s.clientID;Rf(t,r);let a=Bf(i,e,t,r),l=n.constructor===String?new bt(n):n instanceof me?new Nt(n):new hn(n),{left:c,right:h,index:d}=t;e._searchMarker&&nr(e._searchMarker,t.index,l.getLength()),h=new ae(oe(o,Le(s.store,o)),c,c&&c.lastId,h,h&&h.id,e,null,l),h.integrate(i,0),t.right=h,t.index=d,t.forward(),Of(i,e,t,a)},pf=(i,e,t,n,r)=>{let s=i.doc,o=s.clientID;Rf(t,r);let a=Bf(i,e,t,r);e:for(;t.right!==null&&(n>0||a.size>0&&(t.right.deleted||t.right.content.constructor===pe));){if(!t.right.deleted)switch(t.right.content.constructor){case pe:{let{key:l,value:c}=t.right.content,h=r[l];if(h!==void 0){if(ln(h,c))a.delete(l);else{if(n===0)break e;a.set(l,c)}t.right.delete(i)}else t.currentAttributes.set(l,c);break}default:n<t.right.length&&Fe(i,oe(t.right.id.client,t.right.id.clock+n)),n-=t.right.length;break}t.forward()}if(n>0){let l="";for(;n>0;n--)l+=` 2`;t.right=new ae(oe(o,Le(s.store,o)),t.left,t.left&&t.left.lastId,t.right,t.right&&t.right.id,e,null,new bt(l)),t.right.integrate(i,0),t.forward()}Of(i,e,t,a)},zf=(i,e,t,n,r)=>{let s=e,o=Ce();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===pe){let c=s.content;o.set(c.key,c)}s=s.right}let a=0,l=!1;for(;e!==s;){if(t===e&&(l=!0),!e.deleted){let c=e.content;switch(c.constructor){case pe:{let{key:h,value:d}=c,u=n.get(h)??null;(o.get(h)!==c||u===d)&&(e.delete(i),a++,!l&&(r.get(h)??null)===d&&u!==d&&(u===null?r.delete(h):r.set(h,u))),!l&&!e.deleted&&di(r,c);break}}}e=e.right}return a},k_=(i,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;let t=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===pe){let n=e.content.key;t.has(n)?e.delete(i):t.add(n)}e=e.left}},S_=i=>{let e=0;return se(i.doc,t=>{let n=i._start,r=i._start,s=Ce(),o=ms(s);for(;r;){if(r.deleted===!1)switch(r.content.constructor){case pe:di(o,r.content);break;default:e+=zf(t,n,r,s,o),s=ms(o),n=r;break}r=r.right}}),e},C_=i=>{let e=new Set,t=i.doc;for(let[n,r]of i.afterState.entries()){let s=i.beforeState.get(n)||0;r!==s&&vf(i,t.store.clients.get(n),s,r,o=>{!o.deleted&&o.content.constructor===pe&&o.constructor!==It&&e.add(o.parent)})}se(t,n=>{ri(i,i.deleteSet,r=>{if(r instanceof It||!r.parent._hasFormatting||e.has(r.parent))return;let s=r.parent;r.content.constructor===pe?e.add(s):k_(n,r)});for(let r of e)S_(r)})},gf=(i,e,t)=>{let n=t,r=ms(e.currentAttributes),s=e.right;for(;t>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Nt:case hn:case bt:t<e.right.length&&Fe(i,oe(e.right.id.client,e.right.id.clock+t)),t-=e.right.length,e.right.delete(i);break}e.forward()}s&&zf(i,s,e.right,r,e.currentAttributes);let o=(e.left||e.right).parent;return o._searchMarker&&nr(o._searchMarker,e.index,-n+t),e},xl=class extends si{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEac
2h(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){let e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];se(e,n=>{let r=new Map,s=new Map,o=this.target._start,a=null,l={},c="",h=0,d=0,u=()=>{if(a!==null){let f=null;switch(a){case"delete":d>0&&(f={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(f={insert:c},r.size>0&&(f.attributes={},r.forEach((p,m)=>{p!==null&&(f.attributes[m]=p)}))),c="";break;case"retain":h>0&&(f={retain:h},Eu(l)||(f.attributes=Su({},l))),h=0;break}f&&t.push(f),a=null}};for(;o!==null;){switch(o.content.constructor){case Nt:case hn:this.adds(o)?this.deletes(o)||(u(),a="insert",c=o.content.getContent()[0],u()):this.deletes(o)?(a!=="delete"&&(u(),a="delete"),d+=1):o.deleted||(a!=="retain"&&(u(),a="retain"),h+=1);break;case bt:this.adds(o)?this.deletes(o)||(a!=="insert"&&(u(),a="insert"),c+=o.content.str):this.deletes(o)?(a!=="delete"&&(u(),a="delete"),d+=o.length):o.deleted||(a!=="retain"&&(u(),a="retain"),h+=o.length);break;case pe:{let{key:f,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){let m=r.get(f)??null;ln(m,p)?p!==null&&o.delete(n):(a==="retain"&&u(),ln(p,s.get(f)??null)?delete l[f]:l[f]=p)}}else if(this.deletes(o)){s.set(f,p);let m=r.get(f)??null;ln(m,p)||(a==="retain"&&u(),l[f]=m)}else if(!o.deleted){s.set(f,p);let m=l[f];m!==void 0&&(ln(m,p)?m!==null&&o.delete(n):(a==="retain"&&u(),p===null?delete l[f]:l[f]=p))}o.deleted||(a==="insert"&&u(),di(r,o.content));break}}o=o.right}for(u();t.length>0;){let f=t[t.length-1];if(f.retain!==void 0&&f.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},ai=class extends me{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Ie(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(n=>n())}catch(n){console.error(n)}this._pending=null}_copy(){return new ai}clone(){let e=new ai;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);let n=new xl(this,e,t);As(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Ie();let e="",t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===bt&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc!==null?se(this.doc,n=>{let r=new rr(null,this._start,0,new Map);for(let s=0;s<e.length;s++){let o=e[s];if(o.insert!==void 0){let a=!t&&typeof o.insert=="string"&&s===e.length-1&&r.right===null&&o.insert.slice(-1)===` 3`?o.insert.slice(0,-1):o.insert;(typeof a!="string"||a.length>0)&&rl(n,this,r,a,o.attributes||{})}else o.retain!==void 0?pf(n,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&gf(n,r,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,n){this.doc??Ie();let r=[],s=new Map,o=this.doc,a="",l=this._start;function c(){if(a.length>0){let d={},u=!1;s.forEach((p,m)=>{u=!0,d[m]=p});let f={insert:a};u&&(f.attributes=d),r.push(f),a=""}}let h=()=>{for(;l!==null;){if(ti(l,e)||t!==void 0&&ti(l,t))switch(l.content.constructor){case bt:{let d=s.get("ychange");e!==void 0&&!ti(l,e)?(d===void 0||d.user!==l.id.client||d.type!=="removed")&&(c(),s.set("ychange",n?n("removed",l.id):{type:"removed"})):t!==void 0&&!ti(l,t)?(d===void 0||d.user!==l.id.client||d.type!=="added")&&(c(),s.set("ychange",n?n("added",l.id):{type:"added"})):d!==void 0&&(c(),s.delete("ychange")),a+=l.content.str;break}case Nt:case hn:{c();let d={insert:l.content.getContent()[0]};if(s.size>0){let u={};d.attributes=u,s.forEach((f,p)=>{u[p]=f})}r.push(d);break}case pe:ti(l,e)&&(c(),di(s,l.content));break}l=l.right}c()};return e||t?se(o,d=>{e&&ul(d,e),t&&ul(d,t),h()},"cleanup"):h(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r!==null?se(r,s=>{let o=_s(s,this,e,!n);n||(n={},o.currentAttributes.forEach((a,l)=>{n[l]=a})),rl(s,this,o,t,n)}):this._pending.push(()=>this.insert(e,t,n))}insertEmbed(e,t,n){let r=this.doc;r!==null?se(r,s=>{let o=_s(s,this,e,!n);rl(s,this,o,t,n||{})}
3):this._pending.push(()=>this.insertEmbed(e,t,n||{}))}delete(e,t){if(t===0)return;let n=this.doc;n!==null?se(n,r=>{gf(r,_s(r,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,n){if(t===0)return;let r=this.doc;r!==null?se(r,s=>{let o=_s(s,this,e,!1);o.right!==null&&pf(s,this,o,t,n)}):this._pending.push(()=>this.format(e,t,n))}removeAttribute(e){this.doc!==null?se(this.doc,t=>{Cs(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){this.doc!==null?se(this.doc,n=>{Ml(n,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return El(this,e)}getAttributes(){return Nf(this)}_write(e){e.writeTypeRef(D_)}},tr=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Ie()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===Nn||t.constructor===cn)&&t._start!==null)e=t._start;else for(;e!==null;){let n=e.next;if(n!==null){e=n;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},cn=class extends me{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new cn}clone(){let e=new cn;return e.insert(0,this.toArray().map(t=>t instanceof me?t.clone():t)),e}get length(){return this.doc??Ie(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new tr(this,e)}querySelector(e){e=e.toUpperCase();let n=new tr(this,r=>r.nodeName&&r.nodeName.toUpperCase()===e).next();return n.done?null:n.value}querySelectorAll(e){return e=e.toUpperCase(),qt(new tr(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){As(this,e,new vl(this,t,e))}toString(){return Ef(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),ir(this,s=>{r.insertBefore(s.toDOM(e,t,n),null)}),r}insert(e,t){this.doc!==null?se(this.doc,n=>{If(n,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(this.doc!==null)se(this.doc,n=>{let r=e&&e instanceof me?e._item:e;Ss(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(s=>s===e)+1;if(r===0&&e!==null)throw Tn("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){this.doc!==null?se(this.doc,n=>{Df(n,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return Mf(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Af(this,e)}slice(e=0,t=this.length){return Cf(this,e,t)}forEach(e){ir(this,e)}_write(e){e.writeTypeRef(L_)}},Nn=class extends cn{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((n,r)=>{this.setAttribute(r,n)}),this._prelimAttrs=null}_copy(){return new Nn(this.nodeName)}clone(){let e=new Nn(this.nodeName),t=this.getAttributes();return Mu(t,(n,r)=>{typeof n=="string"&&e.setAttribute(r,n)}),e.insert(0,this.toArray().map(n=>n instanceof me?n.clone():n)),e}toString(){let e=this.getAttributes(),t=[],n=[];for(let a in e)n.push(a);n.sort();let r=n.length;for(let a=0;a<r;a++){let l=n[a];t.push(l+'="'+e[l]+'"')}let s=this.nodeName.toLocaleLowerCase(),o=t.length>0?" "+t.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?se(this.doc,t=>{Cs(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){this.doc!==null?se(this.doc,n=>{Ml(n,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return El(this,e)}hasAttribute(e){return Lf(this,e)}getAttributes(e){return e?w_(this,e):Nf(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),s=this.getAttributes();for(let o in s){let a=s[o];
3typeof a=="string"&&r.setAttribute(o,a)}return ir(this,o=>{r.appendChild(o.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(N_),e.writeKey(this.nodeName)}},vl=class extends si{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}},Ms=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw gt()}mergeWith(e){return!1}write(e,t,n){throw gt()}integrate(e,t){throw gt()}},M_=0,It=class extends Ms{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),xf(e.doc.store,this)}write(e,t){e.writeInfo(M_),e.writeLen(this.length-t)}getMissing(e,t){return null}},li=class{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new li(this.content)}splice(e){throw gt()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},ci=class{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new ci(this.len)}splice(e){let t=new ci(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){kl(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},E_=(i,e)=>new Dt({guid:i,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1}),hi=class{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new hi(E_(this.doc.guid,this.opts))}splice(e){throw gt()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},hn=class{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new hn(this.embed)}splice(e){throw gt()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},pe=class{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new pe(this.key,this.value)}splice(e){throw gt()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},A_=Xi("node_env")==="development",dn=class{constructor(e){this.arr=e,A_&&Ua(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new dn(this.arr)}splice(e){let t=new dn(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let s=this.arr[r];e.writeAny(s)}}getRef(){return 8}},bt=class{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new bt(this.str)}splice(e){let t=new bt(this.str.slice(e));this.str=this.str.slice(0,e);let n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"\uFFFD",t.str="\uFFFD"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},T_=0,I_=1,D_=2,N_=3,L_=4,Nt=class{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}
3copy(){return new Nt(this.type._copy())}splice(e){throw gt()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(n=>{n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(n=>{for(;n!==null;)n.gc(e,!0),n=n.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},O_=(i,e)=>{let t=e,n=0,r;do n>0&&(t=oe(t.client,t.clock+n)),r=xs(i,t),n=t.clock-r.id.clock,t=r.redone;while(t!==null&&r instanceof ae);return{item:r,diff:n}},Al=(i,e)=>{for(;i!==null&&i.keep!==e;)i.keep=e,i=i.parent._item},jf=(i,e,t)=>{let{client:n,clock:r}=e.id,s=new ae(oe(n,r+t),e,oe(n,r+t-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=oe(e.redone.client,e.redone.clock+t)),e.right=s,s.right!==null&&(s.right.left=s),i._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=t,s},bf=(i,e)=>fu(i,t=>sr(t.deletions,e)),Pf=(i,e,t,n,r,s)=>{let o=i.doc,a=o.store,l=o.clientID,c=e.redone;if(c!==null)return Fe(i,c);let h=e.parent._item,d=null,u;if(h!==null&&h.deleted===!0){if(h.redone===null&&(!t.has(h)||Pf(i,h,t,n,r,s)===null))return null;for(;h.redone!==null;)h=Fe(i,h.redone)}let f=h===null?e.parent:h.content.type;if(e.parentSub===null){for(d=e.left,u=e;d!==null;){let b=d;for(;b!==null&&b.parent._item!==h;)b=b.redone===null?null:Fe(i,b.redone);if(b!==null&&b.parent._item===h){d=b;break}d=d.left}for(;u!==null;){let b=u;for(;b!==null&&b.parent._item!==h;)b=b.redone===null?null:Fe(i,b.redone);if(b!==null&&b.parent._item===h){u=b;break}u=u.right}}else if(u=null,e.right&&!r){for(d=e;d!==null&&d.right!==null&&(d.right.redone||sr(n,d.right.id)||bf(s.undoStack,d.right.id)||bf(s.redoStack,d.right.id));)for(d=d.right;d.redone;)d=Fe(i,d.redone);if(d&&d.right!==null)return null}else d=f._map.get(e.parentSub)||null;let p=Le(a,l),m=oe(l,p),g=new ae(m,d,d&&d.lastId,u,u&&u.id,f,e.parentSub,e.content.copy());return e.redone=m,Al(g,!0),g.integrate(i,0),g},ae=class extends Ms{constructor(e,t,n,r,s,o,a,l){super(e,l.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=s,this.parent=o,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Le(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Le(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===ni&&this.id.client!==this.parent.client&&this.parent.clock>=Le(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=lf(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Fe(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===It||this.right&&this.right.constructor===It)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===ae?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===ae&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===ni){let n=xs(t,this.parent);n.constructor===It?this.parent=null:this.parent=n.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=lf(e,e.doc.store,oe(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let n=this.left,r;if(n!==null)r=n.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;let s=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),s.add(r),bs(this.origin,r.origin)){if(r.id.client<this.id.client)n=r,s.clear();else if(bs(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(xs(e.doc.store,r.origin)))s.has(xs(e.doc.store,r.origin))||(n=r,s.clear());else break;r=r.right}this.left=n}if(this.left!==null){let n=this.left.right;this.right=n,this.left.right=this}else{let n;if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start,this.parent._start=this;this.right=n}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),xf(e.doc.store,this),this.content.integrate(e,this),hf(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new It(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:oe(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&bs(e.origin,this.lastId)&&this.right===e&&bs(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(n=>
3{n.p===e&&(n.p=this,!this.deleted&&this.countable&&(n.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),kl(e.deleteSet,this.id.client,this.id.clock,this.length),hf(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw on();this.content.gc(e),t?m_(e,this,new It(this.id,this.length)):this.content=new ci(this.length)}write(e,t){let n=t>0?oe(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(s===null?0:32);if(e.writeInfo(o),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let a=this.parent;if(a._item!==void 0){let l=a._item;if(l===null){let c=d_(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===ni?(e.writeParentInfo(!1),e.writeLeftID(a)):on();s!==null&&e.writeString(s)}this.content.write(e,t)}},Uf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:{},Ff="__ $YJS$ __";Uf[Ff]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Uf[Ff]=!0});var Tl,or,B_,Il=E(()=>{fs();$i();Ba();Ki();Tl=3e4,or=class extends ps{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let t=an();this.getLocalState()!==null&&Tl/2<=t-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let n=[];this.meta.forEach((r,s)=>{s!==this.clientID&&Tl<=t-r.lastUpdated&&this.states.has(s)&&n.push(s)}),n.length>0&&B_(this,n,"timeout")},lt(Tl/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let t=this.clientID,n=this.meta.get(t),r=n===void 0?0:n.clock+1,s=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:an()});let o=[],a=[],l=[],c=[];e===null?c.push(t):s==null?e!=null&&o.push(t):(a.push(t),Gi(s,e)||l.push(t)),(o.length>0||l.length>0||c.length>0)&&this.emit("change",[{added:o,updated:l,removed:c},"local"]),this.emit("update",[{added:o,updated:a,removed:c},"local"])}setLocalStateField(e,t){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},B_=(i,e,t)=>{let n=[];for(let r=0;r<e.length;r++){let s=e[r];if(i.states.has(s)){if(i.states.delete(s),s===i.clientID){let o=i.meta.get(s);i.meta.set(s,{clock:o.clock+1,lastUpdated:an()})}n.push(s)}}n.length>0&&(i.emit("change",[{added:[],updated:[],removed:n},t]),i.emit("update",[{added:[],updated:[],removed:n},t]))}});var Ts,ar,Is=E(()=>{Ts=ne(ut(),1);tn();Il();$f();ar=class{constructor(e){var t;this.onStateChanged=n=>{let r=new Array;n.keysChanged.forEach(s=>{let o=n.changes.keys.get(s);o&&r.push({name:s,oldValue:o.oldValue,newValue:this.ystate.get(s)})}),this._changed.emit({stateChange:r})},this._changed=new G(this),this._isDisposed=!1,this._disposed=new G(this),this._ydoc=(t=e?.ydoc)!==null&&t!==void 0?t:new Dt,this._ystate=this._ydoc.getMap("state"),this._undoManager=new ks([],{trackedOrigins:new Set([this]),doc:this._ydoc}),this._awareness=new or(this._ydoc),this._ystate.observe(this.onStateChanged)}get ydoc(){return this._ydoc}get ystate(){return this._ystate}get undoManager(){return this._undoManager}get awareness(){return this._awareness}get changed(){return this._changed}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}get state(){return Ts.JSONExt.deepCopy(this.ystate.toJSON())}canUndo(){return this.undoManager.undoStack.length>0}canRedo(){return this.undoManager.redoStack.length>0}dispose(){this._isDisposed||(this._isDisposed=!0,this.ystate.unobserve(this.onStateChanged),this.awareness.destroy(),this.undoManager.destroy(),this.ydoc.destroy(),this._disposed.emit
3(),G.clearData(this))}getState(e){let t=this.ystate.get(e);return typeof t>"u"?t:Ts.JSONExt.deepCopy(t)}setState(e,t){Ts.JSONExt.deepEqual(this.ystate.get(e),t)||this.ystate.set(e,t)}get source(){return this.getSource()}set source(e){this.setSource(e)}undo(){this.undoManager.undo()}redo(){this.undoManager.redo()}clearUndoHistory(){this.undoManager.clear()}transact(e,t=!0,n=null){this.ydoc.transact(e,t?this:n)}}});var ui,Hf=E(()=>{Is();ui=class extends ar{constructor(){super(),this.version="1.0.0",this.ysource=this.ydoc.getText("source"),this._modelObserver=e=>{this._changed.emit({sourceChange:e.changes.delta})},this.undoManager.addToScope(this.ysource),this.ysource.observe(this._modelObserver)}static create(){return new ui}get source(){return this.getSource()}set source(e){this.setSource(e)}dispose(){this.isDisposed||(this.ysource.unobserve(this._modelObserver),super.dispose())}getSource(){return this.ysource.toString()}setSource(e){this.transact(()=>{let t=this.ysource;t.delete(0,t.length),t.insert(0,e)})}updateSource(e,t,n=""){this.transact(()=>{let r=this.ysource;r.insert(e,n),r.delete(e+n.length,t-e)})}}});var qf,Dl=E(()=>{qf=ne(ut(),1);tn();Il()});var z_,Vf=E(()=>{z_=ne(ut(),1);tn();Is();Dl()});var Wf=E(()=>{su();ou();au();lu();Is();Hf();Vf();Dl()});var Ln,Nl=E(()=>{(function(i){i.defaultMimeType="text/plain"})(Ln||(Ln={}))});var Gf,Jf=E(()=>{Wf();r0();tn();Nl();(function(i){class e{constructor(n={}){var r,s;this.standaloneModel=!1,this._isDisposed=!1,this._selections=new Ph,this._mimeType=Ln.defaultMimeType,this._mimeTypeChanged=new G(this),this.standaloneModel=typeof n.sharedModel>"u",this.sharedModel=(r=n.sharedModel)!==null&&r!==void 0?r:new ui,this._mimeType=(s=n.mimeType)!==null&&s!==void 0?s:Ln.defaultMimeType}get mimeTypeChanged(){return this._mimeTypeChanged}get selections(){return this._selections}get mimeType(){return this._mimeType}set mimeType(n){let r=this.mimeType;r!==n&&(this._mimeType=n,this._mimeTypeChanged.emit({name:"mimeType",oldValue:r,newValue:n}))}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed||(this._isDisposed=!0,this._selections.dispose(),this.standaloneModel&&this.sharedModel.dispose(),G.clearData(this))}}i.Model=e})(Gf||(Gf={}))});var Kf=E(()=>{});var fi,Gt,Yf=E(()=>{fi=class{constructor(){this._first=null,this._last=null,this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:void 0}get last(){return this._last?this._last.value:void 0}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;for(;e;)yield e.value,e=e.next}*retro(){let e=this._last;for(;e;)yield e.value,e=e.prev}*nodes(){let e=this._first;for(;e;)yield e,e=e.next}*retroNodes(){let e=this._last;for(;e;)yield e,e=e.prev}assign(e){this.clear();for(let t of e)this.addLast(t)}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new Gt.LinkedListNode(this,e);return this._first?(t.next=this._first,this._first.prev=t,this._first=t):(this._first=t,this._last=t),this._size++,t}addLast(e){let t=new Gt.LinkedListNode(this,e);return this._last?(t.prev=this._last,this._last.next=t,this._last=t):(this._first=t,this._last=t),this._size++,t}insertBefore(e,t){if(!t||t===this._first)return this.addFirst(e);if(!(t instanceof Gt.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new Gt.LinkedListNode(this,e),r=t,s=r.prev;return n.next=r,n.prev=s,r.prev=n,s.next=n,this._size++,n}insertAfter(e,t){if(!t||t===this._last)return this.addLast(e);if(!(t instanceof Gt.LinkedListNode)||t.list!==this)throw new Error("Reference node is not owned by the list.");let n=new Gt.LinkedListNode(this,e),r=t,s=r.next;return n.next=s,n.prev=r,r.next=n,s.prev=n,this._size++,n}removeFirst(){let e=this._first;if(e)return e===this._last?(this._first=null,this._last=null):(this._first=e.next,this._first.prev=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeLast(){let e=this._last;if(e)return e===this._first?(this._first=null,this._last=null):(this._last=e.prev,this._last.next=null),e.list=null,e.next=null,e.prev=null,this._size--,e.value}removeNode(e){if(!(e instanceof Gt.LinkedListNode)||e.list!==this)throw new Error("Node is not owned by the list.");let t=e;t===this._first&&t===this._last?(this._first=null,this._last=null):t===this._first?(this._first=t.next,this._first.prev=null):t===this._last?(this._last=t.prev,this._last.next=null):(t.next.prev=t.prev,t.prev.next=t.next),t.list=null,t.next=null,t.prev=null,this._size--}clear(){let e=this._first;for(;e;){let t=e.next;e.list=null,e.prev=null,e.next=null,e=t}this._first=null,this._last=null,this._size=0}};(function(i){function e(t){let n=new i;return n.assign(t),n}i.from=e})(fi||(fi={}));(function(i){class e{constructor(n,r){this.list=null,this.next=null,this.prev=null,this.list=n,this.value=r}}i.LinkedListNode=e})(Gt||(Gt={}))});var Oe,un,A,Xf=E(()=>{Ih();Yf();Oe=class{constructor(e){this.type=e}get isConflatable(){return!1}conflate(e){return!1}},un=class extends Oe{get isConflatable(){return!0}conflate(e){return!0}};(function(i){let e=null,t=(S=>I=>{let L=!1;return S.then(()=>!L&&I()),()=>{L=!0}})(Promise.resolve());function n(S,I){let L=u.get(S);if(!L||L.length===0){b(S,I);return}Eh(Th(L),N=>N?g(N,S,I):!0)&&b(S,I)}i.sendMessage=n;function r(S,I){if(!I.isConflatable){y(S,I);return}Ah(d,P=>P.handler!==S||!P.msg||P.msg.type!==I.type||!P.msg.isConflatable?!1:P.msg.conflate(I))||y(S,I)}i.postMessage=r;function s(S,I){let L=u.get(S);L&&L.indexOf(I)!==-1||(L?L.push(I):u.set(S,[I]))}i.installMessageHook=s;function o(S,I){let L=u.get(S);if(!L)return;let P=L.indexOf(I);P!==-1&&(L[P]=null,v(L))}i.removeMessageHook=o;function a(S){let I=u.get(S);I&&I.length>0&&(D.fill(I,null),v(I));for(let L of d)L.handler===S&&(L.handler=null,L.msg=null)}i.clearData=a;function l(){m||e===null||(e(),e=null,m=!0,_(),m=!1)}i.flush=l;function c(){return p}i.getExceptionHandler=c;function h(S){let I=p;return p=S,I}i.setExceptionHandler=h;let d=new fi,u=new WeakMap,f=new Set,p=S=>{console.error(S)},m=!1;function g(S,I,L){let P=!0;try{typeof S=="function"?P=S(I,L):P=S.messageHook(I,L)}catch(N){p(N)}return P}function b(S,I){try{S.processMessage(I)}catch(L){p(L)}}function y(S,I){d.addLast({handler:S,msg:I}),e===null&&(e=t(_))}function _(){if(e=null,d.isEmpty)return;let S={handler:null,msg:null};for(d.addLast(S);;){let I=d.removeFirst();if(I===S)return;I.handler&&I.msg&&n(I.handler,I.msg)}}function v(S){f.size===0&&t(w),f.add(S)}function w(){f.forEach(M),f.clear()}function M(S){D.removeAllWhere(S,C)}function C(S){return S===null}})(A||(A={}))});var ge,De,Qf=E(()=>{Dh();ge=class{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget)return;let{element:t,edge:n,distance:r}=this._scrollTarget,s=De.SCROLL_EDGE_SIZE-r,o=Math.pow(s/De.SCROLL_EDGE_SIZE,2),a=Math.max(1,Math.round(o*De.SCROLL_EDGE_SIZE));switch(n){case"top":t.scrollTop-=a;break;case"left":t.scrollLeft-=a;break;case"right":t.scrollLeft+=a;break;case"bottom":t.scrollTop+=a;break}requestAnimationFrame(this._onScrollFrame)},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=e.document||document,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}dispose(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,clientX:-1,clientY:-1});De.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}}get isDisposed(){return this._disposed}start(e,t){if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise(r=>{this._resolve=r});let n=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:e,clientY:t});return document.dispatchEvent(n),this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation();break}}moveDragImage(e,t){if(!this.dragImage)return;let n=this.dragImage.style;n.transform=`translate(${e}px, ${t}px)`}_evtPointerMove(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){if(e.preventDefault(),e.stopPropagation(),e.button!==0)return;if(this._updateCurrentTarget(e),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){De.dispatchDragLeave(this,this._currentTarget,null,e),this._finalize("none");return}
3let t=De.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&this.dispose()}_addListeners(){document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)}_removeListeners(){document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)}_updateDragScroll(e){let t=De.findScrollTarget(e);!this._scrollTarget&&!t||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)}_updateCurrentTarget(e){let t=this._currentTarget,n=this._currentTarget,r=this._currentElement,s=De.findElementBehindBackdrop(e,this.document);this._currentElement=s,s!==r&&s!==n&&De.dispatchDragExit(this,n,s,e),s!==r&&s!==n&&(n=De.dispatchDragEnter(this,s,n,e)),n!==t&&(this._currentTarget=n,De.dispatchDragLeave(this,t,n,e));let o=De.dispatchDragOver(this,n,e);this._setDropAction(o)}_attachDragImage(e,t){if(!this.dragImage)return;this.dragImage.classList.add("lm-mod-drag-image");let n=this.dragImage.style;n.pointerEvents="none",n.position="fixed",n.transform=`translate(${e}px, ${t}px)`,(this.document instanceof Document?this.document.body:this.document.firstElementChild).appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage)return;let e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}_setDropAction(e){if(e=De.validateAction(e,this.supportedActions),!(this._override&&this._dropAction===e))switch(e){case"none":this._dropAction=e,this._override=ge.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e,this._override=ge.overrideCursor("copy",this.document);break;case"link":this._dropAction=e,this._override=ge.overrideCursor("alias",this.document);break;case"move":this._dropAction=e,this._override=ge.overrideCursor("move",this.document);break}}_finalize(e){let t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)}};(function(i){class e extends DragEvent{constructor(r,s){super(s.type,{bubbles:!0,cancelable:!0,altKey:r.altKey,button:r.button,clientX:r.clientX,clientY:r.clientY,ctrlKey:r.ctrlKey,detail:0,metaKey:r.metaKey,relatedTarget:s.related,screenX:r.screenX,screenY:r.screenY,shiftKey:r.shiftKey,view:window});let{drag:o}=s;this.dropAction="none",this.mimeData=o.mimeData,this.proposedAction=o.proposedAction,this.supportedActions=o.supportedActions,this.source=o.source}}i.Event=e;function t(n,r=document){return De.overrideCursor(n,r)}i.overrideCursor=t})(ge||(ge={}));(function(i){i.SCROLL_EDGE_SIZE=20;function e(v,w){return d[v]&u[w]?v:"none"}i.validateAction=e;function t(v,w=document){if(v){if(n&&v==n.event)return n.element;i.cursorBackdrop.style.zIndex="-1000";let M=w.elementFromPoint(v.clientX,v.clientY);return i.cursorBackdrop.style.zIndex="",n={event:v,element:M},M}else{let M=i.cursorBackdrop.style.transform;if(r&&M===r.transform)return r.element;let C=i.cursorBackdrop.getBoundingClientRect();i.cursorBackdrop.style.zIndex="-1000";let S=w.elementFromPoint(C.left+C.width/2,C.top+C.height/2);return i.cursorBackdrop.style.zIndex="",r={transform:M,element:S},S}}i.findElementBehindBackdrop=t;let n=null,r=null;function s(v){let w=v.clientX,M=v.clientY,C=t(v);for(;C;C=C.parentElement){if(!C.hasAttribute("data-lm-dragscroll"))continue;let S=0,I=0;C===document.body&&(S=window.pageXOffset,I=window.pageYOffset);let L=C.getBoundingClientRect(),P=L.top+I,N=L.left+S,V=N+L.width,te=P+L.height;if(w<N||w>=V||M<P||M>=te)continue;let Q=w-N+1,fe=M-P+1,ce=V-w,Ae=te-M,ve=Math.min(Q,fe,ce,Ae);if(ve>i.SCROLL_EDGE_SIZE)continue;let Ve;switch(ve){case Ae:Ve="bottom";break;case fe:Ve="top";break;
3case ce:Ve="right";break;case Q:Ve="left";break;default:throw"unreachable"}let T=C.scrollWidth-C.clientWidth,k=C.scrollHeight-C.clientHeight,O;switch(Ve){case"top":O=k>0&&C.scrollTop>0;break;case"left":O=T>0&&C.scrollLeft>0;break;case"right":O=T>0&&C.scrollLeft<T;break;case"bottom":O=k>0&&C.scrollTop<k;break;default:throw"unreachable"}if(O)return{element:C,edge:Ve,distance:ve}}return null}i.findScrollTarget=s;function o(v,w,M,C){if(!w)return null;let S=new ge.Event(C,{drag:v,related:M,type:"lm-dragenter"});if(!w.dispatchEvent(S))return w;let L=v.document instanceof Document?v.document.body:v.document.firstElementChild;return w===L?M:(S=new ge.Event(C,{drag:v,related:M,type:"lm-dragenter"}),L.dispatchEvent(S),L)}i.dispatchDragEnter=o;function a(v,w,M,C){if(!w)return;let S=new ge.Event(C,{drag:v,related:M,type:"lm-dragexit"});w.dispatchEvent(S)}i.dispatchDragExit=a;function l(v,w,M,C){if(!w)return;let S=new ge.Event(C,{drag:v,related:M,type:"lm-dragleave"});w.dispatchEvent(S)}i.dispatchDragLeave=l;function c(v,w,M){if(!w)return"none";let C=new ge.Event(M,{drag:v,related:null,type:"lm-dragover"});return w.dispatchEvent(C)?"none":C.dropAction}i.dispatchDragOver=c;function h(v,w,M){if(!w)return"none";let C=new ge.Event(M,{drag:v,related:null,type:"lm-drop"});return w.dispatchEvent(C)?"none":C.dropAction}i.dispatchDrop=h;let d={none:0,copy:1,link:2,move:4},u={none:d.none,copy:d.copy,link:d.link,move:d.move,"copy-link":d.copy|d.link,"copy-move":d.copy|d.move,"link-move":d.link|d.move,all:d.copy|d.link|d.move};function f(v,w=document){let M=++_,C=w instanceof Document?w.body:w.firstElementChild;return i.cursorBackdrop.isConnected||(i.cursorBackdrop.style.transform="scale(0)",C.appendChild(i.cursorBackdrop),g(),document.addEventListener("pointermove",p,{capture:!0,passive:!0}),i.cursorBackdrop.addEventListener("scroll",m,{capture:!0,passive:!0})),i.cursorBackdrop.style.cursor=v,new aa(()=>{M===_&&i.cursorBackdrop.isConnected&&(document.removeEventListener("pointermove",p,!0),i.cursorBackdrop.removeEventListener("scroll",m,!0),C.removeChild(i.cursorBackdrop))})}i.overrideCursor=f;function p(v){i.cursorBackdrop&&(i.cursorBackdrop.style.transform=`translate(${v.clientX}px, ${v.clientY}px)`)}function m(v){if(!i.cursorBackdrop)return;let w=t();if(!w)return;let M=w.closest("[data-lm-dragscroll]");M&&(M.scrollTop+=i.cursorBackdrop.scrollTop-b,M.scrollLeft+=i.cursorBackdrop.scrollLeft-b,g())}function g(){i.cursorBackdrop.scrollTop=b,i.cursorBackdrop.scrollLeft=b}let b=500;function y(){let v=document.createElement("div");return v.classList.add("lm-cursor-backdrop"),v}let _=0;i.cursorBackdrop=y()})(De||(De={}))});var Xt,Lt,Je,lr,x,Ds,Rt,Rn,mi,pi,cr,hr,yt,Kt,Ll,Ns,Ls,Ol,Bn,Rl,dr,Bl,Ke,On,Os,zl,gi,Jt,Ot,Re,Zf,j_,fn,ct,jl,ue,zn,he,Yt,ye,bi,Rs,em,tm,Bs,nm,im,zs=E(()=>{Ih();Xt=ne(ut());e0();Xf();Zb();tn();Qf();n0();i0();Dh();t0();Lt=class{constructor(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}};(function(i){function e(s,o){let a=s.length;if(a===0)return o;let l=0,c=0,h=0,d=0,u=0;for(let m=0;m<a;++m){let g=s[m],b=g.minSize,y=g.maxSize,_=g.sizeHint;g.done=!1,g.size=Math.max(b,Math.min(_,y)),h+=g.size,l+=b,c+=y,g.stretch>0&&(d+=g.stretch,u++)}if(o===h)return 0;if(o<=l){for(let m=0;m<a;++m){let g=s[m];g.size=g.minSize}return o-l}if(o>=c){for(let m=0;m<a;++m){let g=s[m];g.size=g.maxSize}return o-c}let f=.01,p=a;if(o<h){let m=h-o;for(;u>0&&m>f;){let g=m,b=d;for(let y=0;y<a;++y){let _=s[y];if(_.done||_.stretch===0)continue;let v=_.stretch*g/b;_.size-v<=_.minSize?(m-=_.size-_.minSize,d-=_.stretch,_.size=_.minSize,_.done=!0,p--,u--):(m-=v,_.size-=v)}}for(;p>0&&m>f;){let g=m/p;for(let b=0;b<a;++b){let y=s[b];y.done||(y.size-g<=y.minSize?(m-=y.size-y.minSize,y.size=y.minSize,y.done=!0,p--):(m-=g,y.size-=g))}}}else{let m=o-h;for(;u>0&&m>f;){let g=m,b=d;for(let y=0;y<a;++y){let _=s[y];if(_.done||_.stretch===0)continue;let v=_.stretch*g/b;_.size+v>=_.maxSize?(m-=_.maxSize-_.size,d-=_.stretch,_.size=_.maxSize,_.done=!0,p--,u--):(m-=v,_.size+=v)}}for(;p>0&&m>f;){let g=m/p;for(let b=0;b<a;++b){let y=s[b];y.done||(y.size+g>=y.maxSize?(m-=y.maxSize-y.size,y.size=y.maxSize,y.done=!0,p--):(m-=g,y.size+=g))}}}return 0}i.calc=e;function t(s,o,a){s.length===0||a===0||(a>0?n(s,o,a):r(s,o,-a))}i.adjust=t;function n(s,o,a){let l=0;for(let u=0;u<=o;++u){let f=s[u];l+=f.maxSize-f.size}let c=0;for(let u=o+1,f=s.length;u<f;++u){let p=s[u];c+=p.size-p.minSize}a=Math.min(a,l,c);let h=a;for(let u=o;u>=0&&h>0;--u){let f=s[u],p=f.maxSize-f.size;p>=h?(f.sizeHint=f.size+h,h=0):(f.sizeHint=f.size+p,h-=p)}let d=a;for(let u=o+1,f=s.length;u<f&&d>0;++u){let p=s[u],m=p.size-p.minSize;m>=d?(p.sizeHint=p.size-d,d=0):(p.sizeHint=p.size-m,d-=m)}}function r(s,o,a){let l=0;for(let u=o+1,f=s.length;u<f;++u){let p=s[u];l+=p.maxSize-p.size}let c=0;for(let u=0;u<=o;++u){let f=s[u];c+=f.size-f.minSize}a=Math.min(a,l,c);let h=a;for(let u=o+1,f=s.length;u<f&&h>0;++u){let p=s[u],m=p.maxSize-p.size;m>
3=h?(p.sizeHint=p.size+h,h=0):(p.sizeHint=p.size+m,h-=m)}let d=a;for(let u=o;u>=0&&d>0;--u){let f=s[u],p=f.size-f.minSize;p>=d?(f.sizeHint=f.size-d,d=0):(f.sizeHint=f.size-p,d-=p)}}})(Je||(Je={}));lr=class{constructor(e){this._label="",this._caption="",this._mnemonic=-1,this._icon=void 0,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new G(this),this._isDisposed=!1,this.owner=e.owner,e.label!==void 0&&(this._label=e.label),e.mnemonic!==void 0&&(this._mnemonic=e.mnemonic),e.icon!==void 0&&(this._icon=e.icon),e.iconClass!==void 0&&(this._iconClass=e.iconClass),e.iconLabel!==void 0&&(this._iconLabel=e.iconLabel),e.caption!==void 0&&(this._caption=e.caption),e.className!==void 0&&(this._className=e.className),e.closable!==void 0&&(this._closable=e.closable),this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))}get mnemonic(){return this._mnemonic}set mnemonic(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))}get icon(){return this._icon}set icon(e){this._icon!==e&&(this._icon=e,this._changed.emit(void 0))}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))}get iconLabel(){return this._iconLabel}set iconLabel(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))}get caption(){return this._caption}set caption(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))}get className(){return this._className}set className(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))}get closable(){return this._closable}set closable(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))}get dataset(){return this._dataset}set dataset(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,G.clearData(this))}},x=class{constructor(e={}){this._flags=0,this._layout=null,this._parent=null,this._disposed=new G(this),this._hiddenMode=x.HiddenMode.Display,this.node=Ds.createNode(e),this.addClass("lm-Widget")}dispose(){this.isDisposed||(this.setFlag(x.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&x.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),G.clearData(this),A.clearData(this),ft.clearData(this))}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(x.Flag.IsDisposed)}get isAttached(){return this.testFlag(x.Flag.IsAttached)}get isHidden(){return this.testFlag(x.Flag.IsHidden)}get isVisible(){let e=this;do{if(e.isHidden||!e.isAttached)return!1;e=e.parent}while(e!=null);return!0}get title(){return Ds.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this.isHidden&&this._toggleHidden(!1),e==x.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=e,this.isHidden&&this._toggleHidden(!0))}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(e&&this.contains(e))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){let t=new x.ChildMessage("child-removed",this);A.sendMessage(this._parent,t)}if(this._parent=e,this._parent&&!this._parent.isDisposed){let t=new x.ChildMessage("child-added",this);A.sendMessage(this._parent,t)}this.isDisposed||A.sendMessage(this,x.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout!==e){if(this.testFlag(x.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(e.parent)throw new Error("Cannot change layout parent.");this._layout=e,e.parent=this}}*children(){this._layout&&(yield*this._layout)}contains(e){for(let t=e;t;t=t._parent)if(t===this)return!0;return!1}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){return t===!0?(this.node.classList.add(e),!0):t===!1?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)}update(){A.postMessage(this,x.Msg.UpdateRequest)}fit(){A.postMessage(this,x.Msg.FitRequest)}activate(){A.postMessage(this,x.Msg.ActivateRequest)}close(){A.sendMessage(this,x.Msg.CloseRequest)}
3show(){if(this.testFlag(x.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&A.sendMessage(this,x.Msg.BeforeShow),this.clearFlag(x.Flag.IsHidden),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&A.sendMessage(this,x.Msg.AfterShow),this.parent)){let e=new x.ChildMessage("child-shown",this);A.sendMessage(this.parent,e)}}hide(){if(!this.testFlag(x.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&A.sendMessage(this,x.Msg.BeforeHide),this.setFlag(x.Flag.IsHidden),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&A.sendMessage(this,x.Msg.AfterHide),this.parent)){let e=new x.ChildMessage("child-hidden",this);A.sendMessage(this.parent,e)}}setHidden(e){e?this.hide():this.show()}testFlag(e){return(this._flags&e)!==0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e),this.onResize(e);break;case"update-request":this.notifyLayout(e),this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e),this.onFitRequest(e);break;case"before-show":this.notifyLayout(e),this.onBeforeShow(e);break;case"after-show":this.setFlag(x.Flag.IsVisible),this.notifyLayout(e),this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e),this.onBeforeHide(e);break;case"after-hide":this.clearFlag(x.Flag.IsVisible),this.notifyLayout(e),this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e),this.onBeforeAttach(e);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(x.Flag.IsVisible),this.setFlag(x.Flag.IsAttached),this.notifyLayout(e),this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e),this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(x.Flag.IsVisible),this.clearFlag(x.Flag.IsAttached),this.notifyLayout(e),this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e),this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e),this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e),this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e),this.onChildRemoved(e);break;default:this.notifyLayout(e);break}}notifyLayout(e){this._layout&&this._layout.processParentMessage(e)}onCloseRequest(e){this.parent?this.parent=null:this.isAttached&&x.detach(this)}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e)switch(this._hiddenMode){case x.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case x.HiddenMode.Scale:this.node.style.transform="scale(0)",this.node.setAttribute("aria-hidden","true");break;case x.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case x.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case x.HiddenMode.Scale:this.node.style.transform="",this.node.removeAttribute("aria-hidden");break;case x.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}}};(function(i){(function(s){s[s.Display=0]="Display",s[s.Scale=1]="Scale",s[s.ContentVisibility=2]="ContentVisibility"})(i.HiddenMode||(i.HiddenMode={})),function(s){s[s.IsDisposed=1]="IsDisposed",s[s.IsAttached=2]="IsAttached",s[s.IsHidden=4]="IsHidden",s[s.IsVisible=8]="IsVisible",s[s.DisallowLayout=16]="DisallowLayout"}(i.Flag||(i.Flag={})),function(s){s.BeforeShow=new Oe("before-show"),s.AfterShow=new Oe("after-show"),s.BeforeHide=new Oe("before-hide"),s.AfterHide=new Oe("after-hide"),s.BeforeAttach=new Oe("before-attach"),s.AfterAttach=new Oe("after-attach"),s.BeforeDetach=new Oe("before-detach"),s.AfterDetach=new Oe("after-detach"),s.ParentChanged=new Oe("parent-changed"),s.UpdateRequest=new un("update-request"),s.FitRequest=new un("fit-request"),s.ActivateRequest=new un("activate-request"),s.CloseRequest=new un("close-request")}(i.Msg||(i.Msg={}));class e extends Oe{constructor(o,a){super(o),this.child=a}}i.ChildMessage=e;class t extends Oe{constructor(o,a){super("resize"),this.width=o,this.height=a}}i.ResizeMessage=t,function(s){s.UnknownSize=new s(-1,-1)}(t=i.ResizeMessage||(i.ResizeMessage={}));function n(s,o,a=null){if(s.parent)throw new Error("Cannot attach a child widget.");if(s.isAttached||s.node.isConnected)throw new Error("Widget is already attached.");if(!o.isConnected)throw new Error("Host is not attached.");A.sendMessage(s,i.Msg.BeforeAttach),o.insertBefore(s.node,a),A.sendMessage(s,i.Msg.AfterAttach)}i.attach=n;function r(s){if(s.parent)throw new Error("Cannot detach a child widget.");if(!s.isAttached||!s.node.isConnected)throw new Error("Widget is not attached.");A.sendMessage(s,i.Msg.BeforeDetach),s.node.parentNode.removeChild(s.node),A.sendMessage(s,i.Msg.AfterDetach)}i.detach=r})(x||(x={}));(function(i){i.titleProperty=new ft({name:"title",create:t=>new lr({owner:t})});function e(t){return t.node||document.createElement(t.tag||"div")}i.createNode=e})(Ds||(Ds={}));Rt=class{constructor(e={}){this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null,this._disposed=!0,G.clearData(this),ft.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){let t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}}init(){for(let e of this)e.parent=this.parent}onResize(e){for(let t of this)A.sendMessage(t,x.ResizeMessage.UnknownSize)}onUpdateRequest(e){for(let t of this)A.sendMessage(t,x.ResizeMessage.UnknownSize)}onBeforeAttach(e){for(let t of this)A.sendMessage(t,e)}onAfterAttach(e){for(let t of this)A.sendMessage(t,e)}onBeforeDetach(e){for(let t of this)A.sendMessage(t,e)}onAfterDetach(e){for(let t of this)A.sendMessage(t,e)}onBeforeShow(e){for(let t of this)t.isHidden||A.sendMessage(t,e)}onAfterShow(e){for(let t of this)t.isHidden||A.sendMessage(t,e)}onBeforeHide(e){for(let t of this)t.isHidden||A.sendMessage(t,e)}onAfterHide(e){for(let t of this)t.isHidden||A.sendMessage(t,e)}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}};(function(i){function e(s){return mi.horizontalAlignmentProperty.get(s)}i.getHorizontalAlignment=e;function t(s,o){mi.horizontalAlignmentProperty.set(s,o)}i.setHorizontalAlignment=t;function n(s){return mi.verticalAlignmentProperty.get(s)}i.getVerticalAlignment=n;function r(s,o){mi.verticalAlignmentProperty.set(s,o)}i.setVerticalAlignment=r})(Rt||(Rt={}));Rn=class{constructor(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute",this.widget.node.style.contain="strict"}dispose(){if(this._disposed)return;this._disposed=!0;let e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height="",e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=re.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight}update(e,t,n,r){let s=Math.max(this._minWidth,Math.min(n,this._maxWidth)),o=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(s<n)switch(Rt.getHorizontalAlignment(this.widget)){case"left":break;case"center":e+=(n-s)/2;break;case"right":e+=n-s;break;default:throw"unreachable"}if(o<r)switch(Rt.getVerticalAlignment(this.widget)){case"top":break;case"center":t+=(r-o)/2;break;case"bottom":t+=r-o;break;default:throw"unreachable"}let a=!1,l=this.widget.node.style;if(this._top!==t&&(this._top=t,l.top=`${t}px`),this._left!==e&&(this._left=e,l.left=`${e}px`),this._width!==s&&(a=!0,this._width=s,l.width=`${s}px`),this._height!==o&&(a=!0,this._height=o,l.height=`${o}px`),a){let c=new x.ResizeMessage(s,o);A.sendMessage(this.widget,c)}}};(function(i){i.horizontalAlignmentProperty=new ft({name:"horizontalAlignment",create:()=>"center",changed:e}),i.verticalAlignmentProperty=new ft({name:"verticalAlignment",create:()=>"top",changed:e});
3function e(t){t.parent&&t.parent.layout&&t.parent.update()}})(mi||(mi={}));pi=class extends Rt{constructor(){super(...arguments),this._widgets=[]}dispose(){for(;this._widgets.length>0;)this._widgets.pop().dispose();super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let n=this._widgets.indexOf(t),r=Math.max(0,Math.min(e,this._widgets.length));if(n===-1){D.insert(this._widgets,r,t),this.parent&&this.attachWidget(r,t);return}r===this._widgets.length&&r--,n!==r&&(D.move(this._widgets,n,r),this.parent&&this.moveWidget(n,r,t))}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=D.removeAt(this._widgets,e);t&&this.parent&&this.detachWidget(e,t)}init(){super.init();let e=0;for(let t of this)this.attachWidget(e++,t)}attachWidget(e,t){let n=this.parent.node.children[e];this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeAttach),this.parent.node.insertBefore(t.node,n),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterAttach)}moveWidget(e,t,n){this.parent.isAttached&&A.sendMessage(n,x.Msg.BeforeDetach),this.parent.node.removeChild(n.node),this.parent.isAttached&&A.sendMessage(n,x.Msg.AfterDetach);let r=this.parent.node.children[t];this.parent.isAttached&&A.sendMessage(n,x.Msg.BeforeAttach),this.parent.node.insertBefore(n.node,r),this.parent.isAttached&&A.sendMessage(n,x.Msg.AfterAttach)}detachWidget(e,t){this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterDetach)}};(function(i){function e(t){return Math.max(0,Math.floor(t))}i.clampDimension=e})(cr||(cr={}));hr=cr,yt=class extends pi{constructor(e){super(),this.widgetOffset=0,this._fixed=0,this._spacing=4,this._dirty=!1,this._hasNormedSizes=!1,this._sizers=[],this._items=[],this._handles=[],this._box=null,this._alignment="start",this._orientation="horizontal",this.renderer=e.renderer,e.orientation!==void 0&&(this._orientation=e.orientation),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=cr.clampDimension(e.spacing))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,super.dispose()}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=cr.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get handles(){return this._handles}absoluteSizes(){return this._sizers.map(e=>e.size)}relativeSizes(){return Kt.normalize(this._sizers.map(e=>e.size))}setRelativeSizes(e,t=!0){let n=this._sizers.length,r=e.slice(0,n);for(;r.length<n;)r.push(0);let s=Kt.normalize(r);for(let o=0;o<n;++o){let a=this._sizers[o];a.sizeHint=s[o],a.size=s[o]}this._hasNormedSizes=!0,t&&this.parent&&this.parent.update()}moveHandle(e,t){let n=this._handles[e];if(!n||n.classList.contains("lm-mod-hidden"))return;let r;if(this._orientation==="horizontal"?r=t-n.offsetLeft:r=t-n.offsetTop,r!==0){for(let s of this._sizers)s.size>0&&(s.sizeHint=s.size);Je.adjust(this._sizers,e,r),this.parent&&this.parent.update()}}init(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){let n=new Rn(t),r=Kt.createHandle(this.renderer),s=Kt.averageSize(this._sizers),o=Kt.createSizer(s);D.insert(this._items,e,n),D.insert(this._sizers,e,o),D.insert(this._handles,e,r),this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.node.appendChild(r),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){D.move(this._items,e,t),D.move(this._sizers,e,t),D.move(this._handles,e,t),this.parent.fit()}detachWidget(e,t){let n=D.removeAt(this._items,e),r=D.removeAt(this._handles,e);D.removeAt(this._sizers,e),this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.node.removeChild(r),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterDetach),n.dispose(),this.parent.fit()}
3onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}updateItemPosition(e,t,n,r,s,o,a){let l=this._items[e];if(l.isHidden)return;let c=this._handles[e].style;t?(n+=this.widgetOffset,l.update(n,r,a,s),n+=a,c.top=`${r}px`,c.left=`${n}px`,c.width=`${this._spacing}px`,c.height=`${s}px`):(r+=this.widgetOffset,l.update(n,r,o,a),r+=a,c.top=`${r}px`,c.left=`${n}px`,c.width=`${o}px`,c.height=`${this._spacing}px`)}_fit(){let e=0,t=-1;for(let l=0,c=this._items.length;l<c;++l)this._items[l].isHidden?this._handles[l].classList.add("lm-mod-hidden"):(this._handles[l].classList.remove("lm-mod-hidden"),t=l,e++);t!==-1&&this._handles[t].classList.add("lm-mod-hidden"),this._fixed=this._spacing*Math.max(0,e-1)+this.widgetOffset*this._items.length;let n=this._orientation==="horizontal",r=n?this._fixed:0,s=n?0:this._fixed;for(let l=0,c=this._items.length;l<c;++l){let h=this._items[l],d=this._sizers[l];if(d.size>0&&(d.sizeHint=d.size),h.isHidden){d.minSize=0,d.maxSize=0;continue}h.fit(),d.stretch=yt.getStretch(h.widget),n?(d.minSize=h.minWidth,d.maxSize=h.maxWidth,r+=h.minWidth,s=Math.max(s,h.minHeight)):(d.minSize=h.minHeight,d.maxSize=h.maxHeight,s+=h.minHeight,r=Math.max(r,h.minWidth))}let o=this._box=re.boxSizing(this.parent.node);r+=o.horizontalSum,s+=o.verticalSum;let a=this.parent.node.style;a.minWidth=`${r}px`,a.minHeight=`${s}px`,this._dirty=!0,this.parent.parent&&A.sendMessage(this.parent.parent,x.Msg.FitRequest),this._dirty&&A.sendMessage(this.parent,x.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let n=0;for(let d=0,u=this._items.length;d<u;++d)n+=+!this._items[d].isHidden;if(n===0&&this.widgetOffset===0)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=re.boxSizing(this.parent.node));let r=this._box.paddingTop,s=this._box.paddingLeft,o=e-this._box.horizontalSum,a=t-this._box.verticalSum,l=0,c=0,h=this._orientation==="horizontal";if(n>0){let d;if(h?d=Math.max(0,o-this._fixed):d=Math.max(0,a-this._fixed),this._hasNormedSizes){for(let f of this._sizers)f.sizeHint*=d;this._hasNormedSizes=!1}let u=Je.calc(this._sizers,d);if(u>0)switch(this._alignment){case"start":break;case"center":l=0,c=u/2;break;case"end":l=0,c=u;break;case"justify":l=u/n,c=0;break;default:throw"unreachable"}}for(let d=0,u=this._items.length;d<u;++d){let p=this._items[d].isHidden?0:this._sizers[d].size+l;this.updateItemPosition(d,h,h?s+c:s,h?r:r+c,a,o,p);let m=this.widgetOffset+(this._handles[d].classList.contains("lm-mod-hidden")?0:this._spacing);h?s+=p+m:r+=p+m}}};(function(i){function e(n){return Kt.stretchProperty.get(n)}i.getStretch=e;function t(n,r){Kt.stretchProperty.set(n,r)}i.setStretch=t})(yt||(yt={}));(function(i){i.stretchProperty=new ft({name:"stretch",create:()=>0,coerce:(o,a)=>Math.max(0,Math.floor(a)),changed:s});function e(o){let a=new Lt;return a.sizeHint=Math.floor(o),a}i.createSizer=e;function t(o){let a=o.createHandle();return a.style.position="absolute",a.style.contain="style",a}i.createHandle=t;function n(o){return o.reduce((a,l)=>a+l.size,0)/o.length||0}i.averageSize=n;function r(o){let a=o.length;if(a===0)return[];let l=o.reduce((c,h)=>c+Math.abs(h),0);return l===0?o.map(c=>1/a):o.map(c=>c/l)}i.normalize=r;function s(o){o.parent&&o.parent.layout instanceof yt&&o.parent.fit()}})(Kt||(Kt={}));Ll=class extends yt{constructor(e){super({...e,orientation:e.orientation||"vertical"}),this._titles=[],this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=hr.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())}get titles(){return this._titles}dispose(){this.isDisposed||(this._titles.length=0,super.dispose())}updateTitle(e,t){let n=this._titles[e],r=n.classList.contains("lm-mod-expanded"),s=Ns.createTitle(this.renderer,t.title,r);this._titles[e]=s,this.parent.node.replaceChild(s,n)}insertWidget(e,t){t.id||(t.id=`id-${Xt.UUID.uuid4()}`),super.insertWidget(e,t)}attachWidget(e,t){let n=Ns.createTitle(this.renderer,t.title);D.insert(this._titles,e,n),this.parent.node.appendChild(n),t.node.setAttribute("role","regi
3on"),t.node.setAttribute("aria-labelledby",n.id),super.attachWidget(e,t)}moveWidget(e,t,n){D.move(this._titles,e,t),super.moveWidget(e,t,n)}detachWidget(e,t){let n=D.removeAt(this._titles,e);this.parent.node.removeChild(n),super.detachWidget(e,t)}updateItemPosition(e,t,n,r,s,o,a){let l=this._titles[e].style;l.top=`${r}px`,l.left=`${n}px`,l.height=`${this.widgetOffset}px`,t?l.width=`${s}px`:l.width=`${o}px`,super.updateItemPosition(e,t,n,r,s,o,a)}};(function(i){function e(t,n,r=!0){let s=t.createSectionTitle(n);return s.style.position="absolute",s.style.contain="strict",s.setAttribute("aria-label",`${n.label} Section`),s.setAttribute("aria-expanded",r?"true":"false"),s.setAttribute("aria-controls",n.owner.id),r&&s.classList.add("lm-mod-expanded"),s}i.createTitle=e})(Ns||(Ns={}));Ls=class extends x{constructor(e={}){super(),this.addClass("lm-Panel"),this.layout=Ol.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}};(function(i){function e(t){return t.layout||new pi}i.createLayout=e})(Ol||(Ol={}));Bn=class extends Ls{constructor(e={}){super({layout:Rl.createLayout(e)}),this._handleMoved=new G(this),this._pressData=null,this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse(),super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=!0){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child"),this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child"),this._releaseMouse()}_evtKeyDown(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),e.keyCode===27&&this._releaseMouse()}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,n=D.findFirstIndex(t.handles,c=>c.contains(e.target));if(n===-1)return;e.preventDefault(),e.stopPropagation(),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);let r,s=t.handles[n],o=s.getBoundingClientRect();t.orientation==="horizontal"?r=e.clientX-o.left:r=e.clientY-o.top;let a=window.getComputedStyle(s),l=ge.overrideCursor(a.cursor);this._pressData={index:n,delta:r,override:l}}_evtPointerMove(e){e.preventDefault(),e.stopPropagation();let t,n=this.layout,r=this.node.getBoundingClientRect();n.orientation==="horizontal"?t=e.clientX-r.left-this._pressData.delta:t=e.clientY-r.top-this._pressData.delta,n.moveHandle(this._pressData.index,t)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))}};(function(i){class e{createHandle(){let s=document.createElement("div");return s.className="lm-SplitPanel-handle",s}}i.Renderer=e,i.defaultRenderer=new e;function t(r){return yt.getStretch(r)}i.getStretch=t;function n(r,s){yt.setStretch(r,s)}i.setStretch=n})(Bn||(Bn={}));(function(i){function e(t){return t.layout||new yt({renderer:t.renderer||Bn.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}i.createLayout=e})(Rl||(Rl={}));dr=class extends Bn{constructor(e={}){super({...e,layout:Bl.createLayout(e)}),this._widgetSizesCache=new WeakMap,this._expansionToggled=new G(this),this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e),e.title.changed.connect(this._onTitleChanged,this)}collapse(e){let t=this.layout.widgets[e];t&&!t.isHidden&&this._toggleExpansion(e)}expand(e){let t=this.layout.widgets[e];t&&t.isHidden&&this._toggleExpansion(e)}insertWidget(e,t){super.insertWidget(e,t),t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){switch(super.handleEvent(e),e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e);break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)}_onTitleChanged(e){let t=D.findFirstIndex(this.widgets,n=>n.contains(e.owner));t>=0&&(this.layout.updateTitle(t,e.owner),this.update())}_computeWidgetSize(e){let t=this.layout,n=t.widgets[e];if(!n)return;let r=n.isHidden,s=t.absoluteSizes(),o=(r?-1:1)*this.spacing,a=s.reduce((c,h)=>c+h),l=[...s];if(r){let c=this._widgetSizesCache.get(n);if(!c)return;l[e]+=c;let h=l.map(d=>d-c>0).lastIndexOf(!0);h===-1?l.forEach((d,u)=>{u!==e&&(l[u]-=s[u]/a*(c-o))}):l[h]-=c-o}else{let c=s[e];this._widgetSizesCache.set(n,c),l[e]=0;let h=l.map(d=>d>0).lastIndexOf(!0);if(h===-1)return;l[h]=s[h]+c+o}return l.map(c=>c/(a+o))}_evtClick(e){let t=e.target;if(t){let n=D.findFirstIndex(this.titles,r=>r.contains(t));n>=0&&(e.preventDefault(),e.stopPropagation(),this._toggleExpansion(n))}}
3_eventKeyDown(e){if(e.defaultPrevented)return;let t=e.target,n=!1;if(t){let r=D.findFirstIndex(this.titles,s=>s.contains(t));if(r>=0){let s=e.keyCode.toString();if(e.key.match(/Space|Enter/)||s.match(/13|32/))t.click(),n=!0;else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||s.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||s.match(/38|40/)){let o=e.key.match(/ArrowLeft|ArrowUp/)||s.match(/37|38/)?-1:1,a=this.titles.length,l=(r+a+o)%a;this.titles[l].focus(),n=!0}else e.key==="End"||s==="35"?(this.titles[this.titles.length-1].focus(),n=!0):(e.key==="Home"||s==="36")&&(this.titles[0].focus(),n=!0)}n&&e.preventDefault()}}_toggleExpansion(e){let t=this.titles[e],n=this.layout.widgets[e],r=this._computeWidgetSize(e);r&&this.setRelativeSizes(r,!1),n.isHidden?(t.classList.add("lm-mod-expanded"),t.setAttribute("aria-expanded","true"),n.show()):(t.classList.remove("lm-mod-expanded"),t.setAttribute("aria-expanded","false"),n.hide()),this._expansionToggled.emit(e)}};(function(i){class e extends Bn.Renderer{constructor(){super(),this.titleClassName="lm-AccordionPanel-title",this._titleID=0,this._titleKeys=new WeakMap,this._uuid=++e._nInstance}createCollapseIcon(n){return document.createElement("span")}createSectionTitle(n){let r=document.createElement("h3");r.setAttribute("tabindex","0"),r.id=this.createTitleKey(n),r.className=this.titleClassName;for(let a in n.dataset)r.dataset[a]=n.dataset[a];let s=r.appendChild(this.createCollapseIcon(n));s.className="lm-AccordionPanel-titleCollapser";let o=r.appendChild(document.createElement("span"));return o.className="lm-AccordionPanel-titleLabel",o.textContent=n.label,o.title=n.caption||n.label,r}createTitleKey(n){let r=this._titleKeys.get(n);return r===void 0&&(r=`title-key-${this._uuid}-${this._titleID++}`,this._titleKeys.set(n,r)),r}}e._nInstance=0,i.Renderer=e,i.defaultRenderer=new e})(dr||(dr={}));(function(i){function e(t){return t.layout||new Ll({renderer:t.renderer||dr.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}i.createLayout=e})(Bl||(Bl={}));Ke=class extends pi{constructor(e={}){super(),this._fixed=0,this._spacing=4,this._dirty=!1,this._sizers=[],this._items=[],this._box=null,this._alignment="start",this._direction="top-to-bottom",e.direction!==void 0&&(this._direction=e.direction),e.alignment!==void 0&&(this._alignment=e.alignment),e.spacing!==void 0&&(this._spacing=hr.clampDimension(e.spacing))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,this._sizers.length=0,super.dispose()}get direction(){return this._direction}set direction(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))}get alignment(){return this._alignment}set alignment(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))}get spacing(){return this._spacing}set spacing(e){e=hr.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}init(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,super.init()}attachWidget(e,t){D.insert(this._items,e,new Rn(t)),D.insert(this._sizers,e,new Lt),this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){D.move(this._items,e,t),D.move(this._sizers,e,t),this.parent.update()}detachWidget(e,t){let n=D.removeAt(this._items,e);D.removeAt(this._sizers,e),this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterDetach),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0;for(let a=0,l=this._items.length;a<l;++a)e+=+!this._items[a].isHidden;this._fixed=this._spacing*Math.max(0,e-1);let t=On.isHorizontal(this._direction),n=t?this._fixed:0,r=t?0:this._fixed;for(let a=0,l=this._items.length;a<l;++a){let c=this._items[a],h=this._sizers[a];if(c.isHidden){h.minSize=0,h.maxSize=0;continue}c.fit(),h.sizeHint=Ke.getSizeBasis(c.widget),h.stretch=Ke.getStretch(c.widget),t?(h.minSize=c.minWidth,h.maxSize=c.maxWidth,n+=c.minWidth,r=Math.max(r,c.minHeight)):(h.minSize=c.minHeight,h.maxSize=c.maxHeight,r+=c.minHeight,n=Math.max(n,c.minWidth))}let s=this._box=re.boxSizing(this.parent.node);n+=s.horizontalSum,r+=s.verticalSum;let o=this.parent.node.style;o.minWidth=`${n}px`,o.minHeight=`${r}px`,this._dirty=!0,this.parent.parent&&A.sendMessage(this.parent.parent,x.Msg.FitRequest),this._dirty&&A.sendMessage(this.parent,x.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let n=0;for(let d=0,u=this._items.length;d<u;++d)n+=+!this._items[d].isHidden;if(n===0)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=re.boxSizing(this.parent.node));let r=this._box.paddingTop,s=this._box.paddingLeft,o=e-this._box.horizontalSum,a=t-this._box.verticalSum,l;switch(this._direction){case"left-to-right":l=Je.calc(this._sizers,Math.max(0,o-this._fixed));break;case"top-to-bottom":l=Je.calc(this._sizers,Math.max(0,a-this._fixed));break;case"right-to-left":l=Je.calc(this._sizers,Math.max(0,o-this._fixed)),s+=o;break;case"bottom-to-top":l=Je.calc(this._sizers,Math.max(0,a-this._fixed)),r+=a;break;default:throw"unreachable"}let c=0,h=0;if(l>0)switch(this._alignment){case"start":break;case"center":c=0,h=l/2;break;case"end":c=0,h=l;break;case"justify":c=l/n,h=0;break;default:throw"unreachable"}for(let d=0,u=this._items.length;d<u;++d){let f=this._items[d];if(f.isHidden)continue;let p=this._sizers[d].size;switch(this._direction){case"left-to-right":f.update(s+h,r,p+c,a),s+=p+c+this._spacing;break;case"top-to-bottom":f.update(s,r+h,o,p+c),r+=p+c+this._spacing;break;case"right-to-left":f.update(s-h-p-c,r,p+c,a),s-=p+c+this._spacing;break;case"bottom-to-top":f.update(s,r-h-p-c,o,p+c),r-=p+c+this._spacing;break;default:throw"unreachable"}}}};(function(i){function e(s){return On.stretchProperty.get(s)}i.getStretch=e;function t(s,o){On.stretchProperty.set(s,o)}i.setStretch=t;function n(s){return On.sizeBasisProperty.get(s)}i.getSizeBasis=n;function r(s,o){On.sizeBasisProperty.set(s,o)}i.setSizeBasis=r})(Ke||(Ke={}));(function(i){i.stretchProperty=new ft({name:"stretch",create:()=>0,coerce:(r,s)=>Math.max(0,Math.floor(s)),changed:n}),i.sizeBasisProperty=new ft({name:"sizeBasis",create:()=>0,coerce:(r,s)=>Math.max(0,Math.floor(s)),changed:n});function e(r){return r==="left-to-right"||r==="right-to-left"}i.isHorizontal=e;function t(r){return Math.max(0,Math.floor(r))}i.clampSpacing=t;function n(r){r.parent&&r.parent.layout instanceof Ke&&r.parent.fit()}})(On||(On={}));Os=class extends Ls{constructor(e={}){super({layout:zl.createLayout(e)}),this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}};(function(i){function e(s){return Ke.getStretch(s)}i.getStretch=e;function t(s,o){Ke.setStretch(s,o)}i.setStretch=t;function n(s){return Ke.getSizeBasis(s)}i.getSizeBasis=n;function r(s,o){Ke.setSizeBasis(s,o)}i.setSizeBasis=r})(Os||(Os={}));(function(i){function e(t){return t.layout||new Ke(t)}i.createLayout=e})(zl||(zl={}));gi=class extends x{constructor(e){super({node:Jt.createNode()}),this._activeIndex=-1,this._items=[],this._results=null,this.addClass("lm-CommandPalette"),this.setFlag(x.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||gi.defaultRenderer,this.commands.commandChanged.connect(this._onGenericChange,this),this.commands.keyBindingChanged.connect(this._onGenericChange,this)}
3dispose(){this._items.length=0,this._results=null,super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=Jt.createItem(this.commands,e);return this._items.push(t),this.refresh(),t}addItems(e){let t=e.map(n=>Jt.createItem(this.commands,n));return t.forEach(n=>this._items.push(n)),this.refresh(),t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){D.removeAt(this._items,e)&&this.refresh()}clearItems(){this._items.length!==0&&(this._items.length=0,this.refresh())}refresh(){if(this._results=null,this.inputNode.value!==""){let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="inherit"}else{let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="none"}this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(e){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)}onAfterDetach(e){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)}onAfterShow(e){this.update(),super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let t=this.inputNode;t.focus(),t.select()}}onUpdateRequest(e){if(!this.isVisible){nn.render(null,this.contentNode);return}let t=this.inputNode.value,n=this.contentNode,r=this._results;if(r||(r=this._results=Jt.search(this._items,t),this._activeIndex=t?D.findFirstIndex(r,Jt.canActivate):-1),!t&&r.length===0){nn.render(null,n);return}if(t&&r.length===0){let l=this.renderer.renderEmptyMessage({query:t});nn.render(l,n);return}let s=this.renderer,o=this._activeIndex,a=new Array(r.length);for(let l=0,c=r.length;l<c;++l){let h=r[l];if(h.type==="header"){let d=h.indices,u=h.category;a[l]=s.renderHeader({category:u,indices:d})}else{let d=h.item,u=h.indices,f=l===o;a[l]=s.renderItem({item:d,indices:u,active:f})}}if(nn.render(a,n),o<0||o>=r.length)n.scrollTop=0;else{let l=n.children[o];re.scrollIntoViewIfNeeded(n,l)}}_evtClick(e){if(e.button!==0)return;if(e.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}let t=D.findFirstIndex(this.contentNode.children,n=>n.contains(e.target));t!==-1&&(e.preventDefault(),e.stopPropagation(),this._execute(t))}_evtKeyDown(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))switch(e.keyCode){case 13:e.preventDefault(),e.stopPropagation(),this._execute(this._activeIndex);break;case 38:e.preventDefault(),e.stopPropagation(),this._activatePreviousItem();break;case 40:e.preventDefault(),e.stopPropagation(),this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0)return;let e=this._activeIndex,t=this._results.length,n=e<t-1?e+1:0,r=n===0?t-1:n-1;this._activeIndex=D.findFirstIndex(this._results,Jt.canActivate,n,r),this.update()}_activatePreviousItem(){if(!this._results||this._results.length===0)return;let e=this._activeIndex,t=this._results.length,n=e<=0?t-1:e-1,r=n===t-1?0:n+1;this._activeIndex=D.findLastIndex(this._results,Jt.canActivate,n,r),this.update()}_execute(e){if(!this._results)return;let t=this._results[e];if(t){if(t.type==="header"){let n=this.inputNode;n.value=`${t.category.toLowerCase()} `,n.focus(),this.refresh();return}t.item.isEnabled&&(this.commands.execute(t.item.command,t.item.args),this.inputNode.value="",this.refresh())}}_toggleFocused(){let e=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",e)}_onGenericChange(){this.refresh()}};(function(i){class e{renderHeader(n){let r=this.formatHeader(n);return ie.li({className:"lm-CommandPalette-header"},r)}renderItem(n){let r=this.createItemClass(n),s=this.createItemDataset(n);return n.item.isToggleable?ie.li({className:r,dataset:s,role:"menuitemcheckbox","aria-checked":`${n.item.isToggled}`},this.renderItemIcon(n),this.renderItemContent(n),this.renderItemShortcut(n)):ie.li({className:r,dataset:s,role:"menuitem"},this.renderItemIcon(n),this.renderItemContent(n),this.renderItemShortcut(n))}renderEmptyMessage(n){let r=this.formatEmptyMessage(n);return ie.li({className:"lm-CommandPalette-emptyMessage"},r)}renderItemIcon(n){let r=this.createIconClass(n);return ie.div({className:r},n.item.icon,n.item.iconLabel)}renderItemContent(n){return ie.div({className:"lm-CommandPalette-itemContent"},this.renderItemLabel(n),this.renderItemCaption(n))}renderItemLabel(n){let r=this.formatItemLabel(n);return ie.div({className:"lm-CommandPalette-itemLabel"},r)}renderItemCaption(n){let r=this.formatItemCaption(n);return ie.div({className:"lm-CommandPalette-itemCaption"},r)}renderItemShortcut(n){let r=this.formatItemShortcut(n);return ie.div({className:"lm-CommandPalette-itemShortcut"},r)}createItemClass(n){let r="lm-CommandPalette-item";n.item.isEnabled||(r+=" lm-mod-disabled"),n.item.isToggled&&(r+=" lm-mod-toggled"),n.active&&(r+=" lm-mod-active");let s=n.item.className;return s&&(r+=` ${s}`),r}createItemDataset(n){return{...n.item.dataset,command:n.item.command}}createIconClass(n){let r="lm-CommandPalette-itemIcon",s=n.item.iconClass;return s?`${r} ${s}`:r}formatHeader(n){return!n.indices||n.indices.length===0?n.category:Hr.highlight(n.category,n.indices,ie.mark)}formatEmptyMessage(n){return`No commands found that match '${n.query}'`}formatItemShortcut(n){let r=n.item.keyBinding;return r?qr.formatKeystroke(r.keys):null}formatItemLabel(n){return!n.indices||n.indices.length===0?n.item.label:Hr.highlight(n.item.label,n.indices,ie.mark)}formatItemCaption(n){return n.item.caption}}i.Renderer=e,i.defaultRenderer=new e})(gi||(gi={}));(function(i){function e(){let u=document.createElement("div"),f=document.createElement("div"),p=document.createElement("div"),m=document.createElement("input"),g=document.createElement("ul"),b=document.createElement("button");return f.className="lm-CommandPalette-search",p.className="lm-CommandPalette-wrapper",m.className="lm-CommandPalette-input",b.className="lm-close-icon",g.className="lm-CommandPalette-content",g.setAttribute("role","menu"),m.spellcheck=!1,p.appendChild(m),p.appendChild(b),f.appendChild(p),u.appendChild(f),u.appendChild(g),u}i.createNode=e;function t(u,f){return new d(u,f)}i.createItem=t;function n(u,f){let p=a(u,f);return p.sort(c),h(p)}i.search=n;function r(u){return u.type==="item"&&u.item.isEnabled}i.canActivate=r;function s(u){return u.trim().replace(/\s+/g," ")}function o(u){return u.replace(/\s+/g,"").toLowerCase()}function a(u,f){f=o(f);let p=[];for(let m=0,g=u.length;m<g;++m){let b=u[m];if(!b.isVisible)continue;if(!f){p.push({matchType:3,categoryIndices:null,labelIndices:null,
3score:0,item:b});continue}let y=l(b,f);y&&(b.isEnabled||(y.score+=1e3),p.push(y))}return p}function l(u,f){let p=u.category.toLowerCase(),m=u.label.toLowerCase(),g=`${p} ${m}`,b=1/0,y=null,_=/\b\w/g;for(;;){let S=_.exec(g);if(!S)break;let I=Hr.matchSumOfDeltas(g,f,S.index);if(!I)break;I.score<=b&&(b=I.score,y=I.indices)}if(!y||b===1/0)return null;let v=p.length+1,w=D.lowerBound(y,v,(S,I)=>S-I),M=y.slice(0,w),C=y.slice(w);for(let S=0,I=C.length;S<I;++S)C[S]-=v;return M.length===0?{matchType:0,categoryIndices:null,labelIndices:C,score:b,item:u}:C.length===0?{matchType:1,categoryIndices:M,labelIndices:null,score:b,item:u}:{matchType:2,categoryIndices:M,labelIndices:C,score:b,item:u}}function c(u,f){let p=u.matchType-f.matchType;if(p!==0)return p;let m=u.score-f.score;if(m!==0)return m;let g=0,b=0;switch(u.matchType){case 0:g=u.labelIndices[0],b=f.labelIndices[0];break;case 1:case 2:g=u.categoryIndices[0],b=f.categoryIndices[0];break}if(g!==b)return g-b;let y=u.item.category.localeCompare(f.item.category);if(y!==0)return y;let _=u.item.rank,v=f.item.rank;return _!==v?_<v?-1:1:u.item.label.localeCompare(f.item.label)}function h(u){let f=[];for(let p=0,m=u.length;p<m;++p){let{item:g,categoryIndices:b,labelIndices:y}=u[p],_=g.category;(p===0||_!==u[p-1].item.category)&&f.push({type:"header",category:_,indices:b}),f.push({type:"item",item:g,indices:y})}return f}class d{constructor(f,p){this._commands=f,this.category=s(p.category),this.command=p.command,this.args=p.args||Xt.JSONExt.emptyObject,this.rank=p.rank!==void 0?p.rank:1/0}get label(){return this._commands.label(this.command,this.args)}get icon(){return this._commands.icon(this.command,this.args)}get iconClass(){return this._commands.iconClass(this.command,this.args)}get iconLabel(){return this._commands.iconLabel(this.command,this.args)}get caption(){return this._commands.caption(this.command,this.args)}get className(){return this._commands.className(this.command,this.args)}get dataset(){return this._commands.dataset(this.command,this.args)}get isEnabled(){return this._commands.isEnabled(this.command,this.args)}get isToggled(){return this._commands.isToggled(this.command,this.args)}get isToggleable(){return this._commands.isToggleable(this.command,this.args)}get isVisible(){return this._commands.isVisible(this.command,this.args)}get keyBinding(){let{command:f,args:p}=this;return D.findLastValue(this._commands.keyBindings,m=>m.command===f&&Xt.JSONExt.deepEqual(m.args,p))||null}}})(Jt||(Jt={}));Ot=class extends x{constructor(e){super({node:Re.createNode()}),this._childIndex=-1,this._activeIndex=-1,this._openTimerID=0,this._closeTimerID=0,this._items=[],this._childMenu=null,this._parentMenu=null,this._aboutToClose=new G(this),this._menuRequested=new G(this),this.addClass("lm-Menu"),this.setFlag(x.Flag.DisallowLayout),this.commands=e.commands,this.renderer=e.renderer||Ot.defaultRenderer}dispose(){this.close(),this._items.length=0,super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;for(;e._parentMenu;)e=e._parentMenu;return e}get leafMenu(){let e=this;for(;e._childMenu;)e=e._childMenu;return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._items.length)&&(e=-1),e!==-1&&!Re.canActivate(this._items[e])&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())}get items(){return this._items}activateNextItem(){let e=this._items.length,t=this._activeIndex,n=t<e-1?t+1:0,r=n===0?e-1:n-1;this.activeIndex=D.findFirstIndex(this._items,Re.canActivate,n,r)}activatePreviousItem(){let e=this._items.length,t=this._activeIndex,n=t<=0?e-1:t-1,r=n===e-1?0:n+1;this.activeIndex=D.findLastIndex(this._items,Re.canActivate,n,r)}triggerActiveItem(){if(!this.isAttached)return;let e=this.activeItem;if(!e)return;if(this._cancelOpenTimer(),this._cancelCloseTimer(),e.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();let{command:t,args:n}=e;this.commands.isEnabled(t,n)?this.commands.execute(t,n):console.log(`Command '${t}' is disabled.`)}addItem(e){return this.insertItem(this._items.length,e)}insertItem(e,t){this.isAttached&&this.close(),this.activeIndex=-1;let n=Math.max(0,Math.min(e,this._items.length)),r=Re.createItem(this,t);return D.insert(this._items,n,r),this.update(),r}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){this.isAttached&&this.close(),this.activeIndex=-1,D.removeAt(this._items,e)&&this.update()}clearItems(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())}open(e,t,n={}){var r,s,o;if(this.isAttached)return;let a=n.forceX||!1,l=n.forceY||!1,c=(r=n.host)!==null&&r!==void 0?r:null,h=(s=n.ref)!==null&&s!==void 0?s:null,d=(o=n.horizontalAlignment)!==null&&o!==void 0?o:document.documentElement.dir==="rtl"?"right":"left";Re.openRootMenu(this,e,t,a,l,d,c,h),this.activate()}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mouseup":this._evtMouseUp(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseenter":this._evtMouseEnter(e);break;case"mouseleave":this._evtMouseLeave(e);break;case"mousedown":this._evtMouseDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,
3!0)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)}onActivateRequest(e){this.isAttached&&this.node.focus()}onUpdateRequest(e){let t=this._items,n=this.renderer,r=this._activeIndex,s=Re.computeCollapsed(t),o=new Array(t.length);for(let a=0,l=t.length;a<l;++a){let c=t[a],h=a===r,d=s[a];o[a]=n.renderItem({item:c,active:h,collapsed:d,onfocus:()=>{this.activeIndex=a}})}nn.render(o,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;let t=this._childMenu;t&&(this._childIndex=-1,this._childMenu=null,t._parentMenu=null,t.close());let n=this._parentMenu;n&&(this._parentMenu=null,n._childIndex=-1,n._childMenu=null,n.activate()),this.isAttached&&this._aboutToClose.emit(void 0),super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault(),e.stopPropagation();let t=e.keyCode;if(t===13){this.triggerActiveItem();return}if(t===27){this.close();return}if(t===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(t===38){this.activatePreviousItem();return}if(t===39){let o=this.activeItem;o&&o.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(t===40){this.activateNextItem();return}let n=la().keyForKeydownEvent(e);if(!n)return;let r=this._activeIndex+1,s=Re.findMnemonic(this._items,n,r);s.index!==-1&&!s.multiple?(this.activeIndex=s.index,this.triggerActiveItem()):s.index!==-1?this.activeIndex=s.index:s.auto!==-1&&(this.activeIndex=s.auto)}_evtMouseUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this.triggerActiveItem())}_evtMouseMove(e){let t=D.findFirstIndex(this.contentNode.children,r=>re.hitTest(r,e.clientX,e.clientY));if(t===this._activeIndex)return;if(this.activeIndex=t,t=this.activeIndex,t===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();let n=this.activeItem;!n||n.type!=="submenu"||!n.submenu||this._startOpenTimer()}_evtMouseEnter(e){for(let t=this._parentMenu;t;t=t._parentMenu)t._cancelOpenTimer(),t._cancelCloseTimer(),t.activeIndex=t._childIndex}_evtMouseLeave(e){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}let{clientX:t,clientY:n}=e;if(re.hitTest(this._childMenu.node,t,n)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()}_evtMouseDown(e){this._parentMenu||(Re.hitTestMenus(this,e.clientX,e.clientY)?(e.preventDefault(),e.stopPropagation()):this.close())}_openChildMenu(e=!1){let t=this.activeItem;if(!t||t.type!=="submenu"||!t.submenu){this._closeChildMenu();return}let n=t.submenu;if(n===this._childMenu)return;Ot.saveWindowData(),this._closeChildMenu(),this._childMenu=n,this._childIndex=this._activeIndex,n._parentMenu=this,A.sendMessage(this,x.Msg.UpdateRequest);let r=this.contentNode.children[this._activeIndex];Re.openSubmenu(n,r),e&&(n.activeIndex=-1,n.activateNextItem()),n.activate()}_closeChildMenu(){this._childMenu&&this._childMenu.close()}_startOpenTimer(){this._openTimerID===0&&(this._openTimerID=window.setTimeout(()=>{this._openTimerID=0,this._openChildMenu()},Re.TIMER_DELAY))}_startCloseTimer(){this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(()=>{this._closeTimerID=0,this._closeChildMenu()},Re.TIMER_DELAY))}_cancelOpenTimer(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)}_cancelCloseTimer(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)}static saveWindowData(){Re.saveWindowData()}};(function(i){class e{renderItem(n){let r=this.createItemClass(n),s=this.createItemDataset(n),o=this.createItemARIA(n);return ie.li({className:r,dataset:s,tabindex:"0",onfocus:n.onfocus,...o},this.renderIcon(n),this.renderLabel(n),this.renderShortcut(n),this.renderSubmenu(n))}renderIcon(n){let r=this.createIconClass(n);return ie.div({className:r},n.item.icon,n.item.iconLabel)}renderLabel(n){let r=this.formatLabel(n);return ie.div({className:"lm-Menu-itemLabel"},r)}renderShortcut(n){let r=this.formatShortcut(n);return ie.div({className:"lm-Menu-itemShortcut"},r)}renderSubmenu(n){return ie.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(n){let r="lm-Menu-item";n.item.isEnabled||(r+=" lm-mod-disabled"),n.item.isToggled&&(r+=" lm-mod-toggled"),n.item.isVisible||(r+=" lm-mod-hidden"),n.active&&(r+=" lm-mod-active"),n.collapsed&&(r+=" lm-mod-collapsed");let s=n.item.className;return s&&(r+=` ${s}`),r}createItemDataset(n){let r,{type:s,command:o,dataset:a}=n.item;return s==="command"?r={...a,type:s,command:o}:r={...a,type:s},r}createIconClass(n){let r="lm-Menu-itemIcon",s=n.item.iconClass;return s?`${r} ${s}`:r}createItemARIA(n){let r={};switch(n.item.type){case"separator":r.role="presentation";break;case"submenu":r["aria-haspopup"]="true",n.item.isEnabled||(r["aria-disabled"]="true");break;default:n.item.isEnabled||(r["aria-disabled"]="true"),n.item.isToggled?(r.role="menuitemcheckbox",r["aria-checked"]="true"):r.role="menuitem"}return r}formatLabel(n){let{label:r,mnemonic:s}=n.item;if(s<0||s>=r.length)return r;let o=r.slice(0,s),a=r.slice(s+1),l=r[s],c=ie.span({className:"lm-Menu-itemMnemonic"},l);return[o,c,a]}formatShortcut(n){let r=n.item.keyBinding;return r?qr.formatKeystroke(r.keys):null}}
3i.Renderer=e,i.defaultRenderer=new e})(Ot||(Ot={}));(function(i){i.TIMER_DELAY=300,i.SUBMENU_OVERLAP=3;let e=null,t=0;function n(){return t>0?(t--,e):h()}function r(){e=h(),t++}i.saveWindowData=r;function s(){let m=document.createElement("div"),g=document.createElement("ul");return g.className="lm-Menu-content",m.appendChild(g),g.setAttribute("role","menu"),m.tabIndex=0,m}i.createNode=s;function o(m){return m.type!=="separator"&&m.isEnabled&&m.isVisible}i.canActivate=o;function a(m,g){return new p(m.commands,g)}i.createItem=a;function l(m,g,b){for(let y=m;y;y=y.childMenu)if(re.hitTest(y.node,g,b))return!0;return!1}i.hitTestMenus=l;function c(m){let g=new Array(m.length);D.fill(g,!1);let b=0,y=m.length;for(;b<y;++b){let w=m[b];if(w.isVisible){if(w.type!=="separator")break;g[b]=!0}}let _=y-1;for(;_>=0;--_){let w=m[_];if(w.isVisible){if(w.type!=="separator")break;g[_]=!0}}let v=!1;for(;++b<_;){let w=m[b];w.isVisible&&(w.type!=="separator"?v=!1:v?g[b]=!0:v=!0)}return g}i.computeCollapsed=c;function h(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function d(m,g,b,y,_,v,w,M){let C=n(),S=C.pageXOffset,I=C.pageYOffset,L=C.clientWidth,P=C.clientHeight;A.sendMessage(m,x.Msg.UpdateRequest);let N=P-(_?b:0),V=m.node,te=V.style;te.opacity="0",te.maxHeight=`${N}px`,x.attach(m,w||document.body,M);let{width:Q,height:fe}=V.getBoundingClientRect();v==="right"&&(g-=Q),!y&&g+Q>S+L&&(g=S+L-Q),!_&&b+fe>I+P&&(b>I+P?b=I+P-fe:b=b-fe),te.transform=`translate(${Math.max(0,g)}px, ${Math.max(0,b)}px`,te.opacity="1"}i.openRootMenu=d;function u(m,g){let b=n(),y=b.pageXOffset,_=b.pageYOffset,v=b.clientWidth,w=b.clientHeight;A.sendMessage(m,x.Msg.UpdateRequest);let M=w,C=m.node,S=C.style;S.opacity="0",S.maxHeight=`${M}px`,x.attach(m,document.body);let{width:I,height:L}=C.getBoundingClientRect(),P=re.boxSizing(m.node),N=g.getBoundingClientRect(),V=N.right-i.SUBMENU_OVERLAP;V+I>y+v&&(V=N.left+i.SUBMENU_OVERLAP-I);let te=N.top-P.borderTop-P.paddingTop;te+L>_+w&&(te=N.bottom+P.borderBottom+P.paddingBottom-L),S.transform=`translate(${Math.max(0,V)}px, ${Math.max(0,te)}px`,S.opacity="1"}i.openSubmenu=u;function f(m,g,b){let y=-1,_=-1,v=!1,w=g.toUpperCase();for(let M=0,C=m.length;M<C;++M){let S=(M+b)%C,I=m[S];if(!o(I))continue;let L=I.label;if(L.length===0)continue;let P=I.mnemonic;if(P>=0&&P<L.length){L[P].toUpperCase()===w&&(y===-1?y=S:v=!0);continue}_===-1&&L[0].toUpperCase()===w&&(_=S)}return{index:y,multiple:v,auto:_}}i.findMnemonic=f;class p{constructor(g,b){this._commands=g,this.type=b.type||"command",this.command=b.command||"",this.args=b.args||Xt.JSONExt.emptyObject,this.submenu=b.submenu||null}get label(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""}get mnemonic(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1}get icon(){if(this.type==="command")return this._commands.icon(this.command,this.args);if(this.type==="submenu"&&this.submenu)return this.submenu.title.icon}get iconClass(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""}get iconLabel(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""}get caption(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""}get className(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""}get dataset(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}}get isEnabled(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}get isToggled(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1}get isVisible(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0}
3get keyBinding(){if(this.type==="command"){let{command:g,args:b}=this;return D.findLastValue(this._commands.keyBindings,y=>y.command===g&&Xt.JSONExt.deepEqual(y.args,b))||null}return null}}})(Re||(Re={}));(function(i){function e(o,a){let l=n(o.selector),c=o.rank!==void 0?o.rank:1/0;return{...o,selector:l,rank:c,id:a}}i.createItem=e;function t(o,a,l,c){let h=a.target;if(!h)return null;let d=a.currentTarget;if(!d||!d.contains(h)&&(h=document.elementFromPoint(a.clientX,a.clientY),!h||!d.contains(h)))return null;let u=[],f=o.slice();for(;h!==null;){let p=[];for(let m=0,g=f.length;m<g;++m){let b=f[m];b&&Di.matches(h,b.selector)&&(p.push(b),f[m]=null)}if(p.length!==0&&(l&&p.sort(c?s:r),u.push(...p)),h===d)break;h=h.parentElement}return l||u.sort(c?s:r),u}i.matchItems=t;function n(o){if(o.indexOf(",")!==-1)throw new Error(`Selector cannot contain commas: ${o}`);if(!Di.isValid(o))throw new Error(`Invalid selector: ${o}`);return o}function r(o,a){let l=o.rank,c=a.rank;return l!==c?l<c?-1:1:o.id-a.id}function s(o,a){let l=Di.calculateSpecificity(o.selector),c=Di.calculateSpecificity(a.selector);return l!==c?c-l:r(o,a)}})(Zf||(Zf={}));j_=["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End"],fn=class extends x{constructor(e={}){super({node:ct.createNode()}),this._currentIndex=-1,this._titles=[],this._titlesEditable=!1,this._previousTitle=null,this._dragData=null,this._addButtonEnabled=!1,this._tabMoved=new G(this),this._currentChanged=new G(this),this._addRequested=new G(this),this._tabCloseRequested=new G(this),this._tabDetachRequested=new G(this),this._tabActivateRequested=new G(this),this.addClass("lm-TabBar"),this.contentNode.setAttribute("role","tablist"),this.setFlag(x.Flag.DisallowLayout),this._document=e.document||document,this.tabsMovable=e.tabsMovable||!1,this.titlesEditable=e.titlesEditable||!1,this.allowDeselect=e.allowDeselect||!1,this.addButtonEnabled=e.addButtonEnabled||!1,this.insertBehavior=e.insertBehavior||"select-tab-if-needed",this.name=e.name||"",this.orientation=e.orientation||"horizontal",this.removeBehavior=e.removeBehavior||"select-tab-after",this.renderer=e.renderer||fn.defaultRenderer}dispose(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,super.dispose()}get currentChanged(){return this._currentChanged}get tabMoved(){return this._tabMoved}get tabActivateRequested(){return this._tabActivateRequested}get addRequested(){return this._addRequested}get tabCloseRequested(){return this._tabCloseRequested}get tabDetachRequested(){return this._tabDetachRequested}get document(){return this._document}get titlesEditable(){return this._titlesEditable}set titlesEditable(e){this._titlesEditable=e}get currentTitle(){return this._titles[this._currentIndex]||null}set currentTitle(e){this.currentIndex=e?this._titles.indexOf(e):-1}get currentIndex(){return this._currentIndex}set currentIndex(e){if((e<0||e>=this._titles.length)&&(e=-1),this._currentIndex===e)return;let t=this._currentIndex,n=this._titles[t]||null,r=e,s=this._titles[r]||null;this._currentIndex=r,this._previousTitle=n,this.update(),this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:r,currentTitle:s})}get name(){return this._name}set name(e){this._name=e,e?this.contentNode.setAttribute("aria-label",e):this.contentNode.removeAttribute("aria-label")}get orientation(){return this._orientation}set orientation(e){this._orientation!==e&&(this._releaseMouse(),this._orientation=e,this.dataset.orientation=e,this.contentNode.setAttribute("aria-orientation",e))}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled!==e&&(this._addButtonEnabled=e,e?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let n=ct.asTitle(t),r=this._titles.indexOf(n),s=Math.max(0,Math.min(e,this._titles.length));return r===-1?(D.insert(this._titles,s,n),n.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(s,n),n):(s===this._titles.length&&s--,r===s||(D.move(this._titles,r,s),this.update(),this._adjustCurrentForMove(r,s)),n)}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=D.removeAt(this._titles,e);t&&(t.changed.disconnect(this._onTitleChanged,this),t===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(e,t))}clearTabs(){if(this._titles.length===0)return;this._releaseMouse();for(let n of this._titles)n.changed.disconnect(this._onTitleChanged,this);let e=this.currentIndex,t=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),e!==-1&&this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,
3currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this),this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this.node.removeEventListener("keydown",this),this._releaseMouse()}onUpdateRequest(e){var t;let n=this._titles,r=this.renderer,s=this.currentTitle,o=new Array(n.length),a=(t=this._getCurrentTabindex())!==null&&t!==void 0?t:this._currentIndex>-1?this._currentIndex:0;for(let l=0,c=n.length;l<c;++l){let h=n[l],d=h===s,u=d?c:c-l-1,f=a===l?0:-1;o[l]=r.renderTab({title:h,current:d,zIndex:u,tabIndex:f})}nn.render(o,this.contentNode)}_getCurrentTabindex(){let e=null,t=this.contentNode.querySelector('li[tabindex="0"]');return t?e=[...this.contentNode.children].indexOf(t):this._addButtonEnabled&&this.addButtonNode.getAttribute("tabindex")==="0"&&(e=-1),e}_evtDblClick(e){if(!this.titlesEditable)return;let t=this.contentNode.children,n=D.findFirstIndex(t,o=>re.hitTest(o,e.clientX,e.clientY));if(n===-1)return;let r=this.titles[n],s=t[n].querySelector(".lm-TabBar-tabLabel");if(s&&s.contains(e.target)){let o=r.label||"",a=s.innerHTML;s.innerHTML="";let l=document.createElement("input");l.classList.add("lm-TabBar-tabInput"),l.value=o,s.appendChild(l);let c=()=>{l.removeEventListener("blur",c),s.innerHTML=a,this.node.addEventListener("keydown",this)};l.addEventListener("dblclick",h=>h.stopPropagation()),l.addEventListener("blur",c),l.addEventListener("keydown",h=>{h.key==="Enter"?(l.value!==""&&(r.label=r.caption=l.value),c()):h.key==="Escape"&&c()}),this.node.removeEventListener("keydown",this),l.select(),l.focus(),s.children.length>0&&s.children[0].focus()}}_evtKeyDownCapturing(e){e.eventPhase===Event.CAPTURING_PHASE&&(e.preventDefault(),e.stopPropagation(),e.key==="Escape"&&this._releaseMouse())}_evtKeyDown(e){var t,n,r;if(!(e.key==="Tab"||e.eventPhase===Event.CAPTURING_PHASE)){if(e.key==="Enter"||e.key==="Spacebar"||e.key===" "){let s=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(s))e.preventDefault(),e.stopPropagation(),this._addRequested.emit();else{let o=D.findFirstIndex(this.contentNode.children,a=>a.contains(s));o>=0&&(e.preventDefault(),e.stopPropagation(),this.currentIndex=o)}}else if(j_.includes(e.key)){let s=[...this.contentNode.children];if(this.addButtonEnabled&&s.push(this.addButtonNode),s.length<=1)return;e.preventDefault(),e.stopPropagation();let o=s.indexOf(document.activeElement);o===-1&&(o=this._currentIndex);let a;e.key==="ArrowRight"&&this._orientation==="horizontal"||e.key==="ArrowDown"&&this._orientation==="vertical"?a=(t=s[o+1])!==null&&t!==void 0?t:s[0]:e.key==="ArrowLeft"&&this._orientation==="horizontal"||e.key==="ArrowUp"&&this._orientation==="vertical"?a=(n=s[o-1])!==null&&n!==void 0?n:s[s.length-1]:e.key==="Home"?a=s[0]:e.key==="End"&&(a=s[s.length-1]),a&&((r=s[o])===null||r===void 0||r.setAttribute("tabindex","-1"),a?.setAttribute("tabindex","0"),a.focus())}}}_evtPointerDown(e){if(e.button!==0&&e.button!==1||this._dragData||e.target.classList.contains("lm-TabBar-tabInput"))return;let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target),n=this.contentNode.children,r=D.findFirstIndex(n,o=>re.hitTest(o,e.clientX,e.clientY));if(r===-1&&!t||(e.preventDefault(),e.stopPropagation(),this._dragData={tab:n[r],index:r,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("pointerup",this,!0),e.button===1||t))return;let s=n[r].querySelector(this.renderer.closeIconSelector);s&&s.contains(e.target)||(this.tabsMovable&&(this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,
3!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===r?this.currentIndex=-1:this.currentIndex=r,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}_evtPointerMove(e){let t=this._dragData;if(!t)return;e.preventDefault(),e.stopPropagation();let n=this.contentNode.children;if(!(!t.dragActive&&!ct.dragExceeded(t,e))){if(!t.dragActive){let r=t.tab.getBoundingClientRect();this._orientation==="horizontal"?(t.tabPos=t.tab.offsetLeft,t.tabSize=r.width,t.tabPressPos=t.pressX-r.left):(t.tabPos=t.tab.offsetTop,t.tabSize=r.height,t.tabPressPos=t.pressY-r.top),t.tabPressOffset={x:t.pressX-r.left,y:t.pressY-r.top},t.tabLayout=ct.snapTabLayout(n,this._orientation),t.contentRect=this.contentNode.getBoundingClientRect(),t.override=ge.overrideCursor("default"),t.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),t.dragActive=!0}if(!t.detachRequested&&ct.detachExceeded(t,e)){t.detachRequested=!0;let r=t.index,s=e.clientX,o=e.clientY,a=n[r],l=this._titles[r];if(this._tabDetachRequested.emit({index:r,title:l,tab:a,clientX:s,clientY:o,offset:t.tabPressOffset}),t.dragAborted)return}ct.layoutTabs(n,t,e,this._orientation)}}_evtPointerUp(e){if(e.button!==0&&e.button!==1)return;let t=this._dragData;if(!t)return;if(e.preventDefault(),e.stopPropagation(),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!t.dragActive){if(this._dragData=null,this.addButtonEnabled&&this.addButtonNode.contains(e.target)){this._addRequested.emit(void 0);return}let s=this.contentNode.children,o=D.findFirstIndex(s,c=>re.hitTest(c,e.clientX,e.clientY));if(o!==t.index)return;let a=this._titles[o];if(!a.closable)return;if(e.button===1){this._tabCloseRequested.emit({index:o,title:a});return}let l=s[o].querySelector(this.renderer.closeIconSelector);if(l&&l.contains(e.target)){this._tabCloseRequested.emit({index:o,title:a});return}return}if(e.button!==0)return;ct.finalizeTabPosition(t,this._orientation),t.tab.classList.remove("lm-mod-dragging");let n=ct.parseTransitionDuration(t.tab);setTimeout(()=>{if(t.dragAborted)return;this._dragData=null,ct.resetTabPositions(this.contentNode.children,this._orientation),t.override.dispose(),this.removeClass("lm-mod-dragging");let r=t.index,s=t.targetIndex;s===-1||r===s||(D.move(this._titles,r,s),this._adjustCurrentForMove(r,s),this._tabMoved.emit({fromIndex:r,toIndex:s,title:this._titles[s]}),A.sendMessage(this,x.Msg.UpdateRequest))},n)}_releaseMouse(){let e=this._dragData;e&&(this._dragData=null,this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),e.dragAborted=!0,e.dragActive&&(ct.resetTabPositions(this.contentNode.children,this._orientation),e.override.dispose(),e.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging")))}_adjustCurrentForInsert(e,t){let n=this.currentTitle,r=this._currentIndex,s=this.insertBehavior;if(s==="select-tab"||s==="select-tab-if-needed"&&r===-1){this._currentIndex=e,this._previousTitle=n,this._currentChanged.emit({previousIndex:r,previousTitle:n,currentIndex:e,currentTitle:t});return}r>=e&&this._currentIndex++}_adjustCurrentForMove(e,t){this._currentIndex===e?this._currentIndex=t:this._currentIndex<e&&this._currentIndex>=t?this._currentIndex++:this._currentIndex>e&&this._currentIndex<=t&&this._currentIndex--}_adjustCurrentForRemove(e,t){let n=this._currentIndex,r=this.removeBehavior;if(n!==e){n>e&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if(r==="select-tab-after"){this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(r==="select-tab-before"){this._currentIndex=Math.max(0,e-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(r==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(e,this._titles.length-1),this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,
3currentTitle:null})}_onTitleChanged(e){this.update()}};(function(i){class e{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++e._nInstance}renderTab(n){let r=n.title.caption,s=this.createTabKey(n),o=s,a=this.createTabStyle(n),l=this.createTabClass(n),c=this.createTabDataset(n),h=this.createTabARIA(n);return n.title.closable?ie.li({id:o,key:s,className:l,title:r,style:a,dataset:c,...h},this.renderIcon(n),this.renderLabel(n),this.renderCloseIcon(n)):ie.li({id:o,key:s,className:l,title:r,style:a,dataset:c,...h},this.renderIcon(n),this.renderLabel(n))}renderIcon(n){let{title:r}=n,s=this.createIconClass(n);return ie.div({className:s},r.icon,r.iconLabel)}renderLabel(n){return ie.div({className:"lm-TabBar-tabLabel"},n.title.label)}renderCloseIcon(n){return ie.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(n){let r=this._tabKeys.get(n.title);return r===void 0&&(r=`tab-key-${this._uuid}-${this._tabID++}`,this._tabKeys.set(n.title,r)),r}createTabStyle(n){return{zIndex:`${n.zIndex}`}}createTabClass(n){let r="lm-TabBar-tab";return n.title.className&&(r+=` ${n.title.className}`),n.title.closable&&(r+=" lm-mod-closable"),n.current&&(r+=" lm-mod-current"),r}createTabDataset(n){return n.title.dataset}createTabARIA(n){var r;return{role:"tab","aria-selected":n.current.toString(),tabindex:`${(r=n.tabIndex)!==null&&r!==void 0?r:"-1"}`}}createIconClass(n){let r="lm-TabBar-tabIcon",s=n.title.iconClass;return s?`${r} ${s}`:r}}e._nInstance=0,i.Renderer=e,i.defaultRenderer=new e,i.addButtonSelector=".lm-TabBar-addButton"})(fn||(fn={}));(function(i){i.DRAG_THRESHOLD=5,i.DETACH_THRESHOLD=20;function e(){let h=document.createElement("div"),d=document.createElement("ul");d.setAttribute("role","tablist"),d.className="lm-TabBar-content",h.appendChild(d);let u=document.createElement("div");return u.className="lm-TabBar-addButton lm-mod-hidden",u.setAttribute("tabindex","-1"),u.setAttribute("role","button"),h.appendChild(u),h}i.createNode=e;function t(h){return h instanceof lr?h:new lr(h)}i.asTitle=t;function n(h){let d=window.getComputedStyle(h);return 1e3*(parseFloat(d.transitionDuration)||0)}i.parseTransitionDuration=n;function r(h,d){let u=new Array(h.length);for(let f=0,p=h.length;f<p;++f){let m=h[f],g=window.getComputedStyle(m);d==="horizontal"?u[f]={pos:m.offsetLeft,size:m.offsetWidth,margin:parseFloat(g.marginLeft)||0}:u[f]={pos:m.offsetTop,size:m.offsetHeight,margin:parseFloat(g.marginTop)||0}}return u}i.snapTabLayout=r;function s(h,d){let u=Math.abs(d.clientX-h.pressX),f=Math.abs(d.clientY-h.pressY);return u>=i.DRAG_THRESHOLD||f>=i.DRAG_THRESHOLD}i.dragExceeded=s;function o(h,d){let u=h.contentRect;return d.clientX<u.left-i.DETACH_THRESHOLD||d.clientX>=u.right+i.DETACH_THRESHOLD||d.clientY<u.top-i.DETACH_THRESHOLD||d.clientY>=u.bottom+i.DETACH_THRESHOLD}i.detachExceeded=o;function a(h,d,u,f){let p,m,g,b;f==="horizontal"?(p=d.pressX,m=u.clientX-d.contentRect.left,g=u.clientX,b=d.contentRect.width):(p=d.pressY,m=u.clientY-d.contentRect.top,g=u.clientY,b=d.contentRect.height);let y=d.index,_=m-d.tabPressPos,v=_+d.tabSize;for(let w=0,M=h.length;w<M;++w){let C,S=d.tabLayout[w],I=S.pos+(S.size>>1);if(w<d.index&&_<I)C=`${d.tabSize+d.tabLayout[w+1].margin}px`,y=Math.min(y,w);else if(w>d.index&&v>I)C=`${-d.tabSize-S.margin}px`,y=Math.max(y,w);else if(w===d.index){let L=g-p,P=b-(d.tabPos+d.tabSize);C=`${Math.max(-d.tabPos,Math.min(L,P))}px`}else C="";f==="horizontal"?h[w].style.left=C:h[w].style.top=C}d.targetIndex=y}i.layoutTabs=a;function l(h,d){let u;d==="horizontal"?u=h.contentRect.width:u=h.contentRect.height;let f;if(h.targetIndex===h.index)f=0;else if(h.targetIndex>h.index){let g=h.tabLayout[h.targetIndex];f=g.pos+g.size-h.tabSize-h.tabPos}else f=h.tabLayout[h.targetIndex].pos-h.tabPos;let p=u-(h.tabPos+h.tabSize),m=Math.max(-h.tabPos,Math.min(f,p));d==="horizontal"?h.tab.style.left=`${m}px`:h.tab.style.top=`${m}px`}i.finalizeTabPosition=l;function c(h,d){for(let u of h)d==="horizontal"?u.style.left="":u.style.top=""}i.resetTabPositions=c})(ct||(ct={}));jl=class extends Rt{constructor(e){super(),this._spacing=4,this._dirty=!1,this._root=null,this._box=null,this._items=new Map,this.renderer=e.renderer,e.spacing!==void 0&&(this._spacing=hr.clampDimension(e.spacing)),this._document=e.document||document,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:x.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();
3this._items.forEach(t=>{t.dispose()}),this._box=null,this._root=null,this._items.clear();for(let t of e)t.dispose();super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode!==e){this._hiddenMode=e;for(let t of this.tabBars())if(t.titles.length>1)for(let n of t.titles)n.owner.hiddenMode=this._hiddenMode}}get spacing(){return this._spacing}set spacing(e){e=hr.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():Gn()}widgets(){return this._root?this._root.iterUserWidgets():Gn()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():Gn()}tabBars(){return this._root?this._root.iterTabBars():Gn()}handles(){return this._root?this._root.iterHandles():Gn()}moveHandle(e,t,n){let r=e.classList.contains("lm-mod-hidden");if(!this._root||r)return;let s=this._root.findSplitNode(e);if(!s)return;let o;s.node.orientation==="horizontal"?o=t-e.offsetLeft:o=n-e.offsetTop,o!==0&&(s.node.holdSizes(),Je.adjust(s.node.sizers,s.index,o),this.parent&&this.parent.update())}saveLayout(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}}restoreLayout(e){let t=new Set,n;e.main?n=ue.normalizeAreaConfig(e.main,t):n=null;let r=this.widgets(),s=this.tabBars(),o=this.handles();this._root=null;for(let a of r)t.has(a)||(a.parent=null);for(let a of s)a.dispose();for(let a of o)a.parentNode&&a.parentNode.removeChild(a);for(let a of t)a.parent=this.parent;n?this._root=ue.realizeAreaConfig(n,{createTabBar:a=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document):this._root=null,this.parent&&(t.forEach(a=>{this.attachWidget(a)}),this.parent.fit())}addWidget(e,t={}){let n=t.ref||null,r=t.mode||"tab-after",s=null;if(this._root&&n&&(s=this._root.findTabNode(n)),n&&!s)throw new Error("Reference widget is not in the layout.");switch(e.parent=this.parent,r){case"tab-after":this._insertTab(e,n,s,!0);break;case"tab-before":this._insertTab(e,n,s,!1);break;case"split-top":this._insertSplit(e,n,s,"vertical",!1);break;case"split-left":this._insertSplit(e,n,s,"horizontal",!1);break;case"split-right":this._insertSplit(e,n,s,"horizontal",!0);break;case"split-bottom":this._insertSplit(e,n,s,"vertical",!0);break;case"merge-top":this._insertSplit(e,n,s,"vertical",!1,!0);break;case"merge-left":this._insertSplit(e,n,s,"horizontal",!1,!0);break;case"merge-right":this._insertSplit(e,n,s,"horizontal",!0,!0);break;case"merge-bottom":this._insertSplit(e,n,s,"vertical",!0,!0);break}this.parent&&(this.attachWidget(e),this.parent.fit())}removeWidget(e){this._removeWidget(e),this.parent&&(this.detachWidget(e),this.parent.fit())}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=re.boxSizing(this.parent.node));let n=this.parent.node.getBoundingClientRect(),r=e-n.left-this._box.borderLeft,s=t-n.top-this._box.borderTop,o=this._root.hitTestTabNodes(r,s);if(!o)return null;let{tabBar:a,top:l,left:c,width:h,height:d}=o,u=this._box.borderLeft+this._box.borderRight,f=this._box.borderTop+this._box.borderBottom,p=n.width-u-(c+h),m=n.height-f-(l+d);return{tabBar:a,x:r,y:s,top:l,left:c,right:p,bottom:m,width:h,height:d}}init(){super.init();for(let e of this)this.attachWidget(e);for(let e of this.handles())this.parent.node.appendChild(e);this.parent.fit()}attachWidget(e){this.parent.node!==e.node.parentNode&&(this._items.set(e,new Rn(e)),this.parent.isAttached&&A.sendMessage(e,x.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&A.sendMessage(e,x.Msg.AfterAttach))}detachWidget(e){if(this.parent.node!==e.node.parentNode)return;this.parent.isAttached&&A.sendMessage(e,x.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&A.sendMessage(e,x.Msg.AfterDetach);let t=this._items.get(e);t&&(this._items.delete(e),t.dispose())}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_removeWidget(e){if(!this._root)return;let t=this._root.findTabNode(e);if(!t)return;
3if(ue.removeAria(e),t.tabBar.titles.length>1){if(t.tabBar.removeTab(e.title),this._hiddenMode===x.HiddenMode.Scale&&t.tabBar.titles.length==1){let u=t.tabBar.titles[0].owner;u.hiddenMode=x.HiddenMode.Display}return}if(t.tabBar.dispose(),this._root===t){this._root=null;return}this._root.holdAllSizes();let n=t.parent;t.parent=null;let r=D.removeFirstOf(n.children,t),s=D.removeAt(n.handles,r);if(D.removeAt(n.sizers,r),s.parentNode&&s.parentNode.removeChild(s),n.children.length>1){n.syncHandles();return}let o=n.parent;n.parent=null;let a=n.children[0],l=n.handles[0];if(n.children.length=0,n.handles.length=0,n.sizers.length=0,l.parentNode&&l.parentNode.removeChild(l),this._root===n){a.parent=null,this._root=a;return}let c=o,h=c.children.indexOf(n);if(a instanceof ue.TabLayoutNode){a.parent=c,c.children[h]=a;return}let d=D.removeAt(c.handles,h);D.removeAt(c.children,h),D.removeAt(c.sizers,h),d.parentNode&&d.parentNode.removeChild(d);for(let u=0,f=a.children.length;u<f;++u){let p=a.children[u],m=a.handles[u],g=a.sizers[u];D.insert(c.children,h+u,p),D.insert(c.handles,h+u,m),D.insert(c.sizers,h+u,g),p.parent=c}
3a.children.length=0,a.handles.length=0,a.sizers.length=0,a.parent=null,c.syncHandles()}_createTabNode(e){let t=new ue.TabLayoutNode(this._createTabBar());return t.tabBar.addTab(e.title),ue.addAria(e,t.tabBar),t}_insertTab(e,t,n,r){if(e===t)return;if(!this._root){let o=new ue.TabLayoutNode(this._createTabBar());o.tabBar.addTab(e.title),this._root=o,ue.addAria(e,o.tabBar);return}n||(n=this._root.findFirstTabNode()),n.tabBar.titles.indexOf(e.title)===-1&&(this._removeWidget(e),e.hide());let s;if(t?s=n.tabBar.titles.indexOf(t.title):s=n.tabBar.currentIndex,this._hiddenMode===x.HiddenMode.Scale)if(n.tabBar.titles.length===0)e.hiddenMode=x.HiddenMode.Display;else if(n.tabBar.titles.length==1){let o=n.tabBar.titles[0].owner;o.hiddenMode=x.HiddenMode.Scale}else e.hiddenMode=x.HiddenMode.Scale;else e.hiddenMode=this._hiddenMode;n.tabBar.insertTab(s+(r?1:0),e.title),ue.addAria(e,n.tabBar)}_insertSplit(e,t,n,r,s,o=!1){if(e===t&&n&&n.tabBar.titles.length===1)return;if(this._removeWidget(e),!this._root){this._root=this._createTabNode(e);return}if(!n||!n.parent){let u=this._splitRoot(r),f=s?u.children.length:0;u.normalizeSizes();let p=ue.createSizer(n?1:ue.GOLDEN_RATIO),m=this._createTabNode(e);D.insert(u.children,f,m),D.insert(u.sizers,f,p),D.insert(u.handles,f,this._createHandle()),m.parent=u,u.normalizeSizes(),u.syncHandles();return}let a=n.parent;if(a.orientation===r){let u=a.children.indexOf(n);if(o){let g=u+(s?1:-1),b=a.children[g];if(b instanceof ue.TabLayoutNode){this._insertTab(e,null,b,!0),++b.tabBar.currentIndex;return}}a.normalizeSizes();let f=a.sizers[u].sizeHint/=2,p=u+(s?1:0),m=this._createTabNode(e);D.insert(a.children,p,m),D.insert(a.sizers,p,ue.createSizer(f)),D.insert(a.handles,p,this._createHandle()),m.parent=a,a.syncHandles();return}let l=D.removeFirstOf(a.children,n),c=new ue.SplitLayoutNode(r);c.normalized=!0,c.children.push(n),c.sizers.push(ue.createSizer(.5)),c.handles.push(this._createHandle()),n.parent=c;let h=s?1:0,d=this._createTabNode(e);D.insert(c.children,h,d),D.insert(c.sizers,h,ue.createSizer(.5)),D.insert(c.handles,h,this._createHandle()),d.parent=c,c.syncHandles(),D.insert(a.children,l,c),c.parent=a}_splitRoot(e){let t=this._root;if(t instanceof ue.SplitLayoutNode&&t.orientation===e)return t;let n=this._root=new ue.SplitLayoutNode(e);return t&&(n.children.push(t),n.sizers.push(ue.createSizer(0)),n.handles.push(this._createHandle()),t.parent=n),n}_fit(){let e=0,t=0;if(this._root){let s=this._root.fit(this._spacing,this._items);e=s.minWidth,t=s.minHeight}let n=this._box=re.boxSizing(this.parent.node);e+=n.horizontalSum,t+=n.verticalSum;let r=this.parent.node.style;r.minWidth=`${e}px`,r.minHeight=`${t}px`,this._dirty=!0,this.parent.parent&&A.sendMessage(this.parent.parent,x.Msg.FitRequest),this._dirty&&A.sendMessage(this.parent,x.Msg.UpdateRequest)}_update(e,t){if(this._dirty=!1,!this._root)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=re.boxSizing(this.parent.node));let n=this._box.paddingTop,r=this._box.paddingLeft,s=e-this._box.horizontalSum,o=t-this._box.verticalSum;this._root.update(n,r,s,o,this._spacing,this._items)}_createTabBar(){let e=this.renderer.createTabBar(this._document);return e.orientation="horizontal",this.parent&&this.attachWidget(e),e}_createHandle(){let e=this.renderer.createHandle(),t=e.style;return t.position="absolute",t.contain="strict",t.top="0",t.left="0",t.width="0",t.height="0",this.parent&&this.parent.node.appendChild(e),e}};(function(i){i.GOLDEN_RATIO=.618;function e(u){let f=new Lt;return f.sizeHint=u,f.size=u,f}i.createSizer=e;function t(u,f){let p;return u.type==="tab-area"?p=l(u,f):p=c(u,f),p}i.normalizeAreaConfig=t;function n(u,f,p){let m;return u.type==="tab-area"?m=h(u,f,p):m=d(u,f,p),m}i.realizeAreaConfig=n;class r{constructor(f){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;let p=new Lt,m=new Lt;p.stretch=0,m.stretch=1,this.tabBar=f,this.sizers=[p,m]}get top(){return this._top}get left(){return this._left}get width(){return this._width}get height(){return this._height}*iterAllWidgets(){yield this.tabBar,yield*this.iterUserWidgets()}
3*iterUserWidgets(){for(let f of this.tabBar.titles)yield f.owner}*iterSelectedWidgets(){let f=this.tabBar.currentTitle;f&&(yield f.owner)}*iterTabBars(){yield this.tabBar}*iterHandles(){}findTabNode(f){return this.tabBar.titles.indexOf(f.title)!==-1?this:null}findSplitNode(f){return null}findFirstTabNode(){return this}hitTestTabNodes(f,p){return f<this._left||f>=this._left+this._width||p<this._top||p>=this._top+this._height?null:this}createConfig(){let f=this.tabBar.titles.map(m=>m.owner),p=this.tabBar.currentIndex;return{type:"tab-area",widgets:f,currentIndex:p}}holdAllSizes(){}fit(f,p){let m=0,g=0,b=1/0,y=1/0,_=p.get(this.tabBar),v=this.tabBar.currentTitle,w=v?p.get(v.owner):void 0,[M,C]=this.sizers;return _&&_.fit(),w&&w.fit(),_&&!_.isHidden?(m=Math.max(m,_.minWidth),g+=_.minHeight,M.minSize=_.minHeight,M.maxSize=_.maxHeight):(M.minSize=0,M.maxSize=0),w&&!w.isHidden?(m=Math.max(m,w.minWidth),g+=w.minHeight,C.minSize=w.minHeight,C.maxSize=1/0):(C.minSize=0,C.maxSize=1/0),{minWidth:m,minHeight:g,maxWidth:b,maxHeight:y}}update(f,p,m,g,b,y){this._top=p,this._left=f,this._width=m,this._height=g;let _=y.get(this.tabBar),v=this.tabBar.currentTitle,w=v?y.get(v.owner):void 0;if(Je.calc(this.sizers,g),_&&!_.isHidden){let M=this.sizers[0].size;_.update(f,p,m,M),p+=M}if(w&&!w.isHidden){let M=this.sizers[1].size;w.update(f,p,m,M)}}}i.TabLayoutNode=r;class s{constructor(f){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=f}*iterAllWidgets(){for(let f of this.children)yield*f.iterAllWidgets()}*iterUserWidgets(){for(let f of this.children)yield*f.iterUserWidgets()}*iterSelectedWidgets(){for(let f of this.children)yield*f.iterSelectedWidgets()}*iterTabBars(){for(let f of this.children)yield*f.iterTabBars()}*iterHandles(){yield*this.handles;for(let f of this.children)yield*f.iterHandles()}findTabNode(f){for(let p=0,m=this.children.length;p<m;++p){let g=this.children[p].findTabNode(f);if(g)return g}return null}findSplitNode(f){let p=this.handles.indexOf(f);
3if(p!==-1)return{index:p,node:this};for(let m=0,g=this.children.length;m<g;++m){let b=this.children[m].findSplitNode(f);if(b)return b}return null}findFirstTabNode(){return this.children.length===0?null:this.children[0].findFirstTabNode()}hitTestTabNodes(f,p){for(let m=0,g=this.children.length;m<g;++m){let b=this.children[m].hitTestTabNodes(f,p);if(b)return b}return null}createConfig(){let f=this.orientation,p=this.createNormalizedSizes(),m=this.children.map(g=>g.createConfig());return{type:"split-area",orientation:f,children:m,sizes:p}}syncHandles(){this.handles.forEach((f,p)=>{f.setAttribute("data-orientation",this.orientation),p===this.handles.length-1?f.classList.add("lm-mod-hidden"):f.classList.remove("lm-mod-hidden")})}holdSizes(){for(let f of this.sizers)f.sizeHint=f.size}holdAllSizes(){for(let f of this.children)f.holdAllSizes();this.holdSizes()}normalizeSizes(){let f=this.sizers.length;if(f===0)return;this.holdSizes();let p=this.sizers.reduce((m,g)=>m+g.sizeHint,0);if(p===0)for(let m of this.sizers)m.size=m.sizeHint=1/f;else for(let m of this.sizers)m.size=m.sizeHint/=p;this.normalized=!0}createNormalizedSizes(){let f=this.sizers.length;if(f===0)return[];let p=this.sizers.map(g=>g.size),m=p.reduce((g,b)=>g+b,0);if(m===0)for(let g=p.length-1;g>-1;g--)p[g]=1/f;else for(let g=p.length-1;g>-1;g--)p[g]/=m;return p}fit(f,p){let m=this.orientation==="horizontal",g=Math.max(0,this.children.length-1)*f,b=m?g:0,y=m?0:g,_=1/0,v=1/0;for(let w=0,M=this.children.length;w<M;++w){let C=this.children[w].fit(f,p);m?(y=Math.max(y,C.minHeight),b+=C.minWidth,this.sizers[w].minSize=C.minWidth):(b=Math.max(b,C.minWidth),y+=C.minHeight,this.sizers[w].minSize=C.minHeight)}return{minWidth:b,minHeight:y,maxWidth:_,maxHeight:v}}update(f,p,m,g,b,y){let _=this.orientation==="horizontal",v=Math.max(0,this.children.length-1)*b,w=Math.max(0,(_?m:g)-v);if(this.normalized){for(let M of this.sizers)M.sizeHint*=w;this.normalized=!1}Je.calc(this.sizers,w);for(let M=0,C=this.children.length;M<C;++M){let S=this.children[M],I=this.sizers[M].size,L=this.handles[M].style;_?(S.update(f,p,I,g,b,y),f+=I,L.top=`${p}px`,L.left=`${f}px`,L.width=`${b}px`,L.height=`${g}px`,f+=b):(S.update(f,p,m,I,b,y),p+=I,L.top=`${p}px`,L.left=`${f}px`,L.width=`${m}px`,L.height=`${b}px`,p+=b)}}}i.SplitLayoutNode=s;function o(u,f){u.node.setAttribute("role","tabpanel");let p=f.renderer;if(p instanceof fn.Renderer){let m=p.createTabKey({title:u.title,current:!1,zIndex:0});u.node.setAttribute("aria-labelledby",m)}}i.addAria=o;function a(u){u.node.removeAttribute("role"),u.node.removeAttribute("aria-labelledby")}i.removeAria=a;function l(u,f){if(u.widgets.length===0)return null;let p=[];for(let g of u.widgets)f.has(g)||(f.add(g),p.push(g));if(p.length===0)return null;let m=u.currentIndex;return m!==-1&&(m<0||m>=p.length)&&(m=0),{type:"tab-area",widgets:p,currentIndex:m}}function c(u,f){let p=u.orientation,m=[],g=[];for(let b=0,y=u.children.length;b<y;++b){let _=t(u.children[b],f);_&&(_.type==="tab-area"||_.orientation!==p?(m.push(_),g.push(Math.abs(u.sizes[b]||0))):(m.push(..._.children),g.push(..._.sizes)))}return m.length===0?null:m.length===1?m[0]:{type:"split-area",orientation:p,children:m,sizes:g}}function h(u,f,p){let m=f.createTabBar(p);for(let g of u.widgets)g.hide(),m.addTab(g.title),i.addAria(g,m);return m.currentIndex=u.currentIndex,new r(m)}function d(u,f,p){let m=new s(u.orientation);return u.children.forEach((g,b)=>{let y=n(g,f,p),_=e(u.sizes[b]),v=f.createHandle();m.children.push(y),m.handles.push(v),m.sizers.push(_),y.parent=m}),m.syncHandles(),m.normalizeSizes(),m}})(ue||(ue={}));zn=class extends x{constructor(e={}){super(),this._drag=null,this._tabsMovable=!0,this._tabsConstrained=!1,this._addButtonEnabled=!1,this._pressData=null,this._layoutModified=new G(this),this._addRequested=new G(this),this.addClass("lm-DockPanel"),this._document=e.document||document,this._mode=e.mode||"multiple-document",this._renderer=e.renderer||zn.defaultRenderer,this._edges=e.edges||he.DEFAULT_EDGES,e.tabsMovable!==void 0&&(this._tabsMovable=e.tabsMovable),e.tabsConstrained!==void 0&&(this._tabsConstrained=e.tabsConstrained),e.addButtonEnabled!==void 0&&(this._addButtonEnabled=e.addButtonEnabled),this.dataset.mode=this._mode;let t={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new jl({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode}),this.overlay=e.overlay||new zn.Overlay,this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e)return;this._mode=e,this.dataset.mode=e;let t=this.layout;switch(e){case"multiple-document":for(let n of t.tabBars())n.show();break;case"single-document":t.restoreLayout(he.createSingleDocumentConfig(this));break;default:throw"unreachable"}A.postMessage(this,he.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(let t of this.tabBars())t.tabsMovable=e}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(let t of this.tabBars())t.addButtonEnabled=e}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=oa(this.tabBars(),n=>n.titles.indexOf(e.title)!==-1);if(!t)throw new Error("Widget is not contained in the dock panel.");t.currentTitle=e.title}activateWidget(e){this.selectWidget(e),e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document",this.layout.restoreLayout(e),(Ii.IS_EDGE||Ii.IS_IE)&&A.flush(),A.postMessage(this,he.LayoutModified)}addWidget(e,t={}){this._mode==="single-document"?this.layout.addWidget(e):this.layout.addWidget(e,t),A.postMessage(this,he.LayoutModified)}processMessage(e){e.type==="layout-modified"?this._layoutModified.emit(void 0):super.processMessage(e)}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()}onChildAdded(e){he.isGeneratedTabBarProperty.get(e.child)||e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){he.isGeneratedTabBarProperty.get(e.child)||(e.child.removeClass("lm-DockPanel-widget"),A.postMessage(this,he.LayoutModified))}_evtDragEnter(e){e.mimeData.hasData("application/vnd.lumino.widget-factory")&&(e.preventDefault(),e.stopPropagation())}_evtDragLeave(e){e.preventDefault(),!(this._tabsConstrained&&e.source!==this)&&(e.stopPropagation(),this.overlay.hide(1))}_evtDragOver(e){e.preventDefault(),this._tabsConstrained&&e.source!==this||this._showOverlay(e.clientX,e.clientY)==="invalid"?e.dropAction="none":(e.stopPropagation(),e.dropAction=e.proposedAction)}_evtDrop(e){if(e.preventDefault(),this.overlay.hide(0),e.proposedAction==="none"){e.dropAction="none";return}let{clientX:t,clientY:n}=e,{zone:r,target:s}=he.findDropTarget(this,t,n,this._edges);if(this._tabsConstrained&&e.source!==this||r==="invalid"){e.dropAction="none";return}let a=e.mimeData.getData("application/vnd.lumino.widget-factory");if(typeof a!="function"){e.dropAction="none";return}let l=a();if(!(l instanceof x)){e.dropAction="none";return}if(l.contains(this)){e.dropAction="none";return}let c=s?he.getDropRef(s.tabBar):null;switch(r){case"root-all":this.addWidget(l);break;case"root-top":this.addWidget(l,{mode:"split-top"});break;case"root-left":this.addWidget(l,{mode:"split-left"});break;case"root-right":this.addWidget(l,{mode:"split-right"});break;case"root-bottom":this.addWidget(l,{mode:"split-bottom"});break;case"widget-all":this.addWidget(l,{mode:"tab-after",ref:c});break;case"widget-top":this.addWidget(l,{mode:"split-top",ref:c});break;case"widget-left":this.addWidget(l,{mode:"split-left",ref:c});break;case"widget-right":this.addWidget(l,{mode:"split-right",ref:c});break;case"widget-bottom":this.addWidget(l,{mode:"split-bottom",ref:c});break;case"widget-tab":this.addWidget(l,{mode:"tab-after",ref:c});break;default:throw"unreachable"}e.dropAction=e.proposedAction,e.stopPropagation(),this.activateWidget(l)}
3_evtKeyDown(e){e.preventDefault(),e.stopPropagation(),e.keyCode===27&&(this._releaseMouse(),A.postMessage(this,he.LayoutModified))}_evtPointerDown(e){if(e.button!==0)return;let t=this.layout,n=e.target,r=oa(t.handles(),h=>h.contains(n));if(!r)return;e.preventDefault(),e.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);let s=r.getBoundingClientRect(),o=e.clientX-s.left,a=e.clientY-s.top,l=window.getComputedStyle(r),c=ge.overrideCursor(l.cursor,this._document);this._pressData={handle:r,deltaX:o,deltaY:a,override:c}}_evtPointerMove(e){if(!this._pressData)return;e.preventDefault(),e.stopPropagation();let t=this.node.getBoundingClientRect(),n=e.clientX-t.left-this._pressData.deltaX,r=e.clientY-t.top-this._pressData.deltaY;this.layout.moveHandle(this._pressData.handle,n,r)}_evtPointerUp(e){e.button===0&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse(),A.postMessage(this,he.LayoutModified))}_releaseMouse(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))}_showOverlay(e,t){let{zone:n,target:r}=he.findDropTarget(this,e,t,this._edges);if(n==="invalid")return this.overlay.hide(100),n;let s,o,a,l,c=re.boxSizing(this.node),h=this.node.getBoundingClientRect();switch(n){case"root-all":s=c.paddingTop,o=c.paddingLeft,a=c.paddingRight,l=c.paddingBottom;break;case"root-top":s=c.paddingTop,o=c.paddingLeft,a=c.paddingRight,l=h.height*he.GOLDEN_RATIO;break;case"root-left":s=c.paddingTop,o=c.paddingLeft,a=h.width*he.GOLDEN_RATIO,l=c.paddingBottom;break;case"root-right":s=c.paddingTop,o=h.width*he.GOLDEN_RATIO,a=c.paddingRight,l=c.paddingBottom;break;case"root-bottom":s=h.height*he.GOLDEN_RATIO,o=c.paddingLeft,a=c.paddingRight,l=c.paddingBottom;break;case"widget-all":s=r.top,o=r.left,a=r.right,l=r.bottom;break;case"widget-top":s=r.top,o=r.left,a=r.right,l=r.bottom+r.height/2;break;case"widget-left":s=r.top,o=r.left,a=r.right+r.width/2,l=r.bottom;break;case"widget-right":s=r.top,o=r.left+r.width/2,a=r.right,l=r.bottom;break;case"widget-bottom":s=r.top+r.height/2,o=r.left,a=r.right,l=r.bottom;break;case"widget-tab":{let d=r.tabBar.node.getBoundingClientRect().height;s=r.top,o=r.left,a=r.right,l=r.bottom+r.height-d;break}default:throw"unreachable"}return this.overlay.show({top:s,left:o,right:a,bottom:l}),n}_createTabBar(){let e=this._renderer.createTabBar(this._document);return he.isGeneratedTabBarProperty.set(e,!0),this._mode==="single-document"&&e.hide(),e.tabsMovable=this._tabsMovable,e.allowDeselect=!1,e.addButtonEnabled=this._addButtonEnabled,e.removeBehavior="select-previous-tab",e.insertBehavior="select-tab-if-needed",e.tabMoved.connect(this._onTabMoved,this),e.currentChanged.connect(this._onCurrentChanged,this),e.tabCloseRequested.connect(this._onTabCloseRequested,this),e.tabDetachRequested.connect(this._onTabDetachRequested,this),e.tabActivateRequested.connect(this._onTabActivateRequested,this),e.addRequested.connect(this._onTabAddRequested,this),e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){A.postMessage(this,he.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:n,currentTitle:r}=t;n&&n.owner.hide(),r&&r.owner.show(),(Ii.IS_EDGE||Ii.IS_IE)&&A.flush(),A.postMessage(this,he.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag)return;e.releaseMouse();let{title:n,tab:r,clientX:s,clientY:o,offset:a}=t,l=new Xt.MimeData,c=()=>n.owner;l.setData("application/vnd.lumino.widget-factory",c);let h=r.cloneNode(!0);a&&(h.style.top=`-${a.y}px`,h.style.left=`-${a.x}px`),this._drag=new ge({document:this._document,mimeData:l,dragImage:h,proposedAction:"move",supportedActions:"move",source:this}),r.classList.add("lm-mod-hidden");let d=()=>{this._drag=null,r.classList.remove("lm-mod-hidden")};this._drag.start(s,o).then(d)}};(function(i){class e{constructor(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.style.position="absolute",this.node.style.contain="strict"}show(r){let s=this.node.style;s.top=`${r.top}
3px`,s.left=`${r.left}px`,s.right=`${r.right}px`,s.bottom=`${r.bottom}px`,clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"))}hide(r){if(!this._hidden){if(r<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(()=>{this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden")},r))}}}i.Overlay=e;class t{createTabBar(r){let s=new fn({document:r});return s.addClass("lm-DockPanel-tabBar"),s}createHandle(){let r=document.createElement("div");return r.className="lm-DockPanel-handle",r}}i.Renderer=t,i.defaultRenderer=new t})(zn||(zn={}));(function(i){i.GOLDEN_RATIO=.618,i.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},i.LayoutModified=new un("layout-modified"),i.isGeneratedTabBarProperty=new ft({name:"isGeneratedTabBar",create:()=>!1});function e(r){if(r.isEmpty)return{main:null};let s=Array.from(r.widgets()),o=r.selectedWidgets().next().value,a=o?s.indexOf(o):-1;return{main:{type:"tab-area",widgets:s,currentIndex:a}}}i.createSingleDocumentConfig=e;function t(r,s,o,a){if(!re.hitTest(r.node,s,o))return{zone:"invalid",target:null};let l=r.layout;if(l.isEmpty)return{zone:"root-all",target:null};if(r.mode==="multiple-document"){let _=r.node.getBoundingClientRect(),v=s-_.left+1,w=o-_.top+1,M=_.right-s,C=_.bottom-o;switch(Math.min(w,M,C,v)){case w:if(w<a.top)return{zone:"root-top",target:null};break;case M:if(M<a.right)return{zone:"root-right",target:null};break;case C:if(C<a.bottom)return{zone:"root-bottom",target:null};break;case v:if(v<a.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}let c=l.hitTestTabAreas(s,o);if(!c)return{zone:"invalid",target:null};if(r.mode==="single-document")return{zone:"widget-all",target:c};let h=c.x-c.left+1,d=c.y-c.top+1,u=c.left+c.width-c.x,f=c.top+c.height-c.y,p=c.tabBar.node.getBoundingClientRect().height;if(d<p)return{zone:"widget-tab",target:c};let m=Math.round(c.width/3),g=Math.round(c.height/3);if(h>m&&u>m&&d>g&&f>g)return{zone:"widget-all",target:c};h/=m,d/=g,u/=m,f/=g;let b=Math.min(h,d,u,f),y;switch(b){case h:y="widget-left";break;case d:y="widget-top";break;case u:y="widget-right";break;case f:y="widget-bottom";break;default:throw"unreachable"}return{zone:y,target:c}}i.findDropTarget=t;function n(r){return r.titles.length===0?null:r.currentTitle?r.currentTitle.owner:r.titles[r.titles.length-1].owner}i.getDropRef=n})(he||(he={}));Yt=class extends Rt{constructor(e={}){super(e),this._dirty=!1,this._rowSpacing=4,this._columnSpacing=4,this._items=[],this._rowStarts=[],this._columnStarts=[],this._rowSizers=[new Lt],this._columnSizers=[new Lt],this._box=null,e.rowCount!==void 0&&ye.reallocSizers(this._rowSizers,e.rowCount),e.columnCount!==void 0&&ye.reallocSizers(this._columnSizers,e.columnCount),e.rowSpacing!==void 0&&(this._rowSpacing=ye.clampValue(e.rowSpacing)),e.columnSpacing!==void 0&&(this._columnSpacing=ye.clampValue(e.columnSpacing))}dispose(){for(let e of this._items){let t=e.widget;e.dispose(),t.dispose()}this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){e!==this.rowCount&&(ye.reallocSizers(this._rowSizers,e),this.parent&&this.parent.fit())}get columnCount(){return this._columnSizers.length}set columnCount(e){e!==this.columnCount&&(ye.reallocSizers(this._columnSizers,e),this.parent&&this.parent.fit())}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=ye.clampValue(e),this._rowSpacing!==e&&(this._rowSpacing=e,this.parent&&this.parent.fit())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=ye.clampValue(e),this._columnSpacing!==e&&(this._columnSpacing=e,this.parent&&this.parent.fit())}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let n=this._rowSizers[e];n&&(t=ye.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update()))}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let n=this._columnSizers[e];n&&(t=ye.clampValue(t),n.stretch!==t&&(n.stretch=t,this.parent&&this.parent.update(
3)))}*[Symbol.iterator](){for(let e of this._items)yield e.widget}addWidget(e){D.findFirstIndex(this._items,n=>n.widget===e)===-1&&(this._items.push(new Rn(e)),this.parent&&this.attachWidget(e))}removeWidget(e){let t=D.findFirstIndex(this._items,r=>r.widget===e);if(t===-1)return;let n=D.removeAt(this._items,t);this.parent&&this.detachWidget(e),n.dispose()}init(){super.init();for(let e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&A.sendMessage(e,x.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&A.sendMessage(e,x.Msg.AfterAttach),this.parent.fit()}detachWidget(e){this.parent.isAttached&&A.sendMessage(e,x.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&A.sendMessage(e,x.Msg.AfterDetach),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){for(let l=0,c=this.rowCount;l<c;++l)this._rowSizers[l].minSize=0;for(let l=0,c=this.columnCount;l<c;++l)this._columnSizers[l].minSize=0;let e=this._items.filter(l=>!l.isHidden);for(let l=0,c=e.length;l<c;++l)e[l].fit();let t=this.rowCount-1,n=this.columnCount-1;e.sort(ye.rowSpanCmp);for(let l=0,c=e.length;l<c;++l){let h=e[l],d=Yt.getCellConfig(h.widget),u=Math.min(d.row,t),f=Math.min(d.row+d.rowSpan-1,t);ye.distributeMin(this._rowSizers,u,f,h.minHeight)}e.sort(ye.columnSpanCmp);for(let l=0,c=e.length;l<c;++l){let h=e[l],d=Yt.getCellConfig(h.widget),u=Math.min(d.column,n),f=Math.min(d.column+d.columnSpan-1,n);ye.distributeMin(this._columnSizers,u,f,h.minWidth)}if(this.fitPolicy==="set-no-constraint"){A.sendMessage(this.parent,x.Msg.UpdateRequest);return}let r=t*this._rowSpacing,s=n*this._columnSpacing;for(let l=0,c=this.rowCount;l<c;++l)r+=this._rowSizers[l].minSize;for(let l=0,c=this.columnCount;l<c;++l)s+=this._columnSizers[l].minSize;let o=this._box=re.boxSizing(this.parent.node);s+=o.horizontalSum,r+=o.verticalSum;let a=this.parent.node.style;a.minWidth=`${s}px`,a.minHeight=`${r}px`,this._dirty=!0,this.parent.parent&&A.sendMessage(this.parent.parent,x.Msg.FitRequest),this._dirty&&A.sendMessage(this.parent,x.Msg.UpdateRequest)}_update(e,t){this._dirty=!1,e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=re.boxSizing(this.parent.node));let n=this._box.paddingTop,r=this._box.paddingLeft,s=e-this._box.horizontalSum,o=t-this._box.verticalSum,a=this.rowCount-1,l=this.columnCount-1,c=a*this._rowSpacing,h=l*this._columnSpacing;Je.calc(this._rowSizers,Math.max(0,o-c)),Je.calc(this._columnSizers,Math.max(0,s-h));for(let d=0,u=n,f=this.rowCount;d<f;++d)this._rowStarts[d]=u,u+=this._rowSizers[d].size+this._rowSpacing;for(let d=0,u=r,f=this.columnCount;d<f;++d)this._columnStarts[d]=u,u+=this._columnSizers[d].size+this._columnSpacing;for(let d=0,u=this._items.length;d<u;++d){let f=this._items[d];if(f.isHidden)continue;let p=Yt.getCellConfig(f.widget),m=Math.min(p.row,a),g=Math.min(p.column,l),b=Math.min(p.row+p.rowSpan-1,a),y=Math.min(p.column+p.columnSpan-1,l),_=this._columnStarts[g],v=this._rowStarts[m],w=this._columnStarts[y]+this._columnSizers[y].size-_,M=this._rowStarts[b]+this._rowSizers[b].size-v;f.update(_,v,w,M)}}};(function(i){function e(n){return ye.cellConfigProperty.get(n)}i.getCellConfig=e;function t(n,r){ye.cellConfigProperty.set(n,ye.normalizeConfig(r))}i.setCellConfig=t})(Yt||(Yt={}));(function(i){i.cellConfigProperty=new ft({name:"cellConfig",create:()=>({row:0,column:0,rowSpan:1,columnSpan:1}),changed:a});function e(l){let c=Math.max(0,Math.floor(l.row||0)),h=Math.max(0,Math.floor(l.column||0)),d=Math.max(1,Math.floor(l.rowSpan||0)),u=Math.max(1,Math.floor(l.columnSpan||0));return{row:c,column:h,rowSpan:d,columnSpan:u}}i.normalizeConfig=e;function t(l){return Math.max(0,Math.floor(l))}i.clampValue=t;function n(l,c){let h=i.cellConfigProperty.get(l.widget),d=i.cellConfigProperty.get(c.widget);return h.rowSpan-d.rowSpan}i.rowSpanCmp=n;function r(l,c){let h=i.cellConfigProperty.get(l.widget),d=i.cellConfigProperty.get(c.widget);return h.columnSpan-d.columnSpan}i.columnSpanCmp=r;function s(l,c){for(c=Math.max(1,Math.floor(c));l.length<c;)l.push(new Lt);l.length>c&&(l.length=c)}i.reallocSizers=s;function o(l,c,h,d){if(h<c)return;if(c===h){let p=l[c];p.minSize=Math.max(p.minSize,d);return}let u=0;for(let p=c;p<=h;++p)u+=l[p].minSize;if(u>=d)return;let f=(d-u)/(h-c+1);for(let p=c;p<=h;++p)l[p].minSize+=f}i.distributeMin=o;function a(l){l.parent&&l.parent.layout instanceof Yt&&l.parent.fit()}})(ye||(ye={}));bi=class extends x{constructor(e={}){super({node:Rs.createNode()}),this._activeIndex=-1,this._tabFocusIndex=0,this._menus=[],this._childMenu=null,this._overflowMenu=null,this._menuItemSizes=[],this._overflowIndex=-1,this.addClass("lm-MenuBar"),this.setFlag(x.Flag.DisallowLayout),this.renderer=e.renderer||bi.defaultRenderer,this._forceItemsPosition=e.forceItemsPosition||{forceX:!0,forceY:!0},this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:!0}}dispose(){this._closeChildMenu(),this._menus.length=0,super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){(e<0||e>=this._menus.length)&&(e=-1),e>-1&&this._menus[e].items.length===0&&(e=-1),this._activeIndex!==e&&(this._activeIndex=e,this.update())}get menus(){return this._menus}openActiveMenu(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))}addMenu(e,t=!0){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,n=!0){this._closeChildMenu();let r=this._menus.indexOf(t),s=Math.max(0,Math.min(e,this._menus.length));if(r===-1){D.insert(this._menus,s,t),t.addClass("lm-MenuBar-menu"),t.aboutToClose.connect(this._onMenuAboutToClose,this),t.menuRequested.connect(this._onMenuMenuRequested,this),t.title.changed.connect(this._onTitleChanged,this),n&&this.update();return}
3s===this._menus.length&&s--,r!==s&&(D.move(this._menus,r,s),n&&this.update())}removeMenu(e,t=!0){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=!0){this._closeChildMenu();let n=D.removeAt(this._menus,e);n&&(n.aboutToClose.disconnect(this._onMenuAboutToClose,this),n.menuRequested.disconnect(this._onMenuMenuRequested,this),n.title.changed.disconnect(this._onTitleChanged,this),n.removeClass("lm-MenuBar-menu"),t&&this.update())}clearMenus(){if(this._menus.length!==0){this._closeChildMenu();for(let e of this._menus)e.aboutToClose.disconnect(this._onMenuAboutToClose,this),e.menuRequested.disconnect(this._onMenuMenuRequested,this),e.title.changed.disconnect(this._onTitleChanged,this),e.removeClass("lm-MenuBar-menu");this._menus.length=0,this.update()}}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":case"mouseleave":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("focusout",this),this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("focusout",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()}onActivateRequest(e){this.isAttached&&this._focusItemAt(0)}onResize(e){this.update(),super.onResize(e)}onUpdateRequest(e){var t;let n=this._menus,r=this.renderer,s=this._activeIndex,o=this._tabFocusIndex>=0&&this._tabFocusIndex<n.length?this._tabFocusIndex:0,a=this._overflowIndex>-1?this._overflowIndex:n.length,l=0,c=!1;a=this._overflowMenu!==null?a-1:a;let h=new Array(a);for(let d=0;d<a;++d)h[d]=r.renderItem({title:n[d].title,active:d===s,tabbable:d===o,disabled:n[d].items.length===0,onfocus:()=>{this._tabFocusIndex=d,this.activeIndex=d}}),l+=this._menuItemSizes[d],n[d].title.label===this._overflowMenuOptions.title&&(c=!0,a--);if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!c){if(this._overflowMenu===null){let d=(t=this._overflowMenuOptions.title)!==null&&t!==void 0?t:"...";this._overflowMenu=new Ot({commands:new qr}),this._overflowMenu.title.label=d,this._overflowMenu.title.mnemonic=0,this.addMenu(this._overflowMenu,!1)}for(let d=n.length-2;d>=a;d--){let u=this.menus[d];u.title.mnemonic=0,this._overflowMenu.insertItem(0,{type:"submenu",submenu:u}),this.removeMenu(u,!1)}h[a]=r.renderItem({title:this._overflowMenu.title,active:a===s&&n[a].items.length!==0,tabbable:a===o,disabled:n[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}else if(this._overflowMenu!==null){let d=this._overflowMenu.items,u=this.node.offsetWidth,f=this._overflowMenu.items.length;for(let p=0;p<f;++p){let m=n.length-1-p;if(u-l>this._menuItemSizes[m]){let g=d[0].submenu;this._overflowMenu.removeItemAt(0),this.insertMenu(a,g,!1),h[a]=r.renderItem({title:g.title,active:!1,tabbable:a===o,disabled:n[a].items.length===0,onfocus:()=>{this._tabFocusIndex=a,this.activeIndex=a}}),a++}}this._overflowMenu.items.length===0&&(this.removeMenu(this._overflowMenu,!1),h.pop(),this._overflowMenu=null,this._overflowIndex=-1)}}nn.render(h,this.contentNode),this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible)return;let e=this.contentNode.childNodes,t=this.node.offsetWidth,n=0,r=-1,s=e.length;if(this._menuItemSizes.length==0)for(let o=0;o<s;o++){let a=e[o];n+=a.offsetWidth,this._menuItemSizes.push(a.offsetWidth),n>t&&r===-1&&(r=o)}else for(let o=0;o<this._menuItemSizes.length;o++)if(n+=this._menuItemSizes[o],n>t){r=o;break}this._overflowIndex=r}_evtKeyDown(e){let t=e.keyCode;if(t===9){this.activeIndex=-1;return}if(e.preventDefault(),e.stopPropagation(),t===13||t===32||t===38||t===40){if(this.activeIndex=this._tabFocusIndex,this.activeIndex!==this._tabFocusIndex)return;this.openActiveMenu();return}if(t===27){this._closeChildMenu(),this._focusItemAt(this.activeIndex);return}if(t===37||t===39){let o=t===37?-1:1,a=this._tabFocusIndex+o,l=this._menus.length;for(let c=0;c<l;c++){let h=(l+a+o*c)%l;if(this._menus[h].items.length){this._focusItemAt(h);return}}return}let n=la().keyForKeydownEvent(e);
3if(!n)return;let r=this._activeIndex+1,s=Rs.findMnemonic(this._menus,n,r);s.index!==-1&&!s.multiple?(this.activeIndex=s.index,this.openActiveMenu()):s.index!==-1?(this.activeIndex=s.index,this._focusItemAt(this.activeIndex)):s.auto!==-1&&(this.activeIndex=s.auto,this._focusItemAt(this.activeIndex))}_evtMouseDown(e){if(!re.hitTest(this.node,e.clientX,e.clientY))return;e.stopPropagation(),e.stopImmediatePropagation();let t=D.findFirstIndex(this.contentNode.children,n=>re.hitTest(n,e.clientX,e.clientY));if(t===-1){this._closeChildMenu();return}if(e.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=t;else{e.preventDefault();let n=this._positionForMenu(t);Ot.saveWindowData(),this.activeIndex=t,this._openChildMenu(n)}}_evtMouseMove(e){let t=D.findFirstIndex(this.contentNode.children,r=>re.hitTest(r,e.clientX,e.clientY));if(t===this._activeIndex||t===-1&&this._childMenu)return;let n=t>=0&&this._childMenu?this._positionForMenu(t):null;Ot.saveWindowData(),this.activeIndex=t,n&&this._openChildMenu(n)}_positionForMenu(e){let t=this.contentNode.children[e],{left:n,bottom:r}=t.getBoundingClientRect();return{top:r,left:n}}_evtFocusOut(e){!this._childMenu&&!this.node.contains(e.relatedTarget)&&(this.activeIndex=-1)}_focusItemAt(e){let t=this.contentNode.childNodes[e];t&&t.focus()}_openChildMenu(e={}){let t=this.activeMenu;if(!t){this._closeChildMenu();return}let n=this._childMenu;if(n===t)return;this._childMenu=t,n?n.close():document.addEventListener("mousedown",this,!0),this._tabFocusIndex=this.activeIndex,A.sendMessage(this,x.Msg.UpdateRequest);let{left:r,top:s}=e;(typeof r>"u"||typeof s>"u")&&({left:r,top:s}=this._positionForMenu(this._activeIndex)),n||this.addClass("lm-mod-active"),t.items.length>0&&t.open(r,s,this._forceItemsPosition)}_closeChildMenu(){if(!this._childMenu)return;this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0);let e=this._childMenu;this._childMenu=null,e.close(),this.activeIndex=-1}_onMenuAboutToClose(e){e===this._childMenu&&(this.removeClass("lm-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)}_onMenuMenuRequested(e,t){if(e!==this._childMenu)return;let n=this._activeIndex,r=this._menus.length;switch(t){case"next":this.activeIndex=n===r-1?0:n+1;break;case"previous":this.activeIndex=n===0?r-1:n-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}};(function(i){class e{renderItem(n){let r=this.createItemClass(n),s=this.createItemDataset(n),o=this.createItemARIA(n);return ie.li({className:r,dataset:s,...n.disabled?{}:{tabindex:n.tabbable?"0":"-1"},onfocus:n.onfocus,...o},this.renderIcon(n),this.renderLabel(n))}renderIcon(n){let r=this.createIconClass(n);return ie.div({className:r},n.title.icon,n.title.iconLabel)}renderLabel(n){let r=this.formatLabel(n);return ie.div({className:"lm-MenuBar-itemLabel"},r)}createItemClass(n){let r="lm-MenuBar-item";return n.title.className&&(r+=` ${n.title.className}`),n.active&&!n.disabled&&(r+=" lm-mod-active"),r}createItemDataset(n){return n.title.dataset}createItemARIA(n){return{role:"menuitem","aria-haspopup":"true","aria-disabled":n.disabled?"true":"false"}}createIconClass(n){let r="lm-MenuBar-itemIcon",s=n.title.iconClass;return s?`${r} ${s}`:r}formatLabel(n){let{label:r,mnemonic:s}=n.title;if(s<0||s>=r.length)return r;let o=r.slice(0,s),a=r.slice(s+1),l=r[s],c=ie.span({className:"lm-MenuBar-itemMnemonic"},l);return[o,c,a]}}i.Renderer=e,i.defaultRenderer=new e})(bi||(bi={}));(function(i){function e(){let n=document.createElement("div"),r=document.createElement("ul");return r.className="lm-MenuBar-content",n.appendChild(r),r.setAttribute("role","menubar"),n}i.createNode=e;function t(n,r,s){let o=-1,a=-1,l=!1,c=r.toUpperCase();for(let h=0,d=n.length;h<d;++h){let u=(h+s)%d,f=n[u].title;if(f.label.length===0)continue;let p=f.mnemonic;if(p>=0&&p<f.label.length){f.label[p].toUpperCase()===c&&(o===-1?o=u:l=!0);continue}a===-1&&f.label[0].toUpperCase()===c&&(a=u)}return{index:o,multiple:l,auto:a}}i.findMnemonic=t})(Rs||(Rs={}));(function(i){function e(){let n=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div"),a=document.createElement("div");return r.className="lm-ScrollBar-button",s.className="lm-ScrollBar-button",r.dataset.action="decrement",s.dataset.action="increment",o.className="lm-ScrollBar-track",a.className="lm-ScrollBar-thumb",o.appendChild(a),n.appendChild(r),n.appendChild(o),n.appendChild(s),n}i.createNode=e;function t(n,r){return n.thumbNode.contains(r)?"thumb":n.trackNode.contains(r)?"track":n.decrementNode.contains(r)?"decrement":n.incrementNode.contains(r)?"increment":null}i.findPart=t})(em||(em={}));tm=class extends Rt{constructor(){super(...arguments),this._widget=null}dispose(){if(this._widget){let e=this._widget;this._widget=null,e.dispose()}super.dispose()}get widget(){return this._widget}set widget(e){e&&(e.parent=this.parent),this._widget!==e&&(this._widget&&this._widget.dis
3pose(),this._widget=e,this.parent&&e&&this.attachWidget(e))}*[Symbol.iterator](){this._widget&&(yield this._widget)}removeWidget(e){this._widget===e&&(this._widget=null,this.parent&&this.detachWidget(e))}init(){super.init();for(let e of this)this.attachWidget(e)}attachWidget(e){this.parent.isAttached&&A.sendMessage(e,x.Msg.BeforeAttach),this.parent.node.appendChild(e.node),this.parent.isAttached&&A.sendMessage(e,x.Msg.AfterAttach)}detachWidget(e){this.parent.isAttached&&A.sendMessage(e,x.Msg.BeforeDetach),this.parent.node.removeChild(e.node),this.parent.isAttached&&A.sendMessage(e,x.Msg.AfterDetach)}},Bs=class extends pi{constructor(e={}){super(e),this._dirty=!1,this._items=[],this._box=null,this._hiddenMode=e.hiddenMode!==void 0?e.hiddenMode:x.HiddenMode.Display}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){this._hiddenMode!==e&&(this._hiddenMode=e,this.widgets.length>1&&this.widgets.forEach(t=>{t.hiddenMode=this._hiddenMode}))}dispose(){for(let e of this._items)e.dispose();this._box=null,this._items.length=0,super.dispose()}attachWidget(e,t){this._hiddenMode===x.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=x.HiddenMode.Scale),t.hiddenMode=x.HiddenMode.Scale):t.hiddenMode=x.HiddenMode.Display,D.insert(this._items,e,new Rn(t)),this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeAttach),this.parent.node.appendChild(t.node),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterAttach),this.parent.fit()}moveWidget(e,t,n){D.move(this._items,e,t),this.parent.update()}detachWidget(e,t){let n=D.removeAt(this._items,e);this.parent.isAttached&&A.sendMessage(t,x.Msg.BeforeDetach),this.parent.node.removeChild(t.node),this.parent.isAttached&&A.sendMessage(t,x.Msg.AfterDetach),n.widget.node.style.zIndex="",this._hiddenMode===x.HiddenMode.Scale&&(t.hiddenMode=x.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=x.HiddenMode.Display)),n.dispose(),this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e),this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e),this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){this.parent.isVisible&&this._update(e.width,e.height)}onUpdateRequest(e){this.parent.isVisible&&this._update(-1,-1)}onFitRequest(e){this.parent.isAttached&&this._fit()}_fit(){let e=0,t=0;for(let s=0,o=this._items.length;s<o;++s){let a=this._items[s];a.isHidden||(a.fit(),e=Math.max(e,a.minWidth),t=Math.max(t,a.minHeight))}let n=this._box=re.boxSizing(this.parent.node);e+=n.horizontalSum,t+=n.verticalSum;let r=this.parent.node.style;r.minWidth=`${e}px`,r.minHeight=`${t}px`,this._dirty=!0,this.parent.parent&&A.sendMessage(this.parent.parent,x.Msg.FitRequest),this._dirty&&A.sendMessage(this.parent,x.Msg.UpdateRequest)}_update(e,t){this._dirty=!1;let n=0;for(let l=0,c=this._items.length;l<c;++l)n+=+!this._items[l].isHidden;if(n===0)return;e<0&&(e=this.parent.node.offsetWidth),t<0&&(t=this.parent.node.offsetHeight),this._box||(this._box=re.boxSizing(this.parent.node));let r=this._box.paddingTop,s=this._box.paddingLeft,o=e-this._box.horizontalSum,a=t-this._box.verticalSum;for(let l=0,c=this._items.length;l<c;++l){let h=this._items[l];h.isHidden||(h.widget.node.style.zIndex=`${l}`,h.update(s,r,o,a))}}};(function(i){function e(t){return t.layout||new Bs}i.createLayout=e})(nm||(nm={}));(function(i){function e(s){return n[s]}i.orientationFromPlacement=e;function t(s){return r[s]}i.directionFromPlacement=t;let n={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},r={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(im||(im={}))});var P_,rm=E(()=>{wn();P_=ne(ut());zs()});function U_(i){let t=(i.translator||Pe).load("jupyterlab"),n=r=>{if(r.key==="Enter"||r.key==="Spacebar"||r.key===" ")r.preventDefault(),r.stopPropagation(),i.handleClick();else return};return Ye.default.createElement(Fh,{role:"button","aria-haspopup":!0,onClick:i.handleClick,source:t.__("Ln %1, Col %2",i.line,i.column),title:t.__("Go to line number\u2026"),tabIndex:0,onKeyDown:n})}var Ye,Pl,yi,sm=E(()=>{s0();wn();jh();Ye=ne(it());o0();Pl=class extends Ye.default.Component{constructor(e){super(e),this._handleChange=t=>{this.setState({value:t.currentTarget.value})},this._handleSubmit=t=>{t.preventDefault();let n=parseInt(this._textInput.value,10);return!isNaN(n)&&isFinite(n)&&1<=n&&n<=this.props.maxLine&&this.props.handleSubmit(n),!1},this._handleFocus=()=>{this.setState({hasFocus:!0})},this._handleBlur=()=>{this.setState({hasFocus:!1})},this._textInput=null,this.translator=e.translator||Pe,this._trans=this.translator.load("jupyterlab"),this.state={value:"",hasFocus:!1,textInputId:$h.createDomID()+"-line-number-input"}}componentDidMount(){this._textInput.focus()}render(){return Ye.default.createElement("div",{className:"jp-lineFormSearch"},Ye.default.createElement("form",{name:"lineColumnForm",onSubmit:this._handleSubmit,noValidate:!0},Ye.default.createElement("div",{className:Nh("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":void 0)},Ye.default.createElement("input",{type:"text",id:this.state.textInputId,className:"jp-lineFormInput",onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),Ye.default.createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},Ye.default.createElement(Lh.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),Ye.default.createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),Ye.default.createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to line number between 1 and %1",this.props.maxLine))))}};yi=class extends Bh{constructor(e){super(new yi.Model),this._popup=null,this.addClass("jp-mod-highlighted"),this.translator=e||Pe}render(){return this.model===null?null:Ye.default.createElement(U_,{line:this.model.line,column:this.model.column,translator:this.translator,handleClick:()=>this._handleClick()})}_handleClick(){this._popup&&this._popup.dispose();let e=Rh.create(Ye.default.createElement(Pl,{handleSubmit:t=>this._handleSubmit(t),currentLine:this.model.line,maxLine:this.model.editor.lineCount,translator:this.translator}));this._popup=Uh({body:e,anchor:this,align:"right"})}_handleSubmit(e){this.model.editor.setCursorPosition({line:e-1,column:0}),this._popup.dispose(),this.model.editor.focus()}};(function(i){class e extends zh{constructor(){super(...arguments),this._onSelectionChanged=()=>{let n=this._getAllState(),r=this.editor.getCursorPosition();this._line=r.line+1,this._column=r.column+1,this._triggerChange(n,this._getAllState())},this._line=1,this._column=1,this._editor=null}get editor(){return this._editor}set editor(n){var r;let s=this._editor;!((r=s?.model)===null||r===void 0)&&r.selections&&s.model.selections.changed.disconnect(this._onSelectionChanged);let o=this._getAllState();if(this._editor=n,!this._editor)this._column=1,this._line=1;else{this._editor.model.selections.changed.connect(this._onSelectionChanged);let a=this._editor.getCursorPosition();this._column=a.column+1,this._line=a.line+1}this._triggerChange(o,this._getAllState())}get line(){return this._line}get column(){return this._column}_getAllState(){return[this._line,this._column]}_triggerChange(n,r){(n[0]!==r[0]||n[1]!==r[1])&&this.stateChanged.emit(void 0)}}i.Model=e})(yi||(yi={}))});var Ul,om,am,lm,DS,NS,cm=E(()=>{Ul=ne(ut()),om="jp-mod-completer-enabled",am="jp-mod-completer-active",lm="jp-mod-at-line-beginning",DS=new Ul.Token("@jupyterlab/codeeditor:IEditorServices",`A service for the text editor provider 4 for the application. Use this to create new text editors and host them in your 5 UI elements.`),NS=new Ul.Token("@jupyterlab/codeeditor:IPositionModel","A service to handle an code editor cursor position.")});var hm,dm=E(()=>{zs();(function(i){function e(t){let r=t.types().find(s=>s.indexOf("text")===0);if(r!==void 0)return t.getData(r)}i.findTextData=e})(hm||(hm={}))});var um=E(()=>{zs()});var Fl=E(()=>{Jf();Kf();rm();sm();Nl();cm();um();dm()});var fm,F_,$_,H_,mn,$l=E(()=>{Ma();Fl();
5fm="[data-jp-code-runner]",F_='[data-jp-interaction-mode="terminal"]',$_=".jp-CodeMirrorEditor:not(.jp-mod-has-primary-selection):not(.jp-mod-in-leading-whitespace):not(.jp-mod-completer-active)",H_=".jp-mod-editMode .jp-Cell.jp-mod-active";(function(i){function e(a){var l;let c=(l=a.dom.parentElement)===null||l===void 0?void 0:l.classList,h=c?.contains(om),d=c?.contains(lm);if(h&&!d)return!1;let u={state:a.state,dispatch:a.dispatch},f=a.state.selection.main.from,p=a.state.selection.main.to;if(f!=p)return Fi(u);let m=a.state.doc.lineAt(f),g=a.state.doc.slice(m.from,f).toString();return/^\s*$/.test(g)?Fi(u):iu(u)}i.indentMoreOrInsertTab=e;function t(a){var l;if(!((l=a.dom.parentElement)===null||l===void 0)&&l.classList.contains(am)||a.dom.closest(F_))return!1;let c={state:a.state,dispatch:a.dispatch};return Qr(c)}i.completerOrInsertNewLine=t;function n(a){return!!a.dom.closest(fm)}i.preventNewLineOnRun=n;function r(a){if(a.dom.closest(fm))return!1;{let l={state:a.state,dispatch:a.dispatch};return ka(l)}}i.insertBlankLineOnRun=r;function s(a){let l={state:a.state,dispatch:a.dispatch},c=wa(l);return a.dom.closest(H_)?!1:c}i.simplifySelectionAndMaybeSwitchToCommandMode=s;function o(a){return a.dom.closest($_)?!1:Ca(a)}i.dedentIfNotLaunchingTooltip=o})(mn||(mn={}))});function q_(i){let{fontFamily:e,fontSize:t,lineHeight:n}=i.state.facet(mm),r="";return t&&(r+=`font-size: ${t}px !important;`),e&&(r+=`font-family: ${e} !important;`),n&&(r+=`line-height: ${n.toString()} !important`),{style:r}}function pm(i){return[mm.of(i),Z.editorAttributes.of(q_)]}var mm,gm=E(()=>{$t();kt();mm=rt.define({combine(i){return Li(i,{fontFamily:null,fontSize:null,lineHeight:null},{fontFamily:(e,t)=>e??t,fontSize:(e,t)=>e??t,lineHeight:(e,t)=>e??t})}})});var V_,W_,G_,J_,K_,nC,bm=E(()=>{Jr();Kr();V_="InlineMathDollar",W_="InlineMathBracket",G_="BlockMathDollar",J_="BlockMathBracket",K_={[V_]:1,[W_]:3,[G_]:2,[J_]:3},nC=Object.keys(K_).reduce((i,e)=>(i[e]={mark:`${e}Mark`,resolve:e},i),{})});function xm(i){return[Y_,js.of(i),X_]}var ym,_m,Y_,js,X_,vm=E(()=>{$t();kt();ym=ne(ut()),_m="cm-rulers",Y_=Z.baseTheme({[`.${_m}`]:{borderRight:"1px dotted gray",opacity:.7}}),js=rt.define({combine(i){return i.reduce((t,n)=>t.concat(n.filter((r,s)=>!t.includes(r)&&s==n.lastIndexOf(r))),[])}}),X_=wt.fromClass(class{constructor(i){var e,t;this.rulersContainer=i.dom.appendChild(document.createElement("div")),this.rulersContainer.style.cssText=` 6 position: absolute; 7 left: 0; 8 top: 0; 9 width: 100%; 10 height: 100%; 11 pointer-events: none; 12 overflow: hidden; 13 `;let n=i.defaultCharacterWidth,r=i.state.facet(js),s=(t=(e=i.scrollDOM.querySelector(".cm-gutters"))===null||e===void 0?void 0:e.clientWidth)!==null&&t!==void 0?t:0;this.rulers=r.map(o=>{let a=this.rulersContainer.appendChild(document.createElement("div"));return a.classList.add(_m),a.style.cssText=` 14 position: absolute; 15 left: ${s+o*n}px; 16 height: 100%; 17 `,a.style.width="6px",a})}update(i){var e,t;let n=i.view.state.facet(js);if(i.viewportChanged||i.geometryChanged||!ym.JSONExt.deepEqual(n,i.startState.facet(js))){let r=(t=(e=i.view.scrollDOM.querySelector(".cm-gutters"))===null||e===void 0?void 0:e.clientWidth)!==null&&t!==void 0?t:0,s=i.view.defaultCharacterWidth;this.rulers.forEach((o,a)=>{o.style.left=`${r+n[a]*s}px`})}}destroy(){this.rulers.forEach(i=>{i.remove()}),this.rulersContainer.remove()}})});var wm,Hl,Q_,km=E(()=>{kt();$t();Vl();wm=rt.define({combine(i){return i[i.length-1]}}),Hl=class{constructor(e){this._onStackItemAdded=({stackItem:t,changedParentTypes:n})=>{n.has(this._syncConf.ytext)&&this._beforeChangeSelection&&!t.meta.has(this)&&t.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let r=this._syncConf.fromYRange(n);this._view.dispatch(this._view.state.update({selection:r,effects:[Z.scrollIntoView(r)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this._syncConf.toYRange(this._view.state.selection.main)}
17,this._view=e,this._conf=e.state.facet(wm),this._undoManager=this._conf.undoManager,this._syncConf=e.state.facet(ql),this._beforeChangeSelection=null,this._undoManager.on("stack-item-added",this._onStackItemAdded),this._undoManager.on("stack-item-popped",this._onStackItemPopped),this._undoManager.addTrackedOrigin(this._syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(Ps)!==this._syncConf)&&this._storeSelection()}destroy(){this._undoManager.off("stack-item-added",this._onStackItemAdded),this._undoManager.off("stack-item-popped",this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this._syncConf)}},Q_=wt.fromClass(Hl)});var ql,Ps,gC,Vl=E(()=>{$t();kt();km();ql=rt.define({combine(i){return i[i.length-1]}}),Ps=Vr.define(),gC=wt.fromClass(class{constructor(i){this.conf=i.state.facet(ql),this._observer=(e,t)=>{var n;if(t.origin!==this.conf){let r=e.delta,s=[],o=0;for(let a=0;a<r.length;a++){let l=r[a];l.insert!=null?s.push({from:o,to:o,insert:l.insert}):l.delete!=null?(s.push({from:o,to:o+l.delete,insert:""}),o+=l.delete):o+=(n=l.retain)!==null&&n!==void 0?n:0}i.dispatch({changes:s,annotations:[Ps.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(i){if(!i.docChanged||i.transactions.length>0&&i.transactions[0].annotation(Ps)===this.conf)return;let e=this.conf.ytext;e.doc.transact(()=>{let t=0;i.changes.iterChanges((n,r,s,o,a)=>{let l=a.sliceString(0,a.length,` 18`);n!==r&&e.delete(n+t,r-n),l.length>0&&e.insert(n+t,l),t+=l.length-(r-n)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}})});var Wl=E(()=>{gm();bm();vm();Vl()});function Z_(i){try{return new RegExp(i,Ql),!0}catch{return!1}}function qs(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e<t.to&&(n=t.text.charCodeAt(e-t.from))>=56320&&n<57344;)e++;return e}function _i(i,e,t,n){return new fr(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:r=>r.toLowerCase(),i.wholeWord?ex(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function ex(i,e){return(t,n,r,s)=>((s>t||s+r.length<n)&&(s=Math.max(0,t-2),r=i.sliceString(s,Math.min(i.length,n+2))),(e(Gs(r,t-s))!=vt.Word||e(Js(r,t-s))!=vt.Word)&&(e(Js(r,n-s))!=vt.Word||e(Gs(r,n-s))!=vt.Word))}function xi(i,e,t,n){return new $s(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?tx(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function Gs(i,e){return i.slice(Pt(i,e,!1),e)}function Js(i,e){return i.slice(e,Pt(i,e))}function tx(i){return(e,t,n)=>!n[0].length||(i(Gs(n.input,n.index))!=vt.Word||i(Js(n.input,n.index))!=vt.Word)&&(i(Js(n.input,n.index+n[0].length))!=vt.Word||i(Gs(n.input,n.index+n[0].length))!=vt.Word)}function br(i){return e=>{let t=e.state.field(gn,!1);return t&&t.query.spec.valid?i(e,t):tc(e)}}function ec(i){return i.state.facet(vi).createPanel(i)}function Yl(i,e){var t,n,r,s,o;let a=i.selection.main,l=a.empty||a.to>a.from+100?"":i.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=i.facet(vi);return new Vs({search:((t=e?.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(r=e?.literal)!==null&&r!==void 0?r:c.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function Am(i){let e=ua(i,ec);return e&&e.dom.querySelector("[main-field]")}function Tm(i){let e=Am(i);e&&e==i.root.activeElement&&e.select()}function Xe(i,e){return i.state.phrase(e)}function ic(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),r=i.state.doc.lineAt(t).to,s=Math.max(n.from,e-Us),o=Math.min(r,t+Us),a=i.state.sliceDoc(s,o);if(s!=n.from){for(let l=0;l<Us;l++)if(!Fs.test(a[l+1])&&Fs.test(a[l])){a=a.slice(l);break}}if(o!=r){for(let l=a.length-1;l>a.length-Us;l--)if(!Fs.test(a[l-1])&&Fs.test(a[l])){a=a.slice(0,l);break}}return Z.announce.of(`${i.state.phrase("current match")}. ${a} ${i.state.phrase("on line")} ${n.number}.`)}var Sm,fr,Mm,Ql,$s,Gl,pn,Hs,vi,Vs,Ws,Jl,Kl,mr,Zl,gn,ur,nx,ix,rx,pr,gr,sx,Em,Cm,ox,tc,nc,Xl,Us,Fs,ax,lx,Im=E(()=>{kt();$t();l0();Sm=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i,fr=class{constructor(e,t,n=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter
18=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?a=>s(Sm(a)):Sm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Hh(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=qh(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Vh(e);let r=this.normalize(t);if(r.length)for(let s=0,o=n;;s++){let a=r.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(l)return this.value=l,this;break}o==n&&s<t.length&&t.charCodeAt(s)==a&&o++}}}match(e,t,n){let r=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[s+1],to:n}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<"u"&&(fr.prototype[Symbol.iterator]=function(){return this});Mm={from:-1,to:-1,match:/.*/.exec("")},Ql="gm"+(/x/.unicode==null?"":"u"),$s=class{constructor(e,t,n,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=Mm,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Hs(e,t,n,r,s);this.re=new RegExp(t,Ql+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=qs(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=qs(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},Gl=new WeakMap,pn=class{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=Gl.get(e);if(!r||r.from>=n||r.to<=t){let a=new pn(t,e.sliceString(t,n));return Gl.set(e,a),a}if(r.from==t&&r.to==n)return r;let{text:s,from:o}=r;return o>t&&(s=e.sliceString(t,o)+s,o=t),r.to<n&&(s+=e.sliceString(r.to,n)),Gl.set(e,new pn(o,s)),new pn(t,s.slice(t-o,n-o))}},Hs=class{constructor(e,t,n,r,s){this.text=e,this.to=s,this.done=!1,this.value=Mm,this.matchPos=qs(e,r),this.re=new RegExp(t,Ql+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=pn.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=qs(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pn.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&($s.prototype[Symbol.iterator]=Hs.prototype[Symbol.iterator]=function(){return this});vi=rt.define({combine(i){return Li(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Xl(e),scrollToMatch:e=>Z.scrollIntoView(e)})}}),Vs=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Z_(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?` 19`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Kl(this):new Jl(this)}getCursor(e,t=0,n){let r=e.doc?e:Ft.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?xi(this,r,t,n):_i(this,r,t,n)}},Ws=class{constructor(e){this.spec=e}};Jl=class extends Ws{constructor(e){super(e)}
vendor: 4,620 bytes, line 19
19nextMatch(e,t,n){let r=_i(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);r=_i(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let s=Math.max(t,r-1e4-this.spec.unquoted.length),o=_i(this.spec,e,s,r),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=_i(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=_i(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}};Kl=class extends Ws{nextMatch(e,t,n){let r=xi(this.spec,e,n,e.doc.length).next();return r.done&&(r=xi(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let s=Math.max(t,n-r*1e4),o=xi(this.spec,e,s,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let s=+n.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+n.slice(r)}return t})}matchAll(e,t){let n=xi(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=xi(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}},mr=Ut.define(),Zl=Ut.define(),gn=ha.define({create(i){return new ur(Yl(i).create(),null)},update(i,e){for(let t of e.effects)t.is(mr)?i=new ur(t.value.create(),i.panel):t.is(Zl)&&(i=new ur(i.query,t.value?ec:null));return i},provide:i=>sd.from(i,e=>e.panel)}),ur=class{constructor(e,t){this.query=e,this.panel=t}},nx=kn.mark({class:"cm-searchMatch"}),ix=kn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),rx=wt.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(gn))}update(i){let e=i.state.field(gn);(e!=i.startState.field(gn)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return kn.none;let{view:t}=this,n=new Wr;for(let r=0,s=t.visibleRanges,o=s.length;r<o;r++){let{from:a,to:l}=s[r];for(;r<o-1&&l>s[r+1].from-2*250;)l=s[++r].to;i.highlight(t.state,a,l,(c,h)=>{let d=t.state.selection.ranges.some(u=>u.from==c&&u.to==h);n.add(c,h,d?ix:nx)})}return n.finish()}},{decorations:i=>i.decorations});pr=br((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=F.single(n.from,n.to),s=i.state.facet(vi);return i.dispatch({selection:r,effects:[ic(i,n),s.scrollToMatch(r.main,i)],userEvent:"select.search"}),Tm(i),!0}),gr=br((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let s=F.single(r.from,r.to),o=i.state.facet(vi);return i.dispatch({selection:s,effects:[ic(i,r),o.scrollToMatch(s.main,i)],userEvent:"select.search"}),Tm(i),!0}),sx=br((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:F.create(t.map(n=>F.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),Em=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,s=[],o=0;for(let a=new fr(i.doc,i.sliceDoc(n,r));!a.next().done;){if(s.length>1e3)return!1;a.value.from==n&&(o=s.length),s.push(F.range(a.value.from,a.value.to))}return e(i.update({selection:F.create(s,o),userEvent:"select.search.matches"})),!0},Cm=br((i,{query:e})=>{let{state:t}=i,{from:n,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,n,n);if(!s)return!1;let o=s,a=[],l,c,h=[];o.from==n&&o.to==r&&(c=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),h.push(Z.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+".")));let d=i.state.changes(a);return o&&(l=F.single(o.from,o.to).map(d),h.push(ic(i,o)),h.push(t.facet(vi).scrollToMatch(l.main,i))),i.dispatch({changes:d,selection:l,effects:h,userEvent:"input.replace"}),!0}),ox=br((i,{query:e})=>
19{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(r=>{let{from:s,to:o}=r;return{from:s,to:o,insert:e.getReplacement(r)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:Z.announce.of(n),userEvent:"input.replace.all"}),!0});tc=i=>{let e=i.state.field(gn,!1);if(e&&e.panel){let t=Am(i);if(t&&t!=i.root.activeElement){let n=Yl(i.state,e.query.spec);n.valid&&i.dispatch({effects:mr.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[Zl.of(!0),e?mr.of(Yl(i.state,e.query.spec)):Ut.appendConfig.of(lx)]});return!0},nc=i=>{let e=i.state.field(gn,!1);if(!e||!e.panel)return!1;let t=ua(i,ec);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:Zl.of(!1)}),!0},Xl=class{constructor(e){this.view=e;let t=this.query=e.state.field(gn).query.spec;this.commit=this.commit.bind(this),this.searchField=Ge("input",{value:t.search,placeholder:Xe(e,"Find"),"aria-label":Xe(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ge("input",{value:t.replace,placeholder:Xe(e,"Replace"),"aria-label":Xe(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ge("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ge("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ge("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,s,o){return Ge("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Ge("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>pr(e),[Xe(e,"next")]),n("prev",()=>gr(e),[Xe(e,"previous")]),n("select",()=>sx(e),[Xe(e,"all")]),Ge("label",null,[this.caseField,Xe(e,"match case")]),Ge("label",null,[this.reField,Xe(e,"regexp")]),Ge("label",null,[this.wordField,Xe(e,"by word")]),...e.state.readOnly?[]:[Ge("br"),this.replaceField,n("replace",()=>Cm(e),[Xe(e,"replace")]),n("replaceAll",()=>ox(e),[Xe(e,"replace all")])],Ge("button",{name:"close",onclick:()=>nc(e),"aria-label":Xe(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new Vs({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:mr.of(e)}))}keydown(e){Yh(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?gr:pr)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Cm(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(mr)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(vi).top}};Us=30,Fs=/[\s\.,:;?!]/;ax=Z.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),lx=[gn,Ni.low(rx),ax]});var rc,cx,Ks,yr,Ys=E(()=>{c0();Ma();ji();$t();kt();wn();rc=ne(ut());tn();$l();Wl();Im();cx="jp-mod-readOnly",Ks=class{constructor({baseConfiguration:e,config:t,defaultExtensions:n}={}){this._configChanged=new G(this),this._disposed=new G(this),this._isDisposed=!1,this._immutables=new Set,this._baseConfig=e??{},this._config=t??{},this._configurableBuilderMap=new Map(n);let r=Object.keys(this._config).concat(Object.keys(this._baseConfig));this._immutables=new Set([...this._configurableBuilderMap.keys()].filter(s=>!r.includes(s)))}get configChanged(){return this._configChanged}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}dispose(){this.isDisposed||(this._isDisposed=!0,this._disposed.emit
19(),G.clearData(this))}getOption(e){var t;return(t=this._config[e])!==null&&t!==void 0?t:this._baseConfig[e]}hasOption(e){return Object.keys(this._config).includes(e)||Object.keys(this._baseConfig).includes(e)}setOption(e,t){this._config[e]!==t&&(this._config[e]=t,this._configChanged.emit({[e]:t}))}setBaseOptions(e){let t=this._getChangedOptions(e,this._baseConfig);if(t.length>0){this._baseConfig=e;let n=Object.keys(this._config),r=t.filter(s=>!n.includes(s));r.length>0&&this._configChanged.emit(r.reduce((s,o)=>(s[o]=this._baseConfig[o],s),{}))}for(let n of Object.keys(e))n in this._config&&this._config[n]!=e[n]&&this.setOption(n,e[n])}setOptions(e){let t=this._getChangedOptions(e,this._config);t.length>0&&(this._config={...e},this._configChanged.emit(t.reduce((n,r)=>{var s;return n[r]=(s=this._config[r])!==null&&s!==void 0?s:this._baseConfig[r],n},{})))}reconfigureExtension(e,t,n){let r=this.getEffect(e.state,t,n);r&&e.dispatch({effects:[r]})}reconfigureExtensions(e,t){let n=Object.keys(t).filter(r=>this.has(r)).map(r=>this.getEffect(e.state,r,t[r]));e.dispatch({effects:n.filter(r=>r!==null)})}injectExtension(e,t){e.dispatch({effects:Ut.appendConfig.of(t)})}getInitialExtensions(){let e={...this._baseConfig,...this._config},t=[...this._immutables].map(n=>{var r;return(r=this.get(n))===null||r===void 0?void 0:r.instance(void 0)}).filter(n=>n);for(let n of Object.keys(e)){let r=this.get(n);if(r){let s=e[n];t.push(r.instance(s))}}return t}get(e){return this._configurableBuilderMap.get(e)}has(e){return this._configurableBuilderMap.has(e)}getEffect(e,t,n){var r;let s=this.get(t);return(r=s?.reconfigure(n))!==null&&r!==void 0?r:null}_getChangedOptions(e,t){let n=new Array,r=new Array;for(let[s,o]of Object.entries(e))r.push(s),t[s]!==o&&n.push(s);return n.push(...Object.keys(t).filter(s=>!r.includes(s))),n}},yr=class{constructor(){this.configurationBuilder=new Map,this.configurationSchema={},this.defaultOptions={},this.handlers=new Set,this.immutableExtensions=new Set,this._baseConfiguration={}}get baseConfiguration(){return{...this.defaultOptions,...this._baseConfiguration}}set baseConfiguration(e){if(!rc.JSONExt.deepEqual(e,this._baseConfiguration)){this._baseConfiguration=e;for(let t of this.handlers)t.setBaseOptions(this.baseConfiguration)}}get defaultConfiguration(){return Object.freeze({...this.defaultOptions})}get settingsSchema(){return Object.freeze(rc.JSONExt.deepCopy(this.configurationSchema))}addExtension(e){var t;if(this.configurationBuilder.has(e.name))throw new Error(`Extension named ${e.name} is already registered.`);this.configurationBuilder.set(e.name,e),typeof e.default<"u"&&(this.defaultOptions[e.name]=e.default),e.schema&&(this.configurationSchema[e.name]={default:(t=e.default)!==null&&t!==void 0?t:null,...e.schema},this.defaultOptions[e.name]=this.configurationSchema[e.name].default)}createNew(e){let t=new Array;for(let[r,s]of this.configurationBuilder.entries()){let o=s.factory(e);o&&t.push([r,o])}let n=new Ks({baseConfiguration:this.baseConfiguration,config:e.config,defaultExtensions:t});return this.handlers.add(n),n.disposed.connect(()=>{this.handlers.delete(n)}),n}};(function(i){class e{constructor(l){this._compartment=new da,this._builder=l}instance(l){return this._compartment.of(this._builder(l))}reconfigure(l){return this._compartment.reconfigure(this._builder(l))}}class t{constructor(l){this._extension=l}instance(){return this._extension}reconfigure(){return null}}function n(a){return new e(a)}i.createConfigurableExtension=n;function r(a,l=[]){return new e(c=>c?a:l)}i.createConditionalExtension=r;function s(a){return new t(a)}i.createImmutableExtension=s;function o(a={}){let{themes:l,translator:c}=a,h=(c??Pe).load("jupyterlab"),d=[Object.freeze({name:"autoClosingBrackets",default:!1,factory:()=>r(yd()),schema:{type:"boolean",title:h.__("Auto Closing Brackets")}}),Object.freeze({name:"codeFolding",default:!1,factory:()=>r(fd()),schema:{type:"boolean",title:h.__("Code Folding")}}),Object.freeze({name:"cursorBlinkRate",default:1200,factory:()=>n(u=>Xh({cursorBlinkRate:u})),schema:{type:"number",title:h.__("Cursor blinking rate"),description:h.__("Half-period in milliseconds used for cursor blinking. The default blink rate is 1200ms. By setting this to zero, blinking can be disabled.")}}),Object.freeze({name:"highlightActiveLine",default:!1,factory:()=>r(td()),schema:{type:"boolean",title:h.__("Highlight the active line")}}),Object.freeze({name:"highlightSpecialCharacters",default:!0,factory:()=>r(Zh()),schema:{type:"boolean",title:h.__("Highlight special characters")}}),Object.freeze({name:"highlightTrailingWhitespace",default:!1,factory:()=>r(ld()),schema:{type:"boolean",title:h.__("Highlight trailing white space
19s")}}),Object.freeze({name:"highlightWhitespace",default:!1,factory:()=>r(ad()),schema:{type:"boolean",title:h.__("Highlight white spaces")}}),Object.freeze({name:"indentUnit",default:"4",factory:()=>n(u=>u=="Tab"?Bi.of(" "):Bi.of(" ".repeat(parseInt(u,10)))),schema:{type:"string",title:h.__("Indentation unit"),description:h.__("The indentation is a `Tab` or the number of spaces. This defaults to 4 spaces."),enum:["Tab","1","2","4","8"]}}),Object.freeze({name:"keymap",default:[{key:"Mod-Enter",run:mn.insertBlankLineOnRun},{key:"Enter",run:mn.completerOrInsertNewLine},{key:"Escape",run:mn.simplifySelectionAndMaybeSwitchToCommandMode},...ru.filter(u=>!["Ctrl-m","Mod-Enter","Shift-Mod-k","Mod-/","Alt-A","Escape","Enter"].includes(u.key)),{key:"Tab",run:mn.indentMoreOrInsertTab,shift:mn.dedentIfNotLaunchingTooltip}],factory:()=>n(u=>Oi.of(u))}),Object.freeze({name:"lineNumbers",default:!0,factory:()=>r(od()),schema:{type:"boolean",title:h.__("Line Numbers")}}),Object.freeze({name:"lineWrap",factory:()=>r(Z.lineWrapping),default:!0,schema:{type:"boolean",title:h.__("Line Wrap")}}),Object.freeze({name:"dropCursor",default:!0,factory:()=>r(Qh()),schema:{type:"boolean",title:h.__("Drop Cursor")}}),Object.freeze({name:"matchBrackets",default:!0,factory:()=>r([gd(),Ni.high(Oi.of(_d))]),schema:{type:"boolean",title:h.__("Match Brackets")}}),Object.freeze({name:"rectangularSelection",default:!0,factory:()=>r([nd(),id()]),schema:{type:"boolean",title:h.__("Rectangular selection"),description:h.__("Rectangular (block) selection can be created by dragging the mouse pointer while holding the left mouse button and the Alt key. When the Alt key is pressed, a crosshair cursor will appear, indicating that the rectangular selection mode is active.")}}),Object.freeze({name:"readOnly",default:!1,factory:()=>n(u=>[Ft.readOnly.of(u),u?Z.editorAttributes.of({class:cx}):[]])}),Object.freeze({name:"rulers",default:[],factory:()=>n(u=>u.length>0?xm(u):[]),schema:{type:"array",title:h.__("Rulers"),items:{type:"number",minimum:0}}}),Object.freeze({name:"extendSelection",default:!0,factory:()=>r(Oi.of([{key:"Mod-Shift-l",run:Em,preventDefault:!0}]))}),Object.freeze({name:"searchWithCM",default:!1,factory:()=>r(Oi.of([{key:"Mod-f",run:tc,scope:"editor search-panel"},{key:"F3",run:pr,shift:gr,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:pr,shift:gr,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:nc,scope:"editor search-panel"}]))}),Object.freeze({name:"scrollPastEnd",default:!1,factory:u=>u.inline?null:r(ed())}),Object.freeze({name:"smartIndent",default:!0,factory:()=>r(ud()),schema:{type:"boolean",title:h.__("Smart Indentation")}}),Object.freeze({name:"tabFocusable",default:!0,factory:()=>r(Z.contentAttributes.of({tabIndex:"0"}),Z.contentAttributes.of({tabIndex:"-1"}))}),Object.freeze({name:"tabSize",default:4,factory:()=>n(u=>Ft.tabSize.of(u)),schema:{type:"number",title:h.__("Tab size")}}),Object.freeze({name:"tooltips",factory:()=>s(rd({position:"absolute",parent:document.body}))}),Object.freeze({name:"allowMultipleSelections",default:!0,factory:()=>n(u=>Ft.allowMultipleSelections.of(u)),schema:{type:"boolean",title:h.__("Multiple selections")}}),Object.freeze({name:"customStyles",factory:()=>n(u=>pm(u)),default:{fontFamily:null,fontSize:null,lineHeight:null},schema:{title:h.__("Custom editor styles"),type:"object",properties:{fontFamily:{type:["string","null"],title:h.__("Font Family")},fontSize:{type:["number","null"],minimum:1,maximum:100,title:h.__("Font Size")},lineHeight:{type:["number","null"],title:h.__("Line Height")}},additionalProperties:!1}})];return l&&d.push(Object.freeze({name:"theme",default:"jupyter",factory:()=>n(u=>l.getTheme(u)),schema:{type:"string",title:h.__("Theme"),description:h.__("CodeMirror theme")}})),c&&d.push(Object.freeze({name:"translation",default:{"Control character":h.__("Control character"),"Selection deleted":h.__("Selection deleted"),"Folded lines":h.__("Folded lines"),"Unfolded lines":h.__("Unfolded lines"),to:h.__("to"),"folded code":h.__("folded code"),unfold:h.__("unfold"),"Fold line":h.__("Fold line"),"Unfold line":h.__("Unfold line"),"Go to line":h.__("Go to line"),go:h.__("go"),Find:h.__("Find"),Replace:h.__("Replace"),next:h.__("next"),previous:h.__("previous"),all:h.__("all"),"match case":h.__("match case"),replace:h.__("replace"),"replace all":h.__("replace all"),close:h.__("close"),"current match":h.__("current match"),"replaced $ matches":h.__("replaced $ matches"),"replaced match on line $":h.__("replaced match on line $"),"on line":h.__("on line"),Completions:h.__("Completions"),Diagnostics:h.__("Diagnostics"),"No diagnostics":h.__("No diagnostics"),Breakpoint:h.__("Breakpoint"),"Selected breakpoint":h.__("Selected breakpoint")},factory:()=>n(u=>Ft.phrases.of(u))})),d}i.getDefaultExtensions=o})(yr||(yr={}))});function $c(i,e){let t=null;for(let n=0;n<i.length;n++){let r=i[n].walk(e);r!=i[n]&&!t&&(t=i.slice(0,n)),t&&t.push(r)}return t||i}function _n(i,e){return i.constructor==e.constructor&&i.eq(e)}function Lr(i,e){return i.length==e.length&&i.every((t,n)=>_n(t,e[n]))}function Hc(i,e){return i.prec<e.prec?"("+i.toString()+")":i.toString()}function _r(i){for(let e in i)return!0;return!1}function no(i,e,t){if(i.length!=e.length)return i.length-e.length;for(let n=0;n<i.length;n++){let r=t(i[n],e[n]);if(r)return r}return 0}function io(i,e){if(i.length==0||i==e)return e;if(e.length==0)return i;let t=i.slice();for(let n of e)i.includes(n)||t.push(n);return t.sort()}function Dm(i){return i>qc?"\u221E":i==10?"\\n":i==13?"\\r":i<32||i>=55296&&i<57343?"\\u{"+i.toString(16)+"}":String.fromCharCode(i)}function fx(i,e){let t=Object.create(null),n=Object.create(null);for(let r of i){let s=Ec(r.accepting),o=n[s]||(n[s]=[]);o.push(r),t[r.id]=o}for(;;){let r=!1,s=Object.create(null);for(let o of i){if(s[o.id])continue;let a=t[o.id];if(a.length==1){s[a[0].id]=a;continue}let l=[];e:for(let c of a){for(let h of l)if(mx(c,h[0],t)){h.push(c);continue e}l.push([c])}l.length>1&&(r=!0);for(let c of l)for(let h of c)s[h.id]=c}if(!r)return px(i,e,t);t=s}}function mx(i,e,t){if(i.edges.length!=e.edges.length)return!1;for(let n=0;n<i.edges.length;n++){let r=i.edges[n],s=e.edges[n];if(r.from!=s.from||r.to!=s.to||t[r.target.id]!=t[s.target.id])return!1}return!0}function px(i,e,t){for(let n of i)for(let r=0;r<n.edges.length;r++){let s=n.edges[r],o=t[s.target.id][0];o!=s.target&&(n.edges[r]=new ro(s.from,s.to,o))}return t[e.id][0]}function Nm(i){let e="";for(let t=0;t<i.length;t++)e+=String.fromCharCode(i[t].from);return e}function Ec(i){let e="";for(let t of i)e.length&&(e+="-"),e+=t.id;return e}function bx(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!=e[t])return!1;return!0}function yx(i){let e=[],t=[];for(let r of i)e.includes(r.from)||e.push(r.from),e.includes(r.to)||e.push(r.to);e.sort((r,s)=>r-s);for(let r=1;r<e.length;r++){let s=e[r-1],o=e[r],a=[];for(let l of i)if(l.to>s&&l.from<o)for(let c of l.target.closure())a.includes(c)||a.push(c);a.length&&t.push(new so(s,o,a))}let n=i.filter(r=>r.from==65535&&r.to==65535);if(n.length){let r=[];for(let s of n)for(let o of s.target.closure())r.includes(o)||r.push(o);r.length&&t.push(new so(65535,65535,r))}return t}function _x(i){let e=i.start,t=[],n=null,r=null,s=[],o=null,a=[],l=[],c=null,h=[],d=[],u=[],f=[],p=[],m=!1,g=!1;for(;i.type!="eof";){let b=i.start;if(i.eat("at","top"))i.type!="id"&&i.raise("Top rules must have a name",i.start),p.push(bn(i,Me(i))),m=!0;else if(i.type=="at"&&i.value=="tokens")r?i.raise("Multiple @tokens declaractions",i.start):r=Sx(i);else if(i.eat("at","local"))i.expect("id","tokens"),s.push(Cx(i,b));else if(i.eat("at","context")){c&&i.raise("Multiple @context declarations",b);let y=Me(i);i.expect("id","from");let _=i.expect("string");c=new yc(b,y,_)}else if(i.eat("at","external"))i.eat("id","tokens")?h.push(Ex(i,b)):i.eat("id","prop")?u.push(Tx(i,b)):i.eat("id","extend")?d.push(Bm(i,"extend",b)):i.eat("id","specialize")?d.push(Bm(i,"specialize",b)):i.eat("id","propSource")?f.push(Ax(i,b)):i.unexpected();else if(i.eat("at","dialects")){i.expect("{");for(let y=!0;!i.eat("}");y=!1)y||i.eat(","),l.push(Me(i))}else if(i.type=="at"&&i.value=="precedence")n&&i.raise("Multiple precedence declarations",i.start),n=kx(i);else if(i.eat("at","detectDelim"))g=!0;else if(i.eat("at","skip")){let y=Vc(i);if(i.type=="{"){i.next();let _=[],v=[];for(;!i.eat("}");)i.eat("at","top")?(v.push(bn(i,Me(i))),m=!0):_.push(bn(i));a.push({expr:y,topRules:v,rules:_})}else o&&i.raise("Multiple top-level skip declarations",i.start),o=y}else t.push(bn(i))}return m?new dc(e,t,p,r,s,c,h,d,f,n,o,a,l,u,g):i.raise("Missing @top declaration")}function bn(i,e){let t=e?e.start:i.start,n=e||Me(i),r=Or(i),s=[];if(i.eat("<"))for(;!i.eat(">");)s.length&&i.expect(","),s.push(Me(i));let o=Vc(i);return new Ar(t,n,r,s,o)}function Or(i){if(i.type!="[")return Qt;let e=[];for(i.expect("[");!i.eat("]");)e.length&&i.expect(","),e.push(xx(i));return e}function xx(i){let e=i.start,t=[],n=i.value,r=i.type=="at";if(!i.eat("at")&&!i.eat("id")&&i.unexpected(),i.eat("="))for(;;)if(i.type=="string"||i.type=="id")t.push(new Pn(i.start,i.value,null)),i.next();else if(i.eat("."))t.push(new Pn(i.start,".",null));else if(i.eat("{"))t.push(new Pn(i.start,null,i.expect("id"))),i.expect("}");else break;return new wi(e,r,n,t)}function Vc(i){i.expect("{");let e=kr(i);return i.expect("}"),e}function oo(i){let e=i.start;if(i.eat("(")){if(i.eat(")"))return new Be(e,Qt,[Qt,Qt]);let t=kr(i);return i.expect(")"),t}else if(i.type=="string"){let t=i.value;return i.next(),t.length==0?new Be(e,Qt,[Qt,Qt]):new $e(e,t)}else{if(i.eat("id","_"))return new to(e);
19if(i.type=="set"){let t=i.value,n=i.string[i.start]=="!",r=Tc(t.replace(/\\.|-|"/g,o=>o=="-"?sc:o=='"'?'\\"':o)),s=[];for(let o=0;o<r.length;){let a=r.codePointAt(o);if(o+=a>65535?2:1,o<r.length-1&&r[o]==sc){let l=r.codePointAt(o+1);o+=l>65535?3:2,l<a&&i.raise("Invalid character range",i.start),Lm(i,s,a,l+1)}else a==sc.charCodeAt(0)&&(a=45),Lm(i,s,a,a+1)}return i.next(),new eo(e,s.sort((o,a)=>o[0]-a[0]),n)}else if(i.type=="at"&&(i.value=="specialize"||i.value=="extend")){let{start:t,value:n}=i;i.next();let r=Or(i);i.expect("<");let s=kr(i),o;return i.eat(",")?o=kr(i):s instanceof $e?o=s:i.raise(`@${n} requires two arguments when its first argument isn't a literal string`),i.expect(">"),new yn(t,n,r,s,o)}else if(i.type=="at"&&Sc.hasOwnProperty(i.value)){let t=new Tr(i.start,i.value);return i.next(),t}else if(i.type=="["){let t=bn(i,new Zs(e,"_anon"));return t.params.length&&i.raise("Inline rules can't have parameters",t.start),new Zt(e,t)}else{let t=Me(i);if(i.type=="["||i.type=="{"){let n=bn(i,t);return n.params.length&&i.raise("Inline rules can't have parameters",n.start),new Zt(e,n)}else{if(i.eat(".")&&t.name=="std"&&Sc.hasOwnProperty(i.value)){let n=new Tr(e,i.value);return i.next(),n}return new Se(e,t,vx(i))}}}}function vx(i){let e=[];
19if(i.eat("<"))for(;!i.eat(">");)e.length&&i.expect(","),e.push(kr(i));return e}function Lm(i,e,t,n){e.every(([r,s])=>s<=t||r>=n)||i.raise("Overlapping character range",i.start),e.push([t,n])}function wx(i){let e=i.start,t=oo(i);for(;;){let n=i.type;if(i.eat("*")||i.eat("?")||i.eat("+"))t=new en(e,t,n);else return t}}function Om(i){return i.type=="}"||i.type==")"||i.type=="|"||i.type=="/"||i.type=="/\\"||i.type=="{"||i.type==","||i.type==">"}function Rm(i){let e=i.start,t=[],n=[Qt];do{for(;;){let r=i.start,s;if(i.eat("~"))s="ambig";else if(i.eat("!"))s="prec";else break;n[n.length-1]=n[n.length-1].concat(new kc(r,Me(i),s))}if(Om(i))break;t.push(wx(i)),n.push(Qt)}while(!Om(i));return t.length==1&&n.every(r=>r.length==0)?t[0]:new Be(e,t,n,!t.length)}function kr(i){let e=i.start,t=Rm(i);if(!i.eat("|"))return t;let n=[t];do n.push(Rm(i));while(i.eat("|"));let r=n.find(s=>s instanceof Be&&s.empty);return r&&i.raise("Empty expression in choice operator. If this is intentional, use () to make it explicit.",r.start),new Bt(e,n)}function Me(i){i.type!="id"&&i.unexpected();let e=i.start,t=i.value;return i.next(),new Zs(e,t)}function kx(i){let e=i.start;i.next(),i.expect("{");let t=[];for(;!i.eat("}");)t.length&&i.eat(","),t.push({id:Me(i),type:i.eat("at","left")?"left":i.eat("at","right")?"right":i.eat("at","cut")?"cut":null});return new uc(e,t)}function Sx(i){let e=i.start;i.next(),i.expect("{");let t=[],n=[],r=[],s=[];for(;!i.eat("}");)i.type=="at"&&i.value=="precedence"?r.push(Km(i)):i.type=="at"&&i.value=="conflict"?s.push(Mx(i)):i.type=="string"?n.push(new bc(i.start,i.expect("string"),Or(i))):t.push(bn(i));return new pc(e,r,s,t,n)}function Cx(i,e){i.expect("{");let t=[],n=[],r=null;for(;!i.eat("}");)i.type=="at"&&i.value=="precedence"?n.push(Km(i)):i.eat("at","else")&&!r?r={id:Me(i),props:Or(i)}:t.push(bn(i));return new gc(e,n,t,r)}function Km(i){let e=i.start;i.next(),i.expect("{");let t=[];for(;!i.eat("}");){t.length&&i.eat(",");let n=oo(i);n instanceof $e||n instanceof Se?t.push(n):i.raise("Invalid expression in token precedences",n.start)}return new fc(e,t)}function Mx(i){let e=i.start;i.next(),i.expect("{");
19let t=oo(i);t instanceof $e||t instanceof Se||i.raise("Invalid expression in token conflict",t.start),i.eat(",");let n=oo(i);return n instanceof $e||n instanceof Se||i.raise("Invalid expression in token conflict",n.start),i.expect("}"),new mc(e,t,n)}function Ym(i,e){let t=[],n=[];i.expect("{");for(let r=!0;!i.eat("}");r=!1)if(r||i.eat(","),e&&i.eat("at","conflict")){i.expect("{");for(let s=!0;!i.eat("}");s=!1)s||i.eat(","),n.push(Me(i))}else{let s=Me(i),o=Or(i);t.push({id:s,props:o})}return{tokens:t,conflicts:n}}function Ex(i,e){let t=Me(i);i.expect("id","from");let n=i.expect("string"),{tokens:r,conflicts:s}=Ym(i,!0);return new _c(e,t,n,r,s)}function Bm(i,e,t){let n=Vc(i),r=Me(i);i.expect("id","from");let s=i.expect("string");return new xc(t,e,n,r,s,Ym(i,!1).tokens)}function Ax(i,e){let t=Me(i);return i.expect("id","from"),new vc(e,t,i.expect("string"))}function Tx(i,e){let t=Me(i),n=i.eat("id","as")?Me(i):t;i.expect("id","from");let r=i.expect("string");return new wc(e,n,t,r)}function Tc(i){let e=/\\(?:u\{([\da-f]+)\}|u([\da-f]{4})|x([\da-f]{2})|([ntbrf0])|(.))|[^]/yig,t="",n;for(;n=e.exec(i);){let[r,s,o,a,l,c]=n;s||o||a?t+=String.fromCodePoint(parseInt(s||o||a,16)):l?t+=l=="n"?` 20`:l=="t"?" ":l=="0"?"\0":l=="r"?"\r":l=="f"?"\f":"\b":c?t+=c:t+=r}return t}function Sr(i,e){return(i<<5)+i+e}function Ix(i,e){for(let t=0;t<e.length;t++)i=Sr(i,e.charCodeAt(t));return i}function zm(i){let e=_e.none;for(let t of i)e=e.join(t.conflicts());return e}function Dx(i,e){for(let t of i)if(t.rule.name.repeated){for(let n of e)if(n.rule.name==t.rule.name){if(t.rule.
20isRepeatWrap&&t.pos==2)return 1;if(n.rule.isRepeatWrap&&n.pos==2)return-1}}return 0}function Nx(i,e){return i<e?-1:i>e?1:0}function jm(i,e,t,n){let r=[];for(let s=e+1;s<i.parts.length;s++){let o=i.parts[s],a=!1;if(o.terminal)Un(o,r);else for(let l of n[o.name])l==null?a=!0:Un(l,r);if(!a)return r}for(let s of t)Un(s,r);return r}function Xs(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(!i[t].eq(e[t]))return!1;return!0}function Pm(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!=e[t])return!1;return!0}function Ic(i){let e=5381;for(let t of i)e=Sr(e,t.hash);return e}function Lx(i,e){let t=[],n=[];function r(o,a,l,c,h){for(let d of o.rules){let u=t.find(f=>f.rule==d);if(!u){let f=i.find(p=>p.pos==0&&p.rule==d);u=f?new zt(d,0,f.ahead.slice(),f.ambigAhead,f.skipAhead,f.via):new zt(d,0,[],Oc,c,h),t.push(u)}if(u.skipAhead!=c)throw new _t("Inconsistent skip sets after "+h.trail());u.ambigAhead=io(u.ambigAhead,l);for(let f of a)u.ahead.includes(f)||(u.ahead.push(f),u.rule.parts.length&&!u.rule.parts[0].terminal&&Un(u,n))}}for(let o of i){let a=o.next;a&&!a.terminal&&r(a,jm(o.rule,o.pos,o.ahead,e),o.conflicts(o.pos+1).ambigGroups,o.pos==o.rule.parts.length-1?o.skipAhead:o.rule.skip,o)}for(;n.length;){let o=n.pop();r(o.rule.parts[0],jm(o.rule,0,o.ahead,e),io(o.rule.conflicts[1].ambigGroups,o.rule.parts.length==1?o.ambigAhead:Oc),o.rule.parts.length==1?o.skipAhead:o.rule.skip,o)}let s=i.slice();for(let o of t){o.ahead.sort((l,c)=>l.hash-c.hash),o.finish();let a=i.findIndex(l=>l.pos==0&&l.rule==o.rule);a>-1?s[a]=o:s.push(o)}return s.sort((o,a)=>o.cmp(a))}function Un(i,e){e.includes(i)||e.push(i)}function Ox(i){let e=Object.create(null);for(let t of i.terms)t.terminal||(e[t.name]=[]);for(;;){let t=!1;for(let n of i.terms)if(!n.terminal)for(let r of n.rules){let s=e[n.name],o=!1,a=s.length;for(let l of r.parts){if(o=!0,l.terminal)Un(l,s);else for(let c of e[l.name])c==null?o=!1:Un(c,s);if(o)break}o||Un(null,s),s.length>a&&(t=!0)}if(!t)return e}}function Rx(i,e){if(i.eqSimple(e))return"";function t(n,r){let s=[];for(let o=r.via;!o.eqSimple(n);o=o.via)s.push(o);return s.length?(s.unshift(r),s.reverse().map((o,a)=>` 21`+" ".repeat(a+1)+(o==r?"":"via ")+o).join("")):""}for(let n=i;n;n=n.via)for(let r=e;r;r=r.via)if(n.eqSimple(r))return` 22Shared origin: `+n+t(n,i)+t(n,e);return""}function Bx(i,e,t){let n=i,r=[];for(;;){for(let a=n.pos-1;a>=0;a--)r.push(n.rule.parts[a]);if(!n.via)break;n=n.via}r.reverse();let s=new Set;function o(a,l,c){if(l==r.length&&c&&!a.next)return` 23The reduction of ${i.rule.name} is allowed before ${e} because of this rule: 24 ${c}`;for(let h;h=a.next;){if(l<r.length&&h==r[l]){let f=o(a.advance(),l+1,c);if(f)return f}let d=a.rule.parts[a.pos+1],u=a.pos+1==a.rule.parts.length?c:null;d&&(d.terminal?d==e:t[d.name].includes(e))&&(u=a.advance());for(let f of h.rules){let p=(f.id<<5)+l+(u?555:0);if(!s.has(p)){s.add(p);let m=o(new zt(f,0,[],[],h,a),l,u);if(m)return m}}if(!h.terminal&&t[h.name].includes(null))a=a.advance();else break}return""}return o(n,0,null)}function zx(i,e,t){let n=[],r={},s={},o=Date.now();function a(c,h){if(c.length==0)return null;let d=Ic(c),u=s[d],f;for(let y of c)if(!f)f=y.skip;else if(f!=y.skip)throw new _t("Inconsistent skip sets after "+y.trail());if(u){for(let y of u)if(Xs(c,y.set)){if(y.state.skip!=f)throw new _t("Inconsistent skip sets after "+y.set[0].trail());return y.state}}let p=Lx(c,t),m=Ic(p),g=r[m]||(r[m]=[]),b;if(!h)for(let y of g)y.hasSet(p)&&(b=y);return b||(b=new ao(n.length,p,0,f,m,h),g.push(b),n.push(b),Dr&&n.length%500==0&&console.log(`${n.length} states after ${((Date.now()-o)/1e3).toFixed(2)}s`)),(s[d]||(s[d]=[])).push(new Nc(c,b)),b}for(let c of e){let h=c.rules.length?c.rules[0].skip:i.names["%noskip"];a(c.rules.map(d=>new zt(d,0,[i.eof],Oc,h,null).finish()),c)}let l=new Dc(t);for(let c=0;c<n.length;c++){let h=n[c],d=[],u=[],f=[];for(let m of h.set)if(m.pos==m.rule.parts.length)m.rule.name.top||f.push(m);else{let g=m.rule.parts[m.pos],b=d.indexOf(g);b<0?(d.push(g),u.push([m])):u[b].push(m)}for(let m=0;m<d.length;m++){let g=d[m],b=u[m].map(y=>y.advance());if(g.terminal){let y=jx(b),_=a(y);_&&h.addAction(new He(g,_),u[m],l)}else{let y=a(b);y&&h.goto.push(new He(g,y))}}let p=!1;for(let m of f)for(let g of m.ahead){let b=h.actions.length;h.addAction(new jt(g,m.rule),[m],l),h.actions.length==b&&(p=!0)}if(p)for(let m=0;m<h.goto.length;m++)t[h.goto[m].term.name].some(b=>h.actions.some(y=>y.term==b&&y instanceof He))||h.goto.splice(m--,1)}if(l.conflicts.length)throw new _t(l.conflicts.map(c=>c.error).join(` 25 26`));for(let c of n)c.finish();
26return Dr&&console.log(`${n.length} states total.`),n}function jx(i){let e=null,t=1;for(let n of i){let r=n.rule.conflicts[n.pos-1].cut;r<t||((!e||r>t)&&(t=r,e=[]),e.push(n))}return e||i}function Um(i,e,t){for(let r of i.goto)for(let s of e.goto)if(r.term==s.term&&t[r.target.id]!=t[s.target.id])return!1;let n=e.actionsByTerm();for(let r of i.actions){let s=n[r.term.id];if(s&&s.some(o=>!o.matches(r,t))){if(s.length==1)return!1;let o=i.actionsByTerm()[r.term.id];if(o.length!=s.length||o.some(a=>!s.some(l=>a.matches(l,t))))return!1}}return!0}function Px(i,e){let t=[];for(let n of i){let r=e[n.id];t[r]||(t[r]=new ao(r,n.set,0,n.skip,n.hash,n.startRule),t[r].tokenGroup=n.tokenGroup,t[r].defaultReduce=n.defaultReduce)}for(let n of i){let r=e[n.id],s=t[r];s.flags|=n.flags;for(let o=0;o<n.actions.length;o++){let a=n.actions[o].map(e,t);s.actions.some(l=>l.eq(a))||(s.actions.push(a),s.actionPositions.push(n.actionPositions[o]))}for(let o of n.goto){let a=o.map(e,t);s.goto.some(l=>l.eq(a))||s.goto.push(a)}}return t}function Ux(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(!i[t].eqSimple(e[t]))return!1;return!0}function Fx(i){let e=[],t=[];e:for(let r=0;r<i.length;r++){let s=i[r];if(!s.startRule)for(let o=0;o<t.length;o++){let a=t[o],l=i[a.members[0]];if(s.tokenGroup==l.tokenGroup&&s.skip==l.skip&&!l.startRule&&Ux(s.set,l.set)){a.members.push(r),e.push(o);continue e}}e.push(t.length),t.push(new lo(t.length,r))}function n(r,s){let o=t[r],a=i[o.members[s]],l=o.members.pop();s!=o.members.length&&(o.members[s]=l);for(let c=r+1;c<t.length;c++)if(e[a.id]=c,t[c].origin==o.origin&&t[c].members.every(h=>Um(a,i[h],e))){t[c].members.push(a.id);return}e[a.id]=t.length,t.push(new lo(o.origin,a.id))}for(let r=1;;r++){let s=!1,o=Date.now();for(let a=0,l=t.length;a<l;a++){let c=t[a];for(let h=0;h<c.members.length-1;h++)for(let d=h+1;d<c.members.length;d++){let u=c.members[h],f=c.members[d];Um(i[u],i[f],e)||(s=!0,n(a,d--))}}if(Dr&&console.log(`Collapse pass ${r}${s?"":", done"} (${((Date.now()-o)/1e3).toFixed(2)}s)`),!s)return Px(i,e)}}function $x(i){for(let e=1;;e++){let t=[],n=!1,r=Date.now(),s=[];for(let o=0;o<i.length;o++){let a=i[o],l=s.findIndex(c=>a.eq(c));if(l<0)t[o]=s.length,s.push(a);else{t[o]=l,n=!0;let c=s[l],h=null;for(let d of a.set)c.set.some(u=>u.eqSimple(d))||(h||(h=[])).push(d);h&&(c.set=h.concat(c.set).sort((d,u)=>d.cmp(u)))}}if(Dr&&console.log(`Merge identical pass ${e}${n?"":", done"} (${((Date.now()-r)/1e3).toFixed(2)}s)`),!n)return i;for(let o of s)o.defaultReduce||(o.actions=o.actions.map(a=>a.map(t,s)),o.goto=o.goto.map(a=>a.map(t,s)));for(let o=0;o<s.length;o++)s[o].id=o;i=s}}function Hx(i){return $x(Fx(i))}function qx(i){let e=i+32;return e>=34&&e++,e>=92&&e++,String.fromCharCode(e)}function Fm(i,e=65535){if(i>e)throw new Error("Trying to encode a number that's too big: "+i);if(i==65535)return String.fromCharCode(126);let t="";for(let n=46;;n=0){let r=i%46,s=i-r;if(t=qx(r+n)+t,s==0)break;i=s/46}return t}function vr(i,e=65535){let t='"'+Fm(i.length,4294967295);for(let n=0;n<i.length;n++)t+=Fm(i[n],e);return t+='"',t}function ht(...i){return new Ze(i,null)}function Qs(i){if(i instanceof $e)return i.value;if(i instanceof Be){let e="";for(let t of i.exprs){let n=Qs(t);if(n==null)return null;e+=n}return e}return null}function $m(i,e,t){let n=i.props[e];(!n||n.split(" ").indexOf(t)<0)&&(i.props[e]=n?n+" "+t:t)}function Vx(i){let e=Object.create(null);for(let{value:t,term:n,type:r}of i){let s=r=="specialize"?0:1;e[t]=n.id<<1|s}return e}function Mr(i,e,t=i.parts.length){return i.name.id|65536|(i.isRepeatWrap&&t==i.parts.length?131072:0)|(e.some(n=>n.rule==i.name)?262144:0)|t<<19}function Wx(i,e){e:for(let t=0;;){let n=i.indexOf(e[0],t);if(n==-1||n+e.length>i.length)break;for(let r=1;r<e.length;r++)if(e[r]!=i[n+r]){t=n+1;continue e}return n}return-1}function Gx(i,e){let t=Object.create(null),n=[],r=s=>{t[s.id]||(t[s.id]=!0,n.push(s))};for(let s of i)s.startRule&&e.includes(s.startRule)&&r(s);for(let s=0;s<n.length;s++){for(let o of n[s].actions)o instanceof He&&r(o.target);for(let o of n[s].goto)r(o.target)}return s=>!t[s]}function Jx(i){let e={},t=0;for(let o of i)for(let a of o.goto){t=Math.max(a.term.id,t);let l=e[a.term.id]||(e[a.term.id]={});(l[a.target.id]||(l[a.target.id]=[])).push(o.id)}let n=new co,r=[],s=t+2;for(let o=0;o<=t;o++){let a=e[o];if(!a){r.push(1);continue}let l=[],c=Object.keys(a);for(let h of c){let d=a[h];l.push((h==c[c.length-1]?1:0)+(d.length<<1)),l.push(+h);for(let u of d)l.push(u)}r.push(n.storeArray(l)+s)}if(r.some(o=>o>65535))throw new _t("Goto table too large");return Uint16Array.from([t+1,...r,...n.data])}function wr(i,e){i.includes(e)||i.push(e)}function Kx(i){let e=Object.create(null);for(let t of i){let n=1<<t.groupID;for(let r of t.tokens)e[r.id]=(e[r.id]||0)|n}return e}function Yx(i,e,t){let n=Object.create(null);function r(s,o){return s.actions.some(a=>a.term==o)||t[e.skipRules.indexOf(s.skip)].startTokens.includes(o)}return(s,o)=>{s.id<o.id&&([s,o]=[o,s]);let a=s.id|o.id<<16,l=n[a];return l??(n[a]=i.some(c=>r(c,s)&&r(c,o)))}}function Xx(i){let e=0,t=[];for(let[n,r]of i)n>e&&t.push([e,n]),e=r;return e<=Vm&&t.push([e,Vm+1]),t}function Qx(i,e,t,n){if(t<ac&&(t<Hm&&i.edge(t,Math.min(n,Hm),e),n>qm&&i.edge(Math.max(t,qm),Math.min(n,qc+1),e),t=ac),n<=ac)return;let r=String.fromCodePoint(t),s=String.fromCodePoint(n-1),o=r.charCodeAt(0),a=r.charCodeAt(1),l=s.charCodeAt(0),c=s.charCodeAt(1);if(o==l){let h=new Qe;i.edge(o,o+1,h),h.edge(a,c+1,e)}else{let h=o,d=l;if(a>lc){h++;let u=new Qe;i.edge(o,o+1,u),u.edge(a,cc+1,e)}if(c<cc){d--;let u=new Qe;i.edge(l,l+1,u),u.edge(lc,c+1,e)}if(h<=d){let u=new Qe;i.edge(h,d+1,u),u.edge(lc,cc+1,e)}}}function Xm(i){return i instanceof Be&&i.exprs.length==0}function Qm(i,e){let t=Object.create(null);for(let n of e){i.unique(n.id);let{name:r,props:s,dialect:o}=i.nodeInfo(n.props,"d",n.id.name),a=i.makeTerminal(n.id.name,r,s);o!=null&&(i.tokens.byDialect[o]||(i.tokens.byDialect[o]=[])).push(a),i.namedTerms[n.id.name]=t[n.id.name]=a}return t}function Zm(i,e,t){let n=e[t.id.name];return n?(t.args.length&&i.raise("External tokens cannot take arguments",t.args[0].start),i.used(t.id.name),n):null}function hc(i,e,t){let n=i.findIndex(r=>r.term==e);n<0?i.push({term:e,after:t}):i[n]={term:e,after:i[n].after.concat(t)}}function Zx(i,e){for(let t=0;;t++){let n=Object.create(null),r;if(t==0){for(let o of i)if(o.name.inline&&!n[o.name.name]){let a=i.filter(l=>l.name==o.name);if(a.some(l=>l.parts.includes(o.name)))continue;r=n[o.name.name]=a}}for(let o=0;o<i.length;o++){let a=i[o];!a.name.interesting&&!a.parts.includes(a.name)&&a.parts.length<3&&!e.includes(a.name)&&(a.parts.length==1||i.every(l=>l.skip==a.skip||!l.parts.includes(a.name)))&&!a.parts.some(l=>!!n[l.name])&&!i.some((l,c)=>c!=o&&l.name==a.name)&&(r=n[a.name.name]=[a])}if(!r)return i;let s=[];
26for(let o of i){let a=function(l,c,h){if(l==o.parts.length){s.push(new Ir(o.name,h,c,o.skip));return}let d=o.parts[l],u=n[d.name];if(!u){a(l+1,c.concat(o.conflicts[l+1]),h.concat(d));return}for(let f of u)a(l+1,c.slice(0,c.length-1).concat(c[l].join(f.conflicts[0])).concat(f.conflicts.slice(1,f.conflicts.length-1)).concat(o.conflicts[l+1].join(f.conflicts[f.conflicts.length-1])),h.concat(f.parts))};if(!n[o.name.name]){if(!o.parts.some(l=>!!n[l.name])){s.push(o);continue}a(0,[o.conflicts[0]],[])}}i=s}}function ev(i){let e=Object.create(null),t;for(let r=0;r<i.length;){let s=r,o=i[r++].name;for(;r<i.length&&i[r].name==o;)r++;let a=r-s;if(!o.interesting)for(let l=r;l<i.length;){let c=l,h=i[l++].name;for(;l<i.length&&i[l].name==h;)l++;if(l-c!=a||h.interesting)continue;let d=!0;for(let u=0;u<a&&d;u++){let f=i[s+u],p=i[c+u];f.cmpNoName(p)!=0&&(d=!1)}d&&(t=e[o.name]=h)}}if(!t)return i;let n=[];for(let r of i)e[r.name.name]||n.push(r.parts.every(s=>!e[s.name])?r:new Ir(r.name,r.parts.map(s=>e[s.name]||s),r.conflicts,r.skip));return n}function tv(i,e){return ev(Zx(i,e))}function ep(i,e={}){let t=new Rc(i,e),n=t.getParser();return n.termTable=t.termTable,n}function nv(i){let e=i[0];return e=="_"||e.toUpperCase()!=e}function iv(i){return i.props.some(e=>e.at&&e.name=="export")}var be,dc,Ar,uc,fc,mc,pc,gc,bc,yc,_c,xc,vc,wc,Zs,et,Se,yn,Zt,Bt,Be,kc,en,$e,eo,to,Sc,Tr,wi,Pn,_t,hx,Cc,Mc,dx,_e,ux,Ir,qc,ro,gx,Qe,Jm,so,xr,Qt,Ac,sc,Cr,Dr,jn,zt,He,jt,Dc,ao,Nc,Lc,lo,Oc,ke,Ze,ki,Rc,oc,Bc,co,zc,jc,Pc,ho,Uc,Fc,ac,Hm,qm,Vm,lc,cc,Nr,Er,Wm,tp=E(()=>{Jr();h0();be=class{constructor(e){this.start=e}},dc=class extends be{constructor(e,t,n,r,s,o,a,l,c,h,d,u,f,p,m){super(e),this.rules=t,this.topRules=n,this.tokens=r,this.localTokens=s,this.context=o,this.externalTokens=a,this.externalSpecializers=l,this.externalPropSources=c,this.precedences=h,this.mainSkip=d,this.scopedSkip=u,this.dialects=f,this.externalProps=p,this.autoDelim=m}toString(){return Object.values(this.rules).join(` 27`)}},Ar=class extends be{constructor(e,t,n,r,s){super(e),this.id=t,this.props=n,this.params=r,this.expr=s}toString(){return this.id.name+(this.params.length?`<${this.params.join()}>`:"")+" -> "+this.expr}},uc=class extends be{constructor(e,t){super(e),this.items=t}},fc=class extends be{constructor(e,t){super(e),this.items=t}},mc=class extends be{constructor(e,t,n){super(e),this.a=t,this.b=n}},pc=class extends be{constructor(e,t,n,r,s){super(e),this.precedences=t,this.conflicts=n,this.rules=r,this.literals=s}},gc=class extends be{constructor(e,t,n,r){super(e),this.precedences=t,this.rules=n,this.fallback=r}},bc=class extends be{constructor(e,t,n){super(e),this.literal=t,this.props=n}},yc=class extends be{constructor(e,t,n){super(e),this.id=t,this.source=n}},_c=class extends be{constructor(e,t,n,r,s){super(e),this.id=t,this.source=n,this.tokens=r,this.conflicts=s}},xc=class extends be{constructor(e,t,n,r,s,o){super(e),this.type=t,this.token=n,this.id=r,this.source=s,this.tokens=o}},vc=class extends be{constructor(e,t,n){super(e),this.id=t,this.source=n}},wc=class extends be{constructor(e,t,n,r){super(e),this.id=t,this.externalID=n,this.source=r}},Zs=class extends be{constructor(e,t){super(e),this.name=t}toString(){return this.name}},et=class extends be{walk(e){return e(this)}eq(e){return!1}};et.prototype.prec=10;Se=class extends et{constructor(e,t,n){super(e),this.id=t,this.args=n}toString(){return this.id.name+(this.args.length?`<${this.args.join()}>`:"")}eq(e){return this.id.name==e.id.name&&Lr(this.args,e.args)}walk(e){let t=$c(this.args,e);return e(t==this.args?this:new Se(this.start,this.id,t))}},yn=class extends et{constructor(e,t,n,r,s){super(e),this.type=t,this.props=n,this.token=r,this.content=s}toString(){return`@${this.type}[${this.props.join(",")}]<${this.token}, ${this.content}>`}eq(e){return this.type==e.type&&wi.eqProps(this.props,e.props)&&_n(this.token,e.token)&&_n(this.content,e.content)}walk(e){let t=this.token.walk(e),n=this.content.walk(e);return e(t==this.token&&n==this.content?this:new yn(this.start,this.type,this.props,t,n))}},Zt=class extends et{constructor(e,t){super(e),this.rule=t}toString(){let e=this.rule;return`${e.id}${e.props.length?`[${e.props.join(",")}]`:""} { ${e.expr} }`}eq(e){let t=this.rule,n=e.rule;return _n(t.expr,n.expr)&&t.id.name==n.id.name&&wi.eqProps(t.props,n.props)}walk(e){let t=this.rule,n=t.expr.walk(e);return e(n==t.expr?this:new Zt(this.start,new Ar(t.start,t.id,t.props,[],n)))}},Bt=class extends et{constructor(e,t){super(e),this.exprs=t}toString(){return this.exprs.map(e=>Hc(e,this)).join(" | ")}eq(e){return Lr(this.exprs,e.exprs)}walk(e){let t=$c(this.exprs,e);return e(t==this.exprs?this:new Bt(this.start,t))}};Bt.prototype.prec=1;Be=class extends et{constructor(e,t,n,r=!1){super(e),this.exprs=t,this.markers=n,this.empty=r}toString(){return this.empty?"()":this.exprs.map(e=>Hc(e,this)).join(" ")}eq(e){return Lr(this.exprs,e.exprs)&&this.markers.every((t,n)=>{let r=e.markers[n];return t.length==r.length&&t.every((s,o)=>s.eq(r[o]))})}walk(e){let t=$c(this.exprs,e);return e(t==this.exprs?this:new Be(this.start,t,this.markers,this.empty&&!t.length))}};Be.prototype.prec=2;kc=class extends be{constructor(e,t,n){super(e),this.id=t,this.type=n}toString(){return(this.type=="ambig"?"~":"!")+this.id.name}eq(e){return this.id.name==e.id.name&&this.type==e.type}},en=class extends et{constructor(e,t,n){super(e),this.expr=t,this.kind=n}toString(){return Hc(this.expr,this)+this.kind}eq(e){return _n(this.expr,e.expr)&&this.kind==e.kind}walk(e){let t=this.expr.walk(e);return e(t==this.expr?this:new en(this.start,t,this.kind))}};en.prototype.prec=3;$e=class extends et{constructor(e,t){super(e),this.value=t}toString(){return JSON.stringify(this.value)}eq(e){return this.value==e.value}},eo=class extends et{constructor(e,t,n){super(e),this.ranges=t,this.inverted=n}toString(){return`[${this.inverted?"^":""}${this.ranges.map(([e,t])=>String.fromCodePoint(e)+(t==e+1?"":"-"+String.fromCodePoint(t)))}]`}eq(e){return this.inverted==e.inverted&&this.ranges.length==e.ranges.length&&this.ranges.every(([t,n],r)=>
27{let[s,o]=e.ranges[r];return t==s&&n==o})}},to=class extends et{constructor(e){super(e)}toString(){return"_"}eq(){return!0}};Sc={asciiLetter:[[65,91],[97,123]],asciiLowercase:[[97,123]],asciiUppercase:[[65,91]],digit:[[48,58]],whitespace:[[9,14],[32,33],[133,134],[160,161],[5760,5761],[8192,8203],[8232,8234],[8239,8240],[8287,8288],[12288,12289]],eof:[[65535,65535]]},Tr=class extends et{constructor(e,t){super(e),this.type=t}toString(){return"@"+this.type}eq(e){return this.type==e.type}};wi=class extends be{constructor(e,t,n,r){super(e),this.at=t,this.name=n,this.value=r}eq(e){return this.name==e.name&&this.value.length==e.value.length&&this.value.every((t,n)=>t.value==e.value[n].value&&t.name==e.value[n].name)}toString(){let e=(this.at?"@":"")+this.name;if(this.value.length){e+="=";for(let{name:t,value:n}of this.value)e+=t?`{${t}}`:/[^\w-]/.test(n)?JSON.stringify(n):n}return e}static eqProps(e,t){return e.length==t.length&&e.every((n,r)=>n.eq(t[r]))}},Pn=class extends be{constructor(e,t,n){super(e),this.value=t,this.name=n}};_t=class extends Error{};hx=0,Cc=class{constructor(e,t,n,r={}){this.name=e,this.flags=t,this.nodeName=n,this.props=r,this.hash=++hx,this.id=-1,this.rules=[]}toString(){return this.name}get nodeType(){return this.top||this.nodeName!=null||_r(this.props)||this.repeated}get terminal(){return(this.flags&1)>0}get eof(){return(this.flags&4)>0}get error(){return"error"in this.props}get top(){return(this.flags&2)>0}get interesting(){return this.flags>0||this.nodeName!=null}get repeated(){return(this.flags&16)>0}set preserve(e){this.flags=e?this.flags|8:this.flags&-9}get preserve(){return(this.flags&8)>0}set inline(e){this.flags=e?this.flags|32:this.flags&-33}get inline(){return(this.flags&32)>0}cmp(e){return this.hash-e.hash}},Mc=class{constructor(){this.terms=[],this.names=Object.create(null),this.tops=[],this.eof=this.term("\u2404",null,5),this.error=this.term("\u26A0","\u26A0",8)}term(e,t,n=0,r={}){let s=new Cc(e,n,t,r);return this.terms.push(s),this.names[e]=s,s}makeTop(e,t){let n=this.term("@top",e,2,t);return this.tops.push(n),n}makeTerminal(e,t,n={}){return this.term(e,t,1,n)}makeNonTerminal(e,t,n={}){return this.term(e,t,0,n)}makeRepeat(e){return this.term(e,null,16)}uniqueName(e){for(let t=0;;t++){let n=t?`${e}-${t}`:e;if(!this.names[n])return n}}finish(e){for(let o of e)o.name.rules.push(o);this.terms=this.terms.filter(o=>o.terminal||o.preserve||e.some(a=>a.name==o||a.parts.includes(o)));let t={},n=[this.error];this.error.id=0;let r=0+1;for(let o of this.terms)o.id<0&&o.nodeType&&!o.repeated&&(o.id=r++,n.push(o));let s=r;for(let o of this.terms)o.repeated&&(o.id=r++,n.push(o));this.eof.id=r++;for(let o of this.terms)o.id<0&&(o.id=r++),o.name&&(t[o.id]=o.name);if(r>=65534)throw new _t("Too many terms");return{nodeTypes:n,names:t,minRepeatTerm:s,maxTerm:r-1}}};dx=[],_e=class{constructor(e,t=dx,n=0){this.precedence=e,this.ambigGroups=t,this.cut=n}join(e){return this==_e.none||this==e?e:e==_e.none?this:new _e(Math.max(this.precedence,e.precedence),io(this.ambigGroups,e.ambigGroups),Math.max(this.cut,e.cut))}cmp(e){return this.precedence-e.precedence||no(this.ambigGroups,e.ambigGroups,(t,n)=>t<n?-1:t>n?1:0)||this.cut-e.cut}};_e.none=new _e(0);ux=0,Ir=class{constructor(e,t,n,r){this.name=e,this.parts=t,this.conflicts=n,this.skip=r,this.id=ux++}cmp(e){return this.id-e.id}cmpNoName(e){return this.parts.length-e.parts.length||this.skip.hash-e.skip.hash||this.parts.reduce((t,n,r)=>t||n.cmp(e.parts[r]),0)||no(this.conflicts,e.conflicts,(t,n)=>t.cmp(n))}toString(){return this.name+" -> "+this.parts.join(" ")}get isRepeatWrap(){return this.name.repeated&&this.parts.length==2&&this.parts[0]==this.name}sameReduce(e){return this.name==e.name&&this.parts.length==e.parts.length&&this.isRepeatWrap==e.isRepeatWrap}},qc=65535,ro=class{constructor(e,t,n){this.from=e,this.to=t,this.target=n}toString(){return`-> ${this.target.id}[label=${JSON.stringify(this.from<0?"\u03B5":Dm(this.from)+(this.to>this.from+1?"-"+Dm(this.to-1):""))}]`}};gx=1,Qe=class Gm{constructor(e=[],t=gx++){this.accepting=e,this.id=t,this.edges=[]}edge(e,t,n){this.edges.push(new ro(e,t,n))}nullEdge(e){this.edge(-1,-1,e)}compile(){let e=Object.create(null),t=0,n=r(this.closure().sort((s,o)=>s.id-o.id));return fx(Object.values(e),n);function r(s){let o=e[Ec(s)]=new Gm(s.reduce((c,h)=>io(c,h.accepting),[]),t++),a=[];for(let c of s)for(let h of c.edges)h.from>=0&&a.push(h);let l=yx(a);for(let c of l){let h=c.targets.sort((d,u)=>d.id-u.id);o.edge(c.from,c.to,e[Ec(h)]||r(h))}return o}}closure(){let e=[],t=Object.create(null);function n(r){if(!t[r.id]){t[r.id]=!0,(r.edges.some(s=>s.from>=0)||r.accepting.length>0&&!r.edges.some(s=>bx(r.accepting,s.target.accepting)))&&e.push(r);for(let s of r.edges)s.from<0&&n(s.target)}}return n(this),e}findConflicts(e){let t=[],n=this.cycleTerms();function r(s,o,a,l,c){s.id<o.id&&([s,o]=[o,s],a=-a);let h=t.find(d=>d.a==s&&d.b==o);h?h.soft!=a&&(h.soft=0):t.push(new Jm(s,o,a,Nm(l),c&&Nm(c)))}return this.reachable((s,o)=>
27{if(s.accepting.length!=0){for(let a=0;a<s.accepting.length;a++)for(let l=a+1;l<s.accepting.length;l++)r(s.accepting[a],s.accepting[l],0,o);s.reachable((a,l)=>{if(a!=s)for(let c of a.accepting){let h=n.includes(c);for(let d of s.accepting)c!=d&&r(c,d,h||n.includes(d)||!e(c,d)?0:1,o,o.concat(l))}})}}),t}cycleTerms(){let e=[];this.reachable(s=>{for(let{target:o}of s.edges)e.push(s,o)});let t=new Map,n=[];for(let s=0;s<e.length;){let o=e[s++],a=e[s++],l=t.get(o);if(l||t.set(o,l=[]),!l.includes(a))if(o==a)n.includes(o)||n.push(o);else{for(let c of l)e.push(o,c);l.push(a)}}let r=[];for(let s of n)for(let o of s.accepting)r.includes(o)||r.push(o);return r}reachable(e){let t=[],n=[];(function r(s){e(s,n),t.push(s);for(let o of s.edges)t.includes(o.target)||(n.push(o),r(o.target),n.pop())})(this)}toString(){let e=`digraph { 28`;return this.reachable(t=>{t.accepting.length&&(e+=` ${t.id} [label=${JSON.stringify(t.accepting.join())}]; 29`);for(let n of t.edges)e+=` ${t.id} ${n}; 30`}),e+"}"}toArray(e,t){let n=[],r=[];this.reachable(s=>{let o=r.length,a=o+3+s.accepting.length*2;n[s.id]=o,r.push(s.stateMask(e),a,s.edges.length),s.accepting.sort((l,c)=>t.indexOf(l.id)-t.indexOf(c.id));for(let l of s.accepting)r.push(l.id,e[l.id]||65535);for(let l of s.edges)r.push(l.from,l.to,-l.target.id-1)});for(let s=0;s<r.length;s++)r[s]<0&&(r[s]=n[-r[s]-1]);if(r.length>Math.pow(2,16))throw new _t("Tokenizer tables too big to represent with 16-bit offsets.");return Uint16Array.from(r)}stateMask(e){let t=0;return this.reachable(n=>{for(let r of n.accepting)t|=e[r.id]||65535}),t}},Jm=class{constructor(e,t,n,r,s){this.a=e,this.b=t,this.soft=n,this.exampleA=r,this.exampleB=s}};so=class{constructor(e,t,n){this.from=e,this.to=t,this.targets=n}};xr=/[\w_-]+/gy;try{xr=/[\p{Alphabetic}\d_-]+/ugy}catch{}Qt=[],Ac=class{constructor(e,t=null){this.string=e,this.fileName=t,this.type="sof",this.value=null,this.start=0,this.end=0,this.next()}lineInfo(e){for(let t=1,n=0;;){let r=this.string.indexOf(` 31`,n);if(r>-1&&r<e)++t,n=r+1;else return{line:t,ch:e-n}}}message(e,t=-1){let n=this.fileName||"";if(t>-1){let r=this.lineInfo(t);n+=(n?" ":"")+r.line+":"+r.ch}return n?e+` (${n})`:e}raise(e,t=-1){throw new _t(this.message(e,t))}match(e,t){let n=t.exec(this.string.slice(e));return n?e+n[0].length:-1}next(){let e=this.match(this.end,/^(\s|\/\/.*|\/\*[^]*?\*\/)*/);if(e==this.string.length)return this.set("eof",null,e,e);let t=this.string[e];if(t=='"'){let n=this.match(e+1,/^(\\.|[^"\\])*"/);return n==-1&&this.raise("Unterminated string literal",e),this.set("string",Tc(this.string.slice(e+1,n-1)),e,n)}else if(t=="'"){let n=this.match(e+1,/^(\\.|[^'\\])*'/);return n==-1&&this.raise("Unterminated string literal",e),this.set("string",Tc(this.string.slice(e+1,n-1)),e,n)}else if(t=="@"){xr.lastIndex=e+1;let n=xr.exec(this.string);return n?this.set("at",n[0],e,e+1+n[0].length):this.raise("@ without a name",e)}else if((t=="$"||t=="!")&&this.string[e+1]=="["){let n=this.match(e+2,/^(?:\\.|[^\]\\])*\]/);return n==-1&&this.raise("Unterminated character set",e),this.set("set",this.string.slice(e+2,n-1),e,n)}else{if(/[\[\]()!~+*?{}<>\.,|:$=]/.test(t))return this.set(t,null,e,e+1);{xr.lastIndex=e;let n=xr.exec(this.string);return n?this.set("id",n[0],e,e+n[0].length):this.raise("Unexpected character "+JSON.stringify(t),e)}}}set(e,t,n,r){this.type=e,this.value=t,this.start=n,this.end=r}eat(e,t=null){return this.type==e&&(t==null||this.value===t)?(this.next(),!0):!1}unexpected(){return this.raise(`Unexpected token '${this.string.slice(this.start,this.end)}'`,this.start)}expect(e,t=null){let n=this.value;return(this.type!=e||!(t==null||n===t))&&this.unexpected(),this.next(),n}parse(){return _x(this)}};sc="\uFDDA";Cr=typeof process<"u"&&process.env.LOG||"",Dr=/\btime\b/.test(Cr),jn=Dr?(i,e)=>{let t=Date.now(),n=e();return console.log(`${i} (${((Date.now()-t)/1e3).toFixed(2)}s)`),n}:(i,e)=>e(),zt=class{constructor(e,t,n,r,s,o){this.rule=e,this.pos=t,this.ahead=n,this.ambigAhead=r,this.skipAhead=s,this.via=o,this.hash=0}finish(){let e=Sr(Sr(this.rule.id,this.pos),this.skipAhead.hash);for(let t of this.ahead)e=Sr(e,t.hash);for(let t of this.ambigAhead)e=Ix(e,t);return this.hash=e,this}get next(){return this.pos<this.rule.parts.length?this.rule.parts[this.pos]:null}advance(){return new zt(this.rule,this.pos+1,this.ahead,this.ambigAhead,this.skipAhead,this.via).finish()}get skip(){return this.pos==this.rule.parts.length?this.skipAhead:this.rule.skip}cmp(e){return this.rule.cmp(e.rule)||this.pos-e.pos||this.skipAhead.hash-e.skipAhead.hash||no(this.ahead,e.ahead,(t,n)=>t.cmp(n))||no(this.ambigAhead,e.ambigAhead,Nx)}eqSimple(e){return e.rule==this.rule&&e.pos==this.pos}toString(){let e=this.rule.parts.map(t=>t.name);return e.splice(this.pos,0,"\xB7"),`${this.rule.name} -> ${e.join(" ")}`}eq(e){return this==e||this.hash==e.hash&&this.rule==e.rule&&this.pos==e.pos&&this.skipAhead==e.skipAhead&&Pm(this.ahead,e.ahead)&&Pm(this.ambigAhead,e.ambigAhead)}trail(e=60){let t=[];for(let r=this;r;r=r.via)for(let s=r.pos-1;s>=0;s--)t.push(r.rule.parts[s]);let n=t.reverse().join(" ");return n.length>e&&(n=n.slice(n.length-e).replace(/.*? /,"\u2026 ")),n}conflicts(e=this.pos){let t=this.rule.conflicts[e];return e==this.rule.parts.length&&this.ambigAhead.length&&(t=t.join(new _e(0,this.ambigAhead))),t}static addOrigins(e,t){let n=e.slice();for(let r=0;r<n.length;r++){let s=n[r];if(s.pos==0)for(let o of t)o.next==s.rule.name&&!n.includes(o)&&n.push(o)}return n}};He=class{constructor(e,t){this.term=e,this.target=t}eq(e){return e instanceof He&&this.term==e.term&&e.target.id==this.target.id}cmp(e){return e instanceof jt?-1:this.term.id-e.term.id||this.target.id-e.target.id}matches(e,t){return e instanceof He&&t[e.target.id]==t[this.target.id]}toString(){return"s"+this.target.id}map(e,t){let n=t[e[this.target.id]];return n==this.target?this:new He(this.term,n)}},jt=class{constructor(e,t){this.term=e,this.rule=t}eq(e){return e instanceof jt&&this.term==e.term&&e.rule.sameReduce(this.rule)}cmp(e){return e instanceof He?1:this.term.id-e.term.id||this.rule.name.id-e.rule.name.id||this.rule.parts.length-e.rule.parts.length}matches(e,t){return e instanceof jt&&e.rule.sameReduce(this.rule)}toString(){return`${this.rule.name.name}(${this.rule.parts.length})`}map(){return this}};Dc=class{constructor(e){this.first=e,this.conflicts=[]}},ao=class{constructor(e,t,n=0,r,s=Ic(t),o=null){this.id=e,this.set=t,this.flags=n,this.skip=r,this.hash=s,this.startRule=o,this.actions=[],this.actionPositions=[],this.goto=[],this.tokenGroup=-1,this.defaultReduce=null,this._actionsByTerm=null}toString(){let e=this.actions.map(t=>t.term+"="+t).join(",")+(this.goto.length?" | "+this.goto.map(t=>t.term+"="+t).join(","):"");return this.id+": "+this.set.filter(t=>t.pos>0).join()+(this.defaultReduce?` 32 always ${this.defaultReduce.name}(${this.defaultReduce.parts.length})`:e.length?` 33 `+e:"")}addActionInner(e,t){e:for(let n=0;n<this.actions.length;n++){let r=this.actions[n];if(r.term==e.term){if(r.eq(e))return null;let s=zt.addOrigins(t,this.set),o=zt.addOrigins(this.actionPositions[n],this.set),a=zm(s),l=zm(o),c=Dx(s,o)||a.precedence-l.precedence;if(c>0){this.actions.splice(n,1),this.actionPositions.splice(n,1),n--;continue e}else{if(c<0)return null;if(a.ambigGroups.some(h=>l.ambigGroups.includes(h)))continue e;return r}}}return this.actions.push(e),this.actionPositions.push(t),null}addAction(e,t,n){let r=this.addActionInner(e,t);if(r){let s=this.actionPositions[this.actions.indexOf(r)][0],o=[t[0].rule.name,s.rule.name];if(n.conflicts.some(l=>l.rules.some(c=>o.includes(c))))return;let a;r instanceof He?a=`shift/reduce conflict between 34 ${s} 35and 36 ${t[0].rule}`:a=`reduce/reduce conflict between 37 ${s.rule} 38and 39 ${t[0].rule}`,a+=` 40With input: 41 ${t[0].trail(70)} \xB7 ${e.term} \u2026`,r instanceof He&&(a+=Bx(t[0],r.term,n.first)),a+=Rx(s,t[0]),n.conflicts.push(new Lc(a,o))}}getGoto(e){return this.goto.find(t=>t.term==e)}hasSet(e){return Xs(this.set,e)}actionsByTerm(){let e=this._actionsByTerm;if(!e){this._actionsByTerm=e=Object.create(null);for(let t of this.actions)(e[t.term.id]||(e[t.term.id]=[])).push(t)}return e}finish(){if(this.actions.length){let e=this.actions[0];if(e instanceof jt){let{rule:t}=e;this.actions.every(n=>n instanceof jt&&n.rule.sameReduce(t))&&(this.defaultReduce=t)}}this.actions.sort((e,t)=>
41e.cmp(t)),this.goto.sort((e,t)=>e.cmp(t))}eq(e){let t=this.defaultReduce,n=e.defaultReduce;return t||n?t&&n?t.sameReduce(n):!1:this.skip==e.skip&&this.tokenGroup==e.tokenGroup&&Xs(this.actions,e.actions)&&Xs(this.goto,e.goto)}};Nc=class{constructor(e,t){this.set=e,this.state=t}},Lc=class{constructor(e,t){this.error=e,this.rules=t}};lo=class{constructor(e,t){this.origin=e,this.members=[t]}};Oc=[];ke=[],Ze=class{constructor(e,t){this.terms=e,this.conflicts=t}concat(e){if(this==Ze.none)return e;if(e==Ze.none)return this;let t=null;if(this.conflicts||e.conflicts){t=this.conflicts?this.conflicts.slice():this.ensureConflicts();let n=e.ensureConflicts();t[t.length-1]=t[t.length-1].join(n[0]);for(let r=1;r<n.length;r++)t.push(n[r])}return new Ze(this.terms.concat(e.terms),t)}withConflicts(e,t){if(t==_e.none)return this;let n=this.conflicts?this.conflicts.slice():this.ensureConflicts();return n[e]=n[e].join(t),new Ze(this.terms,n)}ensureConflicts(){if(this.conflicts)return this.conflicts;let e=[];for(let t=0;t<=this.terms.length;t++)e.push(_e.none);return e}};Ze.none=new Ze(ke,null);ki=class{constructor(e,t,n){this.id=e,this.args=t,this.term=n}matches(e){return this.id==e.id.name&&Lr(e.args,this.args)}matchesRepeat(e){return this.id=="+"&&_n(e.expr,this.args[0])}},Rc=class{constructor(e,t){this.options=t,this.terms=new Mc,this.specialized=Object.create(null),this.tokenOrigins=Object.create(null),this.rules=[],this.built=[],this.ruleNames=Object.create(null),this.namespaces=Object.create(null),this.namedTerms=Object.create(null),this.termTable=Object.create(null),this.knownProps=Object.create(null),this.dynamicRulePrecedences=[],this.definedGroups=[],this.astRules=[],this.currentSkip=[],jn("Parse",()=>{this.input=new Ac(e,t.fileName),this.ast=this.input.parse()});let n=St;for(let r in n)n[r]instanceof St&&!n[r].perNode&&(this.knownProps[r]={prop:n[r],source:{name:r,from:null}});for(let r of this.ast.externalProps)this.knownProps[r.id.name]={prop:this.options.externalProp?this.options.externalProp(r.id.name):new St,source:{name:r.externalID.name,from:r.source}};this.dialects=this.ast.dialects.map(r=>r.name),this.tokens=new Uc(this,this.ast.tokens),this.localTokens=this.ast.localTokens.map(r=>new Fc(this,r)),this.externalTokens=this.ast.externalTokens.map(r=>new Nr(this,r)),this.externalSpecializers=this.ast.externalSpecializers.map(r=>new Er(this,r)),jn("Build rules",()=>{let r=this.newName("%noskip",!0);this.defineRule(r,[]);let s=this.ast.mainSkip?this.newName("%mainskip",!0):r,o=[],a=[];for(let l of this.ast.rules)this.astRules.push({skip:s,rule:l});for(let l of this.ast.topRules)a.push({skip:s,rule:l});for(let l of this.ast.scopedSkip){let c=r,h=this.ast.scopedSkip.findIndex((d,u)=>u<o.length&&_n(d.expr,l.expr));h>-1?c=o[h]:this.ast.mainSkip&&_n(l.expr,this.ast.mainSkip)?c=s:Xm(l.expr)||(c=this.newName("%skip",!0)),o.push(c);for(let d of l.rules)this.astRules.push({skip:c,rule:d});for(let d of l.topRules)a.push({skip:c,rule:d})}for(let{rule:l}of this.astRules)this.unique(l.id);this.currentSkip.push(r),this.skipRules=s==r?[s]:[r,s],s!=r&&this.defineRule(s,this.normalizeExpr(this.ast.mainSkip));for(let l=0;l<this.ast.scopedSkip.length;l++){let c=o[l];this.skipRules.includes(c)||(this.skipRules.push(c),c!=r&&this.defineRule(c,this.normalizeExpr(this.ast.scopedSkip[l].expr)))}this.currentSkip.pop();for(let{rule:l,skip:c}of a.sort((h,d)=>h.rule.start-d.rule.start)){this.unique(l.id),this.used(l.id.name),this.currentSkip.push(c);let{name:h,props:d}
41=this.nodeInfo(l.props,"a",l.id.name,ke,ke,l.expr),u=this.terms.makeTop(h,d);this.namedTerms[h]=u,this.defineRule(u,this.normalizeExpr(l.expr)),this.currentSkip.pop()}for(let l of this.externalSpecializers)l.finish();for(let{skip:l,rule:c}of this.astRules)this.ruleNames[c.id.name]&&iv(c)&&!c.params.length&&(this.buildRule(c,[],l,!1),c.expr instanceof Be&&c.expr.exprs.length==0&&this.used(c.id.name))});for(let r in this.ruleNames){let s=this.ruleNames[r];s&&this.warn(`Unused rule '${s.name}'`,s.start)}this.tokens.takePrecedences(),this.tokens.takeConflicts();for(let r of this.localTokens)r.takePrecedences();for(let{name:r,group:s,rule:o}of this.definedGroups)this.defineGroup(r,s,o);this.checkGroups()}unique(e){e.name in this.ruleNames&&this.raise(`Duplicate definition of rule '${e.name}'`,e.start),this.ruleNames[e.name]=e}used(e){this.ruleNames[e]=null}newName(e,t=null,n={}){for(let r=t?0:1;;r++){let s=r?`${e}-${r}`:e;if(!this.terms.names[s])return this.terms.makeNonTerminal(s,t===!0?null:t,n)}}prepareParser(){let e=jn("Simplify rules",()=>tv(this.rules,[...this.skipRules,...this.terms.tops])),{nodeTypes:t,names:n,minRepeatTerm:r,maxTerm:s}=this.terms.finish(e);for(let N in this.namedTerms)this.termTable[N]=this.namedTerms[N].id;/\bgrammar\b/.test(Cr)&&console.log(e.join(` 42`));let o=this.terms.tops.slice(),a=Ox(this.terms),l=this.skipRules.map((N,V)=>{let te=[],Q=[],fe=[];for(let ce of N.rules){if(!ce.parts.length)continue;let Ae=ce.parts[0];for(let ve of Ae.terminal?[Ae]:a[Ae.name]||[])ve&&!Q.includes(ve)&&Q.push(ve);Ae.terminal&&ce.parts.length==1&&!fe.some(ve=>ve!=ce&&ve.parts[0]==Ae)?te.push(Ae):fe.push(ce)}return N.rules=fe,fe.length&&o.push(N),{skip:te,rule:fe.length?N:null,startTokens:Q,id:V}}),c=jn("Build full automaton",()=>zx(this.terms,o,a)),h=this.localTokens.map((N,V)=>N.buildLocalGroup(c,l,V)),{tokenGroups:d,tokenPrec:u,tokenData:f}=jn("Build token groups",()=>this.tokens.buildTokenGroups(c,l,h.length));for(let N of this.externalTokens)N.checkConflicts(c,l);let p=jn("Finish automaton",()=>Hx(c)),m=Gx(p,this.terms.tops);/\blr\b/.test(Cr)&&console.log(p.join(` 43`));let g=[];for(let N of this.externalSpecializers)g.push(N);for(let N in this.specialized)g.push({token:this.terms.names[N],table:Vx(this.specialized[N])});let b=N=>N instanceof Nr?N.ast.start:this.tokens.ast?this.tokens.ast.start:-1,y=d.concat(this.externalTokens).sort((N,V)=>b(N)-b(V)).concat(h),_=new co,v=l.map(N=>{let V=[];for(let te of N.skip)V.push(te.id,0,4);if(N.rule){let te=p.find(Q=>Q.startRule==N.rule);for(let Q of te.actions)V.push(Q.term.id,te.id,2)}return V.push(65535,0),_.storeArray(V)}),w=jn("Finish states",()=>{let N=new Uint32Array(p.length*6),V=this.computeForceReductions(p,l),te=new Bc(y,_,N,v,l,p,this);for(let Q of p)te.finish(Q,m(Q.id),V[Q.id]);return N}),M=Object.create(null);for(let N=0;N<this.dialects.length;N++)M[this.dialects[N]]=_.storeArray((this.tokens.byDialect[N]||ke).map(V=>V.id).concat(65535));let C=null;if(this.dynamicRulePrecedences.length){C=Object.create(null);for(let{rule:N,prec:V}of this.dynamicRulePrecedences)C[N.id]=V}let S=Object.create(null);for(let N of this.terms.tops)S[N.nodeName]=[p.find(V=>V.startRule==N).id,N.id];let I=_.storeArray(u.concat(65535)),{nodeProps:L,skippedTypes:P}=this.gatherNodeProps(t);return{states:w,stateData:_.finish(),goto:Jx(p),nodeNames:t.filter(N=>N.id<r).map(N=>N.nodeName).join(" "),nodeProps:L,skippedTypes:P,maxTerm:s,repeatNodeCount:t.length-r,tokenizers:y,tokenData:f,topRules:S,dialects:M,dynamicPrecedences:C,specialized:g,tokenPrec:I,termNames:n}}getParser(){let{states:e,stateData:t,goto:n,nodeNames:r,nodeProps:s,skippedTypes:o,maxTerm:a,repeatNodeCount:l,tokenizers:c,tokenData:h,topRules:d,dialects:u,dynamicPrecedences:f,specialized:p,tokenPrec:m,termNames:g}=this.prepareParser(),b=p.map(y=>{if(y instanceof Er){let _=this.options.externalSpecializer(y.ast.id.name,this.termTable);return{term:y.term.id,get:(v,w)=>_(v,w)<<1|(y.ast.type=="extend"?1:0),external:_,extend:y.ast.type=="extend"}}else return{term:y.token.id,get:_=>y.table[_]||-1}});return vd.deserialize({version:14,states:e,stateData:t,goto:n,nodeNames:r,maxTerm:a,repeatNodeCount:l,nodeProps:s.map(({prop:y,terms:_})=>[this.knownProps[y].prop,..._]),propSources:this.options.externalPropSource?this.ast.externalPropSources.map(y=>this.options.externalPropSource(y.id.name)):void 0,skippedNodes:o,tokenData:h,tokenizers:c.map(y=>y.create()),context:this.ast.context?typeof this.options.contextTracker=="function"?this.options.contextTracker(this.termTable):this.options.contextTracker:void 0,topRules:d,dialects:u,dynamicPrecedences:f,specialized:b,tokenPrec:m,termNames:g})}getParserFile(){let{states:e,stateData:t,goto:n,nodeNames:r,nodeProps:s,skippedTypes:o,maxTerm:a,repeatNodeCount:l,tokenizers:c,tokenData:h,topRules:d,dialects:u,dynamicPrecedences:f,specialized:p,tokenPrec:m,termNames:g}=this.prepareParser(),b=this.options.moduleStyle||"es",y=`// This file was generated by lezer-generator. You probably shouldn't edit it. 44`,_=y,v={},w=Object.create(null),M=Object.create(null);for(let k of Wm)M[k]=!0;let C=this.options.exportName||"parser";M[C]=!0;let S=k=>{for(let O=0;;O++){let B=k+(O?"_"+O:"");if(!M[B])return B}},I=(k,O,B=k)=>{let U=k+" from "+O;if(w[U])return w[U];let J=JSON.stringify(O),H=k;return k in M&&(H=S(B),k+=`${b=="cjs"?":":" as"} ${H}`),M[H]=!0,(v[J]||(v[J]=[])).push(k),w[U]=H},L=I("LRParser","@lezer/lr"),P=c.map(k=>
44k.createSource(I)),N=this.ast.context?I(this.ast.context.id.name,this.ast.context.source):null,V=s.map(({prop:k,terms:O})=>{let{source:B}=this.knownProps[k];return`[${B.from?I(B.name,B.from):JSON.stringify(B.name)}, ${O.map(Ae).join(",")}]`});function te(k){return"{__proto__:null,"+Object.keys(k).map(O=>`${/^(\d+|[a-zA-Z_]\w*)$/.test(O)?O:JSON.stringify(O)}:${k[O]}`).join(", ")+"}"}let Q="",fe=p.map(k=>{if(k instanceof Er){let O=I(k.ast.id.name,k.ast.source),B=this.options.typeScript?": any":"";return`{term: ${k.term.id}, get: (value${B}, stack${B}) => (${O}(value, stack) << 1)${k.ast.type=="extend"?" | 1":""}, external: ${O}${k.ast.type=="extend"?", extend: true":""}}`}else{let O=S("spec_"+k.token.name.replace(/\W/g,""));M[O]=!0,Q+=`const ${O} = ${te(k.table)} 45`;let B=this.options.typeScript?`: keyof typeof ${O}`:"";return`{term: ${k.token.id}, get: (value${B}) => ${O}[value] || -1}`}}),ce=this.ast.externalPropSources.map(k=>I(k.id.name,k.source));for(let k in v)b=="cjs"?_+=`const {${v[k].join(", ")}} = require(${k}) 46`:_+=`import {${v[k].join(", ")}} from ${k} 47`;_+=Q;function Ae(k){return typeof k!="string"||/^(true|false|\d+(\.\d+)?|\.\d+)$/.test(k)?k:JSON.stringify(k)}let ve=Object.keys(u).map(k=>`${k}: ${u[k]}`),Ve=`${L}.deserialize({ 48 version: 14, 49 states: ${vr(e,4294967295)}, 50 stateData: ${vr(t)}, 51 goto: ${vr(n)}, 52 nodeNames: ${JSON.stringify(r)}, 53 maxTerm: ${a}${N?`, 54 context: ${N}`:""}${V.length?`, 55 nodeProps: [ 56 ${V.join(`, 57 `)} 58 ]`:""}${ce.length?`, 59 propSources: [${ce.join()}]`:""}${o.length?`, 60 skippedNodes: ${JSON.stringify(o)}`:""}, 61 repeatNodeCount: ${l}, 62 tokenData: ${vr(h)}, 63 tokenizers: [${P.join(", ")}], 64 topRules: ${JSON.stringify(d)}${ve.length?`, 65 dialects: {${ve.join(", ")}}`:""}${f?`, 66 dynamicPrecedences: ${JSON.stringify(f)}`:""}${fe.length?`, 67 specialized: [${fe.join(",")}]`:""}, 68 tokenPrec: ${m}${this.options.includeNames?`, 69 termNames: ${JSON.stringify(g)}`:""} 70})`,T=[];for(let k in this.termTable){let O=k;if(Wm.includes(O))for(let B=1;O="_".repeat(B)+k,O in this.termTable;B++);else if(!/^[\w$]+$/.test(k))continue;T.push(`${O}${b=="cjs"?":":" ="} ${this.termTable[k]}`)}for(let k=0;k<this.dialects.length;k++)T.push(`Dialect_${this.dialects[k]}${b=="cjs"?":":" ="} ${k}`);return{parser:_+(b=="cjs"?`exports.${C} = ${Ve} 71`:`export const ${C} = ${Ve} 72`),terms:b=="cjs"?`${y}module.exports = { 73 ${T.join(`, 74 `)} 75}`:`${y}export const 76 ${T.join(`, 77 `)} 78`}}gatherNonSkippedNodes(){let e=Object.create(null),t=[],n=r=>{e[r.id]||(e[r.id]=!0,t.push(r))};this.terms.tops.forEach(n);for(let r=0;r<t.length;r++)for(let s of t[r].rules)for(let o of s.parts)n(o);return e}gatherNodeProps(e){let t=this.gatherNonSkippedNodes(),n=[],r=[];for(let s of e){!t[s.id]&&!s.error&&n.push(s.id);for(let o in s.props){let a=this.knownProps[o];if(!a)throw new _t("No known prop type for "+o);if(a.source.from==null&&(a.source.name=="repeated"||a.source.name=="error"))continue;let l=r.find(c=>c.prop==o);l||r.push(l={prop:o,values:{}}),(l.values[s.props[o]]||(l.values[s.props[o]]=[])).push(s.id)}}return{nodeProps:r.map(({prop:s,values:o})=>{let a=[];for(let l in o){let c=o[l];if(c.length==1)a.push(c[0],l);else{a.push(-c.length);for(let h of c)a.push(h);a.push(l)}}return{prop:s,terms:a}}),skippedTypes:n}}makeTerminal(e,t,n){return this.terms.makeTerminal(this.terms.uniqueName(e),t,n)}computeForceReductions(e,t){let n=[],r=[],s=Object.create(null);for(let l of e){n.push(0);for(let c of l.goto){let h=s[c.term.id]||(s[c.term.id]=[]),d=h.find(u=>u.target==c.target.id);d?d.parents.push(l.id):h.push({parents:[l.id],target:c.target.id})}r[l.id]=l.set.filter(c=>c.pos>0&&!c.rule.name.top).sort((c,h)=>h.pos-c.pos||c.rule.parts.length-h.rule.parts.length)}let o=Object.create(null);function a(l,c,h=null){let d=s[l];return d?d.some(u=>{let f=h?h.filter(m=>u.parents.includes(m)):u.parents;if(f.length==0)return!1;if(u.target==c)return!0;let p=o[u.target];return p!=null&&a(p,c,f)}):!1}for(let l of e)l.defaultReduce&&l.defaultReduce.parts.length>0&&(n[l.id]=Mr(l.defaultReduce,t),l.defaultReduce.parts.length==1&&(o[l.id]=l.defaultReduce.name.id));for(let l=1;;l++){let c=!0;for(let h of e){if(h.defaultReduce)continue;let d=r[h.id];if(d.length!=l){d.length>l&&(c=!1);continue}for(let u of d)if(u.pos!=1||!a(u.rule.name.id,h.id)){n[h.id]=Mr(u.rule,t,u.pos),u.pos==1&&(o[h.id]=u.rule.name.id);break}}if(c)break}return n}substituteArgs(e,t,n){return t.length==0?e:e.walk(r=>{let s;if(r instanceof Se&&(s=n.findIndex(o=>o.name==r.id.name))>-1){let o=t[s];if(r.args.length){if(o instanceof Se&&!o.args.length)return new Se(r.start,o.id,r.args);this.raise("Passing arguments to a parameter that already has arguments",r.start)}return o}else if(r instanceof Zt){let o=r.rule,a=this.substituteArgsInProps(o.props,t,n);return a==o.props?r:new Zt(r.start,new Ar(o.start,o.id,a,o.params,o.expr))}else if(r instanceof yn){let o=this.substituteArgsInProps(r.props,t,n);return o==r.props?r:new yn(r.start,r.type,o,r.token,r.content)}return r})}substituteArgsInProps(e,t,n){let r=o=>{let a=o;for(let l=0;l<o.length;l++){let c=o[l];if(!c.name)continue;let h=n.findIndex(u=>u.name==c.name);if(h<0)continue;a==o&&(a=o.slice());let d=t[h];d instanceof Se&&!d.args.length?a[l]=new Pn(c.start,d.id.name,null):d instanceof $e?a[l]=new Pn(c.start,d.value,
78null):this.raise(`Trying to interpolate expression '${d}' into a prop`,c.start)}return a},s=e;for(let o=0;o<e.length;o++){let a=e[o],l=r(a.value);l!=a.value&&(s==e&&(s=e.slice()),s[o]=new wi(a.start,a.at,a.name,l))}return s}conflictsFor(e){let t=_e.none,n=_e.none;for(let r of e)if(r.type=="ambig")t=t.join(new _e(0,[r.id.name]));else{let s=this.ast.precedences,o=s?s.items.findIndex(c=>c.id.name==r.id.name):-1;o<0&&this.raise(`Reference to unknown precedence: '${r.id.name}'`,r.id.start);let a=s.items[o],l=s.items.length-o;a.type=="cut"?t=t.join(new _e(0,ke,l)):(t=t.join(new _e(l<<2)),n=n.join(new _e((l<<2)+(a.type=="left"?1:a.type=="right"?-1:0))))}return{here:t,atEnd:n}}raise(e,t=1){return this.input.raise(e,t)}warn(e,t=-1){let n=this.input.message(e,t);this.options.warn?this.options.warn(n):console.warn(n)}defineRule(e,t){let n=this.currentSkip[this.currentSkip.length-1];for(let r of t)this.rules.push(new Ir(e,r.terms,r.ensureConflicts(),n))}resolve(e){for(let r of this.built)if(r.matches(e))return[ht(r.term)];let t=this.tokens.getToken(e);if(t)return[ht(t)];for(let r of this.localTokens){let s=r.getToken(e);if(s)return[ht(s)]}for(let r of this.externalTokens){let s=r.getToken(e);if(s)return[ht(s)]}for(let r of this.externalSpecializers){let s=r.getToken(e);if(s)return[ht(s)]}let n=this.astRules.find(r=>r.rule.id.name==e.id.name);return n?(n.rule.params.length!=e.args.length&&this.raise(`Wrong number or arguments for '${e.id.name}'`,e.start),this.used(n.rule.id.name),[ht(this.buildRule(n.rule,e.args,n.skip))]):this.raise(`Reference to undefined rule '${e.id.name}'`,e.start)}normalizeRepeat(e){let t=this.built.find(s=>s.matchesRepeat(e));if(t)return ht(t.term);let n=e.expr.prec<e.prec?`(${e.expr})+`:`${e.expr}+`,r=this.terms.makeRepeat(this.terms.uniqueName(n));return this.built.push(new ki("+",[e.expr],r)),this.defineRule(r,this.normalizeExpr(e.expr).concat(ht(r,r))),ht(r)}normalizeSequence(e){let t=e.exprs.map(s=>this.normalizeExpr(s)),n=this;function r(s,o,a){let{here:l,atEnd:c}=n.conflictsFor(e.markers[o]);if(o==t.length)return[s.withConflicts(s.terms.length,l.join(a))];let h=[];for(let d of t[o])for(let u of r(s.concat(d).withConflicts(s.terms.length,l),o+1,a.join(c)))h.push(u);return h}return r(Ze.none,0,_e.none)}normalizeExpr(e){if(e instanceof en&&e.kind=="?")return[Ze.none,...this.normalizeExpr(e.expr)];if(e instanceof en){let t=this.normalizeRepeat(e);return e.kind=="+"?[t]:[Ze.none,t]}else return e instanceof Bt?e.exprs.reduce((t,n)=>t.concat(this.normalizeExpr(n)),[]):e instanceof Be?this.normalizeSequence(e):e instanceof $e?[ht(this.tokens.getLiteral(e))]:e instanceof Se?this.resolve(e):e instanceof yn?[ht(this.resolveSpecialization(e))]:e instanceof Zt?[ht(this.buildRule(e.rule,ke,this.currentSkip[this.currentSkip.length-1],!0))]:this.raise(`This type of expression ('${e}') may not occur in non-token rules`,e.start)}buildRule(e,t,n,r=!1){let s=this.substituteArgs(e.expr,t,e.params),{name:o,props:a,dynamicPrec:l,inline:c,group:h,exported:d}=this.nodeInfo(e.props||ke,r?"pg":"pgi",e.id.name,t,e.params,e.expr);d&&e.params.length&&this.warn("Can't export parameterized rules",e.start),d&&r&&this.warn("Can't export inline rule",e.start);let u=this.newName(e.id.name+(t.length?"<"+t.join(",")+">":""),o||!0,a);c&&(u.inline=!0),l&&this.registerDynamicPrec(u,l),(u.nodeType||d)&&e.params.length==0&&(o||(u.preserve=!0),r||(this.namedTerms[d||e.id.name]=u)),r||this.built.push(new ki(e.id.name,t,u)),this.currentSkip.push(n);let f=this.normalizeExpr(s);return f.length>100*(s instanceof Bt?s.exprs.length:1)&&this.warn(`Rule ${e.id.name} is generating a lot (${f.length}) of choices. 79 Consider splitting it up or reducing the amount of ? or | operator uses.`,e.start),/\brulesize\b/.test(Cr)&&f.length>10&&console.log(`Rule ${e.id.name}: ${f.length} variants`),this.defineRule(u,f),this.currentSkip.pop(),h&&this.definedGroups.push({name:u,group:h,rule:e}),u}nodeInfo(e,t,n=null,r=ke,s=ke,o,a){let l={},c=n&&(t.indexOf("a")>-1||!nv(n))&&!/ /.test(n)?n:null,h=null,d=0,u=!1,f=null,p=null;for(let m of e)if(m.at)if(m.name=="name")c=this.finishProp(m,r,s),/ /.test(c)&&this.raise(`Node names cannot have spaces ('${c}')`,m.start);else if(m.name=="dialect"){t.indexOf("d")<0&&this.raise("Can't specify a dialect on non-token rules",e[0].start),m.value.length!=1&&!m.value[0].value&&this.raise("The '@dialect' rule prop must hold a plain string value");let g=this.dialects.indexOf(m.value[0].value);g<0&&this.raise(`Unknown dialect '${m.value[0].value}'`,m.value[0].start),h=g}else m.name=="dynamicPrecedence"?(t.indexOf("p")<0&&this.raise("Dynamic precedence can only be specified on nonterminals"),(m.value.length!=1||!/^-?(?:10|\d)$/.test(m.value[0].value))&&this.raise("The '@dynamicPrecedence' rule prop must hold an integer between -10 and 10"),d=+m.value[0].value):m.name=="inline"?(m.value.length&&this.raise("'@inline' doesn't take a value",m.value[0].start),t.indexOf("i")<0&&this.raise("Inline can only be specified on nonterminals"),u=!0):m.name=="isGroup"?(t.indexOf("g")<0&&this.raise("'@isGroup' can only be specified on nonterminals"),f=m.value.length?this.finishProp(m,r,s):n):m.name=="export"?m.value.length?p=this.finishProp(m,r,s):p=n:this.raise(`Unknown built-in prop name '@${m.name}'`,m.start);else{if(!this.knownProps[m.name]){let g=["name","dialect","dynamicPrecedence","export","isGroup"].includes(m.name)?` (did you mean '@${m.name}'?)`:"";this.raise(`Unknown prop name '${m.name}'${g}`,m.start)}l[m.name]=this.finishProp(m,r,s)}if(o&&this.ast.autoDelim&&(c||_r(l))){let m=this.findDelimiters(o);m&&($m(m[0],"closedBy",m[1].nodeName),$m(m[1],"openedBy",m[0].nodeName))}if(a&&_r(a))for(let m in a)m in l||(l[m]=a[m]);return _r(l)&&!c&&this.raise("Node has properties but no name",e.length?e[0].start:o.start),u&&(_r(l)||h||d)&&this.raise("Inline nodes can't have props, dynamic precedence, or a dialect",e[0].start),u&&c&&(c=null),{name:c,props:l,dialect:h,dynamicPrec:d,inline:u,group:f,exported:p}}finishProp(e,t,n){return e.value.map(r=>{if(r.value)return r.value;let s=n.findIndex(a=>a.name==r.name);s<0&&this.raise(`Property refers to '${r.name}', but no parameter by that name is in scope`,r.start);let o=t[s];return o instanceof Se&&!o.args.length?o.id.name:o instanceof $e?o.value:this.raise(`Expression '${o}' can not be used as part of a property value`,r.start)}).join("")}resolveSpecialization(e){let t=e.type,{name:n,props:r,dialect:s,exported:o}=this.nodeInfo(e.props,"d"),a=this.normalizeExpr(e.token);
79(a.length!=1||a[0].terms.length!=1||!a[0].terms[0].terminal)&&this.raise(`The first argument to '${t}' must resolve to a token`,e.token.start);let l,c;if((c=Qs(e.content))!=null)l=[c];else if(e.content instanceof Bt&&e.content.exprs.every(f=>Qs(f)!=null))l=e.content.exprs.map(Qs);else return this.raise(`The second argument to '${e.type}' must be a literal or choice of literals`,e.content.start);let h=a[0].terms[0],d=null,u=this.specialized[h.name]||(this.specialized[h.name]=[]);for(let f of l){let p=u.find(m=>m.value==f);p==null?(d||(d=this.makeTerminal(h.name+"/"+JSON.stringify(f),n,r),s!=null&&(this.tokens.byDialect[s]||(this.tokens.byDialect[s]=[])).push(d)),u.push({value:f,term:d,type:t,dialect:s,name:n}),this.tokenOrigins[d.name]={spec:h},(n||o)&&(n||(d.preserve=!0),this.namedTerms[o||n]=d)):(p.type!=t&&this.raise(`Conflicting specialization types for ${JSON.stringify(f)} of ${h.name} (${t} vs ${p.type})`,e.start),p.dialect!=s&&this.raise(`Conflicting dialects for specialization ${JSON.stringify(f)} of ${h.name}`,e.start),p.name!=n&&this.raise(`Conflicting names for specialization ${JSON.stringify(f)} of ${h.name}`,e.start),d&&p.term!=d&&this.raise(`Conflicting specialization tokens for ${JSON.stringify(f)} of ${h.name}`,e.start),d=p.term)}return d}findDelimiters(e){if(!(e instanceof Be)||e.exprs.length<2)return null;let t=a=>{if(a instanceof $e)return{term:this.tokens.getLiteral(a),str:a.value};if(a instanceof Se&&a.args.length==0){let l=this.ast.rules.find(h=>h.id.name==a.id.name);if(l)return t(l.expr);let c=this.tokens.rules.find(h=>h.id.name==a.id.name);if(c&&c.expr instanceof $e)return{term:this.tokens.getToken(a),str:c.expr.value}}return null},n=t(e.exprs[e.exprs.length-1]);if(!n||!n.term.nodeName)return null;let s=["()","[]","{}","<>"].find(a=>n.str.indexOf(a[1])>-1&&n.str.indexOf(a[0])<0);if(!s)return null;let o=t(e.exprs[0]);return!o||!o.term.nodeName||o.str.indexOf(s[0])<0||o.str.indexOf(s[1])>-1?null:[o.term,n.term]}registerDynamicPrec(e,t){this.dynamicRulePrecedences.push({rule:e,prec:t}),e.preserve=!0}defineGroup(e,t,n){var r;let s=[],o=a=>{if(a.nodeName)return[a];s.includes(a)&&this.raise(`Rule '${n.id.name}' cannot define a group because it contains a non-named recursive rule ('${a.name}')`,n.start);let l=[];s.push(a);for(let c of this.rules)if(c.name==a){let h=c.parts.map(o).filter(d=>d.length);if(h.length>1&&this.raise(`Rule '${n.id.name}' cannot define a group because some choices produce multiple named nodes`,n.start),h.length==1)for(let d of h[0])l.push(d)}return s.pop(),l};for(let a of o(e))a.props.group=(((r=a.props.group)===null||r===void 0?void 0:r.split(" "))||[]).concat(t).sort().join(" ")}checkGroups(){let e=Object.create(null),t=Object.create(null);for(let r of this.terms.terms)if(r.nodeName&&(t[r.nodeName]=!0,r.props.group))for(let s of r.props.group.split(" "))(e[s]||(e[s]=[])).push(r);let n=Object.keys(e);for(let r=0;r<n.length;r++){let s=n[r],o=e[s];t[s]&&this.warn(`Group name '${s}' conflicts with a node of the same name`);for(let a=r+1;a<n.length;a++){let l=e[n[a]];o.some(c=>l.includes(c))&&(o.length>l.length?l.some(c=>!o.includes(c)):o.some(c=>!l.includes(c)))&&this.warn(`Groups '${s}' and '${n[a]}' overlap without one being a superset of the other`)}}}};oc=5,Bc=class{constructor(e,t,n,r,s,o,a){this.tokenizers=e,this.data=t,this.stateArray=n,this.skipData=r,this.skipInfo=s,this.states=o,this.builder=a,this.sharedActions=[]}findSharedActions(e){if(e.actions.length<oc)return null;let t=null;for(let o of this.sharedActions)(!t||o.actions.length>t.actions.length)&&o.actions.every(a=>e.actions.some(l=>l.eq(a)))&&(t=o);if(t)return t;let n=null,r=[];for(let o=e.id+1;o<this.states.length;o++){let a=this.states[o],l=0;if(!(a.defaultReduce||a.actions.length<oc)){for(let c of e.actions)for(let h of a.actions)c.eq(h)&&(r[l++]=c);l>=oc&&(!n||n.length<l)&&(n=r,r=[])}}if(!n)return null;let s={actions:n,addr:this.storeActions(n,-1,null)};return this.sharedActions.push(s),s}storeActions(e,t,n){if(t<0&&n&&n.actions.length==e.length)return n.addr;let r=[];for(let s of e)if(!(n&&n.actions.some(o=>o.eq(s))))if(s instanceof He)r.push(s.term.id,s.target.id,0);else{let o=Mr(s.rule,this.skipInfo);o!=t&&r.push(s.term.id,o&65535,o>>16)}return r.push(65535),t>-1?r.push(2,t&65535,t>>16):n?r.push(1,n.addr&65535,n.addr>>16):r.push(0),this.data.storeArray(r)}finish(e,t,n){let r=this.builder,s=r.skipRules.indexOf(e.skip),o=this.skipData[s],a=this.skipInfo[s].startTokens,l=e.defaultReduce?Mr(e.defaultReduce,this.skipInfo):0,c=t?1:0,h=-1,d=null;if(l==0){if(t)for(let m of e.actions)m instanceof jt&&m.term.eof&&(h=Mr(m.rule,this.skipInfo));h<0&&(d=this.findSharedActions(e))}e.set.some(m=>m.rule.name.top&&m.pos==m.rule.parts.length)&&(c|=2);let u=[];for(let m=0;m<e.actions.length+a.length;m++){let g=m<e.actions.length?e.actions[m].term:a[m-e.actions.length];for(;;){let b=r.tokenOrigins[g.name];if(b&&b.spec){g=b.spec;continue}b&&b.external instanceof Nr&&wr(u,b.external);break}}let f=0;for(let m=0;m<this.tokenizers.length;m++){let g=this.tokenizers[m];(u.includes(g)||g.groupID==e.tokenGroup)&&(f|=1<<m)}let p=e.id*6;this.stateArray[p+0]=c,this.stateArray[p+1]=this.storeActions(l?ke:e.actions,h,d),this.stateArray[p+2]=o,this.stateArray[p+3]=f,this.stateArray[p+4]=l,this.stateArray[p+5]=n}};co=class{constructor(){this.data=[]}storeArray(e){let t=Wx(this.data,e);if(t>-1)return t;let n=this.data.length;for(let r of e)this.data.push(r);return n}finish(){return Uint16Array.from(this.data)}};zc=class{constructor(e,t){this.tokens=e,this.groupID=t}create(){return this.groupID}createSource(){return String(this.groupID)}};jc=class{constructor(e,t,n){this.name=e,this.expr=t,this.scope=n}},Pc=class{constructor(e,t,n,r){this.name=e,this.start=t,this.to=n,this.args=r}},ho=class{constructor(e,t){this.b=e,this.ast=t,this.startState=new Qe,this.built=[],this.building=[],this.byDialect=Object.create(null),this.precedenceRelations=[],this.rules=t?t.rules:ke;for(let n of this.rules)e.unique(n.id)}getToken(e){for(let c of this.built)if(c.matches(e))return c.term;let t=e.id.name,n=this.rules.find(c=>c.id.name==t);if(!n)return null;let{name:r,props:s,dialect:o,exported:a}=this.b.nodeInfo(n.props,"d",t,e.args,n.params.length!=e.args.length?ke:n.params),l=this.b.makeTerminal(e.toString(),r,s);return o!=null&&(this.byDialect[o]||(this.byDialect[o]=[])).push(l),(l.nodeType||a)&&n.params.length==0&&(l.nodeType||(l.preserve=!0),this.b.namedTerms[a||t]=l),this.buildRule(n,e,this.startState,new Qe([l])),this.built.push(new ki(t,e.args,l)),l}buildRule(e,t,n,r,s=ke){let o=t.id.name;e.params.length!=t.args.length&&this.b.raise(`Incorrect number of arguments for token '${o}'`,t.start);let a=this.building.find(c=>c.name==o&&Lr(t.args,c.args));if(a){if(a.to==r){n.nullEdge(a.start);return}let c=this.building.length-1;for(;this.building[c].name!=o;)c--;this.b.raise(`Invalid (non-tail) recursion in token rules: ${this.building.slice(c).map(h=>h.name).join(" -> ")}`,t.start)}this.b.used(e.id.name);let l=new Qe;n.nullEdge(l),this.building.push(new Pc(o,l,r,t.args)),this.build(this.b.substituteArgs(e.expr,t.args,e.params),l,r,t.args.map((c,h)=>
79new jc(e.params[h].name,c,s))),this.building.pop()}build(e,t,n,r){if(e instanceof Se){let s=e.id.name,o=r.find(l=>l.name==s);if(o)return this.build(o.expr,t,n,o.scope);let a;for(let l=0,c=this.b.localTokens;l<=c.length&&(a=(l==c.length?this.b.tokens:c[l]).rules.find(d=>d.id.name==s),!a);l++);if(!a)return this.b.raise(`Reference to token rule '${s}', which isn't found`,e.start);this.buildRule(a,e,t,n,r)}else if(e instanceof Tr)for(let[s,o]of Sc[e.type])t.edge(s,o,n);else if(e instanceof Bt)for(let s of e.exprs)this.build(s,t,n,r);else if(Xm(e))t.nullEdge(n);else if(e instanceof Be){let s=e.markers.find(o=>o.length>0);s&&this.b.raise("Conflict marker in token expression",s[0].start);for(let o=0;o<e.exprs.length;o++){let a=o==e.exprs.length-1?n:new Qe;this.build(e.exprs[o],t,a,r),t=a}}else if(e instanceof en)if(e.kind=="*"){let s=new Qe;t.nullEdge(s),this.build(e.expr,s,s,r),s.nullEdge(n)}else if(e.kind=="+"){let s=new Qe;this.build(e.expr,t,s,r),this.build(e.expr,s,s,r),s.nullEdge(n)}else t.nullEdge(n),this.build(e.expr,t,n,r);else if(e instanceof eo)for(let[s,o]of e.inverted?Xx(e.ranges):e.ranges)Qx(t,n,s,o);else if(e instanceof $e)for(let s=0;s<e.value.length;s++){let o=e.value.charCodeAt(s),a=s==e.value.length-1?n:new Qe;t.edge(o,o+1,a),t=a}else if(e instanceof to){let s=new Qe;t.edge(0,56320,n),t.edge(56320,qc+1,n),t.edge(55296,56320,s),s.edge(56320,57344,n)}else return this.b.raise("Unrecognized expression type in token",e.start)}takePrecedences(){let e=this.precedenceRelations=[];if(this.ast)for(let t of this.ast.precedences){let n=[];for(let r of t.items){let s=[];if(r instanceof Se)for(let o of this.built)(r.args.length?o.matches(r):o.id==r.id.name)&&s.push(o.term);else{let o=JSON.stringify(r.value),a=this.built.find(l=>l.id==o);a&&s.push(a.term)}s.length||this.b.warn(`Precedence specified for unknown token ${r}`,r.start);for(let o of s)hc(e,o,n);n=n.concat(s)}}}precededBy(e,t){let n=this.precedenceRelations.find(r=>r.term==e);return n&&n.after.includes(t)}buildPrecTable(e){let t=[],n=this.precedenceRelations.slice();for(let{a:r,b:s,soft:o}of e)if(o){if(!n.some(a=>a.term==r)||!n.some(a=>a.term==s))continue;o<0&&([r,s]=[s,r]),hc(n,s,[r]),hc(n,r,[])}e:for(;n.length;){for(let r=0;r<n.length;r++){let s=n[r];if(s.after.every(o=>t.includes(o.id))){if(t.push(s.term.id),n.length==1)break e;n[r]=n.pop();continue e}}this.b.raise(`Cyclic token precedence relation between ${n.map(r=>r.term).join(", ")}`)}return t}},Uc=class extends ho{constructor(){super(...arguments),this.explicitConflicts=[]}getLiteral(e){let t=JSON.stringify(e.value);for(let c of this.built)if(c.id==t)return c.term;let n=null,r={},s=null,o=null,a=this.ast?this.ast.literals.find(c=>c.literal==e.value):null;a&&({name:n,props:r,dialect:s,exported:o}=this.b.nodeInfo(a.props,"da",e.value));let l=this.b.makeTerminal(t,n,r);return s!=null&&(this.byDialect[s]||(this.byDialect[s]=[])).push(l),o&&(this.b.namedTerms[o]=l),this.build(e,this.startState,new Qe([l]),ke),this.built.push(new ki(t,ke,l)),l}takeConflicts(){var e;let t=n=>{if(n instanceof Se){for(let r of this.built)if(r.matches(n))return r.term}else{let r=JSON.stringify(n.value),s=this.built.find(o=>o.id==r);if(s)return s.term}return this.b.warn(`Conflict specified for unknown token ${n}`,n.start),null};for(let n of((e=this.ast)===null||e===void 0?void 0:e.conflicts)||[]){let r=t(n.a),s=t(n.b);r&&s&&(r.id<s.id&&([r,s]=[s,r]),this.explicitConflicts.push({a:r,b:s}))}}buildTokenGroups(e,t,n){let r=this.startState.compile();r.accepting.length&&this.b.raise(`Grammar contains zero-length tokens (in '${r.accepting[0].name}')`,this.rules.find(d=>d.id.name==r.accepting[0].name).start),/\btokens\b/.test(Cr)&&console.log(r.toString());let s=r.findConflicts(Yx(e,this.b,t)).filter(({a:d,b:u})=>!this.precededBy(d,u)&&!this.precededBy(u,d));for(let{a:d,b:u}of this.explicitConflicts)s.some(f=>f.a==d&&f.b==u)||s.push(new Jm(d,u,0,"",""));let o=s.filter(d=>d.soft),a=s.filter(d=>!d.soft),l=[],c=[];for(let d of e){if(d.defaultReduce||d.tokenGroup>-1)continue;let u=[],f=[],p=t[this.b.skipRules.indexOf(d.skip)].startTokens;for(let b of p)d.actions.some(y=>y.term==b)&&this.b.raise(`Use of token ${b.name} conflicts with skip rule`);let m=[];for(let b=0;b<d.actions.length+(p?p.length:0);b++){let y=b<d.actions.length?d.actions[b].term:p[b-d.actions.length],_=this.b.tokenOrigins[y.name];if(_&&_.spec)y=_.spec;else if(_&&_.external)continue;wr(m,y)}if(m.length==0)continue;for(let b of m)for(let y of a){let _=y.a==b?y.b:y.b==b?y.a:null;if(_){if(m.includes(_)&&!l.some(v=>v.conflict==y)){let v=y.exampleA?` (example: ${JSON.stringify(y.exampleA)}${y.exampleB?` vs ${JSON.stringify(y.exampleB)}`:""})`:"";l.push({error:`Overlapping tokens ${b.name} and ${_.name} used in same context${v} 80After: ${d.set[0].trail()}`,conflict:y})}wr(u,b),wr(f,_)}}let g=null;for(let b of c)if(!f.some(y=>b.tokens.includes(y))){for(let y of u)wr(b.tokens,y);g=b;break}g||(g=new zc(u,c.length+n),c.push(g)),d.tokenGroup=g.groupID}l.length&&this.b.raise(l.map(d=>d.error).join(` 81 82`)),c.length+n>16&&this.b.raise(`Too many different token groups (${c.length}) to represent them as a 16-bit bitfield`);let h=this.buildPrecTable(o);return{tokenGroups:c,tokenPrec:h,tokenData:r.toArray(Kx(c),h)}}},Fc=class extends ho{constructor(e,t){super(e,t),this.fallback=null,t.fallback&&e.unique(t.fallback.id)}getToken(e){let t=null;if(this.ast.fallback&&this.ast.fallback.id.name==e.id.name){if(e.args.length&&this.b.raise(`Incorrect number of arguments for ${e.id.name}`,e.start),!this.fallback){let{name:n,props:r,exported:s}=this.b.nodeInfo(this.ast.fallback.props,"",e.id.name,ke,ke),o=this.fallback=this.b.makeTerminal(e.id.name,n,r);(o.nodeType||s)&&(o.nodeType||(o.preserve=!0),this.b.namedTerms[s||e.id.name]=o),this.b.used(e.id.name)}t=this.fallback}else t=super.getToken(e);return t&&!this.b.tokenOrigins[t.name]&&(this.b.tokenOrigins[t.name]={group:this}),t}buildLocalGroup(e,t,n){let r=this.startState.compile();r.accepting.length&&this.b.raise(`Grammar contains zero-length tokens (in '${r.accepting[0].name}')`,this.rules.find(c=>c.id.name==r.accepting[0].name).start);for(let{a:c,b:h,exampleA:d}of r.findConflicts(()=>!0))!this.precededBy(c,h)&&!this.precededBy(h,c)&&this.b.raise(`Overlapping tokens ${c.name} and ${h.name} in local token group${d?` (example: ${JSON.stringify(d)})`:""}`);for(let c of e){if(c.defaultReduce)continue;let h=null,d=t[this.b.skipRules.indexOf(c.skip)].startTokens[0];for(let{term:u}of c.actions){let f=this.b.tokenOrigins[u.name];for(;f?.spec;)f=this.b.tokenOrigins[f.spec.name];f?.group==this?h=u:d=u}h&&(d&&this.b.raise(`Tokens from a local token group used together with other tokens (${h.name} with ${d.name})`),c.tokenGroup=n)}let s=this.buildPrecTable(ke),o=r.toArray({[n]:65535},s),a=o.length,l=new Uint16Array(o.length+s.length+1);return l.set(o,0),l.set(s,a),l[l.length-1]=65535,{groupID:n,create:()=>new xd(l,a,this.fallback?this.fallback.id:void 0),createSource:c=>`new ${c("LocalTokenGroup","@lezer/lr")}(${vr(l)}, ${a}${this.fallback?`, ${this.fallback.id}`:""})`}}};ac=65536,Hm=55296,qm=57344,Vm=1114111,lc=56320,cc=57343;Nr=class{constructor(e,t){this.b=e,this.ast=t,this.tokens=Qm(e,t.tokens);for(let n in this.tokens)this.b.tokenOrigins[this.tokens[n].name]={external:this}}getToken(e){return Zm(this.b,this.tokens,e)}checkConflicts(e,t){let n=[];for(let r of this.ast.conflicts){let s=this.b.namedTerms[r.name];s?s.terminal?this.tokens[r.name]?this.b.warn(`External token set specifying a conflict with one of its own tokens ('${r.name}')`):n.push(s):this.b.warn(`Term '${r.name}' isn't a terminal and cannot be used in a token conflict.`):this.b.warn(`Unknown conflict term '${r.name}'`)}if(n.length)for(let r of e){let s=t[this.b.skipRules.indexOf(r.skip)].startTokens,o=!1,a=null;for(let l=0;l<r.actions.length+s.length;l++){let c=l<r.actions.length?r.actions[l].term:s[l-r.actions.length];c.name in this.tokens?o=!0:n.indexOf(c)>-1&&(a=c)}o&&a&&this.b.raise(`Tokens from external group used together with conflicting token '${a.name}' 83After: ${r.set[0].trail()}`,this.ast.start)}}create(){return this.b.options.externalTokenizer(this.ast.id.name,this.b.termTable)}createSource(e){let{source:t,id:{name:n}}=this.ast;return e(n,t)}},Er=class{constructor(e,t){this.b=e,this.ast=t,this.term=null,this.tokens=Qm(e,t.tokens)}finish(){let e=this.b.normalizeExpr(this.ast.token);(e.length!=1||e[0].terms.length!=1||!e[0].terms[0].terminal)&&this.b.raise(`The token expression to '@external ${this.ast.type}' must resolve to a token`,this.ast.token.start),this.term=e[0].terms[0];for(let t in this.tokens)this.b.tokenOrigins[this.tokens[t].name]={spec:this.term,external:this}}getToken(e){return Zm(this.b,this.tokens,e)}};Wm=["arguments","await","break","case","catch","continue","debugger","default","do","else","eval","finally","for","function","if","return","switch","throw","try","var","while","with","null","true","false","instanceof","typeof","void","delete","new","in","this","const","class","extends","export","import","super","enum","implements","interface","let","package","private","protected","public","static","yield","require"]});var rv,Si,sv,uo,Wc=E(()=>{ji();kt();wn();Kr();rv=Z.theme({"&":{background:"var(--jp-layout-color0)",color:"var(--jp-content-font-color1)"},".cm-panels":{color:"var(--jp-ui-font-color2)",backgroundColor:"var(--jp-layout-color2)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--jp-border-color2)"},".cm-button":{background:"var(--jp-layout-color2)",border:"var(--jp-border-width) solid var(--jp-border-color1)",color:"var(--jp-ui-font-color1)",borderRadius:"var(--jp-border-radius)"},".cm-button:hover":{background:"var(--jp-layout-color1)"},".cm-panel.cm-search > label":{color:"var(--jp-ui-font-color1)"},".cm-textfield":{backgroundColor:"var(--jp-layout-color2)",color:"var(--jp-ui-font-color1)",border:"var(--jp-border-width) solid var(--jp-border-color1)"},".jp-CodeConsole &, .jp-Notebook &":{background:"transparent"},".cm-content":{caretColor:"var(--jp-editor-cursor-color)"},".cm-scroller":{fontFamily:"inherit"}
83,".cm-cursor, .cm-dropCursor":{borderLeft:"var(--jp-code-cursor-width0) solid var(--jp-editor-cursor-color)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--jp-editor-selected-background)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{backgroundColor:"var(--jp-editor-selected-focused-background)"},".cm-gutters":{borderRight:"1px solid var(--jp-border-color2)",backgroundColor:"var(--jp-layout-color2)"},".cm-gutter":{backgroundColor:"var(--jp-layout-color2)"},".cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--jp-layout-color3) 25%, transparent)"},".cm-lineNumbers":{color:"var(--jp-ui-font-color2)"},".cm-searchMatch":{backgroundColor:"var(--jp-search-unselected-match-background-color)",color:"var(--jp-search-unselected-match-color)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--jp-search-selected-match-background-color) !important",color:"var(--jp-search-selected-match-color) !important"},".cm-tooltip":{backgroundColor:"var(--jp-layout-color1)"}}),Si=md.define([{tag:z.meta,color:"var(--jp-mirror-editor-meta-color)"},{tag:z.heading,color:"var(--jp-mirror-editor-header-color)"},{tag:[z.heading1,z.heading2,z.heading3,z.heading4],color:"var(--jp-mirror-editor-header-color)",fontWeight:"bold"},{tag:z.keyword,color:"var(--jp-mirror-editor-keyword-color)",fontWeight:"bold"},{tag:z.atom,color:"var(--jp-mirror-editor-atom-color)"},{tag:z.number,color:"var(--jp-mirror-editor-number-color)"},{tag:[z.definition(z.name),z.function(z.definition(z.variableName))],color:"var(--jp-mirror-editor-def-color)"},{tag:z.standard(z.variableName),color:"var(--jp-mirror-editor-builtin-color)"},{tag:[z.special(z.variableName),z.self],color:"var(--jp-mirror-editor-variable-2-color)"},{tag:z.punctuation,color:"var(--jp-mirror-editor-punctuation-color)"},{tag:z.propertyName,color:"var(--jp-mirror-editor-property-color)"},{tag:z.operator,color:"var(--jp-mirror-editor-operator-color)",fontWeight:"bold"},{tag:z.comment,color:"var(--jp-mirror-editor-comment-color)",fontStyle:"italic"},{tag:z.string,color:"var(--jp-mirror-editor-string-color)"},{tag:[z.labelName,z.monospace,z.special(z.string)],color:"var(--jp-mirror-editor-string-2-color)"},{tag:z.bracket,color:"var(--jp-mirror-editor-bracket-color)"},{tag:z.tagName,color:"var(--jp-mirror-editor-tag-color)"},{tag:z.attributeName,color:"var(--jp-mirror-editor-attribute-color)"},{tag:z.quote,color:"var(--jp-mirror-editor-quote-color)"},{tag:z.link,color:"var(--jp-mirror-editor-link-color)",textDecoration:"underline"},{tag:[z.separator,z.derefOperator,z.paren],color:""},{tag:z.strong,fontWeight:"bold"},{tag:z.emphasis,fontStyle:"italic"},{tag:z.strikethrough,textDecoration:"line-through"},{tag:z.bool,color:"var(--jp-mirror-editor-keyword-color)",fontWeight:"bold"}]),sv=[rv,pa(Si)],uo=class{constructor(){this._themeMap=new Map([["jupyter",Object.freeze({name:"jupyter",theme:sv})]])}get themes(){return Array.from(this._themeMap.values())}defaultTheme(){return this._themeMap.get("jupyter").theme}addTheme(e){if(this._themeMap.has(e.name))throw new Error(`A theme named '${e.name}' is already registered.`);this._themeMap.set(e.name,{displayName:e.name,...e})}getTheme(e){var t;let n=(t=this._themeMap.get(e))===null||t===void 0?void 0:t.theme;return n??this.defaultTheme()}};(function(i){function e(t){let n=(t??Pe).load("jupyterlab");return[Object.freeze({name:"codemirror",displayName:n.__("codemirror"),theme:[Z.baseTheme({}),pa(pd)]})]}i.getDefaultThemes=e})(uo||(uo={}))});function Jc(i){return wt.define(e=>new Gc(e,i),{decorations:e=>e.decorations})}var Gc,ov,Kc=E(()=>{ji();$t();kt();Jr();Gc=class{constructor(e,t){this.langPython=t,this.tree=Sn(e.state),this.mark=kn.mark({class:"cm-builtin"}),this.decorations=this.buildDeco(e),this.decoratedTo=e.viewport.to}update(e){let t=Sn(e.state),{viewport:n}=e.view,r=e.changes.mapPos(this.decoratedTo,1);t.length<n.to&&t.type==this.tree.type&&r>=n.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=r):(t!=this.tree||e.viewportChanged)&&(this.tree=t,this.decorations=this.buildDeco(e.view),this.decoratedTo=n.to)}buildDeco(e){if(!this.tree.length)return kn.none;let t=new Wr,n=r=>{var s;let o=r.node.cursor(),a=o.tree&&o.tree.prop(St.mounted);if(a&&a.overlay&&((s=r.node.enter(a.overlay[0].from+r.from,1))===null||s===void 0||s.cursor(
83).iterate(n)),this.langPython.isActiveAt(e.state,r.from+1)&&r.name==="VariableName"){let l=e.state.sliceDoc(r.from,r.to);ov.includes(l)&&t.add(r.from,r.to,this.mark)}};for(let{from:r,to:s}of e.visibleRanges)this.tree.iterate({enter:n,from:r,to:s});return t.finish()}};ov=["abs","aiter","all","any","anext","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__"]});var np,Ci,fo=E(()=>{ji();Fl();np=ne(Qb());wn();tp();Kr();Wc();Kc();Ci=class{constructor(){this._modeList=[],this.addLanguage({name:"none",mime:"text/plain",support:new Ri(hd.define({parser:ep("@top Program { }")}))})}addLanguage(e){var t;if((t=this.findByName(e.name))!==null&&t!==void 0?t:this.findByMIME(e.mime,!0))throw new Error(`${e.mime} already registered`);this._modeList.push(this.makeSpec(e))}async getLanguage(e){let t=this.findBest(e);return t&&!t.support&&(t.support=await t.load()),t}getLanguages(){return[...this._modeList]}findByMIME(e,t=!1){if(Array.isArray(e)){for(let n=0;n<e.length;n++){let r=this.findByMIME(e[n]);if(r)return r}return null}e=e.toLowerCase();for(let n=0;n<this._modeList.length;n++){let r=this._modeList[n];if(Array.isArray(r.mime)){for(let s=0;s<r.mime.length;s++)if(r.mime[s]==e)return r}else if(r.mime==e)return r}if(!t){if(/\+xml$/.test(e))return this.findByMIME("application/xml");if(/\+json$/.test(e))return this.findByMIME("application/json")}return null}findByName(e){e=e.toLowerCase();for(let t=0;t<this._modeList.length;t++){let n=this._modeList[t];if(n.name.toLowerCase()==e)return n;if(n.alias){for(let r=0;r<n.alias.length;r++)if(n.alias[r].toLowerCase()==e)return n}}return null}findByExtension(e){if(Array.isArray(e)){for(let t=0;t<e.length;t++){let n=this.findByExtension(e[t]);if(n)return n}return null}e=e.toLowerCase();for(let t=0;t<this._modeList.length;t++){let n=this._modeList[t];for(let r=0;r<n.extensions.length;r++)if(n.extensions[r].toLowerCase()==e)return n}return null}findByFileName(e){let t=np.PathExt.basename(e);for(let s=0;s<this._modeList.length;s++){let o=this._modeList[s];if(o.filename&&o.filename.test(t))return o}let n=t.lastIndexOf("."),r=n>-1&&t.substring(n+1,t.length);return r?this.findByExtension(r):null}findBest(e,t=!0){var n,r,s,o;let a=typeof e=="string"?e:e.name,l=typeof e!="string"?e.mime:a,c=typeof e!="string"?(n=e.extensions)!==null&&n!==void 0?n:[]:[];return(o=(s=(r=a?this.findByName(a):null)!==null&&r!==void 0?r:l?this.findByMIME(l):null)!==null&&s!==void 0?s:this.findByExtension(c))!==null&&o!==void 0?o:t?this.findByMIME(Ln.defaultMimeType):null}async highlight(e,t,n){var r;t&&await this.getLanguage(t);let s=(r=t?.support)===null||r===void 0?void 0:r.language;if(!s){n.appendChild(document.createTextNode(e));return}let o=s.parser.parse(e),a=0;cd(o,Si,(l,c,h)=>{l>a&&n.appendChild(document.createTextNode(e.slice(a,l)));let d=n.appendChild(document.createElement("span"));d.className=h,d.appendChild(document.createTextNode(e.slice(l,c))),a=c}),a<o.length-1&&n.appendChild(document.createTextNode(e.slice(a,o.length)))}makeSpec(e){let t=dd.of(e);return t.mime=e.mime,t.displayName=e.displayName,t}};(function(i){function e(r){return new Ri(bd.define(r))}i.legacy=e;async function t(r){let s=await import("/build/_shared/dist-TWY5YC6L.js");return s.sql({dialect:s[r]})}function n(r){let s=(r??Pe).load("jupyterlab");return[{name:"C",displayName:s.__("C"),mime:"text/x-csrc",extensions:["c","h","ino"],async load(){return(await import("/build/_shared/dist-IZ45BHUF.js")).cpp()}},{name:"C++",displayName:s.__("C++"),mime:"text/x-c++src",extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],async load(){return(await import("/build/_shared/dist-IZ45BHUF.js")).cpp()}},{name:"CQL",displayName:s.__("CQL"),mime:"text/x-cassandra",extensions:["cql"],load(){return t("Cassandra")}},{name:"CSS",displayName:s.__("CSS"),mime:"text/css",extensions:["css"],async load(){return(await import("/build/_shared/dist-JUTUCJGJ.js")).css()}},{name:"HTML",displayName:s.__("HTML"),alias:["xhtml"],mime:"text/html",extensions:["html","htm","handlebars","hbs"],async load(){return(await import("/build/_shared/dist-7GEVB3VT.js")).html()}},{name:"Java",displayName:s.__("Java"),mime:"text/x-java",extensions:["java"],async load(){return(await import("/build/_shared/dist-W5L4JBWE.js")).java()}},{name:"Javascript",displayName:s.__("Javascript"),alias:["ecmascript","js","node"],mime:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],extensions:["js","mjs","cjs"],async load(){return(await import("/build/_shared/dist-VBQHJNWT.js")).javascript()}},{name:"JSON",displayName:s.__("JSON"),alias:["json5"],mime:["application/json","application/x-json"],extensions:["json","map"],async load(){return(await import("/build/_shared/dist-QM2YZLYO.js")).json()}},{name:"JSX",displayName:s.__("JSX"),mime:"text/jsx",extensions:["jsx"],async load(){return(await import("/build/_shared/dist-VBQHJNWT.js")).javascript({
83jsx:!0})}},{name:"MariaDB SQL",displayName:s.__("MariaDB SQL"),mime:"text/x-mariadb",load(){return t("MariaSQL")}},{name:"Markdown",displayName:s.__("Markdown"),mime:"text/x-markdown",extensions:["md","markdown","mkd"],async load(){return(await import("/build/_shared/dist-ISZQEXRA.js")).markdown({codeLanguages:this._modeList})}},{name:"MS SQL",displayName:s.__("MS SQL"),mime:"text/x-mssql",load(){return t("MSSQL")}},{name:"MySQL",displayName:s.__("MySQL"),mime:"text/x-mysql",load(){return t("MySQL")}},{name:"PHP",displayName:s.__("PHP"),mime:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],extensions:["php","php3","php4","php5","php7","phtml"],async load(){return(await import("/build/_shared/dist-37PGAUEF.js")).php()}},{name:"PLSQL",displayName:s.__("PLSQL"),mime:"text/x-plsql",extensions:["pls"],load(){return t("PLSQL")}},{name:"PostgreSQL",displayName:s.__("PostgreSQL"),mime:"text/x-pgsql",load(){return t("PostgreSQL")}},{name:"Python",displayName:s.__("Python"),mime:"text/x-python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,async load(){let o=await import("/build/_shared/dist-K66TO5IT.js");return new Ri(o.pythonLanguage,Jc(o.pythonLanguage))}},{name:"ipython",displayName:s.__("ipython"),mime:"text/x-ipython",async load(){let o=await import("/build/_shared/dist-K66TO5IT.js");return new Ri(o.pythonLanguage,Jc(o.pythonLanguage))}},{name:"Rust",displayName:s.__("Rust"),mime:"text/x-rustsrc",extensions:["rs"],async load(){return(await import("/build/_shared/dist-TKJTEPRH.js")).rust()}},{name:"SQL",displayName:s.__("SQL"),mime:["application/sql","text/x-sql"],extensions:["sql"],load(){return t("StandardSQL")}},{name:"SQLite",displayName:s.__("SQLite"),mime:"text/x-sqlite",load(){return t("SQLite")}},{name:"TSX",displayName:s.__("TSX"),alias:["TypeScript-JSX"],mime:"text/typescript-jsx",extensions:["tsx"],async load(){return(await import("/build/_shared/dist-VBQHJNWT.js")).javascript({jsx:!0,typescript:!0})}},{name:"TypeScript",displayName:s.__("TypeScript"),alias:["ts"],mime:"application/typescript",extensions:["ts"],async load(){return(await import("/build/_shared/dist-VBQHJNWT.js")).javascript({typescript:!0})}},{name:"WebAssembly",displayName:s.__("WebAssembly"),mime:"text/webassembly",extensions:["wat","wast"],async load(){return(await import("/build/_shared/dist-MIKXK5JH.js")).wast()}},{name:"XML",displayName:s.__("XML"),alias:["rss","wsdl","xsd"],mime:["application/xml","text/xml"],extensions:["xml","xsl","xsd","svg"],async load(){return(await import("/build/_shared/dist-SXUICQHC.js")).xml()}},{name:"APL",displayName:s.__("APL"),mime:"text/apl",extensions:["dyalog","apl"],async load(){let o=await import("/build/_shared/apl-ZZO6JXPL.js");return e(o.apl)}},{name:"PGP",displayName:s.__("PGP"),alias:["asciiarmor"],mime:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],extensions:["asc","pgp","sig"],async load(){let o=await import("/build/_shared/asciiarmor-RPXMRT54.js");return e(o.asciiArmor)}},{name:"ASN.1",displayName:s.__("ASN.1"),mime:"text/x-ttcn-asn",extensions:["asn","asn1"],async load(){let o=await import("/build/_shared/asn1-N4ENKCWM.js");return e(o.asn1({}))}},{name:"Asterisk",displayName:s.__("Asterisk"),mime:"text/x-asterisk",filename:/^extensions\.conf$/i,async load(){let o=await import("/build/_shared/asterisk-MOV35MZK.js");return e(o.asterisk)}},{name:"Brainfuck",displayName:s.__("Brainfuck"),mime:"text/x-brainfuck",extensions:["b","bf"],async load(){let o=await import("/build/_shared/brainfuck-KJ7DDEPS.js");return e(o.brainfuck)}},{name:"Cobol",displayName:s.__("Cobol"),mime:"text/x-cobol",extensions:["cob","cpy"],async load(){let o=await import("/build/_shared/cobol-3VCX2POD.js");return e(o.cobol)}},{name:"C#",displayName:s.__("C#"),alias:["csharp","cs"],mime:"text/x-csharp",extensions:["cs"],async load(){let o=await import("/build/_shared/clike-ZAZZ6HMK.js");return e(o.csharp)}},{name:"Clojure",displayName:s.__("Clojure"),mime:"text/x-clojure",extensions:["clj","cljc","cljx"],async load(){let o=await import("/build/_shared/clojure-VPWXRSVI.js");return e(o.clojure)}},{name:"ClojureScript",displayName:s.__("ClojureScript"),mime:"text/x-clojurescript",extensions:["cljs"],async load(){let o=await import("/build/_shared/clojure-VPWXRSVI.js");return e(o.clojure)}},{name:"Closure Stylesheets (GSS)",displayName:s.__("Closure Stylesheets (GSS)"),mime:"text/x-gss",extensions:["gss"],async load(){let o=await import("/build/_shared/css-46NDXSAD.js");return e(o.gss)}},{name:"CMake",displayName:s.__("CMake"),mime:"text/x-cmake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,async load(){let o=await import("/build/_shared/cmake-XIF4MJ3R.js");return e(o.cmake)}}
83,{name:"CoffeeScript",displayName:s.__("CoffeeScript"),alias:["coffee","coffee-script"],mime:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],extensions:["coffee"],async load(){let o=await import("/build/_shared/coffeescript-3K6RAOQG.js");return e(o.coffeeScript)}},{name:"Common Lisp",displayName:s.__("Common Lisp"),alias:["lisp"],mime:"text/x-common-lisp",extensions:["cl","lisp","el"],async load(){let o=await import("/build/_shared/commonlisp-UDJCBUKE.js");return e(o.commonLisp)}},{name:"Cypher",displayName:s.__("Cypher"),mime:"application/x-cypher-query",extensions:["cyp","cypher"],async load(){let o=await import("/build/_shared/cypher-4PSAVP6D.js");return e(o.cypher)}},{name:"Cython",displayName:s.__("Cython"),mime:"text/x-cython",extensions:["pyx","pxd","pxi"],async load(){let o=await import("/build/_shared/python-HIOOBLYV.js");return e(o.cython)}},{name:"Crystal",displayName:s.__("Crystal"),mime:"text/x-crystal",extensions:["cr"],async load(){let o=await import("/build/_shared/crystal-2JURC3IG.js");return e(o.crystal)}},{name:"D",displayName:s.__("D"),mime:"text/x-d",extensions:["d"],async load(){let o=await import("/build/_shared/d-Z4ZIMODV.js");return e(o.d)}},{name:"Dart",displayName:s.__("Dart"),mime:["application/dart","text/x-dart"],extensions:["dart"],async load(){let o=await import("/build/_shared/clike-ZAZZ6HMK.js");return e(o.dart)}},{name:"diff",displayName:s.__("diff"),mime:"text/x-diff",extensions:["diff","patch"],async load(){let o=await import("/build/_shared/diff-74EFSNND.js");return e(o.diff)}},{name:"Dockerfile",displayName:s.__("Dockerfile"),mime:"text/x-dockerfile",filename:/^Dockerfile$/,async load(){let o=await import("/build/_shared/dockerfile-SC4HCRSW.js");return e(o.dockerFile)}},{name:"DTD",displayName:s.__("DTD"),mime:"application/xml-dtd",extensions:["dtd"],async load(){let o=await import("/build/_shared/dtd-BLTMJO7E.js");return e(o.dtd)}},{name:"Dylan",displayName:s.__("Dylan"),mime:"text/x-dylan",extensions:["dylan","dyl","intr"],async load(){let o=await import("/build/_shared/dylan-FN7EVROT.js");return e(o.dylan)}},{name:"EBNF",displayName:s.__("EBNF"),mime:"text/x-ebnf",async load(){let o=await import("/build/_shared/ebnf-OJSEZ3N5.js");return e(o.ebnf)}},{name:"ECL",displayName:s.__("ECL"),mime:"text/x-ecl",extensions:["ecl"],async load(){let o=await import("/build/_shared/ecl-2U2OAJMP.js");return e(o.ecl)}},{name:"edn",displayName:s.__("edn"),mime:"application/edn",extensions:["edn"],async load(){let o=await import("/build/_shared/clojure-VPWXRSVI.js");return e(o.clojure)}},{name:"Eiffel",displayName:s.__("Eiffel"),mime:"text/x-eiffel",extensions:["e"],async load(){let o=await import("/build/_shared/eiffel-3KLEGQDA.js");return e(o.eiffel)}},{name:"Elm",displayName:s.__("Elm"),mime:"text/x-elm",extensions:["elm"],async load(){let o=await import("/build/_shared/elm-HAZGKQYD.js");return e(o.elm)}},{name:"Erlang",displayName:s.__("Erlang"),mime:"text/x-erlang",extensions:["erl"],async load(){let o=await import("/build/_shared/erlang-DC7X3CE7.js");return e(o.erlang)}},{name:"Esper",displayName:s.__("Esper"),mime:"text/x-esper",async load(){let o=await import("/build/_shared/sql-3UCYESNE.js");return e(o.esper)}},{name:"Factor",displayName:s.__("Factor"),mime:"text/x-factor",extensions:["factor"],async load(){let o=await import("/build/_shared/factor-GPDBZWRU.js");return e(o.factor)}},{name:"FCL",displayName:s.__("FCL"),mime:"text/x-fcl",async load(){let o=await import("/build/_shared/fcl-SKSHCG25.js");return e(o.fcl)}},{name:"Forth",displayName:s.__("Forth"),mime:"text/x-forth",extensions:["forth","fth","4th"],async load(){let o=await import("/build/_shared/forth-O4TR6KNO.js");return e(o.forth)}},{name:"Fortran",displayName:s.__("Fortran"),mime:"text/x-fortran",extensions:["f","for","f77","f90","f95"],async load(){let o=await import("/build/_shared/fortran-F5ZZVJJA.js");return e(o.fortran)}},{name:"F#",displayName:s.__("F#"),alias:["fsharp"],mime:"text/x-fsharp",extensions:["fs"],async load(){let o=await import("/build/_shared/mllike-75IP5OPV.js");return e(o.fSharp)}},{name:"Gas",displayName:s.__("Gas"),mime:"text/x-gas",extensions:["s"],async load(){let o=await import("/build/_shared/gas-Z2YQPJ3F.js");return e(o.gas)}},{name:"Gherkin",displayName:s.__("Gherkin"),mime:"text/x-feature",extensions:["feature"],async load(){let o=await import("/build/_shared/gherkin-LFAHEJNF.js");return e(o.gherkin)}},{name:"Go",displayName:s.__("Go"),mime:"text/x-go",extensions:["go"],async load(){let o=await import("/build/_shared/go-BG4QZD2O.js");return e(o.go)}},{name:"Groovy",displayName:s.__("Groovy"),mime:"text/x-groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,async load(){let o=await import("/build/_shared/groovy-UYNOWD56.js");return e(o.groovy)}},{name:"Haskell",displayName:s.__("Haskell"),mime:"text/x-haskell",extensions:["hs"],async load(){let o=await import("/build/_shared/haskell-PNOY5UR5.js");return e(o.haskell)}}
83,{name:"Haxe",displayName:s.__("Haxe"),mime:"text/x-haxe",extensions:["hx"],async load(){let o=await import("/build/_shared/haxe-H5JJOUJJ.js");return e(o.haxe)}},{name:"HXML",displayName:s.__("HXML"),mime:"text/x-hxml",extensions:["hxml"],async load(){let o=await import("/build/_shared/haxe-H5JJOUJJ.js");return e(o.hxml)}},{name:"HTTP",displayName:s.__("HTTP"),mime:"message/http",async load(){let o=await import("/build/_shared/http-AK274HE5.js");return e(o.http)}},{name:"IDL",displayName:s.__("IDL"),mime:"text/x-idl",extensions:["pro"],async load(){let o=await import("/build/_shared/idl-KBY34UBJ.js");return e(o.idl)}},{name:"JSON-LD",displayName:s.__("JSON-LD"),alias:["jsonld"],mime:"application/ld+json",extensions:["jsonld"],async load(){let o=await import("/build/_shared/javascript-63JUCONM.js");return e(o.jsonld)}},{name:"Jinja2",displayName:s.__("Jinja2"),mime:"text/jinja2",extensions:["j2","jinja","jinja2"],async load(){let o=await import("/build/_shared/jinja2-J2XTUZDZ.js");return e(o.jinja2)}},{name:"Julia",displayName:s.__("Julia"),mime:"text/x-julia",extensions:["jl"],async load(){let o=await import("/build/_shared/julia-UFS7LIEQ.js");return e(o.julia)}},{name:"Kotlin",displayName:s.__("Kotlin"),mime:"text/x-kotlin",extensions:["kt"],async load(){let o=await import("/build/_shared/clike-ZAZZ6HMK.js");return e(o.kotlin)}},{name:"LESS",displayName:s.__("LESS"),mime:"text/x-less",extensions:["less"],async load(){let o=await import("/build/_shared/css-46NDXSAD.js");return e(o.less)}},{name:"LiveScript",displayName:s.__("LiveScript"),alias:["ls"],mime:"text/x-livescript",extensions:["ls"],async load(){let o=await import("/build/_shared/livescript-4JP5ZFQN.js");return e(o.liveScript)}},{name:"Lua",displayName:s.__("Lua"),mime:"text/x-lua",extensions:["lua"],async load(){let o=await import("/build/_shared/lua-I4TE44GI.js");return e(o.lua)}},{name:"mIRC",displayName:s.__("mIRC"),mime:"text/mirc",async load(){let o=await import("/build/_shared/mirc-EV3TL4S5.js");return e(o.mirc)}},{name:"Mathematica",displayName:s.__("Mathematica"),mime:"text/x-mathematica",extensions:["m","nb","wl","wls"],async load(){let o=await import("/build/_shared/mathematica-AOQNWEMV.js");return e(o.mathematica)}},{name:"Modelica",displayName:s.__("Modelica"),mime:"text/x-modelica",extensions:["mo"],async load(){let o=await import("/build/_shared/modelica-ECJFWQXT.js");return e(o.modelica)}},{name:"MUMPS",displayName:s.__("MUMPS"),mime:"text/x-mumps",extensions:["mps"],async load(){let o=await import("/build/_shared/mumps-QLDXIEPU.js");return e(o.mumps)}},{name:"mbox",displayName:s.__("mbox"),mime:"application/mbox",extensions:["mbox"],async load(){let o=await import("/build/_shared/mbox-RZ7KEXOM.js");return e(o.mbox)}},{name:"Nginx",displayName:s.__("Nginx"),mime:"text/x-nginx-conf",filename:/nginx.*\.conf$/i,async load(){let o=await import("/build/_shared/nginx-57T5JZ6G.js");return e(o.nginx)}},{name:"NSIS",displayName:s.__("NSIS"),mime:"text/x-nsis",extensions:["nsh","nsi"],async load(){let o=await import("/build/_shared/nsis-G52REVKE.js");return e(o.nsis)}},{name:"NTriples",displayName:s.__("NTriples"),mime:["application/n-triples","application/n-quads","text/n-triples"],extensions:["nt","nq"],async load(){let o=await import("/build/_shared/ntriples-MX5ZTK2K.js");return e(o.ntriples)}},{name:"Objective-C",displayName:s.__("Objective-C"),alias:["objective-c","objc"],mime:"text/x-objectivec",extensions:["m"],async load(){let o=await import("/build/_shared/clike-ZAZZ6HMK.js");return e(o.objectiveC)}},{name:"Objective-C++",displayName:s.__("Objective-C++"),alias:["objective-c++","objc++"],mime:"text/x-objectivec++",extensions:["mm"],async load(){let o=await import("/build/_shared/clike-ZAZZ6HMK.js");return e(o.objectiveCpp)}},{name:"OCaml",displayName:s.__("OCaml"),mime:"text/x-ocaml",extensions:["ml","mli","mll","mly"],async load(){let o=await import("/build/_shared/mllike-75IP5OPV.js");return e(o.oCaml)}},{name:"Octave",displayName:s.__("Octave"),mime:"text/x-octave",extensions:["m"],async load(){let o=await import("/build/_shared/octave-H2ZRPKPS.js");return e(o.octave)}},{name:"Oz",displayName:s.__("Oz"),mime:"text/x-oz",extensions:["oz"],async load(){let o=await import("/build/_shared/oz-XJ2O7NFW.js");return e(o.oz)}}
83,{name:"Pascal",displayName:s.__("Pascal"),mime:"text/x-pascal",extensions:["p","pas"],async load(){let o=await import("/build/_shared/pascal-UMVPJWX2.js");return e(o.pascal)}},{name:"Perl",displayName:s.__("Perl"),mime:"text/x-perl",extensions:["pl","pm"],async load(){let o=await import("/build/_shared/perl-UHWLEA2V.js");return e(o.perl)}},{name:"Pig",displayName:s.__("Pig"),mime:"text/x-pig",extensions:["pig"],async load(){let o=await import("/build/_shared/pig-ZMVJZ4XB.js");return e(o.pig)}},{name:"PowerShell",displayName:s.__("PowerShell"),mime:"application/x-powershell",extensions:["ps1","psd1","psm1"],async load(){let o=await import("/build/_shared/powershell-UIVUK3QV.js");return e(o.powerShell)}},{name:"Properties files",displayName:s.__("Properties files"),alias:["ini","properties"],mime:"text/x-properties",extensions:["properties","ini","in"],async load(){let o=await import("/build/_shared/properties-RZXZGZSZ.js");return e(o.properties)}},{name:"ProtoBuf",displayName:s.__("ProtoBuf"),mime:"text/x-protobuf",extensions:["proto"],async load(){let o=await import("/build/_shared/protobuf-STOITIJG.js");return e(o.protobuf)}},{name:"Pug",displayName:s.__("Pug"),mime:"text/x-pug",extensions:["pug"],async load(){let o=await import("/build/_shared/pug-2KO5NALV.js");return e(o.pug)}},{name:"Puppet",displayName:s.__("Puppet"),mime:"text/x-puppet",extensions:["pp"],async load(){let o=await import("/build/_shared/puppet-F5CUCALG.js");return e(o.puppet)}},{name:"Q",displayName:s.__("Q"),mime:"text/x-q",extensions:["q"],async load(){let o=await import("/build/_shared/q-HTTITPIC.js");return e(o.q)}},{name:"R",displayName:s.__("R"),alias:["rscript"],mime:"text/x-rsrc",extensions:["r","R"],async load(){let o=await import("/build/_shared/r-Y2Z2DQKD.js");return e(o.r)}},{name:"RPM Changes",displayName:s.__("RPM Changes"),mime:"text/x-rpm-changes",async load(){let o=await import("/build/_shared/rpm-MZI3FYQ5.js");return e(o.rpmChanges)}},{name:"RPM Spec",displayName:s.__("RPM Spec"),mime:"text/x-rpm-spec",extensions:["spec"],async load(){let o=await import("/build/_shared/rpm-MZI3FYQ5.js");return e(o.rpmSpec)}},{name:"Ruby",displayName:s.__("Ruby"),alias:["jruby","macruby","rake","rb","rbx"],mime:"text/x-ruby",extensions:["rb"],async load(){let o=await import("/build/_shared/ruby-EEWPHUSH.js");return e(o.ruby)}},{name:"SAS",displayName:s.__("SAS"),mime:"text/x-sas",extensions:["sas"],async load(){let o=await import("/build/_shared/sas-2XWW4XGY.js");return e(o.sas)}},{name:"Scala",displayName:s.__("Scala"),mime:"text/x-scala",extensions:["scala"],async load(){let o=await import("/build/_shared/clike-ZAZZ6HMK.js");return e(o.scala)}},{name:"Scheme",displayName:s.__("Scheme"),mime:"text/x-scheme",extensions:["scm","ss"],async load(){let o=await import("/build/_shared/scheme-JGKNZIH6.js");return e(o.scheme)}},{name:"SCSS",displayName:s.__("SCSS"),mime:"text/x-scss",extensions:["scss"],async load(){let o=await import("/build/_shared/css-46NDXSAD.js");return e(o.sCSS)}},{name:"Shell",displayName:s.__("Shell"),alias:["bash","sh","zsh"],mime:["text/x-sh","application/x-sh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,async load(){let o=await import("/build/_shared/shell-AGS4HSQT.js");return e(o.shell)}},{name:"Sieve",displayName:s.__("Sieve"),mime:"application/sieve",extensions:["siv","sieve"],async load(){let o=await import("/build/_shared/sieve-QHD6R3SL.js");return e(o.sieve)}},{name:"Smalltalk",displayName:s.__("Smalltalk"),mime:"text/x-stsrc",extensions:["st"],async load(){let o=await import("/build/_shared/smalltalk-TA3K7I75.js");return e(o.smalltalk)}},{name:"Solr",displayName:s.__("Solr"),mime:"text/x-solr",async load(){let o=await import("/build/_shared/solr-I5AE4W6C.js");return e(o.solr)}},{name:"SML",displayName:s.__("SML"),mime:"text/x-sml",extensions:["sml","sig","fun","smackspec"],async load(){let o=await import("/build/_shared/mllike-75IP5OPV.js");return e(o.sml)}},{name:"SPARQL",displayName:s.__("SPARQL"),alias:["sparul"],mime:"application/sparql-query",extensions:["rq","sparql"],async load(){let o=await import("/build/_shared/sparql-G65EOUAQ.js");return e(o.sparql)}},{name:"Spreadsheet",displayName:s.__("Spreadsheet"),alias:["excel","formula"],mime:"text/x-spreadsheet",async load(){let o=await import("/build/_shared/spreadsheet-BVYF7S4T.js");return e(o.spreadsheet)}},{name:"Squirrel",displayName:s.__("Squirrel"),mime:"text/x-squirrel",extensions:["nut"],async load(){let o=await import("/build/_shared/clike-ZAZZ6HMK.js");return e(o.squirrel)}},{name:"Stylus",displayName:s.__("Stylus"),mime:"text/x-styl",extensions:["styl"],async load(){let o=await import("/build/_shared/stylus-DBWLQJZA.js");return e(o.stylus)}}
83,{name:"Swift",displayName:s.__("Swift"),mime:"text/x-swift",extensions:["swift"],async load(){let o=await import("/build/_shared/swift-NUCMVKQJ.js");return e(o.swift)}},{name:"sTeX",displayName:s.__("sTeX"),mime:"text/x-stex",async load(){let o=await import("/build/_shared/stex-EEH5NLGQ.js");return e(o.stex)}},{name:"LaTeX",displayName:s.__("LaTeX"),alias:["tex"],mime:"text/x-latex",extensions:["text","ltx","tex"],async load(){let o=await import("/build/_shared/stex-EEH5NLGQ.js");return e(o.stex)}},{name:"SystemVerilog",displayName:s.__("SystemVerilog"),mime:"text/x-systemverilog",extensions:["v","sv","svh"],async load(){let o=await import("/build/_shared/verilog-3TJJ4GIT.js");return e(o.verilog)}},{name:"Tcl",displayName:s.__("Tcl"),mime:"text/x-tcl",extensions:["tcl"],async load(){let o=await import("/build/_shared/tcl-57GYB4CX.js");return e(o.tcl)}},{name:"Textile",displayName:s.__("Textile"),mime:"text/x-textile",extensions:["textile"],async load(){let o=await import("/build/_shared/textile-C2SPNBLZ.js");return e(o.textile)}},{name:"TiddlyWiki",displayName:s.__("TiddlyWiki"),mime:"text/x-tiddlywiki",async load(){let o=await import("/build/_shared/tiddlywiki-GYSVLUIZ.js");return e(o.tiddlyWiki)}},{name:"Tiki wiki",displayName:s.__("Tiki wiki"),mime:"text/tiki",async load(){let o=await import("/build/_shared/tiki-DGAS7YZA.js");return e(o.tiki)}},{name:"TOML",displayName:s.__("TOML"),mime:"text/x-toml",extensions:["toml"],async load(){let o=await import("/build/_shared/toml-HJP2N2MX.js");return e(o.toml)}},{name:"troff",displayName:s.__("troff"),mime:"text/troff",extensions:["1","2","3","4","5","6","7","8","9"],async load(){let o=await import("/build/_shared/troff-2HX3MXKM.js");return e(o.troff)}},{name:"TTCN",displayName:s.__("TTCN"),mime:"text/x-ttcn",extensions:["ttcn","ttcn3","ttcnpp"],async load(){let o=await import("/build/_shared/ttcn-G33MOJFN.js");return e(o.ttcn)}},{name:"TTCN_CFG",displayName:s.__("TTCN_CFG"),mime:"text/x-ttcn-cfg",extensions:["cfg"],async load(){let o=await import("/build/_shared/ttcn-cfg-EUK6SGDO.js");return e(o.ttcnCfg)}},{name:"Turtle",displayName:s.__("Turtle"),mime:"text/turtle",extensions:["ttl"],async load(){let o=await import("/build/_shared/turtle-MHUWKRLW.js");return e(o.turtle)}},{name:"Web IDL",displayName:s.__("Web IDL"),mime:"text/x-webidl",extensions:["webidl"],async load(){let o=await import("/build/_shared/webidl-RFST4YLQ.js");return e(o.webIDL)}},{name:"VB.NET",displayName:s.__("VB.NET"),mime:"text/x-vb",extensions:["vb"],async load(){let o=await import("/build/_shared/vb-N4HBS7C2.js");return e(o.vb)}},{name:"VBScript",displayName:s.__("VBScript"),mime:"text/vbscript",extensions:["vbs"],async load(){let o=await import("/build/_shared/vbscript-UTCFOITP.js");return e(o.vbScript)}},{name:"Velocity",displayName:s.__("Velocity"),mime:"text/velocity",extensions:["vtl"],async load(){let o=await import("/build/_shared/velocity-ZJJ6D7SL.js");return e(o.velocity)}},{name:"Verilog",displayName:s.__("Verilog"),mime:"text/x-verilog",extensions:["v"],async load(){let o=await import("/build/_shared/verilog-3TJJ4GIT.js");return e(o.verilog)}},{name:"VHDL",displayName:s.__("VHDL"),mime:"text/x-vhdl",extensions:["vhd","vhdl"],async load(){let o=await import("/build/_shared/vhdl-N6LB33YL.js");return e(o.vhdl)}},{name:"XQuery",displayName:s.__("XQuery"),mime:"application/xquery",extensions:["xy","xquery"],async load(){let o=await import("/build/_shared/xquery-SBG6OK4J.js");return e(o.xQuery)}},{name:"Yacas",displayName:s.__("Yacas"),mime:"text/x-yacas",extensions:["ys"],async load(){let o=await import("/build/_shared/yacas-6R6KQCI3.js");return e(o.yacas)}},{name:"YAML",displayName:s.__("YAML"),alias:["yml"],mime:["text/x-yaml","text/yaml"],extensions:["yaml","yml"],async load(){let o=await import("/build/_shared/yaml-ZNGH7NVB.js");return e(o.yaml)}},{name:"Z80",displayName:s.__("Z80"),mime:"text/x-z80",extensions:["z80"],async load(){let o=await import("/build/_shared/z80-2KSUHF3W.js");return e(o.z80)}},{name:"mscgen",displayName:s.__("mscgen"),mime:"text/x-mscgen",extensions:["mscgen","mscin","msc"],async load(){let o=await import("/build/_shared/mscgen-D6IXTXRW.js");return e(o.mscgen)}},{name:"xu",displayName:s.__("xu"),mime:"text/x-xu",extensions:["xu"],async load(){let o=await import("/build/_shared/mscgen-D6IXTXRW.js");return e(o.xu)}},{name:"msgenny",displayName:s.__("msgenny"),mime:"text/x-msgenny",extensions:["msgenny"],async load(){let o=await import("/build/_shared/mscgen-D6IXTXRW.js");return e(o.msgenny)}}]}i.getDefaultLanguages=n})(Ci||(Ci={}))});var av,ip,Yc=E(()=>{$t();kt();av=ne(ut());tn();Ys();fo();(function(i){function e(t,n,r,s){let o=n.getInitialExtensions();return o.push(...r),new Z({state:Ft.create({doc:s,extensions:o}),parent:t})}i.createEditor=e})(ip||(ip={}))});var rp=E(()=>{wn();Ys();Yc();fo()});var sp=E(()=>{});var op,ap=E(()=>{tn();(function(i){function e(t,n,r=0,s=1/0){for(s=Math.min(t.length-1,s);r<=s;){let l=Math.floor(.5*(r+s)),c=t[l].position;if(c<n){if(r=l+1,r<t.length&&t[r].position>n)return r}else if(c>n){if(s=l-1,s>0&&t[s].position<n)return l}else return l}let o=r>0?r-1:0;return t[o].position>=n?o:null}i.findNext=e})(op||(op={}))});var mo,kM,SM,CM,lp=E(()=>{mo=ne(ut()),kM=new mo.Token("@jupyterlab/codemirror:IEditorExtensionRegistry","A registry for CodeMirror extension factories."),SM=new mo.Token("@jupyterlab/codemirror:IEditorLanguageRegistry","A registry for CodeMirror languages."),CM=new mo.Token("@jupyterlab/codemirror:IEditorThemeRegistry","A registry for CodeMirror theme.")});var cp=E(()=>{$l();Yc();Ys();Wl();rp();fo();sp();ap();Wc();lp();Kc()});var dp=j((PM,hp)=>{hp.exports=function(i){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={exports:{},id:n,loaded:!1};
vendor: 9,079 bytes, line 83
83return i[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}return t.m=i,t.c=e,t.p="",t(0)}([function(i,e,t){i.exports=t(1)},function(i,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(o){return o&&o.__esModule?o:{default:o}}var r=t(2),s=n(r);e.default=s.default,i.exports=e.default},function(i,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(f){for(var p=1;p<arguments.length;p++){var m=arguments[p];for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(f[g]=m[g])}return f};e.default=u;function r(f){return f&&f.__esModule?f:{default:f}}function s(f,p){var m={};for(var g in f)p.indexOf(g)>=0||Object.prototype.hasOwnProperty.call(f,g)&&(m[g]=f[g]);return m}var o=t(3),a=t(4),l=r(a),c=t(14),h=t(15),d=r(h);u.propTypes={activeClassName:l.default.string,activeIndex:l.default.number,activeStyle:l.default.object,autoEscape:l.default.bool,className:l.default.string,findChunks:l.default.func,highlightClassName:l.default.oneOfType([l.default.object,l.default.string]),highlightStyle:l.default.object,highlightTag:l.default.oneOfType([l.default.node,l.default.func,l.default.string]),sanitize:l.default.func,searchWords:l.default.arrayOf(l.default.oneOfType([l.default.string,l.default.instanceOf(RegExp)])).isRequired,textToHighlight:l.default.string.isRequired,unhighlightTag:l.default.oneOfType([l.default.node,l.default.func,l.default.string]),unhighlightClassName:l.default.string,unhighlightStyle:l.default.object};function u(f){var p=f.activeClassName,m=p===void 0?"":p,g=f.activeIndex,b=g===void 0?-1:g,y=f.activeStyle,_=f.autoEscape,v=f.caseSensitive,w=v===void 0?!1:v,M=f.className,C=f.findChunks,S=f.highlightClassName,I=S===void 0?"":S,L=f.highlightStyle,P=L===void 0?{}:L,N=f.highlightTag,V=N===void 0?"mark":N,te=f.sanitize,Q=f.searchWords,fe=f.textToHighlight,ce=f.unhighlightTag,Ae=ce===void 0?"span":ce,ve=f.unhighlightClassName,Ve=ve===void 0?"":ve,T=f.unhighlightStyle,k=s(f,["activeClassName","activeIndex","activeStyle","autoEscape","caseSensitive","className","findChunks","highlightClassName","highlightStyle","highlightTag","sanitize","searchWords","textToHighlight","unhighlightTag","unhighlightClassName","unhighlightStyle"]),O=(0,o.findAll)({autoEscape:_,caseSensitive:w,findChunks:C,sanitize:te,searchWords:Q,textToHighlight:fe}),B=V,U=-1,J="",H=void 0,W=function(X){var Ne={};for(var We in X)Ne[We.toLowerCase()]=X[We];return Ne},K=(0,d.default)(W);return(0,c.createElement)("span",n({className:M},k,{children:O.map(function(Y,X){var Ne=fe.substr(Y.start,Y.end-Y.start);if(Y.highlight){U++;var We=void 0;typeof I=="object"?w?We=I[Ne]:(I=K(I),We=I[Ne.toLowerCase()]):We=I;var kh=U===+b;J=We+" "+(kh?m:""),H=kh===!0&&y!=null?Object.assign({},P,y):P;var Sh={children:Ne,className:J,key:X,style:H};return typeof B!="string"&&(Sh.highlightIndex=U),(0,c.createElement)(B,Sh)}else return(0,c.createElement)(Ae,{children:Ne,className:Ve,key:X,style:T})})}))}i.exports=e.default},function(i,e){i.exports=function(t){var n={};function r(s){if(n[s])return n[s].exports;var o=n[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=t,r.c=n,r.p="",r(0)}([function(t,n,r){t.exports=r(1)},function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var s=r(2);Object.defineProperty(n,"combineChunks",{enumerable:!0,get:function(){return s.combineChunks}}),Object.defineProperty(n,"fillInChunks",{enumerable:!0,get:function(){return s.fillInChunks}}),Object.defineProperty(n,"findAll",{enumerable:!0,get:function(){return s.findAll}}),Object.defineProperty(n,"findChunks",{enumerable:!0,get:function(){return s.findChunks}})},function(t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=n.findAll=function(d){var u=d.autoEscape,f=d.caseSensitive,p=f===void 0?!1:f,m=d.findChunks,g=m===void 0?o:m,b=d.sanitize,y=d.searchWords,_=d.textToHighlight;return a({chunksToHighlight:s({chunks:g({autoEscape:u,caseSensitive:p,sanitize:b,searchWords:y,textToHighlight:_})}),totalLength:_?_.length:0})},s=n.combineChunks=function(d){var u=d.chunks;return u=u.sort(function(f,p){return f.start-p.start}).reduce(function(f,p){if(f.length===0)return[p];var m=f.pop();if(p.start<=m.end){var g=Math.max(m.end,p.end);f.push({start:m.start,end:g})}else f.push(m,p);return f},[]),u},o=function(d){var u=d.autoEscape,f=d.caseSensitive,p=d.sanitize,m=p===void 0?l:p,g=d.searchWords,b=d.textToHighlight;return b=m(b),g.filter(function(y){return y}).reduce(function(y,_){_=m(_),u&&(_=c(_));for(var v=new RegExp(_,f?"g":"gi"),w=void 0;w=v.exec(b);){var M=w.index,C=v.lastIndex;C>M&&y.push({start:M,end:C}),w.index==v.lastIndex&&v.lastIndex++}return y},[])};n.findChunks=o;var a=n.fillInChunks=function(d){var u=d.chunksToHighlight,f=d.totalLength,p=[],m=function(y,_,v){_-y>0&&p.push({start:y,end:_,highlight:v})};if(u.length===0)m(0,f,!1);else{var g=0;u.forEach(function(b){m(g,b.start,!1),m(b.start,b.end,!0),g=b.end}),m(g,f,!1)}return p};function l(h){return h}function c(h){return h.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}}])},function(i,e,t){(function(n){if(n.env.NODE_ENV!=="production"){var r=typeof Symbol=="function"&&Symbol.for&&Symbol.for("react.element")||60103,s=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===r},o=!0;i.exports=t(6)(s,o)}else i.exports=t(13)()}).call(e,t(5))},function(i,e){var t=i.exports={},n,r;function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?n=setTimeout:n=s}catch{n=s}try{typeof clearTimeout=="function"?r=clearTimeout:r=o}catch{r=o}})();function a(b){if(n===setTimeout)return setTimeout(b,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(b,0);try{return n(b,0)}catch{try{return n.call(null,b,0)}catch{return n.call(this,b,0)}}}function l(b){if(r===clearTimeout)return clearTimeout(b);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(b);try{return r(b)}catch{try{return r.call(null,b)}catch{return r.call(this,b)}}}var c=[],h=!1,d,u=-1;function f(){!h||!d||(h=!1,d.length?c=d.concat(c):u=-1,c.length&&p())}function p(){if(!h){var b=a(f);h=!0;for(var y=c.length;y;){for(d=c,c=[];++u<y;)d&&d[u].run();u=-1,y=c.length}d=null,h=!1,l(b)}}t.nextTick=function(b){var y=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)y[_-1]=arguments[_];c.push(new m(b,y)),c.length===1&&!h&&a(p)};function m(b,y){this.fun=b,this.array=y}m.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function g(){}t.on=g,t.addListener=g,t.once=g,t.off=g,t.removeListener=g,t.removeAllListeners=g,t.emit=g,t.prependListener=g,t.prependOnceListener=g,t.listeners=function(b){return[]},t.binding=function(b){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(b){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(i,e,t){(function(n){"use strict";var r=t(7),s=t(8),o=t(9),a=t(10),l=t(11),c=t(12);i.exports=function(h,d){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function p(T){var k=T&&(u&&T[u]||T[f]);if(typeof k=="function")return k}var m="<<anonymous>>",g={array:v("array"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:w(),arrayOf:M,element:C(),instanceOf:S,node:N(),objectOf:L,oneOf:I,oneOfType:P,shape:V,exact:te};function b(T,k){return T===k?T!==0||1/T===1/k:T!==T&&k!==k}function y(T){this.message=T,this.stack=""}y.prototype=Error.prototype;function _(T){if(n.env.NODE_ENV!=="production")var k={},O=0;function B(J,H,W,K,Y,X,Ne){if(K=K||m,X=X||W,Ne!==l){if(d)s(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if(n.env.NODE_ENV!=="production"&&typeof console<"u"){var We=K+":"+W;!k[We]&&O<3&&(o(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",X,K),k[We]=!0,O++)}}return H[W]==null?J?H[W]===null?new y("The "+Y+" `"+X+"` is marked as required "+("in `"+K+"`, but its value is `null`.")):new y("The "+Y+" `"+X+"` is marked as required in "+("`"+K+"`, but its value is `undefined`.")):null:T(H,W,K,Y,X)}var U=B.bind(null,!1);return U.isRequired=B.bind(null,!0),U}function v(T){function k(O,B,U,J,H,W){var K=O[B],Y=ce(K);if(Y!==T){var X=Ae(K);return new y("Invalid "+J+" `"+H+"` of type "+("`"+X+"` supplied to `"+U+"`, expected ")+("`"+T+"`."))}return null}return _(k)}function w(){return _(r.thatReturnsNull)}function M(T){function k(O,B,U,J,H){if(typeof T!="function")return new y("Property `"+H+"` of component `"+U+"` has invali
83d PropType notation inside arrayOf.");var W=O[B];if(!Array.isArray(W)){var K=ce(W);return new y("Invalid "+J+" `"+H+"` of type "+("`"+K+"` supplied to `"+U+"`, expected an array."))}for(var Y=0;Y<W.length;Y++){var X=T(W,Y,U,J,H+"["+Y+"]",l);if(X instanceof Error)return X}return null}return _(k)}function C(){function T(k,O,B,U,J){var H=k[O];if(!h(H)){var W=ce(H);return new y("Invalid "+U+" `"+J+"` of type "+("`"+W+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return _(T)}function S(T){function k(O,B,U,J,H){if(!(O[B]instanceof T)){var W=T.name||m,K=Ve(O[B]);return new y("Invalid "+J+" `"+H+"` of type "+("`"+K+"` supplied to `"+U+"`, expected ")+("instance of `"+W+"`."))}return null}return _(k)}function I(T){if(!Array.isArray(T))return n.env.NODE_ENV!=="production"&&o(!1,"Invalid argument supplied to oneOf, expected an instance of array."),r.thatReturnsNull;function k(O,B,U,J,H){for(var W=O[B],K=0;K<T.length;K++)if(b(W,T[K]))return null;var Y=JSON.stringify(T);return new y("Invalid "+J+" `"+H+"` of value `"+W+"` "+("supplied to `"+U+"`, expected one of "+Y+"."))}return _(k)}function L(T){function k(O,B,U,J,H){if(typeof T!="function")return new y("Property `"+H+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var W=O[B],K=ce(W);if(K!=="object")return new y("Invalid "+J+" `"+H+"` of type "+("`"+K+"` supplied to `"+U+"`, expected an object."));for(var Y in W)if(W.hasOwnProperty(Y)){var X=T(W,Y,U,J,H+"."+Y,l);if(X instanceof Error)return X}return null}return _(k)}function P(T){if(!Array.isArray(T))return n.env.NODE_ENV!=="production"&&o(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),r.thatReturnsNull;for(var k=0;k<T.length;k++){var O=T[k];if(typeof O!="function")return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",ve(O),k),r.thatReturnsNull}function B(U,J,H,W,K){for(var Y=0;Y<T.length;Y++){var X=T[Y];if(X(U,J,H,W,K,l)==null)return null}return new y("Invalid "+W+" `"+K+"` supplied to "+("`"+H+"`."))}return _(B)}function N(){function T(k,O,B,U,J){return Q(k[O])?null:new y("Invalid "+U+" `"+J+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return _(T)}function V(T){function k(O,B,U,J,H){var W=O[B],K=ce(W);if(K!=="object")return new y("Invalid "+J+" `"+H+"` of type `"+K+"` "+("supplied to `"+U+"`, expected `object`."));for(var Y in T){var X=T[Y];if(X){var Ne=X(W,Y,U,J,H+"."+Y,l);if(Ne)return Ne}}return null}return _(k)}function te(T){function k(O,B,U,J,H){var W=O[B],K=ce(W);if(K!=="object")return new y("Invalid "+J+" `"+H+"` of type `"+K+"` "+("supplied to `"+U+"`, expected `object`."));var Y=a({},O[B],T);for(var X in Y){var Ne=T[X];if(!Ne)return new y("Invalid "+J+" `"+H+"` key `"+X+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(O[B],null," ")+` 84Valid keys: `+JSON.stringify(Object.keys(T),null," "));var We=Ne(W,X,U,J,H+"."+X,l);if(We)return We}return null}return _(k)}function Q(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(Q);if(T===null||h(T))return!0;var k=p(T);if(k){var O=k.call(T),B;if(k!==T.entries){for(;!(B=O.next()).done;)if(!Q(B.value))return!1}else for(;!(B=O.next()).done;){var U=B.value;if(U&&!Q(U[1]))return!1}}else return!1;return!0;default:return!1}}function fe(T,k){return T==="symbol"||k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol}function ce(T){var k=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":fe(k,T)?"symbol":k}function Ae(T){if(typeof T>"u"||T===null)return""+T;var k=ce(T);
84if(k==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return k}function ve(T){var k=Ae(T);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function Ve(T){return!T.constructor||!T.constructor.name?m:T.constructor.name}return g.checkPropTypes=c,g.PropTypes=g,g}}).call(e,t(5))},function(i,e){"use strict";function t(r){return function(){return r}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(r){return r},i.exports=n},function(i,e,t){(function(n){"use strict";var r=function(a){};n.env.NODE_ENV!=="production"&&(r=function(a){if(a===void 0)throw new Error("invariant requires an error message argument")});function s(o,a,l,c,h,d,u,f){if(r(a),!o){var p;if(a===void 0)p=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var m=[l,c,h,d,u,f],g=0;p=new Error(a.replace(/%s/g,function(){return m[g++]})),p.name="Invariant Violation"}throw p.framesToPop=1,p}}i.exports=s}).call(e,t(5))},function(i,e,t){(function(n){"use strict";var r=t(7),s=r;if(n.env.NODE_ENV!=="production"){var o=function(l){for(var c=arguments.length,h=Array(c>1?c-1:0),d=1;d<c;d++)h[d-1]=arguments[d];var u=0,f="Warning: "+l.replace(/%s/g,function(){return h[u++]});typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}};s=function(l,c){if(c===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(c.indexOf("Failed Composite propType: ")!==0&&!l){for(var h=arguments.length,d=Array(h>2?h-2:0),u=2;u<h;u++)d[u-2]=arguments[u];o.apply(void 0,[c].concat(d))}}}i.exports=s}).call(e,t(5))},function(i,e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function s(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var l={},c=0;c<10;c++)l["_"+String.fromCharCode(c)]=c;var h=Object.getOwnPropertyNames(l).map(function(u){return l[u]});if(h.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(u){d[u]=u}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}i.exports=o()?Object.assign:function(a,l){for(var c,h=s(a),d,u=1;u<arguments.length;u++){c=Object(arguments[u]);for(var f in c)n.call(c,f)&&(h[f]=c[f]);if(t){d=t(c);for(var p=0;p<d.length;p++)r.call(c,d[p])&&(h[d[p]]=c[d[p]])}}return h}},function(i,e){"use strict";var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";i.exports=t},function(i,e,t){(function(n){"use strict";if(n.env.NODE_ENV!=="production")var r=t(8),s=t(9),o=t(11),a={};function l(c,h,d,u,f){if(n.env.NODE_ENV!=="production"){for(var p in c)if(c.hasOwnProperty(p)){var m;try{r(typeof c[p]=="function","%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",u||"React class",d,p,typeof c[p]),m=c[p](h,p,u,d,null,o)}catch(b){m=b}if(s(!m||m instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",d,p,typeof m),m instanceof Error&&!(m.message in a)){a[m.message]=!0;var g=f?f():"";s(!1,"Failed %s type: %s%s",d,m.message,g??"")}}}}i.exports=l}).call(e,t(5))},function(i,e,t){"use strict";var n=t(7),r=t(8),s=t(11);i.exports=function(){function o(c,h,d,u,f,p){p!==s&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}o.isRequired=o;function a(){return o}var l={array:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:a,element:o,instanceOf:a,node:o,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a};return l.checkPropTypes=n,l.PropTypes=l,l}},function(i,e){i.exports=it()},function(i,e){"use strict";var t=function(s,o){return s===o};function n(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,o=void 0,a=[],l=void 0,c=!1,h=function(f,p){return s(f,a[p])},d=function(){for(var f=arguments.length,p=Array(f),m=0;m<f;m++)p[m]=arguments[m];return c&&o===this&&p.length===a.length&&p.every(h)||(c=!0,o=this,a=p,l=r.apply(this,p)),l};return d}i.exports=n}])});function Xc(i){let e=Object.prototype.toString.call(i).slice(8,-1);return e==="Object"&&typeof i[Symbol.iterator]=="function"?"Iterable":e==="Custom"&&i.constructor!==Object&&i instanceof Object?"Object":e}var up=E(()=>{});function Rr(i){let{styling:e,arrowStyle:t="single",expanded:n,nodeType:r,onClick:s}=i;return po.default.createElement("div",le({},e("arrowContainer",t),{onClick:s}),po.default.createElement("div",e(["arrow","arrowSign"],r,n,t),"\u25B6",t==="double"&&po.default.createElement("div",e(["arrowSign","arrowSignInner"]),"\u25B6")))}var po,Qc=E(()=>{vn();po=ne(it())});function lv(i,e){return i==="Object"?Object.keys(e).length:i==="Array"?e.length:1/0}function cv(i){return typeof i.set=="function"}function hv(i,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1/0,s;if(i==="Object"){let o=Object.getOwnPropertyNames(e);t&&o.sort(t===!0?void 0:t),o=o.slice(n,r+1),s={entries:o.map(a=>({key:a,value:e[a]}))}}else if(i==="Array")s={entries:e.slice(n,r+1).map((o,a)=>({key:a+n,value:o}))};else{let o=0,a=[],l=!0,c=cv(e);for(let h of e){if(o>r){l=!1;break}n<=o&&(c&&Array.isArray(h)?typeof h[0]=="string"||typeof h[0]=="number"?a.push({key:h[0],value:h[1]}):a.push({key:`[entry ${o}]`,value:{"[key]":h[0],"[value]":h[1]}}):a.push({key:o,value:h})),o++}s={hasMore:!l,entries:a}}return s}function Zc(i,e,t){let n=[];for(;e-i>t*t;)t=t*t;for(let r=i;r<=e;r+=t)n.push({from:r,to:Math.min(e,r+t-1)});return n}function eh(i,e,t,n){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:1/0,o=hv.bind(null,i,e,t);if(!n)return o().entries;let a=s<1/0,l=Math.min(s-r,lv(i,e));
84if(i!=="Iterable"){if(l<=n||n<7)return o(r,s).entries}else if(l<=n&&!a)return o(r,s).entries;let c;if(i==="Iterable"){let{hasMore:h,entries:d}=o(r,r+n-1);c=h?[...d,...Zc(r+n,r+2*n-1,n)]:d}else c=a?Zc(r,s,n):[...o(0,n-5).entries,...Zc(n-4,l-5,n),...o(l-4,l-1).entries];return c}var fp=E(()=>{});function th(i){let{styling:e,from:t,to:n,renderChildNodes:r,nodeType:s}=i,[o,a]=(0,xn.useState)(!1),l=(0,xn.useCallback)(()=>{a(!o)},[o]);return o?xn.default.createElement("div",e("itemRange",o),r(i,t,n)):xn.default.createElement("div",le({},e("itemRange",o),{onClick:l}),xn.default.createElement(Rr,{nodeType:s,styling:e,expanded:!1,onClick:l,arrowStyle:"double"}),`${t} ... ${n}`)}var xn,mp=E(()=>{vn();xn=ne(it());Qc()});function dv(i){return i.to!==void 0}function pp(i,e,t){let{nodeType:n,data:r,collectionLimit:s,circularCache:o,keyPath:a,postprocessValue:l,sortObjectKeys:c}=i,h=[];return eh(n,r,c,s,e,t).forEach(d=>{if(dv(d))h.push(ze.default.createElement(th,le({},i,{key:`ItemRange--${d.from}-${d.to}`,from:d.from,to:d.to,renderChildNodes:pp})));else{let{key:u,value:f}=d,p=o.indexOf(f)!==-1;h.push(ze.default.createElement(Br,le({},i,{postprocessValue:l,collectionLimit:s,key:`Node--${u}`,keyPath:[u,...a],value:l(f),circularCache:[...o,f],isCircular:p,hideRoot:!1})))}}),h}function Fn(i){let{circularCache:e=[],collectionLimit:t,createItemString:n,data:r,expandable:s,getItemString:o,hideRoot:a,isCircular:l,keyPath:c,labelRenderer:h,level:d=0,nodeType:u,nodeTypeIndicator:f,shouldExpandNodeInitially:p,styling:m}=i,[g,b]=(0,ze.useState)(l?!1:p(c,r,d)),y=(0,ze.useCallback)(()=>{s&&b(!g)},[s,g]),_=g||a&&d===0?pp({...i,circularCache:e,level:d+1}):null,v=ze.default.createElement("span",m("nestedNodeItemType",g),f),w=o(u,r,v,n(r,t),c),M=[c,u,g,s];return a?ze.default.createElement("li",m("rootNode",...M),ze.default.createElement("ul",m("rootNodeChildren",...M),_)):ze.default.createElement("li",m("nestedNode",...M),s&&ze.default.createElement(Rr,{styling:m,nodeType:u,expanded:g,onClick:y}),ze.default.createElement("label",le({},m(["label","nestedNodeLabel"],...M),{onClick:y}),h(...M)),ze.default.createElement("span",le({},m("nestedNodeItemString",...M),{onClick:y}),w),ze.default.createElement("ul",m("nestedNodeChildren",...M),_))}var ze,go=E(()=>{vn();ze=ne(it());Qc();fp();nh();mp()});function uv(i){let e=Object.getOwnPropertyNames(i).length;return`${e} ${e!==1?"keys":"key"}`}function ih(i){let{data:e,...t}=i;return gp.default.createElement(Fn,le({},t,{data:e,nodeType:"Object",nodeTypeIndicator:t.nodeType==="Error"?"Error()":"{}",createItemString:uv,expandable:Object.getOwnPropertyNames(e).length>0}))}var gp,bp=E(()=>{vn();gp=ne(it());go()});function fv(i){return`${i.length} ${i.length!==1?"items":"item"}`}function rh(i){let{data:e,...t}=i;return yp.default.createElement(Fn,le({},t,{data:e,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:fv,expandable:e.length>0}))}var yp,_p=E(()=>{vn();yp=ne(it());go()});function mv(i,e){let t=0,n=!1;if(Number.isSafeInteger(i.size))t=i.size;else for(let r of i){if(e&&t+1>e){n=!0;break}t+=1}return`${n?">":""}${t} ${t!==1?"entries":"entry"}`}function sh(i){return xp.default.createElement(Fn,le({},i,{nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:mv,expandable:!0}))}var xp,vp=E(()=>{vn();xp=ne(it());go()});function xt(i){let{nodeType:e,styling:t,labelRenderer:n,keyPath:r,valueRenderer:s,value:o,valueGetter:a=l=>l}=i;return bo.default.createElement("li",t("value",e,r),bo.default.createElement("label",t(["label","valueLabel"],e,r),n(r,e,!1,!1)),bo.default.createElement("span",t("valueText",e,r),s(a(o),o,...r)))}var bo,wp=E(()=>{bo=ne(it())});function Br(i){let{getItemString:e,keyPath:t,labelRenderer:n,styling:r,value:s,valueRenderer:o,isCustomNode:a,...l}=i,c=a(s)?"Custom":Xc(s),h={getItemString:e,key:t[0],keyPath:t,labelRenderer:n,nodeType:c,styling:r,value:s,valueRenderer:o},d={...l,...h,data:s,isCustomNode:a};switch(c){case"Object":case"Error":case"WeakMap":case"WeakSet":return tt.default.createElement(ih,d);case"Array":return tt.default.createElement(rh,d);case"Iterable":case"Map":case"Set":return tt.default.createElement(sh,d);case"String":return tt.default.createElement(xt,le({},h,{valueGetter:u=>`"${u}"`}));case"Number":return tt.default.createElement(xt,h);case"Boolean":return tt.default.createElement(xt,le({},h,{valueGetter:u=>u?"true":"false"}));case"Date":return tt.default.createElement(xt,le({},h,{valueGetter:u=>u.toISOString()}));case"Null":return tt.default.createElement(xt,le({},h,{valueGetter:()=>"null"}));case"Undefined":return tt.default.createElement(xt,le({},h,{valueGetter:()=>"undefined"}));
84case"Function":case"Symbol":return tt.default.createElement(xt,le({},h,{valueGetter:u=>u.toString()}));case"Custom":return tt.default.createElement(xt,h);default:return tt.default.createElement(xt,le({},h,{valueGetter:()=>`<${c}>`}))}}var tt,nh=E(()=>{vn();tt=ne(it());up();bp();_p();vp();wp()});function kp(i){if(Array.isArray(i))return i}var Sp=E(()=>{});function Cp(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var n,r,s,o,a=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=s.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(h){c=!0,r=h}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}var Mp=E(()=>{});function Ep(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 85In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ap=E(()=>{});function oh(i,e){return kp(i)||Cp(i,e)||Ch(i,e)||Ep()}var Tp=E(()=>{Sp();Mp();Jb();Ap()});var Dp=j((yo,Ip)=>{"use strict";yo.__esModule=!0;yo.default={scheme:"threezerotwofour",author:"jan t. sott (http://github.com/idleberg)",base00:"#090300",base01:"#3a3432",base02:"#4a4543",base03:"#5c5855",base04:"#807d7c",base05:"#a5a2a2",base06:"#d6d5d4",base07:"#f7f7f7",base08:"#db2d20",base09:"#e8bbd0",base0A:"#fded02",base0B:"#01a252",base0C:"#b5e4f4",base0D:"#01a0e4",base0E:"#a16a94",base0F:"#cdab53"};Ip.exports=yo.default});var Lp=j((_o,Np)=>{"use strict";_o.__esModule=!0;_o.default={scheme:"apathy",author:"jannik siebert (https://github.com/janniks)",base00:"#031A16",base01:"#0B342D",base02:"#184E45",base03:"#2B685E",base04:"#5F9C92",base05:"#81B5AC",base06:"#A7CEC8",base07:"#D2E7E4",base08:"#3E9688",base09:"#3E7996",base0A:"#3E4C96",base0B:"#883E96",base0C:"#963E4C",base0D:"#96883E",base0E:"#4C963E",base0F:"#3E965B"};Np.exports=_o.default});var Rp=j((xo,Op)=>{"use strict";xo.__esModule=!0;xo.default={scheme:"ashes",author:"jannik siebert (https://github.com/janniks)",base00:"#1C2023",base01:"#393F45",base02:"#565E65",base03:"#747C84",base04:"#ADB3BA",base05:"#C7CCD1",base06:"#DFE2E5",base07:"#F3F4F5",base08:"#C7AE95",base09:"#C7C795",base0A:"#AEC795",base0B:"#95C7AE",base0C:"#95AEC7",base0D:"#AE95C7",base0E:"#C795AE",base0F:"#C79595"};Op.exports=xo.default});var zp=j((vo,Bp)=>{"use strict";vo.__esModule=!0;vo.default={scheme:"atelier dune",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)",base00:"#20201d",base01:"#292824",base02:"#6e6b5e",base03:"#7d7a68",base04:"#999580",base05:"#a6a28c",base06:"#e8e4cf",base07:"#fefbec",base08:"#d73737",base09:"#b65611",base0A:"#cfb017",base0B:"#60ac39",base0C:"#1fad83",base0D:"#6684e1",base0E:"#b854d4",base0F:"#d43552"};Bp.exports=vo.default});var Pp=j((wo,jp)=>{"use strict";wo.__esModule=!0;wo.default={scheme:"atelier forest",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)",base00:"#1b1918",base01:"#2c2421",base02:"#68615e",base03:"#766e6b",base04:"#9c9491",base05:"#a8a19f",base06:"#e6e2e0",base07:"#f1efee",base08:"#f22c40",base09:"#df5320",base0A:"#d5911a",base0B:"#5ab738",base0C:"#00ad9c",base0D:"#407ee7",base0E:"#6666ea",base0F:"#c33ff3"};jp.exports=wo.default});var Fp=j((ko,Up)=>{"use strict";ko.__esModule=!0;ko.default={scheme:"atelier heath",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath)",base00:"#1b181b",base01:"#292329",base02:"#695d69",base03:"#776977",base04:"#9e8f9e",base05:"#ab9bab",base06:"#d8cad8",base07:"#f7f3f7",base08:"#ca402b",base09:"#a65926",base0A:"#bb8a35",base0B:"#379a37",base0C:"#159393",base0D:"#516aec",base0E:"#7b59c0",base0F:"#cc33cc"};Up.exports=ko.default});var Hp=j((So,$p)=>{"use strict";So.__esModule=!0;So.default={scheme:"atelier lakeside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/)",base00:"#161b1d",base01:"#1f292e",base02:"#516d7b",base03:"#5a7b8c",base04:"#7195a8",base05:"#7ea2b4",base06:"#c1e4f6",base07:"#ebf8ff",base08:"#d22d72",base09:"#935c25",base0A:"#8a8a0f",base0B:"#568c3b",base0C:"#2d8f6f",base0D:"#257fad",base0E:"#5d5db1",base0F:"#b72dd2"};$p.exports=So.default});var Vp=j((Co,qp)=>{"use strict";Co.__esModule=!0;Co.default={scheme:"atelier seaside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)",base00:"#131513",base01:"#242924",base02:"#5e6e5e",base03:"#687d68",base04:"#809980",base05:"#8ca68c",base06:"#cfe8cf",base07:"#f0fff0",base08:"#e6193c",base09:"#87711d",base0A:"#c3c322",base0B:"#29a329",base0C:"#1999b3",base0D:"#3d62f5",base0E:"#ad2bee",base0F:"#e619c3"};qp.exports=Co.default});var Gp=j((Mo,Wp)=>{"use strict";Mo.__esModule=!0;Mo.default={scheme:"bespin",author:"jan t. sott",base00:"#28211c",base01:"#36312e",base02:"#5e5d5c",base03:"#666666",base04:"#797977",base05:"#8a8986",base06:"#9d9b97",base07:"#baae9e",base08:"#cf6a4c",base09:"#cf7d34",base0A:"#f9ee98",base0B:"#54be0d",base0C:"#afc4db",base0D:"#5ea6ea",base0E:"#9b859d",base0F:"#937121"};Wp.exports=Mo.default});var Kp=j((Eo,Jp)=>{"use strict";Eo.__esModule=!0;Eo.default={scheme:"brewer",author:"timoth\xE9e poisot (http://github.com/tpoisot)",base00:"#0c0d0e",base01:"#2e2f30",base02:"#515253",base03:"#737475",base04:"#959697",base05:"#b7b8b9",base06:"#dadbdc",base07:"#fcfdfe",base08:"#e31a1c",base09:"#e6550d",base0A:"#dca060",base0B:"#31a354",base0C:"#80b1d3",base0D:"#3182bd",base0E:"#756bb1",base0F:"#b15928"};Jp.exports=Eo.default});var Xp=j((Ao,Yp)=>{"use strict";Ao.__esModule=!0;Ao.default={scheme:"bright",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#303030",base02:"#505050",base03:"#b0b0b0",base04:"#d0d0d0",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ffffff",base08:"#fb0120",base09:"#fc6d24",base0A:"#fda331",base0B:"#a1c659",base0C:"#76c7b7",base0D:"#6fb3d2",base0E:"#d381c3",base0F:"#be643c"};Yp.exports=Ao.default});var Zp=j((To,Qp)=>{"use strict";To.__esModule=!0;To.default={scheme:"chalk",author:"chris kempson (http://chriskempson.com)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#eda987",base0A:"#ddb26f",base0B:"#acc267",base0C:"#12cfc0",base0D:"#6fc2ef",base0E:"#e1a3ee",base0F:"#deaf8f"};Qp.exports=To.default});var tg=j((Io,eg)=>{"use strict";Io.__esModule=!0;Io.default={scheme:"codeschool",author:"brettof86",base00:"#232c31",base01:"#1c3657",base02:"#2a343a",base03:"#3f4944",base04:"#84898c",base05:"#9ea7a6",base06:"#a7cfa3",base07:"#b5d8f6",base08:"#2a5491",base09:"#43820d",base0A:"#a03b1e",base0B:"#237986",base0C:"#b02f30",base0D:"#484d79",base0E:"#c59820",base0F:"#c98344"};eg.exports=Io.default});var ig=j((Do,ng)=>{"use strict";Do.__esModule=!0;Do.default={scheme:"colors",author:"mrmrs (http://clrs.cc)",base00:"#111111",base01:"#333333",base02:"#555555",base03:"#777777",base04:"#999999",base05:"#bbbbbb",base06:"#dddddd",base07:"#ffffff",base08:"#ff4136",base09:"#ff851b",base0A:"#ffdc00",base0B:"#2ecc40",base0C:"#7fdbff",base0D:"#0074d9",base0E:"#b10dc9",base0F:"#85144b"};ng.exports=Do.default});var sg=j((No,rg)=>{"use strict";No.__esModule=!0;No.default={scheme:"default",author:"chris kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"};rg.exports=No.default});var ag=j((Lo,og)=>{"use strict";Lo.__esModule=!0;Lo.default={scheme:"eighties",author:"chris kempson (http://chriskempson.com)",base00:"#2d2d2d",base01:"#393939",base02:"#515151",base03:"#747369",base04:"#a09f93",base05:"#d3d0c8",base06:"#e8e6df",base07:"#f2f0ec",base08:"#f2777a",base09:"#f99157",base0A:"#ffcc66",base0B:"#99cc99",base0C:"#66cccc",base0D:"#6699cc",base0E:"#cc99cc",base0F:"#d27b53"};og.exports=Lo.default});var cg=j((Oo,lg)=>{"use strict";Oo.__esModule=!0;Oo.default={scheme:"embers",author:"jannik siebert (https://github.com/janniks)",base00:"#16130F",base01:"#2C2620",base02:"#433B32",base03:"#5A5047",base04:"#8A8075",base05:"#A39A90",base06:"#BEB6AE",base07:"#DB
85D6D1",base08:"#826D57",base09:"#828257",base0A:"#6D8257",base0B:"#57826D",base0C:"#576D82",base0D:"#6D5782",base0E:"#82576D",base0F:"#825757"};lg.exports=Oo.default});var dg=j((Ro,hg)=>{"use strict";Ro.__esModule=!0;Ro.default={scheme:"flat",author:"chris kempson (http://chriskempson.com)",base00:"#2C3E50",base01:"#34495E",base02:"#7F8C8D",base03:"#95A5A6",base04:"#BDC3C7",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ECF0F1",base08:"#E74C3C",base09:"#E67E22",base0A:"#F1C40F",base0B:"#2ECC71",base0C:"#1ABC9C",base0D:"#3498DB",base0E:"#9B59B6",base0F:"#be643c"};hg.exports=Ro.default});var fg=j((Bo,ug)=>{"use strict";Bo.__esModule=!0;Bo.default={scheme:"google",author:"seth wright (http://sethawright.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#CC342B",base09:"#F96A38",base0A:"#FBA922",base0B:"#198844",base0C:"#3971ED",base0D:"#3971ED",base0E:"#A36AC7",base0F:"#3971ED"};ug.exports=Bo.default});var pg=j((zo,mg)=>{"use strict";zo.__esModule=!0;zo.default={scheme:"grayscale",author:"alexandre gavioli (https://github.com/alexx2/)",base00:"#101010",base01:"#252525",base02:"#464646",base03:"#525252",base04:"#ababab",base05:"#b9b9b9",base06:"#e3e3e3",base07:"#f7f7f7",base08:"#7c7c7c",base09:"#999999",base0A:"#a0a0a0",base0B:"#8e8e8e",base0C:"#868686",base0D:"#686868",base0E:"#747474",base0F:"#5e5e5e"};mg.exports=zo.default});var bg=j((jo,gg)=>{"use strict";jo.__esModule=!0;jo.default={scheme:"green screen",author:"chris kempson (http://chriskempson.com)",base00:"#001100",base01:"#003300",base02:"#005500",base03:"#007700",base04:"#009900",base05:"#00bb00",base06:"#00dd00",base07:"#00ff00",base08:"#007700",base09:"#009900",base0A:"#007700",base0B:"#00bb00",base0C:"#005500",base0D:"#009900",base0E:"#00bb00",base0F:"#005500"};gg.exports=jo.default});var _g=j((Po,yg)=>{"use strict";Po.__esModule=!0;Po.default={scheme:"harmonic16",author:"jannik siebert (https://github.com/janniks)",base00:"#0b1c2c",base01:"#223b54",base02:"#405c79",base03:"#627e99",base04:"#aabcce",base05:"#cbd6e2",base06:"#e5ebf1",base07:"#f7f9fb",base08:"#bf8b56",base09:"#bfbf56",base0A:"#8bbf56",base0B:"#56bf8b",base0C:"#568bbf",base0D:"#8b56bf",base0E:"#bf568b",base0F:"#bf5656"};yg.exports=Po.default});var vg=j((Uo,xg)=>{"use strict";Uo.__esModule=!0;Uo.default={scheme:"hopscotch",author:"jan t. sott",base00:"#322931",base01:"#433b42",base02:"#5c545b",base03:"#797379",base04:"#989498",base05:"#b9b5b8",base06:"#d5d3d5",base07:"#ffffff",base08:"#dd464c",base09:"#fd8b19",base0A:"#fdcc59",base0B:"#8fc13e",base0C:"#149b93",base0D:"#1290bf",base0E:"#c85e7c",base0F:"#b33508"};xg.exports=Uo.default});var kg=j((Fo,wg)=>{"use strict";Fo.__esModule=!0;Fo.default={scheme:"isotope",author:"jan t. sott",base00:"#000000",base01:"#404040",base02:"#606060",base03:"#808080",base04:"#c0c0c0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#ff0000",base09:"#ff9900",base0A:"#ff0099",base0B:"#33ff00",base0C:"#00ffff",base0D:"#0066ff",base0E:"#cc00ff",base0F:"#3300ff"};wg.exports=Fo.default});var Cg=j(($o,Sg)=>{"use strict";$o.__esModule=!0;$o.default={scheme:"marrakesh",author:"alexandre gavioli (http://github.com/alexx2/)",base00:"#201602",base01:"#302e00",base02:"#5f5b17",base03:"#6c6823",base04:"#86813b",base05:"#948e48",base06:"#ccc37a",base07:"#faf0a5",base08:"#c35359",base09:"#b36144",base0A:"#a88339",base0B:"#18974e",base0C:"#75a738",base0D:"#477ca1",base0E:"#8868b3",base0F:"#b3588e"};Sg.exports=$o.default});var Eg=j((Ho,Mg)=>{"use strict";Ho.__esModule=!0;Ho.default={scheme:"mocha",author:"chris kempson (http://chriskempson.com)",base00:"#3B3228",base01:"#534636",base02:"#645240",base03:"#7e705a",base04:"#b8afad",base05:"#d0c8c6",base06:"#e9e1dd",base07:"#f5eeeb",base08:"#cb6077",base09:"#d28b71",base0A:"#f4bc87",base0B:"#beb55b",base0C:"#7bbda4",base0D:"#8ab3b5",base0E:"#a89bb9",base0F:"#bb9584"};Mg.exports=Ho.default});var Tg=j((qo,Ag)=>{"use strict";qo.__esModule=!0;qo.default={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"};Ag.exports=qo.default});var Dg=j((Vo,Ig)=>{"use strict";Vo.__esModule=!0;Vo.default={scheme:"ocean",author:"chris kempson (http://chriskempson.com)",base00:"#2b303b",base01:"#343d46",base02:"#4f5b66",base03:"#65737e",base04:"#a7adba",base05:"#c0c
855ce",base06:"#dfe1e8",base07:"#eff1f5",base08:"#bf616a",base09:"#d08770",base0A:"#ebcb8b",base0B:"#a3be8c",base0C:"#96b5b4",base0D:"#8fa1b3",base0E:"#b48ead",base0F:"#ab7967"};Ig.exports=Vo.default});var Lg=j((Wo,Ng)=>{"use strict";Wo.__esModule=!0;Wo.default={scheme:"paraiso",author:"jan t. sott",base00:"#2f1e2e",base01:"#41323f",base02:"#4f424c",base03:"#776e71",base04:"#8d8687",base05:"#a39e9b",base06:"#b9b6b0",base07:"#e7e9db",base08:"#ef6155",base09:"#f99b15",base0A:"#fec418",base0B:"#48b685",base0C:"#5bc4bf",base0D:"#06b6ef",base0E:"#815ba4",base0F:"#e96ba8"};Ng.exports=Wo.default});var Rg=j((Go,Og)=>{"use strict";Go.__esModule=!0;Go.default={scheme:"pop",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#eb008a",base09:"#f29333",base0A:"#f8ca12",base0B:"#37b349",base0C:"#00aabb",base0D:"#0e5a94",base0E:"#b31e8d",base0F:"#7a2d00"};Og.exports=Go.default});var zg=j((Jo,Bg)=>{"use strict";Jo.__esModule=!0;Jo.default={scheme:"railscasts",author:"ryan bates (http://railscasts.com)",base00:"#2b2b2b",base01:"#272935",base02:"#3a4055",base03:"#5a647e",base04:"#d4cfc9",base05:"#e6e1dc",base06:"#f4f1ed",base07:"#f9f7f3",base08:"#da4939",base09:"#cc7833",base0A:"#ffc66d",base0B:"#a5c261",base0C:"#519f50",base0D:"#6d9cbe",base0E:"#b6b3eb",base0F:"#bc9458"};Bg.exports=Jo.default});var Pg=j((Ko,jg)=>{"use strict";Ko.__esModule=!0;Ko.default={scheme:"shapeshifter",author:"tyler benziger (http://tybenz.com)",base00:"#000000",base01:"#040404",base02:"#102015",base03:"#343434",base04:"#555555",base05:"#ababab",base06:"#e0e0e0",base07:"#f9f9f9",base08:"#e92f2f",base09:"#e09448",base0A:"#dddd13",base0B:"#0ed839",base0C:"#23edda",base0D:"#3b48e3",base0E:"#f996e2",base0F:"#69542d"};jg.exports=Ko.default});var Fg=j((Yo,Ug)=>{"use strict";Yo.__esModule=!0;Yo.default={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"};Ug.exports=Yo.default});var Hg=j((Xo,$g)=>{"use strict";Xo.__esModule=!0;Xo.default={scheme:"summerfruit",author:"christopher corley (http://cscorley.github.io/)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#B0B0B0",base05:"#D0D0D0",base06:"#E0E0E0",base07:"#FFFFFF",base08:"#FF0086",base09:"#FD8900",base0A:"#ABA800",base0B:"#00C918",base0C:"#1faaaa",base0D:"#3777E6",base0E:"#AD00A1",base0F:"#cc6633"};$g.exports=Xo.default});var Vg=j((Qo,qg)=>{"use strict";Qo.__esModule=!0;Qo.default={scheme:"tomorrow",author:"chris kempson (http://chriskempson.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#cc6666",base09:"#de935f",base0A:"#f0c674",base0B:"#b5bd68",base0C:"#8abeb7",base0D:"#81a2be",base0E:"#b294bb",base0F:"#a3685a"};qg.exports=Qo.default});var Gg=j((Zo,Wg)=>{"use strict";Zo.__esModule=!0;Zo.default={scheme:"london tube",author:"jan t. sott",base00:"#231f20",base01:"#1c3f95",base02:"#5a5758",base03:"#737171",base04:"#959ca1",base05:"#d9d8d8",base06:"#e7e7e8",base07:"#ffffff",base08:"#ee2e24",base09:"#f386a1",base0A:"#ffd204",base0B:"#00853e",base0C:"#85cebc",base0D:"#009ddc",base0E:"#98005d",base0F:"#b06110"};Wg.exports=Zo.default});var Kg=j((ea,Jg)=>{"use strict";ea.__esModule=!0;ea.default={scheme:"twilight",author:"david hart (http://hart-dev.com)",base00:"#1e1e1e",base01:"#323537",base02:"#464b50",base03:"#5f5a60",base04:"#838184",base05:"#a7a7a7",base06:"#c3c3c3",base07:"#ffffff",base08:"#cf6a4c",base09:"#cda869",base0A:"#f9ee98",base0B:"#8f9d6a",base0C:"#afc4db",base0D:"#7587a6",base0E:"#9b859d",base0F:"#9b703f"};Jg.exports=ea.default});var Yg=j($=>{"use strict";$.__esModule=!0;function q(i){return i&&i.__esModule?i.default:i}var pv=Dp();$.threezerotwofour=q(pv);var gv=Lp();$.apathy=q(gv);var bv=Rp();$.ashes=q(bv);var yv=zp();$.atelierDune=q(yv);var _v=Pp();$.atelierForest=q(_v);var xv=Fp();$.atelierHeath=q(xv);var vv=Hp();$.atelierLakeside=q(vv);var wv=Vp();$.atelierSeaside=q(wv);var kv=Gp();$.bespin=q(kv);var Sv=Kp();$.brewer=q(Sv);var Cv=Xp();$.bright=q(Cv);var Mv=Zp();$.chalk=q(Mv);var Ev=tg();$.codeschool=q(Ev);var Av=ig();$.colors=q(Av);
85var Tv=sg();$.default=q(Tv);var Iv=ag();$.eighties=q(Iv);var Dv=cg();$.embers=q(Dv);var Nv=dg();$.flat=q(Nv);var Lv=fg();$.google=q(Lv);var Ov=pg();$.grayscale=q(Ov);var Rv=bg();$.greenscreen=q(Rv);var Bv=_g();$.harmonic=q(Bv);var zv=vg();$.hopscotch=q(zv);var jv=kg();$.isotope=q(jv);var Pv=Cg();$.marrakesh=q(Pv);var Uv=Eg();$.mocha=q(Uv);var Fv=Tg();$.monokai=q(Fv);var $v=Dg();$.ocean=q($v);var Hv=Lg();$.paraiso=q(Hv);var qv=Rg();$.pop=q(qv);var Vv=zg();$.railscasts=q(Vv);var Wv=Pg();$.shapeshifter=q(Wv);var Gv=Fg();$.solarized=q(Gv);var Jv=Hg();$.summerfruit=q(Jv);var Kv=Vg();$.tomorrow=q(Kv);var Yv=Gg();$.tube=q(Yv);var Xv=Kg();$.twilight=q(Xv)});var Qg=j((CE,Xg)=>{"use strict";Xg.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ah=j((ME,nb)=>
vendor: 16,121 bytes, line 85
85{var $n=Qg(),tb={};for(ta in $n)$n.hasOwnProperty(ta)&&(tb[$n[ta]]=ta);var ta,R=nb.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(je in R)if(R.hasOwnProperty(je)){if(!("channels"in R[je]))throw new Error("missing channels property: "+je);if(!("labels"in R[je]))throw new Error("missing channel labels property: "+je);if(R[je].labels.length!==R[je].channels)throw new Error("channel and label counts mismatch: "+je);Zg=R[je].channels,eb=R[je].labels,delete R[je].channels,delete R[je].labels,Object.defineProperty(R[je],"channels",{value:Zg}),Object.defineProperty(R[je],"labels",{value:eb})}var Zg,eb,je;R.rgb.hsl=function(i){var e=i[0]/255,t=i[1]/255,n=i[2]/255,r=Math.min(e,t,n),s=Math.max(e,t,n),o=s-r,a,l,c;return s===r?a=0:e===s?a=(t-n)/o:t===s?a=2+(n-e)/o:n===s&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360),c=(r+s)/2,s===r?l=0:c<=.5?l=o/(s+r):l=o/(2-s-r),[a,l*100,c*100]};R.rgb.hsv=function(i){var e,t,n,r,s,o=i[0]/255,a=i[1]/255,l=i[2]/255,c=Math.max(o,a,l),h=c-Math.min(o,a,l),d=function(u){return(c-u)/6/h+1/2};return h===0?r=s=0:(s=h/c,e=d(o),t=d(a),n=d(l),o===c?r=n-t:a===c?r=1/3+e-n:l===c&&(r=2/3+t-e),r<0?r+=1:r>1&&(r-=1)),[r*360,s*100,c*100]};R.rgb.hwb=function(i){var e=i[0],t=i[1],n=i[2],r=R.rgb.hsl(i)[0],s=1/255*Math.min(e,Math.min(t,n));return n=1-1/255*Math.max(e,Math.max(t,n)),[r,s*100,n*100]};R.rgb.cmyk=function(i){var e=i[0]/255,t=i[1]/255,n=i[2]/255,r,s,o,a;return a=Math.min(1-e,1-t,1-n),r=(1-e-a)/(1-a)||0,s=(1-t-a)/(1-a)||0,o=(1-n-a)/(1-a)||0,[r*100,s*100,o*100,a*100]};function Qv(i,e){return Math.pow(i[0]-e[0],2)+Math.pow(i[1]-e[1],2)+Math.pow(i[2]-e[2],2)}R.rgb.keyword=function(i){var e=tb[i];if(e)return e;var t=1/0,n;for(var r in $n)if($n.hasOwnProperty(r)){var s=$n[r],o=Qv(i,s);o<t&&(t=o,n=r)}return n};R.keyword.rgb=function(i){return $n[i]};R.rgb.xyz=function(i){var e=i[0]/255,t=i[1]/255,n=i[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var r=e*.4124+t*.3576+n*.1805,s=e*.2126+t*.7152+n*.0722,o=e*.0193+t*.1192+n*.9505;return[r*100,s*100,o*100]};R.rgb.lab=function(i){var e=R.rgb.xyz(i),t=e[0],n=e[1],r=e[2],s,o,a;return t/=95.047,n/=100,r/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,s=116*n-16,o=500*(t-n),a=200*(n-r),[s,o,a]};R.hsl.rgb=function(i){var e=i[0]/360,t=i[1]/100,n=i[2]/100,r,s,o,a,l;if(t===0)return l=n*255,[l,l,l];n<.5?s=n*(1+t):s=n+t-n*t,r=2*n-s,a=[0,0,0];for(var c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?l=r+(s-r)*6*o:2*o<1?l=s:3*o<2?l=r+(s-r)*(2/3-o)*6:l=r,a[c]=l*255;return a};R.hsl.hsv=function(i){var e=i[0],t=i[1]/100,n=i[2]/100,r=t,s=Math.max(n,.01),o,a;return n*=2,t*=n<=1?n:2-n,r*=s<=1?s:2-s,a=(n+t)/2,o=n===0?2*r/(s+r):2*t/(n+t),[e,o*100,a*100]};R.hsv.rgb=function(i){var e=i[0]/60,t=i[1]/100,n=i[2]/100,r=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-t),a=255*n*(1-t*s),l=255*n*(1-t*(1-s));switch(n*=255,r){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}};R.hsv.hsl=function(i){var e=i[0],t=i[1]/100,n=i[2]/100,r=Math.max(n,.01),s,o,a;return a=(2-t)*n,s=(2-t)*r,o=t*r,o/=s<=1?s:2-s,o=o||0,a/=2,[e,o*100,a*100]};R.hwb.rgb=function(i){var e=i[0]/360,t=i[1]/100,n=i[2]/100,r=t+n,s,o,a,l;r>1&&(t/=r,n/=r),s=Math.floor(6*e),o=1-n,a=6*e-s,s&1&&(a=1-a),l=t+a*(o-t);var c,h,d;switch(s){default:case 6:case 0:c=o,h=l,d=t;break;case 1:c=l,h=o,d=t;break;case 2:c=t,h=o,d=l;break;case 3:c=t,h=l,d=o;break;case 4:c=l,h=t,d=o;break;case 5:c=o,h=t,d=l;break}return[c*255,h*255,d*255]};R.cmyk.rgb=function(i){var e=i[0]/100,t=i[1]/100,n=i[2]/100,r=i[3]/100,s,o,a;return s=1-Math.min(1,e*(1-r)+r),o=1-Math.min(1,t*(1-r)+r),a=1-Math.min(1,n*(1-r)+r),[s*255,o*255,a*255]};R.xyz.rgb=function(i){var e=i[0]/100,t=i[1]/100,n=i[2]/100,r,s,o;return r=e*3.2406+t*-1.5372+n*-.4986,s=e*-.9689+t*1.8758+n*.0415,o=e*.0557+t*-.204+n*1.057,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[r*255,s*255,o*255]};R.xyz.lab=function(i){var e=i[0],t=i[1],n=i[2],r,s,o;return e/=95.047,t/=100,n/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=116*t-16,s=500*(e-t),o=200*(t-n),[r,s,o]};R.lab.xyz=function(i){var e=i[0],t=i[1],n=i[2],r,s,o;s=(e+16)/116,r=t/500+s,o=s-n/200;var a=Math.pow(s,3),l=Math.pow(r,3),c=Math.pow(o,3);return s=a>.008856?a:(s-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,r*=95.047,s*=100,o*=108.883,[r,s,o]};R.lab.lch=function(i){var e=i[0],t=i[1],n=i[2],r,s,o;return r=Math.atan2(n,t),s=r*360/2/Math.PI,s<0&&(s+=360),o=Math.sqrt(t*t+n*n),[e,o,s]};R.lch.lab=function(i){var e=i[0],t=i[1],n=i[2],r,s,o;return o=n/360*2*Math.PI,r=t*Math.cos(o),s=t*Math.sin(o),[e,r,s]};R.rgb.ansi16=function(i){var e=i[0],t=i[1],n=i[2],r=1 in arguments?arguments[1]:R.rgb.hsv(i)[2];if(r=Math.round(r/50),r===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return r===2&&(s+=60),s};R.hsv.ansi16=function(i){return R.rgb.ansi16(R.hsv.rgb(i),i[2])};R.rgb.ansi256=function(i){var e=i[0],t=i[1],n=i[2];if(e===t&&t===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var r=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return r};R.ansi16.rgb=function(i){var e=i%10;if(e===0||e===7)return i>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(i>50)+1)*.5,n=(e&1)*t*255,r=(e>>1&1)*t*255,s=(e>>2&1)*t*255;return[n,r,s]};R.ansi256.rgb=function(i){if(i>=232){var e=(i-232)*10+8;return[e,e,e]}i-=16;var t,n=Math.floor(i/36)/5*255,r=Math.floor((t=i%36)/6)/5*255,s=t%6/5*255;return[n,r,s]};R.rgb.hex=function(i){var e=((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};R.hex.rgb=function(i){var e=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(a){return a+a}).join(""));var n=parseInt(t,16),r=n>>16&255,s=n>>8&255,o=n&255;return[r,s,o]};R.rgb.hcg=function(i){var e=i[0]/255,t=i[1]/255,n=i[2]/255,r=Math.max(Math.max(e,t),n),s=Math.min(Math.min(e,t),n),o=r-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:r===e?l=(t-n)/o%6:r===t?l=2+(n-e)/o:l=4+(e-t)/o+4,l/=6,l%=1,[l*360,o*100,a*100]};R.hsl.hcg=function(i){var e=i[1]/100,t=i[2]/100,n=1,r=0;return t<.5?n=2*e*t:n=2*e*(1-t),n<1&&(r=(t-.5*n)/(1-n)),[i[0],n*100,r*100]};R.hsv.hcg=function(i){var e=i[1]/100,t=i[2]/100,n=e*t,r=0;return n<1&&(r=(t-n)/(1-n)),[i[0],n*100,r*100]};R.hcg.rgb=function(i){var e=i[0]/360,t=i[1]/100,n=i[2]/100;if(t===0)return[n*255,n*255,n*255];var r=[0,0,0],s=e%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return l=(1-t)*n,[(t*r[0]+l)*255,(t*r[1]+l)*255,(t*r[2]+l)*255]};R.hcg.hsv=function(i){var e=i[1]/100,t=i[2]/100,n=e+t*(1-e),r=0;return n>0&&(r=e/n),[i[0],r*100,n*100]};R.hcg.hsl=function(i){var e=i[1]/100,t=i[2]/100,n=t*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[i[0],r*100,n*100]};R.hcg.hwb=function(i){var e=i[1]/100,t=i[2]/100,n=e+t*(1-e);return[i[0],(n-e)*100,(1-n)*100]};R.hwb.hcg=function(i){var e=i[1]/100,t=i[2]/100,n=1-t,r=n-e,s=0;return r<1&&(s=(n-r)/(1-r)),[i[0],r*100,s*100]};R.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]};R.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]};R.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]};R.gray.hsl=R.gray.hsv=function(i){return[0,0,i[0]]};R.gray.hwb=function(i){return[0,100,i[0]]};R.gray.cmyk=function(i){return[0,0,0,i[0]]};R.gray.lab=function(i){return[i[0],0,0]};R.gray.hex=function(i){var e=Math.round(i[0]/100*255)&255,t=(e<<16)+(e<<8)+e,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};R.rgb.gray=function(i){var e=(i[0]+i[1]+i[2])/3;return[e/255*100]}});var rb=j((EE,ib)=>{var na=ah();function Zv(){for(var i={},e=Object.keys(na),t=e.length,n=0;n<t;n++)i[e[n]]={distance:-1,parent:null};return i}function ew(i){var e=Zv(),t=[i];for(e[i].distance=0;t.length;)for(var n=t.pop(),r=Object.keys(na[n]),s=r.length,o=0;o<s;o++){var a=r[o],l=e[a];l.distance===-1&&(l.distance=e[n].distance+1,l.parent=n,t.unshift(a))}return e}function tw(i,e){return function(t){return e(i(t))}}function nw(i,e){for(var t=[e[i].parent,i],n=na[e[i].parent][i],r=e[i].parent;e[r].parent;)t.unshift(e[r].parent),n=tw(na[e[r].parent][r],n),r=e[r].parent;return n.conversion=t,n}ib.exports=function(i){for(var e=ew(i),t={},n=Object.keys(e),r=n.length,s=0;s<r;s++){var o=n[s],a=e[o];a.parent!==null&&(t[o]=nw(o,e))}return t}});var ob=j((AE,sb)=>{var lh=ah(),iw=rb(),Mi={},rw=Object.keys(lh);function sw(i){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),i(t))};return"conversion"in i&&(e.conversion=i.conversion),e}function ow(i){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=i(t);if(typeof n=="object")for(var r=n.length,s=0;s<r;s++)n[s]=Math.round(n[s]);return n};return"conversion"in i&&(e.conversion=i.conversion),e}rw.forEach(function(i){Mi[i]={},Object.defineProperty(Mi[i],"channels",{value:lh[i].channels}),Object.defineProperty(Mi[i],"labels",{value:lh[i].labels});var e=iw(i),t=Object.keys(e);t.forEach(function(n){var r=e[n];Mi[i][n]=ow(r),Mi[i][n].raw=sw(r)})});sb.exports=Mi});var cb=j((TE,lb)=>{"use strict";var zr=Xb(),nt=ob(),dh=[].slice,ab=["keyword","gray","hex"],ch={};Object.keys(nt).forEach(function(i){ch[dh.call(nt[i].labels).sort().join("")]=i});var ia={};function Ee(i,e){if(!(this instanceof Ee))return new Ee(i,e);if(e&&e in ab&&(e=null),e&&!(e in nt))throw new Error("Unknown model: "+e);var t,n;if(i==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(i instanceof Ee)this.model=i.model,this.color=i.color.slice(),this.valpha=i.valpha;else if(typeof i=="string"){var r=zr.get(i);if(r===null)throw new Error("Unable to parse color from string: "+i);this.model=r.model,n=nt[this.model].channels,this.color=r.value.slice(0,n),this.valpha=typeof r.value[n]=="number"?r.value[n]:1}else if(i.length){this.model=e||"rgb",n=nt[this.model].channels;var s=dh.call(i,0,n);this.color=hh(s,n),this.valpha=typeof i[n]=="number"?i[n]:1}else if(typeof i=="number")i&=16777215,this.model="rgb",this.color=[i>>16&255,i>>8&255,i&255],this.valpha=1;else{this.valpha=1;var o=Object.keys(i);"alpha"in i&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof i.alpha=="number"?i.alpha:0);var a=o.sort().join("");if(!(a in ch))throw new Error("Unable to parse color from object: "+JSON.stringify(i));this.model=ch[a];var l=nt[this.model].labels,c=[];for(t=0;t<l.length;t++)c.push(i[l[t]]);this.color=hh(c)}if(ia[this.model])for(n=nt[this.model].channels,t=0;t<n;t++){var h=ia[this.model][t];h&&(this.color[t]=h(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Ee.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(i){var e=this.model in zr.to?this:this.rgb();e=e.round(typeof i=="number"?i:1);var t=e.valpha===1?e.color:e.color.concat(this.valpha);return zr.to[e.model](t)},percentString:function(i){var e=this.rgb().round(typeof i=="number"?i:1),t=e.valpha===1?e.color:e.color.concat(this.valpha);return zr.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var i={},e=nt[this.model].channels,t=nt[this.model].labels,n=0;n<e;n++)i[t[n]]=this.color[n];return this.valpha!==1&&(i.alpha=this.valpha),i},unitArray:function(){var i=this.rgb().color;return i[0]/=255,i[1]/=255,i[2]/=255,this.valpha!==1&&i.push(this.valpha),i},unitObject:function(){var i=this.rgb().object();return i.r/=255,i.g/=255,i.b/=255,this.valpha!==1&&(i.alpha=this.valpha),i},round:function(i){return i=Math.max(i||0,0),new Ee(this.color.map(lw(i)).concat(this.valpha),this.model)},alpha:function(i){return arguments.length?new Ee(this.color.concat(Math.max(0,Math.min(1,i))),this.model):this.valpha},red:de("rgb",0,xe(255)),green:de("rgb",1,xe(255)),blue:de("rgb",2,xe(255)),hue:de(["hsl","hsv","hsl","hwb","hcg"],0,function(i){return(i%360+360)%360}),saturationl:de("hsl",1,xe(100)),lightness:de("hsl",2,xe(100)),saturationv:de("hsv",1,xe(100)),value:de("hsv",2,xe(100)),chroma:de("hcg",1,xe(100)),gray:de("hcg",2,xe(100)),white:de("hwb",1,xe(100)),wblack:de("hwb",2,xe(100)),cyan:de("cmyk",0,xe(100)),magenta:de("cmyk",1,xe(100)),yellow:de("cmyk",2,xe(100)),black:de("cmyk",3,xe(100)),x:de("xyz",0,xe(100)),y:de("xyz",1,xe(100)),z:de("xyz",2,xe(100)),l:de("lab",0,xe(100)),a:de("lab",1),b:de("lab",2),keyword:function(i){return arguments.length?new Ee(i):nt[this.model].keyword(this.color)},hex:function(i){return arguments.length?new Ee(i):zr.to.hex(this.rgb().round().color)},rgbNumber:function(){var i=this.rgb().color;return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255},luminosity:function(){for(var i=this.rgb().color,e=[],t=0;t<i.length;t++){var n=i[t]/255;e[t]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(i){var e=this.luminosity(),t=i.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(i){var e=this.contrast(i);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var i=this.rgb().color,e=(i[0]*299+i[1]*587+i[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var i=this.rgb(),e=0;e<3;e++)i.color[e]=255-i.color[e];return i},lighten:function(i){var e=this.hsl();return e.color[2]+=e.color[2]*i,e},darken:function(i){var e=this.hsl();return e.color[2]-=e.color[2]*i,e},saturate:function(i){var e=this.hsl();return e.color[1]+=e.color[1]*i,e},desaturate:function(i){var e=this.hsl();return e.color[1]-=e.color[1]*i,e},whiten:function(i){var e=this.hwb();return e.color[1]+=e.color[1]*i,e},blacken:function(i){var e=this.hwb();return e.color[2]+=e.color[2]*i,e},grayscale:function(){var i=this.rgb().color,e=i[0]*.3+i[1]*.59+i[2]*.11;return Ee.rgb(e,e,e)},fade:function(i){return this.alpha(this.valpha-this.valpha*i)},opaquer:function(i){return this.alpha(this.valpha+this.valpha*i)},rotate:function(i){var e=this.hsl(),t=e.color[0];return t=(t+i)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(i,e){if(!i||!i.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof i);var t=i.rgb(),n=this.rgb(),r=e===void 0?.5:e,s=2*r-1,o=t.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,l=1-a;return Ee.rgb(a*t.red()+l*n.red(),a*t.green()+l*n.green(),a*t.blue()+l*n.blue(),t.alpha()*r+n.alpha()*(1-r))}};Object.keys(nt).forEach(function(i){if(ab.indexOf(i)===-1){var e=nt[i].channels;Ee.prototype[i]=function(){if(this.model===i)return new Ee(this);if(arguments.length)return new Ee(arguments,i);var t=typeof arguments[e]=="number"?e:this.valpha;return new Ee(cw(nt[this.model][i].raw(this.color)).concat(t),i)},Ee[i]=function(t){return typeof t=="number"&&(t=hh(dh.call(arguments),e)),new Ee(t,i)}}});function aw(i,e){return Number(i.toFixed(e))}function lw(i){return function(e){return aw(e,i)}}function de(i,e,t){return i=Array.isArray(i)?i:[i],i.forEach(function(n){(ia[n]||(ia[n]=[]))[e]=t}),i=i[0],function(n){var r;
vendor: 7,571 bytes, lines 85-87
85return arguments.length?(t&&(n=t(n)),r=this[i](),r.color[e]=n,r):(r=this[i]().color[e],t&&(r=t(r)),r)}}function xe(i){return function(e){return Math.max(0,Math.min(i,e))}}function cw(i){return Array.isArray(i)?i:[i]}function hh(i,e){for(var t=0;t<e;t++)typeof i[t]!="number"&&(i[t]=0);return i}lb.exports=Ee});var Ab=j((IE,Eb)=>{var hw="Expected a function",hb="__lodash_placeholder__",qn=1,sa=2,dw=4,Hn=8,jr=16,Ei=32,Pr=64,bb=128,uw=256,yb=512,db=1/0,fw=9007199254740991,mw=17976931348623157e292,ub=0/0,pw=[["ary",bb],["bind",qn],["bindKey",sa],["curry",Hn],["curryRight",jr],["flip",yb],["partial",Ei],["partialRight",Pr],["rearg",uw]],gw="[object Function]",bw="[object GeneratorFunction]",yw="[object Symbol]",_w=/[\\^$.*+?()[\]{}|]/g,xw=/^\s+|\s+$/g,vw=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ww=/\{\n\/\* \[wrapped with (.+)\] \*/,kw=/,? & /,Sw=/^[-+]0x[0-9a-f]+$/i,Cw=/^0b[01]+$/i,Mw=/^\[object .+?Constructor\]$/,Ew=/^0o[0-7]+$/i,Aw=/^(?:0|[1-9]\d*)$/,Tw=parseInt,Iw=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,Dw=typeof self=="object"&&self&&self.Object===Object&&self,Fr=Iw||Dw||Function("return this")();function _b(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)}function Nw(i,e){for(var t=-1,n=i?i.length:0;++t<n&&e(i[t],t,i)!==!1;);return i}function Lw(i,e){var t=i?i.length:0;return!!t&&Rw(i,e,0)>-1}function Ow(i,e,t,n){for(var r=i.length,s=t+(n?1:-1);n?s--:++s<r;)if(e(i[s],s,i))return s;return-1}function Rw(i,e,t){if(e!==e)return Ow(i,Bw,t);for(var n=t-1,r=i.length;++n<r;)if(i[n]===e)return n;return-1}function Bw(i){return i!==i}function zw(i,e){for(var t=i.length,n=0;t--;)i[t]===e&&n++;return n}function jw(i,e){return i?.[e]}function Pw(i){var e=!1;if(i!=null&&typeof i.toString!="function")try{e=!!(i+"")}catch{}return e}function xb(i,e){for(var t=-1,n=i.length,r=0,s=[];++t<n;){var o=i[t];(o===e||o===hb)&&(i[t]=hb,s[r++]=t)}return s}var Uw=Function.prototype,vb=Object.prototype,uh=Fr["__core-js_shared__"],fb=function(){var i=/[^.]+$/.exec(uh&&uh.keys&&uh.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),wb=Uw.toString,Fw=vb.hasOwnProperty,kb=vb.toString,$w=RegExp("^"+wb.call(Fw).replace(_w,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hw=Object.create,ra=Math.max,qw=Math.min,mb=function(){var i=pb(Object,"defineProperty"),e=pb.name;return e&&e.length>2?i:void 0}();function Vw(i){return Ai(i)?Hw(i):{}}function Ww(i){if(!Ai(i)||i1(i))return!1;var e=a1(i)||Pw(i)?$w:Mw;return e.test(s1(i))}function Gw(i,e,t,n){for(var r=-1,s=i.length,o=t.length,a=-1,l=e.length,c=ra(s-o,0),h=Array(l+c),d=!n;++a<l;)h[a]=e[a];for(;++r<o;)(d||r<s)&&(h[t[r]]=i[r]);for(;c--;)h[a++]=i[r++];return h}function Jw(i,e,t,n){for(var r=-1,s=i.length,o=-1,a=t.length,l=-1,c=e.length,h=ra(s-a,0),d=Array(h+c),u=!n;++r<h;)d[r]=i[r];for(var f=r;++l<c;)d[f+l]=e[l];for(;++o<a;)(u||r<s)&&(d[f+t[o]]=i[r++]);return d}function Kw(i,e){var t=-1,n=i.length;for(e||(e=Array(n));++t<n;)e[t]=i[t];return e}function Yw(i,e,t){var n=e&qn,r=Ur(i);function s(){var o=this&&this!==Fr&&this instanceof s?r:i;return o.apply(n?t:this,arguments)}return s}function Ur(i){return function(){var e=arguments;switch(e.length){case 0:return new i;case 1:return new i(e[0]);case 2:return new i(e[0],e[1]);case 3:return new i(e[0],e[1],e[2]);case 4:return new i(e[0],e[1],e[2],e[3]);case 5:return new i(e[0],e[1],e[2],e[3],e[4]);case 6:return new i(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new i(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Vw(i.prototype),n=i.apply(t,e);return Ai(n)?n:t}}function Xw(i,e,t){var n=Ur(i);function r(){for(var s=arguments.length,o=Array(s),a=s,l=Cb(r);a--;)o[a]=arguments[a];var c=s<3&&o[0]!==l&&o[s-1]!==l?[]:xb(o,l);if(s-=c.length,s<t)return Sb(i,e,fh,r.placeholder,void 0,o,c,void 0,void 0,t-s);var h=this&&this!==Fr&&this instanceof r?n:i;return _b(h,this,o)}return r}function fh(i,e,t,n,r,s,o,a,l,c){var h=e&bb,d=e&qn,u=e&sa,f=e&(Hn|jr),p=e&yb,m=u?void 0:Ur(i);function g(){for(var b=arguments.length,y=Array(b),_=b;_--;)y[_]=arguments[_];if(f)var v=Cb(g),w=zw(y,v);if(n&&(y=Gw(y,n,r,f)),s&&(y=Jw(y,s,o,f)),b-=w,f&&b<c){var M=xb(y,v);return Sb(i,e,fh,g.placeholder,t,y,M,a,l,c-b)}var C=d?t:this,S=u?C[i]:i;return b=y.length,a?y=r1(y,a):p&&b>1&&y.reverse(),h&&l<b&&(y.length=l),this&&this!==Fr&&this instanceof g&&(S=m||Ur(S)),S.apply(C,y)}return g}function Qw(i,e,t,n){var r=e&qn,s=Ur(i);function o(){for(var a=-1,l=arguments.length,c=-1,h=n.length,d=Array(h+l),u=this&&this!==Fr&&this instanceof o?s:i;++c<h;)d[c]=n[c];for(;l--;)d[c++]=arguments[++a];return _b(u,r?t:this,d)}return o}function Sb(i,e,t,n,r,s,o,a,l,c){var h=e&Hn,d=h?o:void 0,u=h?void 0:o,f=h?s:void 0,p=h?void 0:s;e|=h?Ei:Pr,e&=~(h?Pr:Ei),e&dw||(e&=~(qn|sa));var m=t(i,e,r,f,d,p,u,a,l,c);return m.placeholder=n,Mb(m,i,e)}function Zw(i,e,t,n,r,s,o,a){var l=e&sa;if(!l&&typeof i!="function")throw new TypeError(hw);var c=n?n.length:0;if(c||(e&=~(Ei|Pr),n=r=void 0),o=o===void 0?o:ra(gb(o),0),a=a===void 0?a:gb(a),c-=r?r.length:0,e&Pr){var h=n,d=r;n=r=void 0}var u=[i,e,t,n,r,h,d,s,o,a];if(i=u[0],e=u[1],t=u[2],n=u[3],r=u[4],a=u[9]=u[9]==null?l?0:i.length:ra(u[9]-c,0),!a&&e&(Hn|jr)&&(e&=~(Hn|jr)),!e||e==qn)var f=Yw(i,e,t);else e==Hn||e==jr?f=Xw(i,e,a):(e==Ei||e==(qn|Ei))&&!r.length?f=Qw(i,e,t,n):f=fh.apply(void 0,u);return Mb(f,i,e)}function Cb(i){var e=i;return e.placeholder}function pb(i,e){var t=jw(i,e);return Ww(t)?t:void 0}function e1(i){var e=i.match(ww);return e?e[1].split(kw):[]}function t1(i,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),i.replace(vw,`{ 86/* [wrapped with `+e+`] */ 87`)}function n1(i,e){return e=e??fw,!!e&&(typeof i=="number"||Aw.test(i))&&i>-1&&i%1==0&&i<e}function i1(i){return!!fb&&fb in i}function r1(i,e){for(var t=i.length,n=qw(e.length,t),r=Kw(i);n--;){var s=e[n];i[n]=n1(s,t)?r[s]:void 0}return i}var Mb=mb?function(i,e,t){var n=e+"";return mb(i,"toString",{configurable:!0,enumerable:!1,value:u1(t1(n,o1(e1(n),t)))})}:f1;function s1(i){if(i!=null){try{return wb.call(i)}catch{}try{return i+""}catch{}}return""}function o1(i,e){return Nw(pw,function(t){var n="_."+t[0];e&t[1]&&!Lw(i,n)&&i.push(n)}),i.sort()}function mh(i,e,t){e=t?void 0:e;var n=Zw(i,Hn,void 0,void 0,void 0,void 0,void 0,e);return n.placeholder=mh.placeholder,n}function a1(i){var e=Ai(i)?kb.call(i):"";return e==gw||e==bw}function Ai(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function l1(i){return!!i&&typeof i=="object"}function c1(i){return typeof i=="symbol"||l1(i)&&kb.call(i)==yw}function h1(i){if(!i)return i===0?i:0;if(i=d1(i),i===db||i===-db){var e=i<0?-1:1;return e*mw}return i===i?i:0}function gb(i){var e=h1(i),t=e%1;return e===e?t?e-t:e:0}function d1(i){if(typeof i=="number")return i;if(c1(i))return ub;if(Ai(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Ai(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(xw,"");var t=Cw.test(i);return t||Ew.test(i)?Tw(i.slice(2),t?2:8):Sw.test(i)?ub:+i}function u1(i){return function(){return i}}function f1(i){return i}mh.placeholder={};Eb.exports=mh});function Tb(i){var e=i[0],t=i[1],n=i[2],r,s,o;return r=e*1+t*0+n*1.13983,s=e*1+t*-.39465+n*-.5806,o=e*1+t*2.02311+n*0,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[r*255,s*255,o*255]}function Ib(i){var e=i[0]/255,t=i[1]/255,n=i[2]/255,r=e*.299+t*.587+n*.114,s=e*-.14713+t*-.28886+n*.436,o=e*.615+t*-.51499+n*-.10001;return[r,s,o]}var Db=E(()=>{});var Nb=E(()=>{});
87function Lb(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function qe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lb(Object(t),!0).forEach(function(n){Mh(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Lb(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}var yh,ph,gh,Rb,Ob,m1,p1,Ti,g1,b1,y1,bh,Bb,zb,_1,jb,_h=E(()=>{Kb();Yb();Tp();yh=ne(Yg()),ph=ne(cb()),gh=ne(Ab());Db();Nb();Rb=yh.default,Ob=Object.keys(Rb),m1=function(e){return e<.25?1:e<.5?.9-e:1.1-e},p1=function(e){var t=(0,ph.default)(e),n=Ib(t.array()),r=oh(n,3),s=r[0],o=r[1],a=r[2],l=[m1(s),o,a],c=Tb(l);return ph.default.rgb(c).hex()},Ti=function(e){return function(t){return{className:[t.className,e.className].filter(Boolean).join(" "),style:qe(qe({},t.style||{}),e.style||{})}}},g1=function(e,t){if(e===void 0)return t;if(t===void 0)return e;var n=$r(e),r=$r(t);switch(n){case"string":switch(r){case"string":return[t,e].filter(Boolean).join(" ");case"object":return Ti({className:e,style:t});case"function":return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];return Ti({className:e})(t.apply(void 0,[s].concat(a)))}}break;case"object":switch(r){case"string":return Ti({className:t,style:e});case"object":return qe(qe({},t),e);case"function":return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];return Ti({style:e})(t.apply(void 0,[s].concat(a)))}}break;case"function":switch(r){case"string":return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];return e.apply(void 0,[Ti(s)({className:t})].concat(a))};case"object":return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];return e.apply(void 0,[Ti(s)({style:t})].concat(a))};case"function":return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];return e.apply(void 0,[t.apply(void 0,[s].concat(a))].concat(a))}}}},b1=function(e,t){var n=Object.keys(t);for(var r in e)n.indexOf(r)===-1&&n.push(r);return n.reduce(function(s,o){return s[o]=g1(e[o],t[o]),s},{})},y1=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];if(t===null)return e;Array.isArray(t)||(t=[t]);var o=t.map(function(l){return e[l]}).filter(Boolean),a=o.reduce(function(l,c){return typeof c=="string"?l.className=[l.className,c].filter(Boolean).join(" "):$r(c)==="object"?l.style=qe(qe({},l.style),c):typeof c=="function"&&(l=qe(qe({},l),c.apply(void 0,[l].concat(r)))),l},{className:"",style:{}});return a.className||delete a.className,Object.keys(a.style).length===0&&delete a.style,a},bh=function(e){return Object.keys(e).reduce(function(t,n){return t[n]=/^base/.test(n)?p1(e[n]):n==="scheme"?e[n]+":inverted":e[n],t},{})},Bb=(0,gh.default)(function(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.defaultBase16,r=n===void 0?Rb:n,s=e.base16Themes,o=s===void 0?null:s,a=_1(t,o);a&&(t=qe(qe({},a),t));for(var l=Ob.reduce(function(m,g){return m[g]=t[g]||r[g],m},{}),c=Object.keys(t).reduce(function(m,g){return Ob.indexOf(g)===-1&&(m[g]=t[g]),m},{}),h=i(l),d=b1(c,h),u=arguments.length,f=new Array(u>3?u-3:0),p=3;p<u;p++)f[p-3]=arguments[p];return(0,gh.default)(y1,2).apply(void 0,[d].concat(f))},3),zb=function(e){return!!e.extend},_1=function(e,t){if(e&&zb(e)&&e.extend&&(e=e.extend),typeof e=="string"){var n=e.split(":"),r=oh(n,2),s=r[0],o=r[1];t?e=t[s]:e=yh[s],o==="inverted"&&(e=bh(e))}return e&&Object.prototype.hasOwnProperty.call(e,"base00")?e:void 0},jb=function(e){return typeof e=="string"?"".concat(e,":inverted"):e&&zb(e)&&e.extend?typeof e.extend=="string"?qe(qe({},e),{},{extend:"".concat(e.extend,":inverted")}):qe(qe({},e),{},{extend:bh(e.extend)}):e&&bh(e)}});var Pb,Ub=E(()=>{Pb={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"}});var x1,v1,w1,k1,Fb,$b=E(()=>{_h();
87Ub();x1=i=>({BACKGROUND_COLOR:i.base00,TEXT_COLOR:i.base07,STRING_COLOR:i.base0B,DATE_COLOR:i.base0B,NUMBER_COLOR:i.base09,BOOLEAN_COLOR:i.base09,NULL_COLOR:i.base08,UNDEFINED_COLOR:i.base08,FUNCTION_COLOR:i.base08,SYMBOL_COLOR:i.base08,LABEL_COLOR:i.base0D,ARROW_COLOR:i.base0D,ITEM_STRING_COLOR:i.base0B,ITEM_STRING_EXPANDED_COLOR:i.base03}),v1=i=>({String:i.STRING_COLOR,Date:i.DATE_COLOR,Number:i.NUMBER_COLOR,Boolean:i.BOOLEAN_COLOR,Null:i.NULL_COLOR,Undefined:i.UNDEFINED_COLOR,Function:i.FUNCTION_COLOR,Symbol:i.SYMBOL_COLOR}),w1=i=>{let e=x1(i);return{tree:{border:0,padding:0,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"0.125em",marginRight:0,listStyle:"none",MozUserSelect:"none",WebkitUserSelect:"none",backgroundColor:e.BACKGROUND_COLOR},value:(t,n,r)=>{let{style:s}=t;return{style:{...s,paddingTop:"0.25em",paddingRight:0,marginLeft:"0.875em",WebkitUserSelect:"text",MozUserSelect:"text",wordWrap:"break-word",paddingLeft:r.length>1?"2.125em":"1.25em",textIndent:"-0.5em",wordBreak:"break-all"}}},label:{display:"inline-block",color:e.LABEL_COLOR},valueLabel:{margin:"0 0.5em 0 0"},valueText:(t,n)=>{let{style:r}=t;return{style:{...r,color:v1(e)[n]}}},itemRange:(t,n)=>
87({style:{paddingTop:n?0:"0.25em",cursor:"pointer",color:e.LABEL_COLOR}}),arrow:(t,n,r)=>{let{style:s}=t;return{style:{...s,marginLeft:0,transition:"150ms",WebkitTransition:"150ms",MozTransition:"150ms",WebkitTransform:r?"rotateZ(90deg)":"rotateZ(0deg)",MozTransform:r?"rotateZ(90deg)":"rotateZ(0deg)",transform:r?"rotateZ(90deg)":"rotateZ(0deg)",transformOrigin:"45% 50%",WebkitTransformOrigin:"45% 50%",MozTransformOrigin:"45% 50%",position:"relative",lineHeight:"1.1em",fontSize:"0.75em"}}},arrowContainer:(t,n)=>{let{style:r}=t;return{style:{...r,display:"inline-block",paddingRight:"0.5em",paddingLeft:n==="double"?"1em":0,cursor:"pointer"}}},arrowSign:{color:e.ARROW_COLOR},arrowSignInner:{position:"absolute",top:0,left:"-0.4em"},nestedNode:(t,n,r,s,o)=>{let{style:a}=t;return{style:{...a,position:"relative",paddingTop:"0.25em",marginLeft:n.length>1?"0.875em":0,paddingLeft:o?0:"1.125em"}}},rootNode:{padding:0,margin:0},nestedNodeLabel:(t,n,r,s,o)=>{let{style:a}=t;return{style:{...a,margin:0,padding:0,WebkitUserSelect:o?"inherit":"text",MozUserSelect:o?"inherit":"text",cursor:o?"pointer":"default"}}},nestedNodeItemString:(t,n,r,s)=>{let{style:o}=t;return{style:{...o,paddingLeft:"0.5em",cursor:"default",color:s?e.ITEM_STRING_EXPANDED_COLOR:e.ITEM_STRING_COLOR}}},nestedNodeItemType:{marginLeft:"0.3em",marginRight:"0.3em"},nestedNodeChildren:(t,n,r)=>{let{style:s}=t;return{style:{...s,padding:0,margin:0,listStyle:"none",display:r?"block":"none"}}},rootNodeChildren:{padding:0,margin:0,listStyle:"none"}}},k1=Bb(w1,{defaultBase16:Pb}),Fb=k1});function qb(i){let{data:e,theme:t,invertTheme:n,keyPath:r=["root"],labelRenderer:s=M1,valueRenderer:o=Hb,shouldExpandNodeInitially:a=S1,hideRoot:l=!1,getItemString:c=C1,postprocessValue:h=Hb,isCustomNode:d=E1,collectionLimit:u=50,sortObjectKeys:f=!1}=i,p=(0,Vn.useMemo)(()=>Fb(n?jb(t):t),[t,n]);return Vn.default.createElement("ul",p("tree"),Vn.default.createElement(Br,{keyPath:l?[]:r,value:h(e),isCustomNode:d,styling:p,labelRenderer:s,valueRenderer:o,shouldExpandNodeInitially:a,hideRoot:l,getItemString:c,postprocessValue:h,collectionLimit:u,sortObjectKeys:f}))}var Vn,Hb,S1,C1,M1,E1,Vb=E(()=>{Vn=ne(it());nh();$b();_h();Hb=i=>i,S1=(i,e,t)=>t===0,C1=(i,e,t,n)=>Vn.default.createElement("span",null,t," ",n),M1=i=>{let[e]=i;return Vn.default.createElement("span",null,e,":")},E1=()=>!1});function Wn(i){var e;return(e=Si.style([i]))!==null&&e!==void 0?e:""}function Gb(i,e){return JSON.stringify(i).includes(e)}function wh(i,e,t=["root"]){return xh.JSONExt.isArray(i)?i.reduce((n,r,s)=>r&&typeof r=="object"&&Gb(r,e)?[...n,[s,...t].join(","),...wh(r,e,[s,...t])]:n,[]):xh.JSONExt.isObject(i)?Object.keys(i).reduce((n,r)=>{let s=i[r];return s&&typeof s=="object"&&(r.includes(e)||Gb(s,e))?[...n,[r,...t].join(","),...wh(s,e,[r,...t])]:n},[]):[]}var xh,dt,vh,Wb,A1,T1=E(()=>{cp();wn();jh();Kr();xh=ne(ut()),dt=ne(it()),vh=ne(dp());Vb();a0();Wb=class extends dt.Component{constructor(){super(...arguments),this.state={filter:"",value:""},this.timer=0,this.handleChange=e=>{let{value:t}=e.target;this.setState({value:t}),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.setState({filter:t})},300)}}componentDidMount(){Jh.mount(document,Si.module)}render(){let t=(this.props.translator||Pe).load("jupyterlab"),{data:n,metadata:r,forwardedRef:s}=this.props,o=r&&r.root?r.root:"root",a=this.state.filter?wh(n,this.state.filter,[o]):[o];return dt.createElement("div",{className:"container",ref:s},dt.createElement(Oh,{className:"filter",type:"text",placeholder:t.__("Find\u2026"),onChange:this.handleChange,value:this.state.value,rightIcon:"ui-components:search"}),dt.createElement(qb,{data:n,collectionLimit:100,theme:{extend:A1,valueLabel:Wn(z.variableName),valueText:Wn(z.string),nestedNodeItemString:Wn(z.comment)},invertTheme:!1,keyPath:[o],getItemString:(l,c,h,d)=>Array.isArray(c)?dt.createElement("span",null,h," ",d):Object.keys(c).length===0?dt.createElement("span",null,h):null,labelRenderer:([l,c])=>dt.createElement("span",{className:Wn(z.keyword)},dt.createElement(vh.default,{searchWords:[this.state.filter],textToHighlight:`${l}`,highlightClassName:"jp-mod-selected"})),valueRenderer:l=>{let c=Wn(z.string);return typeof l=="number"&&(c=Wn(z.number)),(l==="true"||l==="false")&&(c=Wn(z.keyword)),dt.createElement("span",{className:c},dt.createElement(vh.default,{searchWords:[this.state.filter],textToHighlight:`${l}`,highlightClassName:"jp-mod-selected"}))},shouldExpandNodeInitially:(l,c,h)=>r&&r.expanded?!0:a.join(",").includes(l.join(","))}))}},A1={scheme:"jupyter",base00:"invalid",base01:"invalid",base02:"invalid",base03:"invalid",base04:"invalid",base05:"invalid",base06:"invalid",base07:"invalid",base08:"invalid",base09:"invalid",base0A:"invalid",base0B:"invalid",base0C:"invalid",base0D:"invalid",base0E:"invalid",base0F:"invalid",author:"invalid"}});T1();export{Wb as Component}; 88/*! Bundled license information: 89 90react-highlight-words/dist/main.js: 91 (* 92 object-assign 93 (c) Sindre Sorhus 94 @license MIT 95 *) 96*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.