twenty-sdk 2.35.0 → 2.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/billing/index.cjs.map +1 -1
  2. package/dist/billing/index.mjs.map +1 -1
  3. package/dist/{catalog-sync-Cn-gDxAz.js → catalog-sync-Szx_4267.js} +1 -1
  4. package/dist/{catalog-sync-C0Td21sN.mjs → catalog-sync-mAO3vmdp.mjs} +1 -1
  5. package/dist/cli/utilities/api/api-service.d.ts +2 -0
  6. package/dist/cli/utilities/api/file-api.d.ts +41 -0
  7. package/dist/cli/utilities/dev/orchestrator/steps/upload-files-orchestrator-step.d.ts +1 -0
  8. package/dist/cli/utilities/file/file-uploader.d.ts +13 -4
  9. package/dist/cli/utilities/file/put-file-to-upload-url.d.ts +5 -0
  10. package/dist/cli.cjs +15 -15
  11. package/dist/cli.mjs +249 -235
  12. package/dist/define/index.cjs +14 -14
  13. package/dist/define/index.cjs.map +1 -1
  14. package/dist/define/index.d.ts +259 -21
  15. package/dist/define/index.mjs +3142 -3021
  16. package/dist/define/index.mjs.map +1 -1
  17. package/dist/front-component/index.cjs +1 -1
  18. package/dist/front-component/index.cjs.map +1 -1
  19. package/dist/front-component/index.d.ts +1 -0
  20. package/dist/front-component/index.mjs +2 -2
  21. package/dist/front-component/index.mjs.map +1 -1
  22. package/dist/front-component-renderer/build.cjs +1 -1
  23. package/dist/front-component-renderer/build.mjs +1 -1
  24. package/dist/{get-front-component-build-plugins-CcV3Cown.js → get-front-component-build-plugins-DZIleilT.js} +8 -8
  25. package/dist/{get-front-component-build-plugins-BZ1HBS5Y.mjs → get-front-component-build-plugins-WU9ATS3e.mjs} +98 -92
  26. package/dist/{get-function-input-schema-GNk3NRLJ-Byssjp8I.js → get-function-input-schema-GNk3NRLJ-DKoJBhuO.js} +1 -1
  27. package/dist/{get-function-input-schema-GNk3NRLJ-BimwLfRN.mjs → get-function-input-schema-GNk3NRLJ-H7iWzfXn.mjs} +1 -1
  28. package/dist/logic-function/index.cjs +2 -0
  29. package/dist/logic-function/index.cjs.map +1 -1
  30. package/dist/logic-function/index.d.ts +1 -0
  31. package/dist/logic-function/index.mjs +2 -2
  32. package/dist/logic-function/index.mjs.map +1 -1
  33. package/dist/{login-Cl-mw1L0.js → login-4PI5lTOa.js} +61 -31
  34. package/dist/{login-CuJiHYwZ.mjs → login-CNByz3vi.mjs} +5411 -5151
  35. package/dist/operations.cjs +1 -1
  36. package/dist/operations.mjs +1 -1
  37. package/dist/utils/index.cjs.map +1 -1
  38. package/dist/utils/index.mjs.map +1 -1
  39. package/package.json +2 -2
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./get-front-component-build-plugins-CcV3Cown.js"),t=require("./login-Cl-mw1L0.js");let n=require("path");n=e.St(n);let r=require("node:fs/promises"),i=require("@sniptt/guards"),a=require("uuid"),o=require("react");o=e.St(o);let s=require("node:path");s=e.St(s);let c=require("crypto");c=e.St(c);let l=require("node:child_process"),u=require("chalk");u=e.St(u);let d=require("inquirer");d=e.St(d);let f=require("chokidar");f=e.St(f);let p=require("react/jsx-runtime"),m=require("commander"),h=require("util");var g=e=>e&&!e?.startsWith(`/`)?(0,n.join)(t.Dt,e):e,_=async e=>{let i=(0,n.join)(e,`package.json`);if(await t.yt(i))try{let e=await(0,r.readFile)(i,`utf-8`),t=JSON.parse(e);return t.dependencies?.[`twenty-sdk`]??t.devDependencies?.[`twenty-sdk`]??void 0}catch{return}},v=e=>{let t=e.match(/(\d+)\./);if(t)return parseInt(t[1],10);let n=e.match(/^[~^>=<]*(\d+)$/);return n?parseInt(n[1],10):null},y=async e=>{let n=t.I.version,r=await _(e);if(!n||!r)return;let i=v(n),a=v(r);i===null||a===null||i!==a&&(console.warn(u.default.yellow(`⚠ Version mismatch: your app requires twenty-sdk@${a}.x but the CLI running is v${n}. Major version mismatches may cause unexpected behavior.\n Update with: npm install -g twenty-sdk@${a}`)),console.warn(``))},b=class{async execute(e){e.private?await this.executePrivate(e):await this.executeNpm(e)}async executeNpm(e){let n=e.appPath??t.Dt;await y(n),console.log(u.default.blue(`Publishing to npm...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.L({appPath:n,npmTag:e.tag,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1)),console.log(u.default.green(`✓ Published to npm successfully`))}async executePrivate(e){let r=e.appPath??t.Dt;await y(r);let i=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Deploying application on ${i}...`)),console.log(u.default.gray(`App path: ${r}\n`));let a=e=>console.log(u.default.gray(e)),o=await t.G({appPath:r,tarball:!0,onProgress:a});o.success||(console.error(u.default.red(o.error.message)),process.exit(1));let s=await t.R({tarballPath:o.data.tarballPath,remote:e.remote,onProgress:a});s.success||(console.error(u.default.red(s.error.message)),process.exit(1));let c=await t.bt(n.default.join(r,`package.json`)).catch(()=>void 0),l=c?.name??s.data.name,d=c?.version??`unknown`;console.log(u.default.green(`\n✓ Published ${l} v${d} to ${i}\n`)),console.log(" To install deployed application: `yarn twenty app:install`")}},x=class{async execute(e){let n=e.appPath??t.Dt;await y(n),await t.y();let r=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Installing application on ${r}...`)),console.log(u.default.gray(`App path: ${n}\n`));let i=await t.N({appPath:n,remote:e.remote});i.success||(console.error(u.default.red(i.error.message)),process.exit(1)),console.log(u.default.green(`✓ Application installed`))}},S=class{async execute({appPath:e=t.Dt,askForConfirmation:n}){let r=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Uninstall Twenty Application on ${r}`)),console.log(u.default.gray(`📁 App Path: ${e}\n`)),n&&!await this.confirmationPrompt()&&(console.error(u.default.red(`⛔️ Aborting uninstall`)),process.exit(1));let i=await t.v({appPath:e});return i.success?(console.log(u.default.green(`✅ Application uninstalled successfully`)),{success:!0,data:void 0}):(console.error(u.default.red(`❌ Uninstall failed:`),i.error.message),{success:!1,error:i.error.message})}async confirmationPrompt(){let{confirmation:e}=await d.default.prompt([{type:`confirm`,name:`confirmation`,message:`Are you sure you want to uninstall this application?`,default:!1}]);return e}},C=e=>{let t=new b,n=new x,r=new S;e.command(`app:publish [appPath]`).description(`Build and publish to npm (default) or server registry`).option(`--private`,`Push to a Twenty server's registry instead of npm`).option(`-r, --remote <name>`,`Publish to a specific remote (with --private)`).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,n)=>{await t.execute({appPath:g(e),private:n.private,remote:n.remote,tag:n.tag})}),e.command(`app:install [appPath]`).description(`Install a deployed app on the server`).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{await n.execute({appPath:g(e),remote:t.remote})}),e.command(`app:uninstall [appPath]`).description(`Uninstall app from server`).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{try{let n=await r.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}})},w=[`src/application.config.ts`,`src/application-config.ts`,`src/applicationConfig.ts`],T=async e=>{for(let r of w){let i=(0,n.join)(e,r);if(await t.yt(i))return i}return null},E=async e=>{let n=await T(e);if(n===null)throw Error(`Could not find the application config file (expected one of: ${w.join(`, `)}). Create it with defineApplication({ universalIdentifier: ... }) before generating entities.`);let{config:r}=await t.nt({appPath:e,filePath:n});if(!r?.universalIdentifier)throw Error(`defineApplication in ${n} must declare a universalIdentifier before generating entities.`);return r.universalIdentifier},D=e.bt(((e,t)=>{(function(){var n,r=`4.18.1`,i=200,a=`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`,o=`Expected a function`,s="Invalid `variable` option passed into `_.template`",c="Invalid `imports` option passed into `_.template`",l=`__lodash_hash_undefined__`,u=500,d=`__lodash_placeholder__`,f=1,p=2,m=4,h=1,g=2,_=1,v=2,y=4,b=8,x=16,S=32,C=64,w=128,T=256,E=512,D=30,O=`...`,ee=800,k=16,te=1,ne=2,re=3,A=1/0,j=9007199254740991,M=17976931348623157e292,N=NaN,P=4294967295,F=P-1,ie=P>>>1,ae=[[`ary`,w],[`bind`,_],[`bindKey`,v],[`curry`,b],[`curryRight`,x],[`flip`,E],[`partial`,S],[`partialRight`,C],[`rearg`,T]],oe=`[object Arguments]`,se=`[object Array]`,ce=`[object AsyncFunction]`,le=`[object Boolean]`,I=`[object Date]`,ue=`[object DOMException]`,de=`[object Error]`,fe=`[object Function]`,pe=`[object GeneratorFunction]`,me=`[object Map]`,he=`[object Number]`,ge=`[object Null]`,_e=`[object Object]`,ve=`[object Promise]`,ye=`[object Proxy]`,be=`[object RegExp]`,xe=`[object Set]`,Se=`[object String]`,Ce=`[object Symbol]`,we=`[object Undefined]`,Te=`[object WeakMap]`,Ee=`[object WeakSet]`,L=`[object ArrayBuffer]`,De=`[object DataView]`,Oe=`[object Float32Array]`,ke=`[object Float64Array]`,Ae=`[object Int8Array]`,je=`[object Int16Array]`,Me=`[object Int32Array]`,Ne=`[object Uint8Array]`,Pe=`[object Uint8ClampedArray]`,Fe=`[object Uint16Array]`,Ie=`[object Uint32Array]`,Le=/\b__p \+= '';/g,Re=/\b(__p \+=) '' \+/g,ze=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,Ve=/[&<>"']/g,He=RegExp(Be.source),Ue=RegExp(Ve.source),We=/<%-([\s\S]+?)%>/g,Ge=/<%([\s\S]+?)%>/g,Ke=/<%=([\s\S]+?)%>/g,qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Je=/^\w*$/,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/[\\^$.*+?()[\]{}|]/g,Ze=RegExp(Xe.source),Qe=/^\s+/,$e=/\s/,et=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tt=/\{\n\/\* \[wrapped with (.+)\] \*/,nt=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,it=/[()=,{}\[\]\/\s]/,at=/\\(\\)?/g,ot=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ct=/^[-+]0x[0-9a-f]+$/i,lt=/^0b[01]+$/i,ut=/^\[object .+?Constructor\]$/,R=/^0o[0-7]+$/i,dt=/^(?:0|[1-9]\d*)$/,z=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ft=/($^)/,pt=/['\n\r\u2028\u2029\\]/g,mt=`\\ud800-\\udfff`,ht=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,gt=`\\u2700-\\u27bf`,_t=`a-z\\xdf-\\xf6\\xf8-\\xff`,vt=`\\xac\\xb1\\xd7\\xf7`,yt=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,bt=`\\u2000-\\u206f`,xt=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,St=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Ct=`\\ufe0e\\ufe0f`,wt=vt+yt+bt+xt,Tt=`['’]`,Et=`[`+mt+`]`,Dt=`[`+wt+`]`,Ot=`[`+ht+`]`,kt=`\\d+`,At=`[`+gt+`]`,jt=`[`+_t+`]`,Mt=`[^`+mt+wt+kt+gt+_t+St+`]`,Nt=`\\ud83c[\\udffb-\\udfff]`,Pt=`(?:`+Ot+`|`+Nt+`)`,Ft=`[^`+mt+`]`,It=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Lt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Rt=`[`+St+`]`,zt=`\\u200d`,Bt=`(?:`+jt+`|`+Mt+`)`,Vt=`(?:`+Rt+`|`+Mt+`)`,Ht=`(?:`+Tt+`(?:d|ll|m|re|s|t|ve))?`,Ut=`(?:`+Tt+`(?:D|LL|M|RE|S|T|VE))?`,Wt=Pt+`?`,Gt=`[`+Ct+`]?`,Kt=`(?:`+zt+`(?:`+[Ft,It,Lt].join(`|`)+`)`+Gt+Wt+`)*`,qt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,Jt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Yt=Gt+Wt+Kt,Xt=`(?:`+[At,It,Lt].join(`|`)+`)`+Yt,Zt=`(?:`+[Ft+Ot+`?`,Ot,It,Lt,Et].join(`|`)+`)`,B=RegExp(Tt,`g`),Qt=RegExp(Ot,`g`),$t=RegExp(Nt+`(?=`+Nt+`)|`+Zt+Yt,`g`),en=RegExp([Rt+`?`+jt+`+`+Ht+`(?=`+[Dt,Rt,`$`].join(`|`)+`)`,Vt+`+`+Ut+`(?=`+[Dt,Rt+Bt,`$`].join(`|`)+`)`,Rt+`?`+Bt+`+`+Ht,Rt+`+`+Ut,Jt,qt,kt,Xt].join(`|`),`g`),tn=RegExp(`[`+zt+mt+ht+Ct+`]`),nn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rn=`Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout`.split(`.`),an=-1,on={};on[Oe]=on[ke]=on[Ae]=on[je]=on[Me]=on[Ne]=on[Pe]=on[Fe]=on[Ie]=!0,on[oe]=on[se]=on[L]=on[le]=on[De]=on[I]=on[de]=on[fe]=on[me]=on[he]=on[_e]=on[be]=on[xe]=on[Se]=on[Te]=!1;var sn={};sn[oe]=sn[se]=sn[L]=sn[De]=sn[le]=sn[I]=sn[Oe]=sn[ke]=sn[Ae]=sn[je]=sn[Me]=sn[me]=sn[he]=sn[_e]=sn[be]=sn[xe]=sn[Se]=sn[Ce]=sn[Ne]=sn[Pe]=sn[Fe]=sn[Ie]=!0,sn[de]=sn[fe]=sn[Te]=!1;var cn={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`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`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`},ln={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},un={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`},dn={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},fn=parseFloat,pn=parseInt,V=typeof global==`object`&&global&&global.Object===Object&&global,mn=typeof self==`object`&&self&&self.Object===Object&&self,hn=V||mn||Function(`return this`)(),gn=typeof e==`object`&&e&&!e.nodeType&&e,_n=gn&&typeof t==`object`&&t&&!t.nodeType&&t,vn=_n&&_n.exports===gn,yn=vn&&V.process,bn=function(){try{return _n&&_n.require&&_n.require(`util`).types||yn&&yn.binding&&yn.binding(`util`)}catch{}}(),xn=bn&&bn.isArrayBuffer,Sn=bn&&bn.isDate,Cn=bn&&bn.isMap,wn=bn&&bn.isRegExp,Tn=bn&&bn.isSet,En=bn&&bn.isTypedArray;function Dn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function On(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function H(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function kn(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function An(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function jn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Mn(e,t){return!!(e!=null&&e.length)&&Wn(e,t,0)>-1}function Nn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Fn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function In(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ln(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var zn=Jn(`length`);function Bn(e){return e.split(``)}function Vn(e){return e.match(rt)||[]}function Hn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Un(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Wn(e,t,n){return t===t?br(e,t,n):Un(e,Kn,n)}function Gn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function Kn(e){return e!==e}function qn(e,t){var n=e==null?0:e.length;return n?Qn(e,t)/n:N}function Jn(e){return function(t){return t==null?n:t[e]}}function Yn(e){return function(t){return e==null?n:e[t]}}function Xn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Zn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Qn(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function $n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function er(e,t){return Pn(t,function(t){return[t,e[t]]})}function tr(e){return e&&e.slice(0,wr(e)+1).replace(Qe,``)}function nr(e){return function(t){return e(t)}}function rr(e,t){return Pn(t,function(t){return e[t]})}function ir(e,t){return e.has(t)}function ar(e,t){for(var n=-1,r=e.length;++n<r&&Wn(t,e[n],0)>-1;);return n}function or(e,t){for(var n=e.length;n--&&Wn(t,e[n],0)>-1;);return n}function sr(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var cr=Yn(cn),lr=Yn(ln);function ur(e){return`\\`+dn[e]}function dr(e,t){return e==null?n:e[t]}function fr(e){return tn.test(e)}function pr(e){return nn.test(e)}function mr(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function hr(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function gr(e,t){return function(n){return e(t(n))}}function _r(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];(o===t||o===d)&&(e[n]=d,a[i++]=n)}return a}function vr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function yr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function br(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function xr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function Sr(e){return fr(e)?Er(e):zn(e)}function Cr(e){return fr(e)?Dr(e):Bn(e)}function wr(e){for(var t=e.length;t--&&$e.test(e.charAt(t)););return t}var Tr=Yn(un);function Er(e){for(var t=$t.lastIndex=0;$t.test(e);)++t;return t}function Dr(e){return e.match($t)||[]}function Or(e){return e.match(en)||[]}var kr=(function e(t){t=t==null?hn:kr.defaults(hn.Object(),t,kr.pick(hn,rn));var $e=t.Array,rt=t.Date,mt=t.Error,ht=t.Function,gt=t.Math,_t=t.Object,vt=t.RegExp,yt=t.String,bt=t.TypeError,xt=$e.prototype,St=ht.prototype,Ct=_t.prototype,wt=t[`__core-js_shared__`],Tt=St.toString,Et=Ct.hasOwnProperty,Dt=0,Ot=function(){var e=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),kt=Ct.toString,At=Tt.call(_t),jt=hn._,Mt=vt(`^`+Tt.call(Et).replace(Xe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Nt=vn?t.Buffer:n,Pt=t.Symbol,Ft=t.Uint8Array,It=Nt?Nt.allocUnsafe:n,Lt=gr(_t.getPrototypeOf,_t),Rt=_t.create,zt=Ct.propertyIsEnumerable,Bt=xt.splice,Vt=Pt?Pt.isConcatSpreadable:n,Ht=Pt?Pt.iterator:n,Ut=Pt?Pt.toStringTag:n,Wt=function(){try{var e=ts(_t,`defineProperty`);return e({},``,{}),e}catch{}}(),Gt=t.clearTimeout!==hn.clearTimeout&&t.clearTimeout,Kt=rt&&rt.now!==hn.Date.now&&rt.now,qt=t.setTimeout!==hn.setTimeout&&t.setTimeout,Jt=gt.ceil,Yt=gt.floor,Xt=_t.getOwnPropertySymbols,Zt=Nt?Nt.isBuffer:n,$t=t.isFinite,en=xt.join,tn=gr(_t.keys,_t),nn=gt.max,cn=gt.min,ln=rt.now,un=t.parseInt,dn=gt.random,V=xt.reverse,mn=ts(t,`DataView`),gn=ts(t,`Map`),_n=ts(t,`Promise`),yn=ts(t,`Set`),bn=ts(t,`WeakMap`),zn=ts(_t,`create`),Bn=bn&&new bn,Yn={},br=Bs(mn),Er=Bs(gn),Dr=Bs(_n),Ar=Bs(yn),jr=Bs(bn),Mr=Pt?Pt.prototype:n,Nr=Mr?Mr.valueOf:n,Pr=Mr?Mr.toString:n;function U(e){if(Mu(e)&&!hu(e)&&!(e instanceof Rr)){if(e instanceof Lr)return e;if(Et.call(e,`__wrapped__`))return Hs(e)}return new Lr(e)}var Fr=function(){function e(){}return function(t){if(!ju(t))return{};if(Rt)return Rt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Ir(){}function Lr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}U.templateSettings={escape:We,evaluate:Ge,interpolate:Ke,variable:``,imports:{_:U}},U.prototype=Ir.prototype,U.prototype.constructor=U,Lr.prototype=Fr(Ir.prototype),Lr.prototype.constructor=Lr;function Rr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=P,this.__views__=[]}function zr(){var e=new Rr(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e}function Br(){if(this.__filtered__){var e=new Rr(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Vr(){var e=this.__wrapped__.value(),t=this.__dir__,n=hu(e),r=t<0,i=n?e.length:0,a=os(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=cn(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Ja(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==ne)g=b;else if(!b){if(y==te)continue outer;break outer}}m[f++]=g}return m}Rr.prototype=Fr(Ir.prototype),Rr.prototype.constructor=Rr;function Hr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ur(){this.__data__=zn?zn(null):{},this.size=0}function Wr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Gr(e){var t=this.__data__;if(zn){var r=t[e];return r===l?n:r}return Et.call(t,e)?t[e]:n}function Kr(e){var t=this.__data__;return zn?t[e]!==n:Et.call(t,e)}function qr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=zn&&t===n?l:t,this}Hr.prototype.clear=Ur,Hr.prototype.delete=Wr,Hr.prototype.get=Gr,Hr.prototype.has=Kr,Hr.prototype.set=qr;function Jr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yr(){this.__data__=[],this.size=0}function Xr(e){var t=this.__data__,n=xi(t,e);return n<0?!1:(n==t.length-1?t.pop():Bt.call(t,n,1),--this.size,!0)}function Zr(e){var t=this.__data__,r=xi(t,e);return r<0?n:t[r][1]}function Qr(e){return xi(this.__data__,e)>-1}function $r(e,t){var n=this.__data__,r=xi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Jr.prototype.clear=Yr,Jr.prototype.delete=Xr,Jr.prototype.get=Zr,Jr.prototype.has=Qr,Jr.prototype.set=$r;function ei(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ti(){this.size=0,this.__data__={hash:new Hr,map:new(gn||Jr),string:new Hr}}function ni(e){var t=$o(this,e).delete(e);return this.size-=+!!t,t}function ri(e){return $o(this,e).get(e)}function ii(e){return $o(this,e).has(e)}function ai(e,t){var n=$o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}ei.prototype.clear=ti,ei.prototype.delete=ni,ei.prototype.get=ri,ei.prototype.has=ii,ei.prototype.set=ai;function oi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ei;++t<n;)this.add(e[t])}function si(e){return this.__data__.set(e,l),this}function ci(e){return this.__data__.has(e)}oi.prototype.add=oi.prototype.push=si,oi.prototype.has=ci;function li(e){var t=this.__data__=new Jr(e);this.size=t.size}function ui(){this.__data__=new Jr,this.size=0}function di(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fi(e){return this.__data__.get(e)}function pi(e){return this.__data__.has(e)}function mi(e,t){var n=this.__data__;if(n instanceof Jr){var r=n.__data__;if(!gn||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ei(r)}return n.set(e,t),this.size=n.size,this}li.prototype.clear=ui,li.prototype.delete=di,li.prototype.get=fi,li.prototype.has=pi,li.prototype.set=mi;function hi(e,t){var n=hu(e),r=!n&&mu(e),i=!n&&!r&&bu(e),a=!n&&!r&&!i&&qu(e),o=n||r||i||a,s=o?$n(e.length,yt):[],c=s.length;for(var l in e)(t||Et.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||ms(l,c)))&&s.push(l);return s}function gi(e){var t=e.length;return t?e[Oa(0,t-1)]:n}function _i(e,t){return Ls(mo(e),Di(t,0,e.length))}function vi(e){return Ls(mo(e))}function yi(e,t,r){(r!==n&&!du(e[t],r)||r===n&&!(t in e))&&Ti(e,t,r)}function bi(e,t,r){var i=e[t];(!(Et.call(e,t)&&du(i,r))||r===n&&!(t in e))&&Ti(e,t,r)}function xi(e,t){for(var n=e.length;n--;)if(du(e[n][0],t))return n;return-1}function Si(e,t,n,r){return Ni(e,function(e,i,a){t(r,e,n(e),a)}),r}function Ci(e,t){return e&&ho(t,Od(t),e)}function wi(e,t){return e&&ho(t,kd(t),e)}function Ti(e,t,n){t==`__proto__`&&Wt?Wt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ei(e,t){for(var r=-1,i=t.length,a=$e(i),o=e==null;++r<i;)a[r]=o?n:Sd(e,t[r]);return a}function Di(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Oi(e,t,r,i,a,o){var s,c=t&f,l=t&p,u=t&m;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!ju(e))return e;var d=hu(e);if(d){if(s=ls(e),!c)return mo(e,s)}else{var h=as(e),g=h==fe||h==pe;if(bu(e))return ro(e,c);if(h==_e||h==oe||g&&!a){if(s=l||g?{}:us(e),!c)return l?_o(e,wi(s,e)):go(e,Ci(s,e))}else{if(!sn[h])return a?e:{};s=ds(e,h,c)}}o||=new li;var _=o.get(e);if(_)return _;o.set(e,s),Wu(e)?e.forEach(function(n){s.add(Oi(n,t,r,n,e,o))}):Nu(e)&&e.forEach(function(n,i){s.set(i,Oi(n,t,r,i,e,o))});var v=d?n:(u?l?Jo:qo:l?kd:Od)(e);return H(v||e,function(n,i){v&&(i=n,n=e[i]),bi(s,i,Oi(n,t,r,i,e,o))}),s}function ki(e){var t=Od(e);return function(n){return Ai(n,e,t)}}function Ai(e,t,r){var i=r.length;if(e==null)return!i;for(e=_t(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function ji(e,t,r){if(typeof e!=`function`)throw new bt(o);return Ns(function(){e.apply(n,r)},t)}function Mi(e,t,n,r){var a=-1,o=Mn,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=Pn(t,nr(n))),r?(o=Nn,s=!1):t.length>=i&&(o=ir,s=!1,t=new oi(t));outer:for(;++a<c;){var d=e[a],f=n==null?d:n(d);if(d=r||d!==0?d:0,s&&f===f){for(var p=u;p--;)if(t[p]===f)continue outer;l.push(d)}else o(t,f,r)||l.push(d)}return l}var Ni=bo(Hi),Pi=bo(Ui,!0);function Fi(e,t){var n=!0;return Ni(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function Ii(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!Ku(s):r(s,c)))var c=s,l=o}return l}function Li(e,t,r,i){var a=e.length;for(r=td(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:td(i),i<0&&(i+=a),i=r>i?0:nd(i);r<i;)e[r++]=t;return e}function Ri(e,t){var n=[];return Ni(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function zi(e,t,n,r,i){var a=-1,o=e.length;for(n||=ps,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?zi(s,t-1,n,r,i):Fn(i,s):r||(i[i.length]=s)}return i}var Bi=xo(),Vi=xo(!0);function Hi(e,t){return e&&Bi(e,t,Od)}function Ui(e,t){return e&&Vi(e,t,Od)}function Wi(e,t){return jn(t,function(t){return Ou(e[t])})}function Gi(e,t){t=$a(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[zs(t[r++])];return r&&r==i?e:n}function Ki(e,t,n){var r=t(e);return hu(e)?r:Fn(r,n(e))}function qi(e){return e==null?e===n?we:ge:Ut&&Ut in _t(e)?ns(e):Ds(e)}function Ji(e,t){return e>t}function Yi(e,t){return e!=null&&Et.call(e,t)}function Xi(e,t){return e!=null&&t in _t(e)}function Zi(e,t,n){return e>=cn(t,n)&&e<nn(t,n)}function Qi(e,t,r){for(var i=r?Nn:Mn,a=e[0].length,o=e.length,s=o,c=$e(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Pn(d,nr(t))),l=cn(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new oi(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?ir(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?ir(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function $i(e,t,n,r){return Hi(e,function(e,i,a){t(r,n(e),i,a)}),r}function ea(e,t,r){t=$a(t,e),e=ks(e,t);var i=e==null?e:e[zs(pc(t))];return i==null?n:Dn(i,e,r)}function ta(e){return Mu(e)&&qi(e)==oe}function na(e){return Mu(e)&&qi(e)==L}function ra(e){return Mu(e)&&qi(e)==I}function ia(e,t,n,r,i){return e===t?!0:e==null||t==null||!Mu(e)&&!Mu(t)?e!==e&&t!==t:aa(e,t,n,r,ia,i)}function aa(e,t,n,r,i,a){var o=hu(e),s=hu(t),c=o?se:as(e),l=s?se:as(t);c=c==oe?_e:c,l=l==oe?_e:l;var u=c==_e,d=l==_e,f=c==l;if(f&&bu(e)){if(!bu(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new li,o||qu(e)?Uo(e,t,n,r,i,a):Wo(e,t,c,n,r,i,a);if(!(n&h)){var p=u&&Et.call(e,`__wrapped__`),m=d&&Et.call(t,`__wrapped__`);if(p||m){var g=p?e.value():e,_=m?t.value():t;return a||=new li,i(g,_,n,r,a)}}return f?(a||=new li,Go(e,t,n,r,i,a)):!1}function oa(e){return Mu(e)&&as(e)==me}function sa(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=_t(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new li;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?ia(d,u,h|g,i,f):p))return!1}}return!0}function ca(e){return!ju(e)||ys(e)?!1:(Ou(e)?Mt:ut).test(Bs(e))}function la(e){return Mu(e)&&qi(e)==be}function ua(e){return Mu(e)&&as(e)==xe}function da(e){return Mu(e)&&Au(e.length)&&!!on[qi(e)]}function fa(e){return typeof e==`function`?e:e==null?Lf:typeof e==`object`?hu(e)?va(e[0],e[1]):_a(e):Xf(e)}function pa(e){if(!xs(e))return tn(e);var t=[];for(var n in _t(e))Et.call(e,n)&&n!=`constructor`&&t.push(n);return t}function ma(e){if(!ju(e))return Es(e);var t=xs(e),n=[];for(var r in e)r==`constructor`&&(t||!Et.call(e,r))||n.push(r);return n}function ha(e,t){return e<t}function ga(e,t){var n=-1,r=_u(e)?$e(e.length):[];return Ni(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function _a(e){var t=es(e);return t.length==1&&t[0][2]?Cs(t[0][0],t[0][1]):function(n){return n===e||sa(n,e,t)}}function va(e,t){return gs(e)&&Ss(t)?Cs(zs(e),t):function(r){var i=Sd(r,e);return i===n&&i===t?wd(r,e):ia(t,i,h|g)}}function ya(e,t,r,i,a){e!==t&&Bi(t,function(o,s){if(a||=new li,ju(o))ba(e,t,s,r,ya,i,a);else{var c=i?i(js(e,s),o,s+``,e,t,a):n;c===n&&(c=o),yi(e,s,c)}},kd)}function ba(e,t,r,i,a,o,s){var c=js(e,r),l=js(t,r),u=s.get(l);if(u){yi(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=hu(l),m=!p&&bu(l),h=!p&&!m&&qu(l);d=l,p||m||h?hu(c)?d=c:vu(c)?d=mo(c):m?(f=!1,d=ro(l,!0)):h?(f=!1,d=co(l,!0)):d=[]:Vu(l)||mu(l)?(d=c,mu(c)?d=id(c):(!ju(c)||Ou(c))&&(d=us(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),yi(e,r,d)}function xa(e,t){var r=e.length;if(r)return t+=t<0?r:0,ms(t,r)?e[t]:n}function Sa(e,t,n){t=t.length?Pn(t,function(e){return hu(e)?function(t){return Gi(t,e.length===1?e[0]:e)}:e}):[Lf];var r=-1;return t=Pn(t,nr(Qo())),Zn(ga(e,function(e,n,i){return{criteria:Pn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return uo(e,t,n)})}function Ca(e,t){return wa(e,t,function(t,n){return wd(e,n)})}function wa(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Gi(e,o);n(s,o)&&Pa(a,$a(o,e),s)}return a}function Ta(e){return function(t){return Gi(t,e)}}function Ea(e,t,n,r){var i=r?Gn:Wn,a=-1,o=t.length,s=e;for(e===t&&(t=mo(t)),n&&(s=Pn(e,nr(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&Bt.call(s,c,1),Bt.call(e,c,1);return e}function Da(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ms(i)?Bt.call(e,i,1):Ga(e,i)}}return e}function Oa(e,t){return e+Yt(dn()*(t-e+1))}function ka(e,t,n,r){for(var i=-1,a=nn(Jt((t-e)/(n||1)),0),o=$e(a);a--;)o[r?a:++i]=e,e+=n;return o}function Aa(e,t){var n=``;if(!e||t<1||t>j)return n;do t%2&&(n+=e),t=Yt(t/2),t&&(e+=e);while(t);return n}function ja(e,t){return Ps(Os(e,t,Lf),e+``)}function Ma(e){return gi(qd(e))}function Na(e,t){var n=qd(e);return Ls(n,Di(t,0,n.length))}function Pa(e,t,r,i){if(!ju(e))return e;t=$a(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=zs(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=ju(d)?d:ms(t[a+1])?[]:{})}bi(c,l,u),c=c[l]}return e}var Fa=Bn?function(e,t){return Bn.set(e,t),e}:Lf,Ia=Wt?function(e,t){return Wt(e,`toString`,{configurable:!0,enumerable:!1,value:Nf(t),writable:!0})}:Lf;function La(e){return Ls(qd(e))}function Ra(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=$e(i);++r<i;)a[r]=e[r+t];return a}function za(e,t){var n;return Ni(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function Ba(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=ie){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!Ku(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return Va(e,t,Lf,n)}function Va(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=Ku(t),u=t===n;a<o;){var d=Yt((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=Ku(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return cn(o,F)}function W(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!du(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function Ha(e){return typeof e==`number`?e:Ku(e)?N:+e}function Ua(e){if(typeof e==`string`)return e;if(hu(e))return Pn(e,Ua)+``;if(Ku(e))return Pr?Pr.call(e):``;var t=e+``;return t==`0`&&1/e==-A?`-0`:t}function Wa(e,t,n){var r=-1,a=Mn,o=e.length,s=!0,c=[],l=c;if(n)s=!1,a=Nn;else if(o>=i){var u=t?null:Lo(e);if(u)return vr(u);s=!1,a=ir,l=new oi}else l=t?[]:c;outer:for(;++r<o;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,s&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),c.push(d)}else a(l,f,n)||(l!==c&&l.push(f),c.push(d))}return c}function Ga(e,t){t=$a(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=zs(t[n]);if(i===`__proto__`&&!Et.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ks(e,t);return a==null||delete a[zs(pc(t))]}function Ka(e,t,n,r){return Pa(e,t,n(Gi(e,t)),r)}function qa(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?Ra(e,r?0:a,r?a+1:i):Ra(e,r?a+1:0,r?i:a)}function Ja(e,t){var n=e;return n instanceof Rr&&(n=n.value()),In(t,function(e,t){return t.func.apply(t.thisArg,Fn([e],t.args))},n)}function Ya(e,t,n){var r=e.length;if(r<2)return r?Wa(e[0]):[];for(var i=-1,a=$e(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Mi(a[i]||o,e[s],t,n));return Wa(zi(a,1),t,n)}function Xa(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function Za(e){return vu(e)?e:[]}function Qa(e){return typeof e==`function`?e:Lf}function $a(e,t){return hu(e)?e:gs(e,t)?[e]:Rs(od(e))}var eo=ja;function to(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Ra(e,t,r)}var no=Gt||function(e){return hn.clearTimeout(e)};function ro(e,t){if(t)return e.slice();var n=e.length,r=It?It(n):new e.constructor(n);return e.copy(r),r}function io(e){var t=new e.constructor(e.byteLength);return new Ft(t).set(new Ft(e)),t}function ao(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function oo(e){var t=new e.constructor(e.source,st.exec(e));return t.lastIndex=e.lastIndex,t}function so(e){return Nr?_t(Nr.call(e)):{}}function co(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function lo(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=Ku(e),s=t!==n,c=t===null,l=t===t,u=Ku(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function uo(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=lo(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function fo(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=nn(a-o,0),u=$e(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function po(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=nn(a-s,0),d=$e(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function mo(e,t){var n=-1,r=e.length;for(t||=$e(r);++n<r;)t[n]=e[n];return t}function ho(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?Ti(r,c,l):bi(r,c,l)}return r}function go(e,t){return ho(e,rs(e),t)}function _o(e,t){return ho(e,is(e),t)}function vo(e,t){return function(n,r){var i=hu(n)?On:Si,a=t?t():{};return i(n,e,Qo(r,2),a)}}function yo(e){return ja(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&hs(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=_t(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function bo(e,t){return function(n,r){if(n==null)return n;if(!_u(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=_t(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function xo(e){return function(t,n,r){for(var i=-1,a=_t(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function So(e,t,n){var r=t&_,i=To(e);function a(){return(this&&this!==hn&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function Co(e){return function(t){t=od(t);var r=fr(t)?Cr(t):n,i=r?r[0]:t.charAt(0),a=r?to(r,1).join(``):t.slice(1);return i[e]()+a}}function wo(e){return function(t){return In(Of(ef(t).replace(B,``)),e,``)}}function To(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Fr(e.prototype),r=e.apply(n,t);return ju(r)?r:n}}function Eo(e,t,r){var i=To(e);function a(){for(var o=arguments.length,s=$e(o),c=o,l=Zo(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:_r(s,l);return o-=u.length,o<r?G(e,t,ko,a.placeholder,n,s,u,n,n,r-o):Dn(this&&this!==hn&&this instanceof a?i:e,this,s)}return a}function Do(e){return function(t,r,i){var a=_t(t);if(!_u(t)){var o=Qo(r,3);t=Od(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function Oo(e){return Ko(function(t){var r=t.length,i=r,a=Lr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if(typeof s!=`function`)throw new bt(o);if(a&&!c&&Xo(s)==`wrapper`)var c=new Lr([],!0)}for(i=c?i:r;++i<r;){s=t[i];var l=Xo(s),u=l==`wrapper`?Yo(s):n;c=u&&vs(u[0])&&u[1]==(w|b|S|T)&&!u[4].length&&u[9]==1?c[Xo(u[0])].apply(c,u[3]):s.length==1&&vs(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&e.length==1&&hu(n))return c.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}})}function ko(e,t,r,i,a,o,s,c,l,u){var d=t&w,f=t&_,p=t&v,m=t&(b|x),h=t&E,g=p?n:To(e);function y(){for(var n=arguments.length,_=$e(n),v=n;v--;)_[v]=arguments[v];if(m)var b=Zo(y),x=sr(_,b);if(i&&(_=fo(_,i,a,m)),o&&(_=po(_,o,s,m)),n-=x,m&&n<u){var S=_r(_,b);return G(e,t,ko,y.placeholder,r,_,S,c,l,u-n)}var C=f?r:this,w=p?C[e]:e;return n=_.length,c?_=As(_,c):h&&n>1&&_.reverse(),d&&l<n&&(_.length=l),this&&this!==hn&&this instanceof y&&(w=g||To(w)),w.apply(C,_)}return y}function Ao(e,t){return function(n,r){return $i(n,e,t(r),{})}}function jo(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=Ua(r),i=Ua(i)):(r=Ha(r),i=Ha(i)),a=e(r,i)}return a}}function Mo(e){return Ko(function(t){return t=Pn(t,nr(Qo())),ja(function(n){var r=this;return e(t,function(e){return Dn(e,r,n)})})})}function No(e,t){t=t===n?` `:Ua(t);var r=t.length;if(r<2)return r?Aa(t,e):t;var i=Aa(t,Jt(e/Sr(t)));return fr(t)?to(Cr(i),0,e).join(``):i.slice(0,e)}function Po(e,t,n,r){var i=t&_,a=To(e);function o(){for(var t=-1,s=arguments.length,c=-1,l=r.length,u=$e(l+s),d=this&&this!==hn&&this instanceof o?a:e;++c<l;)u[c]=r[c];for(;s--;)u[c++]=arguments[++t];return Dn(d,i?n:this,u)}return o}function Fo(e){return function(t,r,i){return i&&typeof i!=`number`&&hs(t,r,i)&&(r=i=n),t=ed(t),r===n?(r=t,t=0):r=ed(r),i=i===n?t<r?1:-1:ed(i),ka(t,r,i,e)}}function Io(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=rd(t),n=rd(n)),e(t,n)}}function G(e,t,r,i,a,o,s,c,l,u){var d=t&b,f=d?s:n,p=d?n:s,m=d?o:n,h=d?n:o;t|=d?S:C,t&=~(d?C:S),t&y||(t&=~(_|v));var g=[e,t,a,m,f,h,p,c,l,u],x=r.apply(n,g);return vs(e)&&Ms(x,g),x.placeholder=i,Fs(x,e,t)}function K(e){var t=gt[e];return function(e,n){if(e=rd(e),n=n==null?0:cn(td(n),292),n&&$t(e)){var r=(od(e)+`e`).split(`e`);return r=(od(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var Lo=yn&&1/vr(new yn([,-0]))[1]==A?function(e){return new yn(e)}:Gf;function Ro(e){return function(t){var n=as(t);return n==me?hr(t):n==xe?yr(t):er(t,e(t))}}function zo(e,t,r,i,a,s,c,l){var u=t&v;if(!u&&typeof e!=`function`)throw new bt(o);var d=i?i.length:0;if(d||(t&=~(S|C),i=a=n),c=c===n?c:nn(td(c),0),l=l===n?l:td(l),d-=a?a.length:0,t&C){var f=i,p=a;i=a=n}var m=u?n:Yo(e),h=[e,t,r,i,a,f,p,s,c,l];if(m&&Ts(h,m),e=h[0],t=h[1],r=h[2],i=h[3],a=h[4],l=h[9]=h[9]===n?u?0:e.length:nn(h[9]-d,0),!l&&t&(b|x)&&(t&=~(b|x)),!t||t==_)var g=So(e,t,r);else g=t==b||t==x?Eo(e,t,l):(t==S||t==(_|S))&&!a.length?Po(e,t,r,i):ko.apply(n,h);return Fs((m?Fa:Ms)(g,h),e,t)}function Bo(e,t,r,i){return e===n||du(e,Ct[r])&&!Et.call(i,r)?t:e}function Vo(e,t,r,i,a,o){return ju(e)&&ju(t)&&(o.set(t,e),ya(e,t,n,Vo,o),o.delete(t)),e}function Ho(e){return Vu(e)?n:e}function Uo(e,t,r,i,a,o){var s=r&h,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&g?new oi:n;for(o.set(e,t),o.set(t,e);++f<c;){var _=e[f],v=t[f];if(i)var y=s?i(v,_,f,t,e,o):i(_,v,f,e,t,o);if(y!==n){if(y)continue;p=!1;break}if(m){if(!Rn(t,function(e,t){if(!ir(m,t)&&(_===e||a(_,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(_===v||a(_,v,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function Wo(e,t,n,r,i,a,o){switch(n){case De:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!a(new Ft(e),new Ft(t)));case le:case I:case he:return du(+e,+t);case de:return e.name==t.name&&e.message==t.message;case be:case Se:return e==t+``;case me:var s=hr;case xe:var c=r&h;if(s||=vr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=g,o.set(e,t);var u=Uo(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ce:if(Nr)return Nr.call(e)==Nr.call(t)}return!1}function Go(e,t,r,i,a,o){var s=r&h,c=qo(e),l=c.length;if(l!=qo(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Et.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var g=s;++u<l;){d=c[u];var _=e[d],v=t[d];if(i)var y=s?i(v,_,d,t,e,o):i(_,v,d,e,t,o);if(!(y===n?_===v||a(_,v,r,i,o):y)){m=!1;break}g||=d==`constructor`}if(m&&!g){var b=e.constructor,x=t.constructor;b!=x&&`constructor`in e&&`constructor`in t&&!(typeof b==`function`&&b instanceof b&&typeof x==`function`&&x instanceof x)&&(m=!1)}return o.delete(e),o.delete(t),m}function Ko(e){return Ps(Os(e,n,nc),e+``)}function qo(e){return Ki(e,Od,rs)}function Jo(e){return Ki(e,kd,is)}var Yo=Bn?function(e){return Bn.get(e)}:Gf;function Xo(e){for(var t=e.name+``,n=Yn[t],r=Et.call(Yn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Zo(e){return(Et.call(U,`placeholder`)?U:e).placeholder}function Qo(){var e=U.iteratee||Rf;return e=e===Rf?fa:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(e,t){var n=e.__data__;return _s(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function es(e){for(var t=Od(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ss(i)]}return t}function ts(e,t){var r=dr(e,t);return ca(r)?r:n}function ns(e){var t=Et.call(e,Ut),r=e[Ut];try{e[Ut]=n;var i=!0}catch{}var a=kt.call(e);return i&&(t?e[Ut]=r:delete e[Ut]),a}var rs=Xt?function(e){return e==null?[]:(e=_t(e),jn(Xt(e),function(t){return zt.call(e,t)}))}:ep,is=Xt?function(e){for(var t=[];e;)Fn(t,rs(e)),e=Lt(e);return t}:ep,as=qi;(mn&&as(new mn(new ArrayBuffer(1)))!=De||gn&&as(new gn)!=me||_n&&as(_n.resolve())!=ve||yn&&as(new yn)!=xe||bn&&as(new bn)!=Te)&&(as=function(e){var t=qi(e),r=t==_e?e.constructor:n,i=r?Bs(r):``;if(i)switch(i){case br:return De;case Er:return me;case Dr:return ve;case Ar:return xe;case jr:return Te}return t});function os(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=cn(t,e+o);break;case`takeRight`:e=nn(e,t-o);break}}return{start:e,end:t}}function ss(e){var t=e.match(tt);return t?t[1].split(nt):[]}function cs(e,t,n){t=$a(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=zs(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Au(i)&&ms(o,i)&&(hu(e)||mu(e)))}function ls(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Et.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function us(e){return typeof e.constructor==`function`&&!xs(e)?Fr(Lt(e)):{}}function ds(e,t,n){var r=e.constructor;switch(t){case L:return io(e);case le:case I:return new r(+e);case De:return ao(e,n);case Oe:case ke:case Ae:case je:case Me:case Ne:case Pe:case Fe:case Ie:return co(e,n);case me:return new r;case he:case Se:return new r(e);case be:return oo(e);case xe:return new r;case Ce:return so(e)}}function fs(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(et,`{
2
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./get-front-component-build-plugins-DZIleilT.js"),t=require("./login-4PI5lTOa.js");let n=require("path");n=e.Tt(n);let r=require("node:fs/promises"),i=require("@sniptt/guards"),a=require("uuid"),o=require("react");o=e.Tt(o);let s=require("node:path");s=e.Tt(s);let c=require("crypto");c=e.Tt(c);let l=require("node:child_process"),u=require("chalk");u=e.Tt(u);let d=require("inquirer");d=e.Tt(d);let f=require("chokidar");f=e.Tt(f);let p=require("react/jsx-runtime"),m=require("commander"),h=require("util");var g=e=>e&&!e?.startsWith(`/`)?(0,n.join)(t.Dt,e):e,_=async e=>{let i=(0,n.join)(e,`package.json`);if(await t.yt(i))try{let e=await(0,r.readFile)(i,`utf-8`),t=JSON.parse(e);return t.dependencies?.[`twenty-sdk`]??t.devDependencies?.[`twenty-sdk`]??void 0}catch{return}},v=e=>{let t=e.match(/(\d+)\./);if(t)return parseInt(t[1],10);let n=e.match(/^[~^>=<]*(\d+)$/);return n?parseInt(n[1],10):null},y=async e=>{let n=t.I.version,r=await _(e);if(!n||!r)return;let i=v(n),a=v(r);i===null||a===null||i!==a&&(console.warn(u.default.yellow(`⚠ Version mismatch: your app requires twenty-sdk@${a}.x but the CLI running is v${n}. Major version mismatches may cause unexpected behavior.\n Update with: npm install -g twenty-sdk@${a}`)),console.warn(``))},b=class{async execute(e){e.private?await this.executePrivate(e):await this.executeNpm(e)}async executeNpm(e){let n=e.appPath??t.Dt;await y(n),console.log(u.default.blue(`Publishing to npm...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.L({appPath:n,npmTag:e.tag,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1)),console.log(u.default.green(`✓ Published to npm successfully`))}async executePrivate(e){let r=e.appPath??t.Dt;await y(r);let i=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Deploying application on ${i}...`)),console.log(u.default.gray(`App path: ${r}\n`));let a=e=>console.log(u.default.gray(e)),o=await t.G({appPath:r,tarball:!0,onProgress:a});o.success||(console.error(u.default.red(o.error.message)),process.exit(1));let s=await t.R({tarballPath:o.data.tarballPath,remote:e.remote,onProgress:a});s.success||(console.error(u.default.red(s.error.message)),process.exit(1));let c=await t.bt(n.default.join(r,`package.json`)).catch(()=>void 0),l=c?.name??s.data.name,d=c?.version??`unknown`;console.log(u.default.green(`\n✓ Published ${l} v${d} to ${i}\n`)),console.log(" To install deployed application: `yarn twenty app:install`")}},x=class{async execute(e){let n=e.appPath??t.Dt;await y(n),await t.y();let r=e.remote??t.U.getActiveRemote();console.log(u.default.blue(`Installing application on ${r}...`)),console.log(u.default.gray(`App path: ${n}\n`));let i=await t.N({appPath:n,remote:e.remote});i.success||(console.error(u.default.red(i.error.message)),process.exit(1)),console.log(u.default.green(`✓ Application installed`))}},S=class{async execute({appPath:e=t.Dt,askForConfirmation:n}){let r=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Uninstall Twenty Application on ${r}`)),console.log(u.default.gray(`📁 App Path: ${e}\n`)),n&&!await this.confirmationPrompt()&&(console.error(u.default.red(`⛔️ Aborting uninstall`)),process.exit(1));let i=await t.v({appPath:e});return i.success?(console.log(u.default.green(`✅ Application uninstalled successfully`)),{success:!0,data:void 0}):(console.error(u.default.red(`❌ Uninstall failed:`),i.error.message),{success:!1,error:i.error.message})}async confirmationPrompt(){let{confirmation:e}=await d.default.prompt([{type:`confirm`,name:`confirmation`,message:`Are you sure you want to uninstall this application?`,default:!1}]);return e}},C=e=>{let t=new b,n=new x,r=new S;e.command(`app:publish [appPath]`).description(`Build and publish to npm (default) or server registry`).option(`--private`,`Push to a Twenty server's registry instead of npm`).option(`-r, --remote <name>`,`Publish to a specific remote (with --private)`).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,n)=>{await t.execute({appPath:g(e),private:n.private,remote:n.remote,tag:n.tag})}),e.command(`app:install [appPath]`).description(`Install a deployed app on the server`).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{await n.execute({appPath:g(e),remote:t.remote})}),e.command(`app:uninstall [appPath]`).description(`Uninstall app from server`).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{try{let n=await r.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}})},w=[`src/application.config.ts`,`src/application-config.ts`,`src/applicationConfig.ts`],T=async e=>{for(let r of w){let i=(0,n.join)(e,r);if(await t.yt(i))return i}return null},E=async e=>{let n=await T(e);if(n===null)throw Error(`Could not find the application config file (expected one of: ${w.join(`, `)}). Create it with defineApplication({ universalIdentifier: ... }) before generating entities.`);let{config:r}=await t.nt({appPath:e,filePath:n});if(!r?.universalIdentifier)throw Error(`defineApplication in ${n} must declare a universalIdentifier before generating entities.`);return r.universalIdentifier},D=e.Ct(((e,t)=>{(function(){var n,r=`4.18.1`,i=200,a=`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`,o=`Expected a function`,s="Invalid `variable` option passed into `_.template`",c="Invalid `imports` option passed into `_.template`",l=`__lodash_hash_undefined__`,u=500,d=`__lodash_placeholder__`,f=1,p=2,m=4,h=1,g=2,_=1,v=2,y=4,b=8,x=16,S=32,C=64,w=128,T=256,E=512,D=30,O=`...`,ee=800,k=16,te=1,ne=2,re=3,A=1/0,j=9007199254740991,M=17976931348623157e292,N=NaN,P=4294967295,F=P-1,ie=P>>>1,ae=[[`ary`,w],[`bind`,_],[`bindKey`,v],[`curry`,b],[`curryRight`,x],[`flip`,E],[`partial`,S],[`partialRight`,C],[`rearg`,T]],oe=`[object Arguments]`,se=`[object Array]`,ce=`[object AsyncFunction]`,le=`[object Boolean]`,I=`[object Date]`,ue=`[object DOMException]`,de=`[object Error]`,fe=`[object Function]`,pe=`[object GeneratorFunction]`,me=`[object Map]`,he=`[object Number]`,ge=`[object Null]`,_e=`[object Object]`,ve=`[object Promise]`,ye=`[object Proxy]`,be=`[object RegExp]`,xe=`[object Set]`,Se=`[object String]`,Ce=`[object Symbol]`,we=`[object Undefined]`,Te=`[object WeakMap]`,Ee=`[object WeakSet]`,L=`[object ArrayBuffer]`,De=`[object DataView]`,Oe=`[object Float32Array]`,ke=`[object Float64Array]`,Ae=`[object Int8Array]`,je=`[object Int16Array]`,Me=`[object Int32Array]`,Ne=`[object Uint8Array]`,Pe=`[object Uint8ClampedArray]`,Fe=`[object Uint16Array]`,Ie=`[object Uint32Array]`,Le=/\b__p \+= '';/g,Re=/\b(__p \+=) '' \+/g,ze=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,Ve=/[&<>"']/g,He=RegExp(Be.source),Ue=RegExp(Ve.source),We=/<%-([\s\S]+?)%>/g,Ge=/<%([\s\S]+?)%>/g,Ke=/<%=([\s\S]+?)%>/g,qe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Je=/^\w*$/,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/[\\^$.*+?()[\]{}|]/g,Ze=RegExp(Xe.source),Qe=/^\s+/,$e=/\s/,et=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tt=/\{\n\/\* \[wrapped with (.+)\] \*/,nt=/,? & /,rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,it=/[()=,{}\[\]\/\s]/,at=/\\(\\)?/g,ot=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ct=/^[-+]0x[0-9a-f]+$/i,lt=/^0b[01]+$/i,ut=/^\[object .+?Constructor\]$/,R=/^0o[0-7]+$/i,dt=/^(?:0|[1-9]\d*)$/,z=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ft=/($^)/,pt=/['\n\r\u2028\u2029\\]/g,mt=`\\ud800-\\udfff`,ht=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,gt=`\\u2700-\\u27bf`,_t=`a-z\\xdf-\\xf6\\xf8-\\xff`,vt=`\\xac\\xb1\\xd7\\xf7`,yt=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,bt=`\\u2000-\\u206f`,xt=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,St=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Ct=`\\ufe0e\\ufe0f`,wt=vt+yt+bt+xt,Tt=`['’]`,Et=`[`+mt+`]`,Dt=`[`+wt+`]`,Ot=`[`+ht+`]`,kt=`\\d+`,At=`[`+gt+`]`,jt=`[`+_t+`]`,Mt=`[^`+mt+wt+kt+gt+_t+St+`]`,Nt=`\\ud83c[\\udffb-\\udfff]`,Pt=`(?:`+Ot+`|`+Nt+`)`,Ft=`[^`+mt+`]`,It=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Lt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Rt=`[`+St+`]`,zt=`\\u200d`,Bt=`(?:`+jt+`|`+Mt+`)`,Vt=`(?:`+Rt+`|`+Mt+`)`,Ht=`(?:`+Tt+`(?:d|ll|m|re|s|t|ve))?`,Ut=`(?:`+Tt+`(?:D|LL|M|RE|S|T|VE))?`,Wt=Pt+`?`,Gt=`[`+Ct+`]?`,Kt=`(?:`+zt+`(?:`+[Ft,It,Lt].join(`|`)+`)`+Gt+Wt+`)*`,qt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,Jt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Yt=Gt+Wt+Kt,Xt=`(?:`+[At,It,Lt].join(`|`)+`)`+Yt,Zt=`(?:`+[Ft+Ot+`?`,Ot,It,Lt,Et].join(`|`)+`)`,B=RegExp(Tt,`g`),Qt=RegExp(Ot,`g`),$t=RegExp(Nt+`(?=`+Nt+`)|`+Zt+Yt,`g`),en=RegExp([Rt+`?`+jt+`+`+Ht+`(?=`+[Dt,Rt,`$`].join(`|`)+`)`,Vt+`+`+Ut+`(?=`+[Dt,Rt+Bt,`$`].join(`|`)+`)`,Rt+`?`+Bt+`+`+Ht,Rt+`+`+Ut,Jt,qt,kt,Xt].join(`|`),`g`),tn=RegExp(`[`+zt+mt+ht+Ct+`]`),nn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rn=`Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout`.split(`.`),an=-1,on={};on[Oe]=on[ke]=on[Ae]=on[je]=on[Me]=on[Ne]=on[Pe]=on[Fe]=on[Ie]=!0,on[oe]=on[se]=on[L]=on[le]=on[De]=on[I]=on[de]=on[fe]=on[me]=on[he]=on[_e]=on[be]=on[xe]=on[Se]=on[Te]=!1;var sn={};sn[oe]=sn[se]=sn[L]=sn[De]=sn[le]=sn[I]=sn[Oe]=sn[ke]=sn[Ae]=sn[je]=sn[Me]=sn[me]=sn[he]=sn[_e]=sn[be]=sn[xe]=sn[Se]=sn[Ce]=sn[Ne]=sn[Pe]=sn[Fe]=sn[Ie]=!0,sn[de]=sn[fe]=sn[Te]=!1;var cn={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`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`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`},ln={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},un={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`},dn={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},fn=parseFloat,pn=parseInt,V=typeof global==`object`&&global&&global.Object===Object&&global,mn=typeof self==`object`&&self&&self.Object===Object&&self,hn=V||mn||Function(`return this`)(),gn=typeof e==`object`&&e&&!e.nodeType&&e,_n=gn&&typeof t==`object`&&t&&!t.nodeType&&t,vn=_n&&_n.exports===gn,yn=vn&&V.process,bn=function(){try{return _n&&_n.require&&_n.require(`util`).types||yn&&yn.binding&&yn.binding(`util`)}catch{}}(),xn=bn&&bn.isArrayBuffer,Sn=bn&&bn.isDate,Cn=bn&&bn.isMap,wn=bn&&bn.isRegExp,Tn=bn&&bn.isSet,En=bn&&bn.isTypedArray;function Dn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function On(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function H(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function kn(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function An(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function jn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Mn(e,t){return!!(e!=null&&e.length)&&Wn(e,t,0)>-1}function Nn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Fn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function In(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ln(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var zn=Jn(`length`);function Bn(e){return e.split(``)}function Vn(e){return e.match(rt)||[]}function Hn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Un(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Wn(e,t,n){return t===t?br(e,t,n):Un(e,Kn,n)}function Gn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function Kn(e){return e!==e}function qn(e,t){var n=e==null?0:e.length;return n?Qn(e,t)/n:N}function Jn(e){return function(t){return t==null?n:t[e]}}function Yn(e){return function(t){return e==null?n:e[t]}}function Xn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Zn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Qn(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function $n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function er(e,t){return Pn(t,function(t){return[t,e[t]]})}function tr(e){return e&&e.slice(0,wr(e)+1).replace(Qe,``)}function nr(e){return function(t){return e(t)}}function rr(e,t){return Pn(t,function(t){return e[t]})}function ir(e,t){return e.has(t)}function ar(e,t){for(var n=-1,r=e.length;++n<r&&Wn(t,e[n],0)>-1;);return n}function or(e,t){for(var n=e.length;n--&&Wn(t,e[n],0)>-1;);return n}function sr(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var cr=Yn(cn),lr=Yn(ln);function ur(e){return`\\`+dn[e]}function dr(e,t){return e==null?n:e[t]}function fr(e){return tn.test(e)}function pr(e){return nn.test(e)}function mr(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function hr(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function gr(e,t){return function(n){return e(t(n))}}function _r(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];(o===t||o===d)&&(e[n]=d,a[i++]=n)}return a}function vr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function yr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function br(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function xr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function Sr(e){return fr(e)?Er(e):zn(e)}function Cr(e){return fr(e)?Dr(e):Bn(e)}function wr(e){for(var t=e.length;t--&&$e.test(e.charAt(t)););return t}var Tr=Yn(un);function Er(e){for(var t=$t.lastIndex=0;$t.test(e);)++t;return t}function Dr(e){return e.match($t)||[]}function Or(e){return e.match(en)||[]}var kr=(function e(t){t=t==null?hn:kr.defaults(hn.Object(),t,kr.pick(hn,rn));var $e=t.Array,rt=t.Date,mt=t.Error,ht=t.Function,gt=t.Math,_t=t.Object,vt=t.RegExp,yt=t.String,bt=t.TypeError,xt=$e.prototype,St=ht.prototype,Ct=_t.prototype,wt=t[`__core-js_shared__`],Tt=St.toString,Et=Ct.hasOwnProperty,Dt=0,Ot=function(){var e=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),kt=Ct.toString,At=Tt.call(_t),jt=hn._,Mt=vt(`^`+Tt.call(Et).replace(Xe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Nt=vn?t.Buffer:n,Pt=t.Symbol,Ft=t.Uint8Array,It=Nt?Nt.allocUnsafe:n,Lt=gr(_t.getPrototypeOf,_t),Rt=_t.create,zt=Ct.propertyIsEnumerable,Bt=xt.splice,Vt=Pt?Pt.isConcatSpreadable:n,Ht=Pt?Pt.iterator:n,Ut=Pt?Pt.toStringTag:n,Wt=function(){try{var e=ts(_t,`defineProperty`);return e({},``,{}),e}catch{}}(),Gt=t.clearTimeout!==hn.clearTimeout&&t.clearTimeout,Kt=rt&&rt.now!==hn.Date.now&&rt.now,qt=t.setTimeout!==hn.setTimeout&&t.setTimeout,Jt=gt.ceil,Yt=gt.floor,Xt=_t.getOwnPropertySymbols,Zt=Nt?Nt.isBuffer:n,$t=t.isFinite,en=xt.join,tn=gr(_t.keys,_t),nn=gt.max,cn=gt.min,ln=rt.now,un=t.parseInt,dn=gt.random,V=xt.reverse,mn=ts(t,`DataView`),gn=ts(t,`Map`),_n=ts(t,`Promise`),yn=ts(t,`Set`),bn=ts(t,`WeakMap`),zn=ts(_t,`create`),Bn=bn&&new bn,Yn={},br=Bs(mn),Er=Bs(gn),Dr=Bs(_n),Ar=Bs(yn),jr=Bs(bn),Mr=Pt?Pt.prototype:n,Nr=Mr?Mr.valueOf:n,Pr=Mr?Mr.toString:n;function U(e){if(Mu(e)&&!hu(e)&&!(e instanceof Rr)){if(e instanceof Lr)return e;if(Et.call(e,`__wrapped__`))return Hs(e)}return new Lr(e)}var Fr=function(){function e(){}return function(t){if(!ju(t))return{};if(Rt)return Rt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Ir(){}function Lr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}U.templateSettings={escape:We,evaluate:Ge,interpolate:Ke,variable:``,imports:{_:U}},U.prototype=Ir.prototype,U.prototype.constructor=U,Lr.prototype=Fr(Ir.prototype),Lr.prototype.constructor=Lr;function Rr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=P,this.__views__=[]}function zr(){var e=new Rr(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e}function Br(){if(this.__filtered__){var e=new Rr(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Vr(){var e=this.__wrapped__.value(),t=this.__dir__,n=hu(e),r=t<0,i=n?e.length:0,a=os(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=cn(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Ja(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==ne)g=b;else if(!b){if(y==te)continue outer;break outer}}m[f++]=g}return m}Rr.prototype=Fr(Ir.prototype),Rr.prototype.constructor=Rr;function Hr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ur(){this.__data__=zn?zn(null):{},this.size=0}function Wr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Gr(e){var t=this.__data__;if(zn){var r=t[e];return r===l?n:r}return Et.call(t,e)?t[e]:n}function Kr(e){var t=this.__data__;return zn?t[e]!==n:Et.call(t,e)}function qr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=zn&&t===n?l:t,this}Hr.prototype.clear=Ur,Hr.prototype.delete=Wr,Hr.prototype.get=Gr,Hr.prototype.has=Kr,Hr.prototype.set=qr;function Jr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yr(){this.__data__=[],this.size=0}function Xr(e){var t=this.__data__,n=xi(t,e);return n<0?!1:(n==t.length-1?t.pop():Bt.call(t,n,1),--this.size,!0)}function Zr(e){var t=this.__data__,r=xi(t,e);return r<0?n:t[r][1]}function Qr(e){return xi(this.__data__,e)>-1}function $r(e,t){var n=this.__data__,r=xi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Jr.prototype.clear=Yr,Jr.prototype.delete=Xr,Jr.prototype.get=Zr,Jr.prototype.has=Qr,Jr.prototype.set=$r;function ei(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ti(){this.size=0,this.__data__={hash:new Hr,map:new(gn||Jr),string:new Hr}}function ni(e){var t=$o(this,e).delete(e);return this.size-=+!!t,t}function ri(e){return $o(this,e).get(e)}function ii(e){return $o(this,e).has(e)}function ai(e,t){var n=$o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}ei.prototype.clear=ti,ei.prototype.delete=ni,ei.prototype.get=ri,ei.prototype.has=ii,ei.prototype.set=ai;function oi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ei;++t<n;)this.add(e[t])}function si(e){return this.__data__.set(e,l),this}function ci(e){return this.__data__.has(e)}oi.prototype.add=oi.prototype.push=si,oi.prototype.has=ci;function li(e){var t=this.__data__=new Jr(e);this.size=t.size}function ui(){this.__data__=new Jr,this.size=0}function di(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fi(e){return this.__data__.get(e)}function pi(e){return this.__data__.has(e)}function mi(e,t){var n=this.__data__;if(n instanceof Jr){var r=n.__data__;if(!gn||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ei(r)}return n.set(e,t),this.size=n.size,this}li.prototype.clear=ui,li.prototype.delete=di,li.prototype.get=fi,li.prototype.has=pi,li.prototype.set=mi;function hi(e,t){var n=hu(e),r=!n&&mu(e),i=!n&&!r&&bu(e),a=!n&&!r&&!i&&qu(e),o=n||r||i||a,s=o?$n(e.length,yt):[],c=s.length;for(var l in e)(t||Et.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||ms(l,c)))&&s.push(l);return s}function gi(e){var t=e.length;return t?e[Oa(0,t-1)]:n}function _i(e,t){return Ls(mo(e),Di(t,0,e.length))}function vi(e){return Ls(mo(e))}function yi(e,t,r){(r!==n&&!du(e[t],r)||r===n&&!(t in e))&&Ti(e,t,r)}function bi(e,t,r){var i=e[t];(!(Et.call(e,t)&&du(i,r))||r===n&&!(t in e))&&Ti(e,t,r)}function xi(e,t){for(var n=e.length;n--;)if(du(e[n][0],t))return n;return-1}function Si(e,t,n,r){return Ni(e,function(e,i,a){t(r,e,n(e),a)}),r}function Ci(e,t){return e&&ho(t,Od(t),e)}function wi(e,t){return e&&ho(t,kd(t),e)}function Ti(e,t,n){t==`__proto__`&&Wt?Wt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ei(e,t){for(var r=-1,i=t.length,a=$e(i),o=e==null;++r<i;)a[r]=o?n:Sd(e,t[r]);return a}function Di(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Oi(e,t,r,i,a,o){var s,c=t&f,l=t&p,u=t&m;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!ju(e))return e;var d=hu(e);if(d){if(s=ls(e),!c)return mo(e,s)}else{var h=as(e),g=h==fe||h==pe;if(bu(e))return ro(e,c);if(h==_e||h==oe||g&&!a){if(s=l||g?{}:us(e),!c)return l?_o(e,wi(s,e)):go(e,Ci(s,e))}else{if(!sn[h])return a?e:{};s=ds(e,h,c)}}o||=new li;var _=o.get(e);if(_)return _;o.set(e,s),Wu(e)?e.forEach(function(n){s.add(Oi(n,t,r,n,e,o))}):Nu(e)&&e.forEach(function(n,i){s.set(i,Oi(n,t,r,i,e,o))});var v=d?n:(u?l?Jo:qo:l?kd:Od)(e);return H(v||e,function(n,i){v&&(i=n,n=e[i]),bi(s,i,Oi(n,t,r,i,e,o))}),s}function ki(e){var t=Od(e);return function(n){return Ai(n,e,t)}}function Ai(e,t,r){var i=r.length;if(e==null)return!i;for(e=_t(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function ji(e,t,r){if(typeof e!=`function`)throw new bt(o);return Ns(function(){e.apply(n,r)},t)}function Mi(e,t,n,r){var a=-1,o=Mn,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=Pn(t,nr(n))),r?(o=Nn,s=!1):t.length>=i&&(o=ir,s=!1,t=new oi(t));outer:for(;++a<c;){var d=e[a],f=n==null?d:n(d);if(d=r||d!==0?d:0,s&&f===f){for(var p=u;p--;)if(t[p]===f)continue outer;l.push(d)}else o(t,f,r)||l.push(d)}return l}var Ni=bo(Hi),Pi=bo(Ui,!0);function Fi(e,t){var n=!0;return Ni(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function Ii(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!Ku(s):r(s,c)))var c=s,l=o}return l}function Li(e,t,r,i){var a=e.length;for(r=td(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:td(i),i<0&&(i+=a),i=r>i?0:nd(i);r<i;)e[r++]=t;return e}function Ri(e,t){var n=[];return Ni(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function zi(e,t,n,r,i){var a=-1,o=e.length;for(n||=ps,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?zi(s,t-1,n,r,i):Fn(i,s):r||(i[i.length]=s)}return i}var Bi=xo(),Vi=xo(!0);function Hi(e,t){return e&&Bi(e,t,Od)}function Ui(e,t){return e&&Vi(e,t,Od)}function Wi(e,t){return jn(t,function(t){return Ou(e[t])})}function Gi(e,t){t=$a(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[zs(t[r++])];return r&&r==i?e:n}function Ki(e,t,n){var r=t(e);return hu(e)?r:Fn(r,n(e))}function qi(e){return e==null?e===n?we:ge:Ut&&Ut in _t(e)?ns(e):Ds(e)}function Ji(e,t){return e>t}function Yi(e,t){return e!=null&&Et.call(e,t)}function Xi(e,t){return e!=null&&t in _t(e)}function Zi(e,t,n){return e>=cn(t,n)&&e<nn(t,n)}function Qi(e,t,r){for(var i=r?Nn:Mn,a=e[0].length,o=e.length,s=o,c=$e(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Pn(d,nr(t))),l=cn(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new oi(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?ir(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?ir(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function $i(e,t,n,r){return Hi(e,function(e,i,a){t(r,n(e),i,a)}),r}function ea(e,t,r){t=$a(t,e),e=ks(e,t);var i=e==null?e:e[zs(pc(t))];return i==null?n:Dn(i,e,r)}function ta(e){return Mu(e)&&qi(e)==oe}function na(e){return Mu(e)&&qi(e)==L}function ra(e){return Mu(e)&&qi(e)==I}function ia(e,t,n,r,i){return e===t?!0:e==null||t==null||!Mu(e)&&!Mu(t)?e!==e&&t!==t:aa(e,t,n,r,ia,i)}function aa(e,t,n,r,i,a){var o=hu(e),s=hu(t),c=o?se:as(e),l=s?se:as(t);c=c==oe?_e:c,l=l==oe?_e:l;var u=c==_e,d=l==_e,f=c==l;if(f&&bu(e)){if(!bu(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new li,o||qu(e)?Uo(e,t,n,r,i,a):Wo(e,t,c,n,r,i,a);if(!(n&h)){var p=u&&Et.call(e,`__wrapped__`),m=d&&Et.call(t,`__wrapped__`);if(p||m){var g=p?e.value():e,_=m?t.value():t;return a||=new li,i(g,_,n,r,a)}}return f?(a||=new li,Go(e,t,n,r,i,a)):!1}function oa(e){return Mu(e)&&as(e)==me}function sa(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=_t(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new li;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?ia(d,u,h|g,i,f):p))return!1}}return!0}function ca(e){return!ju(e)||ys(e)?!1:(Ou(e)?Mt:ut).test(Bs(e))}function la(e){return Mu(e)&&qi(e)==be}function ua(e){return Mu(e)&&as(e)==xe}function da(e){return Mu(e)&&Au(e.length)&&!!on[qi(e)]}function fa(e){return typeof e==`function`?e:e==null?Lf:typeof e==`object`?hu(e)?va(e[0],e[1]):_a(e):Xf(e)}function pa(e){if(!xs(e))return tn(e);var t=[];for(var n in _t(e))Et.call(e,n)&&n!=`constructor`&&t.push(n);return t}function ma(e){if(!ju(e))return Es(e);var t=xs(e),n=[];for(var r in e)r==`constructor`&&(t||!Et.call(e,r))||n.push(r);return n}function ha(e,t){return e<t}function ga(e,t){var n=-1,r=_u(e)?$e(e.length):[];return Ni(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function _a(e){var t=es(e);return t.length==1&&t[0][2]?Cs(t[0][0],t[0][1]):function(n){return n===e||sa(n,e,t)}}function va(e,t){return gs(e)&&Ss(t)?Cs(zs(e),t):function(r){var i=Sd(r,e);return i===n&&i===t?wd(r,e):ia(t,i,h|g)}}function ya(e,t,r,i,a){e!==t&&Bi(t,function(o,s){if(a||=new li,ju(o))ba(e,t,s,r,ya,i,a);else{var c=i?i(js(e,s),o,s+``,e,t,a):n;c===n&&(c=o),yi(e,s,c)}},kd)}function ba(e,t,r,i,a,o,s){var c=js(e,r),l=js(t,r),u=s.get(l);if(u){yi(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=hu(l),m=!p&&bu(l),h=!p&&!m&&qu(l);d=l,p||m||h?hu(c)?d=c:vu(c)?d=mo(c):m?(f=!1,d=ro(l,!0)):h?(f=!1,d=co(l,!0)):d=[]:Vu(l)||mu(l)?(d=c,mu(c)?d=id(c):(!ju(c)||Ou(c))&&(d=us(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),yi(e,r,d)}function xa(e,t){var r=e.length;if(r)return t+=t<0?r:0,ms(t,r)?e[t]:n}function Sa(e,t,n){t=t.length?Pn(t,function(e){return hu(e)?function(t){return Gi(t,e.length===1?e[0]:e)}:e}):[Lf];var r=-1;return t=Pn(t,nr(Qo())),Zn(ga(e,function(e,n,i){return{criteria:Pn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return uo(e,t,n)})}function Ca(e,t){return wa(e,t,function(t,n){return wd(e,n)})}function wa(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Gi(e,o);n(s,o)&&Pa(a,$a(o,e),s)}return a}function Ta(e){return function(t){return Gi(t,e)}}function Ea(e,t,n,r){var i=r?Gn:Wn,a=-1,o=t.length,s=e;for(e===t&&(t=mo(t)),n&&(s=Pn(e,nr(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&Bt.call(s,c,1),Bt.call(e,c,1);return e}function Da(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ms(i)?Bt.call(e,i,1):Ga(e,i)}}return e}function Oa(e,t){return e+Yt(dn()*(t-e+1))}function ka(e,t,n,r){for(var i=-1,a=nn(Jt((t-e)/(n||1)),0),o=$e(a);a--;)o[r?a:++i]=e,e+=n;return o}function Aa(e,t){var n=``;if(!e||t<1||t>j)return n;do t%2&&(n+=e),t=Yt(t/2),t&&(e+=e);while(t);return n}function ja(e,t){return Ps(Os(e,t,Lf),e+``)}function Ma(e){return gi(qd(e))}function Na(e,t){var n=qd(e);return Ls(n,Di(t,0,n.length))}function Pa(e,t,r,i){if(!ju(e))return e;t=$a(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=zs(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=ju(d)?d:ms(t[a+1])?[]:{})}bi(c,l,u),c=c[l]}return e}var Fa=Bn?function(e,t){return Bn.set(e,t),e}:Lf,Ia=Wt?function(e,t){return Wt(e,`toString`,{configurable:!0,enumerable:!1,value:Nf(t),writable:!0})}:Lf;function La(e){return Ls(qd(e))}function Ra(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=$e(i);++r<i;)a[r]=e[r+t];return a}function za(e,t){var n;return Ni(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function Ba(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=ie){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!Ku(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return Va(e,t,Lf,n)}function Va(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=Ku(t),u=t===n;a<o;){var d=Yt((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=Ku(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return cn(o,F)}function W(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!du(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function Ha(e){return typeof e==`number`?e:Ku(e)?N:+e}function Ua(e){if(typeof e==`string`)return e;if(hu(e))return Pn(e,Ua)+``;if(Ku(e))return Pr?Pr.call(e):``;var t=e+``;return t==`0`&&1/e==-A?`-0`:t}function Wa(e,t,n){var r=-1,a=Mn,o=e.length,s=!0,c=[],l=c;if(n)s=!1,a=Nn;else if(o>=i){var u=t?null:Lo(e);if(u)return vr(u);s=!1,a=ir,l=new oi}else l=t?[]:c;outer:for(;++r<o;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,s&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),c.push(d)}else a(l,f,n)||(l!==c&&l.push(f),c.push(d))}return c}function Ga(e,t){t=$a(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=zs(t[n]);if(i===`__proto__`&&!Et.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ks(e,t);return a==null||delete a[zs(pc(t))]}function Ka(e,t,n,r){return Pa(e,t,n(Gi(e,t)),r)}function qa(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?Ra(e,r?0:a,r?a+1:i):Ra(e,r?a+1:0,r?i:a)}function Ja(e,t){var n=e;return n instanceof Rr&&(n=n.value()),In(t,function(e,t){return t.func.apply(t.thisArg,Fn([e],t.args))},n)}function Ya(e,t,n){var r=e.length;if(r<2)return r?Wa(e[0]):[];for(var i=-1,a=$e(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Mi(a[i]||o,e[s],t,n));return Wa(zi(a,1),t,n)}function Xa(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function Za(e){return vu(e)?e:[]}function Qa(e){return typeof e==`function`?e:Lf}function $a(e,t){return hu(e)?e:gs(e,t)?[e]:Rs(od(e))}var eo=ja;function to(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Ra(e,t,r)}var no=Gt||function(e){return hn.clearTimeout(e)};function ro(e,t){if(t)return e.slice();var n=e.length,r=It?It(n):new e.constructor(n);return e.copy(r),r}function io(e){var t=new e.constructor(e.byteLength);return new Ft(t).set(new Ft(e)),t}function ao(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function oo(e){var t=new e.constructor(e.source,st.exec(e));return t.lastIndex=e.lastIndex,t}function so(e){return Nr?_t(Nr.call(e)):{}}function co(e,t){var n=t?io(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function lo(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=Ku(e),s=t!==n,c=t===null,l=t===t,u=Ku(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function uo(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=lo(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function fo(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=nn(a-o,0),u=$e(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function po(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=nn(a-s,0),d=$e(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function mo(e,t){var n=-1,r=e.length;for(t||=$e(r);++n<r;)t[n]=e[n];return t}function ho(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?Ti(r,c,l):bi(r,c,l)}return r}function go(e,t){return ho(e,rs(e),t)}function _o(e,t){return ho(e,is(e),t)}function vo(e,t){return function(n,r){var i=hu(n)?On:Si,a=t?t():{};return i(n,e,Qo(r,2),a)}}function yo(e){return ja(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&hs(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=_t(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function bo(e,t){return function(n,r){if(n==null)return n;if(!_u(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=_t(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function xo(e){return function(t,n,r){for(var i=-1,a=_t(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function So(e,t,n){var r=t&_,i=To(e);function a(){return(this&&this!==hn&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function Co(e){return function(t){t=od(t);var r=fr(t)?Cr(t):n,i=r?r[0]:t.charAt(0),a=r?to(r,1).join(``):t.slice(1);return i[e]()+a}}function wo(e){return function(t){return In(Of(ef(t).replace(B,``)),e,``)}}function To(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Fr(e.prototype),r=e.apply(n,t);return ju(r)?r:n}}function Eo(e,t,r){var i=To(e);function a(){for(var o=arguments.length,s=$e(o),c=o,l=Zo(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:_r(s,l);return o-=u.length,o<r?G(e,t,ko,a.placeholder,n,s,u,n,n,r-o):Dn(this&&this!==hn&&this instanceof a?i:e,this,s)}return a}function Do(e){return function(t,r,i){var a=_t(t);if(!_u(t)){var o=Qo(r,3);t=Od(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function Oo(e){return Ko(function(t){var r=t.length,i=r,a=Lr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if(typeof s!=`function`)throw new bt(o);if(a&&!c&&Xo(s)==`wrapper`)var c=new Lr([],!0)}for(i=c?i:r;++i<r;){s=t[i];var l=Xo(s),u=l==`wrapper`?Yo(s):n;c=u&&vs(u[0])&&u[1]==(w|b|S|T)&&!u[4].length&&u[9]==1?c[Xo(u[0])].apply(c,u[3]):s.length==1&&vs(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&e.length==1&&hu(n))return c.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}})}function ko(e,t,r,i,a,o,s,c,l,u){var d=t&w,f=t&_,p=t&v,m=t&(b|x),h=t&E,g=p?n:To(e);function y(){for(var n=arguments.length,_=$e(n),v=n;v--;)_[v]=arguments[v];if(m)var b=Zo(y),x=sr(_,b);if(i&&(_=fo(_,i,a,m)),o&&(_=po(_,o,s,m)),n-=x,m&&n<u){var S=_r(_,b);return G(e,t,ko,y.placeholder,r,_,S,c,l,u-n)}var C=f?r:this,w=p?C[e]:e;return n=_.length,c?_=As(_,c):h&&n>1&&_.reverse(),d&&l<n&&(_.length=l),this&&this!==hn&&this instanceof y&&(w=g||To(w)),w.apply(C,_)}return y}function Ao(e,t){return function(n,r){return $i(n,e,t(r),{})}}function jo(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=Ua(r),i=Ua(i)):(r=Ha(r),i=Ha(i)),a=e(r,i)}return a}}function Mo(e){return Ko(function(t){return t=Pn(t,nr(Qo())),ja(function(n){var r=this;return e(t,function(e){return Dn(e,r,n)})})})}function No(e,t){t=t===n?` `:Ua(t);var r=t.length;if(r<2)return r?Aa(t,e):t;var i=Aa(t,Jt(e/Sr(t)));return fr(t)?to(Cr(i),0,e).join(``):i.slice(0,e)}function Po(e,t,n,r){var i=t&_,a=To(e);function o(){for(var t=-1,s=arguments.length,c=-1,l=r.length,u=$e(l+s),d=this&&this!==hn&&this instanceof o?a:e;++c<l;)u[c]=r[c];for(;s--;)u[c++]=arguments[++t];return Dn(d,i?n:this,u)}return o}function Fo(e){return function(t,r,i){return i&&typeof i!=`number`&&hs(t,r,i)&&(r=i=n),t=ed(t),r===n?(r=t,t=0):r=ed(r),i=i===n?t<r?1:-1:ed(i),ka(t,r,i,e)}}function Io(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=rd(t),n=rd(n)),e(t,n)}}function G(e,t,r,i,a,o,s,c,l,u){var d=t&b,f=d?s:n,p=d?n:s,m=d?o:n,h=d?n:o;t|=d?S:C,t&=~(d?C:S),t&y||(t&=~(_|v));var g=[e,t,a,m,f,h,p,c,l,u],x=r.apply(n,g);return vs(e)&&Ms(x,g),x.placeholder=i,Fs(x,e,t)}function K(e){var t=gt[e];return function(e,n){if(e=rd(e),n=n==null?0:cn(td(n),292),n&&$t(e)){var r=(od(e)+`e`).split(`e`);return r=(od(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var Lo=yn&&1/vr(new yn([,-0]))[1]==A?function(e){return new yn(e)}:Gf;function Ro(e){return function(t){var n=as(t);return n==me?hr(t):n==xe?yr(t):er(t,e(t))}}function zo(e,t,r,i,a,s,c,l){var u=t&v;if(!u&&typeof e!=`function`)throw new bt(o);var d=i?i.length:0;if(d||(t&=~(S|C),i=a=n),c=c===n?c:nn(td(c),0),l=l===n?l:td(l),d-=a?a.length:0,t&C){var f=i,p=a;i=a=n}var m=u?n:Yo(e),h=[e,t,r,i,a,f,p,s,c,l];if(m&&Ts(h,m),e=h[0],t=h[1],r=h[2],i=h[3],a=h[4],l=h[9]=h[9]===n?u?0:e.length:nn(h[9]-d,0),!l&&t&(b|x)&&(t&=~(b|x)),!t||t==_)var g=So(e,t,r);else g=t==b||t==x?Eo(e,t,l):(t==S||t==(_|S))&&!a.length?Po(e,t,r,i):ko.apply(n,h);return Fs((m?Fa:Ms)(g,h),e,t)}function Bo(e,t,r,i){return e===n||du(e,Ct[r])&&!Et.call(i,r)?t:e}function Vo(e,t,r,i,a,o){return ju(e)&&ju(t)&&(o.set(t,e),ya(e,t,n,Vo,o),o.delete(t)),e}function Ho(e){return Vu(e)?n:e}function Uo(e,t,r,i,a,o){var s=r&h,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&g?new oi:n;for(o.set(e,t),o.set(t,e);++f<c;){var _=e[f],v=t[f];if(i)var y=s?i(v,_,f,t,e,o):i(_,v,f,e,t,o);if(y!==n){if(y)continue;p=!1;break}if(m){if(!Rn(t,function(e,t){if(!ir(m,t)&&(_===e||a(_,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(_===v||a(_,v,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function Wo(e,t,n,r,i,a,o){switch(n){case De:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!a(new Ft(e),new Ft(t)));case le:case I:case he:return du(+e,+t);case de:return e.name==t.name&&e.message==t.message;case be:case Se:return e==t+``;case me:var s=hr;case xe:var c=r&h;if(s||=vr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=g,o.set(e,t);var u=Uo(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ce:if(Nr)return Nr.call(e)==Nr.call(t)}return!1}function Go(e,t,r,i,a,o){var s=r&h,c=qo(e),l=c.length;if(l!=qo(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Et.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var g=s;++u<l;){d=c[u];var _=e[d],v=t[d];if(i)var y=s?i(v,_,d,t,e,o):i(_,v,d,e,t,o);if(!(y===n?_===v||a(_,v,r,i,o):y)){m=!1;break}g||=d==`constructor`}if(m&&!g){var b=e.constructor,x=t.constructor;b!=x&&`constructor`in e&&`constructor`in t&&!(typeof b==`function`&&b instanceof b&&typeof x==`function`&&x instanceof x)&&(m=!1)}return o.delete(e),o.delete(t),m}function Ko(e){return Ps(Os(e,n,nc),e+``)}function qo(e){return Ki(e,Od,rs)}function Jo(e){return Ki(e,kd,is)}var Yo=Bn?function(e){return Bn.get(e)}:Gf;function Xo(e){for(var t=e.name+``,n=Yn[t],r=Et.call(Yn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Zo(e){return(Et.call(U,`placeholder`)?U:e).placeholder}function Qo(){var e=U.iteratee||Rf;return e=e===Rf?fa:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(e,t){var n=e.__data__;return _s(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function es(e){for(var t=Od(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ss(i)]}return t}function ts(e,t){var r=dr(e,t);return ca(r)?r:n}function ns(e){var t=Et.call(e,Ut),r=e[Ut];try{e[Ut]=n;var i=!0}catch{}var a=kt.call(e);return i&&(t?e[Ut]=r:delete e[Ut]),a}var rs=Xt?function(e){return e==null?[]:(e=_t(e),jn(Xt(e),function(t){return zt.call(e,t)}))}:ep,is=Xt?function(e){for(var t=[];e;)Fn(t,rs(e)),e=Lt(e);return t}:ep,as=qi;(mn&&as(new mn(new ArrayBuffer(1)))!=De||gn&&as(new gn)!=me||_n&&as(_n.resolve())!=ve||yn&&as(new yn)!=xe||bn&&as(new bn)!=Te)&&(as=function(e){var t=qi(e),r=t==_e?e.constructor:n,i=r?Bs(r):``;if(i)switch(i){case br:return De;case Er:return me;case Dr:return ve;case Ar:return xe;case jr:return Te}return t});function os(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=cn(t,e+o);break;case`takeRight`:e=nn(e,t-o);break}}return{start:e,end:t}}function ss(e){var t=e.match(tt);return t?t[1].split(nt):[]}function cs(e,t,n){t=$a(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=zs(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Au(i)&&ms(o,i)&&(hu(e)||mu(e)))}function ls(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Et.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function us(e){return typeof e.constructor==`function`&&!xs(e)?Fr(Lt(e)):{}}function ds(e,t,n){var r=e.constructor;switch(t){case L:return io(e);case le:case I:return new r(+e);case De:return ao(e,n);case Oe:case ke:case Ae:case je:case Me:case Ne:case Pe:case Fe:case Ie:return co(e,n);case me:return new r;case he:case Se:return new r(e);case be:return oo(e);case xe:return new r;case Ce:return so(e)}}function fs(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(et,`{
3
3
  /* [wrapped with `+t+`] */
4
4
  `)}function ps(e){return hu(e)||mu(e)||!!(Vt&&e&&e[Vt])}function ms(e,t){var n=typeof e;return t??=j,!!t&&(n==`number`||n!=`symbol`&&dt.test(e))&&e>-1&&e%1==0&&e<t}function hs(e,t,n){if(!ju(n))return!1;var r=typeof t;return(r==`number`?_u(n)&&ms(t,n.length):r==`string`&&t in n)?du(n[t],e):!1}function gs(e,t){if(hu(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Ku(e)?!0:Je.test(e)||!qe.test(e)||t!=null&&e in _t(t)}function _s(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function vs(e){var t=Xo(e),n=U[t];if(typeof n!=`function`||!(t in Rr.prototype))return!1;if(e===n)return!0;var r=Yo(n);return!!r&&e===r[0]}function ys(e){return!!Ot&&Ot in e}var bs=wt?Ou:tp;function xs(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Ct)}function Ss(e){return e===e&&!ju(e)}function Cs(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==n||e in _t(r))}}function ws(e){var t=ql(e,function(e){return n.size===u&&n.clear(),e}),n=t.cache;return t}function Ts(e,t){var n=e[1],r=t[1],i=n|r,a=i<(_|v|w),o=r==w&&n==b||r==w&&n==T&&e[7].length<=t[8]||r==(w|T)&&t[7].length<=t[8]&&n==b;if(!(a||o))return e;r&_&&(e[2]=t[2],i|=n&_?0:y);var s=t[3];if(s){var c=e[3];e[3]=c?fo(c,s,t[4]):s,e[4]=c?_r(e[3],d):t[4]}return s=t[5],s&&(c=e[5],e[5]=c?po(c,s,t[6]):s,e[6]=c?_r(e[5],d):t[6]),s=t[7],s&&(e[7]=s),r&w&&(e[8]=e[8]==null?t[8]:cn(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function Es(e){var t=[];if(e!=null)for(var n in _t(e))t.push(n);return t}function Ds(e){return kt.call(e)}function Os(e,t,r){return t=nn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=nn(n.length-t,0),o=$e(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=$e(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),Dn(e,this,s)}}function ks(e,t){return t.length<2?e:Gi(e,Ra(t,0,-1))}function As(e,t){for(var r=e.length,i=cn(t.length,r),a=mo(e);i--;){var o=t[i];e[i]=ms(o,r)?a[o]:n}return e}function js(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var Ms=Is(Fa),Ns=qt||function(e,t){return hn.setTimeout(e,t)},Ps=Is(Ia);function Fs(e,t,n){var r=t+``;return Ps(e,fs(r,Vs(ss(r),n)))}function Is(e){var t=0,r=0;return function(){var i=ln(),a=k-(i-r);if(r=i,a>0){if(++t>=ee)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ls(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=Oa(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var Rs=ws(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Ye,function(e,n,r,i){t.push(r?i.replace(at,`$1`):n||e)}),t});function zs(e){if(typeof e==`string`||Ku(e))return e;var t=e+``;return t==`0`&&1/e==-A?`-0`:t}function Bs(e){if(e!=null){try{return Tt.call(e)}catch{}try{return e+``}catch{}}return``}function Vs(e,t){return H(ae,function(n){var r=`_.`+n[0];t&n[1]&&!Mn(e,r)&&e.push(r)}),e.sort()}function Hs(e){if(e instanceof Rr)return e.clone();var t=new Lr(e.__wrapped__,e.__chain__);return t.__actions__=mo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Us(e,t,r){t=(r?hs(e,t,r):t===n)?1:nn(td(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=$e(Jt(i/t));a<i;)s[o++]=Ra(e,a,a+=t);return s}function Ws(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function Gs(){var e=arguments.length;if(!e)return[];for(var t=$e(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Fn(hu(n)?mo(n):[n],zi(t,1))}var Ks=ja(function(e,t){return vu(e)?Mi(e,zi(t,1,vu,!0)):[]}),qs=ja(function(e,t){var r=pc(t);return vu(r)&&(r=n),vu(e)?Mi(e,zi(t,1,vu,!0),Qo(r,2)):[]}),Js=ja(function(e,t){var r=pc(t);return vu(r)&&(r=n),vu(e)?Mi(e,zi(t,1,vu,!0),n,r):[]});function Ys(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:td(t),Ra(e,t<0?0:t,i)):[]}function Xs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:td(t),t=i-t,Ra(e,0,t<0?0:t)):[]}function Zs(e,t){return e&&e.length?qa(e,Qo(t,3),!0,!0):[]}function Qs(e,t){return e&&e.length?qa(e,Qo(t,3),!0):[]}function $s(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&hs(e,t,n)&&(n=0,r=i),Li(e,t,n,r)):[]}function ec(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:td(n);return i<0&&(i=nn(r+i,0)),Un(e,Qo(t,3),i)}function tc(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=td(r),a=r<0?nn(i+a,0):cn(a,i-1)),Un(e,Qo(t,3),a,!0)}function nc(e){return e!=null&&e.length?zi(e,1):[]}function rc(e){return e!=null&&e.length?zi(e,A):[]}function ic(e,t){return e!=null&&e.length?(t=t===n?1:td(t),zi(e,t)):[]}function ac(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];Ti(r,i[0],i[1])}return r}function oc(e){return e&&e.length?e[0]:n}function sc(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:td(n);return i<0&&(i=nn(r+i,0)),Wn(e,t,i)}function cc(e){return e!=null&&e.length?Ra(e,0,-1):[]}var lc=ja(function(e){var t=Pn(e,Za);return t.length&&t[0]===e[0]?Qi(t):[]}),uc=ja(function(e){var t=pc(e),r=Pn(e,Za);return t===pc(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Qi(r,Qo(t,2)):[]}),dc=ja(function(e){var t=pc(e),r=Pn(e,Za);return t=typeof t==`function`?t:n,t&&r.pop(),r.length&&r[0]===e[0]?Qi(r,n,t):[]});function fc(e,t){return e==null?``:en.call(e,t)}function pc(e){var t=e==null?0:e.length;return t?e[t-1]:n}function mc(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=td(r),a=a<0?nn(i+a,0):cn(a,i-1)),t===t?xr(e,t,a):Un(e,Kn,a,!0)}function hc(e,t){return e&&e.length?xa(e,td(t)):n}var gc=ja(_c);function _c(e,t){return e&&e.length&&t&&t.length?Ea(e,t):e}function vc(e,t,n){return e&&e.length&&t&&t.length?Ea(e,t,Qo(n,2)):e}function yc(e,t,r){return e&&e.length&&t&&t.length?Ea(e,t,n,r):e}var bc=Ko(function(e,t){var n=e==null?0:e.length,r=Ei(e,t);return Da(e,Pn(t,function(e){return ms(e,n)?+e:e}).sort(lo)),r});function xc(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=Qo(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return Da(e,i),n}function Sc(e){return e==null?e:V.call(e)}function Cc(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&hs(e,t,r)?(t=0,r=i):(t=t==null?0:td(t),r=r===n?i:td(r)),Ra(e,t,r)):[]}function wc(e,t){return Ba(e,t)}function Tc(e,t,n){return Va(e,t,Qo(n,2))}function Ec(e,t){var n=e==null?0:e.length;if(n){var r=Ba(e,t);if(r<n&&du(e[r],t))return r}return-1}function Dc(e,t){return Ba(e,t,!0)}function Oc(e,t,n){return Va(e,t,Qo(n,2),!0)}function kc(e,t){if(e!=null&&e.length){var n=Ba(e,t,!0)-1;if(du(e[n],t))return n}return-1}function Ac(e){return e&&e.length?W(e):[]}function jc(e,t){return e&&e.length?W(e,Qo(t,2)):[]}function Mc(e){var t=e==null?0:e.length;return t?Ra(e,1,t):[]}function Nc(e,t,r){return e&&e.length?(t=r||t===n?1:td(t),Ra(e,0,t<0?0:t)):[]}function Pc(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:td(t),t=i-t,Ra(e,t<0?0:t,i)):[]}function Fc(e,t){return e&&e.length?qa(e,Qo(t,3),!1,!0):[]}function Ic(e,t){return e&&e.length?qa(e,Qo(t,3)):[]}var Lc=ja(function(e){return Wa(zi(e,1,vu,!0))}),Rc=ja(function(e){var t=pc(e);return vu(t)&&(t=n),Wa(zi(e,1,vu,!0),Qo(t,2))}),q=ja(function(e){var t=pc(e);return t=typeof t==`function`?t:n,Wa(zi(e,1,vu,!0),n,t)});function zc(e){return e&&e.length?Wa(e):[]}function Bc(e,t){return e&&e.length?Wa(e,Qo(t,2)):[]}function Vc(e,t){return t=typeof t==`function`?t:n,e&&e.length?Wa(e,n,t):[]}function Hc(e){if(!(e&&e.length))return[];var t=0;return e=jn(e,function(e){if(vu(e))return t=nn(e.length,t),!0}),$n(t,function(t){return Pn(e,Jn(t))})}function Uc(e,t){if(!(e&&e.length))return[];var r=Hc(e);return t==null?r:Pn(r,function(e){return Dn(t,n,e)})}var Wc=ja(function(e,t){return vu(e)?Mi(e,t):[]}),Gc=ja(function(e){return Ya(jn(e,vu))}),Kc=ja(function(e){var t=pc(e);return vu(t)&&(t=n),Ya(jn(e,vu),Qo(t,2))}),qc=ja(function(e){var t=pc(e);return t=typeof t==`function`?t:n,Ya(jn(e,vu),n,t)}),Jc=ja(Hc);function Yc(e,t){return Xa(e||[],t||[],bi)}function Xc(e,t){return Xa(e||[],t||[],Pa)}var Zc=ja(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,Uc(e,r)});function Qc(e){var t=U(e);return t.__chain__=!0,t}function $c(e,t){return t(e),e}function el(e,t){return t(e)}var tl=Ko(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return Ei(t,e)};return t>1||this.__actions__.length||!(i instanceof Rr)||!ms(r)?this.thru(a):(i=i.slice(r,+r+ +!!t),i.__actions__.push({func:el,args:[a],thisArg:n}),new Lr(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e}))});function nl(){return Qc(this)}function rl(){return new Lr(this.value(),this.__chain__)}function il(){this.__values__===n&&(this.__values__=$u(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}}function al(){return this}function ol(e){for(var t,r=this;r instanceof Ir;){var i=Hs(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t}function sl(){var e=this.__wrapped__;if(e instanceof Rr){var t=e;return this.__actions__.length&&(t=new Rr(this)),t=t.reverse(),t.__actions__.push({func:el,args:[Sc],thisArg:n}),new Lr(t,this.__chain__)}return this.thru(Sc)}function cl(){return Ja(this.__wrapped__,this.__actions__)}var ll=vo(function(e,t,n){Et.call(e,n)?++e[n]:Ti(e,n,1)});function ul(e,t,r){var i=hu(e)?An:Fi;return r&&hs(e,t,r)&&(t=n),i(e,Qo(t,3))}function dl(e,t){return(hu(e)?jn:Ri)(e,Qo(t,3))}var fl=Do(ec),pl=Do(tc);function ml(e,t){return zi(Cl(e,t),1)}function hl(e,t){return zi(Cl(e,t),A)}function gl(e,t,r){return r=r===n?1:td(r),zi(Cl(e,t),r)}function _l(e,t){return(hu(e)?H:Ni)(e,Qo(t,3))}function vl(e,t){return(hu(e)?kn:Pi)(e,Qo(t,3))}var yl=vo(function(e,t,n){Et.call(e,n)?e[n].push(t):Ti(e,n,[t])});function bl(e,t,n,r){e=_u(e)?e:qd(e),n=n&&!r?td(n):0;var i=e.length;return n<0&&(n=nn(i+n,0)),Gu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Wn(e,t,n)>-1}var xl=ja(function(e,t,n){var r=-1,i=typeof t==`function`,a=_u(e)?$e(e.length):[];return Ni(e,function(e){a[++r]=i?Dn(t,e,n):ea(e,t,n)}),a}),Sl=vo(function(e,t,n){Ti(e,n,t)});function Cl(e,t){return(hu(e)?Pn:ga)(e,Qo(t,3))}function wl(e,t,r,i){return e==null?[]:(hu(t)||(t=t==null?[]:[t]),r=i?n:r,hu(r)||(r=r==null?[]:[r]),Sa(e,t,r))}var Tl=vo(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]});function El(e,t,n){var r=hu(e)?In:Xn,i=arguments.length<3;return r(e,Qo(t,4),n,i,Ni)}function Dl(e,t,n){var r=hu(e)?Ln:Xn,i=arguments.length<3;return r(e,Qo(t,4),n,i,Pi)}function Ol(e,t){return(hu(e)?jn:Ri)(e,Jl(Qo(t,3)))}function kl(e){return(hu(e)?gi:Ma)(e)}function Al(e,t,r){return t=(r?hs(e,t,r):t===n)?1:td(t),(hu(e)?_i:Na)(e,t)}function jl(e){return(hu(e)?vi:La)(e)}function Ml(e){if(e==null)return 0;if(_u(e))return Gu(e)?Sr(e):e.length;var t=as(e);return t==me||t==xe?e.size:pa(e).length}function Nl(e,t,r){var i=hu(e)?Rn:za;return r&&hs(e,t,r)&&(t=n),i(e,Qo(t,3))}var Pl=ja(function(e,t){if(e==null)return[];var n=t.length;return n>1&&hs(e,t[0],t[1])?t=[]:n>2&&hs(t[0],t[1],t[2])&&(t=[t[0]]),Sa(e,zi(t,1),[])}),Fl=Kt||function(){return hn.Date.now()};function Il(e,t){if(typeof t!=`function`)throw new bt(o);return e=td(e),function(){if(--e<1)return t.apply(this,arguments)}}function Ll(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,zo(e,w,n,n,n,n,t)}function Rl(e,t){var r;if(typeof t!=`function`)throw new bt(o);return e=td(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var zl=ja(function(e,t,n){var r=_;if(n.length){var i=_r(n,Zo(zl));r|=S}return zo(e,r,t,n,i)}),Bl=ja(function(e,t,n){var r=_|v;if(n.length){var i=_r(n,Zo(Bl));r|=S}return zo(t,r,e,n,i)});function Vl(e,t,r){t=r?n:t;var i=zo(e,b,n,n,n,n,n,t);return i.placeholder=Vl.placeholder,i}function Hl(e,t,r){t=r?n:t;var i=zo(e,x,n,n,n,n,n,t);return i.placeholder=Hl.placeholder,i}function Ul(e,t,r){var i,a,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new bt(o);t=rd(t)||0,ju(r)&&(f=!!r.leading,p=`maxWait`in r,s=p?nn(rd(r.maxWait)||0,t):s,m=`trailing`in r?!!r.trailing:m);function h(t){var r=i,o=a;return i=a=n,d=t,c=e.apply(o,r),c}function g(e){return d=e,l=Ns(y,t),f?h(e):c}function _(e){var n=e-u,r=e-d,i=t-n;return p?cn(i,s-r):i}function v(e){var r=e-u,i=e-d;return u===n||r>=t||r<0||p&&i>=s}function y(){var e=Fl();if(v(e))return b(e);l=Ns(y,_(e))}function b(e){return l=n,m&&i?h(e):(i=a=n,c)}function x(){l!==n&&no(l),d=0,i=u=a=l=n}function S(){return l===n?c:b(Fl())}function C(){var e=Fl(),r=v(e);if(i=arguments,a=this,u=e,r){if(l===n)return g(u);if(p)return no(l),l=Ns(y,t),h(u)}return l===n&&(l=Ns(y,t)),c}return C.cancel=x,C.flush=S,C}var Wl=ja(function(e,t){return ji(e,1,t)}),Gl=ja(function(e,t,n){return ji(e,rd(t)||0,n)});function Kl(e){return zo(e,E)}function ql(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new bt(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(ql.Cache||ei),n}ql.Cache=ei;function Jl(e){if(typeof e!=`function`)throw new bt(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Yl(e){return Rl(2,e)}var Xl=eo(function(e,t){t=t.length==1&&hu(t[0])?Pn(t[0],nr(Qo())):Pn(zi(t,1),nr(Qo()));var n=t.length;return ja(function(r){for(var i=-1,a=cn(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return Dn(e,this,r)})}),Zl=ja(function(e,t){return zo(e,S,n,t,_r(t,Zo(Zl)))}),Ql=ja(function(e,t){return zo(e,C,n,t,_r(t,Zo(Ql)))}),$l=Ko(function(e,t){return zo(e,T,n,n,n,t)});function eu(e,t){if(typeof e!=`function`)throw new bt(o);return t=t===n?t:td(t),ja(e,t)}function tu(e,t){if(typeof e!=`function`)throw new bt(o);return t=t==null?0:nn(td(t),0),ja(function(n){var r=n[t],i=to(n,0,t);return r&&Fn(i,r),Dn(e,this,i)})}function nu(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw new bt(o);return ju(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),Ul(e,t,{leading:r,maxWait:t,trailing:i})}function ru(e){return Ll(e,1)}function iu(e,t){return Zl(Qa(t),e)}function au(){if(!arguments.length)return[];var e=arguments[0];return hu(e)?e:[e]}function ou(e){return Oi(e,m)}function su(e,t){return t=typeof t==`function`?t:n,Oi(e,m,t)}function cu(e){return Oi(e,f|m)}function lu(e,t){return t=typeof t==`function`?t:n,Oi(e,f|m,t)}function uu(e,t){return t==null||Ai(e,t,Od(t))}function du(e,t){return e===t||e!==e&&t!==t}var fu=Io(Ji),pu=Io(function(e,t){return e>=t}),mu=ta(function(){return arguments}())?ta:function(e){return Mu(e)&&Et.call(e,`callee`)&&!zt.call(e,`callee`)},hu=$e.isArray,gu=xn?nr(xn):na;function _u(e){return e!=null&&Au(e.length)&&!Ou(e)}function vu(e){return Mu(e)&&_u(e)}function yu(e){return e===!0||e===!1||Mu(e)&&qi(e)==le}var bu=Zt||tp,xu=Sn?nr(Sn):ra;function Su(e){return Mu(e)&&e.nodeType===1&&!Vu(e)}function Cu(e){if(e==null)return!0;if(_u(e)&&(hu(e)||typeof e==`string`||typeof e.splice==`function`||bu(e)||qu(e)||mu(e)))return!e.length;var t=as(e);if(t==me||t==xe)return!e.size;if(xs(e))return!pa(e).length;for(var n in e)if(Et.call(e,n))return!1;return!0}function wu(e,t){return ia(e,t)}function Tu(e,t,r){r=typeof r==`function`?r:n;var i=r?r(e,t):n;return i===n?ia(e,t,n,r):!!i}function Eu(e){if(!Mu(e))return!1;var t=qi(e);return t==de||t==ue||typeof e.message==`string`&&typeof e.name==`string`&&!Vu(e)}function Du(e){return typeof e==`number`&&$t(e)}function Ou(e){if(!ju(e))return!1;var t=qi(e);return t==fe||t==pe||t==ce||t==ye}function ku(e){return typeof e==`number`&&e==td(e)}function Au(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=j}function ju(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function Mu(e){return typeof e==`object`&&!!e}var Nu=Cn?nr(Cn):oa;function Pu(e,t){return e===t||sa(e,t,es(t))}function Fu(e,t,r){return r=typeof r==`function`?r:n,sa(e,t,es(t),r)}function Iu(e){return Bu(e)&&e!=+e}function Lu(e){if(bs(e))throw new mt(a);return ca(e)}function Ru(e){return e===null}function zu(e){return e==null}function Bu(e){return typeof e==`number`||Mu(e)&&qi(e)==he}function Vu(e){if(!Mu(e)||qi(e)!=_e)return!1;var t=Lt(e);if(t===null)return!0;var n=Et.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Tt.call(n)==At}var Hu=wn?nr(wn):la;function Uu(e){return ku(e)&&e>=-j&&e<=j}var Wu=Tn?nr(Tn):ua;function Gu(e){return typeof e==`string`||!hu(e)&&Mu(e)&&qi(e)==Se}function Ku(e){return typeof e==`symbol`||Mu(e)&&qi(e)==Ce}var qu=En?nr(En):da;function Ju(e){return e===n}function Yu(e){return Mu(e)&&as(e)==Te}function Xu(e){return Mu(e)&&qi(e)==Ee}var Zu=Io(ha),Qu=Io(function(e,t){return e<=t});function $u(e){if(!e)return[];if(_u(e))return Gu(e)?Cr(e):mo(e);if(Ht&&e[Ht])return mr(e[Ht]());var t=as(e);return(t==me?hr:t==xe?vr:qd)(e)}function ed(e){return e?(e=rd(e),e===A||e===-A?(e<0?-1:1)*M:e===e?e:0):e===0?e:0}function td(e){var t=ed(e),n=t%1;return t===t?n?t-n:t:0}function nd(e){return e?Di(td(e),0,P):0}function rd(e){if(typeof e==`number`)return e;if(Ku(e))return N;if(ju(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=ju(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=tr(e);var n=lt.test(e);return n||R.test(e)?pn(e.slice(2),n?2:8):ct.test(e)?N:+e}function id(e){return ho(e,kd(e))}function ad(e){return e?Di(td(e),-j,j):e===0?e:0}function od(e){return e==null?``:Ua(e)}var sd=yo(function(e,t){if(xs(t)||_u(t)){ho(t,Od(t),e);return}for(var n in t)Et.call(t,n)&&bi(e,n,t[n])}),cd=yo(function(e,t){ho(t,kd(t),e)}),ld=yo(function(e,t,n,r){ho(t,kd(t),e,r)}),ud=yo(function(e,t,n,r){ho(t,Od(t),e,r)}),dd=Ko(Ei);function fd(e,t){var n=Fr(e);return t==null?n:Ci(n,t)}var pd=ja(function(e,t){e=_t(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&hs(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=kd(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===n||du(d,Ct[u])&&!Et.call(e,u))&&(e[u]=o[u])}return e}),md=ja(function(e){return e.push(n,Vo),Dn(Nd,n,e)});function hd(e,t){return Hn(e,Qo(t,3),Hi)}function gd(e,t){return Hn(e,Qo(t,3),Ui)}function _d(e,t){return e==null?e:Bi(e,Qo(t,3),kd)}function J(e,t){return e==null?e:Vi(e,Qo(t,3),kd)}function vd(e,t){return e&&Hi(e,Qo(t,3))}function yd(e,t){return e&&Ui(e,Qo(t,3))}function bd(e){return e==null?[]:Wi(e,Od(e))}function xd(e){return e==null?[]:Wi(e,kd(e))}function Sd(e,t,r){var i=e==null?n:Gi(e,t);return i===n?r:i}function Cd(e,t){return e!=null&&cs(e,t,Yi)}function wd(e,t){return e!=null&&cs(e,t,Xi)}var Td=Ao(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=kt.call(t)),e[t]=n},Nf(Lf)),Ed=Ao(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=kt.call(t)),Et.call(e,t)?e[t].push(n):e[t]=[n]},Qo),Dd=ja(ea);function Od(e){return _u(e)?hi(e):pa(e)}function kd(e){return _u(e)?hi(e,!0):ma(e)}function Ad(e,t){var n={};return t=Qo(t,3),Hi(e,function(e,r,i){Ti(n,t(e,r,i),e)}),n}function jd(e,t){var n={};return t=Qo(t,3),Hi(e,function(e,r,i){Ti(n,r,t(e,r,i))}),n}var Md=yo(function(e,t,n){ya(e,t,n)}),Nd=yo(function(e,t,n,r){ya(e,t,n,r)}),Pd=Ko(function(e,t){var n={};if(e==null)return n;var r=!1;t=Pn(t,function(t){return t=$a(t,e),r||=t.length>1,t}),ho(e,Jo(e),n),r&&(n=Oi(n,f|p|m,Ho));for(var i=t.length;i--;)Ga(n,t[i]);return n});function Fd(e,t){return Ld(e,Jl(Qo(t)))}var Id=Ko(function(e,t){return e==null?{}:Ca(e,t)});function Ld(e,t){if(e==null)return{};var n=Pn(Jo(e),function(e){return[e]});return t=Qo(t),wa(e,n,function(e,n){return t(e,n[0])})}function Rd(e,t,r){t=$a(t,e);var i=-1,a=t.length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[zs(t[i])];o===n&&(i=a,o=r),e=Ou(o)?o.call(e):o}return e}function zd(e,t,n){return e==null?e:Pa(e,t,n)}function Bd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Pa(e,t,r,i)}var Vd=Ro(Od),Hd=Ro(kd);function Ud(e,t,n){var r=hu(e),i=r||bu(e)||qu(e);if(t=Qo(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:ju(e)&&Ou(a)?Fr(Lt(e)):{}}return(i?H:Hi)(e,function(e,r,i){return t(n,e,r,i)}),n}function Wd(e,t){return e==null?!0:Ga(e,t)}function Gd(e,t,n){return e==null?e:Ka(e,t,Qa(n))}function Kd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Ka(e,t,Qa(r),i)}function qd(e){return e==null?[]:rr(e,Od(e))}function Jd(e){return e==null?[]:rr(e,kd(e))}function Yd(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=rd(r),r=r===r?r:0),t!==n&&(t=rd(t),t=t===t?t:0),Di(rd(e),t,r)}function Xd(e,t,r){return t=ed(t),r===n?(r=t,t=0):r=ed(r),e=rd(e),Zi(e,t,r)}function Zd(e,t,r){if(r&&typeof r!=`boolean`&&hs(e,t,r)&&(t=r=n),r===n&&(typeof t==`boolean`?(r=t,t=n):typeof e==`boolean`&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=ed(e),t===n?(t=e,e=0):t=ed(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=dn();return cn(e+a*(t-e+fn(`1e-`+((a+``).length-1))),t)}return Oa(e,t)}var Qd=wo(function(e,t,n){return t=t.toLowerCase(),e+(n?$d(t):t)});function $d(e){return Df(od(e).toLowerCase())}function ef(e){return e=od(e),e&&e.replace(z,cr).replace(Qt,``)}function tf(e,t,r){e=od(e),t=Ua(t);var i=e.length;r=r===n?i:Di(td(r),0,i);var a=r;return r-=t.length,r>=0&&e.slice(r,a)==t}function nf(e){return e=od(e),e&&Ue.test(e)?e.replace(Ve,lr):e}function rf(e){return e=od(e),e&&Ze.test(e)?e.replace(Xe,`\\$&`):e}var af=wo(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),of=wo(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),sf=Co(`toLowerCase`);function cf(e,t,n){e=od(e),t=td(t);var r=t?Sr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return No(Yt(i),n)+e+No(Jt(i),n)}function lf(e,t,n){e=od(e),t=td(t);var r=t?Sr(e):0;return t&&r<t?e+No(t-r,n):e}function uf(e,t,n){e=od(e),t=td(t);var r=t?Sr(e):0;return t&&r<t?No(t-r,n)+e:e}function df(e,t,n){return n||t==null?t=0:t&&=+t,un(od(e).replace(Qe,``),t||0)}function ff(e,t,r){return t=(r?hs(e,t,r):t===n)?1:td(t),Aa(od(e),t)}function pf(){var e=arguments,t=od(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var mf=wo(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()});function hf(e,t,r){return r&&typeof r!=`number`&&hs(e,t,r)&&(t=r=n),r=r===n?P:r>>>0,r?(e=od(e),e&&(typeof t==`string`||t!=null&&!Hu(t))&&(t=Ua(t),!t&&fr(e))?to(Cr(e),0,r):e.split(t,r)):[]}var gf=wo(function(e,t,n){return e+(n?` `:``)+Df(t)});function _f(e,t,n){return e=od(e),n=n==null?0:Di(td(n),0,e.length),t=Ua(t),e.slice(n,n+t.length)==t}function vf(e,t,r){var i=U.templateSettings;r&&hs(e,t,r)&&(t=n),e=od(e),t=ud({},t,i,Bo);var a=ud({},t.imports,i.imports,Bo),o=Od(a),l=rr(a,o);H(o,function(e){if(it.test(e))throw new mt(c)});var u,d,f=0,p=t.interpolate||ft,m=`__p += '`,h=vt((t.escape||ft).source+`|`+p.source+`|`+(p===Ke?ot:ft).source+`|`+(t.evaluate||ft).source+`|$`,`g`),g=`//# sourceURL=`+(Et.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++an+`]`)+`
5
5
  `;e.replace(h,function(t,n,r,i,a,o){return r||=i,m+=e.slice(f,o).replace(pt,ur),n&&(u=!0,m+=`' +
@@ -142,7 +142,7 @@ export default defineCommandMenuItem({
142
142
  label: '${e}',
143
143
  availabilityType: 'GLOBAL',
144
144
  });
145
- `,ae=({name:t,type:n})=>{let r=n===e.Y.DASHBOARD?e.z.GRID:e.z.VERTICAL_LIST;return`import {
145
+ `,ae=({name:t,type:n})=>{let r=n===e.U.DASHBOARD?e.K.GRID:e.K.VERTICAL_LIST;return`import {
146
146
  definePageLayout,
147
147
  PageLayoutTabLayoutMode,
148
148
  PageLayoutType,
@@ -340,10 +340,10 @@ export default defineTimelineActivityType({
340
340
  name: '${e}',
341
341
  label: '${e}',
342
342
  });
343
- `,he=`src/application.config.ts`,ge=`src`,_e=class{async execute(i,a){try{let o=await E(t.Dt),s=i??await this.getEntity(),c=this.getFolderName(s),l=a?(0,n.join)(t.Dt,a):(0,n.join)(t.Dt,ge,c);await t.vt(l);let{name:d,file:f}=await this.getEntityData(s,o),p=(0,n.join)(l,this.getFileName(d,s));if(await t.yt(p)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(p,f),console.log(u.default.green(`✓ Created ${c}:`),u.default.cyan((0,n.relative)(t.Dt,p))),s===e.c.Object&&await this.promptAndCreateObjectCompanions({objectName:d,applicationUniversalIdentifier:o,customPath:a}),s===e.c.ConnectionProvider&&await this.registerConnectionProviderServerVariables(d)}catch(e){console.error(u.default.red(`Add new entity failed:`),e instanceof Error?e.message:e),process.exit(1)}}async getEntityData(n,r){switch(n){case e.c.Object:{let e=await this.getObjectData(),t=e.nameSingular,n=(0,a.v4)(),r=(0,a.v4)();return this.lastObjectUniversalIdentifier=n,this.lastNameFieldUniversalIdentifier=r,this.lastObjectLabelSingular=e.labelSingular,{name:t,file:F({data:e,name:t,universalIdentifier:n,nameFieldUniversalIdentifier:r})}}case e.c.Field:{let e=await this.getFieldData(),t=e.name;return{name:t,file:A({data:e,name:t})}}case e.c.LogicFunction:{let e=await this.getEntityName(n);return{name:e,file:N({name:e})}}case e.c.FrontComponent:{let e=await this.getEntityName(n);return{name:e,file:M({name:e})}}case e.c.Role:{let e=await this.getEntityName(n);return{name:e,file:ce({name:e})}}case e.c.Skill:{let e=await this.getEntityName(n);return{name:e,file:ue({name:e})}}case e.c.Agent:{let e=await this.getEntityName(n);return{name:e,file:le({name:e})}}case e.c.ConnectionProvider:{let e=await this.getEntityName(n);return{name:e,file:I({name:e})}}case e.c.View:{let e=(await this.getViewData()).name;return{name:e,file:fe({name:e,applicationUniversalIdentifier:r})}}case e.c.ViewField:return{name:await this.getEntityName(n),file:pe({})};case e.c.NavigationMenuItem:{let e=await this.getEntityName(n);return{name:e,file:P({name:e})}}case e.c.PageLayout:{let t=await this.getEntityName(n),{type:r}=await d.default.prompt([{type:`select`,name:`type`,message:`Select the page layout type:`,choices:Object.values(e.Y)}]);return{name:t,file:ae({name:t,type:r})}}case e.c.PageLayoutTab:{let e=await this.getEntityName(n);return{name:e,file:oe({name:e})}}case e.c.CommandMenuItem:{let e=await this.getEntityName(n);return{name:e,file:ie({name:e})}}case e.c.TimelineActivityType:{let e=await this.getEntityName(n);return{name:e,file:me({name:e})}}default:t.Ct(n)}}async promptAndCreateObjectCompanions({objectName:i,applicationUniversalIdentifier:o,customPath:s}){let{createCompanions:c}=await d.default.prompt([{type:`confirm`,name:`createCompanions`,message:`Also create a view, navigation menu item, and record page layout for this object? (recommended)`,default:!0}]);if(!c||!this.lastObjectUniversalIdentifier)return;let l=(0,a.v4)(),f=(0,a.v4)(),p=fe({name:`all-${j(i)}`,universalIdentifier:l,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,applicationUniversalIdentifier:o,fields:this.lastNameFieldUniversalIdentifier?[{fieldMetadataUniversalIdentifier:this.lastNameFieldUniversalIdentifier,position:0,isVisible:!0,size:200}]:[]}),m=s?(0,n.join)(t.Dt,s):(0,n.join)(t.Dt,ge,this.getFolderName(e.c.View));await t.vt(m);let h=(0,n.join)(m,`all-${j(i)}.ts`);if(await t.yt(h)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(h,p),console.log(u.default.green(`✓ Created view:`),u.default.cyan((0,n.relative)(t.Dt,h)));let g=this.buildRecordPageFieldsViewFields(this.lastNameFieldUniversalIdentifier),_=fe({name:`${j(i)}-record-page-fields`,universalIdentifier:f,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,applicationUniversalIdentifier:o,type:e.j.FIELDS_WIDGET,fields:g}),v=(0,n.join)(m,`${j(i)}-record-page-fields.ts`);if(await t.yt(v)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(v,_),console.log(u.default.green(`✓ Created record-page-fields view:`),u.default.cyan((0,n.relative)(t.Dt,v)));let y=P({name:i,type:`OBJECT`,targetObjectUniversalIdentifier:this.lastObjectUniversalIdentifier}),b=s?(0,n.join)(t.Dt,s):(0,n.join)(t.Dt,ge,this.getFolderName(e.c.NavigationMenuItem));await t.vt(b);let x=(0,n.join)(b,`${j(i)}.ts`);if(await t.yt(x)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(x,y),console.log(u.default.green(`✓ Created navigation menu item:`),u.default.cyan((0,n.relative)(t.Dt,x)));let S=se({objectLabelSingular:this.lastObjectLabelSingular??i,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,fieldsWidgetViewUniversalIdentifier:f}),C=s?(0,n.join)(t.Dt,s):(0,n.join)(t.Dt,ge,this.getFolderName(e.c.PageLayout));await t.vt(C);let w=(0,n.join)(C,`${j(i)}-record-page-layout.ts`);if(await t.yt(w)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(w,S),console.log(u.default.green(`✓ Created record page layout:`),u.default.cyan((0,n.relative)(t.Dt,w)))}async registerConnectionProviderServerVariables(e){let r=j(e).toUpperCase().replace(/-/g,`_`),i=[{name:`${r}_CLIENT_ID`,description:`OAuth client ID issued by the third-party provider. Filled in once by the server admin on the application registration.`,isSecret:!1},{name:`${r}_CLIENT_SECRET`,description:`OAuth client secret issued by the third-party provider. Stored encrypted; never echoed in API responses.`,isSecret:!0}],a=await te({projectRoot:t.Dt,variables:i});switch(a.status){case`appended`:case`created`:console.log(u.default.green(`✓ Added ${i.map(e=>e.name).join(` + `)} to defineApplication.serverVariables:`),u.default.cyan((0,n.relative)(t.Dt,a.file)));break;case`skipped-existing`:console.log(u.default.dim(` (${i.map(e=>e.name).join(` / `)} already declared on defineApplication.serverVariables)`));break;case`skipped-no-config`:case`skipped-no-app-call`:console.log(u.default.yellow(`! Couldn't auto-update ${he}. Add these manually to defineApplication.serverVariables:\n`+i.map(e=>` ${e.name}: { description: '...', isSecret: ${e.isSecret}, isRequired: true },`).join(`
344
- `)));break}}buildRecordPageFieldsViewFields(e){let t=[`createdAt`,`updatedAt`,`createdBy`,`updatedBy`].map(e=>({defaultFieldName:e,isVisible:!0,size:200}));return(e?[{fieldMetadataUniversalIdentifier:e,isVisible:!0,size:200},...t]:t).map((e,t)=>({...e,position:t}))}async getEntity(){let{entity:t}=await d.default.prompt([{type:`select`,name:`entity`,message:`What entity do you want to create?`,default:``,choices:Object.values(e.c)}]);return t}async handleFileExist(){return await d.default.prompt([{type:`confirm`,name:`overwrite`,message:`File already exists. Do you want to overwrite it?`,default:!1}])}async getEntityName(e){let{name:t}=await d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your new ${e}:`,default:``,validate:t=>t.length===0?`${e} name is required`:!0}]);return t}async getFieldData(){let t=t=>t===e.X.RELATION||t===e.X.MORPH_RELATION;return d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your field:`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`label`,message:`Enter a label for your field:`,default:e=>O(e.name),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`select`,name:`type`,message:`Select the field type:`,choices:Object.values(e.X),default:e.X.TEXT},{type:`input`,name:`objectUniversalIdentifier`,message:`Enter the universalIdentifier of the object this field belongs to:`,default:`fill-later`,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`description`,message:`Enter a description for your field (optional):`,default:``},{type:`input`,name:`relationTargetObjectMetadataUniversalIdentifier`,message:`Enter the universalIdentifier of the target object of the relation:`,default:`fill-later`,when:e=>t(e.type),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`relationTargetFieldMetadataUniversalIdentifier`,message:`Enter the universalIdentifier of the target field on the related object:`,default:`fill-later`,when:e=>t(e.type),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`select`,name:`relationType`,message:`Select the relation type:`,choices:Object.values(e.B),default:e.B.ONE_TO_MANY,when:e=>t(e.type)},{type:`select`,name:`onDelete`,message:`Select the onDelete behavior:`,choices:Object.values(e.V),default:e.V.CASCADE,when:e=>t(e.type)}])}async getObjectData(){return d.default.prompt([{type:`input`,name:`nameSingular`,message:`Enter a name singular for your object (eg: company):`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`namePlural`,message:`Enter a name plural for your object (eg: companies):`,default:``,validate:(e,t)=>e.trim()===t?.nameSingular.trim()?`Name plural must be different from name singular`:!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`labelSingular`,message:`Enter a label singular for your object:`,default:e=>O(e.nameSingular),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`labelPlural`,message:`Enter a label plural for your object:`,default:e=>O(e.namePlural),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0}])}async getViewData(){return d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your view:`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`objectUniversalIdentifier`,message:`Enter the universalIdentifier of the object this view belongs to:`,default:`fill-later`,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0}])}getFolderName(e){return`${j(e)}s`}getFileName(t,n){switch(n){case e.c.FrontComponent:return`${j(t)}.tsx`;default:return`${j(t)}.ts`}}},ve=class{async execute(e){let n=e.appPath??t.Dt;await y(n),console.log(u.default.blue(`Building application...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.G({appPath:n,tarball:e.tarball,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1)),console.log(u.default.green(`✓ Build succeeded (${r.data.fileCount} file${r.data.fileCount===1?``:`s`})`)),console.log(u.default.gray(`Output: ${r.data.outputDir}`)),r.data.tarballPath&&console.log(u.default.gray(`Tarball: ${r.data.tarballPath}`))}},ye=class{async execute({appPath:n=t.Dt,postInstall:r=!1,preInstall:i=!1,uninstall:a=!1,functionUniversalIdentifier:o,functionName:s,payload:c=`{}`}){let l;try{l=JSON.parse(c)}catch{console.error(u.default.red(`Invalid JSON payload. Please provide valid JSON.`)),process.exit(1)}let d=r?`post install`:i?`pre install`:a?`uninstall`:o??s,f=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Executing function "${d}" on ${f}...`)),console.log(u.default.gray(` Payload: ${JSON.stringify(l)}\n`));let p=await t._(r?{appPath:n,postInstall:!0,payload:l}:i?{appPath:n,preInstall:!0,payload:l}:a?{appPath:n,uninstall:!0,payload:l}:o?{appPath:n,functionUniversalIdentifier:o,payload:l}:{appPath:n,functionName:s,payload:l});if(!p.success){switch(p.error.code){case t.K.MANIFEST_NOT_FOUND:console.error(u.default.red(`Failed to build manifest.`));break;case t.J.FETCH_FUNCTIONS_FAILED:console.error(u.default.red(`Failed to fetch functions:`),p.error.message);break;case t.J.FUNCTION_NOT_FOUND:{console.error(u.default.red(p.error.message),`
345
- `);let e=p.error.details?.availableFunctions??[];e.length>0?(console.log(u.default.cyan(`Available functions:`)),e.forEach(e=>{console.log(` - ${u.default.white(e.name)} (${e.universalIdentifier})`)})):console.log(u.default.yellow("No functions found for this application. Have you synced your app with `twenty dev`?"));break}case t.J.EXECUTION_FAILED:console.error(u.default.red(`Execution failed:`),p.error.message);break;default:console.error(u.default.red(p.error.message))}process.exit(1)}let m=p.data;console.log(u.default.cyan(`─`.repeat(60))),console.log(u.default.cyan(`Execution Result`)),console.log(u.default.cyan(`─`.repeat(60)));let h=m.status===`SUCCESS`?u.default.green:u.default.red;console.log(`${u.default.bold(`Status:`)} ${h(m.status)}`),console.log(`${u.default.bold(`Duration:`)} ${m.duration}ms\n`),e.yt(m.data)&&(console.log(u.default.bold(`Data:`)),console.log(u.default.white(JSON.stringify(m.data,null,2)))),m.error&&(console.log(u.default.bold.red(`Error:`)),console.log(u.default.red(` Type: ${m.error.errorType}`)),console.log(u.default.red(` Message: ${m.error.errorMessage}\n`)),m.error.stackTrace&&(console.log(u.default.gray(`Stack trace:`)),console.log(u.default.gray(m.error.stackTrace)))),m.logs&&(console.log(u.default.bold(`Logs:`)),console.log(u.default.gray(m.logs))),console.log(u.default.cyan(`─`.repeat(60))),m.status!==`SUCCESS`&&process.exit(1)}},be=class{constructor(){this.apiService=new t.z}async execute({appPath:e=t.Dt,functionUniversalIdentifier:n,functionName:r}){try{let i=await t.F(e);i||process.exit(1),this.logWatchInfo({appName:i.application.displayName,functionUniversalIdentifier:n,functionName:r}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:i.application.universalIdentifier,functionUniversalIdentifier:n,functionName:r})}catch(e){console.error(u.default.red(`Watch logs failed:`),e instanceof Error?e.message:e),process.exit(1)}}logWatchInfo({appName:e,functionUniversalIdentifier:n,functionName:r}){let i=e??`Twenty Application`,a=n||r?`function "${n||r}"`:`functions`,o=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Watching ${i} ${a} logs on ${o}:\n`))}},xe=e=>`${u.default.cyan(e.file)}:${u.default.yellow(String(e.line))}:${u.default.yellow(String(e.column+1))} - ${u.default.red(`error`)} ${e.text}`,Se=class{async execute(e){let n=e.appPath??t.Dt;console.log(u.default.blue(`Running type check...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.mt(n);r.length===0&&(console.log(u.default.green(`✓ No type errors found`)),process.exit(0));for(let e of r)console.log(xe(e));console.log(`
346
- `,u.default.red(`✗ Found ${r.length} type error${r.length===1?``:`s`}`)),process.exit(1)}},Ce=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty ${e}\` is deprecated. Use \`twenty ${t}\` instead.`)),we=e=>{let t=new ve,n=new Se,r=new be,i=new ye,a=new _e,o=new b,s=new x,c=new S;e.command(`build [appPath]`,{hidden:!0}).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,n)=>{Ce(`build`,`dev:build`),await t.execute({appPath:g(e),tarball:n.tarball})}),e.command(`typecheck [appPath]`,{hidden:!0}).action(async e=>{Ce(`typecheck`,`dev:typecheck`),await n.execute({appPath:g(e)})}),e.command(`logs [appPath]`,{hidden:!0}).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Only show logs for the function with this universal ID`).option(`-n, --functionName <functionName>`,`Only show logs for the function with this name`).action(async(e,t)=>{Ce(`logs`,`dev:function:logs`),await r.execute({...t,appPath:g(e)})}),e.command(`exec [appPath]`,{hidden:!0}).option(`--postInstall`,`Execute post-install logic function if defined`).option(`--preInstall`,`Execute pre-install logic function if defined`).option(`-p, --payload <payload>`,`JSON payload to send to the function`,`{}`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Universal ID of the function to execute`).option(`-n, --functionName <functionName>`,`Name of the function to execute`).action(async(e,t)=>{Ce(`exec`,`dev:function:exec`),!t?.postInstall&&!t?.preInstall&&!t?.functionUniversalIdentifier&&!t?.functionName&&(console.error(u.default.red(`Error: Either --postInstall, --preInstall, --functionName (-n), or --functionUniversalIdentifier (-u) is required.`)),process.exit(1)),await i.execute({...t,payload:t?.payload??`{}`,appPath:g(e)})}),e.command(`add [entityType]`,{hidden:!0}).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{Ce(`add`,`dev:add`),await a.execute(e,t?.path)}),e.command(`publish [appPath]`,{hidden:!0}).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,t)=>{Ce(`publish`,`app:publish`),await o.execute({appPath:g(e),tag:t.tag})}),e.command(`deploy [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Deploy to a specific remote`).action(async(e,t)=>{Ce(`deploy`,`app:publish --private`),await o.execute({appPath:g(e),private:!0,remote:t.remote})}),e.command(`install [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{Ce(`install`,`app:install`),await s.execute({appPath:g(e),remote:t.remote})}),e.command(`uninstall [appPath]`,{hidden:!0}).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{Ce(`uninstall`,`app:uninstall`);try{let n=await c.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}}),e.command(`catalog-sync`,{hidden:!0}).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{Ce(`catalog-sync`,`dev:catalog-sync`);let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-Cn-gDxAz.js"));await new t().execute({remote:e.remote})})},Te=class{constructor({state:e,notify:t}){this.state=e,this.notify=t}async execute(e){let n=this.state.steps.buildManifest;n.status=`in_progress`,this.state.updatePipeline({status:`building`});let r=[{message:`Building manifest`,status:`info`}],i=await t.et(e.appPath);if(!i.success){for(let e of i.errors)r.push({message:e,status:`error`});return n.output={result:null},n.status=`error`,this.state.updatePipeline({status:`error`}),this.state.applyStepEvents(r),null}if(i.warnings.length>0)for(let e of i.warnings)r.push({message:`⚠ ${e}`,status:`warning`});r.push({message:`Successfully built manifest`,status:`success`});let a={manifest:i.manifest,filePaths:i.filePaths};return n.output={result:a},n.status=`done`,this.state.updatePipeline({appName:i.manifest.application.displayName}),this.state.updateEntitiesFromManifest(i.filePaths),this.state.applyStepEvents(r),a}},Ee=class{constructor({apiService:e,state:t,notify:n}){this.hasRetried=!1,this.apiService=e,this.state=t,this.notify=n}async execute(){let n=this.state.steps.checkServer,r=await this.apiService.validateAuth();if(!r.serverUp){let e=await t.m();return e&&!this.hasRetried?(this.hasRetried=!0,await new t.U().setConfig({apiUrl:e}),this.execute()):(n.output.errorLogged||(n.output={isReady:!1,errorLogged:!0},n.status=`error`,this.state.applyStepEvents([{message:`Cannot reach Twenty server.
343
+ `,he=`src/application.config.ts`,ge=`src`,_e=class{async execute(i,a){try{let o=await E(t.Dt),s=i??await this.getEntity(),c=this.getFolderName(s),l=a?(0,n.join)(t.Dt,a):(0,n.join)(t.Dt,ge,c);await t.vt(l);let{name:d,file:f}=await this.getEntityData(s,o),p=(0,n.join)(l,this.getFileName(d,s));if(await t.yt(p)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(p,f),console.log(u.default.green(`✓ Created ${c}:`),u.default.cyan((0,n.relative)(t.Dt,p))),s===e.s.Object&&await this.promptAndCreateObjectCompanions({objectName:d,applicationUniversalIdentifier:o,customPath:a}),s===e.s.ConnectionProvider&&await this.registerConnectionProviderServerVariables(d)}catch(e){console.error(u.default.red(`Add new entity failed:`),e instanceof Error?e.message:e),process.exit(1)}}async getEntityData(n,r){switch(n){case e.s.Object:{let e=await this.getObjectData(),t=e.nameSingular,n=(0,a.v4)(),r=(0,a.v4)();return this.lastObjectUniversalIdentifier=n,this.lastNameFieldUniversalIdentifier=r,this.lastObjectLabelSingular=e.labelSingular,{name:t,file:F({data:e,name:t,universalIdentifier:n,nameFieldUniversalIdentifier:r})}}case e.s.Field:{let e=await this.getFieldData(),t=e.name;return{name:t,file:A({data:e,name:t})}}case e.s.LogicFunction:{let e=await this.getEntityName(n);return{name:e,file:N({name:e})}}case e.s.FrontComponent:{let e=await this.getEntityName(n);return{name:e,file:M({name:e})}}case e.s.Role:{let e=await this.getEntityName(n);return{name:e,file:ce({name:e})}}case e.s.Skill:{let e=await this.getEntityName(n);return{name:e,file:ue({name:e})}}case e.s.Agent:{let e=await this.getEntityName(n);return{name:e,file:le({name:e})}}case e.s.ConnectionProvider:{let e=await this.getEntityName(n);return{name:e,file:I({name:e})}}case e.s.View:{let e=(await this.getViewData()).name;return{name:e,file:fe({name:e,applicationUniversalIdentifier:r})}}case e.s.ViewField:return{name:await this.getEntityName(n),file:pe({})};case e.s.NavigationMenuItem:{let e=await this.getEntityName(n);return{name:e,file:P({name:e})}}case e.s.PageLayout:{let t=await this.getEntityName(n),{type:r}=await d.default.prompt([{type:`select`,name:`type`,message:`Select the page layout type:`,choices:Object.values(e.U)}]);return{name:t,file:ae({name:t,type:r})}}case e.s.PageLayoutTab:{let e=await this.getEntityName(n);return{name:e,file:oe({name:e})}}case e.s.CommandMenuItem:{let e=await this.getEntityName(n);return{name:e,file:ie({name:e})}}case e.s.TimelineActivityType:{let e=await this.getEntityName(n);return{name:e,file:me({name:e})}}default:t.Ct(n)}}async promptAndCreateObjectCompanions({objectName:i,applicationUniversalIdentifier:o,customPath:s}){let{createCompanions:c}=await d.default.prompt([{type:`confirm`,name:`createCompanions`,message:`Also create a view, navigation menu item, and record page layout for this object? (recommended)`,default:!0}]);if(!c||!this.lastObjectUniversalIdentifier)return;let l=(0,a.v4)(),f=(0,a.v4)(),p=fe({name:`all-${j(i)}`,universalIdentifier:l,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,applicationUniversalIdentifier:o,fields:this.lastNameFieldUniversalIdentifier?[{fieldMetadataUniversalIdentifier:this.lastNameFieldUniversalIdentifier,position:0,isVisible:!0,size:200}]:[]}),m=s?(0,n.join)(t.Dt,s):(0,n.join)(t.Dt,ge,this.getFolderName(e.s.View));await t.vt(m);let h=(0,n.join)(m,`all-${j(i)}.ts`);if(await t.yt(h)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(h,p),console.log(u.default.green(`✓ Created view:`),u.default.cyan((0,n.relative)(t.Dt,h)));let g=this.buildRecordPageFieldsViewFields(this.lastNameFieldUniversalIdentifier),_=fe({name:`${j(i)}-record-page-fields`,universalIdentifier:f,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,applicationUniversalIdentifier:o,type:e.O.FIELDS_WIDGET,fields:g}),v=(0,n.join)(m,`${j(i)}-record-page-fields.ts`);if(await t.yt(v)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(v,_),console.log(u.default.green(`✓ Created record-page-fields view:`),u.default.cyan((0,n.relative)(t.Dt,v)));let y=P({name:i,type:`OBJECT`,targetObjectUniversalIdentifier:this.lastObjectUniversalIdentifier}),b=s?(0,n.join)(t.Dt,s):(0,n.join)(t.Dt,ge,this.getFolderName(e.s.NavigationMenuItem));await t.vt(b);let x=(0,n.join)(b,`${j(i)}.ts`);if(await t.yt(x)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(x,y),console.log(u.default.green(`✓ Created navigation menu item:`),u.default.cyan((0,n.relative)(t.Dt,x)));let S=se({objectLabelSingular:this.lastObjectLabelSingular??i,objectUniversalIdentifier:this.lastObjectUniversalIdentifier,fieldsWidgetViewUniversalIdentifier:f}),C=s?(0,n.join)(t.Dt,s):(0,n.join)(t.Dt,ge,this.getFolderName(e.s.PageLayout));await t.vt(C);let w=(0,n.join)(C,`${j(i)}-record-page-layout.ts`);if(await t.yt(w)){let{overwrite:e}=await this.handleFileExist();if(!e)return}await(0,r.writeFile)(w,S),console.log(u.default.green(`✓ Created record page layout:`),u.default.cyan((0,n.relative)(t.Dt,w)))}async registerConnectionProviderServerVariables(e){let r=j(e).toUpperCase().replace(/-/g,`_`),i=[{name:`${r}_CLIENT_ID`,description:`OAuth client ID issued by the third-party provider. Filled in once by the server admin on the application registration.`,isSecret:!1},{name:`${r}_CLIENT_SECRET`,description:`OAuth client secret issued by the third-party provider. Stored encrypted; never echoed in API responses.`,isSecret:!0}],a=await te({projectRoot:t.Dt,variables:i});switch(a.status){case`appended`:case`created`:console.log(u.default.green(`✓ Added ${i.map(e=>e.name).join(` + `)} to defineApplication.serverVariables:`),u.default.cyan((0,n.relative)(t.Dt,a.file)));break;case`skipped-existing`:console.log(u.default.dim(` (${i.map(e=>e.name).join(` / `)} already declared on defineApplication.serverVariables)`));break;case`skipped-no-config`:case`skipped-no-app-call`:console.log(u.default.yellow(`! Couldn't auto-update ${he}. Add these manually to defineApplication.serverVariables:\n`+i.map(e=>` ${e.name}: { description: '...', isSecret: ${e.isSecret}, isRequired: true },`).join(`
344
+ `)));break}}buildRecordPageFieldsViewFields(e){let t=[`createdAt`,`updatedAt`,`createdBy`,`updatedBy`].map(e=>({defaultFieldName:e,isVisible:!0,size:200}));return(e?[{fieldMetadataUniversalIdentifier:e,isVisible:!0,size:200},...t]:t).map((e,t)=>({...e,position:t}))}async getEntity(){let{entity:t}=await d.default.prompt([{type:`select`,name:`entity`,message:`What entity do you want to create?`,default:``,choices:Object.values(e.s)}]);return t}async handleFileExist(){return await d.default.prompt([{type:`confirm`,name:`overwrite`,message:`File already exists. Do you want to overwrite it?`,default:!1}])}async getEntityName(e){let{name:t}=await d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your new ${e}:`,default:``,validate:t=>t.length===0?`${e} name is required`:!0}]);return t}async getFieldData(){let t=t=>t===e.X.RELATION||t===e.X.MORPH_RELATION;return d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your field:`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`label`,message:`Enter a label for your field:`,default:e=>O(e.name),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`select`,name:`type`,message:`Select the field type:`,choices:Object.values(e.X),default:e.X.TEXT},{type:`input`,name:`objectUniversalIdentifier`,message:`Enter the universalIdentifier of the object this field belongs to:`,default:`fill-later`,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`description`,message:`Enter a description for your field (optional):`,default:``},{type:`input`,name:`relationTargetObjectMetadataUniversalIdentifier`,message:`Enter the universalIdentifier of the target object of the relation:`,default:`fill-later`,when:e=>t(e.type),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`relationTargetFieldMetadataUniversalIdentifier`,message:`Enter the universalIdentifier of the target field on the related object:`,default:`fill-later`,when:e=>t(e.type),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`select`,name:`relationType`,message:`Select the relation type:`,choices:Object.values(e.et),default:e.et.ONE_TO_MANY,when:e=>t(e.type)},{type:`select`,name:`onDelete`,message:`Select the onDelete behavior:`,choices:Object.values(e.Q),default:e.Q.CASCADE,when:e=>t(e.type)}])}async getObjectData(){return d.default.prompt([{type:`input`,name:`nameSingular`,message:`Enter a name singular for your object (eg: company):`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`namePlural`,message:`Enter a name plural for your object (eg: companies):`,default:``,validate:(e,t)=>e.trim()===t?.nameSingular.trim()?`Name plural must be different from name singular`:!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`labelSingular`,message:`Enter a label singular for your object:`,default:e=>O(e.nameSingular),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`labelPlural`,message:`Enter a label plural for your object:`,default:e=>O(e.namePlural),validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0}])}async getViewData(){return d.default.prompt([{type:`input`,name:`name`,message:`Enter a name for your view:`,default:``,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0},{type:`input`,name:`objectUniversalIdentifier`,message:`Enter the universalIdentifier of the object this view belongs to:`,default:`fill-later`,validate:e=>!e||e.trim().length===0?`Please enter a non empty string`:!0}])}getFolderName(e){return`${j(e)}s`}getFileName(t,n){switch(n){case e.s.FrontComponent:return`${j(t)}.tsx`;default:return`${j(t)}.ts`}}},ve=class{async execute(e){let n=e.appPath??t.Dt;await y(n),console.log(u.default.blue(`Building application...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.G({appPath:n,tarball:e.tarball,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1)),console.log(u.default.green(`✓ Build succeeded (${r.data.fileCount} file${r.data.fileCount===1?``:`s`})`)),console.log(u.default.gray(`Output: ${r.data.outputDir}`)),r.data.tarballPath&&console.log(u.default.gray(`Tarball: ${r.data.tarballPath}`))}},ye=class{async execute({appPath:n=t.Dt,postInstall:r=!1,preInstall:i=!1,uninstall:a=!1,functionUniversalIdentifier:o,functionName:s,payload:c=`{}`}){let l;try{l=JSON.parse(c)}catch{console.error(u.default.red(`Invalid JSON payload. Please provide valid JSON.`)),process.exit(1)}let d=r?`post install`:i?`pre install`:a?`uninstall`:o??s,f=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Executing function "${d}" on ${f}...`)),console.log(u.default.gray(` Payload: ${JSON.stringify(l)}\n`));let p=await t._(r?{appPath:n,postInstall:!0,payload:l}:i?{appPath:n,preInstall:!0,payload:l}:a?{appPath:n,uninstall:!0,payload:l}:o?{appPath:n,functionUniversalIdentifier:o,payload:l}:{appPath:n,functionName:s,payload:l});if(!p.success){switch(p.error.code){case t.K.MANIFEST_NOT_FOUND:console.error(u.default.red(`Failed to build manifest.`));break;case t.J.FETCH_FUNCTIONS_FAILED:console.error(u.default.red(`Failed to fetch functions:`),p.error.message);break;case t.J.FUNCTION_NOT_FOUND:{console.error(u.default.red(p.error.message),`
345
+ `);let e=p.error.details?.availableFunctions??[];e.length>0?(console.log(u.default.cyan(`Available functions:`)),e.forEach(e=>{console.log(` - ${u.default.white(e.name)} (${e.universalIdentifier})`)})):console.log(u.default.yellow("No functions found for this application. Have you synced your app with `twenty dev`?"));break}case t.J.EXECUTION_FAILED:console.error(u.default.red(`Execution failed:`),p.error.message);break;default:console.error(u.default.red(p.error.message))}process.exit(1)}let m=p.data;console.log(u.default.cyan(`─`.repeat(60))),console.log(u.default.cyan(`Execution Result`)),console.log(u.default.cyan(`─`.repeat(60)));let h=m.status===`SUCCESS`?u.default.green:u.default.red;console.log(`${u.default.bold(`Status:`)} ${h(m.status)}`),console.log(`${u.default.bold(`Duration:`)} ${m.duration}ms\n`),e.St(m.data)&&(console.log(u.default.bold(`Data:`)),console.log(u.default.white(JSON.stringify(m.data,null,2)))),m.error&&(console.log(u.default.bold.red(`Error:`)),console.log(u.default.red(` Type: ${m.error.errorType}`)),console.log(u.default.red(` Message: ${m.error.errorMessage}\n`)),m.error.stackTrace&&(console.log(u.default.gray(`Stack trace:`)),console.log(u.default.gray(m.error.stackTrace)))),m.logs&&(console.log(u.default.bold(`Logs:`)),console.log(u.default.gray(m.logs))),console.log(u.default.cyan(`─`.repeat(60))),m.status!==`SUCCESS`&&process.exit(1)}},be=class{constructor(){this.apiService=new t.z}async execute({appPath:e=t.Dt,functionUniversalIdentifier:n,functionName:r}){try{let i=await t.F(e);i||process.exit(1),this.logWatchInfo({appName:i.application.displayName,functionUniversalIdentifier:n,functionName:r}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:i.application.universalIdentifier,functionUniversalIdentifier:n,functionName:r})}catch(e){console.error(u.default.red(`Watch logs failed:`),e instanceof Error?e.message:e),process.exit(1)}}logWatchInfo({appName:e,functionUniversalIdentifier:n,functionName:r}){let i=e??`Twenty Application`,a=n||r?`function "${n||r}"`:`functions`,o=t.U.getActiveRemote();console.log(u.default.blue(`🚀 Watching ${i} ${a} logs on ${o}:\n`))}},xe=e=>`${u.default.cyan(e.file)}:${u.default.yellow(String(e.line))}:${u.default.yellow(String(e.column+1))} - ${u.default.red(`error`)} ${e.text}`,Se=class{async execute(e){let n=e.appPath??t.Dt;console.log(u.default.blue(`Running type check...`)),console.log(u.default.gray(`App path: ${n}\n`));let r=await t.mt(n);r.length===0&&(console.log(u.default.green(`✓ No type errors found`)),process.exit(0));for(let e of r)console.log(xe(e));console.log(`
346
+ `,u.default.red(`✗ Found ${r.length} type error${r.length===1?``:`s`}`)),process.exit(1)}},Ce=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty ${e}\` is deprecated. Use \`twenty ${t}\` instead.`)),we=e=>{let t=new ve,n=new Se,r=new be,i=new ye,a=new _e,o=new b,s=new x,c=new S;e.command(`build [appPath]`,{hidden:!0}).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,n)=>{Ce(`build`,`dev:build`),await t.execute({appPath:g(e),tarball:n.tarball})}),e.command(`typecheck [appPath]`,{hidden:!0}).action(async e=>{Ce(`typecheck`,`dev:typecheck`),await n.execute({appPath:g(e)})}),e.command(`logs [appPath]`,{hidden:!0}).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Only show logs for the function with this universal ID`).option(`-n, --functionName <functionName>`,`Only show logs for the function with this name`).action(async(e,t)=>{Ce(`logs`,`dev:function:logs`),await r.execute({...t,appPath:g(e)})}),e.command(`exec [appPath]`,{hidden:!0}).option(`--postInstall`,`Execute post-install logic function if defined`).option(`--preInstall`,`Execute pre-install logic function if defined`).option(`-p, --payload <payload>`,`JSON payload to send to the function`,`{}`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Universal ID of the function to execute`).option(`-n, --functionName <functionName>`,`Name of the function to execute`).action(async(e,t)=>{Ce(`exec`,`dev:function:exec`),!t?.postInstall&&!t?.preInstall&&!t?.functionUniversalIdentifier&&!t?.functionName&&(console.error(u.default.red(`Error: Either --postInstall, --preInstall, --functionName (-n), or --functionUniversalIdentifier (-u) is required.`)),process.exit(1)),await i.execute({...t,payload:t?.payload??`{}`,appPath:g(e)})}),e.command(`add [entityType]`,{hidden:!0}).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{Ce(`add`,`dev:add`),await a.execute(e,t?.path)}),e.command(`publish [appPath]`,{hidden:!0}).option(`--tag <tag>`,`npm dist-tag (e.g. beta, next)`).action(async(e,t)=>{Ce(`publish`,`app:publish`),await o.execute({appPath:g(e),tag:t.tag})}),e.command(`deploy [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Deploy to a specific remote`).action(async(e,t)=>{Ce(`deploy`,`app:publish --private`),await o.execute({appPath:g(e),private:!0,remote:t.remote})}),e.command(`install [appPath]`,{hidden:!0}).option(`-r, --remote <name>`,`Install on a specific remote`).action(async(e,t)=>{Ce(`install`,`app:install`),await s.execute({appPath:g(e),remote:t.remote})}),e.command(`uninstall [appPath]`,{hidden:!0}).option(`-y, --yes`,`Skip confirmation prompt`).action(async(e,t)=>{Ce(`uninstall`,`app:uninstall`);try{let n=await c.execute({appPath:g(e),askForConfirmation:!t?.yes});process.exit(+!n.success)}catch{process.exit(1)}}),e.command(`catalog-sync`,{hidden:!0}).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{Ce(`catalog-sync`,`dev:catalog-sync`);let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-Szx_4267.js"));await new t().execute({remote:e.remote})})},Te=class{constructor({state:e,notify:t}){this.state=e,this.notify=t}async execute(e){let n=this.state.steps.buildManifest;n.status=`in_progress`,this.state.updatePipeline({status:`building`});let r=[{message:`Building manifest`,status:`info`}],i=await t.et(e.appPath);if(!i.success){for(let e of i.errors)r.push({message:e,status:`error`});return n.output={result:null},n.status=`error`,this.state.updatePipeline({status:`error`}),this.state.applyStepEvents(r),null}if(i.warnings.length>0)for(let e of i.warnings)r.push({message:`⚠ ${e}`,status:`warning`});r.push({message:`Successfully built manifest`,status:`success`});let a={manifest:i.manifest,filePaths:i.filePaths};return n.output={result:a},n.status=`done`,this.state.updatePipeline({appName:i.manifest.application.displayName}),this.state.updateEntitiesFromManifest(i.filePaths),this.state.applyStepEvents(r),a}},Ee=class{constructor({apiService:e,state:t,notify:n}){this.hasRetried=!1,this.apiService=e,this.state=t,this.notify=n}async execute(){let n=this.state.steps.checkServer,r=await this.apiService.validateAuth();if(!r.serverUp){let e=await t.m();return e&&!this.hasRetried?(this.hasRetried=!0,await new t.U().setConfig({apiUrl:e}),this.execute()):(n.output.errorLogged||(n.output={isReady:!1,errorLogged:!0},n.status=`error`,this.state.applyStepEvents([{message:`Cannot reach Twenty server.
347
347
 
348
348
  Start a local server:
349
349
  yarn twenty docker:start
@@ -351,12 +351,12 @@ export default defineTimelineActivityType({
351
351
  Check server status:
352
352
  yarn twenty docker:status
353
353
 
354
- Waiting for server...`,status:`error`}]),this.state.updatePipeline({status:`error`})),!1)}if(!r.authValid)return n.output.errorLogged||(n.output={isReady:!1,errorLogged:!0},n.status=`error`,this.state.applyStepEvents([{message:"Authentication failed. Run `yarn twenty remote:add` to authenticate.",status:`error`}]),this.state.updatePipeline({status:`error`})),!1;let i=n.output.isReady;if(n.output={isReady:!0,errorLogged:!1},n.status=`done`,!e.yt(this.state.frontendUrl)){let t=await this.apiService.getWorkspaceFrontendUrl();e.yt(t)&&(this.state.frontendUrl=t)}return i||this.notify(),!0}},L=class{constructor({clientService:e,configService:t,state:n,notify:r}){this.clientService=e,this.configService=t,this.state=n,this.notify=r}async execute(e){let n=this.state.steps.generateApiClient;n.status=`in_progress`,this.notify();try{let r=await t.f(this.configService,e.tokenSources);await this.clientService.generateCoreClient({appPath:e.appPath,appAccessToken:r}),n.status=`done`}catch(e){this.state.applyStepEvents([{message:`Failed to generate API client: ${e instanceof Error?e.message:String(e)}`,status:`error`}]),n.status=`error`}this.notify()}},De=class{constructor({apiService:e,configService:t,state:n,notify:r}){this.apiService=e,this.configService=t,this.state=n,this.notify=r}async execute(e){try{let n=await t.d(this.apiService,this.configService,{name:e.manifest.application.displayName,universalIdentifier:e.manifest.application.universalIdentifier});this.registrationCredentials={clientId:n.clientId,clientSecret:n.clientSecret},this.state.applyStepEvents([{message:n.isNewRegistration?`App registration created: ${e.manifest.application.displayName}`:`Existing app registration found`,status:n.isNewRegistration?`success`:`info`},...n.isNewRegistration?[{message:`Credentials saved to config.`,status:`info`}]:[]])}catch(e){throw this.state.applyStepEvents([{message:`Failed to register app: ${e instanceof Error?e.message:String(e)}`,status:`error`}]),e}this.notify()}},Oe=class{constructor(e){this.watcher=null,this.appPath=e.appPath,this.fileFolder=e.fileFolder,this.watchPaths=e.watchPaths,this.handleFileBuilt=e.handleFileBuilt}async start(){let e=(await Promise.all(this.watchPaths.map(async e=>{let r=(0,n.join)(this.appPath,e);return await t.yt(r)?r:null}))).filter(e=>e!==null);e.length!==0&&(this.watcher=f.default.watch(e,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.watcher.on(`all`,(e,t)=>{e===`addDir`||e===`unlinkDir`||((e===`add`||e===`change`)&&this.copyAndNotify(t),e===`unlink`&&this.handleUnlink(t))}))}async close(){await this.watcher?.close()}async copyAndNotify(i){let a=(0,n.relative)(this.appPath,i),o=(0,n.join)(e.i,a),s=(0,n.join)(this.appPath,o);await t.vt((0,n.dirname)(s)),await t.gt(i,s);let l=await(0,r.readFile)(s),u=c.default.createHash(`md5`).update(l).digest(`hex`);this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:a,checksum:u})}async handleUnlink(r){let i=(0,n.join)(e.i,(0,n.relative)(this.appPath,r));await t.xt((0,n.join)(this.appPath,i))}},ke=[`package.json`,`yarn.lock`],Ae=class{constructor(e){this.componentsWatcher=null,this.sharedDependenciesBuildContext=null,this.lastSharedDependenciesChecksum=null,this.installedDependenciesWatcher=null,this.isClosed=!1,this.isApplyingRestart=!1,this.sharedDependenciesBuildGeneration=0,this.inFlightSharedDependenciesBuildPromise=null,this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!1,this.appPath=e.appPath,this.sourcePaths=e.sourcePaths,this.sharedDependencies=e.sharedDependencies,this.watchMode=e.watch??!0,this.shouldSkipTypecheck=e.shouldSkipTypecheck,this.handleFileBuilt=e.handleFileBuilt,this.handleBuildError=e.handleBuildError}getSharedDependenciesBuildContext(){return this.sharedDependenciesBuildContext}shouldRestart(e,t){return(this.componentsWatcher?.shouldRestart(e)??!0)||this.hasSharedDependenciesManifestChanged(t)}async start(){e.yt(this.sharedDependencies)&&(await this.requestSharedDependenciesBuild(),await this.startInstalledDependenciesWatcher()),this.componentsWatcher=new t.ut({appPath:this.appPath,sourcePaths:this.sourcePaths,watch:this.watchMode,handleFileBuilt:this.handleFileBuilt,handleBuildError:this.handleBuildError,config:{externalModules:t.lt,fileFolder:e.M.BuiltFrontComponent,jsx:`automatic`,extraPlugins:[t.ft(this.appPath,this.shouldSkipTypecheck),...e.t({getSharedDependenciesBuildContext:()=>this.sharedDependenciesBuildContext}),t.ht()]}}),await this.componentsWatcher.start()}async restart(t,n){this.isApplyingRestart=!0;try{let r=this.hasSharedDependenciesManifestChanged(n);this.sourcePaths=t,r&&(this.sharedDependenciesBuildGeneration+=1,this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!1,await this.inFlightSharedDependenciesBuildPromise,await this.installedDependenciesWatcher?.close(),this.installedDependenciesWatcher=null,this.sharedDependencies=n,this.sharedDependenciesBuildContext=null,this.lastSharedDependenciesChecksum=null,e.yt(n)&&(await this.requestSharedDependenciesBuild(),await this.startInstalledDependenciesWatcher())),await this.componentsWatcher?.restart(t)}finally{this.isApplyingRestart=!1}}async close(){this.isClosed=!0,await this.installedDependenciesWatcher?.close(),this.installedDependenciesWatcher=null,await this.componentsWatcher?.close(),this.componentsWatcher=null}hasSharedDependenciesManifestChanged(t){return!e.yt(t)||!e.yt(this.sharedDependencies)?e.yt(t)!==e.yt(this.sharedDependencies):t.dependencies.join(`,`)!==this.sharedDependencies.dependencies.join(`,`)}async requestSharedDependenciesBuild(){if(e.yt(this.inFlightSharedDependenciesBuildPromise)){this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!0;return}this.inFlightSharedDependenciesBuildPromise=this.runSharedDependenciesBuild();try{await this.inFlightSharedDependenciesBuildPromise}finally{this.inFlightSharedDependenciesBuildPromise=null,this.hasSharedDependenciesBuildRequestedDuringInFlightBuild&&(this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!1,await this.requestSharedDependenciesBuild())}}async runSharedDependenciesBuild(){let n=this.sharedDependencies,r=this.sharedDependenciesBuildGeneration;if(!e.yt(n))return;let i=()=>this.isClosed||r!==this.sharedDependenciesBuildGeneration;try{let e=null,r=await t.ct({appPath:this.appPath,sharedDependencies:n,onFileBuilt:async t=>{e=t.checksum,!(i()||t.checksum===this.lastSharedDependenciesChecksum)&&await this.handleFileBuilt(t)}});if(i())return;this.sharedDependenciesBuildContext=r,e!==this.lastSharedDependenciesChecksum&&(this.lastSharedDependenciesChecksum=e,this.isApplyingRestart||await this.componentsWatcher?.restart(this.sourcePaths))}catch(e){if(i())return;await this.handleBuildError([{error:e instanceof Error?e.message:String(e),location:null}])}}async startInstalledDependenciesWatcher(){let r=(await Promise.all(ke.map(async e=>{let r=(0,n.join)(this.appPath,e);return await t.yt(r)?r:null}))).filter(e.yt);(0,i.isNonEmptyArray)(r)&&(this.installedDependenciesWatcher=f.default.watch(r,{ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.installedDependenciesWatcher.on(`all`,e=>{(e===`add`||e===`change`)&&this.requestSharedDependenciesBuild()}))}},je=class{constructor(e){this.process=null,this.pendingErrors=[],this.buffer=``,this.hasErrors=!1,this.appPath=e.appPath,this.onErrors=e.onErrors}async start(){let e=s.default.join(this.appPath,`node_modules`,`.bin`,`tsc`);if(!await t.yt(e))return;let n=s.default.join(this.appPath,`tsconfig.json`);this.process=(0,l.spawn)(e,[`--watch`,`--noEmit`,`--pretty`,`false`,`-p`,n],{cwd:this.appPath,stdio:[`ignore`,`pipe`,`pipe`]}),this.process.on(`error`,()=>{this.process=null}),this.process.stdout?.on(`data`,e=>{this.handleOutput(e.toString())}),this.process.stderr?.on(`data`,e=>{this.handleOutput(e.toString())})}close(){this.process?.kill(),this.process=null}handleOutput(e){this.buffer+=e;let t=this.buffer.split(`
355
- `);this.buffer=t.pop()??``;for(let e of t)this.processLine(e)}processLine(e){if(e.includes(`Starting compilation in watch mode...`)||e.includes(`Starting incremental compilation...`)){this.pendingErrors=[];return}if(e.includes(`Watching for file changes.`)){let e=this.hasErrors;this.hasErrors=this.pendingErrors.length>0,(this.hasErrors||e)&&this.onErrors(this.pendingErrors),this.pendingErrors=[];return}let n=t.pt(e);n&&this.pendingErrors.push(n)}},Me=new Set([`node_modules`,`dist`,`.twenty`]),Ne=class{constructor(e){this.watcher=null,this.appPath=e.appPath,this.handleChangeDetected=e.handleChangeDetected,this.verbose=e.verbose??!1}async start(){let t=this.appPath;this.watcher=f.default.watch(this.appPath,{ignoreInitial:!this.verbose,ignored:e=>{let r=(0,n.relative)(t,e);if(r===``)return!1;let i=r.split(n.default.sep)[0];return Me.has(i)||i.startsWith(`.`)},awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.watcher.on(`all`,(t,r)=>{if(t===`addDir`||t===`unlinkDir`)return;let i=(0,n.relative)(this.appPath,r),a=i.startsWith(e.s),o=[`package.json`,`yarn.lock`].includes(i);!(i.endsWith(`.ts`)||i.endsWith(`.tsx`))&&!a&&!o||this.handleChangeDetected(i,t)})}async close(){await this.watcher?.close()}},Pe=class{constructor(e){this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.tscWatcher=null,this.state=e.state,this.scheduleSync=e.scheduleSync,this.notify=e.notify,this.onFileBuilt=e.onFileBuilt,this.shouldSkipTypecheck=e.shouldSkipTypecheck,this.verbose=e.verbose??!1}async start(){this.state.steps.startWatchers.status=`in_progress`,this.notify(),this.manifestWatcher=new Ne({appPath:this.state.appPath,handleChangeDetected:this.handleChangeDetected.bind(this),verbose:this.verbose}),await this.manifestWatcher.start()}async handleWatcherRestarts(e){let{logicFunctions:t,frontComponents:n}=e.filePaths,r=e.manifest?.application.frontComponentSharedDependencies;if(!this.state.steps.startWatchers.output.watchersStarted){this.state.steps.startWatchers.output.watchersStarted=!0,this.state.steps.startWatchers.status=`done`,await this.startFileWatchers(t,n,r);return}this.logicFunctionsWatcher?.shouldRestart(t)&&await this.logicFunctionsWatcher.restart(t),this.frontComponentsWatcher?.shouldRestart(n,r)&&await this.frontComponentsWatcher.restart(n,r)}async close(){this.tscWatcher?.close(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()])}handleChangeDetected(e,t){this.state.addEvent({message:`Change detected: ${e}`,status:`info`,spacingBefore:!0}),t===`unlink`?this.state.removeEntity(e):this.state.updateEntityStatus(e,`building`),this.notify(),this.scheduleSync()}handleFileBuildError(e){this.state.addEvent({message:`Build failed:`,status:`error`});for(let t of e)this.state.addEvent({message:t.error,status:`error`});this.notify()}handleFileBuilt(e){this.verbose&&this.state.addEvent({message:`Successfully built ${e.builtPath}`,status:`success`}),this.state.steps.uploadFiles.output.builtFileInfos.set(e.builtPath,{checksum:e.checksum,builtPath:e.builtPath,sourcePath:e.sourcePath,fileFolder:e.fileFolder,usesSdkClient:e.usesSdkClient}),this.onFileBuilt(e),this.notify(),this.scheduleSync()}async startFileWatchers(e,t,n){await Promise.all([this.startTscWatcher(),this.startLogicFunctionsWatcher(e),this.startFrontComponentsWatcher(t,n),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(e){this.logicFunctionsWatcher=t.dt({appPath:this.state.appPath,sourcePaths:e,shouldSkipTypecheck:this.shouldSkipTypecheck,handleBuildError:this.handleFileBuildError.bind(this),handleFileBuilt:this.handleFileBuilt.bind(this)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(e,t){this.frontComponentsWatcher=new Ae({appPath:this.state.appPath,sourcePaths:e,sharedDependencies:t,shouldSkipTypecheck:this.shouldSkipTypecheck,handleBuildError:this.handleFileBuildError.bind(this),handleFileBuilt:this.handleFileBuilt.bind(this)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new Oe({appPath:this.state.appPath,fileFolder:e.M.PublicAsset,watchPaths:[e.s],handleFileBuilt:this.handleFileBuilt.bind(this)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Oe({appPath:this.state.appPath,fileFolder:e.M.Dependencies,watchPaths:[`package.json`,`yarn.lock`],handleFileBuilt:this.handleFileBuilt.bind(this)}),this.dependencyWatcher.start()}async startTscWatcher(){this.tscWatcher=new je({appPath:this.state.appPath,onErrors:this.handleTypecheckErrors.bind(this)}),await this.tscWatcher.start()}handleTypecheckErrors(e){e.length===0?this.state.addEvent({message:`Typecheck passed`,status:`success`}):this.state.applyStepEvents(e.map(e=>({message:`Type error in ${e.file}(${e.line},${e.column}): ${e.text}`,status:`error`}))),this.notify()}},Fe=50,Ie={create:`created`,update:`updated`,delete:`deleted`},Le=e=>{if(e.type===`create`)return t.u(e.flatEntity)??`unknown`;let n=t.u(e.flatEntity);return n&&n!==e.universalIdentifier?`${n} (${e.universalIdentifier})`:e.universalIdentifier},Re=t=>{if(t.type!==`update`||!e.yt(t.diff))return``;let n=Object.keys(t.diff);return n.length===0?``:` [${n.join(`, `)}] changed`},ze=t=>{let n=t??[];if(n.length===0)return[{message:`No metadata changes`,status:`info`}];let r={create:0,update:0,delete:0};for(let e of n)r[e.type]+=1;let i=[{message:`Metadata changes: ${[r.create>0?`${r.create} created`:null,r.update>0?`${r.update} updated`:null,r.delete>0?`${r.delete} deleted`:null].filter(e.yt).join(`, `)}`,status:`info`}],a=n.slice(0,Fe);for(let e of a){let t=Le(e),n=Re(e);i.push({message:` ${Ie[e.type]} ${e.metadataName} ${t}${n}`,status:`info`})}let o=n.length-a.length;return o>0&&i.push({message:` …and ${o} more change(s)`,status:`info`}),i},Be=class{constructor({apiService:e,state:t,notify:n,verbose:r,force:i,interactive:a,onExit:o}){this.apiService=e,this.state=t,this.notify=n,this.verbose=r??!1,this.force=i??!1,this.interactive=a??!1,this.onExit=o}async execute(e){let n=this.state.steps.syncApplication;n.status=`in_progress`,this.state.updatePipeline({status:`syncing`});let r=[],i={...t.$({manifest:e.manifest,builtFileInfos:e.builtFileInfos}),translations:await t.Z(e.appPath)};if(r.push({message:`Manifest checksums set`,status:`info`}),await t.Q(e.appPath,i),r.push({message:`Manifest saved to output directory`,status:`info`}),!this.force){r.push({message:`Computing metadata plan`,status:`info`});let e=await this.apiService.syncApplication(i,{dryRun:!0});if(!e.success){this.applyFailure(e,r);return}if(t.l(e.data.actions)&&await this.gateDestructiveChange(t.c(e.data.actions),r))return}r.push({message:`Syncing manifest`,status:`info`});let a=await this.apiService.syncApplication(i);if(a.success){r.push(...ze(a.data.actions)),r.push({message:`✓ Synced`,status:`success`}),n.output={syncStatus:`synced`,error:null},n.status=`done`,this.state.updatePipeline({status:`synced`,error:null}),this.state.updateAllEntitiesStatus(`success`),this.state.applyStepEvents(r);return}this.applyFailure(a,r)}async gateDestructiveChange(e,t){let n=this.state.steps.syncApplication,r=(e,r)=>{t.push({message:e,status:`warning`}),n.output={syncStatus:`idle`,error:null},n.status=`done`,this.state.updatePipeline({status:`idle`,error:null}),this.state.applyStepEvents(t),this.onExit?.({code:1,message:r})};return this.interactive?(this.state.applyStepEvents(t),t.length=0,await this.state.requestDestructiveConfirmation(e)?!1:(r(`Declined ${e} destructive change(s)`,`Stopping: declined ${e} destructive change(s). Re-run with \`yarn twenty dev --force\` to apply deletions or \`yarn twenty plan\` to preview changes.`),!0)):(r(`${e} destructive change(s) require --force`,`Stopping: ${e} destructive change(s) need confirmation. Re-run with \`yarn twenty dev --force\` to apply deletions.`),!0)}applyFailure(e,n){let r=this.state.steps.syncApplication,i=this.verbose?null:t.P(e.error);i?(n.push(...i),n.push({message:`Add --verbose to see full error log`,status:`info`})):n.push({message:`Sync failed with error: ${e.message??`Sync failed`}`,status:`error`});let a=t.s(e.message);a&&n.push({message:a,status:`info`});let o=i?i[0].message:`Sync failed`;r.output={syncStatus:`error`,error:o},r.status=`error`,this.state.updatePipeline({status:`error`,error:o}),this.state.updateAllEntitiesStatus(`error`),this.state.applyStepEvents(n)}},Ve=class{constructor({state:e,notify:t,verbose:n}){this.uploadedCount=0,this.failedCount=0,this.totalQueued=0,this.state=e,this.notify=t,this.verbose=n??!1}get isInitialized(){return e.yt(this.state.steps.uploadFiles.output.fileUploader)}initialize(e){let n=this.state.steps.uploadFiles;n.output={...n.output,fileUploader:new t.o({appPath:e.appPath,applicationUniversalIdentifier:e.universalIdentifier})},n.status=`in_progress`,this.notify(),this.uploadPendingFiles()}uploadFile(e,t,n){let r=this.state.steps.uploadFiles;if(!r.output.fileUploader)return;r.status=`in_progress`,this.totalQueued++,this.verbose&&this.state.addEvent({message:`Uploading ${e}`,status:`info`}),this.state.updateEntityStatus(t,`uploading`),this.notify();let i=r.output.fileUploader.uploadFile({builtPath:e,fileFolder:n}).then(n=>{n.success?(this.uploadedCount++,this.verbose&&this.state.addEvent({message:`Successfully uploaded ${e}`,status:`success`}),this.state.updateEntityStatus(t,`success`)):(this.failedCount++,this.state.addEvent({message:`Failed to upload ${e}: ${n.error}`,status:`error`}))}).catch(t=>{this.failedCount++,this.state.addEvent({message:`Upload failed for ${e}: ${t}`,status:`error`})}).finally(()=>{r.output.activeUploads.delete(i),r.output.activeUploads.size===0&&(this.logUploadSummary(),r.status=`done`,this.notify())});r.output.activeUploads.add(i)}async waitForUploads(){let e=this.state.steps.uploadFiles;for(;e.output.activeUploads.size>0;)await Promise.all(e.output.activeUploads);e.status=`done`,this.notify()}logUploadSummary(){if(this.totalQueued===0){this.resetCounters();return}this.failedCount>0&&this.state.addEvent({message:`Uploaded ${this.uploadedCount}/${this.totalQueued} files (${this.failedCount} failed)`,status:`error`}),this.state.addEvent({message:`Successfully uploaded ${this.uploadedCount} file${this.uploadedCount===1?``:`s`}`,status:`success`}),this.resetCounters()}resetCounters(){this.uploadedCount=0,this.failedCount=0,this.totalQueued=0}uploadPendingFiles(){for(let[e,{fileFolder:t,sourcePath:n}]of this.state.steps.uploadFiles.output.builtFileInfos.entries())this.uploadFile(e,n,t)}},He=class{constructor(e){this.syncTimer=null,this.serverCheckInterval=null,this.syncRequestedWhileRunning=!1,this.isClosed=!1,this.skipTypecheck=!0,this.debounceMs=e.debounceMs??1e3,this.state=e.state,this.verbose=e.verbose??!1,this.apiService=new t.z({disableInterceptors:!0});let n=this.apiService,r=new t.U;this.clientService=new t.h;let i={state:this.state,notify:()=>this.state.notify()};this.checkServerStep=new Ee({...i,apiService:n}),this.buildManifestStep=new Te(i),this.registerAppStep=new De({...i,apiService:n,configService:r}),this.uploadFilesStep=new Ve({...i,verbose:this.verbose}),this.generateApiClientStep=new L({...i,clientService:this.clientService,configService:r}),this.syncApplicationStep=new Be({...i,apiService:n,verbose:this.verbose,force:e.force??!1,interactive:e.interactive??!1,onExit:e.onExit}),this.startWatchersStep=new Pe({...i,scheduleSync:this.scheduleSync.bind(this),onFileBuilt:this.handleFileBuilt.bind(this),shouldSkipTypecheck:()=>this.skipTypecheck,verbose:this.verbose})}async start(){this.isClosed=!1;let r=n.default.join(this.state.appPath,e.i);await t.vt(r),await t._t(r),this.state.addEvent({message:`Using remote "${t.U.getActiveRemote()}"`,status:`info`}),this.verbose||this.state.addEvent({message:`Add --verbose to see fully detailed logs`,status:`info`}),this.state.notify(),await this.startWatchersStep.start(),this.serverCheckInterval=setInterval(()=>{this.checkServerHealth()},2e3)}async close(){this.isClosed=!0,this.syncTimer&&=(clearTimeout(this.syncTimer),null),this.serverCheckInterval&&=(clearInterval(this.serverCheckInterval),null),await this.startWatchersStep.close()}getState(){return this.state}handleFileBuilt(e){this.state.steps.uploadFiles.output.fileUploader&&this.uploadFilesStep.uploadFile(e.builtPath,e.sourcePath,e.fileFolder)}async checkServerHealth(){let e=this.state.steps.checkServer.output.isReady;await this.checkServerStep.execute()&&!e&&this.scheduleSync()}scheduleSync(){this.isClosed||(this.syncTimer&&clearTimeout(this.syncTimer),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs))}async performSync(){if(this.state.pipeline.isSyncing){this.syncRequestedWhileRunning=!0;return}this.state.updatePipeline({isSyncing:!0});try{await this.runSyncPipeline()}catch(e){this.state.addEvent({message:`Sync failed with error: ${t.B(e)}`,status:`error`}),this.state.updatePipeline({status:`error`}),this.state.updateAllEntitiesStatus(`error`)}finally{this.state.updatePipeline({isSyncing:!1}),this.syncRequestedWhileRunning&&!this.isClosed&&(this.syncRequestedWhileRunning=!1,this.scheduleSync())}}async runSyncPipeline(){if(!await this.checkServerStep.execute())return;this.state.steps.ensureValidTokens.status=`done`;let e=await this.buildManifestStep.execute({appPath:this.state.appPath});if(!e||(await this.startWatchersStep.handleWatcherRestarts(e),!this.uploadFilesStep.isInitialized&&!await this.initializePipeline(e.manifest)))return;let t=this.state.hasObjectsOrFieldsChanged(e.manifest);await this.uploadFilesStep.waitForUploads(),await this.syncApplicationStep.execute({manifest:e.manifest,builtFileInfos:this.state.steps.uploadFiles.output.builtFileInfos,appPath:this.state.appPath}),this.state.steps.syncApplication.output.syncStatus===`synced`&&t&&(await this.generateApiClientStep.execute({appPath:this.state.appPath,tokenSources:this.buildAppTokenSources()}),this.skipTypecheck=!1)}buildAppTokenSources(){let e=this.registerAppStep.registrationCredentials,n=this.state.steps.resolveApplication.output.applicationId;return{credentials:e?.clientSecret?{clientId:e.clientId,clientSecret:e.clientSecret}:void 0,fetchTokenPair:n?t.g(this.apiService,n):void 0}}async initializePipeline(e){await this.registerAppStep.execute({manifest:e});let t=await this.apiService.createDevelopmentApplication({universalIdentifier:e.application.universalIdentifier,name:e.application.displayName});return!t.success||!t.data?(this.state.applyStepEvents([{message:`Failed to install development application`,status:`error`},{message:JSON.stringify(t,null,2),status:`error`}]),this.state.updatePipeline({status:`error`}),!1):(this.state.steps.resolveApplication.output={applicationId:t.data.id,universalIdentifier:t.data.universalIdentifier},this.state.steps.resolveApplication.status=`done`,this.state.applyStepEvents([{message:`Application installed`,status:`success`}]),this.uploadFilesStep.initialize({appPath:this.state.appPath,universalIdentifier:e.application.universalIdentifier}),!0)}},Ue={objects:e.c.Object,fields:e.c.Field,logicFunctions:e.c.LogicFunction,frontComponents:e.c.FrontComponent,roles:e.c.Role,skills:e.c.Skill,connectionProviders:e.c.ConnectionProvider,views:e.c.View,viewFields:e.c.ViewField,navigationMenuItems:e.c.NavigationMenuItem,pageLayouts:e.c.PageLayout,pageLayoutTabs:e.c.PageLayoutTab,commandMenuItems:e.c.CommandMenuItem,timelineActivityTypes:e.c.TimelineActivityType},We=200,Ge={pending:[`building`,`uploading`,`success`,`error`],building:[`pending`,`uploading`,`success`,`error`],uploading:[`pending`,`success`,`error`],success:[`pending`,`building`,`uploading`,`error`],error:[`pending`,`building`,`uploading`,`success`]},Ke=class{constructor(e){this.confirmationResolver=null,this.eventIdCounter=0,this.appPath=e.appPath,this.previousObjectsFieldsFingerprint=null,this.pendingConfirmation=null,this.steps={checkServer:{output:{isReady:!1,errorLogged:!1},status:`idle`},ensureValidTokens:{output:{},status:`idle`},resolveApplication:{output:{applicationId:null,universalIdentifier:null},status:`idle`},buildManifest:{output:{result:null},status:`idle`},uploadFiles:{output:{fileUploader:null,builtFileInfos:new Map,activeUploads:new Set},status:`idle`},generateApiClient:{output:{},status:`idle`},syncApplication:{output:{syncStatus:`idle`,error:null},status:`idle`},startWatchers:{output:{watchersStarted:!1},status:`idle`}},this.pipeline={status:`idle`,isSyncing:!1,error:null,appName:null},this.versionInfo=null,this.entities=new Map,this.events=[]}setVersionInfo(e){this.versionInfo=e,this.notify()}notify(){this.onChange?.()}requestDestructiveConfirmation(e){return new Promise(t=>{this.pendingConfirmation={deleteCount:e},this.confirmationResolver=t,this.notify()})}resolveDestructiveConfirmation(e){let t=this.confirmationResolver;this.pendingConfirmation=null,this.confirmationResolver=null,this.notify(),t?.(e)}updatePipeline(e){Object.assign(this.pipeline,e),this.notify()}applyStepEvents(e){let t=e.map(e=>(this.eventIdCounter+=1,{...e,id:this.eventIdCounter,timestamp:new Date,message:e.message.slice(0,5e3)}));this.events=[...this.events.slice(-(We-t.length)),...t]}addEvent(e){this.applyStepEvents([e])}updateEntityStatus(e,t){let n=new Map(this.entities),r=n.get(e);r?.status&&!Ge[r.status].includes(t)||(n.set(e,r?{...r,status:t}:{name:e,path:e,status:t}),this.entities=n)}removeEntity(e){let t=new Map(this.entities);t.delete(e),this.entities=t}updateAllEntitiesStatus(e){let t=new Map(this.entities);for(let[n,r]of t)t.set(n,{...r,status:e});this.entities=t}updateEntitiesFromManifest(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=Ue[n];if(e)for(let n of r)t.set(n,e)}let n=new Map(this.entities);for(let[e,r]of n)n.set(e,{...r,type:t.get(e)});for(let[e,r]of t)n.has(e)||n.set(e,{name:e,path:e,type:r,status:`pending`});this.entities=n}hasObjectsOrFieldsChanged(e){let t=JSON.stringify({objects:e.objects,fields:e.fields}),n=t!==this.previousObjectsFieldsFingerprint;return this.previousObjectsFieldsFingerprint=t,n}},qe={idle:{color:`gray`,icon:`○`},in_progress:{color:`yellow`,icon:`spinner`},uploading:{color:`cyan`,icon:`upload`},done:{color:`green`,icon:`✓`},error:{color:`red`,icon:`✗`}},Je=e=>({idle:`idle`,in_progress:`in_progress`,done:`done`,error:`error`})[e],Ye=e=>({pending:`idle`,building:`in_progress`,uploading:`uploading`,success:`done`,error:`error`})[e],Xe=e=>({idle:`idle`,building:`in_progress`,syncing:`in_progress`,synced:`done`,error:`error`})[e],Ze={idle:`Idle`,building:`Building...`,syncing:`Syncing...`,synced:`Synced`,error:`Error`},Qe=[`◐`,`◓`,`◑`,`◒`],$e=[`↑`,`⇡`,`↑`,`⇡`],et={[e.c.Object]:`Objects`,[e.c.Field]:`Fields`,[e.c.LogicFunction]:`Logic functions`,[e.c.FrontComponent]:`Front components`,[e.c.CommandMenuItem]:`Command menu items`,[e.c.Role]:`Roles`,[e.c.Skill]:`Skills`,[e.c.View]:`Views`,[e.c.ViewField]:`View fields`,[e.c.NavigationMenuItem]:`Navigation menu items`,[e.c.PageLayout]:`Page layouts`,[e.c.PageLayoutTab]:`Page layout tabs`,[e.c.Agent]:`Agents`,[e.c.ConnectionProvider]:`Connection providers`,[e.c.TimelineActivityType]:`Timeline activity types`},tt=Object.keys(et),nt={info:`gray`,success:`green`,error:`red`,warning:`yellow`},rt=e=>e.toLocaleTimeString(`en-US`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),it=(e,t=40)=>{if(e.length<=t)return e;let n=e.split(`/`);return n.length<=2?e:`.../${n.slice(-2).join(`/`)}`},at=e=>{let t=new Map;for(let e of tt)t.set(e,[]);for(let n of e.values()){if(!n.type)continue;let e=t.get(n.type)??[];e.push(n),t.set(n.type,e)}return t},ot=[{status:`success`,label:`synced`},{status:`building`,label:`building`},{status:`uploading`,label:`uploading`},{status:`pending`,label:`pending`},{status:`error`,label:`error`}],st=e=>{let t={pending:0,building:0,uploading:0,success:0,error:0};for(let n of e)t[n.status]+=1;return ot.filter(({status:e})=>t[e]>0).map(({status:e,label:n})=>({status:e,count:t[e],label:n}))},ct=t=>{let n=t.steps.resolveApplication.output.applicationId;return!e.yt(t.frontendUrl)||!e.yt(n)?null:`${t.frontendUrl}/settings/applications/${n}`},lt=e=>e.some(e=>e===`error`)?`error`:e.some(e=>e===`in_progress`)?`in_progress`:e.every(e=>e===`done`)?`done`:`idle`,ut=e=>{let t=[...e.entities.values()],n=t.some(e=>e.status===`error`),r=t.some(e=>e.status===`building`),i=t.length>0&&t.every(e=>e.status===`uploading`||e.status===`success`),a=n?`error`:r?`in_progress`:i?`done`:`idle`;return[{label:`Application Initialization`,status:lt([e.steps.checkServer.status,e.steps.ensureValidTokens.status,e.steps.resolveApplication.status])},{label:`Resources Build`,status:a},{label:`Resources Upload`,status:e.steps.uploadFiles.status},{label:`Manifest Build`,status:e.steps.buildManifest.status},{label:`Application Synchronization`,status:e.steps.syncApplication.status},{label:`Api Client Generation`,status:e.steps.generateApiClient.status}]},R=120,dt=Math.round(200/R),z=()=>{let e=Math.floor(Date.now()/R);return{spinnerFrame:Qe[e%Qe.length],uploadFrame:$e[Math.floor(e/dt)%$e.length]}},ft=e=>{let t=qe[e];return t.icon===`spinner`?z().spinnerFrame:t.icon===`upload`?z().uploadFrame:t.icon},pt=o.default.createContext(null),mt=pt.Provider,ht=()=>{let e=o.default.useContext(pt);if(!e)throw Error(`useInk must be used within InkProvider`);return e},gt=({uiStatus:e})=>{let{Text:t}=ht(),n=ft(e),r=qe[e];return(0,p.jsxs)(t,{color:r.color,children:[n,` `]})},_t=({entity:e})=>{let{Box:t,Text:n}=ht();return(0,p.jsxs)(t,{children:[(0,p.jsx)(gt,{uiStatus:Ye(e.status)}),(0,p.jsx)(n,{children:e.name}),e.path!==e.name&&(0,p.jsxs)(n,{dimColor:!0,children:[` (`,it(e.path),`)`]})]})},vt=({type:e,entities:t})=>{let{Box:n,Text:r}=ht();return t.length===0?null:(0,p.jsxs)(n,{flexDirection:`column`,marginTop:1,children:[(0,p.jsx)(r,{bold:!0,dimColor:!0,children:et[e]}),t.map(e=>(0,p.jsx)(_t,{entity:e},e.path))]})},yt=({entities:e})=>{let{Box:t,Text:n}=ht();if(e.length===0)return null;let r=st(e);return(0,p.jsxs)(t,{marginTop:1,children:[(0,p.jsxs)(n,{bold:!0,dimColor:!0,children:[`Entities`,` `]}),r.map((e,r)=>(0,p.jsxs)(t,{children:[r>0&&(0,p.jsx)(n,{dimColor:!0,children:` · `}),(0,p.jsx)(gt,{uiStatus:Ye(e.status)}),(0,p.jsxs)(n,{children:[e.count,` `,e.label]})]},e.status))]})},bt=()=>{let{Box:e,Text:t}=ht();return(0,p.jsx)(e,{marginTop:1,children:(0,p.jsxs)(t,{dimColor:!0,children:[(0,p.jsx)(t,{color:qe.idle.color,children:qe.idle.icon}),` `,`pending`,` `,(0,p.jsx)(t,{color:qe.in_progress.color,children:Qe[0]}),` `,`building`,` `,(0,p.jsx)(t,{color:qe.uploading.color,children:$e[0]}),` `,`uploading`,` `,(0,p.jsx)(t,{color:qe.done.color,children:qe.done.icon}),` `,`success`,` `,(0,p.jsx)(t,{color:qe.error.color,children:qe.error.icon}),` `,`error`]})})},xt=7,St=({versionInfo:e})=>{let{Box:t,Text:n}=ht();if(e===null)return null;let{cliVersion:r,localServerVersion:i,latestServerVersion:a,isMinorOrMajorBehind:o,daysBehind:s}=e,c=o&&s!==null&&s>xt;return(0,p.jsxs)(t,{children:[(0,p.jsx)(n,{dimColor:!0,children:`Versions: `}),(0,p.jsx)(n,{dimColor:!0,children:`CLI `}),(0,p.jsxs)(n,{children:[`v`,r]}),i!==null&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n,{dimColor:!0,children:` • Server `}),(0,p.jsxs)(n,{color:c?`yellow`:void 0,children:[`v`,i]}),i!==null&&a!==null&&i===a&&(0,p.jsx)(n,{color:`green`,children:` ✓ latest`}),c&&a!==null&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(n,{color:`yellow`,children:[` → v`,a]}),s!==null&&(0,p.jsxs)(n,{dimColor:!0,children:[` (`,s,`d behind)`]})]})]})]})},Ct=({state:e})=>{let{Text:t}=ht(),n=Xe(e.pipeline.status),r=ft(n),i=qe[n],a=Ze[e.pipeline.status];return(0,p.jsxs)(t,{color:i.color,children:[r,` `,a]})},wt=({label:e,status:t})=>{let{Box:n,Text:r}=ht(),i=Je(t),a=ft(i),o=qe[i];return(0,p.jsxs)(n,{children:[(0,p.jsxs)(r,{dimColor:!0,children:[e,`: `]}),(0,p.jsxs)(r,{color:o.color,children:[a,` `,t.replace(`_`,` `)]})]})},Tt=({state:e,verbose:t=!1})=>{let{Box:n,Text:r}=ht(),i=at(e.entities),a=ct(e);return(0,p.jsxs)(n,{flexDirection:`column`,borderStyle:`classic`,borderColor:`gray`,paddingX:1,children:[(0,p.jsx)(r,{bold:!0,color:`cyan`,children:`Application`}),(0,p.jsxs)(n,{marginLeft:2,flexDirection:`column`,children:[(0,p.jsxs)(n,{children:[(0,p.jsx)(r,{dimColor:!0,children:`Name: `}),(0,p.jsx)(r,{bold:!0,children:e.pipeline.appName??`Loading...`})]}),(0,p.jsxs)(n,{children:[(0,p.jsx)(r,{dimColor:!0,children:`Overall Status: `}),(0,p.jsx)(Ct,{state:e})]}),a&&(0,p.jsxs)(n,{children:[(0,p.jsx)(r,{dimColor:!0,children:`Open:`}),(0,p.jsxs)(r,{bold:!0,color:`cyan`,children:[` `,a]})]}),(0,p.jsx)(St,{versionInfo:e.versionInfo})]}),(0,p.jsx)(n,{marginLeft:2,flexDirection:`column`,marginTop:1,children:ut(e).map(e=>(0,p.jsx)(wt,{label:e.label,status:e.status},e.label))}),(0,p.jsx)(n,{marginLeft:2,flexDirection:`column`,children:t?tt.map(e=>(0,p.jsx)(vt,{type:e,entities:i.get(e)??[]},e)):(0,p.jsx)(yt,{entities:Array.from(e.entities.values())})})]})},Et=({state:e})=>{let{Box:t,Text:n,useInput:r}=ht(),i=e.pendingConfirmation;return r((t,n)=>{if(e.pendingConfirmation){if(t.toLowerCase()===`y`){e.resolveDestructiveConfirmation(!0);return}(t.toLowerCase()===`n`||n.escape)&&e.resolveDestructiveConfirmation(!1)}}),i?(0,p.jsxs)(t,{marginTop:1,flexDirection:`column`,borderStyle:`classic`,borderColor:`red`,paddingX:1,children:[(0,p.jsxs)(n,{color:`red`,bold:!0,children:[`⚠ `,i.deleteCount,` destructive change(s) detected`]}),(0,p.jsxs)(n,{children:[`Apply and DESTROY `,i.deleteCount,` metadata entity(ies)? Press`,` `,(0,p.jsx)(n,{color:`green`,bold:!0,children:`y`}),` `,`to apply,`,` `,(0,p.jsx)(n,{color:`red`,bold:!0,children:`n`}),` `,`to cancel and stop watching.`]})]}):null},Dt=({event:e})=>{let{Box:t,Text:n}=ht(),r=nt[e.status],i=rt(e.timestamp);return(0,p.jsxs)(t,{marginTop:+!!e.spacingBefore,children:[(0,p.jsxs)(n,{dimColor:!0,children:[i,` `]}),(0,p.jsx)(n,{color:r,children:e.message})]})},Ot=new Set([`building`,`syncing`]),kt=120,At=80,jt=({uiStateManager:e,verbose:t})=>{let{Box:n,Static:r}=ht(),[,i]=(0,o.useReducer)(e=>e+1,0),a=(0,o.useRef)(null),s=(0,o.useRef)(0),c=(0,o.useCallback)(()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,s.current=Date.now(),i()},At)},[]);(0,o.useEffect)(()=>e.subscribe(()=>{c()}),[e,c]),(0,o.useEffect)(()=>{let t=setInterval(()=>{let t=e.getSnapshot();Ot.has(t.pipeline.status)&&(Date.now()-s.current<kt||i())},kt);return()=>clearInterval(t)},[e]),(0,o.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]);let l=e.getSnapshot();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r,{items:l.events,children:e=>(0,p.jsx)(Dt,{event:e},e.id)}),(0,p.jsxs)(n,{marginTop:1,flexDirection:`column`,children:[(0,p.jsx)(Tt,{state:l,verbose:t}),t&&(0,p.jsx)(bt,{})]}),l.pendingConfirmation&&(0,p.jsx)(Et,{state:l})]})},Mt=async(e,t=!1)=>{let{render:n,Box:r,Text:i,Static:a,useInput:o}=await import(`ink`),{unmount:s}=n((0,p.jsx)(mt,{value:{Box:r,Text:i,Static:a,useInput:o},children:(0,p.jsx)(jt,{uiStateManager:e,verbose:t})}));return{unmount:s}},Nt=class{constructor(e){this.listeners=new Set,this.pendingNotify=!1,this.orchestratorState=e}getSnapshot(){return this.orchestratorState}subscribe(e){return this.listeners.add(e),e(this.orchestratorState),()=>this.listeners.delete(e)}notify(){this.pendingNotify||(this.pendingNotify=!0,queueMicrotask(()=>{this.pendingNotify=!1;for(let e of this.listeners)e(this.orchestratorState)}))}},Pt=class{constructor(){this.orchestrator=null,this.unmountUI=null}async close(){this.unmountUI?.(),await this.orchestrator?.close()}getOrchestrator(){return this.orchestrator}async ensureAuthenticatedBeforeLaunch(){let{serverUp:e,authValid:n}=await new t.z({disableInterceptors:!0}).validateAuth();e&&!n&&await t.V(t.U.getActiveRemote())}async execute(e){let n=e.appPath??t.Dt;await y(n),e.headless&&await t.y(),await this.ensureAuthenticatedBeforeLaunch();let r=new Ke({appPath:n});if(!e.headless){let n=new Nt(r);r.onChange=()=>n.notify();let{unmount:i}=await Mt(n,e.verbose);this.unmountUI=i,t.b().then(e=>r.setVersionInfo(e))}this.orchestrator=new He({state:r,verbose:e.verbose,debounceMs:e.debounceMs,force:e.force,interactive:!e.headless&&process.stdout.isTTY===!0,onExit:({code:t,message:n})=>{e.headless||this.close().then(()=>{console.log(u.default.yellow(`\n${n}`)),process.exit(t)})}}),await this.orchestrator.start(),e.headless||this.setupGracefulShutdown()}setupGracefulShutdown(){let e=()=>void this.close().then(()=>process.exit(0));process.on(`SIGINT`,e),process.on(`SIGTERM`,e)}},Ft=async(e,{force:t})=>{if(t)return!0;if(!process.stdout.isTTY)return console.error(u.default.red(`${e} destructive change(s) detected. Run \`yarn twenty plan\` to review them, or re-run with --force to apply non-interactively.`)),!1;let{confirmed:n}=await d.default.prompt([{type:`confirm`,name:`confirmed`,message:`Twenty will DESTROY ${e} metadata entity(ies) (run \`yarn twenty plan\` for details). Do you want to perform these actions?`,default:!1}]);return n},It=class{async execute(e){let n=e.appPath??t.Dt,r=e.apply??!1;await y(n);let i=t.U.getActiveRemote();console.log(u.default.blue(`${r?`Applying application manifest`:`Planning application apply`} on ${i}...`)),console.log(u.default.gray(`App path: ${n}\n`));let a=await t.a({appPath:n,verbose:e.verbose,apply:r,force:e.force,onProgress:e=>console.log(u.default.gray(e)),onPlan:e=>console.log(`\n${e}\n`),confirmApply:t=>Ft(t,{force:e.force})});if(a.success||(a.error.code===t.K.APPLY_ABORTED&&(console.log(u.default.yellow(a.error.message)),process.exit(1)),console.error(u.default.red(a.error.message)),process.exit(1)),!r){console.log(u.default.green(`\n✓ Plan complete for ${a.data.applicationDisplayName} — no changes were applied`));return}console.log(u.default.green(`\n✓ Synced ${a.data.applicationDisplayName} (${a.data.fileCount} file${a.data.fileCount===1?``:`s`})`)),console.log(u.default.gray(`Output: ${a.data.outputDir}`))}},Lt=e=>{let t=new be,n=new ye;e.command(`dev:function:logs [appPath]`).description(`Stream logic function logs`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Only show logs for the function with this universal ID`).option(`-n, --functionName <functionName>`,`Only show logs for the function with this name`).action(async(e,n)=>{await t.execute({...n,appPath:g(e)})}),e.command(`dev:function:exec [appPath]`).description(`Execute a logic function`).option(`--postInstall`,`Execute post-install logic function if defined`).option(`--preInstall`,`Execute pre-install logic function if defined`).option(`--uninstall`,`Execute uninstall logic function if defined`).option(`-p, --payload <payload>`,`JSON payload to send to the function`,`{}`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Universal ID of the function to execute`).option(`-n, --functionName <functionName>`,`Name of the function to execute`).action(async(e,t)=>{!t?.postInstall&&!t?.preInstall&&!t?.uninstall&&!t?.functionUniversalIdentifier&&!t?.functionName&&(console.error(u.default.red(`Error: Either --postInstall, --preInstall, --uninstall, --functionName (-n), or --functionUniversalIdentifier (-u) is required.`)),process.exit(1)),await n.execute({...t,payload:t?.payload??`{}`,appPath:g(e)})})},Rt=class{async execute(e){let r=e.appPath??t.Dt,i=(0,n.join)(r,`node_modules`,`twenty-client-sdk`);await t.yt(i)||(console.error(u.default.red(`Cannot find twenty-client-sdk in ${r}.\n\n Install it first:
354
+ Waiting for server...`,status:`error`}]),this.state.updatePipeline({status:`error`})),!1)}if(!r.authValid)return n.output.errorLogged||(n.output={isReady:!1,errorLogged:!0},n.status=`error`,this.state.applyStepEvents([{message:"Authentication failed. Run `yarn twenty remote:add` to authenticate.",status:`error`}]),this.state.updatePipeline({status:`error`})),!1;let i=n.output.isReady;if(n.output={isReady:!0,errorLogged:!1},n.status=`done`,!e.St(this.state.frontendUrl)){let t=await this.apiService.getWorkspaceFrontendUrl();e.St(t)&&(this.state.frontendUrl=t)}return i||this.notify(),!0}},L=class{constructor({clientService:e,configService:t,state:n,notify:r}){this.clientService=e,this.configService=t,this.state=n,this.notify=r}async execute(e){let n=this.state.steps.generateApiClient;n.status=`in_progress`,this.notify();try{let r=await t.f(this.configService,e.tokenSources);await this.clientService.generateCoreClient({appPath:e.appPath,appAccessToken:r}),n.status=`done`}catch(e){this.state.applyStepEvents([{message:`Failed to generate API client: ${e instanceof Error?e.message:String(e)}`,status:`error`}]),n.status=`error`}this.notify()}},De=class{constructor({apiService:e,configService:t,state:n,notify:r}){this.apiService=e,this.configService=t,this.state=n,this.notify=r}async execute(e){try{let n=await t.d(this.apiService,this.configService,{name:e.manifest.application.displayName,universalIdentifier:e.manifest.application.universalIdentifier});this.registrationCredentials={clientId:n.clientId,clientSecret:n.clientSecret},this.state.applyStepEvents([{message:n.isNewRegistration?`App registration created: ${e.manifest.application.displayName}`:`Existing app registration found`,status:n.isNewRegistration?`success`:`info`},...n.isNewRegistration?[{message:`Credentials saved to config.`,status:`info`}]:[]])}catch(e){throw this.state.applyStepEvents([{message:`Failed to register app: ${e instanceof Error?e.message:String(e)}`,status:`error`}]),e}this.notify()}},Oe=class{constructor(e){this.watcher=null,this.appPath=e.appPath,this.fileFolder=e.fileFolder,this.watchPaths=e.watchPaths,this.handleFileBuilt=e.handleFileBuilt}async start(){let e=(await Promise.all(this.watchPaths.map(async e=>{let r=(0,n.join)(this.appPath,e);return await t.yt(r)?r:null}))).filter(e=>e!==null);e.length!==0&&(this.watcher=f.default.watch(e,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.watcher.on(`all`,(e,t)=>{e===`addDir`||e===`unlinkDir`||((e===`add`||e===`change`)&&this.copyAndNotify(t),e===`unlink`&&this.handleUnlink(t))}))}async close(){await this.watcher?.close()}async copyAndNotify(i){let a=(0,n.relative)(this.appPath,i),o=(0,n.join)(e.i,a),s=(0,n.join)(this.appPath,o);await t.vt((0,n.dirname)(s)),await t.gt(i,s);let l=await(0,r.readFile)(s),u=c.default.createHash(`md5`).update(l).digest(`hex`);this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:a,checksum:u})}async handleUnlink(r){let i=(0,n.join)(e.i,(0,n.relative)(this.appPath,r));await t.xt((0,n.join)(this.appPath,i))}},ke=[`package.json`,`yarn.lock`],Ae=class{constructor(e){this.componentsWatcher=null,this.sharedDependenciesBuildContext=null,this.lastSharedDependenciesChecksum=null,this.installedDependenciesWatcher=null,this.isClosed=!1,this.isApplyingRestart=!1,this.sharedDependenciesBuildGeneration=0,this.inFlightSharedDependenciesBuildPromise=null,this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!1,this.appPath=e.appPath,this.sourcePaths=e.sourcePaths,this.sharedDependencies=e.sharedDependencies,this.watchMode=e.watch??!0,this.shouldSkipTypecheck=e.shouldSkipTypecheck,this.handleFileBuilt=e.handleFileBuilt,this.handleBuildError=e.handleBuildError}getSharedDependenciesBuildContext(){return this.sharedDependenciesBuildContext}shouldRestart(e,t){return(this.componentsWatcher?.shouldRestart(e)??!0)||this.hasSharedDependenciesManifestChanged(t)}async start(){e.St(this.sharedDependencies)&&(await this.requestSharedDependenciesBuild(),await this.startInstalledDependenciesWatcher()),this.componentsWatcher=new t.ut({appPath:this.appPath,sourcePaths:this.sourcePaths,watch:this.watchMode,handleFileBuilt:this.handleFileBuilt,handleBuildError:this.handleBuildError,config:{externalModules:t.lt,fileFolder:e.tt.BuiltFrontComponent,jsx:`automatic`,extraPlugins:[t.ft(this.appPath,this.shouldSkipTypecheck),...e.t({getSharedDependenciesBuildContext:()=>this.sharedDependenciesBuildContext}),t.ht()]}}),await this.componentsWatcher.start()}async restart(t,n){this.isApplyingRestart=!0;try{let r=this.hasSharedDependenciesManifestChanged(n);this.sourcePaths=t,r&&(this.sharedDependenciesBuildGeneration+=1,this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!1,await this.inFlightSharedDependenciesBuildPromise,await this.installedDependenciesWatcher?.close(),this.installedDependenciesWatcher=null,this.sharedDependencies=n,this.sharedDependenciesBuildContext=null,this.lastSharedDependenciesChecksum=null,e.St(n)&&(await this.requestSharedDependenciesBuild(),await this.startInstalledDependenciesWatcher())),await this.componentsWatcher?.restart(t)}finally{this.isApplyingRestart=!1}}async close(){this.isClosed=!0,await this.installedDependenciesWatcher?.close(),this.installedDependenciesWatcher=null,await this.componentsWatcher?.close(),this.componentsWatcher=null}hasSharedDependenciesManifestChanged(t){return!e.St(t)||!e.St(this.sharedDependencies)?e.St(t)!==e.St(this.sharedDependencies):t.dependencies.join(`,`)!==this.sharedDependencies.dependencies.join(`,`)}async requestSharedDependenciesBuild(){if(e.St(this.inFlightSharedDependenciesBuildPromise)){this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!0;return}this.inFlightSharedDependenciesBuildPromise=this.runSharedDependenciesBuild();try{await this.inFlightSharedDependenciesBuildPromise}finally{this.inFlightSharedDependenciesBuildPromise=null,this.hasSharedDependenciesBuildRequestedDuringInFlightBuild&&(this.hasSharedDependenciesBuildRequestedDuringInFlightBuild=!1,await this.requestSharedDependenciesBuild())}}async runSharedDependenciesBuild(){let n=this.sharedDependencies,r=this.sharedDependenciesBuildGeneration;if(!e.St(n))return;let i=()=>this.isClosed||r!==this.sharedDependenciesBuildGeneration;try{let e=null,r=await t.ct({appPath:this.appPath,sharedDependencies:n,onFileBuilt:async t=>{e=t.checksum,!(i()||t.checksum===this.lastSharedDependenciesChecksum)&&await this.handleFileBuilt(t)}});if(i())return;this.sharedDependenciesBuildContext=r,e!==this.lastSharedDependenciesChecksum&&(this.lastSharedDependenciesChecksum=e,this.isApplyingRestart||await this.componentsWatcher?.restart(this.sourcePaths))}catch(e){if(i())return;await this.handleBuildError([{error:e instanceof Error?e.message:String(e),location:null}])}}async startInstalledDependenciesWatcher(){let r=(await Promise.all(ke.map(async e=>{let r=(0,n.join)(this.appPath,e);return await t.yt(r)?r:null}))).filter(e.St);(0,i.isNonEmptyArray)(r)&&(this.installedDependenciesWatcher=f.default.watch(r,{ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.installedDependenciesWatcher.on(`all`,e=>{(e===`add`||e===`change`)&&this.requestSharedDependenciesBuild()}))}},je=class{constructor(e){this.process=null,this.pendingErrors=[],this.buffer=``,this.hasErrors=!1,this.appPath=e.appPath,this.onErrors=e.onErrors}async start(){let e=s.default.join(this.appPath,`node_modules`,`.bin`,`tsc`);if(!await t.yt(e))return;let n=s.default.join(this.appPath,`tsconfig.json`);this.process=(0,l.spawn)(e,[`--watch`,`--noEmit`,`--pretty`,`false`,`-p`,n],{cwd:this.appPath,stdio:[`ignore`,`pipe`,`pipe`]}),this.process.on(`error`,()=>{this.process=null}),this.process.stdout?.on(`data`,e=>{this.handleOutput(e.toString())}),this.process.stderr?.on(`data`,e=>{this.handleOutput(e.toString())})}close(){this.process?.kill(),this.process=null}handleOutput(e){this.buffer+=e;let t=this.buffer.split(`
355
+ `);this.buffer=t.pop()??``;for(let e of t)this.processLine(e)}processLine(e){if(e.includes(`Starting compilation in watch mode...`)||e.includes(`Starting incremental compilation...`)){this.pendingErrors=[];return}if(e.includes(`Watching for file changes.`)){let e=this.hasErrors;this.hasErrors=this.pendingErrors.length>0,(this.hasErrors||e)&&this.onErrors(this.pendingErrors),this.pendingErrors=[];return}let n=t.pt(e);n&&this.pendingErrors.push(n)}},Me=new Set([`node_modules`,`dist`,`.twenty`]),Ne=class{constructor(e){this.watcher=null,this.appPath=e.appPath,this.handleChangeDetected=e.handleChangeDetected,this.verbose=e.verbose??!1}async start(){let t=this.appPath;this.watcher=f.default.watch(this.appPath,{ignoreInitial:!this.verbose,ignored:e=>{let r=(0,n.relative)(t,e);if(r===``)return!1;let i=r.split(n.default.sep)[0];return Me.has(i)||i.startsWith(`.`)},awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.watcher.on(`all`,(t,r)=>{if(t===`addDir`||t===`unlinkDir`)return;let i=(0,n.relative)(this.appPath,r),a=i.startsWith(e.o),o=[`package.json`,`yarn.lock`].includes(i);!(i.endsWith(`.ts`)||i.endsWith(`.tsx`))&&!a&&!o||this.handleChangeDetected(i,t)})}async close(){await this.watcher?.close()}},Pe=class{constructor(e){this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.tscWatcher=null,this.state=e.state,this.scheduleSync=e.scheduleSync,this.notify=e.notify,this.onFileBuilt=e.onFileBuilt,this.shouldSkipTypecheck=e.shouldSkipTypecheck,this.verbose=e.verbose??!1}async start(){this.state.steps.startWatchers.status=`in_progress`,this.notify(),this.manifestWatcher=new Ne({appPath:this.state.appPath,handleChangeDetected:this.handleChangeDetected.bind(this),verbose:this.verbose}),await this.manifestWatcher.start()}async handleWatcherRestarts(e){let{logicFunctions:t,frontComponents:n}=e.filePaths,r=e.manifest?.application.frontComponentSharedDependencies;if(!this.state.steps.startWatchers.output.watchersStarted){this.state.steps.startWatchers.output.watchersStarted=!0,this.state.steps.startWatchers.status=`done`,await this.startFileWatchers(t,n,r);return}this.logicFunctionsWatcher?.shouldRestart(t)&&await this.logicFunctionsWatcher.restart(t),this.frontComponentsWatcher?.shouldRestart(n,r)&&await this.frontComponentsWatcher.restart(n,r)}async close(){this.tscWatcher?.close(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()])}handleChangeDetected(e,t){this.state.addEvent({message:`Change detected: ${e}`,status:`info`,spacingBefore:!0}),t===`unlink`?this.state.removeEntity(e):this.state.updateEntityStatus(e,`building`),this.notify(),this.scheduleSync()}handleFileBuildError(e){this.state.addEvent({message:`Build failed:`,status:`error`});for(let t of e)this.state.addEvent({message:t.error,status:`error`});this.notify()}handleFileBuilt(e){this.verbose&&this.state.addEvent({message:`Successfully built ${e.builtPath}`,status:`success`}),this.state.steps.uploadFiles.output.builtFileInfos.set(e.builtPath,{checksum:e.checksum,builtPath:e.builtPath,sourcePath:e.sourcePath,fileFolder:e.fileFolder,usesSdkClient:e.usesSdkClient}),this.onFileBuilt(e),this.notify(),this.scheduleSync()}async startFileWatchers(e,t,n){await Promise.all([this.startTscWatcher(),this.startLogicFunctionsWatcher(e),this.startFrontComponentsWatcher(t,n),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(e){this.logicFunctionsWatcher=t.dt({appPath:this.state.appPath,sourcePaths:e,shouldSkipTypecheck:this.shouldSkipTypecheck,handleBuildError:this.handleFileBuildError.bind(this),handleFileBuilt:this.handleFileBuilt.bind(this)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(e,t){this.frontComponentsWatcher=new Ae({appPath:this.state.appPath,sourcePaths:e,sharedDependencies:t,shouldSkipTypecheck:this.shouldSkipTypecheck,handleBuildError:this.handleFileBuildError.bind(this),handleFileBuilt:this.handleFileBuilt.bind(this)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new Oe({appPath:this.state.appPath,fileFolder:e.tt.PublicAsset,watchPaths:[e.o],handleFileBuilt:this.handleFileBuilt.bind(this)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Oe({appPath:this.state.appPath,fileFolder:e.tt.Dependencies,watchPaths:[`package.json`,`yarn.lock`],handleFileBuilt:this.handleFileBuilt.bind(this)}),this.dependencyWatcher.start()}async startTscWatcher(){this.tscWatcher=new je({appPath:this.state.appPath,onErrors:this.handleTypecheckErrors.bind(this)}),await this.tscWatcher.start()}handleTypecheckErrors(e){e.length===0?this.state.addEvent({message:`Typecheck passed`,status:`success`}):this.state.applyStepEvents(e.map(e=>({message:`Type error in ${e.file}(${e.line},${e.column}): ${e.text}`,status:`error`}))),this.notify()}},Fe=50,Ie={create:`created`,update:`updated`,delete:`deleted`},Le=e=>{if(e.type===`create`)return t.u(e.flatEntity)??`unknown`;let n=t.u(e.flatEntity);return n&&n!==e.universalIdentifier?`${n} (${e.universalIdentifier})`:e.universalIdentifier},Re=t=>{if(t.type!==`update`||!e.St(t.diff))return``;let n=Object.keys(t.diff);return n.length===0?``:` [${n.join(`, `)}] changed`},ze=t=>{let n=t??[];if(n.length===0)return[{message:`No metadata changes`,status:`info`}];let r={create:0,update:0,delete:0};for(let e of n)r[e.type]+=1;let i=[{message:`Metadata changes: ${[r.create>0?`${r.create} created`:null,r.update>0?`${r.update} updated`:null,r.delete>0?`${r.delete} deleted`:null].filter(e.St).join(`, `)}`,status:`info`}],a=n.slice(0,Fe);for(let e of a){let t=Le(e),n=Re(e);i.push({message:` ${Ie[e.type]} ${e.metadataName} ${t}${n}`,status:`info`})}let o=n.length-a.length;return o>0&&i.push({message:` …and ${o} more change(s)`,status:`info`}),i},Be=class{constructor({apiService:e,state:t,notify:n,verbose:r,force:i,interactive:a,onExit:o}){this.apiService=e,this.state=t,this.notify=n,this.verbose=r??!1,this.force=i??!1,this.interactive=a??!1,this.onExit=o}async execute(e){let n=this.state.steps.syncApplication;n.status=`in_progress`,this.state.updatePipeline({status:`syncing`});let r=[],i={...t.$({manifest:e.manifest,builtFileInfos:e.builtFileInfos}),translations:await t.Z(e.appPath)};if(r.push({message:`Manifest checksums set`,status:`info`}),await t.Q(e.appPath,i),r.push({message:`Manifest saved to output directory`,status:`info`}),!this.force){r.push({message:`Computing metadata plan`,status:`info`});let e=await this.apiService.syncApplication(i,{dryRun:!0});if(!e.success){this.applyFailure(e,r);return}if(t.l(e.data.actions)&&await this.gateDestructiveChange(t.c(e.data.actions),r))return}r.push({message:`Syncing manifest`,status:`info`});let a=await this.apiService.syncApplication(i);if(a.success){r.push(...ze(a.data.actions)),r.push({message:`✓ Synced`,status:`success`}),n.output={syncStatus:`synced`,error:null},n.status=`done`,this.state.updatePipeline({status:`synced`,error:null}),this.state.updateAllEntitiesStatus(`success`),this.state.applyStepEvents(r);return}this.applyFailure(a,r)}async gateDestructiveChange(e,t){let n=this.state.steps.syncApplication,r=(e,r)=>{t.push({message:e,status:`warning`}),n.output={syncStatus:`idle`,error:null},n.status=`done`,this.state.updatePipeline({status:`idle`,error:null}),this.state.applyStepEvents(t),this.onExit?.({code:1,message:r})};return this.interactive?(this.state.applyStepEvents(t),t.length=0,await this.state.requestDestructiveConfirmation(e)?!1:(r(`Declined ${e} destructive change(s)`,`Stopping: declined ${e} destructive change(s). Re-run with \`yarn twenty dev --force\` to apply deletions or \`yarn twenty plan\` to preview changes.`),!0)):(r(`${e} destructive change(s) require --force`,`Stopping: ${e} destructive change(s) need confirmation. Re-run with \`yarn twenty dev --force\` to apply deletions.`),!0)}applyFailure(e,n){let r=this.state.steps.syncApplication,i=this.verbose?null:t.P(e.error);i?(n.push(...i),n.push({message:`Add --verbose to see full error log`,status:`info`})):n.push({message:`Sync failed with error: ${e.message??`Sync failed`}`,status:`error`});let a=t.s(e.message);a&&n.push({message:a,status:`info`});let o=i?i[0].message:`Sync failed`;r.output={syncStatus:`error`,error:o},r.status=`error`,this.state.updatePipeline({status:`error`,error:o}),this.state.updateAllEntitiesStatus(`error`),this.state.applyStepEvents(n)}},Ve=class{constructor({state:e,notify:t,verbose:n}){this.uploadedCount=0,this.failedCount=0,this.totalQueued=0,this.state=e,this.notify=t,this.verbose=n??!1}get isInitialized(){return e.St(this.state.steps.uploadFiles.output.fileUploader)}initialize(e){let n=this.state.steps.uploadFiles;n.output={...n.output,fileUploader:new t.o({appPath:e.appPath,applicationUniversalIdentifier:e.universalIdentifier})},n.status=`in_progress`,this.notify(),this.uploadPendingFiles()}uploadFile(e,t,n){this.queueUploads([{builtPath:e,sourcePath:t,fileFolder:n}])}async waitForUploads(){let e=this.state.steps.uploadFiles;for(;e.output.activeUploads.size>0;)await Promise.all(e.output.activeUploads);e.status=`done`,this.notify()}logUploadSummary(){if(this.totalQueued===0){this.resetCounters();return}this.failedCount>0&&this.state.addEvent({message:`Uploaded ${this.uploadedCount}/${this.totalQueued} files (${this.failedCount} failed)`,status:`error`}),this.state.addEvent({message:`Successfully uploaded ${this.uploadedCount} file${this.uploadedCount===1?``:`s`}`,status:`success`}),this.resetCounters()}resetCounters(){this.uploadedCount=0,this.failedCount=0,this.totalQueued=0}uploadPendingFiles(){this.queueUploads(Array.from(this.state.steps.uploadFiles.output.builtFileInfos.entries()).map(([e,{fileFolder:t,sourcePath:n}])=>({builtPath:e,sourcePath:n,fileFolder:t})))}queueUploads(t){let n=this.state.steps.uploadFiles,r=n.output.fileUploader;if(!e.St(r)||t.length===0)return;n.status=`in_progress`,this.totalQueued+=t.length,this.verbose&&this.state.addEvent({message:`Uploading ${t.map(({builtPath:e})=>e).join(`, `)}`,status:`info`});for(let{sourcePath:e}of t)this.state.updateEntityStatus(e,`uploading`);this.notify();let i=r.uploadFiles(t.map(({builtPath:e,fileFolder:t})=>({builtPath:e,fileFolder:t}))).then(e=>{for(let t of e)this.failedCount++,this.state.addEvent({message:`Failed to upload ${t.builtPath}: ${t.error}`,status:`error`});for(let{builtPath:n,sourcePath:r}of t)e.some(e=>e.builtPath===n)||(this.uploadedCount++,this.verbose&&this.state.addEvent({message:`Successfully uploaded ${n}`,status:`success`}),this.state.updateEntityStatus(r,`success`))}).catch(e=>{this.failedCount+=t.length,this.state.addEvent({message:`Upload failed: ${e}`,status:`error`})}).finally(()=>{n.output.activeUploads.delete(i),n.output.activeUploads.size===0&&(this.logUploadSummary(),n.status=`done`,this.notify())});n.output.activeUploads.add(i)}},He=class{constructor(e){this.syncTimer=null,this.serverCheckInterval=null,this.syncRequestedWhileRunning=!1,this.isClosed=!1,this.skipTypecheck=!0,this.debounceMs=e.debounceMs??1e3,this.state=e.state,this.verbose=e.verbose??!1,this.apiService=new t.z({disableInterceptors:!0});let n=this.apiService,r=new t.U;this.clientService=new t.h;let i={state:this.state,notify:()=>this.state.notify()};this.checkServerStep=new Ee({...i,apiService:n}),this.buildManifestStep=new Te(i),this.registerAppStep=new De({...i,apiService:n,configService:r}),this.uploadFilesStep=new Ve({...i,verbose:this.verbose}),this.generateApiClientStep=new L({...i,clientService:this.clientService,configService:r}),this.syncApplicationStep=new Be({...i,apiService:n,verbose:this.verbose,force:e.force??!1,interactive:e.interactive??!1,onExit:e.onExit}),this.startWatchersStep=new Pe({...i,scheduleSync:this.scheduleSync.bind(this),onFileBuilt:this.handleFileBuilt.bind(this),shouldSkipTypecheck:()=>this.skipTypecheck,verbose:this.verbose})}async start(){this.isClosed=!1;let r=n.default.join(this.state.appPath,e.i);await t.vt(r),await t._t(r),this.state.addEvent({message:`Using remote "${t.U.getActiveRemote()}"`,status:`info`}),this.verbose||this.state.addEvent({message:`Add --verbose to see fully detailed logs`,status:`info`}),this.state.notify(),await this.startWatchersStep.start(),this.serverCheckInterval=setInterval(()=>{this.checkServerHealth()},2e3)}async close(){this.isClosed=!0,this.syncTimer&&=(clearTimeout(this.syncTimer),null),this.serverCheckInterval&&=(clearInterval(this.serverCheckInterval),null),await this.startWatchersStep.close()}getState(){return this.state}handleFileBuilt(e){this.state.steps.uploadFiles.output.fileUploader&&this.uploadFilesStep.uploadFile(e.builtPath,e.sourcePath,e.fileFolder)}async checkServerHealth(){let e=this.state.steps.checkServer.output.isReady;await this.checkServerStep.execute()&&!e&&this.scheduleSync()}scheduleSync(){this.isClosed||(this.syncTimer&&clearTimeout(this.syncTimer),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs))}async performSync(){if(this.state.pipeline.isSyncing){this.syncRequestedWhileRunning=!0;return}this.state.updatePipeline({isSyncing:!0});try{await this.runSyncPipeline()}catch(e){this.state.addEvent({message:`Sync failed with error: ${t.B(e)}`,status:`error`}),this.state.updatePipeline({status:`error`}),this.state.updateAllEntitiesStatus(`error`)}finally{this.state.updatePipeline({isSyncing:!1}),this.syncRequestedWhileRunning&&!this.isClosed&&(this.syncRequestedWhileRunning=!1,this.scheduleSync())}}async runSyncPipeline(){if(!await this.checkServerStep.execute())return;this.state.steps.ensureValidTokens.status=`done`;let e=await this.buildManifestStep.execute({appPath:this.state.appPath});if(!e||(await this.startWatchersStep.handleWatcherRestarts(e),!this.uploadFilesStep.isInitialized&&!await this.initializePipeline(e.manifest)))return;let t=this.state.hasObjectsOrFieldsChanged(e.manifest);await this.uploadFilesStep.waitForUploads(),await this.syncApplicationStep.execute({manifest:e.manifest,builtFileInfos:this.state.steps.uploadFiles.output.builtFileInfos,appPath:this.state.appPath}),this.state.steps.syncApplication.output.syncStatus===`synced`&&t&&(await this.generateApiClientStep.execute({appPath:this.state.appPath,tokenSources:this.buildAppTokenSources()}),this.skipTypecheck=!1)}buildAppTokenSources(){let e=this.registerAppStep.registrationCredentials,n=this.state.steps.resolveApplication.output.applicationId;return{credentials:e?.clientSecret?{clientId:e.clientId,clientSecret:e.clientSecret}:void 0,fetchTokenPair:n?t.g(this.apiService,n):void 0}}async initializePipeline(e){await this.registerAppStep.execute({manifest:e});let t=await this.apiService.createDevelopmentApplication({universalIdentifier:e.application.universalIdentifier,name:e.application.displayName});return!t.success||!t.data?(this.state.applyStepEvents([{message:`Failed to install development application`,status:`error`},{message:JSON.stringify(t,null,2),status:`error`}]),this.state.updatePipeline({status:`error`}),!1):(this.state.steps.resolveApplication.output={applicationId:t.data.id,universalIdentifier:t.data.universalIdentifier},this.state.steps.resolveApplication.status=`done`,this.state.applyStepEvents([{message:`Application installed`,status:`success`}]),this.uploadFilesStep.initialize({appPath:this.state.appPath,universalIdentifier:e.application.universalIdentifier}),!0)}},Ue={objects:e.s.Object,fields:e.s.Field,logicFunctions:e.s.LogicFunction,frontComponents:e.s.FrontComponent,roles:e.s.Role,skills:e.s.Skill,connectionProviders:e.s.ConnectionProvider,views:e.s.View,viewFields:e.s.ViewField,navigationMenuItems:e.s.NavigationMenuItem,pageLayouts:e.s.PageLayout,pageLayoutTabs:e.s.PageLayoutTab,commandMenuItems:e.s.CommandMenuItem,timelineActivityTypes:e.s.TimelineActivityType},We=200,Ge={pending:[`building`,`uploading`,`success`,`error`],building:[`pending`,`uploading`,`success`,`error`],uploading:[`pending`,`success`,`error`],success:[`pending`,`building`,`uploading`,`error`],error:[`pending`,`building`,`uploading`,`success`]},Ke=class{constructor(e){this.confirmationResolver=null,this.eventIdCounter=0,this.appPath=e.appPath,this.previousObjectsFieldsFingerprint=null,this.pendingConfirmation=null,this.steps={checkServer:{output:{isReady:!1,errorLogged:!1},status:`idle`},ensureValidTokens:{output:{},status:`idle`},resolveApplication:{output:{applicationId:null,universalIdentifier:null},status:`idle`},buildManifest:{output:{result:null},status:`idle`},uploadFiles:{output:{fileUploader:null,builtFileInfos:new Map,activeUploads:new Set},status:`idle`},generateApiClient:{output:{},status:`idle`},syncApplication:{output:{syncStatus:`idle`,error:null},status:`idle`},startWatchers:{output:{watchersStarted:!1},status:`idle`}},this.pipeline={status:`idle`,isSyncing:!1,error:null,appName:null},this.versionInfo=null,this.entities=new Map,this.events=[]}setVersionInfo(e){this.versionInfo=e,this.notify()}notify(){this.onChange?.()}requestDestructiveConfirmation(e){return new Promise(t=>{this.pendingConfirmation={deleteCount:e},this.confirmationResolver=t,this.notify()})}resolveDestructiveConfirmation(e){let t=this.confirmationResolver;this.pendingConfirmation=null,this.confirmationResolver=null,this.notify(),t?.(e)}updatePipeline(e){Object.assign(this.pipeline,e),this.notify()}applyStepEvents(e){let t=e.map(e=>(this.eventIdCounter+=1,{...e,id:this.eventIdCounter,timestamp:new Date,message:e.message.slice(0,5e3)}));this.events=[...this.events.slice(-(We-t.length)),...t]}addEvent(e){this.applyStepEvents([e])}updateEntityStatus(e,t){let n=new Map(this.entities),r=n.get(e);r?.status&&!Ge[r.status].includes(t)||(n.set(e,r?{...r,status:t}:{name:e,path:e,status:t}),this.entities=n)}removeEntity(e){let t=new Map(this.entities);t.delete(e),this.entities=t}updateAllEntitiesStatus(e){let t=new Map(this.entities);for(let[n,r]of t)t.set(n,{...r,status:e});this.entities=t}updateEntitiesFromManifest(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=Ue[n];if(e)for(let n of r)t.set(n,e)}let n=new Map(this.entities);for(let[e,r]of n)n.set(e,{...r,type:t.get(e)});for(let[e,r]of t)n.has(e)||n.set(e,{name:e,path:e,type:r,status:`pending`});this.entities=n}hasObjectsOrFieldsChanged(e){let t=JSON.stringify({objects:e.objects,fields:e.fields}),n=t!==this.previousObjectsFieldsFingerprint;return this.previousObjectsFieldsFingerprint=t,n}},qe={idle:{color:`gray`,icon:`○`},in_progress:{color:`yellow`,icon:`spinner`},uploading:{color:`cyan`,icon:`upload`},done:{color:`green`,icon:`✓`},error:{color:`red`,icon:`✗`}},Je=e=>({idle:`idle`,in_progress:`in_progress`,done:`done`,error:`error`})[e],Ye=e=>({pending:`idle`,building:`in_progress`,uploading:`uploading`,success:`done`,error:`error`})[e],Xe=e=>({idle:`idle`,building:`in_progress`,syncing:`in_progress`,synced:`done`,error:`error`})[e],Ze={idle:`Idle`,building:`Building...`,syncing:`Syncing...`,synced:`Synced`,error:`Error`},Qe=[`◐`,`◓`,`◑`,`◒`],$e=[`↑`,`⇡`,`↑`,`⇡`],et={[e.s.Object]:`Objects`,[e.s.Field]:`Fields`,[e.s.LogicFunction]:`Logic functions`,[e.s.FrontComponent]:`Front components`,[e.s.CommandMenuItem]:`Command menu items`,[e.s.Role]:`Roles`,[e.s.Skill]:`Skills`,[e.s.View]:`Views`,[e.s.ViewField]:`View fields`,[e.s.NavigationMenuItem]:`Navigation menu items`,[e.s.PageLayout]:`Page layouts`,[e.s.PageLayoutTab]:`Page layout tabs`,[e.s.Agent]:`Agents`,[e.s.ConnectionProvider]:`Connection providers`,[e.s.TimelineActivityType]:`Timeline activity types`},tt=Object.keys(et),nt={info:`gray`,success:`green`,error:`red`,warning:`yellow`},rt=e=>e.toLocaleTimeString(`en-US`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),it=(e,t=40)=>{if(e.length<=t)return e;let n=e.split(`/`);return n.length<=2?e:`.../${n.slice(-2).join(`/`)}`},at=e=>{let t=new Map;for(let e of tt)t.set(e,[]);for(let n of e.values()){if(!n.type)continue;let e=t.get(n.type)??[];e.push(n),t.set(n.type,e)}return t},ot=[{status:`success`,label:`synced`},{status:`building`,label:`building`},{status:`uploading`,label:`uploading`},{status:`pending`,label:`pending`},{status:`error`,label:`error`}],st=e=>{let t={pending:0,building:0,uploading:0,success:0,error:0};for(let n of e)t[n.status]+=1;return ot.filter(({status:e})=>t[e]>0).map(({status:e,label:n})=>({status:e,count:t[e],label:n}))},ct=t=>{let n=t.steps.resolveApplication.output.applicationId;return!e.St(t.frontendUrl)||!e.St(n)?null:`${t.frontendUrl}/settings/applications/${n}`},lt=e=>e.some(e=>e===`error`)?`error`:e.some(e=>e===`in_progress`)?`in_progress`:e.every(e=>e===`done`)?`done`:`idle`,ut=e=>{let t=[...e.entities.values()],n=t.some(e=>e.status===`error`),r=t.some(e=>e.status===`building`),i=t.length>0&&t.every(e=>e.status===`uploading`||e.status===`success`),a=n?`error`:r?`in_progress`:i?`done`:`idle`;return[{label:`Application Initialization`,status:lt([e.steps.checkServer.status,e.steps.ensureValidTokens.status,e.steps.resolveApplication.status])},{label:`Resources Build`,status:a},{label:`Resources Upload`,status:e.steps.uploadFiles.status},{label:`Manifest Build`,status:e.steps.buildManifest.status},{label:`Application Synchronization`,status:e.steps.syncApplication.status},{label:`Api Client Generation`,status:e.steps.generateApiClient.status}]},R=120,dt=Math.round(200/R),z=()=>{let e=Math.floor(Date.now()/R);return{spinnerFrame:Qe[e%Qe.length],uploadFrame:$e[Math.floor(e/dt)%$e.length]}},ft=e=>{let t=qe[e];return t.icon===`spinner`?z().spinnerFrame:t.icon===`upload`?z().uploadFrame:t.icon},pt=o.default.createContext(null),mt=pt.Provider,ht=()=>{let e=o.default.useContext(pt);if(!e)throw Error(`useInk must be used within InkProvider`);return e},gt=({uiStatus:e})=>{let{Text:t}=ht(),n=ft(e),r=qe[e];return(0,p.jsxs)(t,{color:r.color,children:[n,` `]})},_t=({entity:e})=>{let{Box:t,Text:n}=ht();return(0,p.jsxs)(t,{children:[(0,p.jsx)(gt,{uiStatus:Ye(e.status)}),(0,p.jsx)(n,{children:e.name}),e.path!==e.name&&(0,p.jsxs)(n,{dimColor:!0,children:[` (`,it(e.path),`)`]})]})},vt=({type:e,entities:t})=>{let{Box:n,Text:r}=ht();return t.length===0?null:(0,p.jsxs)(n,{flexDirection:`column`,marginTop:1,children:[(0,p.jsx)(r,{bold:!0,dimColor:!0,children:et[e]}),t.map(e=>(0,p.jsx)(_t,{entity:e},e.path))]})},yt=({entities:e})=>{let{Box:t,Text:n}=ht();if(e.length===0)return null;let r=st(e);return(0,p.jsxs)(t,{marginTop:1,children:[(0,p.jsxs)(n,{bold:!0,dimColor:!0,children:[`Entities`,` `]}),r.map((e,r)=>(0,p.jsxs)(t,{children:[r>0&&(0,p.jsx)(n,{dimColor:!0,children:` · `}),(0,p.jsx)(gt,{uiStatus:Ye(e.status)}),(0,p.jsxs)(n,{children:[e.count,` `,e.label]})]},e.status))]})},bt=()=>{let{Box:e,Text:t}=ht();return(0,p.jsx)(e,{marginTop:1,children:(0,p.jsxs)(t,{dimColor:!0,children:[(0,p.jsx)(t,{color:qe.idle.color,children:qe.idle.icon}),` `,`pending`,` `,(0,p.jsx)(t,{color:qe.in_progress.color,children:Qe[0]}),` `,`building`,` `,(0,p.jsx)(t,{color:qe.uploading.color,children:$e[0]}),` `,`uploading`,` `,(0,p.jsx)(t,{color:qe.done.color,children:qe.done.icon}),` `,`success`,` `,(0,p.jsx)(t,{color:qe.error.color,children:qe.error.icon}),` `,`error`]})})},xt=7,St=({versionInfo:e})=>{let{Box:t,Text:n}=ht();if(e===null)return null;let{cliVersion:r,localServerVersion:i,latestServerVersion:a,isMinorOrMajorBehind:o,daysBehind:s}=e,c=o&&s!==null&&s>xt;return(0,p.jsxs)(t,{children:[(0,p.jsx)(n,{dimColor:!0,children:`Versions: `}),(0,p.jsx)(n,{dimColor:!0,children:`CLI `}),(0,p.jsxs)(n,{children:[`v`,r]}),i!==null&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n,{dimColor:!0,children:` • Server `}),(0,p.jsxs)(n,{color:c?`yellow`:void 0,children:[`v`,i]}),i!==null&&a!==null&&i===a&&(0,p.jsx)(n,{color:`green`,children:` ✓ latest`}),c&&a!==null&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(n,{color:`yellow`,children:[` → v`,a]}),s!==null&&(0,p.jsxs)(n,{dimColor:!0,children:[` (`,s,`d behind)`]})]})]})]})},Ct=({state:e})=>{let{Text:t}=ht(),n=Xe(e.pipeline.status),r=ft(n),i=qe[n],a=Ze[e.pipeline.status];return(0,p.jsxs)(t,{color:i.color,children:[r,` `,a]})},wt=({label:e,status:t})=>{let{Box:n,Text:r}=ht(),i=Je(t),a=ft(i),o=qe[i];return(0,p.jsxs)(n,{children:[(0,p.jsxs)(r,{dimColor:!0,children:[e,`: `]}),(0,p.jsxs)(r,{color:o.color,children:[a,` `,t.replace(`_`,` `)]})]})},Tt=({state:e,verbose:t=!1})=>{let{Box:n,Text:r}=ht(),i=at(e.entities),a=ct(e);return(0,p.jsxs)(n,{flexDirection:`column`,borderStyle:`classic`,borderColor:`gray`,paddingX:1,children:[(0,p.jsx)(r,{bold:!0,color:`cyan`,children:`Application`}),(0,p.jsxs)(n,{marginLeft:2,flexDirection:`column`,children:[(0,p.jsxs)(n,{children:[(0,p.jsx)(r,{dimColor:!0,children:`Name: `}),(0,p.jsx)(r,{bold:!0,children:e.pipeline.appName??`Loading...`})]}),(0,p.jsxs)(n,{children:[(0,p.jsx)(r,{dimColor:!0,children:`Overall Status: `}),(0,p.jsx)(Ct,{state:e})]}),a&&(0,p.jsxs)(n,{children:[(0,p.jsx)(r,{dimColor:!0,children:`Open:`}),(0,p.jsxs)(r,{bold:!0,color:`cyan`,children:[` `,a]})]}),(0,p.jsx)(St,{versionInfo:e.versionInfo})]}),(0,p.jsx)(n,{marginLeft:2,flexDirection:`column`,marginTop:1,children:ut(e).map(e=>(0,p.jsx)(wt,{label:e.label,status:e.status},e.label))}),(0,p.jsx)(n,{marginLeft:2,flexDirection:`column`,children:t?tt.map(e=>(0,p.jsx)(vt,{type:e,entities:i.get(e)??[]},e)):(0,p.jsx)(yt,{entities:Array.from(e.entities.values())})})]})},Et=({state:e})=>{let{Box:t,Text:n,useInput:r}=ht(),i=e.pendingConfirmation;return r((t,n)=>{if(e.pendingConfirmation){if(t.toLowerCase()===`y`){e.resolveDestructiveConfirmation(!0);return}(t.toLowerCase()===`n`||n.escape)&&e.resolveDestructiveConfirmation(!1)}}),i?(0,p.jsxs)(t,{marginTop:1,flexDirection:`column`,borderStyle:`classic`,borderColor:`red`,paddingX:1,children:[(0,p.jsxs)(n,{color:`red`,bold:!0,children:[`⚠ `,i.deleteCount,` destructive change(s) detected`]}),(0,p.jsxs)(n,{children:[`Apply and DESTROY `,i.deleteCount,` metadata entity(ies)? Press`,` `,(0,p.jsx)(n,{color:`green`,bold:!0,children:`y`}),` `,`to apply,`,` `,(0,p.jsx)(n,{color:`red`,bold:!0,children:`n`}),` `,`to cancel and stop watching.`]})]}):null},Dt=({event:e})=>{let{Box:t,Text:n}=ht(),r=nt[e.status],i=rt(e.timestamp);return(0,p.jsxs)(t,{marginTop:+!!e.spacingBefore,children:[(0,p.jsxs)(n,{dimColor:!0,children:[i,` `]}),(0,p.jsx)(n,{color:r,children:e.message})]})},Ot=new Set([`building`,`syncing`]),kt=120,At=80,jt=({uiStateManager:e,verbose:t})=>{let{Box:n,Static:r}=ht(),[,i]=(0,o.useReducer)(e=>e+1,0),a=(0,o.useRef)(null),s=(0,o.useRef)(0),c=(0,o.useCallback)(()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,s.current=Date.now(),i()},At)},[]);(0,o.useEffect)(()=>e.subscribe(()=>{c()}),[e,c]),(0,o.useEffect)(()=>{let t=setInterval(()=>{let t=e.getSnapshot();Ot.has(t.pipeline.status)&&(Date.now()-s.current<kt||i())},kt);return()=>clearInterval(t)},[e]),(0,o.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]);let l=e.getSnapshot();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r,{items:l.events,children:e=>(0,p.jsx)(Dt,{event:e},e.id)}),(0,p.jsxs)(n,{marginTop:1,flexDirection:`column`,children:[(0,p.jsx)(Tt,{state:l,verbose:t}),t&&(0,p.jsx)(bt,{})]}),l.pendingConfirmation&&(0,p.jsx)(Et,{state:l})]})},Mt=async(e,t=!1)=>{let{render:n,Box:r,Text:i,Static:a,useInput:o}=await import(`ink`),{unmount:s}=n((0,p.jsx)(mt,{value:{Box:r,Text:i,Static:a,useInput:o},children:(0,p.jsx)(jt,{uiStateManager:e,verbose:t})}));return{unmount:s}},Nt=class{constructor(e){this.listeners=new Set,this.pendingNotify=!1,this.orchestratorState=e}getSnapshot(){return this.orchestratorState}subscribe(e){return this.listeners.add(e),e(this.orchestratorState),()=>this.listeners.delete(e)}notify(){this.pendingNotify||(this.pendingNotify=!0,queueMicrotask(()=>{this.pendingNotify=!1;for(let e of this.listeners)e(this.orchestratorState)}))}},Pt=class{constructor(){this.orchestrator=null,this.unmountUI=null}async close(){this.unmountUI?.(),await this.orchestrator?.close()}getOrchestrator(){return this.orchestrator}async ensureAuthenticatedBeforeLaunch(){let{serverUp:e,authValid:n}=await new t.z({disableInterceptors:!0}).validateAuth();e&&!n&&await t.V(t.U.getActiveRemote())}async execute(e){let n=e.appPath??t.Dt;await y(n),e.headless&&await t.y(),await this.ensureAuthenticatedBeforeLaunch();let r=new Ke({appPath:n});if(!e.headless){let n=new Nt(r);r.onChange=()=>n.notify();let{unmount:i}=await Mt(n,e.verbose);this.unmountUI=i,t.b().then(e=>r.setVersionInfo(e))}this.orchestrator=new He({state:r,verbose:e.verbose,debounceMs:e.debounceMs,force:e.force,interactive:!e.headless&&process.stdout.isTTY===!0,onExit:({code:t,message:n})=>{e.headless||this.close().then(()=>{console.log(u.default.yellow(`\n${n}`)),process.exit(t)})}}),await this.orchestrator.start(),e.headless||this.setupGracefulShutdown()}setupGracefulShutdown(){let e=()=>void this.close().then(()=>process.exit(0));process.on(`SIGINT`,e),process.on(`SIGTERM`,e)}},Ft=async(e,{force:t})=>{if(t)return!0;if(!process.stdout.isTTY)return console.error(u.default.red(`${e} destructive change(s) detected. Run \`yarn twenty plan\` to review them, or re-run with --force to apply non-interactively.`)),!1;let{confirmed:n}=await d.default.prompt([{type:`confirm`,name:`confirmed`,message:`Twenty will DESTROY ${e} metadata entity(ies) (run \`yarn twenty plan\` for details). Do you want to perform these actions?`,default:!1}]);return n},It=class{async execute(e){let n=e.appPath??t.Dt,r=e.apply??!1;await y(n);let i=t.U.getActiveRemote();console.log(u.default.blue(`${r?`Applying application manifest`:`Planning application apply`} on ${i}...`)),console.log(u.default.gray(`App path: ${n}\n`));let a=await t.a({appPath:n,verbose:e.verbose,apply:r,force:e.force,onProgress:e=>console.log(u.default.gray(e)),onPlan:e=>console.log(`\n${e}\n`),confirmApply:t=>Ft(t,{force:e.force})});if(a.success||(a.error.code===t.K.APPLY_ABORTED&&(console.log(u.default.yellow(a.error.message)),process.exit(1)),console.error(u.default.red(a.error.message)),process.exit(1)),!r){console.log(u.default.green(`\n✓ Plan complete for ${a.data.applicationDisplayName} — no changes were applied`));return}console.log(u.default.green(`\n✓ Synced ${a.data.applicationDisplayName} (${a.data.fileCount} file${a.data.fileCount===1?``:`s`})`)),console.log(u.default.gray(`Output: ${a.data.outputDir}`))}},Lt=e=>{let t=new be,n=new ye;e.command(`dev:function:logs [appPath]`).description(`Stream logic function logs`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Only show logs for the function with this universal ID`).option(`-n, --functionName <functionName>`,`Only show logs for the function with this name`).action(async(e,n)=>{await t.execute({...n,appPath:g(e)})}),e.command(`dev:function:exec [appPath]`).description(`Execute a logic function`).option(`--postInstall`,`Execute post-install logic function if defined`).option(`--preInstall`,`Execute pre-install logic function if defined`).option(`--uninstall`,`Execute uninstall logic function if defined`).option(`-p, --payload <payload>`,`JSON payload to send to the function`,`{}`).option(`-u, --functionUniversalIdentifier <functionUniversalIdentifier>`,`Universal ID of the function to execute`).option(`-n, --functionName <functionName>`,`Name of the function to execute`).action(async(e,t)=>{!t?.postInstall&&!t?.preInstall&&!t?.uninstall&&!t?.functionUniversalIdentifier&&!t?.functionName&&(console.error(u.default.red(`Error: Either --postInstall, --preInstall, --uninstall, --functionName (-n), or --functionUniversalIdentifier (-u) is required.`)),process.exit(1)),await n.execute({...t,payload:t?.payload??`{}`,appPath:g(e)})})},Rt=class{async execute(e){let r=e.appPath??t.Dt,i=(0,n.join)(r,`node_modules`,`twenty-client-sdk`);await t.yt(i)||(console.error(u.default.red(`Cannot find twenty-client-sdk in ${r}.\n\n Install it first:
356
356
  yarn add twenty-client-sdk`)),process.exit(1));let a=await new t.z({disableInterceptors:!0}).validateAuth();a.serverUp||(console.error(u.default.red(`Cannot reach Twenty server.
357
357
 
358
358
  Check your remotes:
359
- yarn twenty remote:status`)),process.exit(1)),a.authValid||(console.error(u.default.red("Authentication failed. Run `yarn twenty remote:add` to authenticate.")),process.exit(1)),console.log(u.default.blue(`Generating API client...`));try{await new t.h({skipAuth:!1}).generateCoreClient({appPath:r})}catch(e){console.error(u.default.red(`Failed to generate API client: ${t.B(e)}`)),process.exit(1)}console.log(u.default.green(`✓ API client generated`)),console.log(u.default.gray(`Output: ${(0,n.join)(i,`dist`,`core`,`generated`)}`))}},zt=(e,t)=>t!==void 0&&t.length>0?`${t}${e}`:e,Bt=e=>e.replace(/\s+/g,` `).trim(),Vt=e.bt(((e,n)=>{var r={};(e=>{"use strict";var n=Object.defineProperty,r=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},i=e=>e,a={};r(a,{ANONYMOUS:()=>b$,AccessFlags:()=>gi,AssertionLevel:()=>Mt,AssignmentDeclarationKind:()=>Ei,AssignmentKind:()=>k_,Associativity:()=>Lv,BreakpointResolver:()=>T4,BuilderFileEmit:()=>bG,BuilderProgramKind:()=>$G,BuilderState:()=>yG,CallHierarchy:()=>E4,CharacterCodes:()=>Hi,CheckFlags:()=>li,CheckMode:()=>vB,ClassificationType:()=>hX,ClassificationTypeNames:()=>mX,CommentDirectiveType:()=>Wr,Comparison:()=>c,CompletionInfoFlags:()=>sX,CompletionTriggerKind:()=>eX,Completions:()=>j8,ContainerFlags:()=>bz,ContextFlags:()=>ei,Debug:()=>H,DiagnosticCategory:()=>Di,Diagnostics:()=>K,DocumentHighlights:()=>x1,ElementFlags:()=>hi,EmitFlags:()=>Ki,EmitHint:()=>Xi,EmitOnly:()=>Jr,EndOfLineState:()=>uX,ExitStatus:()=>Xr,ExportKind:()=>c1,Extension:()=>Ui,ExternalEmitHelpers:()=>Yi,FileIncludeKind:()=>Kr,FilePreprocessingDiagnosticsKind:()=>qr,FileSystemEntryKind:()=>Ea,FileWatcherEventKind:()=>aa,FindAllReferences:()=>y5,FlattenLevel:()=>RV,FlowFlags:()=>Ur,ForegroundColorEscapeSequences:()=>bW,FunctionFlags:()=>mv,GeneratedIdentifierFlags:()=>Br,GetLiteralTextFlags:()=>Lp,GoToDefinition:()=>P5,HighlightSpanKind:()=>nX,IdentifierNameMap:()=>mV,ImportKind:()=>s1,ImportsNotUsedAsValues:()=>Ii,IndentStyle:()=>rX,IndexFlags:()=>_i,IndexKind:()=>xi,InferenceFlags:()=>wi,InferencePriority:()=>Ci,InlayHintKind:()=>tX,InlayHints:()=>U5,InternalEmitFlags:()=>qi,InternalNodeBuilderFlags:()=>ni,InternalSymbolName:()=>ui,IntersectionFlags:()=>$r,InvalidatedProjectKind:()=>Jq,JSDocParsingMode:()=>na,JsDoc:()=>G5,JsTyping:()=>SY,JsxEmit:()=>Fi,JsxFlags:()=>Lr,JsxReferenceKind:()=>vi,LanguageFeatureMinimumTarget:()=>Ji,LanguageServiceMode:()=>XY,LanguageVariant:()=>Bi,LexicalEnvironmentFlags:()=>Qi,ListFormat:()=>$i,LogLevel:()=>On,MapCode:()=>Y5,MemberOverrideStatus:()=>Zr,ModifierFlags:()=>Ir,ModuleDetectionKind:()=>Ai,ModuleInstanceState:()=>gz,ModuleKind:()=>Pi,ModuleResolutionKind:()=>ki,ModuleSpecifierEnding:()=>_w,NavigateTo:()=>t0,NavigationBar:()=>r0,NewLineKind:()=>Li,NodeBuilderFlags:()=>ti,NodeCheckFlags:()=>di,NodeFactoryFlags:()=>gE,NodeFlags:()=>Fr,NodeResolutionFeatures:()=>dR,ObjectFlags:()=>pi,OperationCanceledException:()=>Gr,OperatorPrecedence:()=>Hv,OrganizeImports:()=>Q5,OrganizeImportsMode:()=>$Y,OuterExpressionKinds:()=>Zi,OutliningElementsCollector:()=>o7,OutliningSpanKind:()=>cX,OutputFileType:()=>lX,PackageJsonAutoImportPreference:()=>YY,PackageJsonDependencyGroup:()=>JY,PatternMatchKind:()=>j1,PollingInterval:()=>oa,PollingWatchKind:()=>Ni,PragmaKindFlags:()=>ea,PredicateSemantics:()=>zr,PreparePasteEdits:()=>Q7,PrivateIdentifierKind:()=>xD,ProcessLevel:()=>pH,ProgramUpdateLevel:()=>ZU,QuotePreference:()=>iQ,RegularExpressionFlags:()=>Vr,RelationComparisonResult:()=>Rr,Rename:()=>u7,ScriptElementKind:()=>fX,ScriptElementKindModifier:()=>pX,ScriptKind:()=>Ri,ScriptSnapshot:()=>qY,ScriptTarget:()=>zi,SemanticClassificationFormat:()=>QY,SemanticMeaning:()=>Kre,SemicolonPreference:()=>iX,SignatureCheckMode:()=>yB,SignatureFlags:()=>bi,SignatureHelp:()=>f7,SignatureInfo:()=>vG,SignatureKind:()=>yi,SmartSelectionRange:()=>m7,SnippetKind:()=>Gi,StatisticType:()=>FJ,StructureIsReused:()=>Yr,SymbolAccessibility:()=>ai,SymbolDisplay:()=>v7,SymbolDisplayPartKind:()=>oX,SymbolFlags:()=>ci,SymbolFormatFlags:()=>ii,SyntaxKind:()=>U,Ternary:()=>Ti,ThrottledCancellationToken:()=>y4,TokenClass:()=>dX,TokenFlags:()=>Hr,TransformFlags:()=>Wi,TypeFacts:()=>gB,TypeFlags:()=>fi,TypeFormatFlags:()=>ri,TypeMapKind:()=>Si,TypePredicateKind:()=>oi,TypeReferenceSerializationKind:()=>si,UnionReduction:()=>Qr,UpToDateStatusType:()=>bq,VarianceFlags:()=>mi,Version:()=>In,VersionRange:()=>zn,WatchDirectoryFlags:()=>Vi,WatchDirectoryKind:()=>Mi,WatchFileKind:()=>ji,WatchLogLevel:()=>aW,WatchType:()=>iq,accessPrivateIdentifier:()=>FV,addEmitFlags:()=>BE,addEmitHelper:()=>oD,addEmitHelpers:()=>sD,addInternalEmitFlags:()=>HE,addNodeFactoryPatcher:()=>vE,addObjectAllocatorPatcher:()=>bee,addRange:()=>L,addRelatedInfo:()=>Bw,addSyntheticLeadingComment:()=>$E,addSyntheticTrailingComment:()=>nD,addToSeen:()=>fS,advancedAsyncSuperHelper:()=>JD,affectsDeclarationPathOptionDeclarations:()=>rF,affectsEmitOptionDeclarations:()=>nF,allKeysStartWithDot:()=>VR,altDirectorySeparator:()=>Ia,and:()=>_n,append:()=>we,appendIfUnique:()=>Oe,arrayFrom:()=>et,arrayIsEqualTo:()=>xe,arrayIsHomogeneous:()=>tT,arrayOf:()=>$e,arrayReverseIterator:()=>je,arrayToMap:()=>rt,arrayToMultiMap:()=>at,arrayToNumericMap:()=>it,assertType:()=>bn,assign:()=>tt,asyncSuperHelper:()=>qD,attachFileToDiagnostics:()=>NS,base64decode:()=>mx,base64encode:()=>px,binarySearch:()=>We,binarySearchKey:()=>Ge,bindSourceFile:()=>Cz,breakIntoCharacterSpans:()=>B1,breakIntoWordSpans:()=>V1,buildLinkParts:()=>zQ,buildOpts:()=>fF,buildOverload:()=>HOe,bundlerModuleNameResolver:()=>hR,canBeConvertedToAsync:()=>Z1,canHaveDecorators:()=>RN,canHaveExportModifier:()=>wT,canHaveFlowNode:()=>m_,canHaveIllegalDecorators:()=>aN,canHaveIllegalModifiers:()=>oN,canHaveIllegalType:()=>rN,canHaveIllegalTypeParameters:()=>iN,canHaveJSDoc:()=>h_,canHaveLocals:()=>Fd,canHaveModifiers:()=>LN,canHaveModuleSpecifier:()=>lee,canHaveSymbol:()=>Pd,canIncludeBindAndCheckDiagnostics:()=>Kw,canJsonReportNoInputFiles:()=>LI,canProduceDiagnostics:()=>ZH,canUsePropertyAccess:()=>ET,canWatchAffectingLocation:()=>CK,canWatchAtTypes:()=>bK,canWatchDirectoryOrFile:()=>vK,canWatchDirectoryOrFilePath:()=>yK,cartesianProduct:()=>Cn,cast:()=>bt,chainBundle:()=>sV,chainDiagnosticMessages:()=>RS,changeAnyExtension:()=>xo,changeCompilerHostLikeToUseCache:()=>gW,changeExtension:()=>Ew,changeFullExtension:()=>So,changesAffectModuleResolution:()=>Af,changesAffectingProgramStructure:()=>Mf,characterCodeToRegularExpressionFlag:()=>os,childIsDecorated:()=>Kh,classElementOrClassElementParameterIsDecorated:()=>Jh,classHasClassThisAssignment:()=>$V,classHasDeclaredOrExplicitlyAssignedName:()=>aH,classHasExplicitlyAssignedName:()=>iH,classOrConstructorParameterIsDecorated:()=>qh,classicNameResolver:()=>lz,classifier:()=>j4,cleanExtendedConfigCache:()=>eW,clear:()=>ee,clearMap:()=>rS,clearSharedExtendedConfigFileWatcher:()=>$U,climbPastPropertyAccess:()=>TX,clone:()=>ct,cloneCompilerOptions:()=>AZ,closeFileWatcher:()=>qx,closeFileWatcherOf:()=>cW,codefix:()=>M4,collapseTextChangeRangesAcrossMultipleVersions:()=>Tc,collectExternalModuleInfo:()=>dV,combine:()=>Te,combinePaths:()=>lo,commandLineOptionOfCustomType:()=>cF,commentPragmas:()=>ta,commonOptionsWithBuild:()=>XP,compact:()=>Se,compareBooleans:()=>B,compareDataObjects:()=>nS,compareDiagnostics:()=>VS,compareEmitHelpers:()=>CD,compareNumberOfDirectorySeparators:()=>xw,comparePaths:()=>Do,comparePathsCaseInsensitive:()=>Eo,comparePathsCaseSensitive:()=>To,comparePatternKeys:()=>GR,compareProperties:()=>Zt,compareStringsCaseInsensitive:()=>Vt,compareStringsCaseInsensitiveEslintCompatible:()=>Ht,compareStringsCaseSensitive:()=>Ut,compareStringsCaseSensitiveUI:()=>Xt,compareTextSpans:()=>Rt,compareValues:()=>Lt,compilerOptionsAffectDeclarationPath:()=>kC,compilerOptionsAffectEmit:()=>OC,compilerOptionsAffectSemanticDiagnostics:()=>DC,compilerOptionsDidYouMeanDiagnostics:()=>DF,compilerOptionsIndicateEsModules:()=>QZ,computeCommonSourceDirectoryOfFilenames:()=>dW,computeLineAndCharacterOfPosition:()=>ds,computeLineOfPosition:()=>fs,computeLineStarts:()=>ss,computePositionOfLineAndCharacter:()=>ls,computeSignatureWithDiagnostics:()=>nK,computeSuggestionDiagnostics:()=>q1,computedOptions:()=>tC,concatenate:()=>de,concatenateDiagnosticMessageChains:()=>zS,consumesNodeCoreModules:()=>I$,contains:()=>w,containsIgnoredPath:()=>fT,containsObjectRestOrSpread:()=>IN,containsParseError:()=>Zf,containsPath:()=>Oo,convertCompilerOptionsForTelemetry:()=>hL,convertCompilerOptionsFromJson:()=>qI,convertJsonOption:()=>tL,convertToBase64:()=>dx,convertToJson:()=>iI,convertToObject:()=>rI,convertToOptionsWithAbsolutePaths:()=>vI,convertToRelativePath:()=>Mo,convertToTSConfig:()=>sI,convertTypeAcquisitionFromJson:()=>JI,copyComments:()=>a$,copyEntries:()=>Lf,copyLeadingComments:()=>l$,copyProperties:()=>ut,copyTrailingAsLeadingComments:()=>d$,copyTrailingComments:()=>u$,couldStartTrivia:()=>Cs,countWhere:()=>E,createAbstractBuilder:()=>hK,createAccessorPropertyBackingField:()=>kN,createAccessorPropertyGetRedirector:()=>AN,createAccessorPropertySetRedirector:()=>jN,createBaseNodeFactory:()=>uE,createBinaryExpressionTrampoline:()=>bN,createBuilderProgram:()=>iK,createBuilderProgramUsingIncrementalBuildInfo:()=>lK,createBuilderStatusReporter:()=>Dq,createCacheableExportInfoMap:()=>l1,createCachedDirectoryStructureHost:()=>XU,createClassifier:()=>$ie,createCommentDirectivesMap:()=>bp,createCompilerDiagnostic:()=>IS,createCompilerDiagnosticForInvalidCustomType:()=>yF,createCompilerDiagnosticFromMessageChain:()=>LS,createCompilerHost:()=>fW,createCompilerHostFromProgramHost:()=>oq,createCompilerHostWorker:()=>hW,createDetachedDiagnostic:()=>jS,createDiagnosticCollection:()=>Kv,createDiagnosticForFileFromMessageChain:()=>Am,createDiagnosticForNode:()=>Cm,createDiagnosticForNodeArray:()=>wm,createDiagnosticForNodeArrayFromMessageChain:()=>Dm,createDiagnosticForNodeFromMessageChain:()=>Em,createDiagnosticForNodeInSourceFile:()=>Tm,createDiagnosticForRange:()=>jm,createDiagnosticMessageChainFromDiagnostic:()=>eee,createDiagnosticReporter:()=>NK,createDocumentPositionMapper:()=>nV,createDocumentRegistry:()=>C1,createDocumentRegistryInternal:()=>w1,createEmitAndSemanticDiagnosticsBuilderProgram:()=>mK,createEmitHelperFactory:()=>SD,createEmptyExports:()=>uM,createEvaluator:()=>YT,createExpressionForJsxElement:()=>gM,createExpressionForJsxFragment:()=>_M,createExpressionForObjectLiteralElementLike:()=>wM,createExpressionForPropertyName:()=>bM,createExpressionFromEntityName:()=>yM,createExternalHelpersImportDeclarationIfNeeded:()=>HM,createFileDiagnostic:()=>PS,createFileDiagnosticFromMessageChain:()=>km,createFlowNode:()=>xz,createForOfBindingStatement:()=>vM,createFutureSourceFile:()=>o1,createGetCanonicalFileName:()=>un,createGetIsolatedDeclarationErrors:()=>eU,createGetSourceFile:()=>pW,createGetSymbolAccessibilityDiagnosticForNode:()=>$H,createGetSymbolAccessibilityDiagnosticForNodeName:()=>QH,createGetSymbolWalker:()=>kz,createIncrementalCompilerHost:()=>gq,createIncrementalProgram:()=>_q,createJsxFactoryExpression:()=>mM,createLanguageService:()=>b4,createLanguageServiceSourceFile:()=>_4,createMemberAccessForPropertyName:()=>dM,createModeAwareCache:()=>tR,createModeAwareCacheKey:()=>eR,createModeMismatchDetails:()=>Gf,createModuleNotFoundChain:()=>Wf,createModuleResolutionCache:()=>rR,createModuleResolutionLoader:()=>HW,createModuleResolutionLoaderUsingGlobalCache:()=>AK,createModuleSpecifierResolutionHost:()=>$Z,createMultiMap:()=>dt,createNameResolver:()=>QT,createNodeConverters:()=>pE,createNodeFactory:()=>yE,createOptionNameMap:()=>mF,createOverload:()=>e9,createPackageJsonImportFilter:()=>F$,createPackageJsonInfo:()=>P$,createParenthesizerRules:()=>dE,createPatternMatcher:()=>N1,createPrinter:()=>YU,createPrinterWithDefaults:()=>GU,createPrinterWithRemoveComments:()=>KU,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>qU,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>JU,createProgram:()=>oG,createProgramHost:()=>lq,createPropertyNameNodeForIdentifierOrLiteral:()=>bT,createQueue:()=>pt,createRange:()=>Sx,createRedirectedBuilderProgram:()=>fK,createResolutionCache:()=>jK,createRuntimeTypeSerializer:()=>wH,createScanner:()=>Us,createSemanticDiagnosticsBuilderProgram:()=>pK,createSet:()=>mt,createSolutionBuilder:()=>jq,createSolutionBuilderHost:()=>kq,createSolutionBuilderWithWatch:()=>Mq,createSolutionBuilderWithWatchHost:()=>Aq,createSortedArray:()=>ve,createSourceFile:()=>_P,createSourceMapGenerator:()=>VB,createSourceMapSource:()=>ME,createSuperAccessVariableStatement:()=>OH,createSymbolTable:()=>Tf,createSymlinkCache:()=>FC,createSyntacticTypeNodeBuilder:()=>xY,createSystemWatchFunctions:()=>ja,createTextChange:()=>VZ,createTextChangeFromStartLength:()=>BZ,createTextChangeRange:()=>Cc,createTextRangeFromNode:()=>LZ,createTextRangeFromSpan:()=>zZ,createTextSpan:()=>yc,createTextSpanFromBounds:()=>bc,createTextSpanFromNode:()=>FZ,createTextSpanFromRange:()=>RZ,createTextSpanFromStringLiteralLikeContent:()=>IZ,createTextWriter:()=>_y,createTokenRange:()=>Dx,createTypeChecker:()=>wB,createTypeReferenceDirectiveResolutionCache:()=>iR,createTypeReferenceResolutionLoader:()=>GW,createWatchCompilerHost:()=>vq,createWatchCompilerHostOfConfigFile:()=>fq,createWatchCompilerHostOfFilesAndCompilerOptions:()=>pq,createWatchFactory:()=>aq,createWatchHost:()=>rq,createWatchProgram:()=>yq,createWatchStatusReporter:()=>LK,createWriteFileMeasuringIO:()=>mW,declarationNameToString:()=>_m,decodeMappings:()=>YB,decodedTextSpanIntersectsWith:()=>mc,deduplicate:()=>ge,defaultInitCompilerOptions:()=>vF,defaultMaximumTruncationLength:()=>xf,diagnosticCategoryName:()=>Oi,diagnosticToString:()=>$$,diagnosticsEqualityComparer:()=>GS,directoryProbablyExists:()=>vx,directorySeparator:()=>Fa,displayPart:()=>DQ,displayPartsToString:()=>m4,disposeEmitNodes:()=>LE,documentSpansEqual:()=>vQ,dumpTracingLegend:()=>Pr,elementAt:()=>Ne,elideNodes:()=>CN,emitDetachedComments:()=>ob,emitFiles:()=>VU,emitFilesAndReportErrors:()=>$K,emitFilesAndReportErrorsAndGetExitStatus:()=>eq,emitModuleKindIsNonNodeESM:()=>yC,emitNewLineBeforeLeadingCommentOfPosition:()=>ib,emitResolverSkipsTypeChecking:()=>BU,emitSkippedWithNoDiagnostics:()=>uG,emptyArray:()=>l,emptyFileSystemEntries:()=>Lw,emptyMap:()=>u,emptyOptions:()=>ZY,endsWith:()=>en,ensurePathIsNonModuleName:()=>bo,ensureScriptKind:()=>ew,ensureTrailingDirectorySeparator:()=>yo,entityNameToString:()=>Sm,enumerateInsertsAndDeletes:()=>Sn,equalOwnProperties:()=>nt,equateStringsCaseInsensitive:()=>Pt,equateStringsCaseSensitive:()=>Ft,equateValues:()=>Nt,escapeJsxAttributeString:()=>uy,escapeLeadingUnderscores:()=>Vc,escapeNonAsciiString:()=>iy,escapeSnippetText:()=>vT,escapeString:()=>ny,escapeTemplateSubstitution:()=>Jv,evaluatorResult:()=>JT,every:()=>y,exclusivelyPrefixedNodeCoreModules:()=>aE,executeCommandLine:()=>ZJ,expandPreOrPostfixIncrementOrDecrementExpression:()=>TM,explainFiles:()=>qK,explainIfFileIsRedirectAndImpliedFormat:()=>JK,exportAssignmentIsAlias:()=>X_,expressionResultIsUnused:()=>dT,extend:()=>lt,extensionFromPath:()=>Nw,extensionIsTS:()=>jw,extensionsNotSupportingExtensionlessResolution:()=>uw,externalHelpersModuleNameText:()=>bf,factory:()=>Y,fileExtensionIs:()=>Ka,fileExtensionIsOneOf:()=>qa,fileIncludeReasonToDiagnostics:()=>ZK,fileShouldUseJavaScriptRequire:()=>i1,filter:()=>D,filterMutate:()=>O,filterSemanticDiagnostics:()=>fG,find:()=>b,findAncestor:()=>q,findBestPatternMatch:()=>pn,findChildOfKind:()=>ZX,findComputedPropertyNameCacheAssignment:()=>MN,findConfigFile:()=>lW,findConstructorDeclaration:()=>ZT,findContainingList:()=>QX,findDiagnosticForNode:()=>R$,findFirstNonJsxWhitespaceToken:()=>xie,findIndex:()=>S,findLast:()=>x,findLastIndex:()=>C,findListItemInfo:()=>cie,findModifier:()=>mQ,findNextToken:()=>oZ,findPackageJson:()=>N$,findPackageJsons:()=>M$,findPrecedingMatchingToken:()=>gZ,findPrecedingToken:()=>sZ,findSuperStatementIndexPath:()=>SV,findTokenOnLeftOfPosition:()=>aZ,findUseStrictPrologue:()=>AM,first:()=>Ie,firstDefined:()=>m,firstDefinedIterator:()=>h,firstIterator:()=>Le,firstOrOnly:()=>U$,firstOrUndefined:()=>Pe,firstOrUndefinedIterator:()=>Fe,fixupCompilerOptions:()=>e0,flatMap:()=>A,flatMapIterator:()=>M,flatMapToMutable:()=>j,flatten:()=>re,flattenCommaList:()=>FN,flattenDestructuringAssignment:()=>zV,flattenDestructuringBinding:()=>UV,flattenDiagnosticMessageText:()=>jW,forEach:()=>f,forEachAncestor:()=>Pf,forEachAncestorDirectory:()=>Fo,forEachAncestorDirectoryStoppingAtGlobalCache:()=>QR,forEachChild:()=>pP,forEachChildRecursively:()=>mP,forEachDynamicImportOrRequireCall:()=>sE,forEachEmittedFile:()=>xU,forEachEnclosingBlockScopeContainer:()=>gm,forEachEntry:()=>Ff,forEachExternalModuleToImportFrom:()=>f1,forEachImportClauseDeclaration:()=>a_,forEachKey:()=>If,forEachLeadingCommentRange:()=>Ms,forEachNameInAccessChainWalkingLeft:()=>yS,forEachNameOfDefaultExport:()=>g1,forEachPropertyAssignment:()=>xh,forEachResolvedProjectReference:()=>qW,forEachReturnStatement:()=>sh,forEachRight:()=>p,forEachTrailingCommentRange:()=>Ns,forEachTsConfigPropArray:()=>Th,forEachUnique:()=>bQ,forEachYieldExpression:()=>ch,formatColorAndReset:()=>DW,formatDiagnostic:()=>yW,formatDiagnostics:()=>vW,formatDiagnosticsWithColorAndContext:()=>AW,formatGeneratedName:()=>ON,formatGeneratedNamePart:()=>TN,formatLocation:()=>kW,formatMessage:()=>FS,formatStringFromArgs:()=>ES,formatting:()=>k7,generateDjb2Hash:()=>ra,generateTSConfig:()=>_I,getAdjustedReferenceLocation:()=>eZ,getAdjustedRenameLocation:()=>tZ,getAliasDeclarationFromName:()=>J_,getAllAccessorDeclarations:()=>Yy,getAllDecoratorsOfClass:()=>kV,getAllDecoratorsOfClassElement:()=>AV,getAllJSDocTags:()=>Pl,getAllJSDocTagsOfKind:()=>Fl,getAllKeys:()=>Ze,getAllProjectOutputs:()=>LU,getAllSuperTypeNodes:()=>nv,getAllowImportingTsExtensions:()=>nC,getAllowJSCompilerOption:()=>_C,getAllowSyntheticDefaultImports:()=>lC,getAncestor:()=>av,getAnyExtensionFromPath:()=>ro,getAreDeclarationMapsEnabled:()=>gC,getAssignedExpandoInitializer:()=>wg,getAssignedName:()=>$c,getAssignmentDeclarationKind:()=>Pg,getAssignmentDeclarationPropertyAccessKind:()=>Kg,getAssignmentTargetKind:()=>j_,getAutomaticTypeDirectiveNames:()=>GL,getBaseFileName:()=>eo,getBinaryOperatorPrecedence:()=>Wv,getBuildInfo:()=>UU,getBuildInfoFileVersionMap:()=>uK,getBuildInfoText:()=>HU,getBuildOrderFromAnyBuildOrder:()=>Eq,getBuilderCreationParameters:()=>eK,getBuilderFileEmit:()=>SG,getCanonicalDiagnostic:()=>Mm,getCheckFlags:()=>Jx,getClassExtendsHeritageElement:()=>ev,getClassLikeDeclarationOfSymbol:()=>sS,getCombinedLocalAndExportSymbolFlags:()=>Zx,getCombinedModifierFlags:()=>Mc,getCombinedNodeFlags:()=>Pc,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>Nc,getCommentRange:()=>YE,getCommonSourceDirectory:()=>FU,getCommonSourceDirectoryOfConfig:()=>IU,getCompilerOptionValue:()=>AC,getCompilerOptionsDiffValue:()=>hI,getConditions:()=>UL,getConfigFileParsingDiagnostics:()=>rG,getConstantValue:()=>iD,getContainerFlags:()=>Dz,getContainerNode:()=>LX,getContainingClass:()=>Oh,getContainingClassExcludingClassDecorators:()=>jh,getContainingClassStaticBlock:()=>kh,getContainingFunction:()=>Eh,getContainingFunctionDeclaration:()=>Dh,getContainingFunctionOrClassStaticBlock:()=>Ah,getContainingNodeArray:()=>pT,getContainingObjectLiteralElement:()=>S4,getContextualTypeFromParent:()=>m$,getContextualTypeFromParentOrAncestorTypeNode:()=>$X,getDeclarationDiagnostics:()=>tU,getDeclarationEmitExtensionForPath:()=>Dy,getDeclarationEmitOutputFilePath:()=>Ty,getDeclarationEmitOutputFilePathWorker:()=>Ey,getDeclarationFileExtension:()=>MP,getDeclarationFromName:()=>G_,getDeclarationModifierFlagsFromSymbol:()=>Yx,getDeclarationOfKind:()=>Cf,getDeclarationsOfKind:()=>wf,getDeclaredExpandoInitializer:()=>Sg,getDecorators:()=>el,getDefaultCompilerOptions:()=>h4,getDefaultFormatCodeSettings:()=>aX,getDefaultLibFileName:()=>nc,getDefaultLibFilePath:()=>w4,getDefaultLikeExportInfo:()=>h1,getDefaultLikeExportNameFromDeclaration:()=>G$,getDefaultResolutionModeForFileWorker:()=>lG,getDiagnosticText:()=>PF,getDiagnosticsWithinSpan:()=>z$,getDirectoryPath:()=>$a,getDirectoryToWatchFailedLookupLocation:()=>wK,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>DK,getDocumentPositionMapper:()=>G1,getDocumentSpansEqualityComparer:()=>yQ,getESModuleInterop:()=>cC,getEditsForFileRename:()=>D1,getEffectiveBaseTypeNode:()=>$_,getEffectiveConstraintOfTypeParameter:()=>zl,getEffectiveContainerForJSDocTemplateTag:()=>x_,getEffectiveImplementsTypeNodes:()=>tv,getEffectiveInitializer:()=>xg,getEffectiveJSDocHost:()=>w_,getEffectiveModifierFlags:()=>wb,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>Tb,getEffectiveModifierFlagsNoCache:()=>jb,getEffectiveReturnTypeNode:()=>Qy,getEffectiveSetAccessorTypeAnnotationNode:()=>tb,getEffectiveTypeAnnotationNode:()=>Xy,getEffectiveTypeParameterDeclarations:()=>Rl,getEffectiveTypeRoots:()=>LL,getElementOrPropertyAccessArgumentExpressionOrName:()=>Wg,getElementOrPropertyAccessName:()=>Gg,getElementsOfBindingOrAssignmentPattern:()=>tN,getEmitDeclarations:()=>pC,getEmitFlags:()=>Pp,getEmitHelpers:()=>lD,getEmitModuleDetectionKind:()=>oC,getEmitModuleFormatOfFileWorker:()=>sG,getEmitModuleKind:()=>iC,getEmitModuleResolutionKind:()=>aC,getEmitScriptTarget:()=>rC,getEmitStandardClassFields:()=>EC,getEnclosingBlockScopeContainer:()=>hm,getEnclosingContainer:()=>mm,getEncodedSemanticClassifications:()=>v1,getEncodedSyntacticClassifications:()=>b1,getEndLinePosition:()=>ap,getEntityNameFromTypeNode:()=>Vh,getEntrypointsFromPackageJsonInfo:()=>jR,getErrorCountForSummary:()=>zK,getErrorSpanForNode:()=>Fm,getErrorSummaryText:()=>UK,getEscapedTextOfIdentifierOrLiteral:()=>wv,getEscapedTextOfJsxAttributeName:()=>PT,getEscapedTextOfJsxNamespacedName:()=>LT,getExpandoInitializer:()=>Tg,getExportAssignmentExpression:()=>Z_,getExportInfoMap:()=>m1,getExportNeedsImportStarHelper:()=>cV,getExpressionAssociativity:()=>Rv,getExpressionPrecedence:()=>Bv,getExternalHelpersModuleName:()=>BM,getExternalModuleImportEqualsDeclarationExpression:()=>ng,getExternalModuleName:()=>n_,getExternalModuleNameFromDeclaration:()=>Sy,getExternalModuleNameFromPath:()=>Cy,getExternalModuleNameLiteral:()=>GM,getExternalModuleRequireArgument:()=>rg,getFallbackOptions:()=>sW,getFileEmitOutput:()=>_G,getFileMatcherPatterns:()=>YC,getFileNamesFromConfigSpecs:()=>sL,getFileWatcherEventKind:()=>ba,getFilesInErrorForSummary:()=>BK,getFirstConstructorWithBody:()=>By,getFirstIdentifier:()=>Jb,getFirstNonSpaceCharacterPosition:()=>XQ,getFirstProjectOutput:()=>zU,getFixableErrorSpanExpression:()=>V$,getFormatCodeSettingsForWriting:()=>e1,getFullWidth:()=>zf,getFunctionFlags:()=>hv,getHeritageClause:()=>iv,getHostSignatureFromJSDoc:()=>C_,getIdentifierAutoGenerate:()=>yD,getIdentifierGeneratedImportReference:()=>Hee,getIdentifierTypeArguments:()=>_D,getImmediatelyInvokedFunctionExpression:()=>Ih,getImpliedNodeFormatForEmitWorker:()=>cG,getImpliedNodeFormatForFile:()=>iG,getImpliedNodeFormatForFileWorker:()=>aG,getImportNeedsImportDefaultHelper:()=>uV,getImportNeedsImportStarHelper:()=>lV,getIndentString:()=>hy,getInferredLibraryNameResolveFrom:()=>XW,getInitializedVariables:()=>Wx,getInitializerOfBinaryExpression:()=>qg,getInitializerOfBindingOrAssignmentElement:()=>YM,getInterfaceBaseTypeNodes:()=>rv,getInternalEmitFlags:()=>Fp,getInvokedExpression:()=>Hh,getIsFileExcluded:()=>p1,getIsolatedModules:()=>sC,getJSDocAugmentsTag:()=>ll,getJSDocClassTag:()=>dl,getJSDocCommentRanges:()=>nh,getJSDocCommentsAndTags:()=>g_,getJSDocDeprecatedTag:()=>xl,getJSDocDeprecatedTagNoCache:()=>Sl,getJSDocEnumTag:()=>Cl,getJSDocHost:()=>T_,getJSDocImplementsTags:()=>ul,getJSDocOverloadTags:()=>S_,getJSDocOverrideTagNoCache:()=>bl,getJSDocParameterTags:()=>rl,getJSDocParameterTagsNoCache:()=>il,getJSDocPrivateTag:()=>ml,getJSDocPrivateTagNoCache:()=>hl,getJSDocProtectedTag:()=>gl,getJSDocProtectedTagNoCache:()=>_l,getJSDocPublicTag:()=>fl,getJSDocPublicTagNoCache:()=>pl,getJSDocReadonlyTag:()=>vl,getJSDocReadonlyTagNoCache:()=>yl,getJSDocReturnTag:()=>Tl,getJSDocReturnType:()=>Al,getJSDocRoot:()=>E_,getJSDocSatisfiesExpressionType:()=>MT,getJSDocSatisfiesTag:()=>Dl,getJSDocTags:()=>Ml,getJSDocTemplateTag:()=>El,getJSDocThisTag:()=>wl,getJSDocType:()=>kl,getJSDocTypeAliasName:()=>nN,getJSDocTypeAssertionType:()=>FM,getJSDocTypeParameterDeclarations:()=>$y,getJSDocTypeParameterTags:()=>ol,getJSDocTypeParameterTagsNoCache:()=>sl,getJSDocTypeTag:()=>Ol,getJSXImplicitImportBase:()=>MC,getJSXRuntimeImport:()=>NC,getJSXTransformEnabled:()=>jC,getKeyForCompilerOptions:()=>YL,getLanguageVariant:()=>YS,getLastChild:()=>dS,getLeadingCommentRanges:()=>Ls,getLeadingCommentRangesOfNode:()=>th,getLeftmostAccessExpression:()=>vS,getLeftmostExpression:()=>bS,getLibraryNameFromLibFileName:()=>ZW,getLineAndCharacterOfPosition:()=>ms,getLineInfo:()=>GB,getLineOfLocalPosition:()=>Ry,getLineStartPositionForPosition:()=>BX,getLineStarts:()=>us,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>zx,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>Rx,getLinesBetweenPositions:()=>ps,getLinesBetweenRangeEndAndRangeStart:()=>Nx,getLinesBetweenRangeEndPositions:()=>Px,getLiteralText:()=>Rp,getLocalNameForExternalImport:()=>WM,getLocalSymbolForExportDefault:()=>ox,getLocaleSpecificMessage:()=>AS,getLocaleTimeString:()=>IK,getMappedContextSpan:()=>wQ,getMappedDocumentSpan:()=>CQ,getMappedLocation:()=>SQ,getMatchedFileSpec:()=>YK,getMatchedIncludeSpec:()=>XK,getMeaningFromDeclaration:()=>_X,getMeaningFromLocation:()=>vX,getMembersOfDeclaration:()=>uh,getModeForFileReference:()=>MW,getModeForResolutionAtIndex:()=>NW,getModeForUsageLocation:()=>FW,getModifiedTime:()=>ca,getModifiers:()=>tl,getModuleInstanceState:()=>_z,getModuleNameStringLiteralAt:()=>gG,getModuleSpecifierEndingPreference:()=>vw,getModuleSpecifierResolverHost:()=>eQ,getNameForExportedSymbol:()=>W$,getNameFromImportAttribute:()=>KT,getNameFromIndexInfo:()=>vm,getNameFromPropertyName:()=>YZ,getNameOfAccessExpression:()=>gS,getNameOfCompilerOptionValue:()=>fI,getNameOfDeclaration:()=>Qc,getNameOfExpando:()=>Og,getNameOfJSDocTypedef:()=>Yc,getNameOfScriptTarget:()=>TC,getNameOrArgument:()=>Vg,getNameTable:()=>x4,getNamespaceDeclarationNode:()=>r_,getNewLineCharacter:()=>xx,getNewLineKind:()=>Q$,getNewLineOrDefaultFromHost:()=>BQ,getNewTargetContainer:()=>cee,getNextJSDocCommentLocation:()=>y_,getNodeChildren:()=>oM,getNodeForGeneratedName:()=>wN,getNodeId:()=>xB,getNodeKind:()=>RX,getNodeModifiers:()=>CZ,getNodeModulePathParts:()=>ST,getNonAssignedNameOfDeclaration:()=>Zc,getNonAssignmentOperatorForCompoundAssignment:()=>yV,getNonAugmentationDeclaration:()=>em,getNonDecoratorTokenPosOfNode:()=>Sp,getNonIncrementalBuildInfoRoots:()=>dK,getNonModifierTokenPosOfNode:()=>Cp,getNormalizedAbsolutePath:()=>po,getNormalizedAbsolutePathWithoutRoot:()=>go,getNormalizedPathComponents:()=>fo,getObjectFlags:()=>cS,getOperatorAssociativity:()=>zv,getOperatorPrecedence:()=>Uv,getOptionFromName:()=>kF,getOptionsForLibraryResolution:()=>aR,getOptionsNameMap:()=>gF,getOrCreateEmitNode:()=>IE,getOrUpdate:()=>ae,getOriginalNode:()=>Rc,getOriginalNodeId:()=>iV,getOutputDeclarationFileName:()=>OU,getOutputDeclarationFileNameWorker:()=>kU,getOutputExtension:()=>EU,getOutputFileNames:()=>RU,getOutputJSFileNameWorker:()=>jU,getOutputPathsFor:()=>wU,getOwnEmitOutputFilePath:()=>wy,getOwnKeys:()=>Xe,getOwnValues:()=>Qe,getPackageJsonTypesVersionsPaths:()=>IL,getPackageNameFromTypesPackageName:()=>oz,getPackageScopeForPath:()=>NR,getParameterSymbolFromJSDoc:()=>b_,getParentNodeInSpan:()=>pQ,getParseTreeNode:()=>Bc,getParsedCommandLineOfConfigFile:()=>FF,getPathComponents:()=>ao,getPathFromPathComponents:()=>oo,getPathUpdater:()=>O1,getPathsBasePath:()=>Ay,getPatternFromSpec:()=>KC,getPendingEmitKindWithSeen:()=>FG,getPositionOfLineAndCharacter:()=>cs,getPossibleGenericSignatures:()=>vZ,getPossibleOriginalInputExtensionForExtension:()=>Oy,getPossibleOriginalInputPathWithoutChangingExt:()=>ky,getPossibleTypeArgumentsInfo:()=>yZ,getPreEmitDiagnostics:()=>_W,getPrecedingNonSpaceCharacterPosition:()=>ZQ,getPrivateIdentifier:()=>NV,getProperties:()=>CV,getProperty:()=>Ye,getPropertyArrayElementValue:()=>Sh,getPropertyAssignmentAliasLikeExpression:()=>Q_,getPropertyNameForPropertyNameNode:()=>xv,getPropertyNameFromType:()=>VT,getPropertyNameOfBindingOrAssignmentElement:()=>QM,getPropertySymbolFromBindingElement:()=>fQ,getPropertySymbolsFromContextualType:()=>C4,getQuoteFromPreference:()=>sQ,getQuotePreference:()=>oQ,getRangesWhere:()=>ue,getRefactorContextSpan:()=>B$,getReferencedFileLocation:()=>tG,getRegexFromPattern:()=>XC,getRegularExpressionForWildcard:()=>UC,getRegularExpressionsForWildcards:()=>WC,getRelativePathFromDirectory:()=>jo,getRelativePathFromFile:()=>No,getRelativePathToDirectoryOrUrl:()=>Po,getRenameLocation:()=>c$,getReplacementSpanForContextToken:()=>PZ,getResolutionDiagnostic:()=>hG,getResolutionModeOverride:()=>RW,getResolveJsonModule:()=>fC,getResolvePackageJsonExports:()=>uC,getResolvePackageJsonImports:()=>dC,getResolvedExternalModuleName:()=>xy,getResolvedModuleFromResolution:()=>Hf,getResolvedTypeReferenceDirectiveFromResolution:()=>Uf,getRestIndicatorOfBindingOrAssignmentElement:()=>ZM,getRestParameterElementType:()=>lh,getRightMostAssignedExpression:()=>Ag,getRootDeclaration:()=>Pv,getRootDirectoryOfResolutionCache:()=>OK,getRootLength:()=>Qa,getScriptKind:()=>qQ,getScriptKindFromFileName:()=>tw,getScriptTargetFeatures:()=>Ip,getSelectedEffectiveModifierFlags:()=>xb,getSelectedSyntacticModifierFlags:()=>Sb,getSemanticClassifications:()=>_1,getSemanticJsxChildren:()=>Gv,getSetAccessorTypeAnnotationNode:()=>Hy,getSetAccessorValueParameter:()=>Vy,getSetExternalModuleIndicator:()=>ZS,getShebang:()=>zs,getSingleVariableOfVariableStatement:()=>p_,getSnapshotText:()=>KZ,getSnippetElement:()=>dD,getSourceFileOfModule:()=>ep,getSourceFileOfNode:()=>$f,getSourceFilePathInNewDir:()=>Ny,getSourceFileVersionAsHashFromText:()=>sq,getSourceFilesToEmit:()=>jy,getSourceMapRange:()=>UE,getSourceMapper:()=>W1,getSourceTextOfNodeFromSourceFile:()=>wp,getSpanOfTokenAtPosition:()=>Nm,getSpellingSuggestion:()=>Qt,getStartPositionOfLine:()=>rp,getStartPositionOfRange:()=>Lx,getStartsOnNewLine:()=>qE,getStaticPropertiesAndClassStaticBlock:()=>TV,getStrictOptionValue:()=>wC,getStringComparer:()=>Wt,getSubPatternFromSpec:()=>qC,getSuperCallFromStatement:()=>bV,getSuperContainer:()=>Fh,getSupportedCodeFixes:()=>g4,getSupportedExtensions:()=>dw,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>fw,getSwitchedType:()=>y$,getSymbolId:()=>SB,getSymbolNameForPrivateIdentifier:()=>Tv,getSymbolTarget:()=>JQ,getSyntacticClassifications:()=>y1,getSyntacticModifierFlags:()=>Eb,getSyntacticModifierFlagsNoCache:()=>Mb,getSynthesizedDeepClone:()=>QQ,getSynthesizedDeepCloneWithReplacements:()=>$Q,getSynthesizedDeepClones:()=>e$,getSynthesizedDeepClonesWithReplacements:()=>t$,getSyntheticLeadingComments:()=>ZE,getSyntheticTrailingComments:()=>eD,getTargetLabel:()=>EX,getTargetOfBindingOrAssignmentElement:()=>XM,getTemporaryModuleResolutionState:()=>MR,getTextOfConstantValue:()=>Bp,getTextOfIdentifierOrLiteral:()=>Cv,getTextOfJSDocComment:()=>Il,getTextOfJsxAttributeName:()=>FT,getTextOfJsxNamespacedName:()=>RT,getTextOfNode:()=>jp,getTextOfNodeFromSourceText:()=>Ap,getTextOfPropertyName:()=>xm,getThisContainer:()=>Mh,getThisParameter:()=>Uy,getTokenAtPosition:()=>iZ,getTokenPosOfNode:()=>xp,getTokenSourceMapRange:()=>GE,getTouchingPropertyName:()=>nZ,getTouchingToken:()=>rZ,getTrailingCommentRanges:()=>Rs,getTrailingSemicolonDeferringWriter:()=>vy,getTransformers:()=>uU,getTsBuildInfoEmitOutputFilePath:()=>SU,getTsConfigObjectLiteralExpression:()=>Ch,getTsConfigPropArrayElementValue:()=>wh,getTypeAnnotationNode:()=>Zy,getTypeArgumentOrTypeParameterList:()=>wZ,getTypeKeywordOfTypeOnlyImport:()=>gQ,getTypeNode:()=>hD,getTypeNodeIfAccessible:()=>x$,getTypeParameterFromJsDoc:()=>D_,getTypeParameterOwner:()=>Ec,getTypesPackageName:()=>iz,getUILocale:()=>Jt,getUniqueName:()=>s$,getUniqueSymbolId:()=>YQ,getUseDefineForClassFields:()=>vC,getWatchErrorSummaryDiagnosticMessage:()=>VK,getWatchFactory:()=>oW,group:()=>ot,groupBy:()=>st,guessIndentation:()=>ff,handleNoEmitOptions:()=>dG,handleWatchOptionsConfigDirTemplateSubstitution:()=>DI,hasAbstractModifier:()=>gb,hasAccessorModifier:()=>vb,hasAmbientModifier:()=>_b,hasChangesInResolutions:()=>Xf,hasContextSensitiveParameters:()=>mT,hasDecorators:()=>bb,hasDocComment:()=>xZ,hasDynamicName:()=>yv,hasEffectiveModifier:()=>db,hasEffectiveModifiers:()=>lb,hasEffectiveReadonlyModifier:()=>yb,hasExtension:()=>Ga,hasImplementationTSFileExtension:()=>gw,hasIndexSignature:()=>v$,hasInferredType:()=>tE,hasInitializer:()=>sf,hasInvalidEscape:()=>Xv,hasJSDocNodes:()=>af,hasJSDocParameterTags:()=>cl,hasJSFileExtension:()=>mw,hasJsonModuleEmitEnabled:()=>bC,hasOnlyExpressionInitializer:()=>cf,hasOverrideModifier:()=>hb,hasPossibleExternalModuleReference:()=>fm,hasProperty:()=>Je,hasPropertyAccessExpressionWithName:()=>DX,hasQuestionToken:()=>o_,hasRecordedExternalHelpers:()=>VM,hasResolutionModeOverride:()=>UT,hasRestParameter:()=>hf,hasScopeMarker:()=>Sd,hasStaticModifier:()=>mb,hasSyntacticModifier:()=>fb,hasSyntacticModifiers:()=>ub,hasTSFileExtension:()=>hw,hasTabstop:()=>DT,hasTrailingDirectorySeparator:()=>Ja,hasType:()=>of,hasTypeArguments:()=>O_,hasZeroOrOneAsteriskCharacter:()=>PC,hostGetCanonicalFileName:()=>by,hostUsesCaseSensitiveFileNames:()=>yy,idText:()=>Uc,identifierIsThisKeyword:()=>Jy,identifierToKeywordKind:()=>Wc,identity:()=>Tt,identitySourceMapConsumer:()=>rV,ignoreSourceNewlines:()=>pD,ignoredPaths:()=>xa,importFromModuleSpecifier:()=>$g,importSyntaxAffectsModuleResolution:()=>QS,indexOfAnyCharCode:()=>T,indexOfNode:()=>Np,indicesOf:()=>pe,inferredTypesContainingFile:()=>YW,injectClassNamedEvaluationHelperBlockIfMissing:()=>oH,injectClassThisAssignmentIfMissing:()=>eH,insertImports:()=>hQ,insertSorted:()=>ye,insertStatementAfterCustomPrologue:()=>_p,insertStatementAfterStandardPrologue:()=>gp,insertStatementsAfterCustomPrologue:()=>hp,insertStatementsAfterStandardPrologue:()=>mp,intersperse:()=>v,intrinsicTagNameToString:()=>zT,introducesArgumentsExoticObject:()=>see,inverseJsxOptionMap:()=>GP,isAbstractConstructorSymbol:()=>oS,isAbstractModifier:()=>CO,isAccessExpression:()=>hS,isAccessibilityModifier:()=>kZ,isAccessor:()=>Bu,isAccessorModifier:()=>TO,isAliasableExpression:()=>Y_,isAmbientModule:()=>Wp,isAmbientPropertyDeclaration:()=>im,isAnyDirectorySeparator:()=>za,isAnyImportOrBareOrAccessedRequire:()=>lm,isAnyImportOrReExport:()=>pm,isAnyImportOrRequireStatement:()=>um,isAnyImportSyntax:()=>cm,isAnySupportedFileExtension:()=>Pw,isApplicableVersionedTypesKey:()=>YR,isArgumentExpressionOfElementAccess:()=>NX,isArray:()=>ht,isArrayBindingElement:()=>Qu,isArrayBindingOrAssignmentElement:()=>ad,isArrayBindingOrAssignmentPattern:()=>id,isArrayBindingPattern:()=>gk,isArrayLiteralExpression:()=>vk,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>jZ,isArrayTypeNode:()=>ZO,isArrowFunction:()=>Ok,isAsExpression:()=>Uk,isAssertClause:()=>MA,isAssertEntry:()=>NA,isAssertionExpression:()=>yd,isAssertsKeyword:()=>yO,isAssignmentDeclaration:()=>bg,isAssignmentExpression:()=>Wb,isAssignmentOperator:()=>Vb,isAssignmentPattern:()=>Zu,isAssignmentTarget:()=>M_,isAsteriskToken:()=>lO,isAsyncFunction:()=>gv,isAsyncModifier:()=>vO,isAutoAccessorPropertyDeclaration:()=>Vu,isAwaitExpression:()=>Mk,isAwaitKeyword:()=>bO,isBigIntLiteral:()=>ZD,isBinaryExpression:()=>Fk,isBinaryLogicalOperator:()=>Fb,isBinaryOperatorToken:()=>vN,isBindableObjectDefinePropertyCall:()=>Fg,isBindableStaticAccessExpression:()=>Rg,isBindableStaticElementAccessExpression:()=>zg,isBindableStaticNameExpression:()=>Bg,isBindingElement:()=>_k,isBindingElementOfBareOrAccessedRequire:()=>hg,isBindingName:()=>Au,isBindingOrAssignmentElement:()=>ed,isBindingOrAssignmentPattern:()=>td,isBindingPattern:()=>Xu,isBlock:()=>Qk,isBlockLike:()=>a1,isBlockOrCatchScoped:()=>Hp,isBlockScope:()=>am,isBlockScopedContainerTopLevel:()=>Xp,isBooleanLiteral:()=>Pu,isBreakOrContinueStatement:()=>$l,isBreakStatement:()=>lA,isBuildCommand:()=>XJ,isBuildInfoFile:()=>bU,isBuilderProgram:()=>GK,isBundle:()=>gj,isCallChain:()=>Wl,isCallExpression:()=>Sk,isCallExpressionTarget:()=>bX,isCallLikeExpression:()=>ld,isCallLikeOrFunctionLikeExpression:()=>cd,isCallOrNewExpression:()=>ud,isCallOrNewExpressionTarget:()=>SX,isCallSignatureDeclaration:()=>HO,isCallToHelper:()=>YD,isCaseBlock:()=>EA,isCaseClause:()=>sj,isCaseKeyword:()=>OO,isCaseOrDefaultClause:()=>Qd,isCatchClause:()=>uj,isCatchClauseVariableDeclaration:()=>gT,isCatchClauseVariableDeclarationOrBindingElement:()=>Up,isCheckJsEnabledForFile:()=>Iw,isCircularBuildOrder:()=>Tq,isClassDeclaration:()=>bA,isClassElement:()=>Ru,isClassExpression:()=>Bk,isClassInstanceProperty:()=>Hu,isClassLike:()=>zu,isClassMemberModifier:()=>Eu,isClassNamedEvaluationHelperBlock:()=>rH,isClassOrTypeElement:()=>Ku,isClassStaticBlockDeclaration:()=>RO,isClassThisAssignmentBlock:()=>QV,isColonToken:()=>fO,isCommaExpression:()=>MM,isCommaListExpression:()=>Yk,isCommaSequence:()=>NM,isCommaToken:()=>oO,isComment:()=>TZ,isCommonJsExportPropertyAssignment:()=>mh,isCommonJsExportedExpression:()=>ph,isCompoundAssignment:()=>vV,isComputedNonLiteralName:()=>ym,isComputedPropertyName:()=>AO,isConciseBody:()=>Ed,isConditionalExpression:()=>Ik,isConditionalTypeNode:()=>ik,isConstAssertion:()=>XT,isConstTypeReference:()=>Xl,isConstructSignatureDeclaration:()=>UO,isConstructorDeclaration:()=>zO,isConstructorTypeNode:()=>JO,isContextualKeyword:()=>lv,isContinueStatement:()=>cA,isCustomPrologue:()=>Zm,isDebuggerStatement:()=>gA,isDeclaration:()=>zd,isDeclarationBindingElement:()=>$u,isDeclarationFileName:()=>jP,isDeclarationName:()=>W_,isDeclarationNameOfEnumOrNamespace:()=>Ux,isDeclarationReadonly:()=>Bm,isDeclarationStatement:()=>Bd,isDeclarationWithTypeParameterChildren:()=>sm,isDeclarationWithTypeParameters:()=>om,isDecorator:()=>NO,isDecoratorTarget:()=>$re,isDefaultClause:()=>cj,isDefaultImport:()=>i_,isDefaultModifier:()=>_O,isDefaultedExpandoInitializer:()=>Dg,isDeleteExpression:()=>kk,isDeleteTarget:()=>H_,isDeprecatedDeclaration:()=>X$,isDestructuringAssignment:()=>Gb,isDiskPathRoot:()=>W,isDoStatement:()=>rA,isDocumentRegistryEntry:()=>S1,isDotDotDotToken:()=>aO,isDottedName:()=>Yb,isDynamicName:()=>bv,isEffectiveExternalModule:()=>nm,isEffectiveStrictModeSourceFile:()=>rm,isElementAccessChain:()=>Ul,isElementAccessExpression:()=>xk,isEmittedFileOfProgram:()=>iW,isEmptyArrayLiteral:()=>ax,isEmptyBindingElement:()=>kc,isEmptyBindingPattern:()=>Oc,isEmptyObjectLiteral:()=>ix,isEmptyStatement:()=>eA,isEmptyStringLiteral:()=>Yh,isEntityName:()=>Ou,isEntityNameExpression:()=>qb,isEnumConst:()=>zm,isEnumDeclaration:()=>CA,isEnumMember:()=>mj,isEqualityOperatorKind:()=>g$,isEqualsGreaterThanToken:()=>mO,isExclamationToken:()=>uO,isExcludedFile:()=>cL,isExclusivelyTypeOnlyImportOrExport:()=>PW,isExpandoPropertyDeclaration:()=>HT,isExportAssignment:()=>BA,isExportDeclaration:()=>VA,isExportModifier:()=>gO,isExportName:()=>OM,isExportNamespaceAsDefaultDeclaration:()=>Ep,isExportOrDefaultModifier:()=>SN,isExportSpecifier:()=>UA,isExportsIdentifier:()=>jg,isExportsOrModuleExportsOrAlias:()=>Ez,isExpression:()=>J,isExpressionNode:()=>Zh,isExpressionOfExternalModuleImportEqualsDeclaration:()=>aie,isExpressionOfOptionalChainRoot:()=>ql,isExpressionStatement:()=>tA,isExpressionWithTypeArguments:()=>Hk,isExpressionWithTypeArgumentsInClassExtendsClause:()=>Kb,isExternalModule:()=>bP,isExternalModuleAugmentation:()=>Qp,isExternalModuleImportEqualsDeclaration:()=>tg,isExternalModuleIndicator:()=>wd,isExternalModuleNameRelative:()=>$s,isExternalModuleReference:()=>JA,isExternalModuleSymbol:()=>Df,isExternalOrCommonJsModule:()=>Lm,isFileLevelReservedGeneratedIdentifier:()=>xu,isFileLevelUniqueName:()=>op,isFileProbablyExternalModule:()=>qN,isFirstDeclarationOfSymbolParameter:()=>TQ,isFixablePromiseHandler:()=>X1,isForInOrOfStatement:()=>Td,isForInStatement:()=>oA,isForInitializer:()=>Od,isForOfStatement:()=>sA,isForStatement:()=>aA,isFullSourceFile:()=>ag,isFunctionBlock:()=>gh,isFunctionBody:()=>Dd,isFunctionDeclaration:()=>yA,isFunctionExpression:()=>Dk,isFunctionExpressionOrArrowFunction:()=>_T,isFunctionLike:()=>ju,isFunctionLikeDeclaration:()=>Nu,isFunctionLikeKind:()=>Iu,isFunctionLikeOrClassStaticBlockDeclaration:()=>Mu,isFunctionOrConstructorTypeNode:()=>Yu,isFunctionOrModuleBlock:()=>Lu,isFunctionSymbol:()=>Zg,isFunctionTypeNode:()=>qO,isGeneratedIdentifier:()=>yu,isGeneratedPrivateIdentifier:()=>bu,isGetAccessor:()=>rf,isGetAccessorDeclaration:()=>BO,isGetOrSetAccessorDeclaration:()=>Vl,isGlobalScopeAugmentation:()=>Zp,isGlobalSourceFile:()=>Im,isGrammarError:()=>lp,isHeritageClause:()=>lj,isHoistedFunction:()=>Qm,isHoistedVariableStatement:()=>eh,isIdentifier:()=>X,isIdentifierANonContextualKeyword:()=>fv,isIdentifierName:()=>q_,isIdentifierOrThisTypeNode:()=>cN,isIdentifierPart:()=>Vs,isIdentifierStart:()=>Bs,isIdentifierText:()=>Hs,isIdentifierTypePredicate:()=>yh,isIdentifierTypeReference:()=>eT,isIfStatement:()=>nA,isIgnoredFileFromWildCardWatching:()=>rW,isImplicitGlob:()=>GC,isImportAttribute:()=>FA,isImportAttributeName:()=>vu,isImportAttributes:()=>PA,isImportCall:()=>qm,isImportClause:()=>AA,isImportDeclaration:()=>kA,isImportEqualsDeclaration:()=>OA,isImportKeyword:()=>DO,isImportMeta:()=>Jm,isImportOrExportSpecifier:()=>fu,isImportOrExportSpecifierName:()=>KQ,isImportSpecifier:()=>zA,isImportTypeAssertionContainer:()=>jA,isImportTypeNode:()=>fk,isImportable:()=>u1,isInComment:()=>bZ,isInCompoundLikeAssignment:()=>N_,isInExpressionContext:()=>Qh,isInJSDoc:()=>ug,isInJSFile:()=>sg,isInJSXText:()=>mZ,isInJsonFile:()=>cg,isInNonReferenceComment:()=>NZ,isInReferenceComment:()=>MZ,isInRightSideOfInternalImportEqualsDeclaration:()=>yX,isInString:()=>uZ,isInTemplateString:()=>pZ,isInTopLevelContext:()=>Ph,isInTypeQuery:()=>Ky,isIncrementalBuildInfo:()=>YG,isIncrementalBundleEmitBuildInfo:()=>JG,isIncrementalCompilation:()=>hC,isIndexSignatureDeclaration:()=>WO,isIndexedAccessTypeNode:()=>lk,isInferTypeNode:()=>ak,isInfinityOrNaNString:()=>hT,isInitializedProperty:()=>EV,isInitializedVariable:()=>Gx,isInsideJsxElement:()=>hZ,isInsideJsxElementOrAttribute:()=>dZ,isInsideNodeModules:()=>L$,isInsideTemplateLiteral:()=>OZ,isInstanceOfExpression:()=>nx,isInstantiatedModule:()=>CB,isInterfaceDeclaration:()=>xA,isInternalDeclaration:()=>vf,isInternalModuleImportEqualsDeclaration:()=>ig,isInternalName:()=>EM,isIntersectionTypeNode:()=>rk,isIntrinsicJsxName:()=>py,isIterationStatement:()=>bd,isJSDoc:()=>jj,isJSDocAllType:()=>Cj,isJSDocAugmentsTag:()=>Pj,isJSDocAuthorTag:()=>Fj,isJSDocCallbackTag:()=>Lj,isJSDocClassTag:()=>Ij,isJSDocCommentContainingNode:()=>ef,isJSDocConstructSignature:()=>s_,isJSDocDeprecatedTag:()=>Wj,isJSDocEnumTag:()=>Kj,isJSDocFunctionType:()=>Oj,isJSDocImplementsTag:()=>eM,isJSDocImportTag:()=>rM,isJSDocIndexSignature:()=>dg,isJSDocLikeText:()=>KN,isJSDocLink:()=>bj,isJSDocLinkCode:()=>xj,isJSDocLinkLike:()=>mf,isJSDocLinkPlain:()=>Sj,isJSDocMemberName:()=>yj,isJSDocNameReference:()=>vj,isJSDocNamepathType:()=>Aj,isJSDocNamespaceBody:()=>jd,isJSDocNode:()=>$d,isJSDocNonNullableType:()=>Ej,isJSDocNullableType:()=>Tj,isJSDocOptionalParameter:()=>OT,isJSDocOptionalType:()=>Dj,isJSDocOverloadTag:()=>Uj,isJSDocOverrideTag:()=>Hj,isJSDocParameterTag:()=>qj,isJSDocPrivateTag:()=>zj,isJSDocPropertyLikeTag:()=>tu,isJSDocPropertyTag:()=>Zee,isJSDocProtectedTag:()=>Bj,isJSDocPublicTag:()=>Rj,isJSDocReadonlyTag:()=>Vj,isJSDocReturnTag:()=>Jj,isJSDocSatisfiesExpression:()=>jT,isJSDocSatisfiesTag:()=>tM,isJSDocSeeTag:()=>Gj,isJSDocSignature:()=>Nj,isJSDocTag:()=>tf,isJSDocTemplateTag:()=>Zj,isJSDocThisTag:()=>Yj,isJSDocThrowsTag:()=>nM,isJSDocTypeAlias:()=>c_,isJSDocTypeAssertion:()=>PM,isJSDocTypeExpression:()=>_j,isJSDocTypeLiteral:()=>Mj,isJSDocTypeTag:()=>Xj,isJSDocTypedefTag:()=>Qj,isJSDocUnknownTag:()=>$j,isJSDocUnknownType:()=>wj,isJSDocVariadicType:()=>kj,isJSXTagName:()=>Xh,isJsonEqual:()=>qw,isJsonSourceFile:()=>Rm,isJsxAttribute:()=>nj,isJsxAttributeLike:()=>Jd,isJsxAttributeName:()=>IT,isJsxAttributes:()=>rj,isJsxCallLike:()=>Zd,isJsxChild:()=>qd,isJsxClosingElement:()=>QA,isJsxClosingFragment:()=>tj,isJsxElement:()=>YA,isJsxExpression:()=>aj,isJsxFragment:()=>$A,isJsxNamespacedName:()=>oj,isJsxOpeningElement:()=>ZA,isJsxOpeningFragment:()=>ej,isJsxOpeningLikeElement:()=>Xd,isJsxOpeningLikeElementTagName:()=>eie,isJsxSelfClosingElement:()=>XA,isJsxSpreadAttribute:()=>ij,isJsxTagNameExpression:()=>Kd,isJsxText:()=>$D,isJumpStatementTarget:()=>OX,isKeyword:()=>ov,isKeywordOrPunctuation:()=>cv,isKnownSymbol:()=>Ev,isLabelName:()=>AX,isLabelOfLabeledStatement:()=>kX,isLabeledStatement:()=>pA,isLateVisibilityPaintedStatement:()=>dm,isLeftHandSideExpression:()=>fd,isLet:()=>Gm,isLineBreak:()=>_s,isLiteralComputedPropertyDeclarationName:()=>K_,isLiteralExpression:()=>su,isLiteralExpressionOfObject:()=>cu,isLiteralImportTypeNode:()=>Ym,isLiteralKind:()=>ou,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>IX,isLiteralTypeLiteral:()=>_d,isLiteralTypeNode:()=>dk,isLocalName:()=>DM,isLogicalOperator:()=>Ib,isLogicalOrCoalescingAssignmentExpression:()=>Rb,isLogicalOrCoalescingAssignmentOperator:()=>Lb,isLogicalOrCoalescingBinaryExpression:()=>Bb,isLogicalOrCoalescingBinaryOperator:()=>zb,isMappedTypeNode:()=>uk,isMemberName:()=>Bl,isMetaProperty:()=>Kk,isMethodDeclaration:()=>LO,isMethodOrAccessor:()=>Uu,isMethodSignature:()=>IO,isMinusToken:()=>cO,isMissingDeclaration:()=>GA,isMissingPackageJsonInfo:()=>qL,isModifier:()=>Du,isModifierKind:()=>wu,isModifierLike:()=>Wu,isModuleAugmentationExternal:()=>$p,isModuleBlock:()=>TA,isModuleBody:()=>kd,isModuleDeclaration:()=>wA,isModuleExportName:()=>WA,isModuleExportsAccessExpression:()=>Ng,isModuleIdentifier:()=>Mg,isModuleName:()=>dN,isModuleOrEnumDeclaration:()=>Nd,isModuleReference:()=>Gd,isModuleSpecifierLike:()=>uQ,isModuleWithStringLiteralName:()=>Gp,isNameOfFunctionDeclaration:()=>FX,isNameOfModuleDeclaration:()=>PX,isNamedDeclaration:()=>Xc,isNamedEvaluation:()=>jv,isNamedEvaluationSource:()=>Av,isNamedExportBindings:()=>eu,isNamedExports:()=>HA,isNamedImportBindings:()=>Md,isNamedImports:()=>RA,isNamedImportsOrExports:()=>_S,isNamedTupleMember:()=>$O,isNamespaceBody:()=>Ad,isNamespaceExport:()=>LA,isNamespaceExportDeclaration:()=>DA,isNamespaceImport:()=>IA,isNamespaceReexportDeclaration:()=>eg,isNewExpression:()=>Ck,isNewExpressionTarget:()=>xX,isNewScopeNode:()=>lE,isNoSubstitutionTemplateLiteral:()=>tO,isNodeArray:()=>au,isNodeArrayMultiLine:()=>Fx,isNodeDescendantOf:()=>U_,isNodeKind:()=>nu,isNodeLikeSystem:()=>Dn,isNodeModulesDirectory:()=>Io,isNodeWithPossibleHoistedDeclaration:()=>P_,isNonContextualKeyword:()=>uv,isNonGlobalAmbientModule:()=>Kp,isNonNullAccess:()=>AT,isNonNullChain:()=>Ql,isNonNullExpression:()=>Gk,isNonStaticMethodOrAccessorWithPrivateName:()=>DV,isNotEmittedStatement:()=>KA,isNullishCoalesce:()=>Yl,isNumber:()=>vt,isNumericLiteral:()=>XD,isNumericLiteralName:()=>yT,isObjectBindingElementWithoutPropertyName:()=>dQ,isObjectBindingOrAssignmentElement:()=>rd,isObjectBindingOrAssignmentPattern:()=>nd,isObjectBindingPattern:()=>hk,isObjectLiteralElement:()=>lf,isObjectLiteralElementLike:()=>qu,isObjectLiteralExpression:()=>yk,isObjectLiteralMethod:()=>_h,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>vh,isObjectTypeDeclaration:()=>pS,isOmittedExpression:()=>Vk,isOptionalChain:()=>Gl,isOptionalChainRoot:()=>Kl,isOptionalDeclaration:()=>kT,isOptionalJSDocPropertyLikeTag:()=>TT,isOptionalTypeNode:()=>ek,isOuterExpression:()=>IM,isOutermostOptionalChain:()=>Jl,isOverrideModifier:()=>wO,isPackageJsonInfo:()=>KL,isPackedArrayLiteral:()=>uT,isParameter:()=>MO,isParameterPropertyDeclaration:()=>Dc,isParameterPropertyModifier:()=>Tu,isParenthesizedExpression:()=>Ek,isParenthesizedTypeNode:()=>ok,isParseTreeNode:()=>zc,isPartOfParameterDeclaration:()=>Nv,isPartOfTypeNode:()=>oh,isPartOfTypeOnlyImportOrExportDeclaration:()=>gu,isPartOfTypeQuery:()=>$h,isPartiallyEmittedExpression:()=>Jk,isPatternMatch:()=>gn,isPinnedComment:()=>yp,isPlainJsFile:()=>tp,isPlusToken:()=>sO,isPossiblyTypeArgumentPosition:()=>_Z,isPostfixUnaryExpression:()=>Pk,isPrefixUnaryExpression:()=>Nk,isPrimitiveLiteralValue:()=>$T,isPrivateIdentifier:()=>hO,isPrivateIdentifierClassElementDeclaration:()=>Su,isPrivateIdentifierPropertyAccessExpression:()=>Cu,isPrivateIdentifierSymbol:()=>Dv,isProgramUptoDate:()=>nG,isPrologueDirective:()=>Xm,isPropertyAccessChain:()=>Hl,isPropertyAccessEntityNameExpression:()=>Xb,isPropertyAccessExpression:()=>bk,isPropertyAccessOrQualifiedName:()=>sd,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>od,isPropertyAssignment:()=>dj,isPropertyDeclaration:()=>FO,isPropertyName:()=>ku,isPropertyNameLiteral:()=>Sv,isPropertySignature:()=>PO,isPrototypeAccess:()=>Qb,isPrototypePropertyAssignment:()=>Jg,isPunctuation:()=>sv,isPushOrUnshiftIdentifier:()=>Mv,isQualifiedName:()=>kO,isQuestionDotToken:()=>pO,isQuestionOrExclamationToken:()=>sN,isQuestionOrPlusOrMinusToken:()=>uN,isQuestionToken:()=>dO,isReadonlyKeyword:()=>xO,isReadonlyKeywordOrPlusOrMinusToken:()=>lN,isRecognizedTripleSlashComment:()=>vp,isReferenceFileLocation:()=>eG,isReferencedFile:()=>$W,isRegularExpressionLiteral:()=>eO,isRequireCall:()=>fg,isRequireVariableStatement:()=>_g,isRestParameter:()=>gf,isRestTypeNode:()=>tk,isReturnStatement:()=>uA,isReturnStatementWithFixablePromiseHandler:()=>Y1,isRightSideOfAccessExpression:()=>ex,isRightSideOfInstanceofExpression:()=>rx,isRightSideOfPropertyAccess:()=>MX,isRightSideOfQualifiedName:()=>iie,isRightSideOfQualifiedNameOrPropertyAccess:()=>$b,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>tx,isRootedDiskPath:()=>Va,isSameEntityName:()=>kg,isSatisfiesExpression:()=>Wk,isSemicolonClassElement:()=>Zk,isSetAccessor:()=>nf,isSetAccessorDeclaration:()=>VO,isShiftOperatorOrHigher:()=>mN,isShorthandAmbientModuleSymbol:()=>Jp,isShorthandPropertyAssignment:()=>fj,isSideEffectImport:()=>nE,isSignedNumericLiteral:()=>vv,isSimpleCopiableExpression:()=>gV,isSimpleInlineableExpression:()=>_V,isSimpleParameterList:()=>IV,isSingleOrDoubleQuote:()=>vg,isSolutionConfig:()=>II,isSourceElement:()=>qT,isSourceFile:()=>hj,isSourceFileFromLibrary:()=>n1,isSourceFileJS:()=>og,isSourceFileNotJson:()=>lg,isSourceMapping:()=>ZB,isSpecialPropertyDeclaration:()=>Yg,isSpreadAssignment:()=>pj,isSpreadElement:()=>zk,isStatement:()=>Hd,isStatementButNotDeclaration:()=>Vd,isStatementOrBlock:()=>Wd,isStatementWithLocals:()=>np,isStatic:()=>pb,isStaticModifier:()=>SO,isString:()=>_t,isStringANonContextualKeyword:()=>dv,isStringAndEmptyAnonymousObjectIntersection:()=>DZ,isStringDoubleQuoted:()=>yg,isStringLiteral:()=>QD,isStringLiteralLike:()=>pf,isStringLiteralOrJsxExpression:()=>Yd,isStringLiteralOrTemplate:()=>_$,isStringOrNumericLiteralLike:()=>_v,isStringOrRegularExpressionOrTemplateLiteral:()=>EZ,isStringTextContainingNode:()=>_u,isSuperCall:()=>Km,isSuperKeyword:()=>EO,isSuperProperty:()=>Lh,isSupportedSourceFileName:()=>yw,isSwitchStatement:()=>fA,isSyntaxList:()=>iM,isSyntheticExpression:()=>qk,isSyntheticReference:()=>qA,isTagName:()=>jX,isTaggedTemplateExpression:()=>wk,isTaggedTemplateTag:()=>Qre,isTemplateExpression:()=>Lk,isTemplateHead:()=>nO,isTemplateLiteral:()=>dd,isTemplateLiteralKind:()=>lu,isTemplateLiteralToken:()=>uu,isTemplateLiteralTypeNode:()=>mk,isTemplateLiteralTypeSpan:()=>pk,isTemplateMiddle:()=>rO,isTemplateMiddleOrTemplateTail:()=>du,isTemplateSpan:()=>Xk,isTemplateTail:()=>iO,isTextWhiteSpaceLike:()=>xQ,isThis:()=>zX,isThisContainerOrFunctionBlock:()=>Nh,isThisIdentifier:()=>Gy,isThisInTypeQuery:()=>qy,isThisInitializedDeclaration:()=>zh,isThisInitializedObjectBindingExpression:()=>Bh,isThisProperty:()=>Rh,isThisTypeNode:()=>sk,isThisTypeParameter:()=>xT,isThisTypePredicate:()=>bh,isThrowStatement:()=>mA,isToken:()=>iu,isTokenKind:()=>ru,isTraceEnabled:()=>yL,isTransientSymbol:()=>Ef,isTrivia:()=>pv,isTryStatement:()=>hA,isTupleTypeNode:()=>QO,isTypeAlias:()=>l_,isTypeAliasDeclaration:()=>SA,isTypeAssertionExpression:()=>Tk,isTypeDeclaration:()=>CT,isTypeElement:()=>Gu,isTypeKeyword:()=>UZ,isTypeKeywordTokenOrIdentifier:()=>WZ,isTypeLiteralNode:()=>XO,isTypeNode:()=>Ju,isTypeNodeKind:()=>mS,isTypeOfExpression:()=>Ak,isTypeOnlyExportDeclaration:()=>mu,isTypeOnlyImportDeclaration:()=>pu,isTypeOnlyImportOrExportDeclaration:()=>hu,isTypeOperatorNode:()=>ck,isTypeParameterDeclaration:()=>jO,isTypePredicateNode:()=>GO,isTypeQueryNode:()=>YO,isTypeReferenceNode:()=>KO,isTypeReferenceType:()=>uf,isTypeUsableAsPropertyName:()=>BT,isUMDExportSymbol:()=>lS,isUnaryExpression:()=>md,isUnaryExpressionWithWrite:()=>gd,isUnicodeIdentifierStart:()=>Qo,isUnionTypeNode:()=>nk,isUrl:()=>Ba,isValidBigIntString:()=>Qw,isValidESSymbolDeclaration:()=>oee,isValidTypeOnlyAliasUseSite:()=>$w,isValueSignatureDeclaration:()=>F_,isVarAwaitUsing:()=>Vm,isVarConst:()=>Um,isVarConstLike:()=>Wm,isVarUsing:()=>Hm,isVariableDeclaration:()=>_A,isVariableDeclarationInVariableStatement:()=>fh,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>mg,isVariableDeclarationInitializedToRequire:()=>pg,isVariableDeclarationList:()=>vA,isVariableLike:()=>dh,isVariableStatement:()=>$k,isVoidExpression:()=>jk,isWatchSet:()=>Kx,isWhileStatement:()=>iA,isWhiteSpaceLike:()=>hs,isWhiteSpaceSingleLine:()=>gs,isWithStatement:()=>dA,isWriteAccess:()=>$x,isWriteOnlyAccess:()=>Qx,isYieldExpression:()=>Rk,jsxModeNeedsExplicitImport:()=>t1,keywordPart:()=>kQ,last:()=>ze,lastOrUndefined:()=>Re,length:()=>d,libMap:()=>JP,libs:()=>qP,lineBreakPart:()=>VQ,loadModuleFromGlobalCache:()=>fz,loadWithModeAwareCache:()=>KW,makeIdentifierFromModuleName:()=>Vp,makeImport:()=>nQ,makeStringLiteral:()=>rQ,mangleScopedPackageName:()=>az,map:()=>k,mapAllOrFail:()=>P,mapDefined:()=>F,mapDefinedIterator:()=>ie,mapEntries:()=>le,mapIterator:()=>te,mapOneOrMany:()=>H$,mapToDisplayParts:()=>HQ,matchFiles:()=>ZC,matchPatternOrExact:()=>Rw,matchedText:()=>fn,matchesExclude:()=>uL,matchesExcludeWorker:()=>dL,maxBy:()=>zt,maybeBind:()=>R,maybeSetLocalizedDiagnosticMessages:()=>kS,memoize:()=>At,memoizeOne:()=>jt,min:()=>Bt,minAndMax:()=>Iee,missingFileModifiedTime:()=>sa,modifierToFlag:()=>Pb,modifiersToFlags:()=>Nb,moduleExportNameIsDefault:()=>kp,moduleExportNameTextEscaped:()=>Op,moduleExportNameTextUnescaped:()=>Dp,moduleOptionDeclaration:()=>QP,moduleResolutionIsEqualTo:()=>Vf,moduleResolutionNameAndModeGetter:()=>VW,moduleResolutionOptionDeclarations:()=>iF,moduleResolutionSupportsPackageJsonExportsAndImports:()=>CC,moduleResolutionUsesNodeModules:()=>tQ,moduleSpecifierToValidIdentifier:()=>q$,moduleSpecifiers:()=>Az,moduleSymbolToValidIdentifier:()=>K$,moveEmitHelpers:()=>uD,moveRangeEnd:()=>Cx,moveRangePastDecorators:()=>Tx,moveRangePastModifiers:()=>Ex,moveRangePos:()=>wx,moveSyntheticComments:()=>rD,mutateMap:()=>aS,mutateMapSkippingNewValues:()=>iS,needsParentheses:()=>p$,needsScopeMarker:()=>Cd,newCaseClauseTracker:()=>r1,newPrivateEnvironment:()=>MV,noEmitNotification:()=>gU,noEmitSubstitution:()=>hU,noTransformers:()=>lU,noTruncationMaximumTruncationLength:()=>Sf,nodeCanBeDecorated:()=>Uh,nodeCoreModules:()=>oE,nodeHasName:()=>Jc,nodeIsDecorated:()=>Wh,nodeIsMissing:()=>sp,nodeIsPresent:()=>cp,nodeIsSynthesized:()=>Iv,nodeModuleNameResolver:()=>gR,nodeModulesPathPart:()=>xR,nodeNextJsonConfigResolver:()=>_R,nodeOrChildIsDecorated:()=>Gh,nodeOverlapsWithStartEnd:()=>GX,nodePosToString:()=>ip,nodeSeenTracker:()=>GZ,nodeStartsNewLexicalEnvironment:()=>Fv,noop:()=>xt,noopFileWatcher:()=>tq,normalizePath:()=>mo,normalizeSlashes:()=>so,normalizeSpans:()=>vc,not:()=>yn,notImplemented:()=>kt,notImplementedResolver:()=>WU,nullNodeConverters:()=>mE,nullParenthesizerRules:()=>fE,nullTransformationContext:()=>vU,objectAllocator:()=>wS,operatorPart:()=>jQ,optionDeclarations:()=>eF,optionMapToObject:()=>lI,optionsAffectingProgramStructure:()=>oF,optionsForBuild:()=>dF,optionsForWatch:()=>YP,optionsHaveChanges:()=>Nf,or:()=>vn,orderedRemoveItem:()=>an,orderedRemoveItemAt:()=>on,packageIdToPackageName:()=>qf,packageIdToString:()=>Jf,parameterIsThisKeyword:()=>Wy,parameterNamePart:()=>MQ,parseBaseNodeFactory:()=>UN,parseBigInt:()=>Xw,parseBuildCommand:()=>NF,parseCommandLine:()=>OF,parseCommandLineWorker:()=>TF,parseConfigFileTextToJson:()=>LF,parseConfigFileWithSystem:()=>RK,parseConfigHostFromCompilerHostLike:()=>pG,parseCustomTypeOption:()=>xF,parseIsolatedEntityName:()=>vP,parseIsolatedJSDocComment:()=>SP,parseJSDocTypeExpressionForTests:()=>CP,parseJsonConfigFileContent:()=>bI,parseJsonSourceFileConfigFileContent:()=>xI,parseJsonText:()=>yP,parseListTypeOption:()=>SF,parseNodeFactory:()=>WN,parseNodeModuleFromPath:()=>CR,parsePackageName:()=>BR,parsePseudoBigInt:()=>Jw,parseValidBigInt:()=>Zw,pasteEdits:()=>$7,patchWriteFileEnsuringDirectory:()=>Ma,pathContainsNodeModules:()=>SR,pathIsAbsolute:()=>Ha,pathIsBareSpecifier:()=>Wa,pathIsRelative:()=>Ua,patternText:()=>dn,performIncrementalCompilation:()=>mq,performance:()=>lr,positionBelongsToNode:()=>qX,positionIsASICandidate:()=>w$,positionIsSynthesized:()=>Aw,positionsAreOnSameLine:()=>Ix,preProcessFile:()=>Bae,probablyUsesSemicolons:()=>T$,processCommentPragmas:()=>PP,processPragmasIntoFields:()=>FP,processTaggedTemplateExpression:()=>mH,programContainsEsModules:()=>ZZ,programContainsModules:()=>XZ,projectReferenceIsEqualTo:()=>Bf,propertyNamePart:()=>NQ,pseudoBigIntToString:()=>Yw,punctuationPart:()=>AQ,pushIfUnique:()=>De,quote:()=>h$,quotePreferenceFromString:()=>aQ,rangeContainsPosition:()=>VX,rangeContainsPositionExclusive:()=>HX,rangeContainsRange:()=>Bx,rangeContainsRangeExclusive:()=>sie,rangeContainsStartEnd:()=>UX,rangeEndIsOnSameLineAsRangeStart:()=>Mx,rangeEndPositionsAreOnSameLine:()=>Ax,rangeEquals:()=>Me,rangeIsOnSingleLine:()=>Ox,rangeOfNode:()=>Vw,rangeOfTypeParameters:()=>Hw,rangeOverlapsWithStartEnd:()=>WX,rangeStartIsOnSameLineAsRangeEnd:()=>jx,rangeStartPositionsAreOnSameLine:()=>kx,readBuilderProgram:()=>hq,readConfigFile:()=>IF,readJson:()=>gx,readJsonConfigFile:()=>RF,readJsonOrUndefined:()=>hx,reduceEachLeadingCommentRange:()=>Ps,reduceEachTrailingCommentRange:()=>Fs,reduceLeft:()=>Ke,reduceLeftIterator:()=>g,reducePathComponents:()=>co,refactor:()=>k0,regExpEscape:()=>Aee,regularExpressionFlagToCharacterCode:()=>as,relativeComplement:()=>Ce,removeAllComments:()=>RE,removeEmitHelper:()=>cD,removeExtension:()=>Tw,removeFileExtension:()=>Cw,removeIgnoredPath:()=>gK,removeMinAndVersionNumbers:()=>rn,removePrefix:()=>mn,removeSuffix:()=>tn,removeTrailingDirectorySeparator:()=>vo,repeatString:()=>qZ,replaceElement:()=>Ue,replaceFirstStar:()=>GT,resolutionExtensionIsTSOrJson:()=>Mw,resolveConfigFileProjectName:()=>xq,resolveJSModule:()=>uR,resolveLibrary:()=>oR,resolveModuleName:()=>cR,resolveModuleNameFromCache:()=>sR,resolvePackageNameToPackageJson:()=>WL,resolvePath:()=>uo,resolveProjectReferencePath:()=>mG,resolveTripleslashReference:()=>uW,resolveTypeReferenceDirective:()=>VL,resolvingEmptyArray:()=>yf,returnFalse:()=>St,returnNoopFileWatcher:()=>nq,returnTrue:()=>Ct,returnUndefined:()=>wt,returnsPromise:()=>J1,rewriteModuleSpecifier:()=>LV,sameFlatMap:()=>N,sameMap:()=>ne,sameMapping:()=>XB,scanTokenAtPosition:()=>Pm,scanner:()=>gX,semanticDiagnosticsOptionDeclarations:()=>tF,serializeCompilerOptions:()=>pI,server:()=>_je,servicesVersion:()=>Lue,setCommentRange:()=>XE,setConfigFileInOptions:()=>SI,setConstantValue:()=>aD,setEmitFlags:()=>zE,setGetSourceFileAsHashVersioned:()=>cq,setIdentifierAutoGenerate:()=>vD,setIdentifierGeneratedImportReference:()=>bD,setIdentifierTypeArguments:()=>gD,setInternalEmitFlags:()=>VE,setLocalizedDiagnosticMessages:()=>OS,setNodeChildren:()=>sM,setNodeFlags:()=>oT,setObjectAllocator:()=>TS,setOriginalNode:()=>NE,setParent:()=>sT,setParentRecursive:()=>cT,setPrivateIdentifier:()=>PV,setSnippetElement:()=>fD,setSourceMapRange:()=>WE,setStackTraceLimit:()=>ia,setStartsOnNewLine:()=>JE,setSyntheticLeadingComments:()=>QE,setSyntheticTrailingComments:()=>tD,setSys:()=>Pa,setSysLog:()=>wa,setTextRange:()=>Z,setTextRangeEnd:()=>rT,setTextRangePos:()=>nT,setTextRangePosEnd:()=>iT,setTextRangePosWidth:()=>aT,setTokenSourceMapRange:()=>KE,setTypeNode:()=>mD,setUILocale:()=>Yt,setValueDeclaration:()=>Xg,shouldAllowImportingTsExtension:()=>dz,shouldPreserveConstEnums:()=>mC,shouldRewriteModuleSpecifier:()=>t_,shouldUseUriStyleNodeCoreModules:()=>Z$,showModuleSpecifier:()=>uS,signatureHasRestParameter:()=>DB,signatureToDisplayParts:()=>GQ,single:()=>Ve,singleElementArray:()=>xn,singleIterator:()=>se,singleOrMany:()=>He,singleOrUndefined:()=>Be,skipAlias:()=>Xx,skipConstraint:()=>JZ,skipOuterExpressions:()=>LM,skipParentheses:()=>V_,skipPartiallyEmittedExpressions:()=>Zl,skipTrivia:()=>ws,skipTypeChecking:()=>Uw,skipTypeCheckingIgnoringNoCheck:()=>Ww,skipTypeParentheses:()=>B_,skipWhile:()=>En,sliceAfter:()=>zw,some:()=>I,sortAndDeduplicate:()=>be,sortAndDeduplicateDiagnostics:()=>ec,sourceFileAffectingCompilerOptions:()=>aF,sourceFileMayBeEmitted:()=>My,sourceMapCommentRegExp:()=>UB,sourceMapCommentRegExpDontCareLineStart:()=>HB,spacePart:()=>OQ,spanMap:()=>ce,startEndContainsRange:()=>Vx,startEndOverlapsWithStartEnd:()=>KX,startOnNewLine:()=>zM,startTracing:()=>Nr,startsWith:()=>V,startsWithDirectory:()=>ko,startsWithUnderscore:()=>Y$,startsWithUseStrict:()=>jM,stringContainsAt:()=>J$,stringToToken:()=>rs,stripQuotes:()=>dy,supportedDeclarationExtensions:()=>cw,supportedJSExtensionsFlat:()=>aw,supportedLocaleDirectories:()=>Ic,supportedTSExtensionsFlat:()=>rw,supportedTSImplementationExtensions:()=>lw,suppressLeadingAndTrailingTrivia:()=>n$,suppressLeadingTrivia:()=>r$,suppressTrailingTrivia:()=>i$,symbolEscapedNameNoDefault:()=>lQ,symbolName:()=>Gc,symbolNameNoDefault:()=>cQ,symbolToDisplayParts:()=>WQ,sys:()=>Na,sysLog:()=>Ca,tagNamesAreEquivalent:()=>HP,takeWhile:()=>Tn,targetOptionDeclaration:()=>ZP,targetToLibMap:()=>tc,testFormatSettings:()=>Gre,textChangeRangeIsUnchanged:()=>Sc,textChangeRangeNewSpan:()=>xc,textChanges:()=>y7,textOrKeywordPart:()=>PQ,textPart:()=>FQ,textRangeContainsPositionInclusive:()=>oc,textRangeContainsTextSpan:()=>lc,textRangeIntersectsWithTextSpan:()=>gc,textSpanContainsPosition:()=>ac,textSpanContainsTextRange:()=>cc,textSpanContainsTextSpan:()=>sc,textSpanEnd:()=>rc,textSpanIntersection:()=>_c,textSpanIntersectsWith:()=>pc,textSpanIntersectsWithPosition:()=>hc,textSpanIntersectsWithTextSpan:()=>fc,textSpanIsEmpty:()=>ic,textSpanOverlap:()=>dc,textSpanOverlapsWith:()=>uc,textSpansEqual:()=>_Q,textToKeywordObj:()=>zo,timestamp:()=>cr,toArray:()=>gt,toBuilderFileEmit:()=>sK,toBuilderStateFileInfoForMultiEmit:()=>oK,toEditorSettings:()=>p4,toFileNameLowerCase:()=>Ot,toPath:()=>_o,toProgramEmitPending:()=>cK,toSorted:()=>Ae,tokenIsIdentifierOrKeyword:()=>Lo,tokenIsIdentifierOrKeywordOrGreaterThan:()=>Ro,tokenToString:()=>ns,trace:()=>vL,tracing:()=>jr,tracingEnabled:()=>Mr,transferSourceFileChildren:()=>lM,transform:()=>ude,transformClassFields:()=>vH,transformDeclarations:()=>iU,transformECMAScriptModule:()=>YH,transformES2015:()=>UH,transformES2016:()=>VH,transformES2017:()=>DH,transformES2018:()=>kH,transformES2019:()=>AH,transformES2020:()=>jH,transformES2021:()=>MH,transformESDecorators:()=>EH,transformESNext:()=>NH,transformGenerators:()=>GH,transformImpliedNodeFormatDependentModule:()=>XH,transformJsx:()=>BH,transformLegacyDecorators:()=>TH,transformModule:()=>KH,transformNamedEvaluation:()=>fH,transformNodes:()=>_U,transformSystemModule:()=>JH,transformTypeScript:()=>_H,transpile:()=>soe,transpileDeclaration:()=>roe,transpileModule:()=>Q1,transpileOptionValueCompilerOptions:()=>sF,tryAddToSet:()=>oe,tryAndIgnoreErrors:()=>A$,tryCast:()=>yt,tryDirectoryExists:()=>k$,tryExtractTSExtension:()=>cx,tryFileExists:()=>O$,tryGetClassExtendingExpressionWithTypeArguments:()=>Hb,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>Ub,tryGetDirectories:()=>E$,tryGetExtensionFromPath:()=>Fw,tryGetImportFromModuleSpecifier:()=>e_,tryGetJSDocSatisfiesTypeNode:()=>NT,tryGetModuleNameFromFile:()=>qM,tryGetModuleSpecifierFromDeclaration:()=>Qg,tryGetNativePerformanceHooks:()=>sr,tryGetPropertyAccessOrIdentifierToString:()=>Zb,tryGetPropertyNameOfBindingOrAssignmentElement:()=>$M,tryGetSourceMappingURL:()=>KB,tryGetTextOfPropertyName:()=>bm,tryParseJson:()=>_x,tryParsePattern:()=>Dw,tryParsePatterns:()=>kw,tryParseRawSourceMap:()=>JB,tryReadDirectory:()=>D$,tryReadFile:()=>zF,tryRemoveDirectoryPrefix:()=>IC,tryRemoveExtension:()=>ww,tryRemovePrefix:()=>hn,tryRemoveSuffix:()=>nn,tscBuildOption:()=>uF,typeAcquisitionDeclarations:()=>pF,typeAliasNamePart:()=>IQ,typeDirectiveIsEqualTo:()=>Yf,typeKeywords:()=>HZ,typeParameterNamePart:()=>LQ,typeToDisplayParts:()=>UQ,unchangedPollThresholds:()=>fa,unchangedTextChangeRange:()=>wc,unescapeLeadingUnderscores:()=>Hc,unmangleScopedPackageName:()=>sz,unorderedRemoveItem:()=>cn,unprefixedNodeCoreModules:()=>iE,unreachableCodeIsError:()=>xC,unsetNodeChildren:()=>cM,unusedLabelIsError:()=>SC,unwrapInnermostStatementOfLabel:()=>hh,unwrapParenthesizedExpression:()=>eE,updateErrorForNoInputFiles:()=>RI,updateLanguageServiceSourceFile:()=>v4,updateMissingFilePathsWatch:()=>tW,updateResolutionField:()=>kL,updateSharedExtendedConfigFileWatcher:()=>QU,updateSourceFile:()=>xP,updateWatchingWildcardDirectories:()=>nW,usingSingleLineStringWriter:()=>Rf,utf16EncodeAsString:()=>Js,validateLocaleAndSetLanguage:()=>Lc,version:()=>s,versionMajorMinor:()=>o,visitArray:()=>kB,visitCommaListElements:()=>RB,visitEachChild:()=>zB,visitFunctionBody:()=>IB,visitIterationBody:()=>LB,visitLexicalEnvironment:()=>jB,visitNode:()=>$,visitNodes:()=>OB,visitParameterList:()=>MB,walkUpBindingElementsAndPatterns:()=>Ac,walkUpOuterExpressions:()=>RM,walkUpParenthesizedExpressions:()=>R_,walkUpParenthesizedTypes:()=>L_,walkUpParenthesizedTypesAndGetParentAndChild:()=>z_,whitespaceOrMapCommentRegExp:()=>WB,writeCommentRange:()=>sb,writeFile:()=>Fy,writeFileEnsuringDirectories:()=>Ly,zipWith:()=>_}),e.exports=i(a);var o=`5.7`,s=`5.7.3`,c=(e=>(e[e.LessThan=-1]=`LessThan`,e[e.EqualTo=0]=`EqualTo`,e[e.GreaterThan=1]=`GreaterThan`,e))(c||{}),l=[],u=new Map;function d(e){return e===void 0?0:e.length}function f(e,t){if(e!==void 0)for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r)return r}}function p(e,t){if(e!==void 0)for(let n=e.length-1;n>=0;n--){let r=t(e[n],n);if(r)return r}}function m(e,t){if(e!==void 0)for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!==void 0)return r}}function h(e,t){for(let n of e){let e=t(n);if(e!==void 0)return e}}function g(e,t,n){let r=n;if(e){let n=0;for(let i of e)r=t(r,i,n),n++}return r}function _(e,t,n){let r=[];H.assertEqual(e.length,t.length);for(let i=0;i<e.length;i++)r.push(n(e[i],t[i],i));return r}function v(e,t){if(e.length<=1)return e;let n=[];for(let r=0,i=e.length;r<i;r++)r!==0&&n.push(t),n.push(e[r]);return n}function y(e,t){if(e!==void 0){for(let n=0;n<e.length;n++)if(!t(e[n],n))return!1}return!0}function b(e,t,n){if(e!==void 0)for(let r=n??0;r<e.length;r++){let n=e[r];if(t(n,r))return n}}function x(e,t,n){if(e!==void 0)for(let r=n??e.length-1;r>=0;r--){let n=e[r];if(t(n,r))return n}}function S(e,t,n){if(e===void 0)return-1;for(let r=n??0;r<e.length;r++)if(t(e[r],r))return r;return-1}function C(e,t,n){if(e===void 0)return-1;for(let r=n??e.length-1;r>=0;r--)if(t(e[r],r))return r;return-1}function w(e,t,n=Nt){if(e!==void 0){for(let r=0;r<e.length;r++)if(n(e[r],t))return!0}return!1}function T(e,t,n){for(let r=n??0;r<e.length;r++)if(w(t,e.charCodeAt(r)))return r;return-1}function E(e,t){let n=0;if(e!==void 0)for(let r=0;r<e.length;r++){let i=e[r];t(i,r)&&n++}return n}function D(e,t){if(e!==void 0){let n=e.length,r=0;for(;r<n&&t(e[r]);)r++;if(r<n){let i=e.slice(0,r);for(r++;r<n;){let n=e[r];t(n)&&i.push(n),r++}return i}}return e}function O(e,t){let n=0;for(let r=0;r<e.length;r++)t(e[r],r,e)&&(e[n]=e[r],n++);e.length=n}function ee(e){e.length=0}function k(e,t){let n;if(e!==void 0){n=[];for(let r=0;r<e.length;r++)n.push(t(e[r],r))}return n}function*te(e,t){for(let n of e)yield t(n)}function ne(e,t){if(e!==void 0)for(let n=0;n<e.length;n++){let r=e[n],i=t(r,n);if(r!==i){let r=e.slice(0,n);for(r.push(i),n++;n<e.length;n++)r.push(t(e[n],n));return r}}return e}function re(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&(ht(r)?L(t,r):t.push(r))}return t}function A(e,t){let n;if(e!==void 0)for(let r=0;r<e.length;r++){let i=t(e[r],r);i&&(n=ht(i)?L(n,i):we(n,i))}return n??l}function j(e,t){let n=[];if(e!==void 0)for(let r=0;r<e.length;r++){let i=t(e[r],r);i&&(ht(i)?L(n,i):n.push(i))}return n}function*M(e,t){for(let n of e){let e=t(n);e&&(yield*e)}}function N(e,t){let n;if(e!==void 0)for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r);(n||i!==a||ht(a))&&(n||=e.slice(0,r),ht(a)?L(n,a):n.push(a))}return n??e}function P(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r);if(i===void 0)return;n.push(i)}return n}function F(e,t){let n=[];if(e!==void 0)for(let r=0;r<e.length;r++){let i=t(e[r],r);i!==void 0&&n.push(i)}return n}function*ie(e,t){for(let n of e){let e=t(n);e!==void 0&&(yield e)}}function ae(e,t,n){if(e.has(t))return e.get(t);let r=n();return e.set(t,r),r}function oe(e,t){return e.has(t)?!1:(e.add(t),!0)}function*se(e){yield e}function ce(e,t,n){let r;if(e!==void 0){r=[];let i=e.length,a,o,s=0,c=0;for(;s<i;){for(;c<i;){let n=e[c];if(o=t(n,c),c===0)a=o;else if(o!==a)break;c++}if(s<c){let t=n(e.slice(s,c),a,s,c);t&&r.push(t),s=c}a=o,c++}}return r}function le(e,t){if(e===void 0)return;let n=new Map;return e.forEach((e,r)=>{let[i,a]=t(r,e);n.set(i,a)}),n}function I(e,t){if(e!==void 0)if(t!==void 0){for(let n=0;n<e.length;n++)if(t(e[n]))return!0}else return e.length>0;return!1}function ue(e,t,n){let r;for(let i=0;i<e.length;i++)t(e[i])?r=r===void 0?i:r:r!==void 0&&(n(r,i),r=void 0);r!==void 0&&n(r,e.length)}function de(e,t){return t===void 0||t.length===0?e:e===void 0||e.length===0?t:[...e,...t]}function fe(e,t){return t}function pe(e){return e.map(fe)}function me(e,t,n){let r=pe(e);ke(e,r,n);let i=e[r[0]],a=[r[0]];for(let n=1;n<r.length;n++){let o=r[n],s=e[o];t(i,s)||(a.push(o),i=s)}return a.sort(),a.map(t=>e[t])}function he(e,t){let n=[];for(let r=0;r<e.length;r++)De(n,e[r],t);return n}function ge(e,t,n){return e.length===0?[]:e.length===1?e.slice():n?me(e,t,n):he(e,t)}function _e(e,t){if(e.length===0)return l;let n=e[0],r=[n];for(let i=1;i<e.length;i++){let a=e[i];switch(t(a,n)){case!0:case 0:continue;case-1:return H.fail(`Array is unsorted.`)}r.push(n=a)}return r}function ve(){return[]}function ye(e,t,n,r,i){if(e.length===0)return e.push(t),!0;let a=We(e,t,Tt,n);if(a<0){if(r&&!i){let n=~a;if(n>0&&r(t,e[n-1]))return!1;if(n<e.length&&r(t,e[n]))return e.splice(n,1,t),!0}return e.splice(~a,0,t),!0}return i?(e.splice(a,0,t),!0):!1}function be(e,t,n){return _e(Ae(e,t),n??t??Ut)}function xe(e,t,n=Nt){if(e===void 0||t===void 0)return e===t;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r],r))return!1;return!0}function Se(e){let t;if(e!==void 0)for(let n=0;n<e.length;n++){let r=e[n];(t??!r)&&(t??=e.slice(0,n),r&&t.push(r))}return t??e}function Ce(e,t,n){if(!t||!e||t.length===0||e.length===0)return t;let r=[];loopB:for(let i=0,a=0;a<t.length;a++){a>0&&H.assertGreaterThanOrEqual(n(t[a],t[a-1]),0);loopA:for(let o=i;i<e.length;i++)switch(i>o&&H.assertGreaterThanOrEqual(n(e[i],e[i-1]),0),n(t[a],e[i])){case-1:r.push(t[a]);continue loopB;case 0:continue loopB;case 1:continue loopA}}return r}function we(e,t){return t===void 0?e:e===void 0?[t]:(e.push(t),e)}function Te(e,t){return e===void 0?t:t===void 0?e:ht(e)?ht(t)?de(e,t):we(e,t):ht(t)?we(t,e):[e,t]}function Ee(e,t){return t<0?e.length+t:t}function L(e,t,n,r){if(t===void 0||t.length===0)return e;if(e===void 0)return t.slice(n,r);n=n===void 0?0:Ee(t,n),r=r===void 0?t.length:Ee(t,r);for(let i=n;i<r&&i<t.length;i++)t[i]!==void 0&&e.push(t[i]);return e}function De(e,t,n){return w(e,t,n)?!1:(e.push(t),!0)}function Oe(e,t,n){return e===void 0?[t]:(De(e,t,n),e)}function ke(e,t,n){t.sort((t,r)=>n(e[t],e[r])||Lt(t,r))}function Ae(e,t){return e.length===0?l:e.slice().sort(t)}function*je(e){for(let t=e.length-1;t>=0;t--)yield e[t]}function Me(e,t,n,r){for(;n<r;){if(e[n]!==t[n])return!1;n++}return!0}var Ne=Array.prototype.at?(e,t)=>e?.at(t):(e,t)=>{if(e!==void 0&&(t=Ee(e,t),t<e.length))return e[t]};function Pe(e){return e===void 0||e.length===0?void 0:e[0]}function Fe(e){if(e!==void 0)for(let t of e)return t}function Ie(e){return H.assert(e.length!==0),e[0]}function Le(e){for(let t of e)return t;H.fail(`iterator is empty`)}function Re(e){return e===void 0||e.length===0?void 0:e[e.length-1]}function ze(e){return H.assert(e.length!==0),e[e.length-1]}function Be(e){return e!==void 0&&e.length===1?e[0]:void 0}function Ve(e){return H.checkDefined(Be(e))}function He(e){return e!==void 0&&e.length===1?e[0]:e}function Ue(e,t,n){let r=e.slice(0);return r[t]=n,r}function We(e,t,n,r,i){return Ge(e,n(t),n,r,i)}function Ge(e,t,n,r,i){if(!I(e))return-1;let a=i??0,o=e.length-1;for(;a<=o;){let i=a+(o-a>>1);switch(r(n(e[i],i),t)){case-1:a=i+1;break;case 0:return i;case 1:o=i-1;break}}return~a}function Ke(e,t,n,r,i){if(e&&e.length>0){let a=e.length;if(a>0){let o=r===void 0||r<0?0:r,s=i===void 0||o+i>a-1?a-1:o+i,c;for(arguments.length<=2?(c=e[o],o++):c=n;o<=s;)c=t(c,e[o],o),o++;return c}}return n}var qe=Object.prototype.hasOwnProperty;function Je(e,t){return qe.call(e,t)}function Ye(e,t){return qe.call(e,t)?e[t]:void 0}function Xe(e){let t=[];for(let n in e)qe.call(e,n)&&t.push(n);return t}function Ze(e){let t=[];do{let n=Object.getOwnPropertyNames(e);for(let e of n)De(t,e)}while(e=Object.getPrototypeOf(e));return t}function Qe(e){let t=[];for(let n in e)qe.call(e,n)&&t.push(e[n]);return t}function $e(e,t){let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r);return n}function et(e,t){let n=[];for(let r of e)n.push(t?t(r):r);return n}function tt(e,...t){for(let n of t)if(n!==void 0)for(let t in n)Je(n,t)&&(e[t]=n[t]);return e}function nt(e,t,n=Nt){if(e===t)return!0;if(!e||!t)return!1;for(let r in e)if(qe.call(e,r)&&(!qe.call(t,r)||!n(e[r],t[r])))return!1;for(let n in t)if(qe.call(t,n)&&!qe.call(e,n))return!1;return!0}function rt(e,t,n=Tt){let r=new Map;for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==void 0&&r.set(o,n(a))}return r}function it(e,t,n=Tt){let r=[];for(let i=0;i<e.length;i++){let a=e[i];r[t(a)]=n(a)}return r}function at(e,t,n=Tt){let r=dt();for(let i=0;i<e.length;i++){let a=e[i];r.add(t(a),n(a))}return r}function ot(e,t,n=Tt){return et(at(e,t).values(),n)}function st(e,t){let n={};if(e!==void 0)for(let r=0;r<e.length;r++){let i=e[r],a=`${t(i)}`;(n[a]??(n[a]=[])).push(i)}return n}function ct(e){let t={};for(let n in e)qe.call(e,n)&&(t[n]=e[n]);return t}function lt(e,t){let n={};for(let e in t)qe.call(t,e)&&(n[e]=t[e]);for(let t in e)qe.call(e,t)&&(n[t]=e[t]);return n}function ut(e,t){for(let n in t)qe.call(t,n)&&(e[n]=t[n])}function R(e,t){return t?.bind(e)}function dt(){let e=new Map;return e.add=z,e.remove=ft,e}function z(e,t){let n=this.get(e);return n===void 0?this.set(e,n=[t]):n.push(t),n}function ft(e,t){let n=this.get(e);n!==void 0&&(cn(n,t),n.length||this.delete(e))}function pt(e){let t=e?.slice()??[],n=0;function r(){return n===t.length}function i(...e){t.push(...e)}function a(){if(r())throw Error(`Queue is empty`);let e=t[n];if(t[n]=void 0,n++,n>100&&n>t.length>>1){let e=t.length-n;t.copyWithin(0,n),t.length=e,n=0}return e}return{enqueue:i,dequeue:a,isEmpty:r}}function mt(e,t){let n=new Map,r=0;function*i(){for(let e of n.values())ht(e)?yield*e:yield e}let a={has(r){let i=e(r);if(!n.has(i))return!1;let a=n.get(i);return ht(a)?w(a,r,t):t(a,r)},add(i){let a=e(i);if(n.has(a)){let e=n.get(a);if(ht(e))w(e,i,t)||(e.push(i),r++);else{let o=e;t(o,i)||(n.set(a,[o,i]),r++)}}else n.set(a,i),r++;return this},delete(i){let a=e(i);if(!n.has(a))return!1;let o=n.get(a);if(ht(o)){for(let e=0;e<o.length;e++)if(t(o[e],i))return o.length===1?n.delete(a):o.length===2?n.set(a,o[1-e]):sn(o,e),r--,!0}else if(t(o,i))return n.delete(a),r--,!0;return!1},clear(){n.clear(),r=0},get size(){return r},forEach(e){for(let t of et(n.values()))if(ht(t))for(let n of t)e(n,n,a);else{let n=t;e(n,n,a)}},keys(){return i()},values(){return i()},*entries(){for(let e of i())yield[e,e]},[Symbol.iterator]:()=>i(),[Symbol.toStringTag]:n[Symbol.toStringTag]};return a}function ht(e){return Array.isArray(e)}function gt(e){return ht(e)?e:[e]}function _t(e){return typeof e==`string`}function vt(e){return typeof e==`number`}function yt(e,t){return e!==void 0&&t(e)?e:void 0}function bt(e,t){return e!==void 0&&t(e)?e:H.fail(`Invalid cast. The supplied value ${e} did not pass the test '${H.getFunctionName(t)}'.`)}function xt(e){}function St(){return!1}function Ct(){return!0}function wt(){}function Tt(e){return e}function Et(e){return e.toLowerCase()}var Dt=/[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;function Ot(e){return Dt.test(e)?e.replace(Dt,Et):e}function kt(){throw Error(`Not implemented`)}function At(e){let t;return()=>(e&&=(t=e(),void 0),t)}function jt(e){let t=new Map;return n=>{let r=`${typeof n}:${n}`,i=t.get(r);return i===void 0&&!t.has(r)&&(i=e(n),t.set(r,i)),i}}var Mt=(e=>(e[e.None=0]=`None`,e[e.Normal=1]=`Normal`,e[e.Aggressive=2]=`Aggressive`,e[e.VeryAggressive=3]=`VeryAggressive`,e))(Mt||{});function Nt(e,t){return e===t}function Pt(e,t){return e===t||e!==void 0&&t!==void 0&&e.toUpperCase()===t.toUpperCase()}function Ft(e,t){return Nt(e,t)}function It(e,t){return e===t?0:e===void 0?-1:t===void 0?1:e<t?-1:1}function Lt(e,t){return It(e,t)}function Rt(e,t){return Lt(e?.start,t?.start)||Lt(e?.length,t?.length)}function zt(e,t,n){for(let r=0;r<e.length;r++)t=Math.max(t,n(e[r]));return t}function Bt(e,t){return Ke(e,(e,n)=>t(e,n)===-1?e:n)}function Vt(e,t){return e===t?0:e===void 0?-1:t===void 0?1:(e=e.toUpperCase(),t=t.toUpperCase(),e<t?-1:+(e>t))}function Ht(e,t){return e===t?0:e===void 0?-1:t===void 0?1:(e=e.toLowerCase(),t=t.toLowerCase(),e<t?-1:+(e>t))}function Ut(e,t){return It(e,t)}function Wt(e){return e?Vt:Ut}var Gt=(()=>{return t;function e(e,t,n){if(e===t)return 0;if(e===void 0)return-1;if(t===void 0)return 1;let r=n(e,t);return r<0?-1:+(r>0)}function t(t){let n=new Intl.Collator(t,{usage:`sort`,sensitivity:`variant`,numeric:!0}).compare;return(t,r)=>e(t,r,n)}})(),Kt,qt;function Jt(){return qt}function Yt(e){qt!==e&&(qt=e,Kt=void 0)}function Xt(e,t){return Kt??=Gt(qt),Kt(e,t)}function Zt(e,t,n,r){return e===t?0:e===void 0?-1:t===void 0?1:r(e[n],t[n])}function B(e,t){return Lt(+!!e,+!!t)}function Qt(e,t,n){let r=Math.max(2,Math.floor(e.length*.34)),i=Math.floor(e.length*.4)+1,a;for(let o of t){let t=n(o);if(t!==void 0&&Math.abs(t.length-e.length)<=r){if(t===e||t.length<3&&t.toLowerCase()!==e.toLowerCase())continue;let n=$t(e,t,i-.1);if(n===void 0)continue;H.assert(n<i),i=n,a=o}}return a}function $t(e,t,n){let r=Array(t.length+1),i=Array(t.length+1),a=n+.01;for(let e=0;e<=t.length;e++)r[e]=e;for(let o=1;o<=e.length;o++){let s=e.charCodeAt(o-1),c=Math.ceil(o>n?o-n:1),l=Math.floor(t.length>n+o?n+o:t.length);i[0]=o;let u=o;for(let e=1;e<c;e++)i[e]=a;for(let n=c;n<=l;n++){let a=e[o-1].toLowerCase()===t[n-1].toLowerCase()?r[n-1]+.1:r[n-1]+2,c=s===t.charCodeAt(n-1)?r[n-1]:Math.min(r[n]+1,i[n-1]+1,a);i[n]=c,u=Math.min(u,c)}for(let e=l+1;e<=t.length;e++)i[e]=a;if(u>n)return;let d=r;r=i,i=d}let o=r[t.length];return o>n?void 0:o}function en(e,t,n){let r=e.length-t.length;return r>=0&&(n?Pt(e.slice(r),t):e.indexOf(t,r)===r)}function tn(e,t){return en(e,t)?e.slice(0,e.length-t.length):e}function nn(e,t){return en(e,t)?e.slice(0,e.length-t.length):void 0}function rn(e){let t=e.length;for(let n=t-1;n>0;n--){let r=e.charCodeAt(n);if(r>=48&&r<=57)do--n,r=e.charCodeAt(n);while(n>0&&r>=48&&r<=57);else if(n>4&&(r===110||r===78)){if(--n,r=e.charCodeAt(n),r!==105&&r!==73||(--n,r=e.charCodeAt(n),r!==109&&r!==77))break;--n,r=e.charCodeAt(n)}else break;if(r!==45&&r!==46)break;t=n}return t===e.length?e:e.slice(0,t)}function an(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return on(e,n),!0;return!1}function on(e,t){for(let n=t;n<e.length-1;n++)e[n]=e[n+1];e.pop()}function sn(e,t){e[t]=e[e.length-1],e.pop()}function cn(e,t){return ln(e,e=>e===t)}function ln(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return sn(e,n),!0;return!1}function un(e){return e?Tt:Ot}function dn({prefix:e,suffix:t}){return`${e}*${t}`}function fn(e,t){return H.assert(gn(e,t)),t.substring(e.prefix.length,t.length-e.suffix.length)}function pn(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=t(o);s.prefix.length>i&&gn(s,n)&&(i=s.prefix.length,r=o)}return r}function V(e,t,n){return n?Pt(e.slice(0,t.length),t):e.lastIndexOf(t,0)===0}function mn(e,t){return V(e,t)?e.substr(t.length):e}function hn(e,t,n=Tt){return V(n(e),n(t))?e.substring(t.length):void 0}function gn({prefix:e,suffix:t},n){return n.length>=e.length+t.length&&V(n,e)&&en(n,t)}function _n(e,t){return n=>e(n)&&t(n)}function vn(...e){return(...t)=>{let n;for(let r of e)if(n=r(...t),n)return n;return n}}function yn(e){return(...t)=>!e(...t)}function bn(e){}function xn(e){return e===void 0?void 0:[e]}function Sn(e,t,n,r,i,a){a??=xt;let o=0,s=0,c=e.length,l=t.length,u=!1;for(;o<c&&s<l;){let c=e[o],l=t[s],d=n(c,l);d===-1?(r(c),o++,u=!0):d===1?(i(l),s++,u=!0):(a(l,c),o++,s++)}for(;o<c;)r(e[o++]),u=!0;for(;s<l;)i(t[s++]),u=!0;return u}function Cn(e){let t=[];return wn(e,t,void 0,0),t}function wn(e,t,n,r){for(let i of e[r]){let a;n?(a=n.slice(),a.push(i)):a=[i],r===e.length-1?t.push(a):wn(e,t,a,r+1)}}function Tn(e,t){if(e!==void 0){let n=e.length,r=0;for(;r<n&&t(e[r]);)r++;return e.slice(0,r)}}function En(e,t){if(e!==void 0){let n=e.length,r=0;for(;r<n&&t(e[r]);)r++;return e.slice(r)}}function Dn(){return typeof process<`u`&&!!process.nextTick&&!process.browser&&typeof require<`u`}var On=(e=>(e[e.Off=0]=`Off`,e[e.Error=1]=`Error`,e[e.Warning=2]=`Warning`,e[e.Info=3]=`Info`,e[e.Verbose=4]=`Verbose`,e))(On||{}),H;(e=>{let t=0;e.currentLogLevel=2,e.isDebugging=!1;function n(t){return e.currentLogLevel<=t}e.shouldLog=n;function r(t,r){e.loggingHost&&n(t)&&e.loggingHost.log(t,r)}function i(e){r(3,e)}e.log=i,(e=>{function t(e){r(1,e)}e.error=t;function n(e){r(2,e)}e.warn=n;function i(e){r(3,e)}e.log=i;function a(e){r(4,e)}e.trace=a})(i=e.log||={});let a={};function o(){return t}e.getAssertionLevel=o;function s(n){let r=t;if(t=n,n>r)for(let t of Xe(a)){let r=a[t];r!==void 0&&e[t]!==r.assertion&&n>=r.level&&(e[t]=r,a[t]=void 0)}}e.setAssertionLevel=s;function c(e){return t>=e}e.shouldAssert=c;function l(t,n){return c(t)?!0:(a[n]={level:t,assertion:e[n]},e[n]=xt,!1)}function u(e,t){let n=Error(e?`Debug Failure. ${e}`:`Debug Failure.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,t||u),n}e.fail=u;function d(e,t,n){return u(`${t||`Unexpected node.`}\r
359
+ yarn twenty remote:status`)),process.exit(1)),a.authValid||(console.error(u.default.red("Authentication failed. Run `yarn twenty remote:add` to authenticate.")),process.exit(1)),console.log(u.default.blue(`Generating API client...`));try{await new t.h({skipAuth:!1}).generateCoreClient({appPath:r})}catch(e){console.error(u.default.red(`Failed to generate API client: ${t.B(e)}`)),process.exit(1)}console.log(u.default.green(`✓ API client generated`)),console.log(u.default.gray(`Output: ${(0,n.join)(i,`dist`,`core`,`generated`)}`))}},zt=(e,t)=>t!==void 0&&t.length>0?`${t}${e}`:e,Bt=e=>e.replace(/\s+/g,` `).trim(),Vt=e.Ct(((e,n)=>{var r={};(e=>{"use strict";var n=Object.defineProperty,r=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},i=e=>e,a={};r(a,{ANONYMOUS:()=>b$,AccessFlags:()=>gi,AssertionLevel:()=>Mt,AssignmentDeclarationKind:()=>Ei,AssignmentKind:()=>k_,Associativity:()=>Lv,BreakpointResolver:()=>T4,BuilderFileEmit:()=>bG,BuilderProgramKind:()=>$G,BuilderState:()=>yG,CallHierarchy:()=>E4,CharacterCodes:()=>Hi,CheckFlags:()=>li,CheckMode:()=>vB,ClassificationType:()=>hX,ClassificationTypeNames:()=>mX,CommentDirectiveType:()=>Wr,Comparison:()=>c,CompletionInfoFlags:()=>sX,CompletionTriggerKind:()=>eX,Completions:()=>j8,ContainerFlags:()=>bz,ContextFlags:()=>ei,Debug:()=>H,DiagnosticCategory:()=>Di,Diagnostics:()=>K,DocumentHighlights:()=>x1,ElementFlags:()=>hi,EmitFlags:()=>Ki,EmitHint:()=>Xi,EmitOnly:()=>Jr,EndOfLineState:()=>uX,ExitStatus:()=>Xr,ExportKind:()=>c1,Extension:()=>Ui,ExternalEmitHelpers:()=>Yi,FileIncludeKind:()=>Kr,FilePreprocessingDiagnosticsKind:()=>qr,FileSystemEntryKind:()=>Ea,FileWatcherEventKind:()=>aa,FindAllReferences:()=>y5,FlattenLevel:()=>RV,FlowFlags:()=>Ur,ForegroundColorEscapeSequences:()=>bW,FunctionFlags:()=>mv,GeneratedIdentifierFlags:()=>Br,GetLiteralTextFlags:()=>Lp,GoToDefinition:()=>P5,HighlightSpanKind:()=>nX,IdentifierNameMap:()=>mV,ImportKind:()=>s1,ImportsNotUsedAsValues:()=>Ii,IndentStyle:()=>rX,IndexFlags:()=>_i,IndexKind:()=>xi,InferenceFlags:()=>wi,InferencePriority:()=>Ci,InlayHintKind:()=>tX,InlayHints:()=>U5,InternalEmitFlags:()=>qi,InternalNodeBuilderFlags:()=>ni,InternalSymbolName:()=>ui,IntersectionFlags:()=>$r,InvalidatedProjectKind:()=>Jq,JSDocParsingMode:()=>na,JsDoc:()=>G5,JsTyping:()=>SY,JsxEmit:()=>Fi,JsxFlags:()=>Lr,JsxReferenceKind:()=>vi,LanguageFeatureMinimumTarget:()=>Ji,LanguageServiceMode:()=>XY,LanguageVariant:()=>Bi,LexicalEnvironmentFlags:()=>Qi,ListFormat:()=>$i,LogLevel:()=>On,MapCode:()=>Y5,MemberOverrideStatus:()=>Zr,ModifierFlags:()=>Ir,ModuleDetectionKind:()=>Ai,ModuleInstanceState:()=>gz,ModuleKind:()=>Pi,ModuleResolutionKind:()=>ki,ModuleSpecifierEnding:()=>_w,NavigateTo:()=>t0,NavigationBar:()=>r0,NewLineKind:()=>Li,NodeBuilderFlags:()=>ti,NodeCheckFlags:()=>di,NodeFactoryFlags:()=>gE,NodeFlags:()=>Fr,NodeResolutionFeatures:()=>dR,ObjectFlags:()=>pi,OperationCanceledException:()=>Gr,OperatorPrecedence:()=>Hv,OrganizeImports:()=>Q5,OrganizeImportsMode:()=>$Y,OuterExpressionKinds:()=>Zi,OutliningElementsCollector:()=>o7,OutliningSpanKind:()=>cX,OutputFileType:()=>lX,PackageJsonAutoImportPreference:()=>YY,PackageJsonDependencyGroup:()=>JY,PatternMatchKind:()=>j1,PollingInterval:()=>oa,PollingWatchKind:()=>Ni,PragmaKindFlags:()=>ea,PredicateSemantics:()=>zr,PreparePasteEdits:()=>Q7,PrivateIdentifierKind:()=>xD,ProcessLevel:()=>pH,ProgramUpdateLevel:()=>ZU,QuotePreference:()=>iQ,RegularExpressionFlags:()=>Vr,RelationComparisonResult:()=>Rr,Rename:()=>u7,ScriptElementKind:()=>fX,ScriptElementKindModifier:()=>pX,ScriptKind:()=>Ri,ScriptSnapshot:()=>qY,ScriptTarget:()=>zi,SemanticClassificationFormat:()=>QY,SemanticMeaning:()=>Kre,SemicolonPreference:()=>iX,SignatureCheckMode:()=>yB,SignatureFlags:()=>bi,SignatureHelp:()=>f7,SignatureInfo:()=>vG,SignatureKind:()=>yi,SmartSelectionRange:()=>m7,SnippetKind:()=>Gi,StatisticType:()=>FJ,StructureIsReused:()=>Yr,SymbolAccessibility:()=>ai,SymbolDisplay:()=>v7,SymbolDisplayPartKind:()=>oX,SymbolFlags:()=>ci,SymbolFormatFlags:()=>ii,SyntaxKind:()=>U,Ternary:()=>Ti,ThrottledCancellationToken:()=>y4,TokenClass:()=>dX,TokenFlags:()=>Hr,TransformFlags:()=>Wi,TypeFacts:()=>gB,TypeFlags:()=>fi,TypeFormatFlags:()=>ri,TypeMapKind:()=>Si,TypePredicateKind:()=>oi,TypeReferenceSerializationKind:()=>si,UnionReduction:()=>Qr,UpToDateStatusType:()=>bq,VarianceFlags:()=>mi,Version:()=>In,VersionRange:()=>zn,WatchDirectoryFlags:()=>Vi,WatchDirectoryKind:()=>Mi,WatchFileKind:()=>ji,WatchLogLevel:()=>aW,WatchType:()=>iq,accessPrivateIdentifier:()=>FV,addEmitFlags:()=>BE,addEmitHelper:()=>oD,addEmitHelpers:()=>sD,addInternalEmitFlags:()=>HE,addNodeFactoryPatcher:()=>vE,addObjectAllocatorPatcher:()=>bee,addRange:()=>L,addRelatedInfo:()=>Bw,addSyntheticLeadingComment:()=>$E,addSyntheticTrailingComment:()=>nD,addToSeen:()=>fS,advancedAsyncSuperHelper:()=>JD,affectsDeclarationPathOptionDeclarations:()=>rF,affectsEmitOptionDeclarations:()=>nF,allKeysStartWithDot:()=>VR,altDirectorySeparator:()=>Ia,and:()=>_n,append:()=>we,appendIfUnique:()=>Oe,arrayFrom:()=>et,arrayIsEqualTo:()=>xe,arrayIsHomogeneous:()=>tT,arrayOf:()=>$e,arrayReverseIterator:()=>je,arrayToMap:()=>rt,arrayToMultiMap:()=>at,arrayToNumericMap:()=>it,assertType:()=>bn,assign:()=>tt,asyncSuperHelper:()=>qD,attachFileToDiagnostics:()=>NS,base64decode:()=>mx,base64encode:()=>px,binarySearch:()=>We,binarySearchKey:()=>Ge,bindSourceFile:()=>Cz,breakIntoCharacterSpans:()=>B1,breakIntoWordSpans:()=>V1,buildLinkParts:()=>zQ,buildOpts:()=>fF,buildOverload:()=>HOe,bundlerModuleNameResolver:()=>hR,canBeConvertedToAsync:()=>Z1,canHaveDecorators:()=>RN,canHaveExportModifier:()=>wT,canHaveFlowNode:()=>m_,canHaveIllegalDecorators:()=>aN,canHaveIllegalModifiers:()=>oN,canHaveIllegalType:()=>rN,canHaveIllegalTypeParameters:()=>iN,canHaveJSDoc:()=>h_,canHaveLocals:()=>Fd,canHaveModifiers:()=>LN,canHaveModuleSpecifier:()=>lee,canHaveSymbol:()=>Pd,canIncludeBindAndCheckDiagnostics:()=>Kw,canJsonReportNoInputFiles:()=>LI,canProduceDiagnostics:()=>ZH,canUsePropertyAccess:()=>ET,canWatchAffectingLocation:()=>CK,canWatchAtTypes:()=>bK,canWatchDirectoryOrFile:()=>vK,canWatchDirectoryOrFilePath:()=>yK,cartesianProduct:()=>Cn,cast:()=>bt,chainBundle:()=>sV,chainDiagnosticMessages:()=>RS,changeAnyExtension:()=>xo,changeCompilerHostLikeToUseCache:()=>gW,changeExtension:()=>Ew,changeFullExtension:()=>So,changesAffectModuleResolution:()=>Af,changesAffectingProgramStructure:()=>Mf,characterCodeToRegularExpressionFlag:()=>os,childIsDecorated:()=>Kh,classElementOrClassElementParameterIsDecorated:()=>Jh,classHasClassThisAssignment:()=>$V,classHasDeclaredOrExplicitlyAssignedName:()=>aH,classHasExplicitlyAssignedName:()=>iH,classOrConstructorParameterIsDecorated:()=>qh,classicNameResolver:()=>lz,classifier:()=>j4,cleanExtendedConfigCache:()=>eW,clear:()=>ee,clearMap:()=>rS,clearSharedExtendedConfigFileWatcher:()=>$U,climbPastPropertyAccess:()=>TX,clone:()=>ct,cloneCompilerOptions:()=>AZ,closeFileWatcher:()=>qx,closeFileWatcherOf:()=>cW,codefix:()=>M4,collapseTextChangeRangesAcrossMultipleVersions:()=>Tc,collectExternalModuleInfo:()=>dV,combine:()=>Te,combinePaths:()=>lo,commandLineOptionOfCustomType:()=>cF,commentPragmas:()=>ta,commonOptionsWithBuild:()=>XP,compact:()=>Se,compareBooleans:()=>B,compareDataObjects:()=>nS,compareDiagnostics:()=>VS,compareEmitHelpers:()=>CD,compareNumberOfDirectorySeparators:()=>xw,comparePaths:()=>Do,comparePathsCaseInsensitive:()=>Eo,comparePathsCaseSensitive:()=>To,comparePatternKeys:()=>GR,compareProperties:()=>Zt,compareStringsCaseInsensitive:()=>Vt,compareStringsCaseInsensitiveEslintCompatible:()=>Ht,compareStringsCaseSensitive:()=>Ut,compareStringsCaseSensitiveUI:()=>Xt,compareTextSpans:()=>Rt,compareValues:()=>Lt,compilerOptionsAffectDeclarationPath:()=>kC,compilerOptionsAffectEmit:()=>OC,compilerOptionsAffectSemanticDiagnostics:()=>DC,compilerOptionsDidYouMeanDiagnostics:()=>DF,compilerOptionsIndicateEsModules:()=>QZ,computeCommonSourceDirectoryOfFilenames:()=>dW,computeLineAndCharacterOfPosition:()=>ds,computeLineOfPosition:()=>fs,computeLineStarts:()=>ss,computePositionOfLineAndCharacter:()=>ls,computeSignatureWithDiagnostics:()=>nK,computeSuggestionDiagnostics:()=>q1,computedOptions:()=>tC,concatenate:()=>de,concatenateDiagnosticMessageChains:()=>zS,consumesNodeCoreModules:()=>I$,contains:()=>w,containsIgnoredPath:()=>fT,containsObjectRestOrSpread:()=>IN,containsParseError:()=>Zf,containsPath:()=>Oo,convertCompilerOptionsForTelemetry:()=>hL,convertCompilerOptionsFromJson:()=>qI,convertJsonOption:()=>tL,convertToBase64:()=>dx,convertToJson:()=>iI,convertToObject:()=>rI,convertToOptionsWithAbsolutePaths:()=>vI,convertToRelativePath:()=>Mo,convertToTSConfig:()=>sI,convertTypeAcquisitionFromJson:()=>JI,copyComments:()=>a$,copyEntries:()=>Lf,copyLeadingComments:()=>l$,copyProperties:()=>ut,copyTrailingAsLeadingComments:()=>d$,copyTrailingComments:()=>u$,couldStartTrivia:()=>Cs,countWhere:()=>E,createAbstractBuilder:()=>hK,createAccessorPropertyBackingField:()=>kN,createAccessorPropertyGetRedirector:()=>AN,createAccessorPropertySetRedirector:()=>jN,createBaseNodeFactory:()=>uE,createBinaryExpressionTrampoline:()=>bN,createBuilderProgram:()=>iK,createBuilderProgramUsingIncrementalBuildInfo:()=>lK,createBuilderStatusReporter:()=>Dq,createCacheableExportInfoMap:()=>l1,createCachedDirectoryStructureHost:()=>XU,createClassifier:()=>$ie,createCommentDirectivesMap:()=>bp,createCompilerDiagnostic:()=>IS,createCompilerDiagnosticForInvalidCustomType:()=>yF,createCompilerDiagnosticFromMessageChain:()=>LS,createCompilerHost:()=>fW,createCompilerHostFromProgramHost:()=>oq,createCompilerHostWorker:()=>hW,createDetachedDiagnostic:()=>jS,createDiagnosticCollection:()=>Kv,createDiagnosticForFileFromMessageChain:()=>Am,createDiagnosticForNode:()=>Cm,createDiagnosticForNodeArray:()=>wm,createDiagnosticForNodeArrayFromMessageChain:()=>Dm,createDiagnosticForNodeFromMessageChain:()=>Em,createDiagnosticForNodeInSourceFile:()=>Tm,createDiagnosticForRange:()=>jm,createDiagnosticMessageChainFromDiagnostic:()=>eee,createDiagnosticReporter:()=>NK,createDocumentPositionMapper:()=>nV,createDocumentRegistry:()=>C1,createDocumentRegistryInternal:()=>w1,createEmitAndSemanticDiagnosticsBuilderProgram:()=>mK,createEmitHelperFactory:()=>SD,createEmptyExports:()=>uM,createEvaluator:()=>YT,createExpressionForJsxElement:()=>gM,createExpressionForJsxFragment:()=>_M,createExpressionForObjectLiteralElementLike:()=>wM,createExpressionForPropertyName:()=>bM,createExpressionFromEntityName:()=>yM,createExternalHelpersImportDeclarationIfNeeded:()=>HM,createFileDiagnostic:()=>PS,createFileDiagnosticFromMessageChain:()=>km,createFlowNode:()=>xz,createForOfBindingStatement:()=>vM,createFutureSourceFile:()=>o1,createGetCanonicalFileName:()=>un,createGetIsolatedDeclarationErrors:()=>eU,createGetSourceFile:()=>pW,createGetSymbolAccessibilityDiagnosticForNode:()=>$H,createGetSymbolAccessibilityDiagnosticForNodeName:()=>QH,createGetSymbolWalker:()=>kz,createIncrementalCompilerHost:()=>gq,createIncrementalProgram:()=>_q,createJsxFactoryExpression:()=>mM,createLanguageService:()=>b4,createLanguageServiceSourceFile:()=>_4,createMemberAccessForPropertyName:()=>dM,createModeAwareCache:()=>tR,createModeAwareCacheKey:()=>eR,createModeMismatchDetails:()=>Gf,createModuleNotFoundChain:()=>Wf,createModuleResolutionCache:()=>rR,createModuleResolutionLoader:()=>HW,createModuleResolutionLoaderUsingGlobalCache:()=>AK,createModuleSpecifierResolutionHost:()=>$Z,createMultiMap:()=>dt,createNameResolver:()=>QT,createNodeConverters:()=>pE,createNodeFactory:()=>yE,createOptionNameMap:()=>mF,createOverload:()=>e9,createPackageJsonImportFilter:()=>F$,createPackageJsonInfo:()=>P$,createParenthesizerRules:()=>dE,createPatternMatcher:()=>N1,createPrinter:()=>YU,createPrinterWithDefaults:()=>GU,createPrinterWithRemoveComments:()=>KU,createPrinterWithRemoveCommentsNeverAsciiEscape:()=>qU,createPrinterWithRemoveCommentsOmitTrailingSemicolon:()=>JU,createProgram:()=>oG,createProgramHost:()=>lq,createPropertyNameNodeForIdentifierOrLiteral:()=>bT,createQueue:()=>pt,createRange:()=>Sx,createRedirectedBuilderProgram:()=>fK,createResolutionCache:()=>jK,createRuntimeTypeSerializer:()=>wH,createScanner:()=>Us,createSemanticDiagnosticsBuilderProgram:()=>pK,createSet:()=>mt,createSolutionBuilder:()=>jq,createSolutionBuilderHost:()=>kq,createSolutionBuilderWithWatch:()=>Mq,createSolutionBuilderWithWatchHost:()=>Aq,createSortedArray:()=>ve,createSourceFile:()=>_P,createSourceMapGenerator:()=>VB,createSourceMapSource:()=>ME,createSuperAccessVariableStatement:()=>OH,createSymbolTable:()=>Tf,createSymlinkCache:()=>FC,createSyntacticTypeNodeBuilder:()=>xY,createSystemWatchFunctions:()=>ja,createTextChange:()=>VZ,createTextChangeFromStartLength:()=>BZ,createTextChangeRange:()=>Cc,createTextRangeFromNode:()=>LZ,createTextRangeFromSpan:()=>zZ,createTextSpan:()=>yc,createTextSpanFromBounds:()=>bc,createTextSpanFromNode:()=>FZ,createTextSpanFromRange:()=>RZ,createTextSpanFromStringLiteralLikeContent:()=>IZ,createTextWriter:()=>_y,createTokenRange:()=>Dx,createTypeChecker:()=>wB,createTypeReferenceDirectiveResolutionCache:()=>iR,createTypeReferenceResolutionLoader:()=>GW,createWatchCompilerHost:()=>vq,createWatchCompilerHostOfConfigFile:()=>fq,createWatchCompilerHostOfFilesAndCompilerOptions:()=>pq,createWatchFactory:()=>aq,createWatchHost:()=>rq,createWatchProgram:()=>yq,createWatchStatusReporter:()=>LK,createWriteFileMeasuringIO:()=>mW,declarationNameToString:()=>_m,decodeMappings:()=>YB,decodedTextSpanIntersectsWith:()=>mc,deduplicate:()=>ge,defaultInitCompilerOptions:()=>vF,defaultMaximumTruncationLength:()=>xf,diagnosticCategoryName:()=>Oi,diagnosticToString:()=>$$,diagnosticsEqualityComparer:()=>GS,directoryProbablyExists:()=>vx,directorySeparator:()=>Fa,displayPart:()=>DQ,displayPartsToString:()=>m4,disposeEmitNodes:()=>LE,documentSpansEqual:()=>vQ,dumpTracingLegend:()=>Pr,elementAt:()=>Ne,elideNodes:()=>CN,emitDetachedComments:()=>ob,emitFiles:()=>VU,emitFilesAndReportErrors:()=>$K,emitFilesAndReportErrorsAndGetExitStatus:()=>eq,emitModuleKindIsNonNodeESM:()=>yC,emitNewLineBeforeLeadingCommentOfPosition:()=>ib,emitResolverSkipsTypeChecking:()=>BU,emitSkippedWithNoDiagnostics:()=>uG,emptyArray:()=>l,emptyFileSystemEntries:()=>Lw,emptyMap:()=>u,emptyOptions:()=>ZY,endsWith:()=>en,ensurePathIsNonModuleName:()=>bo,ensureScriptKind:()=>ew,ensureTrailingDirectorySeparator:()=>yo,entityNameToString:()=>Sm,enumerateInsertsAndDeletes:()=>Sn,equalOwnProperties:()=>nt,equateStringsCaseInsensitive:()=>Pt,equateStringsCaseSensitive:()=>Ft,equateValues:()=>Nt,escapeJsxAttributeString:()=>uy,escapeLeadingUnderscores:()=>Vc,escapeNonAsciiString:()=>iy,escapeSnippetText:()=>vT,escapeString:()=>ny,escapeTemplateSubstitution:()=>Jv,evaluatorResult:()=>JT,every:()=>y,exclusivelyPrefixedNodeCoreModules:()=>aE,executeCommandLine:()=>ZJ,expandPreOrPostfixIncrementOrDecrementExpression:()=>TM,explainFiles:()=>qK,explainIfFileIsRedirectAndImpliedFormat:()=>JK,exportAssignmentIsAlias:()=>X_,expressionResultIsUnused:()=>dT,extend:()=>lt,extensionFromPath:()=>Nw,extensionIsTS:()=>jw,extensionsNotSupportingExtensionlessResolution:()=>uw,externalHelpersModuleNameText:()=>bf,factory:()=>Y,fileExtensionIs:()=>Ka,fileExtensionIsOneOf:()=>qa,fileIncludeReasonToDiagnostics:()=>ZK,fileShouldUseJavaScriptRequire:()=>i1,filter:()=>D,filterMutate:()=>O,filterSemanticDiagnostics:()=>fG,find:()=>b,findAncestor:()=>q,findBestPatternMatch:()=>pn,findChildOfKind:()=>ZX,findComputedPropertyNameCacheAssignment:()=>MN,findConfigFile:()=>lW,findConstructorDeclaration:()=>ZT,findContainingList:()=>QX,findDiagnosticForNode:()=>R$,findFirstNonJsxWhitespaceToken:()=>xie,findIndex:()=>S,findLast:()=>x,findLastIndex:()=>C,findListItemInfo:()=>cie,findModifier:()=>mQ,findNextToken:()=>oZ,findPackageJson:()=>N$,findPackageJsons:()=>M$,findPrecedingMatchingToken:()=>gZ,findPrecedingToken:()=>sZ,findSuperStatementIndexPath:()=>SV,findTokenOnLeftOfPosition:()=>aZ,findUseStrictPrologue:()=>AM,first:()=>Ie,firstDefined:()=>m,firstDefinedIterator:()=>h,firstIterator:()=>Le,firstOrOnly:()=>U$,firstOrUndefined:()=>Pe,firstOrUndefinedIterator:()=>Fe,fixupCompilerOptions:()=>e0,flatMap:()=>A,flatMapIterator:()=>M,flatMapToMutable:()=>j,flatten:()=>re,flattenCommaList:()=>FN,flattenDestructuringAssignment:()=>zV,flattenDestructuringBinding:()=>UV,flattenDiagnosticMessageText:()=>jW,forEach:()=>f,forEachAncestor:()=>Pf,forEachAncestorDirectory:()=>Fo,forEachAncestorDirectoryStoppingAtGlobalCache:()=>QR,forEachChild:()=>pP,forEachChildRecursively:()=>mP,forEachDynamicImportOrRequireCall:()=>sE,forEachEmittedFile:()=>xU,forEachEnclosingBlockScopeContainer:()=>gm,forEachEntry:()=>Ff,forEachExternalModuleToImportFrom:()=>f1,forEachImportClauseDeclaration:()=>a_,forEachKey:()=>If,forEachLeadingCommentRange:()=>Ms,forEachNameInAccessChainWalkingLeft:()=>yS,forEachNameOfDefaultExport:()=>g1,forEachPropertyAssignment:()=>xh,forEachResolvedProjectReference:()=>qW,forEachReturnStatement:()=>sh,forEachRight:()=>p,forEachTrailingCommentRange:()=>Ns,forEachTsConfigPropArray:()=>Th,forEachUnique:()=>bQ,forEachYieldExpression:()=>ch,formatColorAndReset:()=>DW,formatDiagnostic:()=>yW,formatDiagnostics:()=>vW,formatDiagnosticsWithColorAndContext:()=>AW,formatGeneratedName:()=>ON,formatGeneratedNamePart:()=>TN,formatLocation:()=>kW,formatMessage:()=>FS,formatStringFromArgs:()=>ES,formatting:()=>k7,generateDjb2Hash:()=>ra,generateTSConfig:()=>_I,getAdjustedReferenceLocation:()=>eZ,getAdjustedRenameLocation:()=>tZ,getAliasDeclarationFromName:()=>J_,getAllAccessorDeclarations:()=>Yy,getAllDecoratorsOfClass:()=>kV,getAllDecoratorsOfClassElement:()=>AV,getAllJSDocTags:()=>Pl,getAllJSDocTagsOfKind:()=>Fl,getAllKeys:()=>Ze,getAllProjectOutputs:()=>LU,getAllSuperTypeNodes:()=>nv,getAllowImportingTsExtensions:()=>nC,getAllowJSCompilerOption:()=>_C,getAllowSyntheticDefaultImports:()=>lC,getAncestor:()=>av,getAnyExtensionFromPath:()=>ro,getAreDeclarationMapsEnabled:()=>gC,getAssignedExpandoInitializer:()=>wg,getAssignedName:()=>$c,getAssignmentDeclarationKind:()=>Pg,getAssignmentDeclarationPropertyAccessKind:()=>Kg,getAssignmentTargetKind:()=>j_,getAutomaticTypeDirectiveNames:()=>GL,getBaseFileName:()=>eo,getBinaryOperatorPrecedence:()=>Wv,getBuildInfo:()=>UU,getBuildInfoFileVersionMap:()=>uK,getBuildInfoText:()=>HU,getBuildOrderFromAnyBuildOrder:()=>Eq,getBuilderCreationParameters:()=>eK,getBuilderFileEmit:()=>SG,getCanonicalDiagnostic:()=>Mm,getCheckFlags:()=>Jx,getClassExtendsHeritageElement:()=>ev,getClassLikeDeclarationOfSymbol:()=>sS,getCombinedLocalAndExportSymbolFlags:()=>Zx,getCombinedModifierFlags:()=>Mc,getCombinedNodeFlags:()=>Pc,getCombinedNodeFlagsAlwaysIncludeJSDoc:()=>Nc,getCommentRange:()=>YE,getCommonSourceDirectory:()=>FU,getCommonSourceDirectoryOfConfig:()=>IU,getCompilerOptionValue:()=>AC,getCompilerOptionsDiffValue:()=>hI,getConditions:()=>UL,getConfigFileParsingDiagnostics:()=>rG,getConstantValue:()=>iD,getContainerFlags:()=>Dz,getContainerNode:()=>LX,getContainingClass:()=>Oh,getContainingClassExcludingClassDecorators:()=>jh,getContainingClassStaticBlock:()=>kh,getContainingFunction:()=>Eh,getContainingFunctionDeclaration:()=>Dh,getContainingFunctionOrClassStaticBlock:()=>Ah,getContainingNodeArray:()=>pT,getContainingObjectLiteralElement:()=>S4,getContextualTypeFromParent:()=>m$,getContextualTypeFromParentOrAncestorTypeNode:()=>$X,getDeclarationDiagnostics:()=>tU,getDeclarationEmitExtensionForPath:()=>Dy,getDeclarationEmitOutputFilePath:()=>Ty,getDeclarationEmitOutputFilePathWorker:()=>Ey,getDeclarationFileExtension:()=>MP,getDeclarationFromName:()=>G_,getDeclarationModifierFlagsFromSymbol:()=>Yx,getDeclarationOfKind:()=>Cf,getDeclarationsOfKind:()=>wf,getDeclaredExpandoInitializer:()=>Sg,getDecorators:()=>el,getDefaultCompilerOptions:()=>h4,getDefaultFormatCodeSettings:()=>aX,getDefaultLibFileName:()=>nc,getDefaultLibFilePath:()=>w4,getDefaultLikeExportInfo:()=>h1,getDefaultLikeExportNameFromDeclaration:()=>G$,getDefaultResolutionModeForFileWorker:()=>lG,getDiagnosticText:()=>PF,getDiagnosticsWithinSpan:()=>z$,getDirectoryPath:()=>$a,getDirectoryToWatchFailedLookupLocation:()=>wK,getDirectoryToWatchFailedLookupLocationFromTypeRoot:()=>DK,getDocumentPositionMapper:()=>G1,getDocumentSpansEqualityComparer:()=>yQ,getESModuleInterop:()=>cC,getEditsForFileRename:()=>D1,getEffectiveBaseTypeNode:()=>$_,getEffectiveConstraintOfTypeParameter:()=>zl,getEffectiveContainerForJSDocTemplateTag:()=>x_,getEffectiveImplementsTypeNodes:()=>tv,getEffectiveInitializer:()=>xg,getEffectiveJSDocHost:()=>w_,getEffectiveModifierFlags:()=>wb,getEffectiveModifierFlagsAlwaysIncludeJSDoc:()=>Tb,getEffectiveModifierFlagsNoCache:()=>jb,getEffectiveReturnTypeNode:()=>Qy,getEffectiveSetAccessorTypeAnnotationNode:()=>tb,getEffectiveTypeAnnotationNode:()=>Xy,getEffectiveTypeParameterDeclarations:()=>Rl,getEffectiveTypeRoots:()=>LL,getElementOrPropertyAccessArgumentExpressionOrName:()=>Wg,getElementOrPropertyAccessName:()=>Gg,getElementsOfBindingOrAssignmentPattern:()=>tN,getEmitDeclarations:()=>pC,getEmitFlags:()=>Pp,getEmitHelpers:()=>lD,getEmitModuleDetectionKind:()=>oC,getEmitModuleFormatOfFileWorker:()=>sG,getEmitModuleKind:()=>iC,getEmitModuleResolutionKind:()=>aC,getEmitScriptTarget:()=>rC,getEmitStandardClassFields:()=>EC,getEnclosingBlockScopeContainer:()=>hm,getEnclosingContainer:()=>mm,getEncodedSemanticClassifications:()=>v1,getEncodedSyntacticClassifications:()=>b1,getEndLinePosition:()=>ap,getEntityNameFromTypeNode:()=>Vh,getEntrypointsFromPackageJsonInfo:()=>jR,getErrorCountForSummary:()=>zK,getErrorSpanForNode:()=>Fm,getErrorSummaryText:()=>UK,getEscapedTextOfIdentifierOrLiteral:()=>wv,getEscapedTextOfJsxAttributeName:()=>PT,getEscapedTextOfJsxNamespacedName:()=>LT,getExpandoInitializer:()=>Tg,getExportAssignmentExpression:()=>Z_,getExportInfoMap:()=>m1,getExportNeedsImportStarHelper:()=>cV,getExpressionAssociativity:()=>Rv,getExpressionPrecedence:()=>Bv,getExternalHelpersModuleName:()=>BM,getExternalModuleImportEqualsDeclarationExpression:()=>ng,getExternalModuleName:()=>n_,getExternalModuleNameFromDeclaration:()=>Sy,getExternalModuleNameFromPath:()=>Cy,getExternalModuleNameLiteral:()=>GM,getExternalModuleRequireArgument:()=>rg,getFallbackOptions:()=>sW,getFileEmitOutput:()=>_G,getFileMatcherPatterns:()=>YC,getFileNamesFromConfigSpecs:()=>sL,getFileWatcherEventKind:()=>ba,getFilesInErrorForSummary:()=>BK,getFirstConstructorWithBody:()=>By,getFirstIdentifier:()=>Jb,getFirstNonSpaceCharacterPosition:()=>XQ,getFirstProjectOutput:()=>zU,getFixableErrorSpanExpression:()=>V$,getFormatCodeSettingsForWriting:()=>e1,getFullWidth:()=>zf,getFunctionFlags:()=>hv,getHeritageClause:()=>iv,getHostSignatureFromJSDoc:()=>C_,getIdentifierAutoGenerate:()=>yD,getIdentifierGeneratedImportReference:()=>Hee,getIdentifierTypeArguments:()=>_D,getImmediatelyInvokedFunctionExpression:()=>Ih,getImpliedNodeFormatForEmitWorker:()=>cG,getImpliedNodeFormatForFile:()=>iG,getImpliedNodeFormatForFileWorker:()=>aG,getImportNeedsImportDefaultHelper:()=>uV,getImportNeedsImportStarHelper:()=>lV,getIndentString:()=>hy,getInferredLibraryNameResolveFrom:()=>XW,getInitializedVariables:()=>Wx,getInitializerOfBinaryExpression:()=>qg,getInitializerOfBindingOrAssignmentElement:()=>YM,getInterfaceBaseTypeNodes:()=>rv,getInternalEmitFlags:()=>Fp,getInvokedExpression:()=>Hh,getIsFileExcluded:()=>p1,getIsolatedModules:()=>sC,getJSDocAugmentsTag:()=>ll,getJSDocClassTag:()=>dl,getJSDocCommentRanges:()=>nh,getJSDocCommentsAndTags:()=>g_,getJSDocDeprecatedTag:()=>xl,getJSDocDeprecatedTagNoCache:()=>Sl,getJSDocEnumTag:()=>Cl,getJSDocHost:()=>T_,getJSDocImplementsTags:()=>ul,getJSDocOverloadTags:()=>S_,getJSDocOverrideTagNoCache:()=>bl,getJSDocParameterTags:()=>rl,getJSDocParameterTagsNoCache:()=>il,getJSDocPrivateTag:()=>ml,getJSDocPrivateTagNoCache:()=>hl,getJSDocProtectedTag:()=>gl,getJSDocProtectedTagNoCache:()=>_l,getJSDocPublicTag:()=>fl,getJSDocPublicTagNoCache:()=>pl,getJSDocReadonlyTag:()=>vl,getJSDocReadonlyTagNoCache:()=>yl,getJSDocReturnTag:()=>Tl,getJSDocReturnType:()=>Al,getJSDocRoot:()=>E_,getJSDocSatisfiesExpressionType:()=>MT,getJSDocSatisfiesTag:()=>Dl,getJSDocTags:()=>Ml,getJSDocTemplateTag:()=>El,getJSDocThisTag:()=>wl,getJSDocType:()=>kl,getJSDocTypeAliasName:()=>nN,getJSDocTypeAssertionType:()=>FM,getJSDocTypeParameterDeclarations:()=>$y,getJSDocTypeParameterTags:()=>ol,getJSDocTypeParameterTagsNoCache:()=>sl,getJSDocTypeTag:()=>Ol,getJSXImplicitImportBase:()=>MC,getJSXRuntimeImport:()=>NC,getJSXTransformEnabled:()=>jC,getKeyForCompilerOptions:()=>YL,getLanguageVariant:()=>YS,getLastChild:()=>dS,getLeadingCommentRanges:()=>Ls,getLeadingCommentRangesOfNode:()=>th,getLeftmostAccessExpression:()=>vS,getLeftmostExpression:()=>bS,getLibraryNameFromLibFileName:()=>ZW,getLineAndCharacterOfPosition:()=>ms,getLineInfo:()=>GB,getLineOfLocalPosition:()=>Ry,getLineStartPositionForPosition:()=>BX,getLineStarts:()=>us,getLinesBetweenPositionAndNextNonWhitespaceCharacter:()=>zx,getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter:()=>Rx,getLinesBetweenPositions:()=>ps,getLinesBetweenRangeEndAndRangeStart:()=>Nx,getLinesBetweenRangeEndPositions:()=>Px,getLiteralText:()=>Rp,getLocalNameForExternalImport:()=>WM,getLocalSymbolForExportDefault:()=>ox,getLocaleSpecificMessage:()=>AS,getLocaleTimeString:()=>IK,getMappedContextSpan:()=>wQ,getMappedDocumentSpan:()=>CQ,getMappedLocation:()=>SQ,getMatchedFileSpec:()=>YK,getMatchedIncludeSpec:()=>XK,getMeaningFromDeclaration:()=>_X,getMeaningFromLocation:()=>vX,getMembersOfDeclaration:()=>uh,getModeForFileReference:()=>MW,getModeForResolutionAtIndex:()=>NW,getModeForUsageLocation:()=>FW,getModifiedTime:()=>ca,getModifiers:()=>tl,getModuleInstanceState:()=>_z,getModuleNameStringLiteralAt:()=>gG,getModuleSpecifierEndingPreference:()=>vw,getModuleSpecifierResolverHost:()=>eQ,getNameForExportedSymbol:()=>W$,getNameFromImportAttribute:()=>KT,getNameFromIndexInfo:()=>vm,getNameFromPropertyName:()=>YZ,getNameOfAccessExpression:()=>gS,getNameOfCompilerOptionValue:()=>fI,getNameOfDeclaration:()=>Qc,getNameOfExpando:()=>Og,getNameOfJSDocTypedef:()=>Yc,getNameOfScriptTarget:()=>TC,getNameOrArgument:()=>Vg,getNameTable:()=>x4,getNamespaceDeclarationNode:()=>r_,getNewLineCharacter:()=>xx,getNewLineKind:()=>Q$,getNewLineOrDefaultFromHost:()=>BQ,getNewTargetContainer:()=>cee,getNextJSDocCommentLocation:()=>y_,getNodeChildren:()=>oM,getNodeForGeneratedName:()=>wN,getNodeId:()=>xB,getNodeKind:()=>RX,getNodeModifiers:()=>CZ,getNodeModulePathParts:()=>ST,getNonAssignedNameOfDeclaration:()=>Zc,getNonAssignmentOperatorForCompoundAssignment:()=>yV,getNonAugmentationDeclaration:()=>em,getNonDecoratorTokenPosOfNode:()=>Sp,getNonIncrementalBuildInfoRoots:()=>dK,getNonModifierTokenPosOfNode:()=>Cp,getNormalizedAbsolutePath:()=>po,getNormalizedAbsolutePathWithoutRoot:()=>go,getNormalizedPathComponents:()=>fo,getObjectFlags:()=>cS,getOperatorAssociativity:()=>zv,getOperatorPrecedence:()=>Uv,getOptionFromName:()=>kF,getOptionsForLibraryResolution:()=>aR,getOptionsNameMap:()=>gF,getOrCreateEmitNode:()=>IE,getOrUpdate:()=>ae,getOriginalNode:()=>Rc,getOriginalNodeId:()=>iV,getOutputDeclarationFileName:()=>OU,getOutputDeclarationFileNameWorker:()=>kU,getOutputExtension:()=>EU,getOutputFileNames:()=>RU,getOutputJSFileNameWorker:()=>jU,getOutputPathsFor:()=>wU,getOwnEmitOutputFilePath:()=>wy,getOwnKeys:()=>Xe,getOwnValues:()=>Qe,getPackageJsonTypesVersionsPaths:()=>IL,getPackageNameFromTypesPackageName:()=>oz,getPackageScopeForPath:()=>NR,getParameterSymbolFromJSDoc:()=>b_,getParentNodeInSpan:()=>pQ,getParseTreeNode:()=>Bc,getParsedCommandLineOfConfigFile:()=>FF,getPathComponents:()=>ao,getPathFromPathComponents:()=>oo,getPathUpdater:()=>O1,getPathsBasePath:()=>Ay,getPatternFromSpec:()=>KC,getPendingEmitKindWithSeen:()=>FG,getPositionOfLineAndCharacter:()=>cs,getPossibleGenericSignatures:()=>vZ,getPossibleOriginalInputExtensionForExtension:()=>Oy,getPossibleOriginalInputPathWithoutChangingExt:()=>ky,getPossibleTypeArgumentsInfo:()=>yZ,getPreEmitDiagnostics:()=>_W,getPrecedingNonSpaceCharacterPosition:()=>ZQ,getPrivateIdentifier:()=>NV,getProperties:()=>CV,getProperty:()=>Ye,getPropertyArrayElementValue:()=>Sh,getPropertyAssignmentAliasLikeExpression:()=>Q_,getPropertyNameForPropertyNameNode:()=>xv,getPropertyNameFromType:()=>VT,getPropertyNameOfBindingOrAssignmentElement:()=>QM,getPropertySymbolFromBindingElement:()=>fQ,getPropertySymbolsFromContextualType:()=>C4,getQuoteFromPreference:()=>sQ,getQuotePreference:()=>oQ,getRangesWhere:()=>ue,getRefactorContextSpan:()=>B$,getReferencedFileLocation:()=>tG,getRegexFromPattern:()=>XC,getRegularExpressionForWildcard:()=>UC,getRegularExpressionsForWildcards:()=>WC,getRelativePathFromDirectory:()=>jo,getRelativePathFromFile:()=>No,getRelativePathToDirectoryOrUrl:()=>Po,getRenameLocation:()=>c$,getReplacementSpanForContextToken:()=>PZ,getResolutionDiagnostic:()=>hG,getResolutionModeOverride:()=>RW,getResolveJsonModule:()=>fC,getResolvePackageJsonExports:()=>uC,getResolvePackageJsonImports:()=>dC,getResolvedExternalModuleName:()=>xy,getResolvedModuleFromResolution:()=>Hf,getResolvedTypeReferenceDirectiveFromResolution:()=>Uf,getRestIndicatorOfBindingOrAssignmentElement:()=>ZM,getRestParameterElementType:()=>lh,getRightMostAssignedExpression:()=>Ag,getRootDeclaration:()=>Pv,getRootDirectoryOfResolutionCache:()=>OK,getRootLength:()=>Qa,getScriptKind:()=>qQ,getScriptKindFromFileName:()=>tw,getScriptTargetFeatures:()=>Ip,getSelectedEffectiveModifierFlags:()=>xb,getSelectedSyntacticModifierFlags:()=>Sb,getSemanticClassifications:()=>_1,getSemanticJsxChildren:()=>Gv,getSetAccessorTypeAnnotationNode:()=>Hy,getSetAccessorValueParameter:()=>Vy,getSetExternalModuleIndicator:()=>ZS,getShebang:()=>zs,getSingleVariableOfVariableStatement:()=>p_,getSnapshotText:()=>KZ,getSnippetElement:()=>dD,getSourceFileOfModule:()=>ep,getSourceFileOfNode:()=>$f,getSourceFilePathInNewDir:()=>Ny,getSourceFileVersionAsHashFromText:()=>sq,getSourceFilesToEmit:()=>jy,getSourceMapRange:()=>UE,getSourceMapper:()=>W1,getSourceTextOfNodeFromSourceFile:()=>wp,getSpanOfTokenAtPosition:()=>Nm,getSpellingSuggestion:()=>Qt,getStartPositionOfLine:()=>rp,getStartPositionOfRange:()=>Lx,getStartsOnNewLine:()=>qE,getStaticPropertiesAndClassStaticBlock:()=>TV,getStrictOptionValue:()=>wC,getStringComparer:()=>Wt,getSubPatternFromSpec:()=>qC,getSuperCallFromStatement:()=>bV,getSuperContainer:()=>Fh,getSupportedCodeFixes:()=>g4,getSupportedExtensions:()=>dw,getSupportedExtensionsWithJsonIfResolveJsonModule:()=>fw,getSwitchedType:()=>y$,getSymbolId:()=>SB,getSymbolNameForPrivateIdentifier:()=>Tv,getSymbolTarget:()=>JQ,getSyntacticClassifications:()=>y1,getSyntacticModifierFlags:()=>Eb,getSyntacticModifierFlagsNoCache:()=>Mb,getSynthesizedDeepClone:()=>QQ,getSynthesizedDeepCloneWithReplacements:()=>$Q,getSynthesizedDeepClones:()=>e$,getSynthesizedDeepClonesWithReplacements:()=>t$,getSyntheticLeadingComments:()=>ZE,getSyntheticTrailingComments:()=>eD,getTargetLabel:()=>EX,getTargetOfBindingOrAssignmentElement:()=>XM,getTemporaryModuleResolutionState:()=>MR,getTextOfConstantValue:()=>Bp,getTextOfIdentifierOrLiteral:()=>Cv,getTextOfJSDocComment:()=>Il,getTextOfJsxAttributeName:()=>FT,getTextOfJsxNamespacedName:()=>RT,getTextOfNode:()=>jp,getTextOfNodeFromSourceText:()=>Ap,getTextOfPropertyName:()=>xm,getThisContainer:()=>Mh,getThisParameter:()=>Uy,getTokenAtPosition:()=>iZ,getTokenPosOfNode:()=>xp,getTokenSourceMapRange:()=>GE,getTouchingPropertyName:()=>nZ,getTouchingToken:()=>rZ,getTrailingCommentRanges:()=>Rs,getTrailingSemicolonDeferringWriter:()=>vy,getTransformers:()=>uU,getTsBuildInfoEmitOutputFilePath:()=>SU,getTsConfigObjectLiteralExpression:()=>Ch,getTsConfigPropArrayElementValue:()=>wh,getTypeAnnotationNode:()=>Zy,getTypeArgumentOrTypeParameterList:()=>wZ,getTypeKeywordOfTypeOnlyImport:()=>gQ,getTypeNode:()=>hD,getTypeNodeIfAccessible:()=>x$,getTypeParameterFromJsDoc:()=>D_,getTypeParameterOwner:()=>Ec,getTypesPackageName:()=>iz,getUILocale:()=>Jt,getUniqueName:()=>s$,getUniqueSymbolId:()=>YQ,getUseDefineForClassFields:()=>vC,getWatchErrorSummaryDiagnosticMessage:()=>VK,getWatchFactory:()=>oW,group:()=>ot,groupBy:()=>st,guessIndentation:()=>ff,handleNoEmitOptions:()=>dG,handleWatchOptionsConfigDirTemplateSubstitution:()=>DI,hasAbstractModifier:()=>gb,hasAccessorModifier:()=>vb,hasAmbientModifier:()=>_b,hasChangesInResolutions:()=>Xf,hasContextSensitiveParameters:()=>mT,hasDecorators:()=>bb,hasDocComment:()=>xZ,hasDynamicName:()=>yv,hasEffectiveModifier:()=>db,hasEffectiveModifiers:()=>lb,hasEffectiveReadonlyModifier:()=>yb,hasExtension:()=>Ga,hasImplementationTSFileExtension:()=>gw,hasIndexSignature:()=>v$,hasInferredType:()=>tE,hasInitializer:()=>sf,hasInvalidEscape:()=>Xv,hasJSDocNodes:()=>af,hasJSDocParameterTags:()=>cl,hasJSFileExtension:()=>mw,hasJsonModuleEmitEnabled:()=>bC,hasOnlyExpressionInitializer:()=>cf,hasOverrideModifier:()=>hb,hasPossibleExternalModuleReference:()=>fm,hasProperty:()=>Je,hasPropertyAccessExpressionWithName:()=>DX,hasQuestionToken:()=>o_,hasRecordedExternalHelpers:()=>VM,hasResolutionModeOverride:()=>UT,hasRestParameter:()=>hf,hasScopeMarker:()=>Sd,hasStaticModifier:()=>mb,hasSyntacticModifier:()=>fb,hasSyntacticModifiers:()=>ub,hasTSFileExtension:()=>hw,hasTabstop:()=>DT,hasTrailingDirectorySeparator:()=>Ja,hasType:()=>of,hasTypeArguments:()=>O_,hasZeroOrOneAsteriskCharacter:()=>PC,hostGetCanonicalFileName:()=>by,hostUsesCaseSensitiveFileNames:()=>yy,idText:()=>Uc,identifierIsThisKeyword:()=>Jy,identifierToKeywordKind:()=>Wc,identity:()=>Tt,identitySourceMapConsumer:()=>rV,ignoreSourceNewlines:()=>pD,ignoredPaths:()=>xa,importFromModuleSpecifier:()=>$g,importSyntaxAffectsModuleResolution:()=>QS,indexOfAnyCharCode:()=>T,indexOfNode:()=>Np,indicesOf:()=>pe,inferredTypesContainingFile:()=>YW,injectClassNamedEvaluationHelperBlockIfMissing:()=>oH,injectClassThisAssignmentIfMissing:()=>eH,insertImports:()=>hQ,insertSorted:()=>ye,insertStatementAfterCustomPrologue:()=>_p,insertStatementAfterStandardPrologue:()=>gp,insertStatementsAfterCustomPrologue:()=>hp,insertStatementsAfterStandardPrologue:()=>mp,intersperse:()=>v,intrinsicTagNameToString:()=>zT,introducesArgumentsExoticObject:()=>see,inverseJsxOptionMap:()=>GP,isAbstractConstructorSymbol:()=>oS,isAbstractModifier:()=>CO,isAccessExpression:()=>hS,isAccessibilityModifier:()=>kZ,isAccessor:()=>Bu,isAccessorModifier:()=>TO,isAliasableExpression:()=>Y_,isAmbientModule:()=>Wp,isAmbientPropertyDeclaration:()=>im,isAnyDirectorySeparator:()=>za,isAnyImportOrBareOrAccessedRequire:()=>lm,isAnyImportOrReExport:()=>pm,isAnyImportOrRequireStatement:()=>um,isAnyImportSyntax:()=>cm,isAnySupportedFileExtension:()=>Pw,isApplicableVersionedTypesKey:()=>YR,isArgumentExpressionOfElementAccess:()=>NX,isArray:()=>ht,isArrayBindingElement:()=>Qu,isArrayBindingOrAssignmentElement:()=>ad,isArrayBindingOrAssignmentPattern:()=>id,isArrayBindingPattern:()=>gk,isArrayLiteralExpression:()=>vk,isArrayLiteralOrObjectLiteralDestructuringPattern:()=>jZ,isArrayTypeNode:()=>ZO,isArrowFunction:()=>Ok,isAsExpression:()=>Uk,isAssertClause:()=>MA,isAssertEntry:()=>NA,isAssertionExpression:()=>yd,isAssertsKeyword:()=>yO,isAssignmentDeclaration:()=>bg,isAssignmentExpression:()=>Wb,isAssignmentOperator:()=>Vb,isAssignmentPattern:()=>Zu,isAssignmentTarget:()=>M_,isAsteriskToken:()=>lO,isAsyncFunction:()=>gv,isAsyncModifier:()=>vO,isAutoAccessorPropertyDeclaration:()=>Vu,isAwaitExpression:()=>Mk,isAwaitKeyword:()=>bO,isBigIntLiteral:()=>ZD,isBinaryExpression:()=>Fk,isBinaryLogicalOperator:()=>Fb,isBinaryOperatorToken:()=>vN,isBindableObjectDefinePropertyCall:()=>Fg,isBindableStaticAccessExpression:()=>Rg,isBindableStaticElementAccessExpression:()=>zg,isBindableStaticNameExpression:()=>Bg,isBindingElement:()=>_k,isBindingElementOfBareOrAccessedRequire:()=>hg,isBindingName:()=>Au,isBindingOrAssignmentElement:()=>ed,isBindingOrAssignmentPattern:()=>td,isBindingPattern:()=>Xu,isBlock:()=>Qk,isBlockLike:()=>a1,isBlockOrCatchScoped:()=>Hp,isBlockScope:()=>am,isBlockScopedContainerTopLevel:()=>Xp,isBooleanLiteral:()=>Pu,isBreakOrContinueStatement:()=>$l,isBreakStatement:()=>lA,isBuildCommand:()=>XJ,isBuildInfoFile:()=>bU,isBuilderProgram:()=>GK,isBundle:()=>gj,isCallChain:()=>Wl,isCallExpression:()=>Sk,isCallExpressionTarget:()=>bX,isCallLikeExpression:()=>ld,isCallLikeOrFunctionLikeExpression:()=>cd,isCallOrNewExpression:()=>ud,isCallOrNewExpressionTarget:()=>SX,isCallSignatureDeclaration:()=>HO,isCallToHelper:()=>YD,isCaseBlock:()=>EA,isCaseClause:()=>sj,isCaseKeyword:()=>OO,isCaseOrDefaultClause:()=>Qd,isCatchClause:()=>uj,isCatchClauseVariableDeclaration:()=>gT,isCatchClauseVariableDeclarationOrBindingElement:()=>Up,isCheckJsEnabledForFile:()=>Iw,isCircularBuildOrder:()=>Tq,isClassDeclaration:()=>bA,isClassElement:()=>Ru,isClassExpression:()=>Bk,isClassInstanceProperty:()=>Hu,isClassLike:()=>zu,isClassMemberModifier:()=>Eu,isClassNamedEvaluationHelperBlock:()=>rH,isClassOrTypeElement:()=>Ku,isClassStaticBlockDeclaration:()=>RO,isClassThisAssignmentBlock:()=>QV,isColonToken:()=>fO,isCommaExpression:()=>MM,isCommaListExpression:()=>Yk,isCommaSequence:()=>NM,isCommaToken:()=>oO,isComment:()=>TZ,isCommonJsExportPropertyAssignment:()=>mh,isCommonJsExportedExpression:()=>ph,isCompoundAssignment:()=>vV,isComputedNonLiteralName:()=>ym,isComputedPropertyName:()=>AO,isConciseBody:()=>Ed,isConditionalExpression:()=>Ik,isConditionalTypeNode:()=>ik,isConstAssertion:()=>XT,isConstTypeReference:()=>Xl,isConstructSignatureDeclaration:()=>UO,isConstructorDeclaration:()=>zO,isConstructorTypeNode:()=>JO,isContextualKeyword:()=>lv,isContinueStatement:()=>cA,isCustomPrologue:()=>Zm,isDebuggerStatement:()=>gA,isDeclaration:()=>zd,isDeclarationBindingElement:()=>$u,isDeclarationFileName:()=>jP,isDeclarationName:()=>W_,isDeclarationNameOfEnumOrNamespace:()=>Ux,isDeclarationReadonly:()=>Bm,isDeclarationStatement:()=>Bd,isDeclarationWithTypeParameterChildren:()=>sm,isDeclarationWithTypeParameters:()=>om,isDecorator:()=>NO,isDecoratorTarget:()=>$re,isDefaultClause:()=>cj,isDefaultImport:()=>i_,isDefaultModifier:()=>_O,isDefaultedExpandoInitializer:()=>Dg,isDeleteExpression:()=>kk,isDeleteTarget:()=>H_,isDeprecatedDeclaration:()=>X$,isDestructuringAssignment:()=>Gb,isDiskPathRoot:()=>W,isDoStatement:()=>rA,isDocumentRegistryEntry:()=>S1,isDotDotDotToken:()=>aO,isDottedName:()=>Yb,isDynamicName:()=>bv,isEffectiveExternalModule:()=>nm,isEffectiveStrictModeSourceFile:()=>rm,isElementAccessChain:()=>Ul,isElementAccessExpression:()=>xk,isEmittedFileOfProgram:()=>iW,isEmptyArrayLiteral:()=>ax,isEmptyBindingElement:()=>kc,isEmptyBindingPattern:()=>Oc,isEmptyObjectLiteral:()=>ix,isEmptyStatement:()=>eA,isEmptyStringLiteral:()=>Yh,isEntityName:()=>Ou,isEntityNameExpression:()=>qb,isEnumConst:()=>zm,isEnumDeclaration:()=>CA,isEnumMember:()=>mj,isEqualityOperatorKind:()=>g$,isEqualsGreaterThanToken:()=>mO,isExclamationToken:()=>uO,isExcludedFile:()=>cL,isExclusivelyTypeOnlyImportOrExport:()=>PW,isExpandoPropertyDeclaration:()=>HT,isExportAssignment:()=>BA,isExportDeclaration:()=>VA,isExportModifier:()=>gO,isExportName:()=>OM,isExportNamespaceAsDefaultDeclaration:()=>Ep,isExportOrDefaultModifier:()=>SN,isExportSpecifier:()=>UA,isExportsIdentifier:()=>jg,isExportsOrModuleExportsOrAlias:()=>Ez,isExpression:()=>J,isExpressionNode:()=>Zh,isExpressionOfExternalModuleImportEqualsDeclaration:()=>aie,isExpressionOfOptionalChainRoot:()=>ql,isExpressionStatement:()=>tA,isExpressionWithTypeArguments:()=>Hk,isExpressionWithTypeArgumentsInClassExtendsClause:()=>Kb,isExternalModule:()=>bP,isExternalModuleAugmentation:()=>Qp,isExternalModuleImportEqualsDeclaration:()=>tg,isExternalModuleIndicator:()=>wd,isExternalModuleNameRelative:()=>$s,isExternalModuleReference:()=>JA,isExternalModuleSymbol:()=>Df,isExternalOrCommonJsModule:()=>Lm,isFileLevelReservedGeneratedIdentifier:()=>xu,isFileLevelUniqueName:()=>op,isFileProbablyExternalModule:()=>qN,isFirstDeclarationOfSymbolParameter:()=>TQ,isFixablePromiseHandler:()=>X1,isForInOrOfStatement:()=>Td,isForInStatement:()=>oA,isForInitializer:()=>Od,isForOfStatement:()=>sA,isForStatement:()=>aA,isFullSourceFile:()=>ag,isFunctionBlock:()=>gh,isFunctionBody:()=>Dd,isFunctionDeclaration:()=>yA,isFunctionExpression:()=>Dk,isFunctionExpressionOrArrowFunction:()=>_T,isFunctionLike:()=>ju,isFunctionLikeDeclaration:()=>Nu,isFunctionLikeKind:()=>Iu,isFunctionLikeOrClassStaticBlockDeclaration:()=>Mu,isFunctionOrConstructorTypeNode:()=>Yu,isFunctionOrModuleBlock:()=>Lu,isFunctionSymbol:()=>Zg,isFunctionTypeNode:()=>qO,isGeneratedIdentifier:()=>yu,isGeneratedPrivateIdentifier:()=>bu,isGetAccessor:()=>rf,isGetAccessorDeclaration:()=>BO,isGetOrSetAccessorDeclaration:()=>Vl,isGlobalScopeAugmentation:()=>Zp,isGlobalSourceFile:()=>Im,isGrammarError:()=>lp,isHeritageClause:()=>lj,isHoistedFunction:()=>Qm,isHoistedVariableStatement:()=>eh,isIdentifier:()=>X,isIdentifierANonContextualKeyword:()=>fv,isIdentifierName:()=>q_,isIdentifierOrThisTypeNode:()=>cN,isIdentifierPart:()=>Vs,isIdentifierStart:()=>Bs,isIdentifierText:()=>Hs,isIdentifierTypePredicate:()=>yh,isIdentifierTypeReference:()=>eT,isIfStatement:()=>nA,isIgnoredFileFromWildCardWatching:()=>rW,isImplicitGlob:()=>GC,isImportAttribute:()=>FA,isImportAttributeName:()=>vu,isImportAttributes:()=>PA,isImportCall:()=>qm,isImportClause:()=>AA,isImportDeclaration:()=>kA,isImportEqualsDeclaration:()=>OA,isImportKeyword:()=>DO,isImportMeta:()=>Jm,isImportOrExportSpecifier:()=>fu,isImportOrExportSpecifierName:()=>KQ,isImportSpecifier:()=>zA,isImportTypeAssertionContainer:()=>jA,isImportTypeNode:()=>fk,isImportable:()=>u1,isInComment:()=>bZ,isInCompoundLikeAssignment:()=>N_,isInExpressionContext:()=>Qh,isInJSDoc:()=>ug,isInJSFile:()=>sg,isInJSXText:()=>mZ,isInJsonFile:()=>cg,isInNonReferenceComment:()=>NZ,isInReferenceComment:()=>MZ,isInRightSideOfInternalImportEqualsDeclaration:()=>yX,isInString:()=>uZ,isInTemplateString:()=>pZ,isInTopLevelContext:()=>Ph,isInTypeQuery:()=>Ky,isIncrementalBuildInfo:()=>YG,isIncrementalBundleEmitBuildInfo:()=>JG,isIncrementalCompilation:()=>hC,isIndexSignatureDeclaration:()=>WO,isIndexedAccessTypeNode:()=>lk,isInferTypeNode:()=>ak,isInfinityOrNaNString:()=>hT,isInitializedProperty:()=>EV,isInitializedVariable:()=>Gx,isInsideJsxElement:()=>hZ,isInsideJsxElementOrAttribute:()=>dZ,isInsideNodeModules:()=>L$,isInsideTemplateLiteral:()=>OZ,isInstanceOfExpression:()=>nx,isInstantiatedModule:()=>CB,isInterfaceDeclaration:()=>xA,isInternalDeclaration:()=>vf,isInternalModuleImportEqualsDeclaration:()=>ig,isInternalName:()=>EM,isIntersectionTypeNode:()=>rk,isIntrinsicJsxName:()=>py,isIterationStatement:()=>bd,isJSDoc:()=>jj,isJSDocAllType:()=>Cj,isJSDocAugmentsTag:()=>Pj,isJSDocAuthorTag:()=>Fj,isJSDocCallbackTag:()=>Lj,isJSDocClassTag:()=>Ij,isJSDocCommentContainingNode:()=>ef,isJSDocConstructSignature:()=>s_,isJSDocDeprecatedTag:()=>Wj,isJSDocEnumTag:()=>Kj,isJSDocFunctionType:()=>Oj,isJSDocImplementsTag:()=>eM,isJSDocImportTag:()=>rM,isJSDocIndexSignature:()=>dg,isJSDocLikeText:()=>KN,isJSDocLink:()=>bj,isJSDocLinkCode:()=>xj,isJSDocLinkLike:()=>mf,isJSDocLinkPlain:()=>Sj,isJSDocMemberName:()=>yj,isJSDocNameReference:()=>vj,isJSDocNamepathType:()=>Aj,isJSDocNamespaceBody:()=>jd,isJSDocNode:()=>$d,isJSDocNonNullableType:()=>Ej,isJSDocNullableType:()=>Tj,isJSDocOptionalParameter:()=>OT,isJSDocOptionalType:()=>Dj,isJSDocOverloadTag:()=>Uj,isJSDocOverrideTag:()=>Hj,isJSDocParameterTag:()=>qj,isJSDocPrivateTag:()=>zj,isJSDocPropertyLikeTag:()=>tu,isJSDocPropertyTag:()=>Zee,isJSDocProtectedTag:()=>Bj,isJSDocPublicTag:()=>Rj,isJSDocReadonlyTag:()=>Vj,isJSDocReturnTag:()=>Jj,isJSDocSatisfiesExpression:()=>jT,isJSDocSatisfiesTag:()=>tM,isJSDocSeeTag:()=>Gj,isJSDocSignature:()=>Nj,isJSDocTag:()=>tf,isJSDocTemplateTag:()=>Zj,isJSDocThisTag:()=>Yj,isJSDocThrowsTag:()=>nM,isJSDocTypeAlias:()=>c_,isJSDocTypeAssertion:()=>PM,isJSDocTypeExpression:()=>_j,isJSDocTypeLiteral:()=>Mj,isJSDocTypeTag:()=>Xj,isJSDocTypedefTag:()=>Qj,isJSDocUnknownTag:()=>$j,isJSDocUnknownType:()=>wj,isJSDocVariadicType:()=>kj,isJSXTagName:()=>Xh,isJsonEqual:()=>qw,isJsonSourceFile:()=>Rm,isJsxAttribute:()=>nj,isJsxAttributeLike:()=>Jd,isJsxAttributeName:()=>IT,isJsxAttributes:()=>rj,isJsxCallLike:()=>Zd,isJsxChild:()=>qd,isJsxClosingElement:()=>QA,isJsxClosingFragment:()=>tj,isJsxElement:()=>YA,isJsxExpression:()=>aj,isJsxFragment:()=>$A,isJsxNamespacedName:()=>oj,isJsxOpeningElement:()=>ZA,isJsxOpeningFragment:()=>ej,isJsxOpeningLikeElement:()=>Xd,isJsxOpeningLikeElementTagName:()=>eie,isJsxSelfClosingElement:()=>XA,isJsxSpreadAttribute:()=>ij,isJsxTagNameExpression:()=>Kd,isJsxText:()=>$D,isJumpStatementTarget:()=>OX,isKeyword:()=>ov,isKeywordOrPunctuation:()=>cv,isKnownSymbol:()=>Ev,isLabelName:()=>AX,isLabelOfLabeledStatement:()=>kX,isLabeledStatement:()=>pA,isLateVisibilityPaintedStatement:()=>dm,isLeftHandSideExpression:()=>fd,isLet:()=>Gm,isLineBreak:()=>_s,isLiteralComputedPropertyDeclarationName:()=>K_,isLiteralExpression:()=>su,isLiteralExpressionOfObject:()=>cu,isLiteralImportTypeNode:()=>Ym,isLiteralKind:()=>ou,isLiteralNameOfPropertyDeclarationOrIndexAccess:()=>IX,isLiteralTypeLiteral:()=>_d,isLiteralTypeNode:()=>dk,isLocalName:()=>DM,isLogicalOperator:()=>Ib,isLogicalOrCoalescingAssignmentExpression:()=>Rb,isLogicalOrCoalescingAssignmentOperator:()=>Lb,isLogicalOrCoalescingBinaryExpression:()=>Bb,isLogicalOrCoalescingBinaryOperator:()=>zb,isMappedTypeNode:()=>uk,isMemberName:()=>Bl,isMetaProperty:()=>Kk,isMethodDeclaration:()=>LO,isMethodOrAccessor:()=>Uu,isMethodSignature:()=>IO,isMinusToken:()=>cO,isMissingDeclaration:()=>GA,isMissingPackageJsonInfo:()=>qL,isModifier:()=>Du,isModifierKind:()=>wu,isModifierLike:()=>Wu,isModuleAugmentationExternal:()=>$p,isModuleBlock:()=>TA,isModuleBody:()=>kd,isModuleDeclaration:()=>wA,isModuleExportName:()=>WA,isModuleExportsAccessExpression:()=>Ng,isModuleIdentifier:()=>Mg,isModuleName:()=>dN,isModuleOrEnumDeclaration:()=>Nd,isModuleReference:()=>Gd,isModuleSpecifierLike:()=>uQ,isModuleWithStringLiteralName:()=>Gp,isNameOfFunctionDeclaration:()=>FX,isNameOfModuleDeclaration:()=>PX,isNamedDeclaration:()=>Xc,isNamedEvaluation:()=>jv,isNamedEvaluationSource:()=>Av,isNamedExportBindings:()=>eu,isNamedExports:()=>HA,isNamedImportBindings:()=>Md,isNamedImports:()=>RA,isNamedImportsOrExports:()=>_S,isNamedTupleMember:()=>$O,isNamespaceBody:()=>Ad,isNamespaceExport:()=>LA,isNamespaceExportDeclaration:()=>DA,isNamespaceImport:()=>IA,isNamespaceReexportDeclaration:()=>eg,isNewExpression:()=>Ck,isNewExpressionTarget:()=>xX,isNewScopeNode:()=>lE,isNoSubstitutionTemplateLiteral:()=>tO,isNodeArray:()=>au,isNodeArrayMultiLine:()=>Fx,isNodeDescendantOf:()=>U_,isNodeKind:()=>nu,isNodeLikeSystem:()=>Dn,isNodeModulesDirectory:()=>Io,isNodeWithPossibleHoistedDeclaration:()=>P_,isNonContextualKeyword:()=>uv,isNonGlobalAmbientModule:()=>Kp,isNonNullAccess:()=>AT,isNonNullChain:()=>Ql,isNonNullExpression:()=>Gk,isNonStaticMethodOrAccessorWithPrivateName:()=>DV,isNotEmittedStatement:()=>KA,isNullishCoalesce:()=>Yl,isNumber:()=>vt,isNumericLiteral:()=>XD,isNumericLiteralName:()=>yT,isObjectBindingElementWithoutPropertyName:()=>dQ,isObjectBindingOrAssignmentElement:()=>rd,isObjectBindingOrAssignmentPattern:()=>nd,isObjectBindingPattern:()=>hk,isObjectLiteralElement:()=>lf,isObjectLiteralElementLike:()=>qu,isObjectLiteralExpression:()=>yk,isObjectLiteralMethod:()=>_h,isObjectLiteralOrClassExpressionMethodOrAccessor:()=>vh,isObjectTypeDeclaration:()=>pS,isOmittedExpression:()=>Vk,isOptionalChain:()=>Gl,isOptionalChainRoot:()=>Kl,isOptionalDeclaration:()=>kT,isOptionalJSDocPropertyLikeTag:()=>TT,isOptionalTypeNode:()=>ek,isOuterExpression:()=>IM,isOutermostOptionalChain:()=>Jl,isOverrideModifier:()=>wO,isPackageJsonInfo:()=>KL,isPackedArrayLiteral:()=>uT,isParameter:()=>MO,isParameterPropertyDeclaration:()=>Dc,isParameterPropertyModifier:()=>Tu,isParenthesizedExpression:()=>Ek,isParenthesizedTypeNode:()=>ok,isParseTreeNode:()=>zc,isPartOfParameterDeclaration:()=>Nv,isPartOfTypeNode:()=>oh,isPartOfTypeOnlyImportOrExportDeclaration:()=>gu,isPartOfTypeQuery:()=>$h,isPartiallyEmittedExpression:()=>Jk,isPatternMatch:()=>gn,isPinnedComment:()=>yp,isPlainJsFile:()=>tp,isPlusToken:()=>sO,isPossiblyTypeArgumentPosition:()=>_Z,isPostfixUnaryExpression:()=>Pk,isPrefixUnaryExpression:()=>Nk,isPrimitiveLiteralValue:()=>$T,isPrivateIdentifier:()=>hO,isPrivateIdentifierClassElementDeclaration:()=>Su,isPrivateIdentifierPropertyAccessExpression:()=>Cu,isPrivateIdentifierSymbol:()=>Dv,isProgramUptoDate:()=>nG,isPrologueDirective:()=>Xm,isPropertyAccessChain:()=>Hl,isPropertyAccessEntityNameExpression:()=>Xb,isPropertyAccessExpression:()=>bk,isPropertyAccessOrQualifiedName:()=>sd,isPropertyAccessOrQualifiedNameOrImportTypeNode:()=>od,isPropertyAssignment:()=>dj,isPropertyDeclaration:()=>FO,isPropertyName:()=>ku,isPropertyNameLiteral:()=>Sv,isPropertySignature:()=>PO,isPrototypeAccess:()=>Qb,isPrototypePropertyAssignment:()=>Jg,isPunctuation:()=>sv,isPushOrUnshiftIdentifier:()=>Mv,isQualifiedName:()=>kO,isQuestionDotToken:()=>pO,isQuestionOrExclamationToken:()=>sN,isQuestionOrPlusOrMinusToken:()=>uN,isQuestionToken:()=>dO,isReadonlyKeyword:()=>xO,isReadonlyKeywordOrPlusOrMinusToken:()=>lN,isRecognizedTripleSlashComment:()=>vp,isReferenceFileLocation:()=>eG,isReferencedFile:()=>$W,isRegularExpressionLiteral:()=>eO,isRequireCall:()=>fg,isRequireVariableStatement:()=>_g,isRestParameter:()=>gf,isRestTypeNode:()=>tk,isReturnStatement:()=>uA,isReturnStatementWithFixablePromiseHandler:()=>Y1,isRightSideOfAccessExpression:()=>ex,isRightSideOfInstanceofExpression:()=>rx,isRightSideOfPropertyAccess:()=>MX,isRightSideOfQualifiedName:()=>iie,isRightSideOfQualifiedNameOrPropertyAccess:()=>$b,isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName:()=>tx,isRootedDiskPath:()=>Va,isSameEntityName:()=>kg,isSatisfiesExpression:()=>Wk,isSemicolonClassElement:()=>Zk,isSetAccessor:()=>nf,isSetAccessorDeclaration:()=>VO,isShiftOperatorOrHigher:()=>mN,isShorthandAmbientModuleSymbol:()=>Jp,isShorthandPropertyAssignment:()=>fj,isSideEffectImport:()=>nE,isSignedNumericLiteral:()=>vv,isSimpleCopiableExpression:()=>gV,isSimpleInlineableExpression:()=>_V,isSimpleParameterList:()=>IV,isSingleOrDoubleQuote:()=>vg,isSolutionConfig:()=>II,isSourceElement:()=>qT,isSourceFile:()=>hj,isSourceFileFromLibrary:()=>n1,isSourceFileJS:()=>og,isSourceFileNotJson:()=>lg,isSourceMapping:()=>ZB,isSpecialPropertyDeclaration:()=>Yg,isSpreadAssignment:()=>pj,isSpreadElement:()=>zk,isStatement:()=>Hd,isStatementButNotDeclaration:()=>Vd,isStatementOrBlock:()=>Wd,isStatementWithLocals:()=>np,isStatic:()=>pb,isStaticModifier:()=>SO,isString:()=>_t,isStringANonContextualKeyword:()=>dv,isStringAndEmptyAnonymousObjectIntersection:()=>DZ,isStringDoubleQuoted:()=>yg,isStringLiteral:()=>QD,isStringLiteralLike:()=>pf,isStringLiteralOrJsxExpression:()=>Yd,isStringLiteralOrTemplate:()=>_$,isStringOrNumericLiteralLike:()=>_v,isStringOrRegularExpressionOrTemplateLiteral:()=>EZ,isStringTextContainingNode:()=>_u,isSuperCall:()=>Km,isSuperKeyword:()=>EO,isSuperProperty:()=>Lh,isSupportedSourceFileName:()=>yw,isSwitchStatement:()=>fA,isSyntaxList:()=>iM,isSyntheticExpression:()=>qk,isSyntheticReference:()=>qA,isTagName:()=>jX,isTaggedTemplateExpression:()=>wk,isTaggedTemplateTag:()=>Qre,isTemplateExpression:()=>Lk,isTemplateHead:()=>nO,isTemplateLiteral:()=>dd,isTemplateLiteralKind:()=>lu,isTemplateLiteralToken:()=>uu,isTemplateLiteralTypeNode:()=>mk,isTemplateLiteralTypeSpan:()=>pk,isTemplateMiddle:()=>rO,isTemplateMiddleOrTemplateTail:()=>du,isTemplateSpan:()=>Xk,isTemplateTail:()=>iO,isTextWhiteSpaceLike:()=>xQ,isThis:()=>zX,isThisContainerOrFunctionBlock:()=>Nh,isThisIdentifier:()=>Gy,isThisInTypeQuery:()=>qy,isThisInitializedDeclaration:()=>zh,isThisInitializedObjectBindingExpression:()=>Bh,isThisProperty:()=>Rh,isThisTypeNode:()=>sk,isThisTypeParameter:()=>xT,isThisTypePredicate:()=>bh,isThrowStatement:()=>mA,isToken:()=>iu,isTokenKind:()=>ru,isTraceEnabled:()=>yL,isTransientSymbol:()=>Ef,isTrivia:()=>pv,isTryStatement:()=>hA,isTupleTypeNode:()=>QO,isTypeAlias:()=>l_,isTypeAliasDeclaration:()=>SA,isTypeAssertionExpression:()=>Tk,isTypeDeclaration:()=>CT,isTypeElement:()=>Gu,isTypeKeyword:()=>UZ,isTypeKeywordTokenOrIdentifier:()=>WZ,isTypeLiteralNode:()=>XO,isTypeNode:()=>Ju,isTypeNodeKind:()=>mS,isTypeOfExpression:()=>Ak,isTypeOnlyExportDeclaration:()=>mu,isTypeOnlyImportDeclaration:()=>pu,isTypeOnlyImportOrExportDeclaration:()=>hu,isTypeOperatorNode:()=>ck,isTypeParameterDeclaration:()=>jO,isTypePredicateNode:()=>GO,isTypeQueryNode:()=>YO,isTypeReferenceNode:()=>KO,isTypeReferenceType:()=>uf,isTypeUsableAsPropertyName:()=>BT,isUMDExportSymbol:()=>lS,isUnaryExpression:()=>md,isUnaryExpressionWithWrite:()=>gd,isUnicodeIdentifierStart:()=>Qo,isUnionTypeNode:()=>nk,isUrl:()=>Ba,isValidBigIntString:()=>Qw,isValidESSymbolDeclaration:()=>oee,isValidTypeOnlyAliasUseSite:()=>$w,isValueSignatureDeclaration:()=>F_,isVarAwaitUsing:()=>Vm,isVarConst:()=>Um,isVarConstLike:()=>Wm,isVarUsing:()=>Hm,isVariableDeclaration:()=>_A,isVariableDeclarationInVariableStatement:()=>fh,isVariableDeclarationInitializedToBareOrAccessedRequire:()=>mg,isVariableDeclarationInitializedToRequire:()=>pg,isVariableDeclarationList:()=>vA,isVariableLike:()=>dh,isVariableStatement:()=>$k,isVoidExpression:()=>jk,isWatchSet:()=>Kx,isWhileStatement:()=>iA,isWhiteSpaceLike:()=>hs,isWhiteSpaceSingleLine:()=>gs,isWithStatement:()=>dA,isWriteAccess:()=>$x,isWriteOnlyAccess:()=>Qx,isYieldExpression:()=>Rk,jsxModeNeedsExplicitImport:()=>t1,keywordPart:()=>kQ,last:()=>ze,lastOrUndefined:()=>Re,length:()=>d,libMap:()=>JP,libs:()=>qP,lineBreakPart:()=>VQ,loadModuleFromGlobalCache:()=>fz,loadWithModeAwareCache:()=>KW,makeIdentifierFromModuleName:()=>Vp,makeImport:()=>nQ,makeStringLiteral:()=>rQ,mangleScopedPackageName:()=>az,map:()=>k,mapAllOrFail:()=>P,mapDefined:()=>F,mapDefinedIterator:()=>ie,mapEntries:()=>le,mapIterator:()=>te,mapOneOrMany:()=>H$,mapToDisplayParts:()=>HQ,matchFiles:()=>ZC,matchPatternOrExact:()=>Rw,matchedText:()=>fn,matchesExclude:()=>uL,matchesExcludeWorker:()=>dL,maxBy:()=>zt,maybeBind:()=>R,maybeSetLocalizedDiagnosticMessages:()=>kS,memoize:()=>At,memoizeOne:()=>jt,min:()=>Bt,minAndMax:()=>Iee,missingFileModifiedTime:()=>sa,modifierToFlag:()=>Pb,modifiersToFlags:()=>Nb,moduleExportNameIsDefault:()=>kp,moduleExportNameTextEscaped:()=>Op,moduleExportNameTextUnescaped:()=>Dp,moduleOptionDeclaration:()=>QP,moduleResolutionIsEqualTo:()=>Vf,moduleResolutionNameAndModeGetter:()=>VW,moduleResolutionOptionDeclarations:()=>iF,moduleResolutionSupportsPackageJsonExportsAndImports:()=>CC,moduleResolutionUsesNodeModules:()=>tQ,moduleSpecifierToValidIdentifier:()=>q$,moduleSpecifiers:()=>Az,moduleSymbolToValidIdentifier:()=>K$,moveEmitHelpers:()=>uD,moveRangeEnd:()=>Cx,moveRangePastDecorators:()=>Tx,moveRangePastModifiers:()=>Ex,moveRangePos:()=>wx,moveSyntheticComments:()=>rD,mutateMap:()=>aS,mutateMapSkippingNewValues:()=>iS,needsParentheses:()=>p$,needsScopeMarker:()=>Cd,newCaseClauseTracker:()=>r1,newPrivateEnvironment:()=>MV,noEmitNotification:()=>gU,noEmitSubstitution:()=>hU,noTransformers:()=>lU,noTruncationMaximumTruncationLength:()=>Sf,nodeCanBeDecorated:()=>Uh,nodeCoreModules:()=>oE,nodeHasName:()=>Jc,nodeIsDecorated:()=>Wh,nodeIsMissing:()=>sp,nodeIsPresent:()=>cp,nodeIsSynthesized:()=>Iv,nodeModuleNameResolver:()=>gR,nodeModulesPathPart:()=>xR,nodeNextJsonConfigResolver:()=>_R,nodeOrChildIsDecorated:()=>Gh,nodeOverlapsWithStartEnd:()=>GX,nodePosToString:()=>ip,nodeSeenTracker:()=>GZ,nodeStartsNewLexicalEnvironment:()=>Fv,noop:()=>xt,noopFileWatcher:()=>tq,normalizePath:()=>mo,normalizeSlashes:()=>so,normalizeSpans:()=>vc,not:()=>yn,notImplemented:()=>kt,notImplementedResolver:()=>WU,nullNodeConverters:()=>mE,nullParenthesizerRules:()=>fE,nullTransformationContext:()=>vU,objectAllocator:()=>wS,operatorPart:()=>jQ,optionDeclarations:()=>eF,optionMapToObject:()=>lI,optionsAffectingProgramStructure:()=>oF,optionsForBuild:()=>dF,optionsForWatch:()=>YP,optionsHaveChanges:()=>Nf,or:()=>vn,orderedRemoveItem:()=>an,orderedRemoveItemAt:()=>on,packageIdToPackageName:()=>qf,packageIdToString:()=>Jf,parameterIsThisKeyword:()=>Wy,parameterNamePart:()=>MQ,parseBaseNodeFactory:()=>UN,parseBigInt:()=>Xw,parseBuildCommand:()=>NF,parseCommandLine:()=>OF,parseCommandLineWorker:()=>TF,parseConfigFileTextToJson:()=>LF,parseConfigFileWithSystem:()=>RK,parseConfigHostFromCompilerHostLike:()=>pG,parseCustomTypeOption:()=>xF,parseIsolatedEntityName:()=>vP,parseIsolatedJSDocComment:()=>SP,parseJSDocTypeExpressionForTests:()=>CP,parseJsonConfigFileContent:()=>bI,parseJsonSourceFileConfigFileContent:()=>xI,parseJsonText:()=>yP,parseListTypeOption:()=>SF,parseNodeFactory:()=>WN,parseNodeModuleFromPath:()=>CR,parsePackageName:()=>BR,parsePseudoBigInt:()=>Jw,parseValidBigInt:()=>Zw,pasteEdits:()=>$7,patchWriteFileEnsuringDirectory:()=>Ma,pathContainsNodeModules:()=>SR,pathIsAbsolute:()=>Ha,pathIsBareSpecifier:()=>Wa,pathIsRelative:()=>Ua,patternText:()=>dn,performIncrementalCompilation:()=>mq,performance:()=>lr,positionBelongsToNode:()=>qX,positionIsASICandidate:()=>w$,positionIsSynthesized:()=>Aw,positionsAreOnSameLine:()=>Ix,preProcessFile:()=>Bae,probablyUsesSemicolons:()=>T$,processCommentPragmas:()=>PP,processPragmasIntoFields:()=>FP,processTaggedTemplateExpression:()=>mH,programContainsEsModules:()=>ZZ,programContainsModules:()=>XZ,projectReferenceIsEqualTo:()=>Bf,propertyNamePart:()=>NQ,pseudoBigIntToString:()=>Yw,punctuationPart:()=>AQ,pushIfUnique:()=>De,quote:()=>h$,quotePreferenceFromString:()=>aQ,rangeContainsPosition:()=>VX,rangeContainsPositionExclusive:()=>HX,rangeContainsRange:()=>Bx,rangeContainsRangeExclusive:()=>sie,rangeContainsStartEnd:()=>UX,rangeEndIsOnSameLineAsRangeStart:()=>Mx,rangeEndPositionsAreOnSameLine:()=>Ax,rangeEquals:()=>Me,rangeIsOnSingleLine:()=>Ox,rangeOfNode:()=>Vw,rangeOfTypeParameters:()=>Hw,rangeOverlapsWithStartEnd:()=>WX,rangeStartIsOnSameLineAsRangeEnd:()=>jx,rangeStartPositionsAreOnSameLine:()=>kx,readBuilderProgram:()=>hq,readConfigFile:()=>IF,readJson:()=>gx,readJsonConfigFile:()=>RF,readJsonOrUndefined:()=>hx,reduceEachLeadingCommentRange:()=>Ps,reduceEachTrailingCommentRange:()=>Fs,reduceLeft:()=>Ke,reduceLeftIterator:()=>g,reducePathComponents:()=>co,refactor:()=>k0,regExpEscape:()=>Aee,regularExpressionFlagToCharacterCode:()=>as,relativeComplement:()=>Ce,removeAllComments:()=>RE,removeEmitHelper:()=>cD,removeExtension:()=>Tw,removeFileExtension:()=>Cw,removeIgnoredPath:()=>gK,removeMinAndVersionNumbers:()=>rn,removePrefix:()=>mn,removeSuffix:()=>tn,removeTrailingDirectorySeparator:()=>vo,repeatString:()=>qZ,replaceElement:()=>Ue,replaceFirstStar:()=>GT,resolutionExtensionIsTSOrJson:()=>Mw,resolveConfigFileProjectName:()=>xq,resolveJSModule:()=>uR,resolveLibrary:()=>oR,resolveModuleName:()=>cR,resolveModuleNameFromCache:()=>sR,resolvePackageNameToPackageJson:()=>WL,resolvePath:()=>uo,resolveProjectReferencePath:()=>mG,resolveTripleslashReference:()=>uW,resolveTypeReferenceDirective:()=>VL,resolvingEmptyArray:()=>yf,returnFalse:()=>St,returnNoopFileWatcher:()=>nq,returnTrue:()=>Ct,returnUndefined:()=>wt,returnsPromise:()=>J1,rewriteModuleSpecifier:()=>LV,sameFlatMap:()=>N,sameMap:()=>ne,sameMapping:()=>XB,scanTokenAtPosition:()=>Pm,scanner:()=>gX,semanticDiagnosticsOptionDeclarations:()=>tF,serializeCompilerOptions:()=>pI,server:()=>_je,servicesVersion:()=>Lue,setCommentRange:()=>XE,setConfigFileInOptions:()=>SI,setConstantValue:()=>aD,setEmitFlags:()=>zE,setGetSourceFileAsHashVersioned:()=>cq,setIdentifierAutoGenerate:()=>vD,setIdentifierGeneratedImportReference:()=>bD,setIdentifierTypeArguments:()=>gD,setInternalEmitFlags:()=>VE,setLocalizedDiagnosticMessages:()=>OS,setNodeChildren:()=>sM,setNodeFlags:()=>oT,setObjectAllocator:()=>TS,setOriginalNode:()=>NE,setParent:()=>sT,setParentRecursive:()=>cT,setPrivateIdentifier:()=>PV,setSnippetElement:()=>fD,setSourceMapRange:()=>WE,setStackTraceLimit:()=>ia,setStartsOnNewLine:()=>JE,setSyntheticLeadingComments:()=>QE,setSyntheticTrailingComments:()=>tD,setSys:()=>Pa,setSysLog:()=>wa,setTextRange:()=>Z,setTextRangeEnd:()=>rT,setTextRangePos:()=>nT,setTextRangePosEnd:()=>iT,setTextRangePosWidth:()=>aT,setTokenSourceMapRange:()=>KE,setTypeNode:()=>mD,setUILocale:()=>Yt,setValueDeclaration:()=>Xg,shouldAllowImportingTsExtension:()=>dz,shouldPreserveConstEnums:()=>mC,shouldRewriteModuleSpecifier:()=>t_,shouldUseUriStyleNodeCoreModules:()=>Z$,showModuleSpecifier:()=>uS,signatureHasRestParameter:()=>DB,signatureToDisplayParts:()=>GQ,single:()=>Ve,singleElementArray:()=>xn,singleIterator:()=>se,singleOrMany:()=>He,singleOrUndefined:()=>Be,skipAlias:()=>Xx,skipConstraint:()=>JZ,skipOuterExpressions:()=>LM,skipParentheses:()=>V_,skipPartiallyEmittedExpressions:()=>Zl,skipTrivia:()=>ws,skipTypeChecking:()=>Uw,skipTypeCheckingIgnoringNoCheck:()=>Ww,skipTypeParentheses:()=>B_,skipWhile:()=>En,sliceAfter:()=>zw,some:()=>I,sortAndDeduplicate:()=>be,sortAndDeduplicateDiagnostics:()=>ec,sourceFileAffectingCompilerOptions:()=>aF,sourceFileMayBeEmitted:()=>My,sourceMapCommentRegExp:()=>UB,sourceMapCommentRegExpDontCareLineStart:()=>HB,spacePart:()=>OQ,spanMap:()=>ce,startEndContainsRange:()=>Vx,startEndOverlapsWithStartEnd:()=>KX,startOnNewLine:()=>zM,startTracing:()=>Nr,startsWith:()=>V,startsWithDirectory:()=>ko,startsWithUnderscore:()=>Y$,startsWithUseStrict:()=>jM,stringContainsAt:()=>J$,stringToToken:()=>rs,stripQuotes:()=>dy,supportedDeclarationExtensions:()=>cw,supportedJSExtensionsFlat:()=>aw,supportedLocaleDirectories:()=>Ic,supportedTSExtensionsFlat:()=>rw,supportedTSImplementationExtensions:()=>lw,suppressLeadingAndTrailingTrivia:()=>n$,suppressLeadingTrivia:()=>r$,suppressTrailingTrivia:()=>i$,symbolEscapedNameNoDefault:()=>lQ,symbolName:()=>Gc,symbolNameNoDefault:()=>cQ,symbolToDisplayParts:()=>WQ,sys:()=>Na,sysLog:()=>Ca,tagNamesAreEquivalent:()=>HP,takeWhile:()=>Tn,targetOptionDeclaration:()=>ZP,targetToLibMap:()=>tc,testFormatSettings:()=>Gre,textChangeRangeIsUnchanged:()=>Sc,textChangeRangeNewSpan:()=>xc,textChanges:()=>y7,textOrKeywordPart:()=>PQ,textPart:()=>FQ,textRangeContainsPositionInclusive:()=>oc,textRangeContainsTextSpan:()=>lc,textRangeIntersectsWithTextSpan:()=>gc,textSpanContainsPosition:()=>ac,textSpanContainsTextRange:()=>cc,textSpanContainsTextSpan:()=>sc,textSpanEnd:()=>rc,textSpanIntersection:()=>_c,textSpanIntersectsWith:()=>pc,textSpanIntersectsWithPosition:()=>hc,textSpanIntersectsWithTextSpan:()=>fc,textSpanIsEmpty:()=>ic,textSpanOverlap:()=>dc,textSpanOverlapsWith:()=>uc,textSpansEqual:()=>_Q,textToKeywordObj:()=>zo,timestamp:()=>cr,toArray:()=>gt,toBuilderFileEmit:()=>sK,toBuilderStateFileInfoForMultiEmit:()=>oK,toEditorSettings:()=>p4,toFileNameLowerCase:()=>Ot,toPath:()=>_o,toProgramEmitPending:()=>cK,toSorted:()=>Ae,tokenIsIdentifierOrKeyword:()=>Lo,tokenIsIdentifierOrKeywordOrGreaterThan:()=>Ro,tokenToString:()=>ns,trace:()=>vL,tracing:()=>jr,tracingEnabled:()=>Mr,transferSourceFileChildren:()=>lM,transform:()=>ude,transformClassFields:()=>vH,transformDeclarations:()=>iU,transformECMAScriptModule:()=>YH,transformES2015:()=>UH,transformES2016:()=>VH,transformES2017:()=>DH,transformES2018:()=>kH,transformES2019:()=>AH,transformES2020:()=>jH,transformES2021:()=>MH,transformESDecorators:()=>EH,transformESNext:()=>NH,transformGenerators:()=>GH,transformImpliedNodeFormatDependentModule:()=>XH,transformJsx:()=>BH,transformLegacyDecorators:()=>TH,transformModule:()=>KH,transformNamedEvaluation:()=>fH,transformNodes:()=>_U,transformSystemModule:()=>JH,transformTypeScript:()=>_H,transpile:()=>soe,transpileDeclaration:()=>roe,transpileModule:()=>Q1,transpileOptionValueCompilerOptions:()=>sF,tryAddToSet:()=>oe,tryAndIgnoreErrors:()=>A$,tryCast:()=>yt,tryDirectoryExists:()=>k$,tryExtractTSExtension:()=>cx,tryFileExists:()=>O$,tryGetClassExtendingExpressionWithTypeArguments:()=>Hb,tryGetClassImplementingOrExtendingExpressionWithTypeArguments:()=>Ub,tryGetDirectories:()=>E$,tryGetExtensionFromPath:()=>Fw,tryGetImportFromModuleSpecifier:()=>e_,tryGetJSDocSatisfiesTypeNode:()=>NT,tryGetModuleNameFromFile:()=>qM,tryGetModuleSpecifierFromDeclaration:()=>Qg,tryGetNativePerformanceHooks:()=>sr,tryGetPropertyAccessOrIdentifierToString:()=>Zb,tryGetPropertyNameOfBindingOrAssignmentElement:()=>$M,tryGetSourceMappingURL:()=>KB,tryGetTextOfPropertyName:()=>bm,tryParseJson:()=>_x,tryParsePattern:()=>Dw,tryParsePatterns:()=>kw,tryParseRawSourceMap:()=>JB,tryReadDirectory:()=>D$,tryReadFile:()=>zF,tryRemoveDirectoryPrefix:()=>IC,tryRemoveExtension:()=>ww,tryRemovePrefix:()=>hn,tryRemoveSuffix:()=>nn,tscBuildOption:()=>uF,typeAcquisitionDeclarations:()=>pF,typeAliasNamePart:()=>IQ,typeDirectiveIsEqualTo:()=>Yf,typeKeywords:()=>HZ,typeParameterNamePart:()=>LQ,typeToDisplayParts:()=>UQ,unchangedPollThresholds:()=>fa,unchangedTextChangeRange:()=>wc,unescapeLeadingUnderscores:()=>Hc,unmangleScopedPackageName:()=>sz,unorderedRemoveItem:()=>cn,unprefixedNodeCoreModules:()=>iE,unreachableCodeIsError:()=>xC,unsetNodeChildren:()=>cM,unusedLabelIsError:()=>SC,unwrapInnermostStatementOfLabel:()=>hh,unwrapParenthesizedExpression:()=>eE,updateErrorForNoInputFiles:()=>RI,updateLanguageServiceSourceFile:()=>v4,updateMissingFilePathsWatch:()=>tW,updateResolutionField:()=>kL,updateSharedExtendedConfigFileWatcher:()=>QU,updateSourceFile:()=>xP,updateWatchingWildcardDirectories:()=>nW,usingSingleLineStringWriter:()=>Rf,utf16EncodeAsString:()=>Js,validateLocaleAndSetLanguage:()=>Lc,version:()=>s,versionMajorMinor:()=>o,visitArray:()=>kB,visitCommaListElements:()=>RB,visitEachChild:()=>zB,visitFunctionBody:()=>IB,visitIterationBody:()=>LB,visitLexicalEnvironment:()=>jB,visitNode:()=>$,visitNodes:()=>OB,visitParameterList:()=>MB,walkUpBindingElementsAndPatterns:()=>Ac,walkUpOuterExpressions:()=>RM,walkUpParenthesizedExpressions:()=>R_,walkUpParenthesizedTypes:()=>L_,walkUpParenthesizedTypesAndGetParentAndChild:()=>z_,whitespaceOrMapCommentRegExp:()=>WB,writeCommentRange:()=>sb,writeFile:()=>Fy,writeFileEnsuringDirectories:()=>Ly,zipWith:()=>_}),e.exports=i(a);var o=`5.7`,s=`5.7.3`,c=(e=>(e[e.LessThan=-1]=`LessThan`,e[e.EqualTo=0]=`EqualTo`,e[e.GreaterThan=1]=`GreaterThan`,e))(c||{}),l=[],u=new Map;function d(e){return e===void 0?0:e.length}function f(e,t){if(e!==void 0)for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r)return r}}function p(e,t){if(e!==void 0)for(let n=e.length-1;n>=0;n--){let r=t(e[n],n);if(r)return r}}function m(e,t){if(e!==void 0)for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!==void 0)return r}}function h(e,t){for(let n of e){let e=t(n);if(e!==void 0)return e}}function g(e,t,n){let r=n;if(e){let n=0;for(let i of e)r=t(r,i,n),n++}return r}function _(e,t,n){let r=[];H.assertEqual(e.length,t.length);for(let i=0;i<e.length;i++)r.push(n(e[i],t[i],i));return r}function v(e,t){if(e.length<=1)return e;let n=[];for(let r=0,i=e.length;r<i;r++)r!==0&&n.push(t),n.push(e[r]);return n}function y(e,t){if(e!==void 0){for(let n=0;n<e.length;n++)if(!t(e[n],n))return!1}return!0}function b(e,t,n){if(e!==void 0)for(let r=n??0;r<e.length;r++){let n=e[r];if(t(n,r))return n}}function x(e,t,n){if(e!==void 0)for(let r=n??e.length-1;r>=0;r--){let n=e[r];if(t(n,r))return n}}function S(e,t,n){if(e===void 0)return-1;for(let r=n??0;r<e.length;r++)if(t(e[r],r))return r;return-1}function C(e,t,n){if(e===void 0)return-1;for(let r=n??e.length-1;r>=0;r--)if(t(e[r],r))return r;return-1}function w(e,t,n=Nt){if(e!==void 0){for(let r=0;r<e.length;r++)if(n(e[r],t))return!0}return!1}function T(e,t,n){for(let r=n??0;r<e.length;r++)if(w(t,e.charCodeAt(r)))return r;return-1}function E(e,t){let n=0;if(e!==void 0)for(let r=0;r<e.length;r++){let i=e[r];t(i,r)&&n++}return n}function D(e,t){if(e!==void 0){let n=e.length,r=0;for(;r<n&&t(e[r]);)r++;if(r<n){let i=e.slice(0,r);for(r++;r<n;){let n=e[r];t(n)&&i.push(n),r++}return i}}return e}function O(e,t){let n=0;for(let r=0;r<e.length;r++)t(e[r],r,e)&&(e[n]=e[r],n++);e.length=n}function ee(e){e.length=0}function k(e,t){let n;if(e!==void 0){n=[];for(let r=0;r<e.length;r++)n.push(t(e[r],r))}return n}function*te(e,t){for(let n of e)yield t(n)}function ne(e,t){if(e!==void 0)for(let n=0;n<e.length;n++){let r=e[n],i=t(r,n);if(r!==i){let r=e.slice(0,n);for(r.push(i),n++;n<e.length;n++)r.push(t(e[n],n));return r}}return e}function re(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&(ht(r)?L(t,r):t.push(r))}return t}function A(e,t){let n;if(e!==void 0)for(let r=0;r<e.length;r++){let i=t(e[r],r);i&&(n=ht(i)?L(n,i):we(n,i))}return n??l}function j(e,t){let n=[];if(e!==void 0)for(let r=0;r<e.length;r++){let i=t(e[r],r);i&&(ht(i)?L(n,i):n.push(i))}return n}function*M(e,t){for(let n of e){let e=t(n);e&&(yield*e)}}function N(e,t){let n;if(e!==void 0)for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r);(n||i!==a||ht(a))&&(n||=e.slice(0,r),ht(a)?L(n,a):n.push(a))}return n??e}function P(e,t){let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r);if(i===void 0)return;n.push(i)}return n}function F(e,t){let n=[];if(e!==void 0)for(let r=0;r<e.length;r++){let i=t(e[r],r);i!==void 0&&n.push(i)}return n}function*ie(e,t){for(let n of e){let e=t(n);e!==void 0&&(yield e)}}function ae(e,t,n){if(e.has(t))return e.get(t);let r=n();return e.set(t,r),r}function oe(e,t){return e.has(t)?!1:(e.add(t),!0)}function*se(e){yield e}function ce(e,t,n){let r;if(e!==void 0){r=[];let i=e.length,a,o,s=0,c=0;for(;s<i;){for(;c<i;){let n=e[c];if(o=t(n,c),c===0)a=o;else if(o!==a)break;c++}if(s<c){let t=n(e.slice(s,c),a,s,c);t&&r.push(t),s=c}a=o,c++}}return r}function le(e,t){if(e===void 0)return;let n=new Map;return e.forEach((e,r)=>{let[i,a]=t(r,e);n.set(i,a)}),n}function I(e,t){if(e!==void 0)if(t!==void 0){for(let n=0;n<e.length;n++)if(t(e[n]))return!0}else return e.length>0;return!1}function ue(e,t,n){let r;for(let i=0;i<e.length;i++)t(e[i])?r=r===void 0?i:r:r!==void 0&&(n(r,i),r=void 0);r!==void 0&&n(r,e.length)}function de(e,t){return t===void 0||t.length===0?e:e===void 0||e.length===0?t:[...e,...t]}function fe(e,t){return t}function pe(e){return e.map(fe)}function me(e,t,n){let r=pe(e);ke(e,r,n);let i=e[r[0]],a=[r[0]];for(let n=1;n<r.length;n++){let o=r[n],s=e[o];t(i,s)||(a.push(o),i=s)}return a.sort(),a.map(t=>e[t])}function he(e,t){let n=[];for(let r=0;r<e.length;r++)De(n,e[r],t);return n}function ge(e,t,n){return e.length===0?[]:e.length===1?e.slice():n?me(e,t,n):he(e,t)}function _e(e,t){if(e.length===0)return l;let n=e[0],r=[n];for(let i=1;i<e.length;i++){let a=e[i];switch(t(a,n)){case!0:case 0:continue;case-1:return H.fail(`Array is unsorted.`)}r.push(n=a)}return r}function ve(){return[]}function ye(e,t,n,r,i){if(e.length===0)return e.push(t),!0;let a=We(e,t,Tt,n);if(a<0){if(r&&!i){let n=~a;if(n>0&&r(t,e[n-1]))return!1;if(n<e.length&&r(t,e[n]))return e.splice(n,1,t),!0}return e.splice(~a,0,t),!0}return i?(e.splice(a,0,t),!0):!1}function be(e,t,n){return _e(Ae(e,t),n??t??Ut)}function xe(e,t,n=Nt){if(e===void 0||t===void 0)return e===t;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r],r))return!1;return!0}function Se(e){let t;if(e!==void 0)for(let n=0;n<e.length;n++){let r=e[n];(t??!r)&&(t??=e.slice(0,n),r&&t.push(r))}return t??e}function Ce(e,t,n){if(!t||!e||t.length===0||e.length===0)return t;let r=[];loopB:for(let i=0,a=0;a<t.length;a++){a>0&&H.assertGreaterThanOrEqual(n(t[a],t[a-1]),0);loopA:for(let o=i;i<e.length;i++)switch(i>o&&H.assertGreaterThanOrEqual(n(e[i],e[i-1]),0),n(t[a],e[i])){case-1:r.push(t[a]);continue loopB;case 0:continue loopB;case 1:continue loopA}}return r}function we(e,t){return t===void 0?e:e===void 0?[t]:(e.push(t),e)}function Te(e,t){return e===void 0?t:t===void 0?e:ht(e)?ht(t)?de(e,t):we(e,t):ht(t)?we(t,e):[e,t]}function Ee(e,t){return t<0?e.length+t:t}function L(e,t,n,r){if(t===void 0||t.length===0)return e;if(e===void 0)return t.slice(n,r);n=n===void 0?0:Ee(t,n),r=r===void 0?t.length:Ee(t,r);for(let i=n;i<r&&i<t.length;i++)t[i]!==void 0&&e.push(t[i]);return e}function De(e,t,n){return w(e,t,n)?!1:(e.push(t),!0)}function Oe(e,t,n){return e===void 0?[t]:(De(e,t,n),e)}function ke(e,t,n){t.sort((t,r)=>n(e[t],e[r])||Lt(t,r))}function Ae(e,t){return e.length===0?l:e.slice().sort(t)}function*je(e){for(let t=e.length-1;t>=0;t--)yield e[t]}function Me(e,t,n,r){for(;n<r;){if(e[n]!==t[n])return!1;n++}return!0}var Ne=Array.prototype.at?(e,t)=>e?.at(t):(e,t)=>{if(e!==void 0&&(t=Ee(e,t),t<e.length))return e[t]};function Pe(e){return e===void 0||e.length===0?void 0:e[0]}function Fe(e){if(e!==void 0)for(let t of e)return t}function Ie(e){return H.assert(e.length!==0),e[0]}function Le(e){for(let t of e)return t;H.fail(`iterator is empty`)}function Re(e){return e===void 0||e.length===0?void 0:e[e.length-1]}function ze(e){return H.assert(e.length!==0),e[e.length-1]}function Be(e){return e!==void 0&&e.length===1?e[0]:void 0}function Ve(e){return H.checkDefined(Be(e))}function He(e){return e!==void 0&&e.length===1?e[0]:e}function Ue(e,t,n){let r=e.slice(0);return r[t]=n,r}function We(e,t,n,r,i){return Ge(e,n(t),n,r,i)}function Ge(e,t,n,r,i){if(!I(e))return-1;let a=i??0,o=e.length-1;for(;a<=o;){let i=a+(o-a>>1);switch(r(n(e[i],i),t)){case-1:a=i+1;break;case 0:return i;case 1:o=i-1;break}}return~a}function Ke(e,t,n,r,i){if(e&&e.length>0){let a=e.length;if(a>0){let o=r===void 0||r<0?0:r,s=i===void 0||o+i>a-1?a-1:o+i,c;for(arguments.length<=2?(c=e[o],o++):c=n;o<=s;)c=t(c,e[o],o),o++;return c}}return n}var qe=Object.prototype.hasOwnProperty;function Je(e,t){return qe.call(e,t)}function Ye(e,t){return qe.call(e,t)?e[t]:void 0}function Xe(e){let t=[];for(let n in e)qe.call(e,n)&&t.push(n);return t}function Ze(e){let t=[];do{let n=Object.getOwnPropertyNames(e);for(let e of n)De(t,e)}while(e=Object.getPrototypeOf(e));return t}function Qe(e){let t=[];for(let n in e)qe.call(e,n)&&t.push(e[n]);return t}function $e(e,t){let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r);return n}function et(e,t){let n=[];for(let r of e)n.push(t?t(r):r);return n}function tt(e,...t){for(let n of t)if(n!==void 0)for(let t in n)Je(n,t)&&(e[t]=n[t]);return e}function nt(e,t,n=Nt){if(e===t)return!0;if(!e||!t)return!1;for(let r in e)if(qe.call(e,r)&&(!qe.call(t,r)||!n(e[r],t[r])))return!1;for(let n in t)if(qe.call(t,n)&&!qe.call(e,n))return!1;return!0}function rt(e,t,n=Tt){let r=new Map;for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==void 0&&r.set(o,n(a))}return r}function it(e,t,n=Tt){let r=[];for(let i=0;i<e.length;i++){let a=e[i];r[t(a)]=n(a)}return r}function at(e,t,n=Tt){let r=dt();for(let i=0;i<e.length;i++){let a=e[i];r.add(t(a),n(a))}return r}function ot(e,t,n=Tt){return et(at(e,t).values(),n)}function st(e,t){let n={};if(e!==void 0)for(let r=0;r<e.length;r++){let i=e[r],a=`${t(i)}`;(n[a]??(n[a]=[])).push(i)}return n}function ct(e){let t={};for(let n in e)qe.call(e,n)&&(t[n]=e[n]);return t}function lt(e,t){let n={};for(let e in t)qe.call(t,e)&&(n[e]=t[e]);for(let t in e)qe.call(e,t)&&(n[t]=e[t]);return n}function ut(e,t){for(let n in t)qe.call(t,n)&&(e[n]=t[n])}function R(e,t){return t?.bind(e)}function dt(){let e=new Map;return e.add=z,e.remove=ft,e}function z(e,t){let n=this.get(e);return n===void 0?this.set(e,n=[t]):n.push(t),n}function ft(e,t){let n=this.get(e);n!==void 0&&(cn(n,t),n.length||this.delete(e))}function pt(e){let t=e?.slice()??[],n=0;function r(){return n===t.length}function i(...e){t.push(...e)}function a(){if(r())throw Error(`Queue is empty`);let e=t[n];if(t[n]=void 0,n++,n>100&&n>t.length>>1){let e=t.length-n;t.copyWithin(0,n),t.length=e,n=0}return e}return{enqueue:i,dequeue:a,isEmpty:r}}function mt(e,t){let n=new Map,r=0;function*i(){for(let e of n.values())ht(e)?yield*e:yield e}let a={has(r){let i=e(r);if(!n.has(i))return!1;let a=n.get(i);return ht(a)?w(a,r,t):t(a,r)},add(i){let a=e(i);if(n.has(a)){let e=n.get(a);if(ht(e))w(e,i,t)||(e.push(i),r++);else{let o=e;t(o,i)||(n.set(a,[o,i]),r++)}}else n.set(a,i),r++;return this},delete(i){let a=e(i);if(!n.has(a))return!1;let o=n.get(a);if(ht(o)){for(let e=0;e<o.length;e++)if(t(o[e],i))return o.length===1?n.delete(a):o.length===2?n.set(a,o[1-e]):sn(o,e),r--,!0}else if(t(o,i))return n.delete(a),r--,!0;return!1},clear(){n.clear(),r=0},get size(){return r},forEach(e){for(let t of et(n.values()))if(ht(t))for(let n of t)e(n,n,a);else{let n=t;e(n,n,a)}},keys(){return i()},values(){return i()},*entries(){for(let e of i())yield[e,e]},[Symbol.iterator]:()=>i(),[Symbol.toStringTag]:n[Symbol.toStringTag]};return a}function ht(e){return Array.isArray(e)}function gt(e){return ht(e)?e:[e]}function _t(e){return typeof e==`string`}function vt(e){return typeof e==`number`}function yt(e,t){return e!==void 0&&t(e)?e:void 0}function bt(e,t){return e!==void 0&&t(e)?e:H.fail(`Invalid cast. The supplied value ${e} did not pass the test '${H.getFunctionName(t)}'.`)}function xt(e){}function St(){return!1}function Ct(){return!0}function wt(){}function Tt(e){return e}function Et(e){return e.toLowerCase()}var Dt=/[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g;function Ot(e){return Dt.test(e)?e.replace(Dt,Et):e}function kt(){throw Error(`Not implemented`)}function At(e){let t;return()=>(e&&=(t=e(),void 0),t)}function jt(e){let t=new Map;return n=>{let r=`${typeof n}:${n}`,i=t.get(r);return i===void 0&&!t.has(r)&&(i=e(n),t.set(r,i)),i}}var Mt=(e=>(e[e.None=0]=`None`,e[e.Normal=1]=`Normal`,e[e.Aggressive=2]=`Aggressive`,e[e.VeryAggressive=3]=`VeryAggressive`,e))(Mt||{});function Nt(e,t){return e===t}function Pt(e,t){return e===t||e!==void 0&&t!==void 0&&e.toUpperCase()===t.toUpperCase()}function Ft(e,t){return Nt(e,t)}function It(e,t){return e===t?0:e===void 0?-1:t===void 0?1:e<t?-1:1}function Lt(e,t){return It(e,t)}function Rt(e,t){return Lt(e?.start,t?.start)||Lt(e?.length,t?.length)}function zt(e,t,n){for(let r=0;r<e.length;r++)t=Math.max(t,n(e[r]));return t}function Bt(e,t){return Ke(e,(e,n)=>t(e,n)===-1?e:n)}function Vt(e,t){return e===t?0:e===void 0?-1:t===void 0?1:(e=e.toUpperCase(),t=t.toUpperCase(),e<t?-1:+(e>t))}function Ht(e,t){return e===t?0:e===void 0?-1:t===void 0?1:(e=e.toLowerCase(),t=t.toLowerCase(),e<t?-1:+(e>t))}function Ut(e,t){return It(e,t)}function Wt(e){return e?Vt:Ut}var Gt=(()=>{return t;function e(e,t,n){if(e===t)return 0;if(e===void 0)return-1;if(t===void 0)return 1;let r=n(e,t);return r<0?-1:+(r>0)}function t(t){let n=new Intl.Collator(t,{usage:`sort`,sensitivity:`variant`,numeric:!0}).compare;return(t,r)=>e(t,r,n)}})(),Kt,qt;function Jt(){return qt}function Yt(e){qt!==e&&(qt=e,Kt=void 0)}function Xt(e,t){return Kt??=Gt(qt),Kt(e,t)}function Zt(e,t,n,r){return e===t?0:e===void 0?-1:t===void 0?1:r(e[n],t[n])}function B(e,t){return Lt(+!!e,+!!t)}function Qt(e,t,n){let r=Math.max(2,Math.floor(e.length*.34)),i=Math.floor(e.length*.4)+1,a;for(let o of t){let t=n(o);if(t!==void 0&&Math.abs(t.length-e.length)<=r){if(t===e||t.length<3&&t.toLowerCase()!==e.toLowerCase())continue;let n=$t(e,t,i-.1);if(n===void 0)continue;H.assert(n<i),i=n,a=o}}return a}function $t(e,t,n){let r=Array(t.length+1),i=Array(t.length+1),a=n+.01;for(let e=0;e<=t.length;e++)r[e]=e;for(let o=1;o<=e.length;o++){let s=e.charCodeAt(o-1),c=Math.ceil(o>n?o-n:1),l=Math.floor(t.length>n+o?n+o:t.length);i[0]=o;let u=o;for(let e=1;e<c;e++)i[e]=a;for(let n=c;n<=l;n++){let a=e[o-1].toLowerCase()===t[n-1].toLowerCase()?r[n-1]+.1:r[n-1]+2,c=s===t.charCodeAt(n-1)?r[n-1]:Math.min(r[n]+1,i[n-1]+1,a);i[n]=c,u=Math.min(u,c)}for(let e=l+1;e<=t.length;e++)i[e]=a;if(u>n)return;let d=r;r=i,i=d}let o=r[t.length];return o>n?void 0:o}function en(e,t,n){let r=e.length-t.length;return r>=0&&(n?Pt(e.slice(r),t):e.indexOf(t,r)===r)}function tn(e,t){return en(e,t)?e.slice(0,e.length-t.length):e}function nn(e,t){return en(e,t)?e.slice(0,e.length-t.length):void 0}function rn(e){let t=e.length;for(let n=t-1;n>0;n--){let r=e.charCodeAt(n);if(r>=48&&r<=57)do--n,r=e.charCodeAt(n);while(n>0&&r>=48&&r<=57);else if(n>4&&(r===110||r===78)){if(--n,r=e.charCodeAt(n),r!==105&&r!==73||(--n,r=e.charCodeAt(n),r!==109&&r!==77))break;--n,r=e.charCodeAt(n)}else break;if(r!==45&&r!==46)break;t=n}return t===e.length?e:e.slice(0,t)}function an(e,t){for(let n=0;n<e.length;n++)if(e[n]===t)return on(e,n),!0;return!1}function on(e,t){for(let n=t;n<e.length-1;n++)e[n]=e[n+1];e.pop()}function sn(e,t){e[t]=e[e.length-1],e.pop()}function cn(e,t){return ln(e,e=>e===t)}function ln(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return sn(e,n),!0;return!1}function un(e){return e?Tt:Ot}function dn({prefix:e,suffix:t}){return`${e}*${t}`}function fn(e,t){return H.assert(gn(e,t)),t.substring(e.prefix.length,t.length-e.suffix.length)}function pn(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e[a],s=t(o);s.prefix.length>i&&gn(s,n)&&(i=s.prefix.length,r=o)}return r}function V(e,t,n){return n?Pt(e.slice(0,t.length),t):e.lastIndexOf(t,0)===0}function mn(e,t){return V(e,t)?e.substr(t.length):e}function hn(e,t,n=Tt){return V(n(e),n(t))?e.substring(t.length):void 0}function gn({prefix:e,suffix:t},n){return n.length>=e.length+t.length&&V(n,e)&&en(n,t)}function _n(e,t){return n=>e(n)&&t(n)}function vn(...e){return(...t)=>{let n;for(let r of e)if(n=r(...t),n)return n;return n}}function yn(e){return(...t)=>!e(...t)}function bn(e){}function xn(e){return e===void 0?void 0:[e]}function Sn(e,t,n,r,i,a){a??=xt;let o=0,s=0,c=e.length,l=t.length,u=!1;for(;o<c&&s<l;){let c=e[o],l=t[s],d=n(c,l);d===-1?(r(c),o++,u=!0):d===1?(i(l),s++,u=!0):(a(l,c),o++,s++)}for(;o<c;)r(e[o++]),u=!0;for(;s<l;)i(t[s++]),u=!0;return u}function Cn(e){let t=[];return wn(e,t,void 0,0),t}function wn(e,t,n,r){for(let i of e[r]){let a;n?(a=n.slice(),a.push(i)):a=[i],r===e.length-1?t.push(a):wn(e,t,a,r+1)}}function Tn(e,t){if(e!==void 0){let n=e.length,r=0;for(;r<n&&t(e[r]);)r++;return e.slice(0,r)}}function En(e,t){if(e!==void 0){let n=e.length,r=0;for(;r<n&&t(e[r]);)r++;return e.slice(r)}}function Dn(){return typeof process<`u`&&!!process.nextTick&&!process.browser&&typeof require<`u`}var On=(e=>(e[e.Off=0]=`Off`,e[e.Error=1]=`Error`,e[e.Warning=2]=`Warning`,e[e.Info=3]=`Info`,e[e.Verbose=4]=`Verbose`,e))(On||{}),H;(e=>{let t=0;e.currentLogLevel=2,e.isDebugging=!1;function n(t){return e.currentLogLevel<=t}e.shouldLog=n;function r(t,r){e.loggingHost&&n(t)&&e.loggingHost.log(t,r)}function i(e){r(3,e)}e.log=i,(e=>{function t(e){r(1,e)}e.error=t;function n(e){r(2,e)}e.warn=n;function i(e){r(3,e)}e.log=i;function a(e){r(4,e)}e.trace=a})(i=e.log||={});let a={};function o(){return t}e.getAssertionLevel=o;function s(n){let r=t;if(t=n,n>r)for(let t of Xe(a)){let r=a[t];r!==void 0&&e[t]!==r.assertion&&n>=r.level&&(e[t]=r,a[t]=void 0)}}e.setAssertionLevel=s;function c(e){return t>=e}e.shouldAssert=c;function l(t,n){return c(t)?!0:(a[n]={level:t,assertion:e[n]},e[n]=xt,!1)}function u(e,t){let n=Error(e?`Debug Failure. ${e}`:`Debug Failure.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,t||u),n}e.fail=u;function d(e,t,n){return u(`${t||`Unexpected node.`}\r
360
360
  Node ${N(e.kind)} was unexpected.`,n||d)}e.failBadSyntaxKind=d;function f(e,t,n,r){e||(t=t?`False expression: ${t}`:`False expression.`,n&&(t+=`\r
361
361
  Verbose Debug Information: `+(typeof n==`string`?n:n())),u(t,r||f))}e.assert=f;function p(e,t,n,r,i){e!==t&&u(`Expected ${e} === ${t}. ${n?r?`${n} ${r}`:n:``}`,i||p)}e.assertEqual=p;function m(e,t,n,r){e>=t&&u(`Expected ${e} < ${t}. ${n||``}`,r||m)}e.assertLessThan=m;function h(e,t,n){e>t&&u(`Expected ${e} <= ${t}`,n||h)}e.assertLessThanOrEqual=h;function g(e,t,n){e<t&&u(`Expected ${e} >= ${t}`,n||g)}e.assertGreaterThanOrEqual=g;function v(e,t,n){e??u(t,n||v)}e.assertIsDefined=v;function b(e,t,n){return v(e,t,n||b),e}e.checkDefined=b;function x(e,t,n){for(let r of e)v(r,t,n||x)}e.assertEachIsDefined=x;function S(e,t,n){return x(e,t,n||S),e}e.checkEachDefined=S;function C(e,t=`Illegal value:`,n){return u(`${t} ${typeof e==`object`&&Je(e,`kind`)&&Je(e,`pos`)?`SyntaxKind: `+N(e.kind):JSON.stringify(e)}`,n||C)}e.assertNever=C;function w(e,t,n,r){l(1,`assertEachNode`)&&f(t===void 0||y(e,t),n||`Unexpected node.`,()=>`Node array did not pass test '${ne(t)}'.`,r||w)}e.assertEachNode=w;function T(e,t,n,r){l(1,`assertNode`)&&f(e!==void 0&&(t===void 0||t(e)),n||`Unexpected node.`,()=>`Node ${N(e?.kind)} did not pass test '${ne(t)}'.`,r||T)}e.assertNode=T;function E(e,t,n,r){l(1,`assertNotNode`)&&f(e===void 0||t===void 0||!t(e),n||`Unexpected node.`,()=>`Node ${N(e.kind)} should not have passed test '${ne(t)}'.`,r||E)}e.assertNotNode=E;function D(e,t,n,r){l(1,`assertOptionalNode`)&&f(t===void 0||e===void 0||t(e),n||`Unexpected node.`,()=>`Node ${N(e?.kind)} did not pass test '${ne(t)}'.`,r||D)}e.assertOptionalNode=D;function O(e,t,n,r){l(1,`assertOptionalToken`)&&f(t===void 0||e===void 0||e.kind===t,n||`Unexpected node.`,()=>`Node ${N(e?.kind)} was not a '${N(t)}' token.`,r||O)}e.assertOptionalToken=O;function ee(e,t,n){l(1,`assertMissingNode`)&&f(e===void 0,t||`Unexpected node.`,()=>`Node ${N(e.kind)} was unexpected'.`,n||ee)}e.assertMissingNode=ee;function te(e){}e.type=te;function ne(e){if(typeof e!=`function`)return``;if(Je(e,`name`))return e.name;{let t=Function.prototype.toString.call(e),n=/^function\s+([\w$]+)\s*\(/.exec(t);return n?n[1]:``}}e.getFunctionName=ne;function re(e){return`{ name: ${Hc(e.escapedName)}; flags: ${le(e.flags)}; declarations: ${k(e.declarations,e=>N(e.kind))} }`}e.formatSymbol=re;function A(e=0,t,n){let r=M(t);if(e===0)return r.length>0&&r[0][0]===0?r[0][1]:`0`;if(n){let t=[],n=e;for(let[i,a]of r){if(i>e)break;i!==0&&i&e&&(t.push(a),n&=~i)}if(n===0)return t.join(`|`)}else for(let[t,n]of r)if(t===e)return n;return e.toString()}e.formatEnum=A;let j=new Map;function M(e){let t=j.get(e);if(t)return t;let n=[];for(let t in e){let r=e[t];typeof r==`number`&&n.push([r,t])}let r=Ae(n,(e,t)=>Lt(e[0],t[0]));return j.set(e,r),r}function N(e){return A(e,U,!1)}e.formatSyntaxKind=N;function P(e){return A(e,Gi,!1)}e.formatSnippetKind=P;function F(e){return A(e,Ri,!1)}e.formatScriptKind=F;function ie(e){return A(e,Fr,!0)}e.formatNodeFlags=ie;function ae(e){return A(e,di,!0)}e.formatNodeCheckFlags=ae;function oe(e){return A(e,Ir,!0)}e.formatModifierFlags=oe;function se(e){return A(e,Wi,!0)}e.formatTransformFlags=se;function ce(e){return A(e,Ki,!0)}e.formatEmitFlags=ce;function le(e){return A(e,ci,!0)}e.formatSymbolFlags=le;function I(e){return A(e,fi,!0)}e.formatTypeFlags=I;function ue(e){return A(e,bi,!0)}e.formatSignatureFlags=ue;function de(e){return A(e,pi,!0)}e.formatObjectFlags=de;function fe(e){return A(e,Ur,!0)}e.formatFlowFlags=fe;function pe(e){return A(e,Rr,!0)}e.formatRelationComparisonResult=pe;function me(e){return A(e,vB,!0)}e.formatCheckMode=me;function he(e){return A(e,yB,!0)}e.formatSignatureCheckMode=he;function ge(e){return A(e,gB,!0)}e.formatTypeFacts=ge;let _e=!1,ve;function ye(e){`__debugFlowFlags`in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value(){let e=this.flags&2?`FlowStart`:this.flags&4?`FlowBranchLabel`:this.flags&8?`FlowLoopLabel`:this.flags&16?`FlowAssignment`:this.flags&32?`FlowTrueCondition`:this.flags&64?`FlowFalseCondition`:this.flags&128?`FlowSwitchClause`:this.flags&256?`FlowArrayMutation`:this.flags&512?`FlowCall`:this.flags&1024?`FlowReduceLabel`:this.flags&1?`FlowUnreachable`:`UnknownFlow`,t=this.flags&-2048;return`${e}${t?` (${fe(t)})`:``}`}},__debugFlowFlags:{get(){return A(this.flags,Ur,!0)}},__debugToString:{value(){return Oe(this)}}})}function be(e){return _e&&(typeof Object.setPrototypeOf==`function`?(ve||(ve=Object.create(Object.prototype),ye(ve)),Object.setPrototypeOf(e,ve)):ye(e)),e}e.attachFlowNodeDebugInfo=be;let xe;function Se(e){`__tsDebuggerDisplay`in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value(e){return e=String(e).replace(/(?:,[\s\w]+:[^,]+)+\]$/,`]`),`NodeArray ${e}`}}})}function Ce(e){_e&&(typeof Object.setPrototypeOf==`function`?(xe||(xe=Object.create(Array.prototype),Se(xe)),Object.setPrototypeOf(e,xe)):Se(e))}e.attachNodeArrayDebugInfo=Ce;function we(){if(_e)return;let e=new WeakMap,t=new WeakMap;Object.defineProperties(wS.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value(){let e=this.flags&33554432?`TransientSymbol`:`Symbol`,t=this.flags&-33554433;return`${e} '${Gc(this)}'${t?` (${le(t)})`:``}`}},__debugFlags:{get(){return le(this.flags)}}}),Object.defineProperties(wS.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value(){let e=this.flags&67359327?`IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName?` (${this.debugIntrinsicName})`:``}`:this.flags&98304?`NullableType`:this.flags&384?`LiteralType ${JSON.stringify(this.value)}`:this.flags&2048?`LiteralType ${this.value.negative?`-`:``}${this.value.base10Value}n`:this.flags&8192?`UniqueESSymbolType`:this.flags&32?`EnumType`:this.flags&1048576?`UnionType`:this.flags&2097152?`IntersectionType`:this.flags&4194304?`IndexType`:this.flags&8388608?`IndexedAccessType`:this.flags&16777216?`ConditionalType`:this.flags&33554432?`SubstitutionType`:this.flags&262144?`TypeParameter`:this.flags&524288?this.objectFlags&3?`InterfaceType`:this.objectFlags&4?`TypeReference`:this.objectFlags&8?`TupleType`:this.objectFlags&16?`AnonymousType`:this.objectFlags&32?`MappedType`:this.objectFlags&1024?`ReverseMappedType`:this.objectFlags&256?`EvolvingArrayType`:`ObjectType`:`Type`,t=this.flags&524288?this.objectFlags&-1344:0;return`${e}${this.symbol?` '${Gc(this.symbol)}'`:``}${t?` (${de(t)})`:``}`}},__debugFlags:{get(){return I(this.flags)}},__debugObjectFlags:{get(){return this.flags&524288?de(this.objectFlags):``}},__debugTypeToString:{value(){let t=e.get(this);return t===void 0&&(t=this.checker.typeToString(this),e.set(this,t)),t}}}),Object.defineProperties(wS.getSignatureConstructor().prototype,{__debugFlags:{get(){return ue(this.flags)}},__debugSignatureToString:{value(){return this.checker?.signatureToString(this)}}});let n=[wS.getNodeConstructor(),wS.getIdentifierConstructor(),wS.getTokenConstructor(),wS.getSourceFileConstructor()];for(let e of n)Je(e.prototype,`__debugKind`)||Object.defineProperties(e.prototype,{__tsDebuggerDisplay:{value(){return`${yu(this)?`GeneratedIdentifier`:X(this)?`Identifier '${Uc(this)}'`:hO(this)?`PrivateIdentifier '${Uc(this)}'`:QD(this)?`StringLiteral ${JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+`...`)}`:XD(this)?`NumericLiteral ${this.text}`:ZD(this)?`BigIntLiteral ${this.text}n`:jO(this)?`TypeParameterDeclaration`:MO(this)?`ParameterDeclaration`:zO(this)?`ConstructorDeclaration`:BO(this)?`GetAccessorDeclaration`:VO(this)?`SetAccessorDeclaration`:HO(this)?`CallSignatureDeclaration`:UO(this)?`ConstructSignatureDeclaration`:WO(this)?`IndexSignatureDeclaration`:GO(this)?`TypePredicateNode`:KO(this)?`TypeReferenceNode`:qO(this)?`FunctionTypeNode`:JO(this)?`ConstructorTypeNode`:YO(this)?`TypeQueryNode`:XO(this)?`TypeLiteralNode`:ZO(this)?`ArrayTypeNode`:QO(this)?`TupleTypeNode`:ek(this)?`OptionalTypeNode`:tk(this)?`RestTypeNode`:nk(this)?`UnionTypeNode`:rk(this)?`IntersectionTypeNode`:ik(this)?`ConditionalTypeNode`:ak(this)?`InferTypeNode`:ok(this)?`ParenthesizedTypeNode`:sk(this)?`ThisTypeNode`:ck(this)?`TypeOperatorNode`:lk(this)?`IndexedAccessTypeNode`:uk(this)?`MappedTypeNode`:dk(this)?`LiteralTypeNode`:$O(this)?`NamedTupleMember`:fk(this)?`ImportTypeNode`:N(this.kind)}${this.flags?` (${ie(this.flags)})`:``}`}},__debugKind:{get(){return N(this.kind)}},__debugNodeFlags:{get(){return ie(this.flags)}},__debugModifierFlags:{get(){return oe(jb(this))}},__debugTransformFlags:{get(){return se(this.transformFlags)}},__debugIsParseTreeNode:{get(){return zc(this)}},__debugEmitFlags:{get(){return ce(Pp(this))}},__debugGetText:{value(e){if(Iv(this))return``;let n=t.get(this);if(n===void 0){let r=Bc(this),i=r&&$f(r);n=i?wp(i,r,e):``,t.set(this,n)}return n}}});_e=!0}e.enableDebugInfo=we;function Te(e){let t=e&7,n=t===0?`in out`:t===3?`[bivariant]`:t===2?`in`:t===1?`out`:t===4?`[independent]`:``;return e&8?n+=` (unmeasurable)`:e&16&&(n+=` (unreliable)`),n}e.formatVariance=Te;class Ee{__debugToString(){switch(this.kind){case 3:return this.debugInfo?.call(this)||`(function mapper)`;case 0:return`${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`;case 1:return _(this.sources,this.targets||k(this.sources,()=>`any`),(e,t)=>`${e.__debugTypeToString()} -> ${typeof t==`string`?t:t.__debugTypeToString()}`).join(`, `);case 2:return _(this.sources,this.targets,(e,t)=>`${e.__debugTypeToString()} -> ${t().__debugTypeToString()}`).join(`, `);case 5:case 4:return`m1: ${this.mapper1.__debugToString().split(`
362
362
  `).join(`
@@ -789,7 +789,7 @@ Project '${e.projectName}' (${c9[e.projectKind]}) ${t}
789
789
  `,t++};this.projectService.externalProjects.forEach(n),this.projectService.configuredProjects.forEach(n),this.projectService.inferredProjects.forEach(n)}}this.logger.msg(r,`Err`)}send(e){if(e.type===`event`&&!this.canUseEvents){this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${LY(e)}`);return}this.writeMessage(e)}writeMessage(e){let t=FAe(e,this.logger,this.byteLength,this.host.newLine);this.host.write(t)}event(e,t){this.send(LAe(t,e))}doOutput(e,t,n,r,i,a){let o={seq:0,type:`response`,command:t,request_seq:n,success:r,performanceData:i&&$Ae(i)};if(r){let t;if(ht(e))o.body=e,t=e.metadata,delete e.metadata;else if(typeof e==`object`)if(e.metadata){let{metadata:n,...r}=e;o.body=r,t=n}else o.body=e;else o.body=e;t&&(o.metadata=t)}else H.assert(e===void 0);a&&(o.message=a),this.send(o)}semanticCheck(e,t){var n,r;let i=cr();(n=jr)==null||n.push(jr.Phase.Session,`semanticCheck`,{file:e,configFilePath:t.canonicalConfigFilePath});let a=AAe(t,e)?t9:t.getLanguageService().getSemanticDiagnostics(e).filter(e=>!!e.file);this.sendDiagnosticsEvent(e,t,a,`semanticDiag`,i),(r=jr)==null||r.pop()}syntacticCheck(e,t){var n,r;let i=cr();(n=jr)==null||n.push(jr.Phase.Session,`syntacticCheck`,{file:e,configFilePath:t.canonicalConfigFilePath}),this.sendDiagnosticsEvent(e,t,t.getLanguageService().getSyntacticDiagnostics(e),`syntaxDiag`,i),(r=jr)==null||r.pop()}suggestionCheck(e,t){var n,r;let i=cr();(n=jr)==null||n.push(jr.Phase.Session,`suggestionCheck`,{file:e,configFilePath:t.canonicalConfigFilePath}),this.sendDiagnosticsEvent(e,t,t.getLanguageService().getSuggestionDiagnostics(e),`suggestionDiag`,i),(r=jr)==null||r.pop()}regionSemanticCheck(e,t,n){var r,i,a;let o=cr();(r=jr)==null||r.push(jr.Phase.Session,`regionSemanticCheck`,{file:e,configFilePath:t.canonicalConfigFilePath});let s;if(!this.shouldDoRegionCheck(e)||!(s=t.getLanguageService().getRegionSemanticDiagnostics(e,n))){(i=jr)==null||i.pop();return}this.sendDiagnosticsEvent(e,t,s.diagnostics,`regionSemanticDiag`,o,s.spans),(a=jr)==null||a.pop()}shouldDoRegionCheck(e){let t=this.projectService.getScriptInfoForNormalizedPath(e)?.textStorage.getLineInfo().getLineCount();return!!(t&&t>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(e,t,n,r,i,a){try{let o=H.checkDefined(t.getScriptInfo(e)),s=cr()-i,c={file:e,diagnostics:n.map(n=>MAe(e,t,n)),spans:a?.map(e=>q9(e,o))};this.event(c,r),this.addDiagnosticsPerformanceData(e,r,s)}catch(e){this.logError(e,r)}}updateErrorCheck(e,t,n,r=!0){if(t.length===0)return;H.assert(!this.suppressDiagnosticEvents);let i=this.changeSeq,a=Math.min(n,200),o=0,s=()=>{if(o++,t.length>o)return e.delay(`checkOne`,a,l)},c=(t,n)=>{if(this.semanticCheck(t,n),this.changeSeq===i){if(this.getPreferences(t).disableSuggestions)return s();e.immediate(`suggestionCheck`,()=>{this.suggestionCheck(t,n),s()})}},l=()=>{if(this.changeSeq!==i)return;let n,a=t[o];if(_t(a)?a=this.toPendingErrorCheck(a):`ranges`in a&&(n=a.ranges,a=this.toPendingErrorCheck(a.file)),!a)return s();let{fileName:l,project:u}=a;if(z9(u),u.containsFile(l,r)&&(this.syntacticCheck(l,u),this.changeSeq===i)){if(u.projectService.serverMode!==0)return s();if(n)return e.immediate(`regionSemanticCheck`,()=>{let t=this.projectService.getScriptInfoForNormalizedPath(l);t&&this.regionSemanticCheck(l,u,n.map(e=>this.getRange({file:l,...e},t))),this.changeSeq===i&&e.immediate(`semanticCheck`,()=>c(l,u))});e.immediate(`semanticCheck`,()=>c(l,u))}};t.length>o&&this.changeSeq===i&&e.delay(`checkOne`,n,l)}cleanProjects(e,t){if(t){this.logger.info(`cleaning ${e}`);for(let e of t)e.getLanguageService(!1).cleanupSemanticCache(),e.cleanupProgram()}}cleanup(){this.cleanProjects(`inferred projects`,this.projectService.inferredProjects),this.cleanProjects(`configured projects`,et(this.projectService.configuredProjects.values())),this.cleanProjects(`external projects`,this.projectService.externalProjects),this.host.gc&&(this.logger.info(`host.gc()`),this.host.gc())}getEncodedSyntacticClassifications(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e);return n.getEncodedSyntacticClassifications(t,e)}getEncodedSemanticClassifications(e){let{file:t,project:n}=this.getFileAndProject(e),r=e.format===`2020`?`2020`:`original`;return n.getLanguageService().getEncodedSemanticClassifications(t,e,r)}getProject(e){return e===void 0?void 0:this.projectService.findProject(e)}getConfigFileAndProject(e){let t=this.getProject(e.projectFileName),n=r9(e.file);return{configFile:t&&t.hasConfigFile(n)?n:void 0,project:t}}getConfigFileDiagnostics(e,t,n){let r=D(de(t.getAllProjectErrors(),t.getLanguageService().getCompilerOptionsDiagnostics()),t=>!!t.file&&t.file.fileName===e);return n?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(r):k(r,e=>U9(e,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(e){return e.map(e=>({message:jW(e.messageText,this.host.newLine),start:e.start,length:e.length,category:Oi(e),code:e.code,source:e.source,startLocation:e.file&&H9(ms(e.file,e.start)),endLocation:e.file&&H9(ms(e.file,e.start+e.length)),reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,relatedInformation:k(e.relatedInformation,V9)}))}getCompilerOptionsDiagnostics(e){let t=this.getProject(e.projectFileName);return this.convertToDiagnosticsWithLinePosition(D(t.getLanguageService().getCompilerOptionsDiagnostics(),e=>!e.file),void 0)}convertToDiagnosticsWithLinePosition(e,t){return e.map(e=>({message:jW(e.messageText,this.host.newLine),start:e.start,length:e.length,category:Oi(e),code:e.code,source:e.source,startLocation:t&&t.positionToLineOffset(e.start),endLocation:t&&t.positionToLineOffset(e.start+e.length),reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated,relatedInformation:k(e.relatedInformation,V9)}))}getDiagnosticsWorker(e,t,n,r){let{project:i,file:a}=this.getFileAndProject(e);if(t&&AAe(i,a))return t9;let o=i.getScriptInfoForNormalizedPath(a),s=n(i,a);return r?this.convertToDiagnosticsWithLinePosition(s,o):s.map(e=>MAe(a,i,e))}getDefinition(t,n){let{file:r,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,r),o=this.mapDefinitionInfoLocations(i.getLanguageService().getDefinitionAtPosition(r,a)||t9,i);return n?this.mapDefinitionInfo(o,i):o.map(e.mapToOriginalLocation)}mapDefinitionInfoLocations(e,t){return e.map(e=>{let n=JAe(e,t);return n?{...n,containerKind:e.containerKind,containerName:e.containerName,kind:e.kind,name:e.name,failedAliasResolution:e.failedAliasResolution,...e.unverified&&{unverified:e.unverified}}:e})}getDefinitionAndBoundSpan(t,n){let{file:r,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,r),o=H.checkDefined(i.getScriptInfo(r)),s=i.getLanguageService().getDefinitionAndBoundSpan(r,a);if(!s||!s.definitions)return{definitions:t9,textSpan:void 0};let c=this.mapDefinitionInfoLocations(s.definitions,i),{textSpan:l}=s;return n?{definitions:this.mapDefinitionInfo(c,i),textSpan:q9(l,o)}:{definitions:c.map(e.mapToOriginalLocation),textSpan:l}}findSourceDefinition(e){let{file:t,project:n}=this.getFileAndProject(e),r=this.getPositionInFile(e,t),i=n.getLanguageService().getDefinitionAtPosition(t,r),a=this.mapDefinitionInfoLocations(i||t9,n).slice();if(this.projectService.serverMode===0&&(!I(a,e=>r9(e.fileName)!==t&&!e.isAmbient)||I(a,e=>!!e.failedAliasResolution))){let e=mt(e=>e.textSpan.start,yQ(this.host.useCaseSensitiveFileNames));a?.forEach(t=>e.add(t));let i=n.getNoDtsResolutionProject(t),u=i.getLanguageService(),d=u.getDefinitionAtPosition(t,r,!0,!1)?.filter(e=>r9(e.fileName)!==t);if(I(d))for(let t of d){if(t.unverified){let r=c(t,n.getLanguageService().getProgram(),u.getProgram());if(I(r)){for(let t of r)e.add(t);continue}}e.add(t)}else{let n=a.filter(e=>r9(e.fileName)!==t&&e.isAmbient);for(let r of I(n)?n:s()){let n=o(r.fileName,t,i);if(!n)continue;let a=this.projectService.getOrCreateScriptInfoNotOpenedByClient(n,i.currentDirectory,i.directoryStructureHost,!1);if(!a)continue;i.containsScriptInfo(a)||(i.addRoot(a),i.updateGraph());let s=u.getProgram(),c=H.checkDefined(s.getSourceFile(n));for(let t of l(r.name,c,s))e.add(t)}}a=et(e.values())}return a=a.filter(e=>!e.isAmbient&&!e.failedAliasResolution),this.mapDefinitionInfo(a,n);function o(e,t,r){let i=ST(e);if(i&&e.lastIndexOf(xR)===i.topLevelNodeModulesIndex){let a=e.substring(0,i.packageRootIndex),o=n.getModuleResolutionCache()?.getPackageJsonInfoCache(),s=n.getCompilationSettings(),c=NR(po(a,n.getCurrentDirectory()),MR(o,n,s));if(!c)return;let l=jR(c,{moduleResolution:2},n,n.getModuleResolutionCache()),u=oz(sz(e.substring(i.topLevelPackageNameIndex+1,i.packageRootIndex))),d=n.toPath(e);if(l&&I(l,e=>n.toPath(e)===d))return r.resolutionCache.resolveSingleModuleNameWithoutWatching(u,t).resolvedModule?.resolvedFileName;{let n=`${u}/${Cw(e.substring(i.packageRootIndex+1))}`;return r.resolutionCache.resolveSingleModuleNameWithoutWatching(n,t).resolvedModule?.resolvedFileName}}}function s(){let e=n.getLanguageService(),i=nZ(e.getProgram().getSourceFile(t),r);return(pf(i)||X(i))&&hS(i.parent)&&yS(i,n=>{if(n===i)return;let r=e.getDefinitionAtPosition(t,n.getStart(),!0,!1)?.filter(e=>r9(e.fileName)!==t&&e.isAmbient).map(e=>({fileName:e.fileName,name:Cv(i)}));if(I(r))return r})||t9}function c(e,n,i){let a=i.getSourceFile(e.fileName);if(!a)return;let o=nZ(n.getSourceFile(t),r),s=n.getTypeChecker().getSymbolAtLocation(o),c=s&&Cf(s,276);if(c)return l(c.propertyName?.text||c.name.text,a,i)}function l(e,t,n){return F(y5.Core.getTopMostDeclarationNamesInFile(e,t),e=>{let t=n.getTypeChecker().getSymbolAtLocation(e),r=G_(e);if(t&&r)return P5.createDefinitionInfo(r,n.getTypeChecker(),t,r,!0)})}}getEmitOutput(e){let{file:t,project:n}=this.getFileAndProject(e);if(!n.shouldEmitFile(n.getScriptInfo(t)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};let r=n.getLanguageService().getEmitOutput(t);return e.richResponse?{...r,diagnostics:e.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(r.diagnostics):r.diagnostics.map(e=>U9(e,!0))}:r}mapJSDocTagInfo(e,t,n){return e?e.map(e=>({...e,text:n?this.mapDisplayParts(e.text,t):e.text?.map(e=>e.text).join(``)})):[]}mapDisplayParts(e,t){return e?e.map(e=>e.kind===`linkName`?{...e,target:this.toFileSpan(e.target.fileName,e.target.textSpan,t)}:e):[]}mapSignatureHelpItems(e,t,n){return e.map(e=>({...e,documentation:this.mapDisplayParts(e.documentation,t),parameters:e.parameters.map(e=>({...e,documentation:this.mapDisplayParts(e.documentation,t)})),tags:this.mapJSDocTagInfo(e.tags,t,n)}))}mapDefinitionInfo(e,t){return e.map(e=>({...this.toFileSpanWithContext(e.fileName,e.textSpan,e.contextSpan,t),...e.unverified&&{unverified:e.unverified}}))}static mapToOriginalLocation(e){return e.originalFileName?(H.assert(e.originalTextSpan!==void 0,`originalTextSpan should be present if originalFileName is`),{...e,fileName:e.originalFileName,textSpan:e.originalTextSpan,targetFileName:e.fileName,targetTextSpan:e.textSpan,contextSpan:e.originalContextSpan,targetContextSpan:e.contextSpan}):e}toFileSpan(e,t,n){let r=n.getLanguageService(),i=r.toLineColumnOffset(e,t.start),a=r.toLineColumnOffset(e,rc(t));return{file:e,start:{line:i.line+1,offset:i.character+1},end:{line:a.line+1,offset:a.character+1}}}toFileSpanWithContext(e,t,n,r){let i=this.toFileSpan(e,t,r),a=n&&this.toFileSpan(e,n,r);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}getTypeDefinition(e){let{file:t,project:n}=this.getFileAndProject(e),r=this.getPositionInFile(e,t),i=this.mapDefinitionInfoLocations(n.getLanguageService().getTypeDefinitionAtPosition(t,r)||t9,n);return this.mapDefinitionInfo(i,n)}mapImplementationLocations(e,t){return e.map(e=>{let n=JAe(e,t);return n?{...n,kind:e.kind,displayParts:e.displayParts}:e})}getImplementation(t,n){let{file:r,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,r),o=this.mapImplementationLocations(i.getLanguageService().getImplementationAtPosition(r,a)||t9,i);return n?o.map(({fileName:e,textSpan:t,contextSpan:n})=>this.toFileSpanWithContext(e,t,n,i)):o.map(e.mapToOriginalLocation)}getSyntacticDiagnosticsSync(e){let{configFile:t}=this.getConfigFileAndProject(e);return t?t9:this.getDiagnosticsWorker(e,!1,(e,t)=>e.getLanguageService().getSyntacticDiagnostics(t),!!e.includeLinePosition)}getSemanticDiagnosticsSync(e){let{configFile:t,project:n}=this.getConfigFileAndProject(e);return t?this.getConfigFileDiagnostics(t,n,!!e.includeLinePosition):this.getDiagnosticsWorker(e,!0,(e,t)=>e.getLanguageService().getSemanticDiagnostics(t).filter(e=>!!e.file),!!e.includeLinePosition)}getSuggestionDiagnosticsSync(e){let{configFile:t}=this.getConfigFileAndProject(e);return t?t9:this.getDiagnosticsWorker(e,!0,(e,t)=>e.getLanguageService().getSuggestionDiagnostics(t),!!e.includeLinePosition)}getJsxClosingTag(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t),i=n.getJsxClosingTagAtPosition(t,r);return i===void 0?void 0:{newText:i.newText,caretOffset:0}}getLinkedEditingRange(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t),i=n.getLinkedEditingRangeAtPosition(t,r),a=this.projectService.getScriptInfoForNormalizedPath(t);if(!(a===void 0||i===void 0))return rje(i,a)}getDocumentHighlights(e,t){let{file:n,project:r}=this.getFileAndProject(e),i=this.getPositionInFile(e,n),a=r.getLanguageService().getDocumentHighlights(n,i,e.filesToSearch);return a?t?a.map(({fileName:e,highlightSpans:t})=>{let n=r.getScriptInfo(e);return{file:e,highlightSpans:t.map(({textSpan:e,kind:t,contextSpan:r})=>({...eje(e,r,n),kind:t}))}}):a:t9}provideInlayHints(e){let{file:t,project:n}=this.getFileAndProject(e),r=this.projectService.getScriptInfoForNormalizedPath(t);return n.getLanguageService().provideInlayHints(t,e,this.getPreferences(t)).map(e=>{let{position:t,displayParts:n}=e;return{...e,position:r.positionToLineOffset(t),displayParts:n?.map(({text:e,span:t,file:n})=>{if(t){H.assertIsDefined(n,`Target file should be defined together with its span.`);let r=this.projectService.getScriptInfo(n);return{text:e,span:{start:r.positionToLineOffset(t.start),end:r.positionToLineOffset(t.start+t.length),file:n}}}else return{text:e}})}})}mapCode(e){let t=this.getHostFormatOptions(),n=this.getHostPreferences(),{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(e),a=this.projectService.getScriptInfoForNormalizedPath(r),o=e.mapping.focusLocations?.map(e=>e.map(e=>{let t=a.lineOffsetToPosition(e.start.line,e.start.offset);return{start:t,length:a.lineOffsetToPosition(e.end.line,e.end.offset)-t}})),s=i.mapCode(r,e.mapping.contents,o,t,n);return this.mapTextChangesToCodeEdits(s)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(e){this.projectService.setCompilerOptionsForInferredProjects(e.options,e.projectRootPath)}getProjectInfo(e){return this.getProjectInfoWorker(e.file,e.projectFileName,e.needFileNameList,e.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(e,t,n,r,i){let{project:a}=this.getFileAndProjectWorker(e,t);return z9(a),{configFileName:a.getProjectName(),languageServiceDisabled:!a.languageServiceEnabled,fileNames:n?a.getFileNames(!1,i):void 0,configuredProjectInfo:r?this.getDefaultConfiguredProjectInfo(e):void 0}}getDefaultConfiguredProjectInfo(e){var t;let n=this.projectService.getScriptInfo(e);if(!n)return;let r=this.projectService.findDefaultConfiguredProjectWorker(n,3);if(!r)return;let i,a;return r.seenProjects.forEach((e,t)=>{t!==r.defaultProject&&(e===3?(a??=[]).push(r9(t.getConfigFilePath())):(i??=[]).push(r9(t.getConfigFilePath())))}),(t=r.seenConfigs)==null||t.forEach(e=>(i??=[]).push(e)),{notMatchedByConfig:i,notInProject:a,defaultProject:r.defaultProject&&r9(r.defaultProject.getConfigFilePath())}}getRenameInfo(e){let{file:t,project:n}=this.getFileAndProject(e),r=this.getPositionInFile(e,t),i=this.getPreferences(t);return n.getLanguageService().getRenameInfo(t,r,i)}getProjects(e,t,n){let r,i;if(e.projectFileName){let t=this.getProject(e.projectFileName);t&&(r=[t])}else{let a=t?this.projectService.getScriptInfoEnsuringProjectsUptoDate(e.file):this.projectService.getScriptInfo(e.file);if(a)t||this.projectService.ensureDefaultProjectForFile(a);else return n?t9:(this.projectService.logErrorForScriptInfoNotFound(e.file),n9.ThrowNoProject());r=a.containingProjects,i=this.projectService.getSymlinkedProjects(a)}return r=D(r,e=>e.languageServiceEnabled&&!e.isOrphan()),!n&&(!r||!r.length)&&!i?(this.projectService.logErrorForScriptInfoNotFound(e.file??e.projectFileName),n9.ThrowNoProject()):i?{projects:r,symLinkedProjects:i}:r}getDefaultProject(e){if(e.projectFileName){let t=this.getProject(e.projectFileName);if(t)return t;if(!e.file)return n9.ThrowNoProject()}return this.projectService.getScriptInfo(e.file).getDefaultProject()}getRenameLocations(e,t){let n=r9(e.file),r=this.getPositionInFile(e,n),i=this.getProjects(e),a=this.getDefaultProject(e),o=this.getPreferences(n),s=this.mapRenameInfo(a.getLanguageService().getRenameInfo(n,r,o),H.checkDefined(this.projectService.getScriptInfo(n)));if(!s.canRename)return t?{info:s,locs:[]}:[];let c=zAe(i,a,{fileName:e.file,pos:r},!!e.findInStrings,!!e.findInComments,o,this.host.useCaseSensitiveFileNames);return t?{info:s,locs:this.toSpanGroups(c)}:c}mapRenameInfo(e,t){if(e.canRename){let{canRename:n,fileToRename:r,displayName:i,fullDisplayName:a,kind:o,kindModifiers:s,triggerSpan:c}=e;return Tt({canRename:n,fileToRename:r,displayName:i,fullDisplayName:a,kind:o,kindModifiers:s,triggerSpan:q9(c,t)})}else return e}toSpanGroups(e){let t=new Map;for(let{fileName:n,textSpan:r,contextSpan:i,originalContextSpan:a,originalTextSpan:o,originalFileName:s,...c}of e){let e=t.get(n);e||t.set(n,e={file:n,locs:[]});let a=H.checkDefined(this.projectService.getScriptInfo(n));e.locs.push({...eje(r,i,a),...c})}return et(t.values())}getReferences(e,t){let n=r9(e.file),r=this.getProjects(e),i=this.getPositionInFile(e,n),a=VAe(r,this.getDefaultProject(e),{fileName:e.file,pos:i},this.host.useCaseSensitiveFileNames,this.logger);if(!t)return a;let o=this.getPreferences(n),s=this.getDefaultProject(e),c=s.getScriptInfoForNormalizedPath(n),l=s.getLanguageService().getQuickInfoAtPosition(n,i),u=l?m4(l.displayParts):``,d=l&&l.textSpan,f=d?c.positionToLineOffset(d.start).offset:0,p=d?c.getSnapshot().getText(d.start,rc(d)):``;return{refs:A(a,e=>e.references.map(e=>cje(this.projectService,e,o))),symbolName:p,symbolStartOffset:f,symbolDisplayString:u}}getFileReferences(e,t){let n=this.getProjects(e),r=r9(e.file),i=this.getPreferences(r),a={fileName:r,pos:0},o=UAe(n,this.getDefaultProject(e),a,a,WAe,e=>(this.logger.info(`Finding references to file ${r} in project ${e.getProjectName()}`),e.getLanguageService().getFileReferences(r))),s;if(ht(o))s=o;else{s=[];let e=W9(this.host.useCaseSensitiveFileNames);o.forEach(t=>{for(let n of t)e.has(n)||(s.push(n),e.add(n))})}return t?{refs:s.map(e=>cje(this.projectService,e,i)),symbolName:`"${e.file}"`}:s}openClientFile(e,t,n,r){this.projectService.openClientFileWithNormalizedPath(e,t,n,!1,r)}getPosition(e,t){return e.position===void 0?t.lineOffsetToPosition(e.line,e.offset):e.position}getPositionInFile(e,t){let n=this.projectService.getScriptInfoForNormalizedPath(t);return this.getPosition(e,n)}getFileAndProject(e){return this.getFileAndProjectWorker(e.file,e.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(e){let{file:t,project:n}=this.getFileAndProject(e);return{file:t,languageService:n.getLanguageService(!1)}}getFileAndProjectWorker(e,t){let n=r9(e);return{file:n,project:this.getProject(t)||this.projectService.ensureDefaultProjectForFile(n)}}getOutliningSpans(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=r.getOutliningSpans(n);if(t){let e=this.projectService.getScriptInfoForNormalizedPath(n);return i.map(t=>({textSpan:q9(t.textSpan,e),hintSpan:q9(t.hintSpan,e),bannerText:t.bannerText,autoCollapse:t.autoCollapse,kind:t.kind}))}else return i}getTodoComments(e){let{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().getTodoComments(t,e.descriptors)}getDocCommentTemplate(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.getDocCommentTemplateAtPosition(t,r,this.getPreferences(t),this.getFormatOptions(t))}getSpanOfEnclosingComment(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.onlyMultiLine,i=this.getPositionInFile(e,t);return n.getSpanOfEnclosingComment(t,i,r)}getIndentation(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t),i=e.options?k9(e.options):this.getFormatOptions(t);return{position:r,indentation:n.getIndentationAtPosition(t,r,i)}}getBreakpointStatement(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.getBreakpointStatementAtPosition(t,r)}getNameOrDottedNameSpan(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.getNameOrDottedNameSpan(t,r,r)}isValidBraceCompletion(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.getPositionInFile(e,t);return n.isValidBraceCompletionAtPosition(t,r,e.openingBrace.charCodeAt(0))}getQuickInfoWorker(e,t){let{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=r.getLanguageService().getQuickInfoAtPosition(n,this.getPosition(e,i));if(!a)return;let o=!!this.getPreferences(n).displayPartsForJSDoc;if(t){let e=m4(a.displayParts);return{kind:a.kind,kindModifiers:a.kindModifiers,start:i.positionToLineOffset(a.textSpan.start),end:i.positionToLineOffset(rc(a.textSpan)),displayString:e,documentation:o?this.mapDisplayParts(a.documentation,r):m4(a.documentation),tags:this.mapJSDocTagInfo(a.tags,r,o)}}else return o?a:{...a,tags:this.mapJSDocTagInfo(a.tags,r,!1)}}getFormattingEditsForRange(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.projectService.getScriptInfoForNormalizedPath(t),i=r.lineOffsetToPosition(e.line,e.offset),a=r.lineOffsetToPosition(e.endLine,e.endOffset),o=n.getFormattingEditsForRange(t,i,a,this.getFormatOptions(t));if(o)return o.map(e=>this.convertTextChangeToCodeEdit(e,r))}getFormattingEditsForRangeFull(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.options?k9(e.options):this.getFormatOptions(t);return n.getFormattingEditsForRange(t,e.position,e.endPosition,r)}getFormattingEditsForDocumentFull(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.options?k9(e.options):this.getFormatOptions(t);return n.getFormattingEditsForDocument(t,r)}getFormattingEditsAfterKeystrokeFull(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=e.options?k9(e.options):this.getFormatOptions(t);return n.getFormattingEditsAfterKeystroke(t,e.position,e.key,r)}getFormattingEditsAfterKeystroke(e){let{file:t,languageService:n}=this.getFileAndLanguageServiceForSyntacticOperation(e),r=this.projectService.getScriptInfoForNormalizedPath(t),i=r.lineOffsetToPosition(e.line,e.offset),a=this.getFormatOptions(t),o=n.getFormattingEditsAfterKeystroke(t,i,e.key,a);if(e.key===`
790
790
  `&&(!o||o.length===0||NAe(o,i))){let{lineText:s,absolutePosition:c}=r.textStorage.getAbsolutePositionAndLineText(e.line);if(s&&s.search(`\\S`)<0){let e=n.getIndentationAtPosition(t,i,a),r=0,l,u;for(l=0,u=s.length;l<u;l++)if(s.charAt(l)===` `)r++;else if(s.charAt(l)===` `)r+=a.tabSize;else break;if(e!==r){let t=c+l;o.push({span:bc(c,t),newText:k7.getIndentationString(e,a)})}}}if(o)return o.map(e=>({start:r.positionToLineOffset(e.span.start),end:r.positionToLineOffset(rc(e.span)),newText:e.newText?e.newText:``}))}getCompletions(e,t){let{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=this.getPosition(e,i),o=r.getLanguageService().getCompletionsAtPosition(n,a,{...Yke(this.getPreferences(n)),triggerCharacter:e.triggerCharacter,triggerKind:e.triggerKind,includeExternalModuleExports:e.includeExternalModuleExports,includeInsertTextCompletions:e.includeInsertTextCompletions},r.projectService.getFormatCodeOptions(n));if(o===void 0)return;if(t===`completions-full`)return o;let s=e.prefix||``,c=F(o.entries,e=>{if(o.isMemberCompletion||V(e.name.toLowerCase(),s.toLowerCase())){let t=e.replacementSpan?q9(e.replacementSpan,i):void 0;return{...e,replacementSpan:t,hasAction:e.hasAction||void 0,symbol:void 0}}});return t===`completions`?(o.metadata&&(c.metadata=o.metadata),c):{...o,optionalReplacementSpan:o.optionalReplacementSpan&&q9(o.optionalReplacementSpan,i),entries:c}}getCompletionEntryDetails(e,t){let{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=this.getPosition(e,i),o=r.projectService.getFormatCodeOptions(n),s=!!this.getPreferences(n).displayPartsForJSDoc,c=F(e.entryNames,e=>{let{name:t,source:i,data:s}=typeof e==`string`?{name:e,source:void 0,data:void 0}:e;return r.getLanguageService().getCompletionEntryDetails(n,a,t,o,i,this.getPreferences(n),s?bt(s,uje):void 0)});return t?s?c:c.map(e=>({...e,tags:this.mapJSDocTagInfo(e.tags,r,!1)})):c.map(e=>({...e,codeActions:k(e.codeActions,e=>this.mapCodeAction(e)),documentation:this.mapDisplayParts(e.documentation,r),tags:this.mapJSDocTagInfo(e.tags,r,s)}))}getCompileOnSaveAffectedFileList(e){let t=this.getProjects(e,!0,!0),n=this.projectService.getScriptInfo(e.file);return n?RAe(n,e=>this.projectService.getScriptInfoForPath(e),t,(e,t)=>{if(!e.compileOnSaveEnabled||!e.languageServiceEnabled||e.isOrphan())return;let n=e.getCompilationSettings();if(!(n.noEmit||jP(t.fileName)&&!jAe(n)))return{projectFileName:e.getProjectName(),fileNames:e.getCompileOnSaveAffectedFileList(t),projectUsesOutFile:!!n.outFile}}):t9}emitFile(e){let{file:t,project:n}=this.getFileAndProject(e);if(n||n9.ThrowNoProject(),!n.languageServiceEnabled)return e.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let r=n.getScriptInfo(t),{emitSkipped:i,diagnostics:a}=n.emitFile(r,(e,t,n)=>this.host.writeFile(e,t,n));return e.richResponse?{emitSkipped:i,diagnostics:e.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(a):a.map(e=>U9(e,!0))}:!i}getSignatureHelpItems(e,t){let{file:n,project:r}=this.getFileAndProject(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=this.getPosition(e,i),o=r.getLanguageService().getSignatureHelpItems(n,a,e),s=!!this.getPreferences(n).displayPartsForJSDoc;if(o&&t){let e=o.applicableSpan;return{...o,applicableSpan:{start:i.positionToLineOffset(e.start),end:i.positionToLineOffset(e.start+e.length)},items:this.mapSignatureHelpItems(o.items,r,s)}}else if(s||!o)return o;else return{...o,items:o.items.map(e=>({...e,tags:this.mapJSDocTagInfo(e.tags,r,!1)}))}}toPendingErrorCheck(e){let t=r9(e),n=this.projectService.tryGetDefaultProjectForFile(t);return n&&{fileName:t,project:n}}getDiagnostics(e,t,n){this.suppressDiagnosticEvents||n.length>0&&this.updateErrorCheck(e,n,t)}change(e){let t=this.projectService.getScriptInfo(e.file);H.assert(!!t),t.textStorage.switchToScriptVersionCache();let n=t.lineOffsetToPosition(e.line,e.offset),r=t.lineOffsetToPosition(e.endLine,e.endOffset);n>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(t,se({span:{start:n,length:r-n},newText:e.insertString})))}reload(e){let t=r9(e.file),n=e.tmpfile===void 0?void 0:r9(e.tmpfile),r=this.projectService.getScriptInfoForNormalizedPath(t);r&&(this.changeSeq++,r.reloadFromFile(n))}saveToTmp(e,t){let n=this.projectService.getScriptInfo(e);n&&n.saveTo(t)}closeClientFile(e){if(!e)return;let t=mo(e);this.projectService.closeClientFile(t)}mapLocationNavigationBarItems(e,t){return k(e,e=>({text:e.text,kind:e.kind,kindModifiers:e.kindModifiers,spans:e.spans.map(e=>q9(e,t)),childItems:this.mapLocationNavigationBarItems(e.childItems,t),indent:e.indent}))}getNavigationBarItems(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=r.getNavigationBarItems(n);return i?t?this.mapLocationNavigationBarItems(i,this.projectService.getScriptInfoForNormalizedPath(n)):i:void 0}toLocationNavigationTree(e,t){return{text:e.text,kind:e.kind,kindModifiers:e.kindModifiers,spans:e.spans.map(e=>q9(e,t)),nameSpan:e.nameSpan&&q9(e.nameSpan,t),childItems:k(e.childItems,e=>this.toLocationNavigationTree(e,t))}}getNavigationTree(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=r.getNavigationTree(n);return i?t?this.toLocationNavigationTree(i,this.projectService.getScriptInfoForNormalizedPath(n)):i:void 0}getNavigateToItems(e,t){let n=this.getFullNavigateToItems(e);return t?A(n,({project:e,navigateToItems:t})=>t.map(t=>{let n=e.getScriptInfo(t.fileName),r={name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,isCaseSensitive:t.isCaseSensitive,matchKind:t.matchKind,file:t.fileName,start:n.positionToLineOffset(t.textSpan.start),end:n.positionToLineOffset(rc(t.textSpan))};return t.kindModifiers&&t.kindModifiers!==``&&(r.kindModifiers=t.kindModifiers),t.containerName&&t.containerName.length>0&&(r.containerName=t.containerName),t.containerKind&&t.containerKind.length>0&&(r.containerKind=t.containerKind),r})):A(n,({navigateToItems:e})=>e)}getFullNavigateToItems(e){let{currentFileOnly:t,searchValue:n,maxResultCount:r,projectFileName:i}=e;if(t){H.assertIsDefined(e.file);let{file:t,project:i}=this.getFileAndProject(e);return[{project:i,navigateToItems:i.getLanguageService().getNavigateToItems(n,r,t)}]}let a=this.getHostPreferences(),o=[],s=new Map;return!e.file&&!i?(this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(e=>c(e))):HAe(this.getProjects(e),void 0,e=>c(e)),o;function c(e){let t=D(e.getLanguageService().getNavigateToItems(n,r,void 0,e.isNonTsProject(),a.excludeLibrarySymbolsInNavTo),t=>l(t)&&!K9(G9(t),e));t.length&&o.push({project:e,navigateToItems:t})}function l(e){let t=e.name;if(!s.has(t))return s.set(t,[e]),!0;let n=s.get(t);for(let t of n)if(u(t,e))return!1;return n.push(e),!0}function u(e,t){return e===t?!0:!e||!t?!1:e.containerKind===t.containerKind&&e.containerName===t.containerName&&e.fileName===t.fileName&&e.isCaseSensitive===t.isCaseSensitive&&e.kind===t.kind&&e.kindModifiers===t.kindModifiers&&e.matchKind===t.matchKind&&e.name===t.name&&e.textSpan.start===t.textSpan.start&&e.textSpan.length===t.textSpan.length}}getSupportedCodeFixes(e){if(!e)return g4();if(e.file){let{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().getSupportedCodeFixes(t)}let t=this.getProject(e.projectFileName);return t||n9.ThrowNoProject(),t.getLanguageService().getSupportedCodeFixes()}isLocation(e){return e.line!==void 0}extractPositionOrRange(e,t){let n,r;return this.isLocation(e)?n=i(e):r=this.getRange(e,t),H.checkDefined(n===void 0?r:n);function i(e){return e.position===void 0?t.lineOffsetToPosition(e.line,e.offset):e.position}}getRange(e,t){let{startPosition:n,endPosition:r}=this.getStartAndEndPosition(e,t);return{pos:n,end:r}}getApplicableRefactors(e){let{file:t,project:n}=this.getFileAndProject(e),r=n.getScriptInfoForNormalizedPath(t);return n.getLanguageService().getApplicableRefactors(t,this.extractPositionOrRange(e,r),this.getPreferences(t),e.triggerReason,e.kind,e.includeInteractiveActions).map(e=>({...e,actions:e.actions.map(e=>({...e,range:e.range?{start:H9({line:e.range.start.line,character:e.range.start.offset}),end:H9({line:e.range.end.line,character:e.range.end.offset})}:void 0}))}))}getEditsForRefactor(e,t){let{file:n,project:r}=this.getFileAndProject(e),i=r.getScriptInfoForNormalizedPath(n),a=r.getLanguageService().getEditsForRefactor(n,this.getFormatOptions(n),this.extractPositionOrRange(e,i),e.refactor,e.action,this.getPreferences(n),e.interactiveRefactorArguments);if(a===void 0)return{edits:[]};if(t){let{renameFilename:e,renameLocation:t,edits:n}=a,i;return e!==void 0&&t!==void 0&&(i=oje(KZ(r.getScriptInfoForNormalizedPath(r9(e)).getSnapshot()),e,t,n)),{renameLocation:i,renameFilename:e,edits:this.mapTextChangesToCodeEdits(n),notApplicableReason:a.notApplicableReason}}return a}getMoveToRefactoringFileSuggestions(e){let{file:t,project:n}=this.getFileAndProject(e),r=n.getScriptInfoForNormalizedPath(t);return n.getLanguageService().getMoveToRefactoringFileSuggestions(t,this.extractPositionOrRange(e,r),this.getPreferences(t))}preparePasteEdits(e){let{file:t,project:n}=this.getFileAndProject(e);return n.getLanguageService().preparePasteEditsForFile(t,e.copiedTextSpan.map(e=>this.getRange({file:t,startLine:e.start.line,startOffset:e.start.offset,endLine:e.end.line,endOffset:e.end.offset},this.projectService.getScriptInfoForNormalizedPath(t))))}getPasteEdits(e){let{file:t,project:n}=this.getFileAndProject(e);if(s9(t))return;let r=e.copiedFrom?{file:e.copiedFrom.file,range:e.copiedFrom.spans.map(t=>this.getRange({file:e.copiedFrom.file,startLine:t.start.line,startOffset:t.start.offset,endLine:t.end.line,endOffset:t.end.offset},n.getScriptInfoForNormalizedPath(r9(e.copiedFrom.file))))}:void 0,i=n.getLanguageService().getPasteEdits({targetFile:t,pastedText:e.pastedText,pasteLocations:e.pasteLocations.map(e=>this.getRange({file:t,startLine:e.start.line,startOffset:e.start.offset,endLine:e.end.line,endOffset:e.end.offset},n.getScriptInfoForNormalizedPath(t))),copiedFrom:r,preferences:this.getPreferences(t)},this.getFormatOptions(t));return i&&this.mapPasteEditsAction(i)}organizeImports(e,t){H.assert(e.scope.type===`file`);let{file:n,project:r}=this.getFileAndProject(e.scope.args),i=r.getLanguageService().organizeImports({fileName:n,mode:e.mode??(e.skipDestructiveCodeActions?`SortAndCombine`:void 0),type:`file`},this.getFormatOptions(n),this.getPreferences(n));return t?this.mapTextChangesToCodeEdits(i):i}getEditsForFileRename(e,t){let n=r9(e.oldFilePath),r=r9(e.newFilePath),i=this.getHostFormatOptions(),a=this.getHostPreferences(),o=new Set,s=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(e=>{let t=e.getLanguageService().getEditsForFileRename(n,r,i,a),c=[];for(let e of t)o.has(e.fileName)||(s.push(e),c.push(e.fileName));for(let e of c)o.add(e)}),t?s.map(e=>this.mapTextChangeToCodeEdit(e)):s}getCodeFixes(e,t){let{file:n,project:r}=this.getFileAndProject(e),i=r.getScriptInfoForNormalizedPath(n),{startPosition:a,endPosition:o}=this.getStartAndEndPosition(e,i),s;try{s=r.getLanguageService().getCodeFixesAtPosition(n,a,o,e.errorCodes,this.getFormatOptions(n),this.getPreferences(n))}catch(t){let i=r.getLanguageService(),s=[...i.getSyntacticDiagnostics(n),...i.getSemanticDiagnostics(n),...i.getSuggestionDiagnostics(n)].map(e=>mc(a,o-a,e.start,e.length)&&e.code),c=e.errorCodes.find(e=>!s.includes(e));throw c!==void 0&&(t.message=`BADCLIENT: Bad error code, ${c} not found in range ${a}..${o} (found: ${s.join(`, `)}); could have caused this error:
791
791
  ${t.message}`),t}return t?s.map(e=>this.mapCodeFixAction(e)):s}getCombinedCodeFix({scope:e,fixId:t},n){H.assert(e.type===`file`);let{file:r,project:i}=this.getFileAndProject(e.args),a=i.getLanguageService().getCombinedCodeFix({type:`file`,fileName:r},t,this.getFormatOptions(r),this.getPreferences(r));return n?{changes:this.mapTextChangesToCodeEdits(a.changes),commands:a.commands}:a}applyCodeActionCommand(e){let t=e.command;for(let e of gt(t)){let{file:t,project:n}=this.getFileAndProject(e);n.getLanguageService().applyCodeActionCommand(e,this.getFormatOptions(t)).then(e=>{},e=>{})}return{}}getStartAndEndPosition(e,t){let n,r;return e.startPosition===void 0?(n=t.lineOffsetToPosition(e.startLine,e.startOffset),e.startPosition=n):n=e.startPosition,e.endPosition===void 0?(r=t.lineOffsetToPosition(e.endLine,e.endOffset),e.endPosition=r):r=e.endPosition,{startPosition:n,endPosition:r}}mapCodeAction({description:e,changes:t,commands:n}){return{description:e,changes:this.mapTextChangesToCodeEdits(t),commands:n}}mapCodeFixAction({fixName:e,description:t,changes:n,commands:r,fixId:i,fixAllDescription:a}){return{fixName:e,description:t,changes:this.mapTextChangesToCodeEdits(n),commands:r,fixId:i,fixAllDescription:a}}mapPasteEditsAction({edits:e,fixId:t}){return{edits:this.mapTextChangesToCodeEdits(e),fixId:t}}mapTextChangesToCodeEdits(e){return e.map(e=>this.mapTextChangeToCodeEdit(e))}mapTextChangeToCodeEdit(e){let t=this.projectService.getScriptInfoOrConfig(e.fileName);return!!e.isNewFile==!!t&&(t||this.projectService.logErrorForScriptInfoNotFound(e.fileName),H.fail(`Expected isNewFile for (only) new files. `+JSON.stringify({isNewFile:!!e.isNewFile,hasScriptInfo:!!t}))),t?{fileName:e.fileName,textChanges:e.textChanges.map(e=>tje(e,t))}:aje(e)}convertTextChangeToCodeEdit(e,t){return{start:t.positionToLineOffset(e.span.start),end:t.positionToLineOffset(e.span.start+e.span.length),newText:e.newText?e.newText:``}}getBraceMatching(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=this.getPosition(e,i),o=r.getBraceMatchingAtPosition(n,a);return o?t?o.map(e=>q9(e,i)):o:void 0}getDiagnosticsForProject(e,t,n){if(this.suppressDiagnosticEvents)return;let{fileNames:r,languageServiceDisabled:i}=this.getProjectInfoWorker(n,void 0,!0,void 0,!0);if(i)return;let a=r.filter(e=>!e.includes(`lib.d.ts`));if(a.length===0)return;let o=[],s=[],c=[],l=[],u=r9(n),d=this.projectService.ensureDefaultProjectForFile(u);for(let e of a)this.getCanonicalFileName(e)===this.getCanonicalFileName(n)?o.push(e):this.projectService.getScriptInfo(e).isScriptOpen()?s.push(e):jP(e)?l.push(e):c.push(e);let f=[...o,...s,...c,...l].map(e=>({fileName:e,project:d}));this.updateErrorCheck(e,f,t,!1)}configurePlugin(e){this.projectService.configurePlugin(e)}getSmartSelectionRange(e,t){let{locations:n}=e,{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(e),a=H.checkDefined(this.projectService.getScriptInfo(r));return k(n,e=>{let n=this.getPosition(e,a),o=i.getSmartSelectionRange(r,n);return t?this.mapSelectionRange(o,a):o})}toggleLineComment(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfo(n),a=this.getRange(e,i),o=r.toggleLineComment(n,a);if(t){let e=this.projectService.getScriptInfoForNormalizedPath(n);return o.map(t=>this.convertTextChangeToCodeEdit(t,e))}return o}toggleMultilineComment(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=this.getRange(e,i),o=r.toggleMultilineComment(n,a);if(t){let e=this.projectService.getScriptInfoForNormalizedPath(n);return o.map(t=>this.convertTextChangeToCodeEdit(t,e))}return o}commentSelection(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=this.getRange(e,i),o=r.commentSelection(n,a);if(t){let e=this.projectService.getScriptInfoForNormalizedPath(n);return o.map(t=>this.convertTextChangeToCodeEdit(t,e))}return o}uncommentSelection(e,t){let{file:n,languageService:r}=this.getFileAndLanguageServiceForSyntacticOperation(e),i=this.projectService.getScriptInfoForNormalizedPath(n),a=this.getRange(e,i),o=r.uncommentSelection(n,a);if(t){let e=this.projectService.getScriptInfoForNormalizedPath(n);return o.map(t=>this.convertTextChangeToCodeEdit(t,e))}return o}mapSelectionRange(e,t){let n={textSpan:q9(e.textSpan,t)};return e.parent&&(n.parent=this.mapSelectionRange(e.parent,t)),n}getScriptInfoFromProjectService(e){let t=r9(e);return this.projectService.getScriptInfoForNormalizedPath(t)||(this.projectService.logErrorForScriptInfoNotFound(t),n9.ThrowNoProject())}toProtocolCallHierarchyItem(e){let t=this.getScriptInfoFromProjectService(e.file);return{name:e.name,kind:e.kind,kindModifiers:e.kindModifiers,file:e.file,containerName:e.containerName,span:q9(e.span,t),selectionSpan:q9(e.selectionSpan,t)}}toProtocolCallHierarchyIncomingCall(e){let t=this.getScriptInfoFromProjectService(e.from.file);return{from:this.toProtocolCallHierarchyItem(e.from),fromSpans:e.fromSpans.map(e=>q9(e,t))}}toProtocolCallHierarchyOutgoingCall(e,t){return{to:this.toProtocolCallHierarchyItem(e.to),fromSpans:e.fromSpans.map(e=>q9(e,t))}}prepareCallHierarchy(e){let{file:t,project:n}=this.getFileAndProject(e),r=this.projectService.getScriptInfoForNormalizedPath(t);if(r){let i=this.getPosition(e,r),a=n.getLanguageService().prepareCallHierarchy(t,i);return a&&H$(a,e=>this.toProtocolCallHierarchyItem(e))}}provideCallHierarchyIncomingCalls(e){let{file:t,project:n}=this.getFileAndProject(e),r=this.getScriptInfoFromProjectService(t);return n.getLanguageService().provideCallHierarchyIncomingCalls(t,this.getPosition(e,r)).map(e=>this.toProtocolCallHierarchyIncomingCall(e))}provideCallHierarchyOutgoingCalls(e){let{file:t,project:n}=this.getFileAndProject(e),r=this.getScriptInfoFromProjectService(t);return n.getLanguageService().provideCallHierarchyOutgoingCalls(t,this.getPosition(e,r)).map(e=>this.toProtocolCallHierarchyOutgoingCall(e,r))}getCanonicalFileName(e){return mo(this.host.useCaseSensitiveFileNames?e:Ot(e))}exit(){}notRequired(e){return e&&this.doOutput(void 0,e.command,e.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(e){return{response:e,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(e,t){if(this.handlers.has(e))throw Error(`Protocol handler already exists for command "${e}"`);this.handlers.set(e,t)}setCurrentRequest(e){H.assert(this.currentRequestId===void 0),this.currentRequestId=e,this.cancellationToken.setRequest(e)}resetCurrentRequest(e){H.assert(this.currentRequestId===e),this.currentRequestId=void 0,this.cancellationToken.resetRequest(e)}executeWithRequestId(e,t,n){let r=this.performanceData;try{return this.performanceData=n,this.setCurrentRequest(e),t()}finally{this.resetCurrentRequest(e),this.performanceData=r}}executeCommand(e){let t=this.handlers.get(e.command);if(t){let n=this.executeWithRequestId(e.seq,()=>t(e),void 0);return this.projectService.enableRequestedPlugins(),n}else return this.logger.msg(`Unrecognized JSON command:${LY(e)}`,`Err`),this.doOutput(void 0,`unknown`,e.seq,!1,void 0,`Unrecognized JSON command: ${e.command}`),{responseRequired:!1}}onMessage(e){var t,n,r,i,a,o,s;this.gcTimer.scheduleCollect();let c,l=this.performanceData;this.logger.hasLevel(2)&&(c=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${IY(this.toStringMessage(e))}`));let u,d;try{u=this.parseMessage(e),d=u.arguments&&u.arguments.file?u.arguments:void 0,(t=jr)==null||t.instant(jr.Phase.Session,`request`,{seq:u.seq,command:u.command}),(n=jr)==null||n.push(jr.Phase.Session,`executeCommand`,{seq:u.seq,command:u.command},!0);let{response:a,responseRequired:o,performanceData:s}=this.executeCommand(u);if((r=jr)==null||r.pop(),this.logger.hasLevel(2)){let e=kAe(this.hrtime(c)).toFixed(4);o?this.logger.perftrc(`${u.seq}::${u.command}: elapsed time (in milliseconds) ${e}`):this.logger.perftrc(`${u.seq}::${u.command}: async elapsed time (in milliseconds) ${e}`)}(i=jr)==null||i.instant(jr.Phase.Session,`response`,{seq:u.seq,command:u.command,success:!!a}),a?this.doOutput(a,u.command,u.seq,!0,s):o&&this.doOutput(void 0,u.command,u.seq,!1,s,`No content available.`)}catch(t){if((a=jr)==null||a.popAll(),t instanceof Gr){(o=jr)==null||o.instant(jr.Phase.Session,`commandCanceled`,{seq:u?.seq,command:u?.command}),this.doOutput({canceled:!0},u.command,u.seq,!0,this.performanceData);return}this.logErrorWorker(t,this.toStringMessage(e),d),(s=jr)==null||s.instant(jr.Phase.Session,`commandError`,{seq:u?.seq,command:u?.command,message:t.message}),this.doOutput(void 0,u?u.command:`unknown`,u?u.seq:0,!1,this.performanceData,`Error processing request. `+t.message+`
792
- `+t.stack)}finally{this.performanceData=l}}parseMessage(e){return JSON.parse(e)}toStringMessage(e){return e}getFormatOptions(e){return this.projectService.getFormatCodeOptions(e)}getPreferences(e){return this.projectService.getPreferences(e)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function $Ae(e){let t=e.diagnosticsDuration&&et(e.diagnosticsDuration,([e,t])=>({...t,file:e}));return{...e,diagnosticsDuration:t}}function q9(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(rc(e))}}function eje(e,t,n){let r=q9(e,n),i=t&&q9(t,n);return i?{...r,contextStart:i.start,contextEnd:i.end}:r}function tje(e,t){return{start:nje(t,e.span.start),end:nje(t,rc(e.span)),newText:e.newText}}function nje(e,t){return wAe(e)?ije(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function rje(e,t){let n=e.ranges.map(e=>({start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(e.start+e.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function ije(e){return{line:e.line+1,offset:e.character+1}}function aje(e){H.assert(e.textChanges.length===1);let t=Ie(e.textChanges);return H.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function oje(e,t,n,r){let{line:i,character:a}=ds(ss(sje(e,t,r)),n);return{line:i+1,offset:a+1}}function sje(e,t,n){for(let{fileName:r,textChanges:i}of n)if(r===t)for(let t=i.length-1;t>=0;t--){let{newText:n,span:{start:r,length:a}}=i[t];e=e.slice(0,r)+n+e.slice(r+a)}return e}function cje(e,{fileName:t,textSpan:n,contextSpan:r,isWriteAccess:i,isDefinition:a},{disableLineTextInReferences:o}){let s=H.checkDefined(e.getScriptInfo(t)),c=eje(n,r,s),l=o?void 0:lje(s,c);return{file:t,...c,lineText:l,isWriteAccess:i,isDefinition:a}}function lje(e,t){let n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,rc(n)).replace(/\r|\n/g,``)}function uje(e){return e===void 0||e&&typeof e==`object`&&typeof e.exportName==`string`&&(e.fileName===void 0||typeof e.fileName==`string`)&&(e.ambientModuleName===void 0||typeof e.ambientModuleName==`string`&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport==`boolean`))}var J9=4,dje=(e=>(e[e.PreStart=0]=`PreStart`,e[e.Start=1]=`Start`,e[e.Entire=2]=`Entire`,e[e.Mid=3]=`Mid`,e[e.End=4]=`End`,e[e.PostEnd=5]=`PostEnd`,e))(dje||{}),fje=class{constructor(){this.goSubtree=!0,this.lineIndex=new Z9,this.endBranch=[],this.state=2,this.initialText=``,this.trailingText=``,this.lineIndex.root=new Q9,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=``),e=e?this.initialText+e+this.trailingText:this.initialText+this.trailingText;let n=Z9.linesFromText(e).lines;n.length>1&&n[n.length-1]===``&&n.pop();let r,i;for(let e=this.endBranch.length-1;e>=0;e--)this.endBranch[e].updateCounts(),this.endBranch[e].charCount()===0&&(i=this.endBranch[e],r=e>0?this.endBranch[e-1]:this.branchNode);i&&r.remove(i);let a=this.startPath[this.startPath.length-1];if(n.length>0)if(a.text=n[0],n.length>1){let e=Array(n.length-1),t=a;for(let t=1;t<n.length;t++)e[t-1]=new $9(n[t]);let r=this.startPath.length-2;for(;r>=0;){let n=this.startPath[r];e=n.insertAt(t,e),r--,t=n}let i=e.length;for(;i>0;){let t=new Q9;t.add(this.lineIndex.root),e=t.insertAt(this.lineIndex.root,e),i=e.length,this.lineIndex.root=t}this.lineIndex.root.updateCounts()}else for(let e=this.startPath.length-2;e>=0;e--)this.startPath[e].updateCounts();else{this.startPath[this.startPath.length-2].remove(a);for(let e=this.startPath.length-2;e>=0;e--)this.startPath[e].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,r,i){let a=this.stack[this.stack.length-1];this.state===2&&i===1&&(this.state=1,this.branchNode=a,this.lineCollectionAtBranch=n);let o;function s(e){return e.isLeaf()?new $9(``):new Q9}switch(i){case 0:this.goSubtree=!1,this.state!==4&&a.add(n);break;case 1:this.state===4?this.goSubtree=!1:(o=s(n),a.add(o),this.startPath.push(o));break;case 2:this.state===4?n.isLeaf()||(o=s(n),a.add(o),this.endBranch.push(o)):(o=s(n),a.add(o),this.startPath.push(o));break;case 3:this.goSubtree=!1;break;case 4:this.state===4?n.isLeaf()||(o=s(n),a.add(o),this.endBranch.push(o)):this.goSubtree=!1;break;case 5:this.goSubtree=!1,this.state!==1&&a.add(n);break}this.goSubtree&&this.stack.push(o)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):(this.state===2&&(this.initialText=n.text.substring(0,e)),this.trailingText=n.text.substring(e+t))}},pje=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return Cc(yc(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Y9=class e{constructor(){this.changes=[],this.versions=Array(e.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%e.maxVersions}currentVersionToIndex(){return this.currentVersion%e.maxVersions}edit(t,n,r){this.changes.push(new pje(t,n,r)),(this.changes.length>e.changeNumberThreshold||n>e.changeLengthThreshold||r&&r.length>e.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(let e of this.changes)n=n.edit(e.pos,e.deleteLen,e.insertedText);t=new mje(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=e.maxVersions&&(this.minVersion=this.currentVersion-e.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(e){return this._getSnapshot().index.lineNumberToInfo(e)}lineOffsetToPosition(e,t){return this._getSnapshot().index.absolutePositionOfStartOfLine(e)+(t-1)}positionToLineOffset(e){return this._getSnapshot().index.positionToLineOffset(e)}lineToTextSpan(e){let t=this._getSnapshot().index,{lineText:n,absolutePosition:r}=t.lineNumberToInfo(e+1);return yc(r,n===void 0?t.absolutePositionOfStartOfLine(e+2)-r:n.length)}getTextChangesBetweenVersions(e,t){if(e<t)if(e>=this.minVersion){let n=[];for(let r=e+1;r<=t;r++){let e=this.versions[this.versionToIndex(r)];for(let t of e.changesSincePreviousVersion)n.push(t.getTextChangeRange())}return Tc(n)}else return;else return wc}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let n=new e,r=new mje(0,n,new Z9);n.versions[n.currentVersion]=r;let i=Z9.linesFromText(t);return r.index.load(i.lines),n}};Y9.changeNumberThreshold=8,Y9.changeLengthThreshold=256,Y9.maxVersions=8;var X9=Y9,mje=class e{constructor(e,t,n,r=t9){this.version=e,this.cache=t,this.index=n,this.changesSincePreviousVersion=r}getText(e,t){return this.index.getText(e,t-e)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof e&&this.cache===t.cache)return this.version<=t.version?wc:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},Z9=class e{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(e){return this.lineNumberToInfo(e).absolutePosition}positionToLineOffset(e){let{oneBasedLine:t,zeroBasedColumn:n}=this.root.charOffsetToLineInfo(1,e);return{line:t,offset:n+1}}positionToColumnAndLineText(e){return this.root.charOffsetToLineInfo(1,e)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(e){if(e<=this.getLineCount()){let{position:t,leaf:n}=this.root.lineNumberToInfo(e,0);return{absolutePosition:t,lineText:n&&n.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let n=[];for(let e=0;e<t.length;e++)n[e]=new $9(t[e]);this.root=e.buildTreeFromBottom(n)}else this.root=new Q9}walk(e,t,n){this.root.walk(e,t,n)}getText(e,t){let n=``;return t>0&&e<this.root.charCount()&&this.walk(e,t,{goSubtree:!0,done:!1,leaf:(e,t,r)=>{n=n.concat(r.text.substring(e,e+t))}}),n}getLength(){return this.root.charCount()}every(e,t,n){n||=this.root.charCount();let r={goSubtree:!0,done:!1,leaf(t,n,r){e(r,t,n)||(this.done=!0)}};return this.walk(t,n-t,r),!r.done}edit(t,n,r){if(this.root.charCount()===0)return H.assert(n===0),r===void 0?void 0:(this.load(e.linesFromText(r).lines),this);{let e;if(this.checkEdits){let i=this.getText(0,this.root.charCount());e=i.slice(0,t)+r+i.slice(t+n)}let i=new fje,a=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let e=this.getText(t,1);r=r?e+r:e,n=0,a=!0}else if(n>0){let e=t+n,{zeroBasedColumn:i,lineText:a}=this.positionToColumnAndLineText(e);i===0&&(n+=a.length,r=r?r+a:a)}if(this.root.walk(t,n,i),i.insertLines(r,a),this.checkEdits){let t=i.lineIndex.getText(0,i.lineIndex.getLength());H.assert(e===t,`buffer edit mismatch`)}return i.lineIndex}}static buildTreeFromBottom(e){if(e.length<J9)return new Q9(e);let t=Array(Math.ceil(e.length/J9)),n=0;for(let r=0;r<t.length;r++){let i=Math.min(n+J9,e.length);t[r]=new Q9(e.slice(n,i)),n=i}return this.buildTreeFromBottom(t)}static linesFromText(e){let t=ss(e);if(t.length===0)return{lines:[],lineMap:t};let n=Array(t.length),r=t.length-1;for(let i=0;i<r;i++)n[i]=e.substring(t[i],t[i+1]);let i=e.substring(t[r]);return i.length>0?n[r]=i:n.pop(),{lines:n,lineMap:t}}},Q9=class e{constructor(e=[]){this.children=e,this.totalChars=0,this.totalLines=0,e.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let e of this.children)this.totalChars+=e.charCount(),this.totalLines+=e.lineCount()}execWalk(e,t,n,r,i){return n.pre&&n.pre(e,t,this.children[r],this,i),n.goSubtree?(this.children[r].walk(e,t,n),n.post&&n.post(e,t,this.children[r],this,i)):n.goSubtree=!0,n.done}skipChild(e,t,n,r,i){r.pre&&!r.done&&(r.pre(e,t,this.children[n],this,i),r.goSubtree=!0)}walk(e,t,n){if(this.children.length===0)return;let r=0,i=this.children[r].charCount(),a=e;for(;a>=i;)this.skipChild(a,t,r,n,0),a-=i,r++,i=this.children[r].charCount();if(a+t<=i){if(this.execWalk(a,t,n,r,2))return}else{if(this.execWalk(a,i-a,n,r,1))return;let e=t-(i-a);for(r++,i=this.children[r].charCount();e>i;){if(this.execWalk(0,i,n,r,3))return;e-=i,r++,i=this.children[r].charCount()}if(e>0&&this.execWalk(0,e,n,r,4))return}if(n.pre){let e=this.children.length;if(r<e-1)for(let t=r+1;t<e;t++)this.skipChild(0,0,t,n,5)}}charOffsetToLineInfo(e,t){if(this.children.length===0)return{oneBasedLine:e,zeroBasedColumn:t,lineText:void 0};for(let n of this.children)if(n.charCount()>t)return n.isLeaf()?{oneBasedLine:e,zeroBasedColumn:t,lineText:n.text}:n.charOffsetToLineInfo(e,t);else t-=n.charCount(),e+=n.lineCount();let n=this.lineCount();return n===0?{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0}:{oneBasedLine:n,zeroBasedColumn:H.checkDefined(this.lineNumberToInfo(n,0).leaf).charCount(),lineText:void 0}}lineNumberToInfo(e,t){for(let n of this.children){let r=n.lineCount();if(r>=e)return n.isLeaf()?{position:t,leaf:n}:n.lineNumberToInfo(e,t);e-=r,t+=n.charCount()}return{position:t,leaf:void 0}}splitAfter(t){let n,r=this.children.length;t++;let i=t;if(t<r){for(n=new e;t<r;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=i,n}remove(e){let t=this.findChildIndex(e),n=this.children.length;if(t<n-1)for(let e=t;e<n-1;e++)this.children[e]=this.children[e+1];this.children.pop()}findChildIndex(e){let t=this.children.indexOf(e);return H.assert(t!==-1),t}insertAt(t,n){let r=this.findChildIndex(t),i=this.children.length,a=n.length;if(i<J9&&r===i-1&&a===1)return this.add(n[0]),this.updateCounts(),[];{let t=this.splitAfter(r),i=0;for(r++;r<J9&&i<a;)this.children[r]=n[i],r++,i++;let o=[],s=0;if(i<a){s=Math.ceil((a-i)/J9),o=Array(s);let t=0;for(let t=0;t<s;t++)o[t]=new e;let r=o[0];for(;i<a;)r.add(n[i]),i++,r.children.length===J9&&(t++,r=o[t]);for(let e=o.length-1;e>=0;e--)o[e].children.length===0&&o.pop()}t&&o.push(t),this.updateCounts();for(let e=0;e<s;e++)o[e].updateCounts();return o}}add(e){this.children.push(e),H.assert(this.children.length<=J9)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},$9=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},hje=class e{constructor(e,t,n,r,i,a){this.telemetryEnabled=e,this.logger=t,this.host=n,this.globalTypingsCacheLocation=r,this.event=i,this.maxActiveRequestCount=a,this.activeRequestCount=0,this.requestQueue=pt(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(e){return SY.validatePackageName(e)===SY.NameValidationResult.Ok?(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:`typesRegistry`})),!!this.typesRegistryCache?.has(e)):!1}installPackage(e){this.packageInstallId++;let t={kind:`installPackage`,...e,id:this.packageInstallId},n=new Promise((e,t)=>{(this.packageInstalledPromise??=new Map).set(this.packageInstallId,{resolve:e,reject:t})});return this.installer.send(t),n}attach(e){this.projectService=e,this.installer=this.createInstallerProcess()}onProjectClosed(e){this.installer.send({projectName:e.getProjectName(),kind:`closeProject`})}enqueueInstallTypingsRequest(e,t,n){let r=$Oe(e,t,n);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${LY(r)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(r):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${r.projectName}`),this.requestQueue.enqueue(r),this.requestMap.set(r.projectName,r))}handleMessage(e){var t;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${LY(e)}`),e.kind){case EY:this.typesRegistryCache=new Map(Object.entries(e.typesRegistry));break;case TY:{let n=this.packageInstalledPromise?.get(e.id);H.assertIsDefined(n,`Should find the promise for package install`),(t=this.packageInstalledPromise)==null||t.delete(e.id),e.success?n.resolve({successMessage:e.message}):n.reject(e.message),this.projectService.updateTypingsForProject(e),this.event(e,`setTypings`);break}case kY:{let t={message:e.message};this.event(t,`typesInstallerInitializationFailed`);break}case DY:{let t={eventId:e.eventId,packages:e.packagesToInstall};this.event(t,`beginInstallTypes`);break}case OY:{if(this.telemetryEnabled){let t={telemetryEventName:`typingsInstalled`,payload:{installedPackages:e.packagesToInstall.join(`,`),installSuccess:e.installSuccess,typingsInstallerVersion:e.typingsInstallerVersion}};this.event(t,`telemetry`)}let t={eventId:e.eventId,packages:e.packagesToInstall,success:e.installSuccess};this.event(t,`endInstallTypes`);break}case wY:this.projectService.updateTypingsForProject(e);break;case CY:for(this.activeRequestCount>0?this.activeRequestCount--:H.fail(`TIAdapter:: Received too many responses`);!this.requestQueue.isEmpty();){let e=this.requestQueue.dequeue();if(this.requestMap.get(e.projectName)===e){this.requestMap.delete(e.projectName),this.scheduleRequest(e);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${e.projectName}`)}this.projectService.updateTypingsForProject(e),this.event(e,`setTypings`);break;case AY:this.projectService.watchTypingLocations(e);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${LY(t)}`),this.installer.send(t)},e.requestDelayMillis,`${t.projectName}::${t.kind}`)}};hje.requestDelayMillis=100;var gje=hje,_je={};r(_je,{ActionInvalidate:()=>wY,ActionPackageInstalled:()=>TY,ActionSet:()=>CY,ActionWatchTypingLocations:()=>AY,Arguments:()=>jY,AutoImportProviderProject:()=>zke,AuxiliaryProject:()=>Lke,CharRangeSection:()=>dje,CloseFileWatcherEvent:()=>O9,CommandNames:()=>PAe,ConfigFileDiagEvent:()=>C9,ConfiguredProject:()=>Bke,ConfiguredProjectLoadKind:()=>eAe,CreateDirectoryWatcherEvent:()=>D9,CreateFileWatcherEvent:()=>E9,Errors:()=>n9,EventBeginInstallTypes:()=>DY,EventEndInstallTypes:()=>OY,EventInitializationFailed:()=>kY,EventTypesRegistry:()=>EY,ExternalProject:()=>d9,GcTimer:()=>ske,InferredProject:()=>Ike,LargeFileReferencedEvent:()=>S9,LineIndex:()=>Z9,LineLeaf:()=>$9,LineNode:()=>Q9,LogLevel:()=>ZOe,Msg:()=>QOe,OpenFileInfoTelemetryEvent:()=>Vke,Project:()=>u9,ProjectInfoTelemetryEvent:()=>T9,ProjectKind:()=>c9,ProjectLanguageServiceStateEvent:()=>w9,ProjectLoadingFinishEvent:()=>x9,ProjectLoadingStartEvent:()=>b9,ProjectService:()=>SAe,ProjectsUpdatedInBackgroundEvent:()=>y9,ScriptInfo:()=>bke,ScriptVersionCache:()=>X9,Session:()=>QAe,TextStorage:()=>yke,ThrottledOperations:()=>oke,TypingsInstallerAdapter:()=>gje,allFilesAreJsOrDts:()=>Dke,allRootFilesAreJsOrDts:()=>Eke,asNormalizedPath:()=>a9,convertCompilerOptions:()=>A9,convertFormatOptions:()=>k9,convertScriptKindName:()=>N9,convertTypeAcquisition:()=>Jke,convertUserPreferences:()=>Yke,convertWatchOptions:()=>j9,countEachFileTypes:()=>l9,createInstallTypingsRequest:()=>$Oe,createModuleSpecifierCache:()=>EAe,createNormalizedPathMap:()=>eke,createPackageJsonCache:()=>DAe,createSortedArray:()=>ake,emptyArray:()=>t9,findArgument:()=>NY,formatDiagnosticToProtocol:()=>U9,formatMessage:()=>FAe,getBaseConfigFileName:()=>o9,getDetailWatchInfo:()=>R9,getLocationInNewDocument:()=>oje,hasArgument:()=>MY,hasNoTypeScriptSource:()=>Oke,indent:()=>IY,isBackgroundProject:()=>h9,isConfigFile:()=>wAe,isConfiguredProject:()=>p9,isDynamicFileName:()=>s9,isExternalProject:()=>m9,isInferredProject:()=>f9,isInferredProjectName:()=>tke,isProjectDeferredClose:()=>g9,makeAutoImportProviderProjectName:()=>rke,makeAuxiliaryProjectName:()=>ike,makeInferredProjectName:()=>nke,maxFileSize:()=>v9,maxProgramSizeForNonTsFiles:()=>_9,normalizedPathToPath:()=>i9,nowString:()=>PY,nullCancellationToken:()=>OAe,nullTypingsInstaller:()=>I9,protocol:()=>cke,scriptInfoIsContainedByBackgroundProject:()=>Cke,scriptInfoIsContainedByDeferredClosedProject:()=>wke,stringifyIndented:()=>LY,toEvent:()=>LAe,toNormalizedPath:()=>r9,tryConvertScriptKindName:()=>M9,typingsInstaller:()=>WOe,updateProjectIfDirty:()=>z9}),typeof console<`u`&&(H.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return r},set exports(e){r=e,n!==void 0&&n.exports&&(n.exports=e)}})})),Ht=e.bt(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),Ut=e.bt(((e,t)=>{var n=Ht();t.exports=m;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`,c=1e5,l=4e6;function u(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function d(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function f(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function p(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=p(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function m(e,t){if(!e)return[];t||={};var n=t.max==null?c:t.max,r=t.maxLength==null?l:t.maxLength;return e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),x(d(e),n,r,!0).map(f)}function h(e){return`{`+e+`}`}function g(e){return/^-?0\d/.test(e)}function _(e,t){return e<=t}function v(e,t){return e>=t}function y(e,t,n,r,i,a){for(var o=[],s=0,c=0;c<e.length;c++)for(var l=0;l<n.length;l++){if(o.length>=r)return o;var u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function b(e,t,n,r){var i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;var o=u(i[0]),s=u(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(u(i[2])),1):1,d=_;s<o&&(l*=-1,d=v);for(var f=i.some(g),p=0,m=o;d(m,s)&&a.length<n;m+=l){var h;if(t)h=String.fromCharCode(m),h===`\\`&&(h=``);else if(h=String(m),f){var y=c-h.length;if(y>0){var b=Array(y+1).join(`0`);h=m<0?`-`+b+h.slice(1):b+h}}if(p+h.length>r)break;a.push(h),p+=h.length}return a}function x(e,t,r,i){for(var o=[``],s=!1,c=!0;;){let D=n(`{`,`}`,e);if(!D)return y(o,e,[``],t,r,s);let O=D.pre;if(/\$$/.test(O)){if(o=y(o,O+`{`+D.body+`}`,[``],t,r,s&&!D.post.length),c=!1,!D.post.length)break;e=D.post;continue}var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(D.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(D.body),d=l||u,f=D.body.indexOf(`,`)>=0;if(!d&&!f){if(D.post.match(/,(?!,).*\}/)){e=D.pre+`{`+D.body+a+D.post,i=!0;continue}return y(o,O+`{`+D.body+`}`+D.post,[``],t,r,s)}c&&=(s=i&&!d,!1);var m;if(d)m=b(D.body,u,t,r);else{var g=p(D.body);if(g.length===1&&g[0]!==void 0&&(g=x(g[0],t,r,!1).map(h),g.length===1)){if(o=y(o,O+g[0],[``],t,r,s&&!D.post.length),!D.post.length)break;e=D.post;continue}for(var _=s&&!D.post.length&&!O,v=0;_&&v<o.length;v++)o[v]&&(_=!1);m=[];var S=0;outer:for(var C=0;C<g.length;C++)for(var w=x(g[C],t,r,!1),T=0;T<w.length;T++){var E=w[T];if(!(_&&!E)){if(m.length>=t||S+E.length>r)break outer;m.push(E),S+=E.length}}}if(o=y(o,O,m,t,r,s&&!D.post.length),!D.post.length)break;e=D.post}return o}})),Wt=e.bt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assertValidPattern=void 0;var t=1024*64;e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>t)throw TypeError(`pattern is too long`)}})),Gt=e.bt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseClass=void 0;var t={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;WHILE:for(;l<e.length;){let r=e.charAt(l);if((r===`!`||r===`^`)&&l===o+1){p=!0,l++;continue}if(r===`]`&&u&&!f){m=l+1;break}if(u=!0,r===`\\`&&!f){f=!0,l++;continue}if(r===`[`&&!f){for(let[n,[r,i,a]]of Object.entries(t))if(e.startsWith(n,l)){if(h)return[`$.`,!1,e.length-o,!0];l+=n.length,a?c.push(r):s.push(r),d||=i;continue WHILE}}if(f=!1,h){r>h?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m<l)return[``,!1,0,!1];if(!s.length&&!c.length)return[`$.`,!1,e.length-o,!0];if(c.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!p)return[r(s[0].length===2?s[0].slice(-1):s[0]),!1,m-o,!1];let g=`[`+(p?`^`:``)+i(s)+`]`,_=`[`+(p?``:`^`)+i(c)+`]`;return[s.length&&c.length?`(`+g+`|`+_+`)`:s.length?g:_,d,m-o,!0]}})),Kt=e.bt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`)})),qt=e.bt((e=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.AST=void 0;var n=Gt(),r=Kt(),i=new Set([`!`,`?`,`+`,`*`,`@`]),a=e=>i.has(e),o=e=>a(e.type),s=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),c=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),l=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),u=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),d=`(?!(?:^|/)\\.\\.?(?:$|/))`,f=`(?!\\.)`,p=new Set([`[`,`.`]),m=new Set([`..`,`.`]),h=new Set(`().*{}+?[]^$\\!`),g=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),_=`[^/]`,v=`[^/]*?`,y=`[^/]+?`,b=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let n of e)if(n!==``){if(typeof n!=`string`&&!(n instanceof t&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let n=0;n<this.#a;n++){let r=e.#r[n];if(!(r instanceof t&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let e of this.#r)n.copyIn(e);return n}static#f(e,n,r,i,o){let s=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,d=!1;if(n.type===null){let f=r,p=``;for(;f<e.length;){let r=e.charAt(f++);if(c||r===`\\`){c=!c,p+=r;continue}if(l){f===u+1?(r===`^`||r===`!`)&&(d=!0):r===`]`&&!(f===u+2&&d)&&(l=!1),p+=r;continue}else if(r===`[`){l=!0,u=f,d=!1,p+=r;continue}if(!i.noext&&a(r)&&e.charAt(f)===`(`&&o<=s){n.push(p),p=``;let a=new t(r,n);f=t.#f(e,a,f,i,o+1),n.push(a);continue}p+=r}return n.push(p),f}let f=r+1,p=new t(null,n),m=[],h=``;for(;f<e.length;){let r=e.charAt(f++);if(c||r===`\\`){c=!c,h+=r;continue}if(l){f===u+1?(r===`^`||r===`!`)&&(d=!0):r===`]`&&!(f===u+2&&d)&&(l=!1),h+=r;continue}else if(r===`[`){l=!0,u=f,d=!1,h+=r;continue}if(a(r)&&e.charAt(f)===`(`&&(o<=s||n&&n.#h(r))){let a=n&&n.#h(r)?0:1;p.push(h),h=``;let s=new t(r,p);p.push(s),f=t.#f(e,s,f,i,o+a);continue}if(r===`|`){p.push(h),h=``,m.push(p),p=new t(null,n);continue}if(r===`)`)return h===``&&n.#r.length===0&&(n.#u=!0),p.push(h),h=``,n.push(...m,p),f;h+=r}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],f}#p(e){return this.#m(e,c)}#m(e,t=s){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=l){return!!t.get(this.type)?.includes(e)}#g(e,n){let r=e.#r[0],i=new t(null,r,this.options);i.#r.push(``),r.push(i),this.#_(e,n)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!u.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=u.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}#x(){if(o(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#f(e,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let n=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!o(this)){let i=this.isStart()&&this.isEnd(),a=this.#r.map(n=>{let[r,a,o,s]=typeof n==`string`?t.#C(n,this.#t,i):n.toRegExpSource(e);return this.#t=this.#t||o,this.#n=this.#n||s,r}).join(``),o=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&m.has(this.#r[0]))){let t=p,r=n&&t.has(a.charAt(0))||a.startsWith(`\\.`)&&t.has(a.charAt(2))||a.startsWith(`\\.\\.`)&&t.has(a.charAt(4)),i=!n&&!e&&t.has(a.charAt(0));o=r?d:i?f:``}let s=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(s=`(?:$|\\/)`),[o+a+s,(0,r.unescape)(a),this.#t=!!this.#t,this.#n]}let i=this.type===`*`||this.type===`+`,a=this.type===`!`?`(?:(?!(?:`:`(?:`,s=this.#S(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,(0,r.unescape)(this.toString()),!1,!1]}let c=!i||e||n?``:this.#S(!0);c===s&&(c=``),c&&(s=`(?:${s})(?:${c})*?`);let l=``;if(this.type===`!`&&this.#u)l=(this.isStart()&&!n?f:``)+y;else{let t=this.type===`!`?`))`+(this.isStart()&&!n&&!e?f:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&c?`)`:this.type===`*`&&c?`)?`:`)${this.type}`;l=a+s+t}return[l,(0,r.unescape)(s),this.#t=!!this.#t,this.#n]}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,i=!1){let a=!1,o=``,s=!1,c=!1;for(let r=0;r<e.length;r++){let l=e.charAt(r);if(a){a=!1,o+=(h.has(l)?`\\`:``)+l,c=!1;continue}if(l===`\\`){r===e.length-1?o+=`\\\\`:a=!0;continue}if(l===`[`){let[i,a,l,u]=(0,n.parseClass)(e,r);if(l){o+=i,s||=a,r+=l-1,t||=u,c=!1;continue}}if(l===`*`){if(c)continue;c=!0,o+=i&&/^[*]+$/.test(e)?y:v,t=!0;continue}else c=!1;if(l===`?`){o+=_,t=!0;continue}o+=g(l)}return[o,(0,r.unescape)(e),!!t,s]}};e.AST=b,t=b})),Jt=e.bt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)})),Yt=e.bt((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;var n=t(Ut()),r=Wt(),i=qt(),a=Jt(),o=Kt();e.minimatch=(e,t,n={})=>((0,r.assertValidPattern)(t),!n.nocomment&&t.charAt(0)===`#`?!1:new j(t,n).match(e));var s=/^\*+([^+@!?\*\[\(]*)$/,c=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),l=e=>t=>t.endsWith(e),u=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),d=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),f=/^\*+\.\*+$/,p=e=>!e.startsWith(`.`)&&e.includes(`.`),m=e=>e!==`.`&&e!==`..`&&e.includes(`.`),h=/^\.\*+$/,g=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),_=/^\*+$/,v=e=>e.length!==0&&!e.startsWith(`.`),y=e=>e.length!==0&&e!==`.`&&e!==`..`,b=/^\?+([^+@!?\*\[\(]*)?$/,x=([e,t=``])=>{let n=T([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},S=([e,t=``])=>{let n=E([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},C=([e,t=``])=>{let n=E([e]);return t?e=>n(e)&&e.endsWith(t):n},w=([e,t=``])=>{let n=T([e]);return t?e=>n(e)&&e.endsWith(t):n},T=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},E=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},D=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,O={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=D===`win32`?O.win32.sep:O.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR;var ee=`[^/]*?`,k=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,te=`(?:(?!(?:\\/|^)\\.).)*?`;e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;var ne=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,ne(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,ne(t,n))}static defaults(e){return n.defaults(ne(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,ne(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,ne(t,r))}},unescape:(e,r={})=>n.unescape(e,ne(t,r)),escape:(e,r={})=>n.escape(e,ne(t,r)),filter:(e,r={})=>n.filter(e,ne(t,r)),defaults:e=>n.defaults(ne(t,e)),makeRe:(e,r={})=>n.makeRe(e,ne(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,ne(t,r)),match:(e,r,i={})=>n.match(e,r,ne(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,t={})=>((0,r.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,n.default)(e)),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new j(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new j(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;var re=/[?*]|[+@!]\(.*?\)|\[|\]/,A=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),j=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){(0,r.assertValidPattern)(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||D,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!re.test(e[2]))&&!re.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(t,n,r=!1){let i=0,a=0;if(this.isWindows){let e=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),r=!e&&t[0]===``&&t[1]===``&&t[2]===`?`&&/^[a-z]:$/i.test(t[3]),o=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),s=!o&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),c=r?3:e?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[e,r]=[t[c],n[l]];e.toLowerCase()===r.toLowerCase()&&(n[l]=e,a=l,i=c)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(e.GLOBSTAR)?this.#e(t,n,r,i,a):this.#n(t,n,r,i,a)}#e(t,n,r,i,a){let o=n.indexOf(e.GLOBSTAR,a),s=n.lastIndexOf(e.GLOBSTAR),[c,l,u]=r?[n.slice(a,o),n.slice(o+1),[]]:[n.slice(a,o),n.slice(o+1,s),n.slice(s+1)];if(c.length){let e=t.slice(i,i+c.length);if(!this.#n(e,c,r,0,0))return!1;i+=c.length}let d=0;if(u.length){if(u.length+i>t.length)return!1;let e=t.length-u.length;if(this.#n(t,u,r,e,0))d=u.length;else{if(t[t.length-1]!==``||i+u.length===t.length||(e--,!this.#n(t,u,r,e,0)))return!1;d=u.length+1}}if(!l.length){let e=!!d;for(let n=i;n<t.length-d;n++){let r=String(t[n]);if(e=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return r||e}let f=[[[],0]],p=f[0],m=0,h=[0];for(let t of l)t===e.GLOBSTAR?(h.push(m),p=[[],0],f.push(p)):(p[0].push(t),m++);let g=f.length-1,_=t.length-d;for(let e of f)e[1]=_-(h[g--]+e[0].length);return!!this.#t(t,f,i,0,r,0,!!d)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(t,n,r,i,a){let o,s,c,l;for(o=i,s=a,l=t.length,c=n.length;o<l&&s<c;o++,s++){this.debug(`matchOne loop`);let r=n[s],i=t[o];if(this.debug(n,r,i),r===!1||r===e.GLOBSTAR)return!1;let a;if(typeof r==`string`?(a=i===r,this.debug(`string match`,r,i,a)):(a=r.test(i),this.debug(`pattern match`,r,i,a)),!a)return!1}if(o===l&&s===c)return!0;if(o===l)return r;if(s===c)return o===l-1&&t[o]===``;throw Error(`wtf?`)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,r.assertValidPattern)(t);let n=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let a,o=null;(a=t.match(_))?o=n.dot?y:v:(a=t.match(s))?o=(n.nocase?n.dot?d:u:n.dot?l:c)(a[1]):(a=t.match(b))?o=(n.nocase?n.dot?S:x:n.dot?C:w)(a):(a=t.match(f))?o=n.dot?m:p:(a=t.match(h))&&(o=g);let T=i.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof T==`object`&&Reflect.defineProperty(T,"test",{value:o}),T}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?ee:n.dot?k:te,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?A(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});return n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))}),n.filter(t=>t!==e.GLOBSTAR).join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};e.Minimatch=j;var M=qt();Object.defineProperty(e,"AST",{enumerable:!0,get:function(){return M.AST}});var N=Jt();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return N.escape}});var P=Kt();Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return P.unescape}}),e.minimatch.AST=i.AST,e.minimatch.Minimatch=j,e.minimatch.escape=a.escape,e.minimatch.unescape=o.unescape})),Xt=e.bt(((e,t)=>{function n(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function r(e,t){for(var n=``,r=0,i=-1,a=0,o,s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var c=n.lastIndexOf(`/`);if(c!==n.length-1){c===-1?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}function i(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}var a={resolve:function(){for(var e=``,t=!1,i,a=arguments.length-1;a>=-1&&!t;a--){var o;a>=0?o=arguments[a]:(i===void 0&&(i=process.cwd()),o=i),n(o),o.length!==0&&(e=o+`/`+e,t=o.charCodeAt(0)===47)}return e=r(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`},normalize:function(e){if(n(e),e.length===0)return`.`;var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=r(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&i&&(e+=`/`),t?`/`+e:e},isAbsolute:function(e){return n(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,t=0;t<arguments.length;++t){var r=arguments[t];n(r),r.length>0&&(e===void 0?e=r:e+=`/`+r)}return e===void 0?`.`:a.normalize(e)},relative:function(e,t){if(n(e),n(t),e===t||(e=a.resolve(e),t=a.resolve(t),e===t))return``;for(var r=1;r<e.length&&e.charCodeAt(r)===47;++r);for(var i=e.length,o=i-r,s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(t.charCodeAt(s+d)===47)return t.slice(s+d+1);if(d===0)return t.slice(s+d)}else o>l&&(e.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(r+d);if(f!==t.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=r+u+1;d<=i;++d)(d===i||e.charCodeAt(d)===47)&&(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(n(e),e.length===0)return`.`;for(var t=e.charCodeAt(0),r=t===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);n(e);var r=0,i=-1,a=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;var s=t.length-1,c=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!a){r=o+1;break}}else c===-1&&(a=!1,c=o+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=c))}return r===i?i=c:i===-1&&(i=e.length),e.slice(r,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!a){r=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?``:e.slice(r,i)}},extname:function(e){n(e);for(var t=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),c===46?t===-1?t=s:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||i===-1||o===0||o===1&&t===i-1&&t===r+1?``:e.slice(t,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return i(`/`,e)},parse:function(e){n(e);var t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;var r=e.charCodeAt(0),i=r===47,a;i?(t.root=`/`,a=1):a=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=a;--u){if(r=e.charCodeAt(u),r===47){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),r===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(s===0&&i?t.base=t.name=e.slice(1,c):t.base=t.name=e.slice(s,c)):(s===0&&i?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(s,o),t.base=e.slice(s,c)),t.ext=e.slice(o,c)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};a.posix=a,t.exports=a})),Zt=e.bt((e=>{var n=Vt(),r=Yt(),i=t.Tt(),a=require("fs"),o=require("fs/promises"),s=require("os"),c=require("path");function l(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}function u(e){if(e&&typeof e==`object`&&`default`in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var d=u(n),f=u(r),p=l(i),m=u(a),h=u(o),g=u(s),_=u(c),v=class{#e=new Map;getSize(){return this.#e.size}getValues(){return this.#e.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#e.keys()}getEntries(){return this.#e.entries()}getOrCreate(e,t){let n=this.get(e);return n??(n=t(),this.set(e,n)),n}has(e){return this.#e.has(e)}get(e){return this.#e.get(e)}set(e,t){this.#e.set(e,t)}replaceKey(e,t){if(!this.#e.has(e))throw Error(`Key not found.`);let n=this.#e.get(e);this.#e.delete(e),this.#e.set(t,n)}removeByKey(e){this.#e.delete(e)}clear(){this.#e.clear()}},y=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}compareTo(e){return this.#e.compareTo(this.#t,e)}},b=class e{static instance=new e;compareTo(e,t){let n=e.localeCompare(t,`en-us-u-kf-upper`);return n<0?-1:n===0?0:1}},x=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}compareTo(e,t){return this.#e.compareTo(this.#t(e),this.#t(t))}},S=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}compareTo(e){return this.#e.compareTo(this.#t(e))}},C=class{constructor(){}static isReadonlyArray(e){return e instanceof Array}static isNullOrEmpty(e){return!(e instanceof Array)||e.length===0}static getUniqueItems(e){return e.filter((t,n)=>e.indexOf(t)===n)}static removeFirst(e,t){let n=e.indexOf(t);return n===-1?!1:(e.splice(n,1),!0)}static removeAll(e,t){let n=[];for(let r=e.length-1;r>=0;r--)t(e[r])&&(n.push(e[r]),e.splice(r,1));return n}static*toIterator(e){for(let t of e)yield t}static sortByProperty(e,t){return e.sort((e,n)=>t(e)<=t(n)?-1:1),e}static groupBy(e,t){let n=[],r={};for(let i of e){let e=t(i).toString();r[e]??(r[e]=[],n.push(r[e])),r[e].push(i)}return n}static binaryInsertWithOverwrite(e,t,n){let r=e.length-1,i=0;for(;i<=r;){let a=Math.floor((r+i)/2);n.compareTo(t,e[a])<0?r=a-1:i=a+1}e[r]!=null&&n.compareTo(t,e[r])===0?e[r]=t:e.splice(r+1,0,t)}static binarySearch(e,t){let n=e.length-1,r=0;for(;r<=n;){let i=Math.floor((n+r)/2),a=t.compareTo(e[i]);if(a===0)return i;a<0?n=i-1:r=i+1}return-1}static containsSubArray(e,t){let n=0;for(let r of e)if(t[n]===r){if(n++,n===t.length)return!0}else n=0;return!1}};function w(e){return t(e);function t(e){let t=Object.create(e.constructor.prototype);for(let n of Object.keys(e))t[n]=r(e[n]);return t}function n(e){return e.map(r)}function r(e){return e instanceof Array?n(e):typeof e==`object`?e===null?e:t(e):e}}var T=class{#e=[];subscribe(e){this.#t(e)===-1&&this.#e.push(e)}unsubscribe(e){let t=this.#t(e);t>=0&&this.#e.splice(t,1)}fire(e){for(let t of this.#e)t(e)}#t(e){return this.#e.indexOf(e)}},E=class{static find(e,t){for(let n of e)if(t(n))return n}};function D(e,t){return t??e}var O=class e{constructor(){}static clone(t){if(t==null)return;if(t instanceof Array)return n(t);return Object.assign({},t);function n(t){return t.map(t=>e.clone(t))}}};function ee(e,t,n,r,i,a,o,s,c,l){return d.matchFiles.apply(this,arguments)}function k(e,t,n,r,i){return d.getFileMatcherPatterns.apply(this,arguments)}function te(e){return d.getEmitModuleResolutionKind.apply(this,arguments)}function ne(e){return A()[e]}var re=void 0;function A(){if(re!=null)return re;re={};for(let e of Object.keys(d.SyntaxKind).filter(e=>isNaN(parseInt(e,10)))){let t=d.SyntaxKind[e];re[t]??(re[t]=e)}return re}e.errors=void 0,(function(e){class t extends Error{constructor(e,t){let n=t&&j(t),r=n?`${e}\n\n${n}`:e;super(r),this.message=r}}e.BaseError=t;class n extends t{constructor(e,t,n){super(`Argument Error (${e}): ${t}`,n)}}e.ArgumentError=n;class r extends n{constructor(e,t){super(e,`Cannot be null or whitespace.`,t)}}e.ArgumentNullOrWhitespaceError=r;class i extends n{constructor(e,t,n,r){super(e,`Range is ${n[0]} to ${n[1]}, but ${t} was provided.`,r)}}e.ArgumentOutOfRangeError=i;class a extends n{constructor(e,t,n,r){super(e,`Expected type '${t}', but was '${n}'.`,r)}}e.ArgumentTypeError=a;class o extends t{path;constructor(e,t=`Path`){super(`${t} not found: ${e}`),this.path=e}code=`ENOENT`}e.PathNotFoundError=o;class s extends o{constructor(e){super(e,`Directory`)}}e.DirectoryNotFoundError=s;class c extends o{constructor(e){super(e,`File`)}}e.FileNotFoundError=c;class l extends t{constructor(e,t){super(e,t)}}e.InvalidOperationError=l;class u extends t{constructor(e=`Not implemented.`,t){super(e,t)}}e.NotImplementedError=u;class d extends t{constructor(e){super(e)}}e.NotSupportedError=d;function f(e,t,n){if(typeof e!==t)throw new a(n,t,typeof e)}e.throwIfNotType=f;function p(e,t){if(typeof e!=`string`)throw new a(t,`string`,typeof e)}e.throwIfNotString=p;function m(e,t){if(p(e,t),e.trim().length===0)throw new r(t)}e.throwIfWhitespaceOrNotString=m;function h(e,t,n){if(e<t[0]||e>t[1])throw new i(n,e,t)}e.throwIfOutOfRange=h;function g(e,t,r){if(e[0]>e[1])throw new n(r,`The start of a range must not be greater than the end: [${e[0]}, ${e[1]}]`);h(e[0],t,r),h(e[1],t,r)}e.throwIfRangeOutOfRange=g;function _(e,t){throw new u(`Not implemented feature for syntax kind '${ne(e)}'.`,t)}e.throwNotImplementedForSyntaxKindError=_;function v(e,t){if(e<0)throw new n(t,`Expected a non-negative value.`)}e.throwIfNegative=v;function y(e,t,n){if(e==null)throw new l(typeof t==`string`?t:t(),n);return e}e.throwIfNullOrUndefined=y;function b(e,t){let n=e;if(n!=null&&typeof n.kind==`number`)return _(n.kind,t);throw new u(`Not implemented value: ${JSON.stringify(e)}`,t)}e.throwNotImplementedForNeverValueError=b;function x(e,t,n){if(e!==t)throw new l(`Expected ${e} to equal ${t}. ${n}`)}e.throwIfNotEqual=x;function S(e,t){if(e===!0)throw new l(t)}e.throwIfTrue=S})(e.errors||={});function j(e){let t=M(e);if(t)return`${t.filePath}:${t.loc.line}:${t.loc.character}\n> ${t.loc.line} | ${t.lineText}`}function M(e){if(!N(e))return;let t=e.getSourceFile(),n=t.getFullText(),r=e.getStart(),i=n.lastIndexOf(`
792
+ `+t.stack)}finally{this.performanceData=l}}parseMessage(e){return JSON.parse(e)}toStringMessage(e){return e}getFormatOptions(e){return this.projectService.getFormatCodeOptions(e)}getPreferences(e){return this.projectService.getPreferences(e)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function $Ae(e){let t=e.diagnosticsDuration&&et(e.diagnosticsDuration,([e,t])=>({...t,file:e}));return{...e,diagnosticsDuration:t}}function q9(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(rc(e))}}function eje(e,t,n){let r=q9(e,n),i=t&&q9(t,n);return i?{...r,contextStart:i.start,contextEnd:i.end}:r}function tje(e,t){return{start:nje(t,e.span.start),end:nje(t,rc(e.span)),newText:e.newText}}function nje(e,t){return wAe(e)?ije(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function rje(e,t){let n=e.ranges.map(e=>({start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(e.start+e.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function ije(e){return{line:e.line+1,offset:e.character+1}}function aje(e){H.assert(e.textChanges.length===1);let t=Ie(e.textChanges);return H.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function oje(e,t,n,r){let{line:i,character:a}=ds(ss(sje(e,t,r)),n);return{line:i+1,offset:a+1}}function sje(e,t,n){for(let{fileName:r,textChanges:i}of n)if(r===t)for(let t=i.length-1;t>=0;t--){let{newText:n,span:{start:r,length:a}}=i[t];e=e.slice(0,r)+n+e.slice(r+a)}return e}function cje(e,{fileName:t,textSpan:n,contextSpan:r,isWriteAccess:i,isDefinition:a},{disableLineTextInReferences:o}){let s=H.checkDefined(e.getScriptInfo(t)),c=eje(n,r,s),l=o?void 0:lje(s,c);return{file:t,...c,lineText:l,isWriteAccess:i,isDefinition:a}}function lje(e,t){let n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,rc(n)).replace(/\r|\n/g,``)}function uje(e){return e===void 0||e&&typeof e==`object`&&typeof e.exportName==`string`&&(e.fileName===void 0||typeof e.fileName==`string`)&&(e.ambientModuleName===void 0||typeof e.ambientModuleName==`string`&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport==`boolean`))}var J9=4,dje=(e=>(e[e.PreStart=0]=`PreStart`,e[e.Start=1]=`Start`,e[e.Entire=2]=`Entire`,e[e.Mid=3]=`Mid`,e[e.End=4]=`End`,e[e.PostEnd=5]=`PostEnd`,e))(dje||{}),fje=class{constructor(){this.goSubtree=!0,this.lineIndex=new Z9,this.endBranch=[],this.state=2,this.initialText=``,this.trailingText=``,this.lineIndex.root=new Q9,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=``),e=e?this.initialText+e+this.trailingText:this.initialText+this.trailingText;let n=Z9.linesFromText(e).lines;n.length>1&&n[n.length-1]===``&&n.pop();let r,i;for(let e=this.endBranch.length-1;e>=0;e--)this.endBranch[e].updateCounts(),this.endBranch[e].charCount()===0&&(i=this.endBranch[e],r=e>0?this.endBranch[e-1]:this.branchNode);i&&r.remove(i);let a=this.startPath[this.startPath.length-1];if(n.length>0)if(a.text=n[0],n.length>1){let e=Array(n.length-1),t=a;for(let t=1;t<n.length;t++)e[t-1]=new $9(n[t]);let r=this.startPath.length-2;for(;r>=0;){let n=this.startPath[r];e=n.insertAt(t,e),r--,t=n}let i=e.length;for(;i>0;){let t=new Q9;t.add(this.lineIndex.root),e=t.insertAt(this.lineIndex.root,e),i=e.length,this.lineIndex.root=t}this.lineIndex.root.updateCounts()}else for(let e=this.startPath.length-2;e>=0;e--)this.startPath[e].updateCounts();else{this.startPath[this.startPath.length-2].remove(a);for(let e=this.startPath.length-2;e>=0;e--)this.startPath[e].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,r,i){let a=this.stack[this.stack.length-1];this.state===2&&i===1&&(this.state=1,this.branchNode=a,this.lineCollectionAtBranch=n);let o;function s(e){return e.isLeaf()?new $9(``):new Q9}switch(i){case 0:this.goSubtree=!1,this.state!==4&&a.add(n);break;case 1:this.state===4?this.goSubtree=!1:(o=s(n),a.add(o),this.startPath.push(o));break;case 2:this.state===4?n.isLeaf()||(o=s(n),a.add(o),this.endBranch.push(o)):(o=s(n),a.add(o),this.startPath.push(o));break;case 3:this.goSubtree=!1;break;case 4:this.state===4?n.isLeaf()||(o=s(n),a.add(o),this.endBranch.push(o)):this.goSubtree=!1;break;case 5:this.goSubtree=!1,this.state!==1&&a.add(n);break}this.goSubtree&&this.stack.push(o)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):(this.state===2&&(this.initialText=n.text.substring(0,e)),this.trailingText=n.text.substring(e+t))}},pje=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return Cc(yc(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Y9=class e{constructor(){this.changes=[],this.versions=Array(e.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%e.maxVersions}currentVersionToIndex(){return this.currentVersion%e.maxVersions}edit(t,n,r){this.changes.push(new pje(t,n,r)),(this.changes.length>e.changeNumberThreshold||n>e.changeLengthThreshold||r&&r.length>e.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(let e of this.changes)n=n.edit(e.pos,e.deleteLen,e.insertedText);t=new mje(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=e.maxVersions&&(this.minVersion=this.currentVersion-e.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(e){return this._getSnapshot().index.lineNumberToInfo(e)}lineOffsetToPosition(e,t){return this._getSnapshot().index.absolutePositionOfStartOfLine(e)+(t-1)}positionToLineOffset(e){return this._getSnapshot().index.positionToLineOffset(e)}lineToTextSpan(e){let t=this._getSnapshot().index,{lineText:n,absolutePosition:r}=t.lineNumberToInfo(e+1);return yc(r,n===void 0?t.absolutePositionOfStartOfLine(e+2)-r:n.length)}getTextChangesBetweenVersions(e,t){if(e<t)if(e>=this.minVersion){let n=[];for(let r=e+1;r<=t;r++){let e=this.versions[this.versionToIndex(r)];for(let t of e.changesSincePreviousVersion)n.push(t.getTextChangeRange())}return Tc(n)}else return;else return wc}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let n=new e,r=new mje(0,n,new Z9);n.versions[n.currentVersion]=r;let i=Z9.linesFromText(t);return r.index.load(i.lines),n}};Y9.changeNumberThreshold=8,Y9.changeLengthThreshold=256,Y9.maxVersions=8;var X9=Y9,mje=class e{constructor(e,t,n,r=t9){this.version=e,this.cache=t,this.index=n,this.changesSincePreviousVersion=r}getText(e,t){return this.index.getText(e,t-e)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof e&&this.cache===t.cache)return this.version<=t.version?wc:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},Z9=class e{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(e){return this.lineNumberToInfo(e).absolutePosition}positionToLineOffset(e){let{oneBasedLine:t,zeroBasedColumn:n}=this.root.charOffsetToLineInfo(1,e);return{line:t,offset:n+1}}positionToColumnAndLineText(e){return this.root.charOffsetToLineInfo(1,e)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(e){if(e<=this.getLineCount()){let{position:t,leaf:n}=this.root.lineNumberToInfo(e,0);return{absolutePosition:t,lineText:n&&n.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let n=[];for(let e=0;e<t.length;e++)n[e]=new $9(t[e]);this.root=e.buildTreeFromBottom(n)}else this.root=new Q9}walk(e,t,n){this.root.walk(e,t,n)}getText(e,t){let n=``;return t>0&&e<this.root.charCount()&&this.walk(e,t,{goSubtree:!0,done:!1,leaf:(e,t,r)=>{n=n.concat(r.text.substring(e,e+t))}}),n}getLength(){return this.root.charCount()}every(e,t,n){n||=this.root.charCount();let r={goSubtree:!0,done:!1,leaf(t,n,r){e(r,t,n)||(this.done=!0)}};return this.walk(t,n-t,r),!r.done}edit(t,n,r){if(this.root.charCount()===0)return H.assert(n===0),r===void 0?void 0:(this.load(e.linesFromText(r).lines),this);{let e;if(this.checkEdits){let i=this.getText(0,this.root.charCount());e=i.slice(0,t)+r+i.slice(t+n)}let i=new fje,a=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let e=this.getText(t,1);r=r?e+r:e,n=0,a=!0}else if(n>0){let e=t+n,{zeroBasedColumn:i,lineText:a}=this.positionToColumnAndLineText(e);i===0&&(n+=a.length,r=r?r+a:a)}if(this.root.walk(t,n,i),i.insertLines(r,a),this.checkEdits){let t=i.lineIndex.getText(0,i.lineIndex.getLength());H.assert(e===t,`buffer edit mismatch`)}return i.lineIndex}}static buildTreeFromBottom(e){if(e.length<J9)return new Q9(e);let t=Array(Math.ceil(e.length/J9)),n=0;for(let r=0;r<t.length;r++){let i=Math.min(n+J9,e.length);t[r]=new Q9(e.slice(n,i)),n=i}return this.buildTreeFromBottom(t)}static linesFromText(e){let t=ss(e);if(t.length===0)return{lines:[],lineMap:t};let n=Array(t.length),r=t.length-1;for(let i=0;i<r;i++)n[i]=e.substring(t[i],t[i+1]);let i=e.substring(t[r]);return i.length>0?n[r]=i:n.pop(),{lines:n,lineMap:t}}},Q9=class e{constructor(e=[]){this.children=e,this.totalChars=0,this.totalLines=0,e.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let e of this.children)this.totalChars+=e.charCount(),this.totalLines+=e.lineCount()}execWalk(e,t,n,r,i){return n.pre&&n.pre(e,t,this.children[r],this,i),n.goSubtree?(this.children[r].walk(e,t,n),n.post&&n.post(e,t,this.children[r],this,i)):n.goSubtree=!0,n.done}skipChild(e,t,n,r,i){r.pre&&!r.done&&(r.pre(e,t,this.children[n],this,i),r.goSubtree=!0)}walk(e,t,n){if(this.children.length===0)return;let r=0,i=this.children[r].charCount(),a=e;for(;a>=i;)this.skipChild(a,t,r,n,0),a-=i,r++,i=this.children[r].charCount();if(a+t<=i){if(this.execWalk(a,t,n,r,2))return}else{if(this.execWalk(a,i-a,n,r,1))return;let e=t-(i-a);for(r++,i=this.children[r].charCount();e>i;){if(this.execWalk(0,i,n,r,3))return;e-=i,r++,i=this.children[r].charCount()}if(e>0&&this.execWalk(0,e,n,r,4))return}if(n.pre){let e=this.children.length;if(r<e-1)for(let t=r+1;t<e;t++)this.skipChild(0,0,t,n,5)}}charOffsetToLineInfo(e,t){if(this.children.length===0)return{oneBasedLine:e,zeroBasedColumn:t,lineText:void 0};for(let n of this.children)if(n.charCount()>t)return n.isLeaf()?{oneBasedLine:e,zeroBasedColumn:t,lineText:n.text}:n.charOffsetToLineInfo(e,t);else t-=n.charCount(),e+=n.lineCount();let n=this.lineCount();return n===0?{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0}:{oneBasedLine:n,zeroBasedColumn:H.checkDefined(this.lineNumberToInfo(n,0).leaf).charCount(),lineText:void 0}}lineNumberToInfo(e,t){for(let n of this.children){let r=n.lineCount();if(r>=e)return n.isLeaf()?{position:t,leaf:n}:n.lineNumberToInfo(e,t);e-=r,t+=n.charCount()}return{position:t,leaf:void 0}}splitAfter(t){let n,r=this.children.length;t++;let i=t;if(t<r){for(n=new e;t<r;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=i,n}remove(e){let t=this.findChildIndex(e),n=this.children.length;if(t<n-1)for(let e=t;e<n-1;e++)this.children[e]=this.children[e+1];this.children.pop()}findChildIndex(e){let t=this.children.indexOf(e);return H.assert(t!==-1),t}insertAt(t,n){let r=this.findChildIndex(t),i=this.children.length,a=n.length;if(i<J9&&r===i-1&&a===1)return this.add(n[0]),this.updateCounts(),[];{let t=this.splitAfter(r),i=0;for(r++;r<J9&&i<a;)this.children[r]=n[i],r++,i++;let o=[],s=0;if(i<a){s=Math.ceil((a-i)/J9),o=Array(s);let t=0;for(let t=0;t<s;t++)o[t]=new e;let r=o[0];for(;i<a;)r.add(n[i]),i++,r.children.length===J9&&(t++,r=o[t]);for(let e=o.length-1;e>=0;e--)o[e].children.length===0&&o.pop()}t&&o.push(t),this.updateCounts();for(let e=0;e<s;e++)o[e].updateCounts();return o}}add(e){this.children.push(e),H.assert(this.children.length<=J9)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},$9=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},hje=class e{constructor(e,t,n,r,i,a){this.telemetryEnabled=e,this.logger=t,this.host=n,this.globalTypingsCacheLocation=r,this.event=i,this.maxActiveRequestCount=a,this.activeRequestCount=0,this.requestQueue=pt(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(e){return SY.validatePackageName(e)===SY.NameValidationResult.Ok?(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:`typesRegistry`})),!!this.typesRegistryCache?.has(e)):!1}installPackage(e){this.packageInstallId++;let t={kind:`installPackage`,...e,id:this.packageInstallId},n=new Promise((e,t)=>{(this.packageInstalledPromise??=new Map).set(this.packageInstallId,{resolve:e,reject:t})});return this.installer.send(t),n}attach(e){this.projectService=e,this.installer=this.createInstallerProcess()}onProjectClosed(e){this.installer.send({projectName:e.getProjectName(),kind:`closeProject`})}enqueueInstallTypingsRequest(e,t,n){let r=$Oe(e,t,n);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${LY(r)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(r):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${r.projectName}`),this.requestQueue.enqueue(r),this.requestMap.set(r.projectName,r))}handleMessage(e){var t;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${LY(e)}`),e.kind){case EY:this.typesRegistryCache=new Map(Object.entries(e.typesRegistry));break;case TY:{let n=this.packageInstalledPromise?.get(e.id);H.assertIsDefined(n,`Should find the promise for package install`),(t=this.packageInstalledPromise)==null||t.delete(e.id),e.success?n.resolve({successMessage:e.message}):n.reject(e.message),this.projectService.updateTypingsForProject(e),this.event(e,`setTypings`);break}case kY:{let t={message:e.message};this.event(t,`typesInstallerInitializationFailed`);break}case DY:{let t={eventId:e.eventId,packages:e.packagesToInstall};this.event(t,`beginInstallTypes`);break}case OY:{if(this.telemetryEnabled){let t={telemetryEventName:`typingsInstalled`,payload:{installedPackages:e.packagesToInstall.join(`,`),installSuccess:e.installSuccess,typingsInstallerVersion:e.typingsInstallerVersion}};this.event(t,`telemetry`)}let t={eventId:e.eventId,packages:e.packagesToInstall,success:e.installSuccess};this.event(t,`endInstallTypes`);break}case wY:this.projectService.updateTypingsForProject(e);break;case CY:for(this.activeRequestCount>0?this.activeRequestCount--:H.fail(`TIAdapter:: Received too many responses`);!this.requestQueue.isEmpty();){let e=this.requestQueue.dequeue();if(this.requestMap.get(e.projectName)===e){this.requestMap.delete(e.projectName),this.scheduleRequest(e);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${e.projectName}`)}this.projectService.updateTypingsForProject(e),this.event(e,`setTypings`);break;case AY:this.projectService.watchTypingLocations(e);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${LY(t)}`),this.installer.send(t)},e.requestDelayMillis,`${t.projectName}::${t.kind}`)}};hje.requestDelayMillis=100;var gje=hje,_je={};r(_je,{ActionInvalidate:()=>wY,ActionPackageInstalled:()=>TY,ActionSet:()=>CY,ActionWatchTypingLocations:()=>AY,Arguments:()=>jY,AutoImportProviderProject:()=>zke,AuxiliaryProject:()=>Lke,CharRangeSection:()=>dje,CloseFileWatcherEvent:()=>O9,CommandNames:()=>PAe,ConfigFileDiagEvent:()=>C9,ConfiguredProject:()=>Bke,ConfiguredProjectLoadKind:()=>eAe,CreateDirectoryWatcherEvent:()=>D9,CreateFileWatcherEvent:()=>E9,Errors:()=>n9,EventBeginInstallTypes:()=>DY,EventEndInstallTypes:()=>OY,EventInitializationFailed:()=>kY,EventTypesRegistry:()=>EY,ExternalProject:()=>d9,GcTimer:()=>ske,InferredProject:()=>Ike,LargeFileReferencedEvent:()=>S9,LineIndex:()=>Z9,LineLeaf:()=>$9,LineNode:()=>Q9,LogLevel:()=>ZOe,Msg:()=>QOe,OpenFileInfoTelemetryEvent:()=>Vke,Project:()=>u9,ProjectInfoTelemetryEvent:()=>T9,ProjectKind:()=>c9,ProjectLanguageServiceStateEvent:()=>w9,ProjectLoadingFinishEvent:()=>x9,ProjectLoadingStartEvent:()=>b9,ProjectService:()=>SAe,ProjectsUpdatedInBackgroundEvent:()=>y9,ScriptInfo:()=>bke,ScriptVersionCache:()=>X9,Session:()=>QAe,TextStorage:()=>yke,ThrottledOperations:()=>oke,TypingsInstallerAdapter:()=>gje,allFilesAreJsOrDts:()=>Dke,allRootFilesAreJsOrDts:()=>Eke,asNormalizedPath:()=>a9,convertCompilerOptions:()=>A9,convertFormatOptions:()=>k9,convertScriptKindName:()=>N9,convertTypeAcquisition:()=>Jke,convertUserPreferences:()=>Yke,convertWatchOptions:()=>j9,countEachFileTypes:()=>l9,createInstallTypingsRequest:()=>$Oe,createModuleSpecifierCache:()=>EAe,createNormalizedPathMap:()=>eke,createPackageJsonCache:()=>DAe,createSortedArray:()=>ake,emptyArray:()=>t9,findArgument:()=>NY,formatDiagnosticToProtocol:()=>U9,formatMessage:()=>FAe,getBaseConfigFileName:()=>o9,getDetailWatchInfo:()=>R9,getLocationInNewDocument:()=>oje,hasArgument:()=>MY,hasNoTypeScriptSource:()=>Oke,indent:()=>IY,isBackgroundProject:()=>h9,isConfigFile:()=>wAe,isConfiguredProject:()=>p9,isDynamicFileName:()=>s9,isExternalProject:()=>m9,isInferredProject:()=>f9,isInferredProjectName:()=>tke,isProjectDeferredClose:()=>g9,makeAutoImportProviderProjectName:()=>rke,makeAuxiliaryProjectName:()=>ike,makeInferredProjectName:()=>nke,maxFileSize:()=>v9,maxProgramSizeForNonTsFiles:()=>_9,normalizedPathToPath:()=>i9,nowString:()=>PY,nullCancellationToken:()=>OAe,nullTypingsInstaller:()=>I9,protocol:()=>cke,scriptInfoIsContainedByBackgroundProject:()=>Cke,scriptInfoIsContainedByDeferredClosedProject:()=>wke,stringifyIndented:()=>LY,toEvent:()=>LAe,toNormalizedPath:()=>r9,tryConvertScriptKindName:()=>M9,typingsInstaller:()=>WOe,updateProjectIfDirty:()=>z9}),typeof console<`u`&&(H.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return r},set exports(e){r=e,n!==void 0&&n.exports&&(n.exports=e)}})})),Ht=e.Ct(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),Ut=e.Ct(((e,t)=>{var n=Ht();t.exports=m;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`,c=1e5,l=4e6;function u(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function d(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function f(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function p(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=p(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function m(e,t){if(!e)return[];t||={};var n=t.max==null?c:t.max,r=t.maxLength==null?l:t.maxLength;return e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),x(d(e),n,r,!0).map(f)}function h(e){return`{`+e+`}`}function g(e){return/^-?0\d/.test(e)}function _(e,t){return e<=t}function v(e,t){return e>=t}function y(e,t,n,r,i,a){for(var o=[],s=0,c=0;c<e.length;c++)for(var l=0;l<n.length;l++){if(o.length>=r)return o;var u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function b(e,t,n,r){var i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;var o=u(i[0]),s=u(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(u(i[2])),1):1,d=_;s<o&&(l*=-1,d=v);for(var f=i.some(g),p=0,m=o;d(m,s)&&a.length<n;m+=l){var h;if(t)h=String.fromCharCode(m),h===`\\`&&(h=``);else if(h=String(m),f){var y=c-h.length;if(y>0){var b=Array(y+1).join(`0`);h=m<0?`-`+b+h.slice(1):b+h}}if(p+h.length>r)break;a.push(h),p+=h.length}return a}function x(e,t,r,i){for(var o=[``],s=!1,c=!0;;){let D=n(`{`,`}`,e);if(!D)return y(o,e,[``],t,r,s);let O=D.pre;if(/\$$/.test(O)){if(o=y(o,O+`{`+D.body+`}`,[``],t,r,s&&!D.post.length),c=!1,!D.post.length)break;e=D.post;continue}var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(D.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(D.body),d=l||u,f=D.body.indexOf(`,`)>=0;if(!d&&!f){if(D.post.match(/,(?!,).*\}/)){e=D.pre+`{`+D.body+a+D.post,i=!0;continue}return y(o,O+`{`+D.body+`}`+D.post,[``],t,r,s)}c&&=(s=i&&!d,!1);var m;if(d)m=b(D.body,u,t,r);else{var g=p(D.body);if(g.length===1&&g[0]!==void 0&&(g=x(g[0],t,r,!1).map(h),g.length===1)){if(o=y(o,O+g[0],[``],t,r,s&&!D.post.length),!D.post.length)break;e=D.post;continue}for(var _=s&&!D.post.length&&!O,v=0;_&&v<o.length;v++)o[v]&&(_=!1);m=[];var S=0;outer:for(var C=0;C<g.length;C++)for(var w=x(g[C],t,r,!1),T=0;T<w.length;T++){var E=w[T];if(!(_&&!E)){if(m.length>=t||S+E.length>r)break outer;m.push(E),S+=E.length}}}if(o=y(o,O,m,t,r,s&&!D.post.length),!D.post.length)break;e=D.post}return o}})),Wt=e.Ct((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assertValidPattern=void 0;var t=1024*64;e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>t)throw TypeError(`pattern is too long`)}})),Gt=e.Ct((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseClass=void 0;var t={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;WHILE:for(;l<e.length;){let r=e.charAt(l);if((r===`!`||r===`^`)&&l===o+1){p=!0,l++;continue}if(r===`]`&&u&&!f){m=l+1;break}if(u=!0,r===`\\`&&!f){f=!0,l++;continue}if(r===`[`&&!f){for(let[n,[r,i,a]]of Object.entries(t))if(e.startsWith(n,l)){if(h)return[`$.`,!1,e.length-o,!0];l+=n.length,a?c.push(r):s.push(r),d||=i;continue WHILE}}if(f=!1,h){r>h?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m<l)return[``,!1,0,!1];if(!s.length&&!c.length)return[`$.`,!1,e.length-o,!0];if(c.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!p)return[r(s[0].length===2?s[0].slice(-1):s[0]),!1,m-o,!1];let g=`[`+(p?`^`:``)+i(s)+`]`,_=`[`+(p?``:`^`)+i(c)+`]`;return[s.length&&c.length?`(`+g+`|`+_+`)`:s.length?g:_,d,m-o,!0]}})),Kt=e.Ct((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`)})),qt=e.Ct((e=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.AST=void 0;var n=Gt(),r=Kt(),i=new Set([`!`,`?`,`+`,`*`,`@`]),a=e=>i.has(e),o=e=>a(e.type),s=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),c=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),l=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),u=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),d=`(?!(?:^|/)\\.\\.?(?:$|/))`,f=`(?!\\.)`,p=new Set([`[`,`.`]),m=new Set([`..`,`.`]),h=new Set(`().*{}+?[]^$\\!`),g=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),_=`[^/]`,v=`[^/]*?`,y=`[^/]+?`,b=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let n of e)if(n!==``){if(typeof n!=`string`&&!(n instanceof t&&n.#i===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let n=0;n<this.#a;n++){let r=e.#r[n];if(!(r instanceof t&&r.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let n=new t(this.type,e);for(let e of this.#r)n.copyIn(e);return n}static#f(e,n,r,i,o){let s=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,d=!1;if(n.type===null){let f=r,p=``;for(;f<e.length;){let r=e.charAt(f++);if(c||r===`\\`){c=!c,p+=r;continue}if(l){f===u+1?(r===`^`||r===`!`)&&(d=!0):r===`]`&&!(f===u+2&&d)&&(l=!1),p+=r;continue}else if(r===`[`){l=!0,u=f,d=!1,p+=r;continue}if(!i.noext&&a(r)&&e.charAt(f)===`(`&&o<=s){n.push(p),p=``;let a=new t(r,n);f=t.#f(e,a,f,i,o+1),n.push(a);continue}p+=r}return n.push(p),f}let f=r+1,p=new t(null,n),m=[],h=``;for(;f<e.length;){let r=e.charAt(f++);if(c||r===`\\`){c=!c,h+=r;continue}if(l){f===u+1?(r===`^`||r===`!`)&&(d=!0):r===`]`&&!(f===u+2&&d)&&(l=!1),h+=r;continue}else if(r===`[`){l=!0,u=f,d=!1,h+=r;continue}if(a(r)&&e.charAt(f)===`(`&&(o<=s||n&&n.#h(r))){let a=n&&n.#h(r)?0:1;p.push(h),h=``;let s=new t(r,p);p.push(s),f=t.#f(e,s,f,i,o+a);continue}if(r===`|`){p.push(h),h=``,m.push(p),p=new t(null,n);continue}if(r===`)`)return h===``&&n.#r.length===0&&(n.#u=!0),p.push(h),h=``,n.push(...m,p),f;h+=r}return n.type=null,n.#t=void 0,n.#r=[e.substring(r-1)],f}#p(e){return this.#m(e,c)}#m(e,t=s){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=l){return!!t.get(this.type)?.includes(e)}#g(e,n){let r=e.#r[0],i=new t(null,r,this.options);i.#r.push(``),r.push(i),this.#_(e,n)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!u.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=u.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}#x(){if(o(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}static fromGlob(e,n={}){let r=new t(null,void 0,n);return t.#f(e,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let n=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!o(this)){let i=this.isStart()&&this.isEnd(),a=this.#r.map(n=>{let[r,a,o,s]=typeof n==`string`?t.#C(n,this.#t,i):n.toRegExpSource(e);return this.#t=this.#t||o,this.#n=this.#n||s,r}).join(``),o=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&m.has(this.#r[0]))){let t=p,r=n&&t.has(a.charAt(0))||a.startsWith(`\\.`)&&t.has(a.charAt(2))||a.startsWith(`\\.\\.`)&&t.has(a.charAt(4)),i=!n&&!e&&t.has(a.charAt(0));o=r?d:i?f:``}let s=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(s=`(?:$|\\/)`),[o+a+s,(0,r.unescape)(a),this.#t=!!this.#t,this.#n]}let i=this.type===`*`||this.type===`+`,a=this.type===`!`?`(?:(?!(?:`:`(?:`,s=this.#S(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,(0,r.unescape)(this.toString()),!1,!1]}let c=!i||e||n?``:this.#S(!0);c===s&&(c=``),c&&(s=`(?:${s})(?:${c})*?`);let l=``;if(this.type===`!`&&this.#u)l=(this.isStart()&&!n?f:``)+y;else{let t=this.type===`!`?`))`+(this.isStart()&&!n&&!e?f:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&c?`)`:this.type===`*`&&c?`)?`:`)${this.type}`;l=a+s+t}return[l,(0,r.unescape)(s),this.#t=!!this.#t,this.#n]}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,i=!1){let a=!1,o=``,s=!1,c=!1;for(let r=0;r<e.length;r++){let l=e.charAt(r);if(a){a=!1,o+=(h.has(l)?`\\`:``)+l,c=!1;continue}if(l===`\\`){r===e.length-1?o+=`\\\\`:a=!0;continue}if(l===`[`){let[i,a,l,u]=(0,n.parseClass)(e,r);if(l){o+=i,s||=a,r+=l-1,t||=u,c=!1;continue}}if(l===`*`){if(c)continue;c=!0,o+=i&&/^[*]+$/.test(e)?y:v,t=!0;continue}else c=!1;if(l===`?`){o+=_,t=!0;continue}o+=g(l)}return[o,(0,r.unescape)(e),!!t,s]}};e.AST=b,t=b})),Jt=e.Ct((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)})),Yt=e.Ct((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;var n=t(Ut()),r=Wt(),i=qt(),a=Jt(),o=Kt();e.minimatch=(e,t,n={})=>((0,r.assertValidPattern)(t),!n.nocomment&&t.charAt(0)===`#`?!1:new j(t,n).match(e));var s=/^\*+([^+@!?\*\[\(]*)$/,c=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),l=e=>t=>t.endsWith(e),u=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),d=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),f=/^\*+\.\*+$/,p=e=>!e.startsWith(`.`)&&e.includes(`.`),m=e=>e!==`.`&&e!==`..`&&e.includes(`.`),h=/^\.\*+$/,g=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),_=/^\*+$/,v=e=>e.length!==0&&!e.startsWith(`.`),y=e=>e.length!==0&&e!==`.`&&e!==`..`,b=/^\?+([^+@!?\*\[\(]*)?$/,x=([e,t=``])=>{let n=T([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},S=([e,t=``])=>{let n=E([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},C=([e,t=``])=>{let n=E([e]);return t?e=>n(e)&&e.endsWith(t):n},w=([e,t=``])=>{let n=T([e]);return t?e=>n(e)&&e.endsWith(t):n},T=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},E=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},D=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,O={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=D===`win32`?O.win32.sep:O.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR;var ee=`[^/]*?`,k=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,te=`(?:(?!(?:\\/|^)\\.).)*?`;e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;var ne=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,ne(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,ne(t,n))}static defaults(e){return n.defaults(ne(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,ne(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,ne(t,r))}},unescape:(e,r={})=>n.unescape(e,ne(t,r)),escape:(e,r={})=>n.escape(e,ne(t,r)),filter:(e,r={})=>n.filter(e,ne(t,r)),defaults:e=>n.defaults(ne(t,e)),makeRe:(e,r={})=>n.makeRe(e,ne(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,ne(t,r)),match:(e,r,i={})=>n.match(e,r,ne(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,t={})=>((0,r.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,n.default)(e)),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new j(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new j(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;var re=/[?*]|[+@!]\(.*?\)|\[|\]/,A=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),j=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){(0,r.assertValidPattern)(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||D,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!re.test(e[2]))&&!re.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(t,n,r=!1){let i=0,a=0;if(this.isWindows){let e=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),r=!e&&t[0]===``&&t[1]===``&&t[2]===`?`&&/^[a-z]:$/i.test(t[3]),o=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),s=!o&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),c=r?3:e?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[e,r]=[t[c],n[l]];e.toLowerCase()===r.toLowerCase()&&(n[l]=e,a=l,i=c)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(e.GLOBSTAR)?this.#e(t,n,r,i,a):this.#n(t,n,r,i,a)}#e(t,n,r,i,a){let o=n.indexOf(e.GLOBSTAR,a),s=n.lastIndexOf(e.GLOBSTAR),[c,l,u]=r?[n.slice(a,o),n.slice(o+1),[]]:[n.slice(a,o),n.slice(o+1,s),n.slice(s+1)];if(c.length){let e=t.slice(i,i+c.length);if(!this.#n(e,c,r,0,0))return!1;i+=c.length}let d=0;if(u.length){if(u.length+i>t.length)return!1;let e=t.length-u.length;if(this.#n(t,u,r,e,0))d=u.length;else{if(t[t.length-1]!==``||i+u.length===t.length||(e--,!this.#n(t,u,r,e,0)))return!1;d=u.length+1}}if(!l.length){let e=!!d;for(let n=i;n<t.length-d;n++){let r=String(t[n]);if(e=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return r||e}let f=[[[],0]],p=f[0],m=0,h=[0];for(let t of l)t===e.GLOBSTAR?(h.push(m),p=[[],0],f.push(p)):(p[0].push(t),m++);let g=f.length-1,_=t.length-d;for(let e of f)e[1]=_-(h[g--]+e[0].length);return!!this.#t(t,f,i,0,r,0,!!d)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(t,n,r,i,a){let o,s,c,l;for(o=i,s=a,l=t.length,c=n.length;o<l&&s<c;o++,s++){this.debug(`matchOne loop`);let r=n[s],i=t[o];if(this.debug(n,r,i),r===!1||r===e.GLOBSTAR)return!1;let a;if(typeof r==`string`?(a=i===r,this.debug(`string match`,r,i,a)):(a=r.test(i),this.debug(`pattern match`,r,i,a)),!a)return!1}if(o===l&&s===c)return!0;if(o===l)return r;if(s===c)return o===l-1&&t[o]===``;throw Error(`wtf?`)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,r.assertValidPattern)(t);let n=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let a,o=null;(a=t.match(_))?o=n.dot?y:v:(a=t.match(s))?o=(n.nocase?n.dot?d:u:n.dot?l:c)(a[1]):(a=t.match(b))?o=(n.nocase?n.dot?S:x:n.dot?C:w)(a):(a=t.match(f))?o=n.dot?m:p:(a=t.match(h))&&(o=g);let T=i.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof T==`object`&&Reflect.defineProperty(T,"test",{value:o}),T}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?ee:n.dot?k:te,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?A(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});return n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))}),n.filter(t=>t!==e.GLOBSTAR).join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};e.Minimatch=j;var M=qt();Object.defineProperty(e,"AST",{enumerable:!0,get:function(){return M.AST}});var N=Jt();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return N.escape}});var P=Kt();Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return P.unescape}}),e.minimatch.AST=i.AST,e.minimatch.Minimatch=j,e.minimatch.escape=a.escape,e.minimatch.unescape=o.unescape})),Xt=e.Ct(((e,t)=>{function n(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}function r(e,t){for(var n=``,r=0,i=-1,a=0,o,s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var c=n.lastIndexOf(`/`);if(c!==n.length-1){c===-1?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}function i(e,t){var n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}var a={resolve:function(){for(var e=``,t=!1,i,a=arguments.length-1;a>=-1&&!t;a--){var o;a>=0?o=arguments[a]:(i===void 0&&(i=process.cwd()),o=i),n(o),o.length!==0&&(e=o+`/`+e,t=o.charCodeAt(0)===47)}return e=r(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`},normalize:function(e){if(n(e),e.length===0)return`.`;var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=r(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&i&&(e+=`/`),t?`/`+e:e},isAbsolute:function(e){return n(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return`.`;for(var e,t=0;t<arguments.length;++t){var r=arguments[t];n(r),r.length>0&&(e===void 0?e=r:e+=`/`+r)}return e===void 0?`.`:a.normalize(e)},relative:function(e,t){if(n(e),n(t),e===t||(e=a.resolve(e),t=a.resolve(t),e===t))return``;for(var r=1;r<e.length&&e.charCodeAt(r)===47;++r);for(var i=e.length,o=i-r,s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length-s,l=o<c?o:c,u=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(t.charCodeAt(s+d)===47)return t.slice(s+d+1);if(d===0)return t.slice(s+d)}else o>l&&(e.charCodeAt(r+d)===47?u=d:d===0&&(u=0));break}var f=e.charCodeAt(r+d);if(f!==t.charCodeAt(s+d))break;f===47&&(u=d)}var p=``;for(d=r+u+1;d<=i;++d)(d===i||e.charCodeAt(d)===47)&&(p.length===0?p+=`..`:p+=`/..`);return p.length>0?p+t.slice(s+u):(s+=u,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(n(e),e.length===0)return`.`;for(var t=e.charCodeAt(0),r=t===47,i=-1,a=!0,o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!a){i=o;break}}else a=!1;return i===-1?r?`/`:`.`:r&&i===1?`//`:e.slice(0,i)},basename:function(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);n(e);var r=0,i=-1,a=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;var s=t.length-1,c=-1;for(o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(l===47){if(!a){r=o+1;break}}else c===-1&&(a=!1,c=o+1),s>=0&&(l===t.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=c))}return r===i?i=c:i===-1&&(i=e.length),e.slice(r,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!a){r=o+1;break}}else i===-1&&(a=!1,i=o+1);return i===-1?``:e.slice(r,i)}},extname:function(e){n(e);for(var t=-1,r=0,i=-1,a=!0,o=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),c===46?t===-1?t=s:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||i===-1||o===0||o===1&&t===i-1&&t===r+1?``:e.slice(t,i)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return i(`/`,e)},parse:function(e){n(e);var t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;var r=e.charCodeAt(0),i=r===47,a;i?(t.root=`/`,a=1):a=0;for(var o=-1,s=0,c=-1,l=!0,u=e.length-1,d=0;u>=a;--u){if(r=e.charCodeAt(u),r===47){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),r===46?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}return o===-1||c===-1||d===0||d===1&&o===c-1&&o===s+1?c!==-1&&(s===0&&i?t.base=t.name=e.slice(1,c):t.base=t.name=e.slice(s,c)):(s===0&&i?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(s,o),t.base=e.slice(s,c)),t.ext=e.slice(o,c)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};a.posix=a,t.exports=a})),Zt=e.Ct((e=>{var n=Vt(),r=Yt(),i=t.Tt(),a=require("fs"),o=require("fs/promises"),s=require("os"),c=require("path");function l(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}function u(e){if(e&&typeof e==`object`&&`default`in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var d=u(n),f=u(r),p=l(i),m=u(a),h=u(o),g=u(s),_=u(c),v=class{#e=new Map;getSize(){return this.#e.size}getValues(){return this.#e.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#e.keys()}getEntries(){return this.#e.entries()}getOrCreate(e,t){let n=this.get(e);return n??(n=t(),this.set(e,n)),n}has(e){return this.#e.has(e)}get(e){return this.#e.get(e)}set(e,t){this.#e.set(e,t)}replaceKey(e,t){if(!this.#e.has(e))throw Error(`Key not found.`);let n=this.#e.get(e);this.#e.delete(e),this.#e.set(t,n)}removeByKey(e){this.#e.delete(e)}clear(){this.#e.clear()}},y=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}compareTo(e){return this.#e.compareTo(this.#t,e)}},b=class e{static instance=new e;compareTo(e,t){let n=e.localeCompare(t,`en-us-u-kf-upper`);return n<0?-1:n===0?0:1}},x=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}compareTo(e,t){return this.#e.compareTo(this.#t(e),this.#t(t))}},S=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}compareTo(e){return this.#e.compareTo(this.#t(e))}},C=class{constructor(){}static isReadonlyArray(e){return e instanceof Array}static isNullOrEmpty(e){return!(e instanceof Array)||e.length===0}static getUniqueItems(e){return e.filter((t,n)=>e.indexOf(t)===n)}static removeFirst(e,t){let n=e.indexOf(t);return n===-1?!1:(e.splice(n,1),!0)}static removeAll(e,t){let n=[];for(let r=e.length-1;r>=0;r--)t(e[r])&&(n.push(e[r]),e.splice(r,1));return n}static*toIterator(e){for(let t of e)yield t}static sortByProperty(e,t){return e.sort((e,n)=>t(e)<=t(n)?-1:1),e}static groupBy(e,t){let n=[],r={};for(let i of e){let e=t(i).toString();r[e]??(r[e]=[],n.push(r[e])),r[e].push(i)}return n}static binaryInsertWithOverwrite(e,t,n){let r=e.length-1,i=0;for(;i<=r;){let a=Math.floor((r+i)/2);n.compareTo(t,e[a])<0?r=a-1:i=a+1}e[r]!=null&&n.compareTo(t,e[r])===0?e[r]=t:e.splice(r+1,0,t)}static binarySearch(e,t){let n=e.length-1,r=0;for(;r<=n;){let i=Math.floor((n+r)/2),a=t.compareTo(e[i]);if(a===0)return i;a<0?n=i-1:r=i+1}return-1}static containsSubArray(e,t){let n=0;for(let r of e)if(t[n]===r){if(n++,n===t.length)return!0}else n=0;return!1}};function w(e){return t(e);function t(e){let t=Object.create(e.constructor.prototype);for(let n of Object.keys(e))t[n]=r(e[n]);return t}function n(e){return e.map(r)}function r(e){return e instanceof Array?n(e):typeof e==`object`?e===null?e:t(e):e}}var T=class{#e=[];subscribe(e){this.#t(e)===-1&&this.#e.push(e)}unsubscribe(e){let t=this.#t(e);t>=0&&this.#e.splice(t,1)}fire(e){for(let t of this.#e)t(e)}#t(e){return this.#e.indexOf(e)}},E=class{static find(e,t){for(let n of e)if(t(n))return n}};function D(e,t){return t??e}var O=class e{constructor(){}static clone(t){if(t==null)return;if(t instanceof Array)return n(t);return Object.assign({},t);function n(t){return t.map(t=>e.clone(t))}}};function ee(e,t,n,r,i,a,o,s,c,l){return d.matchFiles.apply(this,arguments)}function k(e,t,n,r,i){return d.getFileMatcherPatterns.apply(this,arguments)}function te(e){return d.getEmitModuleResolutionKind.apply(this,arguments)}function ne(e){return A()[e]}var re=void 0;function A(){if(re!=null)return re;re={};for(let e of Object.keys(d.SyntaxKind).filter(e=>isNaN(parseInt(e,10)))){let t=d.SyntaxKind[e];re[t]??(re[t]=e)}return re}e.errors=void 0,(function(e){class t extends Error{constructor(e,t){let n=t&&j(t),r=n?`${e}\n\n${n}`:e;super(r),this.message=r}}e.BaseError=t;class n extends t{constructor(e,t,n){super(`Argument Error (${e}): ${t}`,n)}}e.ArgumentError=n;class r extends n{constructor(e,t){super(e,`Cannot be null or whitespace.`,t)}}e.ArgumentNullOrWhitespaceError=r;class i extends n{constructor(e,t,n,r){super(e,`Range is ${n[0]} to ${n[1]}, but ${t} was provided.`,r)}}e.ArgumentOutOfRangeError=i;class a extends n{constructor(e,t,n,r){super(e,`Expected type '${t}', but was '${n}'.`,r)}}e.ArgumentTypeError=a;class o extends t{path;constructor(e,t=`Path`){super(`${t} not found: ${e}`),this.path=e}code=`ENOENT`}e.PathNotFoundError=o;class s extends o{constructor(e){super(e,`Directory`)}}e.DirectoryNotFoundError=s;class c extends o{constructor(e){super(e,`File`)}}e.FileNotFoundError=c;class l extends t{constructor(e,t){super(e,t)}}e.InvalidOperationError=l;class u extends t{constructor(e=`Not implemented.`,t){super(e,t)}}e.NotImplementedError=u;class d extends t{constructor(e){super(e)}}e.NotSupportedError=d;function f(e,t,n){if(typeof e!==t)throw new a(n,t,typeof e)}e.throwIfNotType=f;function p(e,t){if(typeof e!=`string`)throw new a(t,`string`,typeof e)}e.throwIfNotString=p;function m(e,t){if(p(e,t),e.trim().length===0)throw new r(t)}e.throwIfWhitespaceOrNotString=m;function h(e,t,n){if(e<t[0]||e>t[1])throw new i(n,e,t)}e.throwIfOutOfRange=h;function g(e,t,r){if(e[0]>e[1])throw new n(r,`The start of a range must not be greater than the end: [${e[0]}, ${e[1]}]`);h(e[0],t,r),h(e[1],t,r)}e.throwIfRangeOutOfRange=g;function _(e,t){throw new u(`Not implemented feature for syntax kind '${ne(e)}'.`,t)}e.throwNotImplementedForSyntaxKindError=_;function v(e,t){if(e<0)throw new n(t,`Expected a non-negative value.`)}e.throwIfNegative=v;function y(e,t,n){if(e==null)throw new l(typeof t==`string`?t:t(),n);return e}e.throwIfNullOrUndefined=y;function b(e,t){let n=e;if(n!=null&&typeof n.kind==`number`)return _(n.kind,t);throw new u(`Not implemented value: ${JSON.stringify(e)}`,t)}e.throwNotImplementedForNeverValueError=b;function x(e,t,n){if(e!==t)throw new l(`Expected ${e} to equal ${t}. ${n}`)}e.throwIfNotEqual=x;function S(e,t){if(e===!0)throw new l(t)}e.throwIfTrue=S})(e.errors||={});function j(e){let t=M(e);if(t)return`${t.filePath}:${t.loc.line}:${t.loc.character}\n> ${t.loc.line} | ${t.lineText}`}function M(e){if(!N(e))return;let t=e.getSourceFile(),n=t.getFullText(),r=e.getStart(),i=n.lastIndexOf(`
793
793
  `,r)+1,a=n.indexOf(`
794
794
  `,r),o=a===-1?n.length:a,s=r-i>40?r-37:i,c=o-s>80?s+77:o,l=``;return s!==i&&(l+=`...`),l+=n.substring(s,c),c!==o&&(l+=`...`),{filePath:t.getFilePath(),loc:{line:ie.getLineNumberAtPos(n,r),character:r-i+1},lineText:l}}function N(e){return typeof e==`object`&&!!e&&`getSourceFile`in e&&`getStart`in e}var P={ASTERISK:42,NEWLINE:10,CARRIAGE_RETURN:13,SPACE:32,TAB:9,CLOSE_BRACE:125},F=new Set([` `,`\f`,`
795
795
  `,`\r`,` `,`\v`,`\xA0`,`\u2028`,`\u2029`].map(e=>e.charCodeAt(0))),ie=class t{constructor(){}static isWhitespaceCharCode(e){return F.has(e)}static isSpaces(e){if(e==null||e.length===0)return!1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)!==P.SPACE)return!1;return!0}static hasBom(e){return e.charCodeAt(0)===65279}static stripBom(e){return t.hasBom(e)?e.slice(1):e}static stripQuotes(e){return t.isQuoted(e)?e.substring(1,e.length-1):e}static isQuoted(e){return e.startsWith(`'`)&&e.endsWith(`'`)||e.startsWith(`"`)&&e.endsWith(`"`)}static isNullOrWhitespace(e){return typeof e!=`string`||t.isWhitespace(e)}static isNullOrEmpty(e){return typeof e!=`string`||e.length===0}static isWhitespace(e){if(e==null)return!0;for(let n=0;n<e.length;n++)if(!t.isWhitespaceCharCode(e.charCodeAt(n)))return!1;return!0}static startsWithNewLine(e){return e==null?!1:e.charCodeAt(0)===P.NEWLINE||e.charCodeAt(0)===P.CARRIAGE_RETURN&&e.charCodeAt(1)===P.NEWLINE}static endsWithNewLine(e){return e==null?!1:e.charCodeAt(e.length-1)===P.NEWLINE}static insertAtLastNonWhitespace(e,n){let r=e.length;for(;r>0&&t.isWhitespaceCharCode(e.charCodeAt(r-1));)r--;return e.substring(0,r)+n+e.substring(r)}static getLineNumberAtPos(t,n){e.errors.throwIfOutOfRange(n,[0,t.length],`pos`);let r=0;for(let e=0;e<n;e++)t.charCodeAt(e)===P.NEWLINE&&r++;return r+1}static getLengthFromLineStartAtPos(n,r){return e.errors.throwIfOutOfRange(r,[0,n.length],`pos`),r-t.getLineStartFromPos(n,r)}static getLineStartFromPos(t,n){for(e.errors.throwIfOutOfRange(n,[0,t.length],`pos`);n>0;){let e=t.charCodeAt(n-1);if(e===P.NEWLINE||e===P.CARRIAGE_RETURN)break;n--}return n}static getLineEndFromPos(t,n){for(e.errors.throwIfOutOfRange(n,[0,t.length],`pos`);n<t.length;){let e=t.charCodeAt(n);if(e===P.NEWLINE||e===P.CARRIAGE_RETURN)break;n++}return n}static escapeForWithinString(e,n){return t.escapeChar(e,n).replace(/(\r?\n)/g,`\\$1`)}static escapeChar(t,n){if(n.length!==1)throw new e.errors.InvalidOperationError(`Specified char must be one character long.`);let r=``;for(let e of t)e===n&&(r+=`\\`),r+=e;return r}static removeIndentation(e,t){let{isInStringAtPos:n,indentSizeInSpaces:r}=t,i=[],a;return o(),s();function o(){let t=e.charCodeAt(0)===P.SPACE||e.charCodeAt(0)===P.TAB;for(let o=0;o<e.length;o++){if(!t){e.charCodeAt(o)===P.NEWLINE&&!n(o+1)&&(t=!0);continue}let s=o,c=0,l=0;for(;;){let n=e.charCodeAt(o);if(n===P.SPACE)c++;else if(n===P.TAB)l++;else if(n===P.NEWLINE||n===P.CARRIAGE_RETURN&&e.charCodeAt(o+1)===P.NEWLINE)c=0,l=0,i.push([s,o]),n===P.CARRIAGE_RETURN?(s=o+2,o++):s=o+1;else if(n==null)break;else{let e=Math.ceil(c/r)*r+l*r;(a==null||e<a)&&(a=e),i.push([s,o]),t=!1;break}o++}}}function s(){if(i.length===0||a==null||a===0)return e;let t=a,n=``;n+=e.substring(0,i[0][0]);for(let a=0;a<i.length;a++){let[o,s]=i[a],c=0,l;for(l=o;l<s&&!(c>=t);l++)e.charCodeAt(l)===P.SPACE?c++:e.charCodeAt(l)===P.TAB&&(c+=r);n+=e.substring(l,i[a+1]?.[0]??e.length)}return n}}static indent(e,t,n){if(t===0)return e;let{indentText:r,indentSizeInSpaces:i,isInStringAtPos:a}=n,o=t>0?r.repeat(t):void 0,s=Math.abs(t*i),c=``,l=0,u=0;for(let t=0;t<e.length;t++){for(l=t;t<e.length&&e.charCodeAt(t)!==P.NEWLINE;)t++;u=t===e.length?t:t+1,d()}return c;function d(){if(a(l))c+=e.substring(l,u);else if(t>0)c+=o+e.substring(l,u);else{let t=l,n=0;for(t=l;t<e.length&&!(n>=s);t++)if(e.charCodeAt(t)===P.SPACE)n++;else if(e.charCodeAt(t)===P.TAB)n+=i;else break;c+=e.substring(t,u)}}}},ae=class{#e=[];#t;#n;constructor(e,t){this.#t=e,this.#n=t}set(e){C.binaryInsertWithOverwrite(this.#e,e,new x(this.#t,this.#n))}removeByValue(e){this.removeByKey(this.#t(e))}removeByKey(e){let t=new y(this.#n,e),n=C.binarySearch(this.#e,new S(this.#t,t));n>=0&&this.#e.splice(n,1)}getArrayCopy(){return[...this.#e]}hasItems(){return this.#e.length>0}*entries(){yield*this.#e}},oe=class{#e=new WeakMap;getOrCreate(e,t){let n=this.get(e);return n??(n=t(),this.set(e,n)),n}has(e){return this.#e.has(e)}get(e){return this.#e.get(e)}set(e,t){this.#e.set(e,t)}removeByKey(e){this.#e.delete(e)}};function se(e,t,n,r,i,a){return d.createLanguageServiceSourceFile(e,t,n??d.ScriptTarget.Latest,r,i,a)}function ce(e){let t=new I;return t._addFiles(e),t}var le=class{#e;#t=new Map;constructor(e,t){for(let n of t._getFilePaths())this.#t.set(e.getStandardizedAbsolutePath(n),n);this.#e=t}getDocumentIfMatch(e,t,n,r){let i=this.#t.get(e);if(i!=null)return this.#e._getDocumentIfMatch(i,e,t,n,r)}},I=class{__documentCacheBrand;#e=new Map;#t=new Map;_addFiles(e){for(let t of e)this.#e.set(t.fileName,t.text)}_getFilePaths(){return this.#e.keys()}_getCacheForFileSystem(e){return new le(e,this)}_getDocumentIfMatch(e,t,n,r,i){let a=this.#e.get(e);if(a!=null&&a===n.getText(0,n.getLength()))return this.#n(e,t,n,r,i)}#n(e,t,n,r,i){let a=this.#r(e,r,i),o=this.#t.get(a);return o??(o=se(t,n,r,`-1`,!1,i),this.#t.set(a,o)),o=w(o),o.fileName=t,o}#r(e,t,n){return e+(t?.toString()??`-1`)+(n?.toString()??`-1`)}},ue=[{fileName:`lib.d.ts`,text:`/// <reference no-default-lib="true"/>
@@ -31361,11 +31361,11 @@ type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "js
31361
31361
  declare function importScripts(...urls:string[]):void;`},{fileName:`lib.webworker.iterable.d.ts`,text:`/// <reference no-default-lib="true"/>
31362
31362
  interface AbortSignal{any(signals:Iterable<AbortSignal>):AbortSignal;}interface CSSNumericArray{[Symbol.iterator]():ArrayIterator<CSSNumericValue>;entries():ArrayIterator<[number,CSSNumericValue]>;keys():ArrayIterator<number>;values():ArrayIterator<CSSNumericValue>;}interface CSSTransformValue{[Symbol.iterator]():ArrayIterator<CSSTransformComponent>;entries():ArrayIterator<[number,CSSTransformComponent]>;keys():ArrayIterator<number>;values():ArrayIterator<CSSTransformComponent>;}interface CSSUnparsedValue{[Symbol.iterator]():ArrayIterator<CSSUnparsedSegment>;entries():ArrayIterator<[number,CSSUnparsedSegment]>;keys():ArrayIterator<number>;values():ArrayIterator<CSSUnparsedSegment>;}interface Cache{addAll(requests:Iterable<RequestInfo>):Promise<void>;}interface CanvasPath{roundRect(x:number,y:number,w:number,h:number,radii?:number|DOMPointInit|Iterable<number|DOMPointInit>):void;}interface CanvasPathDrawingStyles{setLineDash(segments:Iterable<number>):void;}interface DOMStringList{[Symbol.iterator]():ArrayIterator<string>;}interface FileList{[Symbol.iterator]():ArrayIterator<File>;}interface FontFaceSet extends Set<FontFace>{}interface FormDataIterator<T>extends IteratorObject<T,BuiltinIteratorReturn,unknown>{[Symbol.iterator]():FormDataIterator<T>;}interface FormData{[Symbol.iterator]():FormDataIterator<[string,FormDataEntryValue]>;entries():FormDataIterator<[string,FormDataEntryValue]>;keys():FormDataIterator<string>;values():FormDataIterator<FormDataEntryValue>;}interface HeadersIterator<T>extends IteratorObject<T,BuiltinIteratorReturn,unknown>{[Symbol.iterator]():HeadersIterator<T>;}interface Headers{[Symbol.iterator]():HeadersIterator<[string,string]>;entries():HeadersIterator<[string,string]>;keys():HeadersIterator<string>;values():HeadersIterator<string>;}interface IDBDatabase{transaction(storeNames:string|Iterable<string>,mode?:IDBTransactionMode,options?:IDBTransactionOptions):IDBTransaction;}interface IDBObjectStore{createIndex(name:string,keyPath:string|Iterable<string>,options?:IDBIndexParameters):IDBIndex;}interface MessageEvent<T=any>{initMessageEvent(type:string,bubbles?:boolean,cancelable?:boolean,data?:any,origin?:string,lastEventId?:string,source?:MessageEventSource|null,ports?:Iterable<MessagePort>):void;}interface StylePropertyMapReadOnlyIterator<T>extends IteratorObject<T,BuiltinIteratorReturn,unknown>{[Symbol.iterator]():StylePropertyMapReadOnlyIterator<T>;}interface StylePropertyMapReadOnly{[Symbol.iterator]():StylePropertyMapReadOnlyIterator<[string,Iterable<CSSStyleValue>]>;entries():StylePropertyMapReadOnlyIterator<[string,Iterable<CSSStyleValue>]>;keys():StylePropertyMapReadOnlyIterator<string>;values():StylePropertyMapReadOnlyIterator<Iterable<CSSStyleValue>>;}interface SubtleCrypto{deriveKey(algorithm:AlgorithmIdentifier|EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params,baseKey:CryptoKey,derivedKeyType:AlgorithmIdentifier|AesDerivedKeyParams|HmacImportParams|HkdfParams|Pbkdf2Params,extractable:boolean,keyUsages:Iterable<KeyUsage>):Promise<CryptoKey>;generateKey(algorithm:"Ed25519",extractable:boolean,keyUsages:ReadonlyArray<"sign"|"verify">):Promise<CryptoKeyPair>;generateKey(algorithm:RsaHashedKeyGenParams|EcKeyGenParams,extractable:boolean,keyUsages:ReadonlyArray<KeyUsage>):Promise<CryptoKeyPair>;generateKey(algorithm:AesKeyGenParams|HmacKeyGenParams|Pbkdf2Params,extractable:boolean,keyUsages:ReadonlyArray<KeyUsage>):Promise<CryptoKey>;generateKey(algorithm:AlgorithmIdentifier,extractable:boolean,keyUsages:Iterable<KeyUsage>):Promise<CryptoKeyPair|CryptoKey>;importKey(format:"jwk",keyData:JsonWebKey,algorithm:AlgorithmIdentifier|RsaHashedImportParams|EcKeyImportParams|HmacImportParams|AesKeyAlgorithm,extractable:boolean,keyUsages:ReadonlyArray<KeyUsage>):Promise<CryptoKey>;importKey(format:Exclude<KeyFormat,"jwk">,keyData:BufferSource,algorithm:AlgorithmIdentifier|RsaHashedImportParams|EcKeyImportParams|HmacImportParams|AesKeyAlgorithm,extractable:boolean,keyUsages:Iterable<KeyUsage>):Promise<CryptoKey>;unwrapKey(format:KeyFormat,wrappedKey:BufferSource,unwrappingKey:CryptoKey,unwrapAlgorithm:AlgorithmIdentifier|RsaOaepParams|AesCtrParams|AesCbcParams|AesGcmParams,unwrappedKeyAlgorithm:AlgorithmIdentifier|RsaHashedImportParams|EcKeyImportParams|HmacImportParams|AesKeyAlgorithm,extractable:boolean,keyUsages:Iterable<KeyUsage>):Promise<CryptoKey>;}interface URLSearchParamsIterator<T>extends IteratorObject<T,BuiltinIteratorReturn,unknown>{[Symbol.iterator]():URLSearchParamsIterator<T>;}interface URLSearchParams{[Symbol.iterator]():URLSearchParamsIterator<[string,string]>;entries():URLSearchParamsIterator<[string,string]>;keys():URLSearchParamsIterator<string>;values():URLSearchParamsIterator<string>;}interface WEBGL_draw_buffers{drawBuffersWEBGL(buffers:Iterable<GLenum>):void;}interface WEBGL_multi_draw{multiDrawArraysInstancedWEBGL(mode:GLenum,firstsList:Int32Array|Iterable<GLint>,firstsOffset:number,countsList:Int32Array|Iterable<GLsizei>,countsOffset:number,instanceCountsList:Int32Array|Iterable<GLsizei>,instanceCountsOffset:number,drawcount:GLsizei):void;multiDrawArraysWEBGL(mode:GLenum,firstsList:Int32Array|Iterable<GLint>,firstsOffset:number,countsList:Int32Array|Iterable<GLsizei>,countsOffset:number,drawcount:GLsizei):void;multiDrawElementsInstancedWEBGL(mode:GLenum,countsList:Int32Array|Iterable<GLsizei>,countsOffset:number,type:GLenum,offsetsList:Int32Array|Iterable<GLsizei>,offsetsOffset:number,instanceCountsList:Int32Array|Iterable<GLsizei>,instanceCountsOffset:number,drawcount:GLsizei):void;multiDrawElementsWEBGL(mode:GLenum,countsList:Int32Array|Iterable<GLsizei>,countsOffset:number,type:GLenum,offsetsList:Int32Array|Iterable<GLsizei>,offsetsOffset:number,drawcount:GLsizei):void;}interface WebGL2RenderingContextBase{clearBufferfv(buffer:GLenum,drawbuffer:GLint,values:Iterable<GLfloat>,srcOffset?:number):void;clearBufferiv(buffer:GLenum,drawbuffer:GLint,values:Iterable<GLint>,srcOffset?:number):void;clearBufferuiv(buffer:GLenum,drawbuffer:GLint,values:Iterable<GLuint>,srcOffset?:number):void;drawBuffers(buffers:Iterable<GLenum>):void;getActiveUniforms(program:WebGLProgram,uniformIndices:Iterable<GLuint>,pname:GLenum):any;getUniformIndices(program:WebGLProgram,uniformNames:Iterable<string>):Iterable<GLuint>|null;invalidateFramebuffer(target:GLenum,attachments:Iterable<GLenum>):void;invalidateSubFramebuffer(target:GLenum,attachments:Iterable<GLenum>,x:GLint,y:GLint,width:GLsizei,height:GLsizei):void;transformFeedbackVaryings(program:WebGLProgram,varyings:Iterable<string>,bufferMode:GLenum):void;uniform1uiv(location:WebGLUniformLocation|null,data:Iterable<GLuint>,srcOffset?:number,srcLength?:GLuint):void;uniform2uiv(location:WebGLUniformLocation|null,data:Iterable<GLuint>,srcOffset?:number,srcLength?:GLuint):void;uniform3uiv(location:WebGLUniformLocation|null,data:Iterable<GLuint>,srcOffset?:number,srcLength?:GLuint):void;uniform4uiv(location:WebGLUniformLocation|null,data:Iterable<GLuint>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix2x3fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix2x4fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix3x2fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix3x4fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix4x2fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix4x3fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;vertexAttribI4iv(index:GLuint,values:Iterable<GLint>):void;vertexAttribI4uiv(index:GLuint,values:Iterable<GLuint>):void;}interface WebGL2RenderingContextOverloads{uniform1fv(location:WebGLUniformLocation|null,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniform1iv(location:WebGLUniformLocation|null,data:Iterable<GLint>,srcOffset?:number,srcLength?:GLuint):void;uniform2fv(location:WebGLUniformLocation|null,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniform2iv(location:WebGLUniformLocation|null,data:Iterable<GLint>,srcOffset?:number,srcLength?:GLuint):void;uniform3fv(location:WebGLUniformLocation|null,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniform3iv(location:WebGLUniformLocation|null,data:Iterable<GLint>,srcOffset?:number,srcLength?:GLuint):void;uniform4fv(location:WebGLUniformLocation|null,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniform4iv(location:WebGLUniformLocation|null,data:Iterable<GLint>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix2fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix3fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;uniformMatrix4fv(location:WebGLUniformLocation|null,transpose:GLboolean,data:Iterable<GLfloat>,srcOffset?:number,srcLength?:GLuint):void;}interface WebGLRenderingContextBase{vertexAttrib1fv(index:GLuint,values:Iterable<GLfloat>):void;vertexAttrib2fv(index:GLuint,values:Iterable<GLfloat>):void;vertexAttrib3fv(index:GLuint,values:Iterable<GLfloat>):void;vertexAttrib4fv(index:GLuint,values:Iterable<GLfloat>):void;}interface WebGLRenderingContextOverloads{uniform1fv(location:WebGLUniformLocation|null,v:Iterable<GLfloat>):void;uniform1iv(location:WebGLUniformLocation|null,v:Iterable<GLint>):void;uniform2fv(location:WebGLUniformLocation|null,v:Iterable<GLfloat>):void;uniform2iv(location:WebGLUniformLocation|null,v:Iterable<GLint>):void;uniform3fv(location:WebGLUniformLocation|null,v:Iterable<GLfloat>):void;uniform3iv(location:WebGLUniformLocation|null,v:Iterable<GLint>):void;uniform4fv(location:WebGLUniformLocation|null,v:Iterable<GLfloat>):void;uniform4iv(location:WebGLUniformLocation|null,v:Iterable<GLint>):void;uniformMatrix2fv(location:WebGLUniformLocation|null,transpose:GLboolean,value:Iterable<GLfloat>):void;uniformMatrix3fv(location:WebGLUniformLocation|null,transpose:GLboolean,value:Iterable<GLfloat>):void;uniformMatrix4fv(location:WebGLUniformLocation|null,transpose:GLboolean,value:Iterable<GLfloat>):void;}`}];function de(){return ue}var fe=`/node_modules/typescript/lib`;function pe(t){if(t.libFolderPath!=null){if(t.skipLoadingLibFiles===!0)throw new e.errors.InvalidOperationError(`Cannot set ${D(t,`skipLoadingLibFiles`)} to true when ${D(t,`libFolderPath`)} is provided.`);return t.libFolderPath}return fe}var me=Xt(),he=class{fs=new _e;path=new ge;getEnvVar(e){}getEndOfLine(){return`
31363
31363
  `}getPathMatchesPattern(e,t){return f.minimatch(e,t)}},ge=class{join(...e){return me.join(...e)}normalize(e){return me.normalize(e)}relative(e,t){return me.relative(e,t)}},_e=class{#e="Access to the file system is not supported in the browser. Please use an in-memory file system (specify `useInMemoryFileSystem: true` when creating the project).";delete(e){return Promise.reject(Error(this.#e))}deleteSync(e){throw Error(this.#e)}readDirSync(e){throw Error(this.#e)}readFile(e,t){return Promise.reject(Error(this.#e))}readFileSync(e,t){throw Error(this.#e)}writeFile(e,t){return Promise.reject(Error(this.#e))}writeFileSync(e,t){throw Error(this.#e)}mkdir(e){return Promise.reject(Error(this.#e))}mkdirSync(e){throw Error(this.#e)}move(e,t){return Promise.reject(Error(this.#e))}moveSync(e,t){throw Error(this.#e)}copy(e,t){return Promise.reject(Error(this.#e))}copySync(e,t){throw Error(this.#e)}stat(e){return Promise.reject(Error(this.#e))}statSync(e){throw Error(this.#e)}realpathSync(e){throw Error(this.#e)}getCurrentDirectory(){throw Error(this.#e)}glob(e){return Promise.reject(Error(this.#e))}globSync(e){throw Error(this.#e)}isCaseSensitive(){return!0}},ve=class{fs=new be;path=new ye;getEnvVar(e){return process?.env[e]}getEndOfLine(){return g.EOL}getPathMatchesPattern(e,t){return f.minimatch(e,t)}},ye=class{join(...e){return _.join(...e)}normalize(e){return _.normalize(e)}relative(e,t){return _.relative(e,t)}},be=class{delete(e){return new Promise((t,n)=>{m.rm(e,{recursive:!0},e=>{e?n(e):t()})})}deleteSync(e){m.rmSync(e,{recursive:!0})}readDirSync(e){return m.readdirSync(e,{withFileTypes:!0}).map(e=>({name:e.name,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink()}))}readFile(e,t=`utf-8`){return new Promise((n,r)=>{m.readFile(e,t,(e,t)=>{e?r(e):n(t)})})}readFileSync(e,t=`utf-8`){return m.readFileSync(e,t)}async writeFile(e,t){await new Promise((n,r)=>{m.writeFile(e,t,e=>{e?r(e):n()})})}writeFileSync(e,t){m.writeFileSync(e,t)}async mkdir(e){await h.mkdir(e,{recursive:!0})}mkdirSync(e){m.mkdirSync(e,{recursive:!0})}move(e,t){return new Promise((n,r)=>{m.rename(e,t,e=>{e?r(e):n()})})}moveSync(e,t){m.renameSync(e,t)}copy(e,t){return new Promise((n,r)=>{m.copyFile(e,t,e=>{e?r(e):n()})})}copySync(e,t){m.copyFileSync(e,t)}stat(e){return new Promise((t,n)=>{m.stat(e,(e,r)=>{e?e.code===`ENOENT`||e.code===`ENOTDIR`?t(void 0):n(e):t(r)})})}statSync(e){return m.statSync(e,{throwIfNoEntry:!1})}realpathSync(e){return m.realpathSync(e)}getCurrentDirectory(){return _.resolve()}glob(e){return p.default(e,{cwd:this.getCurrentDirectory(),absolute:!0})}globSync(e){return p.default.sync(e,{cwd:this.getCurrentDirectory(),absolute:!0})}isCaseSensitive(){let e=process?.platform;return e!==`win32`&&e!==`darwin`}},xe=Se();function Se(){return Ce()?new ve:new he}function Ce(){return typeof globalThis.process==`object`&&typeof globalThis.process.versions==`object`&&globalThis.process.versions.node!==void 0}function we(e){let{transactionalFileSystem:t,sourceFileContainer:n,compilerOptions:r,getNewLine:i,resolutionHost:a,getProjectVersion:o,isKnownTypesPackageName:s}=e,c=0,l=t.getStandardizedAbsolutePath(pe(e)),u=e=>n.containsSourceFileAtPath(e)||t.fileExistsSync(e),f={getCompilationSettings:()=>r.get(),getNewLine:i,getProjectVersion:o,getScriptFileNames:()=>Array.from(n.getSourceFilePaths()),getScriptVersion:e=>{let r=t.getStandardizedAbsolutePath(e),i=n.getSourceFileFromCacheFromFilePath(r);return i==null?(c++).toString():n.getSourceFileVersion(i)},getScriptSnapshot:e=>{let r=t.getStandardizedAbsolutePath(e),i=n.addOrGetSourceFileFromFilePathSync(r,{markInProject:!1,scriptKind:void 0});return i?d.ScriptSnapshot.fromString(i.getFullText()):void 0},getCurrentDirectory:()=>t.getCurrentDirectory(),getDefaultLibFileName:e=>l+`/`+d.getDefaultLibFileName(e),isKnownTypesPackageName:s,useCaseSensitiveFileNames:()=>!0,readFile:(e,r)=>{let i=t.getStandardizedAbsolutePath(e);return n.containsSourceFileAtPath(i)?n.getSourceFileFromCacheFromFilePath(i).getFullText():t.readFileSync(i,r)},fileExists:e=>u(t.getStandardizedAbsolutePath(e)),directoryExists:e=>{let r=t.getStandardizedAbsolutePath(e);return n.containsDirectoryAtPath(r)||t.directoryExistsSync(r)},resolveModuleNames:a.resolveModuleNames,resolveTypeReferenceDirectives:a.resolveTypeReferenceDirectives,getResolvedModuleWithFailedLookupLocationsFromCache:a.getResolvedModuleWithFailedLookupLocationsFromCache,realpath:e=>t.realpathSync(t.getStandardizedAbsolutePath(e))};return{languageServiceHost:f,compilerHost:{getSourceFile:(e,r,i)=>{let a=t.getStandardizedAbsolutePath(e);return n.addOrGetSourceFileFromFilePathSync(a,{markInProject:!1,scriptKind:void 0})},getDefaultLibFileName:f.getDefaultLibFileName,writeFile:(e,n,r,i,a)=>{let o=t.getStandardizedAbsolutePath(e);t.writeFileSync(o,r?``+n:n)},getCurrentDirectory:()=>f.getCurrentDirectory(),getDirectories:e=>t.getDirectories(t.getStandardizedAbsolutePath(e)),fileExists:f.fileExists,readFile:f.readFile,getCanonicalFileName:e=>t.getStandardizedAbsolutePath(e),useCaseSensitiveFileNames:f.useCaseSensitiveFileNames,getNewLine:f.getNewLine,getEnvironmentVariable:e=>xe.getEnvVar(e),directoryExists:e=>f.directoryExists(e),resolveModuleNames:a.resolveModuleNames,resolveTypeReferenceDirectives:a.resolveTypeReferenceDirectives,realpath:f.realpath}}}var Te=/^[a-z]+:[\\\/]$/i,Ee=xe.path,L=class e{static#e=/\\/g;static#t=/^\//;static#n=/\/$/;static ENOENT=`ENOENT`;constructor(){}static isNotExistsError(t){return t!=null&&t.code===e.ENOENT||t!=null&&t?.constructor?.name===`NotFound`}static pathJoin(t,...n){return e.pathIsAbsolute(t)?e.standardizeSlashes(Ee.normalize(Ee.join(t,...n))):e.standardizeSlashes(Ee.join(t,...n))}static pathIsAbsolute(e){return Oe(e)}static getStandardizedAbsolutePath(t,n,r){return e.standardizeSlashes(Ee.normalize(i()));function i(){return Oe(n)?n:!n.startsWith(`./`)&&r!=null?Ee.join(r,n):Ee.join(t.getCurrentDirectory(),n)}}static getDirPath(t){t=e.standardizeSlashes(t);let n=t.lastIndexOf(`/`);return n===-1?`.`:e.standardizeSlashes(t.substring(0,n+1))}static getBaseName(e){let t=e.lastIndexOf(`/`);return e.substring(t+1)}static getExtension(t){let n=e.getBaseName(t),r=n.lastIndexOf(`.`);if(r<=0)return``;let i=n.substring(r),a=i.toLowerCase();return a===`.ts`&&n.substring(r-2,r).toLowerCase()===`.d`?n.substring(r-2):a===`.map`&&n.substring(r-3,r).toLowerCase()===`.js`?n.substring(r-3):i}static standardizeSlashes(t){let n=t.replace(this.#e,`/`);return!e.isRootDirPath(n)&&n.endsWith(`/`)&&(n=n.substring(0,n.length-1)),n}static pathEndsWith(t,n){let r=e.#r(t),i=e.#r(n);if(i.length>r.length)return!1;for(let e=0;e<i.length;e++)if(i[i.length-e-1]!==r[r.length-e-1])return!1;return i.length>0}static pathStartsWith(t,n){let r=ie.isNullOrWhitespace(t),i=ie.isNullOrWhitespace(n),a=e.#r(t),o=e.#r(n);if(r&&i)return!0;if(i||o.length>a.length)return!1;if(o.length===1&&o[0].length===0)return!0;for(let e=0;e<o.length;e++)if(o[e]!==a[e])return!1;return o.length>0}static#r(t){return t=(t||``).replace(e.#t,``).replace(e.#n,``),e.standardizeSlashes(t).replace(/^\//,``).split(`/`)}static getParentMostPaths(t){let n=[];for(let r of C.sortByProperty(t,e=>e.length))n.every(t=>!e.pathStartsWith(r,t))&&n.push(r);return n}static async readFileOrNotExists(t,n,r){try{return await t.readFile(n,r)}catch(t){if(!e.isNotExistsError(t))throw t;return!1}}static readFileOrNotExistsSync(t,n,r){try{return t.readFileSync(n,r)}catch(t){if(!e.isNotExistsError(t))throw t;return!1}}static getTextWithByteOrderMark(e){return ie.hasBom(e)?e:``+e}static getRelativePathTo(t,n){let r=Ee.relative(t,e.getDirPath(n));return e.standardizeSlashes(Ee.join(r,e.getBaseName(n)))}static isRootDirPath(e){return e===`/`||Te.test(e)}static*getDescendantDirectories(t,n){for(let r of t.readDirSync(n))r.isDirectory&&(yield r.path,yield*e.getDescendantDirectories(t,r.path))}static toAbsoluteGlob(t,n){t.slice(0,2)===`./`&&(t=t.slice(2)),t.length===1&&t===`.`&&(t=``);let r=t.slice(-1),i=e.isNegatedGlob(t);return i&&(t=t.slice(1)),(!Oe(t)||t.slice(0,1)===`\\`)&&(t=De(n,t)),r===`/`&&t.slice(-1)!==`/`&&(t+=`/`),i?`!`+t:t}static isNegatedGlob(e){return e[0]===`!`&&e[1]!==`(`}};function De(e,t){return e.charAt(e.length-1)===`/`&&(e=e.slice(0,-1)),t.charAt(0)===`/`&&(t=t.slice(1)),t?e+`/`+t:e}function Oe(e){return e.startsWith(`/`)||Ae(e)}var ke=/^[a-z]+:[\\\/]/i;function Ae(e){return ke.test(e)||je(e)||Ne(e)}function je(e){return e.startsWith(`\\\\`)}var Me=/^[\\\/]{2,}[^\\\/]+[\\\/]+[^\\\/]+/;function Ne(e){return Me.test(e)}function Pe(e,t,n){t=typeof t==`string`?[L.toAbsoluteGlob(t,n)]:t.map(e=>L.toAbsoluteGlob(e,n));let r=[];for(let n of e)for(let e of t){let t=Fe;L.isNegatedGlob(e)&&(t=Ie,e=e.slice(1)),xe.getPathMatchesPattern(n,e)&&t(r,n)}return r}function Fe(e,t){e.indexOf(t)===-1&&e.push(t)}function Ie(e,t){let n=e.indexOf(t);n>=0&&e.splice(n,1)}var Le=class{#e=new Map;constructor(){this.#r(`/`)}isCaseSensitive(){return!0}delete(e){try{return this.deleteSync(e),Promise.resolve()}catch(e){return Promise.reject(e)}}deleteSync(t){let n=L.getStandardizedAbsolutePath(this,t);if(this.#e.has(n)){for(let e of Re(this.#e.keys(),n))this.#e.delete(e);this.#e.delete(n);return}let r=this.#e.get(L.getDirPath(n));if(r==null||!r.files.has(n))throw new e.errors.FileNotFoundError(n);r.files.delete(n)}readDirSync(t){let n=L.getStandardizedAbsolutePath(this,t),r=this.#e.get(n);if(r==null)throw new e.errors.DirectoryNotFoundError(n);return[...i(this.#e.keys()),...Array.from(r.files.keys()).map(e=>({name:e,isDirectory:!1,isFile:!0,isSymlink:!1}))];function*i(e){for(let t of e){let e=L.getDirPath(t);e===n&&e!==t&&(yield{name:t,isDirectory:!0,isFile:!1,isSymlink:!1})}}}readFile(e,t=`utf-8`){try{return Promise.resolve(this.readFileSync(e,t))}catch(e){return Promise.reject(e)}}readFileSync(t,n=`utf-8`){let r=L.getStandardizedAbsolutePath(this,t),i=this.#e.get(L.getDirPath(r));if(i==null)throw new e.errors.FileNotFoundError(r);let a=i.files.get(r);if(a===void 0)throw new e.errors.FileNotFoundError(r);return a}writeFile(e,t){return this.writeFileSync(e,t),Promise.resolve()}writeFileSync(e,t){this.#t(e,t)}#t(e,t){let n=L.getStandardizedAbsolutePath(this,e),r=L.getDirPath(n);this.#r(r).files.set(n,t)}mkdir(e){return this.mkdirSync(e),Promise.resolve()}mkdirSync(e){this.#r(L.getStandardizedAbsolutePath(this,e))}move(e,t){return this.moveSync(e,t),Promise.resolve()}moveSync(t,n){let r=L.getStandardizedAbsolutePath(this,t),i=L.getStandardizedAbsolutePath(this,n);if(this.fileExistsSync(r)){let e=this.readFileSync(r);this.deleteSync(r),this.writeFileSync(i,e)}else if(this.#e.has(r)){let e=(e,t)=>{this.#n(e,t),this.#e.delete(e)};e(r,i);for(let t of Re(this.#e.keys(),r)){let n=L.getRelativePathTo(r,t);e(t,L.pathJoin(i,n))}}else throw new e.errors.PathNotFoundError(r)}copy(e,t){return this.copySync(e,t),Promise.resolve()}copySync(t,n){let r=L.getStandardizedAbsolutePath(this,t),i=L.getStandardizedAbsolutePath(this,n);if(this.fileExistsSync(r))this.writeFileSync(i,this.readFileSync(r));else if(this.#e.has(r)){this.#n(r,i);for(let e of Re(this.#e.keys(),r)){let t=L.getRelativePathTo(r,e);this.#n(e,L.pathJoin(i,t))}}else throw new e.errors.PathNotFoundError(r)}#n(e,t){let n=this.#e.get(e),r=this.#r(t);for(let[e,i]of n.files.entries()){let n=L.pathJoin(t,L.getBaseName(e));r.files.set(n,i)}}fileExists(e){return Promise.resolve(this.fileExistsSync(e))}fileExistsSync(e){let t=L.getStandardizedAbsolutePath(this,e),n=L.getDirPath(t),r=this.#e.get(n);return r==null?!1:r.files.has(t)}directoryExists(e){return Promise.resolve(this.directoryExistsSync(e))}directoryExistsSync(e){return this.#e.has(L.getStandardizedAbsolutePath(this,e))}realpathSync(e){return e}getCurrentDirectory(){return`/`}glob(e){try{return Promise.resolve(this.globSync(e))}catch(e){return Promise.reject(e)}}globSync(e){return Pe(Array.from(t(this.#e.values())),e,this.getCurrentDirectory());function*t(e){for(let t of e)yield*t.files.keys()}}#r(e){let t=this.#e.get(e);if(t==null){t={path:e,files:new Map},this.#e.set(e,t);let n=L.getDirPath(e);n!==e&&this.#r(n)}return t}};function*Re(e,t){for(let n of e)L.pathStartsWith(n,t)&&(yield n)}var ze=xe.fs,Be=class{async delete(e){try{await ze.delete(e)}catch(t){throw this.#t(t,e)}}deleteSync(e){try{ze.deleteSync(e)}catch(t){throw this.#t(t,e)}}readDirSync(e){try{let t=ze.readDirSync(e);for(let n of t)if(n.name=L.pathJoin(e,n.name),n.isSymlink)try{let e=ze.statSync(n.name);e!=null&&(n.isDirectory=e.isDirectory(),n.isFile=e.isFile())}catch{}return t}catch(t){throw this.#e(t,e)}}async readFile(e,t=`utf-8`){try{return await ze.readFile(e,t)}catch(t){throw this.#t(t,e)}}readFileSync(e,t=`utf-8`){try{return ze.readFileSync(e,t)}catch(t){throw this.#t(t,e)}}async writeFile(e,t){return ze.writeFile(e,t)}writeFileSync(e,t){ze.writeFileSync(e,t)}mkdir(e){return ze.mkdir(e)}mkdirSync(e){ze.mkdirSync(e)}move(e,t){return ze.move(e,t)}moveSync(e,t){ze.moveSync(e,t)}copy(e,t){return ze.copy(e,t)}copySync(e,t){ze.copySync(e,t)}async fileExists(e){try{return(await ze.stat(e))?.isFile()??!1}catch{return!1}}fileExistsSync(e){try{return ze.statSync(e)?.isFile()??!1}catch{return!1}}async directoryExists(e){try{return(await ze.stat(e))?.isDirectory()??!1}catch{return!1}}directoryExistsSync(e){try{return ze.statSync(e)?.isDirectory()??!1}catch{return!1}}realpathSync(e){return ze.realpathSync(e)}getCurrentDirectory(){return L.standardizeSlashes(ze.getCurrentDirectory())}glob(e){return ze.glob(Ve(e))}globSync(e){return ze.globSync(Ve(e))}isCaseSensitive(){return ze.isCaseSensitive()}#e(t,n){return L.isNotExistsError(t)?new e.errors.DirectoryNotFoundError(L.getStandardizedAbsolutePath(this,n)):t}#t(t,n){return L.isNotExistsError(t)?new e.errors.FileNotFoundError(L.getStandardizedAbsolutePath(this,n)):t}};function Ve(e){return e.map(e=>e.replace(/\\/g,`/`))}var He=class{path;operations=[];inboundOperations=[];#e=!1;#t=!1;#n;#r=new ae(e=>e.path,b.instance);constructor(e){this.path=e}getExternalOperations(){return[...this.getAncestors().map(e=>i(e)).flat().filter(e=>n(this,e)),...[this,...this.getDescendants()].map(e=>r(e)).flat().filter(e=>!t(this,e))];function t(e,t){return t.oldDir.isDescendantOrEqual(e)&&t.newDir.isDescendantOrEqual(e)}function n(t,n){switch(n.kind){case`move`:case`copy`:return t.isDescendantOrEqual(n.oldDir)||t.isDescendantOrEqual(n.newDir);case`deleteDir`:return t.isDescendantOrEqual(n.dir);default:return e.errors.throwNotImplementedForNeverValueError(n)}}function r(e){return e.operations.filter(e=>e.kind===`move`||e.kind===`copy`)}function i(e){return e.operations.filter(e=>e.kind===`move`||e.kind===`deleteDir`||e.kind===`copy`)}}isDescendantOrEqual(e){return this.isDescendant(e)||this===e}isDescendant(e){return L.pathStartsWith(this.path,e.path)}getIsDeleted(){return this.#e}getWasEverDeleted(){if(this.#t)return!0;for(let e of this.getAncestorsIterator())if(e.#t)return!0;return!1}setIsDeleted(e){if(this.#e!==e){if(e){this.#t=!0;for(let e of this.#r.entries())e.setIsDeleted(!0)}else this.#n!=null&&this.#n.setIsDeleted(!1);this.#e=e}}getParent(){return this.#n}setParent(t){if(this.#n!=null)throw new e.errors.InvalidOperationError(`For some reason, a parent was being set when the directory already had a parent. Please open an issue.`);this.#n=t,t.#r.set(this),t.#e&&!this.#e&&t.setIsDeleted(!1)}removeParent(){let e=this.#n;e!=null&&(e.#r.removeByValue(this),this.#n=void 0)}getAncestors(){return Array.from(this.getAncestorsIterator())}*getAncestorsIterator(){let e=this.#n;for(;e!=null;)yield e,e=e.#n}*getChildrenEntriesIterator(){for(let e of this.#r.entries())yield{path:e.path,isDirectory:!0,isFile:!1,isSymlink:!1}}getDescendants(){let e=[];for(let t of this.#r.entries())e.push(t),e.push(...t.getDescendants());return e}isFileQueuedForDelete(e){return this.#i(t=>t.kind===`deleteFile`&&t.filePath===e)}#i(e){for(let t of this.operations)if(e(t))return!0;return!1}dequeueFileDelete(e){this.#a(t=>t.kind===`deleteFile`&&t.filePath===e)}dequeueDirDelete(e){this.#a(t=>t.kind===`deleteDir`&&t.dir.path===e)}isRootDir(){return L.isRootDirPath(this.path)}#a(e){C.removeAll(this.operations,e)}},Ue=class{#e=new v;#t;#n;#r;constructor(e){if(this.#n=e.fileSystem,this.#t=new We(e.fileSystem),!e.skipLoadingLibFiles&&e.libFolderPath==null){let t=pe(e);this.#r=new Map;let n=de();for(let e of n)this.#r.set(this.getStandardizedAbsolutePath(t+`/`+e.fileName),e.text)}}queueFileDelete(e){this.#O(e),this.#y(e).operations.push({kind:`deleteFile`,index:this.#_(),filePath:e}),this.#t.removePath(e)}removeFileDelete(e){this.#y(e).dequeueFileDelete(e)}queueMkdir(e){let t=this.#x(e);t.setIsDeleted(!1),this.#y(e).operations.push({kind:`mkdir`,index:this.#_(),dir:t})}queueDirectoryDelete(e){let t=this.#x(e);t.setIsDeleted(!0),this.#y(e).operations.push({kind:`deleteDir`,index:this.#_(),dir:t}),this.#t.removePath(e)}queueMoveDirectory(e,t){let n=this.#y(e),r=this.#x(e),i=this.#x(t),a={kind:`move`,index:this.#_(),oldDir:r,newDir:i};n.operations.push(a),(i.getParent()||i).inboundOperations.push(a),r.setIsDeleted(!0),this.#t.removePath(e)}queueCopyDirectory(e,t){let n=this.#y(e),r=this.#x(e),i=this.#x(t),a={kind:`copy`,index:this.#_(),oldDir:r,newDir:i};n.operations.push(a),(i.getParent()||i).inboundOperations.push(a)}async flush(){let e=this.#s();for(let t of e)await this.#a(t)}flushSync(){for(let e of this.#s())this.#o(e)}async saveForDirectory(e){let t=this.#x(e);this.#S(t,`save directory`);let n=this.#i(t);await this.#C(t);for(let e of n)await this.#a(e)}saveForDirectorySync(e){let t=this.#x(e);this.#S(t,`save directory`),this.#w(t);for(let e of this.#i(t))this.#o(e)}#i(e){let t=n(e.getParent(),e);for(let n of[e,...e.getDescendants()])t.push(...n.operations);return C.sortByProperty(t,e=>e.index),this.#m(e),t;function n(e,t){return e==null?[]:[...C.removeAll(e.operations,e=>e.kind===`mkdir`&&e.dir===t),...n(e.getParent(),e)]}}async#a(t){switch(t.kind){case`deleteDir`:await this.#c(t.dir.path);break;case`deleteFile`:await this.#c(t.filePath);break;case`move`:await this.#n.move(t.oldDir.path,t.newDir.path);break;case`copy`:await this.#n.copy(t.oldDir.path,t.newDir.path);break;case`mkdir`:await this.#n.mkdir(t.dir.path);break;default:e.errors.throwNotImplementedForNeverValueError(t)}}#o(t){switch(t.kind){case`deleteDir`:this.#l(t.dir.path);break;case`deleteFile`:this.#l(t.filePath);break;case`move`:this.#n.moveSync(t.oldDir.path,t.newDir.path);break;case`copy`:this.#n.copySync(t.oldDir.path,t.newDir.path);break;case`mkdir`:this.#n.mkdirSync(t.dir.path);break;default:e.errors.throwNotImplementedForNeverValueError(t)}}#s(){let e=[];for(let t of this.#e.getValues())e.push(...t.operations);return C.sortByProperty(e,e=>e.index),this.#e.clear(),e}async moveFileImmediately(e,t,n){this.#O(t),this.#S(this.#y(e),`move file`),this.#S(this.#y(t),`move file`),await this.writeFile(t,n),await this.deleteFileImmediately(e)}moveFileImmediatelySync(e,t,n){this.#O(t),this.#S(this.#y(e),`move file`),this.#S(this.#y(t),`move file`),this.writeFileSync(t,n),this.deleteFileImmediatelySync(e)}async deleteFileImmediately(e){this.#O(e);let t=this.#y(e);this.#S(t,`delete file`),t.dequeueFileDelete(e),this.#t.removePath(e);try{await this.#c(e)}catch(t){throw this.queueFileDelete(e),t}}deleteFileImmediatelySync(e){this.#O(e);let t=this.#y(e);this.#S(t,`delete file`),t.dequeueFileDelete(e),this.#t.removePath(e);try{this.#l(e)}catch(t){throw this.queueFileDelete(e),t}}async copyDirectoryImmediately(e,t){let n=this.#x(e),r=this.#x(t);this.#S(n,`copy directory`),this.#S(r,`copy directory`);let i=Promise.all([this.saveForDirectory(e),this.saveForDirectory(t)]);this.#m(n),await i,await this.#n.copy(e,t)}copyDirectoryImmediatelySync(e,t){let n=this.#x(e),r=this.#x(t);this.#S(n,`copy directory`),this.#S(r,`copy directory`),this.saveForDirectorySync(e),this.saveForDirectorySync(t),this.#m(n),this.#n.copySync(e,t)}async moveDirectoryImmediately(e,t){let n=this.#x(e),r=this.#x(t);this.#S(n,`move directory`),this.#S(r,`move directory`);let i=Promise.all([this.saveForDirectory(e),this.saveForDirectory(t)]);this.#m(n),this.#t.removePath(e),await i,await this.#n.move(e,t)}moveDirectoryImmediatelySync(e,t){let n=this.#x(e),r=this.#x(t);this.#S(n,`move directory`),this.#S(r,`move directory`),this.saveForDirectorySync(e),this.saveForDirectorySync(t),this.#m(n),this.#t.removePath(e),this.#n.moveSync(e,t)}async deleteDirectoryImmediately(e){let t=this.#x(e);this.#S(t,`delete`),this.#m(t),this.#t.removePath(e);try{await this.#c(e)}catch{this.#h(t),this.queueDirectoryDelete(e)}}async clearDirectoryImmediately(e){await this.deleteDirectoryImmediately(e),this.#x(e).setIsDeleted(!1),await this.#n.mkdir(e)}clearDirectoryImmediatelySync(e){this.deleteDirectoryImmediatelySync(e),this.#x(e).setIsDeleted(!1),this.#n.mkdirSync(e)}deleteDirectoryImmediatelySync(e){let t=this.#x(e);this.#S(t,`delete`),this.#m(t),this.#t.removePath(e);try{this.#l(e)}catch{this.#h(t),this.queueDirectoryDelete(e)}}async#c(e){this.#O(e);try{await this.#n.delete(e)}catch(e){if(!L.isNotExistsError(e))throw e}}#l(e){this.#O(e);try{this.#n.deleteSync(e)}catch(e){if(!L.isNotExistsError(e))throw e}}fileExists(e){return this.#E(e)?!0:this.#u(e)?!1:this.#n.fileExists(e)}fileExistsSync(e){return this.#E(e)?!0:this.#u(e)?!1:this.#n.fileExistsSync(e)}#u(e){if(this.#p(e))return!0;let t=this.#v(e);return!!(t!=null&&t.getWasEverDeleted())}directoryExistsSync(e){if(this.#p(e))return!1;if(this.#f(e))return!0;let t=this.#b(e);return t!=null&&t.getWasEverDeleted()?!1:this.#n.directoryExistsSync(e)}readFileIfExistsSync(t,n){if(!this.#u(t))try{return this.readFileSync(t,n)}catch(t){if(t instanceof e.errors.FileNotFoundError)return;throw t}}readFileSync(e,t){return this.#D(e)??(this.#d(e),this.#n.readFileSync(e,t))}readFileIfExists(t,n){return this.#u(t)?Promise.resolve(void 0):this.readFile(t,n).catch(t=>t instanceof e.errors.FileNotFoundError?Promise.resolve(void 0):Promise.reject(t))}readFile(e,t){let n=this.#D(e);return n==null?(this.#d(e),this.#n.readFile(e,t)):Promise.resolve(n)}#d(t){if(this.#p(t))throw new e.errors.InvalidOperationError(`Cannot read file at ${t} when it is queued for deletion.`);if(this.#y(t).getWasEverDeleted())throw new e.errors.InvalidOperationError(`Cannot read file at ${t} because one of its ancestor directories was once deleted or moved.`)}readDirSync(t){let n=this.#x(t);if(n.getIsDeleted())throw new e.errors.InvalidOperationError(`Cannot read directory at ${t} when it is queued for deletion.`);if(n.getWasEverDeleted())throw new e.errors.InvalidOperationError(`Cannot read directory at ${t} because one of its ancestor directories was once deleted or moved.`);let r=new Map;for(let e of n.getChildrenEntriesIterator())r.set(e.path,e);for(let e of this.#n.readDirSync(t)){let t=this.getStandardizedAbsolutePath(e.name);this.#p(t)||r.set(t,{path:t,isDirectory:e.isDirectory,isFile:e.isFile,isSymlink:e.isSymlink})}return C.sortByProperty(Array.from(r.values()),e=>e.path)}async glob(e){return(await this.#n.glob(e)).map(e=>this.getStandardizedAbsolutePath(e)).filter(e=>!this.#p(e))}*globSync(e){let t=this.#n.globSync(e);for(let e of t){let t=this.getStandardizedAbsolutePath(e);this.#p(t)||(yield t)}}getFileSystem(){return this.#n}getCurrentDirectory(){return this.getStandardizedAbsolutePath(this.#n.getCurrentDirectory())}getDirectories(e){return this.readDirSync(e).filter(e=>e.isDirectory).map(e=>e.path)}realpathSync(e){if(this.#E(e))return e;try{return this.getStandardizedAbsolutePath(this.#n.realpathSync(e))}catch{return e}}getStandardizedAbsolutePath(e,t){let n=L.getStandardizedAbsolutePath(this.#n,e,t);return this.#t.getPath(n)}readFileOrNotExists(e,t){let n=this.#D(e);return n==null?this.#p(e)?!1:L.readFileOrNotExists(this.#n,e,t):Promise.resolve(n)}readFileOrNotExistsSync(e,t){return this.#D(e)??(this.#p(e)?!1:L.readFileOrNotExistsSync(this.#n,e,t))}async writeFile(e,t){this.#O(e);let n=this.#y(e);this.#S(n,`write file`),n.dequeueFileDelete(e),await this.#C(n),await this.#n.writeFile(e,t)}writeFileSync(e,t){this.#O(e);let n=this.#y(e);this.#S(n,`write file`),n.dequeueFileDelete(e),this.#w(n),this.#n.writeFileSync(e,t)}#f(e){let t=this.#b(e);return t==null?!1:!t.getIsDeleted()}#p(e){let t=this.#b(e);if(t!=null)return t.getIsDeleted();let n=this.#v(e);return n==null?!1:n.isFileQueuedForDelete(e)||n.getIsDeleted()}#m(e){let t=e.getParent();e.removeParent();for(let t of[e,...e.getDescendants()])this.#e.removeByKey(t.path);t?.dequeueDirDelete(e.path)}#h(e){for(let t of[e,...e.getDescendants()])this.#e.set(t.path,t);e.isRootDir()||e.setParent(this.#y(e.path))}#g=0;#_(){return this.#g++}#v(e){return this.#b(L.getDirPath(e))}#y(e){return this.#x(L.getDirPath(e))}#b(e){return this.#e.get(e)}#x(e){let t=this.#e.get(e);if(t!=null)return t;let n=e=>this.#e.getOrCreate(e,()=>new He(e));t=n(e);let r=e,i=t;for(;!L.isRootDirPath(r);){let e=L.getDirPath(r),a=this.#e.has(e),o=n(e);if(i.setParent(o),a)return t;i=o,r=e}return t}#S(t,n){let r=t.getExternalOperations();if(r.length===0)return;throw new e.errors.InvalidOperationError(i());function i(){let e=!1,t=`Cannot execute immediate operation '${n}' because of the following external operations:\n`;for(let n of r)n.kind===`move`?t+=`\n* Move: ${n.oldDir.path} --> ${n.newDir.path}`:n.kind===`copy`?(t+=`\n* Copy: ${n.oldDir.path} --> ${n.newDir.path}`,e=!0):n.kind===`deleteDir`?t+=`\n* Delete: ${n.dir.path}`:t+=`
31364
- * Unknown operation: Please report this as a bug.`;return e&&(t+="\n\nNote: Copy operations can be removed from external operations by setting `includeUntrackedFiles` to `false` when copying."),t}}async#C(e){e.isRootDir()||(this.#T(e),await this.#n.mkdir(e.path))}#w(e){e.isRootDir()||(this.#T(e),this.#n.mkdirSync(e.path))}#T(e){let t=e.getParent();t!=null&&(C.removeAll(t.operations,t=>t.kind===`mkdir`&&t.dir===e),this.#T(t))}#E(e){return this.#r!=null&&this.#r.has(e)}#D(e){if(this.#r!=null)return this.#r.get(e)}#O(t){if(this.#E(t))throw new e.errors.InvalidOperationError(`This operation is not permitted on an in memory lib folder file.`)}},We=class{#e;constructor(e){e.isCaseSensitive!=null&&!e.isCaseSensitive()&&(this.#e=new Map)}getPath(e){if(this.#e==null)return e;let t=e.toLowerCase(),n=this.#e.get(t);return n??(n=e,this.#e.set(t,n)),n}removePath(e){this.#e!=null&&this.#e.delete(e.toLowerCase())}};function Ge(e){let{transactionalFileSystem:t,sourceFileContainer:n,getEncoding:r}=e;return{directoryExists:e=>{let r=t.getStandardizedAbsolutePath(e);return n.containsDirectoryAtPath(r)?!0:t.directoryExistsSync(r)},fileExists:e=>{let r=t.getStandardizedAbsolutePath(e);return n.containsSourceFileAtPath(r)?!0:t.fileExistsSync(r)},readFile:e=>{let i=t.getStandardizedAbsolutePath(e),a=n.getSourceFileFromCacheFromFilePath(i);if(a!=null)return a.getFullText();try{return t.readFileSync(i,r())}catch(e){if(L.isNotExistsError(e))return;throw e}},getCurrentDirectory:()=>t.getCurrentDirectory(),getDirectories:e=>{let r=t.getStandardizedAbsolutePath(e),i=new Set(t.readDirSync(r).map(e=>e.path));for(let e of n.getChildDirectoriesOfDirectory(r))i.add(e);return Array.from(i)},realpath:e=>t.realpathSync(t.getStandardizedAbsolutePath(e))}}var Ke=class t{#e=new Map;#t;static#n=`0`;constructor(e){this.#t=e}createOrUpdateSourceFile(e,n,r,i){let a=this.#e.get(e);return a=a==null?this.#i(e,n,r,t.#n,i):this.#i(e,n,r,this.#r(a),i),a}removeSourceFile(e){this.#e.delete(e)}acquireDocument(e,t,n,r,i){let a=this.#t.getStandardizedAbsolutePath(e),o=this.#e.get(a);return(o==null||this.getSourceFileVersion(o)!==r)&&(o=this.#i(a,t,n,r,i)),o}acquireDocumentWithKey(e,t,n,r,i,a,o){return this.acquireDocument(e,n,i,a,o)}updateDocument(e,t,n,r,i){return this.acquireDocument(e,t,n,r,i)}updateDocumentWithKey(e,t,n,r,i,a,o){return this.updateDocument(e,n,i,a,o)}getKeyForCompilationSettings(e){return`defaultKey`}releaseDocument(e,t){}releaseDocumentWithKey(e,t){}reportStats(){throw new e.errors.NotImplementedError}getSourceFileVersion(e){return e.version||`0`}#r(e){return((parseInt(this.getSourceFileVersion(e),10)||0)+1).toString()}#i(e,t,n,r,i){let a=se(e,n,t.target,r,!0,i);return this.#e.set(e,a),a}},qe={deno:(e,t)=>{return{resolveModuleNames:(r,i)=>{let a=t(),o=[];for(let t of r.map(n)){let n=d.resolveModuleName(t,i,a,e);n.resolvedModule&&o.push(n.resolvedModule)}return o}};function n(e){return e.slice(-3).toLowerCase()===`.ts`?e.slice(0,-3):e}}};function Je(e,t,n){if(n.value!=null)n.value=Ze(n.value);else if(n.get!=null)n.get=Ze(n.get);else throw Error(`Only put a Memoize decorator on a method or get accessor.`)}var Ye=new WeakMap,Xe=0;function Ze(e){let t=Xe++;function n(...n){let r=Ye.get(this);r??(r=new Map,Ye.set(this,r));let i=`__memoized_value_${t}`;arguments.length>0&&(i+=`_`+JSON.stringify(n));let a;return r.has(i)?a=r.get(i):(a=e.apply(this,n),r.set(i,a)),a}return n}var Qe=class{#e;#t;_settings;constructor(e){this.#e=Object.assign({},e),this._settings=e}reset(){this._settings=Object.assign({},this.#e),this.#n()}get(){return Object.assign({},this._settings)}set(e){Object.assign(this._settings,e),this.#n()}onModified(e){this.#t??=new T,this.#t.subscribe(e)}#n(){this.#t!=null&&this.#t.fire(void 0)}},$e=class extends Qe{constructor(e={}){super(e)}set(e){super.set(e)}getEncoding(){return this._settings.charset||`utf-8`}};function et(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function tt(e,t,n,r,i,a,o){let s=e.getCurrentDirectory(),c=[],l=k(n,i||[],a,t,s),u=l.includeDirectoryPattern&&new RegExp(l.includeDirectoryPattern,`i`),d=l.excludePattern&&new RegExp(l.excludePattern,`i`);return{files:ee(n,r,i||[],a,t,s,o,t=>{let n=f(t),r=e.getStandardizedAbsolutePath(t);return n&&c.push(r),nt(r,e)},t=>e.realpathSync(e.getStandardizedAbsolutePath(t)),t=>e.directoryExistsSync(e.getStandardizedAbsolutePath(t))),directories:c};function f(e){return e[e.length-1]!==`/`&&(e+=`/`),(!u||u.test(e))&&(!d||!d.test(e))}}function nt(e,t){let n=[],r=[];try{let i=t.readDirSync(e);for(let e of i)e.isFile?n.push(e.path):e.isDirectory&&r.push(e.path)}catch(e){if(!L.isNotExistsError(e))throw e}return{files:n,directories:r}}function rt(e,t){let n=[];return{useCaseSensitiveFileNames:!1,readDirectory:(t,r,i,a,o)=>{let s=tt(e,!1,t,r,i,a,o);return n.push(...s.directories),s.files},fileExists:t=>e.fileExistsSync(e.getStandardizedAbsolutePath(t)),readFile:n=>e.readFileSync(e.getStandardizedAbsolutePath(n),t.encoding),getDirectories:()=>[...n],clearDirectories:()=>n.length=0}}var it=class{#e;#t;#n;#r;#i;constructor(e,t,n){this.#n=rt(e,{encoding:n}),this.#r=e.getStandardizedAbsolutePath(t),this.#i=L.getDirPath(this.#r),this.#t=e,this.#e=n}getCompilerOptions(){return this._parseJsonConfigFileContent().options}getErrors(){return this._parseJsonConfigFileContent().errors||[]}getPaths(e){let t=new Set,n=this.#t,r=new Set;e??=this.getCompilerOptions();let i=this._parseJsonConfigFileContent();for(let e of i.directories){let t=n.getStandardizedAbsolutePath(e);n.directoryExistsSync(t)&&r.add(t)}for(let e of i.fileNames){let i=n.getStandardizedAbsolutePath(e),a=L.getDirPath(i);n.fileExistsSync(i)&&(r.add(a),t.add(i))}return{filePaths:Array.from(t.values()),directoryPaths:Array.from(r.values())}}_parseJsonConfigFileContent(){return this.#n.clearDirectories(),{...d.parseJsonConfigFileContent(this.#a(),this.#n,this.#i,void 0,this.#r),directories:this.#n.getDirectories()}}#a(){let e=this.#t.readFileSync(this.#r,this.#e),t=d.parseConfigFileTextToJson(this.#r,e);if(t.error!=null)throw Error(t.error.messageText.toString());return t.config}};et([Je],it.prototype,`getPaths`,null),et([Je],it.prototype,`_parseJsonConfigFileContent`,null);function at(e,t={}){let n=new Ue({fileSystem:t.fileSystem||new Be,skipLoadingLibFiles:!1,libFolderPath:void 0}),r=new it(n,n.getStandardizedAbsolutePath(e),t.encoding||`utf-8`);return{options:r.getCompilerOptions(),errors:r.getErrors()}}Object.defineProperty(e,"DiagnosticCategory",{enumerable:!0,get:function(){return n.DiagnosticCategory}}),Object.defineProperty(e,"EmitHint",{enumerable:!0,get:function(){return n.EmitHint}}),Object.defineProperty(e,"LanguageVariant",{enumerable:!0,get:function(){return n.LanguageVariant}}),Object.defineProperty(e,"ModuleKind",{enumerable:!0,get:function(){return n.ModuleKind}}),Object.defineProperty(e,"ModuleResolutionKind",{enumerable:!0,get:function(){return n.ModuleResolutionKind}}),Object.defineProperty(e,"NewLineKind",{enumerable:!0,get:function(){return n.NewLineKind}}),Object.defineProperty(e,"NodeFlags",{enumerable:!0,get:function(){return n.NodeFlags}}),Object.defineProperty(e,"ObjectFlags",{enumerable:!0,get:function(){return n.ObjectFlags}}),Object.defineProperty(e,"ScriptKind",{enumerable:!0,get:function(){return n.ScriptKind}}),Object.defineProperty(e,"ScriptTarget",{enumerable:!0,get:function(){return n.ScriptTarget}}),Object.defineProperty(e,"SymbolFlags",{enumerable:!0,get:function(){return n.SymbolFlags}}),Object.defineProperty(e,"SyntaxKind",{enumerable:!0,get:function(){return n.SyntaxKind}}),Object.defineProperty(e,"TypeFlags",{enumerable:!0,get:function(){return n.TypeFlags}}),Object.defineProperty(e,"TypeFormatFlags",{enumerable:!0,get:function(){return n.TypeFormatFlags}}),e.ts=d,e.ArrayUtils=C,e.ComparerToStoredComparer=y,e.CompilerOptionsContainer=$e,e.DocumentRegistry=Ke,e.EventContainer=T,e.FileUtils=L,e.InMemoryFileSystemHost=Le,e.IterableUtils=E,e.KeyValueCache=v,e.LocaleStringComparer=b,e.Memoize=Je,e.ObjectUtils=O,e.PropertyComparer=x,e.PropertyStoredComparer=S,e.RealFileSystemHost=Be,e.ResolutionHosts=qe,e.SettingsContainer=Qe,e.SortedKeyValueArray=ae,e.StringUtils=ie,e.TransactionalFileSystem=Ue,e.TsConfigResolver=it,e.WeakCache=oe,e.createDocumentCache=ce,e.createHosts=we,e.createModuleResolutionHost=Ge,e.deepClone=w,e.getCompilerOptionsFromTsConfig=at,e.getEmitModuleResolutionKind=te,e.getFileMatcherPatterns=k,e.getLibFiles=de,e.getLibFolderPath=pe,e.getSyntaxKindName=ne,e.libFolderInMemoryPath=fe,e.matchFiles=ee,e.matchGlobs=Pe,e.nameof=D,e.runtime=xe})),B=e.bt((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getStringFromStrOrFunc=e.escapeForWithinString=void 0;function t(e,t){let n=``;for(let r=0;r<e.length;r++)e[r]===t?n+=`\\`:e[r]===`\r`&&e[r+1]===`
31364
+ * Unknown operation: Please report this as a bug.`;return e&&(t+="\n\nNote: Copy operations can be removed from external operations by setting `includeUntrackedFiles` to `false` when copying."),t}}async#C(e){e.isRootDir()||(this.#T(e),await this.#n.mkdir(e.path))}#w(e){e.isRootDir()||(this.#T(e),this.#n.mkdirSync(e.path))}#T(e){let t=e.getParent();t!=null&&(C.removeAll(t.operations,t=>t.kind===`mkdir`&&t.dir===e),this.#T(t))}#E(e){return this.#r!=null&&this.#r.has(e)}#D(e){if(this.#r!=null)return this.#r.get(e)}#O(t){if(this.#E(t))throw new e.errors.InvalidOperationError(`This operation is not permitted on an in memory lib folder file.`)}},We=class{#e;constructor(e){e.isCaseSensitive!=null&&!e.isCaseSensitive()&&(this.#e=new Map)}getPath(e){if(this.#e==null)return e;let t=e.toLowerCase(),n=this.#e.get(t);return n??(n=e,this.#e.set(t,n)),n}removePath(e){this.#e!=null&&this.#e.delete(e.toLowerCase())}};function Ge(e){let{transactionalFileSystem:t,sourceFileContainer:n,getEncoding:r}=e;return{directoryExists:e=>{let r=t.getStandardizedAbsolutePath(e);return n.containsDirectoryAtPath(r)?!0:t.directoryExistsSync(r)},fileExists:e=>{let r=t.getStandardizedAbsolutePath(e);return n.containsSourceFileAtPath(r)?!0:t.fileExistsSync(r)},readFile:e=>{let i=t.getStandardizedAbsolutePath(e),a=n.getSourceFileFromCacheFromFilePath(i);if(a!=null)return a.getFullText();try{return t.readFileSync(i,r())}catch(e){if(L.isNotExistsError(e))return;throw e}},getCurrentDirectory:()=>t.getCurrentDirectory(),getDirectories:e=>{let r=t.getStandardizedAbsolutePath(e),i=new Set(t.readDirSync(r).map(e=>e.path));for(let e of n.getChildDirectoriesOfDirectory(r))i.add(e);return Array.from(i)},realpath:e=>t.realpathSync(t.getStandardizedAbsolutePath(e))}}var Ke=class t{#e=new Map;#t;static#n=`0`;constructor(e){this.#t=e}createOrUpdateSourceFile(e,n,r,i){let a=this.#e.get(e);return a=a==null?this.#i(e,n,r,t.#n,i):this.#i(e,n,r,this.#r(a),i),a}removeSourceFile(e){this.#e.delete(e)}acquireDocument(e,t,n,r,i){let a=this.#t.getStandardizedAbsolutePath(e),o=this.#e.get(a);return(o==null||this.getSourceFileVersion(o)!==r)&&(o=this.#i(a,t,n,r,i)),o}acquireDocumentWithKey(e,t,n,r,i,a,o){return this.acquireDocument(e,n,i,a,o)}updateDocument(e,t,n,r,i){return this.acquireDocument(e,t,n,r,i)}updateDocumentWithKey(e,t,n,r,i,a,o){return this.updateDocument(e,n,i,a,o)}getKeyForCompilationSettings(e){return`defaultKey`}releaseDocument(e,t){}releaseDocumentWithKey(e,t){}reportStats(){throw new e.errors.NotImplementedError}getSourceFileVersion(e){return e.version||`0`}#r(e){return((parseInt(this.getSourceFileVersion(e),10)||0)+1).toString()}#i(e,t,n,r,i){let a=se(e,n,t.target,r,!0,i);return this.#e.set(e,a),a}},qe={deno:(e,t)=>{return{resolveModuleNames:(r,i)=>{let a=t(),o=[];for(let t of r.map(n)){let n=d.resolveModuleName(t,i,a,e);n.resolvedModule&&o.push(n.resolvedModule)}return o}};function n(e){return e.slice(-3).toLowerCase()===`.ts`?e.slice(0,-3):e}}};function Je(e,t,n){if(n.value!=null)n.value=Ze(n.value);else if(n.get!=null)n.get=Ze(n.get);else throw Error(`Only put a Memoize decorator on a method or get accessor.`)}var Ye=new WeakMap,Xe=0;function Ze(e){let t=Xe++;function n(...n){let r=Ye.get(this);r??(r=new Map,Ye.set(this,r));let i=`__memoized_value_${t}`;arguments.length>0&&(i+=`_`+JSON.stringify(n));let a;return r.has(i)?a=r.get(i):(a=e.apply(this,n),r.set(i,a)),a}return n}var Qe=class{#e;#t;_settings;constructor(e){this.#e=Object.assign({},e),this._settings=e}reset(){this._settings=Object.assign({},this.#e),this.#n()}get(){return Object.assign({},this._settings)}set(e){Object.assign(this._settings,e),this.#n()}onModified(e){this.#t??=new T,this.#t.subscribe(e)}#n(){this.#t!=null&&this.#t.fire(void 0)}},$e=class extends Qe{constructor(e={}){super(e)}set(e){super.set(e)}getEncoding(){return this._settings.charset||`utf-8`}};function et(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function tt(e,t,n,r,i,a,o){let s=e.getCurrentDirectory(),c=[],l=k(n,i||[],a,t,s),u=l.includeDirectoryPattern&&new RegExp(l.includeDirectoryPattern,`i`),d=l.excludePattern&&new RegExp(l.excludePattern,`i`);return{files:ee(n,r,i||[],a,t,s,o,t=>{let n=f(t),r=e.getStandardizedAbsolutePath(t);return n&&c.push(r),nt(r,e)},t=>e.realpathSync(e.getStandardizedAbsolutePath(t)),t=>e.directoryExistsSync(e.getStandardizedAbsolutePath(t))),directories:c};function f(e){return e[e.length-1]!==`/`&&(e+=`/`),(!u||u.test(e))&&(!d||!d.test(e))}}function nt(e,t){let n=[],r=[];try{let i=t.readDirSync(e);for(let e of i)e.isFile?n.push(e.path):e.isDirectory&&r.push(e.path)}catch(e){if(!L.isNotExistsError(e))throw e}return{files:n,directories:r}}function rt(e,t){let n=[];return{useCaseSensitiveFileNames:!1,readDirectory:(t,r,i,a,o)=>{let s=tt(e,!1,t,r,i,a,o);return n.push(...s.directories),s.files},fileExists:t=>e.fileExistsSync(e.getStandardizedAbsolutePath(t)),readFile:n=>e.readFileSync(e.getStandardizedAbsolutePath(n),t.encoding),getDirectories:()=>[...n],clearDirectories:()=>n.length=0}}var it=class{#e;#t;#n;#r;#i;constructor(e,t,n){this.#n=rt(e,{encoding:n}),this.#r=e.getStandardizedAbsolutePath(t),this.#i=L.getDirPath(this.#r),this.#t=e,this.#e=n}getCompilerOptions(){return this._parseJsonConfigFileContent().options}getErrors(){return this._parseJsonConfigFileContent().errors||[]}getPaths(e){let t=new Set,n=this.#t,r=new Set;e??=this.getCompilerOptions();let i=this._parseJsonConfigFileContent();for(let e of i.directories){let t=n.getStandardizedAbsolutePath(e);n.directoryExistsSync(t)&&r.add(t)}for(let e of i.fileNames){let i=n.getStandardizedAbsolutePath(e),a=L.getDirPath(i);n.fileExistsSync(i)&&(r.add(a),t.add(i))}return{filePaths:Array.from(t.values()),directoryPaths:Array.from(r.values())}}_parseJsonConfigFileContent(){return this.#n.clearDirectories(),{...d.parseJsonConfigFileContent(this.#a(),this.#n,this.#i,void 0,this.#r),directories:this.#n.getDirectories()}}#a(){let e=this.#t.readFileSync(this.#r,this.#e),t=d.parseConfigFileTextToJson(this.#r,e);if(t.error!=null)throw Error(t.error.messageText.toString());return t.config}};et([Je],it.prototype,`getPaths`,null),et([Je],it.prototype,`_parseJsonConfigFileContent`,null);function at(e,t={}){let n=new Ue({fileSystem:t.fileSystem||new Be,skipLoadingLibFiles:!1,libFolderPath:void 0}),r=new it(n,n.getStandardizedAbsolutePath(e),t.encoding||`utf-8`);return{options:r.getCompilerOptions(),errors:r.getErrors()}}Object.defineProperty(e,"DiagnosticCategory",{enumerable:!0,get:function(){return n.DiagnosticCategory}}),Object.defineProperty(e,"EmitHint",{enumerable:!0,get:function(){return n.EmitHint}}),Object.defineProperty(e,"LanguageVariant",{enumerable:!0,get:function(){return n.LanguageVariant}}),Object.defineProperty(e,"ModuleKind",{enumerable:!0,get:function(){return n.ModuleKind}}),Object.defineProperty(e,"ModuleResolutionKind",{enumerable:!0,get:function(){return n.ModuleResolutionKind}}),Object.defineProperty(e,"NewLineKind",{enumerable:!0,get:function(){return n.NewLineKind}}),Object.defineProperty(e,"NodeFlags",{enumerable:!0,get:function(){return n.NodeFlags}}),Object.defineProperty(e,"ObjectFlags",{enumerable:!0,get:function(){return n.ObjectFlags}}),Object.defineProperty(e,"ScriptKind",{enumerable:!0,get:function(){return n.ScriptKind}}),Object.defineProperty(e,"ScriptTarget",{enumerable:!0,get:function(){return n.ScriptTarget}}),Object.defineProperty(e,"SymbolFlags",{enumerable:!0,get:function(){return n.SymbolFlags}}),Object.defineProperty(e,"SyntaxKind",{enumerable:!0,get:function(){return n.SyntaxKind}}),Object.defineProperty(e,"TypeFlags",{enumerable:!0,get:function(){return n.TypeFlags}}),Object.defineProperty(e,"TypeFormatFlags",{enumerable:!0,get:function(){return n.TypeFormatFlags}}),e.ts=d,e.ArrayUtils=C,e.ComparerToStoredComparer=y,e.CompilerOptionsContainer=$e,e.DocumentRegistry=Ke,e.EventContainer=T,e.FileUtils=L,e.InMemoryFileSystemHost=Le,e.IterableUtils=E,e.KeyValueCache=v,e.LocaleStringComparer=b,e.Memoize=Je,e.ObjectUtils=O,e.PropertyComparer=x,e.PropertyStoredComparer=S,e.RealFileSystemHost=Be,e.ResolutionHosts=qe,e.SettingsContainer=Qe,e.SortedKeyValueArray=ae,e.StringUtils=ie,e.TransactionalFileSystem=Ue,e.TsConfigResolver=it,e.WeakCache=oe,e.createDocumentCache=ce,e.createHosts=we,e.createModuleResolutionHost=Ge,e.deepClone=w,e.getCompilerOptionsFromTsConfig=at,e.getEmitModuleResolutionKind=te,e.getFileMatcherPatterns=k,e.getLibFiles=de,e.getLibFolderPath=pe,e.getSyntaxKindName=ne,e.libFolderInMemoryPath=fe,e.matchFiles=ee,e.matchGlobs=Pe,e.nameof=D,e.runtime=xe})),B=e.Ct((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getStringFromStrOrFunc=e.escapeForWithinString=void 0;function t(e,t){let n=``;for(let r=0;r<e.length;r++)e[r]===t?n+=`\\`:e[r]===`\r`&&e[r+1]===`
31365
31365
  `?(n+=`\\r\\n\\`,r++):e[r]===`
31366
- `?n+=`\\n\\`:e[r]===`\\`&&(n+=`\\`),n+=e[r];return n}e.escapeForWithinString=t;function n(e){return e instanceof Function?e():e}e.getStringFromStrOrFunc=n})),Qt=e.bt((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=B(),n;(function(e){e[e.Line=0]=`Line`,e[e.Star=1]=`Star`})(n||={});var r={BACK_SLASH:92,FORWARD_SLASH:47,NEW_LINE:10,CARRIAGE_RETURN:13,ASTERISK:42,DOUBLE_QUOTE:34,SINGLE_QUOTE:39,BACK_TICK:96,OPEN_BRACE:123,CLOSE_BRACE:125,DOLLAR_SIGN:36,SPACE:32,TAB:9},i=new Set([r.BACK_SLASH,r.FORWARD_SLASH,r.NEW_LINE,r.CARRIAGE_RETURN,r.ASTERISK,r.DOUBLE_QUOTE,r.SINGLE_QUOTE,r.BACK_TICK,r.OPEN_BRACE,r.CLOSE_BRACE]),a=class e{constructor(e={}){Object.defineProperty(this,"_indentationText",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_newLine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_useTabs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_quoteChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_indentNumberOfSpaces",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_currentIndentation",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_queuedIndentation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queuedOnlyIfNotBlock",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_length",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_newLineOnNextWrite",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_currentCommentChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stringCharStack",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isInRegEx",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isOnFirstLineOfBlock",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_texts",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._newLine=e.newLine||`
31366
+ `?n+=`\\n\\`:e[r]===`\\`&&(n+=`\\`),n+=e[r];return n}e.escapeForWithinString=t;function n(e){return e instanceof Function?e():e}e.getStringFromStrOrFunc=n})),Qt=e.Ct((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=B(),n;(function(e){e[e.Line=0]=`Line`,e[e.Star=1]=`Star`})(n||={});var r={BACK_SLASH:92,FORWARD_SLASH:47,NEW_LINE:10,CARRIAGE_RETURN:13,ASTERISK:42,DOUBLE_QUOTE:34,SINGLE_QUOTE:39,BACK_TICK:96,OPEN_BRACE:123,CLOSE_BRACE:125,DOLLAR_SIGN:36,SPACE:32,TAB:9},i=new Set([r.BACK_SLASH,r.FORWARD_SLASH,r.NEW_LINE,r.CARRIAGE_RETURN,r.ASTERISK,r.DOUBLE_QUOTE,r.SINGLE_QUOTE,r.BACK_TICK,r.OPEN_BRACE,r.CLOSE_BRACE]),a=class e{constructor(e={}){Object.defineProperty(this,"_indentationText",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_newLine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_useTabs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_quoteChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_indentNumberOfSpaces",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_currentIndentation",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_queuedIndentation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queuedOnlyIfNotBlock",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_length",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_newLineOnNextWrite",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_currentCommentChar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stringCharStack",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isInRegEx",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isOnFirstLineOfBlock",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_texts",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._newLine=e.newLine||`
31367
31367
  `,this._useTabs=e.useTabs||!1,this._indentNumberOfSpaces=e.indentNumberOfSpaces||4,this._indentationText=s(this._useTabs,this._indentNumberOfSpaces),this._quoteChar=e.useSingleQuote?`'`:`"`}getOptions(){return{indentNumberOfSpaces:this._indentNumberOfSpaces,newLine:this._newLine,useTabs:this._useTabs,useSingleQuote:this._quoteChar===`'`}}queueIndentationLevel(e){return this._queuedIndentation=this._getIndentationLevelFromArg(e),this._queuedOnlyIfNotBlock=void 0,this}hangingIndent(e){return this._withResetIndentation(()=>this.queueIndentationLevel(this.getIndentationLevel()+1),e)}hangingIndentUnlessBlock(e){return this._withResetIndentation(()=>{this.queueIndentationLevel(this.getIndentationLevel()+1),this._queuedOnlyIfNotBlock=!0},e)}setIndentationLevel(e){return this._currentIndentation=this._getIndentationLevelFromArg(e),this}withIndentationLevel(e,t){return this._withResetIndentation(()=>this.setIndentationLevel(e),t)}_withResetIndentation(e,t){let n=this._getIndentationState();e();try{t()}finally{this._setIndentationState(n)}return this}getIndentationLevel(){return this._currentIndentation}block(e){return this._newLineIfNewLineOnNextWrite(),this.getLength()>0&&!this.isLastNewLine()&&this.spaceIfLastNot(),this.inlineBlock(e),this._newLineOnNextWrite=!0,this}inlineBlock(e){return this._newLineIfNewLineOnNextWrite(),this.write(`{`),this._indentBlockInternal(e),this.newLineIfLastNot().write(`}`),this}indent(e=1){return typeof e==`number`?(this._newLineIfNewLineOnNextWrite(),this.write(this._indentationText.repeat(e))):(this._indentBlockInternal(e),this.isLastNewLine()||(this._newLineOnNextWrite=!0),this)}_indentBlockInternal(e){this.getLastChar()!=null&&this.newLineIfLastNot(),this._currentIndentation++,this._isOnFirstLineOfBlock=!0,e?.(),this._isOnFirstLineOfBlock=!1,this._currentIndentation=Math.max(0,this._currentIndentation-1)}conditionalWriteLine(e,n){return e&&this.writeLine((0,t.getStringFromStrOrFunc)(n)),this}writeLine(e){return this._newLineIfNewLineOnNextWrite(),this.getLastChar()!=null&&this.newLineIfLastNot(),this._writeIndentingNewLines(e),this.newLine(),this}newLineIfLastNot(){return this._newLineIfNewLineOnNextWrite(),this.isLastNewLine()||this.newLine(),this}blankLineIfLastNot(){return this.isLastBlankLine()||this.blankLine(),this}conditionalBlankLine(e){return e&&this.blankLine(),this}blankLine(){return this.newLineIfLastNot().newLine()}conditionalNewLine(e){return e&&this.newLine(),this}newLine(){return this._newLineOnNextWrite=!1,this._baseWriteNewline(),this}quote(e){return this._newLineIfNewLineOnNextWrite(),this._writeIndentingNewLines(e==null?this._quoteChar:this._quoteChar+(0,t.escapeForWithinString)(e,this._quoteChar)+this._quoteChar),this}spaceIfLastNot(){return this._newLineIfNewLineOnNextWrite(),this.isLastSpace()||this._writeIndentingNewLines(` `),this}space(e=1){return this._newLineIfNewLineOnNextWrite(),this._writeIndentingNewLines(` `.repeat(e)),this}tabIfLastNot(){return this._newLineIfNewLineOnNextWrite(),this.isLastTab()||this._writeIndentingNewLines(` `),this}tab(e=1){return this._newLineIfNewLineOnNextWrite(),this._writeIndentingNewLines(` `.repeat(e)),this}conditionalWrite(e,n){return e&&this.write((0,t.getStringFromStrOrFunc)(n)),this}write(e){return this._newLineIfNewLineOnNextWrite(),this._writeIndentingNewLines(e),this}closeComment(){switch(this._currentCommentChar){case n.Line:this.newLine();break;case n.Star:this.isLastNewLine()||this.spaceIfLastNot(),this.write(`*/`);break;default:break}return this}unsafeInsert(e,t){let n=this._length,r=this._texts;if(i(),e===n)return this.write(t);return a(),this._length+=t.length,this;function i(){if(e<0)throw Error(`Provided position of '${e}' was less than zero.`);if(e>n)throw Error(`Provided position of '${e}' was greater than the text length of '${n}'.`)}function a(){let{index:e,localIndex:n}=o();if(n===0)r.splice(e,0,t);else if(n===r[e].length)r.splice(e+1,0,t);else{let i=r[e],a=i.substring(0,n),o=i.substring(n);r.splice(e,1,a,t,o)}}function o(){if(e<n/2){let t=0;for(let n=0;n<r.length;n++){let i=r[n],a=t;if(t+=i.length,t>=e)return{index:n,localIndex:e-a}}}else{let t=n;for(let n=r.length-1;n>=0;n--){let i=r[n];if(t-=i.length,t<=e)return{index:n,localIndex:e-t}}}throw Error(`Unhandled situation inserting. This should never happen.`)}}getLength(){return this._length}isInComment(){return this._currentCommentChar!==void 0}isAtStartOfFirstLineOfBlock(){return this.isOnFirstLineOfBlock()&&(this.isLastNewLine()||this.getLastChar()==null)}isOnFirstLineOfBlock(){return this._isOnFirstLineOfBlock}isInString(){return this._stringCharStack.length>0&&this._stringCharStack[this._stringCharStack.length-1]!==r.OPEN_BRACE}isLastNewLine(){let e=this.getLastChar();return e===`
31368
- `||e===`\r`}isLastBlankLine(){let e=0;for(let t=this._texts.length-1;t>=0;t--){let n=this._texts[t];for(let t=n.length-1;t>=0;t--){let i=n.charCodeAt(t);if(i===r.NEW_LINE){if(e++,e===2)return!0}else if(i!==r.CARRIAGE_RETURN)return!1}}return!1}isLastSpace(){return this.getLastChar()===` `}isLastTab(){return this.getLastChar()===` `}getLastChar(){let e=this._getLastCharCodeWithOffset(0);return e==null?void 0:String.fromCharCode(e)}endsWith(e){let t=this._length;return this.iterateLastCharCodes((n,r)=>{let i=t-r,a=e.length-i;return e.charCodeAt(a)===n?a===0?!0:void 0:!1})||!1}iterateLastChars(e){return this.iterateLastCharCodes((t,n)=>e(String.fromCharCode(t),n))}iterateLastCharCodes(e){let t=this._length;for(let n=this._texts.length-1;n>=0;n--){let r=this._texts[n];for(let n=r.length-1;n>=0;n--){t--;let i=e(r.charCodeAt(n),t);if(i!=null)return i}}}toString(){if(this._texts.length>1){let e=this._texts.join(``);this._texts.length=0,this._texts.push(e)}return this._texts[0]||``}_writeIndentingNewLines(t){if(t||=``,t.length===0){n(this,``);return}t.split(e._newLineRegEx).forEach((e,t)=>{t>0&&this._baseWriteNewline(),e.length!==0&&n(this,e)});function n(e,t){e.isInString()||(e.isLastNewLine()||e.getLastChar()==null)&&e._writeIndentation(),e._updateInternalState(t),e._internalWrite(t)}}_baseWriteNewline(){this._currentCommentChar===n.Line&&(this._currentCommentChar=void 0);let e=this._stringCharStack[this._stringCharStack.length-1];(e===r.DOUBLE_QUOTE||e===r.SINGLE_QUOTE)&&this._getLastCharCodeWithOffset(0)!==r.BACK_SLASH&&this._stringCharStack.pop(),this._internalWrite(this._newLine),this._isOnFirstLineOfBlock=!1,this._dequeueQueuedIndentation()}_dequeueQueuedIndentation(){if(this._queuedIndentation==null)return;this._queuedOnlyIfNotBlock&&e(this)?(this._queuedIndentation=void 0,this._queuedOnlyIfNotBlock=void 0):(this._currentIndentation=this._queuedIndentation,this._queuedIndentation=void 0);function e(e){let t=!1;return e.iterateLastCharCodes(e=>{switch(e){case r.NEW_LINE:if(t)return!1;t=!0;break;case r.CARRIAGE_RETURN:return;case r.OPEN_BRACE:return!0;default:return!1}})}}_updateInternalState(e){for(let t=0;t<e.length;t++){let a=e.charCodeAt(t);if(!i.has(a))continue;let s=t===0?this._getLastCharCodeWithOffset(0):e.charCodeAt(t-1),c=t===0?this._getLastCharCodeWithOffset(1):t===1?this._getLastCharCodeWithOffset(0):e.charCodeAt(t-2);if(this._isInRegEx)if(s===r.FORWARD_SLASH&&c!==r.BACK_SLASH||s===r.NEW_LINE)this._isInRegEx=!1;else continue;else if(!this.isInString()&&!this.isInComment()&&o(a,s,c)){this._isInRegEx=!0;continue}if(this.isInString()||(this._currentCommentChar==null&&s===r.FORWARD_SLASH&&a===r.FORWARD_SLASH?this._currentCommentChar=n.Line:this._currentCommentChar==null&&s===r.FORWARD_SLASH&&a===r.ASTERISK?this._currentCommentChar=n.Star:this._currentCommentChar===n.Star&&s===r.ASTERISK&&a===r.FORWARD_SLASH&&(this._currentCommentChar=void 0)),this.isInComment())continue;let l=this._stringCharStack.length===0?void 0:this._stringCharStack[this._stringCharStack.length-1];s!==r.BACK_SLASH&&(a===r.DOUBLE_QUOTE||a===r.SINGLE_QUOTE||a===r.BACK_TICK)?l===a?this._stringCharStack.pop():(l===r.OPEN_BRACE||l===void 0)&&this._stringCharStack.push(a):c!==r.BACK_SLASH&&s===r.DOLLAR_SIGN&&a===r.OPEN_BRACE&&l===r.BACK_TICK?this._stringCharStack.push(a):a===r.CLOSE_BRACE&&l===r.OPEN_BRACE&&this._stringCharStack.pop()}}_getLastCharCodeWithOffset(e){if(!(e>=this._length||e<0))for(let t=this._texts.length-1;t>=0;t--){let n=this._texts[t];if(e>=n.length)e-=n.length;else return n.charCodeAt(n.length-1-e)}}_writeIndentation(){let e=Math.floor(this._currentIndentation);this._internalWrite(this._indentationText.repeat(e));let t=this._currentIndentation-e;if(this._useTabs)t>.5&&this._internalWrite(this._indentationText);else{let e=Math.round(this._indentationText.length*t),n=``;for(let t=0;t<e;t++)n+=this._indentationText[t];this._internalWrite(n)}}_newLineIfNewLineOnNextWrite(){this._newLineOnNextWrite&&(this._newLineOnNextWrite=!1,this.newLine())}_internalWrite(e){e.length!==0&&(this._texts.push(e),this._length+=e.length)}_getIndentationLevelFromArg(t){if(typeof t==`number`){if(t<0)throw Error(`Passed in indentation level should be greater than or equal to 0.`);return t}else if(typeof t==`string`){if(!e._spacesOrTabsRegEx.test(t))throw Error(`Provided string must be empty or only contain spaces or tabs.`);let{spacesCount:n,tabsCount:r}=c(t);return r+n/this._indentNumberOfSpaces}else throw Error(`Argument provided must be a string or number.`)}_setIndentationState(e){this._currentIndentation=e.current,this._queuedIndentation=e.queued,this._queuedOnlyIfNotBlock=e.queuedOnlyIfNotBlock}_getIndentationState(){return{current:this._currentIndentation,queued:this._queuedIndentation,queuedOnlyIfNotBlock:this._queuedOnlyIfNotBlock}}};Object.defineProperty(a,"_newLineRegEx",{enumerable:!0,configurable:!0,writable:!0,value:/\r?\n/}),Object.defineProperty(a,"_spacesOrTabsRegEx",{enumerable:!0,configurable:!0,writable:!0,value:/^[ \t]*$/}),e.default=a;function o(e,t,n){return t===r.FORWARD_SLASH&&e!==r.FORWARD_SLASH&&e!==r.ASTERISK&&n!==r.ASTERISK&&n!==r.FORWARD_SLASH}function s(e,t){return e?` `:Array(t+1).join(` `)}function c(e){let t=0,n=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);a===r.SPACE?t++:a===r.TAB&&n++}return{spacesCount:t,tabsCount:n}}})),$t=e.bt((e=>{var t=Zt(),n=Qt();function r(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var i=r(n),a=class{#e;#t=[void 0,void 0,void 0];#n=0;#r=!1;#i=0;constructor(e){this.#e=e,this.#a()}get done(){return this.#r}get current(){if(this.#i===0)throw new t.errors.InvalidOperationError(`Cannot get the current when the iterator has not been advanced.`);return this.#t[this.#n]}get previous(){if(this.#i<=1)throw new t.errors.InvalidOperationError(`Cannot get the previous when the iterator has not advanced enough.`);return this.#t[(this.#n+this.#t.length-1)%this.#t.length]}get peek(){if(this.#r)throw new t.errors.InvalidOperationError(`Cannot peek at the end of the iterator.`);return this.#t[(this.#n+1)%this.#t.length]}next(){if(this.done)throw new t.errors.InvalidOperationError(`Cannot get the next when at the end of the iterator.`);let e=this.#t[this.#o()];return this.#a(),this.#i++,e}*rest(){for(;!this.done;)yield this.next()}#a(){let e=this.#e.next();if(this.#n=this.#o(),e.done){this.#r=!0;return}this.#t[this.#o()]=e.value}#o(){return(this.#n+1)%this.#t.length}},o={ASTERISK:42,NEWLINE:10,CARRIAGE_RETURN:13,SPACE:32,TAB:9,CLOSE_BRACE:125};function s(e,t){let n;return n=typeof t==`string`?e=>c(e,t):t,e.find(n)}function c(e,t){if(e.getNameNode==null)return!1;let n=e.getNameNode();return n==null?!1:V.isArrayBindingPattern(n)||V.isObjectBindingPattern(n)?n.getElements().some(e=>c(e,t)):(e.getName==null?n.getText():e.getName())===t}function l(e,t){return typeof t==`string`?`Expected to find ${e} named '${t}'.`:`Expected to find ${e} that matched the provided condition.`}e.CommentNodeKind=void 0,(function(e){e[e.Statement=0]=`Statement`,e[e.ClassElement=1]=`ClassElement`,e[e.TypeElement=2]=`TypeElement`,e[e.ObjectLiteralElement=3]=`ObjectLiteralElement`,e[e.EnumMember=4]=`EnumMember`})(e.CommentNodeKind||={});var u=class{#e;#t;#n;constructor(e,n,r,i,a,o){this.#e=e,this.#t=n,this.#n=a,this.pos=n,this.end=r,this.kind=i,this.flags=t.ts.NodeFlags.None,this.parent=o}pos;end;kind;flags;modifiers;parent;getSourceFile(){return this.#n}getChildCount(e){return 0}getChildAt(e,t){}getChildren(e){return[]}getStart(e,t){return this.#t}getFullStart(){return this.#e}getEnd(){return this.end}getWidth(e){return this.end-this.#t}getFullWidth(){return this.end-this.#e}getLeadingTriviaWidth(e){return this.#t-this.#e}getFullText(e){return this.#n.text.substring(this.#e,this.end)}getText(e){return this.#n.text.substring(this.#t,this.end)}getFirstToken(e){}getLastToken(e){}forEachChild(e,t){}},d=class extends u{_jsdocContainerBrand;_statementBrand;_commentKind=e.CommentNodeKind.Statement},f=class extends u{_classElementBrand;_declarationBrand;_commentKind=e.CommentNodeKind.ClassElement},p=class extends u{_typeElementBrand;_declarationBrand;_commentKind=e.CommentNodeKind.TypeElement},m=class extends u{_declarationBrand;_objectLiteralBrand;declarationBrand;_commentKind=e.CommentNodeKind.ObjectLiteralElement},h=class extends u{_commentKind=e.CommentNodeKind.EnumMember},g;(function(e){e[e.SingleLine=0]=`SingleLine`,e[e.MultiLine=1]=`MultiLine`,e[e.JsDoc=2]=`JsDoc`})(g||={});var _=new WeakMap,v=new Set([t.SyntaxKind.SourceFile,t.SyntaxKind.Block,t.SyntaxKind.ModuleBlock,t.SyntaxKind.CaseClause,t.SyntaxKind.DefaultClause,t.SyntaxKind.ClassDeclaration,t.SyntaxKind.InterfaceDeclaration,t.SyntaxKind.EnumDeclaration,t.SyntaxKind.ClassExpression,t.SyntaxKind.TypeLiteral,t.SyntaxKind.ObjectLiteralExpression]),y=class{constructor(){}static getOrParseChildren(e,t){x(e)&&(e=e.parent);let n=_.get(e);return n??(n=Array.from(b(e,t)),_.set(e,n)),n}static shouldParseChildren(e){return v.has(e.kind)&&e.pos!==e.end}static hasParsedChildren(e){return x(e)&&(e=e.parent),_.has(e)}static isCommentStatement(t){return t._commentKind===e.CommentNodeKind.Statement}static isCommentClassElement(t){return t._commentKind===e.CommentNodeKind.ClassElement}static isCommentTypeElement(t){return t._commentKind===e.CommentNodeKind.TypeElement}static isCommentObjectLiteralElement(t){return t._commentKind===e.CommentNodeKind.ObjectLiteralElement}static isCommentEnumMember(t){return t._commentKind===e.CommentNodeKind.EnumMember}static getContainerBodyPos(e,n){if(t.ts.isSourceFile(e))return 0;if(t.ts.isClassDeclaration(e)||t.ts.isEnumDeclaration(e)||t.ts.isInterfaceDeclaration(e)||t.ts.isTypeLiteralNode(e)||t.ts.isClassExpression(e)||t.ts.isBlock(e)||t.ts.isModuleBlock(e)||t.ts.isObjectLiteralExpression(e))return r(e,t.SyntaxKind.OpenBraceToken);if(t.ts.isCaseClause(e)||t.ts.isDefaultClause(e))return r(e,t.SyntaxKind.ColonToken);return t.errors.throwNotImplementedForNeverValueError(e);function r(e,t){return e.getChildren(n).find(e=>e.kind===t)?.end}}};function*b(e,n){let r=n.text,i=s(),a=c();if(i.length===0){let t=y.getContainerBodyPos(e,n);t!=null&&(yield*o(t,!1))}else{for(let e of i)yield*o(e.pos,!0),yield e;let e=i[i.length-1];yield*o(e.end,!1)}function*o(e,n){let i=e;c();let o=Array.from(l()),s=r.length===e||r[e]===`}`?e:t.StringUtils.getLineStartFromPos(r,e);for(let e of o)e.end<=s&&(yield e);function c(){if(e===0)return;let n=t.StringUtils.getLineEndFromPos(r,e);for(;e<n;){let i=d();if(i!=null){if(u(i).kind===t.SyntaxKind.SingleLineCommentTrivia)return;n=t.StringUtils.getLineEndFromPos(r,e)}else if(!t.StringUtils.isWhitespace(r[e])&&r[e]!==`,`)return;else e++}for(;t.StringUtils.startsWithNewLine(r[e]);)e++}function*l(){for(;e<r.length;){let i=d();if(i!=null){if(i===g.JsDoc&&n)return;yield u(i),c()}else if(t.StringUtils.isWhitespace(r[e]))e++;else return}}function u(e){return e===g.SingleLine?f():m(e===g.JsDoc)}function d(){if(r[e]!==`/`)return;let t=r[e+1];if(t===`/`)return g.SingleLine;if(t===`*`)return r[e+2]===`*`?g.JsDoc:g.MultiLine}function f(){let n=e;return p(),a(i,n,e,t.SyntaxKind.SingleLineCommentTrivia)}function p(){for(e+=2;e<r.length&&r[e]!==`
31368
+ `||e===`\r`}isLastBlankLine(){let e=0;for(let t=this._texts.length-1;t>=0;t--){let n=this._texts[t];for(let t=n.length-1;t>=0;t--){let i=n.charCodeAt(t);if(i===r.NEW_LINE){if(e++,e===2)return!0}else if(i!==r.CARRIAGE_RETURN)return!1}}return!1}isLastSpace(){return this.getLastChar()===` `}isLastTab(){return this.getLastChar()===` `}getLastChar(){let e=this._getLastCharCodeWithOffset(0);return e==null?void 0:String.fromCharCode(e)}endsWith(e){let t=this._length;return this.iterateLastCharCodes((n,r)=>{let i=t-r,a=e.length-i;return e.charCodeAt(a)===n?a===0?!0:void 0:!1})||!1}iterateLastChars(e){return this.iterateLastCharCodes((t,n)=>e(String.fromCharCode(t),n))}iterateLastCharCodes(e){let t=this._length;for(let n=this._texts.length-1;n>=0;n--){let r=this._texts[n];for(let n=r.length-1;n>=0;n--){t--;let i=e(r.charCodeAt(n),t);if(i!=null)return i}}}toString(){if(this._texts.length>1){let e=this._texts.join(``);this._texts.length=0,this._texts.push(e)}return this._texts[0]||``}_writeIndentingNewLines(t){if(t||=``,t.length===0){n(this,``);return}t.split(e._newLineRegEx).forEach((e,t)=>{t>0&&this._baseWriteNewline(),e.length!==0&&n(this,e)});function n(e,t){e.isInString()||(e.isLastNewLine()||e.getLastChar()==null)&&e._writeIndentation(),e._updateInternalState(t),e._internalWrite(t)}}_baseWriteNewline(){this._currentCommentChar===n.Line&&(this._currentCommentChar=void 0);let e=this._stringCharStack[this._stringCharStack.length-1];(e===r.DOUBLE_QUOTE||e===r.SINGLE_QUOTE)&&this._getLastCharCodeWithOffset(0)!==r.BACK_SLASH&&this._stringCharStack.pop(),this._internalWrite(this._newLine),this._isOnFirstLineOfBlock=!1,this._dequeueQueuedIndentation()}_dequeueQueuedIndentation(){if(this._queuedIndentation==null)return;this._queuedOnlyIfNotBlock&&e(this)?(this._queuedIndentation=void 0,this._queuedOnlyIfNotBlock=void 0):(this._currentIndentation=this._queuedIndentation,this._queuedIndentation=void 0);function e(e){let t=!1;return e.iterateLastCharCodes(e=>{switch(e){case r.NEW_LINE:if(t)return!1;t=!0;break;case r.CARRIAGE_RETURN:return;case r.OPEN_BRACE:return!0;default:return!1}})}}_updateInternalState(e){for(let t=0;t<e.length;t++){let a=e.charCodeAt(t);if(!i.has(a))continue;let s=t===0?this._getLastCharCodeWithOffset(0):e.charCodeAt(t-1),c=t===0?this._getLastCharCodeWithOffset(1):t===1?this._getLastCharCodeWithOffset(0):e.charCodeAt(t-2);if(this._isInRegEx)if(s===r.FORWARD_SLASH&&c!==r.BACK_SLASH||s===r.NEW_LINE)this._isInRegEx=!1;else continue;else if(!this.isInString()&&!this.isInComment()&&o(a,s,c)){this._isInRegEx=!0;continue}if(this.isInString()||(this._currentCommentChar==null&&s===r.FORWARD_SLASH&&a===r.FORWARD_SLASH?this._currentCommentChar=n.Line:this._currentCommentChar==null&&s===r.FORWARD_SLASH&&a===r.ASTERISK?this._currentCommentChar=n.Star:this._currentCommentChar===n.Star&&s===r.ASTERISK&&a===r.FORWARD_SLASH&&(this._currentCommentChar=void 0)),this.isInComment())continue;let l=this._stringCharStack.length===0?void 0:this._stringCharStack[this._stringCharStack.length-1];s!==r.BACK_SLASH&&(a===r.DOUBLE_QUOTE||a===r.SINGLE_QUOTE||a===r.BACK_TICK)?l===a?this._stringCharStack.pop():(l===r.OPEN_BRACE||l===void 0)&&this._stringCharStack.push(a):c!==r.BACK_SLASH&&s===r.DOLLAR_SIGN&&a===r.OPEN_BRACE&&l===r.BACK_TICK?this._stringCharStack.push(a):a===r.CLOSE_BRACE&&l===r.OPEN_BRACE&&this._stringCharStack.pop()}}_getLastCharCodeWithOffset(e){if(!(e>=this._length||e<0))for(let t=this._texts.length-1;t>=0;t--){let n=this._texts[t];if(e>=n.length)e-=n.length;else return n.charCodeAt(n.length-1-e)}}_writeIndentation(){let e=Math.floor(this._currentIndentation);this._internalWrite(this._indentationText.repeat(e));let t=this._currentIndentation-e;if(this._useTabs)t>.5&&this._internalWrite(this._indentationText);else{let e=Math.round(this._indentationText.length*t),n=``;for(let t=0;t<e;t++)n+=this._indentationText[t];this._internalWrite(n)}}_newLineIfNewLineOnNextWrite(){this._newLineOnNextWrite&&(this._newLineOnNextWrite=!1,this.newLine())}_internalWrite(e){e.length!==0&&(this._texts.push(e),this._length+=e.length)}_getIndentationLevelFromArg(t){if(typeof t==`number`){if(t<0)throw Error(`Passed in indentation level should be greater than or equal to 0.`);return t}else if(typeof t==`string`){if(!e._spacesOrTabsRegEx.test(t))throw Error(`Provided string must be empty or only contain spaces or tabs.`);let{spacesCount:n,tabsCount:r}=c(t);return r+n/this._indentNumberOfSpaces}else throw Error(`Argument provided must be a string or number.`)}_setIndentationState(e){this._currentIndentation=e.current,this._queuedIndentation=e.queued,this._queuedOnlyIfNotBlock=e.queuedOnlyIfNotBlock}_getIndentationState(){return{current:this._currentIndentation,queued:this._queuedIndentation,queuedOnlyIfNotBlock:this._queuedOnlyIfNotBlock}}};Object.defineProperty(a,"_newLineRegEx",{enumerable:!0,configurable:!0,writable:!0,value:/\r?\n/}),Object.defineProperty(a,"_spacesOrTabsRegEx",{enumerable:!0,configurable:!0,writable:!0,value:/^[ \t]*$/}),e.default=a;function o(e,t,n){return t===r.FORWARD_SLASH&&e!==r.FORWARD_SLASH&&e!==r.ASTERISK&&n!==r.ASTERISK&&n!==r.FORWARD_SLASH}function s(e,t){return e?` `:Array(t+1).join(` `)}function c(e){let t=0,n=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);a===r.SPACE?t++:a===r.TAB&&n++}return{spacesCount:t,tabsCount:n}}})),$t=e.Ct((e=>{var t=Zt(),n=Qt();function r(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var i=r(n),a=class{#e;#t=[void 0,void 0,void 0];#n=0;#r=!1;#i=0;constructor(e){this.#e=e,this.#a()}get done(){return this.#r}get current(){if(this.#i===0)throw new t.errors.InvalidOperationError(`Cannot get the current when the iterator has not been advanced.`);return this.#t[this.#n]}get previous(){if(this.#i<=1)throw new t.errors.InvalidOperationError(`Cannot get the previous when the iterator has not advanced enough.`);return this.#t[(this.#n+this.#t.length-1)%this.#t.length]}get peek(){if(this.#r)throw new t.errors.InvalidOperationError(`Cannot peek at the end of the iterator.`);return this.#t[(this.#n+1)%this.#t.length]}next(){if(this.done)throw new t.errors.InvalidOperationError(`Cannot get the next when at the end of the iterator.`);let e=this.#t[this.#o()];return this.#a(),this.#i++,e}*rest(){for(;!this.done;)yield this.next()}#a(){let e=this.#e.next();if(this.#n=this.#o(),e.done){this.#r=!0;return}this.#t[this.#o()]=e.value}#o(){return(this.#n+1)%this.#t.length}},o={ASTERISK:42,NEWLINE:10,CARRIAGE_RETURN:13,SPACE:32,TAB:9,CLOSE_BRACE:125};function s(e,t){let n;return n=typeof t==`string`?e=>c(e,t):t,e.find(n)}function c(e,t){if(e.getNameNode==null)return!1;let n=e.getNameNode();return n==null?!1:V.isArrayBindingPattern(n)||V.isObjectBindingPattern(n)?n.getElements().some(e=>c(e,t)):(e.getName==null?n.getText():e.getName())===t}function l(e,t){return typeof t==`string`?`Expected to find ${e} named '${t}'.`:`Expected to find ${e} that matched the provided condition.`}e.CommentNodeKind=void 0,(function(e){e[e.Statement=0]=`Statement`,e[e.ClassElement=1]=`ClassElement`,e[e.TypeElement=2]=`TypeElement`,e[e.ObjectLiteralElement=3]=`ObjectLiteralElement`,e[e.EnumMember=4]=`EnumMember`})(e.CommentNodeKind||={});var u=class{#e;#t;#n;constructor(e,n,r,i,a,o){this.#e=e,this.#t=n,this.#n=a,this.pos=n,this.end=r,this.kind=i,this.flags=t.ts.NodeFlags.None,this.parent=o}pos;end;kind;flags;modifiers;parent;getSourceFile(){return this.#n}getChildCount(e){return 0}getChildAt(e,t){}getChildren(e){return[]}getStart(e,t){return this.#t}getFullStart(){return this.#e}getEnd(){return this.end}getWidth(e){return this.end-this.#t}getFullWidth(){return this.end-this.#e}getLeadingTriviaWidth(e){return this.#t-this.#e}getFullText(e){return this.#n.text.substring(this.#e,this.end)}getText(e){return this.#n.text.substring(this.#t,this.end)}getFirstToken(e){}getLastToken(e){}forEachChild(e,t){}},d=class extends u{_jsdocContainerBrand;_statementBrand;_commentKind=e.CommentNodeKind.Statement},f=class extends u{_classElementBrand;_declarationBrand;_commentKind=e.CommentNodeKind.ClassElement},p=class extends u{_typeElementBrand;_declarationBrand;_commentKind=e.CommentNodeKind.TypeElement},m=class extends u{_declarationBrand;_objectLiteralBrand;declarationBrand;_commentKind=e.CommentNodeKind.ObjectLiteralElement},h=class extends u{_commentKind=e.CommentNodeKind.EnumMember},g;(function(e){e[e.SingleLine=0]=`SingleLine`,e[e.MultiLine=1]=`MultiLine`,e[e.JsDoc=2]=`JsDoc`})(g||={});var _=new WeakMap,v=new Set([t.SyntaxKind.SourceFile,t.SyntaxKind.Block,t.SyntaxKind.ModuleBlock,t.SyntaxKind.CaseClause,t.SyntaxKind.DefaultClause,t.SyntaxKind.ClassDeclaration,t.SyntaxKind.InterfaceDeclaration,t.SyntaxKind.EnumDeclaration,t.SyntaxKind.ClassExpression,t.SyntaxKind.TypeLiteral,t.SyntaxKind.ObjectLiteralExpression]),y=class{constructor(){}static getOrParseChildren(e,t){x(e)&&(e=e.parent);let n=_.get(e);return n??(n=Array.from(b(e,t)),_.set(e,n)),n}static shouldParseChildren(e){return v.has(e.kind)&&e.pos!==e.end}static hasParsedChildren(e){return x(e)&&(e=e.parent),_.has(e)}static isCommentStatement(t){return t._commentKind===e.CommentNodeKind.Statement}static isCommentClassElement(t){return t._commentKind===e.CommentNodeKind.ClassElement}static isCommentTypeElement(t){return t._commentKind===e.CommentNodeKind.TypeElement}static isCommentObjectLiteralElement(t){return t._commentKind===e.CommentNodeKind.ObjectLiteralElement}static isCommentEnumMember(t){return t._commentKind===e.CommentNodeKind.EnumMember}static getContainerBodyPos(e,n){if(t.ts.isSourceFile(e))return 0;if(t.ts.isClassDeclaration(e)||t.ts.isEnumDeclaration(e)||t.ts.isInterfaceDeclaration(e)||t.ts.isTypeLiteralNode(e)||t.ts.isClassExpression(e)||t.ts.isBlock(e)||t.ts.isModuleBlock(e)||t.ts.isObjectLiteralExpression(e))return r(e,t.SyntaxKind.OpenBraceToken);if(t.ts.isCaseClause(e)||t.ts.isDefaultClause(e))return r(e,t.SyntaxKind.ColonToken);return t.errors.throwNotImplementedForNeverValueError(e);function r(e,t){return e.getChildren(n).find(e=>e.kind===t)?.end}}};function*b(e,n){let r=n.text,i=s(),a=c();if(i.length===0){let t=y.getContainerBodyPos(e,n);t!=null&&(yield*o(t,!1))}else{for(let e of i)yield*o(e.pos,!0),yield e;let e=i[i.length-1];yield*o(e.end,!1)}function*o(e,n){let i=e;c();let o=Array.from(l()),s=r.length===e||r[e]===`}`?e:t.StringUtils.getLineStartFromPos(r,e);for(let e of o)e.end<=s&&(yield e);function c(){if(e===0)return;let n=t.StringUtils.getLineEndFromPos(r,e);for(;e<n;){let i=d();if(i!=null){if(u(i).kind===t.SyntaxKind.SingleLineCommentTrivia)return;n=t.StringUtils.getLineEndFromPos(r,e)}else if(!t.StringUtils.isWhitespace(r[e])&&r[e]!==`,`)return;else e++}for(;t.StringUtils.startsWithNewLine(r[e]);)e++}function*l(){for(;e<r.length;){let i=d();if(i!=null){if(i===g.JsDoc&&n)return;yield u(i),c()}else if(t.StringUtils.isWhitespace(r[e]))e++;else return}}function u(e){return e===g.SingleLine?f():m(e===g.JsDoc)}function d(){if(r[e]!==`/`)return;let t=r[e+1];if(t===`/`)return g.SingleLine;if(t===`*`)return r[e+2]===`*`?g.JsDoc:g.MultiLine}function f(){let n=e;return p(),a(i,n,e,t.SyntaxKind.SingleLineCommentTrivia)}function p(){for(e+=2;e<r.length&&r[e]!==`
31369
31369
  `&&r[e]!==`\r`;)e++}function m(n){let r=e;return h(n),a(i,r,e,t.SyntaxKind.MultiLineCommentTrivia)}function h(t){for(e+=t?3:2;e<r.length;){if(r[e]===`*`&&r[e+1]===`/`){e+=2;break}e++}}}function s(){return t.ts.isSourceFile(e)||t.ts.isBlock(e)||t.ts.isModuleBlock(e)||t.ts.isCaseClause(e)||t.ts.isDefaultClause(e)?e.statements:t.ts.isClassDeclaration(e)||t.ts.isClassExpression(e)||t.ts.isEnumDeclaration(e)||t.ts.isInterfaceDeclaration(e)||t.ts.isTypeLiteralNode(e)||t.ts.isClassExpression(e)?e.members:t.ts.isObjectLiteralExpression(e)?e.properties:t.errors.throwNotImplementedForNeverValueError(e)}function c(){let r=i();return(t,i,a,o)=>new r(t,i,a,o,n,e);function i(){if(S(e))return d;if(t.ts.isClassLike(e))return f;if(t.ts.isInterfaceDeclaration(e)||t.ts.isTypeLiteralNode(e))return p;if(t.ts.isObjectLiteralExpression(e))return m;if(t.ts.isEnumDeclaration(e))return h;throw new t.errors.NotImplementedError(`Not implemented comment node container type: ${t.getSyntaxKindName(e.kind)}`)}}}function x(e){return e.kind===t.SyntaxKind.SyntaxList}function S(e){return n()!=null;function n(){let n=e;if(t.ts.isSourceFile(n)||t.ts.isBlock(n)||t.ts.isModuleBlock(n)||t.ts.isCaseClause(n)||t.ts.isDefaultClause(n))return n}}var C=new WeakMap,w=new WeakMap,T=class e{static getContainerArray(e,t){return y.getOrParseChildren(e,t)}static hasParsedTokens(e){return w.has(e)||e.kind==t.SyntaxKind.SyntaxList}static getCompilerChildrenFast(t,n){return e.hasParsedTokens(t)?e.getCompilerChildren(t,n):e.getCompilerForEachChildren(t,n)}static getCompilerForEachChildren(e,t){if(y.shouldParseChildren(e)){let r=C.get(e);return r??(r=n(),E(r,y.getOrParseChildren(e,t)),C.set(e,r)),r}return n();function n(){let t=[];return e.forEachChild(e=>{t.push(e)}),t}}static getCompilerChildren(e,n){let r=w.get(e);if(r==null){if(i()){let t=[...e.getChildren(n)];E(t,y.getOrParseChildren(e,n)),r=t}else r=e.getChildren(n);w.set(e,r)}return r;function i(){if(e.kind!==t.ts.SyntaxKind.SyntaxList)return!1;let r=e.parent;return y.shouldParseChildren(r)?y.getContainerBodyPos(r,n)===e.pos:!1}}};function E(e,n){let r=0;for(let i of n)if(!(i.kind!==t.SyntaxKind.SingleLineCommentTrivia&&i.kind!==t.SyntaxKind.MultiLineCommentTrivia)){for(;r<e.length&&e[r].end<i.end;)r++;e.splice(r,0,i),r++}}function D(e){return e.kind===t.ts.SyntaxKind.SingleLineCommentTrivia||e.kind===t.ts.SyntaxKind.MultiLineCommentTrivia}function O(e,n){if(e.kind===t.SyntaxKind.EndOfFileToken)return;let r=e.parent;if(r==null)return;let{pos:i,end:a}=e;for(let o of T.getCompilerChildren(r,n)){if(o.pos>a||o===e)return;if(o.kind===t.SyntaxKind.SyntaxList&&o.pos<=i&&o.end>=a)return o}}function ee(e,t){let n;return n=typeof t==`string`?e=>e.getName()===t:t,e.find(n)}function k(e){if(te(e)||e._sourceFile.isDeclarationFile())return!0;for(let t of e._getAncestorsIterator(!1))if(te(t))return!0;return!1}function te(e){return(e.getCombinedModifierFlags()&t.ts.ModifierFlags.Ambient)===t.ts.ModifierFlags.Ambient||V.isInterfaceDeclaration(e)||V.isTypeAliasDeclaration(e)}function ne(e){switch(e){case t.SyntaxKind.StringLiteral:case t.SyntaxKind.NoSubstitutionTemplateLiteral:case t.SyntaxKind.TemplateHead:case t.SyntaxKind.TemplateMiddle:case t.SyntaxKind.TemplateTail:return!0;default:return!1}}var re=class{constructor(){}static isModuleSpecifierRelative(e){return e.startsWith(`./`)||e.startsWith(`../`)}static getReferencedSourceFileFromSymbol(e){let n=e.getDeclarations();if(!(n.length===0||n[0].getKind()!==t.SyntaxKind.SourceFile))return n[0]}};function A(e,n,r){let i=n==null||n.kind!==t.SyntaxKind.SourceFile,a=u(),o=c(),s=t.ts.createPrinter({newLine:a.newLineKind??t.NewLineKind.LineFeed,removeComments:a.removeComments||!1});if(o==null)return s.printFile(e);return s.printNode(a.emitHint??t.EmitHint.Unspecified,e,o);function c(){if(i){if(e.kind===t.SyntaxKind.SourceFile)return;let n=l();if(n==null){let e=r();return t.ts.createSourceFile(`print.${o(e)}`,``,t.ScriptTarget.Latest,!1,e)}return n}return n;function r(){return a.scriptKind??t.ScriptKind.TSX}function o(e){return e===t.ScriptKind.JSX||e===t.ScriptKind.TSX?`tsx`:`ts`}}function l(){let t=e.parent;for(;t!=null&&t.parent!=null;)t=t.parent;return t}function u(){return(i?n:r)||{}}}e.IndentationText=void 0,(function(e){e.TwoSpaces=` `,e.FourSpaces=` `,e.EightSpaces=` `,e.Tab=` `})(e.IndentationText||={});var j=class extends t.SettingsContainer{#e;#t;#n;constructor(){super({indentationText:e.IndentationText.FourSpaces,newLineKind:t.NewLineKind.LineFeed,quoteKind:e.QuoteKind.Double,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,usePrefixAndSuffixTextForRename:!1,useTrailingCommas:!1})}getEditorSettings(){return this.#e??(this.#e={},N(this.#e,this)),{...this.#e}}getFormatCodeSettings(){return this.#t??={...this.getEditorSettings(),insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:this._settings.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces},{...this.#t}}getUserPreferences(){return this.#n??={quotePreference:this.getQuoteKind()===e.QuoteKind.Double?`double`:`single`,providePrefixAndSuffixTextForRename:this.getUsePrefixAndSuffixTextForRename()},{...this.#n}}getQuoteKind(){return this._settings.quoteKind}getNewLineKind(){return this._settings.newLineKind}getNewLineKindAsString(){return ue(this.getNewLineKind())}getIndentationText(){return this._settings.indentationText}getUsePrefixAndSuffixTextForRename(){return this._settings.usePrefixAndSuffixTextForRename}getUseTrailingCommas(){return this._settings.useTrailingCommas}set(e){super.set(e),this.#e=void 0,this.#t=void 0,this.#n=void 0}_getIndentSizeInSpaces(){let n=this.getIndentationText();switch(n){case e.IndentationText.EightSpaces:return 8;case e.IndentationText.FourSpaces:return 4;case e.IndentationText.TwoSpaces:return 2;case e.IndentationText.Tab:return 4;default:return t.errors.throwNotImplementedForNeverValueError(n)}}};function M(e,t,n){e[t]===void 0&&(e[t]=n)}function N(n,r){M(n,`convertTabsToSpaces`,r.getIndentationText()!==e.IndentationText.Tab),M(n,`newLineCharacter`,r.getNewLineKindAsString()),M(n,`indentStyle`,t.ts.IndentStyle.Smart),M(n,`indentSize`,r.getIndentationText().length),M(n,`tabSize`,r.getIndentationText().length)}function P(e,t){N(e,t),M(e,`insertSpaceAfterCommaDelimiter`,!0),M(e,`insertSpaceAfterConstructor`,!1),M(e,`insertSpaceAfterSemicolonInForStatements`,!0),M(e,`insertSpaceAfterKeywordsInControlFlowStatements`,!0),M(e,`insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces`,!0),M(e,`insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets`,!1),M(e,`insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces`,!1),M(e,`insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces`,!1),M(e,`insertSpaceBeforeFunctionParenthesis`,!1),M(e,`insertSpaceBeforeAndAfterBinaryOperators`,!0),M(e,`placeOpenBraceOnNewLineForFunctions`,!1),M(e,`placeOpenBraceOnNewLineForControlBlocks`,!1),M(e,`ensureNewLineAtEndOfFile`,!0)}function F(e,t){return ie(e,t),e.toString()}function ie(e,t){if(typeof t==`string`)e.write(t);else if(t instanceof Function)t(e);else for(let n=0;n<t.length;n++)n>0&&e.newLineIfLastNot(),ie(e,t[n])}var ae=class{#e=!1;setEnabled(e){this.#e=e}log(e){this.#e&&this.logInternal(e)}warn(e){this.#e&&this.warnInternal(e)}},oe=class extends ae{logInternal(e){console.log(e)}warnInternal(e){console.warn(e)}},se=/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/,ce=new Set(`do.if.in.for.let.new.try.var.case.else.enum.eval.false.null.this.true.void.with.break.catch.class.const.super.throw.while.yield.delete.export.import.public.return.static.switch.typeof.default.extends.finally.package.private.continue.debugger.function.arguments.interface.protected.implements.instanceof`.split(`.`));function le(e){return ce.has(e)?!1:I(e)?!0:se.test(e)}function I(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=48&&n<=57)&&!(n>=65&&n<=90)&&!(n>=97&&n<=122))return!1}return!0}function ue(e){switch(e){case t.NewLineKind.CarriageReturnLineFeed:return`\r
31370
31370
  `;case t.NewLineKind.LineFeed:return`
31371
31371
  `;default:throw new t.errors.NotImplementedError(`Not implemented newline kind: ${e}`)}}var de=class{#e=new Set;constructor(e){let t=e=>{e.wasForgotten()||this.#e.add(e)};e.onSourceFileAdded(e=>{this.#e.add(e),e.onModified(t)}),e.onSourceFileRemoved(e=>{e._referenceContainer.clear(),this.#e.delete(e),e.onModified(t,!1)})}refreshDirtySourceFiles(){for(let e of this.#e.values())e._referenceContainer.refresh();this.clearDirtySourceFiles()}refreshSourceFileIfDirty(e){this.#e.has(e)&&(e._referenceContainer.refresh(),this.clearDirtyForSourceFile(e))}addDirtySourceFile(e){this.#e.add(e)}clearDirtySourceFiles(){this.#e.clear()}clearDirtyForSourceFile(e){this.#e.delete(e)}},fe=class{#e;#t=new t.KeyValueCache;#n=new t.KeyValueCache;#r=[];constructor(e){this.#e=e}getDependentSourceFiles(){this.#e._context.lazyReferenceCoordinator.refreshDirtySourceFiles();let e=new Set;for(let t of this.#n.getKeys())e.add(t._sourceFile);return e.values()}getLiteralsReferencingOtherSourceFilesEntries(){return this.#e._context.lazyReferenceCoordinator.refreshSourceFileIfDirty(this.#e),this.#t.getEntries()}getReferencingLiteralsInOtherSourceFiles(){return this.#e._context.lazyReferenceCoordinator.refreshDirtySourceFiles(),this.#n.getKeys()}refresh(){this.#r.length>0&&this.#e._context.compilerFactory.onSourceFileAdded(this.#i,!1),this.clear(),this.#a(),this.#r.length>0&&this.#e._context.compilerFactory.onSourceFileAdded(this.#i)}clear(){this.#r.length=0;for(let[e,t]of this.#t.getEntries())this.#t.removeByKey(e),t._referenceContainer.#n.removeByKey(e)}#i=()=>{for(let e=this.#r.length-1;e>=0;e--){let t=this.#r[e],n=this.#o(t);n!=null&&(this.#r.splice(e,1),this.#s(t,n))}this.#r.length===0&&this.#e._context.compilerFactory.onSourceFileAdded(this.#i,!1)};#a(){this.#e._context.compilerFactory.forgetNodesCreatedInBlock(e=>{for(let t of this.#e.getImportStringLiterals()){let n=this.#o(t);e(t),n==null?this.#r.push(t):this.#s(t,n)}})}#o(e){let t=e.getParentOrThrow(),n=t.getParent();if(V.isImportDeclaration(t)||V.isExportDeclaration(t))return t.getModuleSpecifierSourceFile();if(n!=null&&V.isImportEqualsDeclaration(n))return n.getExternalModuleReferenceSourceFile();if(n!=null&&V.isImportTypeNode(n)){let e=n.getSymbol();if(e!=null)return re.getReferencedSourceFileFromSymbol(e)}else if(V.isCallExpression(t)){let t=e.getSymbol();if(t!=null)return re.getReferencedSourceFileFromSymbol(t)}else this.#e._context.logger.warn(`Unknown import string literal parent: ${t.getKindName()}`)}#s(e,t){this.#t.set(e,t),t._referenceContainer.#n.set(e,t)}};function pe(e,n={}){let r=t.getCompilerOptionsFromTsConfig(e,n);return{options:r.options,errors:r.errors.map(e=>new Np(void 0,e))}}t.ts.version.split(`.`).map(e=>parseInt(e,10));var me=class{constructor(){}static getLastCharactersToPos(e,t){let n=e.getLength()-t,r=Array(n);return e.iterateLastChars((e,n)=>{let i=n-t;if(i<0)return!0;r[i]=e}),r.join(``)}};function he(e,t,n){let r;return r=e.getStructure==null?{}:e.getStructure.call(t),n!=null&&Object.assign(r,n),r}function ge(e,t,n){e.set!=null&&e.set.call(t,n)}function _e(e){return class extends e{hasDeclareKeyword(){return this.getDeclareKeyword()!=null}getDeclareKeywordOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDeclareKeyword(),e??`Expected to find a declare keyword.`,this)}getDeclareKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.DeclareKeyword)}isAmbient(){return k(this)}setHasDeclareKeyword(e){return this.toggleModifier(`declare`,e),this}set(t){return ge(e.prototype,this,t),t.hasDeclareKeyword!=null&&this.setHasDeclareKeyword(t.hasDeclareKeyword),this}getStructure(){return he(e.prototype,this,{hasDeclareKeyword:this.hasDeclareKeyword()})}}}var ve;(function(e){e[e.Newline=0]=`Newline`,e[e.Blankline=1]=`Blankline`,e[e.Space=2]=`Space`,e[e.None=3]=`None`})(ve||={});function ye(e,t){return V.isAmbientable(e)&&e.isAmbient()?ve.Newline:be(t)?ve.Blankline:ve.Newline}function be(e){return!!(V.isBodyable(e)&&e.getBody()!=null||V.isBodied(e))}function xe(e,n){switch(e){case ve.Space:return` `;case ve.Newline:return n.newLineKind;case ve.Blankline:return n.newLineKind+n.newLineKind;case ve.None:return``;default:throw new t.errors.NotImplementedError(`Not implemented formatting kind: ${e}`)}}function Se(e,t){return ve.Newline}function Ce(e){return V.isBodyable(e)&&e.hasBody()||V.isBodied(e)?!0:V.isInterfaceDeclaration(e)||V.isClassDeclaration(e)||V.isEnumDeclaration(e)}function we(e,t){return Ce(t)?ve.Blankline:ve.Newline}function Te(e,t){return ve.Newline}function Ee(e,t){return V.isClassDeclaration(e)?ye(e,t):V.isInterfaceDeclaration(e)?Se():we(e,t)}function L(e,t){let n=e.getFullText(),r=[],i=0;for(let{edit:e}of a()){let t=e.getSpan(),a=n.slice(i,t.getStart());i=t.getEnd(),r.push(a),r.push(e.getNewText())}return r.push(n.slice(i)),r.join(``);function a(){return t.map((e,t)=>({edit:o(e),index:t})).sort((e,t)=>{let n=e.edit.getSpan().getStart()-t.edit.getSpan().getStart();return n===0?e.index<t.index?-1:1:n<0?-1:1})}function o(e){return e instanceof Tp?e:new Tp(e)}}function De(e){let{structures:t,newCodes:n,parent:r,getSeparator:i,previousFormattingKind:a,nextFormattingKind:o}=e,s=e.indentationText??r.getChildIndentationText(),c=r._context.manipulationSettings.getNewLineKindAsString();return u(a)+l()+u(o);function l(){let e=n[0];for(let r=1;r<n.length;r++){let a=i(t[r-1],t[r]);e+=u(a),e+=n[r]}return e}function u(e){let t=xe(e,{newLineKind:c});return(e===ve.Newline||e===ve.Blankline)&&(t+=s),t}}var Oe=t.ts.createScanner(t.ts.ScriptTarget.Latest,!0);function ke(e){let t=Ae(e);return t===-1?e:e.substring(0,t)+`,`+e.substring(t)}function Ae(e){Oe.setText(e);try{if(Oe.scan()===t.ts.SyntaxKind.EndOfFileToken)return-1;for(;Oe.scan()!==t.ts.SyntaxKind.EndOfFileToken;);let n=Oe.getStartPos();return e[n-1]===`,`?-1:n}finally{Oe.setText(void 0)}}function je(e){return e?.length??0}function Me(e,t,n){for(;t<e.length&&!n(e.charCodeAt(t));)t++;return t}function Ne(e,t,n){for(;t>0&&!n(e.charCodeAt(t-1));)t--;return t}function Pe(e,t){return Me(e,t,Ie)}function Fe(e,t){return Ne(e,t,Ie)}function Ie(e){return!t.StringUtils.isWhitespaceCharCode(e)}function Le(e,t){for(;t>0;)if(t--,e[t]===`
@@ -31392,8 +31392,8 @@ Stack: `+n.stack;r.length>0&&o(`Manipulation error: A syntax error was inserted.
31392
31392
  `)&&(o=o.replace(/\r?\n$/,``))),At({insertPos:Be(e,this,this.getChildren()),newText:o,parent:this}),Xe(n,this.getChildren(),e,!0))}};function bn(e,n,r){if(t.errors.throwIfWhitespaceOrNotString(n,`newName`),e.getText()===n)return;let i=e._context.languageService.findRenameLocations(e,r),a=new t.KeyValueCache;for(let e of i)a.getOrCreate(e.getSourceFile(),()=>[]).push(e);for(let[e,t]of a.getEntries())tn({sourceFile:e,renameLocations:t,newName:n})}function xn(e,n){let r=un(e._getWriterWithIndentation(),n),i=e.getFirstChildByKindOrThrow(t.SyntaxKind.OpenBraceToken),a=e.getFirstChildByKindOrThrow(t.SyntaxKind.CloseBraceToken);At({insertPos:i.getEnd(),newText:r,parent:e,replacing:{textLength:a.getStart()-i.getEnd()}})}function Sn(e){return class extends e{getBody(){let e=this.compilerNode.body;if(e==null)throw new t.errors.InvalidOperationError(`Bodied node should have a body.`);return this._getNodeFromCompilerNode(e)}setBodyText(e){return xn(this.getBody(),e),this}getBodyText(){return dn(this.getBody())}}}function Cn(e){return class extends e{getBodyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getBody(),e??`Expected to find the node's body.`,this)}getBody(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.body)}getBodyText(){let e=this.getBody();return e==null?void 0:dn(e)}setBodyText(e){return this.addBody(),xn(this.getBodyOrThrow(),e),this}hasBody(){return this.compilerNode.body!=null}addBody(){if(this.hasBody())return this;let e=this.getLastChildByKind(t.SyntaxKind.SemicolonToken);return At({parent:this,insertPos:e==null?this.getEnd():e.getStart(),newText:this._getWriterWithQueuedIndentation().space().block().toString(),replacing:{textLength:e?.getFullWidth()??0}}),this}removeBody(){let e=this.getBody();return e==null||At({parent:this,insertPos:e.getPos(),newText:`;`,replacing:{textLength:e.getFullWidth()}}),this}}}function wn(e){return class extends e{setOrder(e){let n=this.getChildIndex(),r=this.getParentSyntaxList()||this.getParentSyntaxListOrThrow();return t.errors.throwIfOutOfRange(e,[0,r.getChildCount()-1],`order`),n===e||It({parent:r,getSiblingFormatting:Ee,oldIndex:n,newIndex:e}),this}}}function Tn(e){return class extends e{getDecorator(e){return s(this.getDecorators(),e)}getDecoratorOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getDecorator(e),n??(()=>l(`decorator`,e)),this)}getDecorators(){return En(this.compilerNode).map(e=>this._getNodeFromCompilerNode(e))}addDecorator(e){return this.insertDecorator(je(En(this.compilerNode)),e)}addDecorators(e){return this.insertDecorators(je(En(this.compilerNode)),e)}insertDecorator(e,t){return this.insertDecorators(e,[t])[0]}insertDecorators(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=Dn(this,n),i=this.getDecorators();e=tt(e,i.length);let a=On(this,i),o=i[e-1],s=De({structures:n,newCodes:r,parent:this,indentationText:this.getIndentationText(),getSeparator:()=>a,previousFormattingKind:o==null?ve.None:a,nextFormattingKind:o==null?a:ve.None});return At({parent:i[0]?.getParentSyntaxListOrThrow()??this.getModifiers()[0]?.getParentSyntaxListOrThrow()??this,insertPos:e===0?(i[0]??this).getStart():i[e-1].getEnd(),newText:s}),Xe(i,this.getDecorators(),e,!1)}set(t){return ge(e.prototype,this,t),t.decorators!=null&&(this.getDecorators().forEach(e=>e.remove()),this.addDecorators(t.decorators)),this}getStructure(){return he(e.prototype,this,{decorators:this.getDecorators().map(e=>e.getStructure())})}}}function En(e){return t.ts.canHaveDecorators(e)?t.ts.getDecorators(e)??[]:[]}function Dn(e,t){let n=[];for(let r of t){let t=e._getWriter();e._context.structurePrinterFactory.forDecorator().printText(t,r),n.push(t.toString())}return n}function On(e,t){return H(e,t)?ve.Space:ve.Newline}function H(e,n){if(n.length===1){let e=n[0].getPreviousSibling();if(e!=null&&e.getStartLinePos()===n[0].getStartLinePos())return!0}if(n.length<=1)return e.getKind()===t.SyntaxKind.Parameter;let r=n[0].getStartLinePos();for(let e=1;e<n.length;e++)if(n[e].getStartLinePos()!==r)return!1;return!0}function kn(e){return class extends e{getDotDotDotTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDotDotDotToken(),e??`Expected to find a dot dot dot token (...).`,this)}getDotDotDotToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.dotDotDotToken)}}}function An(e){return class extends e{hasExclamationToken(){return this.compilerNode.exclamationToken!=null}getExclamationTokenNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.exclamationToken)}getExclamationTokenNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getExclamationTokenNode(),e??`Expected to find an exclamation token.`,this)}setHasExclamationToken(e){let n=this.getExclamationTokenNode();if(e===(n!=null))return this;if(e){V.isQuestionTokenable(this)&&this.setHasQuestionToken(!1);let e=this.getFirstChildByKind(t.SyntaxKind.ColonToken);if(e==null)throw new t.errors.InvalidOperationError(`Cannot add an exclamation token to a node that does not have a type.`);At({insertPos:e.getStart(),parent:this,newText:`!`})}else Lt({children:[n]});return this}set(t){return ge(e.prototype,this,t),t.hasExclamationToken!=null&&this.setHasExclamationToken(t.hasExclamationToken),this}getStructure(){return he(e.prototype,this,{hasExclamationToken:this.hasExclamationToken()})}}}function jn(e){return class extends e{hasExportKeyword(){return this.getExportKeyword()!=null}getExportKeyword(){return V.isVariableDeclaration(this)?this.getVariableStatement()?.getExportKeyword():V.isModifierable(this)?this.getFirstModifierByKind(t.SyntaxKind.ExportKeyword):Mn()}getExportKeywordOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getExportKeyword(),e??`Expected to find an export keyword.`,this)}hasDefaultKeyword(){return this.getDefaultKeyword()!=null}getDefaultKeyword(){return V.isVariableDeclaration(this)?this.getVariableStatement()?.getDefaultKeyword():V.isModifierable(this)?this.getFirstModifierByKind(t.SyntaxKind.DefaultKeyword):Mn()}getDefaultKeywordOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefaultKeyword(),e??`Expected to find a default keyword.`,this)}isExported(){if(this.hasExportKeyword())return!0;let e=this.getSymbol(),t=this.getSourceFile().getSymbol();return e==null||t==null?!1:t.getExports().some(t=>t===e||t.getAliasedSymbol()===e)}isDefaultExport(){if(this.hasDefaultKeyword())return!0;let e=this.getSymbol();if(e==null)return!1;let t=this.getSourceFile().getDefaultExportSymbol();return t==null?!1:e===t?!0:e===t.getAliasedSymbol()}isNamedExport(){let e=this.getSymbol(),t=this.getSourceFile().getSymbol();if(e==null||t==null)return!1;return!n()&&t.getExports().some(t=>t===e||t.getAliasedSymbol()===e);function n(){let n=t.getExport(`default`);return n==null?!1:e===n||e===n.getAliasedSymbol()}}}}function Mn(){throw new t.errors.NotImplementedError(`Not implemented situation where node was not a ModifierableNode.`)}function Nn(e){return Pn(jn(e))}function Pn(e){return class extends e{setIsDefaultExport(e){if(e===this.isDefaultExport())return this;if(e&&!V.isSourceFile(this.getParentOrThrow()))throw new t.errors.InvalidOperationError(`The parent must be a source file in order to set this node as a default export.`);let n=this.getSourceFile(),r=n.getDefaultExportSymbol();if(r!=null&&n.removeDefaultExport(r),!e)return this;if(V.hasName(this)&&i.call(this)){let e=this.getFirstAncestorByKindOrThrow(t.SyntaxKind.SyntaxList),n=this.getName();e.insertChildText(this.getChildIndex()+1,e=>{e.newLine().write(`export default ${n};`)})}else this.addModifier(`export`),this.addModifier(`default`);return this;function i(){return!!(V.isEnumDeclaration(this)||V.isModuleDeclaration(this)||V.isTypeAliasDeclaration(this)||V.isAmbientable(this)&&this.isAmbient())}}setIsExported(e){return V.isSourceFile(this.getParentOrThrow())&&this.toggleModifier(`default`,!1),this.toggleModifier(`export`,e),this}set(t){return ge(e.prototype,this,t),t.isExported!=null&&this.setIsExported(t.isExported),t.isDefaultExport!=null&&this.setIsDefaultExport(t.isDefaultExport),this}getStructure(){return he(e.prototype,this,{isExported:this.hasExportKeyword(),isDefaultExport:this.hasDefaultKeyword()})}}}var Fn=class{printTextOrWriterFunc(e,t){typeof t==`string`?e.write(t):t?.(e)}getNewWriter(e){return new i.default(e.getOptions())}getNewWriterWithQueuedChildIndentation(e){let t=new i.default(e.getOptions());return t.queueIndentationLevel(1),t}getText(e,t){let n=this.getNewWriter(e);return this.printTextOrWriterFunc(n,t),n.toString()}getTextWithQueuedChildIndentation(e,t){let n=this.getNewWriterWithQueuedChildIndentation(e);return this.printTextOrWriterFunc(n,t),n.toString()}},In=class extends Fn{printText(e,n){let{initializer:r}=n;if(r==null)return;let i=this.getText(e,r);t.StringUtils.isNullOrWhitespace(i)||e.hangingIndent(()=>{e.spaceIfLastNot(),e.write(`= ${i}`)})}},Ln=class extends Fn{printText(e,t){let n=t.scope;t.isDefaultExport?e.write(`export default `):t.isExported&&e.write(`export `),t.hasDeclareKeyword&&e.write(`declare `),n!=null&&e.write(`${n} `),t.isStatic&&e.write(`static `),t.hasOverrideKeyword&&e.write(`override `),t.isAbstract&&e.write(`abstract `),t.isAsync&&e.write(`async `),t.isReadonly&&e.write(`readonly `),t.hasAccessorKeyword&&e.write(`accessor `)}},Rn=class extends Fn{#e;constructor(e=!1){super(),this.#e=e}printText(e,n){let{returnType:r}=n;if(r==null&&this.#e===!1)return;r??=`void`;let i=this.getText(e,r);t.StringUtils.isNullOrWhitespace(i)||e.hangingIndent(()=>{e.write(`: ${i}`)})}},zn=class extends Fn{#e;#t;constructor(e,t=!1){super(),this.#t=t,this.#e=e}printText(e,n){let{type:r}=n;if(r==null&&this.#t===!1)return;r??=`any`;let i=this.getText(e,r);t.StringUtils.isNullOrWhitespace(i)||e.hangingIndent(()=>{e.write(`${this.#e} ${i}`)})}},Bn=class extends Fn{#e;constructor(e){super(),this.#e=e}printText(e,t){if(t!=null)for(let n=0;n<t.length;n++)e.conditionalBlankLine(n>0),this.#e.printText(e,t[n])}},Vn=class extends Fn{#e;constructor(e){super(),this.#e=e}printText(e,t){Hn(this.#e,e,t,()=>e.spaceIfLastNot())}};function Hn(e,t,n,r){if(n!=null)if(n instanceof Function||typeof n==`string`)e.printText(t,n);else{let i=Array(n.length);for(let a=0;a<n.length;a++){a>0&&r();let o=n[a],s=t.getLength();e.printText(t,o);let c=Ae(me.getLastCharactersToPos(t,s));i[a]=c===-1?!1:c+s}let a=!1;for(let e=i.length-1;e>=0;e--){let n=i[e];n!==!1&&(a?t.unsafeInsert(n,`,`):a=!0)}}}var Un=class extends Fn{#e;constructor(e){super(),this.#e=e}printText(e,t){Hn(this.#e,e,t,()=>e.newLineIfLastNot())}},Wn=class extends Fn{#e;constructor(e){super(),this.#e=e}printText(e,t){if(t!=null)for(let n=0;n<t.length;n++)e.conditionalNewLine(n>0),this.#e.printText(e,t[n])}},Gn=class extends Fn{#e;constructor(e){super(),this.#e=e}printText(e,t){if(t!=null)for(let n=0;n<t.length;n++)e.conditionalWrite(n>0,` `),this.#e.printText(e,t[n])}},Kn=class extends Fn{factory;constructor(e){super(),this.factory=e}printTextWithoutTrivia(e,t){this.printTextInternal(e,t)}printText(e,t){this.printLeadingTrivia(e,t),e.closeComment(),this.printTextInternal(e,t),this.printTrailingTrivia(e,t)}printLeadingTrivia(e,t){let n=t?.leadingTrivia;n&&(this.#e(e,n),e.isInComment()&&e.closeComment())}printTrailingTrivia(e,t){let n=t?.trailingTrivia;n!=null&&this.#e(e,n)}#e(e,t){if(t instanceof Array)for(let n=0;n<t.length;n++)this.printTextOrWriterFunc(e,t[n]),n!==t.length-1&&e.newLineIfLastNot();else this.printTextOrWriterFunc(e,t)}},qn=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}printGetAndSet(e,t,n,r){t=[...t??[]],n=[...n??[]];for(let i of t){this.#n(e,r),this.#e.printText(e,i);let t=n.findIndex(e=>e.name===i.name);t>=0&&(this.#n(e,r),this.#t.printText(e,n[t]),n.splice(t,1))}for(let t of n)this.#n(e,r),this.#t.printText(e,t)}#n(e,t){e.isAtStartOfFirstLineOfBlock()||(t?e.newLine():e.blankLine())}},Jn=class extends Kn{#e;#t=new Bn(this);constructor(e,t){super(e),this.#e=t}printTexts(e,t){this.#t.printText(e,t)}printTextInternal(e,n){let r=n.hasDeclareKeyword||this.#e.isAmbient;this.factory.forJSDoc().printDocs(e,n.docs),this.factory.forDecorator().printTexts(e,n.decorators),this.#n(e,n),e.inlineBlock(()=>{this.factory.forPropertyDeclaration().printTexts(e,n.properties),this.#i(e,n),this.#r(e,n,r),this.#a(e,n,r),t.ArrayUtils.isNullOrEmpty(n.methods)||(this.#o(e,r),this.factory.forMethodDeclaration({isAmbient:r}).printTexts(e,n.methods))})}#n(e,n){this.factory.forModifierableNode().printText(e,n),e.write(`class`),t.StringUtils.isNullOrWhitespace(n.name)||e.space().write(n.name),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,n.typeParameters),e.space(),e.hangingIndent(()=>{if(n.extends!=null){let r=this.getText(e,n.extends);t.StringUtils.isNullOrWhitespace(r)||e.write(`extends ${r} `)}if(n.implements!=null){let r=n.implements instanceof Array?n.implements.map(t=>this.getText(e,t)).join(`, `):this.getText(e,n.implements);t.StringUtils.isNullOrWhitespace(r)||e.write(`implements ${r} `)}})}#r(e,n,r){if(!t.ArrayUtils.isNullOrEmpty(n.ctors))for(let t of n.ctors)this.#o(e,r),this.factory.forConstructorDeclaration({isAmbient:r}).printText(e,t)}#i(e,n){if(!t.ArrayUtils.isNullOrEmpty(n.staticBlocks))for(let t of n.staticBlocks)this.#o(e,!1),this.factory.forClassStaticBlockDeclaration().printText(e,t)}#a(e,t,n){t.getAccessors==null&&t.setAccessors==null||new qn(this.factory.forGetAccessorDeclaration({isAmbient:n}),this.factory.forSetAccessorDeclaration({isAmbient:n})).printGetAndSet(e,t.getAccessors,t.setAccessors,n)}#o(e,t){e.isAtStartOfFirstLineOfBlock()||(t?e.newLine():e.blankLine())}};e.StructureKind=void 0,(function(e){e[e.ImportAttribute=0]=`ImportAttribute`,e[e.CallSignature=1]=`CallSignature`,e[e.Class=2]=`Class`,e[e.ClassStaticBlock=3]=`ClassStaticBlock`,e[e.ConstructSignature=4]=`ConstructSignature`,e[e.Constructor=5]=`Constructor`,e[e.ConstructorOverload=6]=`ConstructorOverload`,e[e.Decorator=7]=`Decorator`,e[e.Enum=8]=`Enum`,e[e.EnumMember=9]=`EnumMember`,e[e.ExportAssignment=10]=`ExportAssignment`,e[e.ExportDeclaration=11]=`ExportDeclaration`,e[e.ExportSpecifier=12]=`ExportSpecifier`,e[e.Function=13]=`Function`,e[e.FunctionOverload=14]=`FunctionOverload`,e[e.GetAccessor=15]=`GetAccessor`,e[e.ImportDeclaration=16]=`ImportDeclaration`,e[e.ImportSpecifier=17]=`ImportSpecifier`,e[e.IndexSignature=18]=`IndexSignature`,e[e.Interface=19]=`Interface`,e[e.JsxAttribute=20]=`JsxAttribute`,e[e.JsxSpreadAttribute=21]=`JsxSpreadAttribute`,e[e.JsxElement=22]=`JsxElement`,e[e.JsxSelfClosingElement=23]=`JsxSelfClosingElement`,e[e.JSDoc=24]=`JSDoc`,e[e.JSDocTag=25]=`JSDocTag`,e[e.Method=26]=`Method`,e[e.MethodOverload=27]=`MethodOverload`,e[e.MethodSignature=28]=`MethodSignature`,e[e.Module=29]=`Module`,e[e.Parameter=30]=`Parameter`,e[e.Property=31]=`Property`,e[e.PropertyAssignment=32]=`PropertyAssignment`,e[e.PropertySignature=33]=`PropertySignature`,e[e.SetAccessor=34]=`SetAccessor`,e[e.ShorthandPropertyAssignment=35]=`ShorthandPropertyAssignment`,e[e.SourceFile=36]=`SourceFile`,e[e.SpreadAssignment=37]=`SpreadAssignment`,e[e.TypeAlias=38]=`TypeAlias`,e[e.TypeParameter=39]=`TypeParameter`,e[e.VariableDeclaration=40]=`VariableDeclaration`,e[e.VariableStatement=41]=`VariableStatement`})(e.StructureKind||={});var Yn={hasName(e){return typeof e.name==`string`},isCallSignature(t){return t?.kind===e.StructureKind.CallSignature},isJSDocable(t){switch(t?.kind){case e.StructureKind.CallSignature:case e.StructureKind.Class:case e.StructureKind.ClassStaticBlock:case e.StructureKind.ConstructorOverload:case e.StructureKind.Constructor:case e.StructureKind.ConstructSignature:case e.StructureKind.Enum:case e.StructureKind.EnumMember:case e.StructureKind.ExportAssignment:case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.GetAccessor:case e.StructureKind.IndexSignature:case e.StructureKind.Interface:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.MethodSignature:case e.StructureKind.Module:case e.StructureKind.Property:case e.StructureKind.PropertySignature:case e.StructureKind.SetAccessor:case e.StructureKind.TypeAlias:case e.StructureKind.VariableStatement:return!0;default:return!1}},isSignatured(t){switch(t?.kind){case e.StructureKind.CallSignature:case e.StructureKind.ConstructorOverload:case e.StructureKind.Constructor:case e.StructureKind.ConstructSignature:case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.GetAccessor:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.MethodSignature:case e.StructureKind.SetAccessor:return!0;default:return!1}},isParametered(t){switch(t?.kind){case e.StructureKind.CallSignature:case e.StructureKind.ConstructorOverload:case e.StructureKind.Constructor:case e.StructureKind.ConstructSignature:case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.GetAccessor:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.MethodSignature:case e.StructureKind.SetAccessor:return!0;default:return!1}},isReturnTyped(t){switch(t?.kind){case e.StructureKind.CallSignature:case e.StructureKind.ConstructorOverload:case e.StructureKind.Constructor:case e.StructureKind.ConstructSignature:case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.GetAccessor:case e.StructureKind.IndexSignature:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.MethodSignature:case e.StructureKind.SetAccessor:return!0;default:return!1}},isTypeParametered(t){switch(t?.kind){case e.StructureKind.CallSignature:case e.StructureKind.Class:case e.StructureKind.ConstructorOverload:case e.StructureKind.Constructor:case e.StructureKind.ConstructSignature:case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.GetAccessor:case e.StructureKind.Interface:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.MethodSignature:case e.StructureKind.SetAccessor:case e.StructureKind.TypeAlias:return!0;default:return!1}},isClass(t){return t?.kind===e.StructureKind.Class},isClassLikeDeclarationBase(t){return t?.kind===e.StructureKind.Class},isNameable(t){switch(t?.kind){case e.StructureKind.Class:case e.StructureKind.Function:return!0;default:return!1}},isImplementsClauseable(t){return t?.kind===e.StructureKind.Class},isDecoratable(t){switch(t?.kind){case e.StructureKind.Class:case e.StructureKind.GetAccessor:case e.StructureKind.Method:case e.StructureKind.Parameter:case e.StructureKind.Property:case e.StructureKind.SetAccessor:return!0;default:return!1}},isAbstractable(t){switch(t?.kind){case e.StructureKind.Class:case e.StructureKind.GetAccessor:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.Property:case e.StructureKind.SetAccessor:return!0;default:return!1}},isAmbientable(t){switch(t?.kind){case e.StructureKind.Class:case e.StructureKind.Enum:case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.Interface:case e.StructureKind.Module:case e.StructureKind.Property:case e.StructureKind.TypeAlias:case e.StructureKind.VariableStatement:return!0;default:return!1}},isExportable(t){switch(t?.kind){case e.StructureKind.Class:case e.StructureKind.Enum:case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.Interface:case e.StructureKind.Module:case e.StructureKind.TypeAlias:case e.StructureKind.VariableStatement:return!0;default:return!1}},isClassStaticBlock(t){return t?.kind===e.StructureKind.ClassStaticBlock},isStatemented(t){switch(t?.kind){case e.StructureKind.ClassStaticBlock:case e.StructureKind.Constructor:case e.StructureKind.Function:case e.StructureKind.GetAccessor:case e.StructureKind.Method:case e.StructureKind.Module:case e.StructureKind.SetAccessor:case e.StructureKind.SourceFile:return!0;default:return!1}},isConstructorDeclarationOverload(t){return t?.kind===e.StructureKind.ConstructorOverload},isScoped(t){switch(t?.kind){case e.StructureKind.ConstructorOverload:case e.StructureKind.Constructor:case e.StructureKind.GetAccessor:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.Property:case e.StructureKind.SetAccessor:return!0;default:return!1}},isConstructor(t){return t?.kind===e.StructureKind.Constructor},isFunctionLike(t){switch(t?.kind){case e.StructureKind.Constructor:case e.StructureKind.Function:case e.StructureKind.GetAccessor:case e.StructureKind.Method:case e.StructureKind.SetAccessor:return!0;default:return!1}},isConstructSignature(t){return t?.kind===e.StructureKind.ConstructSignature},isDecorator(t){return t?.kind===e.StructureKind.Decorator},isEnum(t){return t?.kind===e.StructureKind.Enum},isNamed(t){switch(t?.kind){case e.StructureKind.Enum:case e.StructureKind.Interface:case e.StructureKind.ShorthandPropertyAssignment:case e.StructureKind.TypeAlias:case e.StructureKind.TypeParameter:return!0;default:return!1}},isEnumMember(t){return t?.kind===e.StructureKind.EnumMember},isPropertyNamed(t){switch(t?.kind){case e.StructureKind.EnumMember:case e.StructureKind.GetAccessor:case e.StructureKind.Method:case e.StructureKind.MethodSignature:case e.StructureKind.PropertyAssignment:case e.StructureKind.Property:case e.StructureKind.PropertySignature:case e.StructureKind.SetAccessor:return!0;default:return!1}},isInitializerExpressionable(t){switch(t?.kind){case e.StructureKind.EnumMember:case e.StructureKind.Parameter:case e.StructureKind.Property:case e.StructureKind.PropertySignature:case e.StructureKind.VariableDeclaration:return!0;default:return!1}},isExportAssignment(t){return t?.kind===e.StructureKind.ExportAssignment},isExportDeclaration(t){return t?.kind===e.StructureKind.ExportDeclaration},isExportSpecifier(t){return t?.kind===e.StructureKind.ExportSpecifier},isFunctionDeclarationOverload(t){return t?.kind===e.StructureKind.FunctionOverload},isAsyncable(t){switch(t?.kind){case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.MethodOverload:case e.StructureKind.Method:return!0;default:return!1}},isGeneratorable(t){switch(t?.kind){case e.StructureKind.FunctionOverload:case e.StructureKind.Function:case e.StructureKind.MethodOverload:case e.StructureKind.Method:return!0;default:return!1}},isFunction(t){return t?.kind===e.StructureKind.Function},isGetAccessor(t){return t?.kind===e.StructureKind.GetAccessor},isStaticable(t){switch(t?.kind){case e.StructureKind.GetAccessor:case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.Property:case e.StructureKind.SetAccessor:return!0;default:return!1}},isImportAttribute(t){return t?.kind===e.StructureKind.ImportAttribute},isImportAttributeNamed(t){return t?.kind===e.StructureKind.ImportAttribute},isImportDeclaration(t){return t?.kind===e.StructureKind.ImportDeclaration},isImportSpecifier(t){return t?.kind===e.StructureKind.ImportSpecifier},isIndexSignature(t){return t?.kind===e.StructureKind.IndexSignature},isReadonlyable(t){switch(t?.kind){case e.StructureKind.IndexSignature:case e.StructureKind.Parameter:case e.StructureKind.Property:case e.StructureKind.PropertySignature:return!0;default:return!1}},isInterface(t){return t?.kind===e.StructureKind.Interface},isExtendsClauseable(t){return t?.kind===e.StructureKind.Interface},isTypeElementMembered(t){return t?.kind===e.StructureKind.Interface},isJSDoc(t){return t?.kind===e.StructureKind.JSDoc},isJSDocTag(t){return t?.kind===e.StructureKind.JSDocTag},isJsxAttribute(t){return t?.kind===e.StructureKind.JsxAttribute},isJsxElement(t){return t?.kind===e.StructureKind.JsxElement},isJsxSelfClosingElement(t){return t?.kind===e.StructureKind.JsxSelfClosingElement},isJsxTagNamed(t){return t?.kind===e.StructureKind.JsxSelfClosingElement},isJsxAttributed(t){return t?.kind===e.StructureKind.JsxSelfClosingElement},isJsxSpreadAttribute(t){return t?.kind===e.StructureKind.JsxSpreadAttribute},isMethodDeclarationOverload(t){return t?.kind===e.StructureKind.MethodOverload},isQuestionTokenable(t){switch(t?.kind){case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.MethodSignature:case e.StructureKind.Parameter:case e.StructureKind.Property:case e.StructureKind.PropertySignature:return!0;default:return!1}},isOverrideable(t){switch(t?.kind){case e.StructureKind.MethodOverload:case e.StructureKind.Method:case e.StructureKind.Parameter:case e.StructureKind.Property:return!0;default:return!1}},isMethod(t){return t?.kind===e.StructureKind.Method},isMethodSignature(t){return t?.kind===e.StructureKind.MethodSignature},isModule(t){return t?.kind===e.StructureKind.Module},isModuleNamed(t){return t?.kind===e.StructureKind.Module},isParameter(t){return t?.kind===e.StructureKind.Parameter},isBindingNamed(t){switch(t?.kind){case e.StructureKind.Parameter:case e.StructureKind.VariableDeclaration:return!0;default:return!1}},isTyped(t){switch(t?.kind){case e.StructureKind.Parameter:case e.StructureKind.Property:case e.StructureKind.PropertySignature:case e.StructureKind.TypeAlias:case e.StructureKind.VariableDeclaration:return!0;default:return!1}},isScopeable(t){return t?.kind===e.StructureKind.Parameter},isPropertyAssignment(t){return t?.kind===e.StructureKind.PropertyAssignment},isProperty(t){return t?.kind===e.StructureKind.Property},isExclamationTokenable(t){switch(t?.kind){case e.StructureKind.Property:case e.StructureKind.VariableDeclaration:return!0;default:return!1}},isPropertySignature(t){return t?.kind===e.StructureKind.PropertySignature},isSetAccessor(t){return t?.kind===e.StructureKind.SetAccessor},isShorthandPropertyAssignment(t){return t?.kind===e.StructureKind.ShorthandPropertyAssignment},isSourceFile(t){return t?.kind===e.StructureKind.SourceFile},isSpreadAssignment(t){return t?.kind===e.StructureKind.SpreadAssignment},isExpressioned(t){return t?.kind===e.StructureKind.SpreadAssignment},isTypeAlias(t){return t?.kind===e.StructureKind.TypeAlias},isTypeParameter(t){return t?.kind===e.StructureKind.TypeParameter},isVariableDeclaration(t){return t?.kind===e.StructureKind.VariableDeclaration},isVariableStatement(t){return t?.kind===e.StructureKind.VariableStatement}};function Xn(n,r){if(t.ArrayUtils.isReadonlyArray(n)){for(let e of n){let t=r(e);if(t)return t}return}switch(n.kind){case e.StructureKind.CallSignature:return Zn(n,r);case e.StructureKind.Class:return nr(n,r);case e.StructureKind.ClassStaticBlock:return ar(n,r);case e.StructureKind.ConstructorOverload:return sr(n,r);case e.StructureKind.Constructor:return cr(n,r);case e.StructureKind.ConstructSignature:return ur(n,r);case e.StructureKind.Enum:return dr(n,r);case e.StructureKind.EnumMember:return fr(n,r);case e.StructureKind.ExportAssignment:return pr(n,r);case e.StructureKind.ExportDeclaration:return mr(n,r);case e.StructureKind.FunctionOverload:return hr(n,r);case e.StructureKind.Function:return gr(n,r);case e.StructureKind.GetAccessor:return _r(n,r);case e.StructureKind.ImportDeclaration:return vr(n,r);case e.StructureKind.IndexSignature:return yr(n,r);case e.StructureKind.Interface:return br(n,r);case e.StructureKind.JSDoc:return Sr(n,r);case e.StructureKind.JsxElement:return Cr(n,r);case e.StructureKind.JsxSelfClosingElement:return wr(n,r);case e.StructureKind.MethodOverload:return Er(n,r);case e.StructureKind.Method:return Dr(n,r);case e.StructureKind.MethodSignature:return Or(n,r);case e.StructureKind.Module:return kr(n,r);case e.StructureKind.Parameter:return Ar(n,r);case e.StructureKind.Property:return jr(n,r);case e.StructureKind.PropertySignature:return Mr(n,r);case e.StructureKind.SetAccessor:return Nr(n,r);case e.StructureKind.SourceFile:return Pr(n,r);case e.StructureKind.TypeAlias:return U(n,r);case e.StructureKind.VariableStatement:return Fr(n,r);default:return}}function Zn(e,t){return Qn(e,t)||$n(e,t)||tr(e,t)}function Qn(t,n){return Lr(t.docs,n,e.StructureKind.JSDoc)}function $n(e,t){return er(e,t)}function er(t,n){return Ir(t.parameters,n,e.StructureKind.Parameter)}function tr(t,n){return Lr(t.typeParameters,n,e.StructureKind.TypeParameter)}function nr(e,t){return rr(e,t)}function rr(t,n){return ir(t,n)||tr(t,n)||Qn(t,n)||Ir(t.ctors,n,e.StructureKind.Constructor)||Ir(t.staticBlocks,n,e.StructureKind.ClassStaticBlock)||Ir(t.properties,n,e.StructureKind.Property)||Ir(t.getAccessors,n,e.StructureKind.GetAccessor)||Ir(t.setAccessors,n,e.StructureKind.SetAccessor)||Ir(t.methods,n,e.StructureKind.Method)}function ir(t,n){return Ir(t.decorators,n,e.StructureKind.Decorator)}function ar(e,t){return Qn(e,t)||or(e,t)}function or(e,t){return Rr(e.statements,t)}function sr(e,t){return $n(e,t)||tr(e,t)||Qn(e,t)}function cr(t,n){return lr(t,n)||Ir(t.overloads,n,e.StructureKind.ConstructorOverload)}function lr(e,t){return $n(e,t)||tr(e,t)||Qn(e,t)||or(e,t)}function ur(e,t){return Qn(e,t)||$n(e,t)||tr(e,t)}function dr(t,n){return Qn(t,n)||Ir(t.members,n,e.StructureKind.EnumMember)}function fr(e,t){return Qn(e,t)}function pr(e,t){return Qn(e,t)}function mr(t,n){return Lr(t.namedExports,n,e.StructureKind.ExportSpecifier)||Ir(t.attributes,n,e.StructureKind.ImportAttribute)}function hr(e,t){return $n(e,t)||tr(e,t)||Qn(e,t)}function gr(t,n){return lr(t,n)||Ir(t.overloads,n,e.StructureKind.FunctionOverload)}function _r(e,t){return ir(e,t)||lr(e,t)}function vr(t,n){return Lr(t.namedImports,n,e.StructureKind.ImportSpecifier)||Ir(t.attributes,n,e.StructureKind.ImportAttribute)}function yr(e,t){return Qn(e,t)}function br(e,t){return tr(e,t)||Qn(e,t)||xr(e,t)}function xr(t,n){return Ir(t.callSignatures,n,e.StructureKind.CallSignature)||Ir(t.constructSignatures,n,e.StructureKind.ConstructSignature)||Ir(t.getAccessors,n,e.StructureKind.GetAccessor)||Ir(t.indexSignatures,n,e.StructureKind.IndexSignature)||Ir(t.methods,n,e.StructureKind.MethodSignature)||Ir(t.properties,n,e.StructureKind.PropertySignature)||Ir(t.setAccessors,n,e.StructureKind.SetAccessor)}function Sr(t,n){return Ir(t.tags,n,e.StructureKind.JSDocTag)}function Cr(e,t){return Rr(e.attributes,t)||Rr(e.children,t)}function wr(e,t){return Tr(e,t)}function Tr(e,t){return Rr(e.attributes,t)}function Er(e,t){return $n(e,t)||tr(e,t)||Qn(e,t)}function Dr(t,n){return ir(t,n)||lr(t,n)||Ir(t.overloads,n,e.StructureKind.MethodOverload)}function Or(e,t){return Qn(e,t)||$n(e,t)||tr(e,t)}function kr(e,t){return Qn(e,t)||or(e,t)}function Ar(e,t){return ir(e,t)}function jr(e,t){return Qn(e,t)||ir(e,t)}function Mr(e,t){return Qn(e,t)}function Nr(e,t){return ir(e,t)||lr(e,t)}function Pr(e,t){return or(e,t)}function U(e,t){return tr(e,t)||Qn(e,t)}function Fr(t,n){return Qn(t,n)||Ir(t.declarations,n,e.StructureKind.VariableDeclaration)}function Ir(e,t,n){if(e!=null)for(let r of e){let e=t(zr(r,n));if(e)return e}}function Lr(e,t,n){if(!(e==null||!(e instanceof Array))){for(let r of e)if(Br(r)){let e=t(zr(r,n));if(e)return e}}}function Rr(e,t){if(!(e==null||!(e instanceof Array))){for(let n of e)if(Br(n)){let e=t(n);if(e)return e}}}function zr(e,t){return e.kind??=t,e}function Br(e){return e!=null&&typeof e.kind==`number`}function Vr(e){return e.iterateLastCharCodes(e=>e===o.CLOSE_BRACE?!0:t.StringUtils.isWhitespaceCharCode(e)?void 0:!1)||!1}var Hr=class extends Fn{#e;#t;constructor(e,t){super(),this.#t=e,this.#e=t}printTexts(e,t){if(t!=null)if(typeof t==`string`||t instanceof Function)this.printText(e,t);else for(let n of t)Vr(e)?e.blankLineIfLastNot():e.isAtStartOfFirstLineOfBlock()||e.newLineIfLastNot(),this.printText(e,n)}printText(n,r){if(typeof r==`string`||r instanceof Function||r==null){this.printTextOrWriterFunc(n,r);return}switch(r.kind){case e.StructureKind.Method:this.#e.isAmbient||i(),this.#t.forMethodDeclaration(this.#e).printText(n,r);break;case e.StructureKind.Property:this.#t.forPropertyDeclaration().printText(n,r);break;case e.StructureKind.GetAccessor:this.#e.isAmbient||i(),this.#t.forGetAccessorDeclaration(this.#e).printText(n,r);break;case e.StructureKind.SetAccessor:this.#e.isAmbient||i(),this.#t.forSetAccessorDeclaration(this.#e).printText(n,r);break;case e.StructureKind.Constructor:this.#e.isAmbient||i(),this.#t.forConstructorDeclaration(this.#e).printText(n,r);break;case e.StructureKind.ClassStaticBlock:i(),this.#t.forClassStaticBlockDeclaration().printText(n,r);break;default:t.errors.throwNotImplementedForNeverValueError(r)}function i(){n.isAtStartOfFirstLineOfBlock()||n.blankLineIfLastNot()}}},Ur=class extends Kn{constructor(e){super(e)}printTexts(e,t){if(t!=null)for(let n=0;n<t.length;n++)n>0&&e.blankLine(),this.printText(e,t[n])}printTextInternal(e,t){e.write(`static`),e.space().inlineBlock(()=>{this.factory.forStatementedNode({isAmbient:!1}).printText(e,t)})}},Wr=class extends Kn{#e;constructor(e,t){super(e),this.#e=t}printTexts(e,t){if(t!=null)for(let n=0;n<t.length;n++)n>0&&(this.#e.isAmbient?e.newLine():e.blankLine()),this.printText(e,t[n])}printTextInternal(e,n){this.#t(e,r()),this.#n(e,n),this.#e.isAmbient?e.write(`;`):e.space().inlineBlock(()=>{this.factory.forStatementedNode(this.#e).printText(e,n)});function r(){let e=t.ObjectUtils.clone(n.overloads);if(!(e==null||e.length===0)){for(let t of e)M(t,`scope`,n.scope);return e}}}#t(e,t){if(!(t==null||t.length===0))for(let n of t)this.printOverload(e,n),e.newLine()}printOverload(e,t){this.printLeadingTrivia(e,t),this.#n(e,t),e.write(`;`),this.printTrailingTrivia(e,t)}#n(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forModifierableNode().printText(e,t),e.write(`constructor`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,t.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,t.parameters)}},Gr=class extends Kn{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=this.#e.isAmbient?new Wn(this):new Bn(this)}printTexts(e,t){t!=null&&this.#t.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forDecorator().printTexts(e,t.decorators),this.factory.forModifierableNode().printText(e,t),e.write(`get ${t.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,t.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,t.parameters),this.factory.forReturnTypedNode().printText(e,t),this.#e.isAmbient||t.isAbstract?e.write(`;`):e.spaceIfLastNot().inlineBlock(()=>{this.factory.forStatementedNode(this.#e).printText(e,t)})}},Kr=class extends Kn{#e;constructor(e,t){super(e),this.#e=t}printTexts(e,t){if(t!=null)for(let n=0;n<t.length;n++)n>0&&(this.#e.isAmbient?e.newLine():e.blankLine()),this.printText(e,t[n])}printTextInternal(e,n){this.#t(e,n.name,r()),this.#n(e,n.name,n),this.#e.isAmbient||n.isAbstract?e.write(`;`):e.spaceIfLastNot().inlineBlock(()=>{this.factory.forStatementedNode(this.#e).printText(e,n)});function r(){let e=t.ObjectUtils.clone(n.overloads);if(!(e==null||e.length===0)){for(let t of e)M(t,`scope`,n.scope),M(t,`isStatic`,n.isStatic),M(t,`isAbstract`,n.isAbstract),M(t,`hasQuestionToken`,n.hasQuestionToken);return e}}}#t(e,t,n){if(!(n==null||n.length===0))for(let r of n)this.printOverload(e,t,r),e.newLine()}printOverload(e,t,n){this.printLeadingTrivia(e,n),this.#n(e,t,n),e.write(`;`),this.printTrailingTrivia(e,n)}#n(e,t,n){this.factory.forJSDoc().printDocs(e,n.docs),n.decorators!=null&&this.factory.forDecorator().printTexts(e,n.decorators),this.factory.forModifierableNode().printText(e,n),e.conditionalWrite(n.isGenerator,`*`),e.write(t),e.conditionalWrite(n.hasQuestionToken,`?`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,n.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,n.parameters),this.factory.forReturnTypedNode().printText(e,n)}},qr=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forDecorator().printTexts(e,t.decorators),this.factory.forModifierableNode().printText(e,t),e.write(t.name),e.conditionalWrite(t.hasQuestionToken,`?`),e.conditionalWrite(t.hasExclamationToken&&!t.hasQuestionToken,`!`),this.factory.forTypedNode(`:`).printText(e,t),this.factory.forInitializerExpressionableNode().printText(e,t),e.write(`;`)}},Jr=class extends Kn{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=this.#e.isAmbient?new Wn(this):new Bn(this)}printTexts(e,t){t!=null&&this.#t.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forDecorator().printTexts(e,t.decorators),this.factory.forModifierableNode().printText(e,t),e.write(`set ${t.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,t.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,t.parameters),this.factory.forReturnTypedNode().printText(e,t),this.#e.isAmbient||t.isAbstract?e.write(`;`):e.spaceIfLastNot().inlineBlock(()=>{this.factory.forStatementedNode(this.#e).printText(e,t)})}},Yr=class extends Fn{printText(e,t){typeof t==`string`?e.write(t):t(e)}},Xr=class extends Kn{printTexts(e,t){this.#n(e,t,()=>e.newLine())}printTextsInline(e,t){this.#n(e,t,()=>e.space())}printTextInternal(e,t){e.write(`@${t.name}`),this.#e(e,t),this.#t(e,t)}#e(e,t){if(!(t.typeArguments==null||t.typeArguments.length===0)){e.write(`<`);for(let n=0;n<t.typeArguments.length;n++)e.conditionalWrite(n>0,`, `),e.write(this.getTextWithQueuedChildIndentation(e,t.typeArguments[n]));e.write(`>`)}}#t(e,t){if(t.arguments==null)return;e.write(`(`);let n=t.arguments instanceof Array?t.arguments:[t.arguments];for(let t=0;t<n.length;t++)e.conditionalWrite(t>0,`, `),e.write(this.getTextWithQueuedChildIndentation(e,n[t]));e.write(`)`)}#n(e,t,n){if(!(t==null||t.length===0))for(let r of t)this.printText(e,r),n()}},Zr=class extends Kn{printDocs(e,t){if(t!=null)for(let n of t)this.printText(e,n),e.newLine()}printTextInternal(e,t){let n=o(this).split(/\r?\n/),r=n[0].length===0,i=n.length<=1,a=+!!r;if(e.write(`/**`),i?e.space():e.newLine(),i)e.write(n[a]);else for(let t=a;t<n.length;t++)e.write(` *`),n[t].length>0&&e.write(` ${n[t]}`),e.newLine();e.spaceIfLastNot(),e.write(`*/`);function o(n){if(typeof t==`string`)return t;let r=n.getNewWriter(e);return typeof t==`function`?t(r):(t.description&&ie(r,t.description),t.tags&&t.tags.length>0&&(r.getLength()>0&&r.newLine(),n.factory.forJSDocTag({printStarsOnNewLine:!1}).printTexts(r,t.tags))),r.toString()}}},Qr=class extends Kn{#e;constructor(e,t){super(e),this.#e=t}printTexts(e,t){if(t!=null)for(let n=0;n<t.length;n++)n>0&&(e.newLine(),e.conditionalWrite(this.#e.printStarsOnNewLine,` * `)),this.printText(e,t[n])}printTextInternal(e,n){let r=i(this).split(/\r?\n/);for(let t=0;t<r.length;t++)t>0&&(e.newLine(),this.#e.printStarsOnNewLine&&e.write(` *`)),r[t].length>0&&(this.#e.printStarsOnNewLine&&t>0&&e.space(),e.write(r[t]));function i(r){if(typeof n==`string`)return n;let i=r.getNewWriter(e);if(typeof n==`function`)n(i);else{n.text&&ie(i,n.text);let e=i.toString();i.unsafeInsert(0,`@${n.tagName}`+(e.length>0&&!t.StringUtils.startsWithNewLine(e)?` `:``))}return i.toString()}}},$r=class extends Kn{#e=new Bn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forModifierableNode().printText(e,t),e.conditionalWrite(t.isConst,`const `),e.write(`enum ${t.name} `).inlineBlock(()=>{this.factory.forEnumMember().printTexts(e,t.members)})}},ei=class extends Kn{#e=new Un(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,n){if(n instanceof Function){n(e);return}else if(typeof n==`string`){e.write(n);return}if(this.factory.forJSDoc().printDocs(e,n.docs),le(n.name)||t.StringUtils.isQuoted(n.name)?e.write(n.name):e.quote(n.name),typeof n.value==`string`){let{value:t}=n;e.hangingIndent(()=>e.write(` = `).quote(t))}else typeof n.value==`number`?e.write(` = ${n.value}`):this.factory.forInitializerExpressionableNode().printText(e,n)}},ti=class extends Fn{#e;#t=new Un(this);#n={isAmbient:!1};constructor(e){super(),this.#e=e}printTexts(e,t){this.#t.printText(e,t)}printText(n,r){if(typeof r==`string`||r instanceof Function||r==null){this.printTextOrWriterFunc(n,r);return}switch(r.kind){case e.StructureKind.PropertyAssignment:this.#e.forPropertyAssignment().printText(n,r);break;case e.StructureKind.ShorthandPropertyAssignment:this.#e.forShorthandPropertyAssignment().printText(n,r);break;case e.StructureKind.SpreadAssignment:this.#e.forSpreadAssignment().printText(n,r);break;case e.StructureKind.Method:this.#e.forMethodDeclaration(this.#n).printText(n,r);break;case e.StructureKind.GetAccessor:this.#e.forGetAccessorDeclaration(this.#n).printText(n,r);break;case e.StructureKind.SetAccessor:this.#e.forSetAccessorDeclaration(this.#n).printText(n,r);break;default:t.errors.throwNotImplementedForNeverValueError(r)}}},ni=class extends Kn{printTextInternal(e,t){e.hangingIndent(()=>{e.write(`${t.name}: `),ie(e,t.initializer)})}},ri=class extends Kn{printTextInternal(e,t){e.write(`${t.name}`)}},ii=class extends Kn{printTextInternal(e,t){e.hangingIndent(()=>{e.write(`...`),ie(e,t.expression)})}},ai=class extends Kn{#e;constructor(e,t){super(e),this.#e=t}printTexts(e,t){if(t!=null)for(let n=0;n<t.length;n++){let r=t[n];if(n>0){let i=t[n-1];this.#e.isAmbient||i.hasDeclareKeyword&&r.hasDeclareKeyword?e.newLine():e.blankLine()}this.printText(e,r)}}printTextInternal(e,n){this.#t(e,n.name,r()),this.#n(e,n.name,n),this.#e.isAmbient||n.hasDeclareKeyword?e.write(`;`):e.space().inlineBlock(()=>{this.factory.forStatementedNode({isAmbient:!1}).printText(e,n)});function r(){let e=t.ObjectUtils.clone(n.overloads);if(!(e==null||e.length===0)){for(let t of e)M(t,`hasDeclareKeyword`,n.hasDeclareKeyword),M(t,`isExported`,n.isExported),M(t,`isDefaultExport`,n.isDefaultExport);return e}}}#t(e,t,n){if(!(n==null||n.length===0))for(let r of n)this.printOverload(e,t,r),e.newLine()}printOverload(e,t,n){this.printLeadingTrivia(e,n),this.#n(e,t,n),e.write(`;`),this.printTrailingTrivia(e,n)}#n(e,n,r){this.factory.forJSDoc().printDocs(e,r.docs),this.factory.forModifierableNode().printText(e,r),e.write(`function`),e.conditionalWrite(r.isGenerator,`*`),t.StringUtils.isNullOrWhitespace(n)||e.write(` ${n}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,r.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,r.parameters),this.factory.forReturnTypedNode().printText(e,r)}},oi=class extends Kn{#e=new Vn(this);printTextsWithParenthesis(e,t){e.write(`(`),t!=null&&this.factory.forParameterDeclaration().printTexts(e,t),e.write(`)`)}printTexts(e,t){t==null||t.length===0||e.hangingIndent(()=>{this.#e.printText(e,t)})}printTextInternal(e,n){if(n.name==null)throw new t.errors.NotImplementedError(`Not implemented scenario where parameter declaration structure doesn't have a name. Please open an issue if you need this.`);this.factory.forDecorator().printTextsInline(e,n.decorators),this.factory.forModifierableNode().printText(e,n),e.conditionalWrite(n.isRestParameter,`...`),e.write(n.name),e.conditionalWrite(n.hasQuestionToken,`?`),this.factory.forTypedNode(`:`,n.hasQuestionToken).printText(e,n),this.factory.forInitializerExpressionableNode().printText(e,n)}},si=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,t.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,t.parameters),this.factory.forReturnTypedNode(!0).printText(e,t),e.write(`;`)}},ci=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),e.write(`new`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,t.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,t.parameters),this.factory.forReturnTypedNode().printText(e,t),e.write(`;`)}},li=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forModifierableNode().printText(e,t),e.write(`[${t.keyName||`key`}: ${t.keyType||`string`}]`),this.factory.forReturnTypedNode().printText(e,t),e.write(`;`)}},ui=class extends Kn{#e=new Bn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,n){if(this.factory.forJSDoc().printDocs(e,n.docs),this.factory.forModifierableNode().printText(e,n),e.write(`interface ${n.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,n.typeParameters),e.space(),n.extends!=null){let r=n.extends instanceof Array?n.extends.map(t=>this.getText(e,t)).join(`, `):this.getText(e,n.extends);t.StringUtils.isNullOrWhitespace(r)||e.hangingIndent(()=>e.write(`extends ${r} `))}e.inlineBlock(()=>{this.factory.forTypeElementMemberedNode().printText(e,n)})}},di=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),e.write(t.name),e.conditionalWrite(t.hasQuestionToken,`?`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,t.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(e,t.parameters),this.factory.forReturnTypedNode().printText(e,t),e.write(`;`)}},fi=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forModifierableNode().printText(e,t),e.write(t.name),e.conditionalWrite(t.hasQuestionToken,`?`),this.factory.forTypedNode(`:`).printText(e,t),this.factory.forInitializerExpressionableNode().printText(e,t),e.write(`;`)}},pi=class extends Fn{#e;constructor(e){super(),this.#e=e}printText(e,t){this.#e.forCallSignatureDeclaration().printTexts(e,t.callSignatures),this.#n(e,t.constructSignatures),this.#e.forConstructSignatureDeclaration().printTexts(e,t.constructSignatures),this.#n(e,t.indexSignatures),this.#e.forIndexSignatureDeclaration().printTexts(e,t.indexSignatures),this.#t(e,t),this.#n(e,t.properties),this.#e.forPropertySignature().printTexts(e,t.properties),this.#n(e,t.methods),this.#e.forMethodSignature().printTexts(e,t.methods)}#t(e,t){t.getAccessors==null&&t.setAccessors==null||new qn(this.#e.forGetAccessorDeclaration({isAmbient:!0}),this.#e.forSetAccessorDeclaration({isAmbient:!0})).printGetAndSet(e,t.getAccessors,t.setAccessors,!0)}#n(e,n){!t.ArrayUtils.isNullOrEmpty(n)&&!e.isAtStartOfFirstLineOfBlock()&&e.newLine()}},mi=class extends Fn{#e;constructor(e){super(),this.#e=e}printTexts(e,t){if(t!=null)if(typeof t==`string`||t instanceof Function)this.printText(e,t);else for(let n of t)Vr(e)?e.blankLineIfLastNot():e.isAtStartOfFirstLineOfBlock()||e.newLineIfLastNot(),this.printText(e,n)}printText(n,r){if(typeof r==`string`||r instanceof Function||r==null){this.printTextOrWriterFunc(n,r);return}switch(r.kind){case e.StructureKind.PropertySignature:this.#e.forPropertySignature().printText(n,r);break;case e.StructureKind.MethodSignature:this.#e.forMethodSignature().printText(n,r);break;case e.StructureKind.CallSignature:this.#e.forCallSignatureDeclaration().printText(n,r);break;case e.StructureKind.IndexSignature:this.#e.forIndexSignatureDeclaration().printText(n,r);break;case e.StructureKind.ConstructSignature:this.#e.forConstructSignatureDeclaration().printText(n,r);break;default:t.errors.throwNotImplementedForNeverValueError(r)}}},hi=class extends Kn{printTextInternal(n,r){if(i())this.factory.forJsxAttribute().printTextWithoutTrivia(n,r);else if(r.kind===e.StructureKind.JsxSpreadAttribute)this.factory.forJsxSpreadAttribute().printTextWithoutTrivia(n,r);else throw t.errors.throwNotImplementedForNeverValueError(r);function i(t){return r.kind==null||r.kind===e.StructureKind.JsxAttribute}}},gi=class extends Kn{printTextInternal(e,t){typeof t.name==`object`?this.factory.forJsxNamespacedName().printText(e,t.name):e.write(t.name),t.initializer!=null&&e.write(`=`).write(t.initializer)}},_i=class extends Kn{printTextInternal(n,r){i(r)?this.factory.forJsxElement().printText(n,r):r.kind===e.StructureKind.JsxSelfClosingElement?this.factory.forJsxSelfClosingElement().printText(n,r):t.errors.throwNotImplementedForNeverValueError(r);function i(t){return t.kind==null||t.kind===e.StructureKind.JsxElement}}},vi=class extends Kn{printTextInternal(e,t){e.hangingIndent(()=>{e.write(`<${t.name}`),t.attributes&&this.#e(e,t.attributes),e.write(`>`)}),this.#t(e,t.children),e.write(`</${t.name}>`)}#e(e,t){let n=this.factory.forJsxAttributeDecider();for(let r of t)e.space(),n.printText(e,r)}#t(e,t){t!=null&&(e.newLine(),e.indent(()=>{for(let n of t)this.factory.forJsxChildDecider().printText(e,n),e.newLine()}))}},yi=class extends Kn{printTextInternal(e,t){e.write(t.namespace).write(`:`).write(t.name)}},bi=class extends Kn{printTextInternal(e,t){e.hangingIndent(()=>{e.write(`<${t.name}`),t.attributes&&this.#e(e,t.attributes),e.write(` />`)})}#e(e,t){let n=this.factory.forJsxAttributeDecider();for(let r of t)e.space(),n.printText(e,r)}},xi=class extends Kn{printTextInternal(e,t){e.hangingIndent(()=>{e.write(`{`),e.write(`...`),e.write(t.expression),e.write(`}`)})}},Si=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),e.write(`export`),t.isExportEquals===!1?e.write(` default `):e.write(` = `),e.write(this.getTextWithQueuedChildIndentation(e,t.expression)).write(`;`)}},Ci=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,n){let r=n.moduleSpecifier!=null&&n.moduleSpecifier.length>0;if(n.namedExports!=null&&n.namedExports.length>0&&n.namespaceExport!=null)throw new t.errors.InvalidOperationError(`An export declaration cannot have both a namespace export and a named export.`);e.write(`export`),n.isTypeOnly&&e.write(` type`),n.namedExports!=null&&n.namedExports.length>0?(e.space(),this.factory.forNamedImportExportSpecifier().printTextsWithBraces(e,n.namedExports)):n.namespaceExport==null?r?e.write(` *`):e.write(` {`).conditionalWrite(this.factory.getFormatCodeSettings().insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces,` `).write(`}`):(e.write(` *`),t.StringUtils.isNullOrWhitespace(n.namespaceExport)||e.write(` as ${n.namespaceExport}`)),r&&(e.write(` from `),e.quote(n.moduleSpecifier)),n.attributes&&(e.space(),this.factory.forImportAttribute().printAttributes(e,n.attributes)),e.write(`;`)}},wi=class extends Kn{#e=new Un(this);printTexts(e,t){this.#e.printText(e,t)}printAttributes(e,t){t&&(e.write(`with `),e.inlineBlock(()=>{this.printTexts(e,t)}))}printTextInternal(e,t){e.write(t.name),e.write(`: `),e.quote(t.value)}},Ti=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,n){let r=n.namedImports!=null&&n.namedImports.length>0;if(r&&n.namespaceImport!=null)throw new t.errors.InvalidOperationError(`An import declaration cannot have both a namespace import and a named import.`);e.write(`import`),n.isTypeOnly&&e.write(` type`),n.defaultImport!=null&&(e.write(` ${n.defaultImport}`),e.conditionalWrite(r||n.namespaceImport!=null,`,`)),n.namespaceImport!=null&&e.write(` * as ${n.namespaceImport}`),n.namedImports!=null&&n.namedImports.length>0&&(e.space(),this.factory.forNamedImportExportSpecifier().printTextsWithBraces(e,n.namedImports)),e.conditionalWrite(n.defaultImport!=null||r||n.namespaceImport!=null,` from`),e.write(` `),e.quote(n.moduleSpecifier),n.attributes&&(e.space(),this.factory.forImportAttribute().printAttributes(e,n.attributes)),e.write(`;`)}},Ei=class extends Kn{#e;#t=new Bn(this);constructor(e,t){super(e),this.#e=t}printTexts(e,t){this.#t.printText(e,t)}printTextInternal(n,r){r=this.#n(r),this.factory.forJSDoc().printDocs(n,r.docs),this.factory.forModifierableNode().printText(n,r),r.declarationKind==null||r.declarationKind!==e.ModuleDeclarationKind.Global?n.write(`${r.declarationKind||`namespace`} ${r.name}`):n.write(`global`),r.hasDeclareKeyword&&t.StringUtils.isQuoted(r.name.trim())&&r.hasOwnProperty(t.nameof(r,`statements`))&&r.statements==null?n.write(`;`):(n.write(` `),n.inlineBlock(()=>{this.factory.forStatementedNode({isAmbient:r.hasDeclareKeyword||this.#e.isAmbient}).printText(n,r)}))}#n(n){if(t.StringUtils.isQuoted(n.name.trim())){if(n.declarationKind===e.ModuleDeclarationKind.Namespace)throw new t.errors.InvalidOperationError(`Cannot print a namespace with quotes for namespace with name ${n.name}. Use ModuleDeclarationKind.Module instead.`);n=t.ObjectUtils.clone(n),M(n,`hasDeclareKeyword`,!0),M(n,`declarationKind`,e.ModuleDeclarationKind.Module)}return n}},Di=class extends Kn{#e=new Vn(this);printTextsWithBraces(e,n){let r=this.factory.getFormatCodeSettings();e.write(`{`);let i=this.getNewWriter(e);this.printTexts(i,n);let a=i.toString();r.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces&&!t.StringUtils.startsWithNewLine(a)&&e.space(),e.write(a),r.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces&&!t.StringUtils.endsWithNewLine(a)&&e.space(),e.write(`}`)}printTexts(e,t){t instanceof Function?this.printText(e,t):this.#e.printText(e,t)}printTextInternal(e,n){let r=this.getNewWriterWithQueuedChildIndentation(e);typeof n==`string`?r.write(n):n instanceof Function?n(r):(n.isTypeOnly&&e.write(`type `),r.write(n.name),t.StringUtils.isNullOrWhitespace(n.alias)||(r.isLastNewLine()||r.space(),r.write(`as ${n.alias}`))),e.write(r.toString())}},Oi=class extends Kn{#e;constructor(e,t){super(e),this.#e=t}printTextInternal(e,t){this.factory.forStatementedNode(this.#e).printText(e,t),e.conditionalNewLine(!e.isAtStartOfFirstLineOfBlock()&&!e.isLastNewLine())}},ki=class extends Fn{#e;#t;constructor(e,t){super(),this.#t=e,this.#e=t}printText(e,t){this.#t.forStatement(this.#e).printTexts(e,t.statements)}},Ai=class extends Fn{#e;#t;constructor(e,t){super(),this.#t=e,this.#e=t}printTexts(e,t){if(t!=null)if(typeof t==`string`||t instanceof Function)this.printText(e,t);else for(let n of t)Vr(e)?e.blankLineIfLastNot():e.isAtStartOfFirstLineOfBlock()||e.newLineIfLastNot(),this.printText(e,n)}printText(n,r){if(typeof r==`string`||r instanceof Function||r==null){this.printTextOrWriterFunc(n,r);return}switch(r.kind){case e.StructureKind.Function:this.#e.isAmbient||i(),this.#t.forFunctionDeclaration(this.#e).printText(n,r);break;case e.StructureKind.Class:i(),this.#t.forClassDeclaration(this.#e).printText(n,r);break;case e.StructureKind.Interface:i(),this.#t.forInterfaceDeclaration().printText(n,r);break;case e.StructureKind.TypeAlias:this.#t.forTypeAliasDeclaration().printText(n,r);break;case e.StructureKind.VariableStatement:this.#t.forVariableStatement().printText(n,r);break;case e.StructureKind.ImportDeclaration:this.#t.forImportDeclaration().printText(n,r);break;case e.StructureKind.Module:i(),this.#t.forModuleDeclaration(this.#e).printText(n,r);break;case e.StructureKind.Enum:i(),this.#t.forEnumDeclaration().printText(n,r);break;case e.StructureKind.ExportDeclaration:this.#t.forExportDeclaration().printText(n,r);break;case e.StructureKind.ExportAssignment:this.#t.forExportAssignment().printText(n,r);break;default:t.errors.throwNotImplementedForNeverValueError(r)}function i(){n.isAtStartOfFirstLineOfBlock()||n.blankLineIfLastNot()}}};e.VariableDeclarationKind=void 0,(function(e){e.Var=`var`,e.Let=`let`,e.Const=`const`,e.AwaitUsing=`await using`,e.Using=`using`})(e.VariableDeclarationKind||={});var ji=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(t,n){this.factory.forJSDoc().printDocs(t,n.docs),t.hangingIndent(()=>{if(this.factory.forModifierableNode().printText(t,n),t.write(`${n.declarationKind||e.VariableDeclarationKind.Let} `),n.declarations.length===0)throw Error(`You must provide at least one declaration when inserting a variable statement.`);this.factory.forVariableDeclaration().printTexts(t,n.declarations),t.write(`;`)})}},Mi=class extends Kn{#e=new Wn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){this.factory.forJSDoc().printDocs(e,t.docs),this.factory.forModifierableNode().printText(e,t),e.write(`type ${t.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(e,t.typeParameters),this.factory.forTypedNode(` =`).printText(e,t),e.write(`;`)}},Ni=class extends Kn{#e=new Vn(this);printTextsWithBrackets(e,t){t==null||t.length===0||(e.write(`<`),this.printTexts(e,t),e.write(`>`))}printTexts(e,t){this.#e.printText(e,t)}printTextInternal(n,r){if(typeof r==`string`){n.write(r);return}n.hangingIndent(()=>{if(r.isConst&&n.write(`const `),r.variance!=null&&((r.variance&e.TypeParameterVariance.In)!==0&&n.write(`in `),(r.variance&e.TypeParameterVariance.Out)!==0&&n.write(`out `)),n.write(r.name),r.constraint!=null){let e=this.getText(n,r.constraint);t.StringUtils.isNullOrWhitespace(e)||n.write(` extends ${e}`)}if(r.default!=null){let e=this.getText(n,r.default);t.StringUtils.isNullOrWhitespace(e)||n.write(` = ${e}`)}})}},Pi=class extends Kn{#e=new Vn(this);printTexts(e,t){this.#e.printText(e,t)}printTextInternal(e,t){e.write(t.name),e.conditionalWrite(t.hasExclamationToken,`!`),this.factory.forTypedNode(`:`).printText(e,t),this.factory.forInitializerExpressionableNode().printText(e,t)}};function Fi(e){return class extends e{getExtends(){return this.getHeritageClauseByKind(t.SyntaxKind.ExtendsKeyword)?.getTypeNodes()??[]}addExtends(e){return this.insertExtends(this.getExtends().length,e)}insertExtends(e,n){let r=this.getExtends(),i=typeof n==`string`;if(typeof n==`string`)t.errors.throwIfWhitespaceOrNotString(n,`texts`),n=[n];else if(n.length===0)return[];let a=this._getWriterWithQueuedChildIndentation();if(new Vn(new Yr).printText(a,n),e=tt(e,r.length),r.length>0)Mt({parent:this.getHeritageClauseByKindOrThrow(t.SyntaxKind.ExtendsKeyword).getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:r,insertIndex:e,newText:a.toString(),useTrailingCommas:!1});else{let e=this.getFirstChildByKindOrThrow(t.SyntaxKind.OpenBraceToken).getStart(),n=/\s/.test(this.getSourceFile().getFullText()[e-1]),r=`extends ${a.toString()} `;n||(r=` `+r),At({parent:this,insertPos:e,newText:r})}let o=this.getExtends();return i?o[e]:Xe(r,o,e,!1)}removeExtends(e){let n=this.getHeritageClauseByKind(t.SyntaxKind.ExtendsKeyword);if(n==null)throw new t.errors.InvalidOperationError(`Cannot remove an extends when none exist.`);return n.removeExpression(e),this}set(t){return ge(e.prototype,this,t),t.extends!=null&&(this.getExtends().forEach(e=>this.removeExtends(e)),this.addExtends(t.extends)),this}getStructure(){return he(e.prototype,this,{extends:this.getExtends().map(e=>e.getText())})}}}function Ii(e){return class extends e{isGenerator(){return this.compilerNode.asteriskToken!=null}getAsteriskToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.asteriskToken)}getAsteriskTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAsteriskToken(),e??`Expected to find an asterisk token.`,this)}setIsGenerator(e){let t=this.getAsteriskToken();return t!=null===e||(t==null?At({insertPos:Li(this),parent:this,newText:`*`}):zt({children:[t],getSiblingFormatting:()=>ve.Space})),this}set(t){return ge(e.prototype,this,t),t.isGenerator!=null&&this.setIsGenerator(t.isGenerator),this}getStructure(){return he(e.prototype,this,{isGenerator:this.isGenerator()})}}}function Li(e){if(e.getKind()===t.SyntaxKind.FunctionDeclaration)return e.getFirstChildByKindOrThrow(t.SyntaxKind.FunctionKeyword).getEnd();let n=e;if(n.getName==null)throw new t.errors.NotImplementedError(`Expected a name node for a non-function declaration.`);return n.getNameNode().getStart()}function Ri(e){return class extends e{getHeritageClauses(){return this.compilerNode.heritageClauses?.map(e=>this._getNodeFromCompilerNode(e))??[]}getHeritageClauseByKindOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getHeritageClauseByKind(e),n??(()=>`Expected to have heritage clause of kind ${t.getSyntaxKindName(e)}.`),this)}getHeritageClauseByKind(e){return this.getHeritageClauses().find(t=>t.compilerNode.token===e)}}}function zi(e){return class extends e{getImplements(){return this.getHeritageClauseByKind(t.SyntaxKind.ImplementsKeyword)?.getTypeNodes()??[]}addImplements(e){return this.insertImplements(this.getImplements().length,e)}insertImplements(e,n){let r=this.getImplements(),i=typeof n==`string`;if(typeof n==`string`)t.errors.throwIfWhitespaceOrNotString(n,`texts`),n=[n];else if(n.length===0)return[];let a=this._getWriterWithQueuedChildIndentation();new Vn(new Yr).printText(a,n);let o=this.getHeritageClauses();if(e=tt(e,r.length),r.length>0)Mt({parent:this.getHeritageClauseByKindOrThrow(t.SyntaxKind.ImplementsKeyword).getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:r,insertIndex:e,newText:a.toString(),useTrailingCommas:!1});else{let e=this.getFirstChildByKindOrThrow(t.SyntaxKind.OpenBraceToken).getStart(),n=/\s/.test(this.getSourceFile().getFullText()[e-1]),r=`implements ${a.toString()} `;n||(r=` `+r),At({parent:o.length===0?this:o[0].getParentSyntaxListOrThrow(),insertPos:e,newText:r})}let s=this.getImplements();return i?s[0]:Xe(r,s,e,!1)}removeImplements(e){let n=this.getHeritageClauseByKind(t.SyntaxKind.ImplementsKeyword);if(n==null)throw new t.errors.InvalidOperationError(`Cannot remove an implements when none exist.`);return n.removeExpression(e),this}set(t){return ge(e.prototype,this,t),t.implements!=null&&(this.getImplements().forEach(e=>this.removeImplements(e)),this.addImplements(t.implements)),this}getStructure(){return he(e.prototype,this,{implements:this.getImplements().map(e=>e.getText())})}}}function Bi(e){return class extends e{hasInitializer(){return this.compilerNode.initializer!=null}getInitializerIfKindOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getInitializerIfKind(e),n??`Expected to find an initializer of kind '${t.getSyntaxKindName(e)}'.`,this)}getInitializerIfKind(e){let t=this.getInitializer();if(!(t!=null&&t.getKind()!==e))return t}getInitializerOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInitializer(),e??`Expected to find an initializer.`,this)}getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}}}function Vi(e){return Hi(Bi(e))}function Hi(e){return class extends e{removeInitializer(){let e=this.getInitializer();return e==null||Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.EqualsToken),e],removePrecedingSpaces:!0}),this}setInitializer(e){let n=F(this._getWriterWithQueuedChildIndentation(),e);t.errors.throwIfWhitespaceOrNotString(n,`textOrWriterFunction`),this.hasInitializer()&&this.removeInitializer();let r=this.getLastChildIfKind(t.SyntaxKind.SemicolonToken);return At({insertPos:r==null?this.getEnd():r.getPos(),parent:this,newText:` = ${n}`}),this}set(n){return ge(e.prototype,this,n),n.initializer==null?n.hasOwnProperty(t.nameof(n,`initializer`))&&this.removeInitializer():this.setInitializer(n.initializer),this}getStructure(){let t=this.getInitializer();return he(e.prototype,this,{initializer:t?t.getText():void 0})}}}function Ui(e){return class extends e{getJsDocs(){return this.compilerNode.jsDoc?.map(e=>this._getNodeFromCompilerNode(e))??[]}addJsDoc(e){return this.addJsDocs([e])[0]}addJsDocs(e){return this.insertJsDocs(je(this.compilerNode.jsDoc),e)}insertJsDoc(e,t){return this.insertJsDocs(e,[t])[0]}insertJsDocs(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=this._getWriterWithQueuedIndentation();this._context.structurePrinterFactory.forJSDoc().printDocs(r,n),r.write(``);let i=r.toString(),a=this.getJsDocs();return e=tt(e,a.length),At({insertPos:e===a.length?this.getStart():a[e].getStart(),parent:this,newText:i}),Xe(a,this.getJsDocs(),e,!1)}set(t){return ge(e.prototype,this,t),t.docs!=null&&(this.getJsDocs().forEach(e=>e.remove()),this.addJsDocs(t.docs)),this}getStructure(){return he(e.prototype,this,{docs:this.getJsDocs().map(e=>e.getStructure())})}}}function Wi(e){return class extends e{getLiteralText(){return this.compilerNode.text}isTerminated(){return!this.compilerNode.isUnterminated}hasExtendedUnicodeEscape(){return this.compilerNode.hasExtendedUnicodeEscape||!1}}}function Gi(e){return class extends e{getModifiers(){return this.getCompilerModifiers().map(e=>this._getNodeFromCompilerNode(e))}getFirstModifierByKindOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getFirstModifierByKind(e),n??(()=>`Expected a modifier of syntax kind: ${t.getSyntaxKindName(e)}`),this)}getFirstModifierByKind(e){for(let t of this.getCompilerModifiers())if(t.kind===e)return this._getNodeFromCompilerNode(t)}hasModifier(e){return typeof e==`string`?this.getModifiers().some(t=>t.getText()===e):this.getCompilerModifiers().some(t=>t.kind===e)}toggleModifier(e,t){return t??=!this.hasModifier(e),t?this.addModifier(e):this.removeModifier(e),this}addModifier(e){let n=this.getModifiers(),r=this.getModifiers().filter(e=>e.getKind()!==t.SyntaxKind.Decorator),i=r.find(t=>t.getText()===e);if(i!=null)return i;let a=c(this),o,s;return r.length===0||a===r[0].getStart()?(s=e+` `,o=a):(s=` `+e,o=a+1),At({parent:n.length===0?this:n[0].getParentSyntaxListOrThrow(),insertPos:a,newText:s}),this.getModifiers().find(e=>e.getStart()===o);function c(n){let i=a();for(let t of Ki(e))for(let e=0;e<r.length;e++){let n=r[e];if(n.getText()===t){i<n.getEnd()&&(i=n.getEnd());break}}return i;function a(){if(r.length>0)return r[0].getStart();if(n.getKind()===t.SyntaxKind.ArrowFunction)return n.getStart();for(let e of n._getChildrenIterator())if(!(e.getKind()===t.SyntaxKind.SyntaxList||t.ts.isJSDocCommentContainingNode(e.compilerNode)))return e.getStart();return n.getStart()}}}removeModifier(e){let t=this.getModifiers(),n=t.find(t=>t.getText()===e);return n==null?!1:(Lt({children:[t.length===1?n.getParentSyntaxListOrThrow():n],removeFollowingSpaces:!0}),!0)}getCompilerModifiers(){return this.compilerNode.modifiers??[]}}}function Ki(e){switch(e){case`export`:return[];case`public`:case`protected`:case`private`:return[];case`default`:return[`export`];case`const`:return[`export`];case`declare`:return[`export`,`default`];case`static`:return[`public`,`protected`,`private`];case`override`:return[`public`,`private`,`protected`,`static`];case`abstract`:return[`export`,`default`,`declare`,`public`,`private`,`protected`,`static`,`override`];case`async`:return[`export`,`default`,`declare`,`public`,`private`,`protected`,`static`,`override`,`abstract`];case`readonly`:return[`export`,`default`,`declare`,`public`,`private`,`protected`,`static`,`override`,`abstract`];case`out`:return[`const`,`in`];case`in`:return[`const`];case`accessor`:return[`public`,`private`,`protected`,`declare`,`override`,`static`,`abstract`,`readonly`];default:t.errors.throwNotImplementedForNeverValueError(e)}}function qi(e){return class extends e{addImportDeclaration(e){return this.addImportDeclarations([e])[0]}addImportDeclarations(e){let n=this._getCompilerStatementsWithComments();return this.insertImportDeclarations(r(),e);function r(){let e=0,r=!0;for(let i=0;i<n.length;i++){let a=n[i];r&&a.kind===t.SyntaxKind.MultiLineCommentTrivia?e=i+1:(r=!1,a.kind===t.SyntaxKind.ImportDeclaration&&(e=i+1))}return e}}insertImportDeclaration(e,t){return this.insertImportDeclarations(e,[t])[0]}insertImportDeclarations(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.ImportDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forImportDeclaration().printTexts(e,n)},{previousNewLine:e=>V.isImportDeclaration(e)||D(e.compilerNode),nextNewLine:e=>V.isImportDeclaration(e)})}})}getImportDeclaration(e){return this.getImportDeclarations().find(t());function t(){return typeof e==`string`?t=>t.getModuleSpecifierValue()===e:e}}getImportDeclarationOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getImportDeclaration(e),n??`Expected to find an import with the provided condition.`,this)}getImportDeclarations(){return this.getStatements().filter(V.isImportDeclaration)}addExportDeclaration(e){return this.addExportDeclarations([e])[0]}addExportDeclarations(e){return this.insertExportDeclarations(this.getChildSyntaxListOrThrow().getChildCount(),e)}insertExportDeclaration(e,t){return this.insertExportDeclarations(e,[t])[0]}insertExportDeclarations(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.ExportDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forExportDeclaration().printTexts(e,n)},{previousNewLine:e=>V.isExportDeclaration(e)||D(e.compilerNode),nextNewLine:e=>V.isExportDeclaration(e)})}})}getExportDeclaration(e){return this.getExportDeclarations().find(t());function t(){return typeof e==`string`?t=>t.getModuleSpecifierValue()===e:e}}getExportDeclarationOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getExportDeclaration(e),n??`Expected to find an export declaration with the provided condition.`,this)}getExportDeclarations(){return this.getStatements().filter(V.isExportDeclaration)}addExportAssignment(e){return this.addExportAssignments([e])[0]}addExportAssignments(e){return this.insertExportAssignments(this.getChildSyntaxListOrThrow().getChildCount(),e)}insertExportAssignment(e,t){return this.insertExportAssignments(e,[t])[0]}insertExportAssignments(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.ExportAssignment,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forExportAssignment().printTexts(e,n)},{previousNewLine:e=>V.isExportAssignment(e)||D(e.compilerNode),nextNewLine:e=>V.isExportAssignment(e)})}})}getExportAssignment(e){return this.getExportAssignments().find(e)}getExportAssignmentOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getExportAssignment(e),n??`Expected to find an export assignment with the provided condition.`,this)}getExportAssignments(){return this.getStatements().filter(V.isExportAssignment)}getDefaultExportSymbol(){let e=this.getSymbol();if(e!=null)return e.getExport(`default`)}getDefaultExportSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefaultExportSymbol(),e??`Expected to find a default export symbol`)}getExportSymbols(){let e=this.getSymbol();return e==null?[]:this._context.typeChecker.getExportsOfModule(e)}getExportedDeclarations(){let e=new Map,n=this.getExportSymbols();for(let t of n)for(let n of t.getDeclarations()){let i=Array.from(r(n)),a=t.getName(),o=e.get(a);o==null?e.set(t.getName(),i):o.push(...i)}return e;function*r(e){if(V.isExportSpecifier(e))for(let t of e.getLocalTargetDeclarations())yield*r(t);else if(V.isExportAssignment(e)){let r=e.getExpression();if(r==null||r.getKind()!==t.SyntaxKind.Identifier){yield r;return}yield*n(r.getSymbol())}else if(V.isImportSpecifier(e)){let t=e.getNameNode().getSymbol();if(t==null)return;yield*n(t.getAliasedSymbol()||t)}else if(V.isImportClause(e)){let t=e.getDefaultImport();if(t==null)return;let r=t.getSymbol();if(r==null)return;yield*n(r.getAliasedSymbol()||r)}else if(V.isNamespaceImport(e)||V.isNamespaceExport(e)){let t=e.getNameNode().getSymbol();if(t==null)return;yield*n(t.getAliasedSymbol()||t)}else yield e;function*n(e){if(e!=null)for(let t of e.getDeclarations())yield*r(t)}}}removeDefaultExport(e){if(e||=this.getDefaultExportSymbol(),e==null)return this;let n=e.getDeclarations()[0];return n.compilerNode.kind===t.SyntaxKind.ExportAssignment?zt({children:[n],getSiblingFormatting:()=>ve.Newline}):V.isModifierable(n)&&(n.toggleModifier(`default`,!1),n.toggleModifier(`export`,!1)),this}}}function Ji(e){return class extends e{getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}getName(){return this.getNameNode().getText()}set(t){return ge(e.prototype,this,t),t.name!=null&&this.getNameNode().replaceWithText(t.name),this}getStructure(){return he(e.prototype,this,{name:this.getName()})}}}function Yi(e){return class extends e{findReferences(){return this._context.languageService.findReferences(Xi(this))}findReferencesAsNodes(){return this._context.languageService.findReferencesAsNodes(Xi(this))}}}function Xi(e){return V.isIdentifier(e)||V.isStringLiteral(e)?e:e.getNodeProperty(`name`)??(V.isExportable(e)&&e.getDefaultKeyword()||e)}function Zi(e){return class extends e{rename(e,n){return bn(r(this),e,n),this;function r(e){if(V.isIdentifier(e)||V.isPrivateIdentifier(e)||V.isStringLiteral(e))return e;if(e.getNameNode!=null){let n=e.getNameNode();if(t.errors.throwIfNullOrUndefined(n,`Expected to find a name node when renaming.`),V.isArrayBindingPattern(n)||V.isObjectBindingPattern(n))throw new t.errors.NotImplementedError(`Not implemented renameable scenario for ${n.getKindName()}.`);return n}else throw new t.errors.NotImplementedError(`Not implemented renameable scenario for ${e.getKindName()}`)}}}}function Qi(e){return Ji(Yi(Zi(e)))}function $i(e){return Ji(Yi(Zi(e)))}function ea(e){return Ji(Yi(Zi(e)))}function ta(e){return na(Yi(Zi(e)))}function na(e){return class extends e{getNameNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.name)}getNameNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNameNode(),e??`Expected to have a name node.`,this)}getName(){return this.getNameNode()?.getText()??void 0}getNameOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getName(),e??`Expected to have a name.`,this)}rename(n){return n===this.getName()?this:t.StringUtils.isNullOrWhitespace(n)?(this.removeName(),this):(this.getNameNode()==null?ra(this,n):e.prototype.rename.call(this,n),this)}removeName(){let e=this.getNameNode();return e==null||Lt({children:[e],removePrecedingSpaces:!0}),this}set(n){if(ge(e.prototype,this,n),n.name!=null){t.errors.throwIfWhitespaceOrNotString(n.name,`structure.name`);let e=this.getNameNode();e==null?ra(this,n.name):e.replaceWithText(n.name)}else n.hasOwnProperty(t.nameof(n,`name`))&&this.removeName();return this}getStructure(){return he(e.prototype,this,{name:this.getName()})}}}function ra(e,n){V.isClassDeclaration(e)||V.isClassExpression(e)?At({insertPos:e.getFirstChildByKindOrThrow(t.SyntaxKind.ClassKeyword).getEnd(),newText:` `+n,parent:e}):At({insertPos:e.getFirstChildByKindOrThrow(t.SyntaxKind.OpenParenToken).getStart(),newText:` `+n,parent:e})}function ia(e){return Ji(Zi(Yi(e)))}function aa(e){return Ji(Yi(Zi(e)))}function oa(e){return class extends e{hasOverrideKeyword(){return this.hasModifier(t.SyntaxKind.OverrideKeyword)}getOverrideKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.OverrideKeyword)}getOverrideKeywordOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getOverrideKeyword(),e??`Expected to find an override keyword.`,this)}setHasOverrideKeyword(e){return this.toggleModifier(`override`,e),this}set(t){return ge(e.prototype,this,t),t.hasOverrideKeyword!=null&&this.setHasOverrideKeyword(t.hasOverrideKeyword),this}getStructure(){return he(e.prototype,this,{hasOverrideKeyword:this.hasOverrideKeyword()})}}}function sa(e){return class extends e{getParameter(e){return s(this.getParameters(),e)}getParameterOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getParameter(e),()=>l(`parameter`,e))}getParameters(){return this.compilerNode.parameters.map(e=>this._getNodeFromCompilerNode(e))}addParameter(e){return this.addParameters([e])[0]}addParameters(e){return this.insertParameters(je(this.compilerNode.parameters),e)}insertParameter(e,t){return this.insertParameters(e,[t])[0]}insertParameters(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=this.getParameters(),i=this.getFirstChildByKindOrThrow(t.SyntaxKind.OpenParenToken).getNextSiblingIfKindOrThrow(t.SyntaxKind.SyntaxList);e=tt(e,r.length);let a=this._getWriterWithQueuedChildIndentation();return this._context.structurePrinterFactory.forParameterDeclaration().printTexts(a,n),Mt({parent:i,currentNodes:r,insertIndex:e,newText:a.toString(),useTrailingCommas:!1}),Xe(r,this.getParameters(),e,!1)}set(t){return ge(e.prototype,this,t),t.parameters!=null&&(this.getParameters().forEach(e=>e.remove()),this.addParameters(t.parameters)),this}getStructure(){return he(e.prototype,this,{parameters:this.getParameters().map(e=>e.getStructure())})}}}function ca(e){return class extends e{hasQuestionDotToken(){return this.compilerNode.questionDotToken!=null}getQuestionDotTokenNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionDotToken)}getQuestionDotTokenNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQuestionDotTokenNode(),e??`Expected to find a question dot token.`,this)}setHasQuestionDotToken(e){let n=this.getQuestionDotTokenNode();if(e===(n!=null))return this;return e?V.isPropertyAccessExpression(this)?this.getFirstChildByKindOrThrow(t.SyntaxKind.DotToken).replaceWithText(`?.`):At({insertPos:r.call(this),parent:this,newText:`?.`}):V.isPropertyAccessExpression(this)?n.replaceWithText(`.`):Lt({children:[n]}),this;function r(){if(V.isCallExpression(this))return this.getFirstChildByKindOrThrow(t.SyntaxKind.OpenParenToken).getStart();if(V.isElementAccessExpression(this))return this.getFirstChildByKindOrThrow(t.SyntaxKind.OpenBracketToken).getStart();t.errors.throwNotImplementedForSyntaxKindError(this.compilerNode.kind)}}set(t){return ge(e.prototype,this,t),t.hasQuestionDotToken!=null&&this.setHasQuestionDotToken(t.hasQuestionDotToken),this}getStructure(){return he(e.prototype,this,{hasQuestionDotToken:this.hasQuestionDotToken()})}}}function la(e){return class extends e{hasQuestionToken(){return this.compilerNode.questionToken!=null}getQuestionTokenNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionToken)}getQuestionTokenNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQuestionTokenNode(),e??`Expected to find a question token.`,this)}setHasQuestionToken(e){let n=this.getQuestionTokenNode();if(e===(n!=null))return this;return e?(V.isExclamationTokenable(this)&&this.setHasExclamationToken(!1),At({insertPos:r.call(this),parent:this,newText:`?`})):Lt({children:[n]}),this;function r(){if(V.hasName(this))return this.getNameNode().getEnd();let e=this.getFirstChildByKind(t.SyntaxKind.ColonToken);if(e!=null)return e.getStart();let n=this.getLastChildByKind(t.SyntaxKind.SemicolonToken);return n==null?this.getEnd():n.getStart()}}set(t){return ge(e.prototype,this,t),t.hasQuestionToken!=null&&this.setHasQuestionToken(t.hasQuestionToken),this}getStructure(){return he(e.prototype,this,{hasQuestionToken:this.hasQuestionToken()})}}}function ua(e){return class extends e{isReadonly(){return this.getReadonlyKeyword()!=null}getReadonlyKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.ReadonlyKeyword)}getReadonlyKeywordOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getReadonlyKeyword(),e??`Expected to find a readonly keyword.`,this)}setIsReadonly(e){return this.toggleModifier(`readonly`,e),this}set(t){return ge(e.prototype,this,t),t.isReadonly!=null&&this.setIsReadonly(t.isReadonly),this}getStructure(){return he(e.prototype,this,{isReadonly:this.isReadonly()})}}}function da(e){return class extends e{getReturnType(){return this.getSignature().getReturnType()}getReturnTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getReturnTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getReturnTypeNode(),e??`Expected to find a return type node.`,this)}setReturnType(e){let n=F(this._getWriterWithQueuedChildIndentation(),e);if(t.StringUtils.isNullOrWhitespace(n))return this.removeReturnType();let r=this.getReturnTypeNode();if(r!=null)return r.getText()!==n&&r.replaceWithText(n),this;return At({parent:this,insertPos:i(this).getEnd(),newText:`: ${n}`}),this;function i(e){return e.getKind()===t.SyntaxKind.IndexSignature?e.getFirstChildByKindOrThrow(t.SyntaxKind.CloseBracketToken):e.getFirstChildByKindOrThrow(t.SyntaxKind.CloseParenToken)}}removeReturnType(){let e=this.getReturnTypeNode();return e==null||Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.ColonToken),e],removePrecedingSpaces:!0}),this}getSignature(){let e=this._context.typeChecker.getSignatureFromNode(this);if(e==null)throw new t.errors.NotImplementedError(`Expected the node to have a signature.`);return e}set(n){return ge(e.prototype,this,n),n.returnType==null?n.hasOwnProperty(t.nameof(n,`returnType`))&&this.removeReturnType():this.setReturnType(n.returnType),this}getStructure(){let t=this.getReturnTypeNode();return he(e.prototype,this,{returnType:t?t.getText({trimLeadingIndentation:!0}):void 0})}}}function fa(n){return class extends n{getScope(){let t=pa(this);if(t!=null)return t;if(V.isParameterDeclaration(this)&&this.isReadonly())return e.Scope.Public}setScope(e){return ma(this,e),this}getScopeKeyword(){return this.getModifiers().find(e=>{let t=e.getText();return t===`public`||t===`protected`||t===`private`})}hasScopeKeyword(){return this.getScopeKeyword()!=null}set(e){return ge(n.prototype,this,e),e.hasOwnProperty(t.nameof(e,`scope`))&&this.setScope(e.scope),this}getStructure(){return he(n.prototype,this,{scope:this.getScope()})}}}function pa(n){let r=n.getCombinedModifierFlags();if((r&t.ts.ModifierFlags.Private)!==0)return e.Scope.Private;if((r&t.ts.ModifierFlags.Protected)!==0)return e.Scope.Protected;if((r&t.ts.ModifierFlags.Public)!==0)return e.Scope.Public}function ma(t,n){t.toggleModifier(`public`,n===e.Scope.Public),t.toggleModifier(`protected`,n===e.Scope.Protected),t.toggleModifier(`private`,n===e.Scope.Private)}function ha(n){return class extends n{getScope(){return pa(this)||e.Scope.Public}setScope(e){return ma(this,e),this}hasScopeKeyword(){return pa(this)!=null}set(e){return ge(n.prototype,this,e),e.hasOwnProperty(t.nameof(e,`scope`))&&this.setScope(e.scope),this}getStructure(){return he(n.prototype,this,{scope:this.hasScopeKeyword()?this.getScope():void 0})}}}function ga(e){return da(sa(e))}function _a(e){return class extends e{isStatic(){return this.hasModifier(t.SyntaxKind.StaticKeyword)}getStaticKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.StaticKeyword)}getStaticKeywordOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getStaticKeyword(),e??`Expected to find a static keyword.`,this)}setIsStatic(e){return this.toggleModifier(`static`,e),this}set(t){return ge(e.prototype,this,t),t.isStatic!=null&&this.setIsStatic(t.isStatic),this}getStructure(){return he(e.prototype,this,{isStatic:this.isStatic()})}}}function va(e){return class extends e{insertText(e,t){return this.replaceText([e,e],t),this}removeText(e,t){return e==null?this.replaceText(ya(this),``):this.replaceText([e,t],``),this}replaceText(e,n){let r=this.getChildSyntaxListOrThrow(),i=ya(this),a=e[0],o=e[1];return s(),At({insertPos:a,newText:F(this._getWriter(),n),parent:r.getParentOrThrow(),replacing:{textLength:o-a,nodes:[r]}}),this;function s(){if(c(a),c(o),a>o)throw new t.errors.ArgumentError(`range`,`Cannot specify a start position greater than the end position.`)}function c(e){if(!(e>=i[0]&&e<=i[1]))throw new t.errors.InvalidOperationError(`Cannot insert or replace text outside the bounds of the node. Expected a position between [${i[0]}, ${i[1]}], but received ${e}.`)}}}}function ya(e){let n=a(),r=V.isSourceFile(n)?void 0:n.getPreviousSiblingIfKind(t.SyntaxKind.OpenBraceToken),i=r==null?void 0:n.getNextSiblingIfKind(t.SyntaxKind.CloseBraceToken);if(r!=null&&i!=null)return[r.getEnd(),i.getStart()];return[n.getPos(),n.getEnd()];function a(){return V.isSourceFile(e)?e:e.getChildSyntaxListOrThrow()}}function ba(e){return class extends e{getTypeArguments(){return this.compilerNode.typeArguments==null?[]:this.compilerNode.typeArguments.map(e=>this._getNodeFromCompilerNode(e))}addTypeArgument(e){return this.addTypeArguments([e])[0]}addTypeArguments(e){return this.insertTypeArguments(this.getTypeArguments().length,e)}insertTypeArgument(e,t){return this.insertTypeArguments(e,[t])[0]}insertTypeArguments(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=this.getTypeArguments();return e=tt(e,r.length),r.length===0?At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.Identifier).getEnd(),parent:this,newText:`<${n.join(`, `)}>`}):Mt({parent:this.getFirstChildByKindOrThrow(t.SyntaxKind.LessThanToken).getNextSiblingIfKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:r,insertIndex:e,newText:n.join(`, `),useTrailingCommas:!1}),Xe(r,this.getTypeArguments(),e,!1)}removeTypeArgument(e){let n=this.getTypeArguments();if(n.length===0)throw new t.errors.InvalidOperationError(`Cannot remove a type argument when none exist.`);let r=typeof e==`number`?i(e):e;if(n.length===1){let e=n[0].getParentSyntaxListOrThrow();Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.LessThanToken),e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.GreaterThanToken)]})}else Wt(r);return this;function i(e){return n[tt(e,n.length-1)]}}}}function xa(e){return class extends e{getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeNode(),e??`Expected to find a type node.`,this)}setType(e){let n=F(this._getWriterWithQueuedChildIndentation(),e);if(t.StringUtils.isNullOrWhitespace(n))return this.removeType();let r=this.getTypeNode();if(r!=null&&r.getText()===n)return this;let i=Sa(this),a=this.getFirstChildByKind(i),o,s;return a==null?(o=c(this),s=(i===t.SyntaxKind.EqualsToken?` = `:`: `)+n):(o=r.getStart(),s=n),At({parent:this,insertPos:o,newText:s,replacing:{textLength:r==null?0:r.getWidth()}}),this;function c(e){let n=e.getFirstChildByKind(t.SyntaxKind.Identifier)??e.getFirstChildByKind(t.SyntaxKind.ArrayBindingPattern)??e.getFirstChildIfKindOrThrow(t.SyntaxKind.ObjectBindingPattern,`A first child of the kind Identifier, ArrayBindingPattern, or ObjectBindingPattern was expected.`),r=n.getNextSibling();return(l(r)?r:n).getEnd()}function l(e){if(e==null)return!1;let n=e.getKind();return n===t.SyntaxKind.QuestionToken||n===t.SyntaxKind.ExclamationToken}}set(n){return ge(e.prototype,this,n),n.type==null?n.hasOwnProperty(t.nameof(n,`type`))&&this.removeType():this.setType(n.type),this}removeType(){if(this.getKind()===t.SyntaxKind.TypeAliasDeclaration)throw new t.errors.NotSupportedError(`Cannot remove the type of a type alias. Use ${t.nameof(`setType`)} instead.`);let e=this.getTypeNode();return e==null||Lt({children:[e.getPreviousSiblingIfKindOrThrow(Sa(this)),e],removePrecedingSpaces:!0}),this}getStructure(){let t=this.getTypeNode();return he(e.prototype,this,{type:t?t.getText({trimLeadingIndentation:!0}):void 0})}}}function Sa(e){switch(e.getKind()){case t.SyntaxKind.TypeAliasDeclaration:return t.SyntaxKind.EqualsToken;default:return t.SyntaxKind.ColonToken}}function Ca(e){return class extends e{addMember(e){return this.addMembers([e])[0]}addMembers(e){return this.insertMembers(je(this.getMembersWithComments()),e)}insertMember(e,t){return this.insertMembers(e,[t])[0]}insertMembers(e,t){return Ft({getIndexedChildren:()=>this.getMembersWithComments(),index:e,parent:this,write:e=>{e.newLineIfLastNot();let n=this._getWriter();this._context.structurePrinterFactory.forTypeElementMember().printTexts(n,t),e.write(n.toString()),e.newLineIfLastNot()}})}addConstructSignature(e){return this.addConstructSignatures([e])[0]}addConstructSignatures(e){return this.insertConstructSignatures(je(this.getMembersWithComments()),e)}insertConstructSignature(e,t){return this.insertConstructSignatures(e,[t])[0]}insertConstructSignatures(e,n){return wa({thisNode:this,index:e,structures:n,expectedKind:t.SyntaxKind.ConstructSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forConstructSignatureDeclaration()})}getConstructSignature(e){return this.getConstructSignatures().find(e)}getConstructSignatureOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getConstructSignature(e),n??`Expected to find a construct signature with the provided condition.`,this)}getConstructSignatures(){return this.compilerNode.members.filter(e=>e.kind===t.SyntaxKind.ConstructSignature).map(e=>this._getNodeFromCompilerNode(e))}addCallSignature(e){return this.addCallSignatures([e])[0]}addCallSignatures(e){return this.insertCallSignatures(je(this.getMembersWithComments()),e)}insertCallSignature(e,t){return this.insertCallSignatures(e,[t])[0]}insertCallSignatures(e,n){return wa({thisNode:this,index:e,structures:n,expectedKind:t.SyntaxKind.CallSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forCallSignatureDeclaration()})}getCallSignature(e){return this.getCallSignatures().find(e)}getCallSignatureOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getCallSignature(e),n??`Expected to find a call signature with the provided condition.`,this)}getCallSignatures(){return this.compilerNode.members.filter(e=>e.kind===t.SyntaxKind.CallSignature).map(e=>this._getNodeFromCompilerNode(e))}addIndexSignature(e){return this.addIndexSignatures([e])[0]}addIndexSignatures(e){return this.insertIndexSignatures(je(this.getMembersWithComments()),e)}insertIndexSignature(e,t){return this.insertIndexSignatures(e,[t])[0]}insertIndexSignatures(e,n){return wa({thisNode:this,index:e,structures:n,expectedKind:t.SyntaxKind.IndexSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forIndexSignatureDeclaration()})}getIndexSignature(e){return this.getIndexSignatures().find(e)}getIndexSignatureOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getIndexSignature(e),n??`Expected to find a index signature with the provided condition.`,this)}getIndexSignatures(){return this.compilerNode.members.filter(e=>e.kind===t.SyntaxKind.IndexSignature).map(e=>this._getNodeFromCompilerNode(e))}addMethod(e){return this.addMethods([e])[0]}addMethods(e){return this.insertMethods(je(this.getMembersWithComments()),e)}insertMethod(e,t){return this.insertMethods(e,[t])[0]}insertMethods(e,n){return wa({thisNode:this,index:e,structures:n,expectedKind:t.SyntaxKind.MethodSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forMethodSignature()})}getMethod(e){return s(this.getMethods(),e)}getMethodOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getMethod(e),()=>l(`interface method signature`,e))}getMethods(){return this.compilerNode.members.filter(e=>e.kind===t.SyntaxKind.MethodSignature).map(e=>this._getNodeFromCompilerNode(e))}addProperty(e){return this.addProperties([e])[0]}addProperties(e){return this.insertProperties(je(this.getMembersWithComments()),e)}insertProperty(e,t){return this.insertProperties(e,[t])[0]}insertProperties(e,n){return wa({thisNode:this,index:e,structures:n,expectedKind:t.SyntaxKind.PropertySignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forPropertySignature()})}getProperty(e){return s(this.getProperties(),e)}getPropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getProperty(e),()=>l(`interface property signature`,e))}getProperties(){return this.compilerNode.members.filter(e=>e.kind===t.SyntaxKind.PropertySignature).map(e=>this._getNodeFromCompilerNode(e))}addGetAccessor(e){return this.addGetAccessors([e])[0]}addGetAccessors(e){let t=[];for(let n of e){let e=this.getSetAccessor(n.name),r=e==null?je(this.getMembersWithComments()):e.getChildIndex();t.push(this.insertGetAccessor(r,n))}return t}insertGetAccessor(e,t){return this.insertGetAccessors(e,[t])[0]}insertGetAccessors(e,n){return wa({thisNode:this,index:e,structures:n,expectedKind:t.SyntaxKind.GetAccessor,createStructurePrinter:()=>this._context.structurePrinterFactory.forGetAccessorDeclaration({isAmbient:!0})})}getGetAccessor(e){return s(this.getGetAccessors(),e)}getGetAccessorOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getGetAccessor(e),()=>l(`interface get accessor`,e))}getGetAccessors(){return this.compilerNode.members.filter(e=>e.kind===t.SyntaxKind.GetAccessor).map(e=>this._getNodeFromCompilerNode(e))}addSetAccessor(e){return this.addSetAccessors([e])[0]}addSetAccessors(e){let t=[];for(let n of e){let e=this.getGetAccessor(n.name),r=e==null?je(this.getMembersWithComments()):e.getChildIndex()+1;t.push(this.insertSetAccessor(r,n))}return t}insertSetAccessor(e,t){return this.insertSetAccessors(e,[t])[0]}insertSetAccessors(e,n){return wa({thisNode:this,index:e,structures:n,expectedKind:t.SyntaxKind.SetAccessor,createStructurePrinter:()=>this._context.structurePrinterFactory.forSetAccessorDeclaration({isAmbient:!0})})}getSetAccessor(e){return s(this.getSetAccessors(),e)}getSetAccessorOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSetAccessor(e),()=>l(`interface set accessor`,e))}getSetAccessors(){return this.compilerNode.members.filter(e=>e.kind===t.SyntaxKind.SetAccessor).map(e=>this._getNodeFromCompilerNode(e))}getMembers(){return this.compilerNode.members.map(e=>this._getNodeFromCompilerNode(e))}getMembersWithComments(){let e=this.compilerNode;return T.getContainerArray(e,this._sourceFile.compilerNode).map(e=>this._getNodeFromCompilerNode(e))}set(t){return ge(e.prototype,this,t),t.callSignatures!=null&&(this.getCallSignatures().forEach(e=>e.remove()),this.addCallSignatures(t.callSignatures)),t.constructSignatures!=null&&(this.getConstructSignatures().forEach(e=>e.remove()),this.addConstructSignatures(t.constructSignatures)),t.indexSignatures!=null&&(this.getIndexSignatures().forEach(e=>e.remove()),this.addIndexSignatures(t.indexSignatures)),t.properties!=null&&(this.getProperties().forEach(e=>e.remove()),this.addProperties(t.properties)),t.getAccessors!=null&&(this.getGetAccessors().forEach(e=>e.remove()),this.addGetAccessors(t.getAccessors)),t.setAccessors!=null&&(this.getSetAccessors().forEach(e=>e.remove()),this.addSetAccessors(t.setAccessors)),t.methods!=null&&(this.getMethods().forEach(e=>e.remove()),this.addMethods(t.methods)),this}getStructure(){return he(e.prototype,this,{callSignatures:this.getCallSignatures().map(e=>e.getStructure()),constructSignatures:this.getConstructSignatures().map(e=>e.getStructure()),getAccessors:this.getGetAccessors().map(e=>e.getStructure()),indexSignatures:this.getIndexSignatures().map(e=>e.getStructure()),methods:this.getMethods().map(e=>e.getStructure()),properties:this.getProperties().map(e=>e.getStructure()),setAccessors:this.getSetAccessors().map(e=>e.getStructure())})}}}function wa(e){return Pt({getIndexedChildren:()=>e.thisNode.getMembersWithComments(),parent:e.thisNode,index:e.index,structures:e.structures,expectedKind:e.expectedKind,write:(t,n)=>{t.newLineIfLastNot(),e.createStructurePrinter().printTexts(t,e.structures),t.newLineIfLastNot()}})}function Ta(e){return class extends e{getTypeParameter(e){return s(this.getTypeParameters(),e)}getTypeParameterOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeParameter(e),()=>l(`type parameter`,e))}getTypeParameters(){let e=this.compilerNode.typeParameters;return e==null?[]:e.map(e=>this._getNodeFromCompilerNode(e))}addTypeParameter(e){return this.addTypeParameters([e])[0]}addTypeParameters(e){return this.insertTypeParameters(je(this.compilerNode.typeParameters),e)}insertTypeParameter(e,t){return this.insertTypeParameters(e,[t])[0]}insertTypeParameters(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=this.getTypeParameters(),i=this._getWriterWithQueuedChildIndentation(),a=this._context.structurePrinterFactory.forTypeParameterDeclaration();return e=tt(e,r.length),a.printTexts(i,n),r.length===0?At({insertPos:Ea(this),parent:this,newText:`<${i.toString()}>`}):Mt({parent:this.getFirstChildByKindOrThrow(t.SyntaxKind.LessThanToken).getNextSiblingIfKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:r,insertIndex:e,newText:i.toString(),useTrailingCommas:!1}),Xe(r,this.getTypeParameters(),e,!1)}set(t){return ge(e.prototype,this,t),t.typeParameters!=null&&(this.getTypeParameters().forEach(e=>e.remove()),this.addTypeParameters(t.typeParameters)),this}getStructure(){return he(e.prototype,this,{typeParameters:this.getTypeParameters().map(e=>e.getStructure())})}}}function Ea(e){let n=e;if(n.getNameNode!=null)return n.getNameNode().getEnd();if(V.isCallSignatureDeclaration(e)||V.isFunctionTypeNode(e))return e.getFirstChildByKindOrThrow(t.SyntaxKind.OpenParenToken).getStart();throw new t.errors.NotImplementedError(`Not implemented scenario inserting type parameters for node with kind ${e.getKindName()}.`)}function Da(e){return class extends e{unwrap(){Xt(this)}}}var Oa=class extends V{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}},ka=(e=>kn(Vi(Qi(e))))(V),Aa=class extends ka{getPropertyNameNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getPropertyNameNode(),e??`Expected to find a property name node.`,this)}getPropertyNameNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.propertyName)}},ja=class extends V{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}};function Ma(e){return class extends e{isAbstract(){return this.getAbstractKeyword()!=null}getAbstractKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.AbstractKeyword)}getAbstractKeywordOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAbstractKeyword(),e??`Expected to find an abstract keyword.`,this)}setIsAbstract(e){return this.toggleModifier(`abstract`,e),this}set(t){return ge(e.prototype,this,t),t.isAbstract!=null&&this.setIsAbstract(t.isAbstract),this}getStructure(){return he(e.prototype,this,{isAbstract:this.isAbstract()})}}}var Na=class extends V{getContextualType(){return this._context.typeChecker.getContextualType(this)}},Pa=Na,Fa=class extends Pa{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}getOperatorToken(){return this._getNodeFromCompilerNode(this.compilerNode.operatorToken)}getRight(){return this._getNodeFromCompilerNode(this.compilerNode.right)}},Ia=Fa,La=class extends Ia{getOperatorToken(){return this._getNodeFromCompilerNode(this.compilerNode.operatorToken)}},Ra=La,za=class extends Ra{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}},Ba=class extends Na{},Va=class extends Ba{},W=class extends Va{},Ha=class extends W{},Ua=class extends Ha{},Wa=class extends Ua{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}addElement(e,t){return this.addElements([e],t)[0]}addElements(e,t){return this.insertElements(this.compilerNode.elements.length,e,t)}insertElement(e,t,n){return this.insertElements(e,[t],n)[0]}insertElements(e,n,r={}){let i=this.getElements();e=tt(e,i.length);let a=l(this),o=a?this._getWriterWithChildIndentation():this._getWriterWithQueuedChildIndentation(),s=new Yr;return(a?new Un(s):new Vn(s)).printText(o,n),c(this);function c(n){return Mt({parent:n.getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:i,insertIndex:e,newText:o.toString(),useNewLines:a,useTrailingCommas:a&&n._context.manipulationSettings.getUseTrailingCommas()}),Xe(i,n.getElements(),e,!1)}function l(e){if(r.useNewLines!=null)return r.useNewLines;if(i.length>1)return t();return e.getStartLineNumber()!==e.getEndLineNumber();function t(){let e=i[0].getStartLineNumber();for(let t=1;t<i.length;t++){let n=i[t].getStartLineNumber();if(e===n)return!1;e=n}return!0}}}removeElement(e){let n=this.getElements();if(n.length===0)throw new t.errors.InvalidOperationError(`Cannot remove an element when none exist.`);Wt(typeof e==`number`?r(e):e);function r(e){return n[tt(e,n.length-1)]}}};function Ga(e){return class extends e{getExpression(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.expression)}getExpressionOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getExpression(),e??`Expected to find an expression.`,this)}getExpressionIfKind(e){let t=this.getExpression();return t?.getKind()===e?t:void 0}getExpressionIfKindOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getExpressionIfKind(e),n??`An expression with the kind kind ${t.getSyntaxKindName(e)} was expected.`,this)}}}function Ka(e){return class extends e{getExpression(){return this._getNodeFromCompilerNode(this.compilerNode.expression)}getExpressionIfKind(e){let{expression:t}=this.compilerNode;return t.kind===e?this._getNodeFromCompilerNode(t):void 0}getExpressionIfKindOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getExpressionIfKind(e),n??`An expression of the kind ${t.getSyntaxKindName(e)} was expected.`,this)}setExpression(e){return this.getExpression().replaceWithText(e,this._getWriterWithQueuedChildIndentation()),this}set(t){return ge(e.prototype,this,t),t.expression!=null&&this.setExpression(t.expression),this}}}function qa(e){return Ka(e)}function Ja(e){return Ka(e)}function Ya(e){return Ka(e)}function Xa(e){return Ka(e)}function Za(e){return Ka(e)}var Qa=(e=>xa(qa(e)))(Na),$a=class extends Qa{},eo=Za(Ba),to=class extends eo{},no=(e=>ba(on(ca(Ya(e)))))(W),ro=class extends no{getReturnType(){return this._context.typeChecker.getTypeAtLocation(this)}},io=Na,ao=class extends io{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}},oo=Na,so=class extends oo{getCondition(){return this._getNodeFromCompilerNode(this.compilerNode.condition)}getQuestionToken(){return this._getNodeFromCompilerNode(this.compilerNode.questionToken)}getWhenTrue(){return this._getNodeFromCompilerNode(this.compilerNode.whenTrue)}getColonToken(){return this._getNodeFromCompilerNode(this.compilerNode.colonToken)}getWhenFalse(){return this._getNodeFromCompilerNode(this.compilerNode.whenFalse)}},co=Za(Ba),lo=class extends co{},uo=(e=>ca(Ya(e)))(Ha),fo=class extends uo{getArgumentExpression(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.argumentExpression)}getArgumentExpressionOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getArgumentExpression(),e??`Expected to find an argument expression.`,this)}},po=Ua,mo=class extends po{},ho=Wi(Ua),go=class extends ho{},_o=ia(Ua),vo=class extends _o{getKeywordToken(){return this.compilerNode.keywordToken}},yo=(e=>ba(on(Ya(e))))(Ua),bo=class extends yo{},xo=qa(W),So=class extends xo{},Co=class extends V{remove(){Wt(this)}},wo=class extends Co{},To=La,Eo=class extends To{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}},Do=Ua,Oo=class extends Do{getPropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getProperty(e),()=>l(`property`,e))}getProperty(e){let n;return n=typeof e==`string`?n=>n[t.nameof(`getName`)]==null?!1:n.getName()===e:e,this.getProperties().find(n)}getProperties(){return this.compilerNode.properties.map(e=>this._getNodeFromCompilerNode(e))}getPropertiesWithComments(){return T.getContainerArray(this.compilerNode,this.getSourceFile().compilerNode).map(e=>this._getNodeFromCompilerNode(e))}#e(){return T.getContainerArray(this.compilerNode,this.getSourceFile().compilerNode).length}addProperty(e){return this.insertProperties(this.#e(),[e])[0]}addProperties(e){return this.insertProperties(this.#e(),e)}insertProperty(e,t){return this.insertProperties(e,[t])[0]}insertProperties(e,t){let n=this.getPropertiesWithComments();e=tt(e,n.length);let r=this._getWriterWithChildIndentation();return this._context.structurePrinterFactory.forObjectLiteralExpressionProperty().printTexts(r,t),Mt({parent:this.getChildSyntaxListOrThrow(),currentNodes:n,insertIndex:e,newText:r.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),Xe(n,this.getPropertiesWithComments(),e,!0)}addPropertyAssignment(e){return this.addPropertyAssignments([e])[0]}addPropertyAssignments(e){return this.insertPropertyAssignments(this.#e(),e)}insertPropertyAssignment(e,t){return this.insertPropertyAssignments(e,[t])[0]}insertPropertyAssignments(e,t){return this.#t(e,t,()=>this._context.structurePrinterFactory.forPropertyAssignment())}addShorthandPropertyAssignment(e){return this.addShorthandPropertyAssignments([e])[0]}addShorthandPropertyAssignments(e){return this.insertShorthandPropertyAssignments(this.#e(),e)}insertShorthandPropertyAssignment(e,t){return this.insertShorthandPropertyAssignments(e,[t])[0]}insertShorthandPropertyAssignments(e,t){return this.#t(e,t,()=>this._context.structurePrinterFactory.forShorthandPropertyAssignment())}addSpreadAssignment(e){return this.addSpreadAssignments([e])[0]}addSpreadAssignments(e){return this.insertSpreadAssignments(this.#e(),e)}insertSpreadAssignment(e,t){return this.insertSpreadAssignments(e,[t])[0]}insertSpreadAssignments(e,t){return this.#t(e,t,()=>this._context.structurePrinterFactory.forSpreadAssignment())}addMethod(e){return this.addMethods([e])[0]}addMethods(e){return this.insertMethods(this.#e(),e)}insertMethod(e,t){return this.insertMethods(e,[t])[0]}insertMethods(e,t){return this.#t(e,t,()=>this._context.structurePrinterFactory.forMethodDeclaration({isAmbient:!1}))}addGetAccessor(e){return this.addGetAccessors([e])[0]}addGetAccessors(e){return this.insertGetAccessors(this.#e(),e)}insertGetAccessor(e,t){return this.insertGetAccessors(e,[t])[0]}insertGetAccessors(e,t){return this.#t(e,t,()=>this._context.structurePrinterFactory.forGetAccessorDeclaration({isAmbient:!1}))}addSetAccessor(e){return this.addSetAccessors([e])[0]}addSetAccessors(e){return this.insertSetAccessors(this.#e(),e)}insertSetAccessor(e,t){return this.insertSetAccessors(e,[t])[0]}insertSetAccessors(e,t){return this.#t(e,t,()=>this._context.structurePrinterFactory.forSetAccessorDeclaration({isAmbient:!1}))}#t(e,n,r){e=tt(e,this.#e());let i=this._getWriterWithChildIndentation(),a=new Un(r()),o=this.getPropertiesWithComments();return a.printText(i,n),Mt({parent:this.getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:o,insertIndex:e,newText:i.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),Xe(o,this.getPropertiesWithComments(),e,!1)}},ko=(e=>Bi(la(aa(e))))(Co),Ao=class extends ko{removeInitializer(){let e=this.getInitializerOrThrow(),n=e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.ColonToken),r=this.getChildIndex(),i=this._sourceFile.getFullText(),a=this.getStart(),o=i.substring(a,n.getPos())+i.substring(e.getEnd(),this.getEnd()),s=this.getParentSyntaxList()||this.getParentOrThrow();return At({insertPos:a,newText:o,parent:s,replacing:{textLength:this.getWidth()}}),s.getChildAtIndexIfKindOrThrow(r,t.SyntaxKind.ShorthandPropertyAssignment)}setInitializer(e){let t=this.getInitializerOrThrow();return At({insertPos:t.getStart(),newText:F(this._getWriterWithQueuedChildIndentation(),e),parent:this,replacing:{textLength:t.getWidth()}}),this}set(e){if(ge(ko.prototype,this,e),e.initializer!=null)this.setInitializer(e.initializer);else if(e.hasOwnProperty(t.nameof(e,`initializer`)))return this.removeInitializer();return this}getStructure(){let t=this.getInitializerOrThrow(),n=he(ko.prototype,this,{kind:e.StructureKind.PropertyAssignment,initializer:t.getText()});return delete n.hasQuestionToken,n}},jo=(e=>Bi(la(ia(e))))(Co),Mo=class extends jo{hasObjectAssignmentInitializer(){return this.compilerNode.objectAssignmentInitializer!=null}getObjectAssignmentInitializerOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getObjectAssignmentInitializer(),e??`Expected to find an object assignment initializer.`,this)}getObjectAssignmentInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.objectAssignmentInitializer)}getEqualsTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getEqualsToken(),e??`Expected to find an equals token.`,this)}getEqualsToken(){let e=this.compilerNode.equalsToken;if(e!=null)return this._getNodeFromCompilerNode(e)}removeObjectAssignmentInitializer(){return this.hasObjectAssignmentInitializer()&&Lt({children:[this.getEqualsTokenOrThrow(),this.getObjectAssignmentInitializerOrThrow()],removePrecedingSpaces:!0}),this}setInitializer(e){let n=this.getParentSyntaxList()||this.getParentOrThrow(),r=this.getChildIndex();return At({insertPos:this.getStart(),newText:this.getText()+`: ${e}`,parent:n,replacing:{textLength:this.getWidth()}}),n.getChildAtIndexIfKindOrThrow(r,t.SyntaxKind.PropertyAssignment)}set(e){return ge(jo.prototype,this,e),this}getStructure(){let t=he(jo.prototype,this,{kind:e.StructureKind.ShorthandPropertyAssignment});return delete t.hasQuestionToken,t}getValueSymbol(){return this._context.typeChecker.getShorthandAssignmentValueSymbol(this)}getValueSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getValueSymbol(),e??`Expected to find a value symbol.`,this)}},No=qa(Co),Po=class extends No{set(e){return ge(No.prototype,this,e),this}getStructure(){return he(No.prototype,this,{kind:e.StructureKind.SpreadAssignment,expression:this.getExpression().getText()})}},Fo=Na,Io=class extends Fo{},G=qa(Na),K=class extends G{},Lo=qa(Na),Ro=class extends Lo{},zo=Ba,Bo=class extends zo{getOperatorToken(){return this.compilerNode.operator}getOperand(){return this._getNodeFromCompilerNode(this.compilerNode.operand)}},Vo=Ba,Ho=class extends Vo{getOperatorToken(){return this.compilerNode.operator}getOperand(){return this._getNodeFromCompilerNode(this.compilerNode.operand)}},Uo=(e=>ia(ca(Ya(e))))(Ha),Wo=class extends Uo{},Go=(e=>xa(qa(e)))(Na),Ko=class extends Go{},qo=qa(Na),Jo=class extends qo{},Yo=Xa(fo),Xo=class extends Yo{},Zo=Ua,Qo=class extends Zo{},$o=Xa(Wo),es=class extends $o{},ts=Ua,ns=class extends ts{},rs=(e=>xa(Za(e)))(Ba),is=class extends rs{},as=Za(Ba),os=class extends as{},ss=Za(Ba),cs=class extends ss{},ls=Ga(Ii(Na)),us=class extends ls{},ds=wn(V),fs=class extends ds{remove(){Kt(this)}};function ps(e){return class extends e{getStatements(){return(this._getCompilerStatementsContainer()?.statements??[]).map(e=>this._getNodeFromCompilerNode(e))}getStatementsWithComments(){return this._getCompilerStatementsWithComments().map(e=>this._getNodeFromCompilerNode(e))}getStatement(e){return this.getStatements().find(e)}getStatementOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getStatement(e),n??`Expected to find a statement matching the provided condition.`,this)}getStatementByKind(e){let t=this._getCompilerStatementsWithComments().find(t=>t.kind===e);return this._getNodeFromCompilerNodeIfExists(t)}getStatementByKindOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getStatementByKind(e),n??`Expected to find a statement with syntax kind ${t.getSyntaxKindName(e)}.`,this)}addStatements(e){return this.insertStatements(this._getCompilerStatementsWithComments().length,e)}insertStatements(e,n){return ms(this),r.call(this).insertChildText(e,e=>{this._context.structurePrinterFactory.forStatement({isAmbient:k(this)}).printTexts(e,n)});function r(){let e=this.getChildSyntaxListOrThrow();if(V.isCaseClause(this)||V.isDefaultClause(this)){let n=e.getFirstChildIfKind(t.SyntaxKind.Block);if(n!=null)return n.getChildSyntaxListOrThrow()}return e}}removeStatement(e){return e=tt(e,this._getCompilerStatementsWithComments().length-1),this.removeStatements([e,e])}removeStatements(e){let n=this.getStatementsWithComments();return t.errors.throwIfRangeOutOfRange(e,[0,n.length],`indexRange`),qt(n.slice(e[0],e[1]+1)),this}addClass(e){return this.addClasses([e])[0]}addClasses(e){return this.insertClasses(this._getCompilerStatementsWithComments().length,e)}insertClass(e,t){return this.insertClasses(e,[t])[0]}insertClasses(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.ClassDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forClassDeclaration({isAmbient:k(this)}).printTexts(e,n)})}})}getClasses(){return this.getStatements().filter(V.isClassDeclaration)}getClass(e){return s(this.getClasses(),e)}getClassOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getClass(e),()=>l(`class`,e))}addEnum(e){return this.addEnums([e])[0]}addEnums(e){return this.insertEnums(this._getCompilerStatementsWithComments().length,e)}insertEnum(e,t){return this.insertEnums(e,[t])[0]}insertEnums(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.EnumDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forEnumDeclaration().printTexts(e,n)})}})}getEnums(){return this.getStatements().filter(V.isEnumDeclaration)}getEnum(e){return s(this.getEnums(),e)}getEnumOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getEnum(e),()=>l(`enum`,e))}addFunction(e){return this.addFunctions([e])[0]}addFunctions(e){return this.insertFunctions(this._getCompilerStatementsWithComments().length,e)}insertFunction(e,t){return this.insertFunctions(e,[t])[0]}insertFunctions(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.FunctionDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forFunctionDeclaration({isAmbient:k(this)}).printTexts(e,n)},{previousNewLine:e=>n[0].hasDeclareKeyword===!0&&V.isFunctionDeclaration(e)&&e.getBody()==null,nextNewLine:e=>n[n.length-1].hasDeclareKeyword===!0&&V.isFunctionDeclaration(e)&&e.getBody()==null})}})}getFunctions(){return this.getStatements().filter(V.isFunctionDeclaration).filter(e=>e.isAmbient()||e.isImplementation())}getFunction(e){return s(this.getFunctions(),e)}getFunctionOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getFunction(e),()=>l(`function`,e))}addInterface(e){return this.addInterfaces([e])[0]}addInterfaces(e){return this.insertInterfaces(this._getCompilerStatementsWithComments().length,e)}insertInterface(e,t){return this.insertInterfaces(e,[t])[0]}insertInterfaces(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.InterfaceDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forInterfaceDeclaration().printTexts(e,n)})}})}getInterfaces(){return this.getStatements().filter(V.isInterfaceDeclaration)}getInterface(e){return s(this.getInterfaces(),e)}getInterfaceOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInterface(e),()=>l(`interface`,e))}addModule(e){return this.addModules([e])[0]}addModules(e){return this.insertModules(this._getCompilerStatementsWithComments().length,e)}insertModule(e,t){return this.insertModules(e,[t])[0]}insertModules(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.ModuleDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forModuleDeclaration({isAmbient:k(this)}).printTexts(e,n)})}})}getModules(){return this.getStatements().filter(V.isModuleDeclaration)}getModule(e){return s(this.getModules(),e)}getModuleOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getModule(e),()=>l(`module`,e))}addTypeAlias(e){return this.addTypeAliases([e])[0]}addTypeAliases(e){return this.insertTypeAliases(this._getCompilerStatementsWithComments().length,e)}insertTypeAlias(e,t){return this.insertTypeAliases(e,[t])[0]}insertTypeAliases(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.TypeAliasDeclaration,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forTypeAliasDeclaration().printTexts(e,n)},{previousNewLine:e=>V.isTypeAliasDeclaration(e),nextNewLine:e=>V.isTypeAliasDeclaration(e)})}})}getTypeAliases(){return this.getStatements().filter(V.isTypeAliasDeclaration)}getTypeAlias(e){return s(this.getTypeAliases(),e)}getTypeAliasOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeAlias(e),()=>l(`type alias`,e))}getVariableStatements(){return this.getStatements().filter(V.isVariableStatement)}getVariableStatement(e){return this.getVariableStatements().find(t());function t(){return typeof e==`string`?t=>t.getDeclarations().some(t=>c(t,e)):e}}getVariableStatementOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getVariableStatement(e),n??`Expected to find a variable statement that matched the provided condition.`,this)}addVariableStatement(e){return this.addVariableStatements([e])[0]}addVariableStatements(e){return this.insertVariableStatements(this._getCompilerStatementsWithComments().length,e)}insertVariableStatement(e,t){return this.insertVariableStatements(e,[t])[0]}insertVariableStatements(e,n){return this._insertChildren({expectedKind:t.SyntaxKind.VariableStatement,index:e,structures:n,write:(e,t)=>{this._standardWrite(e,t,()=>{this._context.structurePrinterFactory.forVariableStatement().printTexts(e,n)},{previousNewLine:e=>V.isVariableStatement(e),nextNewLine:e=>V.isVariableStatement(e)})}})}getVariableDeclarations(){let e=[];for(let t of this.getVariableStatements())e.push(...t.getDeclarations());return e}getVariableDeclaration(e){return s(this.getVariableDeclarations(),e)}getVariableDeclarationOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getVariableDeclaration(e),()=>l(`variable declaration`,e))}getStructure(){let t={};return V.isBodyable(this)&&!this.hasBody()?t.statements=void 0:t.statements=this.getStatements().map(e=>V._hasStructure(e)?e.getStructure():e.getText({trimLeadingIndentation:!0})),he(e.prototype,this,t)}set(n){if(V.isBodyable(this)&&n.statements==null&&n.hasOwnProperty(t.nameof(n,`statements`)))this.removeBody();else if(n.statements!=null){let e=this._getCompilerStatementsWithComments().length;e>0&&this.removeStatements([0,e-1])}return ge(e.prototype,this,n),n.statements!=null&&this.addStatements(n.statements),this}_getCompilerStatementsWithComments(){let e=this._getCompilerStatementsContainer();return e==null?[]:T.getContainerArray(e,this._sourceFile.compilerNode)}_getCompilerStatementsContainer(){if(V.isSourceFile(this)||V.isCaseClause(this)||V.isDefaultClause(this))return this.compilerNode;if(V.isModuleDeclaration(this))return this._getInnerBody()?.compilerNode;if(V.isBodyable(this)||V.isBodied(this))return this.getBody()?.compilerNode;if(V.isBlock(this)||V.isModuleBlock(this))return this.compilerNode;throw new t.errors.NotImplementedError(`Could not find the statements for node kind: ${this.getKindName()}, text: ${this.getText()}`)}_insertChildren(e){return ms(this),Pt({expectedKind:e.expectedKind,getIndexedChildren:()=>this.getStatementsWithComments(),index:e.index,parent:this,structures:e.structures,write:(t,n)=>e.write(t,n)})}_standardWrite(e,t,n,r={}){t.previousMember!=null&&(r.previousNewLine==null||!r.previousNewLine(t.previousMember))&&!V.isCommentNode(t.previousMember)?e.blankLine():t.isStartOfFile||e.newLineIfLastNot(),n(),t.nextMember!=null&&(r.nextNewLine==null||!r.nextNewLine(t.nextMember))?e.blankLine():e.newLineIfLastNot()}}}function ms(e){V.isBodyable(e)&&!e.hasBody()&&e.addBody()}var hs=(e=>va(ps(e)))(fs),gs=class extends hs{},_s=class extends fs{getLabel(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.label)}getLabelOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLabel(),e??`Expected to find a label.`,this)}},vs=va(V),ys=class extends vs{getClauses(){return(this.compilerNode.clauses||[]).map(e=>this._getNodeFromCompilerNode(e))}removeClause(e){return e=tt(e,this.getClauses().length-1),this.removeClauses([e,e])}removeClauses(e){let n=this.getClauses();return t.errors.throwIfRangeOutOfRange(e,[0,n.length],`indexRange`),Yt(n.slice(e[0],e[1]+1)),this}},bs=(e=>Ui(qa(va(ps(e)))))(V),xs=class extends bs{remove(){Jt(this)}},Ss=V,Cs=class extends Ss{getBlock(){return this._getNodeFromCompilerNode(this.compilerNode.block)}getVariableDeclaration(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.variableDeclaration)}getVariableDeclarationOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getVariableDeclaration(),e??`Expected to find a variable declaration.`,this)}},ws=class extends fs{},Ts=class extends fs{getLabel(){return this.compilerNode.label==null?void 0:this._getNodeFromCompilerNode(this.compilerNode.label)}getLabelOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLabel(),e??`Expected to find a label.`,this)}},Es=fs,Ds=class extends Es{},Os=(e=>va(ps(e)))(V),ks=class extends Os{remove(){Jt(this)}},As=class extends fs{getStatement(){return this._getNodeFromCompilerNode(this.compilerNode.statement)}},js=qa(As),Ms=class extends js{},Ns=fs,Ps=class extends Ns{},Fs=qa(Ui(fs)),Is=class extends Fs{},Ls=qa(As),Rs=class extends Ls{getInitializer(){return this._getNodeFromCompilerNode(this.compilerNode.initializer)}},zs=qa(cn(As)),Bs=class extends zs{getInitializer(){return this._getNodeFromCompilerNode(this.compilerNode.initializer)}},Vs=As,Hs=class extends Vs{getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}getInitializerOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInitializer(),e??`Expected to find an initializer.`,this)}getCondition(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.condition)}getConditionOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getCondition(),e??`Expected to find a condition.`,this)}getIncrementor(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.incrementor)}getIncrementorOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getIncrementor(),e??`Expected to find an incrementor.`,this)}},Us=qa(fs),Ws=class extends Us{getThenStatement(){return this._getNodeFromCompilerNode(this.compilerNode.thenStatement)}getElseStatement(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.elseStatement)}remove(){let e=[];V.isIfStatement(this.getParentOrThrow())&&e.push(this.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.ElseKeyword)),e.push(this),qt(e)}},Gs=Ui(fs),Ks=class extends Gs{getLabel(){return this._getNodeFromCompilerNode(this.compilerNode.label)}getStatement(){return this._getNodeFromCompilerNode(this.compilerNode.statement)}},qs=fs,Js=class extends qs{},Ys=Ga(fs),Xs=class extends Ys{},Zs=qa(fs),Qs=class extends Zs{getCaseBlock(){return this._getNodeFromCompilerNode(this.compilerNode.caseBlock)}getClauses(){return this.getCaseBlock().getClauses()}removeClause(e){return this.getCaseBlock().removeClause(e)}removeClauses(e){return this.getCaseBlock().removeClauses(e)}},$s=qa(fs),ec=class extends $s{},tc=fs,nc=class extends tc{getTryBlock(){return this._getNodeFromCompilerNode(this.compilerNode.tryBlock)}getCatchClause(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.catchClause)}getCatchClauseOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getCatchClause(),e??`Expected to find a catch clause.`,this)}getFinallyBlock(){if(!(this.compilerNode.finallyBlock==null||this.compilerNode.finallyBlock.getFullWidth()===0))return this._getNodeFromCompilerNode(this.compilerNode.finallyBlock)}getFinallyBlockOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getFinallyBlock(),e??`Expected to find a finally block.`,this)}},rc=qa(Ui(fs)),ic=class extends rc{isExportEquals(){return this.compilerNode.isExportEquals||!1}setIsExportEquals(e){return this.isExportEquals()===e||(e?this.getFirstChildByKindOrThrow(t.SyntaxKind.DefaultKeyword).replaceWithText(`=`):this.getFirstChildByKindOrThrow(t.SyntaxKind.EqualsToken).replaceWithText(`default`)),this}set(e){return ge(rc.prototype,this,e),e.expression!=null&&this.setExpression(e.expression),e.isExportEquals!=null&&this.setIsExportEquals(e.isExportEquals),this}getStructure(){return he(fs.prototype,this,{kind:e.StructureKind.ExportAssignment,expression:this.getExpression().getText(),isExportEquals:this.isExportEquals()})}},ac=fs,oc=class extends ac{isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(e){return this.isTypeOnly()===e||(e?At({parent:this,insertPos:(this.getNodeProperty(`exportClause`)??this.getFirstChildByKindOrThrow(t.SyntaxKind.AsteriskToken)).getStart(),newText:`type `}):Lt({children:[this.getFirstChildByKindOrThrow(t.ts.SyntaxKind.TypeKeyword)],removeFollowingSpaces:!0})),this}getNamespaceExport(){let e=this.getNodeProperty(`exportClause`);return e!=null&&V.isNamespaceExport(e)?e:void 0}getNamespaceExportOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNamespaceExport(),e??`Expected to find a namespace export.`,this)}setNamespaceExport(e){let n=this.getNodeProperty(`exportClause`),r=t.StringUtils.isNullOrWhitespace(e)?`*`:`* as ${e}`;return n==null?At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.AsteriskToken).getStart(),parent:this,newText:r,replacing:{textLength:1}}):V.isNamespaceExport(n)?n.getNameNode().replaceWithText(e):At({insertPos:n.getStart(),parent:this,newText:r,replacing:{textLength:n.getWidth()}}),this}setModuleSpecifier(e){let n=typeof e==`string`?e:this._sourceFile.getRelativePathAsModuleSpecifierTo(e);if(t.StringUtils.isNullOrEmpty(n))return this.removeModuleSpecifier(),this;let r=this.getModuleSpecifier();if(r==null){let e=this.getLastChildIfKind(t.SyntaxKind.SemicolonToken),r=this._context.manipulationSettings.getQuoteKind();At({insertPos:e==null?this.getEnd():e.getPos(),parent:this,newText:` from ${r}${n}${r}`})}else r.setLiteralValue(n);return this}getModuleSpecifier(){let e=this._getNodeFromCompilerNodeIfExists(this.compilerNode.moduleSpecifier);if(e!=null){if(!V.isStringLiteral(e))throw new t.errors.InvalidOperationError(`Expected the module specifier to be a string literal.`);return e}}getModuleSpecifierValue(){return this.getModuleSpecifier()?.getLiteralValue()}getModuleSpecifierSourceFileOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getModuleSpecifierSourceFile(),e??`A module specifier source file was expected.`,this)}getModuleSpecifierSourceFile(){let e=this.getLastChildByKind(t.SyntaxKind.StringLiteral);if(e==null)return;let n=e.getSymbol();if(n==null)return;let r=n.getDeclarations()[0];return r!=null&&V.isSourceFile(r)?r:void 0}isModuleSpecifierRelative(){let e=this.getModuleSpecifierValue();return e==null?!1:re.isModuleSpecifierRelative(e)}removeModuleSpecifier(){let e=this.getModuleSpecifier();if(e==null)return this;if(!this.hasNamedExports())throw new t.errors.InvalidOperationError(`Cannot remove the module specifier from an export declaration that has no named exports.`);return Lt({children:[this.getFirstChildByKindOrThrow(t.SyntaxKind.FromKeyword),e],removePrecedingNewLines:!0,removePrecedingSpaces:!0}),this}hasModuleSpecifier(){return this.getLastChildByKind(t.SyntaxKind.StringLiteral)!=null}isNamespaceExport(){return!this.hasNamedExports()}hasNamedExports(){return this.compilerNode.exportClause?.kind===t.SyntaxKind.NamedExports}addNamedExport(e){return this.addNamedExports([e])[0]}addNamedExports(e){return this.insertNamedExports(this.getNamedExports().length,e)}insertNamedExport(e,t){return this.insertNamedExports(e,[t])[0]}insertNamedExports(e,n){if(!(n instanceof Function)&&t.ArrayUtils.isNullOrEmpty(n))return[];let r=this.getNamedExports(),i=this._getWriterWithIndentation(),a=this._context.structurePrinterFactory.forNamedImportExportSpecifier();e=tt(e,r.length);let o=this.getNodeProperty(`exportClause`);return o==null?(a.printTextsWithBraces(i,n),At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.AsteriskToken).getStart(),parent:this,newText:i.toString(),replacing:{textLength:1}})):o.getKind()===t.SyntaxKind.NamespaceExport?(a.printTextsWithBraces(i,n),At({insertPos:o.getStart(),parent:this,newText:i.toString(),replacing:{textLength:o.getWidth()}})):(a.printTexts(i,n),Mt({parent:this.getFirstChildByKindOrThrow(t.SyntaxKind.NamedExports).getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:r,insertIndex:e,newText:i.toString(),surroundWithSpaces:this._context.getFormatCodeSettings().insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces,useTrailingCommas:!1})),Xe(r,this.getNamedExports(),e,!1)}getNamedExports(){let e=this.compilerNode.exportClause;return e==null||t.ts.isNamespaceExport(e)?[]:e.elements.map(e=>this._getNodeFromCompilerNode(e))}toNamespaceExport(){if(!this.hasModuleSpecifier())throw new t.errors.InvalidOperationError(`Cannot change to a namespace export when no module specifier exists.`);let e=this.getNodeProperty(`exportClause`);return e==null||At({parent:this,newText:`*`,insertPos:e.getStart(),replacing:{textLength:e.getWidth()}}),this}setAttributes(e){let t=this.getAttributes();if(t)e?t.setElements(e):t.remove();else if(e){let t=this._context.structurePrinterFactory.forImportAttribute(),n=this._context.createWriter();n.space(),t.printAttributes(n,e),At({parent:this,newText:n.toString(),insertPos:this.getSourceFile().getFullText()[this.getEnd()-1]===`;`?this.getEnd()-1:this.getEnd()})}return this}getAttributes(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes)}set(e){return ge(ac.prototype,this,e),e.namedExports==null?e.hasOwnProperty(t.nameof(e,`namedExports`))&&e.moduleSpecifier==null&&this.toNamespaceExport():(sc(this),this.addNamedExports(e.namedExports)),e.moduleSpecifier==null?e.hasOwnProperty(t.nameof(e,`moduleSpecifier`))&&this.removeModuleSpecifier():this.setModuleSpecifier(e.moduleSpecifier),e.namedExports==null&&e.hasOwnProperty(t.nameof(e,`namedExports`))&&this.toNamespaceExport(),e.namespaceExport!=null&&this.setNamespaceExport(e.namespaceExport),e.isTypeOnly!=null&&this.setIsTypeOnly(e.isTypeOnly),e.hasOwnProperty(t.nameof(e,`attributes`))&&this.setAttributes(e.attributes),this}getStructure(){let t=this.getModuleSpecifier(),n=this.getAttributes();return he(ac.prototype,this,{kind:e.StructureKind.ExportDeclaration,isTypeOnly:this.isTypeOnly(),moduleSpecifier:t?.getLiteralText(),namedExports:this.getNamedExports().map(e=>e.getStructure()),namespaceExport:this.getNamespaceExport()?.getName(),attributes:n?n.getElements().map(e=>e.getStructure()):void 0})}};function sc(e){let n=e.getNodeProperty(`exportClause`),r;if(n!=null){if(e.getNamedExports().length===0)return;r=n}else r=e.getFirstChildByKindOrThrow(t.SyntaxKind.AsteriskToken);At({parent:e,newText:`{ }`,insertPos:r.getStart(),replacing:{textLength:r.getWidth()}})}var cc=V,lc=class extends cc{setName(e){let t=this.getNameNode();return this.getName()===e||(le(e)?t.replaceWithText(e):t.replaceWithText(`"${e.replaceAll(`"`,`\\"`)}"`)),this}getName(){let e=this.getNameNode();return e.getKind()===t.ts.SyntaxKind.StringLiteral?e.getLiteralText():e.getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.propertyName||this.compilerNode.name)}renameAlias(e){if(t.StringUtils.isNullOrWhitespace(e))return this.removeAliasWithRename(),this;let n=this.getAliasNode();return n??=(this.setAlias(this.getName()),this.getAliasNode()),n.getKind()===t.SyntaxKind.Identifier&&n.rename(e),this}setAlias(e){if(t.StringUtils.isNullOrWhitespace(e))return this.removeAlias(),this;let n=this.getAliasNode();return n==null?At({insertPos:this.getNameNode().getEnd(),parent:this,newText:` as ${e}`}):le(e)?n.replaceWithText(e):n.replaceWithText(`"${e.replaceAll(`"`,`\\"`)}"`),this}removeAlias(){let e=this.getAliasNode();return e==null||Lt({children:[this.getFirstChildByKindOrThrow(t.SyntaxKind.AsKeyword),e],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this}removeAliasWithRename(){let e=this.getAliasNode();return e==null?this:(e.getKind()===t.SyntaxKind.Identifier&&e.rename(this.getName()),this.removeAlias(),this)}getAliasNode(){if(this.compilerNode.propertyName!=null)return this._getNodeFromCompilerNode(this.compilerNode.name)}isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(e){return this.isTypeOnly()===e||(e?At({insertPos:this.getStart(),parent:this,newText:`type `}):Lt({children:[this.getFirstChildByKindOrThrow(t.ts.SyntaxKind.TypeKeyword)],removeFollowingSpaces:!0})),this}getExportDeclaration(){return this.getFirstAncestorByKindOrThrow(t.SyntaxKind.ExportDeclaration)}getLocalTargetSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLocalTargetSymbol(),e??`The export specifier's local target symbol was expected.`,this)}getLocalTargetSymbol(){return this._context.typeChecker.getExportSpecifierLocalTargetSymbol(this)}getLocalTargetDeclarations(){return this.getLocalTargetSymbol()?.getDeclarations()??[]}remove(){let e=this.getExportDeclaration();e.getNamedExports().length>1||e.getNamespaceExport()==null?Wt(this):e.toNamespaceExport()}set(e){return ge(cc.prototype,this,e),e.isTypeOnly!=null&&this.setIsTypeOnly(e.isTypeOnly),e.name!=null&&this.setName(e.name),e.alias==null?e.hasOwnProperty(t.nameof(e,`alias`))&&this.removeAlias():this.setAlias(e.alias),this}getStructure(){let t=this.getAliasNode();return he(V.prototype,this,{kind:e.StructureKind.ExportSpecifier,alias:t?t.getText():void 0,name:this.getNameNode().getText(),isTypeOnly:this.isTypeOnly()})}},uc=Ga(V),dc=class extends uc{getReferencedSourceFileOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getReferencedSourceFile(),e??`Expected to find the referenced source file.`,this)}isRelative(){let e=this.getExpression();return e==null||!V.isStringLiteral(e)?!1:re.isModuleSpecifierRelative(e.getLiteralText())}getReferencedSourceFile(){let e=this.getExpression();if(e==null)return;let t=e.getSymbol();if(t!=null)return re.getReferencedSourceFileFromSymbol(t)}},fc=$i(V),pc=class extends fc{getValue(){return this._getNodeFromCompilerNode(this.compilerNode.value)}set(e){return ge(fc.prototype,this,e),e.value&&this.getValue().replaceWithText(e.value),this}getStructure(){return he(fc.prototype,this,{kind:e.StructureKind.ImportAttribute,value:this.getValue().getText()})}},mc=V,hc=class extends mc{setElements(e){return this.replaceWithText(t=>{this._context.structurePrinterFactory.forImportAttribute().printAttributes(t,e)}),this}getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}remove(){Lt({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}},gc=V,_c=class extends gc{isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(e){return this.isTypeOnly()===e||(e?At({parent:this,insertPos:this.getStart(),newText:`type `}):Lt({children:[this.getFirstChildByKindOrThrow(t.ts.SyntaxKind.TypeKeyword)],removeFollowingSpaces:!0})),this}getDefaultImportOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefaultImport(),e??`Expected to find a default import.`,this)}getDefaultImport(){return this.getNodeProperty(`name`)}getNamedBindingsOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNamedBindings(),e??`Expected to find an import declaration's named bindings.`,this)}getNamedBindings(){return this.getNodeProperty(`namedBindings`)}getNamespaceImportOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNamespaceImport(),e??`Expected to find a namespace import.`,this)}getNamespaceImport(){let e=this.getNamedBindings();if(!(e==null||!V.isNamespaceImport(e)))return e.getNameNode()}getNamedImports(){let e=this.getNamedBindings();return e==null||!V.isNamedImports(e)?[]:e.getElements()}},vc=fs,yc=class extends vc{isTypeOnly(){return this.getImportClause()?.isTypeOnly()??!1}setIsTypeOnly(e){let n=this.getImportClause();if(n==null){if(e)throw new t.errors.InvalidOperationError(`Cannot set an import as type only when there is no import clause.`);return this}return n.setIsTypeOnly(e),this}setModuleSpecifier(e){let t=typeof e==`string`?e:this._sourceFile.getRelativePathAsModuleSpecifierTo(e);return this.getModuleSpecifier().setLiteralValue(t),this}getModuleSpecifier(){let e=this._getNodeFromCompilerNode(this.compilerNode.moduleSpecifier);if(!V.isStringLiteral(e))throw new t.errors.InvalidOperationError(`Expected the module specifier to be a string literal.`);return e}getModuleSpecifierValue(){return this.getModuleSpecifier().getLiteralValue()}getModuleSpecifierSourceFileOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getModuleSpecifierSourceFile(),e??`A module specifier source file was expected.`,this)}getModuleSpecifierSourceFile(){let e=this.getModuleSpecifier().getSymbol();if(e!=null)return re.getReferencedSourceFileFromSymbol(e)}isModuleSpecifierRelative(){return re.isModuleSpecifierRelative(this.getModuleSpecifierValue())}setDefaultImport(e){if(t.StringUtils.isNullOrWhitespace(e))return this.removeDefaultImport();let n=this.getDefaultImport();if(n!=null)return n.replaceWithText(e),this;let r=this.getFirstChildByKindOrThrow(t.SyntaxKind.ImportKeyword),i=this.getImportClause();return i==null?(At({insertPos:r.getEnd(),parent:this,newText:` ${e} from`}),this):(At({insertPos:r.getEnd(),parent:i,newText:` ${e},`}),this)}renameDefaultImport(e){if(t.StringUtils.isNullOrWhitespace(e))return this.removeDefaultImport();let n=this.getDefaultImport();return n==null?(this.setDefaultImport(e),this):(n.rename(e),this)}getDefaultImportOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefaultImport(),e??`Expected to find a default import.`,this)}getDefaultImport(){return this.getImportClause()?.getDefaultImport()??void 0}setNamespaceImport(e){if(t.StringUtils.isNullOrWhitespace(e))return this.removeNamespaceImport();let n=this.getNamespaceImport();if(n!=null)return n.rename(e),this;if(this.getNamedImports().length>0)throw new t.errors.InvalidOperationError(`Cannot add a namespace import to an import declaration that has named imports.`);let r=this.getDefaultImport();return r==null?(At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.ImportKeyword).getEnd(),parent:this,newText:` * as ${e} from`}),this):(At({insertPos:r.getEnd(),parent:this.getImportClause(),newText:`, * as ${e}`}),this)}removeNamespaceImport(){let e=this.getNamespaceImport();if(e==null)return this;return Lt({children:n.call(this),removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this;function n(){let n=this.getDefaultImport();return n==null?[this.getImportClauseOrThrow(),this.getLastChildByKindOrThrow(t.SyntaxKind.FromKeyword)]:[n.getNextSiblingIfKindOrThrow(t.SyntaxKind.CommaToken),e]}}removeDefaultImport(){let e=this.getImportClause();if(e==null)return this;let n=e.getDefaultImport();return n==null||(e.getNamedBindings()==null?e.isTypeOnly()?At({parent:e,newText:`{}`,insertPos:n.getStart(),replacing:{textLength:n.getWidth()}}):Lt({children:[e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.FromKeyword)],removePrecedingSpaces:!0,removePrecedingNewLines:!0}):Lt({children:[n,n.getNextSiblingIfKindOrThrow(t.SyntaxKind.CommaToken)],removePrecedingSpaces:!0,removePrecedingNewLines:!0})),this}getNamespaceImportOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNamespaceImport(),e??`Expected to find a namespace import.`,this)}getNamespaceImport(){return this.getImportClause()?.getNamespaceImport()??void 0}addNamedImport(e){return this.addNamedImports([e])[0]}addNamedImports(e){return this.insertNamedImports(this.getNamedImports().length,e)}insertNamedImport(e,t){return this.insertNamedImports(e,[t])[0]}insertNamedImports(e,n){if(!(n instanceof Function)&&t.ArrayUtils.isNullOrEmpty(n))return[];let r=this.getNamedImports(),i=this._getWriterWithQueuedIndentation(),a=this._context.structurePrinterFactory.forNamedImportExportSpecifier(),o=this.getImportClause();if(e=tt(e,r.length),r.length===0)if(a.printTextsWithBraces(i,n),o==null)At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.ImportKeyword).getEnd(),parent:this,newText:` ${i.toString()} from`});else if(this.getNamespaceImport()!=null)throw xc();else if(o.getNamedBindings()!=null){let e=o.getNamedBindingsOrThrow();At({insertPos:e.getStart(),replacing:{textLength:e.getWidth()},parent:o,newText:i.toString()})}else At({insertPos:this.getDefaultImport().getEnd(),parent:o,newText:`, ${i.toString()}`});else{if(o==null)throw new t.errors.NotImplementedError(`Expected to have an import clause.`);a.printTexts(i,n),Mt({parent:o.getFirstChildByKindOrThrow(t.SyntaxKind.NamedImports).getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:r,insertIndex:e,newText:i.toString(),surroundWithSpaces:this._context.getFormatCodeSettings().insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces,useTrailingCommas:!1})}return Xe(r,this.getNamedImports(),e,!1)}getNamedImports(){return this.getImportClause()?.getNamedImports()??[]}removeNamedImports(){let e=this.getImportClause();if(e==null)return this;let n=e.getNamedBindings();if(n==null||n.getKind()!==t.SyntaxKind.NamedImports)return this;let r=this.getDefaultImport();return r==null?(Lt({children:[e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.FromKeyword)],removePrecedingSpaces:!0}),this):(Lt({children:[r.getNextSiblingIfKindOrThrow(t.SyntaxKind.CommaToken),n]}),this)}getImportClauseOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getImportClause(),e??`Expected to find an import clause.`,this)}getImportClause(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.importClause)}setAttributes(e){let t=this.getAttributes();if(t)e?t.setElements(e):t.remove();else if(e){let t=this._context.structurePrinterFactory.forImportAttribute(),n=this._context.createWriter();n.space(),t.printAttributes(n,e),At({parent:this,newText:n.toString(),insertPos:this.getSourceFile().getFullText()[this.getEnd()-1]===`;`?this.getEnd()-1:this.getEnd()})}return this}getAttributes(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes)}set(e){return ge(vc.prototype,this,e),e.defaultImport==null?e.hasOwnProperty(t.nameof(e,`defaultImport`))&&this.removeDefaultImport():this.setDefaultImport(e.defaultImport),e.hasOwnProperty(t.nameof(e,`namedImports`))&&this.removeNamedImports(),e.namespaceImport==null?e.hasOwnProperty(t.nameof(e,`namespaceImport`))&&this.removeNamespaceImport():this.setNamespaceImport(e.namespaceImport),e.namedImports!=null&&(bc(this),this.addNamedImports(e.namedImports)),e.moduleSpecifier!=null&&this.setModuleSpecifier(e.moduleSpecifier),e.isTypeOnly!=null&&this.setIsTypeOnly(e.isTypeOnly),e.hasOwnProperty(t.nameof(e,`attributes`))&&this.setAttributes(e.attributes),this}getStructure(){let t=this.getNamespaceImport(),n=this.getDefaultImport(),r=this.getAttributes();return he(vc.prototype,this,{kind:e.StructureKind.ImportDeclaration,isTypeOnly:this.isTypeOnly(),defaultImport:n?n.getText():void 0,moduleSpecifier:this.getModuleSpecifier().getLiteralText(),namedImports:this.getNamedImports().map(e=>e.getStructure()),namespaceImport:t?t.getText():void 0,attributes:r?r.getElements().map(e=>e.getStructure()):void 0})}};function bc(e){let n=e.getNodeProperty(`importClause`),r=e._getWriterWithQueuedChildIndentation();e._context.structurePrinterFactory.forNamedImportExportSpecifier().printTextsWithBraces(r,[]);let i=r.toString();if(e.getNamespaceImport()!=null)throw xc();if(n==null){At({insertPos:e.getFirstChildByKindOrThrow(t.SyntaxKind.ImportKeyword).getEnd(),parent:e,newText:` ${i} from`});return}let a=n.getNamedBindings();if(a!=null){At({parent:n,newText:i,insertPos:a.getStart(),replacing:{textLength:a.getWidth()}});return}let o=n.getDefaultImport();if(o!=null){At({insertPos:o.getEnd(),parent:n,newText:`, ${i}`});return}}function xc(){return new t.errors.InvalidOperationError(`Cannot add a named import to an import declaration that has a namespace import.`)}var Sc=(e=>Nn(Gi(Ui(ia(e)))))(fs),Cc=class extends Sc{isTypeOnly(){return this.compilerNode.isTypeOnly??!1}setIsTypeOnly(e){return this.isTypeOnly()===e||(e?At({parent:this,insertPos:this.getNameNode().getStart(),newText:`type `}):Lt({children:[this.getFirstChildByKindOrThrow(t.ts.SyntaxKind.TypeKeyword)],removeFollowingSpaces:!0})),this}getModuleReference(){return this._getNodeFromCompilerNode(this.compilerNode.moduleReference)}isExternalModuleReferenceRelative(){let e=this.getModuleReference();return V.isExternalModuleReference(e)?e.isRelative():!1}setExternalModuleReference(e){let t=typeof e==`string`?e:this._sourceFile.getRelativePathAsModuleSpecifierTo(e),n=this.getModuleReference();return V.isExternalModuleReference(n)&&n.getExpression()!=null?n.getExpressionOrThrow().replaceWithText(e=>e.quote(t)):n.replaceWithText(e=>e.write(`require(`).quote(t).write(`)`)),this}getExternalModuleReferenceSourceFileOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getExternalModuleReferenceSourceFile(),e??`Expected to find an external module reference's referenced source file.`,this)}getExternalModuleReferenceSourceFile(){let e=this.getModuleReference();if(V.isExternalModuleReference(e))return e.getReferencedSourceFile()}},wc=V,Tc=class extends wc{setName(e){let t=this.getNameNode();return this.getName()===e||(le(e)?t.replaceWithText(e):t.replaceWithText(`"${e.replaceAll(`"`,`\\"`)}"`)),this}getName(){let e=this.getNameNode();return e.getKind()===t.ts.SyntaxKind.StringLiteral?e.getLiteralText():e.getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.propertyName??this.compilerNode.name)}renameAlias(e){if(t.StringUtils.isNullOrWhitespace(e))return this.removeAliasWithRename(),this;let n=this.getAliasNode();return n??=(this.setAlias(this.getName()),this.getAliasNode()),n.rename(e),this}setAlias(e){if(t.StringUtils.isNullOrWhitespace(e))return this.removeAlias(),this;let n=this.getAliasNode();return n==null?At({insertPos:this.getNameNode().getEnd(),parent:this,newText:` as ${e}`}):n.replaceWithText(e),this}removeAlias(){let e=this.getAliasNode();return e==null||Lt({children:[this.getFirstChildByKindOrThrow(t.SyntaxKind.AsKeyword),e],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this}removeAliasWithRename(){let e=this.getAliasNode();return e==null?this:(e.rename(this.getName()),this.removeAlias(),this)}getAliasNode(){if(this.compilerNode.propertyName!=null)return this._getNodeFromCompilerNode(this.compilerNode.name)}isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(e){return this.isTypeOnly()===e||(e?At({insertPos:this.getStart(),parent:this,newText:`type `}):Lt({children:[this.getFirstChildByKindOrThrow(t.ts.SyntaxKind.TypeKeyword)],removeFollowingSpaces:!0})),this}getImportDeclaration(){return this.getFirstAncestorByKindOrThrow(t.SyntaxKind.ImportDeclaration)}remove(){let e=this.getImportDeclaration();e.getNamedImports().length>1||e.getNamespaceImport()==null&&e.getDefaultImport()==null?Wt(this):e.removeNamedImports()}set(e){return ge(wc.prototype,this,e),e.isTypeOnly!=null&&this.setIsTypeOnly(e.isTypeOnly),e.name!=null&&this.setName(e.name),e.alias==null?e.hasOwnProperty(t.nameof(e,`alias`))&&this.removeAlias():this.setAlias(e.alias),this}getStructure(){let t=this.getAliasNode();return he(wc.prototype,this,{kind:e.StructureKind.ImportSpecifier,name:this.getName(),alias:t?t.getText():void 0,isTypeOnly:this.isTypeOnly()})}},Ec=ps(fs),Dc=class extends Ec{};function Oc(e){return class extends e{getParentModuleOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getParentModule(),e??`Expected to find the parent module declaration.`,this)}getParentModule(){let e=this.getParentOrThrow();if(V.isModuleBlock(e)){for(;e.getParentOrThrow().getKind()===t.SyntaxKind.ModuleDeclaration;)e=e.getParentOrThrow();return e}}}}e.ModuleDeclarationKind=void 0,(function(e){e.Namespace=`namespace`,e.Module=`module`,e.Global=`global`})(e.ModuleDeclarationKind||={});var kc=(e=>qi(Da(va(Cn(Oc(ps(Ui(_e(Nn(Gi(ea(e))))))))))))(fs),Ac=class extends kc{getName(){let e=this.getNameNodes();return e instanceof Array?e.map(e=>e.getText()).join(`.`):e.getText()}setName(e){let n=`Please open an issue if you really need this and I'll up the priority.`;if(e.indexOf(`.`)>=0)throw new t.errors.NotImplementedError(`Not implemented to set a namespace name to a name containing a period. ${n}`);let r=this.getNameNodes();if(r instanceof Array){if(r.length>1)throw new t.errors.NotImplementedError(`Not implemented to set a namespace name that uses dot notation. ${n}`);e!==`global`&&jc(this),t.StringUtils.isQuoted(e)&&Mc(this),r[0].replaceWithText(e)}else r.replaceWithText(e);return this}rename(e,n){if(e.indexOf(`.`)>=0)throw new t.errors.NotSupportedError(`Cannot rename a namespace name to a name containing a period.`);let r=this.getNameNodes();if(r instanceof Array){if(r.length>1)throw new t.errors.NotSupportedError(`Cannot rename a namespace name that uses dot notation. Rename the individual nodes via .${t.nameof(this,`getNameNodes`)}()`);e!==`global`&&jc(this),r[0].rename(e,n)}else bn(r,t.StringUtils.stripQuotes(e),n);return this}getNameNodes(){let e=this.getNameNode();if(V.isStringLiteral(e))return e;{let e=[],n=this;do e.push(this._getNodeFromCompilerNode(n.compilerNode.name)),n=n.getFirstChildByKind(t.SyntaxKind.ModuleDeclaration);while(n!=null);return e}}hasNamespaceKeyword(){return this.getDeclarationKind()===e.ModuleDeclarationKind.Namespace}hasModuleKeyword(){return this.getDeclarationKind()===e.ModuleDeclarationKind.Module}setDeclarationKind(t){if(this.getDeclarationKind()===t)return this;if(t===e.ModuleDeclarationKind.Global){let e=this.getDeclarationKindKeyword();this.getNameNode().replaceWithText(`global`),e!=null&&Lt({children:[e],removeFollowingNewLines:!0,removeFollowingSpaces:!0})}else{let e=this.getDeclarationKindKeyword();e==null?At({parent:this,insertPos:this.getNameNode().getStart(),newText:t+` `}):e.replaceWithText(t)}return this}getDeclarationKind(){let n=this.getFlags();return(n&t.ts.NodeFlags.GlobalAugmentation)===0?(n&t.ts.NodeFlags.Namespace)===0?e.ModuleDeclarationKind.Module:e.ModuleDeclarationKind.Namespace:e.ModuleDeclarationKind.Global}getDeclarationKindKeyword(){return this.getFirstChild(e=>e.getKind()===t.SyntaxKind.NamespaceKeyword||e.getKind()===t.SyntaxKind.ModuleKeyword)}set(e){return e.name!=null&&e.name!==`global`&&jc(this),ge(kc.prototype,this,e),e.declarationKind!=null&&this.setDeclarationKind(e.declarationKind),this}getStructure(){return he(kc.prototype,this,{kind:e.StructureKind.Module,declarationKind:this.getDeclarationKind()})}_getInnerBody(){let e=this.getBody();for(;e!=null&&V.isBodyable(e)&&e.compilerNode.statements==null;)e=e.getBody();return e}};function jc(t){t.getDeclarationKind()===e.ModuleDeclarationKind.Global&&t.setDeclarationKind(e.ModuleDeclarationKind.Namespace)}function Mc(t){t.hasNamespaceKeyword()&&t.setDeclarationKind(e.ModuleDeclarationKind.Module),t.hasDeclareKeyword()||t.setHasDeclareKeyword(!0)}var Nc=V,Pc=class extends Nc{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}},Fc=V,Ic=class extends Fc{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}},Lc=Zi(V),Rc=class extends Lc{setName(e){let t=this.getNameNode();return this.getName()===e||(le(e)?t.replaceWithText(e):t.replaceWithText(`"${e.replaceAll(`"`,`\\"`)}"`)),this}getName(){let e=this.getNameNode();return e.getKind()===t.ts.SyntaxKind.StringLiteral?e.getLiteralText():e.getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},q=Zi(V),zc=class extends q{setName(e){let t=this.getNameNode();return t.getText()===e||t.replaceWithText(e),this}getName(){return this.getNameNode().getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},Bc=class extends fn{constructor(e,t){super(e,t)}getFileName(){return this.compilerObject.fileName}};e.FileSystemRefreshResult=void 0,(function(e){e[e.NoChange=0]=`NoChange`,e[e.Updated=1]=`Updated`,e[e.Deleted=2]=`Deleted`})(e.FileSystemRefreshResult||={});function Vc(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Hc=qi(va(ps(V))),Uc=class extends Hc{#e=!1;#t=new t.EventContainer;#n=new t.EventContainer;_referenceContainer=new fe(this);#r;#i;#a;_hasBom;constructor(e,t){super(e,t,void 0),this.__sourceFile=this;let n=()=>{this.isFromExternalLibrary(),this.#n.unsubscribe(n)};this.#n.subscribe(n)}_replaceCompilerNodeFromFactory(e){super._replaceCompilerNodeFromFactory(e),this._context.resetProgram(),this.#e=!1,this.#t.fire(this)}_clearInternals(){super._clearInternals(),e(this.#r),e(this.#a),e(this.#i),this.#r=void 0,this.#a=void 0,this.#i=void 0;function e(e){e?.forEach(e=>e._forget())}}getFilePath(){return this.compilerNode.fileName}getBaseName(){return t.FileUtils.getBaseName(this.getFilePath())}getBaseNameWithoutExtension(){let e=this.getBaseName(),t=this.getExtension();return e.substring(0,e.length-t.length)}getExtension(){return t.FileUtils.getExtension(this.getFilePath())}getDirectory(){return this._context.compilerFactory.getDirectoryFromCache(this.getDirectoryPath())}getDirectoryPath(){return this._context.fileSystemWrapper.getStandardizedAbsolutePath(t.FileUtils.getDirPath(this.compilerNode.fileName))}getFullText(){return this.compilerNode.text}getLineAndColumnAtPos(e){let n=this.getFullText();return{line:t.StringUtils.getLineNumberAtPos(n,e),column:t.StringUtils.getLengthFromLineStartAtPos(n,e)+1}}getLengthFromLineStartAtPos(e){return t.StringUtils.getLengthFromLineStartAtPos(this.getFullText(),e)}copyToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.copy(t.FileUtils.pathJoin(r,this.getBaseName()),n)}copy(e,t={}){this._throwIfIsInMemoryLibFile();let n=this._copyInternal(e,t);if(n===!1)return this;let r=n;return r.getDirectoryPath()!==this.getDirectoryPath()&&r._updateReferencesForCopyInternal(this._getReferencesForCopyInternal()),r}_copyInternal(e,n={}){let{overwrite:r=!1}=n,{compilerFactory:i,fileSystemWrapper:a}=this._context,o=a.getStandardizedAbsolutePath(e,this.getDirectoryPath());if(o===this.getFilePath())return!1;return s(this);function s(e){try{return i.createSourceFileFromText(o,e.getFullText(),{overwrite:r,markInProject:n()})}catch(e){throw e instanceof t.errors.InvalidOperationError?new t.errors.InvalidOperationError(`Did you mean to provide the overwrite option? `+e.message):e}function n(){if(e._isInProject())return!0;let t=i.getSourceFileFromCacheFromFilePath(o);return t!=null&&t._isInProject()}}}_getReferencesForCopyInternal(){return Array.from(this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries())}_updateReferencesForCopyInternal(e){for(let t of e)t[0]=this.getChildSyntaxListOrThrow().getDescendantAtStartWithWidth(t[0].getStart(),t[0].getWidth());Wc(e)}async copyImmediately(e,t){let n=this.copy(e,t);return await n.save(),n}copyImmediatelySync(e,t){let n=this.copy(e,t);return n.saveSync(),n}moveToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.move(t.FileUtils.pathJoin(r,this.getBaseName()),n)}move(e,t={}){this._throwIfIsInMemoryLibFile();let n=this.getDirectoryPath(),r=this._getReferencesForMoveInternal(),i=this.getFilePath();return this._moveInternal(e,t)?(this._context.fileSystemWrapper.queueFileDelete(i),this._updateReferencesForMoveInternal(r,n),this._context.lazyReferenceCoordinator.clearDirtySourceFiles(),this._context.lazyReferenceCoordinator.addDirtySourceFile(this),this):this}_moveInternal(e,t={}){let{overwrite:n=!1}=t,r=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getDirectoryPath());if(r===this.getFilePath())return!1;let i=!1;if(n){let e=this._context.compilerFactory.getSourceFileFromCacheFromFilePath(r);e!=null&&(i=e._isInProject(),e.forget())}else this._context.compilerFactory.throwIfFileExists(r,`Did you mean to provide the overwrite option?`);return rn({newFilePath:r,sourceFile:this}),i&&this._markAsInProject(),this._isInProject()&&this.getDirectory()._markAsInProject(),!0}_getReferencesForMoveInternal(){return{literalReferences:Array.from(this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries()),referencingLiterals:Array.from(this._referenceContainer.getReferencingLiteralsInOtherSourceFiles())}}_updateReferencesForMoveInternal(e,t){let{literalReferences:n,referencingLiterals:r}=e;t!==this.getDirectoryPath()&&Wc(n),Wc(r.map(e=>[e,this]))}async moveImmediately(e,t){let n=this.getFilePath(),r=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getDirectoryPath());return this.move(e,t),n===r?await this.save():(await this._context.fileSystemWrapper.moveFileImmediately(n,r,this.getFullText()),this.#e=!0),this}moveImmediatelySync(e,t){let n=this.getFilePath(),r=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getDirectoryPath());return this.move(e,t),n===r?this.saveSync():(this._context.fileSystemWrapper.moveFileImmediatelySync(n,r,this.getFullText()),this.#e=!0),this}delete(){this._throwIfIsInMemoryLibFile();let e=this.getFilePath();this.forget(),this._context.fileSystemWrapper.queueFileDelete(e)}async deleteImmediately(){this._throwIfIsInMemoryLibFile();let e=this.getFilePath();this.forget(),await this._context.fileSystemWrapper.deleteFileImmediately(e)}deleteImmediatelySync(){this._throwIfIsInMemoryLibFile();let e=this.getFilePath();this.forget(),this._context.fileSystemWrapper.deleteFileImmediatelySync(e)}async save(){this._isLibFileInMemory()||(await this._context.fileSystemWrapper.writeFile(this.getFilePath(),this.#o()),this.#e=!0)}saveSync(){this._isLibFileInMemory()||(this._context.fileSystemWrapper.writeFileSync(this.getFilePath(),this.#o()),this.#e=!0)}#o(){let e=this.getFullText();return this._hasBom?``+e:e}getPathReferenceDirectives(){return this.#r??=(this.compilerNode.referencedFiles||[]).map(e=>new Bc(e,this)),this.#r}getTypeReferenceDirectives(){return this.#a??=(this.compilerNode.typeReferenceDirectives||[]).map(e=>new Bc(e,this)),this.#a}getLibReferenceDirectives(){return this.#i??=(this.compilerNode.libReferenceDirectives||[]).map(e=>new Bc(e,this)),this.#i}getReferencingSourceFiles(){return Array.from(this._referenceContainer.getDependentSourceFiles())}getReferencingNodesInOtherSourceFiles(){let e=this.getReferencingLiteralsInOtherSourceFiles();return Array.from(t());function*t(){for(let t of e)yield Gc(t)}}getReferencingLiteralsInOtherSourceFiles(){return Array.from(this._referenceContainer.getReferencingLiteralsInOtherSourceFiles())}getReferencedSourceFiles(){let e=this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries();return Array.from(new Set(t()).values());function*t(){for(let[,t]of e)yield t}}getNodesReferencingOtherSourceFiles(){let e=this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries();return Array.from(t());function*t(){for(let[t]of e)yield Gc(t)}}getLiteralsReferencingOtherSourceFiles(){let e=this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries();return Array.from(t());function*t(){for(let[t]of e)yield t}}getImportStringLiterals(){return this._ensureBound(),(this.compilerNode.imports||[]).filter(e=>e.pos!==-1).map(e=>this._getNodeFromCompilerNode(e))}getLanguageVersion(){return this.compilerNode.languageVersion}getLanguageVariant(){return this.compilerNode.languageVariant}getScriptKind(){return this.compilerNode.scriptKind}isDeclarationFile(){return this.compilerNode.isDeclarationFile}isFromExternalLibrary(){return this._context.program._isCompilerProgramCreated()?this._context.program.compilerObject.isSourceFileFromExternalLibrary(this.compilerNode):!1}isInNodeModules(){return this.getFilePath().indexOf(`/node_modules/`)>=0}isSaved(){return this.#e&&!this._isLibFileInMemory()}_setIsSaved(e){this.#e=e}getPreEmitDiagnostics(){return this._context.getPreEmitDiagnostics(this)}unindent(e,t=1){return this.indent(e,t*-1)}indent(e,n=1){if(n===0)return this;let r=this.getFullText(),i=typeof e==`number`?[e,e]:e;t.errors.throwIfRangeOutOfRange(i,[0,r.length],`positionRange`);let a=Ne(r,i[0],e=>e===o.NEWLINE),s=Me(r,i[1],e=>e===o.CARRIAGE_RETURN||e===o.NEWLINE),c=t.StringUtils.indent(r.substring(a,s),n,{indentText:this._context.manipulationSettings.getIndentationText(),indentSizeInSpaces:this._context.manipulationSettings._getIndentSizeInSpaces(),isInStringAtPos:e=>this.isInStringAtPos(e+a)});return $t({sourceFile:this,newText:r.substring(0,a)+c+r.substring(s)}),this}emit(e){return this._context.program.emit({targetSourceFile:this,...e})}emitSync(e){return this._context.program.emitSync({targetSourceFile:this,...e})}getEmitOutput(e={}){return this._context.languageService.getEmitOutput(this,e.emitOnlyDtsFiles||!1)}formatText(e={}){$t({sourceFile:this,newText:this._context.languageService.getFormattedDocumentText(this.getFilePath(),e)})}async refreshFromFileSystem(){let e=await this._context.fileSystemWrapper.readFileOrNotExists(this.getFilePath(),this._context.getEncoding());return this.#s(e)}refreshFromFileSystemSync(){let e=this._context.fileSystemWrapper.readFileOrNotExistsSync(this.getFilePath(),this._context.getEncoding());return this.#s(e)}getRelativePathTo(e){return this.getDirectory().getRelativePathTo(e)}getRelativePathAsModuleSpecifierTo(e){return this.getDirectory().getRelativePathAsModuleSpecifierTo(e)}onModified(e,t=!0){return t?this.#t.subscribe(e):this.#t.unsubscribe(e),this}_doActionPreNextModification(e){let t=()=>{e(),this.#n.unsubscribe(t)};return this.#n.subscribe(t),this}_firePreModified(){this.#n.fire(this)}organizeImports(e={},t={}){return this._context.languageService.organizeImports(this,e,t).forEach(e=>e.applyChanges()),this}fixUnusedIdentifiers(e={},t={}){return this._context.languageService.getCombinedCodeFix(this,`unusedIdentifier_delete`,e,t).applyChanges(),this._context.languageService.getCombinedCodeFix(this,`unusedIdentifier_deleteImports`,e,t).applyChanges(),this}fixMissingImports(e={},n={}){let r=this._context.languageService.getCombinedCodeFix(this,`fixMissingImport`,e,n),i=this;for(let e of r.getChanges()){let t=e.getTextChanges();a(t),o(t)}return this;function a(e){e.sort((e,t)=>e.getSpan().getStart()-t.getSpan().getStart());for(let t=0;t<e.length-1;t++){let{compilerObject:n}=e[t];n.newText=n.newText.replace(/(\r?)\n\r?\n$/,`$1
31393
31393
  `)}}function o(e){let n=t.ArrayUtils.groupBy(e,e=>e.getSpan().getStart()),r=0;for(let e of n){let t=e[0].getSpan().getStart()+r,n=e.map(e=>e.getNewText()).join(``);jt({sourceFile:i,insertPos:t,newText:n}),r+=n.length}}}applyTextChanges(e){return e.length===0?this:(this.forgetDescendants(),B({sourceFile:this._sourceFile,start:0,replacingLength:this.getFullWidth(),newText:L(this,e)}),this)}set(e){return ge(Hc.prototype,this,e),this}getStructure(){return he(Hc.prototype,this,{kind:e.StructureKind.SourceFile})}#s(t){if(t===!1)return this.forget(),e.FileSystemRefreshResult.Deleted;let n=t;return n===this.getFullText()?e.FileSystemRefreshResult.NoChange:(this.replaceText([0,this.getEnd()],n),this._setIsSaved(!0),e.FileSystemRefreshResult.Updated)}_isLibFileInMemory(){return this.compilerNode.fileName.startsWith(t.libFolderInMemoryPath)}_throwIfIsInMemoryLibFile(){if(this._isLibFileInMemory())throw new t.errors.InvalidOperationError(`This operation is not permitted on an in memory lib folder file.`)}_isInProject(){return this._context.inProjectCoordinator.isSourceFileInProject(this)}_markAsInProject(){this._context.inProjectCoordinator.markSourceFileAsInProject(this)}};Vc([t.Memoize],Uc.prototype,`isFromExternalLibrary`,null);function Wc(e){for(let[t,n]of e)re.isModuleSpecifierRelative(t.getLiteralText())&&t.setLiteralValue(t._sourceFile.getRelativePathAsModuleSpecifierTo(n))}function Gc(e){let t=e.getParentOrThrow(),n=t.getParent();return n!=null&&V.isImportEqualsDeclaration(n)?n:t}var Kc=(e=>Oc(Ui(_e(Nn(Gi(e))))))(fs),qc=class extends Kc{getDeclarationList(){return this._getNodeFromCompilerNode(this.compilerNode.declarationList)}getDeclarations(){return this.getDeclarationList().getDeclarations()}getDeclarationKind(){return this.getDeclarationList().getDeclarationKind()}getDeclarationKindKeywords(){return this.getDeclarationList().getDeclarationKindKeywords()}setDeclarationKind(e){return this.getDeclarationList().setDeclarationKind(e)}addDeclaration(e){return this.getDeclarationList().addDeclaration(e)}addDeclarations(e){return this.getDeclarationList().addDeclarations(e)}insertDeclaration(e,t){return this.getDeclarationList().insertDeclaration(e,t)}insertDeclarations(e,t){return this.getDeclarationList().insertDeclarations(e,t)}set(e){if(ge(Kc.prototype,this,e),e.declarationKind!=null&&this.setDeclarationKind(e.declarationKind),e.declarations!=null){let t=this.getDeclarations();this.addDeclarations(e.declarations),t.forEach(e=>e.remove())}return this}getStructure(){return he(Kc.prototype,this,{kind:e.StructureKind.VariableStatement,declarationKind:this.getDeclarationKind(),declarations:this.getDeclarations().map(e=>e.getStructure())})}},Jc=qa(As),Yc=class extends Jc{},Xc=qa(fs),Zc=class extends Xc{getStatement(){return this._getNodeFromCompilerNode(this.compilerNode.statement)}};function Qc(e){return Ui(Ta(ga(ps(Gi(e)))))}var $c=(e=>va(Sn(sn(Qc(e)))))(Na),el=class extends $c{getEqualsGreaterThan(){return this._getNodeFromCompilerNode(this.compilerNode.equalsGreaterThanToken)}};function tl(e){return class extends e{getOverloads(){return nl(this).filter(e=>e.isOverload())}getImplementation(){return this.isImplementation()?this:nl(this).find(e=>e.isImplementation())}getImplementationOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getImplementation(),e??`Expected to find a corresponding implementation for the overload.`,this)}isOverload(){return!this.isImplementation()}isImplementation(){return this.getBody()!=null}}}function nl(e){let t=e.getParentOrThrow(),n=rl(e),r=il(e),i=e.getKind();return t.forEachChildAsArray().filter(e=>rl(e)===n&&e.getKind()===i&&il(e)===r)}function rl(e){let t=e;if(t.getName instanceof Function)return t.getName()}function il(e){let t=e;return t.isStatic instanceof Function?t.isStatic():!1}function al(e){if(e.structures.length===0)return[];let t=e.node.getParentSyntaxListOrThrow(),n=e.node.getImplementation()||e.node,r=e.node.getOverloads(),i=r.length,a=r.length>0?r[0].getChildIndex():n.getChildIndex(),o=tt(e.index,i),s=a+o,c=e.getThisStructure(n),l=e.structures.map(e=>Object.assign(Object.assign({},c),e)),u=n._getWriterWithQueuedIndentation();for(let t of l)u.getLength()>0&&u.newLine(),e.printStructure(u,t);return u.newLine(),u.write(``),At({parent:t,insertPos:(r[o]||n).getNonWhitespaceStart(),newText:u.toString()}),Ze(t.getChildren(),s,l.length,e.expectedSyntaxKind)}var ol=(e=>Da(va(tl(Cn(sn(Ii(_e(Nn(Qc(Oc(ta(e))))))))))))(fs),sl=(e=>Da(va(sn(Ii(ga(_e(Oc(Ui(Ta(Nn(Gi(e))))))))))))(fs),cl=class extends ol{addOverload(e){return this.addOverloads([e])[0]}addOverloads(e){return this.insertOverloads(this.getOverloads().length,e)}insertOverload(e,t){return this.insertOverloads(e,[t])[0]}insertOverloads(e,n){let r=this.getName(),i=this._context.structurePrinterFactory.forFunctionDeclaration({isAmbient:this.isAmbient()});return al({node:this,index:e,structures:n,printStructure:(e,t)=>{i.printOverload(e,r,t)},getThisStructure:$e,expectedSyntaxKind:t.SyntaxKind.FunctionDeclaration})}remove(){Gt(this)}set(e){return ge(ol.prototype,this,e),e.overloads!=null&&(this.getOverloads().forEach(e=>e.remove()),this.addOverloads(e.overloads)),this}getStructure(){let t=this.isOverload(),n=this.getImplementation();return he(t&&n?sl.prototype:ol.prototype,this,r(this));function r(r){if(n&&t)return i();return a();function i(){return{kind:e.StructureKind.FunctionOverload}}function a(){return n?{kind:e.StructureKind.Function,overloads:r.getOverloads().map(e=>e.getStructure())}:{kind:e.StructureKind.Function}}}}},ll=(e=>Ui(va(Sn(sn(Ii(ps(Ta(ga(Gi(ta(e)))))))))))(Ua),ul=class extends ll{},dl=(e=>oa(la(Tn(fa(ua(Gi(kn(xa(Vi(Qi(e)))))))))))(V),fl=class extends dl{isRestParameter(){return this.compilerNode.dotDotDotToken!=null}isParameterProperty(){return this.getScope()!=null||this.isReadonly()||this.hasOverrideKeyword()}setIsRestParameter(e){return this.isRestParameter()===e||(e?(pl(this),At({insertPos:this.getNameNode().getStart(),parent:this,newText:`...`})):Lt({children:[this.getDotDotDotTokenOrThrow()]})),this}isOptional(){return this.compilerNode.questionToken!=null||this.isRestParameter()||this.hasInitializer()}remove(){Wt(this)}set(e){return ge(dl.prototype,this,e),e.isRestParameter!=null&&this.setIsRestParameter(e.isRestParameter),this}getStructure(){return he(dl.prototype,this,{kind:e.StructureKind.Parameter,isRestParameter:this.isRestParameter()})}setHasQuestionToken(e){return e&&pl(this),super.setHasQuestionToken(e),this}setInitializer(e){return pl(this),super.setInitializer(e),this}setType(e){return pl(this),super.setType.call(this,e),this}};function pl(e){let n=e.getParentOrThrow();r()&&i();function r(){return V.isArrowFunction(n)&&n.compilerNode.parameters.length===1&&e.getParentSyntaxListOrThrow().getPreviousSiblingIfKind(t.SyntaxKind.OpenParenToken)==null}function i(){let t=e.getText();At({parent:n,insertPos:e.getStart(),newText:`(${t})`,replacing:{textLength:t.length},customMappings:t=>[{currentNode:e,newNode:t.parameters[0]}]})}}var ml=class extends V{remove(){let e=this.getParentOrThrow();V.isClassDeclaration(e)||V.isClassExpression(e)?Bt(this):V.isObjectLiteralExpression(e)?Wt(this):V.isInterfaceDeclaration(e)?Ht(this):t.errors.throwNotImplementedForSyntaxKindError(e.getKind())}},hl=(e=>wn(va(oa(tl(Cn(Tn(Ma(ha(la(_a(sn(Ii(Qc(aa(e)))))))))))))))(ml),gl=(e=>Ui(wn(va(oa(ha(Ta(Ma(la(_a(sn(Gi(Ii(ga(e))))))))))))))(ml),_l=class extends hl{set(e){return ge(hl.prototype,this,e),e.overloads!=null&&(this.getOverloads().forEach(e=>e.remove()),this.addOverloads(e.overloads)),this}addOverload(e){return this.addOverloads([e])[0]}addOverloads(e){return this.insertOverloads(this.getOverloads().length,e)}insertOverload(e,t){return this.insertOverloads(e,[t])[0]}insertOverloads(e,n){let r=this.getName(),i=this._context.structurePrinterFactory.forMethodDeclaration({isAmbient:k(this)});return al({node:this,index:e,structures:n,printStructure:(e,t)=>{i.printOverload(e,r,t)},getThisStructure:et,expectedSyntaxKind:t.SyntaxKind.MethodDeclaration})}getStructure(){let t=this.getImplementation()!=null,n=this.isOverload();return he(n&&t?gl.prototype:hl.prototype,this,r(this));function r(r){if(t&&n)return i();return a();function i(){return{kind:e.StructureKind.MethodOverload}}function a(){return t?{kind:e.StructureKind.Method,overloads:r.getOverloads().map(e=>e.getStructure())}:{kind:e.StructureKind.Method}}}}};function vl(e){return yl(ta(va(zi(Ri(Ma(Ui(Ta(Tn(Gi(e))))))))))}function yl(e){return class extends e{setExtends(e){if(e=this._getTextWithQueuedChildIndentation(e),t.StringUtils.isNullOrWhitespace(e))return this.removeExtends();let n=this.getHeritageClauseByKind(t.SyntaxKind.ExtendsKeyword);if(n!=null){let r=n.getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),i=r.getStart();At({parent:n,newText:e,insertPos:i,replacing:{textLength:r.getEnd()-i}})}else{let n=this.getHeritageClauseByKind(t.SyntaxKind.ImplementsKeyword),r;r=n==null?this.getFirstChildByKindOrThrow(t.SyntaxKind.OpenBraceToken).getStart():n.getStart();let i=/\s/.test(this.getSourceFile().getFullText()[r-1]),a=`extends ${e} `;i||(a=` `+a),At({parent:n==null?this:n.getParentSyntaxListOrThrow(),insertPos:r,newText:a})}return this}removeExtends(){return this.getHeritageClauseByKind(t.SyntaxKind.ExtendsKeyword)?.removeExpression(0),this}getExtendsOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getExtends(),e??`Expected to find the extends expression for the class ${this.getName()}.`,this)}getExtends(){let e=this.getHeritageClauseByKind(t.SyntaxKind.ExtendsKeyword);if(e==null)return;let n=e.getTypeNodes();return n.length===0?void 0:n[0]}addMembers(e){return this.insertMembers(je(this.getMembersWithComments()),e)}addMember(e){return this.insertMember(je(this.getMembersWithComments()),e)}insertMember(e,t){return this.insertMembers(e,[t])[0]}insertMembers(e,t){let n=k(this);return Ft({getIndexedChildren:()=>this.getMembersWithComments(),index:e,parent:this,write:(e,i)=>{let a=!n&&i.previousMember!=null&&V.isBodyable(i.previousMember)&&i.previousMember.hasBody(),o=!n&&t instanceof Array&&r(t[0]);a||i.previousMember!=null&&o?e.blankLineIfLastNot():e.newLineIfLastNot();let s=this._getWriter();this._context.structurePrinterFactory.forClassMember({isAmbient:n}).printTexts(s,t),e.write(s.toString());let c=!n&&t instanceof Array&&r(t[t.length-1]),l=!n&&i.nextMember!=null&&V.isBodyable(i.nextMember)&&i.nextMember.hasBody();i.nextMember!=null&&c||l?e.blankLineIfLastNot():e.newLineIfLastNot()}});function r(e){if(n||e==null||typeof e.kind!=`number`)return!1;let t=e;return Yn.isMethod(t)||Yn.isGetAccessor(t)||Yn.isSetAccessor(t)||Yn.isConstructor(t)}}addConstructor(e={}){return this.insertConstructor(je(this.getMembersWithComments()),e)}addConstructors(e){return this.insertConstructors(je(this.getMembersWithComments()),e)}insertConstructor(e,t={}){return this.insertConstructors(e,[t])[0]}insertConstructors(e,n){let r=k(this);return wl(this,{index:e,structures:n,expectedKind:t.SyntaxKind.Constructor,write:(e,t)=>{!r&&t.previousMember!=null&&!V.isCommentNode(t.previousMember)?e.blankLineIfLastNot():e.newLineIfLastNot(),this._context.structurePrinterFactory.forConstructorDeclaration({isAmbient:r}).printTexts(e,n),!r&&t.nextMember!=null?e.blankLineIfLastNot():e.newLineIfLastNot()}})}getConstructors(){return this.getMembers().filter(e=>V.isConstructorDeclaration(e))}addStaticBlock(e={}){return this.insertStaticBlock(je(this.getMembersWithComments()),e)}addStaticBlocks(e){return this.insertStaticBlocks(je(this.getMembersWithComments()),e)}insertStaticBlock(e,t={}){return this.insertStaticBlocks(e,[t])[0]}insertStaticBlocks(e,n){let r=k(this);return wl(this,{index:e,structures:n,expectedKind:t.SyntaxKind.ClassStaticBlockDeclaration,write:(e,t)=>{!r&&t.previousMember!=null&&!V.isCommentNode(t.previousMember)?e.blankLineIfLastNot():e.newLineIfLastNot(),this._context.structurePrinterFactory.forClassStaticBlockDeclaration().printTexts(e,n),!r&&t.nextMember!=null?e.blankLineIfLastNot():e.newLineIfLastNot()}})}getStaticBlocks(){return this.getMembers().filter(e=>V.isClassStaticBlockDeclaration(e))}addGetAccessor(e){return this.addGetAccessors([e])[0]}addGetAccessors(e){return this.insertGetAccessors(je(this.getMembersWithComments()),e)}insertGetAccessor(e,t){return this.insertGetAccessors(e,[t])[0]}insertGetAccessors(e,n){return wl(this,{index:e,structures:n,expectedKind:t.SyntaxKind.GetAccessor,write:(e,t)=>{t.previousMember!=null&&!V.isCommentNode(t.previousMember)?e.blankLineIfLastNot():e.newLineIfLastNot(),this._context.structurePrinterFactory.forGetAccessorDeclaration({isAmbient:k(this)}).printTexts(e,n),t.nextMember==null?e.newLineIfLastNot():e.blankLineIfLastNot()}})}addSetAccessor(e){return this.addSetAccessors([e])[0]}addSetAccessors(e){return this.insertSetAccessors(je(this.getMembersWithComments()),e)}insertSetAccessor(e,t){return this.insertSetAccessors(e,[t])[0]}insertSetAccessors(e,n){return wl(this,{index:e,structures:n,expectedKind:t.SyntaxKind.SetAccessor,write:(e,t)=>{t.previousMember!=null&&!V.isCommentNode(t.previousMember)?e.blankLineIfLastNot():e.newLineIfLastNot(),this._context.structurePrinterFactory.forSetAccessorDeclaration({isAmbient:k(this)}).printTexts(e,n),t.nextMember==null?e.newLineIfLastNot():e.blankLineIfLastNot()}})}addProperty(e){return this.addProperties([e])[0]}addProperties(e){return this.insertProperties(je(this.getMembersWithComments()),e)}insertProperty(e,t){return this.insertProperties(e,[t])[0]}insertProperties(e,n){return wl(this,{index:e,structures:n,expectedKind:t.SyntaxKind.PropertyDeclaration,write:(e,t)=>{t.previousMember!=null&&V.hasBody(t.previousMember)?e.blankLineIfLastNot():e.newLineIfLastNot(),this._context.structurePrinterFactory.forPropertyDeclaration().printTexts(e,n),t.nextMember!=null&&V.hasBody(t.nextMember)?e.blankLineIfLastNot():e.newLineIfLastNot()}})}addMethod(e){return this.addMethods([e])[0]}addMethods(e){return this.insertMethods(je(this.getMembersWithComments()),e)}insertMethod(e,t){return this.insertMethods(e,[t])[0]}insertMethods(e,n){let r=k(this);return n=n.map(e=>({...e})),wl(this,{index:e,write:(e,t)=>{!r&&t.previousMember!=null&&!V.isCommentNode(t.previousMember)?e.blankLineIfLastNot():e.newLineIfLastNot(),this._context.structurePrinterFactory.forMethodDeclaration({isAmbient:r}).printTexts(e,n),!r&&t.nextMember!=null?e.blankLineIfLastNot():e.newLineIfLastNot()},structures:n,expectedKind:t.SyntaxKind.MethodDeclaration})}getInstanceProperty(e){return s(this.getInstanceProperties(),e)}getInstancePropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInstanceProperty(e),()=>l(`class instance property`,e))}getInstanceProperties(){return this.getInstanceMembers().filter(e=>Sl(e))}getStaticProperty(e){return s(this.getStaticProperties(),e)}getStaticPropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getStaticProperty(e),()=>l(`class static property`,e))}getStaticProperties(){return this.getStaticMembers().filter(e=>Sl(e))}getProperty(e){return s(this.getProperties(),e)}getPropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getProperty(e),()=>l(`class property declaration`,e))}getProperties(){return this.getMembers().filter(e=>V.isPropertyDeclaration(e))}getGetAccessor(e){return s(this.getGetAccessors(),e)}getGetAccessorOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getGetAccessor(e),()=>l(`class getAccessor declaration`,e))}getGetAccessors(){return this.getMembers().filter(e=>V.isGetAccessorDeclaration(e))}getSetAccessor(e){return s(this.getSetAccessors(),e)}getSetAccessorOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSetAccessor(e),()=>l(`class setAccessor declaration`,e))}getSetAccessors(){return this.getMembers().filter(e=>V.isSetAccessorDeclaration(e))}getMethod(e){return s(this.getMethods(),e)}getMethodOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getMethod(e),()=>l(`class method declaration`,e))}getMethods(){return this.getMembers().filter(e=>V.isMethodDeclaration(e))}getInstanceMethod(e){return s(this.getInstanceMethods(),e)}getInstanceMethodOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInstanceMethod(e),()=>l(`class instance method`,e))}getInstanceMethods(){return this.getInstanceMembers().filter(e=>e instanceof _l)}getStaticMethod(e){return s(this.getStaticMethods(),e)}getStaticMethodOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getStaticMethod(e),()=>l(`class static method`,e))}getStaticMethods(){return this.getStaticMembers().filter(e=>e instanceof _l)}getInstanceMember(e){return s(this.getInstanceMembers(),e)}getInstanceMemberOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInstanceMember(e),()=>l(`class instance member`,e))}getInstanceMembers(){return this.getMembersWithParameterProperties().filter(e=>V.isConstructorDeclaration(e)?!1:V.isParameterDeclaration(e)||!e.isStatic())}getStaticMember(e){return s(this.getStaticMembers(),e)}getStaticMemberOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getStaticMember(e),()=>l(`class static member`,e))}getStaticMembers(){return this.getMembers().filter(e=>V.isConstructorDeclaration(e)?!1:!V.isParameterDeclaration(e)&&e.isStatic())}getMembersWithParameterProperties(){let e=this.getMembers(),t=e.filter(e=>V.isConstructorDeclaration(e)&&e.isImplementation());for(let n of t){let t=e.indexOf(n)+1;for(let r of n.getParameters())r.isParameterProperty()&&(e.splice(t,0,r),t++)}return e}getMembers(){return bl(this,this.compilerNode.members).filter(e=>Cl(e))}getMembersWithComments(){let e=this.compilerNode,t=T.getContainerArray(e,this.getSourceFile().compilerNode);return bl(this,t).filter(e=>Cl(e)||V.isCommentClassElement(e))}getMember(e){return s(this.getMembers(),e)}getMemberOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getMember(e),()=>l(`class member`,e))}getBaseTypes(){return this.getType().getBaseTypes()}getBaseClassOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getBaseClass(),e??`Expected to find the base class of ${this.getName()}.`,this)}getBaseClass(){let e=this.getBaseTypes().map(e=>e.isIntersection()?e.getIntersectionTypes():[e]).flat().map(e=>e.getSymbol()).filter(e=>e!=null).map(e=>e.getDeclarations()).reduce((e,t)=>e.concat(t),[]).filter(e=>e.getKind()===t.SyntaxKind.ClassDeclaration);if(e.length===1)return e[0]}getDerivedClasses(){let e=xl(this);for(let t=0;t<e.length;t++){let n=xl(e[t]);for(let t of n)t!==this&&e.indexOf(t)===-1&&e.push(t)}return e}}}function bl(e,t){let n=k(e),r=t.map(t=>e._getNodeFromCompilerNode(t));return n?r:r.filter(e=>!(V.isConstructorDeclaration(e)||V.isMethodDeclaration(e))||V.isMethodDeclaration(e)&&e.isAbstract()?!0:e.isImplementation())}function xl(e){let n=[],r=e.getNameNode();if(r==null)return n;for(let e of r.findReferencesAsNodes()){e=e.getParentWhileKind(t.SyntaxKind.PropertyAccessExpression)??e;let r=e.getParentIfKind(t.SyntaxKind.ExpressionWithTypeArguments);if(r==null)continue;let i=r.getParentIfKind(t.SyntaxKind.HeritageClause);if(i==null||i.getToken()!==t.SyntaxKind.ExtendsKeyword)continue;let a=i.getParentIfKind(t.SyntaxKind.ClassDeclaration);a!=null&&n.push(a)}return n}function Sl(e){return V.isPropertyDeclaration(e)||V.isSetAccessorDeclaration(e)||V.isGetAccessorDeclaration(e)||V.isParameterDeclaration(e)}function Cl(e){return V.isMethodDeclaration(e)||V.isPropertyDeclaration(e)||V.isGetAccessorDeclaration(e)||V.isSetAccessorDeclaration(e)||V.isConstructorDeclaration(e)||V.isClassStaticBlockDeclaration(e)}function wl(e,t){return Pt({getIndexedChildren:()=>e.getMembersWithComments(),parent:e,...t})}var Tl=(e=>Oc(_e(Nn(vl(e)))))(fs),El=class extends Tl{set(e){return ge(Tl.prototype,this,e),e.extends==null?e.hasOwnProperty(t.nameof(e,`extends`))&&this.removeExtends():this.setExtends(e.extends),e.ctors!=null&&(this.getConstructors().forEach(e=>e.remove()),this.addConstructors(e.ctors)),e.staticBlocks!=null&&(this.getStaticBlocks().forEach(e=>e.remove()),this.addStaticBlocks(e.staticBlocks)),e.properties!=null&&(this.getProperties().forEach(e=>e.remove()),this.addProperties(e.properties)),e.getAccessors!=null&&(this.getGetAccessors().forEach(e=>e.remove()),this.addGetAccessors(e.getAccessors)),e.setAccessors!=null&&(this.getSetAccessors().forEach(e=>e.remove()),this.addSetAccessors(e.setAccessors)),e.methods!=null&&(this.getMethods().forEach(e=>e.remove()),this.addMethods(e.methods)),this}getStructure(){let t=this.getExtends(),n=this.isAmbient();return he(Tl.prototype,this,{kind:e.StructureKind.Class,ctors:this.getConstructors().filter(e=>n||!e.isOverload()).map(e=>e.getStructure()),staticBlocks:this.getStaticBlocks().map(e=>e.getStructure()),methods:this.getMethods().filter(e=>n||!e.isOverload()).map(e=>e.getStructure()),properties:this.getProperties().map(e=>e.getStructure()),extends:t?t.getText():void 0,getAccessors:this.getGetAccessors().map(e=>e.getStructure()),setAccessors:this.getSetAccessors().map(e=>e.getStructure())})}extractInterface(t){let{constructors:n,properties:r,methods:i,accessors:a}=Dl(this,!1),o=n.map(e=>e.getParameters().filter(e=>e.isParameterProperty())).flat().filter(t=>t.getName()!=null&&t.getScope()===e.Scope.Public);return{kind:e.StructureKind.Interface,name:Ol(t,this),docs:this.getJsDocs().map(e=>e.getStructure()),typeParameters:this.getTypeParameters().map(e=>e.getStructure()),properties:[...o.map(t=>{let n=t.getParentOrThrow().getJsDocs().map(e=>e.getTags()).flat().filter(V.isJSDocParameterTag).filter(e=>e.getTagName()===`param`&&e.getName()===t.getName()&&e.getComment()!=null).map(e=>e.getCommentText().trim())[0];return{kind:e.StructureKind.PropertySignature,docs:n==null?[]:[{kind:e.StructureKind.JSDoc,description:n}],name:t.getName(),type:t.getType().getText(t),hasQuestionToken:t.hasQuestionToken(),isReadonly:t.isReadonly()}}),...r.map(kl),...a.map(Al)],methods:i.map(jl)}}extractStaticInterface(t){let{constructors:n,properties:r,methods:i,accessors:a}=Dl(this,!0),o=Ol(void 0,this);return{kind:e.StructureKind.Interface,name:t,properties:[...r.map(kl),...a.map(Al)],methods:i.map(jl),constructSignatures:n.map(t=>({kind:e.StructureKind.ConstructSignature,docs:t.getJsDocs().map(e=>e.getStructure()),parameters:t.getParameters().map(e=>({...Ml(e),scope:void 0,isReadonly:!1})),returnType:o}))}}};function Dl(n,r){return{constructors:n.getConstructors().map(e=>e.getOverloads().length>0?e.getOverloads():[e]).flat(),properties:n.getProperties().filter(t=>t.isStatic()===r&&t.getScope()===e.Scope.Public),methods:n.getMethods().filter(t=>t.isStatic()===r&&t.getScope()===e.Scope.Public).map(e=>e.getOverloads().length>0?e.getOverloads():[e]).flat(),accessors:i()};function i(){let i=new t.KeyValueCache;for(let t of[...n.getGetAccessors(),...n.getSetAccessors()])t.isStatic()===r&&t.getScope()===e.Scope.Public&&i.getOrCreate(t.getName(),()=>[]).push(t);return i.getValuesAsArray()}}function Ol(e,n){return e=t.StringUtils.isNullOrWhitespace(e)?void 0:e,e||n.getName()||n.getSourceFile().getBaseNameWithoutExtension().replace(/[^a-zA-Z0-9_$]/g,``)}function kl(t){return{kind:e.StructureKind.PropertySignature,docs:t.getJsDocs().map(e=>e.getStructure()),name:t.getName(),type:t.getType().getText(t),hasQuestionToken:t.hasQuestionToken(),isReadonly:t.isReadonly()}}function Al(t){return{kind:e.StructureKind.PropertySignature,docs:t[0].getJsDocs().map(e=>e.getStructure()),name:t[0].getName(),type:t[0].getType().getText(t[0]),hasQuestionToken:!1,isReadonly:t.every(V.isGetAccessorDeclaration)}}function jl(t){return{kind:e.StructureKind.MethodSignature,docs:t.getJsDocs().map(e=>e.getStructure()),name:t.getName(),hasQuestionToken:t.hasQuestionToken(),returnType:t.getReturnType().getText(t),parameters:t.getParameters().map(Ml),typeParameters:t.getTypeParameters().map(e=>e.getStructure())}}function Ml(e){return{...e.getStructure(),decorators:[]}}var Nl=vl(Ua),Pl=class extends Nl{},Fl=(e=>wn(va(ps(Ui(Sn(e))))))(ml),Il=class extends Fl{getName(){return`static`}isStatic(){return!0}set(e){return ge(Fl.prototype,this,e),this}getStructure(){return he(Fl.prototype,this,{kind:e.StructureKind.ClassStaticBlock})}},Ll=class extends ml{},Rl=(e=>Yi(wn(va(tl(ha(Qc(Cn(e))))))))(ml),zl=(e=>Ta(Ui(wn(va(ha(Gi(ga(e))))))))(ml),Bl=class extends Rl{set(e){return ge(Rl.prototype,this,e),e.overloads!=null&&(this.getOverloads().forEach(e=>e.remove()),this.addOverloads(e.overloads)),this}addOverload(e){return this.addOverloads([e])[0]}addOverloads(e){return this.insertOverloads(this.getOverloads().length,e)}insertOverload(e,t){return this.insertOverloads(e,[t])[0]}insertOverloads(e,n){let r=this._context.structurePrinterFactory.forConstructorDeclaration({isAmbient:k(this)});return al({node:this,index:e,structures:n,printStructure:(e,t)=>{r.printOverload(e,t)},getThisStructure:Qe,expectedSyntaxKind:t.SyntaxKind.Constructor})}getStructure(){let t=this.getImplementation()!=null,n=this.isOverload();return he(n&&t?zl.prototype:Rl.prototype,this,r(this));function r(r){if(t&&n)return i();return a();function i(){return{kind:e.StructureKind.ConstructorOverload}}function a(){return t?{kind:e.StructureKind.Constructor,overloads:r.getOverloads().map(e=>e.getStructure())}:{kind:e.StructureKind.Constructor}}}}},Vl=(e=>wn(va(Tn(Ma(ha(_a(Qc(Cn(aa(e))))))))))(ml),Hl=class extends Vl{set(e){return ge(Vl.prototype,this,e),this}getSetAccessor(){let e=this.getName(),t=this.isStatic();return this.getParentOrThrow().forEachChild(n=>{if(V.isSetAccessorDeclaration(n)&&n.getName()===e&&n.isStatic()===t)return n})}getSetAccessorOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSetAccessor(),e??(()=>`Expected to find a corresponding set accessor for ${this.getName()}.`),this)}getStructure(){return he(Vl.prototype,this,{kind:e.StructureKind.GetAccessor})}},Ul=(e=>wn(oa(_e(Tn(Ma(ha(_a(Ui(ua(An(la(Vi(xa(aa(Gi(e))))))))))))))))(ml),Wl=class extends Ul{hasAccessorKeyword(){return this.hasModifier(t.SyntaxKind.AccessorKeyword)}setHasAccessorKeyword(e){return this.toggleModifier(`accessor`,e)}set(e){return ge(Ul.prototype,this,e),e.hasAccessorKeyword!=null&&this.setHasAccessorKeyword(e.hasAccessorKeyword),this}remove(){let e=this.getParentOrThrow();switch(e.getKind()){case t.SyntaxKind.ClassDeclaration:super.remove();break;default:throw new t.errors.NotImplementedError(`Not implemented parent syntax kind: ${e.getKindName()}`)}}getStructure(){return he(Ul.prototype,this,{kind:e.StructureKind.Property,hasAccessorKeyword:this.hasAccessorKeyword()})}},Gl=(e=>wn(va(Tn(Ma(ha(_a(Qc(Cn(aa(e))))))))))(ml),Kl=class extends Gl{set(e){return ge(Gl.prototype,this,e),this}getGetAccessor(){let e=this.getName(),t=this.isStatic();return this.getParentOrThrow().forEachChild(n=>{if(V.isGetAccessorDeclaration(n)&&n.getName()===e&&n.isStatic()===t)return n})}getGetAccessorOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getGetAccessor(),e??(()=>`Expected to find a corresponding get accessor for ${this.getName()}.`),this)}getStructure(){return he(Gl.prototype,this,{kind:e.StructureKind.SetAccessor})}},ql=Ya(V),Jl=class extends ql{getName(){return this.getNameNode().getText()}getNameNode(){let e=this.getCallExpression();if(e)return n(e.getExpression());return n(this._getInnerExpression());function n(e){let n=r(e);if(!V.isIdentifier(n))throw new t.errors.NotImplementedError(`Expected the decorator expression '${n.getText()}' to be an identifier. Please deal directly with 'getExpression()' on the decorator to handle more complex scenarios.`);return n}function r(e){return V.isPropertyAccessExpression(e)?e.getNameNode():e}}getFullName(){let e=this.getSourceFile();return this.isDecoratorFactory()?this.getCallExpression().getExpression().getText():this.compilerNode.expression.getText(e.compilerNode)}isDecoratorFactory(){return V.isCallExpression(this._getInnerExpression())}setIsDecoratorFactory(e){if(this.isDecoratorFactory()===e)return this;if(e){let e=this._getInnerExpression(),t=e.getText();At({parent:this,insertPos:e.getStart(),newText:`${t}()`,replacing:{textLength:t.length},customMappings:t=>[{currentNode:e,newNode:t.expression.expression}]})}else{let e=this.getCallExpressionOrThrow(),t=e.getExpression(),n=t.getText();At({parent:this,insertPos:e.getStart(),newText:`${n}`,replacing:{textLength:e.getWidth()},customMappings:e=>[{currentNode:t,newNode:e.expression}]})}return this}getCallExpressionOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getCallExpression(),e??`Expected to find a call expression.`,this)}getCallExpression(){let e=this._getInnerExpression();return V.isCallExpression(e)?e:void 0}getArguments(){return this.getCallExpression()?.getArguments()??[]}getTypeArguments(){return this.getCallExpression()?.getTypeArguments()??[]}addTypeArgument(e){return this.getCallExpressionOrThrow().addTypeArgument(e)}addTypeArguments(e){return this.getCallExpressionOrThrow().addTypeArguments(e)}insertTypeArgument(e,t){return this.getCallExpressionOrThrow().insertTypeArgument(e,t)}insertTypeArguments(e,t){return this.getCallExpressionOrThrow().insertTypeArguments(e,t)}removeTypeArgument(e){let n=this.getCallExpression();if(n==null)throw new t.errors.InvalidOperationError(`Cannot remove a type argument from a decorator that has no type arguments.`);return n.removeTypeArgument(e),this}addArgument(e){return this.addArguments([e])[0]}addArguments(e){return this.insertArguments(this.getArguments().length,e)}insertArgument(e,t){return this.insertArguments(e,[t])[0]}insertArguments(e,t){return this.setIsDecoratorFactory(!0),this.getCallExpressionOrThrow().insertArguments(e,t)}removeArgument(e){let n=this.getCallExpression();if(n==null)throw new t.errors.InvalidOperationError(`Cannot remove an argument from a decorator that has no arguments.`);return n.removeArgument(e),this}remove(){let e=this.getStartLinePos(),n=this.getPreviousSiblingIfKind(t.SyntaxKind.Decorator);n!=null&&n.getStartLinePos()===e?Lt({children:[this],removePrecedingSpaces:!0}):Rt({children:[this],getSiblingFormatting:(t,n)=>n.getStartLinePos()===e?ve.Space:ve.Newline})}_getInnerExpression(){let e=this.getExpression();for(;V.isParenthesizedExpression(e);)e=e.getExpression();return e}set(e){return ge(ql.prototype,this,e),e.name!=null&&this.getNameNode().replaceWithText(e.name),e.arguments!=null&&(this.setIsDecoratorFactory(!0),this.getArguments().map(e=>this.removeArgument(e)),this.addArguments(e.arguments)),e.typeArguments!=null&&e.typeArguments.length>0&&(this.setIsDecoratorFactory(!0),this.getTypeArguments().map(e=>this.removeTypeArgument(e)),this.addTypeArguments(e.typeArguments)),this}getStructure(){let t=this.isDecoratorFactory();return he(ql.prototype,this,{kind:e.StructureKind.Decorator,name:this.getName(),arguments:t?this.getArguments().map(e=>e.getText()):void 0,typeArguments:t?this.getTypeArguments().map(e=>e.getText()):void 0})}};function Yl(e){return class extends e{getTypeExpression(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression)}getTypeExpressionOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeExpression(),e??`Expected to find a JS doc type expression.`,this)}getName(){return this.getNameNode().getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}isBracketed(){return this.compilerNode.isBracketed}}}function Xl(e){return class extends e{getTypeExpression(){let e=this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression);if(!(e!=null&&e.getWidth()===0))return e}getTypeExpressionOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeExpression(),e??`Expected to find the JS doc tag's type expression.`,this)}}}function Zl(e){return class extends e{getTypeParameters(){return this.compilerNode.typeParameters.map(e=>this._getNodeFromCompilerNode(e)).filter(e=>e.getWidth()>0)}}}function Ql(e){return e.replace(/^\/\*\*[^\S\n]*\n?/,``).replace(/(\r?\n)?[^\S\n]*\*\/$/,``).split(/\n/).map(e=>{let t=n(e);if(t===-1)return e;let r=e[t+1]===` `?t+2:t+1;return e.substring(r)}).join(`
31394
31394
  `);function n(e){for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===o.ASTERISK)return n;if(!t.StringUtils.isWhitespaceCharCode(r))break}return-1}}var $l=V,eu=class extends $l{isMultiLine(){return this.getText().includes(`
31395
- `)}getTags(){return this.compilerNode.tags?.map(e=>this._getNodeFromCompilerNode(e))??[]}getInnerText(){return Ql(this.getText())}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:this.compilerNode.comment.map(e=>this._getNodeFromCompilerNodeIfExists(e))}getCommentText(){return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:t.ts.getTextOfJSDocComment(this.compilerNode.comment)}getDescription(){let e=this.getSourceFile().getFullText(),n=this.getTags()[0]?.getStart()??this.getEnd()-2,r=i(this);return Ql(e.substring(r,Math.max(r,a())));function i(t){let n=t.getStart()+3;return e.charCodeAt(n)===o.SPACE?n+1:n}function a(){return Ne(e,Ne(e,n,e=>e===o.NEWLINE||!t.StringUtils.isWhitespaceCharCode(e)&&e!==o.ASTERISK),e=>e!==o.NEWLINE&&e!==o.CARRIAGE_RETURN)}}setDescription(e){let t=this.getTags(),n=this.getStart()+3,r=t.length>0?Ne(this._sourceFile.getFullText(),t[0].getStart(),e=>e===o.ASTERISK)-1:this.getEnd()-2;return nn({parent:this,newText:i.call(this),replacePos:n,replacingLength:r-n}),this;function i(){let t=this.getIndentationText(),n=this._context.manipulationSettings.getNewLineKindAsString(),r=F(this._getWriter(),e).split(/\r?\n/),i=r[0].length===0,a=r.length===1&&(this.compilerNode.tags?.length??0)===0,o=a?r[0]:r.map(e=>e.length===0?`${t} *`:`${t} * ${e}`).slice(+!!i).join(n);return a?` `+o+` `:n+o+n+t+` `}}addTag(e){return this.addTags([e])[0]}addTags(e){return this.insertTags(this.compilerNode.tags?.length??0,e)}insertTag(e,t){return this.insertTags(e,[t])[0]}insertTags(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=this._getWriterWithQueuedIndentation(),i=this.getTags();if(e=tt(e,i.length),i.length===0&&!this.isMultiLine()){let e=this._context.structurePrinterFactory.forJSDoc();this.replaceWithText(t=>{e.printText(t,{description:this.getDescription(),tags:n})})}else{let t=this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0});r.newLine().write(` * `),t.printTexts(r,n),r.newLine().write(` *`),r.conditionalWrite(e<i.length,` `);let o=a.call(this),c=s.call(this);At({parent:this,insertPos:o,replacing:{textLength:c-o},newText:r.toString()})}return Xe(i,this.getTags(),e,!1);function a(){let n=e<i.length?i[e].getStart():this.getEnd()-2,r=this.getStart()+3;return Math.max(r,Ne(this.getSourceFile().getFullText(),n,e=>!t.StringUtils.isWhitespaceCharCode(e)&&e!==o.ASTERISK))}function s(){return e<i.length?i[e].getStart():this.getEnd()-1}}remove(){Lt({children:[this],removeFollowingSpaces:!0,removeFollowingNewLines:!0})}set(e){return ge($l.prototype,this,e),e.tags==null?(e.description!=null&&this.setDescription(e.description),this):this.replaceWithText(t=>{this._context.structurePrinterFactory.forJSDoc().printText(t,{description:e.description??this.getDescription(),tags:e.tags})})}getStructure(){return he($l.prototype,this,{kind:e.StructureKind.JSDoc,description:this.getDescription(),tags:this.getTags().map(e=>e.getStructure())})}},tu=class extends V{},nu=ba(tu),ru=class extends nu{},iu=class extends tu{getElementTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.elementType)}},au=class extends tu{getCheckType(){return this._getNodeFromCompilerNode(this.compilerNode.checkType)}getExtendsType(){return this._getNodeFromCompilerNode(this.compilerNode.extendsType)}getTrueType(){return this._getNodeFromCompilerNode(this.compilerNode.trueType)}getFalseType(){return this._getNodeFromCompilerNode(this.compilerNode.falseType)}},ou=ga(tu),su=class extends ou{},cu=Ma(Gi(su)),lu=class extends cu{},uu=Ya(ru),du=class extends uu{},fu=Ta(su),pu=class extends fu{},mu=class extends ru{setArgument(e){let t=this.getArgument();if(V.isLiteralTypeNode(t)){let n=t.getLiteral();if(V.isStringLiteral(n))return n.setLiteralValue(e),this}return t.replaceWithText(t=>t.quote(e),this._getWriterWithQueuedChildIndentation()),this}getArgument(){return this._getNodeFromCompilerNode(this.compilerNode.argument)}setQualifier(e){let n=this.getQualifier();return n==null?At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.CloseParenToken).getEnd(),parent:this,newText:this._getWriterWithQueuedIndentation().write(`.`).write(e).toString()}):n.replaceWithText(e,this._getWriterWithQueuedChildIndentation()),this}getQualifierOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQualifier(),e??(()=>`Expected to find a qualifier for the import type: ${this.getText()}`),this)}getQualifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.qualifier)}getAttributes(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes)}getAttributesOrThrow(e){return t.errors.throwIfNullOrUndefined(this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes),e??`Could not find import type assertion container.`,this)}},hu=class extends tu{getObjectTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.objectType)}getIndexTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.indexType)}},gu=class extends tu{getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}},_u=class extends tu{getTypeNodes(){return this.compilerNode.types.map(e=>this._getNodeFromCompilerNode(e))}},vu=class extends tu{getLiteral(){let e=this.compilerNode.literal;return this._getNodeFromCompilerNode(e)}},yu=class extends tu{getNameTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.nameType)}getNameTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNameTypeNode(),e??`Type did not exist.`,this)}getReadonlyToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.readonlyToken)}getReadonlyTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getReadonlyToken(),e??`Readonly token did not exist.`,this)}getQuestionToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionToken)}getQuestionTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQuestionToken(),e??`Question token did not exist.`,this)}getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeNode(),e??`Type did not exist, but was expected to exist.`,this)}},bu=(e=>xa(la(kn(Ui(ia(e))))))(tu),xu=class extends bu{getTypeNode(){return super.getTypeNode()}removeType(){throw new t.errors.InvalidOperationError(`Cannot remove the type of a named tuple member.`)}},Su=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}setType(e){return this.getTypeNode().replaceWithText(e),this}},Cu=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},wu=class extends tu{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(e=>this._getNodeFromCompilerNode(e))}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()??this.getParentOrThrow();return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},Tu=class extends tu{},Eu=class extends tu{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}},Du=(e=>Ta(xa(Ui(_e(Nn(Gi(ia(e))))))))(fs),Ou=class extends Du{set(e){return ge(Du.prototype,this,e),this}getStructure(){return he(Du.prototype,this,{kind:e.StructureKind.TypeAlias,type:this.getTypeNodeOrThrow().getText()})}},ku=Ca(tu),Au=class extends ku{},ju=class extends tu{getOperator(){return this.compilerNode.operator}getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}};e.TypeParameterVariance=void 0,(function(e){e[e.None=0]=`None`,e[e.In=1]=`In`,e[e.Out=2]=`Out`,e[e.InOut=3]=`InOut`})(e.TypeParameterVariance||={});var Mu=(e=>Gi(ia(e)))(V),Nu=class extends Mu{isConst(){return this.hasModifier(t.SyntaxKind.ConstKeyword)}setIsConst(e){return this.toggleModifier(`const`,e)}getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find the type parameter's constraint.`,this)}setConstraint(e){if(e=this.getParentOrThrow()._getTextWithQueuedChildIndentation(e),t.StringUtils.isNullOrWhitespace(e))return this.removeConstraint(),this;let n=this.getConstraint();if(n!=null)return n.replaceWithText(e),this;let r=this.getNameNode();return At({parent:this,insertPos:r.getEnd(),newText:` extends ${e}`}),this}removeConstraint(){return Pu(this.getConstraint(),t.SyntaxKind.ExtendsKeyword),this}getDefault(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.default)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected to find the type parameter's default.`,this)}setDefault(e){if(e=this.getParentOrThrow()._getTextWithQueuedChildIndentation(e),t.StringUtils.isNullOrWhitespace(e))return this.removeDefault(),this;let n=this.getDefault();if(n!=null)return n.replaceWithText(e),this;let r=this.getConstraint()||this.getNameNode();return At({parent:this,insertPos:r.getEnd(),newText:` = ${e}`}),this}removeDefault(){return Pu(this.getDefault(),t.SyntaxKind.EqualsToken),this}setVariance(t){return this.toggleModifier(`in`,(t&e.TypeParameterVariance.In)!==0),this.toggleModifier(`out`,(t&e.TypeParameterVariance.Out)!==0),this}getVariance(){let n=e.TypeParameterVariance.None;return this.hasModifier(t.SyntaxKind.InKeyword)&&(n|=e.TypeParameterVariance.In),this.hasModifier(t.SyntaxKind.OutKeyword)&&(n|=e.TypeParameterVariance.Out),n}remove(){let e=this.getParentSyntaxListOrThrow();e.getChildrenOfKind(t.SyntaxKind.TypeParameter).length===1?n():Wt(this);function n(){Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.LessThanToken),e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.GreaterThanToken)]})}}set(e){return ge(Mu.prototype,this,e),e.isConst!=null&&this.setIsConst(e.isConst),e.constraint==null?e.hasOwnProperty(t.nameof(e,`constraint`))&&this.removeConstraint():this.setConstraint(e.constraint),e.default==null?e.hasOwnProperty(t.nameof(e,`default`))&&this.removeDefault():this.setDefault(e.default),e.variance!=null&&this.setVariance(e.variance),this}getStructure(){let t=this.getConstraint(),n=this.getDefault();return he(Mu.prototype,this,{kind:e.StructureKind.TypeParameter,isConst:this.isConst(),constraint:t?.getText({trimLeadingIndentation:!0}),default:n?n.getText({trimLeadingIndentation:!0}):void 0,variance:this.getVariance()})}};function Pu(e,t){e!=null&&Lt({children:[e.getPreviousSiblingIfKindOrThrow(t),e],removePrecedingSpaces:!0})}var Fu=class extends tu{getParameterNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.parameterName)}hasAssertsModifier(){return this.compilerNode.assertsModifier!=null}getAssertsModifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertsModifier)}getAssertsModifierOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAssertsModifier(),e??`Expected to find an asserts modifier.`,this)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeNode(),e??`Expected to find a type node.`,this)}},Iu=class extends ru{getExprName(){return this._getNodeFromCompilerNode(this.compilerNode.exprName)}},Lu=class extends ru{getTypeName(){return this._getNodeFromCompilerNode(this.compilerNode.typeName)}},Ru=class extends tu{getTypeNodes(){return this.compilerNode.types.map(e=>this._getNodeFromCompilerNode(e))}},zu=class extends tu{},Bu=class extends zu{},Vu=V,Hu=class extends Vu{getTagName(){return this.getTagNameNode().getText()}getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}setTagName(e){return this.set({tagName:e})}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:this.compilerNode.comment.map(e=>this._getNodeFromCompilerNodeIfExists(e))}getCommentText(){return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:t.ts.getTextOfJSDocComment(this.compilerNode.comment)}remove(){let e=this.getParentOrThrow().getStart()+3,t=Ku(this),n=t==null,r=i.call(this);Lt({children:[this],customRemovalPos:r,customRemovalEnd:Gu(this,t),replaceTrivia:a.call(this)});function i(){return Math.max(e,qu(this,this.getStart()))}function a(){return r===e&&n?``:`${this._context.manipulationSettings.getNewLineKindAsString()}${this.getParentOrThrow().getIndentationText()} `+(n?``:`* `)}}set(e){return ge(Vu.prototype,this,e),e.text!=null||e.tagName!=null?this.replaceWithText(t=>{this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0}).printText(t,{tagName:e.tagName??this.getTagName(),text:e.text==null?Uu(this):e.text})}):this}replaceWithText(e){let t=F(this._getWriterWithQueuedIndentation(),e),n=this.getParentOrThrow(),r=this.getChildIndex(),i=this.getStart();return At({parent:n,insertPos:i,newText:t,replacing:{textLength:Wu(this)-i}}),n.getChildren()[r]}getStructure(){let t=Uu(this);return he(Vu.prototype,this,{kind:e.StructureKind.JSDocTag,tagName:this.getTagName(),text:t.length===0?void 0:t})}};function Uu(e){let t=e.getSourceFile().getFullText(),n=e.getTagNameNode().getEnd(),r=Wu(e),i=Math.min(t.charCodeAt(n)===o.SPACE?n+1:n,r);return Ql(t.substring(i,r))}function Wu(e){return qu(e,Gu(e))}function Gu(e,t){return t??=Ku(e),t==null?e.getParentOrThrow().getEnd()-2:t.getStart()}function Ku(e){let n=e.getParentIfKindOrThrow(t.SyntaxKind.JSDoc).getTags();return n[n.indexOf(e)+1]}function qu(e,n){return Ne(e.getSourceFile().getFullText(),n,e=>e!==o.ASTERISK&&!t.StringUtils.isWhitespaceCharCode(e))}var Ju=class extends Hu{},Yu=class extends Hu{},Xu=class extends Hu{},Zu=class extends Hu{},Qu=class extends Hu{},$u=class extends Hu{},ed=ga(zu),td=class extends ed{},nd=class extends Hu{},rd=class extends V{},id=class extends V{},ad=class extends V{},od=class extends V{},sd=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},cd=class extends V{getName(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},ld=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},ud=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},dd=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},fd=Xl(Hu),pd=class extends fd{},md=class extends Hu{},hd=Yl(Hu),gd=class extends hd{},_d=class extends Hu{},J=Yl(Hu),vd=class extends J{},yd=class extends Hu{},bd=class extends Hu{},xd=class extends Hu{},Sd=Xl(Hu),Cd=class extends Sd{},wd=Xl(Hu),Td=class extends wd{},Ed=Xl(Hu),Dd=class extends Ed{},Od=class extends zu{getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}},kd=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getName(){return this.compilerObject.name}getText(){return this.compilerObject.text??[]}},Ad=Zl(Hu),jd=class extends Ad{getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find the JS doc template tag's constraint.`,this)}},Md=class extends V{},Nd=Xl(Hu),Pd=class extends Nd{},Fd=Xl(Hu),Id=class extends Fd{},Ld=class extends Hu{},Rd=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},zd=class extends zu{isArrayType(){return this.compilerNode.isArrayType}getPropertyTags(){return this.compilerNode.jsDocPropertyTags?this.compilerNode.jsDocPropertyTags.map(e=>this._getNodeFromCompilerNode(e)):void 0}},Bd=class extends Hu{getTypeExpression(){let e=this.compilerNode.typeExpression;if(!(e!=null&&e.pos===e.end))return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression)}},Vd=class extends Hu{},Hd=class extends zu{},Ud=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},Wd=class extends V{remove(){zt({children:[this],getSiblingFormatting:()=>ve.Newline})}},Gd=(e=>va(Oc(Ui(_e(Nn(Gi(ia(e))))))))(fs),Kd=class extends Gd{set(e){return ge(Gd.prototype,this,e),e.isConst!=null&&this.setIsConstEnum(e.isConst),e.members!=null&&(this.getMembers().forEach(e=>e.remove()),this.addMembers(e.members)),this}addMember(e){return this.addMembers([e])[0]}addMembers(e){return this.insertMembers(this.getMembers().length,e)}insertMember(e,t){return this.insertMembers(e,[t])[0]}insertMembers(e,t){if(t.length===0)return[];let n=this.getMembersWithComments();e=tt(e,n.length);let r=this._getWriterWithChildIndentation();return this._context.structurePrinterFactory.forEnumMember().printTexts(r,t),Mt({parent:this.getChildSyntaxListOrThrow(),currentNodes:n,insertIndex:e,newText:r.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),Xe(n,this.getMembersWithComments(),e,!i());function i(){return t instanceof Array?t.every(e=>typeof e==`object`):!1}}getMember(e){return s(this.getMembers(),e)}getMemberOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getMember(e),()=>l(`enum member`,e))}getMembers(){return this.compilerNode.members.map(e=>this._getNodeFromCompilerNode(e))}getMembersWithComments(){let e=this.compilerNode;return T.getContainerArray(e,this.getSourceFile().compilerNode).map(e=>this._getNodeFromCompilerNode(e))}setIsConstEnum(e){return this.toggleModifier(`const`,e)}isConstEnum(){return this.getConstKeyword()!=null}getConstKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.ConstKeyword)}getStructure(){return he(Gd.prototype,this,{kind:e.StructureKind.Enum,isConst:this.isConstEnum(),members:this.getMembers().map(e=>e.getStructure())})}},qd=(e=>Ui(Vi(aa(e))))(V),Jd=class extends qd{getValue(){return this._context.typeChecker.getConstantValue(this)}setValue(e){let n;if(typeof e==`string`){let r=this._context.manipulationSettings.getQuoteKind();n=r+t.StringUtils.escapeForWithinString(e,r)+r}else n=e.toString();return this.setInitializer(n),this}remove(){let e=[this],n=this.getNextSiblingIfKind(t.SyntaxKind.CommaToken);n!=null&&e.push(n),zt({children:e,getSiblingFormatting:()=>ve.Newline})}set(e){return ge(qd.prototype,this,e),e.value==null?e.hasOwnProperty(t.nameof(e,`value`))&&e.initializer==null&&this.removeInitializer():this.setValue(e.value),this}getStructure(){return he(qd.prototype,this,{kind:e.StructureKind.EnumMember,value:void 0})}},Yd=class extends V{getTypeNodes(){return this.compilerNode.types?.map(e=>this._getNodeFromCompilerNode(e))??[]}getToken(){return this.compilerNode.token}removeExpression(e){let t=this.getTypeNodes(),n=typeof e==`number`?r(e):e;if(t.length===1){let e=this.getParentSyntaxListOrThrow().getChildren();e.length===1?Lt({children:[e[0].getParentSyntaxListOrThrow()],removePrecedingSpaces:!0}):Lt({children:[this],removePrecedingSpaces:!0})}else Wt(n);return this;function r(e){return t[tt(e,t.length-1)]}}},Xd=class extends V{remove(){Ht(this)}},Zd=(e=>Ta(wn(Ui(ga(e)))))(Xd),Qd=class extends Zd{set(e){return ge(Zd.prototype,this,e),this}getStructure(){return he(Zd.prototype,this,{kind:e.StructureKind.CallSignature})}},$d=class extends Xd{},ef=(e=>Ta(wn(Ui(ga(e)))))(Xd),tf=class extends ef{set(e){return ge(ef.prototype,this,e),this}getStructure(){return he(ef.prototype,this,{kind:e.StructureKind.ConstructSignature})}},nf=(e=>da(wn(Ui(ua(Gi(e))))))(Xd),rf=class extends nf{getKeyName(){return this.getKeyNameNode().getText()}setKeyName(e){t.errors.throwIfWhitespaceOrNotString(e,`name`),this.getKeyName()!==e&&this.getKeyNameNode().replaceWithText(e,this._getWriterWithQueuedChildIndentation())}getKeyNameNode(){let e=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(e.name)}getKeyType(){return this.getKeyNameNode().getType()}setKeyType(e){t.errors.throwIfWhitespaceOrNotString(e,`type`);let n=this.getKeyTypeNode();return n.getText()===e||n.replaceWithText(e,this._getWriterWithQueuedChildIndentation()),this}getKeyTypeNode(){let e=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(e.type)}set(e){return ge(nf.prototype,this,e),e.keyName!=null&&this.setKeyName(e.keyName),e.keyType!=null&&this.setKeyType(e.keyType),this}getStructure(){let t=this.getKeyTypeNode();return he(nf.prototype,this,{kind:e.StructureKind.IndexSignature,keyName:this.getKeyName(),keyType:t.getText()})}},af=(e=>Ca(va(Fi(Ri(Ta(Ui(_e(Oc(Nn(Gi(ia(e))))))))))))(fs),of=class extends af{getBaseTypes(){return this.getType().getBaseTypes()}getBaseDeclarations(){return this.getType().getBaseTypes().map(e=>e.getSymbol()?.getDeclarations()??[]).flat()}getImplementations(){return this.getNameNode().getImplementations()}set(e){return ge(af.prototype,this,e),this}getStructure(){return he(af.prototype,this,{kind:e.StructureKind.Interface})}},sf=(e=>wn(Ui(la(Ta(ga(aa(e)))))))(Xd),cf=class extends sf{set(e){return ge(sf.prototype,this,e),this}getStructure(){return he(sf.prototype,this,{kind:e.StructureKind.MethodSignature})}},lf=(e=>wn(Ui(ua(la(Vi(xa(aa(Gi(e)))))))))(Xd),uf=class extends lf{set(e){return ge(lf.prototype,this,e),this}getStructure(){return he(lf.prototype,this,{kind:e.StructureKind.PropertySignature})}};function df(e){return class extends e{getAttributes(){return this.compilerNode.attributes.properties.map(e=>this._getNodeFromCompilerNode(e))}getAttributeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAttribute(e),()=>l(`attribute`,e))}getAttribute(e){return s(this.getAttributes(),e)}addAttribute(e){return this.addAttributes([e])[0]}addAttributes(e){return this.insertAttributes(this.compilerNode.attributes.properties.length,e)}insertAttribute(e,t){return this.insertAttributes(e,[t])[0]}insertAttributes(e,n){if(n.length===0)return[];let r=this.compilerNode.attributes.properties.length;e=tt(e,r);let i=e===0?this.getTagNameNode().getEnd():this.getAttributes()[e-1].getEnd(),a=this._getWriterWithQueuedChildIndentation();return new Gn(this._context.structurePrinterFactory.forJsxAttributeDecider()).printText(a,n),At({insertPos:i,newText:` `+a.toString(),parent:this.getNodeProperty(`attributes`).getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList)}),Xe(r,this.getAttributes(),e,!1)}set(t){return ge(e.prototype,this,t),t.attributes!=null&&(this.getAttributes().forEach(e=>e.remove()),this.addAttributes(t.attributes)),this}getStructure(){return he(e.prototype,this,{attributes:this.getAttributes().map(e=>e.getStructure())})}}}function ff(e){return class extends e{getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}set(t){return ge(e.prototype,this,t),t.name!=null&&this.getTagNameNode().replaceWithText(t.name),this}getStructure(){return he(e.prototype,this,{name:this.getTagNameNode().getText()})}}}function pf(e){return class extends e{getText(){return this.compilerNode.text}getDefinitionNodes(){return this.getDefinitions().map(e=>e.getDeclarationNode()).filter(e=>e!=null)}getDefinitions(){return this._context.languageService.getDefinitions(this)}}}var mf=qa(V),hf=class extends mf{},gf=pf(Yi(Zi(Ua))),_f=class extends gf{getImplementations(){return this._context.languageService.getImplementations(this)}},vf=pf(Yi(Zi(V))),yf=class extends vf{},bf=class extends V{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}getRight(){return this._getNodeFromCompilerNode(this.compilerNode.right)}},xf=V,Sf=class extends xf{getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}setName(e){return this.getNameNode().replaceWithText(t=>{typeof e==`object`?this._context.structurePrinterFactory.forJsxNamespacedName().printText(t,e):t.write(e)}),this}getInitializerOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInitializer(),e??`Expected to find an initializer for the JSX attribute '${this.getNameNode().getText()}'`,this)}getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}setInitializer(e){let n=F(this._getWriterWithQueuedIndentation(),e);if(t.StringUtils.isNullOrWhitespace(n))return this.removeInitializer(),this;let r=this.getInitializer();return r==null?(At({insertPos:this.getNameNode().getEnd(),parent:this,newText:`=${n}`}),this):(r.replaceWithText(n),this)}removeInitializer(){let e=this.getInitializer();return e==null||Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.EqualsToken),e],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this}remove(){Lt({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(e){return ge(xf.prototype,this,e),e.name!=null&&this.setName(e.name),e.initializer==null?e.hasOwnProperty(t.nameof(e,`initializer`))&&this.removeInitializer():this.setInitializer(e.initializer),this}getStructure(){let t=this.getInitializer(),n=this.getNameNode();return he(xf.prototype,this,{name:n instanceof _f?n.getText():n.getStructure(),kind:e.StructureKind.JsxAttribute,initializer:t?.getText()})}},Cf=(e=>ff(e))(V),wf=class extends Cf{},Tf=class extends Na{},Ef=Ua,Df=class extends Ef{getJsxChildren(){return this.compilerNode.children.map(e=>this._getNodeFromCompilerNode(e))}getOpeningElement(){return this._getNodeFromCompilerNode(this.compilerNode.openingElement)}getClosingElement(){return this._getNodeFromCompilerNode(this.compilerNode.closingElement)}setBodyText(e){let t=un(this._getWriterWithIndentation(),e);return Of(this,t),this}setBodyTextInline(e){let t=this._getWriterWithQueuedChildIndentation();return ie(t,e),t.isLastNewLine()&&(t.setIndentationLevel(Math.max(0,this.getIndentationLevel()-1)),t.write(``)),Of(this,t.toString()),this}set(e){if(ge(Ef.prototype,this,e),e.attributes!=null){let t=this.getOpeningElement();t.getAttributes().forEach(e=>e.remove()),t.addAttributes(e.attributes)}if(e.children!=null)throw new t.errors.NotImplementedError(`Setting JSX children is currently not implemented. Please open an issue if you need this.`);return e.bodyText==null?e.hasOwnProperty(t.nameof(e,`bodyText`))&&this.setBodyTextInline(``):this.setBodyText(e.bodyText),e.name!=null&&(this.getOpeningElement().getTagNameNode().replaceWithText(e.name),this.getClosingElement().getTagNameNode().replaceWithText(e.name)),this}getStructure(){let t=this.getOpeningElement(),n=he(Ef.prototype,this,{kind:e.StructureKind.JsxElement,name:t.getTagNameNode().getText(),attributes:t.getAttributes().map(e=>e.getStructure()),children:void 0,bodyText:dn(this)});return delete n.children,n}};function Of(e,t){let n=e.getOpeningElement(),r=e.getClosingElement();At({insertPos:n.getEnd(),newText:t,parent:e.getChildSyntaxListOrThrow(),replacing:{textLength:r.getStart()-n.getEnd()}})}var kf=Ga(kn(Na)),Af=class extends kf{},jf=class extends Ua{getJsxChildren(){return this.compilerNode.children.map(e=>this._getNodeFromCompilerNode(e))}getOpeningFragment(){return this._getNodeFromCompilerNode(this.compilerNode.openingFragment)}getClosingFragment(){return this._getNodeFromCompilerNode(this.compilerNode.closingFragment)}},Mf=V,Nf=class extends Mf{getNamespaceNode(){return this._getNodeFromCompilerNode(this.compilerNode.namespace)}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}set(e){return this.getNamespaceNode().replaceWithText(e.namespace),this.getNameNode().replaceWithText(e.name),this}getStructure(){return{namespace:this.getNamespaceNode().getText(),name:this.getNameNode().getText()}}},Pf=(e=>df(ff(e)))(Na),Ff=class extends Pf{},If=class extends Na{},Lf=(e=>df(ff(e)))(Ua),Rf=class extends Lf{set(e){return ge(Lf.prototype,this,e),this}getStructure(){return he(Lf.prototype,this,{kind:e.StructureKind.JsxSelfClosingElement})}},zf=qa(V),Bf=class extends zf{remove(){Lt({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(e){return ge(zf.prototype,this,e),e.expression!=null&&this.setExpression(e.expression),this}getStructure(){return he(zf.prototype,this,{kind:e.StructureKind.JsxSpreadAttribute,expression:this.getExpression().getText()})}},Vf=Wi(V),Hf=class extends Vf{containsOnlyTriviaWhiteSpaces(){let e=this.compilerNode;return typeof e.containsOnlyWhiteSpaces==`boolean`?e.containsOnlyWhiteSpaces:this.compilerNode.containsOnlyTriviaWhiteSpaces}},Uf=go,Wf=class extends Uf{getLiteralValue(){let e=this.compilerNode.text;if(typeof BigInt>`u`)throw new t.errors.InvalidOperationError(`Runtime environment does not support BigInts. Perhaps work with the text instead?`);let n=e.substring(0,e.length-1);return BigInt(n)}setLiteralValue(e){if(typeof e!=`bigint`)throw new t.errors.ArgumentTypeError(`value`,`bigint`,typeof e);return B({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:e.toString()+`n`}),this}},Gf=Ua,Kf=class extends Gf{getLiteralValue(){return Xf(this)}setLiteralValue(e){return Yf(this,e)}},qf=Ua,Jf=class extends qf{getLiteralValue(){return Xf(this)}setLiteralValue(e){return Yf(this,e)}};function Yf(e,t){if(Xf(e)===t)return e;let n=e.getParentSyntaxList()||e.getParentOrThrow(),r=e.getChildIndex();return e.replaceWithText(t?`true`:`false`),n.getChildAtIndex(r)}function Xf(e){return e.getKind()===t.SyntaxKind.TrueKeyword}var Zf=Ua,Qf=class extends Zf{},$f=go,ep=class extends $f{getLiteralValue(){let e=this.compilerNode.text;return e.indexOf(`.`)>=0?parseFloat(e):parseInt(e,10)}setLiteralValue(e){return B({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:e.toString(10)}),this}};e.QuoteKind=void 0,(function(e){e.Single=`'`,e.Double=`"`})(e.QuoteKind||={});var tp=go,np=class extends tp{getLiteralValue(){let e=/^\/(.*)\/([^\/]*)$/,t=this.compilerNode.text,n=e.exec(t);return new RegExp(n[1],n[2])}setLiteralValue(e,t){let n;return typeof e==`string`?n=e:(n=e.source,t=e.flags),B({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:`/${n}/${t||``}`}),this}},rp=go,ip=class extends rp{getLiteralValue(){return this.compilerNode.text}setLiteralValue(e){return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:t.StringUtils.escapeForWithinString(e,this.getQuoteKind())}),this}getQuoteKind(){return this.getText()[0]===`'`?e.QuoteKind.Single:e.QuoteKind.Double}},ap=go,op=class extends ap{getLiteralValue(){return this.compilerNode.text}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()||this.getParentOrThrow();return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},sp=class extends Ha{getTag(){return this._getNodeFromCompilerNode(this.compilerNode.tag)}getTemplate(){return this._getNodeFromCompilerNode(this.compilerNode.template)}removeTag(){let e=this.getParentSyntaxList()??this.getParentOrThrow(),t=this.getChildIndex(),n=this.getTemplate();return At({customMappings:(e,r)=>[{currentNode:n,newNode:e.getChildren(r)[t]}],parent:e,insertPos:this.getStart(),newText:this.getTemplate().getText(),replacing:{textLength:this.getWidth(),nodes:[this]}}),e.getChildAtIndex(t)}},cp=Ua,lp=class extends cp{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(e=>this._getNodeFromCompilerNode(e))}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()??this.getParentOrThrow();return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},up=Wi(V),dp=class extends up{},fp=Wi(V),pp=class extends fp{},mp=qa(V),hp=class extends mp{getLiteral(){return this._getNodeFromCompilerNode(this.compilerNode.literal)}},gp=Wi(V),_p=class extends gp{},vp=(e=>jn(An(xa(Vi(Qi(e))))))(V),yp=class extends vp{remove(){let e=this.getParentOrThrow();switch(e.getKind()){case t.SyntaxKind.VariableDeclarationList:n(this);break;case t.SyntaxKind.CatchClause:r(this);break;default:throw new t.errors.NotImplementedError(`Not implemented for syntax kind: ${e.getKindName()}`)}function n(n){let r=e.getParentIfKindOrThrow(t.SyntaxKind.VariableStatement);r.getDeclarations().length===1?r.remove():Wt(n)}function r(e){Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.OpenParenToken),e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.CloseParenToken)],removePrecedingSpaces:!0})}}getVariableStatementOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getVariableStatement(),e??`Expected the grandparent to be a variable statement.`,this)}getVariableStatement(){let e=this.getParentOrThrow().getParentOrThrow();return V.isVariableStatement(e)?e:void 0}set(e){return ge(vp.prototype,this,e),this}getStructure(){return he(vp.prototype,this,{kind:e.StructureKind.VariableDeclaration})}},bp=Gi(V),xp=class extends bp{getDeclarations(){return this.compilerNode.declarations.map(e=>this._getNodeFromCompilerNode(e))}getDeclarationKind(){let n=this.compilerNode.flags;return n&t.ts.NodeFlags.Let?e.VariableDeclarationKind.Let:(n&t.ts.NodeFlags.AwaitUsing)===t.ts.NodeFlags.AwaitUsing?e.VariableDeclarationKind.AwaitUsing:(n&t.ts.NodeFlags.Using)===t.ts.NodeFlags.Using?e.VariableDeclarationKind.Using:n&t.ts.NodeFlags.Const?e.VariableDeclarationKind.Const:e.VariableDeclarationKind.Var}getDeclarationKindKeywords(){let n=this.getDeclarationKind();switch(n){case e.VariableDeclarationKind.Const:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.ConstKeyword)];case e.VariableDeclarationKind.Let:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.LetKeyword)];case e.VariableDeclarationKind.Var:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.VarKeyword)];case e.VariableDeclarationKind.Using:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.UsingKeyword)];case e.VariableDeclarationKind.AwaitUsing:let r=this.getFirstChildByKindOrThrow(t.SyntaxKind.AwaitKeyword);return[r,r.getNextSiblingIfKindOrThrow(t.SyntaxKind.UsingKeyword)];default:return t.errors.throwNotImplementedForNeverValueError(n)}}setDeclarationKind(e){if(this.getDeclarationKind()===e)return this;let t=this.getDeclarationKindKeywords(),n=t[0].getStart(),r=t[t.length-1].getEnd();return At({insertPos:n,newText:e,parent:this,replacing:{textLength:r-n}}),this}addDeclaration(e){return this.addDeclarations([e])[0]}addDeclarations(e){return this.insertDeclarations(this.getDeclarations().length,e)}insertDeclaration(e,t){return this.insertDeclarations(e,[t])[0]}insertDeclarations(e,n){let r=this._getWriterWithQueuedChildIndentation(),i=new Vn(this._context.structurePrinterFactory.forVariableDeclaration()),a=this.compilerNode.declarations.length;return e=tt(e,a),i.printText(r,n),Mt({parent:this.getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:this.getDeclarations(),insertIndex:e,newText:r.toString(),useTrailingCommas:!1}),Xe(a,this.getDeclarations(),e,!1)}},Sp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerSignature(){return this.#t}getTypeParameters(){return(this.compilerSignature.typeParameters||[]).map(e=>this.#e.compilerFactory.getTypeParameter(e))}getParameters(){return this.compilerSignature.parameters.map(e=>this.#e.compilerFactory.getSymbol(e))}getReturnType(){return this.#e.compilerFactory.getType(this.compilerSignature.getReturnType())}getDocumentationComments(){return this.compilerSignature.getDocumentationComment(this.#e.typeChecker.compilerObject).map(e=>this.#e.compilerFactory.getSymbolDisplayPart(e))}getJsDocTags(){return this.compilerSignature.getJsDocTags().map(e=>this.#e.compilerFactory.getJSDocTagInfo(e))}getDeclaration(){let{compilerFactory:e}=this.#e,t=this.compilerSignature.getDeclaration();return e.getNodeFromCompilerNode(t,e.getSourceFileForNode(t))}},Cp=class{#e;#t;get compilerSymbol(){return this.#t}constructor(e,t){this.#e=e,this.#t=t,this.getValueDeclaration(),this.getDeclarations()}getName(){return this.compilerSymbol.getName()}getEscapedName(){return this.compilerSymbol.getEscapedName()}getAliasedSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAliasedSymbol(),e??`Expected to find an aliased symbol.`)}getImmediatelyAliasedSymbol(){return this.#e.typeChecker.getImmediatelyAliasedSymbol(this)}getImmediatelyAliasedSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getImmediatelyAliasedSymbol(),e??`Expected to find an immediately aliased symbol.`)}getAliasedSymbol(){return this.#e.typeChecker.getAliasedSymbol(this)}getExportSymbol(){return this.#e.typeChecker.getExportSymbolOfSymbol(this)}isAlias(){return(this.getFlags()&t.SymbolFlags.Alias)===t.SymbolFlags.Alias}isOptional(){return(this.getFlags()&t.SymbolFlags.Optional)===t.SymbolFlags.Optional}getFlags(){return this.compilerSymbol.getFlags()}hasFlags(e){return(this.compilerSymbol.flags&e)===e}getValueDeclarationOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getValueDeclaration(),e??(()=>`Expected to find the value declaration of symbol '${this.getName()}'.`))}getValueDeclaration(){let e=this.compilerSymbol.valueDeclaration;if(e!=null)return this.#e.compilerFactory.getNodeFromCompilerNode(e,this.#e.compilerFactory.getSourceFileForNode(e))}getDeclarations(){return(this.compilerSymbol.declarations??[]).map(e=>this.#e.compilerFactory.getNodeFromCompilerNode(e,this.#e.compilerFactory.getSourceFileForNode(e)))}getExportOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getExport(e),n??(()=>`Expected to find export with name: ${e}`))}getExport(e){if(this.compilerSymbol.exports==null)return;let n=this.compilerSymbol.exports.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getExports(){return this.compilerSymbol.exports==null?[]:Array.from(this.compilerSymbol.exports.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getGlobalExportOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getGlobalExport(e),n??(()=>`Expected to find global export with name: ${e}`))}getGlobalExport(e){if(this.compilerSymbol.globalExports==null)return;let n=this.compilerSymbol.globalExports.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getGlobalExports(){return this.compilerSymbol.globalExports==null?[]:Array.from(this.compilerSymbol.globalExports.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getMemberOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getMember(e),n??`Expected to find member with name: ${e}`)}getMember(e){if(this.compilerSymbol.members==null)return;let n=this.compilerSymbol.members.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getMembers(){return this.compilerSymbol.members==null?[]:Array.from(this.compilerSymbol.members.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getDeclaredType(){return this.#e.typeChecker.getDeclaredTypeOfSymbol(this)}getTypeAtLocation(e){return this.#e.typeChecker.getTypeOfSymbolAtLocation(this,e)}getFullyQualifiedName(){return this.#e.typeChecker.getFullyQualifiedName(this)}getJsDocTags(){return this.compilerSymbol.getJsDocTags(this.#e.typeChecker.compilerObject).map(e=>new kd(e))}},wp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getStart(){return this.compilerObject.start}getEnd(){return this.compilerObject.start+this.compilerObject.length}getLength(){return this.compilerObject.length}},Tp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getSpan(){return new wp(this.compilerObject.span)}getNewText(){return this.compilerObject.newText}};Vc([t.Memoize],Tp.prototype,`getSpan`,null);var Ep=class{#e;#t;#n;#r;#i;constructor(e,t){this.#e=e,this.#t=t;let n=e.compilerFactory.addOrGetSourceFileFromFilePath(e.fileSystemWrapper.getStandardizedAbsolutePath(t.fileName),{markInProject:!1,scriptKind:void 0});this.#r=n!=null,t.isNewFile||(this.#n=n)}getFilePath(){return this.#t.fileName}getSourceFile(){return this.#n}getTextChanges(){return this.#t.textChanges.map(e=>new Tp(e))}applyChanges(e={}){if(this.#i)return;if(this.isNewFile()&&this.#r&&!e.overwrite)throw new t.errors.InvalidOperationError(`Cannot apply file text change for creating a new file when the file exists at path ${this.getFilePath()}. Did you mean to provide the overwrite option?`);let n;if(n=this.isNewFile()?this.#e.project.createSourceFile(this.getFilePath(),``,{overwrite:e.overwrite}):this.getSourceFile(),n==null)throw new t.errors.InvalidOperationError(`Cannot apply file text change to modify existing file that doesn't exist at path: ${this.getFilePath()}`);return n.applyTextChanges(this.getTextChanges()),n._markAsInProject(),this.#i=!0,this}isNewFile(){return!!this.#t.isNewFile}};Vc([t.Memoize],Ep.prototype,`getTextChanges`,null);var Dp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getDescription(){return this.compilerObject.description}getChanges(){return this.compilerObject.changes.map(e=>new Ep(this.#e,e))}},Op=class extends Dp{getFixName(){return this.compilerObject.fixName}getFixId(){return this.compilerObject.fixId}getFixAllDescription(){return this.compilerObject.fixAllDescription}},kp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getChanges(){return this.compilerObject.changes.map(e=>new Ep(this.#e,e))}applyChanges(e){for(let t of this.getChanges())t.applyChanges(e);return this}};Vc([t.Memoize],kp.prototype,`getChanges`,null);var Ap=class{_context;_compilerObject;_sourceFile;constructor(e,t){this._context=e,this._compilerObject=t,this._sourceFile=this._context.compilerFactory.addOrGetSourceFileFromFilePath(e.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.fileName),{markInProject:!1,scriptKind:void 0}),this._sourceFile._doActionPreNextModification(()=>this.getNode())}get compilerObject(){return this._compilerObject}getSourceFile(){return this._sourceFile}getTextSpan(){return new wp(this.compilerObject.textSpan)}getNode(){let e=this.getTextSpan(),t=this.getSourceFile(),n=e.getStart(),r=e.getEnd();return i();function i(){let e;return t._context.compilerFactory.forgetNodesCreatedInBlock(i=>{let a,o=t;for(;o!=null;){if(a??(e=o),o.getStart()===n&&o.getWidth()===r)e=a=o;else if(a!=null)break;o=o.getChildAtPos(n)}e!=null&&i(e)}),e}}getOriginalTextSpan(){let{originalTextSpan:e}=this.compilerObject;return e==null?void 0:new wp(e)}getOriginalFileName(){return this.compilerObject.originalFileName}};Vc([t.Memoize],Ap.prototype,`getTextSpan`,null),Vc([t.Memoize],Ap.prototype,`getNode`,null),Vc([t.Memoize],Ap.prototype,`getOriginalTextSpan`,null);var jp=class extends Ap{constructor(e,t){super(e,t),this.getSourceFile()._doActionPreNextModification(()=>this.getDeclarationNode())}getKind(){return this.compilerObject.kind}getName(){return this.compilerObject.name}getContainerKind(){return this.compilerObject.containerKind}getContainerName(){return this.compilerObject.containerName}getDeclarationNode(){if(this.getKind()===`module`&&this.getTextSpan().getLength()===this.getSourceFile().getFullWidth())return this.getSourceFile();let e=this.getTextSpan().getStart();return n(this.getSourceFile())?.getParentOrThrow();function n(r){if(r.getKind()===t.SyntaxKind.Identifier&&r.getStart()===e)return r;for(let t of r._getChildrenIterator())if(t.getPos()<=e&&t.getEnd()>e)return n(t)}}};Vc([t.Memoize],jp.prototype,`getDeclarationNode`,null);var Mp=class e{_compilerObject;constructor(e){this._compilerObject=e}get compilerObject(){return this._compilerObject}getMessageText(){return this.compilerObject.messageText}getNext(){let t=this.compilerObject.next;if(t!=null)return t instanceof Array?t.map(t=>new e(t)):[new e(t)]}getCode(){return this.compilerObject.code}getCategory(){return this.compilerObject.category}},Np=class{_context;_compilerObject;constructor(e,t){this._context=e,this._compilerObject=t,this.getSourceFile()}get compilerObject(){return this._compilerObject}getSourceFile(){if(this._context==null)return;let e=this.compilerObject.file;return e==null?void 0:this._context.compilerFactory.getSourceFile(e,{markInProject:!1})}getMessageText(){let e=this._compilerObject.messageText;return typeof e==`string`?e:this._context==null?new Mp(e):this._context.compilerFactory.getDiagnosticMessageChain(e)}getLineNumber(){let e=this.getSourceFile(),n=this.getStart();if(!(e==null||n==null))return t.StringUtils.getLineNumberAtPos(e.getFullText(),n)}getStart(){return this.compilerObject.start}getLength(){return this.compilerObject.length}getCategory(){return this.compilerObject.category}getCode(){return this.compilerObject.code}getSource(){return this.compilerObject.source}};Vc([t.Memoize],Np.prototype,`getSourceFile`,null);var Pp=class extends Np{constructor(e,t){super(e,t)}getLineNumber(){return super.getLineNumber()}getStart(){return super.getStart()}getLength(){return super.getLength()}getSourceFile(){return super.getSourceFile()}},Fp=class{#e;#t;constructor(e,t){this.#e=t,this.#t=e}get compilerObject(){return this.#e}getFilePath(){return this.#t.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.name)}getWriteByteOrderMark(){return this.compilerObject.writeByteOrderMark||!1}getText(){return this.compilerObject.text}},Ip=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getDiagnostics(){return this.compilerObject.diagnostics.map(e=>this.#e.compilerFactory.getDiagnostic(e))}getEmitSkipped(){return this.compilerObject.emitSkipped}getOutputFiles(){return this.compilerObject.outputFiles.map(e=>new Fp(this.#e,e))}};Vc([t.Memoize],Ip.prototype,`getDiagnostics`,null),Vc([t.Memoize],Ip.prototype,`getOutputFiles`,null);var Lp=class{_context;_compilerObject;constructor(e,t){this._context=e,this._compilerObject=t,this.getDiagnostics()}get compilerObject(){return this._compilerObject}getEmitSkipped(){return this.compilerObject.emitSkipped}getDiagnostics(){return this.compilerObject.diagnostics.map(e=>this._context.compilerFactory.getDiagnostic(e))}};Vc([t.Memoize],Lp.prototype,`getDiagnostics`,null);var Rp=class extends Ap{constructor(e,t){super(e,t)}getKind(){return this.compilerObject.kind}getDisplayParts(){return this.compilerObject.displayParts.map(e=>this._context.compilerFactory.getSymbolDisplayPart(e))}};Vc([t.Memoize],Rp.prototype,`getDisplayParts`,null);var zp=class extends Lp{#e;constructor(e,t,n){super(e,t),this.#e=n}getFiles(){return this.#e}saveFiles(){let e=this._context.fileSystemWrapper,t=this.#e.map(t=>e.writeFile(t.filePath,t.writeByteOrderMark?``+t.text:t.text));return Promise.all(t)}saveFilesSync(){let e=this._context.fileSystemWrapper;for(let t of this.#e)e.writeFileSync(t.filePath,t.writeByteOrderMark?``+t.text:t.text)}},Bp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getEdits(){return this.compilerObject.edits.map(e=>new Ep(this.#e,e))}getRenameFilePath(){return this.compilerObject.renameFilename}getRenameLocation(){return this.compilerObject.renameLocation}applyChanges(e){for(let t of this.getEdits())t.applyChanges(e);return this}};Vc([t.Memoize],Bp.prototype,`getEdits`,null);var Vp=class{_context;#e;#t;constructor(e,t){this._context=e,this.#e=t,this.#t=this.compilerObject.references.map(t=>e.compilerFactory.getReferencedSymbolEntry(t))}get compilerObject(){return this.#e}getDefinition(){return this._context.compilerFactory.getReferencedSymbolDefinitionInfo(this.compilerObject.definition)}getReferences(){return this.#t}};Vc([t.Memoize],Vp.prototype,`getDefinition`,null);var Hp=class extends jp{constructor(e,t){super(e,t)}getDisplayParts(){return this.compilerObject.displayParts.map(e=>this._context.compilerFactory.getSymbolDisplayPart(e))}};Vc([t.Memoize],Hp.prototype,`getDisplayParts`,null);var Up=class extends Ap{constructor(e,t){super(e,t)}isWriteAccess(){return this.compilerObject.isWriteAccess}isInString(){return this.compilerObject.isInString}},Wp=class extends Up{constructor(e,t){super(e,t)}isDefinition(){return this.compilerObject.isDefinition}},Gp=class extends Ap{getPrefixText(){return this._compilerObject.prefixText}getSuffixText(){return this._compilerObject.suffixText}},Kp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getText(){return this.compilerObject.text}getKind(){return this.compilerObject.kind}},qp=class{#e;#t;constructor(e){this.#e=e}get compilerObject(){return this.#t()}_reset(e){this.#t=e}getAmbientModules(){return this.compilerObject.getAmbientModules().map(e=>this.#e.compilerFactory.getSymbol(e))}getApparentType(e){return this.#e.compilerFactory.getType(this.compilerObject.getApparentType(e.compilerType))}getConstantValue(e){return this.compilerObject.getConstantValue(e.compilerNode)}getFullyQualifiedName(e){return this.compilerObject.getFullyQualifiedName(e.compilerSymbol)}getTypeAtLocation(e){return this.#e.compilerFactory.getType(this.compilerObject.getTypeAtLocation(e.compilerNode))}getContextualType(e){let t=this.compilerObject.getContextualType(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getType(t)}getTypeOfSymbolAtLocation(e,t){return this.#e.compilerFactory.getType(this.compilerObject.getTypeOfSymbolAtLocation(e.compilerSymbol,t.compilerNode))}getDeclaredTypeOfSymbol(e){return this.#e.compilerFactory.getType(this.compilerObject.getDeclaredTypeOfSymbol(e.compilerSymbol))}getSymbolAtLocation(e){let t=this.compilerObject.getSymbolAtLocation(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getAliasedSymbol(e){if(!e.hasFlags(t.SymbolFlags.Alias))return;let n=this.compilerObject.getAliasedSymbol(e.compilerSymbol);return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getImmediatelyAliasedSymbol(e){let t=this.compilerObject.getImmediateAliasedSymbol(e.compilerSymbol);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getExportSymbolOfSymbol(e){return this.#e.compilerFactory.getSymbol(this.compilerObject.getExportSymbolOfSymbol(e.compilerSymbol))}getPropertiesOfType(e){return this.compilerObject.getPropertiesOfType(e.compilerType).map(e=>this.#e.compilerFactory.getSymbol(e))}getTypeText(e,t,n){return n??=this.#n(t),this.compilerObject.typeToString(e.compilerType,t?.compilerNode,n)}getReturnTypeOfSignature(e){return this.#e.compilerFactory.getType(this.compilerObject.getReturnTypeOfSignature(e.compilerSignature))}getSignatureFromNode(e){let t=this.compilerObject.getSignatureFromDeclaration(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSignature(t)}getExportsOfModule(e){return(this.compilerObject.getExportsOfModule(e.compilerSymbol)||[]).map(e=>this.#e.compilerFactory.getSymbol(e))}getExportSpecifierLocalTargetSymbol(e){let t=this.compilerObject.getExportSpecifierLocalTargetSymbol(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getResolvedSignature(e){let t=this.compilerObject.getResolvedSignature(e.compilerNode);if(!(!t||!t.declaration))return this.#e.compilerFactory.getSignature(t)}getResolvedSignatureOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getResolvedSignature(e),n??`Signature could not be resolved.`,e)}getBaseTypeOfLiteralType(e){return this.#e.compilerFactory.getType(this.compilerObject.getBaseTypeOfLiteralType(e.compilerType))}getSymbolsInScope(e,t){return this.compilerObject.getSymbolsInScope(e.compilerNode,t).map(e=>this.#e.compilerFactory.getSymbol(e))}getTypeArguments(e){return this.compilerObject.getTypeArguments(e.compilerType).map(e=>this.#e.compilerFactory.getType(e))}isTypeAssignableTo(e,t){return this.compilerObject.isTypeAssignableTo(e.compilerType,t.compilerType)}#n(e){let n=t.TypeFormatFlags.UseTypeOfFunction|t.TypeFormatFlags.NoTruncation|t.TypeFormatFlags.UseFullyQualifiedType|t.TypeFormatFlags.WriteTypeArgumentsOfSignature;return e!=null&&e.getKind()===t.SyntaxKind.TypeAliasDeclaration&&(n|=t.TypeFormatFlags.InTypeAlias),n}getShorthandAssignmentValueSymbol(e){let t=this.compilerObject.getShorthandAssignmentValueSymbol(e.compilerNode);return t?this.#e.compilerFactory.getSymbol(t):void 0}resolveName(e,t,n,r){let i=this.compilerObject.resolveName(e,t?.compilerNode,n,r);return i?this.#e.compilerFactory.getSymbol(i):void 0}},Jp=class{#e;#t;#n;#r;#i;#a;constructor(e){this.#e=e.context,this.#a=e.configFileParsingDiagnostics,this.#t=new qp(this.#e),this._reset(e.rootNames,e.host)}get compilerObject(){return this.#i()}_isCompilerProgramCreated(){return this.#n!=null}_reset(e,n){let r=this.#e.compilerOptions.get();this.#i=()=>(this.#n??(this.#n=t.ts.createProgram(e,r,n,this.#r,this.#a),this.#r=void 0),this.#n),this.#n!=null&&(this.#r=this.#n,this.#n=void 0),this.#t._reset(()=>this.compilerObject.getTypeChecker())}getTypeChecker(){return this.#t}async emit(e={}){if(e.writeFile){let n=`Cannot specify a ${t.nameof(e,`writeFile`)} option when emitting asynchrously. Use ${t.nameof(this,`emitSync`)}() instead.`;throw new t.errors.InvalidOperationError(n)}let{fileSystemWrapper:n}=this.#e,r=[],i=this.#o({writeFile:(e,t,i)=>{r.push(n.writeFile(n.getStandardizedAbsolutePath(e),i?``+t:t))},...e});return await Promise.all(r),new Lp(this.#e,i)}emitSync(e={}){return new Lp(this.#e,this.#o(e))}emitToMemory(e={}){let t=[],{fileSystemWrapper:n}=this.#e,r=this.#o({writeFile:(e,r,i)=>{t.push({filePath:n.getStandardizedAbsolutePath(e),text:r,writeByteOrderMark:i||!1})},...e});return new zp(this.#e,r,t)}#o(e={}){let t=e.targetSourceFile==null?void 0:e.targetSourceFile.compilerNode,{emitOnlyDtsFiles:n,customTransformers:r,writeFile:i}=e;return this.compilerObject.emit(t,i,void 0,n,r)}getSyntacticDiagnostics(e){return this.compilerObject.getSyntacticDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnosticWithLocation(e))}getSemanticDiagnostics(e){return this.compilerObject.getSemanticDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnostic(e))}getDeclarationDiagnostics(e){return this.compilerObject.getDeclarationDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnosticWithLocation(e))}getGlobalDiagnostics(){return this.compilerObject.getGlobalDiagnostics().map(e=>this.#e.compilerFactory.getDiagnostic(e))}getConfigFileParsingDiagnostics(){return this.compilerObject.getConfigFileParsingDiagnostics().map(e=>this.#e.compilerFactory.getDiagnostic(e))}getEmitModuleResolutionKind(){return t.getEmitModuleResolutionKind(this.compilerObject.getCompilerOptions())}isSourceFileFromExternalLibrary(e){return e.isFromExternalLibrary()}},Yp=class{#e;#t;#n;#r;#i=0;get compilerObject(){return this.#e}constructor(e){this.#r=e.context;let{languageServiceHost:n,compilerHost:r}=t.createHosts({transactionalFileSystem:this.#r.fileSystemWrapper,sourceFileContainer:this.#r.getSourceFileContainer(),compilerOptions:this.#r.compilerOptions,getNewLine:()=>this.#r.manipulationSettings.getNewLineKindAsString(),getProjectVersion:()=>`${this.#i}`,resolutionHost:e.resolutionHost??{},libFolderPath:e.libFolderPath,skipLoadingLibFiles:e.skipLoadingLibFiles});this.#t=r,this.#e=t.ts.createLanguageService(n,this.#r.compilerFactory.documentRegistry),this.#n=new Jp({context:this.#r,rootNames:Array.from(this.#r.compilerFactory.getSourceFilePaths()),host:this.#t,configFileParsingDiagnostics:e.configFileParsingDiagnostics}),this.#r.compilerFactory.onSourceFileAdded(e=>{e._isInProject()&&this._reset()}),this.#r.compilerFactory.onSourceFileRemoved(()=>this._reset())}_reset(){this.#i+=1,this.#n._reset(Array.from(this.#r.compilerFactory.getSourceFilePaths()),this.#t)}getProgram(){return this.#n}getDefinitions(e){return this.getDefinitionsAtPosition(e._sourceFile,e.getStart())}getDefinitionsAtPosition(e,t){return(this.compilerObject.getDefinitionAtPosition(e.getFilePath(),t)||[]).map(e=>this.#r.compilerFactory.getDefinitionInfo(e))}getImplementations(e){return this.getImplementationsAtPosition(e._sourceFile,e.getStart())}getImplementationsAtPosition(e,t){return(this.compilerObject.getImplementationAtPosition(e.getFilePath(),t)||[]).map(e=>new Rp(this.#r,e))}findReferences(e){return this.findReferencesAtPosition(e._sourceFile,e.getStart())}findReferencesAsNodes(e){let n=this.findReferences(e);return Array.from(r());function*r(){for(let e of n){let n=e.getDefinition().getKind()===t.ts.ScriptElementKind.alias,r=e.getReferences();for(let e=0;e<r.length;e++){let t=r[e];(n||!t.isDefinition()||e>0)&&(yield t.getNode())}}}}findReferencesAtPosition(e,t){return(this.compilerObject.findReferences(e.getFilePath(),t)||[]).map(e=>this.#r.compilerFactory.getReferencedSymbol(e))}findRenameLocations(e,t={}){let n=t.usePrefixAndSuffixText==null?this.#r.manipulationSettings.getUsePrefixAndSuffixTextForRename():t.usePrefixAndSuffixText;return(this.compilerObject.findRenameLocations(e._sourceFile.getFilePath(),e.getStart(),t.renameInStrings||!1,t.renameInComments||!1,n)||[]).map(e=>new Gp(this.#r,e))}getSuggestionDiagnostics(e){let t=this.#a(e);return this.compilerObject.getSuggestionDiagnostics(t).map(e=>this.#r.compilerFactory.getDiagnosticWithLocation(e))}getFormattingEditsForRange(e,t,n){return(this.compilerObject.getFormattingEditsForRange(e,t[0],t[1],this.#o(n))||[]).map(e=>new Tp(e))}getFormattingEditsForDocument(e,t){let n=this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e);return(this.compilerObject.getFormattingEditsForDocument(n,this.#o(t))||[]).map(e=>new Tp(e))}getFormattedDocumentText(e,n){let r=this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e),i=this.#r.compilerFactory.getSourceFileFromCacheFromFilePath(r);if(i==null)throw new t.errors.FileNotFoundError(r);n=this.#o(n);let a=L(i,this.getFormattingEditsForDocument(r,n)),o=n.newLineCharacter;return n.ensureNewLineAtEndOfFile&&!a.endsWith(o)&&(a+=o),a.replace(/\r?\n/g,o)}getEmitOutput(e,t){let n=this.#a(e),r=this.compilerObject;return new Ip(this.#r,i());function i(){let e=r.getProgram();return e==null||e.getSourceFile(n)==null?{emitSkipped:!0,outputFiles:[],diagnostics:[]}:r.getEmitOutput(n,t)}}getIdentationAtPosition(e,t,n){let r=this.#a(e);return n==null?n=this.#r.manipulationSettings.getEditorSettings():N(n,this.#r.manipulationSettings),this.compilerObject.getIndentationAtPosition(r,t,n)}organizeImports(e,t={},n={}){let r={type:`file`,fileName:this.#a(e)};return this.compilerObject.organizeImports(r,this.#o(t),this.#s(n)).map(e=>new Ep(this.#r,e))}getEditsForRefactor(e,t,n,r,i,a={}){let o=this.#a(e),s=typeof n==`number`?n:{pos:n.getPos(),end:n.getEnd()},c=this.compilerObject.getEditsForRefactor(o,this.#o(t),s,r,i,this.#s(a));return c==null?void 0:new Bp(this.#r,c)}getCombinedCodeFix(e,t,n={},r={}){let i=this.compilerObject.getCombinedCodeFix({type:`file`,fileName:this.#a(e)},t,this.#o(n),this.#s(r||{}));return new kp(this.#r,i)}getCodeFixesAtPosition(e,t,n,r,i={},a={}){let o=this.#a(e);return this.compilerObject.getCodeFixesAtPosition(o,t,n,r,this.#o(i),this.#s(a||{})).map(e=>new Op(this.#r,e))}#a(e){let n=typeof e==`string`?this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e):e.getFilePath();if(!this.#r.compilerFactory.containsSourceFileAtPath(n))throw new t.errors.FileNotFoundError(n);return n}#o(e){return e._filled?e:(e=Object.assign(this.#r.getFormatCodeSettings(),e),P(e,this.#r.manipulationSettings),e._filled=!0,e)}#s(e){return Object.assign(this.#r.getUserPreferences(),e)}},Xp=class{_context;#e;get compilerType(){return this.#e}constructor(e,t){this._context=e,this.#e=t}getText(e,t){return this._context.typeChecker.getTypeText(this,e,t)}getAliasSymbol(){return this.compilerType.aliasSymbol==null?void 0:this._context.compilerFactory.getSymbol(this.compilerType.aliasSymbol)}getAliasSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAliasSymbol(),`Expected to find an alias symbol.`)}getAliasTypeArguments(){return(this.compilerType.aliasTypeArguments||[]).map(e=>this._context.compilerFactory.getType(e))}getApparentType(){return this._context.typeChecker.getApparentType(this)}getArrayElementTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getArrayElementType(),e??`Expected to find an array element type.`)}getArrayElementType(){if(this.isArray())return this.getTypeArguments()[0]}getBaseTypes(){return(this.compilerType.getBaseTypes()||[]).map(e=>this._context.compilerFactory.getType(e))}getBaseTypeOfLiteralType(){return this._context.typeChecker.getBaseTypeOfLiteralType(this)}getCallSignatures(){return this.compilerType.getCallSignatures().map(e=>this._context.compilerFactory.getSignature(e))}getConstructSignatures(){return this.compilerType.getConstructSignatures().map(e=>this._context.compilerFactory.getSignature(e))}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find a constraint.`)}getConstraint(){let e=this.compilerType.getConstraint();return e==null?void 0:this._context.compilerFactory.getType(e)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected to find a default type.`)}getDefault(){let e=this.compilerType.getDefault();return e==null?void 0:this._context.compilerFactory.getType(e)}getProperties(){return this.compilerType.getProperties().map(e=>this._context.compilerFactory.getSymbol(e))}getPropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getProperty(e),()=>l(`symbol property`,e))}getProperty(e){return ee(this.getProperties(),e)}getApparentProperties(){return this.compilerType.getApparentProperties().map(e=>this._context.compilerFactory.getSymbol(e))}getApparentProperty(e){return ee(this.getApparentProperties(),e)}isNullable(){return this.getUnionTypes().some(e=>e.isNull()||e.isUndefined())}getNonNullableType(){return this._context.compilerFactory.getType(this.compilerType.getNonNullableType())}getNumberIndexType(){let e=this.compilerType.getNumberIndexType();return e==null?void 0:this._context.compilerFactory.getType(e)}getStringIndexType(){let e=this.compilerType.getStringIndexType();return e==null?void 0:this._context.compilerFactory.getType(e)}getTargetType(){let e=this.compilerType.target||void 0;return e==null?void 0:this._context.compilerFactory.getType(e)}getTargetTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTargetType(),e??`Expected to find the target type.`)}getTypeArguments(){return this._context.typeChecker.getTypeArguments(this)}getTupleElements(){return this.isTuple()?this.getTypeArguments():[]}getUnionTypes(){return this.isUnion()?this.compilerType.types.map(e=>this._context.compilerFactory.getType(e)):[]}getIntersectionTypes(){return this.isIntersection()?this.compilerType.types.map(e=>this._context.compilerFactory.getType(e)):[]}getLiteralValue(){return this.compilerType?.value}getLiteralValueOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralValue(),e??`Type was not a literal type.`)}getLiteralFreshType(){let e=this.compilerType?.freshType;return e==null?void 0:this._context.compilerFactory.getType(e)}getLiteralFreshTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralFreshType(),e??`Type was not a literal type.`)}getLiteralRegularType(){let e=this.compilerType?.regularType;return e==null?void 0:this._context.compilerFactory.getType(e)}getLiteralRegularTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralRegularType(),e??`Type was not a literal type.`)}getSymbol(){let e=this.compilerType.getSymbol();return e==null?void 0:this._context.compilerFactory.getSymbol(e)}getSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSymbol(),e??`Expected to find a symbol.`)}isAssignableTo(e){return this._context.typeChecker.isTypeAssignableTo(this,e)}isAnonymous(){return this.#n(t.ObjectFlags.Anonymous)}isAny(){return this.#t(t.TypeFlags.Any)}isNever(){return this.#t(t.TypeFlags.Never)}isArray(){let e=this.getSymbol();return e==null?!1:(e.getName()===`Array`||e.getName()===`ReadonlyArray`)&&this.getTypeArguments().length===1}isReadonlyArray(){let e=this.getSymbol();return e==null?!1:e.getName()===`ReadonlyArray`&&this.getTypeArguments().length===1}isTemplateLiteral(){return this.#t(t.TypeFlags.TemplateLiteral)}isBoolean(){return this.#t(t.TypeFlags.Boolean)}isString(){return this.#t(t.TypeFlags.String)}isNumber(){return this.#t(t.TypeFlags.Number)}isBigInt(){return this.#t(t.TypeFlags.BigInt)}isLiteral(){let e=this.isBooleanLiteral();return this.compilerType.isLiteral()||e}isBooleanLiteral(){return this.#t(t.TypeFlags.BooleanLiteral)}isBigIntLiteral(){return this.#t(t.TypeFlags.BigIntLiteral)}isEnumLiteral(){return this.#t(t.TypeFlags.EnumLiteral)&&!this.isUnion()}isNumberLiteral(){return this.#t(t.TypeFlags.NumberLiteral)}isStringLiteral(){return this.compilerType.isStringLiteral()}isClass(){return this.compilerType.isClass()}isClassOrInterface(){return this.compilerType.isClassOrInterface()}isEnum(){if(this.#t(t.TypeFlags.Enum))return!0;if(this.isEnumLiteral()&&!this.isUnion())return!1;let e=this.getSymbol();if(e==null)return!1;let n=e.getValueDeclaration();return n!=null&&V.isEnumDeclaration(n)}isInterface(){return this.#n(t.ObjectFlags.Interface)}isObject(){return this.#t(t.TypeFlags.Object)}isTypeParameter(){return this.compilerType.isTypeParameter()}isTuple(){let e=this.getTargetType();return e==null?!1:e.#n(t.ObjectFlags.Tuple)}isUnion(){return this.compilerType.isUnion()}isIntersection(){return this.compilerType.isIntersection()}isUnionOrIntersection(){return this.compilerType.isUnionOrIntersection()}isUnknown(){return this.#t(t.TypeFlags.Unknown)}isNull(){return this.#t(t.TypeFlags.Null)}isUndefined(){return this.#t(t.TypeFlags.Undefined)}isVoid(){return this.#t(t.TypeFlags.Void)}getFlags(){return this.compilerType.flags}getObjectFlags(){return this.isObject()&&this.compilerType.objectFlags||0}#t(e){return(this.compilerType.flags&e)===e}#n(e){return(this.getObjectFlags()&e)===e}},Zp=class extends Xp{getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected type parameter to have a constraint.`)}getConstraint(){let e=this.#e();if(e==null)return;let t=e.getConstraint();if(t!=null)return this._context.typeChecker.getTypeAtLocation(t)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected type parameter to have a default type.`)}getDefault(){let e=this.#e();if(e==null)return;let t=e.getDefault();if(t!=null)return this._context.typeChecker.getTypeAtLocation(t)}#e(){let e=this.getSymbol();if(e==null)return;let t=e.getDeclarations()[0];if(t!=null&&V.isTypeParameterDeclaration(t))return t}},Qp=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}getSkippedFilePaths(){return this.#t}getOutputFilePaths(){return this.#e}},$p=class e{#e;#t;#n;constructor(e,t){this.#e=e,this._setPathInternal(t)}_setPathInternal(e){this.#t=e,this.#n=e.split(`/`).filter(e=>e.length>0)}get _context(){return this.#s(),this.#e}isAncestorOf(t){return e.#u(this,t)}isDescendantOf(t){return e.#u(t,this)}_getDepth(){return this.#n.length}getPath(){return this.#s(),this.#t}getBaseName(){return this.#n[this.#n.length-1]}getParentOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getParent(),e??(()=>`Parent directory of ${this.getPath()} does not exist or was never added.`))}getParent(){if(!t.FileUtils.isRootDirPath(this.getPath()))return this.addDirectoryAtPathIfExists(t.FileUtils.getDirPath(this.getPath()))}getDirectoryOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDirectory(e),()=>typeof e==`string`?`Could not find a directory at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath())}'.`:`Could not find child directory that matched condition.`)}getDirectory(e){if(typeof e==`string`){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.getDirectoryFromCache(t)}return this.getDirectories().find(e)}getSourceFileOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSourceFile(e),()=>typeof e==`string`?`Could not find child source file at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath())}'.`:`Could not find child source file that matched condition.`)}getSourceFile(e){if(typeof e==`string`){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(t)}for(let t of this._getSourceFilesIterator())if(e(t))return t}getDirectories(){return Array.from(this._getDirectoriesIterator())}_getDirectoriesIterator(){return this._context.compilerFactory.getChildDirectoriesOfDirectory(this.getPath())}getSourceFiles(e){let{compilerFactory:n,fileSystemWrapper:r}=this._context,i=this;if(typeof e==`string`||e instanceof Array){let t=typeof e==`string`?[e]:e;return Array.from(a(t))}else return Array.from(this._getSourceFilesIterator());function*a(e){let a=Array.from(s()),o=t.matchGlobs(a,e,i.getPath());for(let e of o)yield n.getSourceFileFromCacheFromFilePath(r.getStandardizedAbsolutePath(e));function*s(){for(let e of i._getDescendantSourceFilesIterator())yield e.getFilePath()}}}_getSourceFilesIterator(){return this._context.compilerFactory.getChildSourceFilesOfDirectory(this.getPath())}getDescendantSourceFiles(){return Array.from(this._getDescendantSourceFilesIterator())}*_getDescendantSourceFilesIterator(){for(let e of this._getSourceFilesIterator())yield e;for(let e of this._getDirectoriesIterator())yield*e._getDescendantSourceFilesIterator()}getDescendantDirectories(){return Array.from(this._getDescendantDirectoriesIterator())}*_getDescendantDirectoriesIterator(){for(let e of this.getDirectories())yield e,yield*e._getDescendantDirectoriesIterator()}addSourceFilesAtPaths(e){return e=typeof e==`string`?[e]:e,e=e.map(e=>t.FileUtils.pathIsAbsolute(e)?e:t.FileUtils.pathJoin(this.getPath(),e)),this._context.directoryCoordinator.addSourceFilesAtPaths(e,{markInProject:this._isInProject()})}addDirectoryAtPathIfExists(e,t={}){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPathIfExists(n,{...t,markInProject:this._isInProject()})}addDirectoryAtPath(e,t={}){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPath(n,{...t,markInProject:this._isInProject()})}createDirectory(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.createDirectoryOrAddIfExists(t,{markInProject:this._isInProject()})}createSourceFile(e,t,n){let r=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.createSourceFile(r,t||``,{...n||{},markInProject:this._isInProject()})}addSourceFileAtPathIfExists(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPathIfExists(t,{markInProject:this._isInProject()})}addSourceFileAtPath(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPath(t,{markInProject:this._isInProject()})}async emit(e={}){let{fileSystemWrapper:t}=this._context,n=[],r=[],i=[];for(let a of this.#r(e))tm(a)?i.push(a):(n.push(t.writeFile(a.filePath,a.fileText)),r.push(a.filePath));return await Promise.all(n),new Qp(i,r)}emitSync(e={}){let{fileSystemWrapper:t}=this._context,n=[],r=[];for(let i of this.#r(e))tm(i)?r.push(i):(t.writeFileSync(i.filePath,i.fileText),n.push(i.filePath));return new Qp(r,n)}#r(e={}){let{emitOnlyDtsFiles:n=!1}=e,r=e.outDir==null?void 0:/\.js$/i,i=e.outDir==null?void 0:/\.js\.map$/i,a=e.declarationDir==null&&e.outDir==null?void 0:/\.d\.ts$/i,o=e=>e==null?void 0:this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath()),s=(e,n)=>e==null?void 0:t.FileUtils.pathJoin(e,n.getBaseName()),c=this._context.compilerOptions.get().declarationDir!=null||e.declarationDir!=null;return l(this,o(e.outDir),o(e.declarationDir));function*l(e,o,u){for(let s of e.getSourceFiles()){let e=s.getEmitOutput({emitOnlyDtsFiles:n});if(e.getEmitSkipped()){yield s.getFilePath();continue}for(let n of e.getOutputFiles()){let e=n.getFilePath(),s=n.getWriteByteOrderMark()?t.FileUtils.getTextWithByteOrderMark(n.getText()):n.getText();o!=null&&(r.test(e)||i.test(e)||!c&&a.test(e))?e=t.FileUtils.pathJoin(o,t.FileUtils.getBaseName(e)):u!=null&&a.test(e)&&(e=t.FileUtils.pathJoin(u,t.FileUtils.getBaseName(e))),yield{filePath:e,fileText:s}}}for(let t of e.getDirectories())yield*l(t,s(o,t),s(u,t))}}copyToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.copy(t.FileUtils.pathJoin(r,this.getBaseName()),n)}copy(e,t){let n=this.getPath(),r=this._context.fileSystemWrapper,i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return n===i?this:(t=em(t),t.includeUntrackedFiles&&r.queueCopyDirectory(n,i),this.#i(i,t))}async copyImmediately(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);if(r===i)return await this.save(),this;t=em(t);let a=this.#i(i,t);return t.includeUntrackedFiles&&await n.copyDirectoryImmediately(r,i),await a.save(),a}copyImmediatelySync(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);if(r===i)return this.saveSync(),this;t=em(t);let a=this.#i(i,t);return t.includeUntrackedFiles&&n.copyDirectoryImmediatelySync(r,i),a.saveSync(),a}#i(e,t){if(this.getPath()===e)return this;let{fileSystemWrapper:n,compilerFactory:r}=this._context,i=[this,...this.getDescendantDirectories()].map(t=>({newDirPath:t===this?e:n.getStandardizedAbsolutePath(this.getRelativePathTo(t),e)})),a=this.getDescendantSourceFiles().map(t=>({sourceFile:t,newFilePath:n.getStandardizedAbsolutePath(this.getRelativePathTo(t),e),references:this.#c(t)}));for(let{newDirPath:e}of i)this._context.compilerFactory.createDirectoryOrAddIfExists(e,{markInProject:this._isInProject()});for(let{sourceFile:e,newFilePath:n}of a)e._copyInternal(n,t);for(let{references:e,newFilePath:t}of a)this.getSourceFileOrThrow(t)._updateReferencesForCopyInternal(e);return r.getDirectoryFromCache(e)}moveToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.move(t.FileUtils.pathJoin(r,this.getBaseName()),n)}move(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?this:this.#a(i,t,()=>n.queueMoveDirectory(r,i))}async moveImmediately(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?(await this.save(),this):(this.#a(i,t),await n.moveDirectoryImmediately(r,i),await this.save(),this)}moveImmediatelySync(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?(this.saveSync(),this):(this.#a(i,t),n.moveDirectoryImmediatelySync(r,i),this.saveSync(),this)}#a(e,t,n){let r=this.getPath();if(r===e)return this;let i=this._context.compilerFactory.getDirectoryFromCacheOnlyIfInCache(e),a=i!=null&&i._isInProject();n&&n();let o=this._context.fileSystemWrapper,s=this._context.compilerFactory,c=[this,...this.getDescendantDirectories()].map(t=>({directory:t,oldPath:t.getPath(),newDirPath:t===this?e:o.getStandardizedAbsolutePath(this.getRelativePathTo(t),e)})),l=this.getDescendantSourceFiles().map(t=>({sourceFile:t,newFilePath:o.getStandardizedAbsolutePath(this.getRelativePathTo(t),e),references:this.#l(t)}));for(let{directory:e,oldPath:t,newDirPath:n}of c)s.removeDirectoryFromCache(t),s.getDirectoryFromCache(n)?._forgetOnlyThis(),e._setPathInternal(n),s.addDirectoryToCache(e);for(let{sourceFile:e,newFilePath:n}of l)e._moveInternal(n,t);for(let{sourceFile:e,references:t}of l)e._updateReferencesForMoveInternal(t,r);return a&&this._markAsInProject(),this}clear(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.queueDirectoryDelete(e),this._context.fileSystemWrapper.queueMkdir(e)}async clearImmediately(){let e=this.getPath();this.#o(),await this._context.fileSystemWrapper.clearDirectoryImmediately(e)}clearImmediatelySync(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.clearDirectoryImmediatelySync(e)}delete(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.queueDirectoryDelete(e),this.forget()}#o(){for(let e of this.getSourceFiles())e.delete();for(let e of this.getDirectories())e.delete()}async deleteImmediately(){let{fileSystemWrapper:e}=this._context,t=this.getPath();this.forget(),await e.deleteDirectoryImmediately(t)}deleteImmediatelySync(){let{fileSystemWrapper:e}=this._context,t=this.getPath();this.forget(),e.deleteDirectoryImmediatelySync(t)}forget(){if(!this.wasForgotten()){for(let e of this.getSourceFiles())e.forget();for(let e of this.getDirectories())e.forget();this._forgetOnlyThis()}}_forgetOnlyThis(){this.wasForgotten()||(this._context.compilerFactory.removeDirectoryFromCache(this.getPath()),this.#e=void 0)}async save(){await this._context.fileSystemWrapper.saveForDirectory(this.getPath());let e=this.getDescendantSourceFiles().filter(e=>!e.isSaved());await Promise.all(e.map(e=>e.save()))}saveSync(){this._context.fileSystemWrapper.saveForDirectorySync(this.getPath()),this.getDescendantSourceFiles().filter(e=>!e.isSaved()).forEach(e=>e.saveSync())}getRelativePathTo(n){let r=this;return t.FileUtils.getRelativePathTo(this.getPath(),i());function i(){return n instanceof Uc?n.getFilePath():n instanceof e?n.getPath():r._context.fileSystemWrapper.getStandardizedAbsolutePath(n,r.getPath())}}getRelativePathAsModuleSpecifierTo(n){let r=this._context.program.getEmitModuleResolutionKind(),i=this,a=t.FileUtils.getRelativePathTo(this.getPath(),o()).replace(/((\.d\.ts$)|(\.[^/.]+$))/i,``);return a.startsWith(`../`)?a:`./`+a;function o(){return n instanceof Uc?a(n):n instanceof e?o(n):s(i._context.fileSystemWrapper.getStandardizedAbsolutePath(n,i.getPath()));function a(e){return s(e.getFilePath())}function o(e){switch(r){case t.ModuleResolutionKind.Node10:return e===i?t.FileUtils.pathJoin(e.getPath(),`index.ts`):e.getPath();case t.ModuleResolutionKind.Classic:case t.ModuleResolutionKind.Node16:case t.ModuleResolutionKind.NodeNext:case t.ModuleResolutionKind.Bundler:return t.FileUtils.pathJoin(e.getPath(),`index.ts`);default:return t.errors.throwNotImplementedForNeverValueError(r)}}function s(e){let n=t.FileUtils.getDirPath(e);switch(r){case t.ModuleResolutionKind.Node10:return n===i.getPath()?e:e.replace(/\/index?(\.d\.ts|\.ts|\.js)$/i,``);case t.ModuleResolutionKind.Classic:case t.ModuleResolutionKind.Node16:case t.ModuleResolutionKind.NodeNext:case t.ModuleResolutionKind.Bundler:return e;default:return t.errors.throwNotImplementedForNeverValueError(r)}}}}getProject(){return this._context.project}wasForgotten(){return this.#e==null}_isInProject(){return this._context.inProjectCoordinator.isDirectoryInProject(this)}_markAsInProject(){this._context.inProjectCoordinator.markDirectoryAsInProject(this)}_hasLoadedParent(){return this._context.compilerFactory.containsDirectoryAtPath(t.FileUtils.getDirPath(this.getPath()))}#s(){if(this.wasForgotten())throw new t.errors.InvalidOperationError(`Cannot use a directory that was deleted, removed, or overwritten.`)}#c(e){return e._getReferencesForCopyInternal().filter(e=>!this.isAncestorOf(e[1]))}#l(e){let{literalReferences:t,referencingLiterals:n}=e._getReferencesForMoveInternal();return{literalReferences:t.filter(e=>!this.isAncestorOf(e[1])),referencingLiterals:n.filter(e=>!this.isAncestorOf(e._sourceFile))}}static#u(e,t){if(t instanceof Uc&&(t=t.getDirectory(),e===t))return!0;if(e.#n.length>=t.#n.length)return!1;for(let n=e.#n.length-1;n>=0;n--)if(e.#n[n]!==t.#n[n])return!1;return!0}};function em(e){return e=t.ObjectUtils.clone(e||{}),M(e,`includeUntrackedFiles`,!0),e}function tm(e){return typeof e==`string`}var nm=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}addDirectoryAtPathIfExists(e,n){let r=this.#t.getDirectoryFromPath(e,n);if(r!=null){if(n.recursive)for(let r of t.FileUtils.getDescendantDirectories(this.#e,e))this.#t.createDirectoryOrAddIfExists(r,n);return r}}addDirectoryAtPath(e,n){let r=this.addDirectoryAtPathIfExists(e,n);if(r==null)throw new t.errors.DirectoryNotFoundError(e);return r}createDirectoryOrAddIfExists(e,t){return this.#t.createDirectoryOrAddIfExists(e,t)}addSourceFileAtPathIfExists(e,t){return this.#t.addOrGetSourceFileFromFilePath(e,{markInProject:t.markInProject,scriptKind:void 0})}addSourceFileAtPath(e,n){let r=this.addSourceFileAtPathIfExists(e,n);if(r==null)throw new t.errors.FileNotFoundError(this.#e.getStandardizedAbsolutePath(e));return r}addSourceFilesAtPaths(e,n){typeof e==`string`&&(e=[e]);let r=[],i=new Set;for(let a of this.#e.globSync(e)){let e=this.addSourceFileAtPathIfExists(a,n);e!=null&&r.push(e),i.add(t.FileUtils.getDirPath(a))}for(let e of t.FileUtils.getParentMostPaths(Array.from(i)))this.addDirectoryAtPathIfExists(e,{recursive:!0,markInProject:n.markInProject});return r}},rm=class{#e;#t=new t.KeyValueCache;#n=new t.KeyValueCache;#r=new t.KeyValueCache;#i=new t.KeyValueCache;constructor(e){this.#e=e}has(e){return this.#t.has(e)}get(e){if(!this.#t.has(e)){for(let n of this.#i.getValues())if(t.FileUtils.pathStartsWith(n.getPath(),e))return this.createOrAddIfExists(e);return}return this.#t.get(e)}getOrphans(){return this.#i.getValues()}getAll(){return this.#t.getValuesAsArray()}*getAllByDepth(){let e=new t.KeyValueCache,n=0;for(let e of this.getOrphans())r(e);for(n=Math.min(...Array.from(e.getKeys()));e.getSize()>0;){for(let t of e.get(n)||[])yield t,t.getDirectories().forEach(r);e.removeByKey(n),n++}function r(t){let r=t._getDepth();if(n>r)throw Error(`For some reason a subdirectory had a lower depth than the parent directory: ${t.getPath()}`);e.getOrCreate(r,()=>[]).push(t)}}remove(e){this.#s(e),this.#t.removeByKey(e),this.#i.removeByKey(e)}*getChildDirectoriesOfDirectory(e){let t=this.#r.get(e)?.entries();if(t!=null)for(let e of t)yield e}*getChildSourceFilesOfDirectory(e){let t=this.#n.get(e)?.entries();if(t!=null)for(let e of t)yield e}addSourceFile(e){let n=e.getDirectoryPath();this.createOrAddIfExists(n),this.#n.getOrCreate(n,()=>new t.SortedKeyValueArray(e=>e.getBaseName(),t.LocaleStringComparer.instance)).set(e)}removeSourceFile(e){let n=t.FileUtils.getDirPath(e),r=this.#n.get(n);r!=null&&(r.removeByKey(t.FileUtils.getBaseName(e)),r.hasItems()||this.#n.removeByKey(n))}createOrAddIfExists(e){return this.has(e)?this.get(e):(this.#c(e),this.#a(e))}#a(e){let t=new $p(this.#e,e);return this.addDirectory(t),t}addDirectory(e){let n=e.getPath(),r=t.FileUtils.getDirPath(n),i=r===n;for(let e of this.#i.getValues()){let r=e.getPath(),i=t.FileUtils.getDirPath(r);i!==r&&i===n&&this.#i.removeByKey(r)}i||this.#o(e),this.has(r)||this.#i.set(n,e),this.#t.set(n,e),this.#e.fileSystemWrapper.directoryExistsSync(n)||this.#e.fileSystemWrapper.queueMkdir(n);for(let t of this.#i.getValues())e.isAncestorOf(t)&&this.#c(t.getPath())}#o(e){if(t.FileUtils.isRootDirPath(e.getPath()))return;let n=t.FileUtils.getDirPath(e.getPath());this.#r.getOrCreate(n,()=>new t.SortedKeyValueArray(e=>e.getBaseName(),t.LocaleStringComparer.instance)).set(e)}#s(e){if(t.FileUtils.isRootDirPath(e))return;let n=t.FileUtils.getDirPath(e),r=this.#r.get(n);r!=null&&(r.removeByKey(t.FileUtils.getBaseName(e)),r.hasItems()||this.#r.removeByKey(n))}#c(e){let n=[],r=t.FileUtils.getDirPath(e);for(;e!==r;){if(e=r,r=t.FileUtils.getDirPath(e),this.#t.has(e)){for(let e of n)this.#a(e);break}n.unshift(e)}}},im=class extends t.KeyValueCache{#e=[];getOrCreate(e,t){return super.getOrCreate(e,()=>{let e=t();return this.#e.length>0&&this.#e[this.#e.length-1].add(e),e})}setForgetPoint(){this.#e.push(new Set)}forgetLastPoint(){let e=this.#e.pop();e!=null&&this.#n(e.values())}rememberNode(e){if(e.wasForgotten())throw new t.errors.InvalidOperationError(`Cannot remember a node that was removed or forgotten.`);let n=!1;for(let t of this.#e)if(t.delete(e)){n=!0;break}return n&&this.#t(e),n}#t(e){let t=e.getParentSyntaxList()||e.getParent();t!=null&&this.rememberNode(t)}#n(e){for(let n of e)n.wasForgotten()||n.getKind()===t.SyntaxKind.SourceFile||n._forgetOnlyThis()}},am={[t.SyntaxKind.SourceFile]:Uc,[t.SyntaxKind.ArrayBindingPattern]:Oa,[t.SyntaxKind.ArrayLiteralExpression]:Wa,[t.SyntaxKind.ArrayType]:iu,[t.SyntaxKind.ArrowFunction]:el,[t.SyntaxKind.AsExpression]:$a,[t.SyntaxKind.AwaitExpression]:to,[t.SyntaxKind.BigIntLiteral]:Wf,[t.SyntaxKind.BindingElement]:Aa,[t.SyntaxKind.BinaryExpression]:Fa,[t.SyntaxKind.Block]:gs,[t.SyntaxKind.BreakStatement]:_s,[t.SyntaxKind.CallExpression]:ro,[t.SyntaxKind.CallSignature]:Qd,[t.SyntaxKind.CaseBlock]:ys,[t.SyntaxKind.CaseClause]:xs,[t.SyntaxKind.CatchClause]:Cs,[t.SyntaxKind.ClassDeclaration]:El,[t.SyntaxKind.ClassExpression]:Pl,[t.SyntaxKind.ClassStaticBlockDeclaration]:Il,[t.SyntaxKind.ConditionalType]:au,[t.SyntaxKind.Constructor]:Bl,[t.SyntaxKind.ConstructorType]:lu,[t.SyntaxKind.ConstructSignature]:tf,[t.SyntaxKind.ContinueStatement]:Ts,[t.SyntaxKind.CommaListExpression]:ao,[t.SyntaxKind.ComputedPropertyName]:hf,[t.SyntaxKind.ConditionalExpression]:so,[t.SyntaxKind.DebuggerStatement]:Ds,[t.SyntaxKind.Decorator]:Jl,[t.SyntaxKind.DefaultClause]:ks,[t.SyntaxKind.DeleteExpression]:lo,[t.SyntaxKind.DoStatement]:Ms,[t.SyntaxKind.ElementAccessExpression]:fo,[t.SyntaxKind.EmptyStatement]:Ps,[t.SyntaxKind.EnumDeclaration]:Kd,[t.SyntaxKind.EnumMember]:Jd,[t.SyntaxKind.ExportAssignment]:ic,[t.SyntaxKind.ExportDeclaration]:oc,[t.SyntaxKind.ExportSpecifier]:lc,[t.SyntaxKind.ExpressionWithTypeArguments]:du,[t.SyntaxKind.ExpressionStatement]:Is,[t.SyntaxKind.ExternalModuleReference]:dc,[t.SyntaxKind.QualifiedName]:bf,[t.SyntaxKind.ForInStatement]:Rs,[t.SyntaxKind.ForOfStatement]:Bs,[t.SyntaxKind.ForStatement]:Hs,[t.SyntaxKind.FunctionDeclaration]:cl,[t.SyntaxKind.FunctionExpression]:ul,[t.SyntaxKind.FunctionType]:pu,[t.SyntaxKind.GetAccessor]:Hl,[t.SyntaxKind.HeritageClause]:Yd,[t.SyntaxKind.Identifier]:_f,[t.SyntaxKind.IfStatement]:Ws,[t.SyntaxKind.ImportClause]:_c,[t.SyntaxKind.ImportDeclaration]:yc,[t.SyntaxKind.ImportEqualsDeclaration]:Cc,[t.SyntaxKind.ImportSpecifier]:Tc,[t.SyntaxKind.ImportType]:mu,[t.SyntaxKind.ImportAttribute]:pc,[t.SyntaxKind.ImportAttributes]:hc,[t.SyntaxKind.IndexedAccessType]:hu,[t.SyntaxKind.IndexSignature]:rf,[t.SyntaxKind.InferType]:gu,[t.SyntaxKind.InterfaceDeclaration]:of,[t.SyntaxKind.IntersectionType]:_u,[t.SyntaxKind.JSDocAllType]:Bu,[t.SyntaxKind.JSDocAugmentsTag]:Ju,[t.SyntaxKind.JSDocAuthorTag]:Yu,[t.SyntaxKind.JSDocCallbackTag]:Xu,[t.SyntaxKind.JSDocClassTag]:Zu,[t.SyntaxKind.JSDocDeprecatedTag]:Qu,[t.SyntaxKind.JSDocEnumTag]:$u,[t.SyntaxKind.JSDocFunctionType]:td,[t.SyntaxKind.JSDocImplementsTag]:nd,[t.SyntaxKind.JSDocLink]:rd,[t.SyntaxKind.JSDocLinkCode]:id,[t.SyntaxKind.JSDocLinkPlain]:ad,[t.SyntaxKind.JSDocMemberName]:od,[t.SyntaxKind.JSDocNamepathType]:sd,[t.SyntaxKind.JSDocNameReference]:cd,[t.SyntaxKind.JSDocNonNullableType]:ld,[t.SyntaxKind.JSDocNullableType]:ud,[t.SyntaxKind.JSDocOptionalType]:dd,[t.SyntaxKind.JSDocOverrideTag]:md,[t.SyntaxKind.JSDocParameterTag]:gd,[t.SyntaxKind.JSDocPrivateTag]:_d,[t.SyntaxKind.JSDocPropertyTag]:vd,[t.SyntaxKind.JSDocProtectedTag]:yd,[t.SyntaxKind.JSDocPublicTag]:bd,[t.SyntaxKind.JSDocReturnTag]:Cd,[t.SyntaxKind.JSDocReadonlyTag]:xd,[t.SyntaxKind.JSDocThrowsTag]:Id,[t.SyntaxKind.JSDocOverloadTag]:pd,[t.SyntaxKind.JSDocSatisfiesTag]:Td,[t.SyntaxKind.JSDocSeeTag]:Dd,[t.SyntaxKind.JSDocSignature]:Od,[t.SyntaxKind.JSDocTag]:Vd,[t.SyntaxKind.JSDocTemplateTag]:jd,[t.SyntaxKind.JSDocText]:Md,[t.SyntaxKind.JSDocThisTag]:Pd,[t.SyntaxKind.JSDocTypeExpression]:Rd,[t.SyntaxKind.JSDocTypeLiteral]:zd,[t.SyntaxKind.JSDocTypeTag]:Bd,[t.SyntaxKind.JSDocTypedefTag]:Ld,[t.SyntaxKind.JSDocUnknownType]:Hd,[t.SyntaxKind.JSDocVariadicType]:Ud,[t.SyntaxKind.JsxAttribute]:Sf,[t.SyntaxKind.JsxClosingElement]:wf,[t.SyntaxKind.JsxClosingFragment]:Tf,[t.SyntaxKind.JsxElement]:Df,[t.SyntaxKind.JsxExpression]:Af,[t.SyntaxKind.JsxFragment]:jf,[t.SyntaxKind.JsxNamespacedName]:Nf,[t.SyntaxKind.JsxOpeningElement]:Ff,[t.SyntaxKind.JsxOpeningFragment]:If,[t.SyntaxKind.JsxSelfClosingElement]:Rf,[t.SyntaxKind.JsxSpreadAttribute]:Bf,[t.SyntaxKind.JsxText]:Hf,[t.SyntaxKind.LabeledStatement]:Ks,[t.SyntaxKind.LiteralType]:vu,[t.SyntaxKind.MappedType]:yu,[t.SyntaxKind.MetaProperty]:vo,[t.SyntaxKind.MethodDeclaration]:_l,[t.SyntaxKind.MethodSignature]:cf,[t.SyntaxKind.ModuleBlock]:Dc,[t.SyntaxKind.ModuleDeclaration]:Ac,[t.SyntaxKind.NamedExports]:Pc,[t.SyntaxKind.NamedImports]:Ic,[t.SyntaxKind.NamedTupleMember]:xu,[t.SyntaxKind.NamespaceExport]:Rc,[t.SyntaxKind.NamespaceImport]:zc,[t.SyntaxKind.NewExpression]:bo,[t.SyntaxKind.NonNullExpression]:So,[t.SyntaxKind.NotEmittedStatement]:Js,[t.SyntaxKind.NoSubstitutionTemplateLiteral]:op,[t.SyntaxKind.NumericLiteral]:ep,[t.SyntaxKind.ObjectBindingPattern]:ja,[t.SyntaxKind.ObjectLiteralExpression]:Oo,[t.SyntaxKind.OmittedExpression]:Io,[t.SyntaxKind.Parameter]:fl,[t.SyntaxKind.ParenthesizedExpression]:K,[t.SyntaxKind.ParenthesizedType]:Su,[t.SyntaxKind.PartiallyEmittedExpression]:Ro,[t.SyntaxKind.PostfixUnaryExpression]:Bo,[t.SyntaxKind.PrefixUnaryExpression]:Ho,[t.SyntaxKind.PrivateIdentifier]:yf,[t.SyntaxKind.PropertyAccessExpression]:Wo,[t.SyntaxKind.PropertyAssignment]:Ao,[t.SyntaxKind.PropertyDeclaration]:Wl,[t.SyntaxKind.PropertySignature]:uf,[t.SyntaxKind.RegularExpressionLiteral]:np,[t.SyntaxKind.RestType]:Cu,[t.SyntaxKind.ReturnStatement]:Xs,[t.SyntaxKind.SatisfiesExpression]:Ko,[t.SyntaxKind.SetAccessor]:Kl,[t.SyntaxKind.ShorthandPropertyAssignment]:Mo,[t.SyntaxKind.SpreadAssignment]:Po,[t.SyntaxKind.SpreadElement]:Jo,[t.SyntaxKind.StringLiteral]:ip,[t.SyntaxKind.SwitchStatement]:Qs,[t.SyntaxKind.SyntaxList]:yn,[t.SyntaxKind.TaggedTemplateExpression]:sp,[t.SyntaxKind.TemplateExpression]:lp,[t.SyntaxKind.TemplateHead]:dp,[t.SyntaxKind.TemplateLiteralType]:wu,[t.SyntaxKind.TemplateMiddle]:pp,[t.SyntaxKind.TemplateSpan]:hp,[t.SyntaxKind.TemplateTail]:_p,[t.SyntaxKind.ThisType]:Tu,[t.SyntaxKind.ThrowStatement]:ec,[t.SyntaxKind.TryStatement]:nc,[t.SyntaxKind.TupleType]:Eu,[t.SyntaxKind.TypeAliasDeclaration]:Ou,[t.SyntaxKind.TypeAssertionExpression]:is,[t.SyntaxKind.TypeLiteral]:Au,[t.SyntaxKind.TypeOperator]:ju,[t.SyntaxKind.TypeParameter]:Nu,[t.SyntaxKind.TypePredicate]:Fu,[t.SyntaxKind.TypeQuery]:Iu,[t.SyntaxKind.TypeReference]:Lu,[t.SyntaxKind.UnionType]:Ru,[t.SyntaxKind.VariableDeclaration]:yp,[t.SyntaxKind.VariableDeclarationList]:xp,[t.SyntaxKind.VariableStatement]:qc,[t.SyntaxKind.JSDoc]:eu,[t.SyntaxKind.TypeOfExpression]:os,[t.SyntaxKind.WhileStatement]:Yc,[t.SyntaxKind.WithStatement]:Zc,[t.SyntaxKind.YieldExpression]:us,[t.SyntaxKind.SemicolonToken]:V,[t.SyntaxKind.AnyKeyword]:Na,[t.SyntaxKind.BooleanKeyword]:Na,[t.SyntaxKind.FalseKeyword]:Jf,[t.SyntaxKind.ImportKeyword]:mo,[t.SyntaxKind.InferKeyword]:V,[t.SyntaxKind.NeverKeyword]:V,[t.SyntaxKind.NullKeyword]:Qf,[t.SyntaxKind.NumberKeyword]:Na,[t.SyntaxKind.ObjectKeyword]:Na,[t.SyntaxKind.StringKeyword]:Na,[t.SyntaxKind.SymbolKeyword]:Na,[t.SyntaxKind.SuperKeyword]:Qo,[t.SyntaxKind.ThisKeyword]:ns,[t.SyntaxKind.TrueKeyword]:Kf,[t.SyntaxKind.UndefinedKeyword]:Na,[t.SyntaxKind.VoidExpression]:cs},om=class{#e;#t=new Map;#n=new t.WeakCache;#r=new t.WeakCache;#i=new t.WeakCache;#a=new t.WeakCache;#o=new t.WeakCache;#s=new t.WeakCache;#c=new t.WeakCache;#l=new t.WeakCache;#u=new t.WeakCache;#d=new t.WeakCache;#f=new t.WeakCache;#p=new t.WeakCache;#m=new t.WeakCache;#h=new im;#g;#_=new t.EventContainer;#v=new t.EventContainer;documentRegistry;constructor(e){this.documentRegistry=new t.DocumentRegistry(e.fileSystemWrapper),this.#g=new rm(e),e.compilerOptions.onModified(()=>{let e=Array.from(this.#t.values());for(let t of e)an(t)}),this.#e=e}*getSourceFilesByDirectoryDepth(){for(let e of this.getDirectoriesByDepth())yield*e.getSourceFiles()}getSourceFilePaths(){return this.#t.keys()}getChildDirectoriesOfDirectory(e){return this.#g.getChildDirectoriesOfDirectory(e)}getChildSourceFilesOfDirectory(e){return this.#g.getChildSourceFilesOfDirectory(e)}onSourceFileAdded(e,t=!0){t?this.#_.subscribe(e):this.#_.unsubscribe(e)}onSourceFileRemoved(e){this.#v.subscribe(e)}createSourceFile(e,n,r){if(n=n instanceof Function?F(this.#e.createWriter(),n):n||``,typeof n==`string`)return this.createSourceFileFromText(e,n,r);let i=this.#e.createWriter();return this.#e.structurePrinterFactory.forSourceFile({isAmbient:t.FileUtils.getExtension(e)===`.d.ts`}).printText(i,n),this.createSourceFileFromText(e,i.toString(),r)}createSourceFileFromText(e,t,n){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),n.overwrite===!0?this.#y(e,t,n):(this.throwIfFileExists(e,`Did you mean to provide the overwrite option?`),this.#b(e,t,n))}throwIfFileExists(e,n){if(!(!this.containsSourceFileAtPath(e)&&!this.#e.fileSystemWrapper.fileExistsSync(e)))throw n=n==null?``:n+` `,new t.errors.InvalidOperationError(`${n}A source file already exists at the provided file path: ${e}`)}#y(e,t,n){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let r=this.addOrGetSourceFileFromFilePath(e,n);return r==null?this.#b(e,t,n):(r.getChildren().forEach(e=>e.forget()),this.replaceCompilerNode(r,this.createCompilerSourceFileFromText(e,t,n.scriptKind)),r)}getSourceFileFromCacheFromFilePath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#t.get(e)}addOrGetSourceFileFromFilePath(e,t){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let n=this.#t.get(e);if(n==null){let r=this.#e.fileSystemWrapper.readFileIfExistsSync(e,this.#e.getEncoding());r!=null&&(this.#e.logger.log(`Loaded file: ${e}`),n=this.#b(e,r,t),n._setIsSaved(!0))}return n!=null&&t.markInProject&&n._markAsInProject(),n}containsSourceFileAtPath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#t.has(e)}containsDirectoryAtPath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#g.has(e)}getSourceFileForNode(e){let n=e;for(;n.kind!==t.SyntaxKind.SourceFile;){if(n.parent==null)return;n=n.parent}return this.getSourceFile(n,{markInProject:!1})}hasCompilerNode(e){return this.#h.has(e)}getExistingNodeFromCompilerNode(e){return this.#h.get(e)}getNodeFromCompilerNode(e,n){if(e.kind===t.SyntaxKind.SourceFile)return this.getSourceFile(e,{markInProject:!1});return this.#h.getOrCreate(e,()=>{let e=r.call(this);return a.call(this,e),e});function r(){return i(e)?y.isCommentStatement(e)?new ws(this.#e,e,n):y.isCommentClassElement(e)?new Ll(this.#e,e,n):y.isCommentTypeElement(e)?new $d(this.#e,e,n):y.isCommentObjectLiteralElement(e)?new wo(this.#e,e,n):y.isCommentEnumMember(e)?new Wd(this.#e,e,n):t.errors.throwNotImplementedForNeverValueError(e):new(am[e.kind]||V)(this.#e,e,n)}function i(e){return e._commentKind!=null}function a(r){if(e.parent!=null){let t=this.getNodeFromCompilerNode(e.parent,n);t._wrappedChildCount++}let i=r._getParentSyntaxListIfWrapped();if(i!=null&&i._wrappedChildCount++,e.kind===t.SyntaxKind.SyntaxList){let e=0;for(let t of r._getChildrenInCacheIterator())e++;r._wrappedChildCount=e}}}#b(e,n,r){let i=t.StringUtils.hasBom(n);i&&(n=t.StringUtils.stripBom(n));let a=this.getSourceFile(this.createCompilerSourceFileFromText(e,n,r.scriptKind),r);return i&&(a._hasBom=!0),a}createCompilerSourceFileFromText(e,n,r){return this.documentRegistry.createOrUpdateSourceFile(e,this.#e.compilerOptions.get(),t.ts.ScriptSnapshot.fromString(n),r)}getSourceFile(e,t){let n=!1,r=this.#t.get(e.fileName)??this.#h.getOrCreate(e,()=>{let r=new Uc(this.#e,e);return t.markInProject||this.#e.inProjectCoordinator.setSourceFileNotInProject(r),this.#x(r),n=!0,r});return t.markInProject&&r._markAsInProject(),n&&this.#_.fire(r),r}#x(e){this.#t.set(e.getFilePath(),e),this.#e.fileSystemWrapper.removeFileDelete(e.getFilePath()),this.#g.addSourceFile(e)}getDirectoryFromPath(e,t){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let n=this.#g.get(e);return n==null&&this.#e.fileSystemWrapper.directoryExistsSync(e)&&(n=this.#g.createOrAddIfExists(e)),n!=null&&t.markInProject&&n._markAsInProject(),n}createDirectoryOrAddIfExists(e,t){let n=this.#g.createOrAddIfExists(e);return n!=null&&t.markInProject&&n._markAsInProject(),n}getDirectoryFromCache(e){return this.#g.get(e)}getDirectoryFromCacheOnlyIfInCache(e){return this.#g.has(e)?this.#g.get(e):void 0}getDirectoriesByDepth(){return this.#g.getAllByDepth()}getOrphanDirectories(){return this.#g.getOrphans()}getSymbolDisplayPart(e){return this.#l.getOrCreate(e,()=>new Kp(e))}getType(e){return(e.flags&t.TypeFlags.TypeParameter)===t.TypeFlags.TypeParameter?this.getTypeParameter(e):this.#p.getOrCreate(e,()=>new Xp(this.#e,e))}getTypeParameter(e){return this.#m.getOrCreate(e,()=>new Zp(this.#e,e))}getSignature(e){return this.#s.getOrCreate(e,()=>new Sp(this.#e,e))}getSymbol(e){return this.#c.getOrCreate(e,()=>new Cp(this.#e,e))}getDefinitionInfo(e){return this.#r.getOrCreate(e,()=>new jp(this.#e,e))}getDocumentSpan(e){return this.#i.getOrCreate(e,()=>new Ap(this.#e,e))}getReferencedSymbolEntry(e){return this.#u.getOrCreate(e,()=>new Wp(this.#e,e))}getReferencedSymbol(e){return this.#d.getOrCreate(e,()=>new Vp(this.#e,e))}getReferencedSymbolDefinitionInfo(e){return this.#f.getOrCreate(e,()=>new Hp(this.#e,e))}getDiagnostic(e){return this.#n.getOrCreate(e,()=>e.start==null?new Np(this.#e,e):new Pp(this.#e,e))}getDiagnosticWithLocation(e){return this.#n.getOrCreate(e,()=>new Pp(this.#e,e))}getDiagnosticMessageChain(e){return this.#a.getOrCreate(e,()=>new Mp(e))}getJSDocTagInfo(e){return this.#o.getOrCreate(e,()=>new kd(e))}replaceCompilerNode(e,n){let r=e instanceof V?e.compilerNode:e,i=e instanceof V?e:this.#h.get(e);if(r.kind===t.SyntaxKind.SourceFile&&r.fileName!==n.fileName){let e=i;this.#S(r),e._replaceCompilerNodeFromFactory(n),this.#h.set(n,e),this.#x(e),this.#_.fire(e)}else this.#h.replaceKey(r,n),i?._replaceCompilerNodeFromFactory(n)}removeNodeFromCache(e){this.#S(e.compilerNode)}#S(e){if(this.#h.removeByKey(e),e.kind===t.SyntaxKind.SourceFile){let t=e,n=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(t.fileName);this.#g.removeSourceFile(n);let r=this.#t.get(n);this.#t.delete(n),this.documentRegistry.removeSourceFile(n),r!=null&&this.#v.fire(r)}}addDirectoryToCache(e){this.#g.addDirectory(e)}removeDirectoryFromCache(e){this.#g.remove(e)}forgetNodesCreatedInBlock(e){this.#h.setForgetPoint();let t=!1,n;try{if(n=e((...e)=>{for(let t of e)this.#h.rememberNode(t)}),V.isNode(n)&&this.#h.rememberNode(n),r(n))return t=!0,n.then(e=>(V.isNode(e)&&this.#h.rememberNode(e),this.#h.forgetLastPoint(),e))}finally{t||this.#h.forgetLastPoint()}return n;function r(e){return e!=null&&typeof e.then==`function`}}},sm=class{#e;#t=new Set;constructor(e){e.onSourceFileRemoved(e=>{this.#t.delete(e)}),this.#e=e}setSourceFileNotInProject(e){this.#t.add(e),e._inProject=!1}markSourceFileAsInProject(e){this.isSourceFileInProject(e)||(this.#n(e),this.#t.delete(e))}markSourceFilesAsInProjectForResolution(){let e=this.#e,n=[],r=[];for(let e of[...this.#t.values()])i(e)?(this.#n(e),this.#t.delete(e),n.push(e)):r.push(e);return{changedSourceFiles:n,unchangedSourceFiles:r};function i(n){let r=n.getFilePath(),i=r.toLowerCase().lastIndexOf(`/node_modules/`);if(i===-1)return!0;let a=r.substring(0,i+14-1),o=e.getDirectoryFromCacheOnlyIfInCache(a);if(o!=null&&o._isInProject())return!0;let s=n.getDirectory();for(;s!=null&&s.getPath()!==a;){if(s._isInProject())return!0;s=e.getDirectoryFromCacheOnlyIfInCache(t.FileUtils.getDirPath(s.getPath()))}return!1}}#n(e){e._inProject=!0,this.markDirectoryAsInProject(e.getDirectory())}isSourceFileInProject(e){return e._inProject===!0}setDirectoryAndFilesAsNotInProjectForTesting(e){for(let t of e.getDirectories())this.setDirectoryAndFilesAsNotInProjectForTesting(t);for(let t of e.getSourceFiles())delete t._inProject,this.#t.add(t);delete e._inProject}markDirectoryAsInProject(e){if(this.isDirectoryInProject(e))return;let n=this,r=this.#e;e._inProject=!0,i(e);function i(e){let t=Array.from(a(e)),r=t[t.length-1];if(!(r==null||!n.isDirectoryInProject(r)))for(let e of t)e._inProject=!0}function*a(e){if(t.FileUtils.isRootDirPath(e.getPath()))return;let i=t.FileUtils.getDirPath(e.getPath()),o=r.getDirectoryFromCacheOnlyIfInCache(i);o!=null&&(yield o,n.isDirectoryInProject(o)||(yield*a(o)))}}isDirectoryInProject(e){return e._inProject===!0}},cm=class{_getFormatCodeSettings;constructor(e){this._getFormatCodeSettings=e}getFormatCodeSettings(){return this._getFormatCodeSettings()}forInitializerExpressionableNode(){return new In}forModifierableNode(){return new Ln}forReturnTypedNode(e){return new Rn(e)}forTypedNode(e,t){return new zn(e,t)}forClassDeclaration(e){return new Jn(this,e)}forClassMember(e){return new Hr(this,e)}forClassStaticBlockDeclaration(){return new Ur(this)}forConstructorDeclaration(e){return new Wr(this,e)}forGetAccessorDeclaration(e){return new Gr(this,e)}forMethodDeclaration(e){return new Kr(this,e)}forPropertyDeclaration(){return new qr(this)}forSetAccessorDeclaration(e){return new Jr(this,e)}forDecorator(){return new Xr(this)}forJSDoc(){return new Zr(this)}forJSDocTag(e){return new Qr(this,e)}forEnumDeclaration(){return new $r(this)}forEnumMember(){return new ei(this)}forObjectLiteralExpressionProperty(){return new ti(this)}forPropertyAssignment(){return new ni(this)}forShorthandPropertyAssignment(){return new ri(this)}forSpreadAssignment(){return new ii(this)}forFunctionDeclaration(e){return new ai(this,e)}forParameterDeclaration(){return new oi(this)}forCallSignatureDeclaration(){return new si(this)}forConstructSignatureDeclaration(){return new ci(this)}forIndexSignatureDeclaration(){return new li(this)}forInterfaceDeclaration(){return new ui(this)}forMethodSignature(){return new di(this)}forPropertySignature(){return new fi(this)}forTypeElementMemberedNode(){return new pi(this)}forTypeElementMember(){return new mi(this)}forJsxAttributeDecider(){return new hi(this)}forJsxAttribute(){return new gi(this)}forJsxChildDecider(){return new _i(this)}forJsxElement(){return new vi(this)}forJsxNamespacedName(){return new yi(this)}forJsxSelfClosingElement(){return new bi(this)}forJsxSpreadAttribute(){return new xi(this)}forExportAssignment(){return new Si(this)}forExportDeclaration(){return new Ci(this)}forImportAttribute(){return new wi(this)}forImportDeclaration(){return new Ti(this)}forModuleDeclaration(e){return new Ei(this,e)}forNamedImportExportSpecifier(){return new Di(this)}forSourceFile(e){return new Oi(this,e)}forStatementedNode(e){return new ki(this,e)}forStatement(e){return new Ai(this,e)}forVariableStatement(){return new ji(this)}forTypeAliasDeclaration(){return new Mi(this)}forTypeParameterDeclaration(){return new Ni(this)}forVariableDeclaration(){return new Pi(this)}};Vc([t.Memoize],cm.prototype,`forInitializerExpressionableNode`,null),Vc([t.Memoize],cm.prototype,`forModifierableNode`,null),Vc([t.Memoize],cm.prototype,`forReturnTypedNode`,null),Vc([t.Memoize],cm.prototype,`forTypedNode`,null),Vc([t.Memoize],cm.prototype,`forClassDeclaration`,null),Vc([t.Memoize],cm.prototype,`forClassMember`,null),Vc([t.Memoize],cm.prototype,`forClassStaticBlockDeclaration`,null),Vc([t.Memoize],cm.prototype,`forConstructorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forGetAccessorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forMethodDeclaration`,null),Vc([t.Memoize],cm.prototype,`forPropertyDeclaration`,null),Vc([t.Memoize],cm.prototype,`forSetAccessorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forDecorator`,null),Vc([t.Memoize],cm.prototype,`forJSDoc`,null),Vc([t.Memoize],cm.prototype,`forJSDocTag`,null),Vc([t.Memoize],cm.prototype,`forEnumDeclaration`,null),Vc([t.Memoize],cm.prototype,`forEnumMember`,null),Vc([t.Memoize],cm.prototype,`forObjectLiteralExpressionProperty`,null),Vc([t.Memoize],cm.prototype,`forPropertyAssignment`,null),Vc([t.Memoize],cm.prototype,`forShorthandPropertyAssignment`,null),Vc([t.Memoize],cm.prototype,`forSpreadAssignment`,null),Vc([t.Memoize],cm.prototype,`forFunctionDeclaration`,null),Vc([t.Memoize],cm.prototype,`forParameterDeclaration`,null),Vc([t.Memoize],cm.prototype,`forCallSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forConstructSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forIndexSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forInterfaceDeclaration`,null),Vc([t.Memoize],cm.prototype,`forMethodSignature`,null),Vc([t.Memoize],cm.prototype,`forPropertySignature`,null),Vc([t.Memoize],cm.prototype,`forTypeElementMemberedNode`,null),Vc([t.Memoize],cm.prototype,`forTypeElementMember`,null),Vc([t.Memoize],cm.prototype,`forJsxAttributeDecider`,null),Vc([t.Memoize],cm.prototype,`forJsxAttribute`,null),Vc([t.Memoize],cm.prototype,`forJsxChildDecider`,null),Vc([t.Memoize],cm.prototype,`forJsxElement`,null),Vc([t.Memoize],cm.prototype,`forJsxNamespacedName`,null),Vc([t.Memoize],cm.prototype,`forJsxSelfClosingElement`,null),Vc([t.Memoize],cm.prototype,`forJsxSpreadAttribute`,null),Vc([t.Memoize],cm.prototype,`forExportAssignment`,null),Vc([t.Memoize],cm.prototype,`forExportDeclaration`,null),Vc([t.Memoize],cm.prototype,`forImportAttribute`,null),Vc([t.Memoize],cm.prototype,`forImportDeclaration`,null),Vc([t.Memoize],cm.prototype,`forModuleDeclaration`,null),Vc([t.Memoize],cm.prototype,`forNamedImportExportSpecifier`,null),Vc([t.Memoize],cm.prototype,`forSourceFile`,null),Vc([t.Memoize],cm.prototype,`forStatementedNode`,null),Vc([t.Memoize],cm.prototype,`forStatement`,null),Vc([t.Memoize],cm.prototype,`forVariableStatement`,null),Vc([t.Memoize],cm.prototype,`forTypeAliasDeclaration`,null),Vc([t.Memoize],cm.prototype,`forTypeParameterDeclaration`,null),Vc([t.Memoize],cm.prototype,`forVariableDeclaration`,null);var lm=class{#e;#t;#n;#r;get project(){if(this.#r==null)throw new t.errors.InvalidOperationError(`This operation is not permitted in this context.`);return this.#r}logger=new oe;lazyReferenceCoordinator;directoryCoordinator;fileSystemWrapper;manipulationSettings=new j;structurePrinterFactory;compilerFactory;inProjectCoordinator;constructor(e){this.#r=e.project,this.fileSystemWrapper=e.fileSystemWrapper,this.#t=e.compilerOptionsContainer,this.compilerFactory=new om(this),this.inProjectCoordinator=new sm(this.compilerFactory),this.structurePrinterFactory=new cm(()=>this.manipulationSettings.getFormatCodeSettings()),this.lazyReferenceCoordinator=new de(this.compilerFactory),this.directoryCoordinator=new nm(this.compilerFactory,e.fileSystemWrapper),this.#e=e.createLanguageService?new Yp({context:this,configFileParsingDiagnostics:e.configFileParsingDiagnostics,resolutionHost:e.resolutionHost&&e.resolutionHost(this.getModuleResolutionHost(),()=>this.compilerOptions.get()),skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}):void 0,e.typeChecker!=null&&(t.errors.throwIfTrue(e.createLanguageService,`Cannot specify a type checker and create a language service.`),this.#n=new qp(this),this.#n._reset(()=>e.typeChecker))}get compilerOptions(){return this.#t}get languageService(){if(this.#e==null)throw this.#i(`language service`);return this.#e}get program(){if(this.#e==null)throw this.#i(`program`);return this.languageService.getProgram()}get typeChecker(){if(this.#n!=null)return this.#n;if(this.#e==null)throw this.#i(`type checker`);return this.program.getTypeChecker()}hasLanguageService(){return this.#e!=null}getEncoding(){return this.compilerOptions.getEncoding()}getFormatCodeSettings(){return this.manipulationSettings.getFormatCodeSettings()}getUserPreferences(){return this.manipulationSettings.getUserPreferences()}resetProgram(){this.languageService._reset()}createWriter(){let t=this.manipulationSettings.getIndentationText();return new i.default({newLine:this.manipulationSettings.getNewLineKindAsString(),indentNumberOfSpaces:t===e.IndentationText.Tab?void 0:t.length,useTabs:t===e.IndentationText.Tab,useSingleQuote:this.manipulationSettings.getQuoteKind()===e.QuoteKind.Single})}getPreEmitDiagnostics(e){return t.ts.getPreEmitDiagnostics(this.program.compilerObject,e?.compilerNode).map(e=>this.compilerFactory.getDiagnostic(e))}getSourceFileContainer(){return{addOrGetSourceFileFromFilePath:(e,t)=>Promise.resolve(this.compilerFactory.addOrGetSourceFileFromFilePath(e,t)?.compilerNode),addOrGetSourceFileFromFilePathSync:(e,t)=>this.compilerFactory.addOrGetSourceFileFromFilePath(e,t)?.compilerNode,containsDirectoryAtPath:e=>this.compilerFactory.containsDirectoryAtPath(e),containsSourceFileAtPath:e=>this.compilerFactory.containsSourceFileAtPath(e),getSourceFileFromCacheFromFilePath:e=>this.compilerFactory.getSourceFileFromCacheFromFilePath(e)?.compilerNode,getSourceFilePaths:()=>this.compilerFactory.getSourceFilePaths(),getSourceFileVersion:e=>this.compilerFactory.documentRegistry.getSourceFileVersion(e),getChildDirectoriesOfDirectory:e=>{let t=[];for(let n of this.compilerFactory.getChildDirectoriesOfDirectory(e))t.push(n.getPath());return t}}}getModuleResolutionHost(){return t.createModuleResolutionHost({transactionalFileSystem:this.fileSystemWrapper,getEncoding:()=>this.getEncoding(),sourceFileContainer:this.getSourceFileContainer()})}#i(e){return new t.errors.InvalidOperationError(`A ${e} is required for this operation. This might occur when manipulating or getting type information from a node that was not added to a Project object and created via createWrappedNode. Please submit a bug report if you don't believe a ${e} should be required for this operation.`)}};Vc([t.Memoize],lm.prototype,`getSourceFileContainer`,null),Vc([t.Memoize],lm.prototype,`getModuleResolutionHost`,null);var um=class{_context;constructor(e={}){s();let n=c(),r=new t.TransactionalFileSystem({fileSystem:n,skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}),i=e.tsConfigFilePath==null?void 0:new t.TsConfigResolver(r,r.getStandardizedAbsolutePath(e.tsConfigFilePath),d()),a=l(),o=new t.CompilerOptionsContainer(e.defaultCompilerOptions);o.set(a),this._context=new lm({project:this,compilerOptionsContainer:o,fileSystemWrapper:r,createLanguageService:!0,resolutionHost:e.resolutionHost,configFileParsingDiagnostics:i?.getErrors()??[],skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}),e.manipulationSettings!=null&&this._context.manipulationSettings.set(e.manipulationSettings),i!=null&&e.skipAddingFilesFromTsConfig!==!0&&(this.#e(i,a),e.skipFileDependencyResolution||this.resolveSourceFileDependencies());function s(){if(e.fileSystem!=null&&e.useInMemoryFileSystem)throw new t.errors.InvalidOperationError(`Cannot provide a file system when specifying to use an in-memory file system.`)}function c(){return e.useInMemoryFileSystem?new t.InMemoryFileSystemHost:e.fileSystem??new t.RealFileSystemHost}function l(){return{...u(),...e.compilerOptions??{}}}function u(){return i?.getCompilerOptions()??{}}function d(){let t=`utf-8`;return e.compilerOptions==null?t:e.compilerOptions.charset??t}}get manipulationSettings(){return this._context.manipulationSettings}get compilerOptions(){return this._context.compilerOptions}resolveSourceFileDependencies(){let e=new Set,t=t=>e.add(t),{compilerFactory:n,inProjectCoordinator:r}=this._context;n.onSourceFileAdded(t);try{this.getProgram().compilerObject}finally{n.onSourceFileAdded(t,!1)}let i=r.markSourceFilesAsInProjectForResolution();for(let t of i.changedSourceFiles)e.add(t);for(let t of i.unchangedSourceFiles)e.delete(t);return Array.from(e.values())}addDirectoryAtPathIfExists(e,t={}){return this._context.directoryCoordinator.addDirectoryAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{...t,markInProject:!0})}addDirectoryAtPath(e,t={}){return this._context.directoryCoordinator.addDirectoryAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{...t,markInProject:!0})}createDirectory(e){return this._context.directoryCoordinator.createDirectoryOrAddIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}getDirectoryOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getDirectory(e),n??(()=>`Could not find a directory at the specified path: ${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e)}`))}getDirectory(e){let{compilerFactory:t}=this._context;return t.getDirectoryFromCache(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e))}getDirectories(){return Array.from(this.#n())}getRootDirectories(){let{inProjectCoordinator:e}=this._context,t=[];for(let e of this._context.compilerFactory.getOrphanDirectories())for(let r of n(e))t.push(r);return t;function*n(t){if(e.isDirectoryInProject(t)){yield t;return}for(let e of t._getDirectoriesIterator())yield*n(e)}}addSourceFilesAtPaths(e){return this._context.directoryCoordinator.addSourceFilesAtPaths(e,{markInProject:!0})}addSourceFileAtPathIfExists(e){return this._context.directoryCoordinator.addSourceFileAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}addSourceFileAtPath(e){return this._context.directoryCoordinator.addSourceFileAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}addSourceFilesFromTsConfig(e){let n=new t.TsConfigResolver(this._context.fileSystemWrapper,this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),this._context.getEncoding());return this.#e(n,n.getCompilerOptions())}#e(e,t){let n=e.getPaths(t),r=n.filePaths.map(e=>this.addSourceFileAtPath(e));for(let e of n.directoryPaths)this.addDirectoryAtPathIfExists(e);return r}createSourceFile(e,t,n){return this._context.compilerFactory.createSourceFile(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),t??``,{...n??{},markInProject:!0})}removeSourceFile(e){let t=e.wasForgotten();return e.forget(),!t}getSourceFileOrThrow(e){let n=this.getSourceFile(e);if(n!=null)return n;if(typeof e==`string`){let n=t.FileUtils.standardizeSlashes(e);if(t.FileUtils.pathIsAbsolute(n)||n.indexOf(`/`)>=0){let e=this._context.fileSystemWrapper.getStandardizedAbsolutePath(n);throw new t.errors.InvalidOperationError(`Could not find source file in project at the provided path: ${e}`)}else throw new t.errors.InvalidOperationError(`Could not find source file in project with the provided file name: ${e}`)}else throw new t.errors.InvalidOperationError(`Could not find source file in project based on the provided condition.`)}getSourceFile(e){let n=r(this._context.fileSystemWrapper);if(i(n))return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(n);return t.IterableUtils.find(this.#t(),n);function r(n){if(e instanceof Function)return e;let r=t.FileUtils.standardizeSlashes(e);return t.FileUtils.pathIsAbsolute(r)||r.indexOf(`/`)>=0?n.getStandardizedAbsolutePath(r):e=>t.FileUtils.pathEndsWith(e.getFilePath(),r)}function i(e){return typeof e==`string`}}getSourceFiles(e){let{compilerFactory:n,fileSystemWrapper:r}=this._context,i=this.#t();if(typeof e==`string`||e instanceof Array)return Array.from(a());return Array.from(i);function*a(){let a=Array.from(s()),o=t.matchGlobs(a,e,r.getCurrentDirectory());for(let e of o)yield n.getSourceFileFromCacheFromFilePath(r.getStandardizedAbsolutePath(e));function*s(){for(let e of i)yield e.getFilePath()}}}*#t(){let{compilerFactory:e,inProjectCoordinator:t}=this._context;for(let n of e.getSourceFilesByDirectoryDepth())t.isSourceFileInProject(n)&&(yield n)}*#n(){let{compilerFactory:e,inProjectCoordinator:t}=this._context;for(let n of e.getDirectoriesByDepth())t.isDirectoryInProject(n)&&(yield n)}getAmbientModule(e){return e=dm(e),this.getAmbientModules().find(t=>t.getName()===e)}getAmbientModuleOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getAmbientModule(e),n??(()=>`Could not find ambient module with name: ${dm(e)}`))}getAmbientModules(){return this.getTypeChecker().getAmbientModules()}async save(){await this._context.fileSystemWrapper.flush(),await Promise.all(this.#r().map(e=>e.save()))}saveSync(){this._context.fileSystemWrapper.flushSync();for(let e of this.#r())e.saveSync()}enableLogging(e=!0){this._context.logger.setEnabled(e)}#r(){return Array.from(e(this._context.compilerFactory.getSourceFilesByDirectoryDepth()));function*e(e){for(let t of e)t.isSaved()||(yield t)}}getPreEmitDiagnostics(){return this._context.getPreEmitDiagnostics()}getLanguageService(){return this._context.languageService}getProgram(){return this._context.program}getTypeChecker(){return this._context.typeChecker}getFileSystem(){return this._context.fileSystemWrapper.getFileSystem()}emit(e={}){return this._context.program.emit(e)}emitSync(e={}){return this._context.program.emitSync(e)}emitToMemory(e={}){return this._context.program.emitToMemory(e)}getCompilerOptions(){return this._context.compilerOptions.get()}getConfigFileParsingDiagnostics(){return this.getProgram().getConfigFileParsingDiagnostics()}createWriter(){return this._context.createWriter()}forgetNodesCreatedInBlock(e){return this._context.compilerFactory.forgetNodesCreatedInBlock(e)}formatDiagnosticsWithColorAndContext(e,n={}){return t.ts.formatDiagnosticsWithColorAndContext(e.map(e=>e.compilerObject),{getCurrentDirectory:()=>this._context.fileSystemWrapper.getCurrentDirectory(),getCanonicalFileName:e=>e,getNewLine:()=>n.newLineChar??t.runtime.getEndOfLine()})}getModuleResolutionHost(){return this._context.getModuleResolutionHost()}};function dm(e){return t(e[0])&&t(e[e.length-1])&&(e=e.substring(1,e.length-1)),`"${e}"`;function t(e){return e===`"`||e===`'`}}function fm(e,n={}){let{compilerOptions:r={},sourceFile:i,typeChecker:a}=n,o=new t.CompilerOptionsContainer;o.set(r);let s=new lm({project:void 0,fileSystemWrapper:new t.TransactionalFileSystem({fileSystem:new t.RealFileSystemHost,skipLoadingLibFiles:!0,libFolderPath:void 0}),compilerOptionsContainer:o,createLanguageService:!1,typeChecker:a,configFileParsingDiagnostics:[],skipLoadingLibFiles:!0,libFolderPath:void 0}),c=s.compilerFactory.getSourceFile(l(),{markInProject:!0});return s.compilerFactory.getNodeFromCompilerNode(e,c);function l(){return i??u(e)}function u(e){if(e.kind===t.SyntaxKind.SourceFile)return e;if(e.parent==null)throw new t.errors.InvalidOperationError(`Please ensure the node was created from a source file with 'setParentNodes' set to 'true'.`);let n=e;for(;n.parent!=null;)n=n.parent;if(n.kind!==t.SyntaxKind.SourceFile)throw new t.errors.NotImplementedError(`For some reason the top parent was not a source file.`);return n}}var pm=new cm(()=>{throw new t.errors.NotImplementedError(`Not implemented scenario for getting code format settings when using a writer function. Please open an issue.`)}),mm=class{constructor(){}static object(e){return t=>{let n=Object.keys(e);t.write(`{`),n.length>0&&t.indent(()=>{r()}),t.write(`}`);function r(){for(let r=0;r<n.length;r++){r>0&&t.write(`,`).newLine();let i=n[r],a=e[i];t.write(i),a!=null&&(t.write(`: `),vm(t,a))}t.newLine()}}}static objectType(e){return t=>{t.write(`{`),gm(e)&&t.indent(()=>{pm.forTypeElementMemberedNode().printText(t,e)}),t.write(`}`)}}static unionType(e,t,...n){return hm(`|`,[e,t,...n])}static intersectionType(e,t,...n){return hm(`&`,[e,t,...n])}static assertion(e,t){return n=>{vm(n,e),n.spaceIfLastNot().write(`as `),vm(n,t)}}static returnStatement(e){return t=>{t.write(`return `),t.hangingIndentUnlessBlock(()=>{vm(t,e),t.write(`;`)})}}};function hm(e,t){return n=>{_m(n,` ${e} `,t)}}function gm(e){for(let t of Object.keys(e))if(e[t]!=null&&!(e[t]instanceof Array&&e[t].length===0))return!0;return!1}function _m(e,t,n){for(let r=0;r<n.length;r++)e.conditionalWrite(r>0,t),vm(e,n[r])}function vm(e,t){t instanceof Function?t(e):e.write(t.toString())}var{InvalidOperationError:ym,FileNotFoundError:bm,ArgumentError:xm,ArgumentNullOrWhitespaceError:Sm,ArgumentOutOfRangeError:Cm,ArgumentTypeError:wm,BaseError:Tm,DirectoryNotFoundError:Em,NotImplementedError:Dm,NotSupportedError:Om,PathNotFoundError:km}=t.errors;Object.defineProperty(e,"CompilerOptionsContainer",{enumerable:!0,get:function(){return t.CompilerOptionsContainer}}),Object.defineProperty(e,"DiagnosticCategory",{enumerable:!0,get:function(){return t.DiagnosticCategory}}),Object.defineProperty(e,"EmitHint",{enumerable:!0,get:function(){return t.EmitHint}}),Object.defineProperty(e,"InMemoryFileSystemHost",{enumerable:!0,get:function(){return t.InMemoryFileSystemHost}}),Object.defineProperty(e,"LanguageVariant",{enumerable:!0,get:function(){return t.LanguageVariant}}),Object.defineProperty(e,"ModuleKind",{enumerable:!0,get:function(){return t.ModuleKind}}),Object.defineProperty(e,"ModuleResolutionKind",{enumerable:!0,get:function(){return t.ModuleResolutionKind}}),Object.defineProperty(e,"NewLineKind",{enumerable:!0,get:function(){return t.NewLineKind}}),Object.defineProperty(e,"NodeFlags",{enumerable:!0,get:function(){return t.NodeFlags}}),Object.defineProperty(e,"ObjectFlags",{enumerable:!0,get:function(){return t.ObjectFlags}}),Object.defineProperty(e,"ResolutionHosts",{enumerable:!0,get:function(){return t.ResolutionHosts}}),Object.defineProperty(e,"ScriptKind",{enumerable:!0,get:function(){return t.ScriptKind}}),Object.defineProperty(e,"ScriptTarget",{enumerable:!0,get:function(){return t.ScriptTarget}}),Object.defineProperty(e,"SettingsContainer",{enumerable:!0,get:function(){return t.SettingsContainer}}),Object.defineProperty(e,"SymbolFlags",{enumerable:!0,get:function(){return t.SymbolFlags}}),Object.defineProperty(e,"SyntaxKind",{enumerable:!0,get:function(){return t.SyntaxKind}}),Object.defineProperty(e,"TypeFlags",{enumerable:!0,get:function(){return t.TypeFlags}}),Object.defineProperty(e,"TypeFormatFlags",{enumerable:!0,get:function(){return t.TypeFormatFlags}}),Object.defineProperty(e,"ts",{enumerable:!0,get:function(){return t.ts}}),Object.defineProperty(e,"CodeBlockWriter",{enumerable:!0,get:function(){return i.default}}),e.AbstractableNode=Ma,e.AmbientableNode=_e,e.ArgumentError=xm,e.ArgumentNullOrWhitespaceError=Sm,e.ArgumentOutOfRangeError=Cm,e.ArgumentTypeError=wm,e.ArgumentedNode=on,e.ArrayBindingPattern=Oa,e.ArrayDestructuringAssignment=za,e.ArrayDestructuringAssignmentBase=Ra,e.ArrayLiteralExpression=Wa,e.ArrayTypeNode=iu,e.ArrowFunction=el,e.ArrowFunctionBase=$c,e.AsExpression=$a,e.AsExpressionBase=Qa,e.AssignmentExpression=La,e.AssignmentExpressionBase=Ia,e.AsyncableNode=sn,e.AwaitExpression=to,e.AwaitExpressionBase=eo,e.AwaitableNode=cn,e.BaseError=Tm,e.BaseExpressionedNode=Ka,e.BigIntLiteral=Wf,e.BigIntLiteralBase=Uf,e.BinaryExpression=Fa,e.BinaryExpressionBase=Pa,e.BindingElement=Aa,e.BindingElementBase=ka,e.BindingNamedNode=Qi,e.Block=gs,e.BlockBase=hs,e.BodiedNode=Sn,e.BodyableNode=Cn,e.BreakStatement=_s,e.CallExpression=ro,e.CallExpressionBase=no,e.CallSignatureDeclaration=Qd,e.CallSignatureDeclarationBase=Zd,e.CaseBlock=ys,e.CaseBlockBase=vs,e.CaseClause=xs,e.CaseClauseBase=bs,e.CatchClause=Cs,e.CatchClauseBase=Ss,e.ChildOrderableNode=wn,e.ClassDeclaration=El,e.ClassDeclarationBase=Tl,e.ClassElement=ml,e.ClassExpression=Pl,e.ClassExpressionBase=Nl,e.ClassLikeDeclarationBase=vl,e.ClassLikeDeclarationBaseSpecific=yl,e.ClassStaticBlockDeclaration=Il,e.ClassStaticBlockDeclarationBase=Fl,e.CodeAction=Dp,e.CodeFixAction=Op,e.CombinedCodeActions=kp,e.CommaListExpression=ao,e.CommaListExpressionBase=io,e.CommentClassElement=Ll,e.CommentEnumMember=Wd,e.CommentObjectLiteralElement=wo,e.CommentRange=pn,e.CommentStatement=ws,e.CommentTypeElement=$d,e.CommonIdentifierBase=pf,e.CompilerCommentClassElement=f,e.CompilerCommentEnumMember=h,e.CompilerCommentNode=u,e.CompilerCommentObjectLiteralElement=m,e.CompilerCommentStatement=d,e.CompilerCommentTypeElement=p,e.ComputedPropertyName=hf,e.ComputedPropertyNameBase=mf,e.ConditionalExpression=so,e.ConditionalExpressionBase=oo,e.ConditionalTypeNode=au,e.ConstructSignatureDeclaration=tf,e.ConstructSignatureDeclarationBase=ef,e.ConstructorDeclaration=Bl,e.ConstructorDeclarationBase=Rl,e.ConstructorDeclarationOverloadBase=zl,e.ConstructorTypeNode=lu,e.ConstructorTypeNodeBase=cu,e.ContinueStatement=Ts,e.DebuggerStatement=Ds,e.DebuggerStatementBase=Es,e.DecoratableNode=Tn,e.Decorator=Jl,e.DecoratorBase=ql,e.DefaultClause=ks,e.DefaultClauseBase=Os,e.DefinitionInfo=jp,e.DeleteExpression=lo,e.DeleteExpressionBase=co,e.Diagnostic=Np,e.DiagnosticMessageChain=Mp,e.DiagnosticWithLocation=Pp,e.Directory=$p,e.DirectoryEmitResult=Qp,e.DirectoryNotFoundError=Em,e.DoStatement=Ms,e.DoStatementBase=js,e.DocumentSpan=Ap,e.DotDotDotTokenableNode=kn,e.ElementAccessExpression=fo,e.ElementAccessExpressionBase=uo,e.EmitOutput=Ip,e.EmitResult=Lp,e.EmptyStatement=Ps,e.EmptyStatementBase=Ns,e.EnumDeclaration=Kd,e.EnumDeclarationBase=Gd,e.EnumMember=Jd,e.EnumMemberBase=qd,e.ExclamationTokenableNode=An,e.ExportAssignment=ic,e.ExportAssignmentBase=rc,e.ExportDeclaration=oc,e.ExportDeclarationBase=ac,e.ExportGetableNode=jn,e.ExportSpecifier=lc,e.ExportSpecifierBase=cc,e.ExportableNode=Nn,e.Expression=Na,e.ExpressionStatement=Is,e.ExpressionStatementBase=Fs,e.ExpressionWithTypeArguments=du,e.ExpressionWithTypeArgumentsBase=uu,e.ExpressionableNode=Ga,e.ExpressionedNode=qa,e.ExtendsClauseableNode=Fi,e.ExternalModuleReference=dc,e.ExternalModuleReferenceBase=uc,e.FalseLiteral=Jf,e.FalseLiteralBase=qf,e.FileNotFoundError=bm,e.FileReference=Bc,e.FileTextChanges=Ep,e.ForInStatement=Rs,e.ForInStatementBase=Ls,e.ForOfStatement=Bs,e.ForOfStatementBase=zs,e.ForStatement=Hs,e.ForStatementBase=Vs,e.FunctionDeclaration=cl,e.FunctionDeclarationBase=ol,e.FunctionDeclarationOverloadBase=sl,e.FunctionExpression=ul,e.FunctionExpressionBase=ll,e.FunctionLikeDeclaration=Qc,e.FunctionOrConstructorTypeNodeBase=su,e.FunctionOrConstructorTypeNodeBaseBase=ou,e.FunctionTypeNode=pu,e.FunctionTypeNodeBase=fu,e.GeneratorableNode=Ii,e.GetAccessorDeclaration=Hl,e.GetAccessorDeclarationBase=Vl,e.HeritageClause=Yd,e.HeritageClauseableNode=Ri,e.Identifier=_f,e.IdentifierBase=gf,e.IfStatement=Ws,e.IfStatementBase=Us,e.ImplementationLocation=Rp,e.ImplementsClauseableNode=zi,e.ImportAttribute=pc,e.ImportAttributeBase=fc,e.ImportAttributeNamedNode=$i,e.ImportAttributes=hc,e.ImportAttributesBase=mc,e.ImportClause=_c,e.ImportClauseBase=gc,e.ImportDeclaration=yc,e.ImportDeclarationBase=vc,e.ImportEqualsDeclaration=Cc,e.ImportEqualsDeclarationBase=Sc,e.ImportExpression=mo,e.ImportExpressionBase=po,e.ImportExpressionedNode=Ja,e.ImportSpecifier=Tc,e.ImportSpecifierBase=wc,e.ImportTypeNode=mu,e.IndexSignatureDeclaration=rf,e.IndexSignatureDeclarationBase=nf,e.IndexedAccessTypeNode=hu,e.InferTypeNode=gu,e.InitializerExpressionGetableNode=Bi,e.InitializerExpressionableNode=Vi,e.InterfaceDeclaration=of,e.InterfaceDeclarationBase=af,e.IntersectionTypeNode=_u,e.InvalidOperationError=ym,e.IterationStatement=As,e.JSDoc=eu,e.JSDocAllType=Bu,e.JSDocAugmentsTag=Ju,e.JSDocAuthorTag=Yu,e.JSDocBase=$l,e.JSDocCallbackTag=Xu,e.JSDocClassTag=Zu,e.JSDocDeprecatedTag=Qu,e.JSDocEnumTag=$u,e.JSDocFunctionType=td,e.JSDocFunctionTypeBase=ed,e.JSDocImplementsTag=nd,e.JSDocLink=rd,e.JSDocLinkCode=id,e.JSDocLinkPlain=ad,e.JSDocMemberName=od,e.JSDocNameReference=cd,e.JSDocNamepathType=sd,e.JSDocNonNullableType=ld,e.JSDocNullableType=ud,e.JSDocOptionalType=dd,e.JSDocOverloadTag=pd,e.JSDocOverloadTagBase=fd,e.JSDocOverrideTag=md,e.JSDocParameterTag=gd,e.JSDocParameterTagBase=hd,e.JSDocPrivateTag=_d,e.JSDocPropertyLikeTag=Yl,e.JSDocPropertyTag=vd,e.JSDocPropertyTagBase=J,e.JSDocProtectedTag=yd,e.JSDocPublicTag=bd,e.JSDocReadonlyTag=xd,e.JSDocReturnTag=Cd,e.JSDocReturnTagBase=Sd,e.JSDocSatisfiesTag=Td,e.JSDocSatisfiesTagBase=wd,e.JSDocSeeTag=Dd,e.JSDocSeeTagBase=Ed,e.JSDocSignature=Od,e.JSDocTag=Hu,e.JSDocTagBase=Vu,e.JSDocTagInfo=kd,e.JSDocTemplateTag=jd,e.JSDocTemplateTagBase=Ad,e.JSDocText=Md,e.JSDocThisTag=Pd,e.JSDocThisTagBase=Nd,e.JSDocThrowsTag=Id,e.JSDocThrowsTagBase=Fd,e.JSDocType=zu,e.JSDocTypeExpression=Rd,e.JSDocTypeExpressionableTag=Xl,e.JSDocTypeLiteral=zd,e.JSDocTypeParameteredTag=Zl,e.JSDocTypeTag=Bd,e.JSDocTypedefTag=Ld,e.JSDocUnknownTag=Vd,e.JSDocUnknownType=Hd,e.JSDocVariadicType=Ud,e.JSDocableNode=Ui,e.JsxAttribute=Sf,e.JsxAttributeBase=xf,e.JsxAttributedNode=df,e.JsxClosingElement=wf,e.JsxClosingElementBase=Cf,e.JsxClosingFragment=Tf,e.JsxElement=Df,e.JsxElementBase=Ef,e.JsxExpression=Af,e.JsxExpressionBase=kf,e.JsxFragment=jf,e.JsxNamespacedName=Nf,e.JsxNamespacedNameBase=Mf,e.JsxOpeningElement=Ff,e.JsxOpeningElementBase=Pf,e.JsxOpeningFragment=If,e.JsxSelfClosingElement=Rf,e.JsxSelfClosingElementBase=Lf,e.JsxSpreadAttribute=Bf,e.JsxSpreadAttributeBase=zf,e.JsxTagNamedNode=ff,e.JsxText=Hf,e.JsxTextBase=Vf,e.LabeledStatement=Ks,e.LabeledStatementBase=Gs,e.LanguageService=Yp,e.LeftHandSideExpression=W,e.LeftHandSideExpressionedNode=Ya,e.LiteralExpression=go,e.LiteralExpressionBase=ho,e.LiteralLikeNode=Wi,e.LiteralTypeNode=vu,e.ManipulationError=Dt,e.ManipulationSettingsContainer=j,e.MappedTypeNode=yu,e.MemberExpression=Ha,e.MemoryEmitResult=zp,e.MetaProperty=vo,e.MetaPropertyBase=_o,e.MethodDeclaration=_l,e.MethodDeclarationBase=hl,e.MethodDeclarationOverloadBase=gl,e.MethodSignature=cf,e.MethodSignatureBase=sf,e.ModifierableNode=Gi,e.ModuleBlock=Dc,e.ModuleBlockBase=Ec,e.ModuleChildableNode=Oc,e.ModuleDeclaration=Ac,e.ModuleDeclarationBase=kc,e.ModuleNamedNode=ea,e.ModuledNode=qi,e.NameableNode=ta,e.NamedExports=Pc,e.NamedExportsBase=Nc,e.NamedImports=Ic,e.NamedImportsBase=Fc,e.NamedNode=ia,e.NamedNodeBase=Ji,e.NamedTupleMember=xu,e.NamedTupleMemberBase=bu,e.NamespaceExport=Rc,e.NamespaceExportBase=Lc,e.NamespaceImport=zc,e.NamespaceImportBase=q,e.NewExpression=bo,e.NewExpressionBase=yo,e.NoSubstitutionTemplateLiteral=op,e.NoSubstitutionTemplateLiteralBase=ap,e.Node=V,e.NodeWithTypeArguments=ru,e.NodeWithTypeArgumentsBase=nu,e.NonNullExpression=So,e.NonNullExpressionBase=xo,e.NotEmittedStatement=Js,e.NotEmittedStatementBase=qs,e.NotImplementedError=Dm,e.NotSupportedError=Om,e.NullLiteral=Qf,e.NullLiteralBase=Zf,e.NumericLiteral=ep,e.NumericLiteralBase=$f,e.ObjectBindingPattern=ja,e.ObjectDestructuringAssignment=Eo,e.ObjectDestructuringAssignmentBase=To,e.ObjectLiteralElement=Co,e.ObjectLiteralExpression=Oo,e.ObjectLiteralExpressionBase=Do,e.OmittedExpression=Io,e.OmittedExpressionBase=Fo,e.OutputFile=Fp,e.OverloadableNode=tl,e.OverrideableNode=oa,e.ParameterDeclaration=fl,e.ParameterDeclarationBase=dl,e.ParameteredNode=sa,e.ParenthesizedExpression=K,e.ParenthesizedExpressionBase=G,e.ParenthesizedTypeNode=Su,e.PartiallyEmittedExpression=Ro,e.PartiallyEmittedExpressionBase=Lo,e.PathNotFoundError=km,e.PostfixUnaryExpression=Bo,e.PostfixUnaryExpressionBase=zo,e.PrefixUnaryExpression=Ho,e.PrefixUnaryExpressionBase=Vo,e.PrimaryExpression=Ua,e.PrivateIdentifier=yf,e.PrivateIdentifierBase=vf,e.Program=Jp,e.Project=um,e.PropertyAccessExpression=Wo,e.PropertyAccessExpressionBase=Uo,e.PropertyAssignment=Ao,e.PropertyAssignmentBase=ko,e.PropertyDeclaration=Wl,e.PropertyDeclarationBase=Ul,e.PropertyNamedNode=aa,e.PropertySignature=uf,e.PropertySignatureBase=lf,e.QualifiedName=bf,e.QuestionDotTokenableNode=ca,e.QuestionTokenableNode=la,e.ReadonlyableNode=ua,e.RefactorEditInfo=Bp,e.ReferenceEntry=Up,e.ReferenceFindableNode=Yi,e.ReferencedSymbol=Vp,e.ReferencedSymbolDefinitionInfo=Hp,e.ReferencedSymbolEntry=Wp,e.RegularExpressionLiteral=np,e.RegularExpressionLiteralBase=tp,e.RenameLocation=Gp,e.RenameableNode=Zi,e.RestTypeNode=Cu,e.ReturnStatement=Xs,e.ReturnStatementBase=Ys,e.ReturnTypedNode=da,e.SatisfiesExpression=Ko,e.SatisfiesExpressionBase=Go,e.ScopeableNode=fa,e.ScopedNode=ha,e.SetAccessorDeclaration=Kl,e.SetAccessorDeclarationBase=Gl,e.ShorthandPropertyAssignment=Mo,e.ShorthandPropertyAssignmentBase=jo,e.Signature=Sp,e.SignaturedDeclaration=ga,e.SourceFile=Uc,e.SourceFileBase=Hc,e.SpreadAssignment=Po,e.SpreadAssignmentBase=No,e.SpreadElement=Jo,e.SpreadElementBase=qo,e.Statement=fs,e.StatementBase=ds,e.StatementedNode=ps,e.StaticableNode=_a,e.StringLiteral=ip,e.StringLiteralBase=rp,e.Structure=Yn,e.SuperElementAccessExpression=Xo,e.SuperElementAccessExpressionBase=Yo,e.SuperExpression=Qo,e.SuperExpressionBase=Zo,e.SuperExpressionedNode=Xa,e.SuperPropertyAccessExpression=es,e.SuperPropertyAccessExpressionBase=$o,e.SwitchStatement=Qs,e.SwitchStatementBase=Zs,e.Symbol=Cp,e.SymbolDisplayPart=Kp,e.SyntaxList=yn,e.TaggedTemplateExpression=sp,e.TemplateExpression=lp,e.TemplateExpressionBase=cp,e.TemplateHead=dp,e.TemplateHeadBase=up,e.TemplateLiteralTypeNode=wu,e.TemplateMiddle=pp,e.TemplateMiddleBase=fp,e.TemplateSpan=hp,e.TemplateSpanBase=mp,e.TemplateTail=_p,e.TemplateTailBase=gp,e.TextChange=Tp,e.TextInsertableNode=va,e.TextRange=fn,e.TextSpan=wp,e.ThisExpression=ns,e.ThisExpressionBase=ts,e.ThisTypeNode=Tu,e.ThrowStatement=ec,e.ThrowStatementBase=$s,e.TrueLiteral=Kf,e.TrueLiteralBase=Gf,e.TryStatement=nc,e.TryStatementBase=tc,e.TupleTypeNode=Eu,e.Type=Xp,e.TypeAliasDeclaration=Ou,e.TypeAliasDeclarationBase=Du,e.TypeArgumentedNode=ba,e.TypeAssertion=is,e.TypeAssertionBase=rs,e.TypeChecker=qp,e.TypeElement=Xd,e.TypeElementMemberedNode=Ca,e.TypeLiteralNode=Au,e.TypeLiteralNodeBase=ku,e.TypeNode=tu,e.TypeOfExpression=os,e.TypeOfExpressionBase=as,e.TypeOperatorTypeNode=ju,e.TypeParameter=Zp,e.TypeParameterDeclaration=Nu,e.TypeParameterDeclarationBase=Mu,e.TypeParameteredNode=Ta,e.TypePredicateNode=Fu,e.TypeQueryNode=Iu,e.TypeReferenceNode=Lu,e.TypedNode=xa,e.UnaryExpression=Ba,e.UnaryExpressionedNode=Za,e.UnionTypeNode=Ru,e.UnwrappableNode=Da,e.UpdateExpression=Va,e.VariableDeclaration=yp,e.VariableDeclarationBase=vp,e.VariableDeclarationList=xp,e.VariableDeclarationListBase=bp,e.VariableStatement=qc,e.VariableStatementBase=Kc,e.VoidExpression=cs,e.VoidExpressionBase=ss,e.WhileStatement=Yc,e.WhileStatementBase=Jc,e.WithStatement=Zc,e.WithStatementBase=Xc,e.Writers=mm,e.YieldExpression=us,e.YieldExpressionBase=ls,e.createWrappedNode=fm,e.forEachStructureChild=Xn,e.getCompilerOptionsFromTsConfig=pe,e.getScopeForNode=pa,e.insertOverloads=al,e.printNode=A,e.setScopeForNode=ma}))(),en=new Set([`t`,`msg`]),tn=`Trans`,nn=e=>{if(e!==void 0&&($t.Node.isStringLiteral(e)||$t.Node.isNoSubstitutionTemplateLiteral(e)))return e.getLiteralText()},rn=e=>{if(e===void 0)return;let t=nn(e);if(t!==void 0)return{message:t};if(!$t.Node.isObjectLiteralExpression(e))return;let n=e.getProperty(`message`);if(n===void 0||!$t.Node.isPropertyAssignment(n))return;let r=nn(n.getInitializer());if(r===void 0)return;let i=e.getProperty(`context`),a=i!==void 0&&$t.Node.isPropertyAssignment(i)?nn(i.getInitializer()):void 0;return a===void 0?{message:r}:{message:r,context:a}},an=(e,t)=>{let n=e.getAttribute(t);if(n===void 0||!$t.Node.isJsxAttribute(n))return;let r=n.getInitializer();if(r!==void 0){if($t.Node.isStringLiteral(r))return r.getLiteralText();if($t.Node.isJsxExpression(r))return nn(r.getExpression())}},on=e=>{let t=e.getJsxChildren();if(t.some(e=>$t.Node.isJsxExpression(e)||$t.Node.isJsxElement(e)||$t.Node.isJsxSelfClosingElement(e)))return;let n=Bt(t.filter(e=>$t.Node.isJsxText(e)).map(e=>e.getText()).join(``));return n.length>0?n:void 0},sn=e=>{let t=new Map;for(let n of e)t.set(zt(n.message,n.context),n);return[...t.values()]},cn=async e=>{if(e.length===0)return[];let t=new $t.Project({useInMemoryFileSystem:!0,skipFileDependencyResolution:!0}),n=[];for(let i=0;i<e.length;i++){let a;try{a=await(0,r.readFile)(e[i],`utf8`)}catch{continue}t.createSourceFile(`front-component-${i}.tsx`,a,{overwrite:!0}).forEachDescendant(e=>{if($t.Node.isCallExpression(e)){let t=e.getExpression();if($t.Node.isIdentifier(t)&&en.has(t.getText())){let t=rn(e.getArguments()[0]);t!==void 0&&n.push(t)}return}if($t.Node.isJsxSelfClosingElement(e)){if(e.getTagNameNode().getText()!==tn)return;let t=an(e,`message`);if(t!==void 0&&t.length>0){let r=an(e,`context`);n.push(r===void 0?{message:t}:{message:t,context:r})}return}if($t.Node.isJsxElement(e)){let t=e.getOpeningElement();if(t.getTagNameNode().getText()!==tn)return;let r=an(t,`message`)??on(e);if(r!==void 0&&r.length>0){let e=an(t,`context`);n.push(e===void 0?{message:r}:{message:r,context:e})}}})}return sn(n)},ln={objectMetadata:`objects`,fieldMetadata:`fields`,view:`views`,pageLayout:`pageLayouts`,pageLayoutTab:`pageLayoutTabs`,commandMenuItem:`commandMenuItems`,navigationMenuItem:`navigationMenuItems`,timelineActivityType:`timelineActivityTypes`},un=e=>{let n=new Map,r=(e,r)=>{if(!(typeof e!=`object`||!e))for(let i of t.st[r]){let a=e[i];if(typeof a!=`string`||a.length===0)continue;let o=t.ot(r,i);n.set(JSON.stringify([o,a]),{message:a,context:o})}};for(let[t,n]of Object.entries(ln)){let i=e[n];if(Array.isArray(i))for(let e of i)r(e,t)}for(let t of e.pageLayouts??[])for(let e of t.tabs??[]){r(e,`pageLayoutTab`);for(let t of e.widgets??[])r(t,`pageLayoutWidget`)}return[...n.values()]},dn=async({manifest:e,frontComponentSourcePaths:t})=>{let n=await cn(t),r=new Map;for(let t of[...un(e),...n])r.set(zt(t.message,t.context),t);return[...r.values()]},fn=async({appPath:e,manifest:i,frontComponentSourcePaths:a=[],scaffoldLocale:o})=>{let s=await dn({manifest:i,frontComponentSourcePaths:a}),c=n.default.join(e,t.rt);if(await t.vt(c),await t.St(n.default.join(c,`en.json`),t.it(s.map(({message:e,context:t})=>({message:e,context:t,translation:e})))),o!==void 0&&o!==`en`){let e=n.default.join(c,`${o}.json`);await t.yt(e)||await t.St(e,{})}let l=(await(0,r.readdir)(c)).filter(e=>e.endsWith(`.json`)&&e!==`en.json`);for(let e of l){let r=n.default.join(c,e),i=await t.bt(r)??{},a=new Map(t.at(i).map(e=>[zt(e.message,e.context),e.translation]));await t.St(r,t.it(s.map(({message:e,context:t})=>({message:e,context:t,translation:a.get(zt(e,t))??``}))))}return{sourceCount:s.length,updatedLocaleFiles:l}},pn=e=>Object.prototype.hasOwnProperty.call(t.Et,e),V=class{async execute(e){let r=e.appPath??t.Dt,i;e.locale!==void 0&&((e.locale===`en`||!pn(e.locale))&&(console.error(u.default.red(`"${e.locale}" is not a supported target locale. Choose one of: ${Object.keys(t.Et).filter(e=>e!==`en`).join(`, `)}`)),process.exit(1)),i=e.locale),console.log(u.default.blue(`Extracting translatable strings...`));let a=await t.et(r);a.success||(console.error(u.default.red(a.errors.join(`
31395
+ `)}getTags(){return this.compilerNode.tags?.map(e=>this._getNodeFromCompilerNode(e))??[]}getInnerText(){return Ql(this.getText())}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:this.compilerNode.comment.map(e=>this._getNodeFromCompilerNodeIfExists(e))}getCommentText(){return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:t.ts.getTextOfJSDocComment(this.compilerNode.comment)}getDescription(){let e=this.getSourceFile().getFullText(),n=this.getTags()[0]?.getStart()??this.getEnd()-2,r=i(this);return Ql(e.substring(r,Math.max(r,a())));function i(t){let n=t.getStart()+3;return e.charCodeAt(n)===o.SPACE?n+1:n}function a(){return Ne(e,Ne(e,n,e=>e===o.NEWLINE||!t.StringUtils.isWhitespaceCharCode(e)&&e!==o.ASTERISK),e=>e!==o.NEWLINE&&e!==o.CARRIAGE_RETURN)}}setDescription(e){let t=this.getTags(),n=this.getStart()+3,r=t.length>0?Ne(this._sourceFile.getFullText(),t[0].getStart(),e=>e===o.ASTERISK)-1:this.getEnd()-2;return nn({parent:this,newText:i.call(this),replacePos:n,replacingLength:r-n}),this;function i(){let t=this.getIndentationText(),n=this._context.manipulationSettings.getNewLineKindAsString(),r=F(this._getWriter(),e).split(/\r?\n/),i=r[0].length===0,a=r.length===1&&(this.compilerNode.tags?.length??0)===0,o=a?r[0]:r.map(e=>e.length===0?`${t} *`:`${t} * ${e}`).slice(+!!i).join(n);return a?` `+o+` `:n+o+n+t+` `}}addTag(e){return this.addTags([e])[0]}addTags(e){return this.insertTags(this.compilerNode.tags?.length??0,e)}insertTag(e,t){return this.insertTags(e,[t])[0]}insertTags(e,n){if(t.ArrayUtils.isNullOrEmpty(n))return[];let r=this._getWriterWithQueuedIndentation(),i=this.getTags();if(e=tt(e,i.length),i.length===0&&!this.isMultiLine()){let e=this._context.structurePrinterFactory.forJSDoc();this.replaceWithText(t=>{e.printText(t,{description:this.getDescription(),tags:n})})}else{let t=this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0});r.newLine().write(` * `),t.printTexts(r,n),r.newLine().write(` *`),r.conditionalWrite(e<i.length,` `);let o=a.call(this),c=s.call(this);At({parent:this,insertPos:o,replacing:{textLength:c-o},newText:r.toString()})}return Xe(i,this.getTags(),e,!1);function a(){let n=e<i.length?i[e].getStart():this.getEnd()-2,r=this.getStart()+3;return Math.max(r,Ne(this.getSourceFile().getFullText(),n,e=>!t.StringUtils.isWhitespaceCharCode(e)&&e!==o.ASTERISK))}function s(){return e<i.length?i[e].getStart():this.getEnd()-1}}remove(){Lt({children:[this],removeFollowingSpaces:!0,removeFollowingNewLines:!0})}set(e){return ge($l.prototype,this,e),e.tags==null?(e.description!=null&&this.setDescription(e.description),this):this.replaceWithText(t=>{this._context.structurePrinterFactory.forJSDoc().printText(t,{description:e.description??this.getDescription(),tags:e.tags})})}getStructure(){return he($l.prototype,this,{kind:e.StructureKind.JSDoc,description:this.getDescription(),tags:this.getTags().map(e=>e.getStructure())})}},tu=class extends V{},nu=ba(tu),ru=class extends nu{},iu=class extends tu{getElementTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.elementType)}},au=class extends tu{getCheckType(){return this._getNodeFromCompilerNode(this.compilerNode.checkType)}getExtendsType(){return this._getNodeFromCompilerNode(this.compilerNode.extendsType)}getTrueType(){return this._getNodeFromCompilerNode(this.compilerNode.trueType)}getFalseType(){return this._getNodeFromCompilerNode(this.compilerNode.falseType)}},ou=ga(tu),su=class extends ou{},cu=Ma(Gi(su)),lu=class extends cu{},uu=Ya(ru),du=class extends uu{},fu=Ta(su),pu=class extends fu{},mu=class extends ru{setArgument(e){let t=this.getArgument();if(V.isLiteralTypeNode(t)){let n=t.getLiteral();if(V.isStringLiteral(n))return n.setLiteralValue(e),this}return t.replaceWithText(t=>t.quote(e),this._getWriterWithQueuedChildIndentation()),this}getArgument(){return this._getNodeFromCompilerNode(this.compilerNode.argument)}setQualifier(e){let n=this.getQualifier();return n==null?At({insertPos:this.getFirstChildByKindOrThrow(t.SyntaxKind.CloseParenToken).getEnd(),parent:this,newText:this._getWriterWithQueuedIndentation().write(`.`).write(e).toString()}):n.replaceWithText(e,this._getWriterWithQueuedChildIndentation()),this}getQualifierOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQualifier(),e??(()=>`Expected to find a qualifier for the import type: ${this.getText()}`),this)}getQualifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.qualifier)}getAttributes(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes)}getAttributesOrThrow(e){return t.errors.throwIfNullOrUndefined(this._getNodeFromCompilerNodeIfExists(this.compilerNode.attributes),e??`Could not find import type assertion container.`,this)}},hu=class extends tu{getObjectTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.objectType)}getIndexTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.indexType)}},gu=class extends tu{getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}},_u=class extends tu{getTypeNodes(){return this.compilerNode.types.map(e=>this._getNodeFromCompilerNode(e))}},vu=class extends tu{getLiteral(){let e=this.compilerNode.literal;return this._getNodeFromCompilerNode(e)}},yu=class extends tu{getNameTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.nameType)}getNameTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getNameTypeNode(),e??`Type did not exist.`,this)}getReadonlyToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.readonlyToken)}getReadonlyTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getReadonlyToken(),e??`Readonly token did not exist.`,this)}getQuestionToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionToken)}getQuestionTokenOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getQuestionToken(),e??`Question token did not exist.`,this)}getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeNode(),e??`Type did not exist, but was expected to exist.`,this)}},bu=(e=>xa(la(kn(Ui(ia(e))))))(tu),xu=class extends bu{getTypeNode(){return super.getTypeNode()}removeType(){throw new t.errors.InvalidOperationError(`Cannot remove the type of a named tuple member.`)}},Su=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}setType(e){return this.getTypeNode().replaceWithText(e),this}},Cu=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},wu=class extends tu{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(e=>this._getNodeFromCompilerNode(e))}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()??this.getParentOrThrow();return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},Tu=class extends tu{},Eu=class extends tu{getElements(){return this.compilerNode.elements.map(e=>this._getNodeFromCompilerNode(e))}},Du=(e=>Ta(xa(Ui(_e(Nn(Gi(ia(e))))))))(fs),Ou=class extends Du{set(e){return ge(Du.prototype,this,e),this}getStructure(){return he(Du.prototype,this,{kind:e.StructureKind.TypeAlias,type:this.getTypeNodeOrThrow().getText()})}},ku=Ca(tu),Au=class extends ku{},ju=class extends tu{getOperator(){return this.compilerNode.operator}getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}};e.TypeParameterVariance=void 0,(function(e){e[e.None=0]=`None`,e[e.In=1]=`In`,e[e.Out=2]=`Out`,e[e.InOut=3]=`InOut`})(e.TypeParameterVariance||={});var Mu=(e=>Gi(ia(e)))(V),Nu=class extends Mu{isConst(){return this.hasModifier(t.SyntaxKind.ConstKeyword)}setIsConst(e){return this.toggleModifier(`const`,e)}getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find the type parameter's constraint.`,this)}setConstraint(e){if(e=this.getParentOrThrow()._getTextWithQueuedChildIndentation(e),t.StringUtils.isNullOrWhitespace(e))return this.removeConstraint(),this;let n=this.getConstraint();if(n!=null)return n.replaceWithText(e),this;let r=this.getNameNode();return At({parent:this,insertPos:r.getEnd(),newText:` extends ${e}`}),this}removeConstraint(){return Pu(this.getConstraint(),t.SyntaxKind.ExtendsKeyword),this}getDefault(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.default)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected to find the type parameter's default.`,this)}setDefault(e){if(e=this.getParentOrThrow()._getTextWithQueuedChildIndentation(e),t.StringUtils.isNullOrWhitespace(e))return this.removeDefault(),this;let n=this.getDefault();if(n!=null)return n.replaceWithText(e),this;let r=this.getConstraint()||this.getNameNode();return At({parent:this,insertPos:r.getEnd(),newText:` = ${e}`}),this}removeDefault(){return Pu(this.getDefault(),t.SyntaxKind.EqualsToken),this}setVariance(t){return this.toggleModifier(`in`,(t&e.TypeParameterVariance.In)!==0),this.toggleModifier(`out`,(t&e.TypeParameterVariance.Out)!==0),this}getVariance(){let n=e.TypeParameterVariance.None;return this.hasModifier(t.SyntaxKind.InKeyword)&&(n|=e.TypeParameterVariance.In),this.hasModifier(t.SyntaxKind.OutKeyword)&&(n|=e.TypeParameterVariance.Out),n}remove(){let e=this.getParentSyntaxListOrThrow();e.getChildrenOfKind(t.SyntaxKind.TypeParameter).length===1?n():Wt(this);function n(){Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.LessThanToken),e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.GreaterThanToken)]})}}set(e){return ge(Mu.prototype,this,e),e.isConst!=null&&this.setIsConst(e.isConst),e.constraint==null?e.hasOwnProperty(t.nameof(e,`constraint`))&&this.removeConstraint():this.setConstraint(e.constraint),e.default==null?e.hasOwnProperty(t.nameof(e,`default`))&&this.removeDefault():this.setDefault(e.default),e.variance!=null&&this.setVariance(e.variance),this}getStructure(){let t=this.getConstraint(),n=this.getDefault();return he(Mu.prototype,this,{kind:e.StructureKind.TypeParameter,isConst:this.isConst(),constraint:t?.getText({trimLeadingIndentation:!0}),default:n?n.getText({trimLeadingIndentation:!0}):void 0,variance:this.getVariance()})}};function Pu(e,t){e!=null&&Lt({children:[e.getPreviousSiblingIfKindOrThrow(t),e],removePrecedingSpaces:!0})}var Fu=class extends tu{getParameterNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.parameterName)}hasAssertsModifier(){return this.compilerNode.assertsModifier!=null}getAssertsModifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertsModifier)}getAssertsModifierOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAssertsModifier(),e??`Expected to find an asserts modifier.`,this)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTypeNode(),e??`Expected to find a type node.`,this)}},Iu=class extends ru{getExprName(){return this._getNodeFromCompilerNode(this.compilerNode.exprName)}},Lu=class extends ru{getTypeName(){return this._getNodeFromCompilerNode(this.compilerNode.typeName)}},Ru=class extends tu{getTypeNodes(){return this.compilerNode.types.map(e=>this._getNodeFromCompilerNode(e))}},zu=class extends tu{},Bu=class extends zu{},Vu=V,Hu=class extends Vu{getTagName(){return this.getTagNameNode().getText()}getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}setTagName(e){return this.set({tagName:e})}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:this.compilerNode.comment.map(e=>this._getNodeFromCompilerNodeIfExists(e))}getCommentText(){return typeof this.compilerNode.comment==`string`?this.compilerNode.comment:t.ts.getTextOfJSDocComment(this.compilerNode.comment)}remove(){let e=this.getParentOrThrow().getStart()+3,t=Ku(this),n=t==null,r=i.call(this);Lt({children:[this],customRemovalPos:r,customRemovalEnd:Gu(this,t),replaceTrivia:a.call(this)});function i(){return Math.max(e,qu(this,this.getStart()))}function a(){return r===e&&n?``:`${this._context.manipulationSettings.getNewLineKindAsString()}${this.getParentOrThrow().getIndentationText()} `+(n?``:`* `)}}set(e){return ge(Vu.prototype,this,e),e.text!=null||e.tagName!=null?this.replaceWithText(t=>{this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0}).printText(t,{tagName:e.tagName??this.getTagName(),text:e.text==null?Uu(this):e.text})}):this}replaceWithText(e){let t=F(this._getWriterWithQueuedIndentation(),e),n=this.getParentOrThrow(),r=this.getChildIndex(),i=this.getStart();return At({parent:n,insertPos:i,newText:t,replacing:{textLength:Wu(this)-i}}),n.getChildren()[r]}getStructure(){let t=Uu(this);return he(Vu.prototype,this,{kind:e.StructureKind.JSDocTag,tagName:this.getTagName(),text:t.length===0?void 0:t})}};function Uu(e){let t=e.getSourceFile().getFullText(),n=e.getTagNameNode().getEnd(),r=Wu(e),i=Math.min(t.charCodeAt(n)===o.SPACE?n+1:n,r);return Ql(t.substring(i,r))}function Wu(e){return qu(e,Gu(e))}function Gu(e,t){return t??=Ku(e),t==null?e.getParentOrThrow().getEnd()-2:t.getStart()}function Ku(e){let n=e.getParentIfKindOrThrow(t.SyntaxKind.JSDoc).getTags();return n[n.indexOf(e)+1]}function qu(e,n){return Ne(e.getSourceFile().getFullText(),n,e=>e!==o.ASTERISK&&!t.StringUtils.isWhitespaceCharCode(e))}var Ju=class extends Hu{},Yu=class extends Hu{},Xu=class extends Hu{},Zu=class extends Hu{},Qu=class extends Hu{},$u=class extends Hu{},ed=ga(zu),td=class extends ed{},nd=class extends Hu{},rd=class extends V{},id=class extends V{},ad=class extends V{},od=class extends V{},sd=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},cd=class extends V{getName(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},ld=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},ud=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},dd=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},fd=Xl(Hu),pd=class extends fd{},md=class extends Hu{},hd=Yl(Hu),gd=class extends hd{},_d=class extends Hu{},J=Yl(Hu),vd=class extends J{},yd=class extends Hu{},bd=class extends Hu{},xd=class extends Hu{},Sd=Xl(Hu),Cd=class extends Sd{},wd=Xl(Hu),Td=class extends wd{},Ed=Xl(Hu),Dd=class extends Ed{},Od=class extends zu{getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}},kd=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getName(){return this.compilerObject.name}getText(){return this.compilerObject.text??[]}},Ad=Zl(Hu),jd=class extends Ad{getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find the JS doc template tag's constraint.`,this)}},Md=class extends V{},Nd=Xl(Hu),Pd=class extends Nd{},Fd=Xl(Hu),Id=class extends Fd{},Ld=class extends Hu{},Rd=class extends tu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},zd=class extends zu{isArrayType(){return this.compilerNode.isArrayType}getPropertyTags(){return this.compilerNode.jsDocPropertyTags?this.compilerNode.jsDocPropertyTags.map(e=>this._getNodeFromCompilerNode(e)):void 0}},Bd=class extends Hu{getTypeExpression(){let e=this.compilerNode.typeExpression;if(!(e!=null&&e.pos===e.end))return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression)}},Vd=class extends Hu{},Hd=class extends zu{},Ud=class extends zu{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},Wd=class extends V{remove(){zt({children:[this],getSiblingFormatting:()=>ve.Newline})}},Gd=(e=>va(Oc(Ui(_e(Nn(Gi(ia(e))))))))(fs),Kd=class extends Gd{set(e){return ge(Gd.prototype,this,e),e.isConst!=null&&this.setIsConstEnum(e.isConst),e.members!=null&&(this.getMembers().forEach(e=>e.remove()),this.addMembers(e.members)),this}addMember(e){return this.addMembers([e])[0]}addMembers(e){return this.insertMembers(this.getMembers().length,e)}insertMember(e,t){return this.insertMembers(e,[t])[0]}insertMembers(e,t){if(t.length===0)return[];let n=this.getMembersWithComments();e=tt(e,n.length);let r=this._getWriterWithChildIndentation();return this._context.structurePrinterFactory.forEnumMember().printTexts(r,t),Mt({parent:this.getChildSyntaxListOrThrow(),currentNodes:n,insertIndex:e,newText:r.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),Xe(n,this.getMembersWithComments(),e,!i());function i(){return t instanceof Array?t.every(e=>typeof e==`object`):!1}}getMember(e){return s(this.getMembers(),e)}getMemberOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getMember(e),()=>l(`enum member`,e))}getMembers(){return this.compilerNode.members.map(e=>this._getNodeFromCompilerNode(e))}getMembersWithComments(){let e=this.compilerNode;return T.getContainerArray(e,this.getSourceFile().compilerNode).map(e=>this._getNodeFromCompilerNode(e))}setIsConstEnum(e){return this.toggleModifier(`const`,e)}isConstEnum(){return this.getConstKeyword()!=null}getConstKeyword(){return this.getFirstModifierByKind(t.SyntaxKind.ConstKeyword)}getStructure(){return he(Gd.prototype,this,{kind:e.StructureKind.Enum,isConst:this.isConstEnum(),members:this.getMembers().map(e=>e.getStructure())})}},qd=(e=>Ui(Vi(aa(e))))(V),Jd=class extends qd{getValue(){return this._context.typeChecker.getConstantValue(this)}setValue(e){let n;if(typeof e==`string`){let r=this._context.manipulationSettings.getQuoteKind();n=r+t.StringUtils.escapeForWithinString(e,r)+r}else n=e.toString();return this.setInitializer(n),this}remove(){let e=[this],n=this.getNextSiblingIfKind(t.SyntaxKind.CommaToken);n!=null&&e.push(n),zt({children:e,getSiblingFormatting:()=>ve.Newline})}set(e){return ge(qd.prototype,this,e),e.value==null?e.hasOwnProperty(t.nameof(e,`value`))&&e.initializer==null&&this.removeInitializer():this.setValue(e.value),this}getStructure(){return he(qd.prototype,this,{kind:e.StructureKind.EnumMember,value:void 0})}},Yd=class extends V{getTypeNodes(){return this.compilerNode.types?.map(e=>this._getNodeFromCompilerNode(e))??[]}getToken(){return this.compilerNode.token}removeExpression(e){let t=this.getTypeNodes(),n=typeof e==`number`?r(e):e;if(t.length===1){let e=this.getParentSyntaxListOrThrow().getChildren();e.length===1?Lt({children:[e[0].getParentSyntaxListOrThrow()],removePrecedingSpaces:!0}):Lt({children:[this],removePrecedingSpaces:!0})}else Wt(n);return this;function r(e){return t[tt(e,t.length-1)]}}},Xd=class extends V{remove(){Ht(this)}},Zd=(e=>Ta(wn(Ui(ga(e)))))(Xd),Qd=class extends Zd{set(e){return ge(Zd.prototype,this,e),this}getStructure(){return he(Zd.prototype,this,{kind:e.StructureKind.CallSignature})}},$d=class extends Xd{},ef=(e=>Ta(wn(Ui(ga(e)))))(Xd),tf=class extends ef{set(e){return ge(ef.prototype,this,e),this}getStructure(){return he(ef.prototype,this,{kind:e.StructureKind.ConstructSignature})}},nf=(e=>da(wn(Ui(ua(Gi(e))))))(Xd),rf=class extends nf{getKeyName(){return this.getKeyNameNode().getText()}setKeyName(e){t.errors.throwIfWhitespaceOrNotString(e,`name`),this.getKeyName()!==e&&this.getKeyNameNode().replaceWithText(e,this._getWriterWithQueuedChildIndentation())}getKeyNameNode(){let e=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(e.name)}getKeyType(){return this.getKeyNameNode().getType()}setKeyType(e){t.errors.throwIfWhitespaceOrNotString(e,`type`);let n=this.getKeyTypeNode();return n.getText()===e||n.replaceWithText(e,this._getWriterWithQueuedChildIndentation()),this}getKeyTypeNode(){let e=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(e.type)}set(e){return ge(nf.prototype,this,e),e.keyName!=null&&this.setKeyName(e.keyName),e.keyType!=null&&this.setKeyType(e.keyType),this}getStructure(){let t=this.getKeyTypeNode();return he(nf.prototype,this,{kind:e.StructureKind.IndexSignature,keyName:this.getKeyName(),keyType:t.getText()})}},af=(e=>Ca(va(Fi(Ri(Ta(Ui(_e(Oc(Nn(Gi(ia(e))))))))))))(fs),of=class extends af{getBaseTypes(){return this.getType().getBaseTypes()}getBaseDeclarations(){return this.getType().getBaseTypes().map(e=>e.getSymbol()?.getDeclarations()??[]).flat()}getImplementations(){return this.getNameNode().getImplementations()}set(e){return ge(af.prototype,this,e),this}getStructure(){return he(af.prototype,this,{kind:e.StructureKind.Interface})}},sf=(e=>wn(Ui(la(Ta(ga(aa(e)))))))(Xd),cf=class extends sf{set(e){return ge(sf.prototype,this,e),this}getStructure(){return he(sf.prototype,this,{kind:e.StructureKind.MethodSignature})}},lf=(e=>wn(Ui(ua(la(Vi(xa(aa(Gi(e)))))))))(Xd),uf=class extends lf{set(e){return ge(lf.prototype,this,e),this}getStructure(){return he(lf.prototype,this,{kind:e.StructureKind.PropertySignature})}};function df(e){return class extends e{getAttributes(){return this.compilerNode.attributes.properties.map(e=>this._getNodeFromCompilerNode(e))}getAttributeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAttribute(e),()=>l(`attribute`,e))}getAttribute(e){return s(this.getAttributes(),e)}addAttribute(e){return this.addAttributes([e])[0]}addAttributes(e){return this.insertAttributes(this.compilerNode.attributes.properties.length,e)}insertAttribute(e,t){return this.insertAttributes(e,[t])[0]}insertAttributes(e,n){if(n.length===0)return[];let r=this.compilerNode.attributes.properties.length;e=tt(e,r);let i=e===0?this.getTagNameNode().getEnd():this.getAttributes()[e-1].getEnd(),a=this._getWriterWithQueuedChildIndentation();return new Gn(this._context.structurePrinterFactory.forJsxAttributeDecider()).printText(a,n),At({insertPos:i,newText:` `+a.toString(),parent:this.getNodeProperty(`attributes`).getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList)}),Xe(r,this.getAttributes(),e,!1)}set(t){return ge(e.prototype,this,t),t.attributes!=null&&(this.getAttributes().forEach(e=>e.remove()),this.addAttributes(t.attributes)),this}getStructure(){return he(e.prototype,this,{attributes:this.getAttributes().map(e=>e.getStructure())})}}}function ff(e){return class extends e{getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}set(t){return ge(e.prototype,this,t),t.name!=null&&this.getTagNameNode().replaceWithText(t.name),this}getStructure(){return he(e.prototype,this,{name:this.getTagNameNode().getText()})}}}function pf(e){return class extends e{getText(){return this.compilerNode.text}getDefinitionNodes(){return this.getDefinitions().map(e=>e.getDeclarationNode()).filter(e=>e!=null)}getDefinitions(){return this._context.languageService.getDefinitions(this)}}}var mf=qa(V),hf=class extends mf{},gf=pf(Yi(Zi(Ua))),_f=class extends gf{getImplementations(){return this._context.languageService.getImplementations(this)}},vf=pf(Yi(Zi(V))),yf=class extends vf{},bf=class extends V{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}getRight(){return this._getNodeFromCompilerNode(this.compilerNode.right)}},xf=V,Sf=class extends xf{getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}setName(e){return this.getNameNode().replaceWithText(t=>{typeof e==`object`?this._context.structurePrinterFactory.forJsxNamespacedName().printText(t,e):t.write(e)}),this}getInitializerOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getInitializer(),e??`Expected to find an initializer for the JSX attribute '${this.getNameNode().getText()}'`,this)}getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}setInitializer(e){let n=F(this._getWriterWithQueuedIndentation(),e);if(t.StringUtils.isNullOrWhitespace(n))return this.removeInitializer(),this;let r=this.getInitializer();return r==null?(At({insertPos:this.getNameNode().getEnd(),parent:this,newText:`=${n}`}),this):(r.replaceWithText(n),this)}removeInitializer(){let e=this.getInitializer();return e==null||Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.EqualsToken),e],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this}remove(){Lt({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(e){return ge(xf.prototype,this,e),e.name!=null&&this.setName(e.name),e.initializer==null?e.hasOwnProperty(t.nameof(e,`initializer`))&&this.removeInitializer():this.setInitializer(e.initializer),this}getStructure(){let t=this.getInitializer(),n=this.getNameNode();return he(xf.prototype,this,{name:n instanceof _f?n.getText():n.getStructure(),kind:e.StructureKind.JsxAttribute,initializer:t?.getText()})}},Cf=(e=>ff(e))(V),wf=class extends Cf{},Tf=class extends Na{},Ef=Ua,Df=class extends Ef{getJsxChildren(){return this.compilerNode.children.map(e=>this._getNodeFromCompilerNode(e))}getOpeningElement(){return this._getNodeFromCompilerNode(this.compilerNode.openingElement)}getClosingElement(){return this._getNodeFromCompilerNode(this.compilerNode.closingElement)}setBodyText(e){let t=un(this._getWriterWithIndentation(),e);return Of(this,t),this}setBodyTextInline(e){let t=this._getWriterWithQueuedChildIndentation();return ie(t,e),t.isLastNewLine()&&(t.setIndentationLevel(Math.max(0,this.getIndentationLevel()-1)),t.write(``)),Of(this,t.toString()),this}set(e){if(ge(Ef.prototype,this,e),e.attributes!=null){let t=this.getOpeningElement();t.getAttributes().forEach(e=>e.remove()),t.addAttributes(e.attributes)}if(e.children!=null)throw new t.errors.NotImplementedError(`Setting JSX children is currently not implemented. Please open an issue if you need this.`);return e.bodyText==null?e.hasOwnProperty(t.nameof(e,`bodyText`))&&this.setBodyTextInline(``):this.setBodyText(e.bodyText),e.name!=null&&(this.getOpeningElement().getTagNameNode().replaceWithText(e.name),this.getClosingElement().getTagNameNode().replaceWithText(e.name)),this}getStructure(){let t=this.getOpeningElement(),n=he(Ef.prototype,this,{kind:e.StructureKind.JsxElement,name:t.getTagNameNode().getText(),attributes:t.getAttributes().map(e=>e.getStructure()),children:void 0,bodyText:dn(this)});return delete n.children,n}};function Of(e,t){let n=e.getOpeningElement(),r=e.getClosingElement();At({insertPos:n.getEnd(),newText:t,parent:e.getChildSyntaxListOrThrow(),replacing:{textLength:r.getStart()-n.getEnd()}})}var kf=Ga(kn(Na)),Af=class extends kf{},jf=class extends Ua{getJsxChildren(){return this.compilerNode.children.map(e=>this._getNodeFromCompilerNode(e))}getOpeningFragment(){return this._getNodeFromCompilerNode(this.compilerNode.openingFragment)}getClosingFragment(){return this._getNodeFromCompilerNode(this.compilerNode.closingFragment)}},Mf=V,Nf=class extends Mf{getNamespaceNode(){return this._getNodeFromCompilerNode(this.compilerNode.namespace)}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}set(e){return this.getNamespaceNode().replaceWithText(e.namespace),this.getNameNode().replaceWithText(e.name),this}getStructure(){return{namespace:this.getNamespaceNode().getText(),name:this.getNameNode().getText()}}},Pf=(e=>df(ff(e)))(Na),Ff=class extends Pf{},If=class extends Na{},Lf=(e=>df(ff(e)))(Ua),Rf=class extends Lf{set(e){return ge(Lf.prototype,this,e),this}getStructure(){return he(Lf.prototype,this,{kind:e.StructureKind.JsxSelfClosingElement})}},zf=qa(V),Bf=class extends zf{remove(){Lt({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(e){return ge(zf.prototype,this,e),e.expression!=null&&this.setExpression(e.expression),this}getStructure(){return he(zf.prototype,this,{kind:e.StructureKind.JsxSpreadAttribute,expression:this.getExpression().getText()})}},Vf=Wi(V),Hf=class extends Vf{containsOnlyTriviaWhiteSpaces(){let e=this.compilerNode;return typeof e.containsOnlyWhiteSpaces==`boolean`?e.containsOnlyWhiteSpaces:this.compilerNode.containsOnlyTriviaWhiteSpaces}},Uf=go,Wf=class extends Uf{getLiteralValue(){let e=this.compilerNode.text;if(typeof BigInt>`u`)throw new t.errors.InvalidOperationError(`Runtime environment does not support BigInts. Perhaps work with the text instead?`);let n=e.substring(0,e.length-1);return BigInt(n)}setLiteralValue(e){if(typeof e!=`bigint`)throw new t.errors.ArgumentTypeError(`value`,`bigint`,typeof e);return B({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:e.toString()+`n`}),this}},Gf=Ua,Kf=class extends Gf{getLiteralValue(){return Xf(this)}setLiteralValue(e){return Yf(this,e)}},qf=Ua,Jf=class extends qf{getLiteralValue(){return Xf(this)}setLiteralValue(e){return Yf(this,e)}};function Yf(e,t){if(Xf(e)===t)return e;let n=e.getParentSyntaxList()||e.getParentOrThrow(),r=e.getChildIndex();return e.replaceWithText(t?`true`:`false`),n.getChildAtIndex(r)}function Xf(e){return e.getKind()===t.SyntaxKind.TrueKeyword}var Zf=Ua,Qf=class extends Zf{},$f=go,ep=class extends $f{getLiteralValue(){let e=this.compilerNode.text;return e.indexOf(`.`)>=0?parseFloat(e):parseInt(e,10)}setLiteralValue(e){return B({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:e.toString(10)}),this}};e.QuoteKind=void 0,(function(e){e.Single=`'`,e.Double=`"`})(e.QuoteKind||={});var tp=go,np=class extends tp{getLiteralValue(){let e=/^\/(.*)\/([^\/]*)$/,t=this.compilerNode.text,n=e.exec(t);return new RegExp(n[1],n[2])}setLiteralValue(e,t){let n;return typeof e==`string`?n=e:(n=e.source,t=e.flags),B({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:`/${n}/${t||``}`}),this}},rp=go,ip=class extends rp{getLiteralValue(){return this.compilerNode.text}setLiteralValue(e){return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:t.StringUtils.escapeForWithinString(e,this.getQuoteKind())}),this}getQuoteKind(){return this.getText()[0]===`'`?e.QuoteKind.Single:e.QuoteKind.Double}},ap=go,op=class extends ap{getLiteralValue(){return this.compilerNode.text}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()||this.getParentOrThrow();return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},sp=class extends Ha{getTag(){return this._getNodeFromCompilerNode(this.compilerNode.tag)}getTemplate(){return this._getNodeFromCompilerNode(this.compilerNode.template)}removeTag(){let e=this.getParentSyntaxList()??this.getParentOrThrow(),t=this.getChildIndex(),n=this.getTemplate();return At({customMappings:(e,r)=>[{currentNode:n,newNode:e.getChildren(r)[t]}],parent:e,insertPos:this.getStart(),newText:this.getTemplate().getText(),replacing:{textLength:this.getWidth(),nodes:[this]}}),e.getChildAtIndex(t)}},cp=Ua,lp=class extends cp{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(e=>this._getNodeFromCompilerNode(e))}setLiteralValue(e){let t=this.getChildIndex(),n=this.getParentSyntaxList()??this.getParentOrThrow();return B({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:e}),n.getChildAtIndex(t)}},up=Wi(V),dp=class extends up{},fp=Wi(V),pp=class extends fp{},mp=qa(V),hp=class extends mp{getLiteral(){return this._getNodeFromCompilerNode(this.compilerNode.literal)}},gp=Wi(V),_p=class extends gp{},vp=(e=>jn(An(xa(Vi(Qi(e))))))(V),yp=class extends vp{remove(){let e=this.getParentOrThrow();switch(e.getKind()){case t.SyntaxKind.VariableDeclarationList:n(this);break;case t.SyntaxKind.CatchClause:r(this);break;default:throw new t.errors.NotImplementedError(`Not implemented for syntax kind: ${e.getKindName()}`)}function n(n){let r=e.getParentIfKindOrThrow(t.SyntaxKind.VariableStatement);r.getDeclarations().length===1?r.remove():Wt(n)}function r(e){Lt({children:[e.getPreviousSiblingIfKindOrThrow(t.SyntaxKind.OpenParenToken),e,e.getNextSiblingIfKindOrThrow(t.SyntaxKind.CloseParenToken)],removePrecedingSpaces:!0})}}getVariableStatementOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getVariableStatement(),e??`Expected the grandparent to be a variable statement.`,this)}getVariableStatement(){let e=this.getParentOrThrow().getParentOrThrow();return V.isVariableStatement(e)?e:void 0}set(e){return ge(vp.prototype,this,e),this}getStructure(){return he(vp.prototype,this,{kind:e.StructureKind.VariableDeclaration})}},bp=Gi(V),xp=class extends bp{getDeclarations(){return this.compilerNode.declarations.map(e=>this._getNodeFromCompilerNode(e))}getDeclarationKind(){let n=this.compilerNode.flags;return n&t.ts.NodeFlags.Let?e.VariableDeclarationKind.Let:(n&t.ts.NodeFlags.AwaitUsing)===t.ts.NodeFlags.AwaitUsing?e.VariableDeclarationKind.AwaitUsing:(n&t.ts.NodeFlags.Using)===t.ts.NodeFlags.Using?e.VariableDeclarationKind.Using:n&t.ts.NodeFlags.Const?e.VariableDeclarationKind.Const:e.VariableDeclarationKind.Var}getDeclarationKindKeywords(){let n=this.getDeclarationKind();switch(n){case e.VariableDeclarationKind.Const:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.ConstKeyword)];case e.VariableDeclarationKind.Let:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.LetKeyword)];case e.VariableDeclarationKind.Var:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.VarKeyword)];case e.VariableDeclarationKind.Using:return[this.getFirstChildByKindOrThrow(t.SyntaxKind.UsingKeyword)];case e.VariableDeclarationKind.AwaitUsing:let r=this.getFirstChildByKindOrThrow(t.SyntaxKind.AwaitKeyword);return[r,r.getNextSiblingIfKindOrThrow(t.SyntaxKind.UsingKeyword)];default:return t.errors.throwNotImplementedForNeverValueError(n)}}setDeclarationKind(e){if(this.getDeclarationKind()===e)return this;let t=this.getDeclarationKindKeywords(),n=t[0].getStart(),r=t[t.length-1].getEnd();return At({insertPos:n,newText:e,parent:this,replacing:{textLength:r-n}}),this}addDeclaration(e){return this.addDeclarations([e])[0]}addDeclarations(e){return this.insertDeclarations(this.getDeclarations().length,e)}insertDeclaration(e,t){return this.insertDeclarations(e,[t])[0]}insertDeclarations(e,n){let r=this._getWriterWithQueuedChildIndentation(),i=new Vn(this._context.structurePrinterFactory.forVariableDeclaration()),a=this.compilerNode.declarations.length;return e=tt(e,a),i.printText(r,n),Mt({parent:this.getFirstChildByKindOrThrow(t.SyntaxKind.SyntaxList),currentNodes:this.getDeclarations(),insertIndex:e,newText:r.toString(),useTrailingCommas:!1}),Xe(a,this.getDeclarations(),e,!1)}},Sp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerSignature(){return this.#t}getTypeParameters(){return(this.compilerSignature.typeParameters||[]).map(e=>this.#e.compilerFactory.getTypeParameter(e))}getParameters(){return this.compilerSignature.parameters.map(e=>this.#e.compilerFactory.getSymbol(e))}getReturnType(){return this.#e.compilerFactory.getType(this.compilerSignature.getReturnType())}getDocumentationComments(){return this.compilerSignature.getDocumentationComment(this.#e.typeChecker.compilerObject).map(e=>this.#e.compilerFactory.getSymbolDisplayPart(e))}getJsDocTags(){return this.compilerSignature.getJsDocTags().map(e=>this.#e.compilerFactory.getJSDocTagInfo(e))}getDeclaration(){let{compilerFactory:e}=this.#e,t=this.compilerSignature.getDeclaration();return e.getNodeFromCompilerNode(t,e.getSourceFileForNode(t))}},Cp=class{#e;#t;get compilerSymbol(){return this.#t}constructor(e,t){this.#e=e,this.#t=t,this.getValueDeclaration(),this.getDeclarations()}getName(){return this.compilerSymbol.getName()}getEscapedName(){return this.compilerSymbol.getEscapedName()}getAliasedSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAliasedSymbol(),e??`Expected to find an aliased symbol.`)}getImmediatelyAliasedSymbol(){return this.#e.typeChecker.getImmediatelyAliasedSymbol(this)}getImmediatelyAliasedSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getImmediatelyAliasedSymbol(),e??`Expected to find an immediately aliased symbol.`)}getAliasedSymbol(){return this.#e.typeChecker.getAliasedSymbol(this)}getExportSymbol(){return this.#e.typeChecker.getExportSymbolOfSymbol(this)}isAlias(){return(this.getFlags()&t.SymbolFlags.Alias)===t.SymbolFlags.Alias}isOptional(){return(this.getFlags()&t.SymbolFlags.Optional)===t.SymbolFlags.Optional}getFlags(){return this.compilerSymbol.getFlags()}hasFlags(e){return(this.compilerSymbol.flags&e)===e}getValueDeclarationOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getValueDeclaration(),e??(()=>`Expected to find the value declaration of symbol '${this.getName()}'.`))}getValueDeclaration(){let e=this.compilerSymbol.valueDeclaration;if(e!=null)return this.#e.compilerFactory.getNodeFromCompilerNode(e,this.#e.compilerFactory.getSourceFileForNode(e))}getDeclarations(){return(this.compilerSymbol.declarations??[]).map(e=>this.#e.compilerFactory.getNodeFromCompilerNode(e,this.#e.compilerFactory.getSourceFileForNode(e)))}getExportOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getExport(e),n??(()=>`Expected to find export with name: ${e}`))}getExport(e){if(this.compilerSymbol.exports==null)return;let n=this.compilerSymbol.exports.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getExports(){return this.compilerSymbol.exports==null?[]:Array.from(this.compilerSymbol.exports.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getGlobalExportOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getGlobalExport(e),n??(()=>`Expected to find global export with name: ${e}`))}getGlobalExport(e){if(this.compilerSymbol.globalExports==null)return;let n=this.compilerSymbol.globalExports.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getGlobalExports(){return this.compilerSymbol.globalExports==null?[]:Array.from(this.compilerSymbol.globalExports.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getMemberOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getMember(e),n??`Expected to find member with name: ${e}`)}getMember(e){if(this.compilerSymbol.members==null)return;let n=this.compilerSymbol.members.get(t.ts.escapeLeadingUnderscores(e));return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getMembers(){return this.compilerSymbol.members==null?[]:Array.from(this.compilerSymbol.members.values()).map(e=>this.#e.compilerFactory.getSymbol(e))}getDeclaredType(){return this.#e.typeChecker.getDeclaredTypeOfSymbol(this)}getTypeAtLocation(e){return this.#e.typeChecker.getTypeOfSymbolAtLocation(this,e)}getFullyQualifiedName(){return this.#e.typeChecker.getFullyQualifiedName(this)}getJsDocTags(){return this.compilerSymbol.getJsDocTags(this.#e.typeChecker.compilerObject).map(e=>new kd(e))}},wp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getStart(){return this.compilerObject.start}getEnd(){return this.compilerObject.start+this.compilerObject.length}getLength(){return this.compilerObject.length}},Tp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getSpan(){return new wp(this.compilerObject.span)}getNewText(){return this.compilerObject.newText}};Vc([t.Memoize],Tp.prototype,`getSpan`,null);var Ep=class{#e;#t;#n;#r;#i;constructor(e,t){this.#e=e,this.#t=t;let n=e.compilerFactory.addOrGetSourceFileFromFilePath(e.fileSystemWrapper.getStandardizedAbsolutePath(t.fileName),{markInProject:!1,scriptKind:void 0});this.#r=n!=null,t.isNewFile||(this.#n=n)}getFilePath(){return this.#t.fileName}getSourceFile(){return this.#n}getTextChanges(){return this.#t.textChanges.map(e=>new Tp(e))}applyChanges(e={}){if(this.#i)return;if(this.isNewFile()&&this.#r&&!e.overwrite)throw new t.errors.InvalidOperationError(`Cannot apply file text change for creating a new file when the file exists at path ${this.getFilePath()}. Did you mean to provide the overwrite option?`);let n;if(n=this.isNewFile()?this.#e.project.createSourceFile(this.getFilePath(),``,{overwrite:e.overwrite}):this.getSourceFile(),n==null)throw new t.errors.InvalidOperationError(`Cannot apply file text change to modify existing file that doesn't exist at path: ${this.getFilePath()}`);return n.applyTextChanges(this.getTextChanges()),n._markAsInProject(),this.#i=!0,this}isNewFile(){return!!this.#t.isNewFile}};Vc([t.Memoize],Ep.prototype,`getTextChanges`,null);var Dp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getDescription(){return this.compilerObject.description}getChanges(){return this.compilerObject.changes.map(e=>new Ep(this.#e,e))}},Op=class extends Dp{getFixName(){return this.compilerObject.fixName}getFixId(){return this.compilerObject.fixId}getFixAllDescription(){return this.compilerObject.fixAllDescription}},kp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getChanges(){return this.compilerObject.changes.map(e=>new Ep(this.#e,e))}applyChanges(e){for(let t of this.getChanges())t.applyChanges(e);return this}};Vc([t.Memoize],kp.prototype,`getChanges`,null);var Ap=class{_context;_compilerObject;_sourceFile;constructor(e,t){this._context=e,this._compilerObject=t,this._sourceFile=this._context.compilerFactory.addOrGetSourceFileFromFilePath(e.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.fileName),{markInProject:!1,scriptKind:void 0}),this._sourceFile._doActionPreNextModification(()=>this.getNode())}get compilerObject(){return this._compilerObject}getSourceFile(){return this._sourceFile}getTextSpan(){return new wp(this.compilerObject.textSpan)}getNode(){let e=this.getTextSpan(),t=this.getSourceFile(),n=e.getStart(),r=e.getEnd();return i();function i(){let e;return t._context.compilerFactory.forgetNodesCreatedInBlock(i=>{let a,o=t;for(;o!=null;){if(a??(e=o),o.getStart()===n&&o.getWidth()===r)e=a=o;else if(a!=null)break;o=o.getChildAtPos(n)}e!=null&&i(e)}),e}}getOriginalTextSpan(){let{originalTextSpan:e}=this.compilerObject;return e==null?void 0:new wp(e)}getOriginalFileName(){return this.compilerObject.originalFileName}};Vc([t.Memoize],Ap.prototype,`getTextSpan`,null),Vc([t.Memoize],Ap.prototype,`getNode`,null),Vc([t.Memoize],Ap.prototype,`getOriginalTextSpan`,null);var jp=class extends Ap{constructor(e,t){super(e,t),this.getSourceFile()._doActionPreNextModification(()=>this.getDeclarationNode())}getKind(){return this.compilerObject.kind}getName(){return this.compilerObject.name}getContainerKind(){return this.compilerObject.containerKind}getContainerName(){return this.compilerObject.containerName}getDeclarationNode(){if(this.getKind()===`module`&&this.getTextSpan().getLength()===this.getSourceFile().getFullWidth())return this.getSourceFile();let e=this.getTextSpan().getStart();return n(this.getSourceFile())?.getParentOrThrow();function n(r){if(r.getKind()===t.SyntaxKind.Identifier&&r.getStart()===e)return r;for(let t of r._getChildrenIterator())if(t.getPos()<=e&&t.getEnd()>e)return n(t)}}};Vc([t.Memoize],jp.prototype,`getDeclarationNode`,null);var Mp=class e{_compilerObject;constructor(e){this._compilerObject=e}get compilerObject(){return this._compilerObject}getMessageText(){return this.compilerObject.messageText}getNext(){let t=this.compilerObject.next;if(t!=null)return t instanceof Array?t.map(t=>new e(t)):[new e(t)]}getCode(){return this.compilerObject.code}getCategory(){return this.compilerObject.category}},Np=class{_context;_compilerObject;constructor(e,t){this._context=e,this._compilerObject=t,this.getSourceFile()}get compilerObject(){return this._compilerObject}getSourceFile(){if(this._context==null)return;let e=this.compilerObject.file;return e==null?void 0:this._context.compilerFactory.getSourceFile(e,{markInProject:!1})}getMessageText(){let e=this._compilerObject.messageText;return typeof e==`string`?e:this._context==null?new Mp(e):this._context.compilerFactory.getDiagnosticMessageChain(e)}getLineNumber(){let e=this.getSourceFile(),n=this.getStart();if(!(e==null||n==null))return t.StringUtils.getLineNumberAtPos(e.getFullText(),n)}getStart(){return this.compilerObject.start}getLength(){return this.compilerObject.length}getCategory(){return this.compilerObject.category}getCode(){return this.compilerObject.code}getSource(){return this.compilerObject.source}};Vc([t.Memoize],Np.prototype,`getSourceFile`,null);var Pp=class extends Np{constructor(e,t){super(e,t)}getLineNumber(){return super.getLineNumber()}getStart(){return super.getStart()}getLength(){return super.getLength()}getSourceFile(){return super.getSourceFile()}},Fp=class{#e;#t;constructor(e,t){this.#e=t,this.#t=e}get compilerObject(){return this.#e}getFilePath(){return this.#t.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.name)}getWriteByteOrderMark(){return this.compilerObject.writeByteOrderMark||!1}getText(){return this.compilerObject.text}},Ip=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getDiagnostics(){return this.compilerObject.diagnostics.map(e=>this.#e.compilerFactory.getDiagnostic(e))}getEmitSkipped(){return this.compilerObject.emitSkipped}getOutputFiles(){return this.compilerObject.outputFiles.map(e=>new Fp(this.#e,e))}};Vc([t.Memoize],Ip.prototype,`getDiagnostics`,null),Vc([t.Memoize],Ip.prototype,`getOutputFiles`,null);var Lp=class{_context;_compilerObject;constructor(e,t){this._context=e,this._compilerObject=t,this.getDiagnostics()}get compilerObject(){return this._compilerObject}getEmitSkipped(){return this.compilerObject.emitSkipped}getDiagnostics(){return this.compilerObject.diagnostics.map(e=>this._context.compilerFactory.getDiagnostic(e))}};Vc([t.Memoize],Lp.prototype,`getDiagnostics`,null);var Rp=class extends Ap{constructor(e,t){super(e,t)}getKind(){return this.compilerObject.kind}getDisplayParts(){return this.compilerObject.displayParts.map(e=>this._context.compilerFactory.getSymbolDisplayPart(e))}};Vc([t.Memoize],Rp.prototype,`getDisplayParts`,null);var zp=class extends Lp{#e;constructor(e,t,n){super(e,t),this.#e=n}getFiles(){return this.#e}saveFiles(){let e=this._context.fileSystemWrapper,t=this.#e.map(t=>e.writeFile(t.filePath,t.writeByteOrderMark?``+t.text:t.text));return Promise.all(t)}saveFilesSync(){let e=this._context.fileSystemWrapper;for(let t of this.#e)e.writeFileSync(t.filePath,t.writeByteOrderMark?``+t.text:t.text)}},Bp=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get compilerObject(){return this.#t}getEdits(){return this.compilerObject.edits.map(e=>new Ep(this.#e,e))}getRenameFilePath(){return this.compilerObject.renameFilename}getRenameLocation(){return this.compilerObject.renameLocation}applyChanges(e){for(let t of this.getEdits())t.applyChanges(e);return this}};Vc([t.Memoize],Bp.prototype,`getEdits`,null);var Vp=class{_context;#e;#t;constructor(e,t){this._context=e,this.#e=t,this.#t=this.compilerObject.references.map(t=>e.compilerFactory.getReferencedSymbolEntry(t))}get compilerObject(){return this.#e}getDefinition(){return this._context.compilerFactory.getReferencedSymbolDefinitionInfo(this.compilerObject.definition)}getReferences(){return this.#t}};Vc([t.Memoize],Vp.prototype,`getDefinition`,null);var Hp=class extends jp{constructor(e,t){super(e,t)}getDisplayParts(){return this.compilerObject.displayParts.map(e=>this._context.compilerFactory.getSymbolDisplayPart(e))}};Vc([t.Memoize],Hp.prototype,`getDisplayParts`,null);var Up=class extends Ap{constructor(e,t){super(e,t)}isWriteAccess(){return this.compilerObject.isWriteAccess}isInString(){return this.compilerObject.isInString}},Wp=class extends Up{constructor(e,t){super(e,t)}isDefinition(){return this.compilerObject.isDefinition}},Gp=class extends Ap{getPrefixText(){return this._compilerObject.prefixText}getSuffixText(){return this._compilerObject.suffixText}},Kp=class{#e;constructor(e){this.#e=e}get compilerObject(){return this.#e}getText(){return this.compilerObject.text}getKind(){return this.compilerObject.kind}},qp=class{#e;#t;constructor(e){this.#e=e}get compilerObject(){return this.#t()}_reset(e){this.#t=e}getAmbientModules(){return this.compilerObject.getAmbientModules().map(e=>this.#e.compilerFactory.getSymbol(e))}getApparentType(e){return this.#e.compilerFactory.getType(this.compilerObject.getApparentType(e.compilerType))}getConstantValue(e){return this.compilerObject.getConstantValue(e.compilerNode)}getFullyQualifiedName(e){return this.compilerObject.getFullyQualifiedName(e.compilerSymbol)}getTypeAtLocation(e){return this.#e.compilerFactory.getType(this.compilerObject.getTypeAtLocation(e.compilerNode))}getContextualType(e){let t=this.compilerObject.getContextualType(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getType(t)}getTypeOfSymbolAtLocation(e,t){return this.#e.compilerFactory.getType(this.compilerObject.getTypeOfSymbolAtLocation(e.compilerSymbol,t.compilerNode))}getDeclaredTypeOfSymbol(e){return this.#e.compilerFactory.getType(this.compilerObject.getDeclaredTypeOfSymbol(e.compilerSymbol))}getSymbolAtLocation(e){let t=this.compilerObject.getSymbolAtLocation(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getAliasedSymbol(e){if(!e.hasFlags(t.SymbolFlags.Alias))return;let n=this.compilerObject.getAliasedSymbol(e.compilerSymbol);return n==null?void 0:this.#e.compilerFactory.getSymbol(n)}getImmediatelyAliasedSymbol(e){let t=this.compilerObject.getImmediateAliasedSymbol(e.compilerSymbol);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getExportSymbolOfSymbol(e){return this.#e.compilerFactory.getSymbol(this.compilerObject.getExportSymbolOfSymbol(e.compilerSymbol))}getPropertiesOfType(e){return this.compilerObject.getPropertiesOfType(e.compilerType).map(e=>this.#e.compilerFactory.getSymbol(e))}getTypeText(e,t,n){return n??=this.#n(t),this.compilerObject.typeToString(e.compilerType,t?.compilerNode,n)}getReturnTypeOfSignature(e){return this.#e.compilerFactory.getType(this.compilerObject.getReturnTypeOfSignature(e.compilerSignature))}getSignatureFromNode(e){let t=this.compilerObject.getSignatureFromDeclaration(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSignature(t)}getExportsOfModule(e){return(this.compilerObject.getExportsOfModule(e.compilerSymbol)||[]).map(e=>this.#e.compilerFactory.getSymbol(e))}getExportSpecifierLocalTargetSymbol(e){let t=this.compilerObject.getExportSpecifierLocalTargetSymbol(e.compilerNode);return t==null?void 0:this.#e.compilerFactory.getSymbol(t)}getResolvedSignature(e){let t=this.compilerObject.getResolvedSignature(e.compilerNode);if(!(!t||!t.declaration))return this.#e.compilerFactory.getSignature(t)}getResolvedSignatureOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getResolvedSignature(e),n??`Signature could not be resolved.`,e)}getBaseTypeOfLiteralType(e){return this.#e.compilerFactory.getType(this.compilerObject.getBaseTypeOfLiteralType(e.compilerType))}getSymbolsInScope(e,t){return this.compilerObject.getSymbolsInScope(e.compilerNode,t).map(e=>this.#e.compilerFactory.getSymbol(e))}getTypeArguments(e){return this.compilerObject.getTypeArguments(e.compilerType).map(e=>this.#e.compilerFactory.getType(e))}isTypeAssignableTo(e,t){return this.compilerObject.isTypeAssignableTo(e.compilerType,t.compilerType)}#n(e){let n=t.TypeFormatFlags.UseTypeOfFunction|t.TypeFormatFlags.NoTruncation|t.TypeFormatFlags.UseFullyQualifiedType|t.TypeFormatFlags.WriteTypeArgumentsOfSignature;return e!=null&&e.getKind()===t.SyntaxKind.TypeAliasDeclaration&&(n|=t.TypeFormatFlags.InTypeAlias),n}getShorthandAssignmentValueSymbol(e){let t=this.compilerObject.getShorthandAssignmentValueSymbol(e.compilerNode);return t?this.#e.compilerFactory.getSymbol(t):void 0}resolveName(e,t,n,r){let i=this.compilerObject.resolveName(e,t?.compilerNode,n,r);return i?this.#e.compilerFactory.getSymbol(i):void 0}},Jp=class{#e;#t;#n;#r;#i;#a;constructor(e){this.#e=e.context,this.#a=e.configFileParsingDiagnostics,this.#t=new qp(this.#e),this._reset(e.rootNames,e.host)}get compilerObject(){return this.#i()}_isCompilerProgramCreated(){return this.#n!=null}_reset(e,n){let r=this.#e.compilerOptions.get();this.#i=()=>(this.#n??(this.#n=t.ts.createProgram(e,r,n,this.#r,this.#a),this.#r=void 0),this.#n),this.#n!=null&&(this.#r=this.#n,this.#n=void 0),this.#t._reset(()=>this.compilerObject.getTypeChecker())}getTypeChecker(){return this.#t}async emit(e={}){if(e.writeFile){let n=`Cannot specify a ${t.nameof(e,`writeFile`)} option when emitting asynchrously. Use ${t.nameof(this,`emitSync`)}() instead.`;throw new t.errors.InvalidOperationError(n)}let{fileSystemWrapper:n}=this.#e,r=[],i=this.#o({writeFile:(e,t,i)=>{r.push(n.writeFile(n.getStandardizedAbsolutePath(e),i?``+t:t))},...e});return await Promise.all(r),new Lp(this.#e,i)}emitSync(e={}){return new Lp(this.#e,this.#o(e))}emitToMemory(e={}){let t=[],{fileSystemWrapper:n}=this.#e,r=this.#o({writeFile:(e,r,i)=>{t.push({filePath:n.getStandardizedAbsolutePath(e),text:r,writeByteOrderMark:i||!1})},...e});return new zp(this.#e,r,t)}#o(e={}){let t=e.targetSourceFile==null?void 0:e.targetSourceFile.compilerNode,{emitOnlyDtsFiles:n,customTransformers:r,writeFile:i}=e;return this.compilerObject.emit(t,i,void 0,n,r)}getSyntacticDiagnostics(e){return this.compilerObject.getSyntacticDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnosticWithLocation(e))}getSemanticDiagnostics(e){return this.compilerObject.getSemanticDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnostic(e))}getDeclarationDiagnostics(e){return this.compilerObject.getDeclarationDiagnostics(e?.compilerNode).map(e=>this.#e.compilerFactory.getDiagnosticWithLocation(e))}getGlobalDiagnostics(){return this.compilerObject.getGlobalDiagnostics().map(e=>this.#e.compilerFactory.getDiagnostic(e))}getConfigFileParsingDiagnostics(){return this.compilerObject.getConfigFileParsingDiagnostics().map(e=>this.#e.compilerFactory.getDiagnostic(e))}getEmitModuleResolutionKind(){return t.getEmitModuleResolutionKind(this.compilerObject.getCompilerOptions())}isSourceFileFromExternalLibrary(e){return e.isFromExternalLibrary()}},Yp=class{#e;#t;#n;#r;#i=0;get compilerObject(){return this.#e}constructor(e){this.#r=e.context;let{languageServiceHost:n,compilerHost:r}=t.createHosts({transactionalFileSystem:this.#r.fileSystemWrapper,sourceFileContainer:this.#r.getSourceFileContainer(),compilerOptions:this.#r.compilerOptions,getNewLine:()=>this.#r.manipulationSettings.getNewLineKindAsString(),getProjectVersion:()=>`${this.#i}`,resolutionHost:e.resolutionHost??{},libFolderPath:e.libFolderPath,skipLoadingLibFiles:e.skipLoadingLibFiles});this.#t=r,this.#e=t.ts.createLanguageService(n,this.#r.compilerFactory.documentRegistry),this.#n=new Jp({context:this.#r,rootNames:Array.from(this.#r.compilerFactory.getSourceFilePaths()),host:this.#t,configFileParsingDiagnostics:e.configFileParsingDiagnostics}),this.#r.compilerFactory.onSourceFileAdded(e=>{e._isInProject()&&this._reset()}),this.#r.compilerFactory.onSourceFileRemoved(()=>this._reset())}_reset(){this.#i+=1,this.#n._reset(Array.from(this.#r.compilerFactory.getSourceFilePaths()),this.#t)}getProgram(){return this.#n}getDefinitions(e){return this.getDefinitionsAtPosition(e._sourceFile,e.getStart())}getDefinitionsAtPosition(e,t){return(this.compilerObject.getDefinitionAtPosition(e.getFilePath(),t)||[]).map(e=>this.#r.compilerFactory.getDefinitionInfo(e))}getImplementations(e){return this.getImplementationsAtPosition(e._sourceFile,e.getStart())}getImplementationsAtPosition(e,t){return(this.compilerObject.getImplementationAtPosition(e.getFilePath(),t)||[]).map(e=>new Rp(this.#r,e))}findReferences(e){return this.findReferencesAtPosition(e._sourceFile,e.getStart())}findReferencesAsNodes(e){let n=this.findReferences(e);return Array.from(r());function*r(){for(let e of n){let n=e.getDefinition().getKind()===t.ts.ScriptElementKind.alias,r=e.getReferences();for(let e=0;e<r.length;e++){let t=r[e];(n||!t.isDefinition()||e>0)&&(yield t.getNode())}}}}findReferencesAtPosition(e,t){return(this.compilerObject.findReferences(e.getFilePath(),t)||[]).map(e=>this.#r.compilerFactory.getReferencedSymbol(e))}findRenameLocations(e,t={}){let n=t.usePrefixAndSuffixText==null?this.#r.manipulationSettings.getUsePrefixAndSuffixTextForRename():t.usePrefixAndSuffixText;return(this.compilerObject.findRenameLocations(e._sourceFile.getFilePath(),e.getStart(),t.renameInStrings||!1,t.renameInComments||!1,n)||[]).map(e=>new Gp(this.#r,e))}getSuggestionDiagnostics(e){let t=this.#a(e);return this.compilerObject.getSuggestionDiagnostics(t).map(e=>this.#r.compilerFactory.getDiagnosticWithLocation(e))}getFormattingEditsForRange(e,t,n){return(this.compilerObject.getFormattingEditsForRange(e,t[0],t[1],this.#o(n))||[]).map(e=>new Tp(e))}getFormattingEditsForDocument(e,t){let n=this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e);return(this.compilerObject.getFormattingEditsForDocument(n,this.#o(t))||[]).map(e=>new Tp(e))}getFormattedDocumentText(e,n){let r=this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e),i=this.#r.compilerFactory.getSourceFileFromCacheFromFilePath(r);if(i==null)throw new t.errors.FileNotFoundError(r);n=this.#o(n);let a=L(i,this.getFormattingEditsForDocument(r,n)),o=n.newLineCharacter;return n.ensureNewLineAtEndOfFile&&!a.endsWith(o)&&(a+=o),a.replace(/\r?\n/g,o)}getEmitOutput(e,t){let n=this.#a(e),r=this.compilerObject;return new Ip(this.#r,i());function i(){let e=r.getProgram();return e==null||e.getSourceFile(n)==null?{emitSkipped:!0,outputFiles:[],diagnostics:[]}:r.getEmitOutput(n,t)}}getIdentationAtPosition(e,t,n){let r=this.#a(e);return n==null?n=this.#r.manipulationSettings.getEditorSettings():N(n,this.#r.manipulationSettings),this.compilerObject.getIndentationAtPosition(r,t,n)}organizeImports(e,t={},n={}){let r={type:`file`,fileName:this.#a(e)};return this.compilerObject.organizeImports(r,this.#o(t),this.#s(n)).map(e=>new Ep(this.#r,e))}getEditsForRefactor(e,t,n,r,i,a={}){let o=this.#a(e),s=typeof n==`number`?n:{pos:n.getPos(),end:n.getEnd()},c=this.compilerObject.getEditsForRefactor(o,this.#o(t),s,r,i,this.#s(a));return c==null?void 0:new Bp(this.#r,c)}getCombinedCodeFix(e,t,n={},r={}){let i=this.compilerObject.getCombinedCodeFix({type:`file`,fileName:this.#a(e)},t,this.#o(n),this.#s(r||{}));return new kp(this.#r,i)}getCodeFixesAtPosition(e,t,n,r,i={},a={}){let o=this.#a(e);return this.compilerObject.getCodeFixesAtPosition(o,t,n,r,this.#o(i),this.#s(a||{})).map(e=>new Op(this.#r,e))}#a(e){let n=typeof e==`string`?this.#r.fileSystemWrapper.getStandardizedAbsolutePath(e):e.getFilePath();if(!this.#r.compilerFactory.containsSourceFileAtPath(n))throw new t.errors.FileNotFoundError(n);return n}#o(e){return e._filled?e:(e=Object.assign(this.#r.getFormatCodeSettings(),e),P(e,this.#r.manipulationSettings),e._filled=!0,e)}#s(e){return Object.assign(this.#r.getUserPreferences(),e)}},Xp=class{_context;#e;get compilerType(){return this.#e}constructor(e,t){this._context=e,this.#e=t}getText(e,t){return this._context.typeChecker.getTypeText(this,e,t)}getAliasSymbol(){return this.compilerType.aliasSymbol==null?void 0:this._context.compilerFactory.getSymbol(this.compilerType.aliasSymbol)}getAliasSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getAliasSymbol(),`Expected to find an alias symbol.`)}getAliasTypeArguments(){return(this.compilerType.aliasTypeArguments||[]).map(e=>this._context.compilerFactory.getType(e))}getApparentType(){return this._context.typeChecker.getApparentType(this)}getArrayElementTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getArrayElementType(),e??`Expected to find an array element type.`)}getArrayElementType(){if(this.isArray())return this.getTypeArguments()[0]}getBaseTypes(){return(this.compilerType.getBaseTypes()||[]).map(e=>this._context.compilerFactory.getType(e))}getBaseTypeOfLiteralType(){return this._context.typeChecker.getBaseTypeOfLiteralType(this)}getCallSignatures(){return this.compilerType.getCallSignatures().map(e=>this._context.compilerFactory.getSignature(e))}getConstructSignatures(){return this.compilerType.getConstructSignatures().map(e=>this._context.compilerFactory.getSignature(e))}getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected to find a constraint.`)}getConstraint(){let e=this.compilerType.getConstraint();return e==null?void 0:this._context.compilerFactory.getType(e)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected to find a default type.`)}getDefault(){let e=this.compilerType.getDefault();return e==null?void 0:this._context.compilerFactory.getType(e)}getProperties(){return this.compilerType.getProperties().map(e=>this._context.compilerFactory.getSymbol(e))}getPropertyOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getProperty(e),()=>l(`symbol property`,e))}getProperty(e){return ee(this.getProperties(),e)}getApparentProperties(){return this.compilerType.getApparentProperties().map(e=>this._context.compilerFactory.getSymbol(e))}getApparentProperty(e){return ee(this.getApparentProperties(),e)}isNullable(){return this.getUnionTypes().some(e=>e.isNull()||e.isUndefined())}getNonNullableType(){return this._context.compilerFactory.getType(this.compilerType.getNonNullableType())}getNumberIndexType(){let e=this.compilerType.getNumberIndexType();return e==null?void 0:this._context.compilerFactory.getType(e)}getStringIndexType(){let e=this.compilerType.getStringIndexType();return e==null?void 0:this._context.compilerFactory.getType(e)}getTargetType(){let e=this.compilerType.target||void 0;return e==null?void 0:this._context.compilerFactory.getType(e)}getTargetTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getTargetType(),e??`Expected to find the target type.`)}getTypeArguments(){return this._context.typeChecker.getTypeArguments(this)}getTupleElements(){return this.isTuple()?this.getTypeArguments():[]}getUnionTypes(){return this.isUnion()?this.compilerType.types.map(e=>this._context.compilerFactory.getType(e)):[]}getIntersectionTypes(){return this.isIntersection()?this.compilerType.types.map(e=>this._context.compilerFactory.getType(e)):[]}getLiteralValue(){return this.compilerType?.value}getLiteralValueOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralValue(),e??`Type was not a literal type.`)}getLiteralFreshType(){let e=this.compilerType?.freshType;return e==null?void 0:this._context.compilerFactory.getType(e)}getLiteralFreshTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralFreshType(),e??`Type was not a literal type.`)}getLiteralRegularType(){let e=this.compilerType?.regularType;return e==null?void 0:this._context.compilerFactory.getType(e)}getLiteralRegularTypeOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getLiteralRegularType(),e??`Type was not a literal type.`)}getSymbol(){let e=this.compilerType.getSymbol();return e==null?void 0:this._context.compilerFactory.getSymbol(e)}getSymbolOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSymbol(),e??`Expected to find a symbol.`)}isAssignableTo(e){return this._context.typeChecker.isTypeAssignableTo(this,e)}isAnonymous(){return this.#n(t.ObjectFlags.Anonymous)}isAny(){return this.#t(t.TypeFlags.Any)}isNever(){return this.#t(t.TypeFlags.Never)}isArray(){let e=this.getSymbol();return e==null?!1:(e.getName()===`Array`||e.getName()===`ReadonlyArray`)&&this.getTypeArguments().length===1}isReadonlyArray(){let e=this.getSymbol();return e==null?!1:e.getName()===`ReadonlyArray`&&this.getTypeArguments().length===1}isTemplateLiteral(){return this.#t(t.TypeFlags.TemplateLiteral)}isBoolean(){return this.#t(t.TypeFlags.Boolean)}isString(){return this.#t(t.TypeFlags.String)}isNumber(){return this.#t(t.TypeFlags.Number)}isBigInt(){return this.#t(t.TypeFlags.BigInt)}isLiteral(){let e=this.isBooleanLiteral();return this.compilerType.isLiteral()||e}isBooleanLiteral(){return this.#t(t.TypeFlags.BooleanLiteral)}isBigIntLiteral(){return this.#t(t.TypeFlags.BigIntLiteral)}isEnumLiteral(){return this.#t(t.TypeFlags.EnumLiteral)&&!this.isUnion()}isNumberLiteral(){return this.#t(t.TypeFlags.NumberLiteral)}isStringLiteral(){return this.compilerType.isStringLiteral()}isClass(){return this.compilerType.isClass()}isClassOrInterface(){return this.compilerType.isClassOrInterface()}isEnum(){if(this.#t(t.TypeFlags.Enum))return!0;if(this.isEnumLiteral()&&!this.isUnion())return!1;let e=this.getSymbol();if(e==null)return!1;let n=e.getValueDeclaration();return n!=null&&V.isEnumDeclaration(n)}isInterface(){return this.#n(t.ObjectFlags.Interface)}isObject(){return this.#t(t.TypeFlags.Object)}isTypeParameter(){return this.compilerType.isTypeParameter()}isTuple(){let e=this.getTargetType();return e==null?!1:e.#n(t.ObjectFlags.Tuple)}isUnion(){return this.compilerType.isUnion()}isIntersection(){return this.compilerType.isIntersection()}isUnionOrIntersection(){return this.compilerType.isUnionOrIntersection()}isUnknown(){return this.#t(t.TypeFlags.Unknown)}isNull(){return this.#t(t.TypeFlags.Null)}isUndefined(){return this.#t(t.TypeFlags.Undefined)}isVoid(){return this.#t(t.TypeFlags.Void)}getFlags(){return this.compilerType.flags}getObjectFlags(){return this.isObject()&&this.compilerType.objectFlags||0}#t(e){return(this.compilerType.flags&e)===e}#n(e){return(this.getObjectFlags()&e)===e}},Zp=class extends Xp{getConstraintOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getConstraint(),e??`Expected type parameter to have a constraint.`)}getConstraint(){let e=this.#e();if(e==null)return;let t=e.getConstraint();if(t!=null)return this._context.typeChecker.getTypeAtLocation(t)}getDefaultOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDefault(),e??`Expected type parameter to have a default type.`)}getDefault(){let e=this.#e();if(e==null)return;let t=e.getDefault();if(t!=null)return this._context.typeChecker.getTypeAtLocation(t)}#e(){let e=this.getSymbol();if(e==null)return;let t=e.getDeclarations()[0];if(t!=null&&V.isTypeParameterDeclaration(t))return t}},Qp=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}getSkippedFilePaths(){return this.#t}getOutputFilePaths(){return this.#e}},$p=class e{#e;#t;#n;constructor(e,t){this.#e=e,this._setPathInternal(t)}_setPathInternal(e){this.#t=e,this.#n=e.split(`/`).filter(e=>e.length>0)}get _context(){return this.#s(),this.#e}isAncestorOf(t){return e.#u(this,t)}isDescendantOf(t){return e.#u(t,this)}_getDepth(){return this.#n.length}getPath(){return this.#s(),this.#t}getBaseName(){return this.#n[this.#n.length-1]}getParentOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getParent(),e??(()=>`Parent directory of ${this.getPath()} does not exist or was never added.`))}getParent(){if(!t.FileUtils.isRootDirPath(this.getPath()))return this.addDirectoryAtPathIfExists(t.FileUtils.getDirPath(this.getPath()))}getDirectoryOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getDirectory(e),()=>typeof e==`string`?`Could not find a directory at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath())}'.`:`Could not find child directory that matched condition.`)}getDirectory(e){if(typeof e==`string`){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.getDirectoryFromCache(t)}return this.getDirectories().find(e)}getSourceFileOrThrow(e){return t.errors.throwIfNullOrUndefined(this.getSourceFile(e),()=>typeof e==`string`?`Could not find child source file at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath())}'.`:`Could not find child source file that matched condition.`)}getSourceFile(e){if(typeof e==`string`){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(t)}for(let t of this._getSourceFilesIterator())if(e(t))return t}getDirectories(){return Array.from(this._getDirectoriesIterator())}_getDirectoriesIterator(){return this._context.compilerFactory.getChildDirectoriesOfDirectory(this.getPath())}getSourceFiles(e){let{compilerFactory:n,fileSystemWrapper:r}=this._context,i=this;if(typeof e==`string`||e instanceof Array){let t=typeof e==`string`?[e]:e;return Array.from(a(t))}else return Array.from(this._getSourceFilesIterator());function*a(e){let a=Array.from(s()),o=t.matchGlobs(a,e,i.getPath());for(let e of o)yield n.getSourceFileFromCacheFromFilePath(r.getStandardizedAbsolutePath(e));function*s(){for(let e of i._getDescendantSourceFilesIterator())yield e.getFilePath()}}}_getSourceFilesIterator(){return this._context.compilerFactory.getChildSourceFilesOfDirectory(this.getPath())}getDescendantSourceFiles(){return Array.from(this._getDescendantSourceFilesIterator())}*_getDescendantSourceFilesIterator(){for(let e of this._getSourceFilesIterator())yield e;for(let e of this._getDirectoriesIterator())yield*e._getDescendantSourceFilesIterator()}getDescendantDirectories(){return Array.from(this._getDescendantDirectoriesIterator())}*_getDescendantDirectoriesIterator(){for(let e of this.getDirectories())yield e,yield*e._getDescendantDirectoriesIterator()}addSourceFilesAtPaths(e){return e=typeof e==`string`?[e]:e,e=e.map(e=>t.FileUtils.pathIsAbsolute(e)?e:t.FileUtils.pathJoin(this.getPath(),e)),this._context.directoryCoordinator.addSourceFilesAtPaths(e,{markInProject:this._isInProject()})}addDirectoryAtPathIfExists(e,t={}){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPathIfExists(n,{...t,markInProject:this._isInProject()})}addDirectoryAtPath(e,t={}){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPath(n,{...t,markInProject:this._isInProject()})}createDirectory(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.createDirectoryOrAddIfExists(t,{markInProject:this._isInProject()})}createSourceFile(e,t,n){let r=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.compilerFactory.createSourceFile(r,t||``,{...n||{},markInProject:this._isInProject()})}addSourceFileAtPathIfExists(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPathIfExists(t,{markInProject:this._isInProject()})}addSourceFileAtPath(e){let t=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPath(t,{markInProject:this._isInProject()})}async emit(e={}){let{fileSystemWrapper:t}=this._context,n=[],r=[],i=[];for(let a of this.#r(e))tm(a)?i.push(a):(n.push(t.writeFile(a.filePath,a.fileText)),r.push(a.filePath));return await Promise.all(n),new Qp(i,r)}emitSync(e={}){let{fileSystemWrapper:t}=this._context,n=[],r=[];for(let i of this.#r(e))tm(i)?r.push(i):(t.writeFileSync(i.filePath,i.fileText),n.push(i.filePath));return new Qp(r,n)}#r(e={}){let{emitOnlyDtsFiles:n=!1}=e,r=e.outDir==null?void 0:/\.js$/i,i=e.outDir==null?void 0:/\.js\.map$/i,a=e.declarationDir==null&&e.outDir==null?void 0:/\.d\.ts$/i,o=e=>e==null?void 0:this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath()),s=(e,n)=>e==null?void 0:t.FileUtils.pathJoin(e,n.getBaseName()),c=this._context.compilerOptions.get().declarationDir!=null||e.declarationDir!=null;return l(this,o(e.outDir),o(e.declarationDir));function*l(e,o,u){for(let s of e.getSourceFiles()){let e=s.getEmitOutput({emitOnlyDtsFiles:n});if(e.getEmitSkipped()){yield s.getFilePath();continue}for(let n of e.getOutputFiles()){let e=n.getFilePath(),s=n.getWriteByteOrderMark()?t.FileUtils.getTextWithByteOrderMark(n.getText()):n.getText();o!=null&&(r.test(e)||i.test(e)||!c&&a.test(e))?e=t.FileUtils.pathJoin(o,t.FileUtils.getBaseName(e)):u!=null&&a.test(e)&&(e=t.FileUtils.pathJoin(u,t.FileUtils.getBaseName(e))),yield{filePath:e,fileText:s}}}for(let t of e.getDirectories())yield*l(t,s(o,t),s(u,t))}}copyToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.copy(t.FileUtils.pathJoin(r,this.getBaseName()),n)}copy(e,t){let n=this.getPath(),r=this._context.fileSystemWrapper,i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(e,this.getPath());return n===i?this:(t=em(t),t.includeUntrackedFiles&&r.queueCopyDirectory(n,i),this.#i(i,t))}async copyImmediately(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);if(r===i)return await this.save(),this;t=em(t);let a=this.#i(i,t);return t.includeUntrackedFiles&&await n.copyDirectoryImmediately(r,i),await a.save(),a}copyImmediatelySync(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);if(r===i)return this.saveSync(),this;t=em(t);let a=this.#i(i,t);return t.includeUntrackedFiles&&n.copyDirectoryImmediatelySync(r,i),a.saveSync(),a}#i(e,t){if(this.getPath()===e)return this;let{fileSystemWrapper:n,compilerFactory:r}=this._context,i=[this,...this.getDescendantDirectories()].map(t=>({newDirPath:t===this?e:n.getStandardizedAbsolutePath(this.getRelativePathTo(t),e)})),a=this.getDescendantSourceFiles().map(t=>({sourceFile:t,newFilePath:n.getStandardizedAbsolutePath(this.getRelativePathTo(t),e),references:this.#c(t)}));for(let{newDirPath:e}of i)this._context.compilerFactory.createDirectoryOrAddIfExists(e,{markInProject:this._isInProject()});for(let{sourceFile:e,newFilePath:n}of a)e._copyInternal(n,t);for(let{references:e,newFilePath:t}of a)this.getSourceFileOrThrow(t)._updateReferencesForCopyInternal(e);return r.getDirectoryFromCache(e)}moveToDirectory(e,n){let r=typeof e==`string`?e:e.getPath();return this.move(t.FileUtils.pathJoin(r,this.getBaseName()),n)}move(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?this:this.#a(i,t,()=>n.queueMoveDirectory(r,i))}async moveImmediately(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?(await this.save(),this):(this.#a(i,t),await n.moveDirectoryImmediately(r,i),await this.save(),this)}moveImmediatelySync(e,t){let n=this._context.fileSystemWrapper,r=this.getPath(),i=n.getStandardizedAbsolutePath(e,r);return r===i?(this.saveSync(),this):(this.#a(i,t),n.moveDirectoryImmediatelySync(r,i),this.saveSync(),this)}#a(e,t,n){let r=this.getPath();if(r===e)return this;let i=this._context.compilerFactory.getDirectoryFromCacheOnlyIfInCache(e),a=i!=null&&i._isInProject();n&&n();let o=this._context.fileSystemWrapper,s=this._context.compilerFactory,c=[this,...this.getDescendantDirectories()].map(t=>({directory:t,oldPath:t.getPath(),newDirPath:t===this?e:o.getStandardizedAbsolutePath(this.getRelativePathTo(t),e)})),l=this.getDescendantSourceFiles().map(t=>({sourceFile:t,newFilePath:o.getStandardizedAbsolutePath(this.getRelativePathTo(t),e),references:this.#l(t)}));for(let{directory:e,oldPath:t,newDirPath:n}of c)s.removeDirectoryFromCache(t),s.getDirectoryFromCache(n)?._forgetOnlyThis(),e._setPathInternal(n),s.addDirectoryToCache(e);for(let{sourceFile:e,newFilePath:n}of l)e._moveInternal(n,t);for(let{sourceFile:e,references:t}of l)e._updateReferencesForMoveInternal(t,r);return a&&this._markAsInProject(),this}clear(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.queueDirectoryDelete(e),this._context.fileSystemWrapper.queueMkdir(e)}async clearImmediately(){let e=this.getPath();this.#o(),await this._context.fileSystemWrapper.clearDirectoryImmediately(e)}clearImmediatelySync(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.clearDirectoryImmediatelySync(e)}delete(){let e=this.getPath();this.#o(),this._context.fileSystemWrapper.queueDirectoryDelete(e),this.forget()}#o(){for(let e of this.getSourceFiles())e.delete();for(let e of this.getDirectories())e.delete()}async deleteImmediately(){let{fileSystemWrapper:e}=this._context,t=this.getPath();this.forget(),await e.deleteDirectoryImmediately(t)}deleteImmediatelySync(){let{fileSystemWrapper:e}=this._context,t=this.getPath();this.forget(),e.deleteDirectoryImmediatelySync(t)}forget(){if(!this.wasForgotten()){for(let e of this.getSourceFiles())e.forget();for(let e of this.getDirectories())e.forget();this._forgetOnlyThis()}}_forgetOnlyThis(){this.wasForgotten()||(this._context.compilerFactory.removeDirectoryFromCache(this.getPath()),this.#e=void 0)}async save(){await this._context.fileSystemWrapper.saveForDirectory(this.getPath());let e=this.getDescendantSourceFiles().filter(e=>!e.isSaved());await Promise.all(e.map(e=>e.save()))}saveSync(){this._context.fileSystemWrapper.saveForDirectorySync(this.getPath()),this.getDescendantSourceFiles().filter(e=>!e.isSaved()).forEach(e=>e.saveSync())}getRelativePathTo(n){let r=this;return t.FileUtils.getRelativePathTo(this.getPath(),i());function i(){return n instanceof Uc?n.getFilePath():n instanceof e?n.getPath():r._context.fileSystemWrapper.getStandardizedAbsolutePath(n,r.getPath())}}getRelativePathAsModuleSpecifierTo(n){let r=this._context.program.getEmitModuleResolutionKind(),i=this,a=t.FileUtils.getRelativePathTo(this.getPath(),o()).replace(/((\.d\.ts$)|(\.[^/.]+$))/i,``);return a.startsWith(`../`)?a:`./`+a;function o(){return n instanceof Uc?a(n):n instanceof e?o(n):s(i._context.fileSystemWrapper.getStandardizedAbsolutePath(n,i.getPath()));function a(e){return s(e.getFilePath())}function o(e){switch(r){case t.ModuleResolutionKind.Node10:return e===i?t.FileUtils.pathJoin(e.getPath(),`index.ts`):e.getPath();case t.ModuleResolutionKind.Classic:case t.ModuleResolutionKind.Node16:case t.ModuleResolutionKind.NodeNext:case t.ModuleResolutionKind.Bundler:return t.FileUtils.pathJoin(e.getPath(),`index.ts`);default:return t.errors.throwNotImplementedForNeverValueError(r)}}function s(e){let n=t.FileUtils.getDirPath(e);switch(r){case t.ModuleResolutionKind.Node10:return n===i.getPath()?e:e.replace(/\/index?(\.d\.ts|\.ts|\.js)$/i,``);case t.ModuleResolutionKind.Classic:case t.ModuleResolutionKind.Node16:case t.ModuleResolutionKind.NodeNext:case t.ModuleResolutionKind.Bundler:return e;default:return t.errors.throwNotImplementedForNeverValueError(r)}}}}getProject(){return this._context.project}wasForgotten(){return this.#e==null}_isInProject(){return this._context.inProjectCoordinator.isDirectoryInProject(this)}_markAsInProject(){this._context.inProjectCoordinator.markDirectoryAsInProject(this)}_hasLoadedParent(){return this._context.compilerFactory.containsDirectoryAtPath(t.FileUtils.getDirPath(this.getPath()))}#s(){if(this.wasForgotten())throw new t.errors.InvalidOperationError(`Cannot use a directory that was deleted, removed, or overwritten.`)}#c(e){return e._getReferencesForCopyInternal().filter(e=>!this.isAncestorOf(e[1]))}#l(e){let{literalReferences:t,referencingLiterals:n}=e._getReferencesForMoveInternal();return{literalReferences:t.filter(e=>!this.isAncestorOf(e[1])),referencingLiterals:n.filter(e=>!this.isAncestorOf(e._sourceFile))}}static#u(e,t){if(t instanceof Uc&&(t=t.getDirectory(),e===t))return!0;if(e.#n.length>=t.#n.length)return!1;for(let n=e.#n.length-1;n>=0;n--)if(e.#n[n]!==t.#n[n])return!1;return!0}};function em(e){return e=t.ObjectUtils.clone(e||{}),M(e,`includeUntrackedFiles`,!0),e}function tm(e){return typeof e==`string`}var nm=class{#e;#t;constructor(e,t){this.#t=e,this.#e=t}addDirectoryAtPathIfExists(e,n){let r=this.#t.getDirectoryFromPath(e,n);if(r!=null){if(n.recursive)for(let r of t.FileUtils.getDescendantDirectories(this.#e,e))this.#t.createDirectoryOrAddIfExists(r,n);return r}}addDirectoryAtPath(e,n){let r=this.addDirectoryAtPathIfExists(e,n);if(r==null)throw new t.errors.DirectoryNotFoundError(e);return r}createDirectoryOrAddIfExists(e,t){return this.#t.createDirectoryOrAddIfExists(e,t)}addSourceFileAtPathIfExists(e,t){return this.#t.addOrGetSourceFileFromFilePath(e,{markInProject:t.markInProject,scriptKind:void 0})}addSourceFileAtPath(e,n){let r=this.addSourceFileAtPathIfExists(e,n);if(r==null)throw new t.errors.FileNotFoundError(this.#e.getStandardizedAbsolutePath(e));return r}addSourceFilesAtPaths(e,n){typeof e==`string`&&(e=[e]);let r=[],i=new Set;for(let a of this.#e.globSync(e)){let e=this.addSourceFileAtPathIfExists(a,n);e!=null&&r.push(e),i.add(t.FileUtils.getDirPath(a))}for(let e of t.FileUtils.getParentMostPaths(Array.from(i)))this.addDirectoryAtPathIfExists(e,{recursive:!0,markInProject:n.markInProject});return r}},rm=class{#e;#t=new t.KeyValueCache;#n=new t.KeyValueCache;#r=new t.KeyValueCache;#i=new t.KeyValueCache;constructor(e){this.#e=e}has(e){return this.#t.has(e)}get(e){if(!this.#t.has(e)){for(let n of this.#i.getValues())if(t.FileUtils.pathStartsWith(n.getPath(),e))return this.createOrAddIfExists(e);return}return this.#t.get(e)}getOrphans(){return this.#i.getValues()}getAll(){return this.#t.getValuesAsArray()}*getAllByDepth(){let e=new t.KeyValueCache,n=0;for(let e of this.getOrphans())r(e);for(n=Math.min(...Array.from(e.getKeys()));e.getSize()>0;){for(let t of e.get(n)||[])yield t,t.getDirectories().forEach(r);e.removeByKey(n),n++}function r(t){let r=t._getDepth();if(n>r)throw Error(`For some reason a subdirectory had a lower depth than the parent directory: ${t.getPath()}`);e.getOrCreate(r,()=>[]).push(t)}}remove(e){this.#s(e),this.#t.removeByKey(e),this.#i.removeByKey(e)}*getChildDirectoriesOfDirectory(e){let t=this.#r.get(e)?.entries();if(t!=null)for(let e of t)yield e}*getChildSourceFilesOfDirectory(e){let t=this.#n.get(e)?.entries();if(t!=null)for(let e of t)yield e}addSourceFile(e){let n=e.getDirectoryPath();this.createOrAddIfExists(n),this.#n.getOrCreate(n,()=>new t.SortedKeyValueArray(e=>e.getBaseName(),t.LocaleStringComparer.instance)).set(e)}removeSourceFile(e){let n=t.FileUtils.getDirPath(e),r=this.#n.get(n);r!=null&&(r.removeByKey(t.FileUtils.getBaseName(e)),r.hasItems()||this.#n.removeByKey(n))}createOrAddIfExists(e){return this.has(e)?this.get(e):(this.#c(e),this.#a(e))}#a(e){let t=new $p(this.#e,e);return this.addDirectory(t),t}addDirectory(e){let n=e.getPath(),r=t.FileUtils.getDirPath(n),i=r===n;for(let e of this.#i.getValues()){let r=e.getPath(),i=t.FileUtils.getDirPath(r);i!==r&&i===n&&this.#i.removeByKey(r)}i||this.#o(e),this.has(r)||this.#i.set(n,e),this.#t.set(n,e),this.#e.fileSystemWrapper.directoryExistsSync(n)||this.#e.fileSystemWrapper.queueMkdir(n);for(let t of this.#i.getValues())e.isAncestorOf(t)&&this.#c(t.getPath())}#o(e){if(t.FileUtils.isRootDirPath(e.getPath()))return;let n=t.FileUtils.getDirPath(e.getPath());this.#r.getOrCreate(n,()=>new t.SortedKeyValueArray(e=>e.getBaseName(),t.LocaleStringComparer.instance)).set(e)}#s(e){if(t.FileUtils.isRootDirPath(e))return;let n=t.FileUtils.getDirPath(e),r=this.#r.get(n);r!=null&&(r.removeByKey(t.FileUtils.getBaseName(e)),r.hasItems()||this.#r.removeByKey(n))}#c(e){let n=[],r=t.FileUtils.getDirPath(e);for(;e!==r;){if(e=r,r=t.FileUtils.getDirPath(e),this.#t.has(e)){for(let e of n)this.#a(e);break}n.unshift(e)}}},im=class extends t.KeyValueCache{#e=[];getOrCreate(e,t){return super.getOrCreate(e,()=>{let e=t();return this.#e.length>0&&this.#e[this.#e.length-1].add(e),e})}setForgetPoint(){this.#e.push(new Set)}forgetLastPoint(){let e=this.#e.pop();e!=null&&this.#n(e.values())}rememberNode(e){if(e.wasForgotten())throw new t.errors.InvalidOperationError(`Cannot remember a node that was removed or forgotten.`);let n=!1;for(let t of this.#e)if(t.delete(e)){n=!0;break}return n&&this.#t(e),n}#t(e){let t=e.getParentSyntaxList()||e.getParent();t!=null&&this.rememberNode(t)}#n(e){for(let n of e)n.wasForgotten()||n.getKind()===t.SyntaxKind.SourceFile||n._forgetOnlyThis()}},am={[t.SyntaxKind.SourceFile]:Uc,[t.SyntaxKind.ArrayBindingPattern]:Oa,[t.SyntaxKind.ArrayLiteralExpression]:Wa,[t.SyntaxKind.ArrayType]:iu,[t.SyntaxKind.ArrowFunction]:el,[t.SyntaxKind.AsExpression]:$a,[t.SyntaxKind.AwaitExpression]:to,[t.SyntaxKind.BigIntLiteral]:Wf,[t.SyntaxKind.BindingElement]:Aa,[t.SyntaxKind.BinaryExpression]:Fa,[t.SyntaxKind.Block]:gs,[t.SyntaxKind.BreakStatement]:_s,[t.SyntaxKind.CallExpression]:ro,[t.SyntaxKind.CallSignature]:Qd,[t.SyntaxKind.CaseBlock]:ys,[t.SyntaxKind.CaseClause]:xs,[t.SyntaxKind.CatchClause]:Cs,[t.SyntaxKind.ClassDeclaration]:El,[t.SyntaxKind.ClassExpression]:Pl,[t.SyntaxKind.ClassStaticBlockDeclaration]:Il,[t.SyntaxKind.ConditionalType]:au,[t.SyntaxKind.Constructor]:Bl,[t.SyntaxKind.ConstructorType]:lu,[t.SyntaxKind.ConstructSignature]:tf,[t.SyntaxKind.ContinueStatement]:Ts,[t.SyntaxKind.CommaListExpression]:ao,[t.SyntaxKind.ComputedPropertyName]:hf,[t.SyntaxKind.ConditionalExpression]:so,[t.SyntaxKind.DebuggerStatement]:Ds,[t.SyntaxKind.Decorator]:Jl,[t.SyntaxKind.DefaultClause]:ks,[t.SyntaxKind.DeleteExpression]:lo,[t.SyntaxKind.DoStatement]:Ms,[t.SyntaxKind.ElementAccessExpression]:fo,[t.SyntaxKind.EmptyStatement]:Ps,[t.SyntaxKind.EnumDeclaration]:Kd,[t.SyntaxKind.EnumMember]:Jd,[t.SyntaxKind.ExportAssignment]:ic,[t.SyntaxKind.ExportDeclaration]:oc,[t.SyntaxKind.ExportSpecifier]:lc,[t.SyntaxKind.ExpressionWithTypeArguments]:du,[t.SyntaxKind.ExpressionStatement]:Is,[t.SyntaxKind.ExternalModuleReference]:dc,[t.SyntaxKind.QualifiedName]:bf,[t.SyntaxKind.ForInStatement]:Rs,[t.SyntaxKind.ForOfStatement]:Bs,[t.SyntaxKind.ForStatement]:Hs,[t.SyntaxKind.FunctionDeclaration]:cl,[t.SyntaxKind.FunctionExpression]:ul,[t.SyntaxKind.FunctionType]:pu,[t.SyntaxKind.GetAccessor]:Hl,[t.SyntaxKind.HeritageClause]:Yd,[t.SyntaxKind.Identifier]:_f,[t.SyntaxKind.IfStatement]:Ws,[t.SyntaxKind.ImportClause]:_c,[t.SyntaxKind.ImportDeclaration]:yc,[t.SyntaxKind.ImportEqualsDeclaration]:Cc,[t.SyntaxKind.ImportSpecifier]:Tc,[t.SyntaxKind.ImportType]:mu,[t.SyntaxKind.ImportAttribute]:pc,[t.SyntaxKind.ImportAttributes]:hc,[t.SyntaxKind.IndexedAccessType]:hu,[t.SyntaxKind.IndexSignature]:rf,[t.SyntaxKind.InferType]:gu,[t.SyntaxKind.InterfaceDeclaration]:of,[t.SyntaxKind.IntersectionType]:_u,[t.SyntaxKind.JSDocAllType]:Bu,[t.SyntaxKind.JSDocAugmentsTag]:Ju,[t.SyntaxKind.JSDocAuthorTag]:Yu,[t.SyntaxKind.JSDocCallbackTag]:Xu,[t.SyntaxKind.JSDocClassTag]:Zu,[t.SyntaxKind.JSDocDeprecatedTag]:Qu,[t.SyntaxKind.JSDocEnumTag]:$u,[t.SyntaxKind.JSDocFunctionType]:td,[t.SyntaxKind.JSDocImplementsTag]:nd,[t.SyntaxKind.JSDocLink]:rd,[t.SyntaxKind.JSDocLinkCode]:id,[t.SyntaxKind.JSDocLinkPlain]:ad,[t.SyntaxKind.JSDocMemberName]:od,[t.SyntaxKind.JSDocNamepathType]:sd,[t.SyntaxKind.JSDocNameReference]:cd,[t.SyntaxKind.JSDocNonNullableType]:ld,[t.SyntaxKind.JSDocNullableType]:ud,[t.SyntaxKind.JSDocOptionalType]:dd,[t.SyntaxKind.JSDocOverrideTag]:md,[t.SyntaxKind.JSDocParameterTag]:gd,[t.SyntaxKind.JSDocPrivateTag]:_d,[t.SyntaxKind.JSDocPropertyTag]:vd,[t.SyntaxKind.JSDocProtectedTag]:yd,[t.SyntaxKind.JSDocPublicTag]:bd,[t.SyntaxKind.JSDocReturnTag]:Cd,[t.SyntaxKind.JSDocReadonlyTag]:xd,[t.SyntaxKind.JSDocThrowsTag]:Id,[t.SyntaxKind.JSDocOverloadTag]:pd,[t.SyntaxKind.JSDocSatisfiesTag]:Td,[t.SyntaxKind.JSDocSeeTag]:Dd,[t.SyntaxKind.JSDocSignature]:Od,[t.SyntaxKind.JSDocTag]:Vd,[t.SyntaxKind.JSDocTemplateTag]:jd,[t.SyntaxKind.JSDocText]:Md,[t.SyntaxKind.JSDocThisTag]:Pd,[t.SyntaxKind.JSDocTypeExpression]:Rd,[t.SyntaxKind.JSDocTypeLiteral]:zd,[t.SyntaxKind.JSDocTypeTag]:Bd,[t.SyntaxKind.JSDocTypedefTag]:Ld,[t.SyntaxKind.JSDocUnknownType]:Hd,[t.SyntaxKind.JSDocVariadicType]:Ud,[t.SyntaxKind.JsxAttribute]:Sf,[t.SyntaxKind.JsxClosingElement]:wf,[t.SyntaxKind.JsxClosingFragment]:Tf,[t.SyntaxKind.JsxElement]:Df,[t.SyntaxKind.JsxExpression]:Af,[t.SyntaxKind.JsxFragment]:jf,[t.SyntaxKind.JsxNamespacedName]:Nf,[t.SyntaxKind.JsxOpeningElement]:Ff,[t.SyntaxKind.JsxOpeningFragment]:If,[t.SyntaxKind.JsxSelfClosingElement]:Rf,[t.SyntaxKind.JsxSpreadAttribute]:Bf,[t.SyntaxKind.JsxText]:Hf,[t.SyntaxKind.LabeledStatement]:Ks,[t.SyntaxKind.LiteralType]:vu,[t.SyntaxKind.MappedType]:yu,[t.SyntaxKind.MetaProperty]:vo,[t.SyntaxKind.MethodDeclaration]:_l,[t.SyntaxKind.MethodSignature]:cf,[t.SyntaxKind.ModuleBlock]:Dc,[t.SyntaxKind.ModuleDeclaration]:Ac,[t.SyntaxKind.NamedExports]:Pc,[t.SyntaxKind.NamedImports]:Ic,[t.SyntaxKind.NamedTupleMember]:xu,[t.SyntaxKind.NamespaceExport]:Rc,[t.SyntaxKind.NamespaceImport]:zc,[t.SyntaxKind.NewExpression]:bo,[t.SyntaxKind.NonNullExpression]:So,[t.SyntaxKind.NotEmittedStatement]:Js,[t.SyntaxKind.NoSubstitutionTemplateLiteral]:op,[t.SyntaxKind.NumericLiteral]:ep,[t.SyntaxKind.ObjectBindingPattern]:ja,[t.SyntaxKind.ObjectLiteralExpression]:Oo,[t.SyntaxKind.OmittedExpression]:Io,[t.SyntaxKind.Parameter]:fl,[t.SyntaxKind.ParenthesizedExpression]:K,[t.SyntaxKind.ParenthesizedType]:Su,[t.SyntaxKind.PartiallyEmittedExpression]:Ro,[t.SyntaxKind.PostfixUnaryExpression]:Bo,[t.SyntaxKind.PrefixUnaryExpression]:Ho,[t.SyntaxKind.PrivateIdentifier]:yf,[t.SyntaxKind.PropertyAccessExpression]:Wo,[t.SyntaxKind.PropertyAssignment]:Ao,[t.SyntaxKind.PropertyDeclaration]:Wl,[t.SyntaxKind.PropertySignature]:uf,[t.SyntaxKind.RegularExpressionLiteral]:np,[t.SyntaxKind.RestType]:Cu,[t.SyntaxKind.ReturnStatement]:Xs,[t.SyntaxKind.SatisfiesExpression]:Ko,[t.SyntaxKind.SetAccessor]:Kl,[t.SyntaxKind.ShorthandPropertyAssignment]:Mo,[t.SyntaxKind.SpreadAssignment]:Po,[t.SyntaxKind.SpreadElement]:Jo,[t.SyntaxKind.StringLiteral]:ip,[t.SyntaxKind.SwitchStatement]:Qs,[t.SyntaxKind.SyntaxList]:yn,[t.SyntaxKind.TaggedTemplateExpression]:sp,[t.SyntaxKind.TemplateExpression]:lp,[t.SyntaxKind.TemplateHead]:dp,[t.SyntaxKind.TemplateLiteralType]:wu,[t.SyntaxKind.TemplateMiddle]:pp,[t.SyntaxKind.TemplateSpan]:hp,[t.SyntaxKind.TemplateTail]:_p,[t.SyntaxKind.ThisType]:Tu,[t.SyntaxKind.ThrowStatement]:ec,[t.SyntaxKind.TryStatement]:nc,[t.SyntaxKind.TupleType]:Eu,[t.SyntaxKind.TypeAliasDeclaration]:Ou,[t.SyntaxKind.TypeAssertionExpression]:is,[t.SyntaxKind.TypeLiteral]:Au,[t.SyntaxKind.TypeOperator]:ju,[t.SyntaxKind.TypeParameter]:Nu,[t.SyntaxKind.TypePredicate]:Fu,[t.SyntaxKind.TypeQuery]:Iu,[t.SyntaxKind.TypeReference]:Lu,[t.SyntaxKind.UnionType]:Ru,[t.SyntaxKind.VariableDeclaration]:yp,[t.SyntaxKind.VariableDeclarationList]:xp,[t.SyntaxKind.VariableStatement]:qc,[t.SyntaxKind.JSDoc]:eu,[t.SyntaxKind.TypeOfExpression]:os,[t.SyntaxKind.WhileStatement]:Yc,[t.SyntaxKind.WithStatement]:Zc,[t.SyntaxKind.YieldExpression]:us,[t.SyntaxKind.SemicolonToken]:V,[t.SyntaxKind.AnyKeyword]:Na,[t.SyntaxKind.BooleanKeyword]:Na,[t.SyntaxKind.FalseKeyword]:Jf,[t.SyntaxKind.ImportKeyword]:mo,[t.SyntaxKind.InferKeyword]:V,[t.SyntaxKind.NeverKeyword]:V,[t.SyntaxKind.NullKeyword]:Qf,[t.SyntaxKind.NumberKeyword]:Na,[t.SyntaxKind.ObjectKeyword]:Na,[t.SyntaxKind.StringKeyword]:Na,[t.SyntaxKind.SymbolKeyword]:Na,[t.SyntaxKind.SuperKeyword]:Qo,[t.SyntaxKind.ThisKeyword]:ns,[t.SyntaxKind.TrueKeyword]:Kf,[t.SyntaxKind.UndefinedKeyword]:Na,[t.SyntaxKind.VoidExpression]:cs},om=class{#e;#t=new Map;#n=new t.WeakCache;#r=new t.WeakCache;#i=new t.WeakCache;#a=new t.WeakCache;#o=new t.WeakCache;#s=new t.WeakCache;#c=new t.WeakCache;#l=new t.WeakCache;#u=new t.WeakCache;#d=new t.WeakCache;#f=new t.WeakCache;#p=new t.WeakCache;#m=new t.WeakCache;#h=new im;#g;#_=new t.EventContainer;#v=new t.EventContainer;documentRegistry;constructor(e){this.documentRegistry=new t.DocumentRegistry(e.fileSystemWrapper),this.#g=new rm(e),e.compilerOptions.onModified(()=>{let e=Array.from(this.#t.values());for(let t of e)an(t)}),this.#e=e}*getSourceFilesByDirectoryDepth(){for(let e of this.getDirectoriesByDepth())yield*e.getSourceFiles()}getSourceFilePaths(){return this.#t.keys()}getChildDirectoriesOfDirectory(e){return this.#g.getChildDirectoriesOfDirectory(e)}getChildSourceFilesOfDirectory(e){return this.#g.getChildSourceFilesOfDirectory(e)}onSourceFileAdded(e,t=!0){t?this.#_.subscribe(e):this.#_.unsubscribe(e)}onSourceFileRemoved(e){this.#v.subscribe(e)}createSourceFile(e,n,r){if(n=n instanceof Function?F(this.#e.createWriter(),n):n||``,typeof n==`string`)return this.createSourceFileFromText(e,n,r);let i=this.#e.createWriter();return this.#e.structurePrinterFactory.forSourceFile({isAmbient:t.FileUtils.getExtension(e)===`.d.ts`}).printText(i,n),this.createSourceFileFromText(e,i.toString(),r)}createSourceFileFromText(e,t,n){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),n.overwrite===!0?this.#y(e,t,n):(this.throwIfFileExists(e,`Did you mean to provide the overwrite option?`),this.#b(e,t,n))}throwIfFileExists(e,n){if(!(!this.containsSourceFileAtPath(e)&&!this.#e.fileSystemWrapper.fileExistsSync(e)))throw n=n==null?``:n+` `,new t.errors.InvalidOperationError(`${n}A source file already exists at the provided file path: ${e}`)}#y(e,t,n){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let r=this.addOrGetSourceFileFromFilePath(e,n);return r==null?this.#b(e,t,n):(r.getChildren().forEach(e=>e.forget()),this.replaceCompilerNode(r,this.createCompilerSourceFileFromText(e,t,n.scriptKind)),r)}getSourceFileFromCacheFromFilePath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#t.get(e)}addOrGetSourceFileFromFilePath(e,t){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let n=this.#t.get(e);if(n==null){let r=this.#e.fileSystemWrapper.readFileIfExistsSync(e,this.#e.getEncoding());r!=null&&(this.#e.logger.log(`Loaded file: ${e}`),n=this.#b(e,r,t),n._setIsSaved(!0))}return n!=null&&t.markInProject&&n._markAsInProject(),n}containsSourceFileAtPath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#t.has(e)}containsDirectoryAtPath(e){return e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e),this.#g.has(e)}getSourceFileForNode(e){let n=e;for(;n.kind!==t.SyntaxKind.SourceFile;){if(n.parent==null)return;n=n.parent}return this.getSourceFile(n,{markInProject:!1})}hasCompilerNode(e){return this.#h.has(e)}getExistingNodeFromCompilerNode(e){return this.#h.get(e)}getNodeFromCompilerNode(e,n){if(e.kind===t.SyntaxKind.SourceFile)return this.getSourceFile(e,{markInProject:!1});return this.#h.getOrCreate(e,()=>{let e=r.call(this);return a.call(this,e),e});function r(){return i(e)?y.isCommentStatement(e)?new ws(this.#e,e,n):y.isCommentClassElement(e)?new Ll(this.#e,e,n):y.isCommentTypeElement(e)?new $d(this.#e,e,n):y.isCommentObjectLiteralElement(e)?new wo(this.#e,e,n):y.isCommentEnumMember(e)?new Wd(this.#e,e,n):t.errors.throwNotImplementedForNeverValueError(e):new(am[e.kind]||V)(this.#e,e,n)}function i(e){return e._commentKind!=null}function a(r){if(e.parent!=null){let t=this.getNodeFromCompilerNode(e.parent,n);t._wrappedChildCount++}let i=r._getParentSyntaxListIfWrapped();if(i!=null&&i._wrappedChildCount++,e.kind===t.SyntaxKind.SyntaxList){let e=0;for(let t of r._getChildrenInCacheIterator())e++;r._wrappedChildCount=e}}}#b(e,n,r){let i=t.StringUtils.hasBom(n);i&&(n=t.StringUtils.stripBom(n));let a=this.getSourceFile(this.createCompilerSourceFileFromText(e,n,r.scriptKind),r);return i&&(a._hasBom=!0),a}createCompilerSourceFileFromText(e,n,r){return this.documentRegistry.createOrUpdateSourceFile(e,this.#e.compilerOptions.get(),t.ts.ScriptSnapshot.fromString(n),r)}getSourceFile(e,t){let n=!1,r=this.#t.get(e.fileName)??this.#h.getOrCreate(e,()=>{let r=new Uc(this.#e,e);return t.markInProject||this.#e.inProjectCoordinator.setSourceFileNotInProject(r),this.#x(r),n=!0,r});return t.markInProject&&r._markAsInProject(),n&&this.#_.fire(r),r}#x(e){this.#t.set(e.getFilePath(),e),this.#e.fileSystemWrapper.removeFileDelete(e.getFilePath()),this.#g.addSourceFile(e)}getDirectoryFromPath(e,t){e=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(e);let n=this.#g.get(e);return n==null&&this.#e.fileSystemWrapper.directoryExistsSync(e)&&(n=this.#g.createOrAddIfExists(e)),n!=null&&t.markInProject&&n._markAsInProject(),n}createDirectoryOrAddIfExists(e,t){let n=this.#g.createOrAddIfExists(e);return n!=null&&t.markInProject&&n._markAsInProject(),n}getDirectoryFromCache(e){return this.#g.get(e)}getDirectoryFromCacheOnlyIfInCache(e){return this.#g.has(e)?this.#g.get(e):void 0}getDirectoriesByDepth(){return this.#g.getAllByDepth()}getOrphanDirectories(){return this.#g.getOrphans()}getSymbolDisplayPart(e){return this.#l.getOrCreate(e,()=>new Kp(e))}getType(e){return(e.flags&t.TypeFlags.TypeParameter)===t.TypeFlags.TypeParameter?this.getTypeParameter(e):this.#p.getOrCreate(e,()=>new Xp(this.#e,e))}getTypeParameter(e){return this.#m.getOrCreate(e,()=>new Zp(this.#e,e))}getSignature(e){return this.#s.getOrCreate(e,()=>new Sp(this.#e,e))}getSymbol(e){return this.#c.getOrCreate(e,()=>new Cp(this.#e,e))}getDefinitionInfo(e){return this.#r.getOrCreate(e,()=>new jp(this.#e,e))}getDocumentSpan(e){return this.#i.getOrCreate(e,()=>new Ap(this.#e,e))}getReferencedSymbolEntry(e){return this.#u.getOrCreate(e,()=>new Wp(this.#e,e))}getReferencedSymbol(e){return this.#d.getOrCreate(e,()=>new Vp(this.#e,e))}getReferencedSymbolDefinitionInfo(e){return this.#f.getOrCreate(e,()=>new Hp(this.#e,e))}getDiagnostic(e){return this.#n.getOrCreate(e,()=>e.start==null?new Np(this.#e,e):new Pp(this.#e,e))}getDiagnosticWithLocation(e){return this.#n.getOrCreate(e,()=>new Pp(this.#e,e))}getDiagnosticMessageChain(e){return this.#a.getOrCreate(e,()=>new Mp(e))}getJSDocTagInfo(e){return this.#o.getOrCreate(e,()=>new kd(e))}replaceCompilerNode(e,n){let r=e instanceof V?e.compilerNode:e,i=e instanceof V?e:this.#h.get(e);if(r.kind===t.SyntaxKind.SourceFile&&r.fileName!==n.fileName){let e=i;this.#S(r),e._replaceCompilerNodeFromFactory(n),this.#h.set(n,e),this.#x(e),this.#_.fire(e)}else this.#h.replaceKey(r,n),i?._replaceCompilerNodeFromFactory(n)}removeNodeFromCache(e){this.#S(e.compilerNode)}#S(e){if(this.#h.removeByKey(e),e.kind===t.SyntaxKind.SourceFile){let t=e,n=this.#e.fileSystemWrapper.getStandardizedAbsolutePath(t.fileName);this.#g.removeSourceFile(n);let r=this.#t.get(n);this.#t.delete(n),this.documentRegistry.removeSourceFile(n),r!=null&&this.#v.fire(r)}}addDirectoryToCache(e){this.#g.addDirectory(e)}removeDirectoryFromCache(e){this.#g.remove(e)}forgetNodesCreatedInBlock(e){this.#h.setForgetPoint();let t=!1,n;try{if(n=e((...e)=>{for(let t of e)this.#h.rememberNode(t)}),V.isNode(n)&&this.#h.rememberNode(n),r(n))return t=!0,n.then(e=>(V.isNode(e)&&this.#h.rememberNode(e),this.#h.forgetLastPoint(),e))}finally{t||this.#h.forgetLastPoint()}return n;function r(e){return e!=null&&typeof e.then==`function`}}},sm=class{#e;#t=new Set;constructor(e){e.onSourceFileRemoved(e=>{this.#t.delete(e)}),this.#e=e}setSourceFileNotInProject(e){this.#t.add(e),e._inProject=!1}markSourceFileAsInProject(e){this.isSourceFileInProject(e)||(this.#n(e),this.#t.delete(e))}markSourceFilesAsInProjectForResolution(){let e=this.#e,n=[],r=[];for(let e of[...this.#t.values()])i(e)?(this.#n(e),this.#t.delete(e),n.push(e)):r.push(e);return{changedSourceFiles:n,unchangedSourceFiles:r};function i(n){let r=n.getFilePath(),i=r.toLowerCase().lastIndexOf(`/node_modules/`);if(i===-1)return!0;let a=r.substring(0,i+14-1),o=e.getDirectoryFromCacheOnlyIfInCache(a);if(o!=null&&o._isInProject())return!0;let s=n.getDirectory();for(;s!=null&&s.getPath()!==a;){if(s._isInProject())return!0;s=e.getDirectoryFromCacheOnlyIfInCache(t.FileUtils.getDirPath(s.getPath()))}return!1}}#n(e){e._inProject=!0,this.markDirectoryAsInProject(e.getDirectory())}isSourceFileInProject(e){return e._inProject===!0}setDirectoryAndFilesAsNotInProjectForTesting(e){for(let t of e.getDirectories())this.setDirectoryAndFilesAsNotInProjectForTesting(t);for(let t of e.getSourceFiles())delete t._inProject,this.#t.add(t);delete e._inProject}markDirectoryAsInProject(e){if(this.isDirectoryInProject(e))return;let n=this,r=this.#e;e._inProject=!0,i(e);function i(e){let t=Array.from(a(e)),r=t[t.length-1];if(!(r==null||!n.isDirectoryInProject(r)))for(let e of t)e._inProject=!0}function*a(e){if(t.FileUtils.isRootDirPath(e.getPath()))return;let i=t.FileUtils.getDirPath(e.getPath()),o=r.getDirectoryFromCacheOnlyIfInCache(i);o!=null&&(yield o,n.isDirectoryInProject(o)||(yield*a(o)))}}isDirectoryInProject(e){return e._inProject===!0}},cm=class{_getFormatCodeSettings;constructor(e){this._getFormatCodeSettings=e}getFormatCodeSettings(){return this._getFormatCodeSettings()}forInitializerExpressionableNode(){return new In}forModifierableNode(){return new Ln}forReturnTypedNode(e){return new Rn(e)}forTypedNode(e,t){return new zn(e,t)}forClassDeclaration(e){return new Jn(this,e)}forClassMember(e){return new Hr(this,e)}forClassStaticBlockDeclaration(){return new Ur(this)}forConstructorDeclaration(e){return new Wr(this,e)}forGetAccessorDeclaration(e){return new Gr(this,e)}forMethodDeclaration(e){return new Kr(this,e)}forPropertyDeclaration(){return new qr(this)}forSetAccessorDeclaration(e){return new Jr(this,e)}forDecorator(){return new Xr(this)}forJSDoc(){return new Zr(this)}forJSDocTag(e){return new Qr(this,e)}forEnumDeclaration(){return new $r(this)}forEnumMember(){return new ei(this)}forObjectLiteralExpressionProperty(){return new ti(this)}forPropertyAssignment(){return new ni(this)}forShorthandPropertyAssignment(){return new ri(this)}forSpreadAssignment(){return new ii(this)}forFunctionDeclaration(e){return new ai(this,e)}forParameterDeclaration(){return new oi(this)}forCallSignatureDeclaration(){return new si(this)}forConstructSignatureDeclaration(){return new ci(this)}forIndexSignatureDeclaration(){return new li(this)}forInterfaceDeclaration(){return new ui(this)}forMethodSignature(){return new di(this)}forPropertySignature(){return new fi(this)}forTypeElementMemberedNode(){return new pi(this)}forTypeElementMember(){return new mi(this)}forJsxAttributeDecider(){return new hi(this)}forJsxAttribute(){return new gi(this)}forJsxChildDecider(){return new _i(this)}forJsxElement(){return new vi(this)}forJsxNamespacedName(){return new yi(this)}forJsxSelfClosingElement(){return new bi(this)}forJsxSpreadAttribute(){return new xi(this)}forExportAssignment(){return new Si(this)}forExportDeclaration(){return new Ci(this)}forImportAttribute(){return new wi(this)}forImportDeclaration(){return new Ti(this)}forModuleDeclaration(e){return new Ei(this,e)}forNamedImportExportSpecifier(){return new Di(this)}forSourceFile(e){return new Oi(this,e)}forStatementedNode(e){return new ki(this,e)}forStatement(e){return new Ai(this,e)}forVariableStatement(){return new ji(this)}forTypeAliasDeclaration(){return new Mi(this)}forTypeParameterDeclaration(){return new Ni(this)}forVariableDeclaration(){return new Pi(this)}};Vc([t.Memoize],cm.prototype,`forInitializerExpressionableNode`,null),Vc([t.Memoize],cm.prototype,`forModifierableNode`,null),Vc([t.Memoize],cm.prototype,`forReturnTypedNode`,null),Vc([t.Memoize],cm.prototype,`forTypedNode`,null),Vc([t.Memoize],cm.prototype,`forClassDeclaration`,null),Vc([t.Memoize],cm.prototype,`forClassMember`,null),Vc([t.Memoize],cm.prototype,`forClassStaticBlockDeclaration`,null),Vc([t.Memoize],cm.prototype,`forConstructorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forGetAccessorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forMethodDeclaration`,null),Vc([t.Memoize],cm.prototype,`forPropertyDeclaration`,null),Vc([t.Memoize],cm.prototype,`forSetAccessorDeclaration`,null),Vc([t.Memoize],cm.prototype,`forDecorator`,null),Vc([t.Memoize],cm.prototype,`forJSDoc`,null),Vc([t.Memoize],cm.prototype,`forJSDocTag`,null),Vc([t.Memoize],cm.prototype,`forEnumDeclaration`,null),Vc([t.Memoize],cm.prototype,`forEnumMember`,null),Vc([t.Memoize],cm.prototype,`forObjectLiteralExpressionProperty`,null),Vc([t.Memoize],cm.prototype,`forPropertyAssignment`,null),Vc([t.Memoize],cm.prototype,`forShorthandPropertyAssignment`,null),Vc([t.Memoize],cm.prototype,`forSpreadAssignment`,null),Vc([t.Memoize],cm.prototype,`forFunctionDeclaration`,null),Vc([t.Memoize],cm.prototype,`forParameterDeclaration`,null),Vc([t.Memoize],cm.prototype,`forCallSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forConstructSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forIndexSignatureDeclaration`,null),Vc([t.Memoize],cm.prototype,`forInterfaceDeclaration`,null),Vc([t.Memoize],cm.prototype,`forMethodSignature`,null),Vc([t.Memoize],cm.prototype,`forPropertySignature`,null),Vc([t.Memoize],cm.prototype,`forTypeElementMemberedNode`,null),Vc([t.Memoize],cm.prototype,`forTypeElementMember`,null),Vc([t.Memoize],cm.prototype,`forJsxAttributeDecider`,null),Vc([t.Memoize],cm.prototype,`forJsxAttribute`,null),Vc([t.Memoize],cm.prototype,`forJsxChildDecider`,null),Vc([t.Memoize],cm.prototype,`forJsxElement`,null),Vc([t.Memoize],cm.prototype,`forJsxNamespacedName`,null),Vc([t.Memoize],cm.prototype,`forJsxSelfClosingElement`,null),Vc([t.Memoize],cm.prototype,`forJsxSpreadAttribute`,null),Vc([t.Memoize],cm.prototype,`forExportAssignment`,null),Vc([t.Memoize],cm.prototype,`forExportDeclaration`,null),Vc([t.Memoize],cm.prototype,`forImportAttribute`,null),Vc([t.Memoize],cm.prototype,`forImportDeclaration`,null),Vc([t.Memoize],cm.prototype,`forModuleDeclaration`,null),Vc([t.Memoize],cm.prototype,`forNamedImportExportSpecifier`,null),Vc([t.Memoize],cm.prototype,`forSourceFile`,null),Vc([t.Memoize],cm.prototype,`forStatementedNode`,null),Vc([t.Memoize],cm.prototype,`forStatement`,null),Vc([t.Memoize],cm.prototype,`forVariableStatement`,null),Vc([t.Memoize],cm.prototype,`forTypeAliasDeclaration`,null),Vc([t.Memoize],cm.prototype,`forTypeParameterDeclaration`,null),Vc([t.Memoize],cm.prototype,`forVariableDeclaration`,null);var lm=class{#e;#t;#n;#r;get project(){if(this.#r==null)throw new t.errors.InvalidOperationError(`This operation is not permitted in this context.`);return this.#r}logger=new oe;lazyReferenceCoordinator;directoryCoordinator;fileSystemWrapper;manipulationSettings=new j;structurePrinterFactory;compilerFactory;inProjectCoordinator;constructor(e){this.#r=e.project,this.fileSystemWrapper=e.fileSystemWrapper,this.#t=e.compilerOptionsContainer,this.compilerFactory=new om(this),this.inProjectCoordinator=new sm(this.compilerFactory),this.structurePrinterFactory=new cm(()=>this.manipulationSettings.getFormatCodeSettings()),this.lazyReferenceCoordinator=new de(this.compilerFactory),this.directoryCoordinator=new nm(this.compilerFactory,e.fileSystemWrapper),this.#e=e.createLanguageService?new Yp({context:this,configFileParsingDiagnostics:e.configFileParsingDiagnostics,resolutionHost:e.resolutionHost&&e.resolutionHost(this.getModuleResolutionHost(),()=>this.compilerOptions.get()),skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}):void 0,e.typeChecker!=null&&(t.errors.throwIfTrue(e.createLanguageService,`Cannot specify a type checker and create a language service.`),this.#n=new qp(this),this.#n._reset(()=>e.typeChecker))}get compilerOptions(){return this.#t}get languageService(){if(this.#e==null)throw this.#i(`language service`);return this.#e}get program(){if(this.#e==null)throw this.#i(`program`);return this.languageService.getProgram()}get typeChecker(){if(this.#n!=null)return this.#n;if(this.#e==null)throw this.#i(`type checker`);return this.program.getTypeChecker()}hasLanguageService(){return this.#e!=null}getEncoding(){return this.compilerOptions.getEncoding()}getFormatCodeSettings(){return this.manipulationSettings.getFormatCodeSettings()}getUserPreferences(){return this.manipulationSettings.getUserPreferences()}resetProgram(){this.languageService._reset()}createWriter(){let t=this.manipulationSettings.getIndentationText();return new i.default({newLine:this.manipulationSettings.getNewLineKindAsString(),indentNumberOfSpaces:t===e.IndentationText.Tab?void 0:t.length,useTabs:t===e.IndentationText.Tab,useSingleQuote:this.manipulationSettings.getQuoteKind()===e.QuoteKind.Single})}getPreEmitDiagnostics(e){return t.ts.getPreEmitDiagnostics(this.program.compilerObject,e?.compilerNode).map(e=>this.compilerFactory.getDiagnostic(e))}getSourceFileContainer(){return{addOrGetSourceFileFromFilePath:(e,t)=>Promise.resolve(this.compilerFactory.addOrGetSourceFileFromFilePath(e,t)?.compilerNode),addOrGetSourceFileFromFilePathSync:(e,t)=>this.compilerFactory.addOrGetSourceFileFromFilePath(e,t)?.compilerNode,containsDirectoryAtPath:e=>this.compilerFactory.containsDirectoryAtPath(e),containsSourceFileAtPath:e=>this.compilerFactory.containsSourceFileAtPath(e),getSourceFileFromCacheFromFilePath:e=>this.compilerFactory.getSourceFileFromCacheFromFilePath(e)?.compilerNode,getSourceFilePaths:()=>this.compilerFactory.getSourceFilePaths(),getSourceFileVersion:e=>this.compilerFactory.documentRegistry.getSourceFileVersion(e),getChildDirectoriesOfDirectory:e=>{let t=[];for(let n of this.compilerFactory.getChildDirectoriesOfDirectory(e))t.push(n.getPath());return t}}}getModuleResolutionHost(){return t.createModuleResolutionHost({transactionalFileSystem:this.fileSystemWrapper,getEncoding:()=>this.getEncoding(),sourceFileContainer:this.getSourceFileContainer()})}#i(e){return new t.errors.InvalidOperationError(`A ${e} is required for this operation. This might occur when manipulating or getting type information from a node that was not added to a Project object and created via createWrappedNode. Please submit a bug report if you don't believe a ${e} should be required for this operation.`)}};Vc([t.Memoize],lm.prototype,`getSourceFileContainer`,null),Vc([t.Memoize],lm.prototype,`getModuleResolutionHost`,null);var um=class{_context;constructor(e={}){s();let n=c(),r=new t.TransactionalFileSystem({fileSystem:n,skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}),i=e.tsConfigFilePath==null?void 0:new t.TsConfigResolver(r,r.getStandardizedAbsolutePath(e.tsConfigFilePath),d()),a=l(),o=new t.CompilerOptionsContainer(e.defaultCompilerOptions);o.set(a),this._context=new lm({project:this,compilerOptionsContainer:o,fileSystemWrapper:r,createLanguageService:!0,resolutionHost:e.resolutionHost,configFileParsingDiagnostics:i?.getErrors()??[],skipLoadingLibFiles:e.skipLoadingLibFiles,libFolderPath:e.libFolderPath}),e.manipulationSettings!=null&&this._context.manipulationSettings.set(e.manipulationSettings),i!=null&&e.skipAddingFilesFromTsConfig!==!0&&(this.#e(i,a),e.skipFileDependencyResolution||this.resolveSourceFileDependencies());function s(){if(e.fileSystem!=null&&e.useInMemoryFileSystem)throw new t.errors.InvalidOperationError(`Cannot provide a file system when specifying to use an in-memory file system.`)}function c(){return e.useInMemoryFileSystem?new t.InMemoryFileSystemHost:e.fileSystem??new t.RealFileSystemHost}function l(){return{...u(),...e.compilerOptions??{}}}function u(){return i?.getCompilerOptions()??{}}function d(){let t=`utf-8`;return e.compilerOptions==null?t:e.compilerOptions.charset??t}}get manipulationSettings(){return this._context.manipulationSettings}get compilerOptions(){return this._context.compilerOptions}resolveSourceFileDependencies(){let e=new Set,t=t=>e.add(t),{compilerFactory:n,inProjectCoordinator:r}=this._context;n.onSourceFileAdded(t);try{this.getProgram().compilerObject}finally{n.onSourceFileAdded(t,!1)}let i=r.markSourceFilesAsInProjectForResolution();for(let t of i.changedSourceFiles)e.add(t);for(let t of i.unchangedSourceFiles)e.delete(t);return Array.from(e.values())}addDirectoryAtPathIfExists(e,t={}){return this._context.directoryCoordinator.addDirectoryAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{...t,markInProject:!0})}addDirectoryAtPath(e,t={}){return this._context.directoryCoordinator.addDirectoryAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{...t,markInProject:!0})}createDirectory(e){return this._context.directoryCoordinator.createDirectoryOrAddIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}getDirectoryOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getDirectory(e),n??(()=>`Could not find a directory at the specified path: ${this._context.fileSystemWrapper.getStandardizedAbsolutePath(e)}`))}getDirectory(e){let{compilerFactory:t}=this._context;return t.getDirectoryFromCache(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e))}getDirectories(){return Array.from(this.#n())}getRootDirectories(){let{inProjectCoordinator:e}=this._context,t=[];for(let e of this._context.compilerFactory.getOrphanDirectories())for(let r of n(e))t.push(r);return t;function*n(t){if(e.isDirectoryInProject(t)){yield t;return}for(let e of t._getDirectoriesIterator())yield*n(e)}}addSourceFilesAtPaths(e){return this._context.directoryCoordinator.addSourceFilesAtPaths(e,{markInProject:!0})}addSourceFileAtPathIfExists(e){return this._context.directoryCoordinator.addSourceFileAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}addSourceFileAtPath(e){return this._context.directoryCoordinator.addSourceFileAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),{markInProject:!0})}addSourceFilesFromTsConfig(e){let n=new t.TsConfigResolver(this._context.fileSystemWrapper,this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),this._context.getEncoding());return this.#e(n,n.getCompilerOptions())}#e(e,t){let n=e.getPaths(t),r=n.filePaths.map(e=>this.addSourceFileAtPath(e));for(let e of n.directoryPaths)this.addDirectoryAtPathIfExists(e);return r}createSourceFile(e,t,n){return this._context.compilerFactory.createSourceFile(this._context.fileSystemWrapper.getStandardizedAbsolutePath(e),t??``,{...n??{},markInProject:!0})}removeSourceFile(e){let t=e.wasForgotten();return e.forget(),!t}getSourceFileOrThrow(e){let n=this.getSourceFile(e);if(n!=null)return n;if(typeof e==`string`){let n=t.FileUtils.standardizeSlashes(e);if(t.FileUtils.pathIsAbsolute(n)||n.indexOf(`/`)>=0){let e=this._context.fileSystemWrapper.getStandardizedAbsolutePath(n);throw new t.errors.InvalidOperationError(`Could not find source file in project at the provided path: ${e}`)}else throw new t.errors.InvalidOperationError(`Could not find source file in project with the provided file name: ${e}`)}else throw new t.errors.InvalidOperationError(`Could not find source file in project based on the provided condition.`)}getSourceFile(e){let n=r(this._context.fileSystemWrapper);if(i(n))return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(n);return t.IterableUtils.find(this.#t(),n);function r(n){if(e instanceof Function)return e;let r=t.FileUtils.standardizeSlashes(e);return t.FileUtils.pathIsAbsolute(r)||r.indexOf(`/`)>=0?n.getStandardizedAbsolutePath(r):e=>t.FileUtils.pathEndsWith(e.getFilePath(),r)}function i(e){return typeof e==`string`}}getSourceFiles(e){let{compilerFactory:n,fileSystemWrapper:r}=this._context,i=this.#t();if(typeof e==`string`||e instanceof Array)return Array.from(a());return Array.from(i);function*a(){let a=Array.from(s()),o=t.matchGlobs(a,e,r.getCurrentDirectory());for(let e of o)yield n.getSourceFileFromCacheFromFilePath(r.getStandardizedAbsolutePath(e));function*s(){for(let e of i)yield e.getFilePath()}}}*#t(){let{compilerFactory:e,inProjectCoordinator:t}=this._context;for(let n of e.getSourceFilesByDirectoryDepth())t.isSourceFileInProject(n)&&(yield n)}*#n(){let{compilerFactory:e,inProjectCoordinator:t}=this._context;for(let n of e.getDirectoriesByDepth())t.isDirectoryInProject(n)&&(yield n)}getAmbientModule(e){return e=dm(e),this.getAmbientModules().find(t=>t.getName()===e)}getAmbientModuleOrThrow(e,n){return t.errors.throwIfNullOrUndefined(this.getAmbientModule(e),n??(()=>`Could not find ambient module with name: ${dm(e)}`))}getAmbientModules(){return this.getTypeChecker().getAmbientModules()}async save(){await this._context.fileSystemWrapper.flush(),await Promise.all(this.#r().map(e=>e.save()))}saveSync(){this._context.fileSystemWrapper.flushSync();for(let e of this.#r())e.saveSync()}enableLogging(e=!0){this._context.logger.setEnabled(e)}#r(){return Array.from(e(this._context.compilerFactory.getSourceFilesByDirectoryDepth()));function*e(e){for(let t of e)t.isSaved()||(yield t)}}getPreEmitDiagnostics(){return this._context.getPreEmitDiagnostics()}getLanguageService(){return this._context.languageService}getProgram(){return this._context.program}getTypeChecker(){return this._context.typeChecker}getFileSystem(){return this._context.fileSystemWrapper.getFileSystem()}emit(e={}){return this._context.program.emit(e)}emitSync(e={}){return this._context.program.emitSync(e)}emitToMemory(e={}){return this._context.program.emitToMemory(e)}getCompilerOptions(){return this._context.compilerOptions.get()}getConfigFileParsingDiagnostics(){return this.getProgram().getConfigFileParsingDiagnostics()}createWriter(){return this._context.createWriter()}forgetNodesCreatedInBlock(e){return this._context.compilerFactory.forgetNodesCreatedInBlock(e)}formatDiagnosticsWithColorAndContext(e,n={}){return t.ts.formatDiagnosticsWithColorAndContext(e.map(e=>e.compilerObject),{getCurrentDirectory:()=>this._context.fileSystemWrapper.getCurrentDirectory(),getCanonicalFileName:e=>e,getNewLine:()=>n.newLineChar??t.runtime.getEndOfLine()})}getModuleResolutionHost(){return this._context.getModuleResolutionHost()}};function dm(e){return t(e[0])&&t(e[e.length-1])&&(e=e.substring(1,e.length-1)),`"${e}"`;function t(e){return e===`"`||e===`'`}}function fm(e,n={}){let{compilerOptions:r={},sourceFile:i,typeChecker:a}=n,o=new t.CompilerOptionsContainer;o.set(r);let s=new lm({project:void 0,fileSystemWrapper:new t.TransactionalFileSystem({fileSystem:new t.RealFileSystemHost,skipLoadingLibFiles:!0,libFolderPath:void 0}),compilerOptionsContainer:o,createLanguageService:!1,typeChecker:a,configFileParsingDiagnostics:[],skipLoadingLibFiles:!0,libFolderPath:void 0}),c=s.compilerFactory.getSourceFile(l(),{markInProject:!0});return s.compilerFactory.getNodeFromCompilerNode(e,c);function l(){return i??u(e)}function u(e){if(e.kind===t.SyntaxKind.SourceFile)return e;if(e.parent==null)throw new t.errors.InvalidOperationError(`Please ensure the node was created from a source file with 'setParentNodes' set to 'true'.`);let n=e;for(;n.parent!=null;)n=n.parent;if(n.kind!==t.SyntaxKind.SourceFile)throw new t.errors.NotImplementedError(`For some reason the top parent was not a source file.`);return n}}var pm=new cm(()=>{throw new t.errors.NotImplementedError(`Not implemented scenario for getting code format settings when using a writer function. Please open an issue.`)}),mm=class{constructor(){}static object(e){return t=>{let n=Object.keys(e);t.write(`{`),n.length>0&&t.indent(()=>{r()}),t.write(`}`);function r(){for(let r=0;r<n.length;r++){r>0&&t.write(`,`).newLine();let i=n[r],a=e[i];t.write(i),a!=null&&(t.write(`: `),vm(t,a))}t.newLine()}}}static objectType(e){return t=>{t.write(`{`),gm(e)&&t.indent(()=>{pm.forTypeElementMemberedNode().printText(t,e)}),t.write(`}`)}}static unionType(e,t,...n){return hm(`|`,[e,t,...n])}static intersectionType(e,t,...n){return hm(`&`,[e,t,...n])}static assertion(e,t){return n=>{vm(n,e),n.spaceIfLastNot().write(`as `),vm(n,t)}}static returnStatement(e){return t=>{t.write(`return `),t.hangingIndentUnlessBlock(()=>{vm(t,e),t.write(`;`)})}}};function hm(e,t){return n=>{_m(n,` ${e} `,t)}}function gm(e){for(let t of Object.keys(e))if(e[t]!=null&&!(e[t]instanceof Array&&e[t].length===0))return!0;return!1}function _m(e,t,n){for(let r=0;r<n.length;r++)e.conditionalWrite(r>0,t),vm(e,n[r])}function vm(e,t){t instanceof Function?t(e):e.write(t.toString())}var{InvalidOperationError:ym,FileNotFoundError:bm,ArgumentError:xm,ArgumentNullOrWhitespaceError:Sm,ArgumentOutOfRangeError:Cm,ArgumentTypeError:wm,BaseError:Tm,DirectoryNotFoundError:Em,NotImplementedError:Dm,NotSupportedError:Om,PathNotFoundError:km}=t.errors;Object.defineProperty(e,"CompilerOptionsContainer",{enumerable:!0,get:function(){return t.CompilerOptionsContainer}}),Object.defineProperty(e,"DiagnosticCategory",{enumerable:!0,get:function(){return t.DiagnosticCategory}}),Object.defineProperty(e,"EmitHint",{enumerable:!0,get:function(){return t.EmitHint}}),Object.defineProperty(e,"InMemoryFileSystemHost",{enumerable:!0,get:function(){return t.InMemoryFileSystemHost}}),Object.defineProperty(e,"LanguageVariant",{enumerable:!0,get:function(){return t.LanguageVariant}}),Object.defineProperty(e,"ModuleKind",{enumerable:!0,get:function(){return t.ModuleKind}}),Object.defineProperty(e,"ModuleResolutionKind",{enumerable:!0,get:function(){return t.ModuleResolutionKind}}),Object.defineProperty(e,"NewLineKind",{enumerable:!0,get:function(){return t.NewLineKind}}),Object.defineProperty(e,"NodeFlags",{enumerable:!0,get:function(){return t.NodeFlags}}),Object.defineProperty(e,"ObjectFlags",{enumerable:!0,get:function(){return t.ObjectFlags}}),Object.defineProperty(e,"ResolutionHosts",{enumerable:!0,get:function(){return t.ResolutionHosts}}),Object.defineProperty(e,"ScriptKind",{enumerable:!0,get:function(){return t.ScriptKind}}),Object.defineProperty(e,"ScriptTarget",{enumerable:!0,get:function(){return t.ScriptTarget}}),Object.defineProperty(e,"SettingsContainer",{enumerable:!0,get:function(){return t.SettingsContainer}}),Object.defineProperty(e,"SymbolFlags",{enumerable:!0,get:function(){return t.SymbolFlags}}),Object.defineProperty(e,"SyntaxKind",{enumerable:!0,get:function(){return t.SyntaxKind}}),Object.defineProperty(e,"TypeFlags",{enumerable:!0,get:function(){return t.TypeFlags}}),Object.defineProperty(e,"TypeFormatFlags",{enumerable:!0,get:function(){return t.TypeFormatFlags}}),Object.defineProperty(e,"ts",{enumerable:!0,get:function(){return t.ts}}),Object.defineProperty(e,"CodeBlockWriter",{enumerable:!0,get:function(){return i.default}}),e.AbstractableNode=Ma,e.AmbientableNode=_e,e.ArgumentError=xm,e.ArgumentNullOrWhitespaceError=Sm,e.ArgumentOutOfRangeError=Cm,e.ArgumentTypeError=wm,e.ArgumentedNode=on,e.ArrayBindingPattern=Oa,e.ArrayDestructuringAssignment=za,e.ArrayDestructuringAssignmentBase=Ra,e.ArrayLiteralExpression=Wa,e.ArrayTypeNode=iu,e.ArrowFunction=el,e.ArrowFunctionBase=$c,e.AsExpression=$a,e.AsExpressionBase=Qa,e.AssignmentExpression=La,e.AssignmentExpressionBase=Ia,e.AsyncableNode=sn,e.AwaitExpression=to,e.AwaitExpressionBase=eo,e.AwaitableNode=cn,e.BaseError=Tm,e.BaseExpressionedNode=Ka,e.BigIntLiteral=Wf,e.BigIntLiteralBase=Uf,e.BinaryExpression=Fa,e.BinaryExpressionBase=Pa,e.BindingElement=Aa,e.BindingElementBase=ka,e.BindingNamedNode=Qi,e.Block=gs,e.BlockBase=hs,e.BodiedNode=Sn,e.BodyableNode=Cn,e.BreakStatement=_s,e.CallExpression=ro,e.CallExpressionBase=no,e.CallSignatureDeclaration=Qd,e.CallSignatureDeclarationBase=Zd,e.CaseBlock=ys,e.CaseBlockBase=vs,e.CaseClause=xs,e.CaseClauseBase=bs,e.CatchClause=Cs,e.CatchClauseBase=Ss,e.ChildOrderableNode=wn,e.ClassDeclaration=El,e.ClassDeclarationBase=Tl,e.ClassElement=ml,e.ClassExpression=Pl,e.ClassExpressionBase=Nl,e.ClassLikeDeclarationBase=vl,e.ClassLikeDeclarationBaseSpecific=yl,e.ClassStaticBlockDeclaration=Il,e.ClassStaticBlockDeclarationBase=Fl,e.CodeAction=Dp,e.CodeFixAction=Op,e.CombinedCodeActions=kp,e.CommaListExpression=ao,e.CommaListExpressionBase=io,e.CommentClassElement=Ll,e.CommentEnumMember=Wd,e.CommentObjectLiteralElement=wo,e.CommentRange=pn,e.CommentStatement=ws,e.CommentTypeElement=$d,e.CommonIdentifierBase=pf,e.CompilerCommentClassElement=f,e.CompilerCommentEnumMember=h,e.CompilerCommentNode=u,e.CompilerCommentObjectLiteralElement=m,e.CompilerCommentStatement=d,e.CompilerCommentTypeElement=p,e.ComputedPropertyName=hf,e.ComputedPropertyNameBase=mf,e.ConditionalExpression=so,e.ConditionalExpressionBase=oo,e.ConditionalTypeNode=au,e.ConstructSignatureDeclaration=tf,e.ConstructSignatureDeclarationBase=ef,e.ConstructorDeclaration=Bl,e.ConstructorDeclarationBase=Rl,e.ConstructorDeclarationOverloadBase=zl,e.ConstructorTypeNode=lu,e.ConstructorTypeNodeBase=cu,e.ContinueStatement=Ts,e.DebuggerStatement=Ds,e.DebuggerStatementBase=Es,e.DecoratableNode=Tn,e.Decorator=Jl,e.DecoratorBase=ql,e.DefaultClause=ks,e.DefaultClauseBase=Os,e.DefinitionInfo=jp,e.DeleteExpression=lo,e.DeleteExpressionBase=co,e.Diagnostic=Np,e.DiagnosticMessageChain=Mp,e.DiagnosticWithLocation=Pp,e.Directory=$p,e.DirectoryEmitResult=Qp,e.DirectoryNotFoundError=Em,e.DoStatement=Ms,e.DoStatementBase=js,e.DocumentSpan=Ap,e.DotDotDotTokenableNode=kn,e.ElementAccessExpression=fo,e.ElementAccessExpressionBase=uo,e.EmitOutput=Ip,e.EmitResult=Lp,e.EmptyStatement=Ps,e.EmptyStatementBase=Ns,e.EnumDeclaration=Kd,e.EnumDeclarationBase=Gd,e.EnumMember=Jd,e.EnumMemberBase=qd,e.ExclamationTokenableNode=An,e.ExportAssignment=ic,e.ExportAssignmentBase=rc,e.ExportDeclaration=oc,e.ExportDeclarationBase=ac,e.ExportGetableNode=jn,e.ExportSpecifier=lc,e.ExportSpecifierBase=cc,e.ExportableNode=Nn,e.Expression=Na,e.ExpressionStatement=Is,e.ExpressionStatementBase=Fs,e.ExpressionWithTypeArguments=du,e.ExpressionWithTypeArgumentsBase=uu,e.ExpressionableNode=Ga,e.ExpressionedNode=qa,e.ExtendsClauseableNode=Fi,e.ExternalModuleReference=dc,e.ExternalModuleReferenceBase=uc,e.FalseLiteral=Jf,e.FalseLiteralBase=qf,e.FileNotFoundError=bm,e.FileReference=Bc,e.FileTextChanges=Ep,e.ForInStatement=Rs,e.ForInStatementBase=Ls,e.ForOfStatement=Bs,e.ForOfStatementBase=zs,e.ForStatement=Hs,e.ForStatementBase=Vs,e.FunctionDeclaration=cl,e.FunctionDeclarationBase=ol,e.FunctionDeclarationOverloadBase=sl,e.FunctionExpression=ul,e.FunctionExpressionBase=ll,e.FunctionLikeDeclaration=Qc,e.FunctionOrConstructorTypeNodeBase=su,e.FunctionOrConstructorTypeNodeBaseBase=ou,e.FunctionTypeNode=pu,e.FunctionTypeNodeBase=fu,e.GeneratorableNode=Ii,e.GetAccessorDeclaration=Hl,e.GetAccessorDeclarationBase=Vl,e.HeritageClause=Yd,e.HeritageClauseableNode=Ri,e.Identifier=_f,e.IdentifierBase=gf,e.IfStatement=Ws,e.IfStatementBase=Us,e.ImplementationLocation=Rp,e.ImplementsClauseableNode=zi,e.ImportAttribute=pc,e.ImportAttributeBase=fc,e.ImportAttributeNamedNode=$i,e.ImportAttributes=hc,e.ImportAttributesBase=mc,e.ImportClause=_c,e.ImportClauseBase=gc,e.ImportDeclaration=yc,e.ImportDeclarationBase=vc,e.ImportEqualsDeclaration=Cc,e.ImportEqualsDeclarationBase=Sc,e.ImportExpression=mo,e.ImportExpressionBase=po,e.ImportExpressionedNode=Ja,e.ImportSpecifier=Tc,e.ImportSpecifierBase=wc,e.ImportTypeNode=mu,e.IndexSignatureDeclaration=rf,e.IndexSignatureDeclarationBase=nf,e.IndexedAccessTypeNode=hu,e.InferTypeNode=gu,e.InitializerExpressionGetableNode=Bi,e.InitializerExpressionableNode=Vi,e.InterfaceDeclaration=of,e.InterfaceDeclarationBase=af,e.IntersectionTypeNode=_u,e.InvalidOperationError=ym,e.IterationStatement=As,e.JSDoc=eu,e.JSDocAllType=Bu,e.JSDocAugmentsTag=Ju,e.JSDocAuthorTag=Yu,e.JSDocBase=$l,e.JSDocCallbackTag=Xu,e.JSDocClassTag=Zu,e.JSDocDeprecatedTag=Qu,e.JSDocEnumTag=$u,e.JSDocFunctionType=td,e.JSDocFunctionTypeBase=ed,e.JSDocImplementsTag=nd,e.JSDocLink=rd,e.JSDocLinkCode=id,e.JSDocLinkPlain=ad,e.JSDocMemberName=od,e.JSDocNameReference=cd,e.JSDocNamepathType=sd,e.JSDocNonNullableType=ld,e.JSDocNullableType=ud,e.JSDocOptionalType=dd,e.JSDocOverloadTag=pd,e.JSDocOverloadTagBase=fd,e.JSDocOverrideTag=md,e.JSDocParameterTag=gd,e.JSDocParameterTagBase=hd,e.JSDocPrivateTag=_d,e.JSDocPropertyLikeTag=Yl,e.JSDocPropertyTag=vd,e.JSDocPropertyTagBase=J,e.JSDocProtectedTag=yd,e.JSDocPublicTag=bd,e.JSDocReadonlyTag=xd,e.JSDocReturnTag=Cd,e.JSDocReturnTagBase=Sd,e.JSDocSatisfiesTag=Td,e.JSDocSatisfiesTagBase=wd,e.JSDocSeeTag=Dd,e.JSDocSeeTagBase=Ed,e.JSDocSignature=Od,e.JSDocTag=Hu,e.JSDocTagBase=Vu,e.JSDocTagInfo=kd,e.JSDocTemplateTag=jd,e.JSDocTemplateTagBase=Ad,e.JSDocText=Md,e.JSDocThisTag=Pd,e.JSDocThisTagBase=Nd,e.JSDocThrowsTag=Id,e.JSDocThrowsTagBase=Fd,e.JSDocType=zu,e.JSDocTypeExpression=Rd,e.JSDocTypeExpressionableTag=Xl,e.JSDocTypeLiteral=zd,e.JSDocTypeParameteredTag=Zl,e.JSDocTypeTag=Bd,e.JSDocTypedefTag=Ld,e.JSDocUnknownTag=Vd,e.JSDocUnknownType=Hd,e.JSDocVariadicType=Ud,e.JSDocableNode=Ui,e.JsxAttribute=Sf,e.JsxAttributeBase=xf,e.JsxAttributedNode=df,e.JsxClosingElement=wf,e.JsxClosingElementBase=Cf,e.JsxClosingFragment=Tf,e.JsxElement=Df,e.JsxElementBase=Ef,e.JsxExpression=Af,e.JsxExpressionBase=kf,e.JsxFragment=jf,e.JsxNamespacedName=Nf,e.JsxNamespacedNameBase=Mf,e.JsxOpeningElement=Ff,e.JsxOpeningElementBase=Pf,e.JsxOpeningFragment=If,e.JsxSelfClosingElement=Rf,e.JsxSelfClosingElementBase=Lf,e.JsxSpreadAttribute=Bf,e.JsxSpreadAttributeBase=zf,e.JsxTagNamedNode=ff,e.JsxText=Hf,e.JsxTextBase=Vf,e.LabeledStatement=Ks,e.LabeledStatementBase=Gs,e.LanguageService=Yp,e.LeftHandSideExpression=W,e.LeftHandSideExpressionedNode=Ya,e.LiteralExpression=go,e.LiteralExpressionBase=ho,e.LiteralLikeNode=Wi,e.LiteralTypeNode=vu,e.ManipulationError=Dt,e.ManipulationSettingsContainer=j,e.MappedTypeNode=yu,e.MemberExpression=Ha,e.MemoryEmitResult=zp,e.MetaProperty=vo,e.MetaPropertyBase=_o,e.MethodDeclaration=_l,e.MethodDeclarationBase=hl,e.MethodDeclarationOverloadBase=gl,e.MethodSignature=cf,e.MethodSignatureBase=sf,e.ModifierableNode=Gi,e.ModuleBlock=Dc,e.ModuleBlockBase=Ec,e.ModuleChildableNode=Oc,e.ModuleDeclaration=Ac,e.ModuleDeclarationBase=kc,e.ModuleNamedNode=ea,e.ModuledNode=qi,e.NameableNode=ta,e.NamedExports=Pc,e.NamedExportsBase=Nc,e.NamedImports=Ic,e.NamedImportsBase=Fc,e.NamedNode=ia,e.NamedNodeBase=Ji,e.NamedTupleMember=xu,e.NamedTupleMemberBase=bu,e.NamespaceExport=Rc,e.NamespaceExportBase=Lc,e.NamespaceImport=zc,e.NamespaceImportBase=q,e.NewExpression=bo,e.NewExpressionBase=yo,e.NoSubstitutionTemplateLiteral=op,e.NoSubstitutionTemplateLiteralBase=ap,e.Node=V,e.NodeWithTypeArguments=ru,e.NodeWithTypeArgumentsBase=nu,e.NonNullExpression=So,e.NonNullExpressionBase=xo,e.NotEmittedStatement=Js,e.NotEmittedStatementBase=qs,e.NotImplementedError=Dm,e.NotSupportedError=Om,e.NullLiteral=Qf,e.NullLiteralBase=Zf,e.NumericLiteral=ep,e.NumericLiteralBase=$f,e.ObjectBindingPattern=ja,e.ObjectDestructuringAssignment=Eo,e.ObjectDestructuringAssignmentBase=To,e.ObjectLiteralElement=Co,e.ObjectLiteralExpression=Oo,e.ObjectLiteralExpressionBase=Do,e.OmittedExpression=Io,e.OmittedExpressionBase=Fo,e.OutputFile=Fp,e.OverloadableNode=tl,e.OverrideableNode=oa,e.ParameterDeclaration=fl,e.ParameterDeclarationBase=dl,e.ParameteredNode=sa,e.ParenthesizedExpression=K,e.ParenthesizedExpressionBase=G,e.ParenthesizedTypeNode=Su,e.PartiallyEmittedExpression=Ro,e.PartiallyEmittedExpressionBase=Lo,e.PathNotFoundError=km,e.PostfixUnaryExpression=Bo,e.PostfixUnaryExpressionBase=zo,e.PrefixUnaryExpression=Ho,e.PrefixUnaryExpressionBase=Vo,e.PrimaryExpression=Ua,e.PrivateIdentifier=yf,e.PrivateIdentifierBase=vf,e.Program=Jp,e.Project=um,e.PropertyAccessExpression=Wo,e.PropertyAccessExpressionBase=Uo,e.PropertyAssignment=Ao,e.PropertyAssignmentBase=ko,e.PropertyDeclaration=Wl,e.PropertyDeclarationBase=Ul,e.PropertyNamedNode=aa,e.PropertySignature=uf,e.PropertySignatureBase=lf,e.QualifiedName=bf,e.QuestionDotTokenableNode=ca,e.QuestionTokenableNode=la,e.ReadonlyableNode=ua,e.RefactorEditInfo=Bp,e.ReferenceEntry=Up,e.ReferenceFindableNode=Yi,e.ReferencedSymbol=Vp,e.ReferencedSymbolDefinitionInfo=Hp,e.ReferencedSymbolEntry=Wp,e.RegularExpressionLiteral=np,e.RegularExpressionLiteralBase=tp,e.RenameLocation=Gp,e.RenameableNode=Zi,e.RestTypeNode=Cu,e.ReturnStatement=Xs,e.ReturnStatementBase=Ys,e.ReturnTypedNode=da,e.SatisfiesExpression=Ko,e.SatisfiesExpressionBase=Go,e.ScopeableNode=fa,e.ScopedNode=ha,e.SetAccessorDeclaration=Kl,e.SetAccessorDeclarationBase=Gl,e.ShorthandPropertyAssignment=Mo,e.ShorthandPropertyAssignmentBase=jo,e.Signature=Sp,e.SignaturedDeclaration=ga,e.SourceFile=Uc,e.SourceFileBase=Hc,e.SpreadAssignment=Po,e.SpreadAssignmentBase=No,e.SpreadElement=Jo,e.SpreadElementBase=qo,e.Statement=fs,e.StatementBase=ds,e.StatementedNode=ps,e.StaticableNode=_a,e.StringLiteral=ip,e.StringLiteralBase=rp,e.Structure=Yn,e.SuperElementAccessExpression=Xo,e.SuperElementAccessExpressionBase=Yo,e.SuperExpression=Qo,e.SuperExpressionBase=Zo,e.SuperExpressionedNode=Xa,e.SuperPropertyAccessExpression=es,e.SuperPropertyAccessExpressionBase=$o,e.SwitchStatement=Qs,e.SwitchStatementBase=Zs,e.Symbol=Cp,e.SymbolDisplayPart=Kp,e.SyntaxList=yn,e.TaggedTemplateExpression=sp,e.TemplateExpression=lp,e.TemplateExpressionBase=cp,e.TemplateHead=dp,e.TemplateHeadBase=up,e.TemplateLiteralTypeNode=wu,e.TemplateMiddle=pp,e.TemplateMiddleBase=fp,e.TemplateSpan=hp,e.TemplateSpanBase=mp,e.TemplateTail=_p,e.TemplateTailBase=gp,e.TextChange=Tp,e.TextInsertableNode=va,e.TextRange=fn,e.TextSpan=wp,e.ThisExpression=ns,e.ThisExpressionBase=ts,e.ThisTypeNode=Tu,e.ThrowStatement=ec,e.ThrowStatementBase=$s,e.TrueLiteral=Kf,e.TrueLiteralBase=Gf,e.TryStatement=nc,e.TryStatementBase=tc,e.TupleTypeNode=Eu,e.Type=Xp,e.TypeAliasDeclaration=Ou,e.TypeAliasDeclarationBase=Du,e.TypeArgumentedNode=ba,e.TypeAssertion=is,e.TypeAssertionBase=rs,e.TypeChecker=qp,e.TypeElement=Xd,e.TypeElementMemberedNode=Ca,e.TypeLiteralNode=Au,e.TypeLiteralNodeBase=ku,e.TypeNode=tu,e.TypeOfExpression=os,e.TypeOfExpressionBase=as,e.TypeOperatorTypeNode=ju,e.TypeParameter=Zp,e.TypeParameterDeclaration=Nu,e.TypeParameterDeclarationBase=Mu,e.TypeParameteredNode=Ta,e.TypePredicateNode=Fu,e.TypeQueryNode=Iu,e.TypeReferenceNode=Lu,e.TypedNode=xa,e.UnaryExpression=Ba,e.UnaryExpressionedNode=Za,e.UnionTypeNode=Ru,e.UnwrappableNode=Da,e.UpdateExpression=Va,e.VariableDeclaration=yp,e.VariableDeclarationBase=vp,e.VariableDeclarationList=xp,e.VariableDeclarationListBase=bp,e.VariableStatement=qc,e.VariableStatementBase=Kc,e.VoidExpression=cs,e.VoidExpressionBase=ss,e.WhileStatement=Yc,e.WhileStatementBase=Jc,e.WithStatement=Zc,e.WithStatementBase=Xc,e.Writers=mm,e.YieldExpression=us,e.YieldExpressionBase=ls,e.createWrappedNode=fm,e.forEachStructureChild=Xn,e.getCompilerOptionsFromTsConfig=pe,e.getScopeForNode=pa,e.insertOverloads=al,e.printNode=A,e.setScopeForNode=ma}))(),en=new Set([`t`,`msg`]),tn=`Trans`,nn=e=>{if(e!==void 0&&($t.Node.isStringLiteral(e)||$t.Node.isNoSubstitutionTemplateLiteral(e)))return e.getLiteralText()},rn=e=>{if(e===void 0)return;let t=nn(e);if(t!==void 0)return{message:t};if(!$t.Node.isObjectLiteralExpression(e))return;let n=e.getProperty(`message`);if(n===void 0||!$t.Node.isPropertyAssignment(n))return;let r=nn(n.getInitializer());if(r===void 0)return;let i=e.getProperty(`context`),a=i!==void 0&&$t.Node.isPropertyAssignment(i)?nn(i.getInitializer()):void 0;return a===void 0?{message:r}:{message:r,context:a}},an=(e,t)=>{let n=e.getAttribute(t);if(n===void 0||!$t.Node.isJsxAttribute(n))return;let r=n.getInitializer();if(r!==void 0){if($t.Node.isStringLiteral(r))return r.getLiteralText();if($t.Node.isJsxExpression(r))return nn(r.getExpression())}},on=e=>{let t=e.getJsxChildren();if(t.some(e=>$t.Node.isJsxExpression(e)||$t.Node.isJsxElement(e)||$t.Node.isJsxSelfClosingElement(e)))return;let n=Bt(t.filter(e=>$t.Node.isJsxText(e)).map(e=>e.getText()).join(``));return n.length>0?n:void 0},sn=e=>{let t=new Map;for(let n of e)t.set(zt(n.message,n.context),n);return[...t.values()]},cn=async e=>{if(e.length===0)return[];let t=new $t.Project({useInMemoryFileSystem:!0,skipFileDependencyResolution:!0}),n=[];for(let i=0;i<e.length;i++){let a;try{a=await(0,r.readFile)(e[i],`utf8`)}catch{continue}t.createSourceFile(`front-component-${i}.tsx`,a,{overwrite:!0}).forEachDescendant(e=>{if($t.Node.isCallExpression(e)){let t=e.getExpression();if($t.Node.isIdentifier(t)&&en.has(t.getText())){let t=rn(e.getArguments()[0]);t!==void 0&&n.push(t)}return}if($t.Node.isJsxSelfClosingElement(e)){if(e.getTagNameNode().getText()!==tn)return;let t=an(e,`message`);if(t!==void 0&&t.length>0){let r=an(e,`context`);n.push(r===void 0?{message:t}:{message:t,context:r})}return}if($t.Node.isJsxElement(e)){let t=e.getOpeningElement();if(t.getTagNameNode().getText()!==tn)return;let r=an(t,`message`)??on(e);if(r!==void 0&&r.length>0){let e=an(t,`context`);n.push(e===void 0?{message:r}:{message:r,context:e})}}})}return sn(n)},ln={objectMetadata:`objects`,fieldMetadata:`fields`,view:`views`,pageLayout:`pageLayouts`,pageLayoutTab:`pageLayoutTabs`,commandMenuItem:`commandMenuItems`,navigationMenuItem:`navigationMenuItems`,timelineActivityType:`timelineActivityTypes`},un=e=>{let n=new Map,r=(e,r)=>{if(!(typeof e!=`object`||!e))for(let i of t.ot[r]){let a=e[i];if(typeof a!=`string`||a.length===0)continue;let o=t.st(r,i);n.set(JSON.stringify([o,a]),{message:a,context:o})}};for(let[t,n]of Object.entries(ln)){let i=e[n];if(Array.isArray(i))for(let e of i)r(e,t)}for(let t of e.pageLayouts??[])for(let e of t.tabs??[]){r(e,`pageLayoutTab`);for(let t of e.widgets??[])r(t,`pageLayoutWidget`)}return[...n.values()]},dn=async({manifest:e,frontComponentSourcePaths:t})=>{let n=await cn(t),r=new Map;for(let t of[...un(e),...n])r.set(zt(t.message,t.context),t);return[...r.values()]},fn=async({appPath:e,manifest:i,frontComponentSourcePaths:a=[],scaffoldLocale:o})=>{let s=await dn({manifest:i,frontComponentSourcePaths:a}),c=n.default.join(e,t.rt);if(await t.vt(c),await t.St(n.default.join(c,`en.json`),t.it(s.map(({message:e,context:t})=>({message:e,context:t,translation:e})))),o!==void 0&&o!==`en`){let e=n.default.join(c,`${o}.json`);await t.yt(e)||await t.St(e,{})}let l=(await(0,r.readdir)(c)).filter(e=>e.endsWith(`.json`)&&e!==`en.json`);for(let e of l){let r=n.default.join(c,e),i=await t.bt(r)??{},a=new Map(t.at(i).map(e=>[zt(e.message,e.context),e.translation]));await t.St(r,t.it(s.map(({message:e,context:t})=>({message:e,context:t,translation:a.get(zt(e,t))??``}))))}return{sourceCount:s.length,updatedLocaleFiles:l}},pn=e=>Object.prototype.hasOwnProperty.call(t.Et,e),V=class{async execute(e){let r=e.appPath??t.Dt,i;e.locale!==void 0&&((e.locale===`en`||!pn(e.locale))&&(console.error(u.default.red(`"${e.locale}" is not a supported target locale. Choose one of: ${Object.keys(t.Et).filter(e=>e!==`en`).join(`, `)}`)),process.exit(1)),i=e.locale),console.log(u.default.blue(`Extracting translatable strings...`));let a=await t.et(r);a.success||(console.error(u.default.red(a.errors.join(`
31396
31396
  `))),process.exit(1)),a.warnings.length>0&&console.warn(u.default.yellow(a.warnings.join(`
31397
- `)));let o=a.filePaths.frontComponents.map(e=>n.default.join(r,e)),{sourceCount:s,updatedLocaleFiles:c}=await fn({appPath:r,manifest:a.manifest,frontComponentSourcePaths:o,scaffoldLocale:i});console.log(u.default.green(`✓ Extracted ${s} string${s===1?``:`s`} to locales/`)),c.length>0&&console.log(u.default.gray(`Updated: ${c.join(`, `)}`))}},mn=t=>{let n=new ve,r=new Pt,i=new It,a=new Se,o=new _e,s=new Rt,c=new V;t.command(`dev [appPath]`).description(`Build and sync local changes`).option(`-o, --once`,"Build and sync once, then exit (deprecated: use `twenty apply`)").option(`--dry-run`,"Preview the metadata changes without applying them (deprecated: use `twenty plan`)").option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`--debounceMs <ms>`,`Debounce in ms (default: 1 000)`).option(`-v, --verbose`,`Show detailed logs`).option(`-d, --debug`,`Show detailed logs (alias for --verbose)`).action(async(e,t)=>{t.dryRun&&!t.once&&console.warn(u.default.yellow("--dry-run only applies with --once. Ignoring it; run `yarn twenty plan` to preview changes."));let n=t.verbose||t.debug;if(t.once){console.warn(u.default.yellow(t.dryRun?"⚠ `twenty dev --once --dry-run` is deprecated. Use `twenty plan` instead.":"⚠ `twenty dev --once` is deprecated. Use `twenty apply` instead.")),await i.execute({appPath:g(e),verbose:n,apply:!t.dryRun,force:t.force});return}await r.execute({appPath:g(e),verbose:n,debounceMs:t.debounceMs?parseInt(t.debounceMs,10):void 0,force:t.force})}),t.command(`plan [appPath]`).description(`Preview metadata changes without applying them`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!1})}),t.command(`apply [appPath]`).description(`Apply local metadata changes after showing the plan`).option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!0,force:t.force})}),t.command(`dev:build [appPath]`).description(`Build and generate API client`).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,t)=>{await n.execute({appPath:g(e),tarball:t.tarball})}),t.command(`dev:typecheck [appPath]`).description(`Run TypeScript type checking`).action(async e=>{await a.execute({appPath:g(e)})}),t.command(`dev:add [entityType]`).description(`Scaffold a new entity (${Object.values(e.c).join(`|`)})`).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{await o.execute(e,t?.path)}),t.command(`dev:catalog-sync`).description(`Trigger marketplace catalog sync`).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-Cn-gDxAz.js"));await new t().execute({remote:e.remote})}),t.command(`dev:generate-client [appPath]`).description(`Generate the typed API client from the active remote (no app definition required)`).action(async e=>{await s.execute({appPath:g(e)})}),t.command(`dev:translations-extract [appPath]`).description(`Extract translatable strings into locales/ catalogs`).option(`--locale <locale>`,`Scaffold an empty catalog for a target locale (e.g. fr-FR)`).action(async(e,t)=>{await c.execute({appPath:g(e),locale:t.locale})}),Lt(t)},hn=async(e,n)=>{let r=n.test?t.C:t.S,i=n.port?parseInt(n.port,10):r;(isNaN(i)||i<1||i>65535)&&(console.error(u.default.red(`Invalid port number.`)),process.exit(1));let a=await t.n({port:i,test:n.test,version:e,onProgress:e=>console.log(u.default.gray(e))});a.success||(console.error(u.default.red(a.error.message)),process.exit(1))},gn=e=>{let n=e.test?t.w:t.x;if(!t.E(n)){console.log(u.default.yellow(`No Twenty server container found.`));return}(0,l.execSync)(`docker stop ${n}`,{stdio:`ignore`}),console.log(u.default.green(`Twenty server stopped.`))},_n=e=>{let n=e.test?t.w:t.x;if(!t.E(n)){console.log(u.default.yellow(`No Twenty server container found.`));return}try{(0,l.spawnSync)(`docker`,[`logs`,`-f`,`--tail`,e.lines,n],{stdio:`inherit`})}catch{}},vn=async e=>{let n=e.test?t.w:t.x,r=e.test?t.C:t.S;if(!t.E(n)){console.log(` Status: ${u.default.gray(`not created`)}`),console.log(u.default.gray(` Run 'yarn twenty docker:start${e.test?` --test`:``}' to create one.`));return}let i=t.M(n),a=i?t.k(n):r,o=i?await t.p(a):!1,s=o?u.default.green(`running (healthy)`):i?u.default.yellow(`running (starting...)`):u.default.gray(`stopped`),c=t.O(`APP_VERSION`,n);console.log(` Status: ${s}`),console.log(` URL: http://localhost:${a}`),c&&console.log(` Version: ${u.default.gray(c)}`),o&&console.log(u.default.gray(` Login: tim@apple.dev / tim@apple.dev`))},yn=e=>{let n=e.test?t.w:t.x,r=e.test?`twenty-app-dev-test-data`:`twenty-app-dev-data`,i=e.test?`twenty-app-dev-test-storage`:`twenty-app-dev-storage`;t.E(n)&&(0,l.execSync)(`docker rm -f ${n}`,{stdio:`ignore`});try{(0,l.execSync)(`docker volume rm ${r} ${i}`,{stdio:`ignore`})}catch{}console.log(u.default.green(`Twenty server data reset.`)),console.log(u.default.gray(`Run 'yarn twenty docker:start${e.test?` --test`:``}' to start a fresh instance.`))},bn=async(e,n)=>{let r=await t.i({version:e??`latest`,test:n.test,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1));let{data:i}=r;if(!i.imageUpdated){console.log(u.default.green(` Already up to date (${i.image}).`));return}console.log(u.default.green(` Upgraded to: ${i.image}`)),i.containerRecreated&&console.log(u.default.gray(` Run 'yarn twenty docker:start${n.test?` --test`:``}' to wait for the server to be ready.`))},xn=e=>{e.command(`docker:start [version]`).description("Start the local Twenty container (version defaults to the app `engines.twenty` range, then `latest`)").option(`-p, --port <port>`,`HTTP port`).option(`--test`,`Start a separate test instance (port 2021)`).action(hn),e.command(`docker:stop`).description(`Stop the local Twenty container`).option(`--test`,`Stop the test instance`).action(gn),e.command(`docker:logs`).description(`Stream container logs`).option(`-n, --lines <lines>`,`Number of lines to show`,`50`).option(`--test`,`Show logs for the test instance`).action(_n),e.command(`docker:status`).description(`Show container status`).option(`--test`,`Show status of the test instance`).action(vn),e.command(`docker:reset`).description(`Delete all data and start fresh`).option(`--test`,`Reset the test instance`).action(yn),e.command(`docker:upgrade [version]`).description(`Upgrade the Docker image`).option(`--test`,`Upgrade the test instance`).action(bn);let t=e.command(`server`,{hidden:!0}).description(`Manage a Twenty server (local instance and server-side actions)`),n=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty server ${e}\` is deprecated. Use \`twenty ${t}\` instead.`));t.command(`start [version]`).option(`-p, --port <port>`,`HTTP port`).option(`--test`,`Start a separate test instance (port 2021)`).action(async(e,t)=>{n(`start`,`docker:start`),await hn(e,t)}),t.command(`stop`).option(`--test`,`Stop the test instance`).action(e=>{n(`stop`,`docker:stop`),gn(e)}),t.command(`logs`).option(`-n, --lines <lines>`,`Number of lines to show`,`50`).option(`--test`,`Show logs for the test instance`).action(e=>{n(`logs`,`docker:logs`),_n(e)}),t.command(`status`).option(`--test`,`Show status of the test instance`).action(async e=>{n(`status`,`docker:status`),await vn(e)}),t.command(`reset`).option(`--test`,`Reset the test instance`).action(e=>{n(`reset`,`docker:reset`),yn(e)}),t.command(`upgrade [version]`).option(`--test`,`Upgrade the test instance`).action(async(e,t)=>{n(`upgrade`,`docker:upgrade`),await bn(e,t)}),t.command(`catalog-sync`).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{n(`catalog-sync`,`dev:catalog-sync`);let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-Cn-gDxAz.js"));await new t().execute({remote:e.remote})})},Sn=/^(\d{1,3}\.){3}\d{1,3}$/,Cn=e=>{try{let{hostname:t}=new URL(e);if(Sn.test(t))return t.replace(/\./g,`-`);let n=t.split(`.`);return n.length>2?n.slice(0,-2).join(`-`):n.length===2?n[0]:n.join(`-`)}catch{return`remote`}},wn=async(e,n)=>n?((await t.t({apiKey:n,apiUrl:e})).success||(console.error(u.default.red(`✗ Authentication failed.`)),process.exit(1)),`API key`):Tn(e),Tn=async e=>{console.log(u.default.gray(`Opening browser for authentication...`));let n=await t.H({apiUrl:e});return n.success?`OAuth`:(console.log(u.default.yellow(n.error.message)),(await t.t({apiKey:(await d.default.prompt([{type:`password`,name:`apiKey`,message:`API Key:`,mask:`*`,validate:e=>e.length>0||`API key is required`}])).apiKey,apiUrl:e})).success||(console.error(u.default.red(`✗ Authentication failed.`)),process.exit(1)),`API key`)},En=async e=>{e.apiUrl&&console.warn(u.default.yellow(`⚠ --api-url is deprecated. Use --url instead.`));let n=e.test?t.W(!0):void 0,r=new t.U(n?{configPath:n}:void 0),i=await r.getRemotes();if(e.as!==void 0&&i.includes(e.as)){let n=await r.getConfigForRemote(e.as);t.U.setActiveRemote(e.as);let i=await wn(n.apiUrl,e.apiKey);console.log(u.default.green(`✓ Re-authenticated "${e.as}" via ${i}.`)),await r.setDefaultRemote(e.as),console.log(u.default.green(`✓ Default remote set to "${e.as}".`));return}let a=e.url??e.apiUrl;if(a)a=t.wt(a);else{let n=await t.m();e.local?(n||(console.error(u.default.red(`No local Twenty server found.
31397
+ `)));let o=a.filePaths.frontComponents.map(e=>n.default.join(r,e)),{sourceCount:s,updatedLocaleFiles:c}=await fn({appPath:r,manifest:a.manifest,frontComponentSourcePaths:o,scaffoldLocale:i});console.log(u.default.green(`✓ Extracted ${s} string${s===1?``:`s`} to locales/`)),c.length>0&&console.log(u.default.gray(`Updated: ${c.join(`, `)}`))}},mn=t=>{let n=new ve,r=new Pt,i=new It,a=new Se,o=new _e,s=new Rt,c=new V;t.command(`dev [appPath]`).description(`Build and sync local changes`).option(`-o, --once`,"Build and sync once, then exit (deprecated: use `twenty apply`)").option(`--dry-run`,"Preview the metadata changes without applying them (deprecated: use `twenty plan`)").option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`--debounceMs <ms>`,`Debounce in ms (default: 1 000)`).option(`-v, --verbose`,`Show detailed logs`).option(`-d, --debug`,`Show detailed logs (alias for --verbose)`).action(async(e,t)=>{t.dryRun&&!t.once&&console.warn(u.default.yellow("--dry-run only applies with --once. Ignoring it; run `yarn twenty plan` to preview changes."));let n=t.verbose||t.debug;if(t.once){console.warn(u.default.yellow(t.dryRun?"⚠ `twenty dev --once --dry-run` is deprecated. Use `twenty plan` instead.":"⚠ `twenty dev --once` is deprecated. Use `twenty apply` instead.")),await i.execute({appPath:g(e),verbose:n,apply:!t.dryRun,force:t.force});return}await r.execute({appPath:g(e),verbose:n,debounceMs:t.debounceMs?parseInt(t.debounceMs,10):void 0,force:t.force})}),t.command(`plan [appPath]`).description(`Preview metadata changes without applying them`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!1})}),t.command(`apply [appPath]`).description(`Apply local metadata changes after showing the plan`).option(`-f, --force`,`Apply destructive changes (deletes) without confirmation`).option(`-v, --verbose`,`Show detailed logs`).action(async(e,t)=>{await i.execute({appPath:g(e),verbose:t.verbose,apply:!0,force:t.force})}),t.command(`dev:build [appPath]`).description(`Build and generate API client`).option(`--tarball`,`Also pack into a .tgz tarball`).action(async(e,t)=>{await n.execute({appPath:g(e),tarball:t.tarball})}),t.command(`dev:typecheck [appPath]`).description(`Run TypeScript type checking`).action(async e=>{await a.execute({appPath:g(e)})}),t.command(`dev:add [entityType]`).description(`Scaffold a new entity (${Object.values(e.s).join(`|`)})`).option(`--path <path>`,`Path in which the entity should be created.`).action(async(e,t)=>{await o.execute(e,t?.path)}),t.command(`dev:catalog-sync`).description(`Trigger marketplace catalog sync`).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-Szx_4267.js"));await new t().execute({remote:e.remote})}),t.command(`dev:generate-client [appPath]`).description(`Generate the typed API client from the active remote (no app definition required)`).action(async e=>{await s.execute({appPath:g(e)})}),t.command(`dev:translations-extract [appPath]`).description(`Extract translatable strings into locales/ catalogs`).option(`--locale <locale>`,`Scaffold an empty catalog for a target locale (e.g. fr-FR)`).action(async(e,t)=>{await c.execute({appPath:g(e),locale:t.locale})}),Lt(t)},hn=async(e,n)=>{let r=n.test?t.C:t.S,i=n.port?parseInt(n.port,10):r;(isNaN(i)||i<1||i>65535)&&(console.error(u.default.red(`Invalid port number.`)),process.exit(1));let a=await t.n({port:i,test:n.test,version:e,onProgress:e=>console.log(u.default.gray(e))});a.success||(console.error(u.default.red(a.error.message)),process.exit(1))},gn=e=>{let n=e.test?t.w:t.x;if(!t.E(n)){console.log(u.default.yellow(`No Twenty server container found.`));return}(0,l.execSync)(`docker stop ${n}`,{stdio:`ignore`}),console.log(u.default.green(`Twenty server stopped.`))},_n=e=>{let n=e.test?t.w:t.x;if(!t.E(n)){console.log(u.default.yellow(`No Twenty server container found.`));return}try{(0,l.spawnSync)(`docker`,[`logs`,`-f`,`--tail`,e.lines,n],{stdio:`inherit`})}catch{}},vn=async e=>{let n=e.test?t.w:t.x,r=e.test?t.C:t.S;if(!t.E(n)){console.log(` Status: ${u.default.gray(`not created`)}`),console.log(u.default.gray(` Run 'yarn twenty docker:start${e.test?` --test`:``}' to create one.`));return}let i=t.M(n),a=i?t.k(n):r,o=i?await t.p(a):!1,s=o?u.default.green(`running (healthy)`):i?u.default.yellow(`running (starting...)`):u.default.gray(`stopped`),c=t.O(`APP_VERSION`,n);console.log(` Status: ${s}`),console.log(` URL: http://localhost:${a}`),c&&console.log(` Version: ${u.default.gray(c)}`),o&&console.log(u.default.gray(` Login: tim@apple.dev / tim@apple.dev`))},yn=e=>{let n=e.test?t.w:t.x,r=e.test?`twenty-app-dev-test-data`:`twenty-app-dev-data`,i=e.test?`twenty-app-dev-test-storage`:`twenty-app-dev-storage`;t.E(n)&&(0,l.execSync)(`docker rm -f ${n}`,{stdio:`ignore`});try{(0,l.execSync)(`docker volume rm ${r} ${i}`,{stdio:`ignore`})}catch{}console.log(u.default.green(`Twenty server data reset.`)),console.log(u.default.gray(`Run 'yarn twenty docker:start${e.test?` --test`:``}' to start a fresh instance.`))},bn=async(e,n)=>{let r=await t.i({version:e??`latest`,test:n.test,onProgress:e=>console.log(u.default.gray(e))});r.success||(console.error(u.default.red(r.error.message)),process.exit(1));let{data:i}=r;if(!i.imageUpdated){console.log(u.default.green(` Already up to date (${i.image}).`));return}console.log(u.default.green(` Upgraded to: ${i.image}`)),i.containerRecreated&&console.log(u.default.gray(` Run 'yarn twenty docker:start${n.test?` --test`:``}' to wait for the server to be ready.`))},xn=e=>{e.command(`docker:start [version]`).description("Start the local Twenty container (version defaults to the app `engines.twenty` range, then `latest`)").option(`-p, --port <port>`,`HTTP port`).option(`--test`,`Start a separate test instance (port 2021)`).action(hn),e.command(`docker:stop`).description(`Stop the local Twenty container`).option(`--test`,`Stop the test instance`).action(gn),e.command(`docker:logs`).description(`Stream container logs`).option(`-n, --lines <lines>`,`Number of lines to show`,`50`).option(`--test`,`Show logs for the test instance`).action(_n),e.command(`docker:status`).description(`Show container status`).option(`--test`,`Show status of the test instance`).action(vn),e.command(`docker:reset`).description(`Delete all data and start fresh`).option(`--test`,`Reset the test instance`).action(yn),e.command(`docker:upgrade [version]`).description(`Upgrade the Docker image`).option(`--test`,`Upgrade the test instance`).action(bn);let t=e.command(`server`,{hidden:!0}).description(`Manage a Twenty server (local instance and server-side actions)`),n=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty server ${e}\` is deprecated. Use \`twenty ${t}\` instead.`));t.command(`start [version]`).option(`-p, --port <port>`,`HTTP port`).option(`--test`,`Start a separate test instance (port 2021)`).action(async(e,t)=>{n(`start`,`docker:start`),await hn(e,t)}),t.command(`stop`).option(`--test`,`Stop the test instance`).action(e=>{n(`stop`,`docker:stop`),gn(e)}),t.command(`logs`).option(`-n, --lines <lines>`,`Number of lines to show`,`50`).option(`--test`,`Show logs for the test instance`).action(e=>{n(`logs`,`docker:logs`),_n(e)}),t.command(`status`).option(`--test`,`Show status of the test instance`).action(async e=>{n(`status`,`docker:status`),await vn(e)}),t.command(`reset`).option(`--test`,`Reset the test instance`).action(e=>{n(`reset`,`docker:reset`),yn(e)}),t.command(`upgrade [version]`).option(`--test`,`Upgrade the test instance`).action(async(e,t)=>{n(`upgrade`,`docker:upgrade`),await bn(e,t)}),t.command(`catalog-sync`).option(`-r, --remote <name>`,`Sync on a specific remote`).action(async e=>{n(`catalog-sync`,`dev:catalog-sync`);let{CatalogSyncCommand:t}=await Promise.resolve().then(()=>require("./catalog-sync-Szx_4267.js"));await new t().execute({remote:e.remote})})},Sn=/^(\d{1,3}\.){3}\d{1,3}$/,Cn=e=>{try{let{hostname:t}=new URL(e);if(Sn.test(t))return t.replace(/\./g,`-`);let n=t.split(`.`);return n.length>2?n.slice(0,-2).join(`-`):n.length===2?n[0]:n.join(`-`)}catch{return`remote`}},wn=async(e,n)=>n?((await t.t({apiKey:n,apiUrl:e})).success||(console.error(u.default.red(`✗ Authentication failed.`)),process.exit(1)),`API key`):Tn(e),Tn=async e=>{console.log(u.default.gray(`Opening browser for authentication...`));let n=await t.H({apiUrl:e});return n.success?`OAuth`:(console.log(u.default.yellow(n.error.message)),(await t.t({apiKey:(await d.default.prompt([{type:`password`,name:`apiKey`,message:`API Key:`,mask:`*`,validate:e=>e.length>0||`API key is required`}])).apiKey,apiUrl:e})).success||(console.error(u.default.red(`✗ Authentication failed.`)),process.exit(1)),`API key`)},En=async e=>{e.apiUrl&&console.warn(u.default.yellow(`⚠ --api-url is deprecated. Use --url instead.`));let n=e.test?t.W(!0):void 0,r=new t.U(n?{configPath:n}:void 0),i=await r.getRemotes();if(e.as!==void 0&&i.includes(e.as)){let n=await r.getConfigForRemote(e.as);t.U.setActiveRemote(e.as);let i=await wn(n.apiUrl,e.apiKey);console.log(u.default.green(`✓ Re-authenticated "${e.as}" via ${i}.`)),await r.setDefaultRemote(e.as),console.log(u.default.green(`✓ Default remote set to "${e.as}".`));return}let a=e.url??e.apiUrl;if(a)a=t.wt(a);else{let n=await t.m();e.local?(n||(console.error(u.default.red(`No local Twenty server found.
31398
31398
  Start one with: yarn twenty docker:start`)),process.exit(1)),console.log(u.default.gray(`Found local server at ${n}`)),a=n):a=t.wt((await d.default.prompt([{type:`input`,name:`serverUrl`,message:`Twenty server URL:`,validate:e=>{try{return new URL(e),!0}catch{return`Please enter a valid URL`}}}])).serverUrl)}let o=e.as??Cn(a);t.U.setActiveRemote(o);let s=await wn(a,e.apiKey);console.log(u.default.green(`✓ Remote "${o}" added (${a}) via ${s}.`)),await r.setDefaultRemote(o),console.log(u.default.green(`✓ Default remote set to "${o}".`))},Dn=async()=>{let e=new t.U,n=await e.getRemotes(),r=await e.getDefaultRemote();if(n.length===0){console.log(`No remotes configured.`),console.log(`Use 'twenty remote:add' to add one.`);return}console.log(``);for(let t of n){let n=await e.getConfigForRemote(t),i=n.twentyCLIAccessToken?`oauth`:n.apiKey?`api-key`:`none`,a=t===r,o=a?`* `:` `,s=a?u.default.bold(t):t;console.log(`${o}${s} ${u.default.gray(n.apiUrl)} [${i}]`)}console.log(`
31399
31399
  `,u.default.gray(`Use 'twenty remote:use <name>' to change default`))},On=async e=>{let n=new t.U,r=e??(await d.default.prompt([{type:`select`,name:`remote`,message:`Select default remote:`,choices:await n.getRemotes()}])).remote;(await n.getRemotes()).includes(r)||(console.error(u.default.red(`Remote "${r}" not found.`)),process.exit(1)),await n.setDefaultRemote(r),console.log(u.default.green(`✓ Default remote set to "${r}".`))},H=async()=>{let e=new t.U,n=new t.z,r=t.U.getActiveRemote(),i=await e.getConfig(),a=i.twentyCLIAccessToken?`oauth`:i.apiKey?`api-key`:`none`;if(console.log(` Remote: ${u.default.bold(r)}`),console.log(` Server: ${i.apiUrl}`),a===`none`){console.log(` Auth: ${u.default.yellow(`not configured`)}`);return}let{authValid:o}=await n.validateAuth(),s=o?u.default.green(`${a} (valid)`):u.default.red(`${a} (invalid)`);console.log(` Auth: ${s}`)},kn=async e=>{let n=new t.U;(await n.getRemotes()).includes(e)||(console.error(u.default.red(`Remote "${e}" not found.`)),process.exit(1)),t.U.setActiveRemote(e),await n.clearConfig(),console.log(u.default.green(`✓ Remote "${e}" removed.`))},An=e=>{e.command(`remote:add`).description(`Add or re-authenticate a remote`).option(`--as <name>`,`Name for this remote`).option(`--api-key <apiKey>`,`API key for non-interactive auth`).option(`--url <url>`,`Server URL`).option(`--api-url <apiUrl>`,`[deprecated: use --url]`).option(`--local`,`Connect to a local Twenty server (auto-detect)`).option(`--test`,`Write to config.test.json (for integration tests)`).action(En),e.command(`remote:list`).description(`List all configured remotes`).action(Dn),e.command(`remote:use [name]`).description(`Set the default remote`).action(On),e.command(`remote:status`).description(`Show active remote auth status`).action(H),e.command(`remote:remove <name>`).description(`Remove a remote`).action(kn);let t=e.command(`remote`,{hidden:!0}).description(`Manage remote Twenty servers`),n=(e,t)=>console.warn(u.default.yellow(`⚠ \`twenty remote ${e}\` is deprecated. Use \`twenty ${t}\` instead.`));t.command(`add`).option(`--as <name>`,`Name for this remote`).option(`--api-key <apiKey>`,`API key for non-interactive auth`).option(`--url <url>`,`Server URL`).option(`--api-url <apiUrl>`,`[deprecated: use --url]`).option(`--local`,`Connect to a local Twenty server (auto-detect)`).option(`--test`,`Write to config.test.json (for integration tests)`).action(async e=>{n(`add`,`remote:add`),await En(e)}),t.command(`list`).action(async()=>{n(`list`,`remote:list`),await Dn()}),t.command(`switch [name]`).action(async e=>{n(`switch`,`remote:use`),await On(e)}),t.command(`status`).action(async()=>{n(`status`,`remote:status`),await H()}),t.command(`remove <name>`).action(async e=>{n(`remove`,`remote:remove`),await kn(e)})},jn=e=>{mn(e),C(e),xn(e),An(e),we(e)};h.inspect.defaultOptions.depth=10;var Mn=new m.Command;Mn.name(`twenty`).description(`CLI for Twenty application development`).version(t.I.version),Mn.option(`-r, --remote <name>`,`Use a specific remote (overrides the default set by remote:use)`),Mn.hook(`preAction`,async e=>{let n=(e.optsWithGlobals?e.optsWithGlobals():e.opts()).remote;n?console.log(u.default.gray(`Using remote: ${n}`)):n=await new t.U().getDefaultRemote(),t.U.setActiveRemote(n)}),jn(Mn),Mn.exitOverride();try{Mn.parse()}catch(e){e instanceof m.CommanderError&&process.exit(e.exitCode),e instanceof Error&&(console.error(u.default.red(`Error:`),e.message),process.exit(1))}