agl 42.2.1 → 42.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-10-31 - 42.2.2
4
+
5
+ ### Fixes
6
+
7
+ - The controller resolves Monaco assets from the maintained editor used by dees-catalog 23.4.1, so a fresh global installation starts with the qualified editor dependency.
8
+
3
9
  ## 2026-10-31 - 42.2.1
4
10
 
5
11
  ### Fixes
@@ -4640,7 +4640,7 @@ img.ProseMirror-separator {
4640
4640
  1. Must only contain digits, lowercase ASCII letters or "-"
4641
4641
  2. Cannot start or end with "-"
4642
4642
  3. "-" cannot repeat`);vn.customSchemes.push([i,e])}function mqi(){vn.scanner=LKs(vn.customSchemes);for(let i=0;i<vn.tokenQueue.length;i++)vn.tokenQueue[i][1]({scanner:vn.scanner});vn.parser=$Ks(vn.scanner.tokens);for(let i=0;i<vn.pluginQueue.length;i++)vn.pluginQueue[i][1]({scanner:vn.scanner,parser:vn.parser});return vn.initialized=!0,vn}function aq(i){return vn.initialized||mqi(),BKs(vn.parser.start,i,lqi(vn.scanner.start,i))}function YFe(i,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}let s=new _0e(t),r=aq(i),a=[];for(let o=0;o<r.length;o++){let l=r[o];l.isLink&&(!e||l.t===e)&&s.check(l)&&a.push(l.toFormattedObject(s))}return a}function qKs(i,e=null){let t=aq(i);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}var kKs,TKs,V4t,G4t,W4t,u0e,p0e,j4t,eqi,EKs,IKs,K4t,Vr,$l,tqi,pi,G1,Y4t,iqi,sqi,f0e,Q4t,X4t,gFe,iq,Z4t,J4t,e5t,m0e,g0e,vFe,bFe,yFe,_Fe,wFe,xFe,SFe,CFe,kFe,TFe,EFe,IFe,RFe,MFe,DFe,OFe,PFe,f2,AFe,LFe,NFe,KN,t5t,$Fe,B0,BFe,i5t,Cb,v0e,FFe,zFe,qFe,b0e,s5t,rqi,r5t,F0,y0e,UFe,nqi,HFe,aqi,z0,sq,VFe,DKs,q0,GFe,OKs,oqi,n5t,PKs,AKs,a5t,WFe,jFe,rq,NKs,uqi,o5t,pqi,x0e,fqi,kb,S0e,c5t,vn,gqi=y(()=>{"use strict";kKs="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",TKs="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",V4t="numeric",G4t="ascii",W4t="alpha",u0e="asciinumeric",p0e="alphanumeric",j4t="domain",eqi="emoji",EKs="scheme",IKs="slashscheme",K4t="whitespace";n(RKs,"registerGroup");n(jN,"addToGroups");n(MKs,"flagsForToken");n(of,"State"),of.groups={},of.prototype={accepts(){return!!this.t},go(i){let e=this,t=e.j[i];if(t)return t;for(let s=0;s<e.jr.length;s++){let r=e.jr[s][0],a=e.jr[s][1];if(a&&r.test(i))return a}return e.jd},has(i,e=!1){return e?i in this.j:!!this.go(i)},ta(i,e,t,s){for(let r=0;r<i.length;r++)this.tt(i[r],e,t,s)},tr(i,e,t,s){s=s||of.groups;let r;return e&&e.j?r=e:(r=new of(e),t&&s&&jN(e,t,s)),this.jr.push([i,r]),r},ts(i,e,t,s){let r=this,a=i.length;if(!a)return r;for(let o=0;o<a-1;o++)r=r.tt(i[o]);return r.tt(i[a-1],e,t,s)},tt(i,e,t,s){s=s||of.groups;let r=this;if(e&&e.j)return r.j[i]=e,e;let a=e,o,l=r.go(i);if(l?(o=new of,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new of,a){if(s)if(o.t&&typeof o.t=="string"){let c=Object.assign(MKs(o.t,s),t);jN(a,c,s)}else t&&jN(a,t,s);o.t=a}return r.j[i]=o,o}};Vr=n((i,e,t,s,r)=>i.ta(e,t,s,r),"ta"),$l=n((i,e,t,s,r)=>i.tr(e,t,s,r),"tr"),tqi=n((i,e,t,s,r)=>i.ts(e,t,s,r),"ts"),pi=n((i,e,t,s,r)=>i.tt(e,t,s,r),"tt"),G1="WORD",Y4t="UWORD",iqi="ASCIINUMERICAL",sqi="ALPHANUMERICAL",f0e="LOCALHOST",Q4t="TLD",X4t="UTLD",gFe="SCHEME",iq="SLASH_SCHEME",Z4t="NUM",J4t="WS",e5t="NL",m0e="OPENBRACE",g0e="CLOSEBRACE",vFe="OPENBRACKET",bFe="CLOSEBRACKET",yFe="OPENPAREN",_Fe="CLOSEPAREN",wFe="OPENANGLEBRACKET",xFe="CLOSEANGLEBRACKET",SFe="FULLWIDTHLEFTPAREN",CFe="FULLWIDTHRIGHTPAREN",kFe="LEFTCORNERBRACKET",TFe="RIGHTCORNERBRACKET",EFe="LEFTWHITECORNERBRACKET",IFe="RIGHTWHITECORNERBRACKET",RFe="FULLWIDTHLESSTHAN",MFe="FULLWIDTHGREATERTHAN",DFe="AMPERSAND",OFe="APOSTROPHE",PFe="ASTERISK",f2="AT",AFe="BACKSLASH",LFe="BACKTICK",NFe="CARET",KN="COLON",t5t="COMMA",$Fe="DOLLAR",B0="DOT",BFe="EQUALS",i5t="EXCLAMATION",Cb="HYPHEN",v0e="PERCENT",FFe="PIPE",zFe="PLUS",qFe="POUND",b0e="QUERY",s5t="QUOTE",rqi="FULLWIDTHMIDDLEDOT",r5t="SEMI",F0="SLASH",y0e="TILDE",UFe="UNDERSCORE",nqi="EMOJI",HFe="SYM",aqi=Object.freeze({__proto__:null,ALPHANUMERICAL:sqi,AMPERSAND:DFe,APOSTROPHE:OFe,ASCIINUMERICAL:iqi,ASTERISK:PFe,AT:f2,BACKSLASH:AFe,BACKTICK:LFe,CARET:NFe,CLOSEANGLEBRACKET:xFe,CLOSEBRACE:g0e,CLOSEBRACKET:bFe,CLOSEPAREN:_Fe,COLON:KN,COMMA:t5t,DOLLAR:$Fe,DOT:B0,EMOJI:nqi,EQUALS:BFe,EXCLAMATION:i5t,FULLWIDTHGREATERTHAN:MFe,FULLWIDTHLEFTPAREN:SFe,FULLWIDTHLESSTHAN:RFe,FULLWIDTHMIDDLEDOT:rqi,FULLWIDTHRIGHTPAREN:CFe,HYPHEN:Cb,LEFTCORNERBRACKET:kFe,LEFTWHITECORNERBRACKET:EFe,LOCALHOST:f0e,NL:e5t,NUM:Z4t,OPENANGLEBRACKET:wFe,OPENBRACE:m0e,OPENBRACKET:vFe,OPENPAREN:yFe,PERCENT:v0e,PIPE:FFe,PLUS:zFe,POUND:qFe,QUERY:b0e,QUOTE:s5t,RIGHTCORNERBRACKET:TFe,RIGHTWHITECORNERBRACKET:IFe,SCHEME:gFe,SEMI:r5t,SLASH:F0,SLASH_SCHEME:iq,SYM:HFe,TILDE:y0e,TLD:Q4t,UNDERSCORE:UFe,UTLD:X4t,UWORD:Y4t,WORD:G1,WS:J4t}),z0=/[a-z]/,sq=/\p{L}/u,VFe=/\p{Emoji}/u,DKs=/\ufe0f/,q0=/\d/,GFe=/\s/,OKs=Object.freeze({__proto__:null,ASCII_LETTER:z0,DIGIT:q0,EMOJI:VFe,EMOJI_VARIATION:DKs,LETTER:sq,SPACE:GFe}),oqi="\r",n5t=`
4643
- `,PKs="\uFE0F",AKs="\u200D",a5t="\uFFFC",WFe=null,jFe=null;n(LKs,"init$2");n(lqi,"run$1");n(cqi,"stringToArray");n(m2,"fastts");n(dqi,"decodeTlds");rq={defaultProtocol:"http",events:null,format:hqi,formatHref:hqi,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};n(_0e,"Options"),_0e.prototype={o:rq,ignoreTags:[],defaultRender(i){return i},check(i){return this.get("validate",i.toString(),i)},get(i,e,t){let s=e!=null,r=this.o[i];return r&&(typeof r=="object"?(r=t.t in r?r[t.t]:rq[i],typeof r=="function"&&s&&(r=r(e,t))):typeof r=="function"&&s&&(r=r(e,t.t,t)),r)},getObj(i,e,t){let s=this.o[i];return typeof s=="function"&&e!=null&&(s=s(e,t.t,t)),s},render(i){let e=i.render(this);return(this.get("render",null,i)||this.defaultRender)(e,i.t,i)}};n(hqi,"noop");NKs=Object.freeze({__proto__:null,Options:_0e,defaults:rq});n(w0e,"MultiToken"),w0e.prototype={isLink:!1,toString(){return this.v},toHref(i){return this.toString()},toFormattedString(i){let e=this.toString(),t=i.get("truncate",e,this),s=i.get("format",e,this);return t&&s.length>t?s.substring(0,t)+"\u2026":s},toFormattedHref(i){return i.get("formatHref",this.toHref(i.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(i=rq.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(i),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(i){return{type:this.t,value:this.toFormattedString(i),isLink:this.isLink,href:this.toFormattedHref(i),start:this.startIndex(),end:this.endIndex()}},validate(i){return i.get("validate",this.toString(),this)},render(i){let e=this,t=this.toHref(i.get("defaultProtocol")),s=i.get("formatHref",t,this),r=i.get("tagName",t,e),a=this.toFormattedString(i),o={},l=i.get("className",t,e),c=i.get("target",t,e),d=i.get("rel",t,e),h=i.getObj("attributes",t,e),u=i.getObj("events",t,e);return o.href=s,l&&(o.class=l),c&&(o.target=c),d&&(o.rel=d),h&&Object.assign(o,h),{tagName:r,attributes:o,content:a,eventListeners:u}}};n(nq,"createTokenClass");uqi=nq("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),o5t=nq("text"),pqi=nq("nl"),x0e=nq("url",{isLink:!0,toHref(i=rq.defaultProtocol){return this.hasProtocol()?this.v:`${i}://${this.v}`},hasProtocol(){let i=this.tk;return i.length>=2&&i[0].t!==f0e&&i[1].t===KN}}),fqi=Object.freeze({__proto__:null,Base:w0e,Email:uqi,MultiToken:w0e,Nl:pqi,Text:o5t,Url:x0e,createTokenClass:nq}),kb=n(i=>new of(i),"makeState");n($Ks,"init$1");n(BKs,"run");n(l5t,"initMultiToken");S0e=typeof console<"u"&&console&&console.warn||(()=>{}),c5t="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",vn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};n(d5t,"reset");n(FKs,"registerTokenPlugin");n(zKs,"registerPlugin");n(KFe,"registerCustomProtocol");n(mqi,"init");n(aq,"tokenize"),aq.scan=lqi;n(YFe,"find");n(qKs,"test")});var bqi={};di(bqi,{Link:()=>u5t,default:()=>u5t,isAllowedUri:()=>W1,pasteRegex:()=>vqi});function GKs(i){return i.length===1?i[0].isLink:i.length===3&&i[1].isLink?["()","[]"].includes(i[0].value+i[2].value):!1}function WKs(i){return new Ha({key:new Bc("autolink"),appendTransaction:n((e,t,s)=>{let r=e.some(d=>d.docChanged)&&!t.doc.eq(s.doc),a=e.some(d=>d.getMeta("preventAutolink"));if(!r||a)return;let{tr:o}=s,l=qBe(t.doc,[...e]);if(HBe(l).forEach(({newRange:d})=>{let h=UBe(s.doc,d,f=>f.isTextblock),u,p;if(h.length>1)u=h[0],p=s.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(h.length){let f=s.doc.textBetween(d.from,d.to," "," ");if(!HKs.test(f))return;u=h[0],p=s.doc.textBetween(u.pos,d.to,void 0," ")}if(u&&p){let f=p.split(UKs).filter(Boolean);if(f.length<=0)return!1;let g=f[f.length-1],m=u.pos+p.lastIndexOf(g);if(!g)return!1;let v=aq(g).map(b=>b.toObject(i.defaultProtocol));if(!GKs(v))return!1;v.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>s.schema.marks.code?!s.doc.rangeHasMark(b.from,b.to,s.schema.marks.code):!0).filter(b=>i.validate(b.value)).filter(b=>i.shouldAutoLink(b.value)).forEach(b=>{tq(b.from,b.to,s.doc).some(_=>_.mark.type===i.type)||o.addMark(b.from,b.to,i.type.create({href:b.href}))})}}),!!o.steps.length)return o},"appendTransaction")})}function jKs(i){return new Ha({key:new Bc("handleClickLink"),props:{handleClick:n((e,t,s)=>{var r,a;if(s.button!==0||!e.editable)return!1;let o=s.target,l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(p=>p.nodeName==="A"))return!1;let c=d0e(e.state,i.type.name),d=s.target,h=(r=d?.href)!==null&&r!==void 0?r:c.href,u=(a=d?.target)!==null&&a!==void 0?a:c.target;return d&&h?(window.open(h,u),!0):!1},"handleClick")}})}function KKs(i){return new Ha({key:new Bc("handlePasteLink"),props:{handlePaste:n((e,t,s)=>{let{state:r}=e,{selection:a}=r,{empty:o}=a;if(o)return!1;let l="";s.content.forEach(d=>{l+=d.textContent});let c=YFe(l,{defaultProtocol:i.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c?!1:i.editor.commands.setMark(i.type,{href:c.href})},"handlePaste")}})}function W1(i,e){let t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(s=>{let r=typeof s=="string"?s:s.scheme;r&&t.push(r)}),!i||i.replace(VKs,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var h5t,UKs,HKs,VKs,vqi,u5t,yqi=y(()=>{"use strict";xo();gqi();qwe();h5t="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",UKs=new RegExp(h5t),HKs=new RegExp(`${h5t}$`),VKs=new RegExp(h5t,"g");n(GKs,"isValidLinkStructure");n(WKs,"autolink");n(jKs,"clickHandler");n(KKs,"pasteHandler");vqi=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;n(W1,"isAllowedUri");u5t=Qh.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(i=>{if(typeof i=="string"){KFe(i);return}KFe(i.scheme,i.optionalSlashes)})},onDestroy(){d5t()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:n((i,e)=>!!W1(i,e.protocols),"isAllowedUri"),validate:n(i=>!!i,"validate"),shouldAutoLink:n(i=>!!i,"shouldAutoLink")}},addAttributes(){return{href:{default:null,parseHTML(i){return i.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n(i=>{let e=i.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n(t=>!!W1(t,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null},"getAttrs")}]},renderHTML({HTMLAttributes:i}){return this.options.isAllowedUri(i.href,{defaultValidate:n(e=>!!W1(e,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",gn(this.options.HTMLAttributes,i),0]:["a",gn(this.options.HTMLAttributes,{...i,href:""}),0]},addCommands(){return{setLink:n(i=>({chain:e})=>{let{href:t}=i;return this.options.isAllowedUri(t,{defaultValidate:n(s=>!!W1(s,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,i).setMeta("preventAutolink",!0).run():!1},"setLink"),toggleLink:n(i=>({chain:e})=>{let{href:t}=i;return this.options.isAllowedUri(t,{defaultValidate:n(s=>!!W1(s,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,i,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},"toggleLink"),unsetLink:n(()=>({chain:i})=>i().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),"unsetLink")}},addPasteRules(){return[Sm({find:n(i=>{let e=[];if(i){let{protocols:t,defaultProtocol:s}=this.options,r=YFe(i).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:n(o=>!!W1(o,t),"defaultValidate"),protocols:t,defaultProtocol:s}));r.length&&r.forEach(a=>e.push({text:a.value,data:{href:a.href},index:a.start}))}return e},"find"),type:this.type,getAttributes:n(i=>{var e;return{href:(e=i.data)===null||e===void 0?void 0:e.href}},"getAttributes")})]},addProseMirrorPlugins(){let i=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&i.push(WKs({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n(s=>this.options.isAllowedUri(s,{defaultValidate:n(r=>!!W1(r,e),"defaultValidate"),protocols:e,defaultProtocol:t}),"validate"),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&i.push(jKs({type:this.type})),this.options.linkOnPaste&&i.push(KKs({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),i}})});var _qi={};di(_qi,{Typography:()=>L5t,closeDoubleQuote:()=>g5t,closeSingleQuote:()=>b5t,copyright:()=>w5t,default:()=>L5t,ellipsis:()=>f5t,emDash:()=>p5t,laquo:()=>I5t,leftArrow:()=>y5t,multiplication:()=>M5t,notEqual:()=>E5t,oneHalf:()=>k5t,oneQuarter:()=>P5t,openDoubleQuote:()=>m5t,openSingleQuote:()=>v5t,plusMinus:()=>T5t,raquo:()=>R5t,registeredTrademark:()=>C5t,rightArrow:()=>_5t,servicemark:()=>S5t,superscriptThree:()=>O5t,superscriptTwo:()=>D5t,threeQuarters:()=>A5t,trademark:()=>x5t});var p5t,f5t,m5t,g5t,v5t,b5t,y5t,_5t,w5t,x5t,S5t,C5t,k5t,T5t,E5t,I5t,R5t,M5t,D5t,O5t,P5t,A5t,L5t,wqi=y(()=>{"use strict";xo();p5t=n(i=>wo({find:/--$/,replace:i??"\u2014"}),"emDash"),f5t=n(i=>wo({find:/\.\.\.$/,replace:i??"\u2026"}),"ellipsis"),m5t=n(i=>wo({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:i??"\u201C"}),"openDoubleQuote"),g5t=n(i=>wo({find:/"$/,replace:i??"\u201D"}),"closeDoubleQuote"),v5t=n(i=>wo({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:i??"\u2018"}),"openSingleQuote"),b5t=n(i=>wo({find:/'$/,replace:i??"\u2019"}),"closeSingleQuote"),y5t=n(i=>wo({find:/<-$/,replace:i??"\u2190"}),"leftArrow"),_5t=n(i=>wo({find:/->$/,replace:i??"\u2192"}),"rightArrow"),w5t=n(i=>wo({find:/\(c\)$/,replace:i??"\xA9"}),"copyright"),x5t=n(i=>wo({find:/\(tm\)$/,replace:i??"\u2122"}),"trademark"),S5t=n(i=>wo({find:/\(sm\)$/,replace:i??"\u2120"}),"servicemark"),C5t=n(i=>wo({find:/\(r\)$/,replace:i??"\xAE"}),"registeredTrademark"),k5t=n(i=>wo({find:/(?:^|\s)(1\/2)\s$/,replace:i??"\xBD"}),"oneHalf"),T5t=n(i=>wo({find:/\+\/-$/,replace:i??"\xB1"}),"plusMinus"),E5t=n(i=>wo({find:/!=$/,replace:i??"\u2260"}),"notEqual"),I5t=n(i=>wo({find:/<<$/,replace:i??"\xAB"}),"laquo"),R5t=n(i=>wo({find:/>>$/,replace:i??"\xBB"}),"raquo"),M5t=n(i=>wo({find:/\d+\s?([*x])\s?\d+$/,replace:i??"\xD7"}),"multiplication"),D5t=n(i=>wo({find:/\^2$/,replace:i??"\xB2"}),"superscriptTwo"),O5t=n(i=>wo({find:/\^3$/,replace:i??"\xB3"}),"superscriptThree"),P5t=n(i=>wo({find:/(?:^|\s)(1\/4)\s$/,replace:i??"\xBC"}),"oneQuarter"),A5t=n(i=>wo({find:/(?:^|\s)(3\/4)\s$/,replace:i??"\xBE"}),"threeQuarters"),L5t=Uo.create({name:"typography",addOptions(){return{closeDoubleQuote:"\u201D",closeSingleQuote:"\u2019",copyright:"\xA9",ellipsis:"\u2026",emDash:"\u2014",laquo:"\xAB",leftArrow:"\u2190",multiplication:"\xD7",notEqual:"\u2260",oneHalf:"\xBD",oneQuarter:"\xBC",openDoubleQuote:"\u201C",openSingleQuote:"\u2018",plusMinus:"\xB1",raquo:"\xBB",registeredTrademark:"\xAE",rightArrow:"\u2192",servicemark:"\u2120",superscriptThree:"\xB3",superscriptTwo:"\xB2",threeQuarters:"\xBE",trademark:"\u2122"}},addInputRules(){let i=[];return this.options.emDash!==!1&&i.push(p5t(this.options.emDash)),this.options.ellipsis!==!1&&i.push(f5t(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&i.push(m5t(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&i.push(g5t(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&i.push(v5t(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&i.push(b5t(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&i.push(y5t(this.options.leftArrow)),this.options.rightArrow!==!1&&i.push(_5t(this.options.rightArrow)),this.options.copyright!==!1&&i.push(w5t(this.options.copyright)),this.options.trademark!==!1&&i.push(x5t(this.options.trademark)),this.options.servicemark!==!1&&i.push(S5t(this.options.servicemark)),this.options.registeredTrademark!==!1&&i.push(C5t(this.options.registeredTrademark)),this.options.oneHalf!==!1&&i.push(k5t(this.options.oneHalf)),this.options.plusMinus!==!1&&i.push(T5t(this.options.plusMinus)),this.options.notEqual!==!1&&i.push(E5t(this.options.notEqual)),this.options.laquo!==!1&&i.push(I5t(this.options.laquo)),this.options.raquo!==!1&&i.push(R5t(this.options.raquo)),this.options.multiplication!==!1&&i.push(M5t(this.options.multiplication)),this.options.superscriptTwo!==!1&&i.push(D5t(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&i.push(O5t(this.options.superscriptThree)),this.options.oneQuarter!==!1&&i.push(P5t(this.options.oneQuarter)),this.options.threeQuarters!==!1&&i.push(A5t(this.options.threeQuarters)),i}})});var xqi,Sqi=y(()=>{"use strict";xqi="0.55.1"});var j1,oq,C0e,Cqi,QFe,N5t=y(()=>{"use strict";Sqi();j1={xterm:"6.0.0",xtermAddonFit:"0.11.0",xtermAddonSearch:"0.16.0",xtermAddonSerialize:"0.14.0",xtermAddonWebLinks:"0.12.0",highlightJs:"11.11.1",echarts:"5.6.0",tiptap:"2.27.2"},oq="https://cdn.jsdelivr.net/npm",C0e=n((i,e,t)=>`${oq}/@xterm/${i}@${e}/lib/${t}.mjs`,"xtermModuleUrl"),Cqi={xterm:C0e("xterm",j1.xterm,"xterm"),xtermAddonFit:C0e("addon-fit",j1.xtermAddonFit,"addon-fit"),xtermAddonSearch:C0e("addon-search",j1.xtermAddonSearch,"addon-search"),xtermAddonSerialize:C0e("addon-serialize",j1.xtermAddonSerialize,"addon-serialize"),xtermAddonWebLinks:C0e("addon-web-links",j1.xtermAddonWebLinks,"addon-web-links"),highlightJs:`${oq}/highlight.js@${j1.highlightJs}/+esm`,echarts:`${oq}/echarts@${j1.echarts}/dist/echarts.esm.min.js`},QFe=`${oq}/monaco-editor@${xqi}/min/vs`});var XFe,YKs,kqi,QKs,XKs,ZKs,JKs,Tqi,eYs,Ho,$5t=y(()=>{"use strict";N5t();XFe=n(i=>globalThis[i],"pageGlobal"),YKs=n((i,e)=>typeof i=="function"&&typeof e=="object"&&e!==null&&"ModuleManager"in e&&typeof e.ModuleManager=="function"&&"moduleManager"in i&&i.moduleManager instanceof e.ModuleManager,"isMonacoLoader"),kqi=n(()=>{let i=XFe("require");return YKs(i,XFe("AMDLoader"))?i:null},"monacoLoader"),QKs=n(()=>{let i=XFe("define");return typeof i=="function"&&"amd"in i},"pageRunsAmdLoader"),XKs=n(i=>{let e=kqi();return e?Promise.resolve(e):QKs()?Promise.reject(new Error(`Monaco's loader from ${i} cannot install beside the AMD loader this page already runs.`)):new Promise((t,s)=>{let r=document.createElement("script"),a=n(o=>{r.remove(),s(new Error(o))},"fail");r.src=i,r.onload=()=>{let o=kqi();o?t(o):a(`${i} is not Monaco's loader.`)},r.onerror=()=>a(`Monaco's loader did not load from ${i}.`),document.head.append(r)})},"installMonacoLoader"),ZKs=n((i,e)=>new Promise((t,s)=>{let r=n((a,o)=>{i.reset(),s(new Error(a,{cause:o}))},"fail");i(["vs/editor/editor.main"],()=>{let a=XFe("monaco");a?t(a):r(`${e}/editor/editor.main.js did not install Monaco.`)},a=>r(`Monaco did not load from ${e}.`,a))}),"requireMonacoApi"),JKs=n(async(i,e="default")=>{let t=await fetch(i,{cache:e});if(!t.ok)throw new Error(`${i} answered ${t.status}.`);return t.text()},"fetchText"),Tqi=n(i=>{let e=new URL(i,document.baseURI).href;return[...document.head.querySelectorAll('link[rel="stylesheet"]')].filter(t=>t.href===e)},"stylesheetLinksTo"),eYs=n(async(i,e)=>{let t=e?await new Promise(s=>{e.addEventListener("load",()=>s(!0),{once:!0}),e.addEventListener("error",()=>s(!1),{once:!0})}):!1;return JKs(i,t?"force-cache":"default")},"readMonacoStylesheet"),Ho=class i{static{n(this,"DeesServiceLibLoader")}static instance;xtermLib=null;xtermFitAddonLib=null;xtermSearchAddonLib=null;xtermSerializeAddonLib=null;xtermWebLinksAddonLib=null;highlightJsLib=null;lightweightChartsLib=null;echartsLib=null;tiptapLib=null;monacoLib=null;monacoBaseUrl=QFe;monacoBaseUrlBound=!1;xtermLoadingPromise=null;xtermFitAddonLoadingPromise=null;xtermSearchAddonLoadingPromise=null;xtermSerializeAddonLoadingPromise=null;xtermWebLinksAddonLoadingPromise=null;highlightJsLoadingPromise=null;lightweightChartsLoadingPromise=null;echartsLoadingPromise=null;tiptapLoadingPromise=null;monacoLoadingPromise=null;constructor(){}static getInstance(){return i.instance||(i.instance=new i),i.instance}shareLoad(e,t,s){let r=e();return s(r),r.catch(()=>{t()===r&&s(null)}),r}async loadXterm(){return this.xtermLib?this.xtermLib:this.xtermLoadingPromise?this.xtermLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(GIt(),f1i));return this.xtermLib??={Terminal:e.Terminal},this.xtermLib},()=>this.xtermLoadingPromise,e=>{this.xtermLoadingPromise=e})}provideXtermModules(e){this.xtermLib={Terminal:e.xterm.Terminal},e.fitAddon&&(this.xtermFitAddonLib={FitAddon:e.fitAddon.FitAddon}),e.searchAddon&&(this.xtermSearchAddonLib={SearchAddon:e.searchAddon.SearchAddon}),e.serializeAddon&&(this.xtermSerializeAddonLib={SerializeAddon:e.serializeAddon.SerializeAddon}),e.webLinksAddon&&(this.xtermWebLinksAddonLib={WebLinksAddon:e.webLinksAddon.WebLinksAddon})}async loadXtermFitAddon(){return this.xtermFitAddonLib?this.xtermFitAddonLib:this.xtermFitAddonLoadingPromise?this.xtermFitAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(WIt(),m1i));return this.xtermFitAddonLib??={FitAddon:e.FitAddon},this.xtermFitAddonLib},()=>this.xtermFitAddonLoadingPromise,e=>{this.xtermFitAddonLoadingPromise=e})}async loadXtermSearchAddon(){return this.xtermSearchAddonLib?this.xtermSearchAddonLib:this.xtermSearchAddonLoadingPromise?this.xtermSearchAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(q1i(),z1i));return this.xtermSearchAddonLib??={SearchAddon:e.SearchAddon},this.xtermSearchAddonLib},()=>this.xtermSearchAddonLoadingPromise,e=>{this.xtermSearchAddonLoadingPromise=e})}async loadXtermSerializeAddon(){return this.xtermSerializeAddonLib?this.xtermSerializeAddonLib:this.xtermSerializeAddonLoadingPromise?this.xtermSerializeAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(hRt(),W1i));return this.xtermSerializeAddonLib??={SerializeAddon:e.SerializeAddon},this.xtermSerializeAddonLib},()=>this.xtermSerializeAddonLoadingPromise,e=>{this.xtermSerializeAddonLoadingPromise=e})}async loadXtermWebLinksAddon(){return this.xtermWebLinksAddonLib?this.xtermWebLinksAddonLib:this.xtermWebLinksAddonLoadingPromise?this.xtermWebLinksAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(uRt(),j1i));return this.xtermWebLinksAddonLib??={WebLinksAddon:e.WebLinksAddon},this.xtermWebLinksAddonLib},()=>this.xtermWebLinksAddonLoadingPromise,e=>{this.xtermWebLinksAddonLoadingPromise=e})}provideHighlightJs(e){this.highlightJsLib=e,this.highlightJsLoadingPromise=null}async loadHighlightJs(){return this.highlightJsLib?this.highlightJsLib:this.highlightJsLoadingPromise?this.highlightJsLoadingPromise:this.shareLoad(async()=>{let{createBundledHighlightJs:e}=await Promise.resolve().then(()=>(hki(),dki));return this.highlightJsLib??=e(),this.highlightJsLib},()=>this.highlightJsLoadingPromise,e=>{this.highlightJsLoadingPromise=e})}async loadLightweightCharts(){return this.lightweightChartsLib?this.lightweightChartsLib:this.lightweightChartsLoadingPromise?this.lightweightChartsLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(FTi(),BTi));return this.lightweightChartsLib={createChart:e.createChart,createChartEx:e.createChartEx,defaultHorzScaleBehavior:e.defaultHorzScaleBehavior,AreaSeries:e.AreaSeries,LineSeries:e.LineSeries,ColorType:e.ColorType,LineType:e.LineType,CrosshairMode:e.CrosshairMode},this.lightweightChartsLib},()=>this.lightweightChartsLoadingPromise,e=>{this.lightweightChartsLoadingPromise=e})}async loadEcharts(){return this.echartsLib?this.echartsLib:this.echartsLoadingPromise?this.echartsLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(Jzi(),Zzi));return this.echartsLib={init:e.init,dispose:n(t=>{typeof t=="string"||t instanceof HTMLElement?e.dispose(t):t.dispose()},"dispose"),getInstanceByDom:e.getInstanceByDom},this.echartsLib},()=>this.echartsLoadingPromise,e=>{this.echartsLoadingPromise=e})}async loadTiptap(){return this.tiptapLib?this.tiptapLib:this.tiptapLoadingPromise?this.tiptapLoadingPromise:this.shareLoad(async()=>{let[e,t,s,r,a,o,l]=await Promise.all([Promise.resolve().then(()=>(xo(),i6i)),Promise.resolve().then(()=>(Y6i(),K6i)),Promise.resolve().then(()=>(D4t(),m6i)),Promise.resolve().then(()=>(X6i(),Q6i)),Promise.resolve().then(()=>(J6i(),Z6i)),Promise.resolve().then(()=>(yqi(),bqi)),Promise.resolve().then(()=>(wqi(),_qi))]);return this.tiptapLib={Editor:e.Editor,Node:e.Node,Extension:e.Extension,StarterKit:t.default||t.StarterKit,CodeBlock:s.default||s.CodeBlock,Underline:r.default||r.Underline,TextAlign:a.default||a.TextAlign,Link:o.default||o.Link,Typography:l.default||l.Typography},this.tiptapLib},()=>this.tiptapLoadingPromise,e=>{this.tiptapLoadingPromise=e})}provideMonacoBaseUrl(e){let t=e.replace(/\/+$/,"");if(t!==this.monacoBaseUrl&&(this.monacoBaseUrlBound||this.monacoLoadingPromise))throw new Error(`Monaco already loads from ${this.monacoBaseUrl}; provide its base URL before the first editor mounts.`);this.monacoBaseUrl=t}async loadMonaco(){return this.monacoLib?this.monacoLib:this.monacoLoadingPromise?this.monacoLoadingPromise:this.shareLoad(async()=>{let e=this.monacoBaseUrl,t=await XKs(`${e}/loader.js`);this.monacoBaseUrlBound=!0,t.config({paths:{vs:e}});let s=`${e}/editor/editor.main.css`,r=Tqi(s),a=await ZKs(t,e),o=Tqi(s).find(c=>!r.includes(c)),l=await eYs(s,o);return this.monacoLib={monaco:a,stylesheet:l},this.monacoLib},()=>this.monacoLoadingPromise,e=>{this.monacoLoadingPromise=e})}async preloadAll(){await Promise.all([this.loadXterm(),this.loadXtermFitAddon(),this.loadXtermSearchAddon(),this.loadXtermSerializeAddon(),this.loadXtermWebLinksAddon(),this.loadHighlightJs(),this.loadLightweightCharts(),this.loadEcharts(),this.loadTiptap()])}isLoaded(e){switch(e){case"xterm":return this.xtermLib!==null;case"xtermFitAddon":return this.xtermFitAddonLib!==null;case"xtermSearchAddon":return this.xtermSearchAddonLib!==null;case"xtermSerializeAddon":return this.xtermSerializeAddonLib!==null;case"xtermWebLinksAddon":return this.xtermWebLinksAddonLib!==null;case"highlightJs":return this.highlightJsLib!==null;case"lightweightCharts":return this.lightweightChartsLib!==null;case"echarts":return this.echartsLib!==null;case"tiptap":return this.tiptapLib!==null;case"monaco":return this.monacoLib!==null;default:return!1}}}});var i_=y(()=>{"use strict";$5t();N5t()});var Z0,au,w$l,x$l,S$l,LVi,NVi=y(()=>{"use strict";Je();IS();It();Z0=function(i,e,t,s,r,a){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}n(o,"accept");for(var l=s.kind,c=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&i?s.static?i:i.prototype:null,h=e||(d?Object.getOwnPropertyDescriptor(d,s.name):{}),u,p=!1,f=t.length-1;f>=0;f--){var g={};for(var m in s)g[m]=m==="access"?{}:s[m];for(var m in s.access)g.access[m]=s.access[m];g.addInitializer=function(b){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(b||null))};var v=(0,t[f])(l==="accessor"?{get:h.get,set:h.set}:h[c],g);if(l==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(u=o(v.get))&&(h.get=u),(u=o(v.set))&&(h.set=u),(u=o(v.init))&&r.unshift(u)}else(u=o(v))&&(l==="field"?r.unshift(u):h[c]=u)}d&&Object.defineProperty(d,s.name,h),p=!0},au=function(i,e,t){for(var s=arguments.length>2,r=0;r<e.length;r++)t=s?e[r].call(i,t):e[r].call(i);return s?t:void 0},w$l=(()=>{let i=[qe("demo-closeable-tabs")],e,t=[],s,r=rt,a,o=[],l=[],c,d=[],h=[];var u=class extends r{static{n(this,"DemoCloseableTabs")}static{s=this}static{let p=typeof Symbol=="function"&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[ue()],c=[ue()],Z0(this,null,a,{kind:"accessor",name:"tabs",static:!1,private:!1,access:{has:n(f=>"tabs"in f,"has"),get:n(f=>f.tabs,"get"),set:n((f,g)=>{f.tabs=g},"set")},metadata:p},o,l),Z0(this,null,c,{kind:"accessor",name:"tabCounter",static:!1,private:!1,access:{has:n(f=>"tabCounter"in f,"has"),get:n(f=>f.tabCounter,"get"),set:n((f,g)=>{f.tabCounter=g},"set")},metadata:p},d,h),Z0(null,e={value:s},i,{kind:"class",name:s.name,metadata:p},null,t),u=s=e.value,p&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:p})}#e=au(this,o,[{key:"Main",iconName:"lucide:home",action:n(()=>console.log("Main clicked"),"action")}]);get tabs(){return this.#e}set tabs(p){this.#e=p}#t=(au(this,l),au(this,d,0));get tabCounter(){return this.#t}set tabCounter(p){this.#t=p}static styles=[Oe`
4643
+ `,PKs="\uFE0F",AKs="\u200D",a5t="\uFFFC",WFe=null,jFe=null;n(LKs,"init$2");n(lqi,"run$1");n(cqi,"stringToArray");n(m2,"fastts");n(dqi,"decodeTlds");rq={defaultProtocol:"http",events:null,format:hqi,formatHref:hqi,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};n(_0e,"Options"),_0e.prototype={o:rq,ignoreTags:[],defaultRender(i){return i},check(i){return this.get("validate",i.toString(),i)},get(i,e,t){let s=e!=null,r=this.o[i];return r&&(typeof r=="object"?(r=t.t in r?r[t.t]:rq[i],typeof r=="function"&&s&&(r=r(e,t))):typeof r=="function"&&s&&(r=r(e,t.t,t)),r)},getObj(i,e,t){let s=this.o[i];return typeof s=="function"&&e!=null&&(s=s(e,t.t,t)),s},render(i){let e=i.render(this);return(this.get("render",null,i)||this.defaultRender)(e,i.t,i)}};n(hqi,"noop");NKs=Object.freeze({__proto__:null,Options:_0e,defaults:rq});n(w0e,"MultiToken"),w0e.prototype={isLink:!1,toString(){return this.v},toHref(i){return this.toString()},toFormattedString(i){let e=this.toString(),t=i.get("truncate",e,this),s=i.get("format",e,this);return t&&s.length>t?s.substring(0,t)+"\u2026":s},toFormattedHref(i){return i.get("formatHref",this.toHref(i.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(i=rq.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(i),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(i){return{type:this.t,value:this.toFormattedString(i),isLink:this.isLink,href:this.toFormattedHref(i),start:this.startIndex(),end:this.endIndex()}},validate(i){return i.get("validate",this.toString(),this)},render(i){let e=this,t=this.toHref(i.get("defaultProtocol")),s=i.get("formatHref",t,this),r=i.get("tagName",t,e),a=this.toFormattedString(i),o={},l=i.get("className",t,e),c=i.get("target",t,e),d=i.get("rel",t,e),h=i.getObj("attributes",t,e),u=i.getObj("events",t,e);return o.href=s,l&&(o.class=l),c&&(o.target=c),d&&(o.rel=d),h&&Object.assign(o,h),{tagName:r,attributes:o,content:a,eventListeners:u}}};n(nq,"createTokenClass");uqi=nq("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),o5t=nq("text"),pqi=nq("nl"),x0e=nq("url",{isLink:!0,toHref(i=rq.defaultProtocol){return this.hasProtocol()?this.v:`${i}://${this.v}`},hasProtocol(){let i=this.tk;return i.length>=2&&i[0].t!==f0e&&i[1].t===KN}}),fqi=Object.freeze({__proto__:null,Base:w0e,Email:uqi,MultiToken:w0e,Nl:pqi,Text:o5t,Url:x0e,createTokenClass:nq}),kb=n(i=>new of(i),"makeState");n($Ks,"init$1");n(BKs,"run");n(l5t,"initMultiToken");S0e=typeof console<"u"&&console&&console.warn||(()=>{}),c5t="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",vn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};n(d5t,"reset");n(FKs,"registerTokenPlugin");n(zKs,"registerPlugin");n(KFe,"registerCustomProtocol");n(mqi,"init");n(aq,"tokenize"),aq.scan=lqi;n(YFe,"find");n(qKs,"test")});var bqi={};di(bqi,{Link:()=>u5t,default:()=>u5t,isAllowedUri:()=>W1,pasteRegex:()=>vqi});function GKs(i){return i.length===1?i[0].isLink:i.length===3&&i[1].isLink?["()","[]"].includes(i[0].value+i[2].value):!1}function WKs(i){return new Ha({key:new Bc("autolink"),appendTransaction:n((e,t,s)=>{let r=e.some(d=>d.docChanged)&&!t.doc.eq(s.doc),a=e.some(d=>d.getMeta("preventAutolink"));if(!r||a)return;let{tr:o}=s,l=qBe(t.doc,[...e]);if(HBe(l).forEach(({newRange:d})=>{let h=UBe(s.doc,d,f=>f.isTextblock),u,p;if(h.length>1)u=h[0],p=s.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(h.length){let f=s.doc.textBetween(d.from,d.to," "," ");if(!HKs.test(f))return;u=h[0],p=s.doc.textBetween(u.pos,d.to,void 0," ")}if(u&&p){let f=p.split(UKs).filter(Boolean);if(f.length<=0)return!1;let g=f[f.length-1],m=u.pos+p.lastIndexOf(g);if(!g)return!1;let v=aq(g).map(b=>b.toObject(i.defaultProtocol));if(!GKs(v))return!1;v.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>s.schema.marks.code?!s.doc.rangeHasMark(b.from,b.to,s.schema.marks.code):!0).filter(b=>i.validate(b.value)).filter(b=>i.shouldAutoLink(b.value)).forEach(b=>{tq(b.from,b.to,s.doc).some(_=>_.mark.type===i.type)||o.addMark(b.from,b.to,i.type.create({href:b.href}))})}}),!!o.steps.length)return o},"appendTransaction")})}function jKs(i){return new Ha({key:new Bc("handleClickLink"),props:{handleClick:n((e,t,s)=>{var r,a;if(s.button!==0||!e.editable)return!1;let o=s.target,l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(p=>p.nodeName==="A"))return!1;let c=d0e(e.state,i.type.name),d=s.target,h=(r=d?.href)!==null&&r!==void 0?r:c.href,u=(a=d?.target)!==null&&a!==void 0?a:c.target;return d&&h?(window.open(h,u),!0):!1},"handleClick")}})}function KKs(i){return new Ha({key:new Bc("handlePasteLink"),props:{handlePaste:n((e,t,s)=>{let{state:r}=e,{selection:a}=r,{empty:o}=a;if(o)return!1;let l="";s.content.forEach(d=>{l+=d.textContent});let c=YFe(l,{defaultProtocol:i.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c?!1:i.editor.commands.setMark(i.type,{href:c.href})},"handlePaste")}})}function W1(i,e){let t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(s=>{let r=typeof s=="string"?s:s.scheme;r&&t.push(r)}),!i||i.replace(VKs,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var h5t,UKs,HKs,VKs,vqi,u5t,yqi=y(()=>{"use strict";xo();gqi();qwe();h5t="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",UKs=new RegExp(h5t),HKs=new RegExp(`${h5t}$`),VKs=new RegExp(h5t,"g");n(GKs,"isValidLinkStructure");n(WKs,"autolink");n(jKs,"clickHandler");n(KKs,"pasteHandler");vqi=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;n(W1,"isAllowedUri");u5t=Qh.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(i=>{if(typeof i=="string"){KFe(i);return}KFe(i.scheme,i.optionalSlashes)})},onDestroy(){d5t()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:n((i,e)=>!!W1(i,e.protocols),"isAllowedUri"),validate:n(i=>!!i,"validate"),shouldAutoLink:n(i=>!!i,"shouldAutoLink")}},addAttributes(){return{href:{default:null,parseHTML(i){return i.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n(i=>{let e=i.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n(t=>!!W1(t,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null},"getAttrs")}]},renderHTML({HTMLAttributes:i}){return this.options.isAllowedUri(i.href,{defaultValidate:n(e=>!!W1(e,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",gn(this.options.HTMLAttributes,i),0]:["a",gn(this.options.HTMLAttributes,{...i,href:""}),0]},addCommands(){return{setLink:n(i=>({chain:e})=>{let{href:t}=i;return this.options.isAllowedUri(t,{defaultValidate:n(s=>!!W1(s,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,i).setMeta("preventAutolink",!0).run():!1},"setLink"),toggleLink:n(i=>({chain:e})=>{let{href:t}=i;return this.options.isAllowedUri(t,{defaultValidate:n(s=>!!W1(s,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,i,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},"toggleLink"),unsetLink:n(()=>({chain:i})=>i().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),"unsetLink")}},addPasteRules(){return[Sm({find:n(i=>{let e=[];if(i){let{protocols:t,defaultProtocol:s}=this.options,r=YFe(i).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:n(o=>!!W1(o,t),"defaultValidate"),protocols:t,defaultProtocol:s}));r.length&&r.forEach(a=>e.push({text:a.value,data:{href:a.href},index:a.start}))}return e},"find"),type:this.type,getAttributes:n(i=>{var e;return{href:(e=i.data)===null||e===void 0?void 0:e.href}},"getAttributes")})]},addProseMirrorPlugins(){let i=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&i.push(WKs({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n(s=>this.options.isAllowedUri(s,{defaultValidate:n(r=>!!W1(r,e),"defaultValidate"),protocols:e,defaultProtocol:t}),"validate"),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&i.push(jKs({type:this.type})),this.options.linkOnPaste&&i.push(KKs({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),i}})});var _qi={};di(_qi,{Typography:()=>L5t,closeDoubleQuote:()=>g5t,closeSingleQuote:()=>b5t,copyright:()=>w5t,default:()=>L5t,ellipsis:()=>f5t,emDash:()=>p5t,laquo:()=>I5t,leftArrow:()=>y5t,multiplication:()=>M5t,notEqual:()=>E5t,oneHalf:()=>k5t,oneQuarter:()=>P5t,openDoubleQuote:()=>m5t,openSingleQuote:()=>v5t,plusMinus:()=>T5t,raquo:()=>R5t,registeredTrademark:()=>C5t,rightArrow:()=>_5t,servicemark:()=>S5t,superscriptThree:()=>O5t,superscriptTwo:()=>D5t,threeQuarters:()=>A5t,trademark:()=>x5t});var p5t,f5t,m5t,g5t,v5t,b5t,y5t,_5t,w5t,x5t,S5t,C5t,k5t,T5t,E5t,I5t,R5t,M5t,D5t,O5t,P5t,A5t,L5t,wqi=y(()=>{"use strict";xo();p5t=n(i=>wo({find:/--$/,replace:i??"\u2014"}),"emDash"),f5t=n(i=>wo({find:/\.\.\.$/,replace:i??"\u2026"}),"ellipsis"),m5t=n(i=>wo({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:i??"\u201C"}),"openDoubleQuote"),g5t=n(i=>wo({find:/"$/,replace:i??"\u201D"}),"closeDoubleQuote"),v5t=n(i=>wo({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:i??"\u2018"}),"openSingleQuote"),b5t=n(i=>wo({find:/'$/,replace:i??"\u2019"}),"closeSingleQuote"),y5t=n(i=>wo({find:/<-$/,replace:i??"\u2190"}),"leftArrow"),_5t=n(i=>wo({find:/->$/,replace:i??"\u2192"}),"rightArrow"),w5t=n(i=>wo({find:/\(c\)$/,replace:i??"\xA9"}),"copyright"),x5t=n(i=>wo({find:/\(tm\)$/,replace:i??"\u2122"}),"trademark"),S5t=n(i=>wo({find:/\(sm\)$/,replace:i??"\u2120"}),"servicemark"),C5t=n(i=>wo({find:/\(r\)$/,replace:i??"\xAE"}),"registeredTrademark"),k5t=n(i=>wo({find:/(?:^|\s)(1\/2)\s$/,replace:i??"\xBD"}),"oneHalf"),T5t=n(i=>wo({find:/\+\/-$/,replace:i??"\xB1"}),"plusMinus"),E5t=n(i=>wo({find:/!=$/,replace:i??"\u2260"}),"notEqual"),I5t=n(i=>wo({find:/<<$/,replace:i??"\xAB"}),"laquo"),R5t=n(i=>wo({find:/>>$/,replace:i??"\xBB"}),"raquo"),M5t=n(i=>wo({find:/\d+\s?([*x])\s?\d+$/,replace:i??"\xD7"}),"multiplication"),D5t=n(i=>wo({find:/\^2$/,replace:i??"\xB2"}),"superscriptTwo"),O5t=n(i=>wo({find:/\^3$/,replace:i??"\xB3"}),"superscriptThree"),P5t=n(i=>wo({find:/(?:^|\s)(1\/4)\s$/,replace:i??"\xBC"}),"oneQuarter"),A5t=n(i=>wo({find:/(?:^|\s)(3\/4)\s$/,replace:i??"\xBE"}),"threeQuarters"),L5t=Uo.create({name:"typography",addOptions(){return{closeDoubleQuote:"\u201D",closeSingleQuote:"\u2019",copyright:"\xA9",ellipsis:"\u2026",emDash:"\u2014",laquo:"\xAB",leftArrow:"\u2190",multiplication:"\xD7",notEqual:"\u2260",oneHalf:"\xBD",oneQuarter:"\xBC",openDoubleQuote:"\u201C",openSingleQuote:"\u2018",plusMinus:"\xB1",raquo:"\xBB",registeredTrademark:"\xAE",rightArrow:"\u2192",servicemark:"\u2120",superscriptThree:"\xB3",superscriptTwo:"\xB2",threeQuarters:"\xBE",trademark:"\u2122"}},addInputRules(){let i=[];return this.options.emDash!==!1&&i.push(p5t(this.options.emDash)),this.options.ellipsis!==!1&&i.push(f5t(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&i.push(m5t(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&i.push(g5t(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&i.push(v5t(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&i.push(b5t(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&i.push(y5t(this.options.leftArrow)),this.options.rightArrow!==!1&&i.push(_5t(this.options.rightArrow)),this.options.copyright!==!1&&i.push(w5t(this.options.copyright)),this.options.trademark!==!1&&i.push(x5t(this.options.trademark)),this.options.servicemark!==!1&&i.push(S5t(this.options.servicemark)),this.options.registeredTrademark!==!1&&i.push(C5t(this.options.registeredTrademark)),this.options.oneHalf!==!1&&i.push(k5t(this.options.oneHalf)),this.options.plusMinus!==!1&&i.push(T5t(this.options.plusMinus)),this.options.notEqual!==!1&&i.push(E5t(this.options.notEqual)),this.options.laquo!==!1&&i.push(I5t(this.options.laquo)),this.options.raquo!==!1&&i.push(R5t(this.options.raquo)),this.options.multiplication!==!1&&i.push(M5t(this.options.multiplication)),this.options.superscriptTwo!==!1&&i.push(D5t(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&i.push(O5t(this.options.superscriptThree)),this.options.oneQuarter!==!1&&i.push(P5t(this.options.oneQuarter)),this.options.threeQuarters!==!1&&i.push(A5t(this.options.threeQuarters)),i}})});var xqi,Sqi=y(()=>{"use strict";xqi="0.55.2"});var j1,oq,C0e,Cqi,QFe,N5t=y(()=>{"use strict";Sqi();j1={xterm:"6.0.0",xtermAddonFit:"0.11.0",xtermAddonSearch:"0.16.0",xtermAddonSerialize:"0.14.0",xtermAddonWebLinks:"0.12.0",highlightJs:"11.11.1",echarts:"5.6.0",tiptap:"2.27.2"},oq="https://cdn.jsdelivr.net/npm",C0e=n((i,e,t)=>`${oq}/@xterm/${i}@${e}/lib/${t}.mjs`,"xtermModuleUrl"),Cqi={xterm:C0e("xterm",j1.xterm,"xterm"),xtermAddonFit:C0e("addon-fit",j1.xtermAddonFit,"addon-fit"),xtermAddonSearch:C0e("addon-search",j1.xtermAddonSearch,"addon-search"),xtermAddonSerialize:C0e("addon-serialize",j1.xtermAddonSerialize,"addon-serialize"),xtermAddonWebLinks:C0e("addon-web-links",j1.xtermAddonWebLinks,"addon-web-links"),highlightJs:`${oq}/highlight.js@${j1.highlightJs}/+esm`,echarts:`${oq}/echarts@${j1.echarts}/dist/echarts.esm.min.js`},QFe=`${oq}/@design.estate/monaco-editor@${xqi}/min/vs`});var XFe,YKs,kqi,QKs,XKs,ZKs,JKs,Tqi,eYs,Ho,$5t=y(()=>{"use strict";N5t();XFe=n(i=>globalThis[i],"pageGlobal"),YKs=n((i,e)=>typeof i=="function"&&typeof e=="object"&&e!==null&&"ModuleManager"in e&&typeof e.ModuleManager=="function"&&"moduleManager"in i&&i.moduleManager instanceof e.ModuleManager,"isMonacoLoader"),kqi=n(()=>{let i=XFe("require");return YKs(i,XFe("AMDLoader"))?i:null},"monacoLoader"),QKs=n(()=>{let i=XFe("define");return typeof i=="function"&&"amd"in i},"pageRunsAmdLoader"),XKs=n(i=>{let e=kqi();return e?Promise.resolve(e):QKs()?Promise.reject(new Error(`Monaco's loader from ${i} cannot install beside the AMD loader this page already runs.`)):new Promise((t,s)=>{let r=document.createElement("script"),a=n(o=>{r.remove(),s(new Error(o))},"fail");r.src=i,r.onload=()=>{let o=kqi();o?t(o):a(`${i} is not Monaco's loader.`)},r.onerror=()=>a(`Monaco's loader did not load from ${i}.`),document.head.append(r)})},"installMonacoLoader"),ZKs=n((i,e)=>new Promise((t,s)=>{let r=n((a,o)=>{i.reset(),s(new Error(a,{cause:o}))},"fail");i(["vs/editor/editor.main"],()=>{let a=XFe("monaco");a?t(a):r(`${e}/editor/editor.main.js did not install Monaco.`)},a=>r(`Monaco did not load from ${e}.`,a))}),"requireMonacoApi"),JKs=n(async(i,e="default")=>{let t=await fetch(i,{cache:e});if(!t.ok)throw new Error(`${i} answered ${t.status}.`);return t.text()},"fetchText"),Tqi=n(i=>{let e=new URL(i,document.baseURI).href;return[...document.head.querySelectorAll('link[rel="stylesheet"]')].filter(t=>t.href===e)},"stylesheetLinksTo"),eYs=n(async(i,e)=>{let t=e?await new Promise(s=>{e.addEventListener("load",()=>s(!0),{once:!0}),e.addEventListener("error",()=>s(!1),{once:!0})}):!1;return JKs(i,t?"force-cache":"default")},"readMonacoStylesheet"),Ho=class i{static{n(this,"DeesServiceLibLoader")}static instance;xtermLib=null;xtermFitAddonLib=null;xtermSearchAddonLib=null;xtermSerializeAddonLib=null;xtermWebLinksAddonLib=null;highlightJsLib=null;lightweightChartsLib=null;echartsLib=null;tiptapLib=null;monacoLib=null;monacoBaseUrl=QFe;monacoBaseUrlBound=!1;xtermLoadingPromise=null;xtermFitAddonLoadingPromise=null;xtermSearchAddonLoadingPromise=null;xtermSerializeAddonLoadingPromise=null;xtermWebLinksAddonLoadingPromise=null;highlightJsLoadingPromise=null;lightweightChartsLoadingPromise=null;echartsLoadingPromise=null;tiptapLoadingPromise=null;monacoLoadingPromise=null;constructor(){}static getInstance(){return i.instance||(i.instance=new i),i.instance}shareLoad(e,t,s){let r=e();return s(r),r.catch(()=>{t()===r&&s(null)}),r}async loadXterm(){return this.xtermLib?this.xtermLib:this.xtermLoadingPromise?this.xtermLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(GIt(),f1i));return this.xtermLib??={Terminal:e.Terminal},this.xtermLib},()=>this.xtermLoadingPromise,e=>{this.xtermLoadingPromise=e})}provideXtermModules(e){this.xtermLib={Terminal:e.xterm.Terminal},e.fitAddon&&(this.xtermFitAddonLib={FitAddon:e.fitAddon.FitAddon}),e.searchAddon&&(this.xtermSearchAddonLib={SearchAddon:e.searchAddon.SearchAddon}),e.serializeAddon&&(this.xtermSerializeAddonLib={SerializeAddon:e.serializeAddon.SerializeAddon}),e.webLinksAddon&&(this.xtermWebLinksAddonLib={WebLinksAddon:e.webLinksAddon.WebLinksAddon})}async loadXtermFitAddon(){return this.xtermFitAddonLib?this.xtermFitAddonLib:this.xtermFitAddonLoadingPromise?this.xtermFitAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(WIt(),m1i));return this.xtermFitAddonLib??={FitAddon:e.FitAddon},this.xtermFitAddonLib},()=>this.xtermFitAddonLoadingPromise,e=>{this.xtermFitAddonLoadingPromise=e})}async loadXtermSearchAddon(){return this.xtermSearchAddonLib?this.xtermSearchAddonLib:this.xtermSearchAddonLoadingPromise?this.xtermSearchAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(q1i(),z1i));return this.xtermSearchAddonLib??={SearchAddon:e.SearchAddon},this.xtermSearchAddonLib},()=>this.xtermSearchAddonLoadingPromise,e=>{this.xtermSearchAddonLoadingPromise=e})}async loadXtermSerializeAddon(){return this.xtermSerializeAddonLib?this.xtermSerializeAddonLib:this.xtermSerializeAddonLoadingPromise?this.xtermSerializeAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(hRt(),W1i));return this.xtermSerializeAddonLib??={SerializeAddon:e.SerializeAddon},this.xtermSerializeAddonLib},()=>this.xtermSerializeAddonLoadingPromise,e=>{this.xtermSerializeAddonLoadingPromise=e})}async loadXtermWebLinksAddon(){return this.xtermWebLinksAddonLib?this.xtermWebLinksAddonLib:this.xtermWebLinksAddonLoadingPromise?this.xtermWebLinksAddonLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(uRt(),j1i));return this.xtermWebLinksAddonLib??={WebLinksAddon:e.WebLinksAddon},this.xtermWebLinksAddonLib},()=>this.xtermWebLinksAddonLoadingPromise,e=>{this.xtermWebLinksAddonLoadingPromise=e})}provideHighlightJs(e){this.highlightJsLib=e,this.highlightJsLoadingPromise=null}async loadHighlightJs(){return this.highlightJsLib?this.highlightJsLib:this.highlightJsLoadingPromise?this.highlightJsLoadingPromise:this.shareLoad(async()=>{let{createBundledHighlightJs:e}=await Promise.resolve().then(()=>(hki(),dki));return this.highlightJsLib??=e(),this.highlightJsLib},()=>this.highlightJsLoadingPromise,e=>{this.highlightJsLoadingPromise=e})}async loadLightweightCharts(){return this.lightweightChartsLib?this.lightweightChartsLib:this.lightweightChartsLoadingPromise?this.lightweightChartsLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(FTi(),BTi));return this.lightweightChartsLib={createChart:e.createChart,createChartEx:e.createChartEx,defaultHorzScaleBehavior:e.defaultHorzScaleBehavior,AreaSeries:e.AreaSeries,LineSeries:e.LineSeries,ColorType:e.ColorType,LineType:e.LineType,CrosshairMode:e.CrosshairMode},this.lightweightChartsLib},()=>this.lightweightChartsLoadingPromise,e=>{this.lightweightChartsLoadingPromise=e})}async loadEcharts(){return this.echartsLib?this.echartsLib:this.echartsLoadingPromise?this.echartsLoadingPromise:this.shareLoad(async()=>{let e=await Promise.resolve().then(()=>(Jzi(),Zzi));return this.echartsLib={init:e.init,dispose:n(t=>{typeof t=="string"||t instanceof HTMLElement?e.dispose(t):t.dispose()},"dispose"),getInstanceByDom:e.getInstanceByDom},this.echartsLib},()=>this.echartsLoadingPromise,e=>{this.echartsLoadingPromise=e})}async loadTiptap(){return this.tiptapLib?this.tiptapLib:this.tiptapLoadingPromise?this.tiptapLoadingPromise:this.shareLoad(async()=>{let[e,t,s,r,a,o,l]=await Promise.all([Promise.resolve().then(()=>(xo(),i6i)),Promise.resolve().then(()=>(Y6i(),K6i)),Promise.resolve().then(()=>(D4t(),m6i)),Promise.resolve().then(()=>(X6i(),Q6i)),Promise.resolve().then(()=>(J6i(),Z6i)),Promise.resolve().then(()=>(yqi(),bqi)),Promise.resolve().then(()=>(wqi(),_qi))]);return this.tiptapLib={Editor:e.Editor,Node:e.Node,Extension:e.Extension,StarterKit:t.default||t.StarterKit,CodeBlock:s.default||s.CodeBlock,Underline:r.default||r.Underline,TextAlign:a.default||a.TextAlign,Link:o.default||o.Link,Typography:l.default||l.Typography},this.tiptapLib},()=>this.tiptapLoadingPromise,e=>{this.tiptapLoadingPromise=e})}provideMonacoBaseUrl(e){let t=e.replace(/\/+$/,"");if(t!==this.monacoBaseUrl&&(this.monacoBaseUrlBound||this.monacoLoadingPromise))throw new Error(`Monaco already loads from ${this.monacoBaseUrl}; provide its base URL before the first editor mounts.`);this.monacoBaseUrl=t}async loadMonaco(){return this.monacoLib?this.monacoLib:this.monacoLoadingPromise?this.monacoLoadingPromise:this.shareLoad(async()=>{let e=this.monacoBaseUrl,t=await XKs(`${e}/loader.js`);this.monacoBaseUrlBound=!0,t.config({paths:{vs:e}});let s=`${e}/editor/editor.main.css`,r=Tqi(s),a=await ZKs(t,e),o=Tqi(s).find(c=>!r.includes(c)),l=await eYs(s,o);return this.monacoLib={monaco:a,stylesheet:l},this.monacoLib},()=>this.monacoLoadingPromise,e=>{this.monacoLoadingPromise=e})}async preloadAll(){await Promise.all([this.loadXterm(),this.loadXtermFitAddon(),this.loadXtermSearchAddon(),this.loadXtermSerializeAddon(),this.loadXtermWebLinksAddon(),this.loadHighlightJs(),this.loadLightweightCharts(),this.loadEcharts(),this.loadTiptap()])}isLoaded(e){switch(e){case"xterm":return this.xtermLib!==null;case"xtermFitAddon":return this.xtermFitAddonLib!==null;case"xtermSearchAddon":return this.xtermSearchAddonLib!==null;case"xtermSerializeAddon":return this.xtermSerializeAddonLib!==null;case"xtermWebLinksAddon":return this.xtermWebLinksAddonLib!==null;case"highlightJs":return this.highlightJsLib!==null;case"lightweightCharts":return this.lightweightChartsLib!==null;case"echarts":return this.echartsLib!==null;case"tiptap":return this.tiptapLib!==null;case"monaco":return this.monacoLib!==null;default:return!1}}}});var i_=y(()=>{"use strict";$5t();N5t()});var Z0,au,w$l,x$l,S$l,LVi,NVi=y(()=>{"use strict";Je();IS();It();Z0=function(i,e,t,s,r,a){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}n(o,"accept");for(var l=s.kind,c=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&i?s.static?i:i.prototype:null,h=e||(d?Object.getOwnPropertyDescriptor(d,s.name):{}),u,p=!1,f=t.length-1;f>=0;f--){var g={};for(var m in s)g[m]=m==="access"?{}:s[m];for(var m in s.access)g.access[m]=s.access[m];g.addInitializer=function(b){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(b||null))};var v=(0,t[f])(l==="accessor"?{get:h.get,set:h.set}:h[c],g);if(l==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(u=o(v.get))&&(h.get=u),(u=o(v.set))&&(h.set=u),(u=o(v.init))&&r.unshift(u)}else(u=o(v))&&(l==="field"?r.unshift(u):h[c]=u)}d&&Object.defineProperty(d,s.name,h),p=!0},au=function(i,e,t){for(var s=arguments.length>2,r=0;r<e.length;r++)t=s?e[r].call(i,t):e[r].call(i);return s?t:void 0},w$l=(()=>{let i=[qe("demo-closeable-tabs")],e,t=[],s,r=rt,a,o=[],l=[],c,d=[],h=[];var u=class extends r{static{n(this,"DemoCloseableTabs")}static{s=this}static{let p=typeof Symbol=="function"&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;a=[ue()],c=[ue()],Z0(this,null,a,{kind:"accessor",name:"tabs",static:!1,private:!1,access:{has:n(f=>"tabs"in f,"has"),get:n(f=>f.tabs,"get"),set:n((f,g)=>{f.tabs=g},"set")},metadata:p},o,l),Z0(this,null,c,{kind:"accessor",name:"tabCounter",static:!1,private:!1,access:{has:n(f=>"tabCounter"in f,"has"),get:n(f=>f.tabCounter,"get"),set:n((f,g)=>{f.tabCounter=g},"set")},metadata:p},d,h),Z0(null,e={value:s},i,{kind:"class",name:s.name,metadata:p},null,t),u=s=e.value,p&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:p})}#e=au(this,o,[{key:"Main",iconName:"lucide:home",action:n(()=>console.log("Main clicked"),"action")}]);get tabs(){return this.#e}set tabs(p){this.#e=p}#t=(au(this,l),au(this,d,0));get tabCounter(){return this.#t}set tabCounter(p){this.#t=p}static styles=[Oe`
4644
4644
  :host {
4645
4645
  display: block;
4646
4646
  }
@@ -44202,7 +44202,7 @@ html\`&lt;dees-button&gt;Click me&lt;/dees-button&gt;\`</code></pre>
44202
44202
  <h1>${this.t("markdownoutlet.heading")}</h1>
44203
44203
  <p>${this.t("markdownoutlet.empty")}</p>
44204
44204
  `:Qf(this.htmlText)}</div>
