UNPKG

@arcgis/coding-components

Version:

Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.

8 lines (7 loc) • 1.1 MB
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. v4.33.14 */ import{o as O0}from"./SWSGV34B.js";import{$ as bi,$a as Dc,$b as xt,$c as Tt,$d as vh,$e as Lt,$f as wL,$g as Vn,$h as vk,$i as wi,$j as ip,$k as mp,A as h,Aa as kn,Ab as gE,Ac as mh,Ad as zE,Ae as On,Af as XP,Ag as pv,Ah as JP,Ai as Fa,Aj as za,Ak as $n,Al as yp,B as V,Ba as Q0,Bb as mE,Bc as NE,Bd as tn,Be as $E,Bf as vt,Bg as PL,Bh as _o,Bi as $h,Bj as ie,Bk as cM,Bl as wM,C as B,Ca as ba,Cb as dh,Cc as Xb,Cd as Dt,Ce as Lo,Cf as sL,Cg as Ph,Ch as dk,Ci as Er,Cj as ft,Ck as up,Cl as Hv,D as pr,Da as ch,Db as fE,Dc as TE,Dd as ye,De as YE,Df as go,Dg as Bn,Dh as yr,Di as Dk,Dj as ln,Dk as hp,Dl as yM,E as _i,Ea as J0,Eb as uh,Ec as Pe,Ed as it,Ee as jP,Ef as sn,Eg as RL,Eh as Wc,Ei as eR,Ej as Uk,Ek as Ua,El as DM,F as j0,Fa as re,Fb as $b,Fc as gs,Fd as It,Fe as rv,Ff as aL,Fg as Rh,Fh as Mt,Fi as Yh,Fj as ni,Fk as qc,G as gr,Ga as Ct,Gb as Ze,Gc as yo,Gd as Do,Ge as ZE,Gf as Cs,Gg as Fh,Gh as Mo,Gi as Ik,Gj as ep,Gk as Gc,H as K0,Ha as P,Hb as _E,Hc as O,Hd as eo,He as Sh,Hf as Ih,Hg as FL,Hh as Dr,Hi as Ft,Hj as jk,Hk as dM,I as vc,Ia as Oe,Ib as OP,Ic as ms,Id as Ia,Ie as XE,If as lL,Ig as OL,Ih as uk,Ii as Zh,Ij as Kk,Ik as pp,J as q0,Ja as v,Jb as Yb,Jc as F,Jd as _h,Je as QE,Jf as cL,Jg as WL,Jh as Pa,Ji as Lr,Jj as qk,Jk as Yn,K as fa,Ka as q,Kb as WP,Kc as PE,Kd as ot,Ke as Ac,Kf as dL,Kg as HL,Kh as We,Ki as zc,Kj as Gk,Kk as Ds,L as G0,La as j,Lb as Ec,Lc as di,Ld as I,Le as JE,Lf as uL,Lg as kt,Lh as Un,Li as Ek,Lj as $k,Lk as gp,M as ci,Ma as St,Mb as bE,Mc as Zt,Md as ev,Me as KP,Mf as hL,Mg as Oh,Mh as hk,Mi as Oa,Mj as Yk,Mk as Nv,N as zi,Na as G,Nb as vE,Nc as RE,Nd as Pi,Ne as vs,Nf as Rc,Ng as BL,Nh as io,Ni as Vc,Nj as Zk,Nk as uM,O as Cc,Oa as yt,Ob as HP,Oc as Si,Od as Pt,Oe as sv,Of as pL,Og as Wh,Oh as jn,Oi as Lk,Oj as wv,Ok as _,P as nh,Pa as Mi,Pb as je,Pc as fs,Pd as U,Pe as xh,Pf as gL,Pg as zL,Ph as pk,Pi as Oi,Pj as Gn,Pk as De,Q as $0,Qa as wc,Qb as Zo,Qc as le,Qd as x,Qe as Fi,Qf as lv,Qg as VL,Qh as Kn,Qi as Wa,Qj as yv,Qk as ja,R as Hb,Ra as Xi,Rb as Ai,Rc as FE,Rd as tv,Re as ko,Rf as mL,Rg as UL,Rh as mv,Ri as vv,Rj as Xk,Rk as hM,S as RP,Sa as eE,Sb as fr,Sc as fh,Sd as VE,Se as Nc,Sf as fL,Sg as jL,Sh as gk,Si as Cv,Sj as Kc,Sk as Tv,T as Y0,Ta as yc,Tb as An,Tc as Da,Td as H,Te as he,Tf as _L,Tg as KL,Th as mk,Ti as kk,Tj as Dv,Tk as Pv,Tl as Mr,U as rh,Ua as xo,Ub as Lc,Uc as W,Ud as UE,Ue as nn,Uf as bL,Ug as qL,Uh as fv,Ui as Mk,Uj as Qk,Uk as Rv,V as sh,Va as va,Vb as Xo,Vc as ti,Vd as X,Ve as eL,Vf as Eh,Vg as GL,Vh as fk,Vi as Xh,Vj as tp,Vk as pM,W as Go,Wa as tE,Wb as Ne,Wc as fe,Wd as bh,We as N,Wf as vL,Wg as Ss,Wh as _k,Wi as Ha,Wj as Iv,Wk as cn,X as _a,Xa as iE,Xb as _r,Xc as Ie,Xd as Mc,Xe as be,Xf as cv,Xg as zn,Xh as _v,Xi as Qh,Xj as Ev,Xk as gM,Y as Sc,Ya as oE,Yb as vi,Yc as ii,Yd as zP,Ye as Wn,Yf as CL,Yg as Hh,Yh as bk,Yi as Ak,Yj as Lv,Yk as mM,Z as ne,Za as Ca,Zb as CE,Zc as Je,Zd as jE,Ze as av,Zf as SL,Zg as Bh,Zh as bv,Zi as Nk,Zj as Jk,Zk as fM,_ as ve,_a as nE,_b as Se,_c as Qi,_d as VP,_e as wh,_f as xL,_g as $L,_h as zh,_i as qn,_j as eM,_k as _M,a as ai,aa as mr,ab as rE,ac as SE,ad as Jo,ae as KE,af as Xe,ag as yL,ah as YL,ai as ws,aj as ys,ak as op,al as Ka,b as cs,ba as Zi,bb as Vb,bc as xE,bd as en,be as ce,bf as Sr,bg as DL,bh as QP,bi as Ck,bj as Vt,bk as Va,bl as fp,c as W0,ca as $o,cb as Sa,cc as ps,cd as Nn,ce as gt,cf as Xt,cg as IL,ch as ZL,ci as Hc,cj as Sv,cl as _p,d as Fb,da as Ce,db as Ub,dc as hh,dd as Qb,de as Et,df as Tc,dg as EL,dh as gv,di as Sk,dj as Uc,dk as qe,dl as bp,e as li,ea as ah,eb as pt,ec as wE,ed as OE,ee as Io,ef as La,eg as LL,eh as xs,ei as xk,ej as Tk,ek as np,el as qa,f as H0,fa as Z0,fb as sE,fc as wo,fd as _s,fe as oi,ff as ka,fg as Lh,fh as XL,fi as Vh,fj as Jh,fk as tM,fl as vp,g as bt,ga as lh,gb as FP,gc as Ni,gd as ue,ge as Pn,gf as Qe,gg as dv,gh as xi,gi as Uh,gj as xv,gk as iM,gl as Cp,h as eh,ha as lt,hb as xa,hc as de,hd as ui,he as wt,hf as tL,hg as uv,hh as QL,hi as oo,hj as Pk,hk as oM,hl as Ga,i as th,ia as Bb,ib as jb,ic as Ci,id as Re,ie as iv,if as qP,ig as Fc,ih as Na,ii as jh,ij as Rk,ik as nM,il as bM,j as Ln,ja as pe,jb as aE,jc as yE,jd as _e,je as vr,jf as iL,jg as hv,jh as JL,ji as Ra,jj as tR,jk as rp,jl as $c,k as ds,ka as y,kb as wa,kc as DE,kd as et,ke as ov,kf as GP,kg as kL,kh as ek,ki as At,kj as Fk,kk as kv,kl as Sp,l as B0,la as w,lb as Mn,lc as ph,ld as D,le as Rn,lf as mt,lg as ML,lh as Oc,li as Bc,lj as iR,lk as To,ll as Wi,m as z0,ma as ct,mb as lE,mc as Zb,md as WE,me as Ch,mf as po,mg as kh,mh as Vi,mi as wk,mj as Ok,mk as sp,ml as Fv,n as $e,na as X0,nb as cE,nc as IE,nd as J,ne as ze,nf as Ma,ng as Aa,nh as ut,ni as we,nj as Ba,nk as ap,nl as vM,o as ih,oa as T,ob as hs,oc as Qo,od as $,oe as pi,of as $P,og as Mh,oh as wr,oi as Kh,oj as oR,ok as bo,ol as Yc,p as oh,pa as nt,pb as dE,pc as Te,pd as se,pe as qE,pf as oL,pg as Ah,ph as Ta,pi as no,pj as Wk,pl as CM,q as Ob,qa as uo,qb as Ic,qc as EE,qd as HE,qe as bs,qf as YP,qg as AL,qh as fo,qi as qh,qj as nR,qk as kr,ql as lR,r as us,ra as Ue,rb as dt,rc as LE,rd as BP,re as nv,rf as yh,rg as Nh,rh as tk,ri as Gh,rj as Hk,rk as lp,rl as SM,s as ga,sa as K,sb as ya,sc as tt,sd as zt,se as Eo,sf as Pc,sg as NL,sh as ik,si as ro,sj as rR,sk as cp,sl as Ov,t as ge,ta as zb,tb as Kb,tc as Ti,td as Tn,te as on,tf as nL,tg as Th,th as ok,ti as Ir,tj as Bk,tk as Mv,tl as $a,u as hr,ua as Me,ub as uE,uc as br,ud as Ji,ue as GE,uf as ZP,ug as Qt,uh as nk,ui as ke,uj as sR,uk as dp,ul as xp,v as V0,va as Y,vb as qb,vc as kE,vd as Jb,ve as Fn,vf as rL,vg as Hn,vh as rk,vi as yk,vj as zk,vk as rM,vl as dn,w as Nt,wa as He,wb as Gb,wc as ME,wd as BE,we as Cr,wf as rn,wg as TL,wh as sk,wi as an,wj as aR,wk as Av,wl as xM,x as U0,xa as xc,xb as Yo,xc as gh,xd as R,xe as UP,xf as z,xg as xr,xh as ak,xi as Ui,xj as jc,xk as sM,xl as Is,y as ma,ya as Be,yb as hE,yc as AE,yd as ho,ye as Ri,yf as to,yg as mo,yh as lk,yi as Rt,yj as Vk,yk as aM,yl as Wv,z as Wb,za as Ye,zb as pE,zc as kc,zd as hi,ze as Ea,zf as Dh,zg as xe,zh as ck,zi as Ao,zj as No,zk as lM,zl as wp}from"./GMVUIEZO.js";import{b as Ju,c as Pb,e as Rb}from"./HAP7XW5O.js";var pW,Pw,$r,Hl,Xd,Qd,rr,Rw,Bl=Ju(()=>{$e();Be();Ce();Cc();Fn();Oe();q();po();fe();Pn();Qi();T();be();pW=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Pw=function(r,e){return function(t,i){e(t,i,r)}},$r=class{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let o=i;for(let n=0;t.children.get(o)!==void 0;n++)o=`${i}_${n}`;return o}static empty(e){return e.children.size===0}},Hl=class extends $r{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}},Xd=class extends $r{constructor(e,t,i,o){super(),this.id=e,this.parent=t,this.label=i,this.order=o,this.children=new Map}},Qd=class r extends $r{static create(e,t,i){let o=new He(i),n=new r(t.uri),s=e.ordered(t),a=s.map((c,d)=>{let u=$r.findId(`provider_${d}`,n),p=new Xd(u,n,c.displayName??"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,o.token)).then(g=>{for(let m of g||[])r._makeOutlineElement(m,p);return p},g=>(ve(g),p)).then(g=>{$r.empty(g)?g.remove():n._groups.set(u,g)})}),l=e.onDidChange(()=>{let c=e.ordered(t);ai(c,s)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!i.isCancellationRequested?r.create(e,t,i):n._compact()).finally(()=>{o.dispose(),l.dispose(),o.dispose()})}static _makeOutlineElement(e,t){let i=$r.findId(e,t),o=new Hl(i,t,e);if(e.children)for(let n of e.children)r._makeOutlineElement(n,o);t.children.set(o.id,o)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(let[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{let t=zi.first(this._groups.values());for(let[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){let e=[];for(let t of this.children.values())t instanceof Hl?e.push(t.symbol):e.push(...zi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>v.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){let e=this.getTopLevelSymbols(),t=[];return r._flattenDocumentSymbols(t,e,""),t.sort((i,o)=>P.compare(v.getStartPosition(i.range),v.getStartPosition(o.range))||P.compare(v.getEndPosition(o.range),v.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(let o of t)e.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||i,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&r._flattenDocumentSymbols(e,o.children,o.name)}},rr=ti("IOutlineModelService"),Rw=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new y,this._cache=new on(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(o=>{this._cache.delete(o.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){let i=this._languageFeaturesService.documentSymbolProvider,o=i.ordered(e),n=this._cache.get(e.id);if(!n||n.versionId!==e.getVersionId()||!ai(n.provider,o)){let a=new He;n={versionId:e.getVersionId(),provider:o,promiseCnt:0,source:a,promise:Qd.create(i,e,a.token),model:void 0},this._cache.set(e.id,n);let l=Date.now();n.promise.then(c=>{n.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(n.model)return n.model;n.promiseCnt+=1;let s=t.onCancellationRequested(()=>{--n.promiseCnt===0&&(n.source.cancel(),this._cache.delete(e.id))});try{return await n.promise}finally{s.dispose()}}};Rw=pW([Pw(0,N),Pw(1,mt),Pw(2,Je)],Rw);oi(rr,Rw,1)});var t_,MT=Ju(()=>{St();t_=class{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){let o=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new j(o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn),o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn)):new j(o.endLineNumber,o.endColumn-this._text.length,o.endLineNumber,o.endColumn)}}});var AT=Ju(()=>{});var NT=Pb(wu=>{Se();Ce();Is();X();q();St();De();ft();ys();B();MT();AT();var CH=wu&&wu.__decorate||function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},SH=wu&&wu.__param||function(r,e){return function(t,i){e(t,i,r)}},i_,nc=class{static{i_=this}static{this.ID="editor.contrib.inPlaceReplaceController"}static get(e){return e.getContribution(i_.ID)}static{this.DECORATION=ie.register({description:"in-place-replace",className:"valueSetReplacement"})}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){this.currentRequest?.cancel();let i=this.editor.getSelection(),o=this.editor.getModel();if(!o||!i)return;let n=i;if(n.startLineNumber!==n.endLineNumber)return;let s=new xp(this.editor,5),a=o.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=je(l=>this.editorWorkerService.navigateValueSet(a,n,t)),this.currentRequest.then(l=>{if(!l||!l.range||!l.value||!s.validate(this.editor))return;let c=v.lift(l.range),d=l.range,u=l.value.length-(n.endColumn-n.startColumn);d={startLineNumber:d.startLineNumber,startColumn:d.startColumn,endLineNumber:d.endLineNumber,endColumn:d.startColumn+l.value.length},u>1&&(n=new j(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn+u-1));let p=new t_(c,n,l.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,p),this.editor.pushUndoStop(),this.decorations.set([{range:d,options:i_.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=fr(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(ne)}).catch(ne)):Promise.resolve(void 0)}};nc=i_=CH([SH(1,wi)],nc);var jy=class extends I{constructor(){super({id:"editor.action.inPlaceReplace.up",label:h("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:3159,weight:100}})}run(e,t){let i=nc.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}},Ky=class extends I{constructor(){super({id:"editor.action.inPlaceReplace.down",label:h("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:3161,weight:100}})}run(e,t){let i=nc.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}};H(nc.ID,nc,4);x(jy);x(Ky)});var vP=Pb(Gu=>{$e();Ft();lR();_M();be();Bl();T();Me();var U2=Gu&&Gu.__decorate||function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},bP=Gu&&Gu.__param||function(r,e){return function(t,i){e(t,i,r)}},w0=class extends w{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=At(this,void 0);let o=Ao("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),n=Ao("_textModel.onDidChangeContent",Ue.debounce(s=>this._textModel.onDidChangeContent(s),()=>{},100));this._register(an(async(s,a)=>{o.read(s),n.read(s);let l=a.add(new fM),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){let i=this._currentModel.read(t);if(!i)return[];let o=i.asListOfDocumentSymbols().filter(n=>e.contains(n.range.startLineNumber)&&!e.contains(n.range.endLineNumber));return o.sort(B0(Ln(n=>n.range.endLineNumber-n.range.startLineNumber,ds))),o.map(n=>({name:n.name,kind:n.kind,startLineNumber:n.range.startLineNumber}))}};w0=U2([bP(1,N),bP(2,rr)],w0);CM.setBreadcrumbsSourceFactory((r,e)=>e.createInstance(w0,r))});var CP=Ju(()=>{});var xP=Pb(Yu=>{CP();le();nn();T();X();pt();$P();JP();Io();kv();ws();var j2=Yu&&Yu.__decorate||function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},SP=Yu&&Yu.__param||function(r,e){return function(t,i){e(t,i,r)}},D0,$u=class extends w{static{D0=this}static{this.ID="editor.contrib.inspectTokens"}static get(e){return e.getContribution(D0.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(Sa.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new E0(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};$u=D0=j2([SP(1,rp),SP(2,Et)],$u);var I0=class extends I{constructor(){super({id:"editor.action.inspectTokens",label:_k.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){$u.get(t)?.launch()}};function K2(r){let e="";for(let t=0,i=r.length;t<i;t++){let o=r.charCodeAt(t);switch(o){case 9:e+="\u2192";break;case 32:e+="\xB7";break;default:e+=String.fromCharCode(o)}}return e}function q2(r,e){let t=Sa.get(e);if(t)return t;let i=r.encodeLanguageId(e);return{getInitialState:()=>ak,tokenize:(o,n,s)=>lk(e,s),tokenizeEncoded:(o,n,s)=>ck(i,s)}}var E0=class r extends w{static{this._ID="editor.contrib.inspectTokensWidget"}constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=q2(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return r._ID}_compute(e){let t=this._getTokensAtLine(e.lineNumber),i=0;for(let l=t.tokens1.length-1;l>=0;l--){let c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let o=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){o=l;break}let n=this._model.getLineContent(e.lineNumber),s="";if(i<t.tokens1.length){let l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:n.length;s=n.substring(l,c)}ms(this._domNode,F("h2.tm-token",void 0,K2(s),F("span.tm-token-length",void 0,`${s.length} ${s.length===1?"char":"chars"}`))),O(this._domNode,F("hr.tokens-inspect-separator",{style:"clear:both"}));let a=(o<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(o<<1)+1]):null;O(this._domNode,F("table.tm-metadata-table",void 0,F("tbody",void 0,F("tr",void 0,F("td.tm-metadata-key",void 0,"language"),F("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),F("tr",void 0,F("td.tm-metadata-key",void 0,"token type"),F("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),F("tr",void 0,F("td.tm-metadata-key",void 0,"font style"),F("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),F("tr",void 0,F("td.tm-metadata-key",void 0,"foreground"),F("td.tm-metadata-value",void 0,`${a?he.Format.CSS.formatHex(a.foreground):"-?-"}`)),F("tr",void 0,F("td.tm-metadata-key",void 0,"background"),F("td.tm-metadata-value",void 0,`${a?he.Format.CSS.formatHex(a.background):"-?-"}`))))),O(this._domNode,F("hr.tokens-inspect-separator")),i<t.tokens1.length&&O(this._domNode,F("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){let t=Sa.getColorMap(),i=Ma.getLanguageId(e),o=Ma.getTokenType(e),n=Ma.getFontStyle(e),s=Ma.getForeground(e),a=Ma.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:o,fontStyle:n,foreground:t[s],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){let t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),o=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:o.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};H($u.ID,$u,4);x(I0)});var IM;(function(r){function e(t){return typeof t=="string"}r.is=e})(IM||(IM={}));var Bv;(function(r){function e(t){return typeof t=="string"}r.is=e})(Bv||(Bv={}));var EM;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&r.MIN_VALUE<=t&&t<=r.MAX_VALUE}r.is=e})(EM||(EM={}));var Dp;(function(r){r.MIN_VALUE=0,r.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&r.MIN_VALUE<=t&&t<=r.MAX_VALUE}r.is=e})(Dp||(Dp={}));var Po;(function(r){function e(i,o){return i===Number.MAX_VALUE&&(i=Dp.MAX_VALUE),o===Number.MAX_VALUE&&(o=Dp.MAX_VALUE),{line:i,character:o}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&E.uinteger(o.line)&&E.uinteger(o.character)}r.is=t})(Po||(Po={}));var Ot;(function(r){function e(i,o,n,s){if(E.uinteger(i)&&E.uinteger(o)&&E.uinteger(n)&&E.uinteger(s))return{start:Po.create(i,o),end:Po.create(n,s)};if(Po.is(i)&&Po.is(o))return{start:i,end:o};throw new Error(`Range#create called with invalid arguments[${i}, ${o}, ${n}, ${s}]`)}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&Po.is(o.start)&&Po.is(o.end)}r.is=t})(Ot||(Ot={}));var Ip;(function(r){function e(i,o){return{uri:i,range:o}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&Ot.is(o.range)&&(E.string(o.uri)||E.undefined(o.uri))}r.is=t})(Ip||(Ip={}));var LM;(function(r){function e(i,o,n,s){return{targetUri:i,targetRange:o,targetSelectionRange:n,originSelectionRange:s}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&Ot.is(o.targetRange)&&E.string(o.targetUri)&&Ot.is(o.targetSelectionRange)&&(Ot.is(o.originSelectionRange)||E.undefined(o.originSelectionRange))}r.is=t})(LM||(LM={}));var zv;(function(r){function e(i,o,n,s){return{red:i,green:o,blue:n,alpha:s}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&E.numberRange(o.red,0,1)&&E.numberRange(o.green,0,1)&&E.numberRange(o.blue,0,1)&&E.numberRange(o.alpha,0,1)}r.is=t})(zv||(zv={}));var kM;(function(r){function e(i,o){return{range:i,color:o}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&Ot.is(o.range)&&zv.is(o.color)}r.is=t})(kM||(kM={}));var MM;(function(r){function e(i,o,n){return{label:i,textEdit:o,additionalTextEdits:n}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&E.string(o.label)&&(E.undefined(o.textEdit)||Za.is(o))&&(E.undefined(o.additionalTextEdits)||E.typedArray(o.additionalTextEdits,Za.is))}r.is=t})(MM||(MM={}));var AM;(function(r){r.Comment="comment",r.Imports="imports",r.Region="region"})(AM||(AM={}));var NM;(function(r){function e(i,o,n,s,a,l){let c={startLine:i,endLine:o};return E.defined(n)&&(c.startCharacter=n),E.defined(s)&&(c.endCharacter=s),E.defined(a)&&(c.kind=a),E.defined(l)&&(c.collapsedText=l),c}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&E.uinteger(o.startLine)&&E.uinteger(o.startLine)&&(E.undefined(o.startCharacter)||E.uinteger(o.startCharacter))&&(E.undefined(o.endCharacter)||E.uinteger(o.endCharacter))&&(E.undefined(o.kind)||E.string(o.kind))}r.is=t})(NM||(NM={}));var Vv;(function(r){function e(i,o){return{location:i,message:o}}r.create=e;function t(i){let o=i;return E.defined(o)&&Ip.is(o.location)&&E.string(o.message)}r.is=t})(Vv||(Vv={}));var Ep;(function(r){r.Error=1,r.Warning=2,r.Information=3,r.Hint=4})(Ep||(Ep={}));var TM;(function(r){r.Unnecessary=1,r.Deprecated=2})(TM||(TM={}));var PM;(function(r){function e(t){let i=t;return E.objectLiteral(i)&&E.string(i.href)}r.is=e})(PM||(PM={}));var Lp;(function(r){function e(i,o,n,s,a,l){let c={range:i,message:o};return E.defined(n)&&(c.severity=n),E.defined(s)&&(c.code=s),E.defined(a)&&(c.source=a),E.defined(l)&&(c.relatedInformation=l),c}r.create=e;function t(i){var o;let n=i;return E.defined(n)&&Ot.is(n.range)&&E.string(n.message)&&(E.number(n.severity)||E.undefined(n.severity))&&(E.integer(n.code)||E.string(n.code)||E.undefined(n.code))&&(E.undefined(n.codeDescription)||E.string((o=n.codeDescription)===null||o===void 0?void 0:o.href))&&(E.string(n.source)||E.undefined(n.source))&&(E.undefined(n.relatedInformation)||E.typedArray(n.relatedInformation,Vv.is))}r.is=t})(Lp||(Lp={}));var Ya;(function(r){function e(i,o,...n){let s={title:i,command:o};return E.defined(n)&&n.length>0&&(s.arguments=n),s}r.create=e;function t(i){let o=i;return E.defined(o)&&E.string(o.title)&&E.string(o.command)}r.is=t})(Ya||(Ya={}));var Za;(function(r){function e(n,s){return{range:n,newText:s}}r.replace=e;function t(n,s){return{range:{start:n,end:n},newText:s}}r.insert=t;function i(n){return{range:n,newText:""}}r.del=i;function o(n){let s=n;return E.objectLiteral(s)&&E.string(s.newText)&&Ot.is(s.range)}r.is=o})(Za||(Za={}));var Uv;(function(r){function e(i,o,n){let s={label:i};return o!==void 0&&(s.needsConfirmation=o),n!==void 0&&(s.description=n),s}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&E.string(o.label)&&(E.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(E.string(o.description)||o.description===void 0)}r.is=t})(Uv||(Uv={}));var Xa;(function(r){function e(t){let i=t;return E.string(i)}r.is=e})(Xa||(Xa={}));var RM;(function(r){function e(n,s,a){return{range:n,newText:s,annotationId:a}}r.replace=e;function t(n,s,a){return{range:{start:n,end:n},newText:s,annotationId:a}}r.insert=t;function i(n,s){return{range:n,newText:"",annotationId:s}}r.del=i;function o(n){let s=n;return Za.is(s)&&(Uv.is(s.annotationId)||Xa.is(s.annotationId))}r.is=o})(RM||(RM={}));var jv;(function(r){function e(i,o){return{textDocument:i,edits:o}}r.create=e;function t(i){let o=i;return E.defined(o)&&Yv.is(o.textDocument)&&Array.isArray(o.edits)}r.is=t})(jv||(jv={}));var Kv;(function(r){function e(i,o,n){let s={kind:"create",uri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(s.options=o),n!==void 0&&(s.annotationId=n),s}r.create=e;function t(i){let o=i;return o&&o.kind==="create"&&E.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||E.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||E.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Xa.is(o.annotationId))}r.is=t})(Kv||(Kv={}));var qv;(function(r){function e(i,o,n,s){let a={kind:"rename",oldUri:i,newUri:o};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(a.options=n),s!==void 0&&(a.annotationId=s),a}r.create=e;function t(i){let o=i;return o&&o.kind==="rename"&&E.string(o.oldUri)&&E.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||E.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||E.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Xa.is(o.annotationId))}r.is=t})(qv||(qv={}));var Gv;(function(r){function e(i,o,n){let s={kind:"delete",uri:i};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(s.options=o),n!==void 0&&(s.annotationId=n),s}r.create=e;function t(i){let o=i;return o&&o.kind==="delete"&&E.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||E.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||E.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||Xa.is(o.annotationId))}r.is=t})(Gv||(Gv={}));var $v;(function(r){function e(t){let i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(o=>E.string(o.kind)?Kv.is(o)||qv.is(o)||Gv.is(o):jv.is(o)))}r.is=e})($v||($v={}));var FM;(function(r){function e(i){return{uri:i}}r.create=e;function t(i){let o=i;return E.defined(o)&&E.string(o.uri)}r.is=t})(FM||(FM={}));var OM;(function(r){function e(i,o){return{uri:i,version:o}}r.create=e;function t(i){let o=i;return E.defined(o)&&E.string(o.uri)&&E.integer(o.version)}r.is=t})(OM||(OM={}));var Yv;(function(r){function e(i,o){return{uri:i,version:o}}r.create=e;function t(i){let o=i;return E.defined(o)&&E.string(o.uri)&&(o.version===null||E.integer(o.version))}r.is=t})(Yv||(Yv={}));var WM;(function(r){function e(i,o,n,s){return{uri:i,languageId:o,version:n,text:s}}r.create=e;function t(i){let o=i;return E.defined(o)&&E.string(o.uri)&&E.string(o.languageId)&&E.integer(o.version)&&E.string(o.text)}r.is=t})(WM||(WM={}));var Zc;(function(r){r.PlainText="plaintext",r.Markdown="markdown";function e(t){let i=t;return i===r.PlainText||i===r.Markdown}r.is=e})(Zc||(Zc={}));var Xc;(function(r){function e(t){let i=t;return E.objectLiteral(t)&&Zc.is(i.kind)&&E.string(i.value)}r.is=e})(Xc||(Xc={}));var Jt;(function(r){r.Text=1,r.Method=2,r.Function=3,r.Constructor=4,r.Field=5,r.Variable=6,r.Class=7,r.Interface=8,r.Module=9,r.Property=10,r.Unit=11,r.Value=12,r.Enum=13,r.Keyword=14,r.Snippet=15,r.Color=16,r.File=17,r.Reference=18,r.Folder=19,r.EnumMember=20,r.Constant=21,r.Struct=22,r.Event=23,r.Operator=24,r.TypeParameter=25})(Jt||(Jt={}));var yi;(function(r){r.PlainText=1,r.Snippet=2})(yi||(yi={}));var HM;(function(r){r.Deprecated=1})(HM||(HM={}));var BM;(function(r){function e(i,o,n){return{newText:i,insert:o,replace:n}}r.create=e;function t(i){let o=i;return o&&E.string(o.newText)&&Ot.is(o.insert)&&Ot.is(o.replace)}r.is=t})(BM||(BM={}));var Di;(function(r){r.asIs=1,r.adjustIndentation=2})(Di||(Di={}));var zM;(function(r){function e(t){let i=t;return i&&(E.string(i.detail)||i.detail===void 0)&&(E.string(i.description)||i.description===void 0)}r.is=e})(zM||(zM={}));var VM;(function(r){function e(t){return{label:t}}r.create=e})(VM||(VM={}));var UM;(function(r){function e(t,i){return{items:t||[],isIncomplete:!!i}}r.create=e})(UM||(UM={}));var kp;(function(r){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}r.fromPlainText=e;function t(i){let o=i;return E.string(o)||E.objectLiteral(o)&&E.string(o.language)&&E.string(o.value)}r.is=t})(kp||(kp={}));var jM;(function(r){function e(t){let i=t;return!!i&&E.objectLiteral(i)&&(Xc.is(i.contents)||kp.is(i.contents)||E.typedArray(i.contents,kp.is))&&(t.range===void 0||Ot.is(t.range))}r.is=e})(jM||(jM={}));var KM;(function(r){function e(t,i){return i?{label:t,documentation:i}:{label:t}}r.create=e})(KM||(KM={}));var qM;(function(r){function e(t,i,...o){let n={label:t};return E.defined(i)&&(n.documentation=i),E.defined(o)?n.parameters=o:n.parameters=[],n}r.create=e})(qM||(qM={}));var GM;(function(r){r.Text=1,r.Read=2,r.Write=3})(GM||(GM={}));var $M;(function(r){function e(t,i){let o={range:t};return E.number(i)&&(o.kind=i),o}r.create=e})($M||($M={}));var YM;(function(r){r.File=1,r.Module=2,r.Namespace=3,r.Package=4,r.Class=5,r.Method=6,r.Property=7,r.Field=8,r.Constructor=9,r.Enum=10,r.Interface=11,r.Function=12,r.Variable=13,r.Constant=14,r.String=15,r.Number=16,r.Boolean=17,r.Array=18,r.Object=19,r.Key=20,r.Null=21,r.EnumMember=22,r.Struct=23,r.Event=24,r.Operator=25,r.TypeParameter=26})(YM||(YM={}));var ZM;(function(r){r.Deprecated=1})(ZM||(ZM={}));var XM;(function(r){function e(t,i,o,n,s){let a={name:t,kind:i,location:{uri:n,range:o}};return s&&(a.containerName=s),a}r.create=e})(XM||(XM={}));var QM;(function(r){function e(t,i,o,n){return n!==void 0?{name:t,kind:i,location:{uri:o,range:n}}:{name:t,kind:i,location:{uri:o}}}r.create=e})(QM||(QM={}));var JM;(function(r){function e(i,o,n,s,a,l){let c={name:i,detail:o,kind:n,range:s,selectionRange:a};return l!==void 0&&(c.children=l),c}r.create=e;function t(i){let o=i;return o&&E.string(o.name)&&E.number(o.kind)&&Ot.is(o.range)&&Ot.is(o.selectionRange)&&(o.detail===void 0||E.string(o.detail))&&(o.deprecated===void 0||E.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}r.is=t})(JM||(JM={}));var eA;(function(r){r.Empty="",r.QuickFix="quickfix",r.Refactor="refactor",r.RefactorExtract="refactor.extract",r.RefactorInline="refactor.inline",r.RefactorRewrite="refactor.rewrite",r.Source="source",r.SourceOrganizeImports="source.organizeImports",r.SourceFixAll="source.fixAll"})(eA||(eA={}));var Mp;(function(r){r.Invoked=1,r.Automatic=2})(Mp||(Mp={}));var tA;(function(r){function e(i,o,n){let s={diagnostics:i};return o!=null&&(s.only=o),n!=null&&(s.triggerKind=n),s}r.create=e;function t(i){let o=i;return E.defined(o)&&E.typedArray(o.diagnostics,Lp.is)&&(o.only===void 0||E.typedArray(o.only,E.string))&&(o.triggerKind===void 0||o.triggerKind===Mp.Invoked||o.triggerKind===Mp.Automatic)}r.is=t})(tA||(tA={}));var iA;(function(r){function e(i,o,n){let s={title:i},a=!0;return typeof o=="string"?(a=!1,s.kind=o):Ya.is(o)?s.command=o:s.edit=o,a&&n!==void 0&&(s.kind=n),s}r.create=e;function t(i){let o=i;return o&&E.string(o.title)&&(o.diagnostics===void 0||E.typedArray(o.diagnostics,Lp.is))&&(o.kind===void 0||E.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Ya.is(o.command))&&(o.isPreferred===void 0||E.boolean(o.isPreferred))&&(o.edit===void 0||$v.is(o.edit))}r.is=t})(iA||(iA={}));var oA;(function(r){function e(i,o){let n={range:i};return E.defined(o)&&(n.data=o),n}r.create=e;function t(i){let o=i;return E.defined(o)&&Ot.is(o.range)&&(E.undefined(o.command)||Ya.is(o.command))}r.is=t})(oA||(oA={}));var nA;(function(r){function e(i,o){return{tabSize:i,insertSpaces:o}}r.create=e;function t(i){let o=i;return E.defined(o)&&E.uinteger(o.tabSize)&&E.boolean(o.insertSpaces)}r.is=t})(nA||(nA={}));var rA;(function(r){function e(i,o,n){return{range:i,target:o,data:n}}r.create=e;function t(i){let o=i;return E.defined(o)&&Ot.is(o.range)&&(E.undefined(o.target)||E.string(o.target))}r.is=t})(rA||(rA={}));var sA;(function(r){function e(i,o){return{range:i,parent:o}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&Ot.is(o.range)&&(o.parent===void 0||r.is(o.parent))}r.is=t})(sA||(sA={}));var aA;(function(r){r.namespace="namespace",r.type="type",r.class="class",r.enum="enum",r.interface="interface",r.struct="struct",r.typeParameter="typeParameter",r.parameter="parameter",r.variable="variable",r.property="property",r.enumMember="enumMember",r.event="event",r.function="function",r.method="method",r.macro="macro",r.keyword="keyword",r.modifier="modifier",r.comment="comment",r.string="string",r.number="number",r.regexp="regexp",r.operator="operator",r.decorator="decorator"})(aA||(aA={}));var lA;(function(r){r.declaration="declaration",r.definition="definition",r.readonly="readonly",r.static="static",r.deprecated="deprecated",r.abstract="abstract",r.async="async",r.modification="modification",r.documentation="documentation",r.defaultLibrary="defaultLibrary"})(lA||(lA={}));var cA;(function(r){function e(t){let i=t;return E.objectLiteral(i)&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}r.is=e})(cA||(cA={}));var dA;(function(r){function e(i,o){return{range:i,text:o}}r.create=e;function t(i){let o=i;return o!=null&&Ot.is(o.range)&&E.string(o.text)}r.is=t})(dA||(dA={}));var uA;(function(r){function e(i,o,n){return{range:i,variableName:o,caseSensitiveLookup:n}}r.create=e;function t(i){let o=i;return o!=null&&Ot.is(o.range)&&E.boolean(o.caseSensitiveLookup)&&(E.string(o.variableName)||o.variableName===void 0)}r.is=t})(uA||(uA={}));var hA;(function(r){function e(i,o){return{range:i,expression:o}}r.create=e;function t(i){let o=i;return o!=null&&Ot.is(o.range)&&(E.string(o.expression)||o.expression===void 0)}r.is=t})(hA||(hA={}));var pA;(function(r){function e(i,o){return{frameId:i,stoppedLocation:o}}r.create=e;function t(i){let o=i;return E.defined(o)&&Ot.is(i.stoppedLocation)}r.is=t})(pA||(pA={}));var Zv;(function(r){r.Type=1,r.Parameter=2;function e(t){return t===1||t===2}r.is=e})(Zv||(Zv={}));var Xv;(function(r){function e(i){return{value:i}}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&(o.tooltip===void 0||E.string(o.tooltip)||Xc.is(o.tooltip))&&(o.location===void 0||Ip.is(o.location))&&(o.command===void 0||Ya.is(o.command))}r.is=t})(Xv||(Xv={}));var gA;(function(r){function e(i,o,n){let s={position:i,label:o};return n!==void 0&&(s.kind=n),s}r.create=e;function t(i){let o=i;return E.objectLiteral(o)&&Po.is(o.position)&&(E.string(o.label)||E.typedArray(o.label,Xv.is))&&(o.kind===void 0||Zv.is(o.kind))&&o.textEdits===void 0||E.typedArray(o.textEdits,Za.is)&&(o.tooltip===void 0||E.string(o.tooltip)||Xc.is(o.tooltip))&&(o.paddingLeft===void 0||E.boolean(o.paddingLeft))&&(o.paddingRight===void 0||E.boolean(o.paddingRight))}r.is=t})(gA||(gA={}));var mA;(function(r){function e(t){return{kind:"snippet",value:t}}r.createSnippet=e})(mA||(mA={}));var fA;(function(r){function e(t,i,o,n){return{insertText:t,filterText:i,range:o,command:n}}r.create=e})(fA||(fA={}));var _A;(function(r){function e(t){return{items:t}}r.create=e})(_A||(_A={}));var bA;(function(r){r.Invoked=0,r.Automatic=1})(bA||(bA={}));var vA;(function(r){function e(t,i){return{range:t,text:i}}r.create=e})(vA||(vA={}));var CA;(function(r){function e(t,i){return{triggerKind:t,selectedCompletionInfo:i}}r.create=e})(CA||(CA={}));var SA;(function(r){function e(t){let i=t;return E.objectLiteral(i)&&Bv.is(i.uri)&&E.string(i.name)}r.is=e})(SA||(SA={}));var xA;(function(r){function e(n,s,a,l){return new Qv(n,s,a,l)}r.create=e;function t(n){let s=n;return!!(E.defined(s)&&E.string(s.uri)&&(E.undefined(s.languageId)||E.string(s.languageId))&&E.uinteger(s.lineCount)&&E.func(s.getText)&&E.func(s.positionAt)&&E.func(s.offsetAt))}r.is=t;function i(n,s){let a=n.getText(),l=o(s,(d,u)=>{let p=d.range.start.line-u.range.start.line;return p===0?d.range.start.character-u.range.start.character:p}),c=a.length;for(let d=l.length-1;d>=0;d--){let u=l[d],p=n.offsetAt(u.range.start),g=n.offsetAt(u.range.end);if(g<=c)a=a.substring(0,p)+u.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");c=p}return a}r.applyEdits=i;function o(n,s){if(n.length<=1)return n;let a=n.length/2|0,l=n.slice(0,a),c=n.slice(a);o(l,s),o(c,s);let d=0,u=0,p=0;for(;d<l.length&&u<c.length;)s(l[d],c[u])<=0?n[p++]=l[d++]:n[p++]=c[u++];for(;d<l.length;)n[p++]=l[d++];for(;u<c.length;)n[p++]=c[u++];return n}})(xA||(xA={}));var Qv=class{constructor(e,t,i,o){this._uri=e,this._languageId=t,this._version=i,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,i=!0;for(let o=0;o<t.length;o++){i&&(e.push(o),i=!1);let n=t.charAt(o);i=n==="\r"||n===` `,n==="\r"&&o+1<t.length&&t.charAt(o+1)===` `&&o++}i&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,o=t.length;if(o===0)return Po.create(0,e);for(;i<o;){let s=Math.floor((i+o)/2);t[s]>e?o=s:i=s+1}let n=i-1;return Po.create(n,e-t[n])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let i=t[e.line],o=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,o),i)}get lineCount(){return this.getLineOffsets().length}},E;(function(r){let e=Object.prototype.toString;function t(g){return typeof g<"u"}r.defined=t;function i(g){return typeof g>"u"}r.undefined=i;function o(g){return g===!0||g===!1}r.boolean=o;function n(g){return e.call(g)==="[object String]"}r.string=n;function s(g){return e.call(g)==="[object Number]"}r.number=s;function a(g,m,f){return e.call(g)==="[object Number]"&&m<=g&&g<=f}r.numberRange=a;function l(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}r.integer=l;function c(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}r.uinteger=c;function d(g){return e.call(g)==="[object Function]"}r.func=d;function u(g){return g!==null&&typeof g=="object"}r.objectLiteral=u;function p(g,m){return Array.isArray(g)&&g.every(m)}r.typedArray=p})(E||(E={}));async function aB(r,e){try{let t=await r,i=new Map,o=new Map,n=[],s=cR(e);return t.forEach(a=>{let l=[];a.items.forEach(c=>dR(l,o,i,s,c)),l.length&&n.push({...a,items:l})}),{categories:n,functionDefinitions:i,constantDefinitions:o}}catch(t){return console.error(t),{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}function cR(r){let{profile:{apiVersion:e,bundles:t,hiddenApiItems:i=[]}={}}=r,o=yA(e),n=Array.isArray(t)&&t.length>0?new Set(["core",...t]):void 0;return s=>hR(o,s.sinceVersion)&&(!n||n.has(s.bundle))&&!i.includes(s.name)}function dR(r,e,t,i,o){if(Array.isArray(o)){o.forEach(n=>wA(r,t,i,n));return}o.type==="constant"?uR(r,e,i,o):wA(r,t,i,o)}function wA(r,e,t,i){if(!t(i))return;i.disableDocumentation||r.push(i);let{completion:{label:o}}=i,n=o.toLowerCase(),s=e.get(n);s||(s={type:"functionDefinition",key:n,overloads:[]},e.set(n,s)),s.overloads.push(i)}function uR(r,e,t,i){if(!t(i))return;r.push(i);let{completion:{label:o}}=i,n=o.toLowerCase();e.set(n,i);let[s,a]=i.completion.label.split(".");if(!a)return;let l=s.toLowerCase(),c=e.get(l);c||(c={type:"namespace",key:l,members:[],completion:{label:s,detail:s,insertText:s,insertTextMode:Di.adjustIndentation,insertTextFormat:yi.PlainText,kind:Jt.Enum}},e.set(l,c));let d=structuredClone(i);d.name=a,d.completion.label=a,d.completion.insertText=a,d.completion.kind=Jt.Constant,c.members.push(d),c.completion.documentation=c.members.reduce((u,p)=>(u.value=`${u.value}${u.value?` `:""}**${p.completion.label}**: ${p.description}`,u),{kind:Zc.Markdown,value:""})}function yA(r){if(!r||typeof r!="string")return null;let e=r.split(".").map(o=>Number.parseInt(o));if(e.some(Number.isNaN))return console.error("Invalid API version string",r),null;let[t,i]=e.slice(0,2);return{major:t,minor:i}}function hR(r,e){if(!r)return!0;let t=yA(e);return t?r.major>t.major?!1:r.minor===void 0||t.minor===void 0?!0:t.minor<=r.minor:!0}var Qc={False:"false",Null:"null",True:"true"},Ve={Break:"break",Continue:"continue",Else:"else",For:"for",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"},Jv={From:"from",Of:"of"},k={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockComment:"BlockComment",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",ContinueStatement:"ContinueStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ExportNamedDeclaration:"ExportNamedDeclaration",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",LineComment:"LineComment",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement"},nC=["++","--"],FA=["-","+","!","~"],OA=["=","/=","*=","%=","+=","-="],WA=["||","&&"],pR=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],Tp={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},te={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,Template:10},gR=["Unknown","Boolean","<end>","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"],Q={InvalidModuleUri:"InvalidModuleUri",ForInOfLoopInitializer:"ForInOfLoopInitializer",IdentifierExpected:"IdentifierExpected",InvalidEscapedReservedWord:"InvalidEscapedReservedWord",InvalidExpression:"InvalidExpression",InvalidFunctionIdentifier:"InvalidFunctionIdentifier",InvalidHexEscapeSequence:"InvalidHexEscapeSequence",InvalidLeftHandSideInAssignment:"InvalidLeftHandSideInAssignment",InvalidLeftHandSideInForIn:"InvalidLeftHandSideInForIn",InvalidTemplateHead:"InvalidTemplateHead",InvalidVariableAssignment:"InvalidVariableAssignment",KeyMustBeString:"KeyMustBeString",NoFunctionInsideBlock:"NoFunctionInsideBlock",NoFunctionInsideFunction:"NoFunctionInsideFunction",ModuleExportRootOnly:"ModuleExportRootOnly",ModuleImportRootOnly:"ModuleImportRootOnly",PunctuatorExpected:"PunctuatorExpected",TemplateOctalLiteral:"TemplateOctalLiteral",UnexpectedBoolean:"UnexpectedBoolean",UnexpectedEndOfScript:"UnexpectedEndOfScript",UnexpectedIdentifier:"UnexpectedIdentifier",UnexpectedKeyword:"UnexpectedKeyword",UnexpectedNull:"UnexpectedNull",UnexpectedNumber:"UnexpectedNumber",UnexpectedPunctuator:"UnexpectedPunctuator",UnexpectedString:"UnexpectedString",UnexpectedTemplate:"UnexpectedTemplate",UnexpectedToken:"UnexpectedToken"},HA={[Q.InvalidModuleUri]:"Module uri must be a text literal.",[Q.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[Q.IdentifierExpected]:"'${value}' is an invalid identifier.",[Q.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[Q.InvalidExpression]:"Invalid expression.",[Q.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[Q.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[Q.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[Q.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[Q.InvalidTemplateHead]:"Invalid template structure.",[Q.InvalidVariableAssignment]:"Invalid variable assignment.",[Q.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[Q.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[Q.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[Q.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[Q.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[Q.PunctuatorExpected]:"'${value}' expected.",[Q.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[Q.UnexpectedBoolean]:"Unexpected boolean literal.",[Q.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[Q.UnexpectedIdentifier]:"Unexpected identifier.",[Q.UnexpectedKeyword]:"Unexpected keyword.",[Q.UnexpectedNull]:"Unexpected null literal.",[Q.UnexpectedNumber]:"Unexpected number.",[Q.UnexpectedPunctuator]:"Unexpected punctuator.",[Q.UnexpectedString]:"Unexpected text literal.",[Q.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[Q.UnexpectedToken]:"Unexpected token '${value}'."},Ja=class r extends Error{constructor({code:e,index:t,line:i,column:o,len:n=0,description:s,data:a}){super(s??e),this.declaredRootClass="esri.arcade.lib.diagnostic",this.name="ParsingError",this.code=e,this.index=t,this.line=i,this.column=o,this.len=n,this.data=a,this.description=s,this.range={start:{line:i,column:o-1},end:{line:i,column:o+n}},Error.captureStackTrace?.(this,r)}};function mR(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.Program}function Zn(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.BlockStatement}function fR(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.BlockComment}function BA(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.EmptyStatement}function _R(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.ExpressionStatement}function DA(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.FunctionDeclaration}function rC(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.IfStatement}function sC(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.VariableDeclaration}function Pp(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.ArrayExpression}function aC(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.BinaryExpression}function yC(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.Identifier}function zA(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.Literal}function lC(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.LogicalExpression}function IA(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.ObjectExpression}function EA(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.MemberExpression}function bR(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.UnaryExpression}function vR(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.UpdateExpression}function VA(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.VariableDeclarator}function CR(r){return!!r&&typeof r=="object"&&"type"in r&&r.type===k.Property}function eC(r,e){return e.loc.end.line===r.loc.start.line&&e.loc.end.column<=r.loc.start.column}function LA(r,e){return r.range[0]>=e.range[0]&&r.range[1]<=e.range[1]}var cC=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!Zn(e)||e.body.length!==0)return;let t=[];for(let i=this._newComments.length-1;i>=0;i--){let o=this._newComments[i];e.range[1]>=o.range[0]&&(t.unshift(o),this._newComments.splice(i,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){let t=this._nodeStack.at(-1);if(!t)return;if(Zn(e)&&LA(t,e))for(let o=this._newComments.length-1;o>=0;o--){let n=this._newComments[o];LA(n,e)&&(t.trailingComments=[...t.trailingComments??[],n],this._newComments.splice(o,1))}let i=[];if(this._newComments.length>0)for(let o=this._newComments.length-1;o>=0;o--){let n=this._newComments[o];eC(n,t)?(t.trailingComments=[...t.trailingComments??[],n],this._newComments.splice(o,1)):eC(n,e)&&(i.unshift(n),this._newComments.splice(o,1))}if(t.trailingComments){let o=t.trailingComments[0];eC(o,e)&&(i=[...i,...t.trailingComments],delete t.trailingCommen