@tsrx/typescript-plugin 0.3.46 → 0.3.47

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const e=require(`./language-DZrsi_P6.js`);var t=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dedupeDocumentSpans=t;function t(e){return n(e,e=>[e.fileName,e.textSpan.start,e.textSpan.length].join(`:`))}function n(e,t){let n=new Map;for(let r of e.reverse())n.set(t(r),r);return[...n.values()]}})),n=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getServiceScript=t,e.fixupImpliedNodeFormatForFile=n;function t(e,t){let n=e.scripts.get(t);if(n?.targetIds.size)for(let t of n.targetIds){let r=e.scripts.get(t);if(r?.generated){let e=r.generated.languagePlugin.typescript?.getServiceScript(r.generated.root);if(e)return[e,r,n]}}if(n?.associatedOnly)return[void 0,n,n];if(n?.generated){let e=n.generated.languagePlugin.typescript?.getServiceScript(n.generated.root);if(e)return[e,n,n]}return[void 0,void 0,void 0]}function n(e,t,n,r,i,a){if(n.impliedNodeFormat!==void 0||!t.some(e=>n.fileName.endsWith(e))||[`.d.ts`,`.ts`,`.tsx`,`.js`,`.jsx`].some(e=>n.fileName.endsWith(e)))return;let o=n.fileName+`.ts`,s=e.getImpliedNodeFormatForFileWorker?.(o,r,i,a)?.impliedNodeFormat;if(s!==void 0)return n.impliedNodeFormat=s,()=>n.impliedNodeFormat=void 0}})),r=e.r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.transformCallHierarchyItem=s,t.transformDiagnostic=c,t.fillSourceFileText=l,t.transformFileTextChanges=u,t.transformDocumentSpan=d,t.transformSpan=f,t.transformTextChange=p,t.transformTextSpan=m,t.toSourceOffset=h,t.toSourceRanges=g,t.toSourceOffsets=_,t.toGeneratedRange=v,t.toGeneratedRanges=y,t.toGeneratedOffset=b,t.toGeneratedOffsets=x,t.getMappingOffset=S;let r=e.n(),i=n(),a=new WeakMap,o=new WeakSet;function s(e,t,n,r){let i=f(e,t.file,t.span,n,r),a=f(e,t.file,t.selectionSpan,n,r);return{...t,file:i?.fileName??t.file,span:i?.textSpan??{start:0,length:0},selectionSpan:a?.textSpan??{start:0,length:0}}}function c(e,t,n,o){if(!a.has(t)){a.set(t,void 0);let{relatedInformation:s}=t;if(s&&(t.relatedInformation=s.map(t=>c(e,t,n,o)).filter(e=>!!e)),t.file!==void 0&&t.start!==void 0&&t.length!==void 0){let[s]=(0,i.getServiceScript)(e,t.file.fileName);if(s){let[i,c]=m(void 0,e,s,{start:t.start,length:t.length},!0,e=>(0,r.shouldReportDiagnostics)(e,String(t.source),String(t.code)))??[],u=i?t.file.fileName===i?t.file:n?.getSourceFile(i):void 0;c&&u&&(o&&l(e,t.file),a.set(t,{...t,file:u,start:c.start,length:c.length}))}else a.set(t,t)}else a.set(t,t)}return a.get(t)}function l(e,t){if(o.has(t))return;o.add(t);let[n]=(0,i.getServiceScript)(e,t.fileName);if(n&&!n.preventLeadingOffset){let r=e.scripts.fromVirtualCode(n.code);t.text=r.snapshot.getText(0,r.snapshot.getLength())+t.text.substring(r.snapshot.getLength())}}function u(e,t,n,r){let a={},o=new Set;for(let s of t){let[t,c]=(0,i.getServiceScript)(e,s.fileName);if(c)s.textChanges.forEach(t=>{let{fileName:i,textSpan:o}=f(e,s.fileName,t.span,n,r)??{};i&&o&&(a[i]??(a[i]=[])).push({...t,span:o})});else{let e=a[s.fileName]??(a[s.fileName]=[]);s.textChanges.forEach(t=>{e.push(t)}),s.isNewFile&&o.add(s.fileName)}}let s=[];for(let e in a)s.push({fileName:e,isNewFile:o.has(e),textChanges:a[e]});return s}function d(e,t,n,r,i){let a=f(e,t.fileName,t.textSpan,n,r);if(!a&&i&&(a={fileName:t.fileName,textSpan:{start:0,length:0}}),!a)return;let o=f(e,t.fileName,t.contextSpan,n,r),s=f(e,t.originalFileName,t.originalTextSpan,n,r),c=f(e,t.originalFileName,t.originalContextSpan,n,r);return{...t,fileName:a.fileName,textSpan:a.textSpan,contextSpan:o?.textSpan,originalFileName:s?.fileName,originalTextSpan:s?.textSpan,originalContextSpan:c?.textSpan}}function f(e,t,n,r,a){if(!t||!n)return;let[o]=(0,i.getServiceScript)(e,t);if(o){let[t,i]=m(void 0,e,o,n,r,a)??[];if(i&&t)return{fileName:t,textSpan:i}}else return{fileName:t,textSpan:n}}function p(e,t,n,r,i,a){let[o,s]=m(e,t,n,r.span,i,a)??[];if(s&&o)return[o,{newText:r.newText,span:s}]}function m(e,t,n,r,i,a){let o=r.start,s=r.start+r.length;for(let[r,c,l]of g(e,t,n,o,s,i,a))return[r,{start:c,length:l-c}]}function h(e,t,n,r,i){for(let a of _(e,t,n,r,i))return a}function*g(e,t,n,r,i,a,o){if(e){let s=t.maps.get(n.code,e);for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}else for(let[e,s]of t.maps.forEach(n.code))for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}function*_(e,t,n,r,i){if(e){let a=t.maps.get(n.code,e);for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}else for(let[e,a]of t.maps.forEach(n.code))for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}function v(e,t,n,r,i,a){for(let o of y(e,t,n,r,i,a))return o}function*y(e,t,n,r,i,a){let o=e.maps.get(t.code,n);for(let[n,s]of o.toGeneratedRange(r,i,!0,a))yield[n+S(e,t),s+S(e,t)]}function b(e,t,n,r,i){for(let[a]of x(e,t,n,r,i))return a}function*x(e,t,n,r,i){let a=e.maps.get(t.code,n);for(let[n,o]of a.toGeneratedLocation(r))i(o.data)&&(yield[n+S(e,t),o])}function S(e,t){return t.preventLeadingOffset?0:e.scripts.fromVirtualCode(t.code).snapshot.getLength()}})),i=e.r((i=>{Object.defineProperty(i,`__esModule`,{value:!0}),i.createProxyLanguageService=u;let a=e.n(),o=t(),s=r(),c=n(),l=/\\/g;function u(e){let t=new Map,n;return{initialize(t){n=(n,r)=>{switch(r){case`getNavigationTree`:return d(t,n[r]);case`getOutliningSpans`:return f(t,n[r]);case`getFormattingEditsForDocument`:return p(t,n[r]);case`getFormattingEditsForRange`:return m(t,n[r]);case`getFormattingEditsAfterKeystroke`:return h(t,n[r]);case`getEditsForFileRename`:return g(t,n[r]);case`getLinkedEditingRangeAtPosition`:return _(t,n[r]);case`prepareCallHierarchy`:return v(t,n[r]);case`provideCallHierarchyIncomingCalls`:return y(t,n[r]);case`provideCallHierarchyOutgoingCalls`:return b(t,n[r]);case`organizeImports`:return x(t,n[r]);case`getQuickInfoAtPosition`:return S(t,n[r]);case`getSignatureHelpItems`:return C(t,n[r]);case`getDocumentHighlights`:return w(t,n[r]);case`getApplicableRefactors`:return T(t,n[r]);case`getEditsForRefactor`:return E(t,n[r]);case`getCombinedCodeFix`:return D(t,n[r]);case`getRenameInfo`:return O(t,n[r]);case`getCodeFixesAtPosition`:return k(t,n[r]);case`getEncodedSemanticClassifications`:return A(t,n[r]);case`getSyntacticDiagnostics`:return j(t,e,n[r]);case`getSemanticDiagnostics`:return M(t,e,n[r]);case`getSuggestionDiagnostics`:return N(t,e,n[r]);case`getDefinitionAndBoundSpan`:return P(t,n[r]);case`findReferences`:return F(t,n[r]);case`getDefinitionAtPosition`:return I(t,n[r]);case`getTypeDefinitionAtPosition`:return L(t,n[r]);case`getImplementationAtPosition`:return R(t,n[r]);case`findRenameLocations`:return z(t,n[r]);case`getReferencesAtPosition`:return B(t,n[r]);case`getCompletionsAtPosition`:return V(t,n[r]);case`getCompletionEntryDetails`:return H(t,n[r]);case`provideInlayHints`:return U(t,n[r]);case`getFileReferences`:return W(t,n[r]);case`getNavigateToItems`:return G(t,n[r])}}},proxy:new Proxy(e,{get(e,r,i){if(n){t.has(r)||t.set(r,n(e,r));let i=t.get(r);if(i)return i}return Reflect.get(e,r,i)},set(e,t,n,r){return Reflect.set(e,t,n,r)}})}}function d(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);if(i||a?.associatedOnly){let e=t(a.id);return e.childItems=void 0,e}else return t(r)}}function f(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);return i||a?.associatedOnly?[]:t(r)}}function p(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);return u?.associatedOnly?[]:o?e.maps.get(o.code,u).mappings.some(e=>(0,a.isFormattingEnabled)(e.data))?t(u.id,r).map(t=>(0,s.transformTextChange)(d,e,o,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e):[]:t(i,r)}}function m(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedRange)(e,d,p,r,i,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n[0],n[1],o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function h(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedOffset)(e,d,p,r,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n,i,o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function g(e,t){return(n,r,i,o)=>{let c=t(n,r,i,o);return(0,s.transformFileTextChanges)(e,c,!1,a.isRenameEnabled)}}function _(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isLinkedEditingEnabled);if(n!==void 0){let r=t(u.id,n);if(r)return{ranges:r.ranges.map(t=>(0,s.transformTextSpan)(d,e,o,t,!1,a.isLinkedEditingEnabled)?.[1]).filter(e=>!!e),wordPattern:r.wordPattern}}}else return t(i,r)}}function v(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isCallHierarchyEnabled);if(n!==void 0){let r=t(u.id,n);if(Array.isArray(r))return r.map(t=>(0,s.transformCallHierarchyItem)(e,t,!0,a.isCallHierarchyEnabled));if(r)return(0,s.transformCallHierarchyItem)(e,r,!0,a.isCallHierarchyEnabled)}}else return t(i,r)}}function y(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({from:(0,s.transformCallHierarchyItem)(e,t.from,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(n=>(0,s.transformSpan)(e,t.from.file,n,!0,a.isCallHierarchyEnabled)?.textSpan).filter(e=>!!e)}))}}function b(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({to:(0,s.transformCallHierarchyItem)(e,t.to,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(t=>u?(0,s.transformTextSpan)(f,e,u,t,!0,a.isCallHierarchyEnabled)?.[1]:t).filter(e=>!!e)}))}}function x(e,t){return(n,r,i)=>{let o=t(n,r,i);return(0,s.transformFileTextChanges)(e,o,!1,a.isCodeActionsEnabled)}}function S(e,t){return(n,r,...i)=>{let o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(!d?.associatedOnly)if(u){let n=[];for(let[o]of(0,s.toGeneratedOffsets)(e,u,f,r,a.isHoverEnabled)){let r=t(d.id,o,...i);if(r){let t=(0,s.transformTextSpan)(f,e,u,r.textSpan,!0,a.isHoverEnabled)?.[1];t&&n.push({...r,textSpan:t})}}if(n.length===1)return n[0];if(n.length>=2){let e={...n[0]};e.displayParts=e.displayParts?.slice(),e.documentation=e.documentation?.slice(),e.tags=e.tags?.slice();let t=new Set([q(n[0].displayParts)]),r=new Set([q(n[0].documentation)]),i=new Set;for(let e of n[0].tags??[])i.add(e.name+`__volar__`+q(e.text));for(let a=1;a<n.length;a++){let{displayParts:o,documentation:s,tags:c}=n[a];o?.length&&!t.has(q(o))&&(t.add(q(o)),e.displayParts??=[],e.displayParts.push({...o[0],text:`
1
+ const e=require(`./language-CAqwRK_u.js`);var t=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dedupeDocumentSpans=t;function t(e){return n(e,e=>[e.fileName,e.textSpan.start,e.textSpan.length].join(`:`))}function n(e,t){let n=new Map;for(let r of e.reverse())n.set(t(r),r);return[...n.values()]}})),n=e.r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getServiceScript=t,e.fixupImpliedNodeFormatForFile=n;function t(e,t){let n=e.scripts.get(t);if(n?.targetIds.size)for(let t of n.targetIds){let r=e.scripts.get(t);if(r?.generated){let e=r.generated.languagePlugin.typescript?.getServiceScript(r.generated.root);if(e)return[e,r,n]}}if(n?.associatedOnly)return[void 0,n,n];if(n?.generated){let e=n.generated.languagePlugin.typescript?.getServiceScript(n.generated.root);if(e)return[e,n,n]}return[void 0,void 0,void 0]}function n(e,t,n,r,i,a){if(n.impliedNodeFormat!==void 0||!t.some(e=>n.fileName.endsWith(e))||[`.d.ts`,`.ts`,`.tsx`,`.js`,`.jsx`].some(e=>n.fileName.endsWith(e)))return;let o=n.fileName+`.ts`,s=e.getImpliedNodeFormatForFileWorker?.(o,r,i,a)?.impliedNodeFormat;if(s!==void 0)return n.impliedNodeFormat=s,()=>n.impliedNodeFormat=void 0}})),r=e.r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.transformCallHierarchyItem=s,t.transformDiagnostic=c,t.fillSourceFileText=l,t.transformFileTextChanges=u,t.transformDocumentSpan=d,t.transformSpan=f,t.transformTextChange=p,t.transformTextSpan=m,t.toSourceOffset=h,t.toSourceRanges=g,t.toSourceOffsets=_,t.toGeneratedRange=v,t.toGeneratedRanges=y,t.toGeneratedOffset=b,t.toGeneratedOffsets=x,t.getMappingOffset=S;let r=e.n(),i=n(),a=new WeakMap,o=new WeakSet;function s(e,t,n,r){let i=f(e,t.file,t.span,n,r),a=f(e,t.file,t.selectionSpan,n,r);return{...t,file:i?.fileName??t.file,span:i?.textSpan??{start:0,length:0},selectionSpan:a?.textSpan??{start:0,length:0}}}function c(e,t,n,o){if(!a.has(t)){a.set(t,void 0);let{relatedInformation:s}=t;if(s&&(t.relatedInformation=s.map(t=>c(e,t,n,o)).filter(e=>!!e)),t.file!==void 0&&t.start!==void 0&&t.length!==void 0){let[s]=(0,i.getServiceScript)(e,t.file.fileName);if(s){let[i,c]=m(void 0,e,s,{start:t.start,length:t.length},!0,e=>(0,r.shouldReportDiagnostics)(e,String(t.source),String(t.code)))??[],u=i?t.file.fileName===i?t.file:n?.getSourceFile(i):void 0;c&&u&&(o&&l(e,t.file),a.set(t,{...t,file:u,start:c.start,length:c.length}))}else a.set(t,t)}else a.set(t,t)}return a.get(t)}function l(e,t){if(o.has(t))return;o.add(t);let[n]=(0,i.getServiceScript)(e,t.fileName);if(n&&!n.preventLeadingOffset){let r=e.scripts.fromVirtualCode(n.code);t.text=r.snapshot.getText(0,r.snapshot.getLength())+t.text.substring(r.snapshot.getLength())}}function u(e,t,n,r){let a={},o=new Set;for(let s of t){let[t,c]=(0,i.getServiceScript)(e,s.fileName);if(c)s.textChanges.forEach(t=>{let{fileName:i,textSpan:o}=f(e,s.fileName,t.span,n,r)??{};i&&o&&(a[i]??(a[i]=[])).push({...t,span:o})});else{let e=a[s.fileName]??(a[s.fileName]=[]);s.textChanges.forEach(t=>{e.push(t)}),s.isNewFile&&o.add(s.fileName)}}let s=[];for(let e in a)s.push({fileName:e,isNewFile:o.has(e),textChanges:a[e]});return s}function d(e,t,n,r,i){let a=f(e,t.fileName,t.textSpan,n,r);if(!a&&i&&(a={fileName:t.fileName,textSpan:{start:0,length:0}}),!a)return;let o=f(e,t.fileName,t.contextSpan,n,r),s=f(e,t.originalFileName,t.originalTextSpan,n,r),c=f(e,t.originalFileName,t.originalContextSpan,n,r);return{...t,fileName:a.fileName,textSpan:a.textSpan,contextSpan:o?.textSpan,originalFileName:s?.fileName,originalTextSpan:s?.textSpan,originalContextSpan:c?.textSpan}}function f(e,t,n,r,a){if(!t||!n)return;let[o]=(0,i.getServiceScript)(e,t);if(o){let[t,i]=m(void 0,e,o,n,r,a)??[];if(i&&t)return{fileName:t,textSpan:i}}else return{fileName:t,textSpan:n}}function p(e,t,n,r,i,a){let[o,s]=m(e,t,n,r.span,i,a)??[];if(s&&o)return[o,{newText:r.newText,span:s}]}function m(e,t,n,r,i,a){let o=r.start,s=r.start+r.length;for(let[r,c,l]of g(e,t,n,o,s,i,a))return[r,{start:c,length:l-c}]}function h(e,t,n,r,i){for(let a of _(e,t,n,r,i))return a}function*g(e,t,n,r,i,a,o){if(e){let s=t.maps.get(n.code,e);for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}else for(let[e,s]of t.maps.forEach(n.code))for(let[c,l]of s.toSourceRange(r-S(t,n),i-S(t,n),a,o))yield[e.id,c,l]}function*_(e,t,n,r,i){if(e){let a=t.maps.get(n.code,e);for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}else for(let[e,a]of t.maps.forEach(n.code))for(let[o,s]of a.toSourceLocation(r-S(t,n)))i(s.data)&&(yield[e.id,o])}function v(e,t,n,r,i,a){for(let o of y(e,t,n,r,i,a))return o}function*y(e,t,n,r,i,a){let o=e.maps.get(t.code,n);for(let[n,s]of o.toGeneratedRange(r,i,!0,a))yield[n+S(e,t),s+S(e,t)]}function b(e,t,n,r,i){for(let[a]of x(e,t,n,r,i))return a}function*x(e,t,n,r,i){let a=e.maps.get(t.code,n);for(let[n,o]of a.toGeneratedLocation(r))i(o.data)&&(yield[n+S(e,t),o])}function S(e,t){return t.preventLeadingOffset?0:e.scripts.fromVirtualCode(t.code).snapshot.getLength()}})),i=e.r((i=>{Object.defineProperty(i,`__esModule`,{value:!0}),i.createProxyLanguageService=u;let a=e.n(),o=t(),s=r(),c=n(),l=/\\/g;function u(e){let t=new Map,n;return{initialize(t){n=(n,r)=>{switch(r){case`getNavigationTree`:return d(t,n[r]);case`getOutliningSpans`:return f(t,n[r]);case`getFormattingEditsForDocument`:return p(t,n[r]);case`getFormattingEditsForRange`:return m(t,n[r]);case`getFormattingEditsAfterKeystroke`:return h(t,n[r]);case`getEditsForFileRename`:return g(t,n[r]);case`getLinkedEditingRangeAtPosition`:return _(t,n[r]);case`prepareCallHierarchy`:return v(t,n[r]);case`provideCallHierarchyIncomingCalls`:return y(t,n[r]);case`provideCallHierarchyOutgoingCalls`:return b(t,n[r]);case`organizeImports`:return x(t,n[r]);case`getQuickInfoAtPosition`:return S(t,n[r]);case`getSignatureHelpItems`:return C(t,n[r]);case`getDocumentHighlights`:return w(t,n[r]);case`getApplicableRefactors`:return T(t,n[r]);case`getEditsForRefactor`:return E(t,n[r]);case`getCombinedCodeFix`:return D(t,n[r]);case`getRenameInfo`:return O(t,n[r]);case`getCodeFixesAtPosition`:return k(t,n[r]);case`getEncodedSemanticClassifications`:return A(t,n[r]);case`getSyntacticDiagnostics`:return j(t,e,n[r]);case`getSemanticDiagnostics`:return M(t,e,n[r]);case`getSuggestionDiagnostics`:return N(t,e,n[r]);case`getDefinitionAndBoundSpan`:return P(t,n[r]);case`findReferences`:return F(t,n[r]);case`getDefinitionAtPosition`:return I(t,n[r]);case`getTypeDefinitionAtPosition`:return L(t,n[r]);case`getImplementationAtPosition`:return R(t,n[r]);case`findRenameLocations`:return z(t,n[r]);case`getReferencesAtPosition`:return B(t,n[r]);case`getCompletionsAtPosition`:return V(t,n[r]);case`getCompletionEntryDetails`:return H(t,n[r]);case`provideInlayHints`:return U(t,n[r]);case`getFileReferences`:return W(t,n[r]);case`getNavigateToItems`:return G(t,n[r])}}},proxy:new Proxy(e,{get(e,r,i){if(n){t.has(r)||t.set(r,n(e,r));let i=t.get(r);if(i)return i}return Reflect.get(e,r,i)},set(e,t,n,r){return Reflect.set(e,t,n,r)}})}}function d(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);if(i||a?.associatedOnly){let e=t(a.id);return e.childItems=void 0,e}else return t(r)}}function f(e,t){return n=>{let r=n.replace(l,`/`),[i,a]=(0,c.getServiceScript)(e,r);return i||a?.associatedOnly?[]:t(r)}}function p(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);return u?.associatedOnly?[]:o?e.maps.get(o.code,u).mappings.some(e=>(0,a.isFormattingEnabled)(e.data))?t(u.id,r).map(t=>(0,s.transformTextChange)(d,e,o,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e):[]:t(i,r)}}function m(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedRange)(e,d,p,r,i,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n[0],n[1],o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function h(e,t){return(n,r,i,o)=>{let u=n.replace(l,`/`),[d,f,p]=(0,c.getServiceScript)(e,u);if(f?.associatedOnly)return[];if(d){let n=(0,s.toGeneratedOffset)(e,d,p,r,a.isFormattingEnabled);return n===void 0?[]:t(f.id,n,i,o).map(t=>(0,s.transformTextChange)(p,e,d,t,!1,a.isFormattingEnabled)?.[1]).filter(e=>!!e)}else return t(u,r,i,o)}}function g(e,t){return(n,r,i,o)=>{let c=t(n,r,i,o);return(0,s.transformFileTextChanges)(e,c,!1,a.isRenameEnabled)}}function _(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isLinkedEditingEnabled);if(n!==void 0){let r=t(u.id,n);if(r)return{ranges:r.ranges.map(t=>(0,s.transformTextSpan)(d,e,o,t,!1,a.isLinkedEditingEnabled)?.[1]).filter(e=>!!e),wordPattern:r.wordPattern}}}else return t(i,r)}}function v(e,t){return(n,r)=>{let i=n.replace(l,`/`),[o,u,d]=(0,c.getServiceScript)(e,i);if(!u?.associatedOnly)if(o){let n=(0,s.toGeneratedOffset)(e,o,d,r,a.isCallHierarchyEnabled);if(n!==void 0){let r=t(u.id,n);if(Array.isArray(r))return r.map(t=>(0,s.transformCallHierarchyItem)(e,t,!0,a.isCallHierarchyEnabled));if(r)return(0,s.transformCallHierarchyItem)(e,r,!0,a.isCallHierarchyEnabled)}}else return t(i,r)}}function y(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({from:(0,s.transformCallHierarchyItem)(e,t.from,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(n=>(0,s.transformSpan)(e,t.from.file,n,!0,a.isCallHierarchyEnabled)?.textSpan).filter(e=>!!e)}))}}function b(e,t){return(n,r)=>{let i=[],o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(d?.associatedOnly)return[];if(u){let n=(0,s.toGeneratedOffset)(e,u,f,r,a.isCallHierarchyEnabled);n!==void 0&&(i=t(d.id,n))}else i=t(o,r);return i.map(t=>({to:(0,s.transformCallHierarchyItem)(e,t.to,!0,a.isCallHierarchyEnabled),fromSpans:t.fromSpans.map(t=>u?(0,s.transformTextSpan)(f,e,u,t,!0,a.isCallHierarchyEnabled)?.[1]:t).filter(e=>!!e)}))}}function x(e,t){return(n,r,i)=>{let o=t(n,r,i);return(0,s.transformFileTextChanges)(e,o,!1,a.isCodeActionsEnabled)}}function S(e,t){return(n,r,...i)=>{let o=n.replace(l,`/`),[u,d,f]=(0,c.getServiceScript)(e,o);if(!d?.associatedOnly)if(u){let n=[];for(let[o]of(0,s.toGeneratedOffsets)(e,u,f,r,a.isHoverEnabled)){let r=t(d.id,o,...i);if(r){let t=(0,s.transformTextSpan)(f,e,u,r.textSpan,!0,a.isHoverEnabled)?.[1];t&&n.push({...r,textSpan:t})}}if(n.length===1)return n[0];if(n.length>=2){let e={...n[0]};e.displayParts=e.displayParts?.slice(),e.documentation=e.documentation?.slice(),e.tags=e.tags?.slice();let t=new Set([q(n[0].displayParts)]),r=new Set([q(n[0].documentation)]),i=new Set;for(let e of n[0].tags??[])i.add(e.name+`__volar__`+q(e.text));for(let a=1;a<n.length;a++){let{displayParts:o,documentation:s,tags:c}=n[a];o?.length&&!t.has(q(o))&&(t.add(q(o)),e.displayParts??=[],e.displayParts.push({...o[0],text:`
2
2
 
3
3
  `+o[0].text}),e.displayParts.push(...o.slice(1))),s?.length&&!r.has(q(s))&&(r.add(q(s)),e.documentation??=[],e.documentation.push({...s[0],text:`
4
4
 
@@ -1,4 +1,4 @@
1
1
  var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));require(`typescript`);let l=require(`fs`);l=c(l);let u=require(`path`);u=c(u);let d=require(`module`),f=require(`url`);var p=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.binarySearch=t;function t(e,t){let n=0,r=e.length-1,i;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o<t)n=a+1;else if(o>t)r=a-1;else{n=a,r=a,i=a;break}}return{low:Math.max(Math.min(n,r,e.length-1),0),high:Math.min(Math.max(n,r,0),e.length-1),match:i}}})),m=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.translateOffset=n;let t=!1;function n(e,n,r,i,a=i,o=!1){if(!n.every((e,t)=>t===0||n[t-1]<=e)){for(let t=0;t<n.length;t++){let s=n[t],c=i[t];if(e>=s&&e<=s+c){let n=a[t],i=r[t],l,u=e-s;return l=o&&n>c&&u===c?n:Math.min(u,n),i+l}}t||(t=!0,console.warn(`fromOffsets should be sorted in ascending order`))}let s=0,c=n.length-1;for(;s<=c;){let t=Math.floor((s+c)/2),l=n[t],u=i[t];if(e>=l&&e<=l+u){let n=a[t],i=r[t],s,c=e-l;return s=o&&n>u&&c===u?n:Math.min(c,n),i+s}else e<l?c=t-1:s=t+1}}})),h=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SourceMap=void 0;let t=p(),n=m();e.SourceMap=class{constructor(e){this.mappings=e}toSourceRange(e,t,n,r){return this.findMatchingStartEnd(e,t,n,`generatedOffsets`,r)}toGeneratedRange(e,t,n,r){return this.findMatchingStartEnd(e,t,n,`sourceOffsets`,r)}toSourceLocation(e,t){return this.findMatchingOffsets(e,`generatedOffsets`,t)}toGeneratedLocation(e,t){return this.findMatchingOffsets(e,`sourceOffsets`,t)}*findMatchingOffsets(e,i,a,o=!1){let s=this.getMemoBasedOnRange(i);if(s.offsets.length===0)return;let{low:c,high:l}=(0,t.binarySearch)(s.offsets,e),u=new Set,d=i===`sourceOffsets`?`generatedOffsets`:`sourceOffsets`;for(let t=c;t<=l;t++)for(let c of s.mappings[t]){if(u.has(c)||(u.add(c),a&&!a(c.data)))continue;let t=(0,n.translateOffset)(e,c[i],c[d],r(c,i),r(c,d),o);t!==void 0&&(yield[t,c])}}*findMatchingStartEnd(e,t,i,a,o){let s=a===`sourceOffsets`?`generatedOffsets`:`sourceOffsets`,c=s===`sourceOffsets`,l=[],u=!1;for(let[i,d]of this.findMatchingOffsets(e,a)){if(o&&!o(d.data))continue;l.push([i,d]);let e=(0,n.translateOffset)(t,d[a],d[s],r(d,a),r(d,s),c);e!==void 0&&(u=!0,yield[i,e,d,d])}if(!u&&i){for(let[e,n]of l)for(let[r,i]of this.findMatchingOffsets(t,a,void 0,c))if(!(o&&!o(i.data)||r<e)){yield[e,r,n,i];break}}}getMemoBasedOnRange(e){return e===`sourceOffsets`?this.sourceCodeOffsetsMemo??=this.createMemo(`sourceOffsets`):this.generatedCodeOffsetsMemo??=this.createMemo(`generatedOffsets`)}createMemo(e){let n=new Set;for(let t of this.mappings)for(let i=0;i<t[e].length;i++)n.add(t[e][i]),n.add(t[e][i]+r(t,e)[i]);let i=[...n].sort((e,t)=>e-t),a=i.map(()=>new Set);for(let n of this.mappings)for(let o=0;o<n[e].length;o++){let s=(0,t.binarySearch)(i,n[e][o]).match,c=(0,t.binarySearch)(i,n[e][o]+r(n,e)[o]).match;for(let e=s;e<=c;e++)a[e].add(n)}return{offsets:i,mappings:a}}};function r(e,t){return t===`sourceOffsets`?e.lengths:e.generatedLengths??e.lengths}})),g=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(h(),e),n(m(),e)})),_=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isHoverEnabled=t,e.isInlayHintsEnabled=n,e.isCodeLensEnabled=r,e.isMonikerEnabled=i,e.isInlineValueEnabled=a,e.isSemanticTokensEnabled=o,e.isCallHierarchyEnabled=s,e.isTypeHierarchyEnabled=c,e.isRenameEnabled=l,e.isDefinitionEnabled=u,e.isTypeDefinitionEnabled=d,e.isReferencesEnabled=f,e.isImplementationEnabled=p,e.isHighlightEnabled=m,e.isSymbolsEnabled=h,e.isFoldingRangesEnabled=g,e.isSelectionRangesEnabled=_,e.isLinkedEditingEnabled=v,e.isColorEnabled=y,e.isDocumentLinkEnabled=b,e.isDiagnosticsEnabled=x,e.isCodeActionsEnabled=S,e.isFormattingEnabled=C,e.isCompletionEnabled=w,e.isAutoInsertEnabled=T,e.isSignatureHelpEnabled=E,e.shouldReportDiagnostics=D,e.resolveRenameNewName=O,e.resolveRenameEditText=k,e.findOverlapCodeRange=A;function t(e){return!!e.semantic}function n(e){return!!e.semantic}function r(e){return!!e.semantic}function i(e){return!!e.semantic}function a(e){return!!e.semantic}function o(e){return typeof e.semantic==`object`?e.semantic.shouldHighlight?.()??!0:!!e.semantic}function s(e){return!!e.navigation}function c(e){return!!e.navigation}function l(e){return typeof e.navigation==`object`?e.navigation.shouldRename?.()??!0:!!e.navigation}function u(e){return!!e.navigation}function d(e){return!!e.navigation}function f(e){return!!e.navigation}function p(e){return!!e.navigation}function m(e){return typeof e.navigation==`object`?e.navigation.shouldHighlight?.()??!0:!!e.navigation}function h(e){return!!e.structure}function g(e){return!!e.structure}function _(e){return!!e.structure}function v(e){return!!e.structure}function y(e){return!!e.structure}function b(e){return!!e.structure}function x(e){return!!e.verification}function S(e){return!!e.verification}function C(e){return!!e.format}function w(e){return!!e.completion}function T(e){return!!e.completion}function E(e){return!!e.completion}function D(e,t,n){return typeof e.verification==`object`?e.verification.shouldReport?.(t,n)??!0:!!e.verification}function O(e,t){return typeof t.navigation==`object`?t.navigation.resolveRenameNewName?.(e)??e:e}function k(e,t){return typeof t.navigation==`object`?t.navigation.resolveRenameEditText?.(e)??e:e}function A(e,t,n,r){let i,a;for(let[t,a]of n.toGeneratedLocation(e))if(r(a.data)){i=t;break}for(let[e,i]of n.toGeneratedLocation(t))if(r(i.data)){a=e;break}if(i===void 0||a===void 0){for(let o of n.mappings)if(r(o.data)){let n=o.sourceOffsets[0],r=j(e,t,n,o.sourceOffsets[o.sourceOffsets.length-1]+o.lengths[o.lengths.length-1]);if(r){let e=r.start-n+o.generatedOffsets[0],t=(o.generatedLengths??o.lengths)[o.generatedOffsets.length-1],s=Math.min(r.end-o.sourceOffsets[o.sourceOffsets.length-1],t),c=o.generatedOffsets[o.generatedOffsets.length-1]+s;i=i===void 0?e:Math.min(i,e),a=a===void 0?c:Math.max(a,c)}}}if(i!==void 0&&a!==void 0)return{start:i,end:a}}function j(e,t,n,r){let i=Math.max(e,n),a=Math.min(t,r);if(!(i>a))return{start:i,end:a}}})),v=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LinkedCodeMap=void 0;let t=g();e.LinkedCodeMap=class extends t.SourceMap{*getLinkedOffsets(e){for(let t of this.toGeneratedLocation(e))yield t[0];for(let t of this.toSourceLocation(e))yield t[0]}}})),y=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),b=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FileMap=void 0,e.FileMap=class extends Map{constructor(e){super(),this.caseSensitive=e,this.originalFileNames=new Map}keys(){return this.originalFileNames.values()}get(e){return super.get(this.normalizeId(e))}has(e){return super.has(this.normalizeId(e))}set(e,t){return this.originalFileNames.set(this.normalizeId(e),e),super.set(this.normalizeId(e),t)}delete(e){return this.originalFileNames.delete(this.normalizeId(e)),super.delete(this.normalizeId(e))}clear(){return this.originalFileNames.clear(),super.clear()}normalizeId(e){return this.caseSensitive?e:e.toLowerCase()}}})),x=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultMapperFactory=e.SourceMap=void 0,e.createLanguage=o,e.forEachEmbeddedCode=s;var r=g();Object.defineProperty(e,`SourceMap`,{enumerable:!0,get:function(){return r.SourceMap}}),n(_(),e),n(v(),e),n(y(),e),n(b(),e);let i=g(),a=v();e.defaultMapperFactory=e=>new i.SourceMap(e);function o(t,n,r,i){let o=new WeakMap,c=new WeakMap,l=new WeakMap,u={mapperFactory:e.defaultMapperFactory,plugins:t,scripts:{fromVirtualCode(e){return o.get(e)},get(e,t=!0,i=!1){r(e,t,i);let a=n.get(e);return a?.isAssociationDirty&&this.set(e,a.snapshot,a.languageId),n.get(e)},set(e,r,i,a=t){if(!i){for(let n of t)if(i=n.getLanguageId?.(e),i)break}if(!i){console.warn(`languageId not found for ${String(e)}`);return}let c=!1;for(let n of t)if(n.isAssociatedFileOnly?.(e,i)){c=!0;break}if(n.has(e)){let t=n.get(e);if(t.languageId!==i||t.associatedOnly!==c)return this.delete(e),d(t),this.set(e,r,i);if(c)t.snapshot!==r&&(t.snapshot=r,d(t));else if(t.isAssociationDirty||t.snapshot!==r){t.snapshot!==r&&(t.snapshot=r,d(t));let n=f(t);if(t.generated){let{updateVirtualCode:a,createVirtualCode:c}=t.generated.languagePlugin,l=a?a(e,t.generated.root,r,n):c?.(e,i,r,n);if(l){t.generated.root=l,t.generated.embeddedCodes.clear();for(let e of s(t.generated.root))o.set(e,t),t.generated.embeddedCodes.set(e.id,e);return t}else{this.delete(e);return}}}else return t}else{let t={id:e,languageId:i,snapshot:r,associatedIds:new Set,targetIds:new Set,associatedOnly:c};if(n.set(e,t),c)return t;for(let n of a){let a=n.createVirtualCode?.(e,i,r,f(t));if(a){t.generated={root:a,languagePlugin:n,embeddedCodes:new Map};for(let e of s(a))o.set(e,t),t.generated.embeddedCodes.set(e.id,e);break}}return t}},delete(e){let t=n.get(e);t&&(t.generated?.languagePlugin.disposeVirtualCode?.(e,t.generated.root),n.delete(e),d(t))}},maps:{get(e,t){let n=c.get(e.snapshot);if(n||c.set(e.snapshot,n=new WeakMap),!n.has(t.snapshot)){let r=e.associatedScriptMappings?.get(t.id)??e.mappings;n.set(t.snapshot,u.mapperFactory(r))}return n.get(t.snapshot)},*forEach(e){let t=o.get(e);if(yield[t,this.get(e,t)],e.associatedScriptMappings)for(let[t]of e.associatedScriptMappings){let r=n.get(t);r&&(yield[r,this.get(e,r)])}}},linkedCodeMaps:{get(e){let t=o.get(e),n=l.get(e.snapshot);return n?.[0]!==t.snapshot&&l.set(e.snapshot,n=[t.snapshot,e.linkedCodeMappings?new a.LinkedCodeMap(e.linkedCodeMappings):void 0]),n[1]}}};return u;function d(e){e.targetIds.forEach(e=>{let t=n.get(e);t&&(t.isAssociationDirty=!0,i?.(t.id))})}function f(e){for(let t of e.associatedIds)n.get(t)?.targetIds.delete(e.id);return e.associatedIds.clear(),e.isAssociationDirty=!1,{getAssociatedScript(t){r(t,!0,!0);let i=n.get(t);return i&&(i.targetIds.add(e.id),e.associatedIds.add(i.id)),i}}}}function*s(e){if(yield e,e.embeddedCodes)for(let t of e.embeddedCodes)yield*s(t)}}));const S=process.env.RIPPLE_DEBUG===`true`;function C(e){return{log(...t){S&&console.log(e,...t)},logError(...t){S&&console.error(e,...t)},logWarning(...t){S&&console.warn(e,...t)}}}var w=x();const T=(0,d.createRequire)(require(`url`).pathToFileURL(__filename).href),E=u.default.dirname((0,f.fileURLToPath)(require(`url`).pathToFileURL(__filename).href)),{log:D,logWarning:O,logError:k}=C(`[Ripple Language]`),A=new Set,j=[`.tsrx`],M=[[`@tsrx/ripple`,[`node_modules`,`@tsrx`,`ripple`],[`.tsrx`],[`@tsrx/ripple`,`ripple`,`@ripple-ts/vite-plugin`,`@ripple-ts/compat-react`]],[`@tsrx/react`,[`node_modules`,`@tsrx`,`react`],[`.tsrx`],[`@tsrx/react`,`@tsrx/vite-plugin-react`]],[`@tsrx/solid`,[`node_modules`,`@tsrx`,`solid`],[`.tsrx`],[`@tsrx/solid`,`@tsrx/vite-plugin-solid`]],[`@tsrx/preact`,[`node_modules`,`@tsrx`,`preact`],[`.tsrx`],[`@tsrx/preact`,`@tsrx/vite-plugin-preact`]],[`@tsrx/vue`,[`node_modules`,`@tsrx`,`vue`],[`.tsrx`],[`@tsrx/vue`,`@tsrx/vite-plugin-vue`]]];function N(e){return j.some(t=>e.endsWith(t))}function P(){return D(`Creating Ripple language plugin...`),{getLanguageId(e){let t=typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`);if(N(t))return D(`Identified Ripple file:`,t),`ripple`},createVirtualCode(e,t,n){if(t===`ripple`){let t=H(e),r=G(t);if(!r){k(`Ripple compiler not found for file: ${t}`);return}D(`Creating virtual code for:`,t);try{return new F(t,n,r)}catch(e){throw k(`Failed to create virtual code for:`,t,`:`,e),e}}},updateVirtualCode(e,t,n){if(t instanceof F)return D(`Updating existing virtual code for:`,t.fileName),t.update(n),t},typescript:{extraFileExtensions:j.map(e=>({extension:e.slice(1),isMixedContent:!1,scriptKind:7})),getServiceScript(e){for(let t of(0,w.forEachEmbeddedCode)(e))if(t.languageId===`ripple`)return{code:t,extension:`.tsx`,scriptKind:4}}}}}var F=class{id=`root`;languageId=`ripple`;codegenStacks=[];tsrx;generatedCode=``;embeddedCodes=[];mappings=[];fatalErrors=[];usageErrors=[];snapshot;sourceSnapshot;originalCode=``;diagnostics=[];#e=null;#t=null;constructor(e,t,n){if(D(`Initializing TSRXVirtualCode for:`,e),this.fileName=e,this.tsrx=n,this.snapshot=t,this.sourceSnapshot=t,this.originalCode=t.getText(0,t.getLength()),!n||typeof n.compile_to_volar_mappings!=`function`)throw k(`Invalid ripple compiler - missing compile_to_volar_mappings method`),Error(`Invalid ripple compiler`);this.update(t)}update(e){D(`Updating virtual code for:`,this.fileName);let t=e.getText(0,e.getLength()),n=e.getChangeRange(this.sourceSnapshot);this.sourceSnapshot=e,this.#e=null,this.#t=null,this.fatalErrors=[],this.usageErrors=[];let r,i=!1,a=-1;if(D(`changeRange:`,JSON.stringify(n)),n){let e=n.span.start,r=e+n.span.length,o=e+n.newLength,s=this.originalCode.substring(e,r),c=t.substring(e,o);if(D(`Change details:`),D(` Position:`,e,`-`,r,`(length:`,n.span.length,`)`),D(` Old text:`,JSON.stringify(s)),D(` New text:`,JSON.stringify(c),`(length:`,n.newLength,`)`),c.endsWith(`.`)){let e=o>1?t[o-2]:``;D(` Char before dot:`,JSON.stringify(e)),/[$#_\u200C\u200D\p{ID_Continue}\)\]\}]/u.test(e)&&(i=!0,a=o-1,D(`ChangeRange detected dot typed at position`,a))}}try{if(i&&a>=0){let e=t.substring(0,a)+t.substring(a+1);if(D(`Compiling without typed dot at position`,a),r=this.tsrx.compile_to_volar_mappings(e,this.fileName,{loose:!0}),D(`Compilation without dot successful`),r&&r.code&&r.mappings.length>0){let e=z(r,a);e===null?O(`Failed to restore typed dot into transpiled output`):D(`Inserted typed dot at generated position`,e)}}else D(`Compiling Ripple code...`),r=this.tsrx.compile_to_volar_mappings(t,this.fileName,{loose:!0}),D(`Compilation successful, generated code length:`,r?.code?.length||0)}catch(e){let n=e;if(k(`Ripple compilation failed for`,this.fileName,`:`,n),process.env.TSRX_TSC===`true`){I(this.fileName,[n]);let e=L(this.tsrx,t,this.fileName);e!==void 0&&(I(this.fileName,e.errors),r={code:e.code,mappings:[{sourceOffsets:[0],generatedOffsets:[0],lengths:[t.length],generatedLengths:[e.code.length],data:{verification:!1,customData:{}}}],errors:e.errors,cssMappings:[]})}n.type=`fatal`,this.fatalErrors.push(n)}if(r&&r.code){this.originalCode=t,this.generatedCode=r.code,this.mappings=r.mappings??[],this.usageErrors=r.errors,process.env.TSRX_TSC===`true`&&r.errors.length>0&&I(this.fileName,r.errors);let e=r.cssMappings;if(e.length>0?(D(`Creating`,e.length,`CSS embedded codes`),this.embeddedCodes=e.map((e,t)=>{let n=e.data?.customData?.content;return D(`CSS region ${t}: \
2
2
  offset ${e.sourceOffsets[0]}-${e.sourceOffsets[0]+e.lengths[0]}, \
3
- length ${e.lengths[0]}`),{id:e.data?.customData?.embeddedId,languageId:`css`,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>e.lengths[0],getChangeRange:()=>void 0},mappings:[e],embeddedCodes:[]}})):this.embeddedCodes=[],S){D(`CSS embedded codes:`,(this.embeddedCodes||[]).length),D(`Using transpiled code, mapping count:`,this.mappings.length),D(`Original code length:`,t.length),D(`Generated code length:`,this.generatedCode.length),D(`Last 100 chars of original:`,JSON.stringify(t.slice(-100))),D(`Last 200 chars of generated:`,JSON.stringify(this.generatedCode.slice(-200))),D(`Last few mappings:`);let e=Math.max(0,this.mappings.length-5);for(let t=e;t<this.mappings.length;t++){let e=this.mappings[t];D(` Mapping ${t}: source[${e.sourceOffsets[0]}:${e.sourceOffsets[0]+e.lengths[0]}] -> gen[${e.generatedOffsets[0]}:${e.generatedOffsets[0]+e.lengths[0]}], len=${e.lengths[0]}, completion=${e.data?.completion}`)}}this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}else D(`Compilation failed, only display where the compilation error occurred.`),this.originalCode=t,this.generatedCode=t,this.mappings=[{sourceOffsets:[0],generatedOffsets:[0],lengths:[t.length],generatedLengths:[t.length],data:{verification:!0,customData:{}}}],this.embeddedCodes=R(t),this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}#n(){if(!(this.#e||this.#t)){this.#e=new Map,this.#t=new Map;for(var e,t,n,r,i,a,o,s,c,l=0;l<this.mappings.length;l++)e=this.mappings[l],t=e.generatedOffsets[0],n=e.generatedLengths[0],r=t+n,i=`${t}-${r}`,this.#e.set(i,e),a=e.sourceOffsets[0],o=e.lengths[0],s=a+o,c=`${a}-${s}`,this.#t.set(c,e)}}findMappingByGeneratedRange(e,t){return this.#n(),this.#e.get(`${e}-${t}`)??null}findMappingBySourceRange(e,t){return this.#n(),this.#t.get(`${e}-${t}`)??null}};function I(e,t){for(let n of t){let t=n&&typeof n==`object`&&`message`in n?String(n.message):String(n),r=`${e}\0${t}`;A.has(r)||(A.add(r),console.error(`[tsrx-tsc] ${e}: ${t}`))}}function L(e,t,n){if(typeof e.compile==`function`)try{let r=e.compile(t,n,{loose:!0}),i=typeof r?.code==`string`?r.code:typeof r?.js?.code==`string`?r.js.code:void 0;if(i!==void 0)return{code:i,errors:r?.errors??[]}}catch(e){k(`Fallback compilation failed for`,n,`:`,e)}}function R(e){let t=[],n=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[0],n=r[1],a=r.index+(e.indexOf(`>`)+1),o=n.length;D(`Extracted CSS region ${i}: offset ${a}, length ${o}`);let s={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:`style_${i}`}}};t.push({id:`style_${i}`,languageId:`css`,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>o,getChangeRange:()=>void 0},mappings:[s],embeddedCodes:[]}),i++}return t.length>0&&D(`Extracted ${t.length} CSS embedded codes from style tags`),t}function z(e,t){let n=null;for(let r of e.mappings)if(r.sourceOffsets[0]+r.lengths[0]===t){n=r;break}if(!n)return null;let r=n.generatedLengths[0],i=n.generatedOffsets[0]+r;e.code=e.code.substring(0,i)+`.`+e.code.substring(i);let a={sourceOffsets:[t],generatedOffsets:[i],lengths:[1],generatedLengths:[1],data:{...n.data}},o=e.mappings.indexOf(n);e.mappings.splice(o+1,0,a);for(let r of e.mappings)r!==n&&r!==a&&r.generatedOffsets[0]>=i&&(r.generatedOffsets[0]+=1),r!==n&&r!==a&&r.sourceOffsets[0]>=t&&(r.sourceOffsets[0]+=1);return i}const B=new Map,V=new Map;function H(e){return typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`)}function U(e,t=l.default.existsSync){let n=e,r=[];for(;n;){if(V.has(n)){let e=V.get(n)??null;for(let t of r)V.set(t,e);return e}r.push(n);let e=u.default.join(n,`package.json`);if(t(e))try{let t=JSON.parse(l.default.readFileSync(e,`utf8`)),n=new Set([...Object.keys(t.dependencies??{}),...Object.keys(t.devDependencies??{}),...Object.keys(t.peerDependencies??{}),...Object.keys(t.optionalDependencies??{})]),i={name:typeof t.name==`string`?t.name:null,dependencies:n};for(let e of r)V.set(e,i);return i}catch{for(let e of r)V.set(e,null);return null}let i=u.default.dirname(n);if(i===n)break;n=i}for(let e of r)V.set(e,null);return null}function W(e,t,n){if(!e)return!1;if(e.name===t||n.includes(e.name??``)||e.dependencies.has(t))return!0;for(let t of n)if(e.dependencies.has(t))return!0;return!1}function G(e){let t=q(e);if(t)return T(t)}function K(e,t=l.default.existsSync,n=B){let r=e.split(`/`),i=u.default.extname(e);for(let e=r.length-2;e>=0;e--){let a=r.slice(0,e+1).join(`/`),o=a+`\0`+i;if(!n.has(o)){let e=[];for(let[n,r,o,s]of M){if(!o.includes(i))continue;let c=[a,...r,`src`,`index.js`].join(`/`);t(c)&&e.push([n,c,s])}let r=null;if(e.length>0){let n=U(a,t);r=e.find(([e,,t])=>W(n,e,t))?.[1]??e[0][1],D(`Found tsrx compiler at:`,r,`for extension:`,i)}n.set(o,r)}let s=n.get(o);if(s)return s}}function q(e){let t=u.default.extname(e),n=U(u.default.dirname(e)),r=K(e);if(r)return r;let i=`No supported tsrx compiler found in workspace for ${e}.`,a=E;for(;a;){let e=[];for(let[n,r,i,o]of M){if(!i.includes(t))continue;let s=u.default.join(a,...r),c=u.default.join(s,`src`,`index.js`);l.default.existsSync(c)&&e.push([n,c,o])}if(e.length>0){let t=e.find(([e,,t])=>W(n,e,t))?.[1]??e[0][1];return O(`${i} Using packaged version at ${t}`),t}let r=u.default.dirname(a);if(r===a)break;a=r}}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return P}});
4
- //# sourceMappingURL=language-DZrsi_P6.js.map
3
+ length ${e.lengths[0]}`),{id:e.data?.customData?.embeddedId,languageId:`css`,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>e.lengths[0],getChangeRange:()=>void 0},mappings:[e],embeddedCodes:[]}})):this.embeddedCodes=[],S){D(`CSS embedded codes:`,(this.embeddedCodes||[]).length),D(`Using transpiled code, mapping count:`,this.mappings.length),D(`Original code length:`,t.length),D(`Generated code length:`,this.generatedCode.length),D(`Last 100 chars of original:`,JSON.stringify(t.slice(-100))),D(`Last 200 chars of generated:`,JSON.stringify(this.generatedCode.slice(-200))),D(`Last few mappings:`);let e=Math.max(0,this.mappings.length-5);for(let t=e;t<this.mappings.length;t++){let e=this.mappings[t];D(` Mapping ${t}: source[${e.sourceOffsets[0]}:${e.sourceOffsets[0]+e.lengths[0]}] -> gen[${e.generatedOffsets[0]}:${e.generatedOffsets[0]+e.lengths[0]}], len=${e.lengths[0]}, completion=${e.data?.completion}`)}}this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}else D(`Compilation failed, only display where the compilation error occurred.`),this.originalCode=t,this.generatedCode=t,this.mappings=[{sourceOffsets:[0],generatedOffsets:[0],lengths:[t.length],generatedLengths:[t.length],data:{verification:!0,customData:{}}}],this.embeddedCodes=R(t),this.snapshot={getText:(e,t)=>this.generatedCode.substring(e,t),getLength:()=>this.generatedCode.length,getChangeRange:()=>void 0}}#n(){if(!(this.#e||this.#t)){this.#e=new Map,this.#t=new Map;for(var e,t,n,r,i,a,o,s,c,l=0;l<this.mappings.length;l++)e=this.mappings[l],t=e.generatedOffsets[0],n=e.generatedLengths[0],r=t+n,i=`${t}-${r}`,this.#e.set(i,e),a=e.sourceOffsets[0],o=e.lengths[0],s=a+o,c=`${a}-${s}`,this.#t.set(c,e)}}findMappingByGeneratedRange(e,t){return this.#n(),this.#e.get(`${e}-${t}`)??null}findMappingBySourceRange(e,t){return this.#n(),this.#t.get(`${e}-${t}`)??null}};function I(e,t){for(let n of t){let t=n&&typeof n==`object`&&`message`in n?String(n.message):String(n),r=`${e}\0${t}`;A.has(r)||(A.add(r),console.error(`[tsrx-tsc] ${e}: ${t}`))}}function L(e,t,n){if(typeof e.compile==`function`)try{let r=e.compile(t,n,{loose:!0});if(typeof r?.code==`string`)return{code:r.code,errors:r?.errors??[]}}catch(e){k(`Fallback compilation failed for`,n,`:`,e)}}function R(e){let t=[],n=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,r,i=0;for(;(r=n.exec(e))!==null;){let e=r[0],n=r[1],a=r.index+(e.indexOf(`>`)+1),o=n.length;D(`Extracted CSS region ${i}: offset ${a}, length ${o}`);let s={sourceOffsets:[a],generatedOffsets:[0],lengths:[o],generatedLengths:[o],data:{verification:!0,completion:!0,semantic:!0,navigation:!0,structure:!0,format:!1,customData:{content:n,embeddedId:`style_${i}`}}};t.push({id:`style_${i}`,languageId:`css`,snapshot:{getText:(e,t)=>n.substring(e,t),getLength:()=>o,getChangeRange:()=>void 0},mappings:[s],embeddedCodes:[]}),i++}return t.length>0&&D(`Extracted ${t.length} CSS embedded codes from style tags`),t}function z(e,t){let n=null;for(let r of e.mappings)if(r.sourceOffsets[0]+r.lengths[0]===t){n=r;break}if(!n)return null;let r=n.generatedLengths[0],i=n.generatedOffsets[0]+r;e.code=e.code.substring(0,i)+`.`+e.code.substring(i);let a={sourceOffsets:[t],generatedOffsets:[i],lengths:[1],generatedLengths:[1],data:{...n.data}},o=e.mappings.indexOf(n);e.mappings.splice(o+1,0,a);for(let r of e.mappings)r!==n&&r!==a&&r.generatedOffsets[0]>=i&&(r.generatedOffsets[0]+=1),r!==n&&r!==a&&r.sourceOffsets[0]>=t&&(r.sourceOffsets[0]+=1);return i}const B=new Map,V=new Map;function H(e){return typeof e==`string`?e:e.fsPath.replace(/\\/g,`/`)}function U(e,t=l.default.existsSync){let n=e,r=[];for(;n;){if(V.has(n)){let e=V.get(n)??null;for(let t of r)V.set(t,e);return e}r.push(n);let e=u.default.join(n,`package.json`);if(t(e))try{let t=JSON.parse(l.default.readFileSync(e,`utf8`)),n=new Set([...Object.keys(t.dependencies??{}),...Object.keys(t.devDependencies??{}),...Object.keys(t.peerDependencies??{}),...Object.keys(t.optionalDependencies??{})]),i={name:typeof t.name==`string`?t.name:null,dependencies:n};for(let e of r)V.set(e,i);return i}catch{for(let e of r)V.set(e,null);return null}let i=u.default.dirname(n);if(i===n)break;n=i}for(let e of r)V.set(e,null);return null}function W(e,t,n){if(!e)return!1;if(e.name===t||n.includes(e.name??``)||e.dependencies.has(t))return!0;for(let t of n)if(e.dependencies.has(t))return!0;return!1}function G(e){let t=q(e);if(t)return T(t)}function K(e,t=l.default.existsSync,n=B){let r=e.split(`/`),i=u.default.extname(e);for(let e=r.length-2;e>=0;e--){let a=r.slice(0,e+1).join(`/`),o=a+`\0`+i;if(!n.has(o)){let e=[];for(let[n,r,o,s]of M){if(!o.includes(i))continue;let c=[a,...r,`src`,`index.js`].join(`/`);t(c)&&e.push([n,c,s])}let r=null;if(e.length>0){let n=U(a,t);r=e.find(([e,,t])=>W(n,e,t))?.[1]??e[0][1],D(`Found tsrx compiler at:`,r,`for extension:`,i)}n.set(o,r)}let s=n.get(o);if(s)return s}}function q(e){let t=u.default.extname(e),n=U(u.default.dirname(e)),r=K(e);if(r)return r;let i=`No supported tsrx compiler found in workspace for ${e}.`,a=E;for(;a;){let e=[];for(let[n,r,i,o]of M){if(!i.includes(t))continue;let s=u.default.join(a,...r),c=u.default.join(s,`src`,`index.js`);l.default.existsSync(c)&&e.push([n,c,o])}if(e.length>0){let t=e.find(([e,,t])=>W(n,e,t))?.[1]??e[0][1];return O(`${i} Using packaged version at ${t}`),t}let r=u.default.dirname(a);if(r===a)break;a=r}}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return P}});
4
+ //# sourceMappingURL=language-CAqwRK_u.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-CAqwRK_u.js","names":["exports","exports","require","#mappingGenToSource","#mappingSourceToGen","#buildMappingCache"],"sources":["../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/binarySearch.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/translateOffset.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/sourceMap.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/index.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/editor.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/linkedCodeMap.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/types.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/utils.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/index.js","../src/utils.js","../src/language.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.binarySearch = binarySearch;\nfunction binarySearch(values, searchValue) {\n let low = 0;\n let high = values.length - 1;\n let match;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const midValue = values[mid];\n if (midValue < searchValue) {\n low = mid + 1;\n }\n else if (midValue > searchValue) {\n high = mid - 1;\n }\n else {\n low = mid;\n high = mid;\n match = mid;\n break;\n }\n }\n const finalLow = Math.max(Math.min(low, high, values.length - 1), 0);\n const finalHigh = Math.min(Math.max(low, high, 0), values.length - 1);\n return { low: finalLow, high: finalHigh, match };\n}\n//# sourceMappingURL=binarySearch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.translateOffset = translateOffset;\nlet warned = false;\nfunction translateOffset(start, fromOffsets, toOffsets, fromLengths, toLengths = fromLengths, preferEnd = false) {\n const isSorted = fromOffsets.every((value, index) => index === 0 || fromOffsets[index - 1] <= value);\n if (!isSorted) {\n for (let i = 0; i < fromOffsets.length; i++) {\n const fromOffset = fromOffsets[i];\n const fromLength = fromLengths[i];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[i];\n const toOffset = toOffsets[i];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n }\n if (!warned) {\n warned = true;\n console.warn('fromOffsets should be sorted in ascending order');\n }\n }\n let low = 0;\n let high = fromOffsets.length - 1;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const fromOffset = fromOffsets[mid];\n const fromLength = fromLengths[mid];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[mid];\n const toOffset = toOffsets[mid];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n else if (start < fromOffset) {\n high = mid - 1;\n }\n else {\n low = mid + 1;\n }\n }\n}\n//# sourceMappingURL=translateOffset.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SourceMap = void 0;\nconst binarySearch_1 = require(\"./binarySearch\");\nconst translateOffset_1 = require(\"./translateOffset\");\nclass SourceMap {\n constructor(mappings) {\n this.mappings = mappings;\n }\n toSourceRange(generatedStart, generatedEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(generatedStart, generatedEnd, fallbackToAnyMatch, 'generatedOffsets', filter);\n }\n toGeneratedRange(sourceStart, sourceEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(sourceStart, sourceEnd, fallbackToAnyMatch, 'sourceOffsets', filter);\n }\n toSourceLocation(generatedOffset, filter) {\n return this.findMatchingOffsets(generatedOffset, 'generatedOffsets', filter);\n }\n toGeneratedLocation(sourceOffset, filter) {\n return this.findMatchingOffsets(sourceOffset, 'sourceOffsets', filter);\n }\n *findMatchingOffsets(offset, fromRange, filter, preferEnd = false) {\n const memo = this.getMemoBasedOnRange(fromRange);\n if (memo.offsets.length === 0) {\n return;\n }\n const { low: start, high: end } = (0, binarySearch_1.binarySearch)(memo.offsets, offset);\n const skip = new Set();\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n for (let i = start; i <= end; i++) {\n for (const mapping of memo.mappings[i]) {\n if (skip.has(mapping)) {\n continue;\n }\n skip.add(mapping);\n if (filter && !filter(mapping.data)) {\n continue;\n }\n const mapped = (0, translateOffset_1.translateOffset)(offset, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mapped !== undefined) {\n yield [mapped, mapping];\n }\n }\n }\n }\n *findMatchingStartEnd(start, end, fallbackToAnyMatch, fromRange, filter) {\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n const preferEnd = toRange === 'sourceOffsets';\n const mappedStarts = [];\n let hadMatch = false;\n for (const [mappedStart, mapping] of this.findMatchingOffsets(start, fromRange)) {\n if (filter && !filter(mapping.data)) {\n continue;\n }\n mappedStarts.push([mappedStart, mapping]);\n const mappedEnd = (0, translateOffset_1.translateOffset)(end, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mappedEnd !== undefined) {\n hadMatch = true;\n yield [mappedStart, mappedEnd, mapping, mapping];\n }\n }\n if (!hadMatch && fallbackToAnyMatch) {\n for (const [mappedStart, mappingStart] of mappedStarts) {\n for (const [mappedEnd, mappingEnd] of this.findMatchingOffsets(end, fromRange, undefined, preferEnd)) {\n if (filter && !filter(mappingEnd.data) || mappedEnd < mappedStart) {\n continue;\n }\n yield [mappedStart, mappedEnd, mappingStart, mappingEnd];\n break;\n }\n }\n }\n }\n getMemoBasedOnRange(fromRange) {\n return fromRange === 'sourceOffsets'\n ? this.sourceCodeOffsetsMemo ??= this.createMemo('sourceOffsets')\n : this.generatedCodeOffsetsMemo ??= this.createMemo('generatedOffsets');\n }\n createMemo(key) {\n const offsetsSet = new Set();\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n offsetsSet.add(mapping[key][i]);\n offsetsSet.add(mapping[key][i] + getLengths(mapping, key)[i]);\n }\n }\n const offsets = [...offsetsSet].sort((a, b) => a - b);\n const mappings = offsets.map(() => new Set());\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n const startIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i]).match;\n const endIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i] + getLengths(mapping, key)[i]).match;\n for (let i = startIndex; i <= endIndex; i++) {\n mappings[i].add(mapping);\n }\n }\n }\n return { offsets, mappings };\n }\n}\nexports.SourceMap = SourceMap;\nfunction getLengths(mapping, key) {\n return key === 'sourceOffsets' ? mapping.lengths : mapping.generatedLengths ?? mapping.lengths;\n}\n//# sourceMappingURL=sourceMap.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/sourceMap\"), exports);\n__exportStar(require(\"./lib/translateOffset\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isHoverEnabled = isHoverEnabled;\nexports.isInlayHintsEnabled = isInlayHintsEnabled;\nexports.isCodeLensEnabled = isCodeLensEnabled;\nexports.isMonikerEnabled = isMonikerEnabled;\nexports.isInlineValueEnabled = isInlineValueEnabled;\nexports.isSemanticTokensEnabled = isSemanticTokensEnabled;\nexports.isCallHierarchyEnabled = isCallHierarchyEnabled;\nexports.isTypeHierarchyEnabled = isTypeHierarchyEnabled;\nexports.isRenameEnabled = isRenameEnabled;\nexports.isDefinitionEnabled = isDefinitionEnabled;\nexports.isTypeDefinitionEnabled = isTypeDefinitionEnabled;\nexports.isReferencesEnabled = isReferencesEnabled;\nexports.isImplementationEnabled = isImplementationEnabled;\nexports.isHighlightEnabled = isHighlightEnabled;\nexports.isSymbolsEnabled = isSymbolsEnabled;\nexports.isFoldingRangesEnabled = isFoldingRangesEnabled;\nexports.isSelectionRangesEnabled = isSelectionRangesEnabled;\nexports.isLinkedEditingEnabled = isLinkedEditingEnabled;\nexports.isColorEnabled = isColorEnabled;\nexports.isDocumentLinkEnabled = isDocumentLinkEnabled;\nexports.isDiagnosticsEnabled = isDiagnosticsEnabled;\nexports.isCodeActionsEnabled = isCodeActionsEnabled;\nexports.isFormattingEnabled = isFormattingEnabled;\nexports.isCompletionEnabled = isCompletionEnabled;\nexports.isAutoInsertEnabled = isAutoInsertEnabled;\nexports.isSignatureHelpEnabled = isSignatureHelpEnabled;\nexports.shouldReportDiagnostics = shouldReportDiagnostics;\nexports.resolveRenameNewName = resolveRenameNewName;\nexports.resolveRenameEditText = resolveRenameEditText;\nexports.findOverlapCodeRange = findOverlapCodeRange;\nfunction isHoverEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlayHintsEnabled(info) {\n return !!info.semantic;\n}\nfunction isCodeLensEnabled(info) {\n return !!info.semantic;\n}\nfunction isMonikerEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlineValueEnabled(info) {\n return !!info.semantic;\n}\nfunction isSemanticTokensEnabled(info) {\n return typeof info.semantic === 'object'\n ? info.semantic.shouldHighlight?.() ?? true\n : !!info.semantic;\n}\nfunction isCallHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isRenameEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldRename?.() ?? true\n : !!info.navigation;\n}\nfunction isDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isReferencesEnabled(info) {\n return !!info.navigation;\n}\nfunction isImplementationEnabled(info) {\n return !!info.navigation;\n}\nfunction isHighlightEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldHighlight?.() ?? true\n : !!info.navigation;\n}\nfunction isSymbolsEnabled(info) {\n return !!info.structure;\n}\nfunction isFoldingRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isSelectionRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isLinkedEditingEnabled(info) {\n return !!info.structure;\n}\nfunction isColorEnabled(info) {\n return !!info.structure;\n}\nfunction isDocumentLinkEnabled(info) {\n return !!info.structure;\n}\nfunction isDiagnosticsEnabled(info) {\n return !!info.verification;\n}\nfunction isCodeActionsEnabled(info) {\n return !!info.verification;\n}\nfunction isFormattingEnabled(info) {\n return !!info.format;\n}\nfunction isCompletionEnabled(info) {\n return !!info.completion;\n}\nfunction isAutoInsertEnabled(info) {\n return !!info.completion;\n}\nfunction isSignatureHelpEnabled(info) {\n return !!info.completion;\n}\n// should...\nfunction shouldReportDiagnostics(info, source, code) {\n return typeof info.verification === 'object'\n ? info.verification.shouldReport?.(source, code) ?? true\n : !!info.verification;\n}\n// resolve...\nfunction resolveRenameNewName(newName, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameNewName?.(newName) ?? newName\n : newName;\n}\nfunction resolveRenameEditText(text, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameEditText?.(text) ?? text\n : text;\n}\nfunction findOverlapCodeRange(start, end, map, filter) {\n let mappedStart;\n let mappedEnd;\n for (const [mapped, mapping] of map.toGeneratedLocation(start)) {\n if (filter(mapping.data)) {\n mappedStart = mapped;\n break;\n }\n }\n for (const [mapped, mapping] of map.toGeneratedLocation(end)) {\n if (filter(mapping.data)) {\n mappedEnd = mapped;\n break;\n }\n }\n if (mappedStart === undefined || mappedEnd === undefined) {\n for (const mapping of map.mappings) {\n if (filter(mapping.data)) {\n const mappingStart = mapping.sourceOffsets[0];\n const mappingEnd = mapping.sourceOffsets[mapping.sourceOffsets.length - 1]\n + mapping.lengths[mapping.lengths.length - 1];\n const overlap = getOverlapRange(start, end, mappingStart, mappingEnd);\n if (overlap) {\n const curMappedStart = (overlap.start - mappingStart) + mapping.generatedOffsets[0];\n const lastGeneratedLength = (mapping.generatedLengths ?? mapping.lengths)[mapping.generatedOffsets.length - 1];\n const curMappedEndOffset = Math.min(overlap.end - mapping.sourceOffsets[mapping.sourceOffsets.length - 1], lastGeneratedLength);\n const curMappedEnd = mapping.generatedOffsets[mapping.generatedOffsets.length - 1] + curMappedEndOffset;\n mappedStart = mappedStart === undefined ? curMappedStart : Math.min(mappedStart, curMappedStart);\n mappedEnd = mappedEnd === undefined ? curMappedEnd : Math.max(mappedEnd, curMappedEnd);\n }\n }\n }\n }\n if (mappedStart !== undefined && mappedEnd !== undefined) {\n return {\n start: mappedStart,\n end: mappedEnd,\n };\n }\n}\nfunction getOverlapRange(range1Start, range1End, range2Start, range2End) {\n const start = Math.max(range1Start, range2Start);\n const end = Math.min(range1End, range2End);\n if (start > end) {\n return undefined;\n }\n return {\n start,\n end,\n };\n}\n//# sourceMappingURL=editor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedCodeMap = void 0;\nconst source_map_1 = require(\"@volar/source-map\");\nclass LinkedCodeMap extends source_map_1.SourceMap {\n *getLinkedOffsets(start) {\n for (const mapped of this.toGeneratedLocation(start)) {\n yield mapped[0];\n }\n for (const mapped of this.toSourceLocation(start)) {\n yield mapped[0];\n }\n }\n}\nexports.LinkedCodeMap = LinkedCodeMap;\n//# sourceMappingURL=linkedCodeMap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileMap = void 0;\nclass FileMap extends Map {\n constructor(caseSensitive) {\n super();\n this.caseSensitive = caseSensitive;\n this.originalFileNames = new Map();\n }\n keys() {\n return this.originalFileNames.values();\n }\n get(key) {\n return super.get(this.normalizeId(key));\n }\n has(key) {\n return super.has(this.normalizeId(key));\n }\n set(key, value) {\n this.originalFileNames.set(this.normalizeId(key), key);\n return super.set(this.normalizeId(key), value);\n }\n delete(key) {\n this.originalFileNames.delete(this.normalizeId(key));\n return super.delete(this.normalizeId(key));\n }\n clear() {\n this.originalFileNames.clear();\n return super.clear();\n }\n normalizeId(id) {\n return this.caseSensitive ? id : id.toLowerCase();\n }\n}\nexports.FileMap = FileMap;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultMapperFactory = exports.SourceMap = void 0;\nexports.createLanguage = createLanguage;\nexports.forEachEmbeddedCode = forEachEmbeddedCode;\nvar source_map_1 = require(\"@volar/source-map\");\nObject.defineProperty(exports, \"SourceMap\", { enumerable: true, get: function () { return source_map_1.SourceMap; } });\n__exportStar(require(\"./lib/editor\"), exports);\n__exportStar(require(\"./lib/linkedCodeMap\"), exports);\n__exportStar(require(\"./lib/types\"), exports);\n__exportStar(require(\"./lib/utils\"), exports);\nconst source_map_2 = require(\"@volar/source-map\");\nconst linkedCodeMap_1 = require(\"./lib/linkedCodeMap\");\nconst defaultMapperFactory = mappings => new source_map_2.SourceMap(mappings);\nexports.defaultMapperFactory = defaultMapperFactory;\nfunction createLanguage(plugins, scriptRegistry, sync, onAssociationDirty) {\n const virtualCodeToSourceScriptMap = new WeakMap();\n const virtualCodeToSourceMap = new WeakMap();\n const virtualCodeToLinkedCodeMap = new WeakMap();\n const language = {\n mapperFactory: exports.defaultMapperFactory,\n plugins,\n scripts: {\n fromVirtualCode(virtualCode) {\n return virtualCodeToSourceScriptMap.get(virtualCode);\n },\n get(id, includeFsFiles = true, shouldRegister = false) {\n sync(id, includeFsFiles, shouldRegister);\n const result = scriptRegistry.get(id);\n // The sync function provider may not always call the set function due to caching, so it is necessary to explicitly check isAssociationDirty.\n if (result?.isAssociationDirty) {\n this.set(id, result.snapshot, result.languageId);\n }\n return scriptRegistry.get(id);\n },\n set(id, snapshot, languageId, _plugins = plugins) {\n if (!languageId) {\n for (const plugin of plugins) {\n languageId = plugin.getLanguageId?.(id);\n if (languageId) {\n break;\n }\n }\n }\n if (!languageId) {\n console.warn(`languageId not found for ${String(id)}`);\n return;\n }\n let associatedOnly = false;\n for (const plugin of plugins) {\n if (plugin.isAssociatedFileOnly?.(id, languageId)) {\n associatedOnly = true;\n break;\n }\n }\n if (scriptRegistry.has(id)) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript.languageId !== languageId || sourceScript.associatedOnly !== associatedOnly) {\n this.delete(id);\n triggerTargetsDirty(sourceScript);\n return this.set(id, snapshot, languageId);\n }\n else if (associatedOnly) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n }\n else if (sourceScript.isAssociationDirty || sourceScript.snapshot !== snapshot) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n const codegenCtx = prepareCreateVirtualCode(sourceScript);\n if (sourceScript.generated) {\n const { updateVirtualCode, createVirtualCode } = sourceScript.generated.languagePlugin;\n const newVirtualCode = updateVirtualCode\n ? updateVirtualCode(id, sourceScript.generated.root, snapshot, codegenCtx)\n : createVirtualCode?.(id, languageId, snapshot, codegenCtx);\n if (newVirtualCode) {\n sourceScript.generated.root = newVirtualCode;\n sourceScript.generated.embeddedCodes.clear();\n for (const code of forEachEmbeddedCode(sourceScript.generated.root)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n return sourceScript;\n }\n else {\n this.delete(id);\n return;\n }\n }\n }\n else {\n // not changed\n return sourceScript;\n }\n }\n else {\n // created\n const sourceScript = {\n id: id,\n languageId,\n snapshot,\n associatedIds: new Set(),\n targetIds: new Set(),\n associatedOnly,\n };\n scriptRegistry.set(id, sourceScript);\n if (associatedOnly) {\n return sourceScript;\n }\n for (const languagePlugin of _plugins) {\n const virtualCode = languagePlugin.createVirtualCode?.(id, languageId, snapshot, prepareCreateVirtualCode(sourceScript));\n if (virtualCode) {\n sourceScript.generated = {\n root: virtualCode,\n languagePlugin,\n embeddedCodes: new Map(),\n };\n for (const code of forEachEmbeddedCode(virtualCode)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n break;\n }\n }\n return sourceScript;\n }\n },\n delete(id) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.generated?.languagePlugin.disposeVirtualCode?.(id, sourceScript.generated.root);\n scriptRegistry.delete(id);\n triggerTargetsDirty(sourceScript);\n }\n },\n },\n maps: {\n get(virtualCode, sourceScript) {\n let mapCache = virtualCodeToSourceMap.get(virtualCode.snapshot);\n if (!mapCache) {\n virtualCodeToSourceMap.set(virtualCode.snapshot, mapCache = new WeakMap());\n }\n if (!mapCache.has(sourceScript.snapshot)) {\n const mappings = virtualCode.associatedScriptMappings?.get(sourceScript.id) ?? virtualCode.mappings;\n mapCache.set(sourceScript.snapshot, language.mapperFactory(mappings));\n }\n return mapCache.get(sourceScript.snapshot);\n },\n *forEach(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n yield [\n sourceScript,\n this.get(virtualCode, sourceScript),\n ];\n if (virtualCode.associatedScriptMappings) {\n for (const [relatedScriptId] of virtualCode.associatedScriptMappings) {\n const relatedSourceScript = scriptRegistry.get(relatedScriptId);\n if (relatedSourceScript) {\n yield [\n relatedSourceScript,\n this.get(virtualCode, relatedSourceScript),\n ];\n }\n }\n }\n },\n },\n linkedCodeMaps: {\n get(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n let mapCache = virtualCodeToLinkedCodeMap.get(virtualCode.snapshot);\n if (mapCache?.[0] !== sourceScript.snapshot) {\n virtualCodeToLinkedCodeMap.set(virtualCode.snapshot, mapCache = [\n sourceScript.snapshot,\n virtualCode.linkedCodeMappings\n ? new linkedCodeMap_1.LinkedCodeMap(virtualCode.linkedCodeMappings)\n : undefined,\n ]);\n }\n return mapCache[1];\n },\n },\n };\n return language;\n function triggerTargetsDirty(sourceScript) {\n sourceScript.targetIds.forEach(id => {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.isAssociationDirty = true;\n onAssociationDirty?.(sourceScript.id);\n }\n });\n }\n function prepareCreateVirtualCode(sourceScript) {\n for (const id of sourceScript.associatedIds) {\n scriptRegistry.get(id)?.targetIds.delete(sourceScript.id);\n }\n sourceScript.associatedIds.clear();\n sourceScript.isAssociationDirty = false;\n return {\n getAssociatedScript(id) {\n sync(id, true, true);\n const relatedSourceScript = scriptRegistry.get(id);\n if (relatedSourceScript) {\n relatedSourceScript.targetIds.add(sourceScript.id);\n sourceScript.associatedIds.add(relatedSourceScript.id);\n }\n return relatedSourceScript;\n },\n };\n }\n}\nfunction* forEachEmbeddedCode(virtualCode) {\n yield virtualCode;\n if (virtualCode.embeddedCodes) {\n for (const embeddedCode of virtualCode.embeddedCodes) {\n yield* forEachEmbeddedCode(embeddedCode);\n }\n }\n}\n//# sourceMappingURL=index.js.map","export const DEBUG = process.env.RIPPLE_DEBUG === 'true';\n// Matches valid JS/CSS identifier characters: word chars, dashes (CSS), $, and # (Ripple shorthands)\nexport const charAllowedWordRegex = /[\\w\\-$#]/;\n\n/**\n * Create a logging utility with a specific label\n * @param {string} label\n * @returns {{\n * \tlog: (...args: unknown[]) => void,\n * \tlogError: (...args: unknown[]) => void,\n * \tlogWarning: (...args: unknown[]) => void,\n * }}\n */\nexport function createLogging(label) {\n\treturn {\n\t\tlog(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.log(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogError(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.error(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogWarning(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.warn(label, ...args);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Get the word at a specific position in the text\n * @param {string} text\n * @param {number} start\n * @returns {{word: string, start: number, end: number}}\n */\nexport function getWordFromPosition(text, start) {\n\tlet wordStart = start;\n\tlet wordEnd = start;\n\twhile (wordStart > 0 && charAllowedWordRegex.test(text[wordStart - 1])) {\n\t\twordStart--;\n\t}\n\twhile (wordEnd < text.length && charAllowedWordRegex.test(text[wordEnd])) {\n\t\twordEnd++;\n\t}\n\n\tconst word = text.substring(wordStart, wordEnd);\n\n\treturn {\n\t\tword,\n\t\tstart: wordStart,\n\t\tend: wordEnd,\n\t};\n}\n","/** @import { CodeMapping } from '@tsrx/ripple' */\n/** @import {TSRXCompileError, VolarMappingsResult} from '@tsrx/ripple' */\n\n/** @typedef {{ code?: string, errors?: TSRXCompileError[] }} TSRXCompileResult */\n/** @typedef {{ compile?: (source: string, filename: string, options?: { loose?: boolean }) => TSRXCompileResult, compile_to_volar_mappings(source: string, filename: string, options?: { loose?: boolean }): VolarMappingsResult }} TSRXCompilerModule */\n\n/** @typedef {Map<string, CodeMapping>} CachedMappings */\n/** @typedef {import('typescript').CompilerOptions} CompilerOptions */\n/** @typedef {import('@volar/language-core').IScriptSnapshot} IScriptSnapshot */\n/** @typedef {import('@volar/language-core').VirtualCode} VirtualCode */\n/** @typedef {string | { fsPath: string }} ScriptId */\n// Side-effect import: augments @volar/language-core's LanguagePlugin with the `typescript` field.\n/** @typedef {typeof import('@volar/typescript')} _VolarTypeScriptAugmentation */\n/** @typedef {import('@volar/language-core').LanguagePlugin<ScriptId, VirtualCode>} RippleLanguagePlugin */\n\n/** @typedef {InstanceType<typeof import('./language.js')[\"TSRXVirtualCode\"]>} TSRXVirtualCodeInstance */\n\nimport ts from 'typescript';\nimport { forEachEmbeddedCode } from '@volar/language-core';\nimport fs from 'fs';\nimport path from 'path';\nimport { createRequire } from 'module';\nimport { fileURLToPath } from 'url';\nimport { createLogging, DEBUG } from './utils.js';\n\nconst require = createRequire(import.meta.url);\nconst root_dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst { log, logWarning, logError } = createLogging('[Ripple Language]');\n/** @type {Set<string>} */\nconst loggedCompilationFailures = new Set();\nexport const RIPPLE_EXTENSIONS = ['.tsrx'];\n/** @typedef {[string, string[], string[], string[]]} CompilerCandidate */\n/** @type {CompilerCandidate[]} */\nexport const COMPILER_CANDIDATES = [\n\t[\n\t\t'@tsrx/ripple',\n\t\t['node_modules', '@tsrx', 'ripple'],\n\t\t['.tsrx'],\n\t\t['@tsrx/ripple', 'ripple', '@ripple-ts/vite-plugin', '@ripple-ts/compat-react'],\n\t],\n\t[\n\t\t'@tsrx/react',\n\t\t['node_modules', '@tsrx', 'react'],\n\t\t['.tsrx'],\n\t\t['@tsrx/react', '@tsrx/vite-plugin-react'],\n\t],\n\t[\n\t\t'@tsrx/solid',\n\t\t['node_modules', '@tsrx', 'solid'],\n\t\t['.tsrx'],\n\t\t['@tsrx/solid', '@tsrx/vite-plugin-solid'],\n\t],\n\t[\n\t\t'@tsrx/preact',\n\t\t['node_modules', '@tsrx', 'preact'],\n\t\t['.tsrx'],\n\t\t['@tsrx/preact', '@tsrx/vite-plugin-preact'],\n\t],\n\t[\n\t\t'@tsrx/vue',\n\t\t['node_modules', '@tsrx', 'vue'],\n\t\t['.tsrx'],\n\t\t['@tsrx/vue', '@tsrx/vite-plugin-vue'],\n\t],\n];\n\n/**\n * @param {string} file_name\n * @returns {boolean}\n */\nexport function is_ripple_file(file_name) {\n\treturn RIPPLE_EXTENSIONS.some((extension) => file_name.endsWith(extension));\n}\n\n/**\n * @returns {RippleLanguagePlugin}\n */\nexport function getRippleLanguagePlugin() {\n\tlog('Creating Ripple language plugin...');\n\n\treturn {\n\t\tgetLanguageId(fileNameOrUri) {\n\t\t\tconst file_name =\n\t\t\t\ttypeof fileNameOrUri === 'string'\n\t\t\t\t\t? fileNameOrUri\n\t\t\t\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n\t\t\tif (is_ripple_file(file_name)) {\n\t\t\t\tlog('Identified Ripple file:', file_name);\n\t\t\t\treturn 'ripple';\n\t\t\t}\n\t\t},\n\t\tcreateVirtualCode(fileNameOrUri, languageId, snapshot) {\n\t\t\tif (languageId === 'ripple') {\n\t\t\t\tconst file_name = normalizeFileNameOrUri(fileNameOrUri);\n\t\t\t\tconst ripple = get_tsrx_compiler(file_name);\n\t\t\t\tif (!ripple) {\n\t\t\t\t\tlogError(`Ripple compiler not found for file: ${file_name}`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tlog('Creating virtual code for:', file_name);\n\t\t\t\ttry {\n\t\t\t\t\treturn new TSRXVirtualCode(file_name, snapshot, ripple);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlogError('Failed to create virtual code for:', file_name, ':', err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\tupdateVirtualCode(fileNameOrUri, virtualCode, snapshot) {\n\t\t\tif (virtualCode instanceof TSRXVirtualCode) {\n\t\t\t\tlog('Updating existing virtual code for:', virtualCode.fileName);\n\t\t\t\tvirtualCode.update(snapshot);\n\t\t\t\treturn virtualCode;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\n\t\ttypescript: {\n\t\t\textraFileExtensions: RIPPLE_EXTENSIONS.map((extension) => ({\n\t\t\t\textension: extension.slice(1),\n\t\t\t\tisMixedContent: false,\n\t\t\t\tscriptKind: 7,\n\t\t\t})),\n\t\t\t/**\n\t\t\t * @param {VirtualCode} ripple_code\n\t\t\t */\n\t\t\tgetServiceScript(ripple_code) {\n\t\t\t\tfor (const code of forEachEmbeddedCode(ripple_code)) {\n\t\t\t\t\tif (code.languageId === 'ripple') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\textension: '.tsx',\n\t\t\t\t\t\t\tscriptKind: 4,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * @implements {VirtualCode}\n */\nexport class TSRXVirtualCode {\n\t/** @type {string} */\n\tid = 'root';\n\t/** @type {string} */\n\tlanguageId = 'ripple';\n\t/** @type {unknown[]} */\n\tcodegenStacks = [];\n\t/** @type {TSRXCompilerModule} */\n\ttsrx;\n\t/** @type {string} */\n\tgeneratedCode = '';\n\t/** @type {VirtualCode['embeddedCodes']} */\n\tembeddedCodes = [];\n\t/** @type {CodeMapping[]} */\n\tmappings = [];\n\t/** @type {TSRXCompileError[]} */\n\tfatalErrors = [];\n\t/** @type {TSRXCompileError[]} */\n\tusageErrors = [];\n\t/** @type {IScriptSnapshot} */\n\tsnapshot;\n\t/** @type {IScriptSnapshot} */\n\tsourceSnapshot;\n\t/** @type {string} */\n\toriginalCode = '';\n\t/** @type {unknown[]} */\n\tdiagnostics = [];\n\t/** @type {CachedMappings | null} */\n\t#mappingGenToSource = null;\n\t/** @type {CachedMappings | null} */\n\t#mappingSourceToGen = null;\n\n\t/**\n\t * @param {string} file_name\n\t * @param {IScriptSnapshot} snapshot\n\t * @param {TSRXCompilerModule} tsrx\n\t */\n\tconstructor(file_name, snapshot, tsrx) {\n\t\tlog('Initializing TSRXVirtualCode for:', file_name);\n\n\t\tthis.fileName = file_name;\n\t\tthis.tsrx = tsrx;\n\t\tthis.snapshot = snapshot;\n\t\tthis.sourceSnapshot = snapshot;\n\t\tthis.originalCode = snapshot.getText(0, snapshot.getLength());\n\n\t\t// Validate ripple compiler\n\t\tif (!tsrx || typeof tsrx.compile_to_volar_mappings !== 'function') {\n\t\t\tlogError('Invalid ripple compiler - missing compile_to_volar_mappings method');\n\t\t\tthrow new Error('Invalid ripple compiler');\n\t\t}\n\n\t\tthis.update(snapshot);\n\t}\n\n\t/**\n\t * @param {IScriptSnapshot} snapshot\n\t * @returns {void}\n\t */\n\tupdate(snapshot) {\n\t\tlog('Updating virtual code for:', this.fileName);\n\n\t\tconst newCode = snapshot.getText(0, snapshot.getLength());\n\t\tconst changeRange = snapshot.getChangeRange(this.sourceSnapshot);\n\t\tthis.sourceSnapshot = snapshot;\n\n\t\t// Only clear mapping index - don't update snapshot/originalCode yet\n\t\tthis.#mappingGenToSource = null;\n\t\tthis.#mappingSourceToGen = null;\n\n\t\tthis.fatalErrors = [];\n\t\tthis.usageErrors = [];\n\n\t\t/** @type {VolarMappingsResult | undefined} */\n\t\tlet transpiled;\n\n\t\t// Check if a single \".\" was typed using changeRange\n\t\tlet isDotTyped = false;\n\t\tlet dotPosition = -1;\n\n\t\tlog('changeRange:', JSON.stringify(changeRange));\n\n\t\tif (changeRange) {\n\t\t\tconst changeStart = changeRange.span.start;\n\t\t\tconst changeEnd = changeStart + changeRange.span.length;\n\t\t\tconst newEnd = changeStart + changeRange.newLength;\n\n\t\t\t// Get the old text (what was replaced) from originalCode\n\t\t\tconst oldText = this.originalCode.substring(changeStart, changeEnd);\n\t\t\t// Get the new text (what replaced it) from newCode\n\t\t\tconst newText = newCode.substring(changeStart, newEnd);\n\n\t\t\tlog('Change details:');\n\t\t\tlog(' Position:', changeStart, '-', changeEnd, '(length:', changeRange.span.length, ')');\n\t\t\tlog(' Old text:', JSON.stringify(oldText));\n\t\t\tlog(' New text:', JSON.stringify(newText), '(length:', changeRange.newLength, ')');\n\n\t\t\t// Check if a dot was added at the end of the new text\n\t\t\tif (newText.endsWith('.')) {\n\t\t\t\t// The dot is at position newEnd - 1\n\t\t\t\t// We need to check the character BEFORE the dot (inside the new text)\n\t\t\t\tconst charBeforeDot = newEnd > 1 ? newCode[newEnd - 2] : '';\n\t\t\t\tlog(' Char before dot:', JSON.stringify(charBeforeDot));\n\n\t\t\t\tif (/[$#_\\u200C\\u200D\\p{ID_Continue}\\)\\]\\}]/u.test(charBeforeDot)) {\n\t\t\t\t\tisDotTyped = true;\n\t\t\t\t\tdotPosition = newEnd - 1; // Position of the dot\n\t\t\t\t\tlog('ChangeRange detected dot typed at position', dotPosition);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// If user typed a \".\", compile without it and then stitch it back into\n\t\t\t// the generated output so completions can still resolve.\n\t\t\tif (isDotTyped && dotPosition >= 0) {\n\t\t\t\tconst codeWithoutDot =\n\t\t\t\t\tnewCode.substring(0, dotPosition) + newCode.substring(dotPosition + 1);\n\n\t\t\t\tlog('Compiling without typed dot at position', dotPosition);\n\t\t\t\ttranspiled = this.tsrx.compile_to_volar_mappings(codeWithoutDot, this.fileName, {\n\t\t\t\t\tloose: true,\n\t\t\t\t});\n\t\t\t\tlog('Compilation without dot successful');\n\n\t\t\t\tif (transpiled && transpiled.code && transpiled.mappings.length > 0) {\n\t\t\t\t\tconst insertedDotPosition = restore_typed_dot_in_transpiled_code(transpiled, dotPosition);\n\n\t\t\t\t\tif (insertedDotPosition === null) {\n\t\t\t\t\t\tlogWarning('Failed to restore typed dot into transpiled output');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog('Inserted typed dot at generated position', insertedDotPosition);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Normal compilation\n\t\t\t\tlog('Compiling Ripple code...');\n\t\t\t\ttranspiled = this.tsrx.compile_to_volar_mappings(newCode, this.fileName, {\n\t\t\t\t\tloose: true,\n\t\t\t\t});\n\t\t\t\tlog('Compilation successful, generated code length:', transpiled?.code?.length || 0);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconst error = /** @type {TSRXCompileError} */ (e);\n\t\t\tlogError('Ripple compilation failed for', this.fileName, ':', error);\n\t\t\tif (process.env.TSRX_TSC === 'true') {\n\t\t\t\tlogTSRXErrors(this.fileName, [error]);\n\n\t\t\t\t// In tsrx-tsc, swap in a best-effort transpile so we don't fall through\n\t\t\t\t// to the raw-source fallback below (which would produce a flood of\n\t\t\t\t// bogus TS diagnostics in the CLI output, drowning the real error).\n\t\t\t\t// We surface the loose-mode usage errors collected by `compile` so\n\t\t\t\t// the user still sees the same non-fatal diagnostics they'd get on\n\t\t\t\t// a successful loose-mode compile.\n\t\t\t\tconst fallback = getFallbackGeneratedCode(this.tsrx, newCode, this.fileName);\n\t\t\t\tif (fallback !== undefined) {\n\t\t\t\t\tlogTSRXErrors(this.fileName, fallback.errors);\n\t\t\t\t\ttranspiled = {\n\t\t\t\t\t\tcode: fallback.code,\n\t\t\t\t\t\tmappings: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsourceOffsets: [0],\n\t\t\t\t\t\t\t\tgeneratedOffsets: [0],\n\t\t\t\t\t\t\t\tlengths: [newCode.length],\n\t\t\t\t\t\t\t\tgeneratedLengths: [fallback.code.length],\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tverification: false,\n\t\t\t\t\t\t\t\t\tcustomData: {},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\terrors: fallback.errors,\n\t\t\t\t\t\tcssMappings: [],\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\terror.type = 'fatal';\n\t\t\tthis.fatalErrors.push(error);\n\t\t}\n\n\t\tif (transpiled && transpiled.code) {\n\t\t\t// Successful compilation - update everything\n\t\t\tthis.originalCode = newCode;\n\t\t\tthis.generatedCode = transpiled.code;\n\t\t\tthis.mappings = transpiled.mappings ?? [];\n\t\t\tthis.usageErrors = transpiled.errors;\n\n\t\t\tif (process.env.TSRX_TSC === 'true' && transpiled.errors.length > 0) {\n\t\t\t\tlogTSRXErrors(this.fileName, transpiled.errors);\n\t\t\t}\n\n\t\t\tconst cssMappings = transpiled.cssMappings;\n\t\t\tif (cssMappings.length > 0) {\n\t\t\t\tlog('Creating', cssMappings.length, 'CSS embedded codes');\n\n\t\t\t\tthis.embeddedCodes = cssMappings.map((mapping, index) => {\n\t\t\t\t\tconst cssContent = /** @type {string} */ (mapping.data?.customData?.content);\n\t\t\t\t\tlog(\n\t\t\t\t\t\t`CSS region ${index}: \\\n\t\t\t\t\t\toffset ${mapping.sourceOffsets[0]}-${mapping.sourceOffsets[0] + mapping.lengths[0]}, \\\n\t\t\t\t\t\tlength ${mapping.lengths[0]}`,\n\t\t\t\t\t);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: /** @type {string} */ (mapping.data?.customData?.embeddedId),\n\t\t\t\t\t\tlanguageId: 'css',\n\t\t\t\t\t\tsnapshot: {\n\t\t\t\t\t\t\tgetText: (/** @type {number} */ start, /** @type {number} */ end) =>\n\t\t\t\t\t\t\t\tcssContent.substring(start, end),\n\t\t\t\t\t\t\tgetLength: () => mapping.lengths[0],\n\t\t\t\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmappings: [mapping],\n\t\t\t\t\t\tembeddedCodes: [],\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.embeddedCodes = [];\n\t\t\t}\n\n\t\t\tif (DEBUG) {\n\t\t\t\tlog('CSS embedded codes:', (this.embeddedCodes || []).length);\n\t\t\t\tlog('Using transpiled code, mapping count:', this.mappings.length);\n\t\t\t\tlog('Original code length:', newCode.length);\n\t\t\t\tlog('Generated code length:', this.generatedCode.length);\n\t\t\t\tlog('Last 100 chars of original:', JSON.stringify(newCode.slice(-100)));\n\t\t\t\tlog('Last 200 chars of generated:', JSON.stringify(this.generatedCode.slice(-200)));\n\t\t\t\tlog('Last few mappings:');\n\t\t\t\tconst startIdx = Math.max(0, this.mappings.length - 5);\n\t\t\t\tfor (let i = startIdx; i < this.mappings.length; i++) {\n\t\t\t\t\tconst m = this.mappings[i];\n\t\t\t\t\tlog(\n\t\t\t\t\t\t` Mapping ${i}: source[${m.sourceOffsets[0]}:${m.sourceOffsets[0] + m.lengths[0]}] -> gen[${m.generatedOffsets[0]}:${m.generatedOffsets[0] + m.lengths[0]}], len=${m.lengths[0]}, completion=${m.data?.completion}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.snapshot = /** @type {IScriptSnapshot} */ ({\n\t\t\t\tgetText: (start, end) => this.generatedCode.substring(start, end),\n\t\t\t\tgetLength: () => this.generatedCode.length,\n\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t});\n\t\t} else {\n\t\t\t// When compilation fails, show where it failed and disable all\n\t\t\t// TypeScript diagnostics until the compilation error is fixed\n\t\t\tlog('Compilation failed, only display where the compilation error occurred.');\n\n\t\t\tthis.originalCode = newCode;\n\n\t\t\t// In the editor we feed the raw source back as the generated code, with\n\t\t\t// verification enabled. This lets TS parse it and surface errors at the\n\t\t\t// broken construct itself — important when a Ripple compile error has no\n\t\t\t// `pos` (or an unreliable one), since the dedicated diagnostic plugin\n\t\t\t// would otherwise pin the error to offset 0 (top of file, off-screen)\n\t\t\t// and the user would have no signal pointing at the actual problem.\n\t\t\t//\n\t\t\t// In tsrx-tsc we'd rather emit a clean TS-valid placeholder, but that\n\t\t\t// path is handled in the catch above (which sets `transpiled` from\n\t\t\t// `getFallbackGeneratedCode`), so by the time we reach this branch we're\n\t\t\t// in editor context and want the raw-source behavior.\n\t\t\tthis.generatedCode = newCode;\n\n\t\t\t// Create 1:1 mappings for the entire content\n\t\t\tthis.mappings = [\n\t\t\t\t{\n\t\t\t\t\tsourceOffsets: [0],\n\t\t\t\t\tgeneratedOffsets: [0],\n\t\t\t\t\tlengths: [newCode.length],\n\t\t\t\t\tgeneratedLengths: [newCode.length],\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tverification: true,\n\t\t\t\t\t\tcustomData: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\n\t\t\t// Extract CSS from <style>...</style> tags for embedded codes\n\t\t\tthis.embeddedCodes = extractCssFromSource(newCode);\n\n\t\t\tthis.snapshot = /** @type {IScriptSnapshot} */ ({\n\t\t\t\tgetText: (start, end) => this.generatedCode.substring(start, end),\n\t\t\t\tgetLength: () => this.generatedCode.length,\n\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\t#buildMappingCache() {\n\t\tif (this.#mappingGenToSource || this.#mappingSourceToGen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#mappingGenToSource = new Map();\n\t\tthis.#mappingSourceToGen = new Map();\n\n\t\tvar mapping, genStart, genLength, genEnd, genKey;\n\t\tvar sourceStart, sourceLength, sourceEnd, sourceKey;\n\t\tfor (var i = 0; i < this.mappings.length; i++) {\n\t\t\tmapping = this.mappings[i];\n\n\t\t\tgenStart = mapping.generatedOffsets[0];\n\t\t\tgenLength = mapping.generatedLengths[0];\n\t\t\tgenEnd = genStart + genLength;\n\t\t\tgenKey = `${genStart}-${genEnd}`;\n\t\t\tthis.#mappingGenToSource.set(genKey, mapping);\n\n\t\t\tsourceStart = mapping.sourceOffsets[0];\n\t\t\tsourceLength = mapping.lengths[0];\n\t\t\tsourceEnd = sourceStart + sourceLength;\n\t\t\tsourceKey = `${sourceStart}-${sourceEnd}`;\n\t\t\tthis.#mappingSourceToGen.set(sourceKey, mapping);\n\t\t}\n\t}\n\n\t/**\n\t * Find mapping by generated range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingByGeneratedRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingGenToSource).get(`${start}-${end}`) ?? null;\n\t}\n\n\t/**\n\t * Find mapping by source range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingBySourceRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingSourceToGen).get(`${start}-${end}`) ?? null;\n\t}\n}\n\n/**\n * @param {string} file_name\n * @param {ReadonlyArray<unknown>} errors\n */\nfunction logTSRXErrors(file_name, errors) {\n\tfor (const error of errors) {\n\t\tconst message =\n\t\t\terror && typeof error === 'object' && 'message' in error\n\t\t\t\t? String(/** @type {{ message: unknown }} */ (error).message)\n\t\t\t\t: String(error);\n\t\tconst key = `${file_name}\\0${message}`;\n\t\tif (loggedCompilationFailures.has(key)) {\n\t\t\tcontinue;\n\t\t}\n\t\tloggedCompilationFailures.add(key);\n\t\tconsole.error(`[tsrx-tsc] ${file_name}: ${message}`);\n\t}\n}\n\n/**\n * @param {TSRXCompilerModule} tsrx\n * @param {string} source\n * @param {string} file_name\n * @returns {{ code: string, errors: TSRXCompileError[] } | undefined}\n */\nfunction getFallbackGeneratedCode(tsrx, source, file_name) {\n\tif (typeof tsrx.compile !== 'function') {\n\t\treturn;\n\t}\n\ttry {\n\t\tconst result = tsrx.compile(source, file_name, { loose: true });\n\t\tif (typeof result?.code === 'string') {\n\t\t\treturn { code: result.code, errors: result?.errors ?? [] };\n\t\t}\n\t} catch (error) {\n\t\tlogError('Fallback compilation failed for', file_name, ':', error);\n\t}\n}\n\n/**\n * Extract CSS content from <style>...</style> tags in source code\n * @param {string} code - The source code to extract CSS from\n * @returns {VirtualCode[]} Array of embedded CSS virtual codes\n */\nfunction extractCssFromSource(code) {\n\t/** @type {VirtualCode[]} */\n\tconst embeddedCodes = [];\n\tconst styleRegex = /<style\\b[^>]*>([\\s\\S]*?)<\\/style>/gi;\n\tlet match;\n\tlet index = 0;\n\n\twhile ((match = styleRegex.exec(code)) !== null) {\n\t\tconst fullMatch = match[0];\n\t\tconst cssContent = match[1];\n\t\tconst styleTagStart = match.index;\n\t\tconst openTagEnd = fullMatch.indexOf('>') + 1;\n\t\tconst cssStart = styleTagStart + openTagEnd;\n\t\tconst cssLength = cssContent.length;\n\n\t\tlog(`Extracted CSS region ${index}: offset ${cssStart}, length ${cssLength}`);\n\n\t\t/** @type {CodeMapping} */\n\t\tconst mapping = {\n\t\t\tsourceOffsets: [cssStart],\n\t\t\tgeneratedOffsets: [0],\n\t\t\tlengths: [cssLength],\n\t\t\tgeneratedLengths: [cssLength],\n\t\t\tdata: {\n\t\t\t\tverification: true,\n\t\t\t\tcompletion: true,\n\t\t\t\tsemantic: true,\n\t\t\t\tnavigation: true,\n\t\t\t\tstructure: true,\n\t\t\t\tformat: false,\n\t\t\t\tcustomData: {\n\t\t\t\t\tcontent: cssContent,\n\t\t\t\t\tembeddedId: `style_${index}`,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tembeddedCodes.push({\n\t\t\tid: `style_${index}`,\n\t\t\tlanguageId: 'css',\n\t\t\tsnapshot: {\n\t\t\t\tgetText: (start, end) => cssContent.substring(start, end),\n\t\t\t\tgetLength: () => cssLength,\n\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t},\n\t\t\tmappings: [mapping],\n\t\t\tembeddedCodes: [],\n\t\t});\n\n\t\tindex++;\n\t}\n\n\tif (embeddedCodes.length > 0) {\n\t\tlog(`Extracted ${embeddedCodes.length} CSS embedded codes from style tags`);\n\t}\n\n\treturn embeddedCodes;\n}\n\n/**\n * Insert a typed dot back into the transpiled code and update mappings so the\n * source and generated offsets stay aligned for completion requests.\n * @param {VolarMappingsResult} transpiled\n * @param {number} dotPosition\n * @returns {number | null}\n */\nfunction restore_typed_dot_in_transpiled_code(transpiled, dotPosition) {\n\tlet dot_mapping = null;\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tconst source_end = mapping.sourceOffsets[0] + mapping.lengths[0];\n\t\tif (source_end === dotPosition) {\n\t\t\tdot_mapping = mapping;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!dot_mapping) {\n\t\treturn null;\n\t}\n\n\tconst generated_length = dot_mapping.generatedLengths[0];\n\tconst insertedDotPosition = dot_mapping.generatedOffsets[0] + generated_length;\n\n\ttranspiled.code =\n\t\ttranspiled.code.substring(0, insertedDotPosition) +\n\t\t'.' +\n\t\ttranspiled.code.substring(insertedDotPosition);\n\n\t// Create a separate 1:1 mapping for the dot character instead of extending\n\t// the existing mapping. When source and generated lengths differ (e.g.\n\t// #ripple → _$__u0023_ripple), Volar's translateOffset uses\n\t// Math.min(relativePos, toLength) which would map the cursor after the dot\n\t// to the middle of the generated identifier instead of after it.\n\n\t/** @type {CodeMapping} */\n\tconst new_dot_mapping = {\n\t\tsourceOffsets: [dotPosition],\n\t\tgeneratedOffsets: [insertedDotPosition],\n\t\tlengths: [1],\n\t\tgeneratedLengths: [1],\n\t\tdata: { ...dot_mapping.data },\n\t};\n\n\t// Find the index to insert after dot_mapping\n\tconst dot_mapping_index = transpiled.mappings.indexOf(dot_mapping);\n\ttranspiled.mappings.splice(dot_mapping_index + 1, 0, new_dot_mapping);\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.generatedOffsets[0] >= insertedDotPosition\n\t\t) {\n\t\t\tmapping.generatedOffsets[0] += 1;\n\t\t}\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.sourceOffsets[0] >= dotPosition\n\t\t) {\n\t\t\tmapping.sourceOffsets[0] += 1;\n\t\t}\n\t}\n\n\treturn insertedDotPosition;\n}\n\n/**\n * @template T\n * @param {{ options?: CompilerOptions } & T} config\n * @returns {{ options: CompilerOptions } & T}\n */\nexport const resolveConfig = (config) => {\n\tconst baseOptions = config.options ?? /** @type {CompilerOptions} */ ({});\n\t/** @type {CompilerOptions} */\n\tconst options = { ...baseOptions };\n\n\t// Default target: align with modern bundlers while staying configurable.\n\tif (options.target === undefined) {\n\t\toptions.target = ts.ScriptTarget.ESNext;\n\t}\n\n\t/** @param {string} libName */\n\tconst normalizeLibName = (libName) => {\n\t\tif (typeof libName !== 'string' || libName.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst trimmed = libName.trim();\n\t\tif (trimmed.startsWith('lib.')) {\n\t\t\treturn trimmed.toLowerCase();\n\t\t}\n\t\treturn `lib.${trimmed.toLowerCase().replace(/\\s+/g, '').replace(/_/g, '.')}\\.d.ts`;\n\t};\n\n\tconst normalizedLibs = new Set(\n\t\t(options.lib ?? []).map(normalizeLibName).filter((lib) => typeof lib === 'string'),\n\t);\n\n\tif (normalizedLibs.size === 0) {\n\t\tconst host = ts.createCompilerHost(options);\n\t\tconst defaultLibFileName = host.getDefaultLibFileName(options).toLowerCase();\n\t\tnormalizedLibs.add(defaultLibFileName);\n\t\tnormalizedLibs.add('lib.dom.d.ts');\n\t\tnormalizedLibs.add('lib.dom.iterable.d.ts');\n\t}\n\n\toptions.lib = [...normalizedLibs];\n\n\t// Default typeRoots: automatically discover @types like tsserver.\n\tif (!options.types) {\n\t\tconst host = ts.createCompilerHost(options);\n\t\tconst typeRoots = ts.getEffectiveTypeRoots(options, host);\n\t\tif (typeRoots && typeRoots.length > 0) {\n\t\t\toptions.typeRoots = typeRoots;\n\t\t}\n\t}\n\n\treturn {\n\t\t...config,\n\t\toptions,\n\t};\n};\n\n/** @type {Map<string, string | null>} */\nexport const path2RipplePathMap = new Map();\n/** @type {Map<string, string>} */\nconst pathToTypesCache = new Map();\n/** @type {Map<string, RegExpMatchArray>} */\nconst typeNameMatchCache = new Map();\n/** @type {Map<string, { name: string | null, dependencies: Set<string> } | null>} */\nconst pathToPackageManifestCache = new Map();\n\n/**\n * @param {ScriptId} fileNameOrUri\n * @returns {string}\n */\nexport function normalizeFileNameOrUri(fileNameOrUri) {\n\treturn typeof fileNameOrUri === 'string'\n\t\t? fileNameOrUri\n\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n}\n\n/**\n * @param {string} start_dir\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @returns {{ name: string | null, dependencies: Set<string> } | null}\n */\nfunction get_nearest_package_manifest(start_dir, exists_sync = fs.existsSync) {\n\tlet current_dir = start_dir;\n\t/** @type {string[]} */\n\tconst visited_dirs = [];\n\n\twhile (current_dir) {\n\t\tif (pathToPackageManifestCache.has(current_dir)) {\n\t\t\tconst cached_manifest = pathToPackageManifestCache.get(current_dir) ?? null;\n\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\tpathToPackageManifestCache.set(visited_dir, cached_manifest);\n\t\t\t}\n\t\t\treturn cached_manifest;\n\t\t}\n\n\t\tvisited_dirs.push(current_dir);\n\n\t\tconst package_json_path = path.join(current_dir, 'package.json');\n\t\tif (exists_sync(package_json_path)) {\n\t\t\ttry {\n\t\t\t\tconst package_json = JSON.parse(fs.readFileSync(package_json_path, 'utf8'));\n\t\t\t\tconst dependencies = new Set([\n\t\t\t\t\t...Object.keys(package_json.dependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.devDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.peerDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.optionalDependencies ?? {}),\n\t\t\t\t]);\n\t\t\t\tconst package_manifest = {\n\t\t\t\t\tname: typeof package_json.name === 'string' ? package_json.name : null,\n\t\t\t\t\tdependencies,\n\t\t\t\t};\n\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, package_manifest);\n\t\t\t\t}\n\n\t\t\t\treturn package_manifest;\n\t\t\t} catch {\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\tfor (const visited_dir of visited_dirs) {\n\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t}\n\n\treturn null;\n}\n\n/**\n * @param {{ name: string | null, dependencies: Set<string> } | null} package_manifest\n * @param {string} compiler_name\n * @param {string[]} package_hints\n * @returns {boolean}\n */\nfunction package_manifest_matches_compiler(package_manifest, compiler_name, package_hints) {\n\tif (!package_manifest) {\n\t\treturn false;\n\t}\n\n\tif (\n\t\tpackage_manifest.name === compiler_name ||\n\t\tpackage_hints.includes(package_manifest.name ?? '')\n\t) {\n\t\treturn true;\n\t}\n\n\tif (package_manifest.dependencies.has(compiler_name)) {\n\t\treturn true;\n\t}\n\n\tfor (const package_hint of package_hints) {\n\t\tif (package_manifest.dependencies.has(package_hint)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {string} normalized_file_name\n * @returns {TSRXCompilerModule | undefined}\n */\nfunction get_tsrx_compiler(normalized_file_name) {\n\tconst compiler_path = get_compiler_entry_for_file(normalized_file_name);\n\tif (compiler_path) {\n\t\treturn require(compiler_path);\n\t}\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @param {Map<string, string | null>} [compiler_path_map]\n * @returns {string | undefined}\n */\nexport function find_workspace_compiler_entry_for_file(\n\tnormalized_file_name,\n\texists_sync = fs.existsSync,\n\tcompiler_path_map = path2RipplePathMap,\n) {\n\tconst parts = normalized_file_name.split('/');\n\tconst ext = path.extname(normalized_file_name);\n\n\tfor (let i = parts.length - 2; i >= 0; i--) {\n\t\tconst dir = parts.slice(0, i + 1).join('/');\n\t\tconst cache_key = dir + '\\0' + ext;\n\n\t\tif (!compiler_path_map.has(cache_key)) {\n\t\t\t/** @type {Array<[string, string, string[]]>} */\n\t\t\tconst available_candidates = [];\n\t\t\tfor (const [\n\t\t\t\tcompiler_name,\n\t\t\t\tcompiler_dir_parts,\n\t\t\t\tsupported_extensions,\n\t\t\t\tpackage_hints,\n\t\t\t] of COMPILER_CANDIDATES) {\n\t\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst full_path = [dir, ...compiler_dir_parts, 'src', 'index.js'].join('/');\n\t\t\t\tif (exists_sync(full_path)) {\n\t\t\t\t\tavailable_candidates.push([compiler_name, full_path, package_hints]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet found_path = null;\n\t\t\tif (available_candidates.length > 0) {\n\t\t\t\tconst package_manifest = get_nearest_package_manifest(dir, exists_sync);\n\t\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t\t);\n\t\t\t\tfound_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\t\tlog('Found tsrx compiler at:', found_path, 'for extension:', ext);\n\t\t\t}\n\n\t\t\tcompiler_path_map.set(cache_key, found_path);\n\t\t}\n\n\t\tconst compiler_path = compiler_path_map.get(cache_key);\n\t\tif (compiler_path) {\n\t\t\treturn compiler_path;\n\t\t}\n\t}\n}\n\n/**\n * @param {string} normalized_file_name\n * @returns {string | undefined}\n */\nexport function get_compiler_entry_for_file(normalized_file_name) {\n\tconst ext = path.extname(normalized_file_name);\n\tconst package_manifest = get_nearest_package_manifest(path.dirname(normalized_file_name));\n\n\tconst workspace_compiler_path = find_workspace_compiler_entry_for_file(normalized_file_name);\n\tif (workspace_compiler_path) {\n\t\treturn workspace_compiler_path;\n\t}\n\n\tconst warn_message = `No supported tsrx compiler found in workspace for ${normalized_file_name}.`;\n\n\t// Fallback: look for a packaged compiler.\n\tlet current_dir = root_dirname;\n\n\twhile (current_dir) {\n\t\t/** @type {Array<[string, string, string[]]>} */\n\t\tconst available_candidates = [];\n\t\tfor (const [\n\t\t\tcompiler_name,\n\t\t\tcompiler_dir_parts,\n\t\t\tsupported_extensions,\n\t\t\tpackage_hints,\n\t\t] of COMPILER_CANDIDATES) {\n\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst full_path = path.join(current_dir, ...compiler_dir_parts);\n\t\t\tconst entry_path = path.join(full_path, 'src', 'index.js');\n\t\t\tif (fs.existsSync(entry_path)) {\n\t\t\t\tavailable_candidates.push([compiler_name, entry_path, package_hints]);\n\t\t\t}\n\t\t}\n\n\t\tif (available_candidates.length > 0) {\n\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t);\n\t\t\tconst entry_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\tlogWarning(`${warn_message} Using packaged version at ${entry_path}`);\n\t\t\treturn entry_path;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * @param {string} typesFilePath\n * @returns {string | undefined}\n */\nexport function getCachedTypeDefinitionFile(typesFilePath) {\n\tconst cached = pathToTypesCache.get(typesFilePath);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tif (!fs.existsSync(typesFilePath)) {\n\t\tlogWarning(`Types file does not exist at path: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tlog(`Found ripple types at: ${typesFilePath}`);\n\n\t// Read the file to find the class definition offset\n\tconst fileContent = fs.readFileSync(typesFilePath, 'utf8');\n\n\tif (!fileContent) {\n\t\tlogWarning(`Failed to read content of types file at: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tpathToTypesCache.set(typesFilePath, fileContent);\n\treturn fileContent;\n}\n\n/**\n * @param {string} typeName\n * @param {string} text\n * @returns {RegExpMatchArray | undefined}\n */\nexport function getCachedTypeMatches(typeName, text) {\n\tconst cached = typeNameMatchCache.get(typeName);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst searchPattern = new RegExp(\n\t\t`(?:export\\\\s+(?:declare\\\\s+)?|declare\\\\s+)(class|function)\\\\s+${typeName}`,\n\t);\n\n\tconst match = text.match(searchPattern);\n\n\tif (match && match.index !== undefined) {\n\t\ttypeNameMatchCache.set(typeName, match);\n\t\treturn match;\n\t}\n\n\treturn;\n}\n\n/**\n * @param {string} normalized_file_name\n * @returns {string | undefined}\n */\nexport function get_compiler_dir_for_file(normalized_file_name) {\n\tconst entry = get_compiler_entry_for_file(normalized_file_name);\n\tif (entry) {\n\t\t// Walk up from .../src/index.js to the package root\n\t\treturn path.dirname(path.dirname(entry));\n\t}\n}\n\nexport { get_compiler_dir_for_file as getRippleDirForFile };\n\n/** Reset module-level state used in tests. */\nexport function _reset_for_test() {\n\tpath2RipplePathMap.clear();\n\tpathToPackageManifestCache.clear();\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8],"mappings":"4pBACA,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,CAC7D,EAAQ,aAAe,EACvB,SAAS,EAAa,EAAQ,EAAa,CACvC,IAAI,EAAM,EACN,EAAO,EAAO,OAAS,EACvB,EACJ,KAAO,GAAO,GAAM,CAChB,IAAM,EAAM,KAAK,OAAO,EAAM,GAAQ,EAAE,CAClC,EAAW,EAAO,GACxB,GAAI,EAAW,EACX,EAAM,EAAM,UAEP,EAAW,EAChB,EAAO,EAAM,MAEZ,CACD,EAAM,EACN,EAAO,EACP,EAAQ,EACR,OAKR,MAAO,CAAE,IAFQ,KAAK,IAAI,KAAK,IAAI,EAAK,EAAM,EAAO,OAAS,EAAE,CAAE,EAAE,CAE5C,KADN,KAAK,IAAI,KAAK,IAAI,EAAK,EAAM,EAAE,CAAE,EAAO,OAAS,EAAE,CAC5B,QAAO,cCxBpD,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,CAC7D,EAAQ,gBAAkB,EAC1B,IAAI,EAAS,GACb,SAAS,EAAgB,EAAO,EAAa,EAAW,EAAa,EAAY,EAAa,EAAY,GAAO,CAE7G,GAAI,CADa,EAAY,OAAO,EAAO,IAAU,IAAU,GAAK,EAAY,EAAQ,IAAM,EAAM,CACrF,CACX,IAAK,IAAI,EAAI,EAAG,EA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ACpC,IAAM,EAAmB,EAA6B,EAAK,EAAY,CAIvE,EAH4B,EAAqB,MAAM,CAAC,GAAiB,KACxE,EAAkC,EAAkB,EAAe,EAAc,CACjF,GACkC,IAAM,EAAqB,GAAG,GACjE,EAAI,0BAA2B,EAAY,iBAAkB,EAAI,CAGlE,EAAkB,IAAI,EAAW,EAAW,CAG7C,IAAM,EAAgB,EAAkB,IAAI,EAAU,CACtD,GAAI,EACH,OAAO,GASV,SAAgB,EAA4B,EAAsB,CACjE,IAAM,EAAM,EAAA,QAAK,QAAQ,EAAqB,CACxC,EAAmB,EAA6B,EAAA,QAAK,QAAQ,EAAqB,CAAC,CAEnF,EAA0B,EAAuC,EAAqB,CAC5F,GAAI,EACH,OAAO,EAGR,IAAM,EAAe,qDAAqD,EAAqB,GAG3F,EAAc,EAElB,KAAO,GAAa,CAEnB,IAAM,EAAuB,EAAE,CAC/B,IAAK,GAAM,CACV,EACA,EACA,EACA,KACI,EAAqB,CACzB,GAAI,CAAC,EAAqB,SAAS,EAAI,CACtC,SAED,IAAM,EAAY,EAAA,QAAK,KAAK,EAAa,GAAG,EAAmB,CACzD,EAAa,EAAA,QAAK,KAAK,EAAW,MAAO,WAAW,CACtD,EAAA,QAAG,WAAW,EAAW,EAC5B,EAAqB,KAAK,CAAC,EAAe,EAAY,EAAc,CAAC,CAIvE,GAAI,EAAqB,OAAS,EAAG,CAIpC,IAAM,EAHsB,EAAqB,MAAM,CAAC,GAAiB,KACxE,EAAkC,EAAkB,EAAe,EAAc,CACjF,GACwC,IAAM,EAAqB,GAAG,GAEvE,OADA,EAAW,GAAG,EAAa,6BAA6B,IAAa,CAC9D,EAGR,IAAM,EAAa,EAAA,QAAK,QAAQ,EAAY,CAC5C,GAAI,IAAe,EAClB,MAED,EAAc"}
package/dist/tsc.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./language-DZrsi_P6.js`),t=(0,require(`node:module`).createRequire)(require(`url`).pathToFileURL(__filename).href),{runTsc:n}=t(`@volar/typescript/lib/quickstart/runTsc.js`),r=t.resolve(`typescript/lib/tsc.js`);process.env.TSRX_TSC=`true`,n(r,{extraSupportedExtensions:[`.tsrx`],extraExtensionsToRemove:[`.tsrx`]},()=>[e.t()]);
2
+ const e=require(`./language-CAqwRK_u.js`),t=(0,require(`node:module`).createRequire)(require(`url`).pathToFileURL(__filename).href),{runTsc:n}=t(`@volar/typescript/lib/quickstart/runTsc.js`),r=t.resolve(`typescript/lib/tsc.js`);process.env.TSRX_TSC=`true`,n(r,{extraSupportedExtensions:[`.tsrx`],extraExtensionsToRemove:[`.tsrx`]},()=>[e.t()]);
3
3
  //# sourceMappingURL=tsc.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "TypeScript plugin for TSRX",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.3.46",
6
+ "version": "0.3.47",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
9
9
  "tsrx-tsc": "./dist/tsc.js"
@@ -31,11 +31,11 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "typescript": "^5.9.3",
34
- "@tsrx/react": "0.1.20",
35
- "@tsrx/ripple": "0.0.28",
36
- "@tsrx/solid": "0.0.26",
37
- "@tsrx/preact": "0.0.21",
38
- "@tsrx/vue": "0.0.21"
34
+ "@tsrx/react": "0.1.21",
35
+ "@tsrx/solid": "0.0.27",
36
+ "@tsrx/preact": "0.0.22",
37
+ "@tsrx/vue": "0.0.22",
38
+ "@tsrx/ripple": "0.0.29"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@tsrx/react": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"language-DZrsi_P6.js","names":["exports","exports","require","#mappingGenToSource","#mappingSourceToGen","#buildMappingCache"],"sources":["../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/binarySearch.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/translateOffset.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/sourceMap.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/index.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/editor.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/linkedCodeMap.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/types.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/utils.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/index.js","../src/utils.js","../src/language.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.binarySearch = binarySearch;\nfunction binarySearch(values, searchValue) {\n let low = 0;\n let high = values.length - 1;\n let match;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const midValue = values[mid];\n if (midValue < searchValue) {\n low = mid + 1;\n }\n else if (midValue > searchValue) {\n high = mid - 1;\n }\n else {\n low = mid;\n high = mid;\n match = mid;\n break;\n }\n }\n const finalLow = Math.max(Math.min(low, high, values.length - 1), 0);\n const finalHigh = Math.min(Math.max(low, high, 0), values.length - 1);\n return { low: finalLow, high: finalHigh, match };\n}\n//# sourceMappingURL=binarySearch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.translateOffset = translateOffset;\nlet warned = false;\nfunction translateOffset(start, fromOffsets, toOffsets, fromLengths, toLengths = fromLengths, preferEnd = false) {\n const isSorted = fromOffsets.every((value, index) => index === 0 || fromOffsets[index - 1] <= value);\n if (!isSorted) {\n for (let i = 0; i < fromOffsets.length; i++) {\n const fromOffset = fromOffsets[i];\n const fromLength = fromLengths[i];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[i];\n const toOffset = toOffsets[i];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n }\n if (!warned) {\n warned = true;\n console.warn('fromOffsets should be sorted in ascending order');\n }\n }\n let low = 0;\n let high = fromOffsets.length - 1;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const fromOffset = fromOffsets[mid];\n const fromLength = fromLengths[mid];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[mid];\n const toOffset = toOffsets[mid];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n else if (start < fromOffset) {\n high = mid - 1;\n }\n else {\n low = mid + 1;\n }\n }\n}\n//# sourceMappingURL=translateOffset.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SourceMap = void 0;\nconst binarySearch_1 = require(\"./binarySearch\");\nconst translateOffset_1 = require(\"./translateOffset\");\nclass SourceMap {\n constructor(mappings) {\n this.mappings = mappings;\n }\n toSourceRange(generatedStart, generatedEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(generatedStart, generatedEnd, fallbackToAnyMatch, 'generatedOffsets', filter);\n }\n toGeneratedRange(sourceStart, sourceEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(sourceStart, sourceEnd, fallbackToAnyMatch, 'sourceOffsets', filter);\n }\n toSourceLocation(generatedOffset, filter) {\n return this.findMatchingOffsets(generatedOffset, 'generatedOffsets', filter);\n }\n toGeneratedLocation(sourceOffset, filter) {\n return this.findMatchingOffsets(sourceOffset, 'sourceOffsets', filter);\n }\n *findMatchingOffsets(offset, fromRange, filter, preferEnd = false) {\n const memo = this.getMemoBasedOnRange(fromRange);\n if (memo.offsets.length === 0) {\n return;\n }\n const { low: start, high: end } = (0, binarySearch_1.binarySearch)(memo.offsets, offset);\n const skip = new Set();\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n for (let i = start; i <= end; i++) {\n for (const mapping of memo.mappings[i]) {\n if (skip.has(mapping)) {\n continue;\n }\n skip.add(mapping);\n if (filter && !filter(mapping.data)) {\n continue;\n }\n const mapped = (0, translateOffset_1.translateOffset)(offset, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mapped !== undefined) {\n yield [mapped, mapping];\n }\n }\n }\n }\n *findMatchingStartEnd(start, end, fallbackToAnyMatch, fromRange, filter) {\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n const preferEnd = toRange === 'sourceOffsets';\n const mappedStarts = [];\n let hadMatch = false;\n for (const [mappedStart, mapping] of this.findMatchingOffsets(start, fromRange)) {\n if (filter && !filter(mapping.data)) {\n continue;\n }\n mappedStarts.push([mappedStart, mapping]);\n const mappedEnd = (0, translateOffset_1.translateOffset)(end, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mappedEnd !== undefined) {\n hadMatch = true;\n yield [mappedStart, mappedEnd, mapping, mapping];\n }\n }\n if (!hadMatch && fallbackToAnyMatch) {\n for (const [mappedStart, mappingStart] of mappedStarts) {\n for (const [mappedEnd, mappingEnd] of this.findMatchingOffsets(end, fromRange, undefined, preferEnd)) {\n if (filter && !filter(mappingEnd.data) || mappedEnd < mappedStart) {\n continue;\n }\n yield [mappedStart, mappedEnd, mappingStart, mappingEnd];\n break;\n }\n }\n }\n }\n getMemoBasedOnRange(fromRange) {\n return fromRange === 'sourceOffsets'\n ? this.sourceCodeOffsetsMemo ??= this.createMemo('sourceOffsets')\n : this.generatedCodeOffsetsMemo ??= this.createMemo('generatedOffsets');\n }\n createMemo(key) {\n const offsetsSet = new Set();\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n offsetsSet.add(mapping[key][i]);\n offsetsSet.add(mapping[key][i] + getLengths(mapping, key)[i]);\n }\n }\n const offsets = [...offsetsSet].sort((a, b) => a - b);\n const mappings = offsets.map(() => new Set());\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n const startIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i]).match;\n const endIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i] + getLengths(mapping, key)[i]).match;\n for (let i = startIndex; i <= endIndex; i++) {\n mappings[i].add(mapping);\n }\n }\n }\n return { offsets, mappings };\n }\n}\nexports.SourceMap = SourceMap;\nfunction getLengths(mapping, key) {\n return key === 'sourceOffsets' ? mapping.lengths : mapping.generatedLengths ?? mapping.lengths;\n}\n//# sourceMappingURL=sourceMap.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/sourceMap\"), exports);\n__exportStar(require(\"./lib/translateOffset\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isHoverEnabled = isHoverEnabled;\nexports.isInlayHintsEnabled = isInlayHintsEnabled;\nexports.isCodeLensEnabled = isCodeLensEnabled;\nexports.isMonikerEnabled = isMonikerEnabled;\nexports.isInlineValueEnabled = isInlineValueEnabled;\nexports.isSemanticTokensEnabled = isSemanticTokensEnabled;\nexports.isCallHierarchyEnabled = isCallHierarchyEnabled;\nexports.isTypeHierarchyEnabled = isTypeHierarchyEnabled;\nexports.isRenameEnabled = isRenameEnabled;\nexports.isDefinitionEnabled = isDefinitionEnabled;\nexports.isTypeDefinitionEnabled = isTypeDefinitionEnabled;\nexports.isReferencesEnabled = isReferencesEnabled;\nexports.isImplementationEnabled = isImplementationEnabled;\nexports.isHighlightEnabled = isHighlightEnabled;\nexports.isSymbolsEnabled = isSymbolsEnabled;\nexports.isFoldingRangesEnabled = isFoldingRangesEnabled;\nexports.isSelectionRangesEnabled = isSelectionRangesEnabled;\nexports.isLinkedEditingEnabled = isLinkedEditingEnabled;\nexports.isColorEnabled = isColorEnabled;\nexports.isDocumentLinkEnabled = isDocumentLinkEnabled;\nexports.isDiagnosticsEnabled = isDiagnosticsEnabled;\nexports.isCodeActionsEnabled = isCodeActionsEnabled;\nexports.isFormattingEnabled = isFormattingEnabled;\nexports.isCompletionEnabled = isCompletionEnabled;\nexports.isAutoInsertEnabled = isAutoInsertEnabled;\nexports.isSignatureHelpEnabled = isSignatureHelpEnabled;\nexports.shouldReportDiagnostics = shouldReportDiagnostics;\nexports.resolveRenameNewName = resolveRenameNewName;\nexports.resolveRenameEditText = resolveRenameEditText;\nexports.findOverlapCodeRange = findOverlapCodeRange;\nfunction isHoverEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlayHintsEnabled(info) {\n return !!info.semantic;\n}\nfunction isCodeLensEnabled(info) {\n return !!info.semantic;\n}\nfunction isMonikerEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlineValueEnabled(info) {\n return !!info.semantic;\n}\nfunction isSemanticTokensEnabled(info) {\n return typeof info.semantic === 'object'\n ? info.semantic.shouldHighlight?.() ?? true\n : !!info.semantic;\n}\nfunction isCallHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isRenameEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldRename?.() ?? true\n : !!info.navigation;\n}\nfunction isDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isReferencesEnabled(info) {\n return !!info.navigation;\n}\nfunction isImplementationEnabled(info) {\n return !!info.navigation;\n}\nfunction isHighlightEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldHighlight?.() ?? true\n : !!info.navigation;\n}\nfunction isSymbolsEnabled(info) {\n return !!info.structure;\n}\nfunction isFoldingRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isSelectionRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isLinkedEditingEnabled(info) {\n return !!info.structure;\n}\nfunction isColorEnabled(info) {\n return !!info.structure;\n}\nfunction isDocumentLinkEnabled(info) {\n return !!info.structure;\n}\nfunction isDiagnosticsEnabled(info) {\n return !!info.verification;\n}\nfunction isCodeActionsEnabled(info) {\n return !!info.verification;\n}\nfunction isFormattingEnabled(info) {\n return !!info.format;\n}\nfunction isCompletionEnabled(info) {\n return !!info.completion;\n}\nfunction isAutoInsertEnabled(info) {\n return !!info.completion;\n}\nfunction isSignatureHelpEnabled(info) {\n return !!info.completion;\n}\n// should...\nfunction shouldReportDiagnostics(info, source, code) {\n return typeof info.verification === 'object'\n ? info.verification.shouldReport?.(source, code) ?? true\n : !!info.verification;\n}\n// resolve...\nfunction resolveRenameNewName(newName, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameNewName?.(newName) ?? newName\n : newName;\n}\nfunction resolveRenameEditText(text, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameEditText?.(text) ?? text\n : text;\n}\nfunction findOverlapCodeRange(start, end, map, filter) {\n let mappedStart;\n let mappedEnd;\n for (const [mapped, mapping] of map.toGeneratedLocation(start)) {\n if (filter(mapping.data)) {\n mappedStart = mapped;\n break;\n }\n }\n for (const [mapped, mapping] of map.toGeneratedLocation(end)) {\n if (filter(mapping.data)) {\n mappedEnd = mapped;\n break;\n }\n }\n if (mappedStart === undefined || mappedEnd === undefined) {\n for (const mapping of map.mappings) {\n if (filter(mapping.data)) {\n const mappingStart = mapping.sourceOffsets[0];\n const mappingEnd = mapping.sourceOffsets[mapping.sourceOffsets.length - 1]\n + mapping.lengths[mapping.lengths.length - 1];\n const overlap = getOverlapRange(start, end, mappingStart, mappingEnd);\n if (overlap) {\n const curMappedStart = (overlap.start - mappingStart) + mapping.generatedOffsets[0];\n const lastGeneratedLength = (mapping.generatedLengths ?? mapping.lengths)[mapping.generatedOffsets.length - 1];\n const curMappedEndOffset = Math.min(overlap.end - mapping.sourceOffsets[mapping.sourceOffsets.length - 1], lastGeneratedLength);\n const curMappedEnd = mapping.generatedOffsets[mapping.generatedOffsets.length - 1] + curMappedEndOffset;\n mappedStart = mappedStart === undefined ? curMappedStart : Math.min(mappedStart, curMappedStart);\n mappedEnd = mappedEnd === undefined ? curMappedEnd : Math.max(mappedEnd, curMappedEnd);\n }\n }\n }\n }\n if (mappedStart !== undefined && mappedEnd !== undefined) {\n return {\n start: mappedStart,\n end: mappedEnd,\n };\n }\n}\nfunction getOverlapRange(range1Start, range1End, range2Start, range2End) {\n const start = Math.max(range1Start, range2Start);\n const end = Math.min(range1End, range2End);\n if (start > end) {\n return undefined;\n }\n return {\n start,\n end,\n };\n}\n//# sourceMappingURL=editor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedCodeMap = void 0;\nconst source_map_1 = require(\"@volar/source-map\");\nclass LinkedCodeMap extends source_map_1.SourceMap {\n *getLinkedOffsets(start) {\n for (const mapped of this.toGeneratedLocation(start)) {\n yield mapped[0];\n }\n for (const mapped of this.toSourceLocation(start)) {\n yield mapped[0];\n }\n }\n}\nexports.LinkedCodeMap = LinkedCodeMap;\n//# sourceMappingURL=linkedCodeMap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileMap = void 0;\nclass FileMap extends Map {\n constructor(caseSensitive) {\n super();\n this.caseSensitive = caseSensitive;\n this.originalFileNames = new Map();\n }\n keys() {\n return this.originalFileNames.values();\n }\n get(key) {\n return super.get(this.normalizeId(key));\n }\n has(key) {\n return super.has(this.normalizeId(key));\n }\n set(key, value) {\n this.originalFileNames.set(this.normalizeId(key), key);\n return super.set(this.normalizeId(key), value);\n }\n delete(key) {\n this.originalFileNames.delete(this.normalizeId(key));\n return super.delete(this.normalizeId(key));\n }\n clear() {\n this.originalFileNames.clear();\n return super.clear();\n }\n normalizeId(id) {\n return this.caseSensitive ? id : id.toLowerCase();\n }\n}\nexports.FileMap = FileMap;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultMapperFactory = exports.SourceMap = void 0;\nexports.createLanguage = createLanguage;\nexports.forEachEmbeddedCode = forEachEmbeddedCode;\nvar source_map_1 = require(\"@volar/source-map\");\nObject.defineProperty(exports, \"SourceMap\", { enumerable: true, get: function () { return source_map_1.SourceMap; } });\n__exportStar(require(\"./lib/editor\"), exports);\n__exportStar(require(\"./lib/linkedCodeMap\"), exports);\n__exportStar(require(\"./lib/types\"), exports);\n__exportStar(require(\"./lib/utils\"), exports);\nconst source_map_2 = require(\"@volar/source-map\");\nconst linkedCodeMap_1 = require(\"./lib/linkedCodeMap\");\nconst defaultMapperFactory = mappings => new source_map_2.SourceMap(mappings);\nexports.defaultMapperFactory = defaultMapperFactory;\nfunction createLanguage(plugins, scriptRegistry, sync, onAssociationDirty) {\n const virtualCodeToSourceScriptMap = new WeakMap();\n const virtualCodeToSourceMap = new WeakMap();\n const virtualCodeToLinkedCodeMap = new WeakMap();\n const language = {\n mapperFactory: exports.defaultMapperFactory,\n plugins,\n scripts: {\n fromVirtualCode(virtualCode) {\n return virtualCodeToSourceScriptMap.get(virtualCode);\n },\n get(id, includeFsFiles = true, shouldRegister = false) {\n sync(id, includeFsFiles, shouldRegister);\n const result = scriptRegistry.get(id);\n // The sync function provider may not always call the set function due to caching, so it is necessary to explicitly check isAssociationDirty.\n if (result?.isAssociationDirty) {\n this.set(id, result.snapshot, result.languageId);\n }\n return scriptRegistry.get(id);\n },\n set(id, snapshot, languageId, _plugins = plugins) {\n if (!languageId) {\n for (const plugin of plugins) {\n languageId = plugin.getLanguageId?.(id);\n if (languageId) {\n break;\n }\n }\n }\n if (!languageId) {\n console.warn(`languageId not found for ${String(id)}`);\n return;\n }\n let associatedOnly = false;\n for (const plugin of plugins) {\n if (plugin.isAssociatedFileOnly?.(id, languageId)) {\n associatedOnly = true;\n break;\n }\n }\n if (scriptRegistry.has(id)) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript.languageId !== languageId || sourceScript.associatedOnly !== associatedOnly) {\n this.delete(id);\n triggerTargetsDirty(sourceScript);\n return this.set(id, snapshot, languageId);\n }\n else if (associatedOnly) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n }\n else if (sourceScript.isAssociationDirty || sourceScript.snapshot !== snapshot) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n const codegenCtx = prepareCreateVirtualCode(sourceScript);\n if (sourceScript.generated) {\n const { updateVirtualCode, createVirtualCode } = sourceScript.generated.languagePlugin;\n const newVirtualCode = updateVirtualCode\n ? updateVirtualCode(id, sourceScript.generated.root, snapshot, codegenCtx)\n : createVirtualCode?.(id, languageId, snapshot, codegenCtx);\n if (newVirtualCode) {\n sourceScript.generated.root = newVirtualCode;\n sourceScript.generated.embeddedCodes.clear();\n for (const code of forEachEmbeddedCode(sourceScript.generated.root)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n return sourceScript;\n }\n else {\n this.delete(id);\n return;\n }\n }\n }\n else {\n // not changed\n return sourceScript;\n }\n }\n else {\n // created\n const sourceScript = {\n id: id,\n languageId,\n snapshot,\n associatedIds: new Set(),\n targetIds: new Set(),\n associatedOnly,\n };\n scriptRegistry.set(id, sourceScript);\n if (associatedOnly) {\n return sourceScript;\n }\n for (const languagePlugin of _plugins) {\n const virtualCode = languagePlugin.createVirtualCode?.(id, languageId, snapshot, prepareCreateVirtualCode(sourceScript));\n if (virtualCode) {\n sourceScript.generated = {\n root: virtualCode,\n languagePlugin,\n embeddedCodes: new Map(),\n };\n for (const code of forEachEmbeddedCode(virtualCode)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n break;\n }\n }\n return sourceScript;\n }\n },\n delete(id) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.generated?.languagePlugin.disposeVirtualCode?.(id, sourceScript.generated.root);\n scriptRegistry.delete(id);\n triggerTargetsDirty(sourceScript);\n }\n },\n },\n maps: {\n get(virtualCode, sourceScript) {\n let mapCache = virtualCodeToSourceMap.get(virtualCode.snapshot);\n if (!mapCache) {\n virtualCodeToSourceMap.set(virtualCode.snapshot, mapCache = new WeakMap());\n }\n if (!mapCache.has(sourceScript.snapshot)) {\n const mappings = virtualCode.associatedScriptMappings?.get(sourceScript.id) ?? virtualCode.mappings;\n mapCache.set(sourceScript.snapshot, language.mapperFactory(mappings));\n }\n return mapCache.get(sourceScript.snapshot);\n },\n *forEach(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n yield [\n sourceScript,\n this.get(virtualCode, sourceScript),\n ];\n if (virtualCode.associatedScriptMappings) {\n for (const [relatedScriptId] of virtualCode.associatedScriptMappings) {\n const relatedSourceScript = scriptRegistry.get(relatedScriptId);\n if (relatedSourceScript) {\n yield [\n relatedSourceScript,\n this.get(virtualCode, relatedSourceScript),\n ];\n }\n }\n }\n },\n },\n linkedCodeMaps: {\n get(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n let mapCache = virtualCodeToLinkedCodeMap.get(virtualCode.snapshot);\n if (mapCache?.[0] !== sourceScript.snapshot) {\n virtualCodeToLinkedCodeMap.set(virtualCode.snapshot, mapCache = [\n sourceScript.snapshot,\n virtualCode.linkedCodeMappings\n ? new linkedCodeMap_1.LinkedCodeMap(virtualCode.linkedCodeMappings)\n : undefined,\n ]);\n }\n return mapCache[1];\n },\n },\n };\n return language;\n function triggerTargetsDirty(sourceScript) {\n sourceScript.targetIds.forEach(id => {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.isAssociationDirty = true;\n onAssociationDirty?.(sourceScript.id);\n }\n });\n }\n function prepareCreateVirtualCode(sourceScript) {\n for (const id of sourceScript.associatedIds) {\n scriptRegistry.get(id)?.targetIds.delete(sourceScript.id);\n }\n sourceScript.associatedIds.clear();\n sourceScript.isAssociationDirty = false;\n return {\n getAssociatedScript(id) {\n sync(id, true, true);\n const relatedSourceScript = scriptRegistry.get(id);\n if (relatedSourceScript) {\n relatedSourceScript.targetIds.add(sourceScript.id);\n sourceScript.associatedIds.add(relatedSourceScript.id);\n }\n return relatedSourceScript;\n },\n };\n }\n}\nfunction* forEachEmbeddedCode(virtualCode) {\n yield virtualCode;\n if (virtualCode.embeddedCodes) {\n for (const embeddedCode of virtualCode.embeddedCodes) {\n yield* forEachEmbeddedCode(embeddedCode);\n }\n }\n}\n//# sourceMappingURL=index.js.map","export const DEBUG = process.env.RIPPLE_DEBUG === 'true';\n// Matches valid JS/CSS identifier characters: word chars, dashes (CSS), $, and # (Ripple shorthands)\nexport const charAllowedWordRegex = /[\\w\\-$#]/;\n\n/**\n * Create a logging utility with a specific label\n * @param {string} label\n * @returns {{\n * \tlog: (...args: unknown[]) => void,\n * \tlogError: (...args: unknown[]) => void,\n * \tlogWarning: (...args: unknown[]) => void,\n * }}\n */\nexport function createLogging(label) {\n\treturn {\n\t\tlog(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.log(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogError(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.error(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogWarning(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.warn(label, ...args);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Get the word at a specific position in the text\n * @param {string} text\n * @param {number} start\n * @returns {{word: string, start: number, end: number}}\n */\nexport function getWordFromPosition(text, start) {\n\tlet wordStart = start;\n\tlet wordEnd = start;\n\twhile (wordStart > 0 && charAllowedWordRegex.test(text[wordStart - 1])) {\n\t\twordStart--;\n\t}\n\twhile (wordEnd < text.length && charAllowedWordRegex.test(text[wordEnd])) {\n\t\twordEnd++;\n\t}\n\n\tconst word = text.substring(wordStart, wordEnd);\n\n\treturn {\n\t\tword,\n\t\tstart: wordStart,\n\t\tend: wordEnd,\n\t};\n}\n","/** @import { CodeMapping } from '@tsrx/ripple' */\n/** @import {TSRXCompileError, VolarMappingsResult} from '@tsrx/ripple' */\n\n/** @typedef {{ code?: string, js?: { code?: string }, errors?: TSRXCompileError[] }} TSRXCompileResult */\n/** @typedef {{ compile?: (source: string, filename: string, options?: { loose?: boolean }) => TSRXCompileResult, compile_to_volar_mappings(source: string, filename: string, options?: { loose?: boolean }): VolarMappingsResult }} TSRXCompilerModule */\n\n/** @typedef {Map<string, CodeMapping>} CachedMappings */\n/** @typedef {import('typescript').CompilerOptions} CompilerOptions */\n/** @typedef {import('@volar/language-core').IScriptSnapshot} IScriptSnapshot */\n/** @typedef {import('@volar/language-core').VirtualCode} VirtualCode */\n/** @typedef {string | { fsPath: string }} ScriptId */\n// Side-effect import: augments @volar/language-core's LanguagePlugin with the `typescript` field.\n/** @typedef {typeof import('@volar/typescript')} _VolarTypeScriptAugmentation */\n/** @typedef {import('@volar/language-core').LanguagePlugin<ScriptId, VirtualCode>} RippleLanguagePlugin */\n\n/** @typedef {InstanceType<typeof import('./language.js')[\"TSRXVirtualCode\"]>} TSRXVirtualCodeInstance */\n\nimport ts from 'typescript';\nimport { forEachEmbeddedCode } from '@volar/language-core';\nimport fs from 'fs';\nimport path from 'path';\nimport { createRequire } from 'module';\nimport { fileURLToPath } from 'url';\nimport { createLogging, DEBUG } from './utils.js';\n\nconst require = createRequire(import.meta.url);\nconst root_dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst { log, logWarning, logError } = createLogging('[Ripple Language]');\n/** @type {Set<string>} */\nconst loggedCompilationFailures = new Set();\nexport const RIPPLE_EXTENSIONS = ['.tsrx'];\n/** @typedef {[string, string[], string[], string[]]} CompilerCandidate */\n/** @type {CompilerCandidate[]} */\nexport const COMPILER_CANDIDATES = [\n\t[\n\t\t'@tsrx/ripple',\n\t\t['node_modules', '@tsrx', 'ripple'],\n\t\t['.tsrx'],\n\t\t['@tsrx/ripple', 'ripple', '@ripple-ts/vite-plugin', '@ripple-ts/compat-react'],\n\t],\n\t[\n\t\t'@tsrx/react',\n\t\t['node_modules', '@tsrx', 'react'],\n\t\t['.tsrx'],\n\t\t['@tsrx/react', '@tsrx/vite-plugin-react'],\n\t],\n\t[\n\t\t'@tsrx/solid',\n\t\t['node_modules', '@tsrx', 'solid'],\n\t\t['.tsrx'],\n\t\t['@tsrx/solid', '@tsrx/vite-plugin-solid'],\n\t],\n\t[\n\t\t'@tsrx/preact',\n\t\t['node_modules', '@tsrx', 'preact'],\n\t\t['.tsrx'],\n\t\t['@tsrx/preact', '@tsrx/vite-plugin-preact'],\n\t],\n\t[\n\t\t'@tsrx/vue',\n\t\t['node_modules', '@tsrx', 'vue'],\n\t\t['.tsrx'],\n\t\t['@tsrx/vue', '@tsrx/vite-plugin-vue'],\n\t],\n];\n\n/**\n * @param {string} file_name\n * @returns {boolean}\n */\nexport function is_ripple_file(file_name) {\n\treturn RIPPLE_EXTENSIONS.some((extension) => file_name.endsWith(extension));\n}\n\n/**\n * @returns {RippleLanguagePlugin}\n */\nexport function getRippleLanguagePlugin() {\n\tlog('Creating Ripple language plugin...');\n\n\treturn {\n\t\tgetLanguageId(fileNameOrUri) {\n\t\t\tconst file_name =\n\t\t\t\ttypeof fileNameOrUri === 'string'\n\t\t\t\t\t? fileNameOrUri\n\t\t\t\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n\t\t\tif (is_ripple_file(file_name)) {\n\t\t\t\tlog('Identified Ripple file:', file_name);\n\t\t\t\treturn 'ripple';\n\t\t\t}\n\t\t},\n\t\tcreateVirtualCode(fileNameOrUri, languageId, snapshot) {\n\t\t\tif (languageId === 'ripple') {\n\t\t\t\tconst file_name = normalizeFileNameOrUri(fileNameOrUri);\n\t\t\t\tconst ripple = get_tsrx_compiler(file_name);\n\t\t\t\tif (!ripple) {\n\t\t\t\t\tlogError(`Ripple compiler not found for file: ${file_name}`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tlog('Creating virtual code for:', file_name);\n\t\t\t\ttry {\n\t\t\t\t\treturn new TSRXVirtualCode(file_name, snapshot, ripple);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlogError('Failed to create virtual code for:', file_name, ':', err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\tupdateVirtualCode(fileNameOrUri, virtualCode, snapshot) {\n\t\t\tif (virtualCode instanceof TSRXVirtualCode) {\n\t\t\t\tlog('Updating existing virtual code for:', virtualCode.fileName);\n\t\t\t\tvirtualCode.update(snapshot);\n\t\t\t\treturn virtualCode;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\n\t\ttypescript: {\n\t\t\textraFileExtensions: RIPPLE_EXTENSIONS.map((extension) => ({\n\t\t\t\textension: extension.slice(1),\n\t\t\t\tisMixedContent: false,\n\t\t\t\tscriptKind: 7,\n\t\t\t})),\n\t\t\t/**\n\t\t\t * @param {VirtualCode} ripple_code\n\t\t\t */\n\t\t\tgetServiceScript(ripple_code) {\n\t\t\t\tfor (const code of forEachEmbeddedCode(ripple_code)) {\n\t\t\t\t\tif (code.languageId === 'ripple') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\textension: '.tsx',\n\t\t\t\t\t\t\tscriptKind: 4,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * @implements {VirtualCode}\n */\nexport class TSRXVirtualCode {\n\t/** @type {string} */\n\tid = 'root';\n\t/** @type {string} */\n\tlanguageId = 'ripple';\n\t/** @type {unknown[]} */\n\tcodegenStacks = [];\n\t/** @type {TSRXCompilerModule} */\n\ttsrx;\n\t/** @type {string} */\n\tgeneratedCode = '';\n\t/** @type {VirtualCode['embeddedCodes']} */\n\tembeddedCodes = [];\n\t/** @type {CodeMapping[]} */\n\tmappings = [];\n\t/** @type {TSRXCompileError[]} */\n\tfatalErrors = [];\n\t/** @type {TSRXCompileError[]} */\n\tusageErrors = [];\n\t/** @type {IScriptSnapshot} */\n\tsnapshot;\n\t/** @type {IScriptSnapshot} */\n\tsourceSnapshot;\n\t/** @type {string} */\n\toriginalCode = '';\n\t/** @type {unknown[]} */\n\tdiagnostics = [];\n\t/** @type {CachedMappings | null} */\n\t#mappingGenToSource = null;\n\t/** @type {CachedMappings | null} */\n\t#mappingSourceToGen = null;\n\n\t/**\n\t * @param {string} file_name\n\t * @param {IScriptSnapshot} snapshot\n\t * @param {TSRXCompilerModule} tsrx\n\t */\n\tconstructor(file_name, snapshot, tsrx) {\n\t\tlog('Initializing TSRXVirtualCode for:', file_name);\n\n\t\tthis.fileName = file_name;\n\t\tthis.tsrx = tsrx;\n\t\tthis.snapshot = snapshot;\n\t\tthis.sourceSnapshot = snapshot;\n\t\tthis.originalCode = snapshot.getText(0, snapshot.getLength());\n\n\t\t// Validate ripple compiler\n\t\tif (!tsrx || typeof tsrx.compile_to_volar_mappings !== 'function') {\n\t\t\tlogError('Invalid ripple compiler - missing compile_to_volar_mappings method');\n\t\t\tthrow new Error('Invalid ripple compiler');\n\t\t}\n\n\t\tthis.update(snapshot);\n\t}\n\n\t/**\n\t * @param {IScriptSnapshot} snapshot\n\t * @returns {void}\n\t */\n\tupdate(snapshot) {\n\t\tlog('Updating virtual code for:', this.fileName);\n\n\t\tconst newCode = snapshot.getText(0, snapshot.getLength());\n\t\tconst changeRange = snapshot.getChangeRange(this.sourceSnapshot);\n\t\tthis.sourceSnapshot = snapshot;\n\n\t\t// Only clear mapping index - don't update snapshot/originalCode yet\n\t\tthis.#mappingGenToSource = null;\n\t\tthis.#mappingSourceToGen = null;\n\n\t\tthis.fatalErrors = [];\n\t\tthis.usageErrors = [];\n\n\t\t/** @type {VolarMappingsResult | undefined} */\n\t\tlet transpiled;\n\n\t\t// Check if a single \".\" was typed using changeRange\n\t\tlet isDotTyped = false;\n\t\tlet dotPosition = -1;\n\n\t\tlog('changeRange:', JSON.stringify(changeRange));\n\n\t\tif (changeRange) {\n\t\t\tconst changeStart = changeRange.span.start;\n\t\t\tconst changeEnd = changeStart + changeRange.span.length;\n\t\t\tconst newEnd = changeStart + changeRange.newLength;\n\n\t\t\t// Get the old text (what was replaced) from originalCode\n\t\t\tconst oldText = this.originalCode.substring(changeStart, changeEnd);\n\t\t\t// Get the new text (what replaced it) from newCode\n\t\t\tconst newText = newCode.substring(changeStart, newEnd);\n\n\t\t\tlog('Change details:');\n\t\t\tlog(' Position:', changeStart, '-', changeEnd, '(length:', changeRange.span.length, ')');\n\t\t\tlog(' Old text:', JSON.stringify(oldText));\n\t\t\tlog(' New text:', JSON.stringify(newText), '(length:', changeRange.newLength, ')');\n\n\t\t\t// Check if a dot was added at the end of the new text\n\t\t\tif (newText.endsWith('.')) {\n\t\t\t\t// The dot is at position newEnd - 1\n\t\t\t\t// We need to check the character BEFORE the dot (inside the new text)\n\t\t\t\tconst charBeforeDot = newEnd > 1 ? newCode[newEnd - 2] : '';\n\t\t\t\tlog(' Char before dot:', JSON.stringify(charBeforeDot));\n\n\t\t\t\tif (/[$#_\\u200C\\u200D\\p{ID_Continue}\\)\\]\\}]/u.test(charBeforeDot)) {\n\t\t\t\t\tisDotTyped = true;\n\t\t\t\t\tdotPosition = newEnd - 1; // Position of the dot\n\t\t\t\t\tlog('ChangeRange detected dot typed at position', dotPosition);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// If user typed a \".\", compile without it and then stitch it back into\n\t\t\t// the generated output so completions can still resolve.\n\t\t\tif (isDotTyped && dotPosition >= 0) {\n\t\t\t\tconst codeWithoutDot =\n\t\t\t\t\tnewCode.substring(0, dotPosition) + newCode.substring(dotPosition + 1);\n\n\t\t\t\tlog('Compiling without typed dot at position', dotPosition);\n\t\t\t\ttranspiled = this.tsrx.compile_to_volar_mappings(codeWithoutDot, this.fileName, {\n\t\t\t\t\tloose: true,\n\t\t\t\t});\n\t\t\t\tlog('Compilation without dot successful');\n\n\t\t\t\tif (transpiled && transpiled.code && transpiled.mappings.length > 0) {\n\t\t\t\t\tconst insertedDotPosition = restore_typed_dot_in_transpiled_code(transpiled, dotPosition);\n\n\t\t\t\t\tif (insertedDotPosition === null) {\n\t\t\t\t\t\tlogWarning('Failed to restore typed dot into transpiled output');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog('Inserted typed dot at generated position', insertedDotPosition);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Normal compilation\n\t\t\t\tlog('Compiling Ripple code...');\n\t\t\t\ttranspiled = this.tsrx.compile_to_volar_mappings(newCode, this.fileName, {\n\t\t\t\t\tloose: true,\n\t\t\t\t});\n\t\t\t\tlog('Compilation successful, generated code length:', transpiled?.code?.length || 0);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconst error = /** @type {TSRXCompileError} */ (e);\n\t\t\tlogError('Ripple compilation failed for', this.fileName, ':', error);\n\t\t\tif (process.env.TSRX_TSC === 'true') {\n\t\t\t\tlogTSRXErrors(this.fileName, [error]);\n\n\t\t\t\t// In tsrx-tsc, swap in a best-effort transpile so we don't fall through\n\t\t\t\t// to the raw-source fallback below (which would produce a flood of\n\t\t\t\t// bogus TS diagnostics in the CLI output, drowning the real error).\n\t\t\t\t// We surface the loose-mode usage errors collected by `compile` so\n\t\t\t\t// the user still sees the same non-fatal diagnostics they'd get on\n\t\t\t\t// a successful loose-mode compile.\n\t\t\t\tconst fallback = getFallbackGeneratedCode(this.tsrx, newCode, this.fileName);\n\t\t\t\tif (fallback !== undefined) {\n\t\t\t\t\tlogTSRXErrors(this.fileName, fallback.errors);\n\t\t\t\t\ttranspiled = {\n\t\t\t\t\t\tcode: fallback.code,\n\t\t\t\t\t\tmappings: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsourceOffsets: [0],\n\t\t\t\t\t\t\t\tgeneratedOffsets: [0],\n\t\t\t\t\t\t\t\tlengths: [newCode.length],\n\t\t\t\t\t\t\t\tgeneratedLengths: [fallback.code.length],\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tverification: false,\n\t\t\t\t\t\t\t\t\tcustomData: {},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\terrors: fallback.errors,\n\t\t\t\t\t\tcssMappings: [],\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\terror.type = 'fatal';\n\t\t\tthis.fatalErrors.push(error);\n\t\t}\n\n\t\tif (transpiled && transpiled.code) {\n\t\t\t// Successful compilation - update everything\n\t\t\tthis.originalCode = newCode;\n\t\t\tthis.generatedCode = transpiled.code;\n\t\t\tthis.mappings = transpiled.mappings ?? [];\n\t\t\tthis.usageErrors = transpiled.errors;\n\n\t\t\tif (process.env.TSRX_TSC === 'true' && transpiled.errors.length > 0) {\n\t\t\t\tlogTSRXErrors(this.fileName, transpiled.errors);\n\t\t\t}\n\n\t\t\tconst cssMappings = transpiled.cssMappings;\n\t\t\tif (cssMappings.length > 0) {\n\t\t\t\tlog('Creating', cssMappings.length, 'CSS embedded codes');\n\n\t\t\t\tthis.embeddedCodes = cssMappings.map((mapping, index) => {\n\t\t\t\t\tconst cssContent = /** @type {string} */ (mapping.data?.customData?.content);\n\t\t\t\t\tlog(\n\t\t\t\t\t\t`CSS region ${index}: \\\n\t\t\t\t\t\toffset ${mapping.sourceOffsets[0]}-${mapping.sourceOffsets[0] + mapping.lengths[0]}, \\\n\t\t\t\t\t\tlength ${mapping.lengths[0]}`,\n\t\t\t\t\t);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: /** @type {string} */ (mapping.data?.customData?.embeddedId),\n\t\t\t\t\t\tlanguageId: 'css',\n\t\t\t\t\t\tsnapshot: {\n\t\t\t\t\t\t\tgetText: (/** @type {number} */ start, /** @type {number} */ end) =>\n\t\t\t\t\t\t\t\tcssContent.substring(start, end),\n\t\t\t\t\t\t\tgetLength: () => mapping.lengths[0],\n\t\t\t\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmappings: [mapping],\n\t\t\t\t\t\tembeddedCodes: [],\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.embeddedCodes = [];\n\t\t\t}\n\n\t\t\tif (DEBUG) {\n\t\t\t\tlog('CSS embedded codes:', (this.embeddedCodes || []).length);\n\t\t\t\tlog('Using transpiled code, mapping count:', this.mappings.length);\n\t\t\t\tlog('Original code length:', newCode.length);\n\t\t\t\tlog('Generated code length:', this.generatedCode.length);\n\t\t\t\tlog('Last 100 chars of original:', JSON.stringify(newCode.slice(-100)));\n\t\t\t\tlog('Last 200 chars of generated:', JSON.stringify(this.generatedCode.slice(-200)));\n\t\t\t\tlog('Last few mappings:');\n\t\t\t\tconst startIdx = Math.max(0, this.mappings.length - 5);\n\t\t\t\tfor (let i = startIdx; i < this.mappings.length; i++) {\n\t\t\t\t\tconst m = this.mappings[i];\n\t\t\t\t\tlog(\n\t\t\t\t\t\t` Mapping ${i}: source[${m.sourceOffsets[0]}:${m.sourceOffsets[0] + m.lengths[0]}] -> gen[${m.generatedOffsets[0]}:${m.generatedOffsets[0] + m.lengths[0]}], len=${m.lengths[0]}, completion=${m.data?.completion}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.snapshot = /** @type {IScriptSnapshot} */ ({\n\t\t\t\tgetText: (start, end) => this.generatedCode.substring(start, end),\n\t\t\t\tgetLength: () => this.generatedCode.length,\n\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t});\n\t\t} else {\n\t\t\t// When compilation fails, show where it failed and disable all\n\t\t\t// TypeScript diagnostics until the compilation error is fixed\n\t\t\tlog('Compilation failed, only display where the compilation error occurred.');\n\n\t\t\tthis.originalCode = newCode;\n\n\t\t\t// In the editor we feed the raw source back as the generated code, with\n\t\t\t// verification enabled. This lets TS parse it and surface errors at the\n\t\t\t// broken construct itself — important when a Ripple compile error has no\n\t\t\t// `pos` (or an unreliable one), since the dedicated diagnostic plugin\n\t\t\t// would otherwise pin the error to offset 0 (top of file, off-screen)\n\t\t\t// and the user would have no signal pointing at the actual problem.\n\t\t\t//\n\t\t\t// In tsrx-tsc we'd rather emit a clean TS-valid placeholder, but that\n\t\t\t// path is handled in the catch above (which sets `transpiled` from\n\t\t\t// `getFallbackGeneratedCode`), so by the time we reach this branch we're\n\t\t\t// in editor context and want the raw-source behavior.\n\t\t\tthis.generatedCode = newCode;\n\n\t\t\t// Create 1:1 mappings for the entire content\n\t\t\tthis.mappings = [\n\t\t\t\t{\n\t\t\t\t\tsourceOffsets: [0],\n\t\t\t\t\tgeneratedOffsets: [0],\n\t\t\t\t\tlengths: [newCode.length],\n\t\t\t\t\tgeneratedLengths: [newCode.length],\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tverification: true,\n\t\t\t\t\t\tcustomData: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\n\t\t\t// Extract CSS from <style>...</style> tags for embedded codes\n\t\t\tthis.embeddedCodes = extractCssFromSource(newCode);\n\n\t\t\tthis.snapshot = /** @type {IScriptSnapshot} */ ({\n\t\t\t\tgetText: (start, end) => this.generatedCode.substring(start, end),\n\t\t\t\tgetLength: () => this.generatedCode.length,\n\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\t#buildMappingCache() {\n\t\tif (this.#mappingGenToSource || this.#mappingSourceToGen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#mappingGenToSource = new Map();\n\t\tthis.#mappingSourceToGen = new Map();\n\n\t\tvar mapping, genStart, genLength, genEnd, genKey;\n\t\tvar sourceStart, sourceLength, sourceEnd, sourceKey;\n\t\tfor (var i = 0; i < this.mappings.length; i++) {\n\t\t\tmapping = this.mappings[i];\n\n\t\t\tgenStart = mapping.generatedOffsets[0];\n\t\t\tgenLength = mapping.generatedLengths[0];\n\t\t\tgenEnd = genStart + genLength;\n\t\t\tgenKey = `${genStart}-${genEnd}`;\n\t\t\tthis.#mappingGenToSource.set(genKey, mapping);\n\n\t\t\tsourceStart = mapping.sourceOffsets[0];\n\t\t\tsourceLength = mapping.lengths[0];\n\t\t\tsourceEnd = sourceStart + sourceLength;\n\t\t\tsourceKey = `${sourceStart}-${sourceEnd}`;\n\t\t\tthis.#mappingSourceToGen.set(sourceKey, mapping);\n\t\t}\n\t}\n\n\t/**\n\t * Find mapping by generated range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingByGeneratedRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingGenToSource).get(`${start}-${end}`) ?? null;\n\t}\n\n\t/**\n\t * Find mapping by source range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingBySourceRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingSourceToGen).get(`${start}-${end}`) ?? null;\n\t}\n}\n\n/**\n * @param {string} file_name\n * @param {ReadonlyArray<unknown>} errors\n */\nfunction logTSRXErrors(file_name, errors) {\n\tfor (const error of errors) {\n\t\tconst message =\n\t\t\terror && typeof error === 'object' && 'message' in error\n\t\t\t\t? String(/** @type {{ message: unknown }} */ (error).message)\n\t\t\t\t: String(error);\n\t\tconst key = `${file_name}\\0${message}`;\n\t\tif (loggedCompilationFailures.has(key)) {\n\t\t\tcontinue;\n\t\t}\n\t\tloggedCompilationFailures.add(key);\n\t\tconsole.error(`[tsrx-tsc] ${file_name}: ${message}`);\n\t}\n}\n\n/**\n * @param {TSRXCompilerModule} tsrx\n * @param {string} source\n * @param {string} file_name\n * @returns {{ code: string, errors: TSRXCompileError[] } | undefined}\n */\nfunction getFallbackGeneratedCode(tsrx, source, file_name) {\n\tif (typeof tsrx.compile !== 'function') {\n\t\treturn;\n\t}\n\ttry {\n\t\tconst result = tsrx.compile(source, file_name, { loose: true });\n\t\tconst code =\n\t\t\ttypeof result?.code === 'string'\n\t\t\t\t? result.code\n\t\t\t\t: typeof result?.js?.code === 'string'\n\t\t\t\t\t? result.js.code\n\t\t\t\t\t: undefined;\n\t\tif (code !== undefined) {\n\t\t\treturn { code, errors: result?.errors ?? [] };\n\t\t}\n\t} catch (error) {\n\t\tlogError('Fallback compilation failed for', file_name, ':', error);\n\t}\n}\n\n/**\n * Extract CSS content from <style>...</style> tags in source code\n * @param {string} code - The source code to extract CSS from\n * @returns {VirtualCode[]} Array of embedded CSS virtual codes\n */\nfunction extractCssFromSource(code) {\n\t/** @type {VirtualCode[]} */\n\tconst embeddedCodes = [];\n\tconst styleRegex = /<style\\b[^>]*>([\\s\\S]*?)<\\/style>/gi;\n\tlet match;\n\tlet index = 0;\n\n\twhile ((match = styleRegex.exec(code)) !== null) {\n\t\tconst fullMatch = match[0];\n\t\tconst cssContent = match[1];\n\t\tconst styleTagStart = match.index;\n\t\tconst openTagEnd = fullMatch.indexOf('>') + 1;\n\t\tconst cssStart = styleTagStart + openTagEnd;\n\t\tconst cssLength = cssContent.length;\n\n\t\tlog(`Extracted CSS region ${index}: offset ${cssStart}, length ${cssLength}`);\n\n\t\t/** @type {CodeMapping} */\n\t\tconst mapping = {\n\t\t\tsourceOffsets: [cssStart],\n\t\t\tgeneratedOffsets: [0],\n\t\t\tlengths: [cssLength],\n\t\t\tgeneratedLengths: [cssLength],\n\t\t\tdata: {\n\t\t\t\tverification: true,\n\t\t\t\tcompletion: true,\n\t\t\t\tsemantic: true,\n\t\t\t\tnavigation: true,\n\t\t\t\tstructure: true,\n\t\t\t\tformat: false,\n\t\t\t\tcustomData: {\n\t\t\t\t\tcontent: cssContent,\n\t\t\t\t\tembeddedId: `style_${index}`,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tembeddedCodes.push({\n\t\t\tid: `style_${index}`,\n\t\t\tlanguageId: 'css',\n\t\t\tsnapshot: {\n\t\t\t\tgetText: (start, end) => cssContent.substring(start, end),\n\t\t\t\tgetLength: () => cssLength,\n\t\t\t\tgetChangeRange: () => undefined,\n\t\t\t},\n\t\t\tmappings: [mapping],\n\t\t\tembeddedCodes: [],\n\t\t});\n\n\t\tindex++;\n\t}\n\n\tif (embeddedCodes.length > 0) {\n\t\tlog(`Extracted ${embeddedCodes.length} CSS embedded codes from style tags`);\n\t}\n\n\treturn embeddedCodes;\n}\n\n/**\n * Insert a typed dot back into the transpiled code and update mappings so the\n * source and generated offsets stay aligned for completion requests.\n * @param {VolarMappingsResult} transpiled\n * @param {number} dotPosition\n * @returns {number | null}\n */\nfunction restore_typed_dot_in_transpiled_code(transpiled, dotPosition) {\n\tlet dot_mapping = null;\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tconst source_end = mapping.sourceOffsets[0] + mapping.lengths[0];\n\t\tif (source_end === dotPosition) {\n\t\t\tdot_mapping = mapping;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!dot_mapping) {\n\t\treturn null;\n\t}\n\n\tconst generated_length = dot_mapping.generatedLengths[0];\n\tconst insertedDotPosition = dot_mapping.generatedOffsets[0] + generated_length;\n\n\ttranspiled.code =\n\t\ttranspiled.code.substring(0, insertedDotPosition) +\n\t\t'.' +\n\t\ttranspiled.code.substring(insertedDotPosition);\n\n\t// Create a separate 1:1 mapping for the dot character instead of extending\n\t// the existing mapping. When source and generated lengths differ (e.g.\n\t// #ripple → _$__u0023_ripple), Volar's translateOffset uses\n\t// Math.min(relativePos, toLength) which would map the cursor after the dot\n\t// to the middle of the generated identifier instead of after it.\n\n\t/** @type {CodeMapping} */\n\tconst new_dot_mapping = {\n\t\tsourceOffsets: [dotPosition],\n\t\tgeneratedOffsets: [insertedDotPosition],\n\t\tlengths: [1],\n\t\tgeneratedLengths: [1],\n\t\tdata: { ...dot_mapping.data },\n\t};\n\n\t// Find the index to insert after dot_mapping\n\tconst dot_mapping_index = transpiled.mappings.indexOf(dot_mapping);\n\ttranspiled.mappings.splice(dot_mapping_index + 1, 0, new_dot_mapping);\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.generatedOffsets[0] >= insertedDotPosition\n\t\t) {\n\t\t\tmapping.generatedOffsets[0] += 1;\n\t\t}\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.sourceOffsets[0] >= dotPosition\n\t\t) {\n\t\t\tmapping.sourceOffsets[0] += 1;\n\t\t}\n\t}\n\n\treturn insertedDotPosition;\n}\n\n/**\n * @template T\n * @param {{ options?: CompilerOptions } & T} config\n * @returns {{ options: CompilerOptions } & T}\n */\nexport const resolveConfig = (config) => {\n\tconst baseOptions = config.options ?? /** @type {CompilerOptions} */ ({});\n\t/** @type {CompilerOptions} */\n\tconst options = { ...baseOptions };\n\n\t// Default target: align with modern bundlers while staying configurable.\n\tif (options.target === undefined) {\n\t\toptions.target = ts.ScriptTarget.ESNext;\n\t}\n\n\t/** @param {string} libName */\n\tconst normalizeLibName = (libName) => {\n\t\tif (typeof libName !== 'string' || libName.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst trimmed = libName.trim();\n\t\tif (trimmed.startsWith('lib.')) {\n\t\t\treturn trimmed.toLowerCase();\n\t\t}\n\t\treturn `lib.${trimmed.toLowerCase().replace(/\\s+/g, '').replace(/_/g, '.')}\\.d.ts`;\n\t};\n\n\tconst normalizedLibs = new Set(\n\t\t(options.lib ?? []).map(normalizeLibName).filter((lib) => typeof lib === 'string'),\n\t);\n\n\tif (normalizedLibs.size === 0) {\n\t\tconst host = ts.createCompilerHost(options);\n\t\tconst defaultLibFileName = host.getDefaultLibFileName(options).toLowerCase();\n\t\tnormalizedLibs.add(defaultLibFileName);\n\t\tnormalizedLibs.add('lib.dom.d.ts');\n\t\tnormalizedLibs.add('lib.dom.iterable.d.ts');\n\t}\n\n\toptions.lib = [...normalizedLibs];\n\n\t// Default typeRoots: automatically discover @types like tsserver.\n\tif (!options.types) {\n\t\tconst host = ts.createCompilerHost(options);\n\t\tconst typeRoots = ts.getEffectiveTypeRoots(options, host);\n\t\tif (typeRoots && typeRoots.length > 0) {\n\t\t\toptions.typeRoots = typeRoots;\n\t\t}\n\t}\n\n\treturn {\n\t\t...config,\n\t\toptions,\n\t};\n};\n\n/** @type {Map<string, string | null>} */\nexport const path2RipplePathMap = new Map();\n/** @type {Map<string, string>} */\nconst pathToTypesCache = new Map();\n/** @type {Map<string, RegExpMatchArray>} */\nconst typeNameMatchCache = new Map();\n/** @type {Map<string, { name: string | null, dependencies: Set<string> } | null>} */\nconst pathToPackageManifestCache = new Map();\n\n/**\n * @param {ScriptId} fileNameOrUri\n * @returns {string}\n */\nexport function normalizeFileNameOrUri(fileNameOrUri) {\n\treturn typeof fileNameOrUri === 'string'\n\t\t? fileNameOrUri\n\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n}\n\n/**\n * @param {string} start_dir\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @returns {{ name: string | null, dependencies: Set<string> } | null}\n */\nfunction get_nearest_package_manifest(start_dir, exists_sync = fs.existsSync) {\n\tlet current_dir = start_dir;\n\t/** @type {string[]} */\n\tconst visited_dirs = [];\n\n\twhile (current_dir) {\n\t\tif (pathToPackageManifestCache.has(current_dir)) {\n\t\t\tconst cached_manifest = pathToPackageManifestCache.get(current_dir) ?? null;\n\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\tpathToPackageManifestCache.set(visited_dir, cached_manifest);\n\t\t\t}\n\t\t\treturn cached_manifest;\n\t\t}\n\n\t\tvisited_dirs.push(current_dir);\n\n\t\tconst package_json_path = path.join(current_dir, 'package.json');\n\t\tif (exists_sync(package_json_path)) {\n\t\t\ttry {\n\t\t\t\tconst package_json = JSON.parse(fs.readFileSync(package_json_path, 'utf8'));\n\t\t\t\tconst dependencies = new Set([\n\t\t\t\t\t...Object.keys(package_json.dependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.devDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.peerDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.optionalDependencies ?? {}),\n\t\t\t\t]);\n\t\t\t\tconst package_manifest = {\n\t\t\t\t\tname: typeof package_json.name === 'string' ? package_json.name : null,\n\t\t\t\t\tdependencies,\n\t\t\t\t};\n\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, package_manifest);\n\t\t\t\t}\n\n\t\t\t\treturn package_manifest;\n\t\t\t} catch {\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\tfor (const visited_dir of visited_dirs) {\n\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t}\n\n\treturn null;\n}\n\n/**\n * @param {{ name: string | null, dependencies: Set<string> } | null} package_manifest\n * @param {string} compiler_name\n * @param {string[]} package_hints\n * @returns {boolean}\n */\nfunction package_manifest_matches_compiler(package_manifest, compiler_name, package_hints) {\n\tif (!package_manifest) {\n\t\treturn false;\n\t}\n\n\tif (\n\t\tpackage_manifest.name === compiler_name ||\n\t\tpackage_hints.includes(package_manifest.name ?? '')\n\t) {\n\t\treturn true;\n\t}\n\n\tif (package_manifest.dependencies.has(compiler_name)) {\n\t\treturn true;\n\t}\n\n\tfor (const package_hint of package_hints) {\n\t\tif (package_manifest.dependencies.has(package_hint)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {string} normalized_file_name\n * @returns {TSRXCompilerModule | undefined}\n */\nfunction get_tsrx_compiler(normalized_file_name) {\n\tconst compiler_path = get_compiler_entry_for_file(normalized_file_name);\n\tif (compiler_path) {\n\t\treturn require(compiler_path);\n\t}\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @param {Map<string, string | null>} [compiler_path_map]\n * @returns {string | undefined}\n */\nexport function find_workspace_compiler_entry_for_file(\n\tnormalized_file_name,\n\texists_sync = fs.existsSync,\n\tcompiler_path_map = path2RipplePathMap,\n) {\n\tconst parts = normalized_file_name.split('/');\n\tconst ext = path.extname(normalized_file_name);\n\n\tfor (let i = parts.length - 2; i >= 0; i--) {\n\t\tconst dir = parts.slice(0, i + 1).join('/');\n\t\tconst cache_key = dir + '\\0' + ext;\n\n\t\tif (!compiler_path_map.has(cache_key)) {\n\t\t\t/** @type {Array<[string, string, string[]]>} */\n\t\t\tconst available_candidates = [];\n\t\t\tfor (const [\n\t\t\t\tcompiler_name,\n\t\t\t\tcompiler_dir_parts,\n\t\t\t\tsupported_extensions,\n\t\t\t\tpackage_hints,\n\t\t\t] of COMPILER_CANDIDATES) {\n\t\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst full_path = [dir, ...compiler_dir_parts, 'src', 'index.js'].join('/');\n\t\t\t\tif (exists_sync(full_path)) {\n\t\t\t\t\tavailable_candidates.push([compiler_name, full_path, package_hints]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet found_path = null;\n\t\t\tif (available_candidates.length > 0) {\n\t\t\t\tconst package_manifest = get_nearest_package_manifest(dir, exists_sync);\n\t\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t\t);\n\t\t\t\tfound_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\t\tlog('Found tsrx compiler at:', found_path, 'for extension:', ext);\n\t\t\t}\n\n\t\t\tcompiler_path_map.set(cache_key, found_path);\n\t\t}\n\n\t\tconst compiler_path = compiler_path_map.get(cache_key);\n\t\tif (compiler_path) {\n\t\t\treturn compiler_path;\n\t\t}\n\t}\n}\n\n/**\n * @param {string} normalized_file_name\n * @returns {string | undefined}\n */\nexport function get_compiler_entry_for_file(normalized_file_name) {\n\tconst ext = path.extname(normalized_file_name);\n\tconst package_manifest = get_nearest_package_manifest(path.dirname(normalized_file_name));\n\n\tconst workspace_compiler_path = find_workspace_compiler_entry_for_file(normalized_file_name);\n\tif (workspace_compiler_path) {\n\t\treturn workspace_compiler_path;\n\t}\n\n\tconst warn_message = `No supported tsrx compiler found in workspace for ${normalized_file_name}.`;\n\n\t// Fallback: look for a packaged compiler.\n\tlet current_dir = root_dirname;\n\n\twhile (current_dir) {\n\t\t/** @type {Array<[string, string, string[]]>} */\n\t\tconst available_candidates = [];\n\t\tfor (const [\n\t\t\tcompiler_name,\n\t\t\tcompiler_dir_parts,\n\t\t\tsupported_extensions,\n\t\t\tpackage_hints,\n\t\t] of COMPILER_CANDIDATES) {\n\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst full_path = path.join(current_dir, ...compiler_dir_parts);\n\t\t\tconst entry_path = path.join(full_path, 'src', 'index.js');\n\t\t\tif (fs.existsSync(entry_path)) {\n\t\t\t\tavailable_candidates.push([compiler_name, entry_path, package_hints]);\n\t\t\t}\n\t\t}\n\n\t\tif (available_candidates.length > 0) {\n\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t);\n\t\t\tconst entry_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\tlogWarning(`${warn_message} Using packaged version at ${entry_path}`);\n\t\t\treturn entry_path;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * @param {string} typesFilePath\n * @returns {string | undefined}\n */\nexport function getCachedTypeDefinitionFile(typesFilePath) {\n\tconst cached = pathToTypesCache.get(typesFilePath);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tif (!fs.existsSync(typesFilePath)) {\n\t\tlogWarning(`Types file does not exist at path: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tlog(`Found ripple types at: ${typesFilePath}`);\n\n\t// Read the file to find the class definition offset\n\tconst fileContent = fs.readFileSync(typesFilePath, 'utf8');\n\n\tif (!fileContent) {\n\t\tlogWarning(`Failed to read content of types file at: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tpathToTypesCache.set(typesFilePath, fileContent);\n\treturn fileContent;\n}\n\n/**\n * @param {string} typeName\n * @param {string} text\n * @returns {RegExpMatchArray | undefined}\n */\nexport function getCachedTypeMatches(typeName, text) {\n\tconst cached = typeNameMatchCache.get(typeName);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst searchPattern = new RegExp(\n\t\t`(?:export\\\\s+(?:declare\\\\s+)?|declare\\\\s+)(class|function)\\\\s+${typeName}`,\n\t);\n\n\tconst match = text.match(searchPattern);\n\n\tif (match && match.index !== undefined) {\n\t\ttypeNameMatchCache.set(typeName, match);\n\t\treturn match;\n\t}\n\n\treturn;\n}\n\n/**\n * @param {string} normalized_file_name\n * @returns {string | undefined}\n */\nexport function get_compiler_dir_for_file(normalized_file_name) {\n\tconst entry = get_compiler_entry_for_file(normalized_file_name);\n\tif (entry) {\n\t\t// Walk up from .../src/index.js to the package root\n\t\treturn path.dirname(path.dirname(entry));\n\t}\n}\n\nexport { get_compiler_dir_for_file as getRippleDirForFile };\n\n/** Reset module-level state used in tests. */\nexport function _reset_for_test() {\n\tpath2RipplePathMap.clear();\n\tpathToPackageManifestCache.clear();\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8],"mappings":"4pBACA,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,CAC7D,EAAQ,aAAe,EACvB,SAAS,EAAa,EAAQ,EAAa,CACvC,IAAI,EAAM,EACN,EAAO,EAAO,OAAS,EACvB,EACJ,KAAO,GAAO,GAAM,CAChB,IAAM,EAAM,KAAK,OAAO,EAAM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