44205
- `}async updateHtmlText(d){this.htmlText=d,await this.updateComplete}constructor(){super(...arguments),q8t(this,l)}static{q8t(s,t)}};return c=s})();ES();Xl();It();Ph();Ui();IS();MSe();eo();var y3e={};di(y3e,{bright:()=>Crr,dark:()=>Srr});var Srr={blue:"#0050b9",blueActive:"#0069f2",blueMuted:"#012452",text:"#ffffff"},Crr={blue:"#0050b9",blueActive:"#0069f2",blueMuted:"#0069f2",text:"#333333"};var XKi={name:"@design.estate/dees-catalog",version:"23.4.0",description:"A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."};i_();var G8t={};di(G8t,{MpDeviceCode:()=>aYi,MpHarnessMark:()=>iYi,MpModelPicker:()=>lYi,MpProviderMark:()=>eYi,MpUsageMeters:()=>rYi,mpHarnesses:()=>U8t});Je();var ZKi=n(()=>C`
44205
+ `}async updateHtmlText(d){this.htmlText=d,await this.updateComplete}constructor(){super(...arguments),q8t(this,l)}static{q8t(s,t)}};return c=s})();ES();Xl();It();Ph();Ui();IS();MSe();eo();var y3e={};di(y3e,{bright:()=>Crr,dark:()=>Srr});var Srr={blue:"#0050b9",blueActive:"#0069f2",blueMuted:"#012452",text:"#ffffff"},Crr={blue:"#0050b9",blueActive:"#0069f2",blueMuted:"#0069f2",text:"#333333"};var XKi={name:"@design.estate/dees-catalog",version:"23.4.1",description:"A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."};i_();var G8t={};di(G8t,{MpDeviceCode:()=>aYi,MpHarnessMark:()=>iYi,MpModelPicker:()=>lYi,MpProviderMark:()=>eYi,MpUsageMeters:()=>rYi,mpHarnesses:()=>U8t});Je();var ZKi=n(()=>C`
44206
44206
  <div style="display: flex; gap: 16px; align-items: center; padding: 24px;">
