@aventusjs/cli 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Aventus@I18n.package.avt +10 -10
- package/lib/Aventus@Main.package.avt +424 -424
- package/lib/Aventus@UI.package.avt +159 -159
- package/out/RealServer.js +2 -1
- package/package.json +1 -1
package/out/RealServer.js
CHANGED
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
|
|
|
4
4
|
`)}}function Pe(e,t,n,r){return{range:m.Range.create(e.positionAt(n),e.positionAt(r)),severity:m.DiagnosticSeverity.Error,source:C.HTML,message:(0,p.flattenDiagnosticMessageText)(t,`
|
|
5
5
|
`)}}function Fe(e,t){return Ie(e,t,0,e.getText().length)}function Ie(e,t,n,r){return{range:m.Range.create(e.positionAt(n),e.positionAt(r)),severity:m.DiagnosticSeverity.Error,source:C.I18n,message:(0,p.flattenDiagnosticMessageText)(t,`
|
|
6
6
|
`)}}function Le(e,t,n,r){return{range:m.Range.create(e.positionAt(n),e.positionAt(r)),severity:m.DiagnosticSeverity.Warning,source:C.I18n,message:(0,p.flattenDiagnosticMessageText)(t,`
|
|
7
|
-
`)}}function Re(e){let t=e.split(`/`);return t.pop(),t.join(`/`)}function ze(e,t){if(t.start===void 0){let t=e.positionAt(0);return m.Range.create(t,t)}let n=e.positionAt(t.start),r=e.positionAt(t.start+(t.length||0));return m.Range.create(n,r)}function Be(e,t){if(!t)return e;let n=t.aliases;for(let t in n)if(!t.startsWith(`@`)){let r=Ve(t),i=RegExp(`(?<!\\\\)`+r,`g`);e=e.replace(i,n[t])}return e}function Ve(e,t=!1){return t?e.replace(/[\\^$+?.()|[\]{}]/g,`\\$&`):e.replace(/[\\^$*+?.()|[\]{}]/g,`\\$&`)}function He(e){return e===13||e===10}const Ue=/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g;function We(e,t){let n=Ue,r=t;for(;r>0&&!He(e.charCodeAt(r-1));)r--;let i=t-r,a=e.substr(r),o=n.ignoreCase?`gi`:`g`;n=new RegExp(n.source,o);let s=n.exec(a);for(;s&&s.index+s[0].length<i;)s=n.exec(a);return s&&s.index<=i?{start:s.index+r,length:s[0].length}:{start:t,length:0}}function Ge(e,t){e=decodeURIComponent(e),t=decodeURIComponent(t);let n=t.split(`/`);n.pop();let r=e.split(`/`);for(let e=0;e<n.length;e++)if(r.length>e)if(n[e]==r[e])n.splice(e,1),r.splice(e,1),e--;else break;let i=``;for(let e=0;e<n.length;e++)i+=`../`;return i==``&&(i+=`./`),i+=r.join(`/`),i}function Ke(e,t,n){e=e.replace(/\[(.*?)\]/g,`.$1`);let r=e=>t instanceof Map?t.get(e):t[e],i=e.split(`.`);for(let e=0;e<i.length-1;e++){let n=i[e],a=r(n);a||=(t[n]={},t[n]),t=a}t instanceof Map?t.set(i[i.length-1],n):t[i[i.length-1]]=n}const qe={};function Je(e,t,n,r){let i=Ye(t),a=(0,f.dirname)(e);(0,u.existsSync)(a)||(0,u.mkdirSync)(a,{recursive:!0});let o=(0,u.existsSync)(e);(!qe[e]||qe[e]!=i||!o)&&(qe[e]=i,Ce.sendFileSize(e,t,n,r),(0,u.writeFileSync)(e,t))}function Ye(e){return(0,_.createHash)(`md5`).update(e).digest(`hex`)}var Xe=class{static timers={};static start(e){this.timers[e]=process.hrtime()}static stop(e){let t=process.hrtime(this.timers[e]),n=t[1]/1e6;return delete this.timers[e],t[0]*1e3+Math.round(n)}static stopNano(e){let t=process.hrtime(this.timers[e]);return delete this.timers[e],t[0]*1e9+t[1]}};const Ze=new Uint8Array(16);function Qe(){return crypto.getRandomValues(Ze)}const $e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function et(e,t=0){return($e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+`-`+$e[e[t+4]]+$e[e[t+5]]+`-`+$e[e[t+6]]+$e[e[t+7]]+`-`+$e[e[t+8]]+$e[e[t+9]]+`-`+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]).toLowerCase()}function k(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():tt(e,t,n)}function tt(e,t,n){e||={};let r=e.random??e.rng?.()??Qe();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return et(r)}var A=class{_documentUser;_documentInternal;get documentUser(){return this._documentUser}get documentInternal(){return this._documentInternal}linkInternalAndUser=!0;setDocumentInternal(e){this._documentInternal=e,this._versionInternal=e.version}constructor(e){this._documentUser=e,this._documentInternal=e,this._versionUser=e.version,this._versionInternal=e.version}get uri(){return this.documentUser.uri}get path(){return D(this.uri)}get name(){return this.path.split(`/`).pop()??``}_versionUser=0;get versionUser(){return this._versionUser}_versionInternal=0;get versionInternal(){return this._versionInternal}get contentUser(){return this.documentUser.getText()}get contentInternal(){return this.documentInternal.getText()}get folderUri(){return Re(this.uri)}get folderPath(){return Re(this.path)}_shortname=``;get shortname(){if(!this._shortname){let e=this.uri.split(`/`);this._shortname=e[e.length-1]}return this._shortname}onGetBuildCb={};getBuild(){let e=[],t=!1;for(let n in this.onGetBuildCb){let r=this.onGetBuildCb[n]();if(r===null)t=!0;else for(let t of r)e.indexOf(t)==-1&&e.push(t)}return e.length==0&&t?null:e}onGetBuild(e){let t=k();for(;this.onGetBuildCb[t]!=null;)t=k();return this.onGetBuildCb[t]=e,t}removeOnGetBuild(e){delete this.onGetBuildCb[e]}onValidateCb={};async validate(e=!0){let t={};for(let e in this.onValidateCb){let n=await this.onValidateCb[e](this);for(let e of n){let n=e.message+`**`+e.range.start.line+`:`+e.range.start.character+`,`+e.range.end.line+`:`+e.range.end.character;t[n]||(t[n]=e)}}if(e)if(T.getInstance().settings.errorByBuild){let e=this.getBuild();if(e==null)$.sendDiagnostics({uri:this.uri,diagnostics:Object.values(t)});else for(let n of e)$.sendDiagnostics({uri:this.uri,diagnostics:Object.values(t)},n)}else $.sendDiagnostics({uri:this.uri,diagnostics:Object.values(t)});return Object.values(t)}onValidate(e){let t=k();for(;this.onValidateCb[t]!=null;)t=k();return this.onValidateCb[t]=e,t}removeOnValidate(e){delete this.onValidateCb[e]}onContentChangeCb={};delayValidate;waitingDocContentChange={};resolveContentChange={};triggerContentChange(e){return new Promise(t=>{if(!this.triggerCanContentChange(e)){t();return}setTimeout(()=>{this.waitingDocContentChange[e.uri]?(this.resolveContentChange[e.uri]||(this.resolveContentChange[e.uri]={}),this.resolveContentChange[e.uri][e.version]||(this.resolveContentChange[e.uri][e.version]=[]),this.resolveContentChange[e.uri][e.version].push(t),this.waitingDocContentChange[e.uri]=e):(this.waitingDocContentChange[e.uri]=!0,this.resolveContentChange[e.uri]={[e.version]:[t]},this.triggerContentChangeNoBuffer(e))},0)})}async triggerContentChangeNoBuffer(e){let t=e.version;this._documentUser=e,this._versionUser=e.version,this.linkInternalAndUser&&(this._documentInternal=e,this._versionInternal=e.version);let n=[];for(let e in this.onContentChangeCb)n.push(this.onContentChangeCb[e](this));if(await Promise.all(n),this.delayValidate&&clearTimeout(this.delayValidate),this.delayValidate=setTimeout(async()=>{this.validate()},500),this.resolveContentChange[e.uri]){let n=Object.keys(this.resolveContentChange[e.uri]);for(let r of n){if(Number(r)>t)break;if(this.resolveContentChange[e.uri][r]){for(let t of this.resolveContentChange[e.uri][r])t();delete this.resolveContentChange[e.uri][r]}}Object.keys(this.resolveContentChange[e.uri]).length==0&&delete this.resolveContentChange[e.uri]}let r=this.waitingDocContentChange[e.uri];r&&typeof r!=`boolean`?(this.waitingDocContentChange[e.uri]=!0,this.triggerContentChangeNoBuffer(r)):delete this.waitingDocContentChange[e.uri]}onContentChange(e){let t=k();for(;this.onContentChangeCb[t]!=null;)t=k();return this.onContentChangeCb[t]=e,t}removeOnContentChange(e){delete this.onContentChangeCb[e]}onCanContentChangeCb={};triggerCanContentChange(e){for(let t in this.onCanContentChangeCb)if(!this.onCanContentChangeCb[t](e))return!1;return!0}onCanContentChange(e){let t=k();for(;this.onCanContentChangeCb[t]!=null;)t=k();return this.onCanContentChangeCb[t]=e,t}removeOnCanContentChange(e){delete this.onCanContentChangeCb[e]}async applyTextEdits(e){let t=this.contentUser;e.sort((e,t)=>this.documentUser.offsetAt(t.range.end)-this.documentUser.offsetAt(e.range.end));for(let n of e){let e=this.documentUser.offsetAt(n.range.start),r=this.documentUser.offsetAt(n.range.end);t=t.slice(0,e)+n.newText+t.slice(r,t.length)}let n=d.TextDocument.create(this.uri,C.TypeScript,this.documentUser.version+1,t);await this.triggerContentChange(n)}onSaveCb={};async triggerSave(){for(let e in this.onSaveCb)await this.onSaveCb[e](this)}onSave(e){let t=k();for(;this.onSaveCb[t]!=null;)t=k();return this.onSaveCb[t]=e,t}removeOnSave(e){delete this.onSaveCb[e]}onDeleteCb={};async triggerDelete(){let e=[];for(let t in this.onDeleteCb)e.push(this.onDeleteCb[t](this));await Promise.all(e),this.removeAllCallbacks()}removeAllCallbacks(){this.onCodeActionCb={},this.onCompletionCb={},this.onCompletionResolveCb={},this.onContentChangeCb={},this.onDefinitionCb={},this.onDeleteCb={},this.onFormattingCb={},this.onHoverCb={},this.onSaveCb={}}onDelete(e){let t=k();for(;this.onDeleteCb[t]!=null;)t=k();return this.onDeleteCb[t]=e,t}removeOnDelete(e){delete this.onDeleteCb[e]}onCompletionCb={};async getCompletion(e){let t={isIncomplete:!1,items:[]},n=[];for(let t in this.onCompletionCb)n.push(this.onCompletionCb[t](this,e));let r=await Promise.all(n),i={};for(let e of r)for(let t of e.items){let e=JSON.stringify(t);i[e]||(i[e]=t)}return t.items=Object.values(i),t}onCompletion(e){let t=k();for(;this.onCompletionCb[t]!=null;)t=k();return this.onCompletionCb[t]=e,t}removeOnCompletion(e){delete this.onCompletionCb[e]}onCompletionResolveCb={};async getCompletionResolve(e){let t=e,n=[];for(let t in this.onCompletionResolveCb)n.push(this.onCompletionResolveCb[t](this,e));return t}onCompletionResolve(e){let t=k();for(;this.onCompletionResolveCb[t]!=null;)t=k();return this.onCompletionResolveCb[t]=e,t}removeOnCompletionResolve(e){delete this.onCompletionResolveCb[e]}onHoverCb={};async getHover(e){let t=[];for(let n in this.onHoverCb)t.push(this.onHoverCb[n](this,e));let n=await Promise.all(t);for(let e of n)if(e)return e;return null}onHover(e){let t=k();for(;this.onHoverCb[t]!=null;)t=k();return this.onHoverCb[t]=e,t}removeOnHover(e){delete this.onHoverCb[e]}onDefinitionCb={};async getDefinition(e){let t=[];for(let n in this.onDefinitionCb)t.push(this.onDefinitionCb[n](this,e));let n=await Promise.all(t);for(let e of n)if(e)return e;return null}onDefinition(e){let t=k();for(;this.onDefinitionCb[t]!=null;)t=k();return this.onDefinitionCb[t]=e,t}removeOnDefinition(e){delete this.onDefinitionCb[e]}onFormattingCb={};async getFormatting(e){e||={insertSpaces:!0,tabSize:4};let t={},n=[],r={start:this.documentUser.positionAt(0),end:this.documentUser.positionAt(this.documentUser.getText().length)};for(let t in this.onFormattingCb)n.push(this.onFormattingCb[t](this,r,e));let i=await Promise.all(n);for(let e of i)for(let n of e){let e=JSON.stringify(n);t[e]||(t[e]=n)}return Object.values(t)}onFormatting(e){let t=k();for(;this.onFormattingCb[t]!=null;)t=k();return this.onFormattingCb[t]=e,t}removeOnFormatting(e){delete this.onFormattingCb[e]}onCodeActionCb={};async getCodeAction(e){let t=[],n=[];for(let t in this.onCodeActionCb)n.push(this.onCodeActionCb[t](this,e));let r=await Promise.all(n);for(let e of r)t=[...t,...e];return t}onCodeAction(e){let t=k();for(;this.onCodeActionCb[t]!=null;)t=k();return this.onCodeActionCb[t]=e,t}removeOnCodeAction(e){delete this.onCodeActionCb[e]}onReferencesCb={};async getReferences(e){let t=[],n=[];for(let t in this.onReferencesCb)n.push(this.onReferencesCb[t](this,e));let r=await Promise.all(n);for(let e of r)t=[...t,...e];return t}onReferences(e){let t=k();for(;this.onReferencesCb[t]!=null;)t=k();return this.onReferencesCb[t]=e,t}removeOnReferences(e){delete this.onReferencesCb[e]}onCodeLensCb={};async getCodeLens(){let e=[],t=[];for(let e in this.onCodeLensCb)t.push(this.onCodeLensCb[e](this));let n=await Promise.all(t);for(let t of n)e=[...e,...t];return e}onCodeLens(e){let t=k();for(;this.onCodeLensCb[t]!=null;)t=k();return this.onCodeLensCb[t]=e,t}removeOnCodeLens(e){delete this.onCodeLensCb[e]}onRenameCb={};async getRename(e,t){let n=[];for(let r in this.onRenameCb)n.push(this.onRenameCb[r](this,e,t));let r=await Promise.all(n);for(let e of r)if(e)return e;return null}onRename(e){let t=k();for(;this.onRenameCb[t]!=null;)t=k();return this.onRenameCb[t]=e,t}removeOnRename(e){delete this.onRenameCb[e]}},nt=class e{static isInit=!1;static send(e){$.sendNotification(`aventus/initStep`,e)}static sendDone(){$.sendNotification(`aventus/initStep`,`Aventus : Done`),e.isInit=!0}},rt=class e{static instance;static getInstance(){return this.instance||=new e,this.instance}watcher;constructor(){T.getInstance().settings.watchFiles&&(this.watcher=(0,v.watch)(` `,{ignored:/(^|[\/\\])\../,persistent:!0}),this.watcher.on(`add`,this.onContentChange.bind(this)).on(`change`,this.onContentChange.bind(this)).on(`unlink`,this.onRemove.bind(this)))}watcheUris=[];watch(e){if(this.watcheUris.includes(e)||!this.watcher)return;this.watcheUris.push(e);let t=D(e);this.watcher.add(t)}unwatch(e){let t=this.watcheUris.indexOf(e);t!=-1&&this.watcheUris.splice(t,1)}async onContentChange(e){$.debug(`onContentChange : `+e);let t=E(e);this.watcheUris.includes(t)&&R.getInstance().onUpdatedUri(t)}async onRemove(e){let t=E(e);this.watcheUris.includes(t)&&R.getInstance().onDeletedUri(t)}async destroy(){await this.watcher?.close(),e.instance=void 0}};const it={$schema:`foo://aventus/conf.json`,title:`JSON Schema for Aventus`,description:`JSON Schema for Aventus`,type:`object`,additionalProperties:!1,properties:{module:{type:`string`,pattern:`^[a-zA-Z0-9_]+$`,description:`Name of the exported module`},version:{type:`string`,pattern:`^[0-9]+.[0-9]+.[0-9]+$`,description:`Version for all your builds (x.x.x)`},description:{type:`string`,description:`Description of the package`},documentation:{type:`string`,description:`Documentation link for the package`},repository:{type:`string`,description:`Repository link for the package`},tags:{type:`array`,description:`Tags for the package`,items:{type:`string`}},organization:{type:`string`,description:`Name of the organization`,pattern:`^[a-zA-Z0-9_@]+$`},readme:{type:`string`,description:`Path to the readme. By default, Aventus check Readme in the same folder as the configuration`},hideWarnings:{type:`boolean`,description:`Hide warnings for all your builds`},componentPrefix:{type:`string`,description:`Identifier to prefix all your components (in lower case)`,pattern:`^[a-z-]{2,}$`},dependencies:{$ref:`#/$defs/dependencies`},namespaceStrategy:{type:`string`,enum:[`manual`,`followFolders`,`followFoldersCamelCase`,`rules`],description:`Stragety to generate namespace`,default:`manual`},namespaceRules:{type:`object`,description:`Rules to define namespace when namespaceStrategy is rules`},namespaceRoot:{type:`string`,description:`Root directory to define namespace when namespaceStrategy is followFolders`},build:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,description:"Part name for the module. The export file will be ${module}@${name}",pattern:`^[a-zA-Z0-9_]+$`},description:{type:`string`,description:`Description of the package`},tags:{type:`array`,description:`Tags for the package`,items:{type:`string`}},documentation:{type:`string`,description:`Documentation link for the package`},repository:{type:`string`,description:`Repository link for the package`},organization:{type:`string`,description:`Name of the organization`,pattern:`^[a-zA-Z0-9_@]+$`},readme:{type:`string`,description:`Path to the readme. By default, Aventus check Readme in the same folder as the configuration`},version:{type:`string`,pattern:`^[0-9]+.[0-9]+.[0-9]+$`,description:`Version for this build (x.x.x)`},disabled:{type:`boolean`,description:`Disable auto-build`,default:!0},hideWarnings:{type:`boolean`,description:`Hide warnings for this build`},componentPrefix:{type:`string`,description:`Identifier to prefix all your components (in lower case)`,pattern:`^[a-z-]{2,}$`},src:{type:`array`,items:{type:`string`},description:`List of all pathes to listen watch`},stories:{type:`object`,additionalProperties:!1,properties:{output:{type:`string`,description:`Define where to export your stories`},workspace:{type:`string`,description:`Define where to add the .storybook`},live:{type:`boolean`,description:`Define if the story content must be recompiled on change`},format:{type:`string`,enum:[`all`,`public`,`protected`,`manual`],default:`all`,description:`All will export all elements, public only public elements, protected only public and protected elements, manual only elements with tag Storybook`},prefix:{type:`string`,description:`Define a prefix for all your stories name. Allow to group stories`},srcBaseUrl:{type:`string`,description:`Define a base url to link file to your repo`}}},outsideModule:{type:`array`,items:{type:`string`},description:`List of all pathes to import outside the module`},compile:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{input:{type:[`string`,`array`],items:{type:`string`},description:`List of all pathes to import inside this build`},output:{type:[`string`,`array`,`object`],description:`The script file generated path`,pattern:`^\\S+\\.js`,items:{type:[`string`,`object`],pattern:`^\\S+\\.js`,properties:{"@default":{$ref:`#/$defs/compileOutput`},"@npm":{$ref:`#/$defs/compileOutput`}},patternProperties:{"^\\S+$":{$ref:`#/$defs/compileOutput`}},required:[`@default`]},properties:{"@default":{$ref:`#/$defs/compileOutput`},"@npm":{$ref:`#/$defs/compileOutput`}},patternProperties:{"^\\S+$":{$ref:`#/$defs/compileOutput`}},required:[`@default`]},outputNpm:{type:[`string`,`array`,`object`],additionalProperties:!1,properties:{path:{type:[`string`,`array`]},packageJson:{type:`boolean`,description:`Define if you need to generate a package.json`},npmName:{type:`string`,description:`Define the name set inside your package.json`},manifest:{type:`boolean`,description:`Define if you need to generate manifest for your components`},live:{type:`boolean`,description:`Define if the npm content must be recompiled on change. Default is false`}},items:{type:`string`},description:`Define where to export as npm files`},compressed:{type:`boolean`},package:{type:[`string`,`array`],items:{type:`string`,pattern:`^\\S+\\.package\\.avt`},pattern:`^\\S+\\.package\\.avt`,description:`The package file generated path (for lib)`},i18n:{type:[`string`,`array`],items:{type:`object`,additionalProperties:!1,properties:{output:{type:[`string`,`array`],items:{type:`string`}},mount:{type:`string`},mode:{type:`string`,enum:[`singleFile`,`oneToOne`,`groupComponent`,`basedOnAttribute`,`include`],default:`singleFile`}},required:[`output`]}}}}},dependencies:{$ref:`#/$defs/dependencies`},module:{type:`string`,pattern:`^[a-zA-Z0-9_]+$`,description:`Name of the exported module for this build`},namespaceStrategy:{type:`string`,enum:[`manual`,`followFolders`,`followFoldersCamelCase`,`rules`],description:`Stragety to generate namespace`,default:`manual`},namespaceRules:{type:`object`,description:`Rules to define namespace when namespaceStrategy is rules`},namespaceRoot:{type:`string`,description:`Root directory to define namespace when namespaceStrategy is followFolders`},avoidParsingInsideTags:{type:`array`,items:{type:`string`,pattern:`^[a-z-]+$`},description:`List of html tag that mustn't be parsed by the html compiler`},nodeModulesDir:{type:[`string`,`array`],items:{type:`string`},description:`The dirs where node_modules are located`},i18n:{type:`object`,properties:{locales:{type:`array`,items:{type:`string`},description:`Locales that is required inside your project`},fallback:{type:`string`},autoRegister:{type:`boolean`}},description:`Define options for i18n`}},required:[`src`]},minItems:1},static:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,description:`Part name for the static export`,pattern:`^[a-zA-Z0-9_]+$`},input:{type:`string`,description:`Input path to watch to export as static files`},output:{type:[`string`,`array`],items:{type:`string`},description:`Define where to export static files`}},required:[`name`,`input`,`output`]}},avoidParsingInsideTags:{type:`array`,items:{type:`string`,pattern:`^[a-z-]+$`},description:`List of html tag that mustn't be parsed by the html compiler`},aliases:{type:`object`}},required:[`build`,`module`],$defs:{dependencies:{type:`object`,description:`List of dependencies for this build`,patternProperties:{"^\\S+$":{type:[`object`,`string`],additionalProperties:!1,pattern:`^[0-9x]+.[0-9x]+.[0-9x]+$`,properties:{uri:{type:`string`,description:`Where to find the package or the json file`},npm:{type:`string`,description:`The npm package name`},version:{type:`string`,pattern:`^[0-9x]+.[0-9x]+.[0-9x]+$`,description:`The version to use for this file. (default is x.x.x)`,default:`x.x.x`},isLocal:{type:`boolean`,description:`Define if you want to use a local package`},include:{type:`string`,description:`Determine if the package must be included inside the final export. (default is need)`,enum:[`none`,`need`,`full`],default:`need`},subDependenciesInclude:{type:`object`,description:`Inclusion pattern for each lib. You can use a star to select everythink. If nothink find for a lib, the need value ll be used`,patternProperties:{"^\\S+$":{type:`string`,enum:[`none`,`need`,`full`],default:`need`}}}}}}},compileOutput:{type:[`string`,`object`],pattern:`^\\S+\\.js`,additionalProperties:!1,properties:{path:{type:`string`,pattern:`^\\S+\\.js`},compressed:{type:`boolean`}}}}},at={$schema:`foo://aventus/sharp.json`,title:`JSON Schema for Aventus`,description:`JSON Schema for Aventus`,type:`object`,additionalProperties:!1,properties:{csProj:{type:`string`,pattern:`^\\S+\\.csproj`,description:`Path to your csproj file`},outputPath:{type:`string`,description:`Define the folder where to export the code`},exportEnumByDefault:{type:`boolean`,default:!1,description:`Define if enums must be exported. You can override behaviour with [Export] or [NoExport]`},exportStorableByDefault:{type:`boolean`,default:!0,description:`Define if storable must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpRouteByDefault:{type:`boolean`,default:!0,description:`Define if http route must be exported. You can override behaviour with [Export] or [NoExport]`},exportErrorsByDefault:{type:`boolean`,default:!0,description:`Define if errors must be exported. You can override behaviour with [Export] or [NoExport]`},exportWsEndPointByDefault:{type:`boolean`,default:!0,description:`Define if websocket endpoint must be exported. You can override behaviour with [Export] or [NoExport]`},exportWsEventByDefault:{type:`boolean`,default:!0,description:`Define if websocket event must be exported. You can override behaviour with [Export] or [NoExport]`},exportWsRouteByDefault:{type:`boolean`,default:!0,description:`Define if websocket route must be exported. You can override behaviour with [Export] or [NoExport]`},replacer:{type:`object`,additionalProperties:!1,description:`Create replacer to export type`,properties:{all:{$ref:`#/$defs/replacerPart`},genericError:{$ref:`#/$defs/replacerPart`},httpRouter:{$ref:`#/$defs/replacerPart`},normalClass:{$ref:`#/$defs/replacerPart`},storable:{$ref:`#/$defs/replacerPart`},withError:{$ref:`#/$defs/replacerPart`},wsEndPoint:{$ref:`#/$defs/replacerPart`},wsEvent:{$ref:`#/$defs/replacerPart`},wsRouter:{$ref:`#/$defs/replacerPart`}}},httpRouter:{type:`object`,additionalProperties:!1,properties:{useCompiledDll:{type:`boolean`,default:!0,description:"Try to parse route by running the app. You must use `app.UseAventusExport()` to prevent real starting."},createRouter:{type:`boolean`,default:!0,description:`Create a router that your route will use`},routerName:{type:`string`,default:`GeneratedRouter`,description:`The name of the router to generate`},uri:{type:`string`,default:``,pattern:`^(?=s*$)|^(\\/[a-zA-Z0-9_-]+?){1,}$`,description:`Define the base uri for your router (ex: /api)`},host:{type:`string`,default:`https://localhost:5000`,pattern:`^http(s)?:\\/\\/[a-zA-Z0-9_-]*?(:[0-9]{3,4})?$`,description:`Define the host that the router will use`},parent:{type:`string`,default:`Aventus.HttpRouter`,description:`Define the parent type to use for your router`},parentFile:{type:`string`,default:``,description:`Define the parent file to use for your router`},namespace:{type:`string`,default:`Routes`,description:`Define the namespace for your router`},addFormData:{type:`boolean`,default:!0,description:"Add ` | FormData` to the route body"},cacheByDefault:{type:`boolean`,default:!1,description:`Add cache to the function generated`},clearCacheFct:{type:`boolean`,default:!1,description:`Add function to clear cache to the function generated`}}},wsEndpoint:{type:`object`,additionalProperties:!1,properties:{useCompiledDll:{type:`boolean`,default:!0,description:"Try to parse route by running the app. You must use `app.UseAventusExport()` to prevent real starting."},prefix:{type:`string`,default:`Define a prefix for your websocket events`},host:{type:`string`,description:`The host to connect to the websocket`},port:{type:`number`,description:`The port to connect to the websocket`},useHttps:{type:`boolean`,description:`Define if you want to use http or https. Be default, Aventus will check if your connection is secure to use https or not`},parent:{type:`string`,default:`AventusSharp.WebSocket.EndPoint`,description:`Define the parent type to use for your router`}}}},required:[`csProj`,`outputPath`],$defs:{replacerPart:{type:`object`,additionalProperties:!1,properties:{type:{type:`object`,description:`Apply a replacer based on the c# type`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}},result:{type:`object`,description:`Apply a replacer based on the result type (ex: to replace Aventus.IData when IStorable is exported)`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}}}}}},ot={$schema:`foo://aventus/php.json`,title:`JSON Schema for Aventus`,description:`JSON Schema for Aventus`,type:`object`,additionalProperties:!1,properties:{output:{type:`string`,description:`Define the folder where to export the code`},exportAsTs:{type:`boolean`,description:`Define if the code must be compiled as typescript`},useNamespace:{type:`boolean`,description:`Define if the compiler must used namespace`},exportEnumByDefault:{type:`boolean`,default:!1,description:`Define if enums must be exported. You can override behaviour with [Export] or [NoExport]`},exportStorableByDefault:{type:`boolean`,default:!0,description:`Define if storable must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpRouteByDefault:{type:`boolean`,default:!0,description:`Define if http route must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpRequestByDefault:{type:`boolean`,default:!0,description:`Define if request must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpResourceByDefault:{type:`boolean`,default:!0,description:`Define if resource must be exported. You can override behaviour with [Export] or [NoExport]`},exportErrorsByDefault:{type:`boolean`,default:!0,description:`Define if erros must be exported. You can override behaviour with [Export] or [NoExport]`},replacer:{type:`object`,additionalProperties:!1,description:`Create replacer to export type`,properties:{all:{$ref:`#/$defs/replacerPart`},genericError:{$ref:`#/$defs/replacerPart`},httpRouter:{$ref:`#/$defs/replacerPart`},normalClass:{$ref:`#/$defs/replacerPart`},storable:{$ref:`#/$defs/replacerPart`},withError:{$ref:`#/$defs/replacerPart`},httpRequest:{$ref:`#/$defs/replacerPart`},httpResource:{$ref:`#/$defs/replacerPart`}}},httpRouter:{type:`object`,additionalProperties:!1,properties:{createRouter:{type:`boolean`,default:!0,description:`Create a router that your route will use`},routerName:{type:`string`,default:`GeneratedRouter`,description:`The name of the router to generate`},uri:{type:`string`,default:``,pattern:`^(?=s*$)|^(\\/[a-zA-Z0-9_-]+?){1,}$`,description:`Define the base uri for your router (ex: /api)`},host:{type:`string`,default:`https://localhost:5000`,pattern:`^http(s)?:\\/\\/[a-zA-Z0-9_-]*?(:[0-9]{3,4})?$`,description:`Define the host that the router will use`},parent:{type:`string`,default:`Aventus.HttpRouter`,description:`Define the parent type to use for your router`},parentFile:{type:`string`,default:``,description:`Define the parent file to load for your router`},namespace:{type:`string`,default:`Routes`,description:`Define the namespace for your router`}}}},required:[`output`],$defs:{replacerPart:{type:`object`,additionalProperties:!1,properties:{type:{type:`object`,description:`Apply a replacer based on the c# type`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}},result:{type:`object`,description:`Apply a replacer based on the result type (ex: to replace Aventus.IData when IStorable is exported)`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}}}}}};var st=class e{static instance;static getInstance(){return this.instance||=new e,this.instance}languageService;constructor(){this.languageService=(0,y.getLanguageService)({schemaRequestService:async e=>JSON.stringify(it)}),this.languageService.configure({allowComments:!0,schemas:[{fileMatch:[`**`+w.Config],uri:it.$schema??``,schema:it},{fileMatch:[`**`+w.CsharpConfig],uri:at.$schema??``,schema:at},{fileMatch:[`**`+w.PhpConfig],uri:ot.$schema??``,schema:ot}]})}async format(e,t,n){let r=e.documentUser;return await this.languageService.format(r,t,n)}async doComplete(e,t){let n=e.documentUser,r=this.languageService.parseJSONDocument(n),i=await this.languageService.doComplete(e.documentUser,t,r),a=r.getNodeFromOffset(n.offsetAt(t));return this.isKeyOfObject(a,`dependencies`)&&(i||={isIncomplete:!1,items:[]},i?.items.push({label:`Aventus@Main`},{label:`Aventus@UI`},{label:`Aventus@I18n`},{label:`Aventus@Sharp`},{label:`Aventus@Php`})),i||{isIncomplete:!1,items:[]}}async doResolve(e){return await this.languageService.doResolve(e)}async doHover(e,t){let n=e.documentUser,r=this.languageService.parseJSONDocument(n);return await this.languageService.doHover(n,t,r)}async validate(e){let t=e.documentUser,n=this.languageService.parseJSONDocument(t),r=await this.languageService.doValidation(t,n);if(r.length==0){let e=this.removeComments(t.getText());try{return JSON.parse(e),r}catch{r.push(Ae(t,`Can't parse the json`,1001))}}for(let e of r)e.severity=m.DiagnosticSeverity.Error;return r}isKeyOfObject(e,t){let n=e?.parent;if(n?.type==`property`&&n.keyNode==e){let n=e?.parent?.parent?.parent;if(n?.type==`property`&&n.keyNode.value==t)return!0}return!1}isValueOfObject(e,t){let n=e?.parent;if(n?.type==`property`&&n.valueNode==e){let n=e?.parent?.parent?.parent;if(n?.type==`property`&&n.keyNode.value==t)return!0}return!1}async getConfig(e){let t=`documentUser`in e?e.documentUser:e,n=this.languageService.parseJSONDocument(t),r=await this.languageService.doValidation(t,n,void 0,it);if(r.length==0){let e=this.removeComments(t.getText());try{let n=JSON.parse(e);return n=this.prepareConfigFile(t.uri,n),n}catch{r.push(Ae(t,`Can't parse the json`,1001))}}return null}prepareConfigFile(e,t){if(t={...this.defaultConfigValue(),...t},t.componentPrefix==``){let e=t.module.match(/([A-Z][a-z]*)|([0-9][a-z]*)/g);e?t.componentPrefix=e.join(`-`).toLowerCase():t.componentPrefix=`av`}let n=[];for(let r of t.build)n.push(this.prepareBuild(e,r,t));if(t.build=n,t.static){let n=[];for(let r of t.static)n.push(this.prepareStatic(e,r));t.static=n}return t}replaceEnvVar(e,t){if(!e||e.startsWith(`@`)||e.startsWith(`Aventus@`))return e;let n=/%(.*?)%/gm,r;for(;r=n.exec(e);){let t=b.env[r[1]]??`undefined`;e=e.replace(r[0],t)}return/^https?:\/\/.*/.exec(e)||(!e.startsWith(`/`)&&!/^[a-zA-Z]:/gm.test(e)?(e=`/`+e,e=(0,f.normalize)(D(t)+e)):e=(0,f.normalize)(e)),e}prepareBuild(e,t,n){let r=Re(e);t={...this.defaultConfigBuildValue(n),...t},t.name?t.fullname=t.module+`@`+t.name:t.fullname=t.module;let i=e=>this.replaceEnvVar(e,r),a=t.compile;for(let e of a){if(!e.input)e.inputPathRegex=RegExp(`.*`);else{Array.isArray(e.input)||(e.input=[e.input]);let t=[];for(let n of e.input){let e=``;n=n.replace(/\\/g,`/`),n.startsWith(`/`)||(e=`/`);let i=n.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),n=i.join(`/`);let a=(0,f.normalize)(D(r)+e+n).replace(/\\/g,`/`);a=Ve(a,!0).replace(`*`,`.*`),t.push(`(^`+a+`$)`)}let n=t.join(`|`);n==``&&(n=`(?!)`),e.inputPathRegex=new RegExp(n)}if(!e.output)e.output=[];else{Array.isArray(e.output)||(e.output=[e.output]);for(let t=0;t<e.output.length;t++){let n=e.output[t];typeof n==`string`&&(e.output[t]={"@default":{path:n}},n=e.output[t]);let r=!1;for(let a in n){a==`@default`&&(r=!0);let o=n[a];typeof o==`string`&&(e.output[t][a]={path:o}),e.output[t][a].path=n[a].path.trim(),n[a].path.length>0&&(e.output[t][a].path=i(n[a].path))}r||(e.output[t][`@default`]={path:`./dist/script.js`})}}if(!e.outputNpm)e.outputNpm={path:[],packageJson:!1,npmName:``,live:!1};else{typeof e.outputNpm==`string`?e.outputNpm={path:[e.outputNpm],packageJson:!0,npmName:``,manifest:{},live:!1}:Array.isArray(e.outputNpm)&&(e.outputNpm={path:e.outputNpm,packageJson:!0,npmName:``,manifest:{},live:!1}),Array.isArray(e.outputNpm.path)||(e.outputNpm.path=[e.outputNpm.path]),e.outputNpm.packageJson===void 0&&(e.outputNpm.packageJson=!0),e.outputNpm.manifest===void 0&&(e.outputNpm.manifest={}),e.outputNpm.npmName===void 0&&(e.outputNpm.npmName=``),e.outputNpm.live===void 0&&(e.outputNpm.live=!1);for(let t=0;t<e.outputNpm.path.length;t++){let n=i(e.outputNpm.path[t]);n.endsWith(`*`)&&(n=n.slice(0,-1)),n.endsWith(`/`)&&(n=n.slice(0,-1)),n=n.replace(/\\/g,`/`),e.outputNpm.path[t]=n}}if(!e.package)e.package=[];else{Array.isArray(e.package)||(e.package=[e.package]);for(let t=0;t<e.package.length;t++)e.package[t]=e.package[t].trim(),e.package[t].length>0&&(e.package[t]=i(e.package[t]))}if(t.i18n)if(e.i18n){Array.isArray(e.i18n)||(e.i18n=[{output:[e.i18n],mount:``,mode:`singleFile`}]);for(let t=0;t<e.i18n.length;t++){if(!Array.isArray(e.i18n[t].output)){let n=e.i18n[t].output;e.i18n[t].output=[n]}for(let n=0;n<e.i18n[t].output.length;n++)e.i18n[t].output[n].endsWith(`/`)&&(e.i18n[t].output[n]=e.i18n[t].output[n].slice(0,-1)),e.i18n[t].output[n]=e.i18n[t].output[n].trim(),e.i18n[t].output[n].length>0&&(e.i18n[t].output[n]=i(e.i18n[t].output[n]));if(!e.i18n[t].mount&&e.i18n[t].output.length>0){let n=(0,f.normalize)(D($.getWorkspaceUri())),r=e.i18n[t].output[0].replace(n,``).replace(/\\/g,`/`);r.startsWith(`/dist`)&&(r=r.replace(`/dist`,``)),e.i18n[t].mount=r}e.i18n[t].mount.endsWith(`/`)&&(e.i18n[t].mount=e.i18n[t].mount.slice(0,-1))}}else{e.i18n=[];for(let t of e.output){let n=t[`@default`].path.split(f.sep);n.pop();let r=(0,f.join)(n.join(f.sep),`locales`),i=(0,f.normalize)(D($.getWorkspaceUri())),a=r.replace(i,``).replace(/\\/g,`/`);a.startsWith(`/dist`)&&(a=a.replace(`/dist`,``)),e.i18n.push({output:[r],mount:a,mode:`singleFile`})}}}let o=[];for(let e of t.src){let n=``;e=e.replace(/\\/g,`/`),e.startsWith(`/`)||(n=`/`);let i=e.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),e=i.join(`/`);let a=(0,f.normalize)(D(r)+n+e).replace(/\\/g,`/`),s=a.replace(`*`,``);s.endsWith(`/`)&&(s=s.slice(0,-1)),t.srcPath.push(s),a=Ve(a,!0).replace(`*`,`.*`),o.push(`(^`+a+`$)`)}if(t.stories){t.stories={...this.defaultConfigBuildStories(r,n),...t.stories};let e=i(t.stories.output);e.endsWith(`*`)&&(e=e.slice(0,-1)),e.endsWith(`/`)&&(e=e.slice(0,-1)),e=e.replace(/\\/g,`/`),t.stories.output=e}let s=o.join(`|`);s==``&&(s=`(?!)`),t.srcPathRegex=new RegExp(s),t.nodeModulesDir=t.nodeModulesDir.trim(),t.nodeModulesDir==``?t.nodeModulesDir=(0,f.normalize)(D(r)+`/node_modules`):t.nodeModulesDir=i(t.nodeModulesDir);let c={};t.rawDependencies=JSON.parse(JSON.stringify(t.dependencies));for(let e in t.dependencies){let n=t.dependencies[e];typeof n==`string`&&(n={version:n}),c[e]={...this.defaultConfigBuildDependencyValue(n),...n};let r=c[e];r.subDependenciesInclude||={},r.subDependenciesInclude[`*`]||(r.subDependenciesInclude[`*`]=n.include??`need`),r.uri&&=i(r.uri)}if(t.dependencies=c,t.outsideModule){let e=[];for(let n of t.outsideModule){let t=``;n=n.replace(/\\/g,`/`),n.startsWith(`/`)||(t=`/`);let i=n.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),n=i.join(`/`);let a=(0,f.normalize)(D(r)+t+n).replace(/\\/g,`/`);a=Ve(a,!0).replace(`*`,`.*`),e.push(`(^`+a+`$)`)}let n=e.join(`|`);n==``&&(n=`(?!)`),t.outsideModulePathRegex=new RegExp(n)}if(t.namespaceStrategy==`rules`)for(let e in t.namespaceRules){let n=[],i=t.namespaceRules[e];for(let e of i){let t=``;e=e.replace(/\\/g,`/`),e.startsWith(`/`)||(t=`/`);let i=e.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),e=i.join(`/`);let a=(0,f.normalize)(D(r)+t+e).replace(/\\/g,`/`);a=Ve(a,!0).replace(`*`,`.*`),n.push(`(^`+a+`$)`)}let a=n.join(`|`);a==``&&(a=`(?!)`),t.namespaceRulesRegex[e]=new RegExp(a)}else if(t.namespaceStrategy==`followFolders`||t.namespaceStrategy==`followFoldersCamelCase`){let e=``;t.namespaceRoot.startsWith(`/`)||(e=`/`),t.namespaceRoot=(0,f.normalize)(D(r)+e+t.namespaceRoot).replace(/\\/g,`/`)}return t.i18n,t}prepareStatic(e,t){let n=Re(e),r=``;t.input.startsWith(`/`)||(r=`/`),t.input.endsWith(`*`)&&(t.input=t.input.slice(0,-1)),t.input.endsWith(`/`)&&(t.input=t.input.slice(0,-1)),t.inputPathFolder=(0,f.normalize)(D(n)+r+t.input),t.inputPathFolder=t.inputPathFolder.replace(/\\/g,`/`),r=``,Array.isArray(t.output)||(t.output=[t.output]),t.outputPathFolder=[];for(let e of t.output)e=this.replaceEnvVar(e,n),e.endsWith(`*`)&&(e=e.slice(0,-1)),e.endsWith(`/`)&&(e=e.slice(0,-1)),e=e.replace(/\\/g,`/`),t.outputPathFolder.push(e);return t}defaultConfigValue(){return{module:``,hideWarnings:T.getInstance().settings.defaultHideWarnings,version:`1.0.0`,componentPrefix:``,tags:[],dependencies:{},build:[],static:[],avoidParsingInsideTags:[],aliases:{},namespaceRules:{},namespaceRulesRegex:{},namespaceStrategy:`manual`,namespaceRoot:`./`}}defaultConfigBuildValue(e){return{fullname:``,name:``,tags:e.tags,version:e.version,organization:e.organization,description:e.description,readme:e.readme,repository:e.repository,documentation:e.documentation,disabled:!1,hideWarnings:e.hideWarnings,src:[],srcPath:[],stories:void 0,compile:[],srcPathRegex:RegExp(`(?!)`),outsideModule:[],outsideModulePathRegex:RegExp(`(?!)`),module:e.module,componentPrefix:e.componentPrefix,namespaceStrategy:e.namespaceStrategy,namespaceRules:{...e.namespaceRules},namespaceRulesRegex:{...e.namespaceRulesRegex},namespaceRoot:e.namespaceRoot,dependencies:{...e.dependencies},rawDependencies:{},avoidParsingInsideTags:[...e.avoidParsingInsideTags],nodeModulesDir:``}}defaultConfigBuildStories(e,t){return{output:e+`/stories`,format:`all`}}defaultConfigBuildDependencyValue(e){return{}}removeComments(e){return e=e.replace(/(\".*?\"|\'.*?\')|(\/\*.*?\*\/|\/\/[^(\r\n|\n)]*$)/gm,(e,t,n)=>{if(n){let e=``;for(let t=0;t<n.length;t++)e+=` `;return e}return t}),e}},ct=class{_file;_build;get file(){return this._file}get build(){if(this._build)return this._build;throw`No build found`}constructor(e,t){this._file=e,this._build=t,this.addEvents()}uuidEvents={onCanContentChange:``,onContentChange:``,onValidate:``,onSave:``,onDelete:``,onCompletion:``,onCompletionResolve:``,onHover:``,onDefinition:``,onFormatting:``,onCodeAction:``,onReferences:``,onCodeLens:``,onGetBuild:``,onRename:``};addEvents(){this.uuidEvents.onCanContentChange=this.file.onCanContentChange(this.onCanContentChange.bind(this)),this.uuidEvents.onContentChange=this.file.onContentChange(this.onContentChange.bind(this)),this.uuidEvents.onValidate=this.file.onValidate(this._onValidate.bind(this)),this.uuidEvents.onSave=this.file.onSave(this.onSave.bind(this)),this.uuidEvents.onDelete=this.file.onDelete(this._onDelete.bind(this)),this.uuidEvents.onCompletion=this.file.onCompletion(this.onCompletion.bind(this)),this.uuidEvents.onCompletionResolve=this.file.onCompletionResolve(this.onCompletionResolve.bind(this)),this.uuidEvents.onHover=this.file.onHover(this.onHover.bind(this)),this.uuidEvents.onDefinition=this.file.onDefinition(this.onDefinition.bind(this)),this.uuidEvents.onFormatting=this.file.onFormatting(this.onFormatting.bind(this)),this.uuidEvents.onCodeAction=this.file.onCodeAction(this.onCodeAction.bind(this)),this.uuidEvents.onReferences=this.file.onReferences(this.onReferences.bind(this)),this.uuidEvents.onCodeLens=this.file.onCodeLens(this.onCodeLens.bind(this)),this.uuidEvents.onGetBuild=this.file.onGetBuild(this.onGetBuild.bind(this)),this.uuidEvents.onRename=this.file.onRename(this.onRename.bind(this))}removeEvents(){this.file.removeOnCanContentChange(this.uuidEvents.onCanContentChange),this.file.removeOnContentChange(this.uuidEvents.onContentChange),this.file.removeOnValidate(this.uuidEvents.onValidate),this.file.removeOnSave(this.uuidEvents.onSave),this.file.removeOnDelete(this.uuidEvents.onDelete),this.file.removeOnCompletion(this.uuidEvents.onCompletion),this.file.removeOnCompletionResolve(this.uuidEvents.onCompletionResolve),this.file.removeOnHover(this.uuidEvents.onHover),this.file.removeOnDefinition(this.uuidEvents.onDefinition),this.file.removeOnFormatting(this.uuidEvents.onFormatting),this.file.removeOnCodeAction(this.uuidEvents.onCodeAction),this.file.removeOnReferences(this.uuidEvents.onReferences),this.file.removeOnCodeLens(this.uuidEvents.onCodeLens),this.file.removeOnGetBuild(this.uuidEvents.onGetBuild),this.file.removeOnRename(this.uuidEvents.onRename)}async validate(){this.file instanceof A&&await this.file.validate()}async triggerSave(){this.file instanceof A&&await this.file.triggerSave()}async triggerDelete(){this.file instanceof A&&await this.file.triggerDelete()}async triggerContentChange(e){this.file instanceof A&&await this.file.triggerContentChange(e)}onCanContentChange(e){return this._file.versionUser!=e.version}oldResult=[];async _onValidate(){let e=this._build?.diagnostics.get(this)??[];return e=[...e,...await this.onValidate()],this._build&&this.build.hideWarnings&&(e=e.filter(e=>e.severity!=m.DiagnosticSeverity.Warning)),this.oldResult=e,e}async _onDelete(){await this.onDelete(),this.removeEvents()}},lt=o(((e,t)=>{var n=require("stream");e=t.exports=r,r.through=r;function r(e,t,r){e||=function(e){this.queue(e)},t||=function(){this.queue(null)};var i=!1,a=!1,o=[],s=!1,c=new n;c.readable=c.writable=!0,c.paused=!1,c.autoDestroy=!(r&&r.autoDestroy===!1),c.write=function(t){return e.call(this,t),!c.paused};function l(){for(;o.length&&!c.paused;){var e=o.shift();if(e===null)return c.emit(`end`);c.emit(`data`,e)}}c.queue=c.push=function(e){return s?c:(e===null&&(s=!0),o.push(e),l(),c)},c.on(`end`,function(){c.readable=!1,!c.writable&&c.autoDestroy&&process.nextTick(function(){c.destroy()})});function u(){c.writable=!1,t.call(c),!c.readable&&c.autoDestroy&&c.destroy()}return c.end=function(e){if(!i)return i=!0,arguments.length&&c.write(e),u(),c},c.destroy=function(){if(!a)return a=!0,i=!0,o.length=0,c.writable=c.readable=!1,c.emit(`close`),c},c.pause=function(){if(!c.paused)return c.paused=!0,c},c.resume=function(){return c.paused&&(c.paused=!1,c.emit(`resume`)),l(),c.paused||c.emit(`drain`),c},c}})),ut=o(((e,t)=>{var n=require("stream");t.exports=function e(t){if(Array.isArray(t)){var r=0,i=t.length;return e(function(e){return r<i?this.emit(`data`,t[r++]):this.emit(`end`),!0})}var a=new n,o=0;a.ended=!1,a.started=!1,a.readable=!0,a.writable=!1,a.paused=!1,a.ended=!1,a.pause=function(){a.started=!0,a.paused=!0};function s(){if(a.started=!0,!a.ended)for(;!a.ended&&!a.paused&&t.call(a,o++,function(){!a.ended&&!a.paused&&process.nextTick(s)}););}return a.resume=function(){a.started=!0,a.paused=!1,s()},a.on(`end`,function(){a.ended=!0,a.readable=!1,process.nextTick(a.destroy)}),a.destroy=function(){a.ended=!0,a.emit(`close`)},process.nextTick(function(){a.started||a.resume()}),a}})),dt=o(((e,t)=>{var n=require("stream"),r=[`write`,`end`,`destroy`],i=[`resume`,`pause`],a=[`data`,`close`],o=Array.prototype.slice;t.exports=c;function s(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n)}function c(e,t){var c=new n,l=!1;return s(r,u),s(i,d),s(a,f),t.on(`end`,p),e.on(`drain`,function(){c.emit(`drain`)}),e.on(`error`,m),t.on(`error`,m),c.writable=e.writable,c.readable=t.readable,c;function u(t){c[t]=n;function n(){return e[t].apply(e,arguments)}}function d(e){c[e]=n;function n(){c.emit(e);var n=t[e];if(n)return n.apply(t,arguments);t.emit(e)}}function f(e){t.on(e,n);function n(){var t=o.call(arguments);t.unshift(e),c.emit.apply(c,t)}}function p(){if(!l){l=!0;var e=o.call(arguments);e.unshift(`end`),c.emit.apply(c,e)}}function m(e){c.emit(`error`,e)}}})),ft=o(((e,t)=>{var n=require("stream").Stream;t.exports=function(e,t){var r=new n,i=0,a=0,o=!1,s=!1,c=!1,l=0,u=!1;t||={};var d=t.failures?`failure`:`error`,f={};r.writable=!0,r.readable=!0;function p(e,t){var n=l+1;if(t===n?(e!==void 0&&r.emit.apply(r,[`data`,e]),l++,n++):f[t]=e,f.hasOwnProperty(n)){var c=f[n];return delete f[n],p(c,n)}a++,i===a&&(s&&(s=!1,r.emit(`drain`)),o&&g())}function m(e,n,i){c||(u=!0,(!e||t.failures)&&p(n,i),e&&r.emit.apply(r,[d,e]),u=!1)}function h(t,n,r){return e.call(null,t,function(e,t){r(e,t,n)})}r.write=function(e){if(o)throw Error(`map stream is not writable`);u=!1,i++;try{return s=h(e,i,m)===!1,!s}catch(e){if(u)throw e;return m(e),!s}};function g(e){if(o=!0,r.writable=!1,e!==void 0)return p(e,i);i==a&&(r.readable=!1,r.emit(`end`),r.destroy())}return r.end=function(e){o||g(e)},r.destroy=function(){o=c=!0,r.writable=r.readable=s=!1,process.nextTick(function(){r.emit(`close`)})},r.pause=function(){s=!0},r.resume=function(){s=!1},r}})),pt=o(((e,t)=>{t.exports=lt()})),mt=o(((e,t)=>{var n=lt(),r=require("string_decoder").StringDecoder;t.exports=i;function i(e,t,i){var a=new r,o=``,s=i&&i.maxLength,c=!(i&&i.trailing===!1);typeof e==`function`&&(t=e,e=null),e||=/\r?\n/;function l(e,n){if(t){try{n=t(n)}catch(t){return e.emit(`error`,t)}n!==void 0&&e.queue(n)}else e.queue(n)}function u(t,n){var r=((o??``)+n).split(e);if(o=r.pop(),s&&o.length>s)return t.emit(`error`,Error(`maximum buffer reached`));for(var i=0;i<r.length;i++){var a=r[i];l(t,a)}}return n(function(e){u(this,a.write(e))},function(){a.end&&u(this,a.end()),c&&o!=null&&l(this,o),this.queue(null)})}})),ht=o(((e,t)=>{var n=dt(),r=lt();t.exports=function(){var e=arguments.length==1&&Array.isArray(arguments[0])?arguments[0]:[].slice.call(arguments);if(e.length==0)return r();if(e.length==1)return e[0];var t=e[0],i=e[e.length-1],a=n(t,i);function o(e){e.length<2||(e[0].pipe(e[1]),o(e.slice(1)))}o(e);function s(){var e=[].slice.call(arguments);e.unshift(`error`),a.emit.apply(a,e)}for(var c=1;c<e.length-1;c++)e[c].on(`error`,s);return a}})),gt=o((e=>{var t=require("stream").Stream,n=e,r=lt(),i=ut(),a=dt(),o=ft(),s=pt(),c=mt(),l=ht(),u=global.setImmediate||process.nextTick;n.Stream=t,n.through=r,n.from=i,n.duplex=a,n.map=o,n.pause=s,n.split=c,n.pipeline=n.connect=n.pipe=l,n.concat=n.merge=function(){var e=[].slice.call(arguments);e.length===1&&e[0]instanceof Array&&(e=e[0]);var n=new t;n.setMaxListeners(0);var r=0;return n.writable=n.readable=!0,e.length?e.forEach(function(t){t.pipe(n,{end:!1});var i=!1;t.on(`end`,function(){i||(i=!0,r++,r==e.length&&n.emit(`end`))})}):process.nextTick(function(){n.emit(`end`)}),n.write=function(e){this.emit(`data`,e)},n.destroy=function(){e.forEach(function(e){e.destroy&&e.destroy()})},n},n.collect=n.writeArray=function(e){if(typeof e!=`function`)throw Error(`function writeArray (done): done must be function`);var n=new t,r=[],i=!1;return n.write=function(e){r.push(e)},n.end=function(){i=!0,e(null,r)},n.writable=!0,n.readable=!1,n.destroy=function(){n.writable=n.readable=!1,!i&&e(Error(`destroyed before end`),r)},n},n.readArray=function(e){var n=new t,r=0,i=!1,a=!1;if(n.readable=!0,n.writable=!1,!Array.isArray(e))throw Error(`event-stream.read expects an array`);return n.resume=function(){if(!a){i=!1;for(var t=e.length;r<t&&!i&&!a;)n.emit(`data`,e[r++]);r==t&&!a&&(a=!0,n.readable=!1,n.emit(`end`))}},process.nextTick(n.resume),n.pause=function(){i=!0},n.destroy=function(){a=!0,n.emit(`close`)},n},n.readable=function(e,n){var r=new t,i=0,a=!1,o=!1,s=!1;if(r.readable=!0,r.writable=!1,typeof e!=`function`)throw Error(`event-stream.readable expects async function`);r.on(`end`,function(){o=!0});function c(t,l){t?(r.emit(`error`,t),n||r.emit(`end`)):arguments.length>1&&r.emit(`data`,l),u(function(){if(!(o||a||s))try{s=!0,e.call(r,i++,function(){s=!1,c.apply(null,arguments)})}catch(e){r.emit(`error`,e)}})}return r.resume=function(){a=!1,c()},process.nextTick(c),r.pause=function(){a=!0},r.destroy=function(){r.emit(`end`),r.emit(`close`),o=!0},r},n.mapSync=function(e){return n.through(function(t){var n;try{n=e(t)}catch(e){return this.emit(`error`,e)}n!==void 0&&this.emit(`data`,n)})},n.filterSync=function(e){return n.through(function(t){var n=this;e(t)&&n.queue(t)})},n.flatmapSync=function(e){return n.through(function(t){var n=this;t.forEach(function(t){n.queue(e(t))})})},n.log=function(e){return n.through(function(t){[].slice.call(arguments),e?console.error(e,t):console.error(t),this.emit(`data`,t)})},n.child=function(e){return n.duplex(e.stdin,e.stdout)},n.parse=function(e){var t=!!(e&&e.error);return n.through(function(e){var n;try{e&&(n=JSON.parse(e.toString()))}catch(n){return t?this.emit(`error`,n):console.error(n,`attempting to parse:`,e)}n!==void 0&&this.emit(`data`,n)})},n.stringify=function(){var e=require("buffer").Buffer;return n.mapSync(function(t){return JSON.stringify(e.isBuffer(t)?t.toString():t)+`
|
|
7
|
+
`)}}function Re(e){let t=e.split(`/`);return t.pop(),t.join(`/`)}function ze(e,t){if(t.start===void 0){let t=e.positionAt(0);return m.Range.create(t,t)}let n=e.positionAt(t.start),r=e.positionAt(t.start+(t.length||0));return m.Range.create(n,r)}function Be(e,t){if(!t)return e;let n=t.aliases;for(let t in n)if(!t.startsWith(`@`)){let r=Ve(t),i=RegExp(`(?<!\\\\)`+r,`g`);e=e.replace(i,n[t])}return e}function Ve(e,t=!1){return t?e.replace(/[\\^$+?.()|[\]{}]/g,`\\$&`):e.replace(/[\\^$*+?.()|[\]{}]/g,`\\$&`)}function He(e){return e===13||e===10}const Ue=/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g;function We(e,t){let n=Ue,r=t;for(;r>0&&!He(e.charCodeAt(r-1));)r--;let i=t-r,a=e.substr(r),o=n.ignoreCase?`gi`:`g`;n=new RegExp(n.source,o);let s=n.exec(a);for(;s&&s.index+s[0].length<i;)s=n.exec(a);return s&&s.index<=i?{start:s.index+r,length:s[0].length}:{start:t,length:0}}function Ge(e,t){e=decodeURIComponent(e),t=decodeURIComponent(t);let n=t.split(`/`);n.pop();let r=e.split(`/`);for(let e=0;e<n.length;e++)if(r.length>e)if(n[e]==r[e])n.splice(e,1),r.splice(e,1),e--;else break;let i=``;for(let e=0;e<n.length;e++)i+=`../`;return i==``&&(i+=`./`),i+=r.join(`/`),i}function Ke(e,t,n){e=e.replace(/\[(.*?)\]/g,`.$1`);let r=e=>t instanceof Map?t.get(e):t[e],i=e.split(`.`);for(let e=0;e<i.length-1;e++){let n=i[e],a=r(n);a||=(t[n]={},t[n]),t=a}t instanceof Map?t.set(i[i.length-1],n):t[i[i.length-1]]=n}const qe={};function Je(e,t,n,r){t=t.replace(/\r\n/g,`
|
|
8
|
+
`);let i=Ye(t),a=(0,f.dirname)(e);(0,u.existsSync)(a)||(0,u.mkdirSync)(a,{recursive:!0});let o=(0,u.existsSync)(e);(!qe[e]||qe[e]!=i||!o)&&(qe[e]=i,Ce.sendFileSize(e,t,n,r),(0,u.writeFileSync)(e,t))}function Ye(e){return(0,_.createHash)(`md5`).update(e).digest(`hex`)}var Xe=class{static timers={};static start(e){this.timers[e]=process.hrtime()}static stop(e){let t=process.hrtime(this.timers[e]),n=t[1]/1e6;return delete this.timers[e],t[0]*1e3+Math.round(n)}static stopNano(e){let t=process.hrtime(this.timers[e]);return delete this.timers[e],t[0]*1e9+t[1]}};const Ze=new Uint8Array(16);function Qe(){return crypto.getRandomValues(Ze)}const $e=[];for(let e=0;e<256;++e)$e.push((e+256).toString(16).slice(1));function et(e,t=0){return($e[e[t+0]]+$e[e[t+1]]+$e[e[t+2]]+$e[e[t+3]]+`-`+$e[e[t+4]]+$e[e[t+5]]+`-`+$e[e[t+6]]+$e[e[t+7]]+`-`+$e[e[t+8]]+$e[e[t+9]]+`-`+$e[e[t+10]]+$e[e[t+11]]+$e[e[t+12]]+$e[e[t+13]]+$e[e[t+14]]+$e[e[t+15]]).toLowerCase()}function k(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():tt(e,t,n)}function tt(e,t,n){e||={};let r=e.random??e.rng?.()??Qe();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return et(r)}var A=class{_documentUser;_documentInternal;get documentUser(){return this._documentUser}get documentInternal(){return this._documentInternal}linkInternalAndUser=!0;setDocumentInternal(e){this._documentInternal=e,this._versionInternal=e.version}constructor(e){this._documentUser=e,this._documentInternal=e,this._versionUser=e.version,this._versionInternal=e.version}get uri(){return this.documentUser.uri}get path(){return D(this.uri)}get name(){return this.path.split(`/`).pop()??``}_versionUser=0;get versionUser(){return this._versionUser}_versionInternal=0;get versionInternal(){return this._versionInternal}get contentUser(){return this.documentUser.getText()}get contentInternal(){return this.documentInternal.getText()}get folderUri(){return Re(this.uri)}get folderPath(){return Re(this.path)}_shortname=``;get shortname(){if(!this._shortname){let e=this.uri.split(`/`);this._shortname=e[e.length-1]}return this._shortname}onGetBuildCb={};getBuild(){let e=[],t=!1;for(let n in this.onGetBuildCb){let r=this.onGetBuildCb[n]();if(r===null)t=!0;else for(let t of r)e.indexOf(t)==-1&&e.push(t)}return e.length==0&&t?null:e}onGetBuild(e){let t=k();for(;this.onGetBuildCb[t]!=null;)t=k();return this.onGetBuildCb[t]=e,t}removeOnGetBuild(e){delete this.onGetBuildCb[e]}onValidateCb={};async validate(e=!0){let t={};for(let e in this.onValidateCb){let n=await this.onValidateCb[e](this);for(let e of n){let n=e.message+`**`+e.range.start.line+`:`+e.range.start.character+`,`+e.range.end.line+`:`+e.range.end.character;t[n]||(t[n]=e)}}if(e)if(T.getInstance().settings.errorByBuild){let e=this.getBuild();if(e==null)$.sendDiagnostics({uri:this.uri,diagnostics:Object.values(t)});else for(let n of e)$.sendDiagnostics({uri:this.uri,diagnostics:Object.values(t)},n)}else $.sendDiagnostics({uri:this.uri,diagnostics:Object.values(t)});return Object.values(t)}onValidate(e){let t=k();for(;this.onValidateCb[t]!=null;)t=k();return this.onValidateCb[t]=e,t}removeOnValidate(e){delete this.onValidateCb[e]}onContentChangeCb={};delayValidate;waitingDocContentChange={};resolveContentChange={};triggerContentChange(e){return new Promise(t=>{if(!this.triggerCanContentChange(e)){t();return}setTimeout(()=>{this.waitingDocContentChange[e.uri]?(this.resolveContentChange[e.uri]||(this.resolveContentChange[e.uri]={}),this.resolveContentChange[e.uri][e.version]||(this.resolveContentChange[e.uri][e.version]=[]),this.resolveContentChange[e.uri][e.version].push(t),this.waitingDocContentChange[e.uri]=e):(this.waitingDocContentChange[e.uri]=!0,this.resolveContentChange[e.uri]={[e.version]:[t]},this.triggerContentChangeNoBuffer(e))},0)})}async triggerContentChangeNoBuffer(e){let t=e.version;this._documentUser=e,this._versionUser=e.version,this.linkInternalAndUser&&(this._documentInternal=e,this._versionInternal=e.version);let n=[];for(let e in this.onContentChangeCb)n.push(this.onContentChangeCb[e](this));if(await Promise.all(n),this.delayValidate&&clearTimeout(this.delayValidate),this.delayValidate=setTimeout(async()=>{this.validate()},500),this.resolveContentChange[e.uri]){let n=Object.keys(this.resolveContentChange[e.uri]);for(let r of n){if(Number(r)>t)break;if(this.resolveContentChange[e.uri][r]){for(let t of this.resolveContentChange[e.uri][r])t();delete this.resolveContentChange[e.uri][r]}}Object.keys(this.resolveContentChange[e.uri]).length==0&&delete this.resolveContentChange[e.uri]}let r=this.waitingDocContentChange[e.uri];r&&typeof r!=`boolean`?(this.waitingDocContentChange[e.uri]=!0,this.triggerContentChangeNoBuffer(r)):delete this.waitingDocContentChange[e.uri]}onContentChange(e){let t=k();for(;this.onContentChangeCb[t]!=null;)t=k();return this.onContentChangeCb[t]=e,t}removeOnContentChange(e){delete this.onContentChangeCb[e]}onCanContentChangeCb={};triggerCanContentChange(e){for(let t in this.onCanContentChangeCb)if(!this.onCanContentChangeCb[t](e))return!1;return!0}onCanContentChange(e){let t=k();for(;this.onCanContentChangeCb[t]!=null;)t=k();return this.onCanContentChangeCb[t]=e,t}removeOnCanContentChange(e){delete this.onCanContentChangeCb[e]}async applyTextEdits(e){let t=this.contentUser;e.sort((e,t)=>this.documentUser.offsetAt(t.range.end)-this.documentUser.offsetAt(e.range.end));for(let n of e){let e=this.documentUser.offsetAt(n.range.start),r=this.documentUser.offsetAt(n.range.end);t=t.slice(0,e)+n.newText+t.slice(r,t.length)}let n=d.TextDocument.create(this.uri,C.TypeScript,this.documentUser.version+1,t);await this.triggerContentChange(n)}onSaveCb={};async triggerSave(){for(let e in this.onSaveCb)await this.onSaveCb[e](this)}onSave(e){let t=k();for(;this.onSaveCb[t]!=null;)t=k();return this.onSaveCb[t]=e,t}removeOnSave(e){delete this.onSaveCb[e]}onDeleteCb={};async triggerDelete(){let e=[];for(let t in this.onDeleteCb)e.push(this.onDeleteCb[t](this));await Promise.all(e),this.removeAllCallbacks()}removeAllCallbacks(){this.onCodeActionCb={},this.onCompletionCb={},this.onCompletionResolveCb={},this.onContentChangeCb={},this.onDefinitionCb={},this.onDeleteCb={},this.onFormattingCb={},this.onHoverCb={},this.onSaveCb={}}onDelete(e){let t=k();for(;this.onDeleteCb[t]!=null;)t=k();return this.onDeleteCb[t]=e,t}removeOnDelete(e){delete this.onDeleteCb[e]}onCompletionCb={};async getCompletion(e){let t={isIncomplete:!1,items:[]},n=[];for(let t in this.onCompletionCb)n.push(this.onCompletionCb[t](this,e));let r=await Promise.all(n),i={};for(let e of r)for(let t of e.items){let e=JSON.stringify(t);i[e]||(i[e]=t)}return t.items=Object.values(i),t}onCompletion(e){let t=k();for(;this.onCompletionCb[t]!=null;)t=k();return this.onCompletionCb[t]=e,t}removeOnCompletion(e){delete this.onCompletionCb[e]}onCompletionResolveCb={};async getCompletionResolve(e){let t=e,n=[];for(let t in this.onCompletionResolveCb)n.push(this.onCompletionResolveCb[t](this,e));return t}onCompletionResolve(e){let t=k();for(;this.onCompletionResolveCb[t]!=null;)t=k();return this.onCompletionResolveCb[t]=e,t}removeOnCompletionResolve(e){delete this.onCompletionResolveCb[e]}onHoverCb={};async getHover(e){let t=[];for(let n in this.onHoverCb)t.push(this.onHoverCb[n](this,e));let n=await Promise.all(t);for(let e of n)if(e)return e;return null}onHover(e){let t=k();for(;this.onHoverCb[t]!=null;)t=k();return this.onHoverCb[t]=e,t}removeOnHover(e){delete this.onHoverCb[e]}onDefinitionCb={};async getDefinition(e){let t=[];for(let n in this.onDefinitionCb)t.push(this.onDefinitionCb[n](this,e));let n=await Promise.all(t);for(let e of n)if(e)return e;return null}onDefinition(e){let t=k();for(;this.onDefinitionCb[t]!=null;)t=k();return this.onDefinitionCb[t]=e,t}removeOnDefinition(e){delete this.onDefinitionCb[e]}onFormattingCb={};async getFormatting(e){e||={insertSpaces:!0,tabSize:4};let t={},n=[],r={start:this.documentUser.positionAt(0),end:this.documentUser.positionAt(this.documentUser.getText().length)};for(let t in this.onFormattingCb)n.push(this.onFormattingCb[t](this,r,e));let i=await Promise.all(n);for(let e of i)for(let n of e){let e=JSON.stringify(n);t[e]||(t[e]=n)}return Object.values(t)}onFormatting(e){let t=k();for(;this.onFormattingCb[t]!=null;)t=k();return this.onFormattingCb[t]=e,t}removeOnFormatting(e){delete this.onFormattingCb[e]}onCodeActionCb={};async getCodeAction(e){let t=[],n=[];for(let t in this.onCodeActionCb)n.push(this.onCodeActionCb[t](this,e));let r=await Promise.all(n);for(let e of r)t=[...t,...e];return t}onCodeAction(e){let t=k();for(;this.onCodeActionCb[t]!=null;)t=k();return this.onCodeActionCb[t]=e,t}removeOnCodeAction(e){delete this.onCodeActionCb[e]}onReferencesCb={};async getReferences(e){let t=[],n=[];for(let t in this.onReferencesCb)n.push(this.onReferencesCb[t](this,e));let r=await Promise.all(n);for(let e of r)t=[...t,...e];return t}onReferences(e){let t=k();for(;this.onReferencesCb[t]!=null;)t=k();return this.onReferencesCb[t]=e,t}removeOnReferences(e){delete this.onReferencesCb[e]}onCodeLensCb={};async getCodeLens(){let e=[],t=[];for(let e in this.onCodeLensCb)t.push(this.onCodeLensCb[e](this));let n=await Promise.all(t);for(let t of n)e=[...e,...t];return e}onCodeLens(e){let t=k();for(;this.onCodeLensCb[t]!=null;)t=k();return this.onCodeLensCb[t]=e,t}removeOnCodeLens(e){delete this.onCodeLensCb[e]}onRenameCb={};async getRename(e,t){let n=[];for(let r in this.onRenameCb)n.push(this.onRenameCb[r](this,e,t));let r=await Promise.all(n);for(let e of r)if(e)return e;return null}onRename(e){let t=k();for(;this.onRenameCb[t]!=null;)t=k();return this.onRenameCb[t]=e,t}removeOnRename(e){delete this.onRenameCb[e]}},nt=class e{static isInit=!1;static send(e){$.sendNotification(`aventus/initStep`,e)}static sendDone(){$.sendNotification(`aventus/initStep`,`Aventus : Done`),e.isInit=!0}},rt=class e{static instance;static getInstance(){return this.instance||=new e,this.instance}watcher;constructor(){T.getInstance().settings.watchFiles&&(this.watcher=(0,v.watch)(` `,{ignored:/(^|[\/\\])\../,persistent:!0}),this.watcher.on(`add`,this.onContentChange.bind(this)).on(`change`,this.onContentChange.bind(this)).on(`unlink`,this.onRemove.bind(this)))}watcheUris=[];watch(e){if(this.watcheUris.includes(e)||!this.watcher)return;this.watcheUris.push(e);let t=D(e);this.watcher.add(t)}unwatch(e){let t=this.watcheUris.indexOf(e);t!=-1&&this.watcheUris.splice(t,1)}async onContentChange(e){$.debug(`onContentChange : `+e);let t=E(e);this.watcheUris.includes(t)&&R.getInstance().onUpdatedUri(t)}async onRemove(e){let t=E(e);this.watcheUris.includes(t)&&R.getInstance().onDeletedUri(t)}async destroy(){await this.watcher?.close(),e.instance=void 0}};const it={$schema:`foo://aventus/conf.json`,title:`JSON Schema for Aventus`,description:`JSON Schema for Aventus`,type:`object`,additionalProperties:!1,properties:{module:{type:`string`,pattern:`^[a-zA-Z0-9_]+$`,description:`Name of the exported module`},version:{type:`string`,pattern:`^[0-9]+.[0-9]+.[0-9]+$`,description:`Version for all your builds (x.x.x)`},description:{type:`string`,description:`Description of the package`},documentation:{type:`string`,description:`Documentation link for the package`},repository:{type:`string`,description:`Repository link for the package`},tags:{type:`array`,description:`Tags for the package`,items:{type:`string`}},organization:{type:`string`,description:`Name of the organization`,pattern:`^[a-zA-Z0-9_@]+$`},readme:{type:`string`,description:`Path to the readme. By default, Aventus check Readme in the same folder as the configuration`},hideWarnings:{type:`boolean`,description:`Hide warnings for all your builds`},componentPrefix:{type:`string`,description:`Identifier to prefix all your components (in lower case)`,pattern:`^[a-z-]{2,}$`},dependencies:{$ref:`#/$defs/dependencies`},namespaceStrategy:{type:`string`,enum:[`manual`,`followFolders`,`followFoldersCamelCase`,`rules`],description:`Stragety to generate namespace`,default:`manual`},namespaceRules:{type:`object`,description:`Rules to define namespace when namespaceStrategy is rules`},namespaceRoot:{type:`string`,description:`Root directory to define namespace when namespaceStrategy is followFolders`},build:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,description:"Part name for the module. The export file will be ${module}@${name}",pattern:`^[a-zA-Z0-9_]+$`},description:{type:`string`,description:`Description of the package`},tags:{type:`array`,description:`Tags for the package`,items:{type:`string`}},documentation:{type:`string`,description:`Documentation link for the package`},repository:{type:`string`,description:`Repository link for the package`},organization:{type:`string`,description:`Name of the organization`,pattern:`^[a-zA-Z0-9_@]+$`},readme:{type:`string`,description:`Path to the readme. By default, Aventus check Readme in the same folder as the configuration`},version:{type:`string`,pattern:`^[0-9]+.[0-9]+.[0-9]+$`,description:`Version for this build (x.x.x)`},disabled:{type:`boolean`,description:`Disable auto-build`,default:!0},hideWarnings:{type:`boolean`,description:`Hide warnings for this build`},componentPrefix:{type:`string`,description:`Identifier to prefix all your components (in lower case)`,pattern:`^[a-z-]{2,}$`},src:{type:`array`,items:{type:`string`},description:`List of all pathes to listen watch`},stories:{type:`object`,additionalProperties:!1,properties:{output:{type:`string`,description:`Define where to export your stories`},workspace:{type:`string`,description:`Define where to add the .storybook`},live:{type:`boolean`,description:`Define if the story content must be recompiled on change`},format:{type:`string`,enum:[`all`,`public`,`protected`,`manual`],default:`all`,description:`All will export all elements, public only public elements, protected only public and protected elements, manual only elements with tag Storybook`},prefix:{type:`string`,description:`Define a prefix for all your stories name. Allow to group stories`},srcBaseUrl:{type:`string`,description:`Define a base url to link file to your repo`}}},outsideModule:{type:`array`,items:{type:`string`},description:`List of all pathes to import outside the module`},compile:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{input:{type:[`string`,`array`],items:{type:`string`},description:`List of all pathes to import inside this build`},output:{type:[`string`,`array`,`object`],description:`The script file generated path`,pattern:`^\\S+\\.js`,items:{type:[`string`,`object`],pattern:`^\\S+\\.js`,properties:{"@default":{$ref:`#/$defs/compileOutput`},"@npm":{$ref:`#/$defs/compileOutput`}},patternProperties:{"^\\S+$":{$ref:`#/$defs/compileOutput`}},required:[`@default`]},properties:{"@default":{$ref:`#/$defs/compileOutput`},"@npm":{$ref:`#/$defs/compileOutput`}},patternProperties:{"^\\S+$":{$ref:`#/$defs/compileOutput`}},required:[`@default`]},outputNpm:{type:[`string`,`array`,`object`],additionalProperties:!1,properties:{path:{type:[`string`,`array`]},packageJson:{type:`boolean`,description:`Define if you need to generate a package.json`},npmName:{type:`string`,description:`Define the name set inside your package.json`},manifest:{type:`boolean`,description:`Define if you need to generate manifest for your components`},live:{type:`boolean`,description:`Define if the npm content must be recompiled on change. Default is false`}},items:{type:`string`},description:`Define where to export as npm files`},compressed:{type:`boolean`},package:{type:[`string`,`array`],items:{type:`string`,pattern:`^\\S+\\.package\\.avt`},pattern:`^\\S+\\.package\\.avt`,description:`The package file generated path (for lib)`},i18n:{type:[`string`,`array`],items:{type:`object`,additionalProperties:!1,properties:{output:{type:[`string`,`array`],items:{type:`string`}},mount:{type:`string`},mode:{type:`string`,enum:[`singleFile`,`oneToOne`,`groupComponent`,`basedOnAttribute`,`include`],default:`singleFile`}},required:[`output`]}}}}},dependencies:{$ref:`#/$defs/dependencies`},module:{type:`string`,pattern:`^[a-zA-Z0-9_]+$`,description:`Name of the exported module for this build`},namespaceStrategy:{type:`string`,enum:[`manual`,`followFolders`,`followFoldersCamelCase`,`rules`],description:`Stragety to generate namespace`,default:`manual`},namespaceRules:{type:`object`,description:`Rules to define namespace when namespaceStrategy is rules`},namespaceRoot:{type:`string`,description:`Root directory to define namespace when namespaceStrategy is followFolders`},avoidParsingInsideTags:{type:`array`,items:{type:`string`,pattern:`^[a-z-]+$`},description:`List of html tag that mustn't be parsed by the html compiler`},nodeModulesDir:{type:[`string`,`array`],items:{type:`string`},description:`The dirs where node_modules are located`},i18n:{type:`object`,properties:{locales:{type:`array`,items:{type:`string`},description:`Locales that is required inside your project`},fallback:{type:`string`},autoRegister:{type:`boolean`}},description:`Define options for i18n`}},required:[`src`]},minItems:1},static:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,description:`Part name for the static export`,pattern:`^[a-zA-Z0-9_]+$`},input:{type:`string`,description:`Input path to watch to export as static files`},output:{type:[`string`,`array`],items:{type:`string`},description:`Define where to export static files`}},required:[`name`,`input`,`output`]}},avoidParsingInsideTags:{type:`array`,items:{type:`string`,pattern:`^[a-z-]+$`},description:`List of html tag that mustn't be parsed by the html compiler`},aliases:{type:`object`}},required:[`build`,`module`],$defs:{dependencies:{type:`object`,description:`List of dependencies for this build`,patternProperties:{"^\\S+$":{type:[`object`,`string`],additionalProperties:!1,pattern:`^[0-9x]+.[0-9x]+.[0-9x]+$`,properties:{uri:{type:`string`,description:`Where to find the package or the json file`},npm:{type:`string`,description:`The npm package name`},version:{type:`string`,pattern:`^[0-9x]+.[0-9x]+.[0-9x]+$`,description:`The version to use for this file. (default is x.x.x)`,default:`x.x.x`},isLocal:{type:`boolean`,description:`Define if you want to use a local package`},include:{type:`string`,description:`Determine if the package must be included inside the final export. (default is need)`,enum:[`none`,`need`,`full`],default:`need`},subDependenciesInclude:{type:`object`,description:`Inclusion pattern for each lib. You can use a star to select everythink. If nothink find for a lib, the need value ll be used`,patternProperties:{"^\\S+$":{type:`string`,enum:[`none`,`need`,`full`],default:`need`}}}}}}},compileOutput:{type:[`string`,`object`],pattern:`^\\S+\\.js`,additionalProperties:!1,properties:{path:{type:`string`,pattern:`^\\S+\\.js`},compressed:{type:`boolean`}}}}},at={$schema:`foo://aventus/sharp.json`,title:`JSON Schema for Aventus`,description:`JSON Schema for Aventus`,type:`object`,additionalProperties:!1,properties:{csProj:{type:`string`,pattern:`^\\S+\\.csproj`,description:`Path to your csproj file`},outputPath:{type:`string`,description:`Define the folder where to export the code`},exportEnumByDefault:{type:`boolean`,default:!1,description:`Define if enums must be exported. You can override behaviour with [Export] or [NoExport]`},exportStorableByDefault:{type:`boolean`,default:!0,description:`Define if storable must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpRouteByDefault:{type:`boolean`,default:!0,description:`Define if http route must be exported. You can override behaviour with [Export] or [NoExport]`},exportErrorsByDefault:{type:`boolean`,default:!0,description:`Define if errors must be exported. You can override behaviour with [Export] or [NoExport]`},exportWsEndPointByDefault:{type:`boolean`,default:!0,description:`Define if websocket endpoint must be exported. You can override behaviour with [Export] or [NoExport]`},exportWsEventByDefault:{type:`boolean`,default:!0,description:`Define if websocket event must be exported. You can override behaviour with [Export] or [NoExport]`},exportWsRouteByDefault:{type:`boolean`,default:!0,description:`Define if websocket route must be exported. You can override behaviour with [Export] or [NoExport]`},replacer:{type:`object`,additionalProperties:!1,description:`Create replacer to export type`,properties:{all:{$ref:`#/$defs/replacerPart`},genericError:{$ref:`#/$defs/replacerPart`},httpRouter:{$ref:`#/$defs/replacerPart`},normalClass:{$ref:`#/$defs/replacerPart`},storable:{$ref:`#/$defs/replacerPart`},withError:{$ref:`#/$defs/replacerPart`},wsEndPoint:{$ref:`#/$defs/replacerPart`},wsEvent:{$ref:`#/$defs/replacerPart`},wsRouter:{$ref:`#/$defs/replacerPart`}}},httpRouter:{type:`object`,additionalProperties:!1,properties:{useCompiledDll:{type:`boolean`,default:!0,description:"Try to parse route by running the app. You must use `app.UseAventusExport()` to prevent real starting."},createRouter:{type:`boolean`,default:!0,description:`Create a router that your route will use`},routerName:{type:`string`,default:`GeneratedRouter`,description:`The name of the router to generate`},uri:{type:`string`,default:``,pattern:`^(?=s*$)|^(\\/[a-zA-Z0-9_-]+?){1,}$`,description:`Define the base uri for your router (ex: /api)`},host:{type:`string`,default:`https://localhost:5000`,pattern:`^http(s)?:\\/\\/[a-zA-Z0-9_-]*?(:[0-9]{3,4})?$`,description:`Define the host that the router will use`},parent:{type:`string`,default:`Aventus.HttpRouter`,description:`Define the parent type to use for your router`},parentFile:{type:`string`,default:``,description:`Define the parent file to use for your router`},namespace:{type:`string`,default:`Routes`,description:`Define the namespace for your router`},addFormData:{type:`boolean`,default:!0,description:"Add ` | FormData` to the route body"},cacheByDefault:{type:`boolean`,default:!1,description:`Add cache to the function generated`},clearCacheFct:{type:`boolean`,default:!1,description:`Add function to clear cache to the function generated`}}},wsEndpoint:{type:`object`,additionalProperties:!1,properties:{useCompiledDll:{type:`boolean`,default:!0,description:"Try to parse route by running the app. You must use `app.UseAventusExport()` to prevent real starting."},prefix:{type:`string`,default:`Define a prefix for your websocket events`},host:{type:`string`,description:`The host to connect to the websocket`},port:{type:`number`,description:`The port to connect to the websocket`},useHttps:{type:`boolean`,description:`Define if you want to use http or https. Be default, Aventus will check if your connection is secure to use https or not`},parent:{type:`string`,default:`AventusSharp.WebSocket.EndPoint`,description:`Define the parent type to use for your router`}}}},required:[`csProj`,`outputPath`],$defs:{replacerPart:{type:`object`,additionalProperties:!1,properties:{type:{type:`object`,description:`Apply a replacer based on the c# type`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}},result:{type:`object`,description:`Apply a replacer based on the result type (ex: to replace Aventus.IData when IStorable is exported)`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}}}}}},ot={$schema:`foo://aventus/php.json`,title:`JSON Schema for Aventus`,description:`JSON Schema for Aventus`,type:`object`,additionalProperties:!1,properties:{output:{type:`string`,description:`Define the folder where to export the code`},exportAsTs:{type:`boolean`,description:`Define if the code must be compiled as typescript`},useNamespace:{type:`boolean`,description:`Define if the compiler must used namespace`},exportEnumByDefault:{type:`boolean`,default:!1,description:`Define if enums must be exported. You can override behaviour with [Export] or [NoExport]`},exportStorableByDefault:{type:`boolean`,default:!0,description:`Define if storable must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpRouteByDefault:{type:`boolean`,default:!0,description:`Define if http route must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpRequestByDefault:{type:`boolean`,default:!0,description:`Define if request must be exported. You can override behaviour with [Export] or [NoExport]`},exportHttpResourceByDefault:{type:`boolean`,default:!0,description:`Define if resource must be exported. You can override behaviour with [Export] or [NoExport]`},exportErrorsByDefault:{type:`boolean`,default:!0,description:`Define if erros must be exported. You can override behaviour with [Export] or [NoExport]`},replacer:{type:`object`,additionalProperties:!1,description:`Create replacer to export type`,properties:{all:{$ref:`#/$defs/replacerPart`},genericError:{$ref:`#/$defs/replacerPart`},httpRouter:{$ref:`#/$defs/replacerPart`},normalClass:{$ref:`#/$defs/replacerPart`},storable:{$ref:`#/$defs/replacerPart`},withError:{$ref:`#/$defs/replacerPart`},httpRequest:{$ref:`#/$defs/replacerPart`},httpResource:{$ref:`#/$defs/replacerPart`}}},httpRouter:{type:`object`,additionalProperties:!1,properties:{createRouter:{type:`boolean`,default:!0,description:`Create a router that your route will use`},routerName:{type:`string`,default:`GeneratedRouter`,description:`The name of the router to generate`},uri:{type:`string`,default:``,pattern:`^(?=s*$)|^(\\/[a-zA-Z0-9_-]+?){1,}$`,description:`Define the base uri for your router (ex: /api)`},host:{type:`string`,default:`https://localhost:5000`,pattern:`^http(s)?:\\/\\/[a-zA-Z0-9_-]*?(:[0-9]{3,4})?$`,description:`Define the host that the router will use`},parent:{type:`string`,default:`Aventus.HttpRouter`,description:`Define the parent type to use for your router`},parentFile:{type:`string`,default:``,description:`Define the parent file to load for your router`},namespace:{type:`string`,default:`Routes`,description:`Define the namespace for your router`}}}},required:[`output`],$defs:{replacerPart:{type:`object`,additionalProperties:!1,properties:{type:{type:`object`,description:`Apply a replacer based on the c# type`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}},result:{type:`object`,description:`Apply a replacer based on the result type (ex: to replace Aventus.IData when IStorable is exported)`,patternProperties:{"^\\S+$":{type:`object`,additionalProperties:!1,properties:{result:{type:`string`},file:{type:`string`},useTypeImport:{type:`boolean`}},required:[`result`]}}}}}}};var st=class e{static instance;static getInstance(){return this.instance||=new e,this.instance}languageService;constructor(){this.languageService=(0,y.getLanguageService)({schemaRequestService:async e=>JSON.stringify(it)}),this.languageService.configure({allowComments:!0,schemas:[{fileMatch:[`**`+w.Config],uri:it.$schema??``,schema:it},{fileMatch:[`**`+w.CsharpConfig],uri:at.$schema??``,schema:at},{fileMatch:[`**`+w.PhpConfig],uri:ot.$schema??``,schema:ot}]})}async format(e,t,n){let r=e.documentUser;return await this.languageService.format(r,t,n)}async doComplete(e,t){let n=e.documentUser,r=this.languageService.parseJSONDocument(n),i=await this.languageService.doComplete(e.documentUser,t,r),a=r.getNodeFromOffset(n.offsetAt(t));return this.isKeyOfObject(a,`dependencies`)&&(i||={isIncomplete:!1,items:[]},i?.items.push({label:`Aventus@Main`},{label:`Aventus@UI`},{label:`Aventus@I18n`},{label:`Aventus@Sharp`},{label:`Aventus@Php`})),i||{isIncomplete:!1,items:[]}}async doResolve(e){return await this.languageService.doResolve(e)}async doHover(e,t){let n=e.documentUser,r=this.languageService.parseJSONDocument(n);return await this.languageService.doHover(n,t,r)}async validate(e){let t=e.documentUser,n=this.languageService.parseJSONDocument(t),r=await this.languageService.doValidation(t,n);if(r.length==0){let e=this.removeComments(t.getText());try{return JSON.parse(e),r}catch{r.push(Ae(t,`Can't parse the json`,1001))}}for(let e of r)e.severity=m.DiagnosticSeverity.Error;return r}isKeyOfObject(e,t){let n=e?.parent;if(n?.type==`property`&&n.keyNode==e){let n=e?.parent?.parent?.parent;if(n?.type==`property`&&n.keyNode.value==t)return!0}return!1}isValueOfObject(e,t){let n=e?.parent;if(n?.type==`property`&&n.valueNode==e){let n=e?.parent?.parent?.parent;if(n?.type==`property`&&n.keyNode.value==t)return!0}return!1}async getConfig(e){let t=`documentUser`in e?e.documentUser:e,n=this.languageService.parseJSONDocument(t),r=await this.languageService.doValidation(t,n,void 0,it);if(r.length==0){let e=this.removeComments(t.getText());try{let n=JSON.parse(e);return n=this.prepareConfigFile(t.uri,n),n}catch{r.push(Ae(t,`Can't parse the json`,1001))}}return null}prepareConfigFile(e,t){if(t={...this.defaultConfigValue(),...t},t.componentPrefix==``){let e=t.module.match(/([A-Z][a-z]*)|([0-9][a-z]*)/g);e?t.componentPrefix=e.join(`-`).toLowerCase():t.componentPrefix=`av`}let n=[];for(let r of t.build)n.push(this.prepareBuild(e,r,t));if(t.build=n,t.static){let n=[];for(let r of t.static)n.push(this.prepareStatic(e,r));t.static=n}return t}replaceEnvVar(e,t){if(!e||e.startsWith(`@`)||e.startsWith(`Aventus@`))return e;let n=/%(.*?)%/gm,r;for(;r=n.exec(e);){let t=b.env[r[1]]??`undefined`;e=e.replace(r[0],t)}return/^https?:\/\/.*/.exec(e)||(!e.startsWith(`/`)&&!/^[a-zA-Z]:/gm.test(e)?(e=`/`+e,e=(0,f.normalize)(D(t)+e)):e=(0,f.normalize)(e)),e}prepareBuild(e,t,n){let r=Re(e);t={...this.defaultConfigBuildValue(n),...t},t.name?t.fullname=t.module+`@`+t.name:t.fullname=t.module;let i=e=>this.replaceEnvVar(e,r),a=t.compile;for(let e of a){if(!e.input)e.inputPathRegex=RegExp(`.*`);else{Array.isArray(e.input)||(e.input=[e.input]);let t=[];for(let n of e.input){let e=``;n=n.replace(/\\/g,`/`),n.startsWith(`/`)||(e=`/`);let i=n.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),n=i.join(`/`);let a=(0,f.normalize)(D(r)+e+n).replace(/\\/g,`/`);a=Ve(a,!0).replace(`*`,`.*`),t.push(`(^`+a+`$)`)}let n=t.join(`|`);n==``&&(n=`(?!)`),e.inputPathRegex=new RegExp(n)}if(!e.output)e.output=[];else{Array.isArray(e.output)||(e.output=[e.output]);for(let t=0;t<e.output.length;t++){let n=e.output[t];typeof n==`string`&&(e.output[t]={"@default":{path:n}},n=e.output[t]);let r=!1;for(let a in n){a==`@default`&&(r=!0);let o=n[a];typeof o==`string`&&(e.output[t][a]={path:o}),e.output[t][a].path=n[a].path.trim(),n[a].path.length>0&&(e.output[t][a].path=i(n[a].path))}r||(e.output[t][`@default`]={path:`./dist/script.js`})}}if(!e.outputNpm)e.outputNpm={path:[],packageJson:!1,npmName:``,live:!1};else{typeof e.outputNpm==`string`?e.outputNpm={path:[e.outputNpm],packageJson:!0,npmName:``,manifest:{},live:!1}:Array.isArray(e.outputNpm)&&(e.outputNpm={path:e.outputNpm,packageJson:!0,npmName:``,manifest:{},live:!1}),Array.isArray(e.outputNpm.path)||(e.outputNpm.path=[e.outputNpm.path]),e.outputNpm.packageJson===void 0&&(e.outputNpm.packageJson=!0),e.outputNpm.manifest===void 0&&(e.outputNpm.manifest={}),e.outputNpm.npmName===void 0&&(e.outputNpm.npmName=``),e.outputNpm.live===void 0&&(e.outputNpm.live=!1);for(let t=0;t<e.outputNpm.path.length;t++){let n=i(e.outputNpm.path[t]);n.endsWith(`*`)&&(n=n.slice(0,-1)),n.endsWith(`/`)&&(n=n.slice(0,-1)),n=n.replace(/\\/g,`/`),e.outputNpm.path[t]=n}}if(!e.package)e.package=[];else{Array.isArray(e.package)||(e.package=[e.package]);for(let t=0;t<e.package.length;t++)e.package[t]=e.package[t].trim(),e.package[t].length>0&&(e.package[t]=i(e.package[t]))}if(t.i18n)if(e.i18n){Array.isArray(e.i18n)||(e.i18n=[{output:[e.i18n],mount:``,mode:`singleFile`}]);for(let t=0;t<e.i18n.length;t++){if(!Array.isArray(e.i18n[t].output)){let n=e.i18n[t].output;e.i18n[t].output=[n]}for(let n=0;n<e.i18n[t].output.length;n++)e.i18n[t].output[n].endsWith(`/`)&&(e.i18n[t].output[n]=e.i18n[t].output[n].slice(0,-1)),e.i18n[t].output[n]=e.i18n[t].output[n].trim(),e.i18n[t].output[n].length>0&&(e.i18n[t].output[n]=i(e.i18n[t].output[n]));if(!e.i18n[t].mount&&e.i18n[t].output.length>0){let n=(0,f.normalize)(D($.getWorkspaceUri())),r=e.i18n[t].output[0].replace(n,``).replace(/\\/g,`/`);r.startsWith(`/dist`)&&(r=r.replace(`/dist`,``)),e.i18n[t].mount=r}e.i18n[t].mount.endsWith(`/`)&&(e.i18n[t].mount=e.i18n[t].mount.slice(0,-1))}}else{e.i18n=[];for(let t of e.output){let n=t[`@default`].path.split(f.sep);n.pop();let r=(0,f.join)(n.join(f.sep),`locales`),i=(0,f.normalize)(D($.getWorkspaceUri())),a=r.replace(i,``).replace(/\\/g,`/`);a.startsWith(`/dist`)&&(a=a.replace(`/dist`,``)),e.i18n.push({output:[r],mount:a,mode:`singleFile`})}}}let o=[];for(let e of t.src){let n=``;e=e.replace(/\\/g,`/`),e.startsWith(`/`)||(n=`/`);let i=e.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),e=i.join(`/`);let a=(0,f.normalize)(D(r)+n+e).replace(/\\/g,`/`),s=a.replace(`*`,``);s.endsWith(`/`)&&(s=s.slice(0,-1)),t.srcPath.push(s),a=Ve(a,!0).replace(`*`,`.*`),o.push(`(^`+a+`$)`)}if(t.stories){t.stories={...this.defaultConfigBuildStories(r,n),...t.stories};let e=i(t.stories.output);e.endsWith(`*`)&&(e=e.slice(0,-1)),e.endsWith(`/`)&&(e=e.slice(0,-1)),e=e.replace(/\\/g,`/`),t.stories.output=e}let s=o.join(`|`);s==``&&(s=`(?!)`),t.srcPathRegex=new RegExp(s),t.nodeModulesDir=t.nodeModulesDir.trim(),t.nodeModulesDir==``?t.nodeModulesDir=(0,f.normalize)(D(r)+`/node_modules`):t.nodeModulesDir=i(t.nodeModulesDir);let c={};t.rawDependencies=JSON.parse(JSON.stringify(t.dependencies));for(let e in t.dependencies){let n=t.dependencies[e];typeof n==`string`&&(n={version:n}),c[e]={...this.defaultConfigBuildDependencyValue(n),...n};let r=c[e];r.subDependenciesInclude||={},r.subDependenciesInclude[`*`]||(r.subDependenciesInclude[`*`]=n.include??`need`),r.uri&&=i(r.uri)}if(t.dependencies=c,t.outsideModule){let e=[];for(let n of t.outsideModule){let t=``;n=n.replace(/\\/g,`/`),n.startsWith(`/`)||(t=`/`);let i=n.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),n=i.join(`/`);let a=(0,f.normalize)(D(r)+t+n).replace(/\\/g,`/`);a=Ve(a,!0).replace(`*`,`.*`),e.push(`(^`+a+`$)`)}let n=e.join(`|`);n==``&&(n=`(?!)`),t.outsideModulePathRegex=new RegExp(n)}if(t.namespaceStrategy==`rules`)for(let e in t.namespaceRules){let n=[],i=t.namespaceRules[e];for(let e of i){let t=``;e=e.replace(/\\/g,`/`),e.startsWith(`/`)||(t=`/`);let i=e.split(`/`);i[i.length-1]==``||i[i.length-1]==`*`?i[i.length-1]=`*`:i[i.length-1].indexOf(`.`)==-1&&i.push(`*`),e=i.join(`/`);let a=(0,f.normalize)(D(r)+t+e).replace(/\\/g,`/`);a=Ve(a,!0).replace(`*`,`.*`),n.push(`(^`+a+`$)`)}let a=n.join(`|`);a==``&&(a=`(?!)`),t.namespaceRulesRegex[e]=new RegExp(a)}else if(t.namespaceStrategy==`followFolders`||t.namespaceStrategy==`followFoldersCamelCase`){let e=``;t.namespaceRoot.startsWith(`/`)||(e=`/`),t.namespaceRoot=(0,f.normalize)(D(r)+e+t.namespaceRoot).replace(/\\/g,`/`)}return t.i18n,t}prepareStatic(e,t){let n=Re(e),r=``;t.input.startsWith(`/`)||(r=`/`),t.input.endsWith(`*`)&&(t.input=t.input.slice(0,-1)),t.input.endsWith(`/`)&&(t.input=t.input.slice(0,-1)),t.inputPathFolder=(0,f.normalize)(D(n)+r+t.input),t.inputPathFolder=t.inputPathFolder.replace(/\\/g,`/`),r=``,Array.isArray(t.output)||(t.output=[t.output]),t.outputPathFolder=[];for(let e of t.output)e=this.replaceEnvVar(e,n),e.endsWith(`*`)&&(e=e.slice(0,-1)),e.endsWith(`/`)&&(e=e.slice(0,-1)),e=e.replace(/\\/g,`/`),t.outputPathFolder.push(e);return t}defaultConfigValue(){return{module:``,hideWarnings:T.getInstance().settings.defaultHideWarnings,version:`1.0.0`,componentPrefix:``,tags:[],dependencies:{},build:[],static:[],avoidParsingInsideTags:[],aliases:{},namespaceRules:{},namespaceRulesRegex:{},namespaceStrategy:`manual`,namespaceRoot:`./`}}defaultConfigBuildValue(e){return{fullname:``,name:``,tags:e.tags,version:e.version,organization:e.organization,description:e.description,readme:e.readme,repository:e.repository,documentation:e.documentation,disabled:!1,hideWarnings:e.hideWarnings,src:[],srcPath:[],stories:void 0,compile:[],srcPathRegex:RegExp(`(?!)`),outsideModule:[],outsideModulePathRegex:RegExp(`(?!)`),module:e.module,componentPrefix:e.componentPrefix,namespaceStrategy:e.namespaceStrategy,namespaceRules:{...e.namespaceRules},namespaceRulesRegex:{...e.namespaceRulesRegex},namespaceRoot:e.namespaceRoot,dependencies:{...e.dependencies},rawDependencies:{},avoidParsingInsideTags:[...e.avoidParsingInsideTags],nodeModulesDir:``}}defaultConfigBuildStories(e,t){return{output:e+`/stories`,format:`all`}}defaultConfigBuildDependencyValue(e){return{}}removeComments(e){return e=e.replace(/(\".*?\"|\'.*?\')|(\/\*.*?\*\/|\/\/[^(\r\n|\n)]*$)/gm,(e,t,n)=>{if(n){let e=``;for(let t=0;t<n.length;t++)e+=` `;return e}return t}),e}},ct=class{_file;_build;get file(){return this._file}get build(){if(this._build)return this._build;throw`No build found`}constructor(e,t){this._file=e,this._build=t,this.addEvents()}uuidEvents={onCanContentChange:``,onContentChange:``,onValidate:``,onSave:``,onDelete:``,onCompletion:``,onCompletionResolve:``,onHover:``,onDefinition:``,onFormatting:``,onCodeAction:``,onReferences:``,onCodeLens:``,onGetBuild:``,onRename:``};addEvents(){this.uuidEvents.onCanContentChange=this.file.onCanContentChange(this.onCanContentChange.bind(this)),this.uuidEvents.onContentChange=this.file.onContentChange(this.onContentChange.bind(this)),this.uuidEvents.onValidate=this.file.onValidate(this._onValidate.bind(this)),this.uuidEvents.onSave=this.file.onSave(this.onSave.bind(this)),this.uuidEvents.onDelete=this.file.onDelete(this._onDelete.bind(this)),this.uuidEvents.onCompletion=this.file.onCompletion(this.onCompletion.bind(this)),this.uuidEvents.onCompletionResolve=this.file.onCompletionResolve(this.onCompletionResolve.bind(this)),this.uuidEvents.onHover=this.file.onHover(this.onHover.bind(this)),this.uuidEvents.onDefinition=this.file.onDefinition(this.onDefinition.bind(this)),this.uuidEvents.onFormatting=this.file.onFormatting(this.onFormatting.bind(this)),this.uuidEvents.onCodeAction=this.file.onCodeAction(this.onCodeAction.bind(this)),this.uuidEvents.onReferences=this.file.onReferences(this.onReferences.bind(this)),this.uuidEvents.onCodeLens=this.file.onCodeLens(this.onCodeLens.bind(this)),this.uuidEvents.onGetBuild=this.file.onGetBuild(this.onGetBuild.bind(this)),this.uuidEvents.onRename=this.file.onRename(this.onRename.bind(this))}removeEvents(){this.file.removeOnCanContentChange(this.uuidEvents.onCanContentChange),this.file.removeOnContentChange(this.uuidEvents.onContentChange),this.file.removeOnValidate(this.uuidEvents.onValidate),this.file.removeOnSave(this.uuidEvents.onSave),this.file.removeOnDelete(this.uuidEvents.onDelete),this.file.removeOnCompletion(this.uuidEvents.onCompletion),this.file.removeOnCompletionResolve(this.uuidEvents.onCompletionResolve),this.file.removeOnHover(this.uuidEvents.onHover),this.file.removeOnDefinition(this.uuidEvents.onDefinition),this.file.removeOnFormatting(this.uuidEvents.onFormatting),this.file.removeOnCodeAction(this.uuidEvents.onCodeAction),this.file.removeOnReferences(this.uuidEvents.onReferences),this.file.removeOnCodeLens(this.uuidEvents.onCodeLens),this.file.removeOnGetBuild(this.uuidEvents.onGetBuild),this.file.removeOnRename(this.uuidEvents.onRename)}async validate(){this.file instanceof A&&await this.file.validate()}async triggerSave(){this.file instanceof A&&await this.file.triggerSave()}async triggerDelete(){this.file instanceof A&&await this.file.triggerDelete()}async triggerContentChange(e){this.file instanceof A&&await this.file.triggerContentChange(e)}onCanContentChange(e){return this._file.versionUser!=e.version}oldResult=[];async _onValidate(){let e=this._build?.diagnostics.get(this)??[];return e=[...e,...await this.onValidate()],this._build&&this.build.hideWarnings&&(e=e.filter(e=>e.severity!=m.DiagnosticSeverity.Warning)),this.oldResult=e,e}async _onDelete(){await this.onDelete(),this.removeEvents()}},lt=o(((e,t)=>{var n=require("stream");e=t.exports=r,r.through=r;function r(e,t,r){e||=function(e){this.queue(e)},t||=function(){this.queue(null)};var i=!1,a=!1,o=[],s=!1,c=new n;c.readable=c.writable=!0,c.paused=!1,c.autoDestroy=!(r&&r.autoDestroy===!1),c.write=function(t){return e.call(this,t),!c.paused};function l(){for(;o.length&&!c.paused;){var e=o.shift();if(e===null)return c.emit(`end`);c.emit(`data`,e)}}c.queue=c.push=function(e){return s?c:(e===null&&(s=!0),o.push(e),l(),c)},c.on(`end`,function(){c.readable=!1,!c.writable&&c.autoDestroy&&process.nextTick(function(){c.destroy()})});function u(){c.writable=!1,t.call(c),!c.readable&&c.autoDestroy&&c.destroy()}return c.end=function(e){if(!i)return i=!0,arguments.length&&c.write(e),u(),c},c.destroy=function(){if(!a)return a=!0,i=!0,o.length=0,c.writable=c.readable=!1,c.emit(`close`),c},c.pause=function(){if(!c.paused)return c.paused=!0,c},c.resume=function(){return c.paused&&(c.paused=!1,c.emit(`resume`)),l(),c.paused||c.emit(`drain`),c},c}})),ut=o(((e,t)=>{var n=require("stream");t.exports=function e(t){if(Array.isArray(t)){var r=0,i=t.length;return e(function(e){return r<i?this.emit(`data`,t[r++]):this.emit(`end`),!0})}var a=new n,o=0;a.ended=!1,a.started=!1,a.readable=!0,a.writable=!1,a.paused=!1,a.ended=!1,a.pause=function(){a.started=!0,a.paused=!0};function s(){if(a.started=!0,!a.ended)for(;!a.ended&&!a.paused&&t.call(a,o++,function(){!a.ended&&!a.paused&&process.nextTick(s)}););}return a.resume=function(){a.started=!0,a.paused=!1,s()},a.on(`end`,function(){a.ended=!0,a.readable=!1,process.nextTick(a.destroy)}),a.destroy=function(){a.ended=!0,a.emit(`close`)},process.nextTick(function(){a.started||a.resume()}),a}})),dt=o(((e,t)=>{var n=require("stream"),r=[`write`,`end`,`destroy`],i=[`resume`,`pause`],a=[`data`,`close`],o=Array.prototype.slice;t.exports=c;function s(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n)}function c(e,t){var c=new n,l=!1;return s(r,u),s(i,d),s(a,f),t.on(`end`,p),e.on(`drain`,function(){c.emit(`drain`)}),e.on(`error`,m),t.on(`error`,m),c.writable=e.writable,c.readable=t.readable,c;function u(t){c[t]=n;function n(){return e[t].apply(e,arguments)}}function d(e){c[e]=n;function n(){c.emit(e);var n=t[e];if(n)return n.apply(t,arguments);t.emit(e)}}function f(e){t.on(e,n);function n(){var t=o.call(arguments);t.unshift(e),c.emit.apply(c,t)}}function p(){if(!l){l=!0;var e=o.call(arguments);e.unshift(`end`),c.emit.apply(c,e)}}function m(e){c.emit(`error`,e)}}})),ft=o(((e,t)=>{var n=require("stream").Stream;t.exports=function(e,t){var r=new n,i=0,a=0,o=!1,s=!1,c=!1,l=0,u=!1;t||={};var d=t.failures?`failure`:`error`,f={};r.writable=!0,r.readable=!0;function p(e,t){var n=l+1;if(t===n?(e!==void 0&&r.emit.apply(r,[`data`,e]),l++,n++):f[t]=e,f.hasOwnProperty(n)){var c=f[n];return delete f[n],p(c,n)}a++,i===a&&(s&&(s=!1,r.emit(`drain`)),o&&g())}function m(e,n,i){c||(u=!0,(!e||t.failures)&&p(n,i),e&&r.emit.apply(r,[d,e]),u=!1)}function h(t,n,r){return e.call(null,t,function(e,t){r(e,t,n)})}r.write=function(e){if(o)throw Error(`map stream is not writable`);u=!1,i++;try{return s=h(e,i,m)===!1,!s}catch(e){if(u)throw e;return m(e),!s}};function g(e){if(o=!0,r.writable=!1,e!==void 0)return p(e,i);i==a&&(r.readable=!1,r.emit(`end`),r.destroy())}return r.end=function(e){o||g(e)},r.destroy=function(){o=c=!0,r.writable=r.readable=s=!1,process.nextTick(function(){r.emit(`close`)})},r.pause=function(){s=!0},r.resume=function(){s=!1},r}})),pt=o(((e,t)=>{t.exports=lt()})),mt=o(((e,t)=>{var n=lt(),r=require("string_decoder").StringDecoder;t.exports=i;function i(e,t,i){var a=new r,o=``,s=i&&i.maxLength,c=!(i&&i.trailing===!1);typeof e==`function`&&(t=e,e=null),e||=/\r?\n/;function l(e,n){if(t){try{n=t(n)}catch(t){return e.emit(`error`,t)}n!==void 0&&e.queue(n)}else e.queue(n)}function u(t,n){var r=((o??``)+n).split(e);if(o=r.pop(),s&&o.length>s)return t.emit(`error`,Error(`maximum buffer reached`));for(var i=0;i<r.length;i++){var a=r[i];l(t,a)}}return n(function(e){u(this,a.write(e))},function(){a.end&&u(this,a.end()),c&&o!=null&&l(this,o),this.queue(null)})}})),ht=o(((e,t)=>{var n=dt(),r=lt();t.exports=function(){var e=arguments.length==1&&Array.isArray(arguments[0])?arguments[0]:[].slice.call(arguments);if(e.length==0)return r();if(e.length==1)return e[0];var t=e[0],i=e[e.length-1],a=n(t,i);function o(e){e.length<2||(e[0].pipe(e[1]),o(e.slice(1)))}o(e);function s(){var e=[].slice.call(arguments);e.unshift(`error`),a.emit.apply(a,e)}for(var c=1;c<e.length-1;c++)e[c].on(`error`,s);return a}})),gt=o((e=>{var t=require("stream").Stream,n=e,r=lt(),i=ut(),a=dt(),o=ft(),s=pt(),c=mt(),l=ht(),u=global.setImmediate||process.nextTick;n.Stream=t,n.through=r,n.from=i,n.duplex=a,n.map=o,n.pause=s,n.split=c,n.pipeline=n.connect=n.pipe=l,n.concat=n.merge=function(){var e=[].slice.call(arguments);e.length===1&&e[0]instanceof Array&&(e=e[0]);var n=new t;n.setMaxListeners(0);var r=0;return n.writable=n.readable=!0,e.length?e.forEach(function(t){t.pipe(n,{end:!1});var i=!1;t.on(`end`,function(){i||(i=!0,r++,r==e.length&&n.emit(`end`))})}):process.nextTick(function(){n.emit(`end`)}),n.write=function(e){this.emit(`data`,e)},n.destroy=function(){e.forEach(function(e){e.destroy&&e.destroy()})},n},n.collect=n.writeArray=function(e){if(typeof e!=`function`)throw Error(`function writeArray (done): done must be function`);var n=new t,r=[],i=!1;return n.write=function(e){r.push(e)},n.end=function(){i=!0,e(null,r)},n.writable=!0,n.readable=!1,n.destroy=function(){n.writable=n.readable=!1,!i&&e(Error(`destroyed before end`),r)},n},n.readArray=function(e){var n=new t,r=0,i=!1,a=!1;if(n.readable=!0,n.writable=!1,!Array.isArray(e))throw Error(`event-stream.read expects an array`);return n.resume=function(){if(!a){i=!1;for(var t=e.length;r<t&&!i&&!a;)n.emit(`data`,e[r++]);r==t&&!a&&(a=!0,n.readable=!1,n.emit(`end`))}},process.nextTick(n.resume),n.pause=function(){i=!0},n.destroy=function(){a=!0,n.emit(`close`)},n},n.readable=function(e,n){var r=new t,i=0,a=!1,o=!1,s=!1;if(r.readable=!0,r.writable=!1,typeof e!=`function`)throw Error(`event-stream.readable expects async function`);r.on(`end`,function(){o=!0});function c(t,l){t?(r.emit(`error`,t),n||r.emit(`end`)):arguments.length>1&&r.emit(`data`,l),u(function(){if(!(o||a||s))try{s=!0,e.call(r,i++,function(){s=!1,c.apply(null,arguments)})}catch(e){r.emit(`error`,e)}})}return r.resume=function(){a=!1,c()},process.nextTick(c),r.pause=function(){a=!0},r.destroy=function(){r.emit(`end`),r.emit(`close`),o=!0},r},n.mapSync=function(e){return n.through(function(t){var n;try{n=e(t)}catch(e){return this.emit(`error`,e)}n!==void 0&&this.emit(`data`,n)})},n.filterSync=function(e){return n.through(function(t){var n=this;e(t)&&n.queue(t)})},n.flatmapSync=function(e){return n.through(function(t){var n=this;t.forEach(function(t){n.queue(e(t))})})},n.log=function(e){return n.through(function(t){[].slice.call(arguments),e?console.error(e,t):console.error(t),this.emit(`data`,t)})},n.child=function(e){return n.duplex(e.stdin,e.stdout)},n.parse=function(e){var t=!!(e&&e.error);return n.through(function(e){var n;try{e&&(n=JSON.parse(e.toString()))}catch(n){return t?this.emit(`error`,n):console.error(n,`attempting to parse:`,e)}n!==void 0&&this.emit(`data`,n)})},n.stringify=function(){var e=require("buffer").Buffer;return n.mapSync(function(t){return JSON.stringify(e.isBuffer(t)?t.toString():t)+`
|
|
8
9
|
`})},n.replace=function(e,t){return n.pipeline(n.split(e),n.join(t))},n.join=function(e){if(typeof e==`function`)return n.wait(e);var t=!0;return n.through(function(n){return t||this.emit(`data`,e),t=!1,this.emit(`data`,n),!0})},n.wait=function(e){var t=[];return n.through(function(e){t.push(e)},function(){var n=Buffer.isBuffer(t[0])?Buffer.concat(t):t.join(``);this.emit(`data`,n),this.emit(`end`),e&&e(null,n)})},n.pipeable=function(){throw Error(`[EVENT-STREAM] es.pipeable is deprecated`)}}))();const _t=`<script type="text/javascript">
|
|
9
10
|
if ('WebSocket' in window) {
|
|
10
11
|
(function () {
|
package/package.json
CHANGED