setta 0.0.14.dev3__py3-none-any.whl → 0.0.14.dev4__py3-none-any.whl
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.
Potentially problematic release.
This version of setta might be problematic. Click here for more details.
- setta/__init__.py +1 -1
- setta/code_gen/export_selected.py +0 -6
- setta/static/frontend/assets/{index-B_D80dlv.js → index-B8656WgG.js} +2 -2
- setta/static/frontend/index.html +1 -1
- {setta-0.0.14.dev3.dist-info → setta-0.0.14.dev4.dist-info}/METADATA +1 -1
- {setta-0.0.14.dev3.dist-info → setta-0.0.14.dev4.dist-info}/RECORD +10 -10
- {setta-0.0.14.dev3.dist-info → setta-0.0.14.dev4.dist-info}/LICENSE +0 -0
- {setta-0.0.14.dev3.dist-info → setta-0.0.14.dev4.dist-info}/WHEEL +0 -0
- {setta-0.0.14.dev3.dist-info → setta-0.0.14.dev4.dist-info}/entry_points.txt +0 -0
- {setta-0.0.14.dev3.dist-info → setta-0.0.14.dev4.dist-info}/top_level.txt +0 -0
setta/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.0.14.
|
1
|
+
__version__ = "0.0.14.dev4"
|
@@ -30,10 +30,6 @@ def get_drawing(p, id):
|
|
30
30
|
return p["sections"][id]["drawing"]
|
31
31
|
|
32
32
|
|
33
|
-
def get_layers(p, id):
|
34
|
-
return p["sections"][id]["layers"]
|
35
|
-
|
36
|
-
|
37
33
|
def get_chat_message(p, id):
|
38
34
|
return p["sections"][id]["latestChatMessage"]
|
39
35
|
|
@@ -600,10 +596,8 @@ class ExporterForInMemoryFn:
|
|
600
596
|
elif type == C.DRAW:
|
601
597
|
value = {
|
602
598
|
"drawing": get_drawing(self.p, id),
|
603
|
-
"layers": get_layers(self.p, id),
|
604
599
|
}
|
605
600
|
self.create_var_mapping((id, "drawing"), f'{name}["drawing"]')
|
606
|
-
self.create_var_mapping((id, "layers"), f'{name}["layers"]')
|
607
601
|
elif type == C.CHAT:
|
608
602
|
latestChatMessage = get_chat_message(self.p, id)
|
609
603
|
artifacts = get_artifacts(self.p, id)
|
@@ -89,7 +89,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
89
89
|
`+s.map(ZF).join(`
|
90
90
|
`):" "+ZF(s[0]):"as no adapter specified";throw new cn("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:MR};function eP(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new XO(null,t)}function GF(t){return eP(t),t.headers=ia.from(t.headers),t.data=JT.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ste.getAdapter(t.adapter||p2.adapter)(t).then(function(r){return eP(t),r.data=JT.call(t,t.transformResponse,r),r.headers=ia.from(r.headers),r},function(r){return vte(r)||(eP(t),r&&r.response&&(r.response.data=JT.call(t,t.transformResponse,r.response),r.response.headers=ia.from(r.response.headers))),Promise.reject(r)})}const _te="1.8.1",R7={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{R7[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const YF={};R7.transitional=function(e,n,r){function i(s,o){return"[Axios v"+_te+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(e===!1)throw new cn(i(o," has been removed"+(n?" in "+n:"")),cn.ERR_DEPRECATED);return n&&!YF[o]&&(YF[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,a):!0}};R7.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function hCe(t,e,n){if(typeof t!="object")throw new cn("options must be an object",cn.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const a=t[s],l=a===void 0||o(a,s,t);if(l!==!0)throw new cn("option "+s+" must be "+l,cn.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new cn("Unknown option "+s,cn.ERR_BAD_OPTION)}}const c3={assertOptions:hCe,validators:R7},cu=c3.validators;let fm=class{constructor(e){this.defaults=e,this.interceptors={request:new FF,response:new FF}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
91
91
|
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ym(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&c3.assertOptions(r,{silentJSONParsing:cu.transitional(cu.boolean),forcedJSONParsing:cu.transitional(cu.boolean),clarifyTimeoutError:cu.transitional(cu.boolean)},!1),i!=null&&(Be.isFunction(i)?n.paramsSerializer={serialize:i}:c3.assertOptions(i,{encode:cu.function,serialize:cu.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),c3.assertOptions(n,{baseUrl:cu.spelling("baseURL"),withXsrfToken:cu.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&Be.merge(s.common,s[n.method]);s&&Be.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=ia.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(l=l&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let u,h=0,f;if(!l){const g=[GF.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),f=g.length,u=Promise.resolve(n);h<f;)u=u.then(g[h++],g[h++]);return u}f=a.length;let d=n;for(h=0;h<f;){const g=a[h++],v=a[h++];try{d=g(d)}catch(m){v.call(this,m);break}}try{u=GF.call(this,d)}catch(g){return Promise.reject(g)}for(h=0,f=c.length;h<f;)u=u.then(c[h++],c[h++]);return u}getUri(e){e=ym(this.defaults,e);const n=yte(e.baseURL,e.url,e.allowAbsoluteUrls);return pte(n,e.params,e.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(e){fm.prototype[e]=function(n,r){return this.request(ym(r||{},{method:e,url:n,data:(r||{}).data}))}});Be.forEach(["post","put","patch"],function(e){function n(r){return function(s,o,a){return this.request(ym(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}fm.prototype[e]=n(),fm.prototype[e+"Form"]=n(!0)});let fCe=class kte{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new XO(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new kte(function(i){e=i}),cancel:e}}};function dCe(t){return function(n){return t.apply(null,n)}}function pCe(t){return Be.isObject(t)&&t.isAxiosError===!0}const $R={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($R).forEach(([t,e])=>{$R[e]=t});function Cte(t){const e=new fm(t),n=rte(fm.prototype.request,e);return Be.extend(n,fm.prototype,e,{allOwnKeys:!0}),Be.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Cte(ym(t,i))},n}const Pi=Cte(p2);Pi.Axios=fm;Pi.CanceledError=XO;Pi.CancelToken=fCe;Pi.isCancel=vte;Pi.VERSION=_te;Pi.toFormData=P7;Pi.AxiosError=cn;Pi.Cancel=Pi.CanceledError;Pi.all=function(e){return Promise.all(e)};Pi.spread=dCe;Pi.isAxiosError=pCe;Pi.mergeConfig=ym;Pi.AxiosHeaders=ia;Pi.formToJSON=t=>gte(Be.isHTMLForm(t)?new FormData(t):t);Pi.getAdapter=Ste.getAdapter;Pi.HttpStatusCode=$R;Pi.default=Pi;const{Axios:a3t,AxiosError:l3t,CanceledError:c3t,isCancel:u3t,CancelToken:h3t,VERSION:f3t,all:d3t,Cancel:p3t,isAxiosError:m3t,spread:g3t,toFormData:v3t,AxiosHeaders:O3t,HttpStatusCode:y3t,formToJSON:b3t,getAdapter:x3t,mergeConfig:w3t}=Pi;async function on({address:t,body:e}){return Pi.post(`${Gv.BACKEND}${t}`,e,{headers:{"Content-Type":"application/json"}}).then(n=>n).catch(n=>n)}function oL(t,e){let n=t;for(const[r,i]of Object.entries(e)){const s=new RegExp(`\\{${r}\\}`,"g");n=n.replace(s,i)}return n}async function mCe(t){return await on({body:{project:Ete(),variantIdsToLoad:t},address:re.ROUTE_LOAD_SECTION_JSON_SOURCE})}async function gCe(t){return await on({body:{project:Ete(),variantId:t},address:re.ROUTE_SAVE_SECTION_JSON_SOURCE})}function Ete(){const{x:t,codeInfoCols:e,variants:n,codeInfo:r}=le.getState();return{sections:t,codeInfo:r,codeInfoCols:e,sectionVariants:n}}async function vCe(t){return await on({body:{variantName:t},address:re.ROUTE_GET_JSON_SOURCE_PATH_TO_BE_DELETED})}async function OCe(t){return await on({body:{filepath:t},address:re.ROUTE_DELETE_FILE})}async function yCe(t){return await on({body:{filepaths:t},address:re.ROUTE_FILE_WATCH_LIST})}const KF=t=>{t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296};let bCe=class{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:n,separator:r,dictionaries:i,style:s,seed:o}=e;this.dictionaries=i,this.separator=r,this.length=n,this.style=s,this.seed=o}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
|
92
|
-
Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((n,r)=>{let i;e?(i=(o=>{if(typeof o=="string"){const a=o.split("").map(c=>c.charCodeAt(0)).reduce((c,u)=>c+u,1),l=Math.floor(Number(a));return KF(l)}return KF(o)})(e),e=4294967296*i):i=Math.random();let s=r[Math.floor(i*r.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[o,...a]=s.split("");s=o.toUpperCase()+a.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return n?`${n}${this.separator}${s}`:`${s}`},"")}};const JF={separator:"_",dictionaries:[]},Tte=t=>{const e=[...t&&t.dictionaries||JF.dictionaries],n={...JF,...t,length:t&&t.length||e.length,dictionaries:e};if(!t||!t.dictionaries||!t.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new bCe(n).generate()};var Pte=["able","above","absent","absolute","abstract","abundant","academic","acceptable","accepted","accessible","accurate","accused","active","actual","acute","added","additional","adequate","adjacent","administrative","adorable","advanced","adverse","advisory","aesthetic","afraid","aggregate","aggressive","agreeable","agreed","agricultural","alert","alive","alleged","allied","alone","alright","alternative","amateur","amazing","ambitious","amused","ancient","angry","annoyed","annual","anonymous","anxious","appalling","apparent","applicable","appropriate","arbitrary","architectural","armed","arrogant","artificial","artistic","ashamed","asleep","assistant","associated","atomic","attractive","automatic","autonomous","available","average","awake","aware","awful","awkward","back","bad","balanced","bare","basic","beautiful","beneficial","better","bewildered","big","binding","biological","bitter","bizarre","blank","blind","blonde","bloody","blushing","boiling","bold","bored","boring","bottom","brainy","brave","breakable","breezy","brief","bright","brilliant","broad","broken","bumpy","burning","busy","calm","capable","capitalist","careful","casual","causal","cautious","central","certain","changing","characteristic","charming","cheap","cheerful","chemical","chief","chilly","chosen","christian","chronic","chubby","circular","civic","civil","civilian","classic","classical","clean","clear","clever","clinical","close","closed","cloudy","clumsy","coastal","cognitive","coherent","cold","collective","colonial","colorful","colossal","coloured","colourful","combative","combined","comfortable","coming","commercial","common","communist","compact","comparable","comparative","compatible","competent","competitive","complete","complex","complicated","comprehensive","compulsory","conceptual","concerned","concrete","condemned","confident","confidential","confused","conscious","conservation","conservative","considerable","consistent","constant","constitutional","contemporary","content","continental","continued","continuing","continuous","controlled","controversial","convenient","conventional","convinced","convincing","cooing","cool","cooperative","corporate","correct","corresponding","costly","courageous","crazy","creative","creepy","criminal","critical","crooked","crowded","crucial","crude","cruel","cuddly","cultural","curious","curly","current","curved","cute","daily","damaged","damp","dangerous","dark","dead","deaf","deafening","dear","decent","decisive","deep","defeated","defensive","defiant","definite","deliberate","delicate","delicious","delighted","delightful","democratic","dependent","depressed","desirable","desperate","detailed","determined","developed","developing","devoted","different","difficult","digital","diplomatic","direct","dirty","disabled","disappointed","disastrous","disciplinary","disgusted","distant","distinct","distinctive","distinguished","disturbed","disturbing","diverse","divine","dizzy","domestic","dominant","double","doubtful","drab","dramatic","dreadful","driving","drunk","dry","dual","due","dull","dusty","dutch","dying","dynamic","eager","early","eastern","easy","economic","educational","eerie","effective","efficient","elaborate","elated","elderly","eldest","electoral","electric","electrical","electronic","elegant","eligible","embarrassed","embarrassing","emotional","empirical","empty","enchanting","encouraging","endless","energetic","enormous","enthusiastic","entire","entitled","envious","environmental","equal","equivalent","essential","established","estimated","ethical","ethnic","eventual","everyday","evident","evil","evolutionary","exact","excellent","exceptional","excess","excessive","excited","exciting","exclusive","existing","exotic","expected","expensive","experienced","experimental","explicit","extended","extensive","external","extra","extraordinary","extreme","exuberant","faint","fair","faithful","familiar","famous","fancy","fantastic","far","fascinating","fashionable","fast","fat","fatal","favourable","favourite","federal","fellow","female","feminist","few","fierce","filthy","final","financial","fine","firm","fiscal","fit","fixed","flaky","flat","flexible","fluffy","fluttering","flying","following","fond","foolish","foreign","formal","formidable","forthcoming","fortunate","forward","fragile","frail","frantic","free","frequent","fresh","friendly","frightened","front","frozen","full","fun","functional","fundamental","funny","furious","future","fuzzy","gastric","gay","general","generous","genetic","gentle","genuine","geographical","giant","gigantic","given","glad","glamorous","gleaming","global","glorious","golden","good","gorgeous","gothic","governing","graceful","gradual","grand","grateful","greasy","great","grieving","grim","gross","grotesque","growing","grubby","grumpy","guilty","handicapped","handsome","happy","hard","harsh","head","healthy","heavy","helpful","helpless","hidden","high","hilarious","hissing","historic","historical","hollow","holy","homeless","homely","hon","honest","horizontal","horrible","hostile","hot","huge","human","hungry","hurt","hushed","husky","icy","ideal","identical","ideological","ill","illegal","imaginative","immediate","immense","imperial","implicit","important","impossible","impressed","impressive","improved","inadequate","inappropriate","inc","inclined","increased","increasing","incredible","independent","indirect","individual","industrial","inevitable","influential","informal","inherent","initial","injured","inland","inner","innocent","innovative","inquisitive","instant","institutional","insufficient","intact","integral","integrated","intellectual","intelligent","intense","intensive","interested","interesting","interim","interior","intermediate","internal","international","intimate","invisible","involved","irrelevant","isolated","itchy","jealous","jittery","joint","jolly","joyous","judicial","juicy","junior","just","keen","key","kind","known","labour","large","late","latin","lazy","leading","left","legal","legislative","legitimate","lengthy","lesser","level","lexical","liable","liberal","light","like","likely","limited","linear","linguistic","liquid","literary","little","live","lively","living","local","logical","lonely","long","loose","lost","loud","lovely","low","loyal","ltd","lucky","mad","magic","magnetic","magnificent","main","major","male","mammoth","managerial","managing","manual","many","marginal","marine","marked","married","marvellous","marxist","mass","massive","mathematical","mature","maximum","mean","meaningful","mechanical","medical","medieval","melodic","melted","mental","mere","metropolitan","mid","middle","mighty","mild","military","miniature","minimal","minimum","ministerial","minor","miserable","misleading","missing","misty","mixed","moaning","mobile","moderate","modern","modest","molecular","monetary","monthly","moral","motionless","muddy","multiple","mushy","musical","mute","mutual","mysterious","naked","narrow","nasty","national","native","natural","naughty","naval","near","nearby","neat","necessary","negative","neighbouring","nervous","net","neutral","new","nice","noble","noisy","normal","northern","nosy","notable","novel","nuclear","numerous","nursing","nutritious","nutty","obedient","objective","obliged","obnoxious","obvious","occasional","occupational","odd","official","ok","okay","old","olympic","only","open","operational","opposite","optimistic","oral","ordinary","organic","organisational","original","orthodox","other","outdoor","outer","outrageous","outside","outstanding","overall","overseas","overwhelming","painful","pale","panicky","parallel","parental","parliamentary","partial","particular","passing","passive","past","patient","payable","peaceful","peculiar","perfect","permanent","persistent","personal","petite","philosophical","physical","plain","planned","plastic","pleasant","pleased","poised","polite","political","poor","popular","positive","possible","potential","powerful","practical","precious","precise","preferred","pregnant","preliminary","premier","prepared","present","presidential","pretty","previous","prickly","primary","prime","primitive","principal","printed","prior","private","probable","productive","professional","profitable","profound","progressive","prominent","promising","proper","proposed","prospective","protective","protestant","proud","provincial","psychiatric","psychological","public","puny","pure","purring","puzzled","quaint","qualified","quarrelsome","querulous","quick","quickest","quiet","quintessential","quixotic","racial","radical","rainy","random","rapid","rare","raspy","rational","ratty","raw","ready","real","realistic","rear","reasonable","recent","reduced","redundant","regional","registered","regular","regulatory","related","relative","relaxed","relevant","reliable","relieved","religious","reluctant","remaining","remarkable","remote","renewed","representative","repulsive","required","resident","residential","resonant","respectable","respective","responsible","resulting","retail","retired","revolutionary","rich","ridiculous","right","rigid","ripe","rising","rival","roasted","robust","rolling","romantic","rotten","rough","round","royal","rubber","rude","ruling","running","rural","sacred","sad","safe","salty","satisfactory","satisfied","scared","scary","scattered","scientific","scornful","scrawny","screeching","secondary","secret","secure","select","selected","selective","selfish","semantic","senior","sensible","sensitive","separate","serious","severe","sexual","shaggy","shaky","shallow","shared","sharp","sheer","shiny","shivering","shocked","short","shrill","shy","sick","significant","silent","silky","silly","similar","simple","single","skilled","skinny","sleepy","slight","slim","slimy","slippery","slow","small","smart","smiling","smoggy","smooth","social","socialist","soft","solar","sole","solid","sophisticated","sore","sorry","sound","sour","southern","soviet","spare","sparkling","spatial","special","specific","specified","spectacular","spicy","spiritual","splendid","spontaneous","sporting","spotless","spotty","square","squealing","stable","stale","standard","static","statistical","statutory","steady","steep","sticky","stiff","still","stingy","stormy","straight","straightforward","strange","strategic","strict","striking","striped","strong","structural","stuck","stupid","subjective","subsequent","substantial","subtle","successful","successive","sudden","sufficient","suitable","sunny","super","superb","superior","supporting","supposed","supreme","sure","surprised","surprising","surrounding","surviving","suspicious","sweet","swift","symbolic","sympathetic","systematic","tall","tame","tart","tasteless","tasty","technical","technological","teenage","temporary","tender","tense","terrible","territorial","testy","then","theoretical","thick","thin","thirsty","thorough","thoughtful","thoughtless","thundering","tight","tiny","tired","top","tory","total","tough","toxic","traditional","tragic","tremendous","tricky","tropical","troubled","typical","ugliest","ugly","ultimate","unable","unacceptable","unaware","uncertain","unchanged","uncomfortable","unconscious","underground","underlying","unemployed","uneven","unexpected","unfair","unfortunate","unhappy","uniform","uninterested","unique","united","universal","unknown","unlikely","unnecessary","unpleasant","unsightly","unusual","unwilling","upper","upset","uptight","urban","urgent","used","useful","useless","usual","vague","valid","valuable","variable","varied","various","varying","vast","verbal","vertical","very","vicarious","vicious","victorious","violent","visible","visiting","visual","vital","vitreous","vivacious","vivid","vocal","vocational","voiceless","voluminous","voluntary","vulnerable","wandering","warm","wasteful","watery","weak","wealthy","weary","wee","weekly","weird","welcome","well","western","wet","whispering","whole","wicked","wide","widespread","wild","wilful","willing","willowy","wily","wise","wispy","wittering","witty","wonderful","wooden","working","worldwide","worried","worrying","worthwhile","worthy","written","wrong","xenacious","xenial","xenogeneic","xenophobic","xeric","xerothermic","yabbering","yammering","yappiest","yappy","yawning","yearling","yearning","yeasty","yelling","yelping","yielding","yodelling","young","youngest","youthful","ytterbic","yucky","yummy","zany","zealous","zeroth","zestful","zesty","zippy","zonal","zoophagous","zygomorphic","zygotic"],Ate=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];let X4;const xCe=new Uint8Array(16);function wCe(){if(!X4&&(X4=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!X4))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return X4(xCe)}const _s=[];for(let t=0;t<256;++t)_s.push((t+256).toString(16).slice(1));function SCe(t,e=0){return(_s[t[e+0]]+_s[t[e+1]]+_s[t[e+2]]+_s[t[e+3]]+"-"+_s[t[e+4]]+_s[t[e+5]]+"-"+_s[t[e+6]]+_s[t[e+7]]+"-"+_s[t[e+8]]+_s[t[e+9]]+"-"+_s[t[e+10]]+_s[t[e+11]]+_s[t[e+12]]+_s[t[e+13]]+_s[t[e+14]]+_s[t[e+15]]).toLowerCase()}const _Ce=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eV={randomUUID:_Ce};function kCe(t,e,n){if(eV.randomUUID&&!t)return eV.randomUUID();t=t||{};const r=t.random||(t.rng||wCe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,SCe(r)}function Tr(){return kCe()}function DR(t){return t||Tr()}function CCe(t){const e={dictionaries:[Pte,Ate],separator:"_",length:2};let n;for(;!n||t.includes(n);)n=Tte(e);return n}function m2(){return Tte({dictionaries:[Pte,Ate],separator:"_",length:2})}const ECe={id:null,name:"",size:{width:"auto",height:"auto"},parentId:null,variantId:null,uiTypeId:null,uiTypeColId:null,social:"",artifactGroupIds:[],defaultVariantId:null,variantIds:[],paramSweepSectionId:null,nonPresetUITypeIds:[],codeLanguage:"python",runInMemory:!1,isFrozen:!1,isHorizontalOrientation:!1,hideParams:!1,hideSearch:!1,hideUnpinnedParams:!1,displayMode:"GUI",visibility:{DEV:!0,USER:!0},pinnedAreaHeight:"auto",isMinimized:!1,canvasSettings:{activeLayerId:null,color:"#ff0000",brushSize:16,brushShape:"butt",eraserBrushSize:16,drawThrottleDelay:0,canvasTransferQueueLength:50,mode:"draw"},chartSettings:{type:"line",xAxisColumn:"",secondYAxisColumns:[],xAxisLog:!1,y1AxisLog:!1,y2AxisLog:!1},isTemporary:!1,isReadOnlyTerminal:!1,renderMarkdown:!1,positionAndSizeLocked:!1,selectedVariantIds:{},paramFilter:"",isInOtherProjectConfigs:!1,aspectRatio:!1,aspectRatioExtraHeight:0,aspectRatioExtraWidth:0,columnWidth:null,renderedValue:null,subprocessStartMethod:"spawn",headingAsSectionName:!1},TCe={name:"",values:{},children:[],selectedItem:null,code:"",codeInfoColId:null,description:"",evRefs:[],templateVars:[],isFrozen:!1,sweep:[],runGroup:{},configLanguage:"python",isJsonSource:!1,jsonSourceKeys:[],jsonSourceMissing:!1},PCe={id:null,name:"",editable:!1,rcType:"parameter",defaultVal:"",description:"",positionalOnly:!1,isPinned:!1,isFrozen:!1,isSelected:!1,evRefs:[],ignoreTypeErrors:!1},ACe={children:{null:[]}},RCe={value:"",evRefs:[]},MCe={uiTypeId:"3fdaeb6a-e989-4888-b844-17a76f0b0192",nonPresetUITypeIds:[]},$Ce={name:"",path:"",value:null,type:""},Fm={section:ECe,sectionVariant:TCe,codeInfo:PCe,codeInfoCol:ACe,evEntry:RCe,uiTypeColEntry:MCe,artifact:$Ce};function M7(){return me.cloneDeep(Fm.codeInfoCol)}function aL({uiType:t,currValue:e}){switch(t.type){case re.TEXT:case re.PASSWORD:return DCe({currValue:e});case re.SLIDER:return ICe({uiType:t,currValue:e});case re.SWITCH:return LCe({currValue:e});case re.COLOR_PICKER:return NCe({currValue:e});case re.DROPDOWN:return QCe({currValue:e});default:return""}}function DCe({currValue:t}){return me.isNil(t)?"":t}function ICe({uiType:t,currValue:e}){const n=me.toNumber(e);return me.isFinite(n)?me.toString(pf(n,t.config.min,t.config.max)):me.toString(t.config.min)}function LCe({currValue:t}){return me.isNil(t)||t==="0"?"false":"true"}function NCe({currValue:t}){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(t)?t:"#ff0000"}function QCe({currValue:t}){return me.isNil(t)?"":t}function ZO(){return me.cloneDeep(Fm.evEntry)}function ju(t){t?pc.setState({open:t}):pc.getState().reset()}function Pf(t,e){pc.setState({modalType:t,modalData:e,open:!0})}function Rte(){Pf(fi.LOAD_PROJECT_CONFIG)}function Mte(){Pf(fi.SAVE_PROJECT_CONFIG_AS)}function BCe(){Pf(fi.SAVE_PROJECT_CONFIG_AS_WITH_REFS)}function jCe(){Pf(fi.EXPORT_JSON)}function zCe(){Pf(fi.IMPORT_JSON)}function FCe(t){Pf(fi.DELETE_PROJECT_WARNING,t)}function VCe(...t){Pf(fi.RENAME_REFERENCES,t)}function WCe(t){Pf(fi.DELETE_JSON_SOURCE_FILE,t)}function qCe(t){Pf(fi.ADD_ARTIFACT_BY_FILEPATH,t)}function $7(t){return t.split(";base64,")[1]}function lL(t){return $7(t.toDataURL("image/png"))}async function cL(t){const e=ZCe(t),n=new Image;return n.src=e,await n.decode(),n}function UCe(t,e){return e.map(n=>{const r=t[n];return r?lL(r):null})}function HCe(t,e){const n=document.createElement("canvas"),r=t[e[0]];n.width=r.width,n.height=r.height;const i=n.getContext("2d");for(const s of e){const o=t[s];o&&i.drawImage(o,0,0)}return lL(n)}function XCe(t,e){const n=HCe(t,e),r=UCe(t,e);return{drawing:n,layers:r}}function ZCe(t){return t.startsWith("data:image/")?t:`data:image/png;base64,${t}`}async function GCe(t){return await on({body:{artifactIds:t},address:re.ROUTE_LOAD_ARTIFACTS})}async function YCe(t){return await on({body:{sectionType:t},address:re.ROUTE_LOAD_AVAILABLE_ARTIFACTS})}async function KCe(t){return await on({body:{filepath:t},address:re.ROUTE_CHECK_IF_FILE_EXISTS})}async function JCe(t,e){return await on({body:{filepath:t,type:e},address:re.ROUTE_LOAD_ARTIFACT_FROM_DISK})}async function e6e(t){return await on({body:{base64Str:t},address:re.ROUTE_READ_CSV_BASE64})}async function t6e(t){return await on({body:{namesPathsTypes:t},address:re.ROUTE_GET_ARTIFACT_IDS_FROM_NAME_PATH_TYPE})}function n6e(t,e){let n;for(let r of t)r>=e&&(n===void 0||r-e<n-e)&&(n=r);return n}function r6e(t,e){const n=[],{fullNameToInfo:r}=zm.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);if(s in r){const o=r[s];n.push({sectionId:o.sectionId,paramInfoId:o.paramInfoId,isArgsObj:o.isArgsObj,startPos:i.startPos,keyword:s})}}return n}function i6e(t,e){const n=[],{fullNameToSectionId:r}=_7.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);s in r&&n.push({sectionId:r[s],startPos:i.startPos,keyword:s})}return n}function $te(){const t={};for(const[e,n]of Object.entries(zm.getState().fullNameToInfo))t[Dte({sectionId:n.sectionId,paramInfoId:n.paramInfoId,isArgsObj:n.isArgsObj})]=e;return t}function Dte({sectionId:t,paramInfoId:e=null,isArgsObj:n=!1}){return JSON.stringify([t,e,n])}function s6e({fullNameToInfo:t,keyword:e,sectionId:n,paramInfoId:r}){return!(t[e].sectionId===n&&!t[e].paramInfoId||t[e].sectionId===n&&t[e].paramInfoId===r)}function uL({sectionId:t,paramInfoId:e,value:n,regexPatternKey:r}){let i;const s=new Set,{[r]:o,fullNameToInfo:a}=zm.getState();for(;i=o.exec(n);)s6e({fullNameToInfo:a,keyword:i[0],sectionId:t,paramInfoId:e})&&s.add([i[0],i.index]);return Array.from(s)}function hL(t,e){let n;const r=[],{pattern:i,fullNameToSectionId:s}=_7.getState();for(;n=i.exec(e);)s[n[0]]!==t&&r.push([n[0],n.index]);return r}function o6e(t){const e=t.indexOf(re.TEMPLATE_PREFIX,t.indexOf(re.TEMPLATE_PREFIX)+1);return t.substring(e)}async function a6e(){return await on({body:{},address:re.ROUTE_ALL_PROJECT_CONFIG_METADATA})}async function tV(){return await on({body:{},address:re.ROUTE_LOAD_PROJECT_CONFIG_NAMES})}async function l6e(t){return await on({body:{projectConfigName:t},address:re.ROUTE_LOAD_PROJECT_CONFIG})}async function c6e({excludeProjectConfigName:t}){return await on({body:{excludeProjectConfigName:t},address:re.ROUTE_LOAD_FULL_PROJECT})}async function u6e({name:t,previewImgColor:e}){return await on({address:re.ROUTE_CREATE_PROJECT_CONFIG,body:{name:t,previewImgColor:e}})}async function h6e({project:t}){return await on({address:re.ROUTE_SAVE_PROJECT,body:{project:t}})}async function f6e({project:t,newConfigName:e,withRefs:n}){return await on({address:re.ROUTE_SAVE_AS_NEW_PROJECT_CONFIG,body:{project:t,newConfigName:e,withRefs:n}})}async function d6e({project:t,configName:e}){return await on({address:re.ROUTE_SAVE_AS_EXISTING_PROJECT_CONFIG,body:{project:t,configName:e}})}async function p6e(t){return await on({address:re.ROUTE_DELETE_PROJECT_CONFIGS,body:{ids:t}})}async function m6e(){return await on({address:re.ROUTE_GET_DEFAULT_CONFIG_NAME,body:{}})}async function g6e(t){return await on({address:re.ROUTE_SET_AS_DEFAULT_PROJECT,body:{projectId:t}})}async function v6e(t){return await on({address:re.ROUTE_FILTER_DATA_FOR_JSON_EXPORT,body:{project:t}})}async function O6e(t){return await on({address:re.ROUTE_ADD_DEFAULT_DATA_FOR_JSON_IMPORT,body:{project:t}})}async function nV(t){return await on({address:re.ROUTE_SAVE_SETTINGS,body:{settings:t}})}async function y6e(){return await on({address:re.ROUTE_LOAD_SETTINGS,body:{}})}async function b6e(t){return await on({address:re.ROUTE_SAVE_SETTINGS_PROJECT,body:{settingsProject:t}})}async function x6e(){return await on({address:re.ROUTE_LOAD_SETTINGS_PROJECT,body:{}})}function Ite({name:t,...e}){return me.merge(me.cloneDeep(Fm.artifact),{name:t??m2()},e)}function Lte({name:t,...e}){return{name:t??m2(),artifactTransforms:[],visible:!0,layerOpacity:.5,brushOpacity:1,...e}}function fL(t,e,n){return{artifactId:t,...w6e(e,n)}}function w6e(t,e){switch(t){case re.DRAW:return{transform:[1,0,0,1,0,0],eraserStrokes:e==="img"?[]:{}};case re.IMAGE:case re.CHART:case re.CHAT:return{};default:return{}}}const dL=me.throttle(()=>{if(kC.temporal.getState().pastStates.length<=1)return;const e=kC.getState().version;for(const n of jO[Qm.PROJECT_STATE])n.temporal&&e===n.getState().version&&(n.temporal.getState().undo(2),S6e(n));mL(),xn.setState({undoOrRedoWasTriggered:!0})},100);function S6e(t){t.temporal.setState(e=>({pastStates:[...e.pastStates,t.getState()],futureStates:Nte(e.futureStates)}))}function Nte(t){const e=[],n=new Set;for(const r of t)n.has(r.version)||(e.push(r),n.add(r.version));return e}const pL=me.throttle(()=>{const t=kC.getState().version;for(const e of jO[Qm.PROJECT_STATE])e.temporal&&t===e.getState().version&&(e.temporal.getState().redo(),_6e(e));mL(),xn.setState({undoOrRedoWasTriggered:!0})},100);function _6e(t){t.temporal.setState(e=>({pastStates:Nte([...e.pastStates,t.getState()])}))}function k6e(t){let e=!1;for(const r of t)if(r.temporal&&!me.isEqual(r.getState(),r.temporal.getState().pastStates.at(-1))){e=!0;break}if(!e)return;const n=kC.getState().version;for(const r of t)r.temporal&&(r.setState({version:n+1}),C6e(r,()=>r.setState({})))}function C6e(t,e){t.temporal.getState().resume(),e(),t.temporal.getState().pause()}const Wn=me.throttle((t,e=!0)=>{t&&(k6e(jO[Qm.PROJECT_STATE]),e&&mL())},500),mL=me.debounce(()=>{vn.getState().backend.autosave&&U7()},1e3);async function E6e(t,e,n){const r=await GCe(e);if(r.status===200){const i=me.cloneDeep(r.data);if(await T6e(i),n!=null&&n.aborted)return;Hi.setState(s=>({x:{...s.x,...i}})),le.setState(s=>{Vte(e,t,s)}),Wn(!0)}}async function T6e(t){for(const e of Object.values(t))e.value=await Qte(e.type,e.value)}async function Qte(t,e){switch(t){case"img":return await cL(e);case"list":case"brushStrokes":case"chatHistory":return e}}async function P6e(t,e){switch(t){case"img":return await cL(e);case"list":const n=await e6e($7(e));if(n.status==200)return n.data;default:return null}}function A6e(){const t={};for(const[e,n]of Object.entries(Hi.getState().x))typeof n!="function"&&(n.type==="img"&&n.value instanceof Image?t[e]={...n,value:$7(n.value.src)}:t[e]=n);return t}function Bte({sectionId:t,sectionTypeName:e,artifactType:n,state:r}){const i=Tr();Hi.setState(o=>({x:{...o.x,[i]:Ite({type:n,value:[]})}}));const s=Tr();return r.artifactGroups[s]=Lte({artifactTransforms:[fL(i,e,n)]}),r.x[t].artifactGroupIds.push(s),s}function jte(t,e){const n=Bte({sectionId:t,artifactType:"brushStrokes",sectionTypeName:re.DRAW,state:e});e.x[t].canvasSettings.activeLayerId=n}function R6e(t,e){Bte({sectionId:t,artifactType:"chatHistory",sectionTypeName:re.CHAT,state:e})}function zte({sectionId:t,sectionTypeName:e,artifactId:n,artifactType:r,createNewArtifactGroup:i=!1,add:s,state:o}){let a=M6e(t,e,o),l;if(s){(!a||i)&&(a=Tr(),o.artifactGroups[a]=Lte({}),o.x[t].artifactGroupIds.unshift(a));const c=fL(n,e,r);l=o.artifactGroups[a],e===re.DRAW||e===re.CHART?l.artifactTransforms.push(c):l.artifactTransforms=[c]}else l=o.artifactGroups[a],l&&(l.artifactTransforms=l.artifactTransforms.filter(c=>c.artifactId!==n));l&&Vte(l.artifactTransforms.map(c=>c.artifactId),t,o)}async function Fte({sectionId:t,createNewArtifactGroup:e,value:n,artifactType:r,path:i=""}){const s=Tr();Hi.setState(o=>({x:{...o.x,[s]:Ite({value:n,path:i,type:r})}})),le.setState(o=>{const a=Bn(t,o);zte({sectionId:t,sectionTypeName:a,artifactId:s,artifactType:r,createNewArtifactGroup:e,add:!0,state:o})})}function M6e(t,e,n){switch(e){case re.DRAW:return n.x[t].canvasSettings.activeLayerId;case re.IMAGE:case re.CHART:return n.x[t].artifactGroupIds[0]}}function Vte(t,e,n){Bn(e,n)===re.CHART&&Wte(t,e,n)}function Wte(t,e,n){const{chartSettings:r}=n.x[e],i=gL(t.map(o=>Hi.getState().x[o]),r.type),s=Object.keys(i);xn.setState(o=>({chartDisplayedSeriesNames:{...o.chartDisplayedSeriesNames,[e]:s}}))}function gL(t,e){switch(e){case"line":return $6e(t);case"scatter":return D6e(t);default:return{}}}function $6e(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value)){const s=t.length===1?r:`${n.name}/${r}`;e[s]=[...i]}return e}function D6e(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value))r in e||(e[r]=[]),e[r].push(...i);return e}function vL(t){return JSON.stringify([t.name,t.path,t.type])}function qte(t,e,n,r,i,s=null,o=null){const a=[],l=n.filter(h=>i(t[h])).reverse(),c=new Set,u=s?{}:null;for(s&&l.forEach(h=>u[h]=s(t[h])?[h]:[]);l.length>0;){const h=l.pop();if(!h||c.has(h))continue;c.add(h);const f=t[h];if(r(f)&&a.push(f.id),i(f)){const d=e[f.id].slice().reverse();if(s){const g=u[h];d.forEach(v=>{u[v]=s(t[v])?[...g,v]:[...g]})}l.push(...d)}if(a.length>0&&(o!=null&&o(t[a[a.length-1]])))return{ids:a,pathMap:u,earlyReturnTriggered:!0}}return{ids:a,pathMap:u,earlyReturnTriggered:!1}}function OL({allCodeInfo:t,codeInfoChildren:e,startingId:n,additionalOutputCondition:r=null,paramPathCondition:i=null,earlyReturnCondition:s=null}){const o=n?[n]:e[n];return qte(t,e,o??[],l=>(l==null?void 0:l.rcType)===re.PARAMETER&&(!r||r(l)),n?()=>!0:l=>(l==null?void 0:l.rcType)===re.PARAMETER,i,s)}function I6e(t,e){return qte(t,e,e[null]??[],()=>!0,()=>!0)}function g2(t){return OL({...t,paramPathCondition:e=>e.rcType===re.PARAMETER})}function Kw(t,e,n,r){const{ids:i,pathMap:s}=g2({allCodeInfo:e,codeInfoChildren:n,startingId:r});i.reverse();let o=[];const a=new Set,l={};for(const c of i)if(Qke(e[c].isPinned,t)&&(n[c].length===0||n[c].some(u=>u in l)))for(const u of s[c])l[u]=s[u],a.has(s[c][0])||(o.push(s[c][0]),a.add(s[c][0]));return o.reverse(),{requiredParamIdsToPaths:l,topLevelParamIds:o}}function yL(t,e,n){if(e[n].length===1)return t[e[n][0]].name;{let r="";for(const[i,s]of e[n].entries())i===0?r=t[s].name:r+=`["${t[s].name}"]`;return r}}function Ute(t,e,n){const{selectedItem:r}=On(t,e),i=Pl(t,e).children,{earlyReturnTriggered:s}=OL({allCodeInfo:e.codeInfo,codeInfoChildren:i,startingId:r,earlyReturnCondition:n});return s}function L6e(t,e){return Ute(t,e,n=>(n==null?void 0:n.rcType)===re.PARAMETER)}function N6e(t,e){return Ute(t,e,n=>n==null?void 0:n.isSelected)}function Hte(t,e){const{hideUnpinnedParams:n}=e.x[t],{codeInfoChildren:r,parentCodeInfoId:i}=S2(t,e);let s=Kw(!0,e.codeInfo,r,i);s=Object.keys(s.requiredParamIdsToPaths),s.reverse();let o=[];return n||(o=Kw(!1,e.codeInfo,r,i),o=Object.keys(o.requiredParamIdsToPaths),o.reverse()),[...s,...o]}function Q6e(t,e){return le(n=>{const r=Dl(t,n).values;return e in r?{value:r[e].value,evRefs:r[e].evRefs}:ZO()},me.isEqual)}function Xte(t){return le(e=>t?e.x[t].variantIds.map(n=>({id:n,name:e.variants[n].name})):[],me.isEqual)}function B6e(t){return le(e=>{const n=e.x[t].parentId;return Dl(n).children.indexOf(t)})}function D7(t){return le(e=>On(t,e).isFrozen)}function Zte(t){return le(e=>({...Gte(t,e),variantIsFrozen:On(t,e).isFrozen}),me.isEqual)}function Gte(t,e){return{renderMarkdown:e.x[t].renderMarkdown,headingAsSectionName:e.x[t].headingAsSectionName,description:Dl(t,e).description}}function j6e(t){return le(e=>{const n=G7(t,e),r=v2(t,e.x);return{forSectionId:r,variantId:n,paramSweep:e.variants[n].sweep,variantIsFrozen:On(t).isFrozen,showParamSweepSectionSearch:!e.x[r].hideSearch&&Bn(r,e)!==re.GLOBAL_VARIABLES}},me.isEqual)}function z6e(t){const e=le(n=>n.x[t].paramSweepSectionId);return Xte(e)}function v2(t,e){var n;return(n=Object.values(e).find(r=>r.paramSweepSectionId===t))==null?void 0:n.id}async function F6e(t,e){switch(Bn(t)){case re.PARAM_SWEEP:return await W6e(t,e);case re.GLOBAL_PARAM_SWEEP:return await q6e(e);case re.GLOBAL_VARIABLES:case re.SECTION:return await V6e(e)}}async function V6e(t){const e=le.getState(),{codeInfoChildren:n,parentCodeInfoId:r}=S2(null,e,t),i=e.codeInfo,s=Kw(!0,i,n,r),o=Kw(!1,i,n,r);s.requiredParamIds=Object.keys(s.requiredParamIdsToPaths),o.requiredParamIds=Object.keys(o.requiredParamIdsToPaths),delete s.requiredParamIdsToPaths,delete o.requiredParamIdsToPaths;const a=e.variants[t];return await on({body:{codeInfo:i,codeInfoChildren:n,sectionVariant:a,pinnedIds:s,unpinnedIds:o},address:re.ROUTE_SECTION_TO_YAML})}async function W6e(t,e){const n=le.getState(),r=v2(t,n.x),s=n.variants[e].sweep,o=n.codeInfo,l=(Vne(r,n)??M7()).children;return await on({body:{sweep:s,codeInfo:o,codeInfoChildren:l},address:re.ROUTE_PARAM_SWEEP_SECTION_TO_YAML})}async function q6e(t){const e=le.getState(),n=e.x,r=e.variants,i=r[t].runGroup;return await on({body:{runGroup:i,sections:n,sectionVariants:r},address:re.ROUTE_GLOBAL_PARAM_SWEEP_SECTION_TO_YAML})}const bL=Symbol.for("yaml.alias"),IR=Symbol.for("yaml.document"),Zd=Symbol.for("yaml.map"),Yte=Symbol.for("yaml.pair"),mf=Symbol.for("yaml.scalar"),GO=Symbol.for("yaml.seq"),Tl=Symbol.for("yaml.node.type"),YO=t=>!!t&&typeof t=="object"&&t[Tl]===bL,I7=t=>!!t&&typeof t=="object"&&t[Tl]===IR,O2=t=>!!t&&typeof t=="object"&&t[Tl]===Zd,Ai=t=>!!t&&typeof t=="object"&&t[Tl]===Yte,jr=t=>!!t&&typeof t=="object"&&t[Tl]===mf,y2=t=>!!t&&typeof t=="object"&&t[Tl]===GO;function ki(t){if(t&&typeof t=="object")switch(t[Tl]){case Zd:case GO:return!0}return!1}function ji(t){if(t&&typeof t=="object")switch(t[Tl]){case bL:case Zd:case mf:case GO:return!0}return!1}const U6e=t=>(jr(t)||ki(t))&&!!t.anchor,jp=Symbol("break visit"),H6e=Symbol("skip children"),aw=Symbol("remove node");function bm(t,e){const n=X6e(e);I7(t)?uv(null,t.contents,n,Object.freeze([t]))===aw&&(t.contents=null):uv(null,t,n,Object.freeze([]))}bm.BREAK=jp;bm.SKIP=H6e;bm.REMOVE=aw;function uv(t,e,n,r){const i=Z6e(t,e,n,r);if(ji(i)||Ai(i))return G6e(t,r,i),uv(t,i,n,r);if(typeof i!="symbol"){if(ki(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){const o=uv(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===jp)return jp;o===aw&&(e.items.splice(s,1),s-=1)}}}else if(Ai(e)){r=Object.freeze(r.concat(e));const s=uv("key",e.key,n,r);if(s===jp)return jp;s===aw&&(e.key=null);const o=uv("value",e.value,n,r);if(o===jp)return jp;o===aw&&(e.value=null)}}return i}function X6e(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Z6e(t,e,n,r){var i,s,o,a,l;if(typeof n=="function")return n(t,e,r);if(O2(e))return(i=n.Map)==null?void 0:i.call(n,t,e,r);if(y2(e))return(s=n.Seq)==null?void 0:s.call(n,t,e,r);if(Ai(e))return(o=n.Pair)==null?void 0:o.call(n,t,e,r);if(jr(e))return(a=n.Scalar)==null?void 0:a.call(n,t,e,r);if(YO(e))return(l=n.Alias)==null?void 0:l.call(n,t,e,r)}function G6e(t,e,n){const r=e[e.length-1];if(ki(r))r.items[t]=n;else if(Ai(r))t==="key"?r.key=n:r.value=n;else if(I7(r))r.contents=n;else{const i=YO(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Y6e={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},K6e=t=>t.replace(/[!,[\]{}]/g,e=>Y6e[e]);class go{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},go.defaultYaml,e),this.tags=Object.assign({},go.defaultTags,n)}clone(){const e=new go(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new go(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:go.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},go.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:go.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},go.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+K6e(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&ji(e.contents)){const s={};bm(e.contents,(o,a)=>{ji(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
|
92
|
+
Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((n,r)=>{let i;e?(i=(o=>{if(typeof o=="string"){const a=o.split("").map(c=>c.charCodeAt(0)).reduce((c,u)=>c+u,1),l=Math.floor(Number(a));return KF(l)}return KF(o)})(e),e=4294967296*i):i=Math.random();let s=r[Math.floor(i*r.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[o,...a]=s.split("");s=o.toUpperCase()+a.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return n?`${n}${this.separator}${s}`:`${s}`},"")}};const JF={separator:"_",dictionaries:[]},Tte=t=>{const e=[...t&&t.dictionaries||JF.dictionaries],n={...JF,...t,length:t&&t.length||e.length,dictionaries:e};if(!t||!t.dictionaries||!t.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new bCe(n).generate()};var Pte=["able","above","absent","absolute","abstract","abundant","academic","acceptable","accepted","accessible","accurate","accused","active","actual","acute","added","additional","adequate","adjacent","administrative","adorable","advanced","adverse","advisory","aesthetic","afraid","aggregate","aggressive","agreeable","agreed","agricultural","alert","alive","alleged","allied","alone","alright","alternative","amateur","amazing","ambitious","amused","ancient","angry","annoyed","annual","anonymous","anxious","appalling","apparent","applicable","appropriate","arbitrary","architectural","armed","arrogant","artificial","artistic","ashamed","asleep","assistant","associated","atomic","attractive","automatic","autonomous","available","average","awake","aware","awful","awkward","back","bad","balanced","bare","basic","beautiful","beneficial","better","bewildered","big","binding","biological","bitter","bizarre","blank","blind","blonde","bloody","blushing","boiling","bold","bored","boring","bottom","brainy","brave","breakable","breezy","brief","bright","brilliant","broad","broken","bumpy","burning","busy","calm","capable","capitalist","careful","casual","causal","cautious","central","certain","changing","characteristic","charming","cheap","cheerful","chemical","chief","chilly","chosen","christian","chronic","chubby","circular","civic","civil","civilian","classic","classical","clean","clear","clever","clinical","close","closed","cloudy","clumsy","coastal","cognitive","coherent","cold","collective","colonial","colorful","colossal","coloured","colourful","combative","combined","comfortable","coming","commercial","common","communist","compact","comparable","comparative","compatible","competent","competitive","complete","complex","complicated","comprehensive","compulsory","conceptual","concerned","concrete","condemned","confident","confidential","confused","conscious","conservation","conservative","considerable","consistent","constant","constitutional","contemporary","content","continental","continued","continuing","continuous","controlled","controversial","convenient","conventional","convinced","convincing","cooing","cool","cooperative","corporate","correct","corresponding","costly","courageous","crazy","creative","creepy","criminal","critical","crooked","crowded","crucial","crude","cruel","cuddly","cultural","curious","curly","current","curved","cute","daily","damaged","damp","dangerous","dark","dead","deaf","deafening","dear","decent","decisive","deep","defeated","defensive","defiant","definite","deliberate","delicate","delicious","delighted","delightful","democratic","dependent","depressed","desirable","desperate","detailed","determined","developed","developing","devoted","different","difficult","digital","diplomatic","direct","dirty","disabled","disappointed","disastrous","disciplinary","disgusted","distant","distinct","distinctive","distinguished","disturbed","disturbing","diverse","divine","dizzy","domestic","dominant","double","doubtful","drab","dramatic","dreadful","driving","drunk","dry","dual","due","dull","dusty","dutch","dying","dynamic","eager","early","eastern","easy","economic","educational","eerie","effective","efficient","elaborate","elated","elderly","eldest","electoral","electric","electrical","electronic","elegant","eligible","embarrassed","embarrassing","emotional","empirical","empty","enchanting","encouraging","endless","energetic","enormous","enthusiastic","entire","entitled","envious","environmental","equal","equivalent","essential","established","estimated","ethical","ethnic","eventual","everyday","evident","evil","evolutionary","exact","excellent","exceptional","excess","excessive","excited","exciting","exclusive","existing","exotic","expected","expensive","experienced","experimental","explicit","extended","extensive","external","extra","extraordinary","extreme","exuberant","faint","fair","faithful","familiar","famous","fancy","fantastic","far","fascinating","fashionable","fast","fat","fatal","favourable","favourite","federal","fellow","female","feminist","few","fierce","filthy","final","financial","fine","firm","fiscal","fit","fixed","flaky","flat","flexible","fluffy","fluttering","flying","following","fond","foolish","foreign","formal","formidable","forthcoming","fortunate","forward","fragile","frail","frantic","free","frequent","fresh","friendly","frightened","front","frozen","full","fun","functional","fundamental","funny","furious","future","fuzzy","gastric","gay","general","generous","genetic","gentle","genuine","geographical","giant","gigantic","given","glad","glamorous","gleaming","global","glorious","golden","good","gorgeous","gothic","governing","graceful","gradual","grand","grateful","greasy","great","grieving","grim","gross","grotesque","growing","grubby","grumpy","guilty","handicapped","handsome","happy","hard","harsh","head","healthy","heavy","helpful","helpless","hidden","high","hilarious","hissing","historic","historical","hollow","holy","homeless","homely","hon","honest","horizontal","horrible","hostile","hot","huge","human","hungry","hurt","hushed","husky","icy","ideal","identical","ideological","ill","illegal","imaginative","immediate","immense","imperial","implicit","important","impossible","impressed","impressive","improved","inadequate","inappropriate","inc","inclined","increased","increasing","incredible","independent","indirect","individual","industrial","inevitable","influential","informal","inherent","initial","injured","inland","inner","innocent","innovative","inquisitive","instant","institutional","insufficient","intact","integral","integrated","intellectual","intelligent","intense","intensive","interested","interesting","interim","interior","intermediate","internal","international","intimate","invisible","involved","irrelevant","isolated","itchy","jealous","jittery","joint","jolly","joyous","judicial","juicy","junior","just","keen","key","kind","known","labour","large","late","latin","lazy","leading","left","legal","legislative","legitimate","lengthy","lesser","level","lexical","liable","liberal","light","like","likely","limited","linear","linguistic","liquid","literary","little","live","lively","living","local","logical","lonely","long","loose","lost","loud","lovely","low","loyal","ltd","lucky","mad","magic","magnetic","magnificent","main","major","male","mammoth","managerial","managing","manual","many","marginal","marine","marked","married","marvellous","marxist","mass","massive","mathematical","mature","maximum","mean","meaningful","mechanical","medical","medieval","melodic","melted","mental","mere","metropolitan","mid","middle","mighty","mild","military","miniature","minimal","minimum","ministerial","minor","miserable","misleading","missing","misty","mixed","moaning","mobile","moderate","modern","modest","molecular","monetary","monthly","moral","motionless","muddy","multiple","mushy","musical","mute","mutual","mysterious","naked","narrow","nasty","national","native","natural","naughty","naval","near","nearby","neat","necessary","negative","neighbouring","nervous","net","neutral","new","nice","noble","noisy","normal","northern","nosy","notable","novel","nuclear","numerous","nursing","nutritious","nutty","obedient","objective","obliged","obnoxious","obvious","occasional","occupational","odd","official","ok","okay","old","olympic","only","open","operational","opposite","optimistic","oral","ordinary","organic","organisational","original","orthodox","other","outdoor","outer","outrageous","outside","outstanding","overall","overseas","overwhelming","painful","pale","panicky","parallel","parental","parliamentary","partial","particular","passing","passive","past","patient","payable","peaceful","peculiar","perfect","permanent","persistent","personal","petite","philosophical","physical","plain","planned","plastic","pleasant","pleased","poised","polite","political","poor","popular","positive","possible","potential","powerful","practical","precious","precise","preferred","pregnant","preliminary","premier","prepared","present","presidential","pretty","previous","prickly","primary","prime","primitive","principal","printed","prior","private","probable","productive","professional","profitable","profound","progressive","prominent","promising","proper","proposed","prospective","protective","protestant","proud","provincial","psychiatric","psychological","public","puny","pure","purring","puzzled","quaint","qualified","quarrelsome","querulous","quick","quickest","quiet","quintessential","quixotic","racial","radical","rainy","random","rapid","rare","raspy","rational","ratty","raw","ready","real","realistic","rear","reasonable","recent","reduced","redundant","regional","registered","regular","regulatory","related","relative","relaxed","relevant","reliable","relieved","religious","reluctant","remaining","remarkable","remote","renewed","representative","repulsive","required","resident","residential","resonant","respectable","respective","responsible","resulting","retail","retired","revolutionary","rich","ridiculous","right","rigid","ripe","rising","rival","roasted","robust","rolling","romantic","rotten","rough","round","royal","rubber","rude","ruling","running","rural","sacred","sad","safe","salty","satisfactory","satisfied","scared","scary","scattered","scientific","scornful","scrawny","screeching","secondary","secret","secure","select","selected","selective","selfish","semantic","senior","sensible","sensitive","separate","serious","severe","sexual","shaggy","shaky","shallow","shared","sharp","sheer","shiny","shivering","shocked","short","shrill","shy","sick","significant","silent","silky","silly","similar","simple","single","skilled","skinny","sleepy","slight","slim","slimy","slippery","slow","small","smart","smiling","smoggy","smooth","social","socialist","soft","solar","sole","solid","sophisticated","sore","sorry","sound","sour","southern","soviet","spare","sparkling","spatial","special","specific","specified","spectacular","spicy","spiritual","splendid","spontaneous","sporting","spotless","spotty","square","squealing","stable","stale","standard","static","statistical","statutory","steady","steep","sticky","stiff","still","stingy","stormy","straight","straightforward","strange","strategic","strict","striking","striped","strong","structural","stuck","stupid","subjective","subsequent","substantial","subtle","successful","successive","sudden","sufficient","suitable","sunny","super","superb","superior","supporting","supposed","supreme","sure","surprised","surprising","surrounding","surviving","suspicious","sweet","swift","symbolic","sympathetic","systematic","tall","tame","tart","tasteless","tasty","technical","technological","teenage","temporary","tender","tense","terrible","territorial","testy","then","theoretical","thick","thin","thirsty","thorough","thoughtful","thoughtless","thundering","tight","tiny","tired","top","tory","total","tough","toxic","traditional","tragic","tremendous","tricky","tropical","troubled","typical","ugliest","ugly","ultimate","unable","unacceptable","unaware","uncertain","unchanged","uncomfortable","unconscious","underground","underlying","unemployed","uneven","unexpected","unfair","unfortunate","unhappy","uniform","uninterested","unique","united","universal","unknown","unlikely","unnecessary","unpleasant","unsightly","unusual","unwilling","upper","upset","uptight","urban","urgent","used","useful","useless","usual","vague","valid","valuable","variable","varied","various","varying","vast","verbal","vertical","very","vicarious","vicious","victorious","violent","visible","visiting","visual","vital","vitreous","vivacious","vivid","vocal","vocational","voiceless","voluminous","voluntary","vulnerable","wandering","warm","wasteful","watery","weak","wealthy","weary","wee","weekly","weird","welcome","well","western","wet","whispering","whole","wicked","wide","widespread","wild","wilful","willing","willowy","wily","wise","wispy","wittering","witty","wonderful","wooden","working","worldwide","worried","worrying","worthwhile","worthy","written","wrong","xenacious","xenial","xenogeneic","xenophobic","xeric","xerothermic","yabbering","yammering","yappiest","yappy","yawning","yearling","yearning","yeasty","yelling","yelping","yielding","yodelling","young","youngest","youthful","ytterbic","yucky","yummy","zany","zealous","zeroth","zestful","zesty","zippy","zonal","zoophagous","zygomorphic","zygotic"],Ate=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];let X4;const xCe=new Uint8Array(16);function wCe(){if(!X4&&(X4=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!X4))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return X4(xCe)}const _s=[];for(let t=0;t<256;++t)_s.push((t+256).toString(16).slice(1));function SCe(t,e=0){return(_s[t[e+0]]+_s[t[e+1]]+_s[t[e+2]]+_s[t[e+3]]+"-"+_s[t[e+4]]+_s[t[e+5]]+"-"+_s[t[e+6]]+_s[t[e+7]]+"-"+_s[t[e+8]]+_s[t[e+9]]+"-"+_s[t[e+10]]+_s[t[e+11]]+_s[t[e+12]]+_s[t[e+13]]+_s[t[e+14]]+_s[t[e+15]]).toLowerCase()}const _Ce=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eV={randomUUID:_Ce};function kCe(t,e,n){if(eV.randomUUID&&!t)return eV.randomUUID();t=t||{};const r=t.random||(t.rng||wCe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,SCe(r)}function Tr(){return kCe()}function DR(t){return t||Tr()}function CCe(t){const e={dictionaries:[Pte,Ate],separator:"_",length:2};let n;for(;!n||t.includes(n);)n=Tte(e);return n}function m2(){return Tte({dictionaries:[Pte,Ate],separator:"_",length:2})}const ECe={id:null,name:"",size:{width:"auto",height:"auto"},parentId:null,variantId:null,uiTypeId:null,uiTypeColId:null,social:"",artifactGroupIds:[],defaultVariantId:null,variantIds:[],paramSweepSectionId:null,nonPresetUITypeIds:[],codeLanguage:"python",runInMemory:!1,isFrozen:!1,isHorizontalOrientation:!1,hideParams:!1,hideSearch:!1,hideUnpinnedParams:!1,displayMode:"GUI",visibility:{DEV:!0,USER:!0},pinnedAreaHeight:"auto",isMinimized:!1,canvasSettings:{activeLayerId:null,color:"#ff0000",brushSize:16,brushShape:"butt",eraserBrushSize:16,drawThrottleDelay:0,canvasTransferQueueLength:50,mode:"draw"},chartSettings:{type:"line",xAxisColumn:"",secondYAxisColumns:[],xAxisLog:!1,y1AxisLog:!1,y2AxisLog:!1},isTemporary:!1,isReadOnlyTerminal:!1,renderMarkdown:!1,positionAndSizeLocked:!1,selectedVariantIds:{},paramFilter:"",isInOtherProjectConfigs:!1,aspectRatio:!1,aspectRatioExtraHeight:0,aspectRatioExtraWidth:0,columnWidth:null,renderedValue:null,subprocessStartMethod:"spawn",headingAsSectionName:!1},TCe={name:"",values:{},children:[],selectedItem:null,code:"",codeInfoColId:null,description:"",evRefs:[],templateVars:[],isFrozen:!1,sweep:[],runGroup:{},configLanguage:"python",isJsonSource:!1,jsonSourceKeys:[],jsonSourceMissing:!1},PCe={id:null,name:"",editable:!1,rcType:"parameter",defaultVal:"",description:"",positionalOnly:!1,isPinned:!1,isFrozen:!1,isSelected:!1,evRefs:[],ignoreTypeErrors:!1},ACe={children:{null:[]}},RCe={value:"",evRefs:[]},MCe={uiTypeId:"3fdaeb6a-e989-4888-b844-17a76f0b0192",nonPresetUITypeIds:[]},$Ce={name:"",path:"",value:null,type:""},Fm={section:ECe,sectionVariant:TCe,codeInfo:PCe,codeInfoCol:ACe,evEntry:RCe,uiTypeColEntry:MCe,artifact:$Ce};function M7(){return me.cloneDeep(Fm.codeInfoCol)}function aL({uiType:t,currValue:e}){switch(t.type){case re.TEXT:case re.PASSWORD:return DCe({currValue:e});case re.SLIDER:return ICe({uiType:t,currValue:e});case re.SWITCH:return LCe({currValue:e});case re.COLOR_PICKER:return NCe({currValue:e});case re.DROPDOWN:return QCe({currValue:e});default:return""}}function DCe({currValue:t}){return me.isNil(t)?"":t}function ICe({uiType:t,currValue:e}){const n=me.toNumber(e);return me.isFinite(n)?me.toString(pf(n,t.config.min,t.config.max)):me.toString(t.config.min)}function LCe({currValue:t}){return me.isNil(t)||t==="0"?"false":"true"}function NCe({currValue:t}){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(t)?t:"#ff0000"}function QCe({currValue:t}){return me.isNil(t)?"":t}function ZO(){return me.cloneDeep(Fm.evEntry)}function ju(t){t?pc.setState({open:t}):pc.getState().reset()}function Pf(t,e){pc.setState({modalType:t,modalData:e,open:!0})}function Rte(){Pf(fi.LOAD_PROJECT_CONFIG)}function Mte(){Pf(fi.SAVE_PROJECT_CONFIG_AS)}function BCe(){Pf(fi.SAVE_PROJECT_CONFIG_AS_WITH_REFS)}function jCe(){Pf(fi.EXPORT_JSON)}function zCe(){Pf(fi.IMPORT_JSON)}function FCe(t){Pf(fi.DELETE_PROJECT_WARNING,t)}function VCe(...t){Pf(fi.RENAME_REFERENCES,t)}function WCe(t){Pf(fi.DELETE_JSON_SOURCE_FILE,t)}function qCe(t){Pf(fi.ADD_ARTIFACT_BY_FILEPATH,t)}function $7(t){return t.split(";base64,")[1]}function lL(t){return $7(t.toDataURL("image/png"))}async function cL(t){const e=ZCe(t),n=new Image;return n.src=e,await n.decode(),n}function UCe(t,e){return e.map(n=>{const r=t[n];return r?lL(r):null})}function HCe(t,e){const n=document.createElement("canvas"),r=t[e[0]];n.width=r.width,n.height=r.height;const i=n.getContext("2d");for(const s of e){const o=t[s];o&&i.drawImage(o,0,0)}return lL(n)}function XCe(t,e){const n=HCe(t,e),r=UCe(t,e);return[n,...r]}function ZCe(t){return t.startsWith("data:image/")?t:`data:image/png;base64,${t}`}async function GCe(t){return await on({body:{artifactIds:t},address:re.ROUTE_LOAD_ARTIFACTS})}async function YCe(t){return await on({body:{sectionType:t},address:re.ROUTE_LOAD_AVAILABLE_ARTIFACTS})}async function KCe(t){return await on({body:{filepath:t},address:re.ROUTE_CHECK_IF_FILE_EXISTS})}async function JCe(t,e){return await on({body:{filepath:t,type:e},address:re.ROUTE_LOAD_ARTIFACT_FROM_DISK})}async function e6e(t){return await on({body:{base64Str:t},address:re.ROUTE_READ_CSV_BASE64})}async function t6e(t){return await on({body:{namesPathsTypes:t},address:re.ROUTE_GET_ARTIFACT_IDS_FROM_NAME_PATH_TYPE})}function n6e(t,e){let n;for(let r of t)r>=e&&(n===void 0||r-e<n-e)&&(n=r);return n}function r6e(t,e){const n=[],{fullNameToInfo:r}=zm.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);if(s in r){const o=r[s];n.push({sectionId:o.sectionId,paramInfoId:o.paramInfoId,isArgsObj:o.isArgsObj,startPos:i.startPos,keyword:s})}}return n}function i6e(t,e){const n=[],{fullNameToSectionId:r}=_7.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);s in r&&n.push({sectionId:r[s],startPos:i.startPos,keyword:s})}return n}function $te(){const t={};for(const[e,n]of Object.entries(zm.getState().fullNameToInfo))t[Dte({sectionId:n.sectionId,paramInfoId:n.paramInfoId,isArgsObj:n.isArgsObj})]=e;return t}function Dte({sectionId:t,paramInfoId:e=null,isArgsObj:n=!1}){return JSON.stringify([t,e,n])}function s6e({fullNameToInfo:t,keyword:e,sectionId:n,paramInfoId:r}){return!(t[e].sectionId===n&&!t[e].paramInfoId||t[e].sectionId===n&&t[e].paramInfoId===r)}function uL({sectionId:t,paramInfoId:e,value:n,regexPatternKey:r}){let i;const s=new Set,{[r]:o,fullNameToInfo:a}=zm.getState();for(;i=o.exec(n);)s6e({fullNameToInfo:a,keyword:i[0],sectionId:t,paramInfoId:e})&&s.add([i[0],i.index]);return Array.from(s)}function hL(t,e){let n;const r=[],{pattern:i,fullNameToSectionId:s}=_7.getState();for(;n=i.exec(e);)s[n[0]]!==t&&r.push([n[0],n.index]);return r}function o6e(t){const e=t.indexOf(re.TEMPLATE_PREFIX,t.indexOf(re.TEMPLATE_PREFIX)+1);return t.substring(e)}async function a6e(){return await on({body:{},address:re.ROUTE_ALL_PROJECT_CONFIG_METADATA})}async function tV(){return await on({body:{},address:re.ROUTE_LOAD_PROJECT_CONFIG_NAMES})}async function l6e(t){return await on({body:{projectConfigName:t},address:re.ROUTE_LOAD_PROJECT_CONFIG})}async function c6e({excludeProjectConfigName:t}){return await on({body:{excludeProjectConfigName:t},address:re.ROUTE_LOAD_FULL_PROJECT})}async function u6e({name:t,previewImgColor:e}){return await on({address:re.ROUTE_CREATE_PROJECT_CONFIG,body:{name:t,previewImgColor:e}})}async function h6e({project:t}){return await on({address:re.ROUTE_SAVE_PROJECT,body:{project:t}})}async function f6e({project:t,newConfigName:e,withRefs:n}){return await on({address:re.ROUTE_SAVE_AS_NEW_PROJECT_CONFIG,body:{project:t,newConfigName:e,withRefs:n}})}async function d6e({project:t,configName:e}){return await on({address:re.ROUTE_SAVE_AS_EXISTING_PROJECT_CONFIG,body:{project:t,configName:e}})}async function p6e(t){return await on({address:re.ROUTE_DELETE_PROJECT_CONFIGS,body:{ids:t}})}async function m6e(){return await on({address:re.ROUTE_GET_DEFAULT_CONFIG_NAME,body:{}})}async function g6e(t){return await on({address:re.ROUTE_SET_AS_DEFAULT_PROJECT,body:{projectId:t}})}async function v6e(t){return await on({address:re.ROUTE_FILTER_DATA_FOR_JSON_EXPORT,body:{project:t}})}async function O6e(t){return await on({address:re.ROUTE_ADD_DEFAULT_DATA_FOR_JSON_IMPORT,body:{project:t}})}async function nV(t){return await on({address:re.ROUTE_SAVE_SETTINGS,body:{settings:t}})}async function y6e(){return await on({address:re.ROUTE_LOAD_SETTINGS,body:{}})}async function b6e(t){return await on({address:re.ROUTE_SAVE_SETTINGS_PROJECT,body:{settingsProject:t}})}async function x6e(){return await on({address:re.ROUTE_LOAD_SETTINGS_PROJECT,body:{}})}function Ite({name:t,...e}){return me.merge(me.cloneDeep(Fm.artifact),{name:t??m2()},e)}function Lte({name:t,...e}){return{name:t??m2(),artifactTransforms:[],visible:!0,layerOpacity:.5,brushOpacity:1,...e}}function fL(t,e,n){return{artifactId:t,...w6e(e,n)}}function w6e(t,e){switch(t){case re.DRAW:return{transform:[1,0,0,1,0,0],eraserStrokes:e==="img"?[]:{}};case re.IMAGE:case re.CHART:case re.CHAT:return{};default:return{}}}const dL=me.throttle(()=>{if(kC.temporal.getState().pastStates.length<=1)return;const e=kC.getState().version;for(const n of jO[Qm.PROJECT_STATE])n.temporal&&e===n.getState().version&&(n.temporal.getState().undo(2),S6e(n));mL(),xn.setState({undoOrRedoWasTriggered:!0})},100);function S6e(t){t.temporal.setState(e=>({pastStates:[...e.pastStates,t.getState()],futureStates:Nte(e.futureStates)}))}function Nte(t){const e=[],n=new Set;for(const r of t)n.has(r.version)||(e.push(r),n.add(r.version));return e}const pL=me.throttle(()=>{const t=kC.getState().version;for(const e of jO[Qm.PROJECT_STATE])e.temporal&&t===e.getState().version&&(e.temporal.getState().redo(),_6e(e));mL(),xn.setState({undoOrRedoWasTriggered:!0})},100);function _6e(t){t.temporal.setState(e=>({pastStates:Nte([...e.pastStates,t.getState()])}))}function k6e(t){let e=!1;for(const r of t)if(r.temporal&&!me.isEqual(r.getState(),r.temporal.getState().pastStates.at(-1))){e=!0;break}if(!e)return;const n=kC.getState().version;for(const r of t)r.temporal&&(r.setState({version:n+1}),C6e(r,()=>r.setState({})))}function C6e(t,e){t.temporal.getState().resume(),e(),t.temporal.getState().pause()}const Wn=me.throttle((t,e=!0)=>{t&&(k6e(jO[Qm.PROJECT_STATE]),e&&mL())},500),mL=me.debounce(()=>{vn.getState().backend.autosave&&U7()},1e3);async function E6e(t,e,n){const r=await GCe(e);if(r.status===200){const i=me.cloneDeep(r.data);if(await T6e(i),n!=null&&n.aborted)return;Hi.setState(s=>({x:{...s.x,...i}})),le.setState(s=>{Vte(e,t,s)}),Wn(!0)}}async function T6e(t){for(const e of Object.values(t))e.value=await Qte(e.type,e.value)}async function Qte(t,e){switch(t){case"img":return await cL(e);case"list":case"brushStrokes":case"chatHistory":return e}}async function P6e(t,e){switch(t){case"img":return await cL(e);case"list":const n=await e6e($7(e));if(n.status==200)return n.data;default:return null}}function A6e(){const t={};for(const[e,n]of Object.entries(Hi.getState().x))typeof n!="function"&&(n.type==="img"&&n.value instanceof Image?t[e]={...n,value:$7(n.value.src)}:t[e]=n);return t}function Bte({sectionId:t,sectionTypeName:e,artifactType:n,state:r}){const i=Tr();Hi.setState(o=>({x:{...o.x,[i]:Ite({type:n,value:[]})}}));const s=Tr();return r.artifactGroups[s]=Lte({artifactTransforms:[fL(i,e,n)]}),r.x[t].artifactGroupIds.push(s),s}function jte(t,e){const n=Bte({sectionId:t,artifactType:"brushStrokes",sectionTypeName:re.DRAW,state:e});e.x[t].canvasSettings.activeLayerId=n}function R6e(t,e){Bte({sectionId:t,artifactType:"chatHistory",sectionTypeName:re.CHAT,state:e})}function zte({sectionId:t,sectionTypeName:e,artifactId:n,artifactType:r,createNewArtifactGroup:i=!1,add:s,state:o}){let a=M6e(t,e,o),l;if(s){(!a||i)&&(a=Tr(),o.artifactGroups[a]=Lte({}),o.x[t].artifactGroupIds.unshift(a));const c=fL(n,e,r);l=o.artifactGroups[a],e===re.DRAW||e===re.CHART?l.artifactTransforms.push(c):l.artifactTransforms=[c]}else l=o.artifactGroups[a],l&&(l.artifactTransforms=l.artifactTransforms.filter(c=>c.artifactId!==n));l&&Vte(l.artifactTransforms.map(c=>c.artifactId),t,o)}async function Fte({sectionId:t,createNewArtifactGroup:e,value:n,artifactType:r,path:i=""}){const s=Tr();Hi.setState(o=>({x:{...o.x,[s]:Ite({value:n,path:i,type:r})}})),le.setState(o=>{const a=Bn(t,o);zte({sectionId:t,sectionTypeName:a,artifactId:s,artifactType:r,createNewArtifactGroup:e,add:!0,state:o})})}function M6e(t,e,n){switch(e){case re.DRAW:return n.x[t].canvasSettings.activeLayerId;case re.IMAGE:case re.CHART:return n.x[t].artifactGroupIds[0]}}function Vte(t,e,n){Bn(e,n)===re.CHART&&Wte(t,e,n)}function Wte(t,e,n){const{chartSettings:r}=n.x[e],i=gL(t.map(o=>Hi.getState().x[o]),r.type),s=Object.keys(i);xn.setState(o=>({chartDisplayedSeriesNames:{...o.chartDisplayedSeriesNames,[e]:s}}))}function gL(t,e){switch(e){case"line":return $6e(t);case"scatter":return D6e(t);default:return{}}}function $6e(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value)){const s=t.length===1?r:`${n.name}/${r}`;e[s]=[...i]}return e}function D6e(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value))r in e||(e[r]=[]),e[r].push(...i);return e}function vL(t){return JSON.stringify([t.name,t.path,t.type])}function qte(t,e,n,r,i,s=null,o=null){const a=[],l=n.filter(h=>i(t[h])).reverse(),c=new Set,u=s?{}:null;for(s&&l.forEach(h=>u[h]=s(t[h])?[h]:[]);l.length>0;){const h=l.pop();if(!h||c.has(h))continue;c.add(h);const f=t[h];if(r(f)&&a.push(f.id),i(f)){const d=e[f.id].slice().reverse();if(s){const g=u[h];d.forEach(v=>{u[v]=s(t[v])?[...g,v]:[...g]})}l.push(...d)}if(a.length>0&&(o!=null&&o(t[a[a.length-1]])))return{ids:a,pathMap:u,earlyReturnTriggered:!0}}return{ids:a,pathMap:u,earlyReturnTriggered:!1}}function OL({allCodeInfo:t,codeInfoChildren:e,startingId:n,additionalOutputCondition:r=null,paramPathCondition:i=null,earlyReturnCondition:s=null}){const o=n?[n]:e[n];return qte(t,e,o??[],l=>(l==null?void 0:l.rcType)===re.PARAMETER&&(!r||r(l)),n?()=>!0:l=>(l==null?void 0:l.rcType)===re.PARAMETER,i,s)}function I6e(t,e){return qte(t,e,e[null]??[],()=>!0,()=>!0)}function g2(t){return OL({...t,paramPathCondition:e=>e.rcType===re.PARAMETER})}function Kw(t,e,n,r){const{ids:i,pathMap:s}=g2({allCodeInfo:e,codeInfoChildren:n,startingId:r});i.reverse();let o=[];const a=new Set,l={};for(const c of i)if(Qke(e[c].isPinned,t)&&(n[c].length===0||n[c].some(u=>u in l)))for(const u of s[c])l[u]=s[u],a.has(s[c][0])||(o.push(s[c][0]),a.add(s[c][0]));return o.reverse(),{requiredParamIdsToPaths:l,topLevelParamIds:o}}function yL(t,e,n){if(e[n].length===1)return t[e[n][0]].name;{let r="";for(const[i,s]of e[n].entries())i===0?r=t[s].name:r+=`["${t[s].name}"]`;return r}}function Ute(t,e,n){const{selectedItem:r}=On(t,e),i=Pl(t,e).children,{earlyReturnTriggered:s}=OL({allCodeInfo:e.codeInfo,codeInfoChildren:i,startingId:r,earlyReturnCondition:n});return s}function L6e(t,e){return Ute(t,e,n=>(n==null?void 0:n.rcType)===re.PARAMETER)}function N6e(t,e){return Ute(t,e,n=>n==null?void 0:n.isSelected)}function Hte(t,e){const{hideUnpinnedParams:n}=e.x[t],{codeInfoChildren:r,parentCodeInfoId:i}=S2(t,e);let s=Kw(!0,e.codeInfo,r,i);s=Object.keys(s.requiredParamIdsToPaths),s.reverse();let o=[];return n||(o=Kw(!1,e.codeInfo,r,i),o=Object.keys(o.requiredParamIdsToPaths),o.reverse()),[...s,...o]}function Q6e(t,e){return le(n=>{const r=Dl(t,n).values;return e in r?{value:r[e].value,evRefs:r[e].evRefs}:ZO()},me.isEqual)}function Xte(t){return le(e=>t?e.x[t].variantIds.map(n=>({id:n,name:e.variants[n].name})):[],me.isEqual)}function B6e(t){return le(e=>{const n=e.x[t].parentId;return Dl(n).children.indexOf(t)})}function D7(t){return le(e=>On(t,e).isFrozen)}function Zte(t){return le(e=>({...Gte(t,e),variantIsFrozen:On(t,e).isFrozen}),me.isEqual)}function Gte(t,e){return{renderMarkdown:e.x[t].renderMarkdown,headingAsSectionName:e.x[t].headingAsSectionName,description:Dl(t,e).description}}function j6e(t){return le(e=>{const n=G7(t,e),r=v2(t,e.x);return{forSectionId:r,variantId:n,paramSweep:e.variants[n].sweep,variantIsFrozen:On(t).isFrozen,showParamSweepSectionSearch:!e.x[r].hideSearch&&Bn(r,e)!==re.GLOBAL_VARIABLES}},me.isEqual)}function z6e(t){const e=le(n=>n.x[t].paramSweepSectionId);return Xte(e)}function v2(t,e){var n;return(n=Object.values(e).find(r=>r.paramSweepSectionId===t))==null?void 0:n.id}async function F6e(t,e){switch(Bn(t)){case re.PARAM_SWEEP:return await W6e(t,e);case re.GLOBAL_PARAM_SWEEP:return await q6e(e);case re.GLOBAL_VARIABLES:case re.SECTION:return await V6e(e)}}async function V6e(t){const e=le.getState(),{codeInfoChildren:n,parentCodeInfoId:r}=S2(null,e,t),i=e.codeInfo,s=Kw(!0,i,n,r),o=Kw(!1,i,n,r);s.requiredParamIds=Object.keys(s.requiredParamIdsToPaths),o.requiredParamIds=Object.keys(o.requiredParamIdsToPaths),delete s.requiredParamIdsToPaths,delete o.requiredParamIdsToPaths;const a=e.variants[t];return await on({body:{codeInfo:i,codeInfoChildren:n,sectionVariant:a,pinnedIds:s,unpinnedIds:o},address:re.ROUTE_SECTION_TO_YAML})}async function W6e(t,e){const n=le.getState(),r=v2(t,n.x),s=n.variants[e].sweep,o=n.codeInfo,l=(Vne(r,n)??M7()).children;return await on({body:{sweep:s,codeInfo:o,codeInfoChildren:l},address:re.ROUTE_PARAM_SWEEP_SECTION_TO_YAML})}async function q6e(t){const e=le.getState(),n=e.x,r=e.variants,i=r[t].runGroup;return await on({body:{runGroup:i,sections:n,sectionVariants:r},address:re.ROUTE_GLOBAL_PARAM_SWEEP_SECTION_TO_YAML})}const bL=Symbol.for("yaml.alias"),IR=Symbol.for("yaml.document"),Zd=Symbol.for("yaml.map"),Yte=Symbol.for("yaml.pair"),mf=Symbol.for("yaml.scalar"),GO=Symbol.for("yaml.seq"),Tl=Symbol.for("yaml.node.type"),YO=t=>!!t&&typeof t=="object"&&t[Tl]===bL,I7=t=>!!t&&typeof t=="object"&&t[Tl]===IR,O2=t=>!!t&&typeof t=="object"&&t[Tl]===Zd,Ai=t=>!!t&&typeof t=="object"&&t[Tl]===Yte,jr=t=>!!t&&typeof t=="object"&&t[Tl]===mf,y2=t=>!!t&&typeof t=="object"&&t[Tl]===GO;function ki(t){if(t&&typeof t=="object")switch(t[Tl]){case Zd:case GO:return!0}return!1}function ji(t){if(t&&typeof t=="object")switch(t[Tl]){case bL:case Zd:case mf:case GO:return!0}return!1}const U6e=t=>(jr(t)||ki(t))&&!!t.anchor,jp=Symbol("break visit"),H6e=Symbol("skip children"),aw=Symbol("remove node");function bm(t,e){const n=X6e(e);I7(t)?uv(null,t.contents,n,Object.freeze([t]))===aw&&(t.contents=null):uv(null,t,n,Object.freeze([]))}bm.BREAK=jp;bm.SKIP=H6e;bm.REMOVE=aw;function uv(t,e,n,r){const i=Z6e(t,e,n,r);if(ji(i)||Ai(i))return G6e(t,r,i),uv(t,i,n,r);if(typeof i!="symbol"){if(ki(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){const o=uv(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===jp)return jp;o===aw&&(e.items.splice(s,1),s-=1)}}}else if(Ai(e)){r=Object.freeze(r.concat(e));const s=uv("key",e.key,n,r);if(s===jp)return jp;s===aw&&(e.key=null);const o=uv("value",e.value,n,r);if(o===jp)return jp;o===aw&&(e.value=null)}}return i}function X6e(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Z6e(t,e,n,r){var i,s,o,a,l;if(typeof n=="function")return n(t,e,r);if(O2(e))return(i=n.Map)==null?void 0:i.call(n,t,e,r);if(y2(e))return(s=n.Seq)==null?void 0:s.call(n,t,e,r);if(Ai(e))return(o=n.Pair)==null?void 0:o.call(n,t,e,r);if(jr(e))return(a=n.Scalar)==null?void 0:a.call(n,t,e,r);if(YO(e))return(l=n.Alias)==null?void 0:l.call(n,t,e,r)}function G6e(t,e,n){const r=e[e.length-1];if(ki(r))r.items[t]=n;else if(Ai(r))t==="key"?r.key=n:r.value=n;else if(I7(r))r.contents=n;else{const i=YO(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Y6e={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},K6e=t=>t.replace(/[!,[\]{}]/g,e=>Y6e[e]);class go{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},go.defaultYaml,e),this.tags=Object.assign({},go.defaultTags,n)}clone(){const e=new go(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new go(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:go.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},go.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:go.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},go.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+K6e(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&ji(e.contents)){const s={};bm(e.contents,(o,a)=>{ji(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
|
93
93
|
`)}}go.defaultYaml={explicit:!1,version:"1.2"};go.defaultTags={"!!":"tag:yaml.org,2002:"};function Kte(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function Jte(t){const e=new Set;return bm(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function ene(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function J6e(t,e){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i||(i=Jte(t));const o=ene(e,i);return i.add(o),o},setAnchors:()=>{for(const s of n){const o=r.get(s);if(typeof o=="object"&&o.anchor&&(jr(o.node)||ki(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}function hv(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){const o=r[i],a=hv(t,r,String(i),o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const s=r.get(i),o=hv(t,r,i,s);o===void 0?r.delete(i):o!==s&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const s=hv(t,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(const[i,s]of Object.entries(r)){const o=hv(t,r,i,s);o===void 0?delete r[i]:o!==s&&(r[i]=o)}return t.call(e,n,r)}function Sl(t,e,n){if(Array.isArray(t))return t.map((r,i)=>Sl(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!U6e(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class xL{constructor(e){Object.defineProperty(this,Tl,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!I7(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Sl(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof s=="function"?hv(s,{"":a},"",a):a}}let wL=class extends xL{constructor(e){super(bL),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return bm(e,{Node:(r,i)=>{if(i===this)return bm.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(e,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(Sl(o,null,n),a=r.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=u3(i,o,r)),a.count*a.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,r){const i=`*${this.source}`;if(e){if(Kte(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function u3(t,e,n){if(YO(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(ki(e)){let r=0;for(const i of e.items){const s=u3(t,i,n);s>r&&(r=s)}return r}else if(Ai(e)){const r=u3(t,e.key,n),i=u3(t,e.value,n);return Math.max(r,i)}return 1}const tne=t=>!t||typeof t!="function"&&typeof t!="object";class fn extends xL{constructor(e){super(mf),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:Sl(this.value,e,n)}toString(){return String(this.value)}}fn.BLOCK_FOLDED="BLOCK_FOLDED";fn.BLOCK_LITERAL="BLOCK_LITERAL";fn.PLAIN="PLAIN";fn.QUOTE_DOUBLE="QUOTE_DOUBLE";fn.QUOTE_SINGLE="QUOTE_SINGLE";const e7e="tag:yaml.org,2002:";function t7e(t,e,n){if(e){const r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,t))&&!r.format})}function Jw(t,e,n){var h,f,d;if(I7(t)&&(t=t.contents),ji(t))return t;if(Ai(t)){const g=(f=(h=n.schema[Zd]).createNode)==null?void 0:f.call(h,n.schema,null,n);return g.items.push(t),g}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n;let l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor||(l.anchor=i(t)),new wL(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=e7e+e.slice(2));let c=t7e(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const g=new fn(t);return l&&(l.node=g),g}c=t instanceof Map?o[Zd]:Symbol.iterator in Object(t)?o[GO]:o[Zd]}s&&(s(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,t,n):typeof((d=c==null?void 0:c.nodeClass)==null?void 0:d.from)=="function"?c.nodeClass.from(n.schema,t,n):new fn(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function PC(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){const s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return Jw(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Ax=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;let nne=class extends xL{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>ji(r)||Ai(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Ax(e))this.add(n);else{const[r,...i]=e,s=this.get(r,!0);if(ki(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,PC(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){const[n,...r]=e;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(ki(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&jr(s)?s.value:s:ki(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Ai(n))return!1;const r=n.value;return r==null||e&&jr(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(r.length===0)return this.has(n);const i=this.get(n,!0);return ki(i)?i.hasIn(r):!1}setIn(e,n){const[r,...i]=e;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(ki(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,PC(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};const n7e=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Gh(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const rm=(t,e,n)=>t.endsWith(`
|
94
94
|
`)?Gh(n,e):n.includes(`
|
95
95
|
`)?`
|
@@ -300,7 +300,7 @@ WARNING: This link could potentially be dangerous`)){const y=window.open();if(y)
|
|
300
300
|
`:`
|
301
301
|
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),y.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(A){const D=this._getMouseBufferCoords(A),N=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!!(N&&W&&D)&&this._areCoordsInSelection(D,N,W)}isCellInSelection(A,D){const N=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!(!N||!W)&&this._areCoordsInSelection([A,D],N,W)}_areCoordsInSelection(A,D,N){return A[1]>D[1]&&A[1]<N[1]||D[1]===N[1]&&A[1]===D[1]&&A[0]>=D[0]&&A[0]<N[0]||D[1]<N[1]&&A[1]===N[1]&&A[0]<N[0]||D[1]<N[1]&&A[1]===D[1]&&A[0]>=D[0]}_selectWordAtCursor(A,D){var N,W;const F=(W=(N=this._linkifier.currentLink)===null||N===void 0?void 0:N.link)===null||W===void 0?void 0:W.range;if(F)return this._model.selectionStart=[F.start.x-1,F.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(F,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(A);return!!H&&(this._selectWordAt(H,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,D){this._model.clearSelection(),A=Math.max(A,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const D=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(A){let D=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const N=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=N?0:(D>N&&(D-=N),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(A){return y.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const D=this._getMouseBufferCoords(A);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(A){return A.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const N=this._bufferService.buffer;if(this._model.selectionEnd[1]<N.lines.length){const W=N.lines.get(this._model.selectionEnd[1]);W&&W.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}D&&D[0]===this._model.selectionEnd[0]&&D[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const D=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const N=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(N&&N[0]!==void 0&&N[1]!==void 0){const W=(0,f.moveToCellSequence)(N[0]-1,N[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(W,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,N=!(!A||!D||A[0]===D[0]&&A[1]===D[1]);N?A&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,D,N)):this._oldHasSelection&&this._fireOnSelectionChange(A,D,N)}_fireOnSelectionChange(A,D,N){this._oldSelectionStart=A,this._oldSelectionEnd=D,this._oldHasSelection=N,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim(D=>this._handleTrim(D))}_convertViewportColToCharacterIndex(A,D){let N=D;for(let W=0;D>=W;W++){const F=A.loadCell(W,this._workCell).getChars().length;this._workCell.getWidth()===0?N--:F>1&&D!==W&&(N+=F-1)}return N}setSelection(A,D,N){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,D],this._model.selectionStartLength=N,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,D,N=!0,W=!0){if(A[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,H=F.lines.get(A[1]);if(!H)return;const V=F.translateBufferLineToString(A[1],!1);let K=this._convertViewportColToCharacterIndex(H,A[0]),ne=K;const oe=A[0]-K;let B=0,q=0,I=0,Z=0;if(V.charAt(K)===" "){for(;K>0&&V.charAt(K-1)===" ";)K--;for(;ne<V.length&&V.charAt(ne+1)===" ";)ne++}else{let ge=A[0],ve=A[0];H.getWidth(ge)===0&&(B++,ge--),H.getWidth(ve)===2&&(q++,ve++);const _e=H.getString(ve).length;for(_e>1&&(Z+=_e-1,ne+=_e-1);ge>0&&K>0&&!this._isCharWordSeparator(H.loadCell(ge-1,this._workCell));){H.loadCell(ge-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(B++,ge--):X>1&&(I+=X-1,K-=X-1),K--,ge--}for(;ve<H.length&&ne+1<V.length&&!this._isCharWordSeparator(H.loadCell(ve+1,this._workCell));){H.loadCell(ve+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(q++,ve++):X>1&&(Z+=X-1,ne+=X-1),ne++,ve++}}ne++;let ce=K+oe-B+I,ee=Math.min(this._bufferService.cols,ne-K+B+q-I-Z);if(D||V.slice(K,ne).trim()!==""){if(N&&ce===0&&H.getCodePoint(0)!==32){const ge=F.lines.get(A[1]-1);if(ge&&H.isWrapped&&ge.getCodePoint(this._bufferService.cols-1)!==32){const ve=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ve){const _e=this._bufferService.cols-ve.start;ce-=_e,ee+=_e}}}if(W&&ce+ee===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const ge=F.lines.get(A[1]+1);if(ge!=null&&ge.isWrapped&&ge.getCodePoint(0)!==32){const ve=this._getWordAt([0,A[1]+1],!1,!1,!0);ve&&(ee+=ve.length)}}return{start:ce,length:ee}}}_selectWordAt(A,D){const N=this._getWordAt(A,D);if(N){for(;N.start<0;)N.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[N.start,A[1]],this._model.selectionStartLength=N.length}}_selectToWordAt(A){const D=this._getWordAt(A,!0);if(D){let N=A[1];for(;D.start<0;)D.start+=this._bufferService.cols,N--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,N++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,N]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const D=this._bufferService.buffer.getWrappedRangeForLine(A),N={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(N,this._bufferService.cols)}};a.SelectionService=R=c([u(3,k.IBufferService),u(4,k.ICoreService),u(5,g.IMouseService),u(6,k.IOptionsService),u(7,g.IRenderService),u(8,g.ICoreBrowserService)],R)},4725:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const c=l(8343);a.ICharSizeService=(0,c.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),a.IMouseService=(0,c.createDecorator)("MouseService"),a.IRenderService=(0,c.createDecorator)("RenderService"),a.ISelectionService=(0,c.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(o,a,l){var c=this&&this.__decorate||function(R,A,D,N){var W,F=arguments.length,H=F<3?A:N===null?N=Object.getOwnPropertyDescriptor(A,D):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(R,A,D,N);else for(var V=R.length-1;V>=0;V--)(W=R[V])&&(H=(F<3?W(H):F>3?W(A,D,H):W(A,D))||H);return F>3&&H&&Object.defineProperty(A,D,H),H},u=this&&this.__param||function(R,A){return function(D,N){A(D,N,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const h=l(7239),f=l(8055),d=l(8460),g=l(844),v=l(2585),m=f.css.toColor("#ffffff"),y=f.css.toColor("#000000"),x=f.css.toColor("#ffffff"),w=f.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let D=0;D<216;D++){const N=A[D/36%6|0],W=A[D/6%6|0],F=A[D%6];R.push({css:f.channels.toCss(N,W,F),rgba:f.channels.toRgba(N,W,F)})}for(let D=0;D<24;D++){const N=8+10*D;R.push({css:f.channels.toCss(N,N,N),rgba:f.channels.toRgba(N,N,N)})}return R})());let T=a.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new d.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:y,cursor:x,cursorAccent:w,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:f.color.blend(y,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:f.color.blend(y,k),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(R={}){const A=this._colors;if(A.foreground=P(R.foreground,m),A.background=P(R.background,y),A.cursor=P(R.cursor,x),A.cursorAccent=P(R.cursorAccent,w),A.selectionBackgroundTransparent=P(R.selectionBackground,k),A.selectionBackgroundOpaque=f.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=P(R.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=f.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=R.selectionForeground?P(R.selectionForeground,f.NULL_COLOR):void 0,A.selectionForeground===f.NULL_COLOR&&(A.selectionForeground=void 0),f.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=f.color.opacity(A.selectionBackgroundTransparent,.3)),f.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=f.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=a.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=P(R.black,a.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=P(R.red,a.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=P(R.green,a.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=P(R.yellow,a.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=P(R.blue,a.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=P(R.magenta,a.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=P(R.cyan,a.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=P(R.white,a.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=P(R.brightBlack,a.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=P(R.brightRed,a.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=P(R.brightGreen,a.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=P(R.brightYellow,a.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=P(R.brightBlue,a.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=P(R.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=P(R.brightCyan,a.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=P(R.brightWhite,a.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const D=Math.min(A.ansi.length-16,R.extendedAnsi.length);for(let N=0;N<D;N++)A.ansi[N+16]=P(R.extendedAnsi[N],a.DEFAULT_ANSI_COLORS[N+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[R]=this._restoreColors.ansi[R]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(R){R(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function P(R,A){if(R!==void 0)try{return f.css.toColor(R)}catch{}return A}a.ThemeService=T=c([u(0,v.IOptionsService)],T)},6349:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const c=l(8460),u=l(844);class h extends u.Disposable{constructor(d){super(),this._maxLength=d,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(d){if(this._maxLength===d)return;const g=new Array(d);for(let v=0;v<Math.min(d,this.length);v++)g[v]=this._array[this._getCyclicIndex(v)];this._array=g,this._maxLength=d,this._startIndex=0}get length(){return this._length}set length(d){if(d>this._length)for(let g=this._length;g<d;g++)this._array[g]=void 0;this._length=d}get(d){return this._array[this._getCyclicIndex(d)]}set(d,g){this._array[this._getCyclicIndex(d)]=g}push(d){this._array[this._getCyclicIndex(this._length)]=d,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(d,g,...v){if(g){for(let m=d;m<this._length-g;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+g)];this._length-=g,this.onDeleteEmitter.fire({index:d,amount:g})}for(let m=this._length-1;m>=d;m--)this._array[this._getCyclicIndex(m+v.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<v.length;m++)this._array[this._getCyclicIndex(d+m)]=v[m];if(v.length&&this.onInsertEmitter.fire({index:d,amount:v.length}),this._length+v.length>this._maxLength){const m=this._length+v.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=v.length}trimStart(d){d>this._length&&(d=this._length),this._startIndex+=d,this._length-=d,this.onTrimEmitter.fire(d)}shiftElements(d,g,v){if(!(g<=0)){if(d<0||d>=this._length)throw new Error("start argument out of range");if(d+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let y=g-1;y>=0;y--)this.set(d+y+v,this.get(d+y));const m=d+g+v-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<g;m++)this.set(d+m+v,this.get(d+m))}}_getCyclicIndex(d){return(this._startIndex+d)%this._maxLength}}a.CircularList=h},1439:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function l(c,u=5){if(typeof c!="object")return c;const h=Array.isArray(c)?[]:{};for(const f in c)h[f]=u<=1?c[f]:c[f]&&l(c[f],u-1);return h}},8055:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;const c=l(6114);let u=0,h=0,f=0,d=0;var g,v,m,y,x;function w(T){const P=T.toString(16);return P.length<2?"0"+P:P}function k(T,P){return T<P?(P+.05)/(T+.05):(T+.05)/(P+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(T){T.toCss=function(P,R,A,D){return D!==void 0?`#${w(P)}${w(R)}${w(A)}${w(D)}`:`#${w(P)}${w(R)}${w(A)}`},T.toRgba=function(P,R,A,D=255){return(P<<24|R<<16|A<<8|D)>>>0}}(g||(a.channels=g={})),function(T){function P(R,A){return d=Math.round(255*A),[u,h,f]=x.toChannels(R.rgba),{css:g.toCss(u,h,f,d),rgba:g.toRgba(u,h,f,d)}}T.blend=function(R,A){if(d=(255&A.rgba)/255,d===1)return{css:A.css,rgba:A.rgba};const D=A.rgba>>24&255,N=A.rgba>>16&255,W=A.rgba>>8&255,F=R.rgba>>24&255,H=R.rgba>>16&255,V=R.rgba>>8&255;return u=F+Math.round((D-F)*d),h=H+Math.round((N-H)*d),f=V+Math.round((W-V)*d),{css:g.toCss(u,h,f),rgba:g.toRgba(u,h,f)}},T.isOpaque=function(R){return(255&R.rgba)==255},T.ensureContrastRatio=function(R,A,D){const N=x.ensureContrastRatio(R.rgba,A.rgba,D);if(N)return x.toColor(N>>24&255,N>>16&255,N>>8&255)},T.opaque=function(R){const A=(255|R.rgba)>>>0;return[u,h,f]=x.toChannels(A),{css:g.toCss(u,h,f),rgba:A}},T.opacity=P,T.multiplyOpacity=function(R,A){return d=255&R.rgba,P(R,d*A/255)},T.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}}(v||(a.color=v={})),function(T){let P,R;if(!c.isNode){const A=document.createElement("canvas");A.width=1,A.height=1;const D=A.getContext("2d",{willReadFrequently:!0});D&&(P=D,P.globalCompositeOperation="copy",R=P.createLinearGradient(0,0,1,1))}T.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return u=parseInt(A.slice(1,2).repeat(2),16),h=parseInt(A.slice(2,3).repeat(2),16),f=parseInt(A.slice(3,4).repeat(2),16),x.toColor(u,h,f);case 5:return u=parseInt(A.slice(1,2).repeat(2),16),h=parseInt(A.slice(2,3).repeat(2),16),f=parseInt(A.slice(3,4).repeat(2),16),d=parseInt(A.slice(4,5).repeat(2),16),x.toColor(u,h,f,d);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const D=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),h=parseInt(D[2]),f=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),x.toColor(u,h,f,d);if(!P||!R)throw new Error("css.toColor: Unsupported css format");if(P.fillStyle=R,P.fillStyle=A,typeof P.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(P.fillRect(0,0,1,1),[u,h,f,d]=P.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,h,f,d),css:A}}}(m||(a.css=m={})),function(T){function P(R,A,D){const N=R/255,W=A/255,F=D/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4))+.0722*(F<=.03928?F/12.92:Math.pow((F+.055)/1.055,2.4))}T.relativeLuminance=function(R){return P(R>>16&255,R>>8&255,255&R)},T.relativeLuminance2=P}(y||(a.rgb=y={})),function(T){function P(A,D,N){const W=A>>24&255,F=A>>16&255,H=A>>8&255;let V=D>>24&255,K=D>>16&255,ne=D>>8&255,oe=k(y.relativeLuminance2(V,K,ne),y.relativeLuminance2(W,F,H));for(;oe<N&&(V>0||K>0||ne>0);)V-=Math.max(0,Math.ceil(.1*V)),K-=Math.max(0,Math.ceil(.1*K)),ne-=Math.max(0,Math.ceil(.1*ne)),oe=k(y.relativeLuminance2(V,K,ne),y.relativeLuminance2(W,F,H));return(V<<24|K<<16|ne<<8|255)>>>0}function R(A,D,N){const W=A>>24&255,F=A>>16&255,H=A>>8&255;let V=D>>24&255,K=D>>16&255,ne=D>>8&255,oe=k(y.relativeLuminance2(V,K,ne),y.relativeLuminance2(W,F,H));for(;oe<N&&(V<255||K<255||ne<255);)V=Math.min(255,V+Math.ceil(.1*(255-V))),K=Math.min(255,K+Math.ceil(.1*(255-K))),ne=Math.min(255,ne+Math.ceil(.1*(255-ne))),oe=k(y.relativeLuminance2(V,K,ne),y.relativeLuminance2(W,F,H));return(V<<24|K<<16|ne<<8|255)>>>0}T.ensureContrastRatio=function(A,D,N){const W=y.relativeLuminance(A>>8),F=y.relativeLuminance(D>>8);if(k(W,F)<N){if(F<W){const K=P(A,D,N),ne=k(W,y.relativeLuminance(K>>8));if(ne<N){const oe=R(A,D,N);return ne>k(W,y.relativeLuminance(oe>>8))?K:oe}return K}const H=R(A,D,N),V=k(W,y.relativeLuminance(H>>8));if(V<N){const K=P(A,D,N);return V>k(W,y.relativeLuminance(K>>8))?H:K}return H}},T.reduceLuminance=P,T.increaseLuminance=R,T.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]},T.toColor=function(A,D,N,W){return{css:g.toCss(A,D,N,W),rgba:g.toRgba(A,D,N,W)}}}(x||(a.rgba=x={})),a.toPaddedHex=w,a.contrastRatio=k},8969:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const c=l(844),u=l(2585),h=l(4348),f=l(7866),d=l(744),g=l(7302),v=l(6975),m=l(8460),y=l(1753),x=l(1480),w=l(7994),k=l(9282),T=l(5435),P=l(5981),R=l(2660);let A=!1;class D extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event(W=>{var F;(F=this._onScrollApi)===null||F===void 0||F.fire(W.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(W){for(const F in W)this.optionsService.options[F]=W[F]}constructor(W){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new g.OptionsService(W)),this._instantiationService.setService(u.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(d.BufferService)),this._instantiationService.setService(u.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(u.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(u.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(u.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(u.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(w.CharsetService),this._instantiationService.setService(u.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(u.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new P.WriteBuffer((F,H)=>this._inputHandler.parse(F,H))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(W,F){this._writeBuffer.write(W,F)}writeSync(W,F){this._logService.logLevel<=u.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(W,F)}resize(W,F){isNaN(W)||isNaN(F)||(W=Math.max(W,d.MINIMUM_COLS),F=Math.max(F,d.MINIMUM_ROWS),this._bufferService.resize(W,F))}scroll(W,F=!1){this._bufferService.scroll(W,F)}scrollLines(W,F,H){this._bufferService.scrollLines(W,F,H)}scrollPages(W){this.scrollLines(W*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(W){const F=W-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(W,F){return this._inputHandler.registerEscHandler(W,F)}registerDcsHandler(W,F){return this._inputHandler.registerDcsHandler(W,F)}registerCsiHandler(W,F){return this._inputHandler.registerCsiHandler(W,F)}registerOscHandler(W,F){return this._inputHandler.registerOscHandler(W,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let W=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?W=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(W=!0),W?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const W=[];W.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),W.push(this.registerCsiHandler({final:"H"},()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const F of W)F.dispose()})}}}a.CoreTerminal=D},8460:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const u=[];for(let h=0;h<this._listeners.length;h++)u.push(this._listeners[h]);for(let h=0;h<u.length;h++)u[h].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,c){return l(u=>c.fire(u))}},5435:function(o,a,l){var c=this&&this.__decorate||function(oe,B,q,I){var Z,ce=arguments.length,ee=ce<3?B:I===null?I=Object.getOwnPropertyDescriptor(B,q):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(oe,B,q,I);else for(var ge=oe.length-1;ge>=0;ge--)(Z=oe[ge])&&(ee=(ce<3?Z(ee):ce>3?Z(B,q,ee):Z(B,q))||ee);return ce>3&&ee&&Object.defineProperty(B,q,ee),ee},u=this&&this.__param||function(oe,B){return function(q,I){B(q,I,oe)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const h=l(2584),f=l(7116),d=l(2015),g=l(844),v=l(482),m=l(8437),y=l(8460),x=l(643),w=l(511),k=l(3734),T=l(2585),P=l(6242),R=l(6351),A=l(5941),D={"(":0,")":1,"*":2,"+":3,"-":1,".":2},N=131072;function W(oe,B){if(oe>24)return B.setWinLines||!1;switch(oe){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var F;(function(oe){oe[oe.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",oe[oe.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(a.WindowsOptionsReportType=F={}));let H=0;class V extends g.Disposable{getAttrData(){return this._curAttrData}constructor(B,q,I,Z,ce,ee,ge,ve,_e=new d.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=q,this._coreService=I,this._logService=Z,this._optionsService=ce,this._oscLinkService=ee,this._coreMouseService=ge,this._unicodeService=ve,this._parser=_e,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new w.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(X=>this._activeBuffer=X.activeBuffer)),this._parser.setCsiHandlerFallback((X,ue)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(X),params:ue.toArray()})}),this._parser.setEscHandlerFallback(X=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(X)})}),this._parser.setExecuteHandlerFallback(X=>{this._logService.debug("Unknown EXECUTE code: ",{code:X})}),this._parser.setOscHandlerFallback((X,ue,Oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:X,action:ue,data:Oe})}),this._parser.setDcsHandlerFallback((X,ue,Oe)=>{ue==="HOOK"&&(Oe=Oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(X),action:ue,payload:Oe})}),this._parser.setPrintHandler((X,ue,Oe)=>this.print(X,ue,Oe)),this._parser.registerCsiHandler({final:"@"},X=>this.insertChars(X)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},X=>this.scrollLeft(X)),this._parser.registerCsiHandler({final:"A"},X=>this.cursorUp(X)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},X=>this.scrollRight(X)),this._parser.registerCsiHandler({final:"B"},X=>this.cursorDown(X)),this._parser.registerCsiHandler({final:"C"},X=>this.cursorForward(X)),this._parser.registerCsiHandler({final:"D"},X=>this.cursorBackward(X)),this._parser.registerCsiHandler({final:"E"},X=>this.cursorNextLine(X)),this._parser.registerCsiHandler({final:"F"},X=>this.cursorPrecedingLine(X)),this._parser.registerCsiHandler({final:"G"},X=>this.cursorCharAbsolute(X)),this._parser.registerCsiHandler({final:"H"},X=>this.cursorPosition(X)),this._parser.registerCsiHandler({final:"I"},X=>this.cursorForwardTab(X)),this._parser.registerCsiHandler({final:"J"},X=>this.eraseInDisplay(X,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},X=>this.eraseInDisplay(X,!0)),this._parser.registerCsiHandler({final:"K"},X=>this.eraseInLine(X,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},X=>this.eraseInLine(X,!0)),this._parser.registerCsiHandler({final:"L"},X=>this.insertLines(X)),this._parser.registerCsiHandler({final:"M"},X=>this.deleteLines(X)),this._parser.registerCsiHandler({final:"P"},X=>this.deleteChars(X)),this._parser.registerCsiHandler({final:"S"},X=>this.scrollUp(X)),this._parser.registerCsiHandler({final:"T"},X=>this.scrollDown(X)),this._parser.registerCsiHandler({final:"X"},X=>this.eraseChars(X)),this._parser.registerCsiHandler({final:"Z"},X=>this.cursorBackwardTab(X)),this._parser.registerCsiHandler({final:"`"},X=>this.charPosAbsolute(X)),this._parser.registerCsiHandler({final:"a"},X=>this.hPositionRelative(X)),this._parser.registerCsiHandler({final:"b"},X=>this.repeatPrecedingCharacter(X)),this._parser.registerCsiHandler({final:"c"},X=>this.sendDeviceAttributesPrimary(X)),this._parser.registerCsiHandler({prefix:">",final:"c"},X=>this.sendDeviceAttributesSecondary(X)),this._parser.registerCsiHandler({final:"d"},X=>this.linePosAbsolute(X)),this._parser.registerCsiHandler({final:"e"},X=>this.vPositionRelative(X)),this._parser.registerCsiHandler({final:"f"},X=>this.hVPosition(X)),this._parser.registerCsiHandler({final:"g"},X=>this.tabClear(X)),this._parser.registerCsiHandler({final:"h"},X=>this.setMode(X)),this._parser.registerCsiHandler({prefix:"?",final:"h"},X=>this.setModePrivate(X)),this._parser.registerCsiHandler({final:"l"},X=>this.resetMode(X)),this._parser.registerCsiHandler({prefix:"?",final:"l"},X=>this.resetModePrivate(X)),this._parser.registerCsiHandler({final:"m"},X=>this.charAttributes(X)),this._parser.registerCsiHandler({final:"n"},X=>this.deviceStatus(X)),this._parser.registerCsiHandler({prefix:"?",final:"n"},X=>this.deviceStatusPrivate(X)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},X=>this.softReset(X)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},X=>this.setCursorStyle(X)),this._parser.registerCsiHandler({final:"r"},X=>this.setScrollRegion(X)),this._parser.registerCsiHandler({final:"s"},X=>this.saveCursor(X)),this._parser.registerCsiHandler({final:"t"},X=>this.windowOptions(X)),this._parser.registerCsiHandler({final:"u"},X=>this.restoreCursor(X)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},X=>this.insertColumns(X)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},X=>this.deleteColumns(X)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},X=>this.selectProtected(X)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},X=>this.requestMode(X,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},X=>this.requestMode(X,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new P.OscHandler(X=>(this.setTitle(X),this.setIconName(X),!0))),this._parser.registerOscHandler(1,new P.OscHandler(X=>this.setIconName(X))),this._parser.registerOscHandler(2,new P.OscHandler(X=>this.setTitle(X))),this._parser.registerOscHandler(4,new P.OscHandler(X=>this.setOrReportIndexedColor(X))),this._parser.registerOscHandler(8,new P.OscHandler(X=>this.setHyperlink(X))),this._parser.registerOscHandler(10,new P.OscHandler(X=>this.setOrReportFgColor(X))),this._parser.registerOscHandler(11,new P.OscHandler(X=>this.setOrReportBgColor(X))),this._parser.registerOscHandler(12,new P.OscHandler(X=>this.setOrReportCursorColor(X))),this._parser.registerOscHandler(104,new P.OscHandler(X=>this.restoreIndexedColor(X))),this._parser.registerOscHandler(110,new P.OscHandler(X=>this.restoreFgColor(X))),this._parser.registerOscHandler(111,new P.OscHandler(X=>this.restoreBgColor(X))),this._parser.registerOscHandler(112,new P.OscHandler(X=>this.restoreCursorColor(X))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const X in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:X},()=>this.selectCharset("("+X)),this._parser.registerEscHandler({intermediates:")",final:X},()=>this.selectCharset(")"+X)),this._parser.registerEscHandler({intermediates:"*",final:X},()=>this.selectCharset("*"+X)),this._parser.registerEscHandler({intermediates:"+",final:X},()=>this.selectCharset("+"+X)),this._parser.registerEscHandler({intermediates:"-",final:X},()=>this.selectCharset("-"+X)),this._parser.registerEscHandler({intermediates:".",final:X},()=>this.selectCharset("."+X)),this._parser.registerEscHandler({intermediates:"/",final:X},()=>this.selectCharset("/"+X));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(X=>(this._logService.error("Parsing error: ",X),X)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new R.DcsHandler((X,ue)=>this.requestStatusString(X,ue)))}_preserveStack(B,q,I,Z){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=q,this._parseStack.decodedLength=I,this._parseStack.position=Z}_logSlowResolvingAsync(B){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([B,new Promise((q,I)=>setTimeout(()=>I("#SLOW_TIMEOUT"),5e3))]).catch(q=>{if(q!=="#SLOW_TIMEOUT")throw q;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,q){let I,Z=this._activeBuffer.x,ce=this._activeBuffer.y,ee=0;const ge=this._parseStack.paused;if(ge){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,q))return this._logSlowResolvingAsync(I),I;Z=this._parseStack.cursorStartX,ce=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>N&&(ee=this._parseStack.position+N)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,ve=>String.fromCharCode(ve)).join("")}"`),typeof B=="string"?B.split("").map(ve=>ve.charCodeAt(0)):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<N&&(this._parseBuffer=new Uint32Array(Math.min(B.length,N))),ge||this._dirtyRowTracker.clearRange(),B.length>N)for(let ve=ee;ve<B.length;ve+=N){const _e=ve+N<B.length?ve+N:B.length,X=typeof B=="string"?this._stringDecoder.decode(B.substring(ve,_e),this._parseBuffer):this._utf8Decoder.decode(B.subarray(ve,_e),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,X))return this._preserveStack(Z,ce,X,ve),this._logSlowResolvingAsync(I),I}else if(!ge){const ve=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,ve))return this._preserveStack(Z,ce,ve,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===Z&&this._activeBuffer.y===ce||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(B,q,I){let Z,ce;const ee=this._charsetService.charset,ge=this._optionsService.rawOptions.screenReaderMode,ve=this._bufferService.cols,_e=this._coreService.decPrivateModes.wraparound,X=this._coreService.modes.insertMode,ue=this._curAttrData;let Oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-q>0&&Oe.getWidth(this._activeBuffer.x-1)===2&&Oe.setCellFromCodePoint(this._activeBuffer.x-1,0,1,ue.fg,ue.bg,ue.extended);for(let ke=q;ke<I;++ke){if(Z=B[ke],ce=this._unicodeService.wcwidth(Z),Z<127&&ee){const qe=ee[String.fromCharCode(Z)];qe&&(Z=qe.charCodeAt(0))}if(ge&&this._onA11yChar.fire((0,v.stringFromCodePoint)(Z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),ce||!this._activeBuffer.x){if(this._activeBuffer.x+ce-1>=ve){if(_e){for(;this._activeBuffer.x<ve;)Oe.setCellFromCodePoint(this._activeBuffer.x++,0,1,ue.fg,ue.bg,ue.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),Oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=ve-1,ce===2)continue}if(X&&(Oe.insertCells(this._activeBuffer.x,ce,this._activeBuffer.getNullCell(ue),ue),Oe.getWidth(ve-1)===2&&Oe.setCellFromCodePoint(ve-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ue.fg,ue.bg,ue.extended)),Oe.setCellFromCodePoint(this._activeBuffer.x++,Z,ce,ue.fg,ue.bg,ue.extended),ce>0)for(;--ce;)Oe.setCellFromCodePoint(this._activeBuffer.x++,0,0,ue.fg,ue.bg,ue.extended)}else Oe.getWidth(this._activeBuffer.x-1)?Oe.addCodepointToCell(this._activeBuffer.x-1,Z):Oe.addCodepointToCell(this._activeBuffer.x-2,Z)}I-q>0&&(Oe.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<ve&&I-q>0&&Oe.getWidth(this._activeBuffer.x)===0&&!Oe.hasContent(this._activeBuffer.x)&&Oe.setCellFromCodePoint(this._activeBuffer.x,0,1,ue.fg,ue.bg,ue.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,q){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,q):this._parser.registerCsiHandler(B,I=>!W(I.params[0],this._optionsService.rawOptions.windowOptions)||q(I))}registerDcsHandler(B,q){return this._parser.registerDcsHandler(B,new R.DcsHandler(q))}registerEscHandler(B,q){return this._parser.registerEscHandler(B,q)}registerOscHandler(B,q){return this._parser.registerOscHandler(B,new P.OscHandler(q))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var B;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||B===void 0)&&B.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);q.hasWidth(this._activeBuffer.x)&&!q.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(B,q){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+q):(this._activeBuffer.x=B,this._activeBuffer.y=q),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,q){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+q)}cursorUp(B){const q=this._activeBuffer.y-this._activeBuffer.scrollTop;return q>=0?this._moveCursor(0,-Math.min(q,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const q=this._activeBuffer.scrollBottom-this._activeBuffer.y;return q>=0?this._moveCursor(0,Math.min(q,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const q=B.params[0];return q===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:q===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let q=B.params[0]||1;for(;q--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let q=B.params[0]||1;for(;q--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const q=B.params[0];return q===1&&(this._curAttrData.bg|=536870912),q!==2&&q!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,q,I,Z=!1,ce=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ee.replaceCells(q,I,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),ce),Z&&(ee.isWrapped=!1)}_resetBufferLine(B,q=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),q),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),I.isWrapped=!1)}eraseInDisplay(B,q=!1){let I;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,q);I<this._bufferService.rows;I++)this._resetBufferLine(I,q);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,q),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,q);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,q);this._dirtyRowTracker.markDirty(0);break;case 3:const Z=this._activeBuffer.lines.length-this._bufferService.rows;Z>0&&(this._activeBuffer.lines.trimStart(Z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-Z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-Z,0),this._onScroll.fire(0))}return!0}eraseInLine(B,q=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,q);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,q);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,q)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let q=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ce=this._bufferService.rows-1+this._activeBuffer.ybase-Z+1;for(;q--;)this._activeBuffer.lines.splice(ce-1,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let q=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let Z;for(Z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-Z;q--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(Z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return q&&(q.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return q&&(q.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let q=B.params[0]||1;for(;q--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(B){let q=B.params[0]||1;for(;q--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=B.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.deleteCells(0,q,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=B.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.insertCells(0,q,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=B.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.insertCells(this._activeBuffer.x,q,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const q=B.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Z.deleteCells(this._activeBuffer.x,q,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),Z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return q&&(q.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){if(!this._parser.precedingCodepoint)return!0;const q=B.params[0]||1,I=new Uint32Array(q);for(let Z=0;Z<q;++Z)I[Z]=this._parser.precedingCodepoint;return this.print(I,0,I.length),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let q=0;q<B.length;q++)switch(B.params[q]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let q=0;q<B.length;q++)switch(B.params[q]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(B){for(let q=0;q<B.length;q++)switch(B.params[q]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let q=0;q<B.length;q++)switch(B.params[q]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),B.params[q]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(B,q){const I=this._coreService.decPrivateModes,{activeProtocol:Z,activeEncoding:ce}=this._coreMouseService,ee=this._coreService,{buffers:ge,cols:ve}=this._bufferService,{active:_e,alt:X}=ge,ue=this._optionsService.rawOptions,Oe=Xe=>Xe?1:2,ke=B.params[0];return qe=ke,We=q?ke===2?4:ke===4?Oe(ee.modes.insertMode):ke===12?3:ke===20?Oe(ue.convertEol):0:ke===1?Oe(I.applicationCursorKeys):ke===3?ue.windowOptions.setWinLines?ve===80?2:ve===132?1:0:0:ke===6?Oe(I.origin):ke===7?Oe(I.wraparound):ke===8?3:ke===9?Oe(Z==="X10"):ke===12?Oe(ue.cursorBlink):ke===25?Oe(!ee.isCursorHidden):ke===45?Oe(I.reverseWraparound):ke===66?Oe(I.applicationKeypad):ke===67?4:ke===1e3?Oe(Z==="VT200"):ke===1002?Oe(Z==="DRAG"):ke===1003?Oe(Z==="ANY"):ke===1004?Oe(I.sendFocus):ke===1005?4:ke===1006?Oe(ce==="SGR"):ke===1015?4:ke===1016?Oe(ce==="SGR_PIXELS"):ke===1048?1:ke===47||ke===1047||ke===1049?Oe(_e===X):ke===2004?Oe(I.bracketedPasteMode):0,ee.triggerDataEvent(`${h.C0.ESC}[${q?"":"?"}${qe};${We}$y`),!0;var qe,We}_updateAttrColor(B,q,I,Z,ce){return q===2?(B|=50331648,B&=-16777216,B|=k.AttributeData.fromColorRGB([I,Z,ce])):q===5&&(B&=-50331904,B|=33554432|255&I),B}_extractColor(B,q,I){const Z=[0,0,-1,0,0,0];let ce=0,ee=0;do{if(Z[ee+ce]=B.params[q+ee],B.hasSubParams(q+ee)){const ge=B.getSubParams(q+ee);let ve=0;do Z[1]===5&&(ce=1),Z[ee+ve+1+ce]=ge[ve];while(++ve<ge.length&&ve+ee+1+ce<Z.length);break}if(Z[1]===5&&ee+ce>=2||Z[1]===2&&ee+ce>=5)break;Z[1]&&(ce=1)}while(++ee+q<B.length&&ee+ce<Z.length);for(let ge=2;ge<Z.length;++ge)Z[ge]===-1&&(Z[ge]=0);switch(Z[0]){case 38:I.fg=this._updateAttrColor(I.fg,Z[1],Z[3],Z[4],Z[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,Z[1],Z[3],Z[4],Z[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,Z[1],Z[3],Z[4],Z[5])}return ee}_processUnderline(B,q){q.extended=q.extended.clone(),(!~B||B>5)&&(B=1),q.extended.underlineStyle=B,q.fg|=268435456,B===0&&(q.fg&=-268435457),q.updateExtended()}_processSGR0(B){B.fg=m.DEFAULT_ATTR_DATA.fg,B.bg=m.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const q=B.length;let I;const Z=this._curAttrData;for(let ce=0;ce<q;ce++)I=B.params[ce],I>=30&&I<=37?(Z.fg&=-50331904,Z.fg|=16777216|I-30):I>=40&&I<=47?(Z.bg&=-50331904,Z.bg|=16777216|I-40):I>=90&&I<=97?(Z.fg&=-50331904,Z.fg|=16777224|I-90):I>=100&&I<=107?(Z.bg&=-50331904,Z.bg|=16777224|I-100):I===0?this._processSGR0(Z):I===1?Z.fg|=134217728:I===3?Z.bg|=67108864:I===4?(Z.fg|=268435456,this._processUnderline(B.hasSubParams(ce)?B.getSubParams(ce)[0]:1,Z)):I===5?Z.fg|=536870912:I===7?Z.fg|=67108864:I===8?Z.fg|=1073741824:I===9?Z.fg|=2147483648:I===2?Z.bg|=134217728:I===21?this._processUnderline(2,Z):I===22?(Z.fg&=-134217729,Z.bg&=-134217729):I===23?Z.bg&=-67108865:I===24?(Z.fg&=-268435457,this._processUnderline(0,Z)):I===25?Z.fg&=-536870913:I===27?Z.fg&=-67108865:I===28?Z.fg&=-1073741825:I===29?Z.fg&=2147483647:I===39?(Z.fg&=-67108864,Z.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):I===49?(Z.bg&=-67108864,Z.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?ce+=this._extractColor(B,ce,Z):I===53?Z.bg|=1073741824:I===55?Z.bg&=-1073741825:I===59?(Z.extended=Z.extended.clone(),Z.extended.underlineColor=-1,Z.updateExtended()):I===100?(Z.fg&=-67108864,Z.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,Z.bg&=-67108864,Z.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const q=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${q};${I}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const q=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${q};${I}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(B){const q=B.params[0]||1;switch(q){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const I=q%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(B){const q=B.params[0]||1;let I;return(B.length<2||(I=B.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>q&&(this._activeBuffer.scrollTop=q-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(B){if(!W(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const q=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:q!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:q!==0&&q!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),q!==0&&q!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:q!==0&&q!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),q!==0&&q!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(B){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const q=[],I=B.split(";");for(;I.length>1;){const Z=I.shift(),ce=I.shift();if(/^\d+$/.exec(Z)){const ee=parseInt(Z);if(ne(ee))if(ce==="?")q.push({type:0,index:ee});else{const ge=(0,A.parseColor)(ce);ge&&q.push({type:1,index:ee,color:ge})}}}return q.length&&this._onColor.fire(q),!0}setHyperlink(B){const q=B.split(";");return!(q.length<2)&&(q[1]?this._createHyperlink(q[0],q[1]):!q[0]&&this._finishHyperlink())}_createHyperlink(B,q){this._getCurrentLinkId()&&this._finishHyperlink();const I=B.split(":");let Z;const ce=I.findIndex(ee=>ee.startsWith("id="));return ce!==-1&&(Z=I[ce].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:Z,uri:q}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,q){const I=B.split(";");for(let Z=0;Z<I.length&&!(q>=this._specialColors.length);++Z,++q)if(I[Z]==="?")this._onColor.fire([{type:0,index:this._specialColors[q]}]);else{const ce=(0,A.parseColor)(I[Z]);ce&&this._onColor.fire([{type:1,index:this._specialColors[q],color:ce}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const q=[],I=B.split(";");for(let Z=0;Z<I.length;++Z)if(/^\d+$/.exec(I[Z])){const ce=parseInt(I[Z]);ne(ce)&&q.push({type:2,index:ce})}return q.length&&this._onColor.fire(q),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(D[B[0]],f.CHARSETS[B[1]]||f.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new w.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let q=0;q<this._bufferService.rows;++q){const I=this._activeBuffer.ybase+this._activeBuffer.y+q,Z=this._activeBuffer.lines.get(I);Z&&(Z.fill(B),Z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,q){const I=this._bufferService.buffer,Z=this._optionsService.rawOptions;return(ce=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${ce}${h.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[Z.cursorStyle]-(Z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,q){this._dirtyRowTracker.markRangeDirty(B,q)}}a.InputHandler=V;let K=class{constructor(oe){this._bufferService=oe,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(oe){oe<this.start?this.start=oe:oe>this.end&&(this.end=oe)}markRangeDirty(oe,B){oe>B&&(H=oe,oe=B,B=H),oe<this.start&&(this.start=oe),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ne(oe){return 0<=oe&&oe<256}K=c([u(0,T.IBufferService)],K)},844:(o,a)=>{function l(c){for(const u of c)u.dispose();c.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const u=this._disposables.indexOf(c);u!==-1&&this._disposables.splice(u,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var u;this._isDisposed||c===this._value||((u=this._value)===null||u===void 0||u.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},a.toDisposable=function(c){return{dispose:c}},a.disposeArray=l,a.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},1505:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(u,h,f){this._data[u]||(this._data[u]={}),this._data[u][h]=f}get(u,h){return this._data[u]?this._data[u][h]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(c,u,h,f,d){this._data.get(c,u)||this._data.set(c,u,new l),this._data.get(c,u).set(h,f,d)}get(c,u,h,f){var d;return(d=this._data.get(c,u))===null||d===void 0?void 0:d.get(h,f)}clear(){this._data.clear()}}},6114:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof navigator>"u";const l=a.isNode?"node":navigator.userAgent,c=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const u=l.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),a.isIpad=c==="iPad",a.isIphone=c==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),a.isLinux=c.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},6106:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let l=0;a.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(l=this._search(this._getKey(c)),this._array.splice(l,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const u=this._getKey(c);if(u===void 0||(l=this._search(u),l===-1)||this._getKey(this._array[l])!==u)return!1;do if(this._array[l]===c)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===u);return!1}*getKeyIterator(c){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===c)}forEachByKey(c,u){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do u(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===c)}values(){return[...this._array].values()}_search(c){let u=0,h=this._array.length-1;for(;h>=u;){let f=u+h>>1;const d=this._getKey(this._array[f]);if(d>c)h=f-1;else{if(!(d<c)){for(;f>0&&this._getKey(this._array[f-1])===c;)f--;return f}u=f+1}}return u}}},7226:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const c=l(6114);class u{constructor(){this._tasks=[],this._i=0}enqueue(d){this._tasks.push(d),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(d){this._idleCallback=void 0;let g=0,v=0,m=d.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),v=Math.max(g,v),y=d.timeRemaining(),1.5*v>y)return m-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-g))}ms`),void this._start();m=y}this.clear()}}class h extends u{_requestCallback(d){return setTimeout(()=>d(this._createDeadline(16)))}_cancelCallback(d){clearTimeout(d)}_createDeadline(d){const g=Date.now()+d;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}a.PriorityTaskQueue=h,a.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:h,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const c=l(643);a.updateWindowsModeWrappedState=function(u){const h=u.buffer.lines.get(u.buffer.ybase+u.buffer.y-1),f=h==null?void 0:h.get(u.cols-1),d=u.buffer.lines.get(u.buffer.ybase+u.buffer.y);d&&f&&(d.isWrapped=f[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&f[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new l;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}a.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}constructor(h=0,f=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=c},9092:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const c=l(6349),u=l(7226),h=l(3734),f=l(8437),d=l(4634),g=l(511),v=l(643),m=l(4863),y=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(x,w,k){this._hasScrollback=x,this._optionsService=w,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new u.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,w){return new f.BufferLine(this._bufferService.cols,this.getNullCell(x),w)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&x<this._rows}_getCorrectBufferLength(x){if(!this._hasScrollback)return x;const w=x+this._optionsService.rawOptions.scrollback;return w>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:w}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=f.DEFAULT_ATTR_DATA);let w=this._rows;for(;w--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,w){const k=this.getNullCell(f.DEFAULT_ATTR_DATA);let T=0;const P=this._getCorrectBufferLength(w);if(P>this.lines.maxLength&&(this.lines.maxLength=P),this.lines.length>0){if(this._cols<x)for(let A=0;A<this.lines.length;A++)T+=+this.lines.get(A).resize(x,k);let R=0;if(this._rows<w)for(let A=this._rows;A<w;A++)this.lines.length<w+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(x,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(x,k)));else for(let A=this._rows;A>w;A--)this.lines.length>w+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(P<this.lines.maxLength){const A=this.lines.length-P;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=P}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,w-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=w-1,this._isReflowEnabled&&(this._reflow(x,w),this._cols>x))for(let R=0;R<this.lines.length;R++)T+=+this.lines.get(R).resize(x,k);this._cols=x,this._rows=w,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let w=0;for(;this._memoryCleanupPosition<this.lines.length;)if(w+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),w>100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,w){this._cols!==x&&(x>this._cols?this._reflowLarger(x,w):this._reflowSmaller(x,w))}_reflowLarger(x,w){const k=(0,d.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(k.length>0){const T=(0,d.reflowLargerCreateNewLayout)(this.lines,k);(0,d.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(x,w,T.countRemoved)}}_reflowLargerAdjustViewport(x,w,k){const T=this.getNullCell(f.DEFAULT_ATTR_DATA);let P=k;for(;P-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<w&&this.lines.push(new f.BufferLine(x,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(x,w){const k=this.getNullCell(f.DEFAULT_ATTR_DATA),T=[];let P=0;for(let R=this.lines.length-1;R>=0;R--){let A=this.lines.get(R);if(!A||!A.isWrapped&&A.getTrimmedLength()<=x)continue;const D=[A];for(;A.isWrapped&&R>0;)A=this.lines.get(--R),D.unshift(A);const N=this.ybase+this.y;if(N>=R&&N<R+D.length)continue;const W=D[D.length-1].getTrimmedLength(),F=(0,d.reflowSmallerGetNewLineLengths)(D,this._cols,x),H=F.length-D.length;let V;V=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const K=[];for(let Z=0;Z<H;Z++){const ce=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);K.push(ce)}K.length>0&&(T.push({start:R+D.length+P,newLines:K}),P+=K.length),D.push(...K);let ne=F.length-1,oe=F[ne];oe===0&&(ne--,oe=F[ne]);let B=D.length-H-1,q=W;for(;B>=0;){const Z=Math.min(q,oe);if(D[ne]===void 0)break;if(D[ne].copyCellsFrom(D[B],q-Z,oe-Z,Z,!0),oe-=Z,oe===0&&(ne--,oe=F[ne]),q-=Z,q===0){B--;const ce=Math.max(B,0);q=(0,d.getWrappedLineTrimmedLength)(D,ce,this._cols)}}for(let Z=0;Z<D.length;Z++)F[Z]<x&&D[Z].setCell(F[Z],k);let I=H-V;for(;I-- >0;)this.ybase===0?this.y<w-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+P)-w&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+w-1)}if(T.length>0){const R=[],A=[];for(let ne=0;ne<this.lines.length;ne++)A.push(this.lines.get(ne));const D=this.lines.length;let N=D-1,W=0,F=T[W];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+P);let H=0;for(let ne=Math.min(this.lines.maxLength-1,D+P-1);ne>=0;ne--)if(F&&F.start>N+H){for(let oe=F.newLines.length-1;oe>=0;oe--)this.lines.set(ne--,F.newLines[oe]);ne++,R.push({index:N+1,amount:F.newLines.length}),H+=F.newLines.length,F=T[++W]}else this.lines.set(ne,A[N--]);let V=0;for(let ne=R.length-1;ne>=0;ne--)R[ne].index+=V,this.lines.onInsertEmitter.fire(R[ne]),V+=R[ne].amount;const K=Math.max(0,D+P-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(x,w,k=0,T){const P=this.lines.get(x);return P?P.translateToString(w,k,T):""}getWrappedRangeForLine(x){let w=x,k=x;for(;w>0&&this.lines.get(w).isWrapped;)w--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:w,last:k}}setupTabStops(x){for(x!=null?this.tabs[x]||(x=this.prevStop(x)):(this.tabs={},x=0);x<this._cols;x+=this._optionsService.rawOptions.tabStopWidth)this.tabs[x]=!0}prevStop(x){for(x==null&&(x=this.x);!this.tabs[--x]&&x>0;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x<this._cols;);return x>=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let w=0;w<this.markers.length;w++)this.markers[w].line===x&&(this.markers[w].dispose(),this.markers.splice(w--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].dispose(),this.markers.splice(x--,1);this._isClearing=!1}addMarker(x){const w=new m.Marker(x);return this.markers.push(w),w.register(this.lines.onTrim(k=>{w.line-=k,w.line<0&&w.dispose()})),w.register(this.lines.onInsert(k=>{w.line>=k.index&&(w.line+=k.amount)})),w.register(this.lines.onDelete(k=>{w.line>=k.index&&w.line<k.index+k.amount&&w.dispose(),w.line>k.index&&(w.line-=k.amount)})),w.register(w.onDispose(()=>this._removeMarker(w))),w}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const c=l(3734),u=l(511),h=l(643),f=l(482);a.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let d=0;class g{constructor(m,y,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const w=y||u.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let k=0;k<m;++k)this.setCell(k,w);this.length=m}get(m){const y=this._data[3*m+0],x=2097151&y;return[this._data[3*m+1],2097152&y?this._combined[m]:x?(0,f.stringFromCodePoint)(x):"",y>>22,2097152&y?this._combined[m].charCodeAt(this._combined[m].length-1):x]}set(m,y){this._data[3*m+1]=y[h.CHAR_DATA_ATTR_INDEX],y[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=y[1],this._data[3*m+0]=2097152|m|y[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=y[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const y=this._data[3*m+0];return 2097152&y?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&y}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const y=this._data[3*m+0];return 2097152&y?this._combined[m]:2097151&y?(0,f.stringFromCodePoint)(2097151&y):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,y){return d=3*m,y.content=this._data[d+0],y.fg=this._data[d+1],y.bg=this._data[d+2],2097152&y.content&&(y.combinedData=this._combined[m]),268435456&y.bg&&(y.extended=this._extendedAttrs[m]),y}setCell(m,y){2097152&y.content&&(this._combined[m]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[m]=y.extended),this._data[3*m+0]=y.content,this._data[3*m+1]=y.fg,this._data[3*m+2]=y.bg}setCellFromCodePoint(m,y,x,w,k,T){268435456&k&&(this._extendedAttrs[m]=T),this._data[3*m+0]=y|x<<22,this._data[3*m+1]=w,this._data[3*m+2]=k}addCodepointToCell(m,y){let x=this._data[3*m+0];2097152&x?this._combined[m]+=(0,f.stringFromCodePoint)(y):(2097151&x?(this._combined[m]=(0,f.stringFromCodePoint)(2097151&x)+(0,f.stringFromCodePoint)(y),x&=-2097152,x|=2097152):x=y|4194304,this._data[3*m+0]=x)}insertCells(m,y,x,w){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs),y<this.length-m){const k=new u.CellData;for(let T=this.length-m-y-1;T>=0;--T)this.setCell(m+y+T,this.loadCell(m+T,k));for(let T=0;T<y;++T)this.setCell(m+T,x)}else for(let k=m;k<this.length;++k)this.setCell(k,x);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs)}deleteCells(m,y,x,w){if(m%=this.length,y<this.length-m){const k=new u.CellData;for(let T=0;T<this.length-m-y;++T)this.setCell(m+T,this.loadCell(m+y+T,k));for(let T=this.length-y;T<this.length;++T)this.setCell(T,x)}else for(let k=m;k<this.length;++k)this.setCell(k,x);m&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodePoint(m,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs)}replaceCells(m,y,x,w,k=!1){if(k)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodePoint(m-1,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodePoint(y,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs);m<y&&m<this.length;)this.isProtected(m)||this.setCell(m,x),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodePoint(m-1,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodePoint(y,0,1,(w==null?void 0:w.fg)||0,(w==null?void 0:w.bg)||0,(w==null?void 0:w.extended)||new c.ExtendedAttrs);m<y&&m<this.length;)this.setCell(m++,x)}resize(m,y){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const x=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const w=new Uint32Array(x);w.set(this._data),this._data=w}for(let w=this.length;w<m;++w)this.setCell(w,y)}else{this._data=this._data.subarray(0,x);const w=Object.keys(this._combined);for(let T=0;T<w.length;T++){const P=parseInt(w[T],10);P>=m&&delete this._combined[P]}const k=Object.keys(this._extendedAttrs);for(let T=0;T<k.length;T++){const P=parseInt(k[T],10);P>=m&&delete this._extendedAttrs[P]}}return this.length=m,4*x*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,y=!1){if(y)for(let x=0;x<this.length;++x)this.isProtected(x)||this.setCell(x,m);else{this._combined={},this._extendedAttrs={};for(let x=0;x<this.length;++x)this.setCell(x,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const y in m._combined)this._combined[y]=m._combined[y];this._extendedAttrs={};for(const y in m._extendedAttrs)this._extendedAttrs[y]=m._extendedAttrs[y];this.isWrapped=m.isWrapped}clone(){const m=new g(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const y in this._combined)m._combined[y]=this._combined[y];for(const y in this._extendedAttrs)m._extendedAttrs[y]=this._extendedAttrs[y];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,y,x,w,k){const T=m._data;if(k)for(let R=w-1;R>=0;R--){for(let A=0;A<3;A++)this._data[3*(x+R)+A]=T[3*(y+R)+A];268435456&T[3*(y+R)+2]&&(this._extendedAttrs[x+R]=m._extendedAttrs[y+R])}else for(let R=0;R<w;R++){for(let A=0;A<3;A++)this._data[3*(x+R)+A]=T[3*(y+R)+A];268435456&T[3*(y+R)+2]&&(this._extendedAttrs[x+R]=m._extendedAttrs[y+R])}const P=Object.keys(m._combined);for(let R=0;R<P.length;R++){const A=parseInt(P[R],10);A>=y&&(this._combined[A-y+x]=m._combined[A])}}translateToString(m=!1,y=0,x=this.length){m&&(x=Math.min(x,this.getTrimmedLength()));let w="";for(;y<x;){const k=this._data[3*y+0],T=2097151&k;w+=2097152&k?this._combined[y]:T?(0,f.stringFromCodePoint)(T):h.WHITESPACE_CELL_CHAR,y+=k>>22||1}return w}}a.BufferLine=g},4841:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(l,c){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return c*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(o,a)=>{function l(c,u,h){if(u===c.length-1)return c[u].getTrimmedLength();const f=!c[u].hasContent(h-1)&&c[u].getWidth(h-1)===1,d=c[u+1].getWidth(0)===2;return f&&d?h-1:h}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(c,u,h,f,d){const g=[];for(let v=0;v<c.length-1;v++){let m=v,y=c.get(++m);if(!y.isWrapped)continue;const x=[c.get(v)];for(;m<c.length&&y.isWrapped;)x.push(y),y=c.get(++m);if(f>=v&&f<m){v+=x.length-1;continue}let w=0,k=l(x,w,u),T=1,P=0;for(;T<x.length;){const A=l(x,T,u),D=A-P,N=h-k,W=Math.min(D,N);x[w].copyCellsFrom(x[T],P,k,W,!1),k+=W,k===h&&(w++,k=0),P+=W,P===A&&(T++,P=0),k===0&&w!==0&&x[w-1].getWidth(h-1)===2&&(x[w].copyCellsFrom(x[w-1],h-1,k++,1,!1),x[w-1].setCell(h-1,d))}x[w].replaceCells(k,h,d);let R=0;for(let A=x.length-1;A>0&&(A>w||x[A].getTrimmedLength()===0);A--)R++;R>0&&(g.push(v+x.length-R),g.push(R)),v+=x.length-1}return g},a.reflowLargerCreateNewLayout=function(c,u){const h=[];let f=0,d=u[f],g=0;for(let v=0;v<c.length;v++)if(d===v){const m=u[++f];c.onDeleteEmitter.fire({index:v-g,amount:m}),v+=m-1,g+=m,d=u[++f]}else h.push(v);return{layout:h,countRemoved:g}},a.reflowLargerApplyNewLayout=function(c,u){const h=[];for(let f=0;f<u.length;f++)h.push(c.get(u[f]));for(let f=0;f<h.length;f++)c.set(f,h[f]);c.length=u.length},a.reflowSmallerGetNewLineLengths=function(c,u,h){const f=[],d=c.map((y,x)=>l(c,x,u)).reduce((y,x)=>y+x);let g=0,v=0,m=0;for(;m<d;){if(d-m<h){f.push(d-m);break}g+=h;const y=l(c,v,u);g>y&&(g-=y,v++);const x=c[v].getWidth(g-1)===2;x&&g--;const w=x?h-1:h;f.push(w),m+=w}return f},a.getWrappedLineTrimmedLength=l},5295:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const c=l(8460),u=l(844),h=l(9092);class f extends u.Disposable{constructor(g,v){super(),this._optionsService=g,this._bufferService=v,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,v){this._normal.resize(g,v),this._alt.resize(g,v),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}a.BufferSet=f},511:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const c=l(482),u=l(643),h=l(3734);class f extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const v=new f;return v.setFromCharData(g),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(g[u.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(g[u.CHAR_DATA_CHAR_INDEX].length===2){const m=g[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const y=g[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(m-55296)+y-56320+65536|g[u.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=g[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[u.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=g[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=f},643:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const c=l(8460),u=l(844);class h{get id(){return this._id}constructor(d){this.line=d,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,u.disposeArray)(this._disposables),this._disposables.length=0)}register(d){return this._disposables.push(d),d}}a.Marker=h,h._nextId=1},7116:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(o,a)=>{var l,c,u;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
302
302
|
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(l||(a.C0=l={})),function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""}(c||(a.C1=c={})),function(h){h.ST=`${l.ESC}\\`}(u||(a.C1_ESCAPED=u={}))},7399:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const c=l(2584),u={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(h,f,d,g){const v={type:0,cancel:!1,key:void 0},m=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(h.altKey){v.key=c.C0.ESC+c.C0.DEL;break}v.key=c.C0.DEL;break;case 9:if(h.shiftKey){v.key=c.C0.ESC+"[Z";break}v.key=c.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,v.cancel=!0;break;case 27:v.key=c.C0.ESC,h.altKey&&(v.key=c.C0.ESC+c.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;m?(v.key=c.C0.ESC+"[1;"+(m+1)+"D",v.key===c.C0.ESC+"[1;3D"&&(v.key=c.C0.ESC+(d?"b":"[1;5D"))):v.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(h.metaKey)break;m?(v.key=c.C0.ESC+"[1;"+(m+1)+"C",v.key===c.C0.ESC+"[1;3C"&&(v.key=c.C0.ESC+(d?"f":"[1;5C"))):v.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(h.metaKey)break;m?(v.key=c.C0.ESC+"[1;"+(m+1)+"A",d||v.key!==c.C0.ESC+"[1;3A"||(v.key=c.C0.ESC+"[1;5A")):v.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(h.metaKey)break;m?(v.key=c.C0.ESC+"[1;"+(m+1)+"B",d||v.key!==c.C0.ESC+"[1;3B"||(v.key=c.C0.ESC+"[1;5B")):v.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=c.C0.ESC+"[2~");break;case 46:v.key=m?c.C0.ESC+"[3;"+(m+1)+"~":c.C0.ESC+"[3~";break;case 36:v.key=m?c.C0.ESC+"[1;"+(m+1)+"H":f?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:v.key=m?c.C0.ESC+"[1;"+(m+1)+"F":f?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=c.C0.ESC+"[5;"+(m+1)+"~":v.key=c.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=c.C0.ESC+"[6;"+(m+1)+"~":v.key=c.C0.ESC+"[6~";break;case 112:v.key=m?c.C0.ESC+"[1;"+(m+1)+"P":c.C0.ESC+"OP";break;case 113:v.key=m?c.C0.ESC+"[1;"+(m+1)+"Q":c.C0.ESC+"OQ";break;case 114:v.key=m?c.C0.ESC+"[1;"+(m+1)+"R":c.C0.ESC+"OR";break;case 115:v.key=m?c.C0.ESC+"[1;"+(m+1)+"S":c.C0.ESC+"OS";break;case 116:v.key=m?c.C0.ESC+"[15;"+(m+1)+"~":c.C0.ESC+"[15~";break;case 117:v.key=m?c.C0.ESC+"[17;"+(m+1)+"~":c.C0.ESC+"[17~";break;case 118:v.key=m?c.C0.ESC+"[18;"+(m+1)+"~":c.C0.ESC+"[18~";break;case 119:v.key=m?c.C0.ESC+"[19;"+(m+1)+"~":c.C0.ESC+"[19~";break;case 120:v.key=m?c.C0.ESC+"[20;"+(m+1)+"~":c.C0.ESC+"[20~";break;case 121:v.key=m?c.C0.ESC+"[21;"+(m+1)+"~":c.C0.ESC+"[21~";break;case 122:v.key=m?c.C0.ESC+"[23;"+(m+1)+"~":c.C0.ESC+"[23~";break;case 123:v.key=m?c.C0.ESC+"[24;"+(m+1)+"~":c.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(d&&!g||!h.altKey||h.metaKey)!d||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=c.C0.US),h.key==="@"&&(v.key=c.C0.NUL)):h.keyCode===65&&(v.type=1);else{const y=u[h.keyCode],x=y==null?void 0:y[h.shiftKey?1:0];if(x)v.key=c.C0.ESC+x;else if(h.keyCode>=65&&h.keyCode<=90){const w=h.ctrlKey?h.keyCode-64:h.keyCode+32;let k=String.fromCharCode(w);h.shiftKey&&(k=k.toUpperCase()),v.key=c.C0.ESC+k}else if(h.keyCode===32)v.key=c.C0.ESC+(h.ctrlKey?c.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let w=h.code.slice(3,4);h.shiftKey||(w=w.toLowerCase()),v.key=c.C0.ESC+w,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=c.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=c.C0.DEL:h.keyCode===219?v.key=c.C0.ESC:h.keyCode===220?v.key=c.C0.FS:h.keyCode===221&&(v.key=c.C0.GS)}return v}},482:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,c=0,u=l.length){let h="";for(let f=c;f<u;++f){let d=l[f];d>65535?(d-=65536,h+=String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):h+=String.fromCharCode(d)}return h},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const u=l.length;if(!u)return 0;let h=0,f=0;if(this._interim){const d=l.charCodeAt(f++);56320<=d&&d<=57343?c[h++]=1024*(this._interim-55296)+d-56320+65536:(c[h++]=this._interim,c[h++]=d),this._interim=0}for(let d=f;d<u;++d){const g=l.charCodeAt(d);if(55296<=g&&g<=56319){if(++d>=u)return this._interim=g,h;const v=l.charCodeAt(d);56320<=v&&v<=57343?c[h++]=1024*(g-55296)+v-56320+65536:(c[h++]=g,c[h++]=v)}else g!==65279&&(c[h++]=g)}return h}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const u=l.length;if(!u)return 0;let h,f,d,g,v=0,m=0,y=0;if(this.interim[0]){let k=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let P,R=0;for(;(P=63&this.interim[++R])&&R<4;)T<<=6,T|=P;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=A-R;for(;y<D;){if(y>=u)return 0;if(P=l[y++],(192&P)!=128){y--,k=!0;break}this.interim[R++]=P,T<<=6,T|=63&P}k||(A===2?T<128?y--:c[v++]=T:A===3?T<2048||T>=55296&&T<=57343||T===65279||(c[v++]=T):T<65536||T>1114111||(c[v++]=T)),this.interim.fill(0)}const x=u-4;let w=y;for(;w<u;){for(;!(!(w<x)||128&(h=l[w])||128&(f=l[w+1])||128&(d=l[w+2])||128&(g=l[w+3]));)c[v++]=h,c[v++]=f,c[v++]=d,c[v++]=g,w+=4;if(h=l[w++],h<128)c[v++]=h;else if((224&h)==192){if(w>=u)return this.interim[0]=h,v;if(f=l[w++],(192&f)!=128){w--;continue}if(m=(31&h)<<6|63&f,m<128){w--;continue}c[v++]=m}else if((240&h)==224){if(w>=u)return this.interim[0]=h,v;if(f=l[w++],(192&f)!=128){w--;continue}if(w>=u)return this.interim[0]=h,this.interim[1]=f,v;if(d=l[w++],(192&d)!=128){w--;continue}if(m=(15&h)<<12|(63&f)<<6|63&d,m<2048||m>=55296&&m<=57343||m===65279)continue;c[v++]=m}else if((248&h)==240){if(w>=u)return this.interim[0]=h,v;if(f=l[w++],(192&f)!=128){w--;continue}if(w>=u)return this.interim[0]=h,this.interim[1]=f,v;if(d=l[w++],(192&d)!=128){w--;continue}if(w>=u)return this.interim[0]=h,this.interim[1]=f,this.interim[2]=d,v;if(g=l[w++],(192&g)!=128){w--;continue}if(m=(7&h)<<18|(63&f)<<12|(63&d)<<6|63&g,m<65536||m>1114111)continue;c[v++]=m}}return v}}},225:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const l=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let u;a.UnicodeV6=class{constructor(){if(this.version="6",!u){u=new Uint8Array(65536),u.fill(1),u[0]=0,u.fill(0,1,32),u.fill(0,127,160),u.fill(2,4352,4448),u[9001]=2,u[9002]=2,u.fill(2,11904,42192),u[12351]=1,u.fill(2,44032,55204),u.fill(2,63744,64256),u.fill(2,65040,65050),u.fill(2,65072,65136),u.fill(2,65280,65377),u.fill(2,65504,65511);for(let h=0;h<l.length;++h)u.fill(0,l[h][0],l[h][1]+1)}}wcwidth(h){return h<32?0:h<127?1:h<65536?u[h]:function(f,d){let g,v=0,m=d.length-1;if(f<d[0][0]||f>d[m][1])return!1;for(;m>=v;)if(g=v+m>>1,f>d[g][1])v=g+1;else{if(!(f<d[g][0]))return!0;m=g-1}return!1}(h,c)?0:h>=131072&&h<=196605||h>=196608&&h<=262141?2:1}}},5981:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const c=l(8460),u=l(844);class h extends u.Disposable{constructor(d){super(),this._action=d,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(d,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(d,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(g),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=d.length,this._writeBuffer.push(d),this._callbacks.push(g)}_innerWrite(d=0,g=!0){const v=d||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],y=this._action(m,g);if(y){const w=k=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,k)):this._innerWrite(v,k);return void y.catch(k=>(queueMicrotask(()=>{throw k}),Promise.resolve(!1))).then(w)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=h},5941:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const l=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function u(h,f){const d=h.toString(16),g=d.length<2?"0"+d:d;switch(f){case 4:return d[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}a.parseColor=function(h){if(!h)return;let f=h.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const d=l.exec(f);if(d){const g=d[1]?15:d[4]?255:d[7]?4095:65535;return[Math.round(parseInt(d[1]||d[4]||d[7]||d[10],16)/g*255),Math.round(parseInt(d[2]||d[5]||d[8]||d[11],16)/g*255),Math.round(parseInt(d[3]||d[6]||d[9]||d[12],16)/g*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),c.exec(f)&&[3,6,9,12].includes(f.length))){const d=f.length/3,g=[0,0,0];for(let v=0;v<3;++v){const m=parseInt(f.slice(d*v,d*v+d),16);g[v]=d===1?m<<4:d===2?m:d===3?m>>4:m>>8}return g}},a.toRgbString=function(h,f=16){const[d,g,v]=h;return`rgb:${u(d,f)}/${u(g,f)}/${u(v,f)}`}},5770:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const c=l(482),u=l(8742),h=l(5770),f=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(g,v){this._handlers[g]===void 0&&(this._handlers[g]=[]);const m=this._handlers[g];return m.push(v),{dispose:()=>{const y=m.indexOf(v);y!==-1&&m.splice(y,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(g,v){if(this.reset(),this._ident=g,this._active=this._handlers[g]||f,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(g,v,m){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(g,v,m);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(g,v,m))}unhook(g,v=!0){if(this._active.length){let m=!1,y=this._active.length-1,x=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,m=v,x=this._stack.fallThrough,this._stack.paused=!1),!x&&m===!1){for(;y>=0&&(m=this._active[y].unhook(g),m!==!0);y--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,m;y--}for(;y>=0;y--)if(m=this._active[y].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",g);this._active=f,this._ident=0}};const d=new u.Params;d.addParam(0),a.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=d,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():d,this._data="",this._hitLimit=!1}put(g,v,m){this._hitLimit||(this._data+=(0,c.utf32ToString)(g,v,m),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let v=!1;if(this._hitLimit)v=!1;else if(g&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(m=>(this._params=d,this._data="",this._hitLimit=!1,m));return this._params=d,this._data="",this._hitLimit=!1,v}}},2015:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const c=l(844),u=l(8742),h=l(6242),f=l(6351);class d{constructor(y){this.table=new Uint8Array(y)}setDefault(y,x){this.table.fill(y<<4|x)}add(y,x,w,k){this.table[x<<8|y]=w<<4|k}addMany(y,x,w,k){for(let T=0;T<y.length;T++)this.table[x<<8|y[T]]=w<<4|k}}a.TransitionTable=d;const g=160;a.VT500_TRANSITION_TABLE=function(){const m=new d(4095),y=Array.apply(null,Array(256)).map((R,A)=>A),x=(R,A)=>y.slice(R,A),w=x(32,127),k=x(0,24);k.push(25),k.push.apply(k,x(28,32));const T=x(0,14);let P;for(P in m.setDefault(1,0),m.addMany(w,0,2,0),T)m.addMany([24,26,153,154],P,3,0),m.addMany(x(128,144),P,3,0),m.addMany(x(144,152),P,3,0),m.add(156,P,0,0),m.add(27,P,11,1),m.add(157,P,4,8),m.addMany([152,158,159],P,0,7),m.add(155,P,11,3),m.add(144,P,11,9);return m.addMany(k,0,3,0),m.addMany(k,1,3,1),m.add(127,1,0,1),m.addMany(k,8,0,8),m.addMany(k,3,3,3),m.add(127,3,0,3),m.addMany(k,4,3,4),m.add(127,4,0,4),m.addMany(k,6,3,6),m.addMany(k,5,3,5),m.add(127,5,0,5),m.addMany(k,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(w,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(x(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(w,7,0,7),m.addMany(k,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(x(64,127),3,7,0),m.addMany(x(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(x(48,60),4,8,4),m.addMany(x(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(x(32,64),6,0,6),m.add(127,6,0,6),m.addMany(x(64,127),6,0,0),m.addMany(x(32,48),3,9,5),m.addMany(x(32,48),5,9,5),m.addMany(x(48,64),5,0,6),m.addMany(x(64,127),5,7,0),m.addMany(x(32,48),4,9,5),m.addMany(x(32,48),1,9,2),m.addMany(x(32,48),2,9,2),m.addMany(x(48,127),2,10,0),m.addMany(x(48,80),1,10,0),m.addMany(x(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(x(96,127),1,10,0),m.add(80,1,11,9),m.addMany(k,9,0,9),m.add(127,9,0,9),m.addMany(x(28,32),9,0,9),m.addMany(x(32,48),9,9,12),m.addMany(x(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(k,11,0,11),m.addMany(x(32,128),11,0,11),m.addMany(x(28,32),11,0,11),m.addMany(k,10,0,10),m.add(127,10,0,10),m.addMany(x(28,32),10,0,10),m.addMany(x(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(x(32,48),10,9,12),m.addMany(k,12,0,12),m.add(127,12,0,12),m.addMany(x(28,32),12,0,12),m.addMany(x(32,48),12,9,12),m.addMany(x(48,64),12,0,11),m.addMany(x(64,127),12,12,13),m.addMany(x(64,127),10,12,13),m.addMany(x(64,127),9,12,13),m.addMany(k,13,13,13),m.addMany(w,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(g,0,2,0),m.add(g,8,5,8),m.add(g,6,0,6),m.add(g,11,0,11),m.add(g,13,13,13),m}();class v extends c.Disposable{constructor(y=a.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new u.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(x,w,k)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,w)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(y,x=[64,126]){let w=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(w=y.prefix.charCodeAt(0),w&&60>w||w>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<y.intermediates.length;++T){const P=y.intermediates.charCodeAt(T);if(32>P||P>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");w<<=8,w|=P}}if(y.final.length!==1)throw new Error("final must be a single byte");const k=y.final.charCodeAt(0);if(x[0]>k||k>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return w<<=8,w|=k,w}identToString(y){const x=[];for(;y;)x.push(String.fromCharCode(255&y)),y>>=8;return x.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,x){const w=this._identifier(y,[48,126]);this._escHandlers[w]===void 0&&(this._escHandlers[w]=[]);const k=this._escHandlers[w];return k.push(x),{dispose:()=>{const T=k.indexOf(x);T!==-1&&k.splice(T,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,x){this._executeHandlers[y.charCodeAt(0)]=x}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,x){const w=this._identifier(y);this._csiHandlers[w]===void 0&&(this._csiHandlers[w]=[]);const k=this._csiHandlers[w];return k.push(x),{dispose:()=>{const T=k.indexOf(x);T!==-1&&k.splice(T,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,x){return this._dcsParser.registerHandler(this._identifier(y),x)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,x){return this._oscParser.registerHandler(y,x)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(y,x,w,k,T){this._parseStack.state=y,this._parseStack.handlers=x,this._parseStack.handlerPos=w,this._parseStack.transition=k,this._parseStack.chunkPos=T}parse(y,x,w){let k,T=0,P=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(w===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(w===!1&&D>-1){for(;D>=0&&(k=A[D](this._params),k!==!0);D--)if(k instanceof Promise)return this._parseStack.handlerPos=D,k}this._parseStack.handlers=[];break;case 4:if(w===!1&&D>-1){for(;D>=0&&(k=A[D](),k!==!0);D--)if(k instanceof Promise)return this._parseStack.handlerPos=D,k}this._parseStack.handlers=[];break;case 6:if(T=y[this._parseStack.chunkPos],k=this._dcsParser.unhook(T!==24&&T!==26,w),k)return k;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=y[this._parseStack.chunkPos],k=this._oscParser.end(T!==24&&T!==26,w),k)return k;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let A=R;A<x;++A){switch(T=y[A],P=this._transitions.table[this.currentState<<8|(T<160?T:g)],P>>4){case 2:for(let H=A+1;;++H){if(H>=x||(T=y[H])<32||T>126&&T<g){this._printHandler(y,A,H),A=H-1;break}if(++H>=x||(T=y[H])<32||T>126&&T<g){this._printHandler(y,A,H),A=H-1;break}if(++H>=x||(T=y[H])<32||T>126&&T<g){this._printHandler(y,A,H),A=H-1;break}if(++H>=x||(T=y[H])<32||T>126&&T<g){this._printHandler(y,A,H),A=H-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const D=this._csiHandlers[this._collect<<8|T];let N=D?D.length-1:-1;for(;N>=0&&(k=D[N](this._params),k!==!0);N--)if(k instanceof Promise)return this._preserveStack(3,D,N,P,A),k;N<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingCodepoint=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++A<x&&(T=y[A])>47&&T<60);A--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const W=this._escHandlers[this._collect<<8|T];let F=W?W.length-1:-1;for(;F>=0&&(k=W[F](),k!==!0);F--)if(k instanceof Promise)return this._preserveStack(4,W,F,P,A),k;F<0&&this._escHandlerFb(this._collect<<8|T),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|T,this._params);break;case 13:for(let H=A+1;;++H)if(H>=x||(T=y[H])===24||T===26||T===27||T>127&&T<g){this._dcsParser.put(y,A,H),A=H-1;break}break;case 14:if(k=this._dcsParser.unhook(T!==24&&T!==26),k)return this._preserveStack(6,[],0,P,A),k;T===27&&(P|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let H=A+1;;H++)if(H>=x||(T=y[H])<32||T>127&&T<g){this._oscParser.put(y,A,H),A=H-1;break}break;case 6:if(k=this._oscParser.end(T!==24&&T!==26),k)return this._preserveStack(5,[],0,P,A),k;T===27&&(P|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&P}}}a.EscapeSequenceParser=v},6242:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const c=l(5770),u=l(482),h=[];a.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,d){this._handlers[f]===void 0&&(this._handlers[f]=[]);const g=this._handlers[f];return g.push(d),{dispose:()=>{const v=g.indexOf(d);v!==-1&&g.splice(v,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,d,g){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(f,d,g);else this._handlerFb(this._id,"PUT",(0,u.utf32ToString)(f,d,g))}start(){this.reset(),this._state=1}put(f,d,g){if(this._state!==3){if(this._state===1)for(;d<g;){const v=f[d++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&g-d>0&&this._put(f,d,g)}}end(f,d=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,v=this._active.length-1,m=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,g=d,m=this._stack.fallThrough,this._stack.paused=!1),!m&&g===!1){for(;v>=0&&(g=this._active[v].end(f),g!==!0);v--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,g;v--}for(;v>=0;v--)if(g=this._active[v].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",f);this._active=h,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,d,g){this._hitLimit||(this._data+=(0,u.utf32ToString)(f,d,g),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let d=!1;if(this._hitLimit)d=!1;else if(f&&(d=this._handler(this._data),d instanceof Promise))return d.then(g=>(this._data="",this._hitLimit=!1,g));return this._data="",this._hitLimit=!1,d}}},8742:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const l=2147483647;class c{static fromArray(h){const f=new c;if(!h.length)return f;for(let d=Array.isArray(h[0])?1:0;d<h.length;++d){const g=h[d];if(Array.isArray(g))for(let v=0;v<g.length;++v)f.addSubParam(g[v]);else f.addParam(g)}return f}constructor(h=32,f=32){if(this.maxLength=h,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new c(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let f=0;f<this.length;++f){h.push(this.params[f]);const d=this._subParamsIdx[f]>>8,g=255&this._subParamsIdx[f];g-d>0&&h.push(Array.prototype.slice.call(this._subParams,d,g))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>l?l:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>l?l:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const f=this._subParamsIdx[h]>>8,d=255&this._subParamsIdx[h];return d-f>0?this._subParams.subarray(f,d):null}getSubParamsAll(){const h={};for(let f=0;f<this.length;++f){const d=this._subParamsIdx[f]>>8,g=255&this._subParamsIdx[f];g-d>0&&(h[f]=this._subParams.slice(d,g))}return h}addDigit(h){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const d=this._digitIsSub?this._subParams:this.params,g=d[f-1];d[f-1]=~g?Math.min(10*g+h,l):h}}a.Params=c},5741:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,c){const u={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(u),c.dispose=()=>this._wrappedAddonDispose(u),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let u=0;u<this._addons.length;u++)if(this._addons[u]===l){c=u;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(c,1)}}},8771:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const c=l(3785),u=l(511);a.BufferApiView=class{constructor(h,f){this._buffer=h,this.type=f}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const f=this._buffer.lines.get(h);if(f)return new c.BufferLineApiView(f)}getNullCell(){return new u.CellData}}},3785:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const c=l(511);a.BufferLineApiView=class{constructor(u){this._line=u}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(u,h){if(!(u<0||u>=this._line.length))return h?(this._line.loadCell(u,h),h):this._line.loadCell(u,new c.CellData)}translateToString(u,h,f){return this._line.translateToString(u,h,f)}}},8285:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const c=l(8771),u=l(8460),h=l(844);class f extends h.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new u.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=f},7975:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,c){return this._core.registerCsiHandler(l,u=>c(u.toArray()))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,(u,h)=>c(u,h.toArray()))}addDcsHandler(l,c){return this.registerDcsHandler(l,c)}registerEscHandler(l,c){return this._core.registerEscHandler(l,c)}addEscHandler(l,c){return this.registerEscHandler(l,c)}registerOscHandler(l,c){return this._core.registerOscHandler(l,c)}addOscHandler(l,c){return this.registerOscHandler(l,c)}}},7090:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(o,a,l){var c=this&&this.__decorate||function(m,y,x,w){var k,T=arguments.length,P=T<3?y:w===null?w=Object.getOwnPropertyDescriptor(y,x):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(m,y,x,w);else for(var R=m.length-1;R>=0;R--)(k=m[R])&&(P=(T<3?k(P):T>3?k(y,x,P):k(y,x))||P);return T>3&&P&&Object.defineProperty(y,x,P),P},u=this&&this.__param||function(m,y){return function(x,w){y(x,w,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const h=l(8460),f=l(844),d=l(5295),g=l(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let v=a.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new d.BufferSet(m,this))}resize(m,y){this.cols=m,this.rows=y,this.buffers.resize(m,y),this._onResize.fire({cols:m,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,y=!1){const x=this.buffer;let w;w=this._cachedBlankLine,w&&w.length===this.cols&&w.getFg(0)===m.fg&&w.getBg(0)===m.bg||(w=x.getBlankLine(m,y),this._cachedBlankLine=w),w.isWrapped=y;const k=x.ybase+x.scrollTop,T=x.ybase+x.scrollBottom;if(x.scrollTop===0){const P=x.lines.isFull;T===x.lines.length-1?P?x.lines.recycle().copyFrom(w):x.lines.push(w.clone()):x.lines.splice(T+1,0,w.clone()),P?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const P=T-k+1;x.lines.shiftElements(k+1,P-1,-1),x.lines.set(T,w.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(m,y,x){const w=this.buffer;if(m<0){if(w.ydisp===0)return;this.isUserScrolling=!0}else m+w.ydisp>=w.ybase&&(this.isUserScrolling=!1);const k=w.ydisp;w.ydisp=Math.max(Math.min(w.ydisp+m,w.ybase),0),k!==w.ydisp&&(y||this._onScroll.fire(w.ydisp))}};a.BufferService=v=c([u(0,g.IOptionsService)],v)},7994:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,c){this._charsets[l]=c,this.glevel===l&&(this.charset=c)}}},1753:function(o,a,l){var c=this&&this.__decorate||function(w,k,T,P){var R,A=arguments.length,D=A<3?k:P===null?P=Object.getOwnPropertyDescriptor(k,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,k,T,P);else for(var N=w.length-1;N>=0;N--)(R=w[N])&&(D=(A<3?R(D):A>3?R(k,T,D):R(k,T))||D);return A>3&&D&&Object.defineProperty(k,T,D),D},u=this&&this.__param||function(w,k){return function(T,P){k(T,P,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const h=l(2585),f=l(8460),d=l(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:w=>w.button!==4&&w.action===1&&(w.ctrl=!1,w.alt=!1,w.shift=!1,!0)},VT200:{events:19,restrict:w=>w.action!==32},DRAG:{events:23,restrict:w=>w.action!==32||w.button!==3},ANY:{events:31,restrict:w=>!0}};function v(w,k){let T=(w.ctrl?16:0)|(w.shift?4:0)|(w.alt?8:0);return w.button===4?(T|=64,T|=w.action):(T|=3&w.button,4&w.button&&(T|=64),8&w.button&&(T|=128),w.action===32?T|=32:w.action!==0||k||(T|=3)),T}const m=String.fromCharCode,y={DEFAULT:w=>{const k=[v(w,!1)+32,w.col+32,w.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${m(k[0])}${m(k[1])}${m(k[2])}`},SGR:w=>{const k=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${v(w,!0)};${w.col};${w.row}${k}`},SGR_PIXELS:w=>{const k=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${v(w,!0)};${w.x};${w.y}${k}`}};let x=a.CoreMouseService=class extends d.Disposable{constructor(w,k){super(),this._bufferService=w,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(g))this.addProtocol(T,g[T]);for(const T of Object.keys(y))this.addEncoding(T,y[T]);this.reset()}addProtocol(w,k){this._protocols[w]=k}addEncoding(w,k){this._encodings[w]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(w){if(!this._protocols[w])throw new Error(`unknown protocol "${w}"`);this._activeProtocol=w,this._onProtocolChange.fire(this._protocols[w].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(w){if(!this._encodings[w])throw new Error(`unknown encoding "${w}"`);this._activeEncoding=w}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(w){if(w.col<0||w.col>=this._bufferService.cols||w.row<0||w.row>=this._bufferService.rows||w.button===4&&w.action===32||w.button===3&&w.action!==32||w.button!==4&&(w.action===2||w.action===3)||(w.col++,w.row++,w.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,w,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(w))return!1;const k=this._encodings[this._activeEncoding](w);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=w,!0}explainEvents(w){return{down:!!(1&w),up:!!(2&w),drag:!!(4&w),move:!!(8&w),wheel:!!(16&w)}}_equalEvents(w,k,T){if(T){if(w.x!==k.x||w.y!==k.y)return!1}else if(w.col!==k.col||w.row!==k.row)return!1;return w.button===k.button&&w.action===k.action&&w.ctrl===k.ctrl&&w.alt===k.alt&&w.shift===k.shift}};a.CoreMouseService=x=c([u(0,h.IBufferService),u(1,h.ICoreService)],x)},6975:function(o,a,l){var c=this&&this.__decorate||function(x,w,k,T){var P,R=arguments.length,A=R<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(x,w,k,T);else for(var D=x.length-1;D>=0;D--)(P=x[D])&&(A=(R<3?P(A):R>3?P(w,k,A):P(w,k))||A);return R>3&&A&&Object.defineProperty(w,k,A),A},u=this&&this.__param||function(x,w){return function(k,T){w(k,T,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const h=l(1439),f=l(8460),d=l(844),g=l(2585),v=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=a.CoreService=class extends d.Disposable{constructor(x,w,k){super(),this._bufferService=x,this._logService=w,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(m)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(m)}triggerDataEvent(x,w=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;w&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),w&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,()=>x.split("").map(T=>T.charCodeAt(0))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,()=>x.split("").map(w=>w.charCodeAt(0))),this._onBinary.fire(x))}};a.CoreService=y=c([u(0,g.IBufferService),u(1,g.ILogService),u(2,g.IOptionsService)],y)},9074:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const c=l(8055),u=l(8460),h=l(844),f=l(6106);let d=0,g=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(x=>x==null?void 0:x.marker.line),this._onDecorationRegistered=this.register(new u.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new u.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(x){if(x.marker.isDisposed)return;const w=new m(x);if(w){const k=w.marker.onDispose(()=>w.dispose());w.onDispose(()=>{w&&(this._decorations.delete(w)&&this._onDecorationRemoved.fire(w),k.dispose())}),this._decorations.insert(w),this._onDecorationRegistered.fire(w)}return w}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,w,k){var T,P,R;let A=0,D=0;for(const N of this._decorations.getKeyIterator(w))A=(T=N.options.x)!==null&&T!==void 0?T:0,D=A+((P=N.options.width)!==null&&P!==void 0?P:1),x>=A&&x<D&&(!k||((R=N.options.layer)!==null&&R!==void 0?R:"bottom")===k)&&(yield N)}forEachDecorationAtCell(x,w,k,T){this._decorations.forEachByKey(w,P=>{var R,A,D;d=(R=P.options.x)!==null&&R!==void 0?R:0,g=d+((A=P.options.width)!==null&&A!==void 0?A:1),x>=d&&x<g&&(!k||((D=P.options.layer)!==null&&D!==void 0?D:"bottom")===k)&&T(P)})}}a.DecorationService=v;class m extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(x){super(),this.options=x,this.onRenderEmitter=this.register(new u.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=x.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const c=l(2585),u=l(8343);class h{constructor(...d){this._entries=new Map;for(const[g,v]of d)this.set(g,v)}set(d,g){const v=this._entries.get(d);return this._entries.set(d,g),v}forEach(d){for(const[g,v]of this._entries.entries())d(g,v)}has(d){return this._entries.has(d)}get(d){return this._entries.get(d)}}a.ServiceCollection=h,a.InstantiationService=class{constructor(){this._services=new h,this._services.set(c.IInstantiationService,this)}setService(f,d){this._services.set(f,d)}getService(f){return this._services.get(f)}createInstance(f,...d){const g=(0,u.getServiceDependencies)(f).sort((y,x)=>y.index-x.index),v=[];for(const y of g){const x=this._services.get(y.id);if(!x)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${y.id}.`);v.push(x)}const m=g.length>0?g[0].index:d.length;if(d.length!==m)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${m+1} conflicts with ${d.length} static arguments`);return new f(...d,...v)}}},7866:function(o,a,l){var c=this&&this.__decorate||function(m,y,x,w){var k,T=arguments.length,P=T<3?y:w===null?w=Object.getOwnPropertyDescriptor(y,x):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(m,y,x,w);else for(var R=m.length-1;R>=0;R--)(k=m[R])&&(P=(T<3?k(P):T>3?k(y,x,P):k(y,x))||P);return T>3&&P&&Object.defineProperty(y,x,P),P},u=this&&this.__param||function(m,y){return function(x,w){y(x,w,m)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const h=l(844),f=l(2585),d={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let g,v=a.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=d[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let y=0;y<m.length;y++)typeof m[y]=="function"&&(m[y]=m[y]())}_log(m,y,x){this._evalLazyOptionalParams(x),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...x)}trace(m,...y){var x,w;this._logLevel<=f.LogLevelEnum.TRACE&&this._log((w=(x=this._optionsService.options.logger)===null||x===void 0?void 0:x.trace.bind(this._optionsService.options.logger))!==null&&w!==void 0?w:console.log,m,y)}debug(m,...y){var x,w;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log((w=(x=this._optionsService.options.logger)===null||x===void 0?void 0:x.debug.bind(this._optionsService.options.logger))!==null&&w!==void 0?w:console.log,m,y)}info(m,...y){var x,w;this._logLevel<=f.LogLevelEnum.INFO&&this._log((w=(x=this._optionsService.options.logger)===null||x===void 0?void 0:x.info.bind(this._optionsService.options.logger))!==null&&w!==void 0?w:console.info,m,y)}warn(m,...y){var x,w;this._logLevel<=f.LogLevelEnum.WARN&&this._log((w=(x=this._optionsService.options.logger)===null||x===void 0?void 0:x.warn.bind(this._optionsService.options.logger))!==null&&w!==void 0?w:console.warn,m,y)}error(m,...y){var x,w;this._logLevel<=f.LogLevelEnum.ERROR&&this._log((w=(x=this._optionsService.options.logger)===null||x===void 0?void 0:x.error.bind(this._optionsService.options.logger))!==null&&w!==void 0?w:console.error,m,y)}};a.LogService=v=c([u(0,f.IOptionsService)],v),a.setTraceLogger=function(m){g=m},a.traceCall=function(m,y,x){if(typeof x.value!="function")throw new Error("not supported");const w=x.value;x.value=function(...k){if(g.logLevel!==f.LogLevelEnum.TRACE)return w.apply(this,k);g.trace(`GlyphRenderer#${w.name}(${k.map(P=>JSON.stringify(P)).join(", ")})`);const T=w.apply(this,k);return g.trace(`GlyphRenderer#${w.name} return`,T),T}}},7302:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const c=l(8460),u=l(844),h=l(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class d extends u.Disposable{constructor(v){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m=Object.assign({},a.DEFAULT_OPTIONS);for(const y in v)if(y in m)try{const x=v[y];m[y]=this._sanitizeAndValidateOption(y,x)}catch(x){console.error(x)}this.rawOptions=m,this.options=Object.assign({},m),this._setupOptions()}onSpecificOptionChange(v,m){return this.onOptionChange(y=>{y===v&&m(this.rawOptions[v])})}onMultipleOptionChange(v,m){return this.onOptionChange(y=>{v.indexOf(y)!==-1&&m()})}_setupOptions(){const v=y=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},m=(y,x)=>{if(!(y in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);x=this._sanitizeAndValidateOption(y,x),this.rawOptions[y]!==x&&(this.rawOptions[y]=x,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const x={get:v.bind(this,y),set:m.bind(this,y)};Object.defineProperty(this.options,y,x)}}_sanitizeAndValidateOption(v,m){switch(v){case"cursorStyle":if(m||(m=a.DEFAULT_OPTIONS[v]),!function(y){return y==="block"||y==="underline"||y==="bar"}(m))throw new Error(`"${m}" is not a valid value for ${v}`);break;case"wordSeparator":m||(m=a.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=f.includes(m)?m:a.DEFAULT_OPTIONS[v];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${v} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${v} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}a.OptionsService=d},2660:function(o,a,l){var c=this&&this.__decorate||function(d,g,v,m){var y,x=arguments.length,w=x<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,g,v,m);else for(var k=d.length-1;k>=0;k--)(y=d[k])&&(w=(x<3?y(w):x>3?y(g,v,w):y(g,v))||w);return x>3&&w&&Object.defineProperty(g,v,w),w},u=this&&this.__param||function(d,g){return function(v,m){g(v,m,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const h=l(2585);let f=a.OscLinkService=class{constructor(d){this._bufferService=d,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(d){const g=this._bufferService.buffer;if(d.id===void 0){const k=g.addMarker(g.ybase+g.y),T={data:d,id:this._nextId++,lines:[k]};return k.onDispose(()=>this._removeMarkerFromLink(T,k)),this._dataByLinkId.set(T.id,T),T.id}const v=d,m=this._getEntryIdKey(v),y=this._entriesWithId.get(m);if(y)return this.addLineToLink(y.id,g.ybase+g.y),y.id;const x=g.addMarker(g.ybase+g.y),w={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[x]};return x.onDispose(()=>this._removeMarkerFromLink(w,x)),this._entriesWithId.set(w.key,w),this._dataByLinkId.set(w.id,w),w.id}addLineToLink(d,g){const v=this._dataByLinkId.get(d);if(v&&v.lines.every(m=>m.line!==g)){const m=this._bufferService.buffer.addMarker(g);v.lines.push(m),m.onDispose(()=>this._removeMarkerFromLink(v,m))}}getLinkData(d){var g;return(g=this._dataByLinkId.get(d))===null||g===void 0?void 0:g.data}_getEntryIdKey(d){return`${d.id};;${d.uri}`}_removeMarkerFromLink(d,g){const v=d.lines.indexOf(g);v!==-1&&(d.lines.splice(v,1),d.lines.length===0&&(d.data.id!==void 0&&this._entriesWithId.delete(d.key),this._dataByLinkId.delete(d.id)))}};a.OscLinkService=f=c([u(0,h.IBufferService)],f)},8343:(o,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",c="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(u){return u[c]||[]},a.createDecorator=function(u){if(a.serviceRegistry.has(u))return a.serviceRegistry.get(u);const h=function(f,d,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,m,y){m[l]===m?m[c].push({id:v,index:y}):(m[c]=[{id:v,index:y}],m[l]=m)})(h,f,g)};return h.toString=()=>u,a.serviceRegistry.set(u,h),h}},2585:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const c=l(8343);var u;a.IBufferService=(0,c.createDecorator)("BufferService"),a.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),a.ICoreService=(0,c.createDecorator)("CoreService"),a.ICharsetService=(0,c.createDecorator)("CharsetService"),a.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(u||(a.LogLevelEnum=u={})),a.ILogService=(0,c.createDecorator)("LogService"),a.IOptionsService=(0,c.createDecorator)("OptionsService"),a.IOscLinkService=(0,c.createDecorator)("OscLinkService"),a.IUnicodeService=(0,c.createDecorator)("UnicodeService"),a.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(o,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const c=l(8460),u=l(225);a.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const h=new u.UnicodeV6;this.register(h),this._active=h.version,this._activeProvider=h}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(h){if(!this._providers[h])throw new Error(`unknown Unicode version "${h}"`);this._active=h,this._activeProvider=this._providers[h],this._onChange.fire(h)}register(h){this._providers[h.version]=h}wcwidth(h){return this._activeProvider.wcwidth(h)}getStringCellWidth(h){let f=0;const d=h.length;for(let g=0;g<d;++g){let v=h.charCodeAt(g);if(55296<=v&&v<=56319){if(++g>=d)return f+this.wcwidth(v);const m=h.charCodeAt(g);56320<=m&&m<=57343?v=1024*(v-55296)+m-56320+65536:f+=this.wcwidth(m)}f+=this.wcwidth(v)}return f}}}},r={};function i(o){var a=r[o];if(a!==void 0)return a.exports;var l=r[o]={exports:{}};return n[o].call(l.exports,l,l.exports,i),l.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const a=i(9042),l=i(3236),c=i(844),u=i(5741),h=i(8285),f=i(7975),d=i(7090),g=["cols","rows"];class v extends c.Disposable{constructor(y){super(),this._core=this.register(new l.Terminal(y)),this._addonManager=this.register(new u.AddonManager),this._publicOptions=Object.assign({},this._core.options);const x=k=>this._core.options[k],w=(k,T)=>{this._checkReadonlyOptions(k),this._core.options[k]=T};for(const k in this._core.options){const T={get:x.bind(this,k),set:w.bind(this,k)};Object.defineProperty(this._publicOptions,k,T)}}_checkReadonlyOptions(y){if(g.includes(y))throw new Error(`Option "${y}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new d.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const x in y)this._publicOptions[x]=y[x]}blur(){this._core.blur()}focus(){this._core.focus()}resize(y,x){this._verifyIntegers(y,x),this._core.resize(y,x)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){var x,w,k;return this._checkProposedApi(),this._verifyPositiveIntegers((x=y.x)!==null&&x!==void 0?x:0,(w=y.width)!==null&&w!==void 0?w:0,(k=y.height)!==null&&k!==void 0?k:0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,x,w){this._verifyIntegers(y,x,w),this._core.select(y,x,w)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,x){this._verifyIntegers(y,x),this._core.selectLines(y,x)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,x){this._core.write(y,x)}writeln(y,x){this._core.write(y),this._core.write(`\r
|
303
|
-
`,x)}paste(y){this._core.paste(y)}refresh(y,x){this._verifyIntegers(y,x),this._core.refresh(y,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return a}_verifyIntegers(...y){for(const x of y)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const x of y)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}o.Terminal=v})(),s})())}(yP)),yP.exports}var Mie=zRe(),bP={exports:{}},wW;function FRe(){return wW||(wW=1,function(t,e){(function(n,r){t.exports=r()})(self,()=>(()=>{var n={};return(()=>{var r=n;function i(s,o,a){return s.addEventListener(o,a),{dispose:()=>{a&&s.removeEventListener(o,a)}}}Object.defineProperty(r,"__esModule",{value:!0}),r.AttachAddon=void 0,r.AttachAddon=class{constructor(s,o){this._disposables=[],this._socket=s,this._socket.binaryType="arraybuffer",this._bidirectional=!(o&&o.bidirectional===!1)}activate(s){this._disposables.push(i(this._socket,"message",o=>{const a=o.data;s.write(typeof a=="string"?a:new Uint8Array(a))})),this._bidirectional&&(this._disposables.push(s.onData(o=>this._sendData(o))),this._disposables.push(s.onBinary(o=>this._sendBinary(o)))),this._disposables.push(i(this._socket,"close",()=>this.dispose())),this._disposables.push(i(this._socket,"error",()=>this.dispose()))}dispose(){for(const s of this._disposables)s.dispose()}_sendData(s){this._checkOpenSocket()&&this._socket.send(s)}_sendBinary(s){if(!this._checkOpenSocket())return;const o=new Uint8Array(s.length);for(let a=0;a<s.length;++a)o[a]=255&s.charCodeAt(a);this._socket.send(o)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}}})(),n})())}(bP)),bP.exports}var $ie=FRe(),xP={exports:{}},SW;function VRe(){return SW||(SW=1,function(t,e){(function(n,r){t.exports=r()})(self,()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const s=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(s._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,s=i._renderService.dimensions;if(s.css.cell.width===0||s.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),c=Math.max(0,parseInt(a.getPropertyValue("width"))),u=window.getComputedStyle(this._terminal.element),h=l-(parseInt(u.getPropertyValue("padding-top"))+parseInt(u.getPropertyValue("padding-bottom"))),f=c-(parseInt(u.getPropertyValue("padding-right"))+parseInt(u.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(f/s.css.cell.width)),rows:Math.max(1,Math.floor(h/s.css.cell.height))}}}})(),n})())}(xP)),xP.exports}var WRe=VRe();const Die={foreground:"#B8C2D5",background:"#06070A",cursor:"#B8C2D5",selection:"#49483e",black:"#272822",red:"#f92672",green:"#a6e22e",yellow:"#f4bf75",blue:"#66d9ef",magenta:"#ae81ff",cyan:"#a1efe4",white:"#f8f8f2",brightBlack:"#75715e",brightRed:"#f92672",brightGreen:"#a6e22e",brightYellow:"#f4bf75",brightBlue:"#66d9ef",brightMagenta:"#ae81ff",brightCyan:"#a1efe4",brightWhite:"#f9f8f5"};function Iie(){const t=E.useRef(null);return t.current||(t.current=new WRe.FitAddon),t.current}function Lie(t,e){return t.onRender(()=>{e(t.buffer.active.baseY>0)}),xn.subscribe(r=>r.isPanScrolling,r=>{r?t.options.scrollSensitivity=Number.MIN_VALUE:t.options.scrollSensitivity=1})}function Nie(t,e){t.readyState===1?(t.close(),e.dispose()):t.addEventListener("open",()=>{t.close(),e.dispose()})}const Vp={},Nd={};function qRe({sectionId:t,width:e,height:n,setHasScrollbar:r}){const i=E.useRef(null),s=Iie();return E.useEffect(()=>{const o=new Mie.Terminal({cursorBlink:!0,theme:Die});o.loadAddon(s),o.open(i.current);const{ws:a}=URe(t);o.onResize(u=>{const h=JSON.stringify({messageType:re.WS_TERMINAL_RESIZE,cols:u.cols,rows:u.rows});a.readyState===1?a.send(h):Qie(t,h)});function l(u){if(u.data===re.SETTA_TERMINAL_READY){const h=new $ie.AttachAddon(a);o.loadAddon(h),a.removeEventListener("message",l)}}a.addEventListener("message",l);const c=Lie(o,r);return()=>{Nie(a,o),c()}},[]),E.useEffect(()=>{s.fit()},[e,n]),i}function URe(t){const e=le.getState().projectConfig.id,n=Tr(),r=!!le.getState().x[t].isTemporary,i=`${Gv.WEBSOCKET}${oL(re.ROUTE_TERMINAL,{projectConfigId:e,sectionId:t,id:n,isTemporary:r})}`,s=new WebSocket(i);s.addEventListener("open",async()=>{var a;if(((a=Nd[t])==null?void 0:a.length)>0){const l=[];for(const[c,u]of Nd[t].entries())await new Promise(h=>setTimeout(h,0)),s.readyState===1&&(s.send(u),l.push(c));Nd[t]=Nd[t].filter((c,u)=>!l.includes(u))}});function o(){t in Vp&&(Vp[t]=XRe(Vp[t],s))}return s.addEventListener("close",o),s.addEventListener("error",o),t in Vp||(Vp[t]=[]),Vp[t].push(s),{ws:s,wsId:n}}function Qie(t,e){t in Nd||(Nd[t]=[]),Nd[t].includes(e)||Nd[t].push(e)}function HRe(t,e){for(const n of Vp[t])if(n.readyState===1){n.send(e);break}}function XRe(t,e){return t.filter(n=>n!==e)}async function ZRe(){const t=await wRe(le.getState().projectConfig.id);if(t.status===200){const n=t.data.filter(r=>!(r.id in le.getState().x));if(n.length===0)return;le.setState(r=>{const i=jie(r);for(const s of n)Bie(s.id,i,r)}),Wn(!0)}}function Bie(t,e,n){O8({sectionProps:{id:t,parentId:e,uiTypeId:VO[re.TERMINAL],isTemporary:!0},state:n}),oO(e,r=>[...r,t],n)}function jie(t){let e=t.singletonSections.temporaryTerminalGroup;return e||(e=A2({type:re.GROUP,sectionProps:{name:GRe(),isTemporary:!0},state:t})),e}function GRe(){const t="Temporary Terminals",e=me.map(le.getState().x,r=>r.name);let n=t;for(;e.includes(n);)n=`${t} ${createRandomName()}`;return n}function*YRe(t){const e={};for(const i of t)e[i.variantId]||(e[i.variantId]=[]),e[i.variantId].push(i);function*n(i,s=[],o={}){if(i.length===0){const h=[];for(const[f,d]of Object.entries(o))for(const g of Object.values(d))h.push(g);yield h;return}const a=i[0],l=i.slice(1),c=e[a];for(const h of c){let g=function(v,m={}){if(v.length===0){f.push({...m});return}const y=v[0],x=v.slice(1);for(const w of d[y])m[y]={paramSweepSectionId:h.paramSweepSectionId,variantId:h.variantId,selectedItem:h.selectedItem,paramInfoId:y,value:w},g(x,m)};var u=g;if(s.some(v=>v.variantId===h.variantId&&v.selectedItem!==h.selectedItem))continue;const f=[],d={};for(const v of h.params)d[v.paramInfoId]=v.values;g(Object.keys(d));for(const v of f){const m={...o},y=`${h.variantId}-${h.selectedItem}`;m[y]=v,yield*n(l,[...s,h],m)}}}const r=Object.keys(e);yield*n(r)}function*KRe(t){const e=new Map;t.forEach(l=>{e.has(l.sectionId)||e.set(l.sectionId,[]),e.get(l.sectionId).push(l)});const n=new Map;t.forEach(l=>{l.parentVersionId===null&&(n.has(l.sectionId)||n.set(l.sectionId,[]),n.get(l.sectionId).push(l))});const r=new Map;t.forEach(l=>{l.parentVersionId!==null&&(r.has(l.parentVersionId)||r.set(l.parentVersionId,[]),r.get(l.parentVersionId).push(l))});function i(l){const c=new Set;return l.forEach(u=>{(r.get(u.versionId)||[]).forEach(f=>{c.add(f)})}),Array.from(c)}function s(l){const c=new Set;for(const h of l){if(c.has(h.sectionId))return!1;c.add(h.sectionId)}for(const h of l)if(h.parentVersionId!==null&&!l.some(d=>d.versionId===h.parentVersionId))return!1;const u=i(l);for(const h of u)if(!l.some(d=>d.sectionId===h.sectionId))return!1;for(const[h]of n)if(!l.some(f=>f.sectionId===h))return!1;return!0}function*o(l=[],c=null,u=new Set){if(c===null&&(c=new Set(t.map(g=>g.sectionId))),c.size===0){if(s(l)){const g=JSON.stringify(l);u.has(g)||(u.add(g),yield l)}return}const h=Array.from(c)[0],f=new Set(c);f.delete(h);const d=e.get(h)||[];for(const g of d){if(g.parentVersionId!==null&&!l.some(w=>w.versionId===g.parentVersionId))continue;const v=[...l,g],m=i([g]),y=new Set;for(const x of m)!l.some(w=>w.sectionId===x.sectionId)&&!f.has(x.sectionId)&&y.add(x.sectionId);y.forEach(x=>f.add(x)),yield*o(v,f,u)}n.has(h)||(yield*o(l,f,u))}yield*o([],null,new Set)}async function R2({withArtifacts:t=!1,includeFullNameToInfo:e=!0,includeInfoToFullName:n=!0,includeFullNameToSectionId:r=!0,includeSectionPathFullNames:i=!0,includeDrawings:s=!1,includeLatestChatMessages:o=!1}){const a=q7({withArtifacts:t});if(e&&(a.fullNameToInfo=zm.getState().fullNameToInfo),n&&(a.infoToFullName=$te()),r&&(a.fullNameToSectionId=_7.getState().fullNameToSectionId),i){a.sectionPathFullNames={};for(const l of Object.values(a.sections))a.sectionPathFullNames[l.id]=WL(l.id,le.getState())}if(s||o){const l=le.getState().x,c={};for(const u of Object.values(l)){const h=me.cloneDeep(u);if(s&&Bn(u.id)===re.DRAW){const{drawing:f,layers:d}=await Bne(u.id);h.drawing=f,h.layers=d}o&&Bn(u.id)===re.CHAT&&(h.latestChatMessage=null),c[u.id]=h}a.sections=c}return a}async function _W(t,e=0){let r={id:Tr(),messageType:re.WS_RUN_CODE,content:t};if(qO.getState().connectedTo!=="main"){w2(r);return}const i=await xRe(t.projectConfig.id);if(i.status===200){const s=i.data;if(r=JSON.stringify(r),s)HRe(s,r);else{const o=Tr();Qie(o,r),le.setState(a=>{const l=jie(a);Bie(o,l,a)})}}}function*zie(t){const e=le.getState().singletonSections[re.GLOBAL_PARAM_SWEEP],n=e?Ks(e).selectedVariantIds:{};if(!e||me.size(n)===0){const r=me.cloneDeep(t),i={};for(const s of Object.values(r.sections))s.paramSweepSectionId&&(i[s.paramSweepSectionId]=r.sections[s.paramSweepSectionId].variantId);r.runCodeBlocks=CW(t),yield*kW(r,i)}else for(const r of Object.keys(n)){const i=le.getState().variants[r].runGroup,s=Fie(t,i,Object.keys(t.projectConfig.children),null);for(const o of KRe(s)){const a=me.cloneDeep(t);a.projectConfig.children=me.pick(a.projectConfig.children,o.map(c=>c.sectionId)),a.sections=me.pick(a.sections,o.map(c=>c.sectionId));for(const c of Object.values(a.sectionVariants))c.children=c.children.filter(u=>u in a.sections);for(const c of o)c.versionId&&(a.sections[c.sectionId].variantId=c.versionId);const l={};for(const c of o)if(c.paramSweepId){const{paramSweepSectionId:u}=a.sections[c.sectionId];l[u]=c.paramSweepId}a.runCodeBlocks=CW(t),yield*kW(a,l)}}}function Fie(t,e,n,r){var s;const i=[];for(const o of n){const a=(s=e[o])==null?void 0:s[r];if(!a||!a.selected)continue;let l=!1;const c=t.sections[o].variantId;for(const[u,h]of Object.entries(a.paramSweeps))h&&(i.push({sectionId:o,paramSweepId:u,versionId:c,parentVersionId:r}),l=!0);for(const[u,h]of Object.entries(a.versions))if(h){(u!==c||!l)&&i.push({sectionId:o,paramSweepId:null,versionId:u,parentVersionId:r});const f=t.sectionVariants[u].children;i.push(...Fie(t,e,f,u))}}return i}function*kW(t,e){const n=[];for(const[r,i]of Object.entries(e))for(const s of t.sectionVariants[i].sweep)s.params=s.params.filter(o=>o.paramInfoId),n.push({paramSweepSectionId:r,variantId:i,...s});if(n.length>0)for(const r of YRe(n)){const i=me.cloneDeep(t);for(const s of r){const{paramSweepSectionId:o,selectedItem:a,paramInfoId:l,value:c}=s,u=v2(o,t.sections),{variantId:h}=t.sections[u],f=i.sectionVariants[h];if(f.selectedItem=a,l){const d=f.values[l]??ZO();d.value=c,f.values[l]=d}}yield i}else yield t}function CW(t,e){var r;const n=[];for(const i of Object.values(t.sections))(((r=t.uiTypes[i.uiTypeId])==null?void 0:r.type)??WI[i.uiTypeId].type)===re.CODE&&n.push(i.id);return n.length>0?n:null}async function yN(t=!1){t&&(To("Checking types..."),wv.setState({userRequested:t}));const e=await R2({});w2({content:e,id:Tr(),messageType:"typeCheck"})}const cM=h2(yN,500);async function JRe({sectionId:t,fullText:e,position:n}){return await Wie({sectionId:t,paramInfoId:null,fullText:e,position:n,messageType:"parametersRequest"})}async function eMe({sectionId:t,paramInfoId:e}){const n=await R2({});await w2({id:Tr(),messageType:"textFieldInitializeCode",content:{project:n,sectionId:t,paramInfoId:e}})}async function Vie(t){const e=await R2({});return await iO({id:Tr(),messageType:"codeAreaInitializeCode",content:{project:e,sectionId:t}})}async function tMe({sectionId:t,fullText:e,position:n,codeLanguage:r}){const{id:i,name:s}=le.getState().projectConfig,{name:o}=Ks(t),a=uL({sectionId:t,paramInfoId:null,value:e,regexPatternKey:"codeAreaPattern"}),l=hL(t,e),c={id:Tr(),messageType:"codeAreaAutocomplete",content:{projectConfigId:i,projectConfigName:s,codeLanguage:r,sectionId:t,sectionName:o,fullText:e,position:n,candidateEVRefs:a,candidateTemplateVars:l}},u=await iO(c);return u.data===re.CODE_AREA_GEN_CODE_NOT_INITIALIZED?(await Vie(t)).data?await iO(c):[]:u}async function Wie({sectionId:t,paramInfoId:e,fullText:n,position:r,messageType:i="textFieldCompletion"}){const{id:s,name:o}=le.getState().projectConfig,a=uL({sectionId:t,paramInfoId:e,value:n,regexPatternKey:"pattern"});return await iO({id:Tr(),messageType:i,content:{projectConfigId:s,projectConfigName:o,sectionId:t,paramInfoId:e,fullText:n,position:r,candidateEVRefs:a}})}async function bN({sectionId:t,paramInfoId:e,fullText:n,regexPatternKey:r="pattern",templateVars:i=null,onlyAfterGenCodeTemplateVar:s=!1}){let o=[],a=[];const l=uL({sectionId:t,paramInfoId:e,value:n,regexPatternKey:r});if(l.length>0){let c=0;a=[],await iO({id:Tr(),messageType:"findEVRefs",content:{sectionId:t,paramInfoId:e,candidateEVRefs:l,fullText:n,templateVars:i,onlyAfterGenCodeTemplateVar:s},condition:({data:{positions:u,numMessages:h}})=>(a.push(...u),c+=1,c===h)}),a.sort((u,h)=>u.startPos-h.startPos),o=r6e(a,n)}return o}async function nMe(t,e){let n=[],r=[];const i=hL(t,e);if(i.length>0){let s=0;r=[],await iO({id:Tr(),messageType:"codeAreaFindTemplateVars",content:{sectionId:t,candidateTemplateVars:i,fullText:e},condition:({data:{positions:o,numMessages:a}})=>(o!==null&&r.push(...o),s+=1,s===a)}),r.sort((o,a)=>o.startPos-a.startPos),n=i6e(r,e)}return n}async function rMe(t,e){const n=await nMe(t,e),r=await bN({sectionId:t,paramInfoId:null,fullText:e,regexPatternKey:"codeAreaPattern",templateVars:n,onlyAfterGenCodeTemplateVar:!0});return{templateVars:n,evRefs:r}}function iMe(){return S.jsx(mN,{trigger:"Edit",children:S.jsx(sMe,{})})}function sMe(){const t=vn(e=>({newCardShortcut:Ni(e.shortcuts.newCardShortcut),newGroupShortcut:Ni(e.shortcuts.newGroupShortcut),typeCheckShortcut:Ni(e.shortcuts.typeCheckShortcut),redoShortcut:Ni(e.shortcuts.redoShortcut),undoShortcut:Ni(e.shortcuts.undoShortcut),groupShortcut:Ni(e.shortcuts.groupShortcut),restartLanguageServerShortcut:Ni(e.shortcuts.restartLanguageServerShortcut)}),me.isEqual);return S.jsxs(S.Fragment,{children:[S.jsxs(Hn,{onClick:Tie,shortcut:t.newCardShortcut,children:[S.jsx(qEe,{className:"h-4 w-4"})," Card"]}),S.jsxs(Hn,{onClick:Pie,shortcut:t.newGroupShortcut,children:[S.jsx(bRe,{className:"h-4 w-4"}),"Group"]}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(Hn,{onClick:()=>yN(!0),shortcut:t.typeCheckShortcut,children:"Type Check"}),S.jsx(Hn,{onClick:Sie,shortcut:t.restartLanguageServerShortcut,children:"Restart Language Server"}),S.jsx(Hn,{onClick:LRe,children:"Auto Layout"}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(Hn,{onClick:pL,shortcut:t.redoShortcut,children:"Redo"}),S.jsx(Hn,{onClick:dL,shortcut:t.undoShortcut,children:"Undo"}),S.jsx(Hn,{onClick:Q8e,children:"Reset sections"}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(T2,{to:UI,children:S.jsx(Hn,{children:"Settings"})})]})}async function oMe({projectConfigName:t}){const e=await l6e(t);return e.status===200?await xN(e.data):!1}async function aMe(){const t=await x6e();return t.status===200?await xN(t.data):!1}async function xN({projectConfig:t,codeInfo:e,codeInfoCols:n,sections:r,sectionVariants:i,artifactGroups:s,uiTypes:o,uiTypeCols:a}){if(!t.viewport)ht.setState({fitViewOnInit:!0,fitViewOnInitDone:!1});else{const{x:l,y:c,zoom:u}=t.viewport;ht.setState({fitViewOnInit:!1,fitViewOnInitDone:!0,transform:[l,c,u]})}return le.setState({projectConfig:me.omit(t,["children","viewport"]),x:r,variants:i,uiTypes:{...o,...WI},uiTypeCols:a,codeInfo:e,codeInfoCols:n,artifactGroups:s}),UO.setState(me.mapValues(r,l=>l.columnWidth)),Yr.setState({x:cMe(t)}),await RC(),Wn(!0,!1),!0}function qie(){const t=wN();return async()=>{const e=lMe(),{data:n}=await u6e({previewImgColor:e});t(n)}}function lMe(){const t=Math.floor(Math.random()*kF.length);return kF[t]}function wN(){const t=ay();return e=>{t(O7(e),{state:{pageLoadType:Jv.LOAD_PROJECT_CONFIG}})}}function cMe(t){const e=new Map;for(let n of Object.keys(t.children)){const r=t.children[n];e.set(n,{id:n,position:{x:r.x,y:r.y},zIndex:r.zIndex,tempZIndex:r.zIndex,visibility:!0})}return e}function uMe(){const t=vn(n=>({newProjectConfigShortcut:Ni(n.shortcuts.newProjectConfigShortcut),saveShortcut:Ni(n.shortcuts.saveShortcut),saveAsShortcut:Ni(n.shortcuts.saveAsShortcut),loadShortcut:Ni(n.shortcuts.loadShortcut),undoShortcut:Ni(n.shortcuts.undoShortcut),groupShortcut:Ni(n.shortcuts.groupShortcut)}),me.isEqual),e=qie();return S.jsxs(mN,{trigger:"File",children:[S.jsx(Hn,{onClick:e,shortcut:t.newProjectConfigShortcut,children:"New Config"}),S.jsx(Hn,{onClick:Rte,shortcut:t.loadShortcut,children:"Load"}),S.jsxs(Hn,{onClick:U7,shortcut:t.saveShortcut,children:[S.jsx(gre,{}),"Save"]}),S.jsxs(Hn,{onClick:Mte,shortcut:t.saveAsShortcut,children:[S.jsx(kV,{}),"Save As"]}),S.jsxs(Hn,{onClick:BCe,children:[S.jsx(kV,{}),"Save As (With Refs)"]}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(Hn,{onClick:zCe,children:"Import JSON"}),S.jsx(Hn,{onClick:jCe,children:"Export JSON"})]})}const cO=E.forwardRef((t,e)=>{const{twClasses:n="",grid:r=!1,type:i,onClick:s,children:o,...a}=t,c=`focus-visible:ring-2 ${r?"grid place-items-center":"inline-flex items-center"} nodrag cursor-pointer ${n} `;return S.jsx("button",{className:c,...a,ref:e,type:i,onClick:s,children:o})}),Uie="Popover",[Hie,L3t]=Ga(Uie,[i8]),y8=i8(),[hMe,Gm]=Hie(Uie),fMe=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=y8(e),l=E.useRef(null),[c,u]=E.useState(!1),[h=!1,f]=Uu({prop:r,defaultProp:i,onChange:s});return E.createElement(Dre,a,E.createElement(hMe,{scope:e,contentId:Gd(),triggerRef:l,open:h,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(d=>!d),[f]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>u(!0),[]),onCustomAnchorRemove:E.useCallback(()=>u(!1),[]),modal:o},n))},dMe="PopoverTrigger",pMe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Gm(dMe,n),s=y8(n),o=yr(e,i.triggerRef),a=E.createElement(Zn.button,ze({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Gie(i.open)},r,{ref:o,onClick:zt(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:E.createElement(Ire,ze({asChild:!0},s),a)}),Xie="PopoverPortal",[mMe,gMe]=Hie(Xie,{forceMount:void 0}),vMe=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=Gm(Xie,e);return E.createElement(mMe,{scope:e,forceMount:n},E.createElement(Um,{present:n||s.open},E.createElement(Nre,{asChild:!0,container:i},r)))},sS="PopoverContent",OMe=E.forwardRef((t,e)=>{const n=gMe(sS,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Gm(sS,t.__scopePopover);return E.createElement(Um,{present:r||s.open},s.modal?E.createElement(yMe,ze({},i,{ref:e})):E.createElement(bMe,ze({},i,{ref:e})))}),yMe=E.forwardRef((t,e)=>{const n=Gm(sS,t.__scopePopover),r=E.useRef(null),i=yr(e,r),s=E.useRef(!1);return E.useEffect(()=>{const o=r.current;if(o)return o8(o)},[]),E.createElement(l8,{as:lO,allowPinchZoom:!0},E.createElement(Zie,ze({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zt(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:zt(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:zt(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),bMe=E.forwardRef((t,e)=>{const n=Gm(sS,t.__scopePopover),r=E.useRef(!1);return E.createElement(Zie,ze({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var o;r.current||(o=n.triggerRef.current)===null||o===void 0||o.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var s,o;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0);const a=i.target;((o=n.triggerRef.current)===null||o===void 0?void 0:o.contains(a))&&i.preventDefault()}}))}),Zie=E.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...h}=t,f=Gm(sS,n),d=y8(n);return yre(),E.createElement(bre,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},E.createElement(vre,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},E.createElement(Lre,ze({"data-state":Gie(f.open),role:"dialog",id:f.contentId},d,h,{ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)"}}))))}),xMe="PopoverClose",wMe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Gm(xMe,n);return E.createElement(Zn.button,ze({type:"button"},r,{ref:e,onClick:zt(t.onClick,()=>i.onOpenChange(!1))}))}),SMe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=y8(n);return E.createElement(sPe,ze({},i,r,{ref:e}))});function Gie(t){return t?"open":"closed"}const _Me=fMe,kMe=pMe,CMe=vMe,EMe=OMe,TMe=wMe,PMe=SMe;function pv({trigger:t,contentClasses:e,children:n,open:r,close:i=!1,closeClasses:s,onOpenChange:o,arrowClasses:a}){return S.jsxs(_Me,{open:r,onOpenChange:o,children:[S.jsx(kMe,{asChild:!0,children:t}),S.jsx(CMe,{children:S.jsxs(EMe,{className:e,children:[i&&S.jsx(TMe,{className:s,children:i}),S.jsx(PMe,{className:a||"[fill:rgb(229,_231,_235)] dark:[fill:rgb(51,_65,_85)]"}),n]})})]})}const Ci=hwe(()=>({isFrozen:!1,isEnabled:!1,contentArray:null,idx:0,copied:!1}));let EW=!1;const SN="setta-tooltip-floating-box",AMe=()=>{const[t,e]=E.useState({x:0,y:0}),{isEnabled:n,contentArray:r,isFrozen:i,idx:s,copied:o}=Ci(),a=E.useRef(null);return E.useEffect(()=>{const l=c=>{EW=!0,i||e({x:c.clientX+10,y:c.clientY+10})};return window.addEventListener("mousemove",l),()=>window.removeEventListener("mousemove",l)},[i]),E.useEffect(()=>{if(!a.current||!n)return;const l=a.current,c=l.getBoundingClientRect(),u=window.innerWidth,h=window.innerHeight;let{x:f,y:d}=t;f+c.width>u&&(f=u-c.width-8),d+c.height>h&&(d=h-c.height-8),l.style.transform=`translate(${f}px, ${d}px)`},[n,t]),!n||!r||r.length===0||!EW?null:S.jsxs("div",{id:SN,ref:a,className:`fixed left-0 top-0 z-50 flex max-h-96 w-64 flex-col rounded-2xl border border-setta-200 bg-white p-4 shadow-lg focus:outline focus:outline-2 focus:outline-blue-600 dark:border-setta-700 dark:bg-setta-950 ${r[s].wrapperClassName}`,style:{transform:`translate(${t.x}px, ${t.y}px)`},tabIndex:"0",children:[S.jsx(MMe,{item:r[s],copied:o}),S.jsx(RMe,{item:r[s],isFrozen:i}),S.jsx($Me,{numPages:r.length,idx:s})]})},RMe=Ne.memo(({item:t,isFrozen:e})=>S.jsxs(S.Fragment,{children:[t.title&&S.jsx("h3",{className:`break-words pb-1 text-xs font-black uppercase text-setta-500 dark:text-setta-600 ${t.titleClassName}`,children:t.title}),S.jsx("article",{className:`flex-1 overflow-y-auto whitespace-pre-line break-words text-sm text-setta-700 dark:text-setta-300 ${t.contentClassName}`,children:t.content}),!!t.content&&S.jsx(DMe,{isFrozen:e})]}),me.isEqual),MMe=Ne.memo(({item:t,copied:e})=>{const n=async()=>{try{const i=t.content??t.title;await navigator.clipboard.writeText(i),setTimeout(()=>{Ci.setState({copied:!1})},2e3)}catch(i){console.error("Failed to copy:",i)}};function r(){Ci.setState({copied:!0})}return E.useEffect(()=>{e&&n()},[e]),S.jsx("button",{onClick:r,className:"tooltip-copy absolute right-2 top-2 cursor-pointer rounded-lg p-1.5 text-setta-500 hover:bg-setta-100 dark:text-setta-400 dark:hover:bg-setta-800","aria-label":e?"Copied!":"Copy to clipboard",children:e?S.jsx(mre,{className:"h-4 w-4"}):S.jsx(e8,{className:"h-4 w-4"})})},me.isEqual),$Me=Ne.memo(({numPages:t,idx:e})=>t>1?S.jsx("div",{className:"tooltip-page mt-4 flex items-center justify-center gap-2",children:Array.from({length:t}).map((n,r)=>S.jsx("div",{className:`h-2 w-2 rounded-full ${r===e?"bg-blue-500":"bg-setta-300 dark:bg-setta-600"}`,"aria-label":`Page ${r+1} of ${t}${r===e?" (current)":""}`},r))}):null);function DMe({isFrozen:t}){const e="tooltip-footer mt-4 border-t border-solid border-setta-100 pt-1 text-[10px] text-setta-500 dark:border-setta-700 dark:text-setta-600";return t?S.jsx(IMe,{className:e}):S.jsx(LMe,{className:e})}function IMe({className:t}){const e=vn(n=>({frozenTooltipToPlaintextShortcut:Ni(n.shortcuts.frozenTooltipToPlaintextShortcut),frozenTooltipToMarkdownShortcut:Ni(n.shortcuts.frozenTooltipToMarkdownShortcut)}),me.isEqual);return S.jsxs("p",{className:t,children:["press ",S.jsx("span",{className:"font-black",children:'"Esc"'})," to close, or"," ",S.jsxs("span",{className:"font-black",children:['"',e.frozenTooltipToPlaintextShortcut,'"']})," ","(plaintext) or"," ",S.jsxs("span",{className:"font-black",children:['"',e.frozenTooltipToMarkdownShortcut,'"']})," ","(markdown) to open tooltip as new section"]})}function LMe({className:t}){const e=vn(n=>({tooltipToPlaintextShortcut:Ni(n.shortcuts.tooltipToPlaintextShortcut),tooltipToMarkdownShortcut:Ni(n.shortcuts.tooltipToMarkdownShortcut),freezeTooltipShortcut:Ni(n.shortcuts.freezeTooltipShortcut)}),me.isEqual);return S.jsxs("ul",{className:t,children:[S.jsxs("li",{children:[S.jsxs("strong",{className:"font-black tracking-tighter",children:['"',e.tooltipToPlaintextShortcut,'"']})," ","convert to plaintext section"]}),S.jsxs("li",{children:[S.jsxs("strong",{className:"font-black tracking-tighter",children:['"',e.tooltipToMarkdownShortcut,'"']})," ","convert to markdown section"]}),S.jsxs("li",{children:[S.jsxs("strong",{className:"font-black tracking-tighter",children:['"',e.freezeTooltipShortcut,'"']})," ","freeze tooltip"]})]})}function di(...t){function e(){t&&!Ci.getState().isFrozen&&Ci.setState({contentArray:t})}function n(){Ci.getState().isFrozen||Ci.setState({contentArray:null,idx:0,copied:!1})}return{onMouseEnter:e,onMouseLeave:n}}function NMe(){Ci.setState({isEnabled:!0})}function QMe(){Ci.setState({isEnabled:!1,idx:0})}function a5(t){return async()=>{const e=Ci.getState();if(e.contentArray){const n=e.contentArray[e.idx],r=n.title?`## ${n.title}
|
303
|
+
`,x)}paste(y){this._core.paste(y)}refresh(y,x){this._verifyIntegers(y,x),this._core.refresh(y,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return a}_verifyIntegers(...y){for(const x of y)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const x of y)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}o.Terminal=v})(),s})())}(yP)),yP.exports}var Mie=zRe(),bP={exports:{}},wW;function FRe(){return wW||(wW=1,function(t,e){(function(n,r){t.exports=r()})(self,()=>(()=>{var n={};return(()=>{var r=n;function i(s,o,a){return s.addEventListener(o,a),{dispose:()=>{a&&s.removeEventListener(o,a)}}}Object.defineProperty(r,"__esModule",{value:!0}),r.AttachAddon=void 0,r.AttachAddon=class{constructor(s,o){this._disposables=[],this._socket=s,this._socket.binaryType="arraybuffer",this._bidirectional=!(o&&o.bidirectional===!1)}activate(s){this._disposables.push(i(this._socket,"message",o=>{const a=o.data;s.write(typeof a=="string"?a:new Uint8Array(a))})),this._bidirectional&&(this._disposables.push(s.onData(o=>this._sendData(o))),this._disposables.push(s.onBinary(o=>this._sendBinary(o)))),this._disposables.push(i(this._socket,"close",()=>this.dispose())),this._disposables.push(i(this._socket,"error",()=>this.dispose()))}dispose(){for(const s of this._disposables)s.dispose()}_sendData(s){this._checkOpenSocket()&&this._socket.send(s)}_sendBinary(s){if(!this._checkOpenSocket())return;const o=new Uint8Array(s.length);for(let a=0;a<s.length;++a)o[a]=255&s.charCodeAt(a);this._socket.send(o)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw new Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw new Error("Attach addon socket is closed");default:throw new Error("Unexpected socket state")}}}})(),n})())}(bP)),bP.exports}var $ie=FRe(),xP={exports:{}},SW;function VRe(){return SW||(SW=1,function(t,e){(function(n,r){t.exports=r()})(self,()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const s=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(s._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,s=i._renderService.dimensions;if(s.css.cell.width===0||s.css.cell.height===0)return;const o=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),c=Math.max(0,parseInt(a.getPropertyValue("width"))),u=window.getComputedStyle(this._terminal.element),h=l-(parseInt(u.getPropertyValue("padding-top"))+parseInt(u.getPropertyValue("padding-bottom"))),f=c-(parseInt(u.getPropertyValue("padding-right"))+parseInt(u.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(f/s.css.cell.width)),rows:Math.max(1,Math.floor(h/s.css.cell.height))}}}})(),n})())}(xP)),xP.exports}var WRe=VRe();const Die={foreground:"#B8C2D5",background:"#06070A",cursor:"#B8C2D5",selection:"#49483e",black:"#272822",red:"#f92672",green:"#a6e22e",yellow:"#f4bf75",blue:"#66d9ef",magenta:"#ae81ff",cyan:"#a1efe4",white:"#f8f8f2",brightBlack:"#75715e",brightRed:"#f92672",brightGreen:"#a6e22e",brightYellow:"#f4bf75",brightBlue:"#66d9ef",brightMagenta:"#ae81ff",brightCyan:"#a1efe4",brightWhite:"#f9f8f5"};function Iie(){const t=E.useRef(null);return t.current||(t.current=new WRe.FitAddon),t.current}function Lie(t,e){return t.onRender(()=>{e(t.buffer.active.baseY>0)}),xn.subscribe(r=>r.isPanScrolling,r=>{r?t.options.scrollSensitivity=Number.MIN_VALUE:t.options.scrollSensitivity=1})}function Nie(t,e){t.readyState===1?(t.close(),e.dispose()):t.addEventListener("open",()=>{t.close(),e.dispose()})}const Vp={},Nd={};function qRe({sectionId:t,width:e,height:n,setHasScrollbar:r}){const i=E.useRef(null),s=Iie();return E.useEffect(()=>{const o=new Mie.Terminal({cursorBlink:!0,theme:Die});o.loadAddon(s),o.open(i.current);const{ws:a}=URe(t);o.onResize(u=>{const h=JSON.stringify({messageType:re.WS_TERMINAL_RESIZE,cols:u.cols,rows:u.rows});a.readyState===1?a.send(h):Qie(t,h)});function l(u){if(u.data===re.SETTA_TERMINAL_READY){const h=new $ie.AttachAddon(a);o.loadAddon(h),a.removeEventListener("message",l)}}a.addEventListener("message",l);const c=Lie(o,r);return()=>{Nie(a,o),c()}},[]),E.useEffect(()=>{s.fit()},[e,n]),i}function URe(t){const e=le.getState().projectConfig.id,n=Tr(),r=!!le.getState().x[t].isTemporary,i=`${Gv.WEBSOCKET}${oL(re.ROUTE_TERMINAL,{projectConfigId:e,sectionId:t,id:n,isTemporary:r})}`,s=new WebSocket(i);s.addEventListener("open",async()=>{var a;if(((a=Nd[t])==null?void 0:a.length)>0){const l=[];for(const[c,u]of Nd[t].entries())await new Promise(h=>setTimeout(h,0)),s.readyState===1&&(s.send(u),l.push(c));Nd[t]=Nd[t].filter((c,u)=>!l.includes(u))}});function o(){t in Vp&&(Vp[t]=XRe(Vp[t],s))}return s.addEventListener("close",o),s.addEventListener("error",o),t in Vp||(Vp[t]=[]),Vp[t].push(s),{ws:s,wsId:n}}function Qie(t,e){t in Nd||(Nd[t]=[]),Nd[t].includes(e)||Nd[t].push(e)}function HRe(t,e){for(const n of Vp[t])if(n.readyState===1){n.send(e);break}}function XRe(t,e){return t.filter(n=>n!==e)}async function ZRe(){const t=await wRe(le.getState().projectConfig.id);if(t.status===200){const n=t.data.filter(r=>!(r.id in le.getState().x));if(n.length===0)return;le.setState(r=>{const i=jie(r);for(const s of n)Bie(s.id,i,r)}),Wn(!0)}}function Bie(t,e,n){O8({sectionProps:{id:t,parentId:e,uiTypeId:VO[re.TERMINAL],isTemporary:!0},state:n}),oO(e,r=>[...r,t],n)}function jie(t){let e=t.singletonSections.temporaryTerminalGroup;return e||(e=A2({type:re.GROUP,sectionProps:{name:GRe(),isTemporary:!0},state:t})),e}function GRe(){const t="Temporary Terminals",e=me.map(le.getState().x,r=>r.name);let n=t;for(;e.includes(n);)n=`${t} ${createRandomName()}`;return n}function*YRe(t){const e={};for(const i of t)e[i.variantId]||(e[i.variantId]=[]),e[i.variantId].push(i);function*n(i,s=[],o={}){if(i.length===0){const h=[];for(const[f,d]of Object.entries(o))for(const g of Object.values(d))h.push(g);yield h;return}const a=i[0],l=i.slice(1),c=e[a];for(const h of c){let g=function(v,m={}){if(v.length===0){f.push({...m});return}const y=v[0],x=v.slice(1);for(const w of d[y])m[y]={paramSweepSectionId:h.paramSweepSectionId,variantId:h.variantId,selectedItem:h.selectedItem,paramInfoId:y,value:w},g(x,m)};var u=g;if(s.some(v=>v.variantId===h.variantId&&v.selectedItem!==h.selectedItem))continue;const f=[],d={};for(const v of h.params)d[v.paramInfoId]=v.values;g(Object.keys(d));for(const v of f){const m={...o},y=`${h.variantId}-${h.selectedItem}`;m[y]=v,yield*n(l,[...s,h],m)}}}const r=Object.keys(e);yield*n(r)}function*KRe(t){const e=new Map;t.forEach(l=>{e.has(l.sectionId)||e.set(l.sectionId,[]),e.get(l.sectionId).push(l)});const n=new Map;t.forEach(l=>{l.parentVersionId===null&&(n.has(l.sectionId)||n.set(l.sectionId,[]),n.get(l.sectionId).push(l))});const r=new Map;t.forEach(l=>{l.parentVersionId!==null&&(r.has(l.parentVersionId)||r.set(l.parentVersionId,[]),r.get(l.parentVersionId).push(l))});function i(l){const c=new Set;return l.forEach(u=>{(r.get(u.versionId)||[]).forEach(f=>{c.add(f)})}),Array.from(c)}function s(l){const c=new Set;for(const h of l){if(c.has(h.sectionId))return!1;c.add(h.sectionId)}for(const h of l)if(h.parentVersionId!==null&&!l.some(d=>d.versionId===h.parentVersionId))return!1;const u=i(l);for(const h of u)if(!l.some(d=>d.sectionId===h.sectionId))return!1;for(const[h]of n)if(!l.some(f=>f.sectionId===h))return!1;return!0}function*o(l=[],c=null,u=new Set){if(c===null&&(c=new Set(t.map(g=>g.sectionId))),c.size===0){if(s(l)){const g=JSON.stringify(l);u.has(g)||(u.add(g),yield l)}return}const h=Array.from(c)[0],f=new Set(c);f.delete(h);const d=e.get(h)||[];for(const g of d){if(g.parentVersionId!==null&&!l.some(w=>w.versionId===g.parentVersionId))continue;const v=[...l,g],m=i([g]),y=new Set;for(const x of m)!l.some(w=>w.sectionId===x.sectionId)&&!f.has(x.sectionId)&&y.add(x.sectionId);y.forEach(x=>f.add(x)),yield*o(v,f,u)}n.has(h)||(yield*o(l,f,u))}yield*o([],null,new Set)}async function R2({withArtifacts:t=!1,includeFullNameToInfo:e=!0,includeInfoToFullName:n=!0,includeFullNameToSectionId:r=!0,includeSectionPathFullNames:i=!0,includeDrawings:s=!1,includeLatestChatMessages:o=!1}){const a=q7({withArtifacts:t});if(e&&(a.fullNameToInfo=zm.getState().fullNameToInfo),n&&(a.infoToFullName=$te()),r&&(a.fullNameToSectionId=_7.getState().fullNameToSectionId),i){a.sectionPathFullNames={};for(const l of Object.values(a.sections))a.sectionPathFullNames[l.id]=WL(l.id,le.getState())}if(s||o){const l=le.getState().x,c={};for(const u of Object.values(l)){const h=me.cloneDeep(u);s&&Bn(u.id)===re.DRAW&&(h.drawing=await Bne(u.id)),o&&Bn(u.id)===re.CHAT&&(h.latestChatMessage=null),c[u.id]=h}a.sections=c}return a}async function _W(t,e=0){let r={id:Tr(),messageType:re.WS_RUN_CODE,content:t};if(qO.getState().connectedTo!=="main"){w2(r);return}const i=await xRe(t.projectConfig.id);if(i.status===200){const s=i.data;if(r=JSON.stringify(r),s)HRe(s,r);else{const o=Tr();Qie(o,r),le.setState(a=>{const l=jie(a);Bie(o,l,a)})}}}function*zie(t){const e=le.getState().singletonSections[re.GLOBAL_PARAM_SWEEP],n=e?Ks(e).selectedVariantIds:{};if(!e||me.size(n)===0){const r=me.cloneDeep(t),i={};for(const s of Object.values(r.sections))s.paramSweepSectionId&&(i[s.paramSweepSectionId]=r.sections[s.paramSweepSectionId].variantId);r.runCodeBlocks=CW(t),yield*kW(r,i)}else for(const r of Object.keys(n)){const i=le.getState().variants[r].runGroup,s=Fie(t,i,Object.keys(t.projectConfig.children),null);for(const o of KRe(s)){const a=me.cloneDeep(t);a.projectConfig.children=me.pick(a.projectConfig.children,o.map(c=>c.sectionId)),a.sections=me.pick(a.sections,o.map(c=>c.sectionId));for(const c of Object.values(a.sectionVariants))c.children=c.children.filter(u=>u in a.sections);for(const c of o)c.versionId&&(a.sections[c.sectionId].variantId=c.versionId);const l={};for(const c of o)if(c.paramSweepId){const{paramSweepSectionId:u}=a.sections[c.sectionId];l[u]=c.paramSweepId}a.runCodeBlocks=CW(t),yield*kW(a,l)}}}function Fie(t,e,n,r){var s;const i=[];for(const o of n){const a=(s=e[o])==null?void 0:s[r];if(!a||!a.selected)continue;let l=!1;const c=t.sections[o].variantId;for(const[u,h]of Object.entries(a.paramSweeps))h&&(i.push({sectionId:o,paramSweepId:u,versionId:c,parentVersionId:r}),l=!0);for(const[u,h]of Object.entries(a.versions))if(h){(u!==c||!l)&&i.push({sectionId:o,paramSweepId:null,versionId:u,parentVersionId:r});const f=t.sectionVariants[u].children;i.push(...Fie(t,e,f,u))}}return i}function*kW(t,e){const n=[];for(const[r,i]of Object.entries(e))for(const s of t.sectionVariants[i].sweep)s.params=s.params.filter(o=>o.paramInfoId),n.push({paramSweepSectionId:r,variantId:i,...s});if(n.length>0)for(const r of YRe(n)){const i=me.cloneDeep(t);for(const s of r){const{paramSweepSectionId:o,selectedItem:a,paramInfoId:l,value:c}=s,u=v2(o,t.sections),{variantId:h}=t.sections[u],f=i.sectionVariants[h];if(f.selectedItem=a,l){const d=f.values[l]??ZO();d.value=c,f.values[l]=d}}yield i}else yield t}function CW(t,e){var r;const n=[];for(const i of Object.values(t.sections))(((r=t.uiTypes[i.uiTypeId])==null?void 0:r.type)??WI[i.uiTypeId].type)===re.CODE&&n.push(i.id);return n.length>0?n:null}async function yN(t=!1){t&&(To("Checking types..."),wv.setState({userRequested:t}));const e=await R2({});w2({content:e,id:Tr(),messageType:"typeCheck"})}const cM=h2(yN,500);async function JRe({sectionId:t,fullText:e,position:n}){return await Wie({sectionId:t,paramInfoId:null,fullText:e,position:n,messageType:"parametersRequest"})}async function eMe({sectionId:t,paramInfoId:e}){const n=await R2({});await w2({id:Tr(),messageType:"textFieldInitializeCode",content:{project:n,sectionId:t,paramInfoId:e}})}async function Vie(t){const e=await R2({});return await iO({id:Tr(),messageType:"codeAreaInitializeCode",content:{project:e,sectionId:t}})}async function tMe({sectionId:t,fullText:e,position:n,codeLanguage:r}){const{id:i,name:s}=le.getState().projectConfig,{name:o}=Ks(t),a=uL({sectionId:t,paramInfoId:null,value:e,regexPatternKey:"codeAreaPattern"}),l=hL(t,e),c={id:Tr(),messageType:"codeAreaAutocomplete",content:{projectConfigId:i,projectConfigName:s,codeLanguage:r,sectionId:t,sectionName:o,fullText:e,position:n,candidateEVRefs:a,candidateTemplateVars:l}},u=await iO(c);return u.data===re.CODE_AREA_GEN_CODE_NOT_INITIALIZED?(await Vie(t)).data?await iO(c):[]:u}async function Wie({sectionId:t,paramInfoId:e,fullText:n,position:r,messageType:i="textFieldCompletion"}){const{id:s,name:o}=le.getState().projectConfig,a=uL({sectionId:t,paramInfoId:e,value:n,regexPatternKey:"pattern"});return await iO({id:Tr(),messageType:i,content:{projectConfigId:s,projectConfigName:o,sectionId:t,paramInfoId:e,fullText:n,position:r,candidateEVRefs:a}})}async function bN({sectionId:t,paramInfoId:e,fullText:n,regexPatternKey:r="pattern",templateVars:i=null,onlyAfterGenCodeTemplateVar:s=!1}){let o=[],a=[];const l=uL({sectionId:t,paramInfoId:e,value:n,regexPatternKey:r});if(l.length>0){let c=0;a=[],await iO({id:Tr(),messageType:"findEVRefs",content:{sectionId:t,paramInfoId:e,candidateEVRefs:l,fullText:n,templateVars:i,onlyAfterGenCodeTemplateVar:s},condition:({data:{positions:u,numMessages:h}})=>(a.push(...u),c+=1,c===h)}),a.sort((u,h)=>u.startPos-h.startPos),o=r6e(a,n)}return o}async function nMe(t,e){let n=[],r=[];const i=hL(t,e);if(i.length>0){let s=0;r=[],await iO({id:Tr(),messageType:"codeAreaFindTemplateVars",content:{sectionId:t,candidateTemplateVars:i,fullText:e},condition:({data:{positions:o,numMessages:a}})=>(o!==null&&r.push(...o),s+=1,s===a)}),r.sort((o,a)=>o.startPos-a.startPos),n=i6e(r,e)}return n}async function rMe(t,e){const n=await nMe(t,e),r=await bN({sectionId:t,paramInfoId:null,fullText:e,regexPatternKey:"codeAreaPattern",templateVars:n,onlyAfterGenCodeTemplateVar:!0});return{templateVars:n,evRefs:r}}function iMe(){return S.jsx(mN,{trigger:"Edit",children:S.jsx(sMe,{})})}function sMe(){const t=vn(e=>({newCardShortcut:Ni(e.shortcuts.newCardShortcut),newGroupShortcut:Ni(e.shortcuts.newGroupShortcut),typeCheckShortcut:Ni(e.shortcuts.typeCheckShortcut),redoShortcut:Ni(e.shortcuts.redoShortcut),undoShortcut:Ni(e.shortcuts.undoShortcut),groupShortcut:Ni(e.shortcuts.groupShortcut),restartLanguageServerShortcut:Ni(e.shortcuts.restartLanguageServerShortcut)}),me.isEqual);return S.jsxs(S.Fragment,{children:[S.jsxs(Hn,{onClick:Tie,shortcut:t.newCardShortcut,children:[S.jsx(qEe,{className:"h-4 w-4"})," Card"]}),S.jsxs(Hn,{onClick:Pie,shortcut:t.newGroupShortcut,children:[S.jsx(bRe,{className:"h-4 w-4"}),"Group"]}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(Hn,{onClick:()=>yN(!0),shortcut:t.typeCheckShortcut,children:"Type Check"}),S.jsx(Hn,{onClick:Sie,shortcut:t.restartLanguageServerShortcut,children:"Restart Language Server"}),S.jsx(Hn,{onClick:LRe,children:"Auto Layout"}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(Hn,{onClick:pL,shortcut:t.redoShortcut,children:"Redo"}),S.jsx(Hn,{onClick:dL,shortcut:t.undoShortcut,children:"Undo"}),S.jsx(Hn,{onClick:Q8e,children:"Reset sections"}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(T2,{to:UI,children:S.jsx(Hn,{children:"Settings"})})]})}async function oMe({projectConfigName:t}){const e=await l6e(t);return e.status===200?await xN(e.data):!1}async function aMe(){const t=await x6e();return t.status===200?await xN(t.data):!1}async function xN({projectConfig:t,codeInfo:e,codeInfoCols:n,sections:r,sectionVariants:i,artifactGroups:s,uiTypes:o,uiTypeCols:a}){if(!t.viewport)ht.setState({fitViewOnInit:!0,fitViewOnInitDone:!1});else{const{x:l,y:c,zoom:u}=t.viewport;ht.setState({fitViewOnInit:!1,fitViewOnInitDone:!0,transform:[l,c,u]})}return le.setState({projectConfig:me.omit(t,["children","viewport"]),x:r,variants:i,uiTypes:{...o,...WI},uiTypeCols:a,codeInfo:e,codeInfoCols:n,artifactGroups:s}),UO.setState(me.mapValues(r,l=>l.columnWidth)),Yr.setState({x:cMe(t)}),await RC(),Wn(!0,!1),!0}function qie(){const t=wN();return async()=>{const e=lMe(),{data:n}=await u6e({previewImgColor:e});t(n)}}function lMe(){const t=Math.floor(Math.random()*kF.length);return kF[t]}function wN(){const t=ay();return e=>{t(O7(e),{state:{pageLoadType:Jv.LOAD_PROJECT_CONFIG}})}}function cMe(t){const e=new Map;for(let n of Object.keys(t.children)){const r=t.children[n];e.set(n,{id:n,position:{x:r.x,y:r.y},zIndex:r.zIndex,tempZIndex:r.zIndex,visibility:!0})}return e}function uMe(){const t=vn(n=>({newProjectConfigShortcut:Ni(n.shortcuts.newProjectConfigShortcut),saveShortcut:Ni(n.shortcuts.saveShortcut),saveAsShortcut:Ni(n.shortcuts.saveAsShortcut),loadShortcut:Ni(n.shortcuts.loadShortcut),undoShortcut:Ni(n.shortcuts.undoShortcut),groupShortcut:Ni(n.shortcuts.groupShortcut)}),me.isEqual),e=qie();return S.jsxs(mN,{trigger:"File",children:[S.jsx(Hn,{onClick:e,shortcut:t.newProjectConfigShortcut,children:"New Config"}),S.jsx(Hn,{onClick:Rte,shortcut:t.loadShortcut,children:"Load"}),S.jsxs(Hn,{onClick:U7,shortcut:t.saveShortcut,children:[S.jsx(gre,{}),"Save"]}),S.jsxs(Hn,{onClick:Mte,shortcut:t.saveAsShortcut,children:[S.jsx(kV,{}),"Save As"]}),S.jsxs(Hn,{onClick:BCe,children:[S.jsx(kV,{}),"Save As (With Refs)"]}),S.jsx(p3,{className:"dark: m-[5px] h-[1px] bg-setta-100 dark:bg-setta-600"}),S.jsx(Hn,{onClick:zCe,children:"Import JSON"}),S.jsx(Hn,{onClick:jCe,children:"Export JSON"})]})}const cO=E.forwardRef((t,e)=>{const{twClasses:n="",grid:r=!1,type:i,onClick:s,children:o,...a}=t,c=`focus-visible:ring-2 ${r?"grid place-items-center":"inline-flex items-center"} nodrag cursor-pointer ${n} `;return S.jsx("button",{className:c,...a,ref:e,type:i,onClick:s,children:o})}),Uie="Popover",[Hie,L3t]=Ga(Uie,[i8]),y8=i8(),[hMe,Gm]=Hie(Uie),fMe=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=y8(e),l=E.useRef(null),[c,u]=E.useState(!1),[h=!1,f]=Uu({prop:r,defaultProp:i,onChange:s});return E.createElement(Dre,a,E.createElement(hMe,{scope:e,contentId:Gd(),triggerRef:l,open:h,onOpenChange:f,onOpenToggle:E.useCallback(()=>f(d=>!d),[f]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>u(!0),[]),onCustomAnchorRemove:E.useCallback(()=>u(!1),[]),modal:o},n))},dMe="PopoverTrigger",pMe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Gm(dMe,n),s=y8(n),o=yr(e,i.triggerRef),a=E.createElement(Zn.button,ze({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Gie(i.open)},r,{ref:o,onClick:zt(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:E.createElement(Ire,ze({asChild:!0},s),a)}),Xie="PopoverPortal",[mMe,gMe]=Hie(Xie,{forceMount:void 0}),vMe=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=Gm(Xie,e);return E.createElement(mMe,{scope:e,forceMount:n},E.createElement(Um,{present:n||s.open},E.createElement(Nre,{asChild:!0,container:i},r)))},sS="PopoverContent",OMe=E.forwardRef((t,e)=>{const n=gMe(sS,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Gm(sS,t.__scopePopover);return E.createElement(Um,{present:r||s.open},s.modal?E.createElement(yMe,ze({},i,{ref:e})):E.createElement(bMe,ze({},i,{ref:e})))}),yMe=E.forwardRef((t,e)=>{const n=Gm(sS,t.__scopePopover),r=E.useRef(null),i=yr(e,r),s=E.useRef(!1);return E.useEffect(()=>{const o=r.current;if(o)return o8(o)},[]),E.createElement(l8,{as:lO,allowPinchZoom:!0},E.createElement(Zie,ze({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zt(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:zt(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:zt(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),bMe=E.forwardRef((t,e)=>{const n=Gm(sS,t.__scopePopover),r=E.useRef(!1);return E.createElement(Zie,ze({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var o;r.current||(o=n.triggerRef.current)===null||o===void 0||o.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var s,o;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0);const a=i.target;((o=n.triggerRef.current)===null||o===void 0?void 0:o.contains(a))&&i.preventDefault()}}))}),Zie=E.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...h}=t,f=Gm(sS,n),d=y8(n);return yre(),E.createElement(bre,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},E.createElement(vre,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},E.createElement(Lre,ze({"data-state":Gie(f.open),role:"dialog",id:f.contentId},d,h,{ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)"}}))))}),xMe="PopoverClose",wMe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Gm(xMe,n);return E.createElement(Zn.button,ze({type:"button"},r,{ref:e,onClick:zt(t.onClick,()=>i.onOpenChange(!1))}))}),SMe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=y8(n);return E.createElement(sPe,ze({},i,r,{ref:e}))});function Gie(t){return t?"open":"closed"}const _Me=fMe,kMe=pMe,CMe=vMe,EMe=OMe,TMe=wMe,PMe=SMe;function pv({trigger:t,contentClasses:e,children:n,open:r,close:i=!1,closeClasses:s,onOpenChange:o,arrowClasses:a}){return S.jsxs(_Me,{open:r,onOpenChange:o,children:[S.jsx(kMe,{asChild:!0,children:t}),S.jsx(CMe,{children:S.jsxs(EMe,{className:e,children:[i&&S.jsx(TMe,{className:s,children:i}),S.jsx(PMe,{className:a||"[fill:rgb(229,_231,_235)] dark:[fill:rgb(51,_65,_85)]"}),n]})})]})}const Ci=hwe(()=>({isFrozen:!1,isEnabled:!1,contentArray:null,idx:0,copied:!1}));let EW=!1;const SN="setta-tooltip-floating-box",AMe=()=>{const[t,e]=E.useState({x:0,y:0}),{isEnabled:n,contentArray:r,isFrozen:i,idx:s,copied:o}=Ci(),a=E.useRef(null);return E.useEffect(()=>{const l=c=>{EW=!0,i||e({x:c.clientX+10,y:c.clientY+10})};return window.addEventListener("mousemove",l),()=>window.removeEventListener("mousemove",l)},[i]),E.useEffect(()=>{if(!a.current||!n)return;const l=a.current,c=l.getBoundingClientRect(),u=window.innerWidth,h=window.innerHeight;let{x:f,y:d}=t;f+c.width>u&&(f=u-c.width-8),d+c.height>h&&(d=h-c.height-8),l.style.transform=`translate(${f}px, ${d}px)`},[n,t]),!n||!r||r.length===0||!EW?null:S.jsxs("div",{id:SN,ref:a,className:`fixed left-0 top-0 z-50 flex max-h-96 w-64 flex-col rounded-2xl border border-setta-200 bg-white p-4 shadow-lg focus:outline focus:outline-2 focus:outline-blue-600 dark:border-setta-700 dark:bg-setta-950 ${r[s].wrapperClassName}`,style:{transform:`translate(${t.x}px, ${t.y}px)`},tabIndex:"0",children:[S.jsx(MMe,{item:r[s],copied:o}),S.jsx(RMe,{item:r[s],isFrozen:i}),S.jsx($Me,{numPages:r.length,idx:s})]})},RMe=Ne.memo(({item:t,isFrozen:e})=>S.jsxs(S.Fragment,{children:[t.title&&S.jsx("h3",{className:`break-words pb-1 text-xs font-black uppercase text-setta-500 dark:text-setta-600 ${t.titleClassName}`,children:t.title}),S.jsx("article",{className:`flex-1 overflow-y-auto whitespace-pre-line break-words text-sm text-setta-700 dark:text-setta-300 ${t.contentClassName}`,children:t.content}),!!t.content&&S.jsx(DMe,{isFrozen:e})]}),me.isEqual),MMe=Ne.memo(({item:t,copied:e})=>{const n=async()=>{try{const i=t.content??t.title;await navigator.clipboard.writeText(i),setTimeout(()=>{Ci.setState({copied:!1})},2e3)}catch(i){console.error("Failed to copy:",i)}};function r(){Ci.setState({copied:!0})}return E.useEffect(()=>{e&&n()},[e]),S.jsx("button",{onClick:r,className:"tooltip-copy absolute right-2 top-2 cursor-pointer rounded-lg p-1.5 text-setta-500 hover:bg-setta-100 dark:text-setta-400 dark:hover:bg-setta-800","aria-label":e?"Copied!":"Copy to clipboard",children:e?S.jsx(mre,{className:"h-4 w-4"}):S.jsx(e8,{className:"h-4 w-4"})})},me.isEqual),$Me=Ne.memo(({numPages:t,idx:e})=>t>1?S.jsx("div",{className:"tooltip-page mt-4 flex items-center justify-center gap-2",children:Array.from({length:t}).map((n,r)=>S.jsx("div",{className:`h-2 w-2 rounded-full ${r===e?"bg-blue-500":"bg-setta-300 dark:bg-setta-600"}`,"aria-label":`Page ${r+1} of ${t}${r===e?" (current)":""}`},r))}):null);function DMe({isFrozen:t}){const e="tooltip-footer mt-4 border-t border-solid border-setta-100 pt-1 text-[10px] text-setta-500 dark:border-setta-700 dark:text-setta-600";return t?S.jsx(IMe,{className:e}):S.jsx(LMe,{className:e})}function IMe({className:t}){const e=vn(n=>({frozenTooltipToPlaintextShortcut:Ni(n.shortcuts.frozenTooltipToPlaintextShortcut),frozenTooltipToMarkdownShortcut:Ni(n.shortcuts.frozenTooltipToMarkdownShortcut)}),me.isEqual);return S.jsxs("p",{className:t,children:["press ",S.jsx("span",{className:"font-black",children:'"Esc"'})," to close, or"," ",S.jsxs("span",{className:"font-black",children:['"',e.frozenTooltipToPlaintextShortcut,'"']})," ","(plaintext) or"," ",S.jsxs("span",{className:"font-black",children:['"',e.frozenTooltipToMarkdownShortcut,'"']})," ","(markdown) to open tooltip as new section"]})}function LMe({className:t}){const e=vn(n=>({tooltipToPlaintextShortcut:Ni(n.shortcuts.tooltipToPlaintextShortcut),tooltipToMarkdownShortcut:Ni(n.shortcuts.tooltipToMarkdownShortcut),freezeTooltipShortcut:Ni(n.shortcuts.freezeTooltipShortcut)}),me.isEqual);return S.jsxs("ul",{className:t,children:[S.jsxs("li",{children:[S.jsxs("strong",{className:"font-black tracking-tighter",children:['"',e.tooltipToPlaintextShortcut,'"']})," ","convert to plaintext section"]}),S.jsxs("li",{children:[S.jsxs("strong",{className:"font-black tracking-tighter",children:['"',e.tooltipToMarkdownShortcut,'"']})," ","convert to markdown section"]}),S.jsxs("li",{children:[S.jsxs("strong",{className:"font-black tracking-tighter",children:['"',e.freezeTooltipShortcut,'"']})," ","freeze tooltip"]})]})}function di(...t){function e(){t&&!Ci.getState().isFrozen&&Ci.setState({contentArray:t})}function n(){Ci.getState().isFrozen||Ci.setState({contentArray:null,idx:0,copied:!1})}return{onMouseEnter:e,onMouseLeave:n}}function NMe(){Ci.setState({isEnabled:!0})}function QMe(){Ci.setState({isEnabled:!1,idx:0})}function a5(t){return async()=>{const e=Ci.getState();if(e.contentArray){const n=e.contentArray[e.idx],r=n.title?`## ${n.title}
|
304
304
|
|
305
305
|
${n.content}`:n.content;le.setState(i=>{A2({type:re.TEXT_BLOCK,sectionProps:{name:e.title,size:{width:300,height:300},renderMarkdown:t},sectionVariantProps:{description:r},state:i})}),Wn(!0)}Yie()}}function BMe(){var t;Ci.setState({isEnabled:!0,isFrozen:!0}),(t=document.getElementById(SN))==null||t.focus({preventScroll:!0})}function Yie(){Ci.setState({isEnabled:!1,isFrozen:!1})}function Kie(){Ci.getState().contentArray&&Ci.setState(t=>({idx:tte(t.idx+1,t.contentArray.length)}))}function Jie(){Ci.getState().contentArray&&Ci.setState(t=>({idx:tte(t.idx-1,t.contentArray.length)}))}async function ese(){Ci.getState().contentArray&&Ci.setState({copied:!0})}function jMe(){_N()&&Kie()}function zMe(){_N()&&Jie()}function FMe(){_N()&&ese()}function _N(){if(Ci.getState().isEnabled&&Ci.getState().isFrozen){const t=document.getElementById(SN);return t==null?void 0:t.contains(document.activeElement)}return!1}async function tse(t,e){const n=await R2({withArtifacts:!0,includeDrawings:!0,includeLatestChatMessages:!0});let r=[];return e?r.push(...zie(n)):(n.runCodeBlocks=t,r.push(n)),r}async function kN(t,e=!1){To("Importing your code...");const n=await tse(t,e),r=await m8e(n);r.status===200&&(zL(r.data.inMemorySubprocessInfo),await y8e(r.data.content),await jL(r.data.content),To("Done importing"))}async function VMe(t,e=!1){const n=await tse(t,e),r=await g8e(n);r.status===200&&(zL(r.data.inMemorySubprocessInfo),await jL(r.data.content))}async function CN(t,e=!1){const n=await R2({});if(e){let r=0;for(const i of zie(n))await _W(i,r),r+=1}else n.runCodeBlocks=t,await _W(n)}async function nse(){const{inMemory:t,asSubprocess:e}=EN();(e.length>0||t.length===0&&e.length===0)&&CN(e,!0),t.length>0&&kN(t,!0)}function WMe(){const{inMemory:t,asSubprocess:e}=EN(!0);t.length>0&&kN(t),e.length>0&&CN(e)}function rse(){const{inMemory:t}=EN();VMe(t,!0)}function EN(t=!1){const e=[],n=[],r=t?Jr.getState().ids:Object.keys(le.getState().x);for(const i of r)Bn(i)===re.CODE&&(Ks(i).runInMemory?e.push(i):n.push(i));return{inMemory:e,asSubprocess:n}}function qMe(){const[t,e]=E.useState(!1),n="transition-colors text-xs font-semibold text-setta-700 dark:text-setta-100 py-1 px-2 rounded-md gap-1 select-none self-center flex items-center hover:bg-setta-100 dark:hover:bg-setta-800 bg-transparent active:!bg-blue-100 active:dark:!bg-blue-950",r="flex items-center gap-1.5 px-3 py-1.5 text-xs text-setta-700 dark:text-setta-100 w-full text-left hover:bg-setta-100 dark:hover:bg-setta-800 active:bg-blue-100 active:dark:bg-blue-950",i=[{label:"Run Interactive Fns",icon:S.jsx(ZR,{}),action:()=>{rse(),e(!1)}}],s=S.jsxs("div",{className:"flex items-center",children:[S.jsxs(cO,{onClick:nse,twClasses:`${n} rounded-r-none`,...di({content:"Run your code."}),children:[S.jsx(ZR,{}),"Run"]}),S.jsx(cO,{twClasses:`${n} pl-1 pr-1 rounded-l-none border-l border-setta-200 dark:border-setta-700`,children:S.jsx(HEe,{})})]});return S.jsx("div",{className:"relative",children:S.jsx(pv,{trigger:s,contentClasses:"bg-white dark:bg-setta-900 py-1 px-0 rounded-md shadow-lg z-50 min-w-36 w-48 border border-setta-200 dark:border-setta-700 overflow-hidden",open:t,onOpenChange:e,arrowClasses:"hidden",children:S.jsx("div",{className:"w-full",children:i.map((o,a)=>S.jsxs("button",{className:r,onClick:o.action,children:[o.icon,S.jsx("span",{className:"ml-0.5",children:o.label})]},a))})})})}function UMe(t){const{twClasses:e,text:n="text-xs font-bold",padding:r="px-1 py-[0.1rem]",rounded:i="rounded-md",children:s}=t,o=`inline-block whitespace-nowrap align-middle ${e} ${n} ${r} ${i}`;return S.jsx("span",{className:o,children:s})}function HMe(){return S.jsx(mN,{trigger:"CLI",children:S.jsx(XMe,{})})}function XMe(){const{connectedTo:t,connections:e}=qO(n=>({connectedTo:n.connectedTo,connections:n.connections.filter(r=>r.isCLI)}),me.isEqual);return e.length>0?e.map(n=>S.jsx(ZMe,{info:n,connectedTo:t},n.websocketId)):S.jsx(Hn,{children:"No CLI connections"})}function ZMe({info:t,connectedTo:e}){const n=e===t.websocketId?"bg-green-100 dark:bg-green-800 text-green-800 dark:text-green-100":"bg-grey-100 dark:bg-grey-800 text-grey-800 dark:text-grey-100";return S.jsxs(Hn,{onClick:()=>WR(t.websocketId),children:[S.jsx(UMe,{twClasses:n,children:"CLI"}),t.websocketId]})}function GMe(){return S.jsx("nav",{className:"flex space-x-2",children:S.jsx(YMe,{})})}function YMe(){const{projectConfigName:t}=m8();return t&&S.jsxs("div",{className:"ml-4 flex gap-1",children:[S.jsxs(aie,{className:"contents",children:[S.jsx(uMe,{}),S.jsx(iMe,{}),S.jsx(HMe,{})]}),S.jsx(qMe,{})]})}const Ym=Ne.forwardRef(({placeholder:t="Search",twClasses:e="",outerClasses:n="",noLeftElement:r=!1,leftElement:i=!1,leftElementStyles:s,rightElement:o=!1,inputStyles:a=!1,onChange:l,onFormSubmit:c,...u},h)=>{const f=` flex-grow outline-0 cursor-auto min-w-0 placeholder-setta-300 dark:placeholder-setta-700 ${e}`;return S.jsxs(KMe,{onFormSubmit:c,outerClasses:n,children:[!r&&S.jsx("div",{className:`absolute left-0 grid select-none place-items-center ${s}`,children:i||S.jsx("i",{className:"gg-sort-az ml-[.4rem] !scale-75 text-setta-300 dark:text-setta-600"})}),S.jsx("input",{className:a||f,placeholder:t,...u,ref:h,tabIndex:"0",onChange:l}),S.jsx("div",{className:`absolute right-0 grid select-none place-items-center ${s}`,children:o})]})});function KMe({onFormSubmit:t,children:e,outerClasses:n}){const r=`flex min-w-0 mx-[2px] items-center relative nodrag dark:text-setta-200 ${n}`;return t?S.jsx("form",{className:r,onSubmit:t,children:e}):S.jsx("search",{className:r,children:e})}function JMe(){const t=kR(e=>e.value);return S.jsx(Ym,{outerClasses:"self-center w-[clamp(10rem,_30vw,_15rem)] ml-4",inputStyles:"flex-grow cursor-auto overflow-hidden bg-setta-100 dark:bg-setta-950 border-setta-500 hover:bg-white outline-offset-2 focus:bg-white rounded-full text-xs text-setta-900 dark:text-setta-200 focus-visible:outline outline-blue-500 pl-7 py-1 placeholder-setta-300 dark:placeholder-setta-700",leftElementStyles:"pl-1",placeholder:"Filter Project Configs",value:t,onChange:e=>kR.setState({value:e.target.value})})}var nx={exports:{}},TW;function e$e(){if(TW)return nx.exports;TW=1;var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},e=Object.keys(t).join("|"),n=new RegExp(e,"g"),r=new RegExp(e,""),i=function(o){return o.replace(n,function(a){return t[a]})},s=function(o){return!!o.match(r)};return nx.exports=i,nx.exports.has=s,nx.exports.remove=i,nx.exports}var t$e=e$e();const n$e=la(t$e);var vo={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};uy.rankings=vo;var r$e=function(e,n){return String(e.rankedValue).localeCompare(String(n.rankedValue))};function uy(t,e,n){n===void 0&&(n={});var r=n,i=r.keys,s=r.threshold,o=s===void 0?vo.MATCHES:s,a=r.baseSort,l=a===void 0?r$e:a,c=r.sorter,u=c===void 0?function(d){return d.sort(function(g,v){return a$e(g,v,l)})}:c,h=t.reduce(f,[]);return u(h).map(function(d){var g=d.item;return g});function f(d,g,v){var m=i$e(g,i,e,n),y=m.rank,x=m.keyThreshold,w=x===void 0?o:x;return y>=w&&d.push(ze({},m,{item:g,index:v})),d}}function i$e(t,e,n,r){if(!e){var i=t;return{rankedValue:i,rank:PW(i,n,r),keyIndex:-1,keyThreshold:r.threshold}}var s=u$e(t,e);return s.reduce(function(o,a,l){var c=o.rank,u=o.rankedValue,h=o.keyIndex,f=o.keyThreshold,d=a.itemValue,g=a.attributes,v=PW(d,n,r),m=u,y=g.minRanking,x=g.maxRanking,w=g.threshold;return v<y&&v>=vo.MATCHES?v=y:v>x&&(v=x),v>c&&(c=v,h=l,f=w,m=d),{rankedValue:m,rank:c,keyIndex:h,keyThreshold:f}},{rankedValue:t,rank:vo.NO_MATCH,keyIndex:-1,keyThreshold:r.threshold})}function PW(t,e,n){return t=AW(t,n),e=AW(e,n),e.length>t.length?vo.NO_MATCH:t===e?vo.CASE_SENSITIVE_EQUAL:(t=t.toLowerCase(),e=e.toLowerCase(),t===e?vo.EQUAL:t.startsWith(e)?vo.STARTS_WITH:t.includes(" "+e)?vo.WORD_STARTS_WITH:t.includes(e)?vo.CONTAINS:e.length===1?vo.NO_MATCH:s$e(t).includes(e)?vo.ACRONYM:o$e(t,e))}function s$e(t){var e="",n=t.split(" ");return n.forEach(function(r){var i=r.split("-");i.forEach(function(s){e+=s.substr(0,1)})}),e}function o$e(t,e){var n=0,r=0;function i(f,d,g){for(var v=g,m=d.length;v<m;v++){var y=d[v];if(y===f)return n+=1,v+1}return-1}function s(f){var d=1/f,g=n/e.length,v=vo.MATCHES+g*d;return v}var o=i(e[0],t,0);if(o<0)return vo.NO_MATCH;r=o;for(var a=1,l=e.length;a<l;a++){var c=e[a];r=i(c,t,r);var u=r>-1;if(!u)return vo.NO_MATCH}var h=r-o;return s(h)}function a$e(t,e,n){var r=-1,i=1,s=t.rank,o=t.keyIndex,a=e.rank,l=e.keyIndex,c=s===a;return c?o===l?n(t,e):o<l?r:i:s>a?r:i}function AW(t,e){var n=e.keepDiacritics;return t=""+t,n||(t=n$e(t)),t}function l$e(t,e){typeof e=="object"&&(e=e.key);var n;if(typeof e=="function")n=e(t);else if(t==null)n=null;else if(Object.hasOwnProperty.call(t,e))n=t[e];else{if(e.includes("."))return c$e(e,t);n=null}return n==null?[]:Array.isArray(n)?n:[String(n)]}function c$e(t,e){for(var n=t.split("."),r=[e],i=0,s=n.length;i<s;i++){for(var o=n[i],a=[],l=0,c=r.length;l<c;l++){var u=r[l];if(u!=null)if(Object.hasOwnProperty.call(u,o)){var h=u[o];h!=null&&a.push(h)}else o==="*"&&(a=a.concat(u))}r=a}if(Array.isArray(r[0])){var f=[];return f.concat.apply(f,r)}return r}function u$e(t,e){for(var n=[],r=0,i=e.length;r<i;r++)for(var s=e[r],o=h$e(s),a=l$e(t,s),l=0,c=a.length;l<c;l++)n.push({itemValue:a[l],attributes:o});return n}var RW={maxRanking:1/0,minRanking:-1/0};function h$e(t){return typeof t=="string"?RW:ze({},RW,t)}function TN(t,e,n){const[r,i]=E.useState(""),s=E.useCallback(me.debounce(a=>i(a),n),[n]),o=r?uy(t,r,{keys:e}):t;return n?[o,s]:[o,i]}function f$e(){const[t,e]=E.useState({winWidth:void 0,winHeight:void 0});return E.useEffect(()=>{function n(){e({winWidth:window.innerWidth,winHeight:window.innerHeight})}return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)},[]),t}function d$e(t){const[e,n]=E.useState(!1),r=E.useCallback(h2(async i=>{const s=await KCe(i);n(s.data)},t),[n]);return{fileExists:e,debouncedCheckIfFileExists:r}}function PN({value:t,onChange:e,onBlur:n,onKeyDown:r,titleProps:i,onMouseEnter:s,onMouseLeave:o,doubleClickToEdit:a=!1,blurTriggeredByEscapeKey:l}){const[c,u]=E.useState(!1),h=E.useRef(null);function f(g){const v=l.current;u(!1),n(g),v&&requestAnimationFrame(()=>{h.current.focus({preventScroll:!0})})}function d(g){(g.code==="Space"||a&&g.detail===2||!a)&&u(!0)}return c?S.jsx(p$e,{value:t,onChange:e,onBlur:f,onKeyDown:r,titleProps:i.editing}):S.jsx(m$e,{value:t,onClick:d,titleProps:i.notEditing,onMouseEnter:s,onMouseLeave:o,paragraphRef:h})}function p$e({value:t,onChange:e,onBlur:n,onKeyDown:r,titleProps:i}){const s=E.useRef(null);return E.useEffect(()=>{s.current.focus({preventScroll:!0});const o=t.length;s.current.setSelectionRange(0,o)},[]),S.jsx("input",{value:t,onChange:e,onBlur:n,onKeyDown:r,className:i,ref:s,size:"1"})}function m$e({value:t,onClick:e,titleProps:n,onMouseEnter:r,onMouseLeave:i,paragraphRef:s}){function o(a){a.code==="Space"&&(a.preventDefault(),e(a))}return S.jsx("p",{onClick:e,className:n,tabIndex:"0",onKeyDown:o,onMouseEnter:r,onMouseLeave:i,ref:s,children:t})}async function g$e(t){return await on({body:{currProjectConfigName:le.getState().projectConfig.name,newProjectConfigName:t},address:re.ROUTE_SET_PROJECT_CONFIG_NAME})}function b8(t,e,n){const[r,i]=E.useState(t),s=E.useRef(!1);function o(c){i(c.target.value)}async function a(c){if(s.current){s.current=!1;return}s.current=!1;const u=c.target.value;u!=""&&u!=t&&await n(u)?e(u):i(t)}function l(c){c.code==="Escape"?(s.current=!0,c.target.blur(),i(t)):c.code==="Enter"&&c.target.blur()}return E.useEffect(()=>{i(t)},[t]),[r,o,a,l,s]}const v$e="flex-1 box-border [border-width:0_0_1px_0] border-solid bg-transparent focus:border-blue-300 focus-visible:ring-0 focus-visible:outline-none w-full ",O$e="flex-1 box-border border-b border-solid border-transparent bg-transparent focus-visible:border-blue-300 focus-visible:ring-0 focus-visible:outline-none w-full truncate";function y$e(){return S.jsx("header",{className:"mb-2 flex w-full flex-col flex-wrap tracking-tight ",...di({content:"Your Project's Name and Config Name, editable all in one spot!"}),children:S.jsx(b$e,{})})}function b$e(){const[t,e,n,r,i]=x$e();return S.jsx(PN,{titleProps:{editing:`${v$e} text-xl text-setta-900 dark:text-setta-50 font-bold `,notEditing:`${O$e} text-xl text-setta-900 dark:text-setta-50 font-bold `},value:t,onChange:e,onBlur:n,onKeyDown:r,blurTriggeredByEscapeKey:i})}function x$e(){const t=le(i=>i.projectConfig.name),e=ay();async function n(i){return(await g$e(i)).status===200}async function r(i){e(O7(i),{state:{pageLoadType:Jv.CHANGE_PROJECT_CONFIG_NAME}})}return b8(t,r,n)}function w$e({listOfSectionIdsAndNames:t=[],checkbox:e=!1}){return t.map((n,r)=>S.jsx(_$e,{sectionId:n.id,sectionHeading:n.name,checkbox:e,depth:n.depth},`SectionItem-${n.id}-${r}`))}function S$e({sectionId:t,sectionHeading:e,checkbox:n,depth:r}){const i=o=>{cy(t),ly(o,t)},s=o=>{o.code==="Space"&&i(o)};return n?S.jsxs("label",{className:"dark:text-rx-300 flex cursor-pointer items-center gap-2 truncate rounded px-1 py-0.5 text-sm text-setta-700 hover:bg-white hover:shadow-md dark:text-setta-200 dark:hover:bg-setta-700",children:[S.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded-md bg-setta-500/10 checked:bg-blue-500 hover:bg-setta-500/30 hover:checked:bg-blue-500"}),e]}):S.jsx("li",{id:`${t}-OverviewListItem`,className:"cursor-pointer truncate rounded px-2 py-0.5 text-xs text-setta-700 hover:bg-white hover:shadow-md focus-visible:border-transparent focus-visible:bg-blue-500 focus-visible:text-white focus-visible:outline-none focus-visible:ring-0 dark:text-setta-200 dark:hover:bg-setta-700 dark:focus-visible:!text-white",onClick:i,onKeyDown:s,style:{marginLeft:`${.75*r}rem`},tabIndex:"0",children:e})}const _$e=Ne.memo(S$e),k$e=Ne.forwardRef(()=>{const t=ise();return S.jsx(C$e,{sectionList:t})});function C$e({sectionList:t}){const[e,n]=TN(t,["name"]);return S.jsxs(S.Fragment,{children:[S.jsx(y$e,{}),S.jsx(Ym,{inputStyles:"flex-grow outline-0 min-w-0 cursor-auto bg-transparent [border-width:0_0_1px_0] border-solid border-setta-200 dark:border-setta-800 focus-visible:!border-blue-300 pl-5 py-1 truncate placeholder-setta-400 dark:placeholder-setta-700 text-sm",outerClasses:"pb-4",leftElementStyles:"pl-1",placeholder:"Filter",leftElement:S.jsx("i",{className:"gg-sort-az !scale-75 text-setta-600 dark:text-setta-400"}),onChange:r=>n(r.target.value),...di({content:"Search through your project's cards."})}),S.jsx("div",{className:"min-h-0 flex-grow overflow-y-scroll",children:S.jsx("ul",{className:"min-h-0 flex-grow",...di({content:"Click on a section name to pan to it."}),children:S.jsx(w$e,{listOfSectionIdsAndNames:e})})})]})}function ise(){return le(t=>{const e=[];for(const n of Object.values(t.x))n.parentId||sse(n.id,0,t,e);return e},me.isEqual)}function sse(t,e,n,r){const i=n.x[t];i.visibility[aO(n.projectConfig.viewingEditingMode)]&&r.push({id:t,name:i.name,depth:e});const s=n.variants[i.variantId].children;if(s)for(const o of s)sse(o,e+1,n,r)}const Tc=Ne.forwardRef(({twClasses:t="",size:e="w-3 h-3",padding:n="py-1 px-1",bg:r="bg-transparent hover:bg-setta-100 dark:hover:bg-setta-600",color:i="text-setta-500",rounded:s="rounded-full",icon:o,children:a,...l},c)=>S.jsxs(cO,{twClasses:`flex justify-center ${r} ${i} ${s} ${n} ${e} ${t}`,...l,ref:c,children:[o,a]})),E$e=Ne.forwardRef(({rounded:t,bg:e,size:n,icon:r,...i},s)=>S.jsx(Tc,{rounded:t||"rounded-full",bg:e||"bg-transparent",size:n||"w-10 h-10",padding:"p-0",grid:!0,twClasses:"absolute right-0 hover:bg-blue-500 dark:hover:bg-blue-700 hover:text-white dark:text-setta-500 dark:hover:text-setta-100",icon:r,...i,ref:s}));function T$e({divId:t,getInputProps:e,getToggleButtonProps:n,isOpen:r,small:i,onKeyDown:s,placeholder:o,bg:a="bg-white dark:bg-setta-900",isDisabled:l,inputRef:c}){return S.jsx(Ym,{inputStyles:`flex-grow truncate outline-0 cursor-auto ${a} rounded-full text-xs font-mono text-setta-600 font-medium pl-3 pr-4 focus-visible:border-white dark:text-setta-300 dark:focus-visible:border-setta-900 focus-visible:ring-2 border border-solid border-setta-100 dark:border-setta-800 placeholder:text-setta-200 dark:placeholder:text-setta-700 min-w-0 ${i?"h-4 my-auto":"h-7"}`,noLeftElement:!0,placeholder:o,...e({id:t,onKeyDown:s,ref:c,disabled:l}),rightElement:S.jsx(E$e,{...n({disabled:l}),icon:r?S.jsx("i",{className:"gg-chevron-up mr-[5px] mt-[4px] !h-3 !w-3"}):S.jsx("i",{className:"gg-chevron-down mb-[4px] mr-[5px] !h-3 !w-3"}),size:i?"w-4 h-4 !mr-[1px]":"w-7 h-7"})})}function ose({isOpen:t,children:e,getMenuProps:n,inputRef:r}){const[i,s]=E.useState({x:0,y:0,width:0}),o=t?"flex":"hidden";return E.useLayoutEffect(()=>{if(t&&r.current){const a=r.current.getBoundingClientRect();s({x:a.left,y:a.bottom+-30,width:a.width})}},[t,r]),xo.createPortal(S.jsx("div",{className:`nowheel nodrag absolute w-fit pb-2 ${o} z-20 mt-8 max-h-96 rounded-md border bg-white shadow-xl dark:border-setta-700/70 dark:bg-setta-800 dark:text-setta-200 dark:shadow-setta-900/50`,...n(),style:{left:`${i.x}px`,top:`${i.y}px`,minWidth:i.width},children:S.jsx("div",{className:"w-full overflow-y-scroll",children:e})}),document.body)}function P$e({getItemProps:t,item:e,index:n,isHighlighted:r,itemStyle:i="",itemString:s}){const o=r?"bg-setta-300/50 dark:bg-setta-900/50":"";return S.jsx("dd",{className:`mx-1 cursor-pointer truncate rounded-lg px-2 py-[.125rem] text-xs ${o} ${i}`,...t({item:e,index:n}),children:s})}const A$e=Ne.memo(P$e);function ase({filteredItems:t,getItemProps:e,highlightedIndex:n,itemToString:r}){return t.reduce((i,s,o)=>(i.groups.push(S.jsxs("dl",{children:[S.jsx("dt",{className:"mx-3 mb-1 truncate border-b border-solid border-setta-300/50 pt-3 text-[0.6rem] font-bold uppercase text-setta-400 first:pt-2",children:s.group}),s.items.map((a,l)=>{const c=i.itemIndex++;return S.jsx(A$e,{getItemProps:e,item:a,index:c,isHighlighted:c===n,itemString:r?r(a):a},l)})]},o)),i),{groups:[],itemIndex:0}).groups}function mv(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var wP={exports:{}},SP,MW;function R$e(){if(MW)return SP;MW=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return SP=t,SP}var _P,$W;function M$e(){if($W)return _P;$W=1;var t=R$e();function e(){}function n(){}return n.resetWarningCache=e,_P=function(){function r(o,a,l,c,u,h){if(h!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},_P}var DW;function $$e(){return DW||(DW=1,wP.exports=M$e()()),wP.exports}var D$e=$$e();const it=la(D$e);var kP={exports:{}},Jn={};/**
|
306
306
|
* @license React
|
setta/static/frontend/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<meta name="description" content="setta" />
|
15
15
|
|
16
16
|
<title>setta.dev</title>
|
17
|
-
<script type="module" crossorigin src="/static/assets/index-
|
17
|
+
<script type="module" crossorigin src="/static/assets/index-B8656WgG.js"></script>
|
18
18
|
<link rel="stylesheet" crossorigin href="/static/assets/index-DQjclEVk.css">
|
19
19
|
</head>
|
20
20
|
<body>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
setta/__init__.py,sha256=
|
1
|
+
setta/__init__.py,sha256=9veran4Ad41E_iJ8FcUXuAdGf6tKlQnmP63HirwZdO8,28
|
2
2
|
setta/server.py,sha256=q4w9WG7SuLxwYtgXUCQyLt7t_HLmQV4y5abqvm7-uEA,4861
|
3
3
|
setta/start.py,sha256=5sMZ7WH3KV9Q0v186PsaYqsWOz7hebyrpXbBOp9wQww,3589
|
4
4
|
setta/cli/__init__.py,sha256=UxZG_VOMuF6lEBT3teUgTS9ulsK3wt3Gu3BbAQiAmt8,47
|
@@ -6,7 +6,7 @@ setta/cli/connect.py,sha256=Pj2Ten7CQcLQGNnyi5Y-vYslQDN3J8csPcWetlvu_J0,1273
|
|
6
6
|
setta/cli/logger.py,sha256=M-gGOcYt8Xj7ldNGBAUfA9yL1nX4UpBuQR1lkg_qiSs,6130
|
7
7
|
setta/code_gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
setta/code_gen/create_runnable_scripts.py,sha256=LXRu8ErO3_e5HCNomnlgfsyxKp2h-Pmm2VFXzBgDDhA,17444
|
9
|
-
setta/code_gen/export_selected.py,sha256=
|
9
|
+
setta/code_gen/export_selected.py,sha256=quF4Fc3KwYDo_ohqHO82f0f2YFB3681mqfdElkeMzoA,28361
|
10
10
|
setta/code_gen/find_placeholders.py,sha256=aTdSSGoh44J2YFZXH9eZJv0D5mvnIMfG2fHSHCn69Ws,575
|
11
11
|
setta/code_gen/utils.py,sha256=ArBPYA__ekeHjZVUDXanlMEnqCX5-Z_R1rMM-1UbEV0,4088
|
12
12
|
setta/code_gen/python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -109,7 +109,7 @@ setta/static/frontend/browserconfig.xml,sha256=w0iw1t89kA7-965LTfyLYrFzewTQnUWE_
|
|
109
109
|
setta/static/frontend/favicon-16x16.png,sha256=q67Crpy8s3wryu7Y3kffPeysN99Lt4XeFygXhPKize8,740
|
110
110
|
setta/static/frontend/favicon-32x32.png,sha256=4NKXYticYdMrRHmVveHjxqnBU1HWgBT5JyJG8lx3BNE,1027
|
111
111
|
setta/static/frontend/favicon.ico,sha256=02qhEBLsvsgBTZX6dcZElMyivlvrR7Yr6wB8ItEZFsc,15086
|
112
|
-
setta/static/frontend/index.html,sha256=
|
112
|
+
setta/static/frontend/index.html,sha256=dTX81lj5goudp8NfyVLjE7r6Bvhg0ZGj-T0nCtn2W3A,1298
|
113
113
|
setta/static/frontend/manifest.json,sha256=ULPYw5A68_eNhxuUVXqxT045yhkurKPSz6hjyGcnmhQ,492
|
114
114
|
setta/static/frontend/mstile-144x144.png,sha256=wQqckmRWre2NCCevevI3rv4j0tcduVMkpYr2tPj73cs,2692
|
115
115
|
setta/static/frontend/mstile-150x150.png,sha256=FUwy6PipTofnhmJB5CdXWYgwy-2inq_sIOdOwdDklcY,2674
|
@@ -184,7 +184,7 @@ setta/static/frontend/assets/cormorant-garamond-cyrillic-ext-700-italic-gsr366qd
|
|
184
184
|
setta/static/frontend/assets/cormorant-garamond-latin-700-italic-BQbwEFjx.woff2,sha256=C8U-EgDBT8MpU4FpUNBJdybVpKvRhg_3WDpUDCw9XZg,20348
|
185
185
|
setta/static/frontend/assets/cormorant-garamond-latin-ext-700-italic-DnnS5iSC.woff2,sha256=Ulc44CPXdUiI5dY86W76HLk7801Fm9_QywCV-8GRtFU,17240
|
186
186
|
setta/static/frontend/assets/cormorant-garamond-vietnamese-700-italic-2_nTgjbG.woff2,sha256=mVYwN54qI0RLXqyrDGPUNpBHWSJDKjgUyBRWa2FJ_ao,5248
|
187
|
-
setta/static/frontend/assets/index-
|
187
|
+
setta/static/frontend/assets/index-B8656WgG.js,sha256=yhMYL76VnFPp4r7w8XZks6CHEdPRx3lpwINId2y-UvY,3082312
|
188
188
|
setta/static/frontend/assets/index-DQjclEVk.css,sha256=uIx7VJi9TIDdzOMllLQNKxOMTytUkdRv9LVJyiB190g,238315
|
189
189
|
setta/static/frontend/assets/inter-all-400-normal-ByZ5TkcW.woff,sha256=BU8S0GmcIMyYte4ESEdQJO-WvL2Rb-38m1n0ujdbYxI,128624
|
190
190
|
setta/static/frontend/assets/inter-all-600-normal-BQl_S1BW.woff,sha256=wDdp5VNyQL_IbxcPThD2qI-ETg_QKj7AmCwMCjqDfLE,139072
|
@@ -252,9 +252,9 @@ setta/utils/generate_new_filename.py,sha256=KBLX6paDmTvXR-027TpqQkfijIXc7mCfhen-
|
|
252
252
|
setta/utils/section_contents.py,sha256=V2HQPik6DfSXw4j7IalbP5AZ3OEGCbtL5ub3xL-Q_Qo,4141
|
253
253
|
setta/utils/utils.py,sha256=KjzcvgM3Ab3IcE8vaWYtgBpwzPLKg0LmblnHLoYZJHM,9164
|
254
254
|
setta/utils/websocket_manager.py,sha256=MBIMI8xxOFQF4lT3on4pupi1ttEWXdWPV4fI2YP_UJU,3925
|
255
|
-
setta-0.0.14.
|
256
|
-
setta-0.0.14.
|
257
|
-
setta-0.0.14.
|
258
|
-
setta-0.0.14.
|
259
|
-
setta-0.0.14.
|
260
|
-
setta-0.0.14.
|
255
|
+
setta-0.0.14.dev4.dist-info/LICENSE,sha256=us9fuCq9wmiZVzayjKxNZ2iJYF6dROe0Qp57ToCO7XU,11361
|
256
|
+
setta-0.0.14.dev4.dist-info/METADATA,sha256=JUVKYWOIw0XU77QDXfJhbcNVN9N5xkrirMToSOucr0Y,7517
|
257
|
+
setta-0.0.14.dev4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
258
|
+
setta-0.0.14.dev4.dist-info/entry_points.txt,sha256=P0qCESy9fWF2q1EQ9JufGldCSnPHplDPn8J6Bgk5hB0,42
|
259
|
+
setta-0.0.14.dev4.dist-info/top_level.txt,sha256=8G4lmRzVOnJ11_DescPVHE6MQZH-o06A0nGsDDV2ngY,6
|
260
|
+
setta-0.0.14.dev4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|