44207
44207
  <mp-provider-mark provider="openai"></mp-provider-mark>
44208
44208
  <mp-provider-mark provider="anthropic"></mp-provider-mark>
@@ -47143,7 +47143,7 @@ description:
47143
47143
  `},"renderProjectsSettings");var{html:DB}=ge,_mr={claude:{name:"Claude Code",mark:"claude"},codex:{name:"Codex",mark:"codex"},opencode:{name:"OpenCode",mark:"opencode"},flex:{name:"Flex",mark:"flex"}},lhs=n(i=>{let e=i?Date.parse(i):Number.NaN;return Number.isFinite(e)?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""},"clock"),wmr=n(i=>{let e=i.files.filter(s=>s.kind!=="unchanged").length,t=n(s=>`${s} ${s===1?"file differs":"files differ"}`,"files");switch(i.state){case"in_sync":return{pill:"In sync",tone:"success",review:!1,text:i.targetId==="flex"?"The next Flex run picks up the latest projection.":"Its files match the latest projection."};case"changes_pending":return{pill:"Changes pending",tone:"warning",review:!0,text:e?`${t(e)} from the latest projection.`:"The latest projection is not applied yet."};case"drifted":return{pill:"Edited outside AGL",tone:"warning",review:!0,text:i.externallyEditedFiles?.length?`${i.externallyEditedFiles.join(", ")} ${i.externallyEditedFiles.length===1?"was":"were"} edited outside AGL.`:"Its files were edited outside AGL."};case"blocked":return{pill:"Blocked",tone:"error",review:!0,text:i.diagnostics.find(s=>s.severity==="error")?.message??"The latest projection cannot be applied to it as it is."};case"applying":return{pill:"Applying",tone:"primary",review:!1,text:"An apply is under way."};case"unbound":return{pill:"Not connected",tone:"default",review:!0,text:"AGL does not write its home yet; connect it in the configuration."}}},"configurationHarnessView"),chs=n((i,e)=>{let s=(i.state==="read"?i.configuration:null)?.projection,r=[{rows:[{key:"open",icon:"lucide:Files",label:"One master configuration for every harness",description:"Instructions, drivers, inference, skills, agents, commands, MCP servers and command policy. Flex projects it onto each harness; you review and apply each one's changes.",control:DB`<dees-button class="settingsConfigurationOpen" data-action="openConfiguration" size="sm" type="accent"
47144
47144
  text="Open configuration" @clicked=${()=>e.open()}></dees-button>`}]},{header:"Harnesses",headerSuffix:DB`<span>${s?lhs(s.createdAt)?`Projected ${lhs(s.createdAt)}`:"Projected":i.state==="read"?"Not projected yet":""}</span>`,footer:"Read when this section opens. Routing through the AGL proxy is set under Inference in the configuration; from a terminal, agl config does the same.",rows:i.state==="read"?i.configuration.harnesses.map(a=>{let o=wmr(a),l=_mr[a.targetId];return{key:`harness-${a.targetId}`,leading:DB`<mp-harness-mark .harness=${l.mark}></mp-harness-mark>`,label:l.name,description:o.text,accessory:DB`<dees-badge data-harness-state=${a.state} .type=${o.tone} .text=${o.pill}></dees-badge>`,...o.review?{control:DB`<dees-button class="settingsConfigurationReview" data-harness=${a.targetId}
47145
47145
  size="sm" type="ghost" text="Review" @clicked=${()=>e.review(a.targetId)}></dees-button>`}:{}}}):[{key:"harnesses",label:i.state==="failed"?"The harnesses could not be read":"Reading the harnesses\u2026",...i.state==="failed"?{description:i.message,control:DB`<dees-button class="settingsConfigurationReread" size="sm" type="ghost" text="Read again"
47146
- @clicked=${()=>e.reread()}></dees-button>`}:{}}]}];return DB`<dees-grouped-list class="settingsConfiguration" .inset=${!1} .sections=${r}></dees-grouped-list>`},"renderConfigurationSettings");var D1e={name:"agl",version:"42.2.1",description:"Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions"};U2e();var hhs="agl",dhs={handoff:"agl.auth.handoff",bundleReload:"agl.bundle.reload"},xmr=5e3,Smr=1e3,Cmr=2e4,qGt=n(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"isRecord"),UGt=n(i=>typeof i=="string"&&i.length>0&&i.length<=256,"isShortString"),mqe=class{constructor(e){this.options=e;let{comms:t}=e;this.subscriptions.push(t.subscribe("signedIn",()=>e.onSignedIn()),t.subscribe("signedOut",()=>e.onSignedOut()),t.subscribe("layout",s=>this.receiveLayout(s)),t.subscribe("bundleReloaded",s=>this.receiveBundleOutcome(s)))}options;static{n(this,"ControllerTabSync")}subscriptions=[];pendingHandoffs=new Set;pendingReloads=new Map;handoffLease;handoffHandlerRemoved=Promise.resolve();releaseReloadLease;closed=!1;setAuthenticated(e){if(this.closed)return;if(!e){this.endHandoffLease();return}if(this.handoffLease)return;let t,s=new Promise(o=>{t=o}),r={abort:new AbortController,granted:s,grant:t};this.handoffLease=r;let{locks:a}=this.options;if(!a){this.answerHandoffs(r);return}a.request(dhs.handoff,{signal:r.abort.signal},()=>new Promise(o=>{if(this.handoffLease!==r){o();return}r.release=o,this.answerHandoffs(r)})).catch(()=>{})}async announceSignedIn(){this.setAuthenticated(!0);let e=this.handoffLease;if(e){let t;await Promise.race([e.granted,new Promise(s=>{t=setTimeout(s,Smr)})]),clearTimeout(t)}await this.send("signedIn",{})}announceSignedOut(){this.send("signedOut",{})}publishLayout(e){this.send("layout",e)}async requestHandoff(e=xmr){if(this.closed)return;let t=new AbortController;this.pendingHandoffs.add(t);try{let s=await this.options.comms.createTypedRequest("handoff").fire({},{timeoutMs:e,abortSignal:t.signal});return qGt(s)&&UGt(s.resumeToken)?s.resumeToken:void 0}catch{return}finally{this.pendingHandoffs.delete(t)}}coordinateBundleReload(e,t=Cmr){let{locks:s}=this.options;return this.closed||!s||this.releaseReloadLease?Promise.resolve("lead"):new Promise(r=>{s.request(dhs.bundleReload,{ifAvailable:!0},async a=>{if(a){if(r("lead"),this.closed)return;await new Promise(o=>{this.releaseReloadLease=o});return}r(await this.awaitBundleOutcome(e,t))}).catch(()=>r("lead"))})}releaseBundleReloadLead(){this.releaseReloadLease?.(),this.releaseReloadLease=void 0}announceBundleOutcome(e,t){this.send("bundleReloaded",{version:e,outcome:t})}async close(){if(!this.closed){this.closed=!0;for(let e of this.subscriptions.splice(0))e.unsubscribe();for(let e of[...this.pendingHandoffs])e.abort();for(let e of[...this.pendingReloads.values()])for(let t of[...e])t("timeout");this.endHandoffLease(),this.releaseBundleReloadLead(),await this.options.comms.close()}}endHandoffLease(){let e=this.handoffLease;this.handoffLease=void 0,e&&(e.abort.abort(),e.handler&&(this.handoffHandlerRemoved=e.handler.then(t=>t?.remove())),e.release?.())}answerHandoffs(e){e.handler=this.handoffHandlerRemoved.then(()=>this.handoffLease===e?this.options.comms.createTypedHandler("handoff",()=>this.answerHandoff(e)):void 0).catch(()=>{}),e.handler.then(()=>e.grant())}async send(e,t){if(this.closed)return!1;try{return await this.options.comms.broadcast(e,t),!0}catch{return!1}}async answerHandoff(e){let t;if(this.handoffLease===e)try{t=await this.options.mintHandoff()}catch{t=void 0}if(this.handoffLease!==e||!UGt(t))throw new Zm.TypedResponseError("handoff_unavailable");return{resumeToken:t}}receiveLayout(e){if(!qGt(e))return;let t={};typeof e.sidebarWidth=="number"&&Number.isFinite(e.sidebarWidth)&&(t.sidebarWidth=e.sidebarWidth),typeof e.browserSidebarVisible=="boolean"&&(t.browserSidebarVisible=e.browserSidebarVisible),(e.browserPresentation==="default"||e.browserPresentation==="paint"||e.browserPresentation==="video")&&(t.browserPresentation=e.browserPresentation),(e.paintRendering==="gpu"||e.paintRendering==="software")&&(t.paintRendering=e.paintRendering),Object.keys(t).length>0&&this.options.onLayout(t)}awaitBundleOutcome(e,t){return this.closed?Promise.resolve("timeout"):new Promise(s=>{let r=this.pendingReloads.get(e);r||(r=new Set,this.pendingReloads.set(e,r));let a=n(l=>{clearTimeout(o),r.delete(a),r.size===0&&this.pendingReloads.get(e)===r&&this.pendingReloads.delete(e),s(l)},"finish"),o=setTimeout(()=>a("timeout"),t);r.add(a)})}receiveBundleOutcome(e){if(!qGt(e)||!UGt(e.version)||e.outcome!=="current"&&e.outcome!=="stale")return;let t=e.outcome;for(let s of[...this.pendingReloads.get(e.version)??[]])s(t)}};var uhs=n((i,e,t)=>{let{statuses:s,finished:r,errors:a,optimistic:o}=i;if(t.sessionError===!0){s.set(e,"error"),a.add(e),r.delete(e),o.delete(e);return}let l=t.sessionStatus;if(l===void 0)return;let c=s.get(e),d=c==="busy"||c==="retry"||o.has(e);s.set(e,l),l==="busy"||l==="retry"?(a.delete(e),r.delete(e),o.delete(e)):l==="idle"?(o.delete(e),d&&!a.has(e)&&r.add(e)):(a.add(e),r.delete(e),o.delete(e))},"applySessionCardEvent");var kmr=4,phs=n(async(i,e)=>{e.throwIfAborted();let t;try{return await Promise.race([i(),new Promise((s,r)=>{t=n(()=>r(e.reason),"onAbort"),e.addEventListener("abort",t,{once:!0})})])}finally{t&&e.removeEventListener("abort",t)}},"settleWithin"),Tmr=n((i,e,t)=>phs(()=>i.send(e),t),"sendWithin"),Emr=n(i=>{if(i instanceof is.TypedResponseError){let t=i.errorData?.code;if(t==="paint_unavailable"||t==="paint_capture_unavailable")return{kind:"paint-refused",code:t,message:i.errorText}}let e=g1e(i);return e===void 0?void 0:{kind:"viewer-cannot-render",failure:e}},"paintOpenFallback"),O1e=class{constructor(e){this.options=e;this.switcher=new SB({surface:e.surface,capture:n(()=>this.renderer instanceof zb?e.canvas:this.renderer?e.video:void 0,"capture"),open:n((t,s)=>t==="paint"?this.openPaint(s):this.openVideo(s),"open"),onError:n(t=>e.onError("Show the browser view",t),"onError")})}options;static{n(this,"ControllerBrowserPresentation")}switcher;renderer;paint;paintOpening=!1;pendingVideoRoutes=[];audio;closed=!1;currentChoice;get mode(){return this.switcher.mode}get choice(){return this.currentChoice}static initialChoice(e,t,s){let r=t==="default"?"controller":"device",a=t==="default"?e:t;return a==="paint"&&s?.paint.state==="unavailable"?{requested:a,reason:{source:r,fallback:{kind:"paint-unavailable",paint:s.paint}}}:{requested:a,reason:{source:r}}}async start(e,t){await this.present(e,t)}async switchTo(e,t){await this.present({requested:e,reason:{source:"view"}},t)}async present(e,t){if(this.closed)return;this.setChoice(e);let s=e.reason.fallback?"video":e.requested;try{await this.switcher.switchTo(s,t)}catch(r){if(this.closed||t?.aborted||s!=="paint")throw r;let a=Emr(r);if(a===void 0)throw r;this.setChoice({requested:e.requested,reason:{...e.reason,fallback:a}}),await this.switcher.switchTo("video",t)}}fallBackToVideo(e){let t=this.currentChoice;this.closed||!t||(this.setChoice({requested:t.requested,reason:{...t.reason,fallback:e}}),this.switcher.switchTo("video").catch(s=>this.options.onError("Show the browser view",s)))}setChoice(e){this.currentChoice=e,this.options.onChoice(e)}async activateSound(){let e=this.renderer;if(!e)throw new Error("The browser view shows nothing yet.");await e.activateAudio()}get soundAvailable(){return this.options.presentation()?.audio.state==="available"}handlePaintTermination(e){let t=this.paint;!t||t.response.paintId!==e.paintId||t.presenter.terminateFromControl(e.source,e.termination)}handleVideoRouteRequest(e){let t=this.paint;if(t&&t.response.paintId===e.paintId){this.openVideoRoute(t,e.routeId).catch(s=>{this.paint===t&&this.options.onError("Show the browser view's video",s)});return}this.paintOpening&&this.pendingVideoRoutes.length<kmr&&this.pendingVideoRoutes.push({paintId:e.paintId,routeId:e.routeId})}async close(){if(this.closed)return;this.closed=!0,this.pendingVideoRoutes.length=0;let e=await Promise.allSettled([this.switcher.close()]),t=this.audio;this.audio=void 0;let s=await Promise.allSettled([t?.dispose()]),r=[...e,...s].flatMap(a=>a.status==="rejected"?[a.reason]:[]);if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Browser presentation cleanup is incomplete.")}async openVideo(e){let t=await this.audioLifecycle();e.throwIfAborted();let s=new BC({video:this.options.video,client:this.options.client,...t===void 0?{}:{audio:t},focusTarget:this.options.surface,resizeTarget:this.options.surface,onError:n(r=>this.options.onRendererError(r),"onError")});this.setRenderer(s);try{await this.options.startRenderer(s)}catch(r){throw await this.options.stopRenderer(s),this.clearRenderer(s),r}return{firstFrame:s.firstFrame,stop:n(async()=>{try{await this.options.stopRenderer(s)}finally{this.clearRenderer(s)}},"stop")}}async openPaint(e){let t=await this.options.assets(),s=await this.audioLifecycle();e.throwIfAborted();let r=new zb({canvas:this.options.canvas,client:this.options.client,...s===void 0?{}:{audio:s},focusTarget:this.options.surface,resizeTarget:this.options.surface,picture:{...MU,...t.paint,...fas(this.options.paintRendering())},originalVideo:d1e,onError:n(o=>{g1e(o.cause)===void 0&&this.options.onRendererError(o)},"onError")});this.setRenderer(r),this.paintOpening=!0;let a;try{await this.options.startRenderer(r);let o=r.pictureRenderer?.videoWorkerIncarnation;if(!o)throw new Error("The Paint renderer has no worker.");a=await this.options.socket.fire("controller.browser.paint.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,workerIncarnation:o},{maxRetries:0,abortSignal:e});let l=a;await phs(()=>Promise.all([l.packets.opened,l.control.opened]),e);let c=new AbortController,d=new hB({expectedHello:l.hello,renderer:r,sendPacket:n((u,p)=>Tmr(l.control,u,p),"sendPacket"),closeSource:n(()=>this.closePaintSource(l),"closeSource"),onFailure:n(u=>{g1e(u)===void 0&&this.options.onError("Run the browser Paint view",u)},"onFailure"),onTermination:n(u=>this.onPaintTermination(l.paintId,u),"onTermination"),signal:c.signal}),h={response:l,presenter:d,renderer:r,routes:new Set,abortController:c,removeSessionEnd:r.observePaintSessionEnd(u=>{this.closeVideoRoutes(h),this.onPaintSessionEnd(h,u)})};this.paint=h,this.receivePaintPackets(h);for(let u of this.pendingVideoRoutes.splice(0))u.paintId===l.paintId&&this.openVideoRoute(h,u.routeId).catch(p=>{this.paint===h&&this.options.onError("Show the browser view's video",p)});return{firstFrame:r.firstFrame,stop:n(()=>this.stopPaint(h),"stop")}}catch(o){throw a&&await this.closePaintSource(a).catch(()=>{}),await r.stop().catch(()=>{}),this.clearRenderer(r),o}finally{this.paintOpening=!1,this.pendingVideoRoutes.length=0}}async receivePaintPackets(e){try{for(;!e.abortController.signal.aborted;){let t=await e.response.packets.receive();if(t===void 0){await e.response.packets.accept();return}e.presenter.receivePacket(t)}}catch(t){if(this.paint!==e||e.abortController.signal.aborted)return;this.options.onError("Run the browser Paint view",t),await this.stopPaint(e).catch(()=>{})}}onPaintTermination(e,t){this.paint?.response.paintId!==e||this.closed||(t.kind==="unsupported"?this.fallBackToVideo({kind:"page-unsupported",reasonCode:t.reasonCode}):t.kind==="failure"&&this.options.onError("Run the browser Paint view",new Error(t.message)))}onPaintSessionEnd(e,t){if(this.paint!==e||this.closed||t===void 0)return;let s=g1e(t);s!==void 0&&this.fallBackToVideo({kind:"viewer-cannot-render",failure:s})}async stopPaint(e){e.abortController.abort(new Error("The Paint stream closed.")),e.removeSessionEnd(),this.closeVideoRoutes(e);try{await e.presenter.close()}finally{this.paint===e&&(this.paint=void 0),this.clearRenderer(e.renderer)}}async closePaintSource(e){let t=new Error("The Paint stream closed.");await Promise.allSettled([e.packets.abort(t),e.control.abort(t)]),this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.paint.close",{viewId:this.options.viewId,paintId:e.paintId,streamGeneration:this.options.streamGeneration},{maxRetries:0})}async openVideoRoute(e,t){let s=e.renderer.pictureRenderer;if(!s)throw new Error("The Paint renderer has no worker.");let r=await this.options.socket.fire("controller.browser.paint.video.openRoute",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,paintId:e.response.paintId,routeId:t},{maxRetries:0,abortSignal:e.abortController.signal}),a=new xB({...c1e,routeId:r.routeId,packets:r.packets,receipts:r.receipts,renderer:s,signal:e.abortController.signal,onEnded:n(()=>{e.routes.delete(a)},"onEnded"),onFailure:n(o=>{e.routes.delete(a),this.options.onError("Show the browser view's video",o)},"onFailure")});e.routes.add(a);try{await a.start()}catch(o){throw e.routes.delete(a),o}}closeVideoRoutes(e){for(let t of e.routes)t.close().catch(s=>this.options.onError("Close the browser view's video",s));e.routes.clear()}async audioLifecycle(){if(this.options.presentation()?.audio.state!=="available")return;if(this.audio)return this.audio;let e=await this.options.assets();if(this.audio)return this.audio;let t={openAudioRelay:n(s=>this.openAudioRelay(s),"openAudioRelay")};return this.audio=new gB({viewerId:this.options.viewId,client:new vB(t),assets:e.audio,sampleCreditBytes:e.audioSampleCredit.bytes,sampleCreditEvents:e.audioSampleCredit.events,clockPolicy:a1e,onError:n(s=>this.options.onError("Play the browser sound",s),"onError")}),this.audio}async openAudioRelay(e){let t=await this.options.socket.fire("controller.browser.audio.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration},{maxRetries:0,abortSignal:e.signal}),r=await new yB({events:t.events,operations:t.operations,sampleCreditBytes:t.sampleCredit.bytes,sampleCreditEvents:t.sampleCredit.events,signal:e.signal}).openAudioRelay(e);return{sendCommand:n(a=>r.sendCommand(a),"sendCommand"),close:n(async()=>{try{await r.close()}finally{this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.audio.close",{viewId:this.options.viewId,audioId:t.audioId,streamGeneration:this.options.streamGeneration},{maxRetries:0}).catch(()=>{})}},"close")}}setRenderer(e){this.renderer=e,this.options.surface.dataset.presentation=e instanceof zb?"paint":"video",this.options.onRenderer(e)}clearRenderer(e){this.renderer===e&&(this.renderer=void 0,this.options.onRenderer(void 0))}};var HGt=n((i,e,t)=>`${i}:${e}\0${t}`,"projectMutationScope"),fhs=n((i,e)=>HGt("draft",i,`${e}`),"draftScopeOf"),mhs=n((i,e)=>HGt("conversation",i,e),"conversationScopeOf"),gqe=class{constructor(e){this.onChange=e}onChange;static{n(this,"ControllerMutationLocks")}held=new Map;startedCount=0;get started(){return this.startedCount}get anyHeld(){return this.held.size>0}isHeld(e){return this.held.has(e)}isProjectHeld(e){let t=["draft","conversation"].map(s=>HGt(s,e,""));return[...this.held.keys()].some(s=>t.some(r=>s.startsWith(r)))}holds(e){return[...this.held.values()].includes(e)}acquire(e){if(this.held.has(e))return;let t=Symbol(e);return this.held.set(e,t),this.startedCount+=1,this.onChange(),t}release(e){for(let[t,s]of this.held)if(s===e)return this.held.delete(t),this.onChange(),!0;return!1}releaseAll(){this.held.size!==0&&(this.held.clear(),this.onChange())}};var vTc=50,ghs=n((i,e)=>[...i,e].slice(-50),"appendErrorJournalEntry"),VGt=n(i=>Number.isFinite(i)?new Date(i).toISOString():"unknown","formatTimestamp"),Imr=n((i,e)=>{let t=[`[${e}] ${VGt(i.at)} - ${i.operation}`,`message: ${i.message}`];i.reference!==void 0&&t.push(`reference: ${i.reference}`);let s=i.detail;return s!==void 0?(t.push(`controller operation: ${s.operation}`,`controller time: ${VGt(s.at)}`,`controller cause: ${s.name}: ${s.message}`),s.stack&&t.push("controller stack:",s.stack)):i.reference!==void 0&&t.push("controller cause: unavailable"),t.join(`
47146
+ @clicked=${()=>e.reread()}></dees-button>`}:{}}]}];return DB`<dees-grouped-list class="settingsConfiguration" .inset=${!1} .sections=${r}></dees-grouped-list>`},"renderConfigurationSettings");var D1e={name:"agl",version:"42.2.2",description:"Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions"};U2e();var hhs="agl",dhs={handoff:"agl.auth.handoff",bundleReload:"agl.bundle.reload"},xmr=5e3,Smr=1e3,Cmr=2e4,qGt=n(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"isRecord"),UGt=n(i=>typeof i=="string"&&i.length>0&&i.length<=256,"isShortString"),mqe=class{constructor(e){this.options=e;let{comms:t}=e;this.subscriptions.push(t.subscribe("signedIn",()=>e.onSignedIn()),t.subscribe("signedOut",()=>e.onSignedOut()),t.subscribe("layout",s=>this.receiveLayout(s)),t.subscribe("bundleReloaded",s=>this.receiveBundleOutcome(s)))}options;static{n(this,"ControllerTabSync")}subscriptions=[];pendingHandoffs=new Set;pendingReloads=new Map;handoffLease;handoffHandlerRemoved=Promise.resolve();releaseReloadLease;closed=!1;setAuthenticated(e){if(this.closed)return;if(!e){this.endHandoffLease();return}if(this.handoffLease)return;let t,s=new Promise(o=>{t=o}),r={abort:new AbortController,granted:s,grant:t};this.handoffLease=r;let{locks:a}=this.options;if(!a){this.answerHandoffs(r);return}a.request(dhs.handoff,{signal:r.abort.signal},()=>new Promise(o=>{if(this.handoffLease!==r){o();return}r.release=o,this.answerHandoffs(r)})).catch(()=>{})}async announceSignedIn(){this.setAuthenticated(!0);let e=this.handoffLease;if(e){let t;await Promise.race([e.granted,new Promise(s=>{t=setTimeout(s,Smr)})]),clearTimeout(t)}await this.send("signedIn",{})}announceSignedOut(){this.send("signedOut",{})}publishLayout(e){this.send("layout",e)}async requestHandoff(e=xmr){if(this.closed)return;let t=new AbortController;this.pendingHandoffs.add(t);try{let s=await this.options.comms.createTypedRequest("handoff").fire({},{timeoutMs:e,abortSignal:t.signal});return qGt(s)&&UGt(s.resumeToken)?s.resumeToken:void 0}catch{return}finally{this.pendingHandoffs.delete(t)}}coordinateBundleReload(e,t=Cmr){let{locks:s}=this.options;return this.closed||!s||this.releaseReloadLease?Promise.resolve("lead"):new Promise(r=>{s.request(dhs.bundleReload,{ifAvailable:!0},async a=>{if(a){if(r("lead"),this.closed)return;await new Promise(o=>{this.releaseReloadLease=o});return}r(await this.awaitBundleOutcome(e,t))}).catch(()=>r("lead"))})}releaseBundleReloadLead(){this.releaseReloadLease?.(),this.releaseReloadLease=void 0}announceBundleOutcome(e,t){this.send("bundleReloaded",{version:e,outcome:t})}async close(){if(!this.closed){this.closed=!0;for(let e of this.subscriptions.splice(0))e.unsubscribe();for(let e of[...this.pendingHandoffs])e.abort();for(let e of[...this.pendingReloads.values()])for(let t of[...e])t("timeout");this.endHandoffLease(),this.releaseBundleReloadLead(),await this.options.comms.close()}}endHandoffLease(){let e=this.handoffLease;this.handoffLease=void 0,e&&(e.abort.abort(),e.handler&&(this.handoffHandlerRemoved=e.handler.then(t=>t?.remove())),e.release?.())}answerHandoffs(e){e.handler=this.handoffHandlerRemoved.then(()=>this.handoffLease===e?this.options.comms.createTypedHandler("handoff",()=>this.answerHandoff(e)):void 0).catch(()=>{}),e.handler.then(()=>e.grant())}async send(e,t){if(this.closed)return!1;try{return await this.options.comms.broadcast(e,t),!0}catch{return!1}}async answerHandoff(e){let t;if(this.handoffLease===e)try{t=await this.options.mintHandoff()}catch{t=void 0}if(this.handoffLease!==e||!UGt(t))throw new Zm.TypedResponseError("handoff_unavailable");return{resumeToken:t}}receiveLayout(e){if(!qGt(e))return;let t={};typeof e.sidebarWidth=="number"&&Number.isFinite(e.sidebarWidth)&&(t.sidebarWidth=e.sidebarWidth),typeof e.browserSidebarVisible=="boolean"&&(t.browserSidebarVisible=e.browserSidebarVisible),(e.browserPresentation==="default"||e.browserPresentation==="paint"||e.browserPresentation==="video")&&(t.browserPresentation=e.browserPresentation),(e.paintRendering==="gpu"||e.paintRendering==="software")&&(t.paintRendering=e.paintRendering),Object.keys(t).length>0&&this.options.onLayout(t)}awaitBundleOutcome(e,t){return this.closed?Promise.resolve("timeout"):new Promise(s=>{let r=this.pendingReloads.get(e);r||(r=new Set,this.pendingReloads.set(e,r));let a=n(l=>{clearTimeout(o),r.delete(a),r.size===0&&this.pendingReloads.get(e)===r&&this.pendingReloads.delete(e),s(l)},"finish"),o=setTimeout(()=>a("timeout"),t);r.add(a)})}receiveBundleOutcome(e){if(!qGt(e)||!UGt(e.version)||e.outcome!=="current"&&e.outcome!=="stale")return;let t=e.outcome;for(let s of[...this.pendingReloads.get(e.version)??[]])s(t)}};var uhs=n((i,e,t)=>{let{statuses:s,finished:r,errors:a,optimistic:o}=i;if(t.sessionError===!0){s.set(e,"error"),a.add(e),r.delete(e),o.delete(e);return}let l=t.sessionStatus;if(l===void 0)return;let c=s.get(e),d=c==="busy"||c==="retry"||o.has(e);s.set(e,l),l==="busy"||l==="retry"?(a.delete(e),r.delete(e),o.delete(e)):l==="idle"?(o.delete(e),d&&!a.has(e)&&r.add(e)):(a.add(e),r.delete(e),o.delete(e))},"applySessionCardEvent");var kmr=4,phs=n(async(i,e)=>{e.throwIfAborted();let t;try{return await Promise.race([i(),new Promise((s,r)=>{t=n(()=>r(e.reason),"onAbort"),e.addEventListener("abort",t,{once:!0})})])}finally{t&&e.removeEventListener("abort",t)}},"settleWithin"),Tmr=n((i,e,t)=>phs(()=>i.send(e),t),"sendWithin"),Emr=n(i=>{if(i instanceof is.TypedResponseError){let t=i.errorData?.code;if(t==="paint_unavailable"||t==="paint_capture_unavailable")return{kind:"paint-refused",code:t,message:i.errorText}}let e=g1e(i);return e===void 0?void 0:{kind:"viewer-cannot-render",failure:e}},"paintOpenFallback"),O1e=class{constructor(e){this.options=e;this.switcher=new SB({surface:e.surface,capture:n(()=>this.renderer instanceof zb?e.canvas:this.renderer?e.video:void 0,"capture"),open:n((t,s)=>t==="paint"?this.openPaint(s):this.openVideo(s),"open"),onError:n(t=>e.onError("Show the browser view",t),"onError")})}options;static{n(this,"ControllerBrowserPresentation")}switcher;renderer;paint;paintOpening=!1;pendingVideoRoutes=[];audio;closed=!1;currentChoice;get mode(){return this.switcher.mode}get choice(){return this.currentChoice}static initialChoice(e,t,s){let r=t==="default"?"controller":"device",a=t==="default"?e:t;return a==="paint"&&s?.paint.state==="unavailable"?{requested:a,reason:{source:r,fallback:{kind:"paint-unavailable",paint:s.paint}}}:{requested:a,reason:{source:r}}}async start(e,t){await this.present(e,t)}async switchTo(e,t){await this.present({requested:e,reason:{source:"view"}},t)}async present(e,t){if(this.closed)return;this.setChoice(e);let s=e.reason.fallback?"video":e.requested;try{await this.switcher.switchTo(s,t)}catch(r){if(this.closed||t?.aborted||s!=="paint")throw r;let a=Emr(r);if(a===void 0)throw r;this.setChoice({requested:e.requested,reason:{...e.reason,fallback:a}}),await this.switcher.switchTo("video",t)}}fallBackToVideo(e){let t=this.currentChoice;this.closed||!t||(this.setChoice({requested:t.requested,reason:{...t.reason,fallback:e}}),this.switcher.switchTo("video").catch(s=>this.options.onError("Show the browser view",s)))}setChoice(e){this.currentChoice=e,this.options.onChoice(e)}async activateSound(){let e=this.renderer;if(!e)throw new Error("The browser view shows nothing yet.");await e.activateAudio()}get soundAvailable(){return this.options.presentation()?.audio.state==="available"}handlePaintTermination(e){let t=this.paint;!t||t.response.paintId!==e.paintId||t.presenter.terminateFromControl(e.source,e.termination)}handleVideoRouteRequest(e){let t=this.paint;if(t&&t.response.paintId===e.paintId){this.openVideoRoute(t,e.routeId).catch(s=>{this.paint===t&&this.options.onError("Show the browser view's video",s)});return}this.paintOpening&&this.pendingVideoRoutes.length<kmr&&this.pendingVideoRoutes.push({paintId:e.paintId,routeId:e.routeId})}async close(){if(this.closed)return;this.closed=!0,this.pendingVideoRoutes.length=0;let e=await Promise.allSettled([this.switcher.close()]),t=this.audio;this.audio=void 0;let s=await Promise.allSettled([t?.dispose()]),r=[...e,...s].flatMap(a=>a.status==="rejected"?[a.reason]:[]);if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Browser presentation cleanup is incomplete.")}async openVideo(e){let t=await this.audioLifecycle();e.throwIfAborted();let s=new BC({video:this.options.video,client:this.options.client,...t===void 0?{}:{audio:t},focusTarget:this.options.surface,resizeTarget:this.options.surface,onError:n(r=>this.options.onRendererError(r),"onError")});this.setRenderer(s);try{await this.options.startRenderer(s)}catch(r){throw await this.options.stopRenderer(s),this.clearRenderer(s),r}return{firstFrame:s.firstFrame,stop:n(async()=>{try{await this.options.stopRenderer(s)}finally{this.clearRenderer(s)}},"stop")}}async openPaint(e){let t=await this.options.assets(),s=await this.audioLifecycle();e.throwIfAborted();let r=new zb({canvas:this.options.canvas,client:this.options.client,...s===void 0?{}:{audio:s},focusTarget:this.options.surface,resizeTarget:this.options.surface,picture:{...MU,...t.paint,...fas(this.options.paintRendering())},originalVideo:d1e,onError:n(o=>{g1e(o.cause)===void 0&&this.options.onRendererError(o)},"onError")});this.setRenderer(r),this.paintOpening=!0;let a;try{await this.options.startRenderer(r);let o=r.pictureRenderer?.videoWorkerIncarnation;if(!o)throw new Error("The Paint renderer has no worker.");a=await this.options.socket.fire("controller.browser.paint.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,workerIncarnation:o},{maxRetries:0,abortSignal:e});let l=a;await phs(()=>Promise.all([l.packets.opened,l.control.opened]),e);let c=new AbortController,d=new hB({expectedHello:l.hello,renderer:r,sendPacket:n((u,p)=>Tmr(l.control,u,p),"sendPacket"),closeSource:n(()=>this.closePaintSource(l),"closeSource"),onFailure:n(u=>{g1e(u)===void 0&&this.options.onError("Run the browser Paint view",u)},"onFailure"),onTermination:n(u=>this.onPaintTermination(l.paintId,u),"onTermination"),signal:c.signal}),h={response:l,presenter:d,renderer:r,routes:new Set,abortController:c,removeSessionEnd:r.observePaintSessionEnd(u=>{this.closeVideoRoutes(h),this.onPaintSessionEnd(h,u)})};this.paint=h,this.receivePaintPackets(h);for(let u of this.pendingVideoRoutes.splice(0))u.paintId===l.paintId&&this.openVideoRoute(h,u.routeId).catch(p=>{this.paint===h&&this.options.onError("Show the browser view's video",p)});return{firstFrame:r.firstFrame,stop:n(()=>this.stopPaint(h),"stop")}}catch(o){throw a&&await this.closePaintSource(a).catch(()=>{}),await r.stop().catch(()=>{}),this.clearRenderer(r),o}finally{this.paintOpening=!1,this.pendingVideoRoutes.length=0}}async receivePaintPackets(e){try{for(;!e.abortController.signal.aborted;){let t=await e.response.packets.receive();if(t===void 0){await e.response.packets.accept();return}e.presenter.receivePacket(t)}}catch(t){if(this.paint!==e||e.abortController.signal.aborted)return;this.options.onError("Run the browser Paint view",t),await this.stopPaint(e).catch(()=>{})}}onPaintTermination(e,t){this.paint?.response.paintId!==e||this.closed||(t.kind==="unsupported"?this.fallBackToVideo({kind:"page-unsupported",reasonCode:t.reasonCode}):t.kind==="failure"&&this.options.onError("Run the browser Paint view",new Error(t.message)))}onPaintSessionEnd(e,t){if(this.paint!==e||this.closed||t===void 0)return;let s=g1e(t);s!==void 0&&this.fallBackToVideo({kind:"viewer-cannot-render",failure:s})}async stopPaint(e){e.abortController.abort(new Error("The Paint stream closed.")),e.removeSessionEnd(),this.closeVideoRoutes(e);try{await e.presenter.close()}finally{this.paint===e&&(this.paint=void 0),this.clearRenderer(e.renderer)}}async closePaintSource(e){let t=new Error("The Paint stream closed.");await Promise.allSettled([e.packets.abort(t),e.control.abort(t)]),this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.paint.close",{viewId:this.options.viewId,paintId:e.paintId,streamGeneration:this.options.streamGeneration},{maxRetries:0})}async openVideoRoute(e,t){let s=e.renderer.pictureRenderer;if(!s)throw new Error("The Paint renderer has no worker.");let r=await this.options.socket.fire("controller.browser.paint.video.openRoute",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,paintId:e.response.paintId,routeId:t},{maxRetries:0,abortSignal:e.abortController.signal}),a=new xB({...c1e,routeId:r.routeId,packets:r.packets,receipts:r.receipts,renderer:s,signal:e.abortController.signal,onEnded:n(()=>{e.routes.delete(a)},"onEnded"),onFailure:n(o=>{e.routes.delete(a),this.options.onError("Show the browser view's video",o)},"onFailure")});e.routes.add(a);try{await a.start()}catch(o){throw e.routes.delete(a),o}}closeVideoRoutes(e){for(let t of e.routes)t.close().catch(s=>this.options.onError("Close the browser view's video",s));e.routes.clear()}async audioLifecycle(){if(this.options.presentation()?.audio.state!=="available")return;if(this.audio)return this.audio;let e=await this.options.assets();if(this.audio)return this.audio;let t={openAudioRelay:n(s=>this.openAudioRelay(s),"openAudioRelay")};return this.audio=new gB({viewerId:this.options.viewId,client:new vB(t),assets:e.audio,sampleCreditBytes:e.audioSampleCredit.bytes,sampleCreditEvents:e.audioSampleCredit.events,clockPolicy:a1e,onError:n(s=>this.options.onError("Play the browser sound",s),"onError")}),this.audio}async openAudioRelay(e){let t=await this.options.socket.fire("controller.browser.audio.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration},{maxRetries:0,abortSignal:e.signal}),r=await new yB({events:t.events,operations:t.operations,sampleCreditBytes:t.sampleCredit.bytes,sampleCreditEvents:t.sampleCredit.events,signal:e.signal}).openAudioRelay(e);return{sendCommand:n(a=>r.sendCommand(a),"sendCommand"),close:n(async()=>{try{await r.close()}finally{this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.audio.close",{viewId:this.options.viewId,audioId:t.audioId,streamGeneration:this.options.streamGeneration},{maxRetries:0}).catch(()=>{})}},"close")}}setRenderer(e){this.renderer=e,this.options.surface.dataset.presentation=e instanceof zb?"paint":"video",this.options.onRenderer(e)}clearRenderer(e){this.renderer===e&&(this.renderer=void 0,this.options.onRenderer(void 0))}};var HGt=n((i,e,t)=>`${i}:${e}\0${t}`,"projectMutationScope"),fhs=n((i,e)=>HGt("draft",i,`${e}`),"draftScopeOf"),mhs=n((i,e)=>HGt("conversation",i,e),"conversationScopeOf"),gqe=class{constructor(e){this.onChange=e}onChange;static{n(this,"ControllerMutationLocks")}held=new Map;startedCount=0;get started(){return this.startedCount}get anyHeld(){return this.held.size>0}isHeld(e){return this.held.has(e)}isProjectHeld(e){let t=["draft","conversation"].map(s=>HGt(s,e,""));return[...this.held.keys()].some(s=>t.some(r=>s.startsWith(r)))}holds(e){return[...this.held.values()].includes(e)}acquire(e){if(this.held.has(e))return;let t=Symbol(e);return this.held.set(e,t),this.startedCount+=1,this.onChange(),t}release(e){for(let[t,s]of this.held)if(s===e)return this.held.delete(t),this.onChange(),!0;return!1}releaseAll(){this.held.size!==0&&(this.held.clear(),this.onChange())}};var vTc=50,ghs=n((i,e)=>[...i,e].slice(-50),"appendErrorJournalEntry"),VGt=n(i=>Number.isFinite(i)?new Date(i).toISOString():"unknown","formatTimestamp"),Imr=n((i,e)=>{let t=[`[${e}] ${VGt(i.at)} - ${i.operation}`,`message: ${i.message}`];i.reference!==void 0&&t.push(`reference: ${i.reference}`);let s=i.detail;return s!==void 0?(t.push(`controller operation: ${s.operation}`,`controller time: ${VGt(s.at)}`,`controller cause: ${s.name}: ${s.message}`),s.stack&&t.push("controller stack:",s.stack)):i.reference!==void 0&&t.push("controller cause: unavailable"),t.join(`
47147
47147
  `)},"formatEntry"),vhs=n(i=>{let e=["AGL error report",`agl version: ${i.version||"unknown"}`,`generated: ${VGt(i.generatedAt)}`,`entries: ${i.entries.length}`].join(`
47148
47148
  `);if(i.entries.length===0)return`${e}
47149
47149
  `;let t=i.entries.map((s,r)=>Imr(s,r+1)).join(`
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist_serve/bundle.js.map
3
- size: 33773189 bytes
4
- sha256: a7b10fa9d0fbf82a4bb5f8cbb2054032b4e59b3e9dbab38eacea59b1b7317a79
3
+ size: 33773309 bytes
4
+ sha256: 83f454a6b543401844e9e508ec2231a576795bbbe40fce00ab1395079bb39518